bundle.js 797 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918
  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 baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. 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'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. 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, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class UIBox extends UIBase {
  1062. constructor() {
  1063. super();
  1064. this.boxNum = 0;
  1065. this.boxMax = 10;
  1066. this.inAd = false;
  1067. this.isClose = false;
  1068. }
  1069. onConstructor() {
  1070. this.ui = ui_UIBox.createInstance();
  1071. this.contentPane = this.ui;
  1072. this.isEject = false;
  1073. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1074. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1075. Laya.timer.loop(1000, this, this.update);
  1076. }
  1077. update() {
  1078. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1079. this.boxNum -= 1;
  1080. this.upBar();
  1081. }
  1082. }
  1083. upBar() {
  1084. if (this.boxNum > this.boxMax)
  1085. this.boxNum = this.boxMax;
  1086. this.ui.bar.value = this.boxNum * 10;
  1087. }
  1088. show() {
  1089. super.show();
  1090. this.isClose = false;
  1091. this.boxNum = 0;
  1092. this.inAd = false;
  1093. this.upBar();
  1094. this.ui.t0.play();
  1095. this.ui.closeBtn.visible = false;
  1096. Laya.timer.once(3000, this, () => {
  1097. this.ui.closeBtn.visible = true;
  1098. this.ui.bar.alpha = 1;
  1099. });
  1100. Laya.timer.once(500, this, () => {
  1101. this.ui.t1.play();
  1102. });
  1103. }
  1104. hide() {
  1105. Laya.timer.clearAll(this);
  1106. Moyu.showBannerAd(false);
  1107. super.hide();
  1108. }
  1109. onOpenBox() {
  1110. this.boxNum++;
  1111. if (this.boxNum < this.boxMax) {
  1112. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1113. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1114. }
  1115. else if (this.boxNum == this.boxMax) {
  1116. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1117. this.ui.openBtn.c1.selectedIndex = 13;
  1118. this.inAd = true;
  1119. }
  1120. else
  1121. this.getAward();
  1122. }
  1123. else if (this.inAd) {
  1124. Moyu.showVideoAd(() => {
  1125. this.getAward();
  1126. }, EAdType.box);
  1127. }
  1128. this.upBar();
  1129. }
  1130. onCloseBox() {
  1131. if (this.isClose)
  1132. this.hide();
  1133. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1134. this.isClose = true;
  1135. PlatMgr.showBanner(true, 0, 3000);
  1136. }
  1137. else
  1138. this.hide();
  1139. }
  1140. getAward() {
  1141. let str = "";
  1142. if (Math.random() < 0.5) {
  1143. let max = Moyu.isLegal ? 500 : 2500;
  1144. let num = xGame.tools.random(max, 500 + max);
  1145. DataMgr.setCoin(num);
  1146. str = "金币x" + num;
  1147. }
  1148. else {
  1149. let max = Moyu.isLegal ? 10 : 30;
  1150. let num = xGame.tools.random(max, 30 + max);
  1151. DataMgr.setDiamond(num);
  1152. str = "钻石x" + num;
  1153. }
  1154. xGame.showTip("恭喜获得-" + str);
  1155. this.hide();
  1156. }
  1157. }
  1158. UIBox.uiName = "UIBox";
  1159. class ui_UITry extends fgui.GComponent {
  1160. static createInstance() {
  1161. return (fgui.UIPackage.createObject("game", "UITry"));
  1162. }
  1163. onConstruct() {
  1164. this.n11 = (this.getChild("n11"));
  1165. this.myNode = (this.getChild("myNode"));
  1166. this.t0 = this.getTransition("t0");
  1167. }
  1168. }
  1169. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1170. class UITry extends UIBase {
  1171. constructor() {
  1172. super();
  1173. this.closeTime = 0;
  1174. this.closeNum = 0;
  1175. this.skillUrl = xGame.common.skillIconList;
  1176. }
  1177. onConstructor() {
  1178. this.ui = ui_UITry.createInstance();
  1179. this.contentPane = this.ui;
  1180. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1181. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1182. }
  1183. show() {
  1184. super.show();
  1185. this.closeNum = 0;
  1186. this.closeTime = 15;
  1187. this.ui.t0.play();
  1188. PlatMgr.showRateBanner();
  1189. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1190. Laya.timer.loop(1000, this, this.updateTime);
  1191. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1192. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1193. xGame.common.gameMgr.gamePause = true;
  1194. }
  1195. updateTime() {
  1196. if (this.closeTime > 1) {
  1197. this.closeTime--;
  1198. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1199. }
  1200. else
  1201. this.hide();
  1202. }
  1203. hide() {
  1204. Laya.timer.clearAll(this);
  1205. Moyu.showBannerAd(false);
  1206. super.hide();
  1207. xGame.common.gameMgr.gamePause = false;
  1208. }
  1209. onTry() {
  1210. Moyu.showVideoAd(() => {
  1211. let select = xGame.common.curPlayerSkillType;
  1212. DataMgr.gameData.trySkill = select;
  1213. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1214. DataMgr.saveGameData();
  1215. DataMgr.setBigSkill(select, 1);
  1216. xGame.showTip("Trial Successful");
  1217. this.hide();
  1218. }, EAdType.try);
  1219. }
  1220. onCancel() {
  1221. if (this.closeNum > 0) {
  1222. this.closeNum--;
  1223. if (this.closeNum < 2)
  1224. this.hide();
  1225. return;
  1226. }
  1227. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1228. this.onTry();
  1229. }
  1230. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1231. this.closeNum = 3;
  1232. }
  1233. else
  1234. this.hide();
  1235. }
  1236. }
  1237. UITry.uiName = "UITry";
  1238. class PlatMgr {
  1239. static initConfig() {
  1240. this.lastVt = 0;
  1241. if (!Moyu.platConfig)
  1242. return;
  1243. for (let k in Moyu.platConfig) {
  1244. let pd = this[k];
  1245. let pc = Moyu.platConfig[k];
  1246. if (pd != undefined && pc != undefined)
  1247. this[k] = pc;
  1248. }
  1249. Moyu.setBannerPos(0.5, 1);
  1250. }
  1251. static rand100(num) {
  1252. return xGame.tools.random(0, 100) < num;
  1253. }
  1254. static isMisVideo() {
  1255. let dt = Laya.timer.currTimer - this.lastVt;
  1256. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1257. this.lastVt = Laya.timer.currTimer;
  1258. return true;
  1259. }
  1260. else {
  1261. if (this.rand100(this.fullVideoRate))
  1262. Moyu.showInsertAd(0, 0, 'full');
  1263. return false;
  1264. }
  1265. }
  1266. static showVideo(call, type) {
  1267. Moyu.showVideoAd(() => {
  1268. this.lastVt = Laya.timer.currTimer;
  1269. call && call();
  1270. }, type);
  1271. }
  1272. static showInsert(delay = false) {
  1273. if (this.getRand() < this.insertRate) {
  1274. let dt = delay ? this.insertDelay : 0;
  1275. Moyu.showInsertAd(dt, this.insertGap);
  1276. }
  1277. }
  1278. static gameInsert() {
  1279. if (this.getRand() < this.gameInsertRate) {
  1280. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1281. }
  1282. }
  1283. static showRateBanner() {
  1284. if (this.getRand() < this.bannerRate)
  1285. this.showBanner(true, this.bannerDelay, 3000);
  1286. }
  1287. static showBanner(show, delay = 0, hide = 0) {
  1288. if (!show)
  1289. Moyu.showBannerAd(false);
  1290. else {
  1291. Laya.timer.clear(this, this.bannerShow);
  1292. if (delay > 0)
  1293. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1294. else
  1295. this.bannerShow(true);
  1296. if (hide > 0)
  1297. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1298. }
  1299. }
  1300. static bannerShow(show) {
  1301. Moyu.showBannerAd(show);
  1302. console.log("showBanner" + show);
  1303. }
  1304. static getRand() {
  1305. return xGame.tools.random(0, 100);
  1306. }
  1307. static openBox() {
  1308. if (this.getRand() < this.boxRate)
  1309. xGame.uiMgr.Show(UIBox);
  1310. }
  1311. static openTry() {
  1312. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1313. return;
  1314. if (this.getRand() < this.tryRate)
  1315. xGame.uiMgr.Show(UITry);
  1316. else if (DataMgr.gameData.gameCount == 1)
  1317. xGame.uiMgr.Show(UITry);
  1318. }
  1319. }
  1320. PlatMgr.forceShare = 0;
  1321. PlatMgr.signAdRate = 0;
  1322. PlatMgr.forceVideoRate = 0;
  1323. PlatMgr.forceVideoGap = 0;
  1324. PlatMgr.fullVideoRate = 0;
  1325. PlatMgr.gameInsertRate = 0;
  1326. PlatMgr.insertGap = 0;
  1327. PlatMgr.insertDelay = 0;
  1328. PlatMgr.insertRate = 0;
  1329. PlatMgr.boxRate = 0;
  1330. PlatMgr.boxVideoRate = 0;
  1331. PlatMgr.boxInsertRate = 0;
  1332. PlatMgr.boxBannerRate = 0;
  1333. PlatMgr.tryRate = 0;
  1334. PlatMgr.tryClose3Rate = 0;
  1335. PlatMgr.tryVideoRate = 0;
  1336. PlatMgr.bannerRate = 0;
  1337. PlatMgr.lastVt = 0;
  1338. class ui_UIAddProp extends fgui.GComponent {
  1339. static createInstance() {
  1340. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1341. }
  1342. onConstruct() {
  1343. this.n11 = (this.getChild("n11"));
  1344. this.myNode = (this.getChild("myNode"));
  1345. this.closeBtn = (this.getChild("closeBtn"));
  1346. this.t0 = this.getTransition("t0");
  1347. }
  1348. }
  1349. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1350. class SpineMgr {
  1351. constructor(name, loadCb = null) {
  1352. this.loaded = false;
  1353. this.spineName = '';
  1354. this.loadedCallback = loadCb;
  1355. this.templet = new Laya.Templet();
  1356. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1357. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1358. if (name === 'mishu') {
  1359. this.templet.loadAni('spine/mishu.sk');
  1360. }
  1361. else {
  1362. this.templet.loadAni(`spine/${name}.sk`);
  1363. }
  1364. this.templet.lock = true;
  1365. this.spineName = name;
  1366. }
  1367. onError() {
  1368. console.log("spine加载出错");
  1369. }
  1370. parseComplete() {
  1371. this.loaded = true;
  1372. this.loadedCallback && this.loadedCallback();
  1373. }
  1374. dispose() {
  1375. if (this.templet && !this.templet.destroyed) {
  1376. this.templet.destroy();
  1377. }
  1378. this.templet = null;
  1379. }
  1380. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1381. if (!this.loaded) {
  1382. return;
  1383. }
  1384. let spine;
  1385. if (mySpine) {
  1386. spine = mySpine;
  1387. }
  1388. else {
  1389. spine = this.createSpine(data, parent);
  1390. }
  1391. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1392. if (!isLoop) {
  1393. spine.on(Laya.Event.STOPPED, this, () => {
  1394. spine.offAll(Laya.Event.STOPPED);
  1395. callback && callback(spine);
  1396. });
  1397. }
  1398. return spine;
  1399. }
  1400. createSpine(data, parent, type = 1) {
  1401. let spine;
  1402. spine = this.templet.buildArmature(type);
  1403. spine.showSkinByIndex(0);
  1404. parent.addChild(spine);
  1405. spine.pos(data.x, data.y);
  1406. spine.scale(data.scaleX, data.scaleY, true);
  1407. return spine;
  1408. }
  1409. }
  1410. var AIState;
  1411. (function (AIState) {
  1412. AIState[AIState["none"] = 0] = "none";
  1413. AIState[AIState["idle"] = 1] = "idle";
  1414. AIState[AIState["reset"] = 2] = "reset";
  1415. AIState[AIState["move"] = 3] = "move";
  1416. AIState[AIState["wait"] = 4] = "wait";
  1417. AIState[AIState["select"] = 5] = "select";
  1418. AIState[AIState["turn"] = 6] = "turn";
  1419. AIState[AIState["shoot"] = 7] = "shoot";
  1420. AIState[AIState["leave"] = 8] = "leave";
  1421. })(AIState || (AIState = {}));
  1422. class AIPlayer {
  1423. constructor() {
  1424. this.dtime = 30;
  1425. this.awayTime = 0;
  1426. this.awayNum = 0;
  1427. this.hideTime = 0;
  1428. this.rootMoveTime = 0;
  1429. this.isGuide = false;
  1430. this.state = AIState.none;
  1431. this.waitTime = 0;
  1432. this.forceNum = 0;
  1433. this.forceMax = 0;
  1434. this.ballSize = 33;
  1435. this.selectNum = 0;
  1436. this.destRot = 0;
  1437. this.aiLv = 10;
  1438. this.kickBall = [];
  1439. this.lineBall = [];
  1440. this.scoreBall = [];
  1441. this.holeBall = [];
  1442. this.turnNum = 0;
  1443. this.setNum = 0;
  1444. this.setMax = 0;
  1445. this.setRate = 0;
  1446. this.rectL = 0;
  1447. this.rectR = 0;
  1448. this.rectT = 0;
  1449. this.rectB = 0;
  1450. this.rootPos = { x: 0, y: 0 };
  1451. this.bestForce = 0;
  1452. this.bestAngle = 180;
  1453. this.bestPos = { x: 0, y: 0 };
  1454. this.bestKick = { x: 0, y: 0 };
  1455. this.posList = [];
  1456. this.posIdx = 0;
  1457. this.chatTime = 3000;
  1458. this.tempDir1 = new Laya.Vector2();
  1459. this.tempDir2 = new Laya.Vector2();
  1460. this.tempDir3 = new Laya.Vector2();
  1461. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1462. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1463. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1464. this.gameSrc = xGame.common.gameUI;
  1465. this.hideTime = Laya.timer.currTimer;
  1466. Moyu.setOnTipCall((id) => {
  1467. if (id == 20012)
  1468. this.hideTime = Laya.timer.currTimer;
  1469. else
  1470. (id == 20011);
  1471. {
  1472. let dt = Laya.timer.currTimer - this.hideTime;
  1473. console.log("onshow" + dt);
  1474. if (dt > 30000 && this.state > AIState.none)
  1475. xGame.common.gameMgr.aiGameEnd(false);
  1476. }
  1477. }, this);
  1478. }
  1479. init() {
  1480. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1481. this.awayTime = xGame.tools.random(5000, 10000);
  1482. this.awayNum = 0;
  1483. this.hideTime = Laya.timer.currTimer;
  1484. let rect = xGame.common.d2World.borderRect;
  1485. this.rectL = Math.ceil(rect.x) + 17;
  1486. this.rectT = Math.ceil(rect.y) + 17;
  1487. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1488. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1489. this.wBall = xGame.common.d2World.rootBall;
  1490. this.ballSize = this.wBall.gameObj.width - 1;
  1491. if (this.posList.length < 1) {
  1492. let dp = 40;
  1493. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1494. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1495. let dx = i < this.rectR ? i : this.rectR;
  1496. let dy = j < this.rectB ? j : this.rectB;
  1497. let order = xGame.tools.random(0, 1000);
  1498. this.posList.push({ x: dx, y: dy, order: order });
  1499. }
  1500. }
  1501. this.posList.sort(function (a, b) {
  1502. return a.order - b.order;
  1503. });
  1504. this.setMax = this.posList.length;
  1505. }
  1506. this.state = AIState.idle;
  1507. }
  1508. setAiLevel(num) {
  1509. this.aiLv = num;
  1510. }
  1511. initBall() {
  1512. this.rootPos.x = this.wBall.gameObj.x;
  1513. this.rootPos.y = this.wBall.gameObj.y;
  1514. this.initHoleBall();
  1515. }
  1516. initHoleBall() {
  1517. this.kickBall = [];
  1518. this.lineBall = [];
  1519. this.scoreBall = [];
  1520. this.holeBall = [];
  1521. this.selectNum = 0;
  1522. this.forceNum = 0;
  1523. this.forceMax = 0;
  1524. this.turnNum = 0;
  1525. let list = xGame.common.d2World.ballArr;
  1526. if (list.length < 20 && !this.isGuide) {
  1527. let holes = xGame.common.gameMgr.holePosList;
  1528. for (let i = 0; i < list.length; i++) {
  1529. let obj = list[i];
  1530. if (!obj)
  1531. continue;
  1532. obj.kickPos.x = 0;
  1533. obj.kickPos.y = 0;
  1534. obj.poleAngle = 0;
  1535. obj.hard = 0;
  1536. obj.borderDis = 0;
  1537. obj.kickAngle = 180;
  1538. if (obj.number == 0)
  1539. continue;
  1540. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1541. continue;
  1542. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1543. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1544. continue;
  1545. }
  1546. let b = obj.gameObj;
  1547. let wbp = this.rootPos;
  1548. let bx = wbp.x - b.x;
  1549. let by = wbp.y - b.y;
  1550. obj.borderDis = xGame.tools.random(0, 100);
  1551. this.kickBall.push(obj);
  1552. if (!this.isLine(wbp, obj))
  1553. continue;
  1554. obj.kickAngle = xGame.tools.random(90, 180);
  1555. obj.kickPos.x = b.x;
  1556. obj.kickPos.y = b.y;
  1557. this.lineBall.push(obj);
  1558. let minDis = 999999;
  1559. let hole = false;
  1560. for (let j = 0; j < holes.length; j++) {
  1561. let hp = holes[j];
  1562. if (bx >= 0 && hp.x > b.x + 100)
  1563. continue;
  1564. if (bx <= 0 && hp.x < b.x - 100)
  1565. continue;
  1566. if (by < -10 && hp.y < wbp.y)
  1567. continue;
  1568. if (by > 10 && hp.y > wbp.y)
  1569. continue;
  1570. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1571. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1572. if (dis < minDis) {
  1573. let dx = b.x - this.tempDir1.x * this.ballSize;
  1574. let dy = b.y - this.tempDir1.y * this.ballSize;
  1575. this.tempDir3.x = this.tempDir1.x;
  1576. this.tempDir3.y = this.tempDir1.y;
  1577. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1578. obj.kickPos.x = dx;
  1579. obj.kickPos.y = dy;
  1580. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1581. if (num > 1)
  1582. num = 1;
  1583. obj.kickAngle = Math.acos(num) * 57.3;
  1584. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1585. dis = dis * 2;
  1586. if (Math.abs(hp.x - 600) < 100)
  1587. dis += 50;
  1588. obj.hard = dis + obj.kickAngle * 3;
  1589. hole = true;
  1590. }
  1591. }
  1592. }
  1593. }
  1594. if (hole) {
  1595. this.scoreBall.push(obj);
  1596. this.holeBall.push(obj);
  1597. }
  1598. }
  1599. this.scoreBall.sort(function (a, b) {
  1600. return a.hard - b.hard;
  1601. });
  1602. this.holeBall.sort(function (a, b) {
  1603. return a.kickAngle - b.kickAngle;
  1604. });
  1605. this.kickBall.sort(function (a, b) {
  1606. return a.borderDis - b.borderDis;
  1607. });
  1608. }
  1609. else {
  1610. let max = list.length - 1;
  1611. let i = xGame.tools.random(0, max);
  1612. for (i; i <= max; i++) {
  1613. let idx = i >= max ? i -= max : i;
  1614. let obj = list[idx];
  1615. if (obj && obj.number != 0) {
  1616. obj.kickAngle = xGame.tools.random(90, 180);
  1617. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1618. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1619. this.lineBall.push(obj);
  1620. break;
  1621. }
  1622. }
  1623. }
  1624. }
  1625. selectBall() {
  1626. let ball = null;
  1627. this.destRot = 0;
  1628. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1629. let ai = 110 - this.aiLv * 10;
  1630. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1631. let score = false;
  1632. if (this.scoreBall.length < 1) {
  1633. if (this.lineBall.length < 1) {
  1634. for (let i = 0; i < this.kickBall.length; i++) {
  1635. let list = [];
  1636. let bo = this.kickBall[i];
  1637. let bobj = bo.gameObj;
  1638. let rect = xGame.common.d2World.borderRect;
  1639. let mobj = this.wBall.gameObj;
  1640. let minb = bobj.y - rect.y - 20;
  1641. let minw = mobj.y - rect.y - 50;
  1642. if (minb > 0 && minw > 0) {
  1643. let dlenx = 0;
  1644. let dleny = mobj.y - rect.y;
  1645. let spx = mobj.x;
  1646. let spy = rect.y - dleny;
  1647. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1648. }
  1649. minb = rect.y + rect.height - bobj.y - 20;
  1650. minw = rect.y + rect.height - mobj.y - 50;
  1651. if (minb > 0 && minw > 0) {
  1652. let dlenx = 0;
  1653. let dleny = rect.y + rect.height - mobj.y;
  1654. let spx = mobj.x;
  1655. let spy = rect.y + rect.height + dleny;
  1656. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1657. }
  1658. minb = bobj.x - rect.x - 20;
  1659. minw = mobj.x - rect.x - 50;
  1660. if (minb > 0 && minw > 0) {
  1661. let dlenx = mobj.x - rect.x;
  1662. let dleny = 0;
  1663. let spx = rect.x - dlenx;
  1664. let spy = mobj.y;
  1665. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1666. }
  1667. minb = rect.x + rect.width - bobj.x - 20;
  1668. minw = rect.x + rect.width - mobj.x - 50;
  1669. if (minb > 0 && minw > 0) {
  1670. let dlenx = rect.x + rect.width - mobj.x;
  1671. let dleny = 0;
  1672. let spx = rect.x + rect.width + dlenx;
  1673. let spy = mobj.y;
  1674. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1675. }
  1676. list.sort(function (a, b) {
  1677. return a.order - b.order;
  1678. });
  1679. for (let i = 0; i < list.length; i++) {
  1680. let data = list[i];
  1681. let mx = mobj.x - bobj.x;
  1682. let my = mobj.y - bobj.y;
  1683. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1684. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1685. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1686. if (num > 1)
  1687. num = 1;
  1688. let cos = Math.acos(num);
  1689. if (cos > 1.57)
  1690. cos = 1.57;
  1691. else if (cos < 0.01)
  1692. cos = 0.01;
  1693. let tan = Math.tan(cos);
  1694. let dx = tan * data.dleny;
  1695. let dy = tan * data.dlenx;
  1696. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1697. if (Math.abs(bx - 667) < 40)
  1698. continue;
  1699. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1700. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1701. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1702. this.forceMax = dis * 0.08;
  1703. this.destRot += mis * 0.1;
  1704. this.setKick(bx, by);
  1705. return true;
  1706. }
  1707. }
  1708. }
  1709. }
  1710. else {
  1711. ball = xGame.common.getRandArrEle(this.lineBall);
  1712. }
  1713. }
  1714. else {
  1715. for (let i = 0; i < this.scoreBall.length; i++) {
  1716. if (i < this.scoreBall.length - 1) {
  1717. let rand = 70 + this.aiLv * 10 + i * 10;
  1718. if (xGame.tools.random(0, 100) < rand) {
  1719. ball = this.scoreBall[i];
  1720. break;
  1721. }
  1722. }
  1723. else {
  1724. ball = this.scoreBall[i];
  1725. break;
  1726. }
  1727. }
  1728. score = true;
  1729. this.selectNum++;
  1730. }
  1731. if (!ball)
  1732. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1733. if (this.selectNum >= max) {
  1734. let dx = ball.gameObj.x;
  1735. let dy = ball.gameObj.y;
  1736. let kickAngle = 0;
  1737. if (score) {
  1738. dx = ball.kickPos.x;
  1739. dy = ball.kickPos.y;
  1740. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1741. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1742. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1743. if (adot > 1)
  1744. adot = 1;
  1745. kickAngle = Math.acos(adot) * 57.3;
  1746. if (kickAngle > 45) {
  1747. let kdx = ball.kickPos.x - ball.gameObj.x;
  1748. let kdy = ball.kickPos.y - ball.gameObj.y;
  1749. dx = ball.kickPos.x - kdx * mis * 0.3;
  1750. dy = ball.kickPos.y - kdy * mis * 0.3;
  1751. }
  1752. else
  1753. this.destRot += mis;
  1754. }
  1755. else if (ball.poleAngle != 0) {
  1756. this.destRot += ball.poleAngle;
  1757. }
  1758. if (xGame.common.gameMode == 0) {
  1759. let af = kickAngle * 0.08;
  1760. this.forceMax = ball.hard * 0.1 + af * af;
  1761. }
  1762. this.setKick(dx, dy);
  1763. }
  1764. else {
  1765. let rand = this.aiLv * 5 + 40;
  1766. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1767. ball = xGame.common.getRandArrEle(this.scoreBall);
  1768. else
  1769. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1770. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1771. if (xGame.tools.random(0, 100) > rand) {
  1772. this.selectNum = max;
  1773. }
  1774. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1775. this.selectNum++;
  1776. }
  1777. ball.onClick(0, true);
  1778. }
  1779. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1780. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1781. let balls = xGame.common.d2World.ballArr;
  1782. let max = xGame.tools.getDis(hx, hy, bx, by);
  1783. for (let index = 0; index < balls.length; index++) {
  1784. let obj = balls[index];
  1785. if (obj.number == 0)
  1786. continue;
  1787. if (obj.number == bn || obj.number == dn)
  1788. continue;
  1789. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1790. if (dis * dis > max)
  1791. continue;
  1792. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1793. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1794. if (num > 1)
  1795. num = 1;
  1796. if (num < 0)
  1797. continue;
  1798. let gap = Math.sin(Math.acos(num)) * dis;
  1799. if (gap < this.ballSize)
  1800. return true;
  1801. }
  1802. return false;
  1803. }
  1804. isLine(xy, ball) {
  1805. let bx = xy.x;
  1806. let by = xy.y;
  1807. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1808. let dis = ball.getDestDis(xy);
  1809. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1810. let sin = Math.sin(angle);
  1811. let cos = Math.cos(angle);
  1812. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1813. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1814. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1815. let dx = bx + this.tempDir2.x * dis;
  1816. let dy = by + this.tempDir2.y * dis;
  1817. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1818. sin = Math.sin(-angle);
  1819. cos = Math.cos(-angle);
  1820. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1821. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1822. dx = bx + this.tempDir2.x * dis;
  1823. dy = by + this.tempDir2.y * dis;
  1824. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1825. if (isr && isl)
  1826. return false;
  1827. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1828. }
  1829. return true;
  1830. }
  1831. turnPole() {
  1832. this.turnNum++;
  1833. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1834. let dr = rot - this.destRot;
  1835. let abs = Math.abs(dr) % 360;
  1836. if (abs > 180) {
  1837. if (rot > 180)
  1838. rot -= 360;
  1839. if (this.destRot > 180)
  1840. this.destRot -= 360;
  1841. }
  1842. let max = this.turnNum * 5 + this.aiLv * 5;
  1843. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  1844. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  1845. let at = xGame.tools.random(1000, 2000);
  1846. if (!this.onAway(3))
  1847. at += xGame.tools.random(10000, 15000);
  1848. this.setState(AIState.shoot, at);
  1849. }
  1850. else {
  1851. let mr = 0;
  1852. if (abs > 3)
  1853. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  1854. else if (Math.random() > 0.6)
  1855. mr = xGame.tools.random(1, 10) * 0.1;
  1856. mr = dr > 0 ? -mr : mr;
  1857. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  1858. }
  1859. }
  1860. setKick(dx, dy) {
  1861. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  1862. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1863. this.tempDir1.x = 0;
  1864. this.tempDir1.y = 1;
  1865. this.tempDir2.y = -this.tempDir2.y;
  1866. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1867. if (num > 1)
  1868. num = 1;
  1869. let rot = Math.acos(num) * 57.3;
  1870. if (this.tempDir2.x < 0)
  1871. rot = 360 - rot;
  1872. this.destRot += rot;
  1873. if (!xGame.common.gameMgr.finishOneShoot) {
  1874. this.forceMax += xGame.tools.random(10, 50);
  1875. this.forceMax -= this.aiLv * 2;
  1876. if (this.forceMax < 20)
  1877. this.forceMax = 20;
  1878. }
  1879. if (this.forceMax > 100)
  1880. this.forceMax = 101;
  1881. else if (this.forceMax < 10)
  1882. this.forceMax += xGame.tools.random(0, 10);
  1883. if (xGame.common.gameMode == 1)
  1884. this.forceMax = xGame.tools.random(80, 100);
  1885. else
  1886. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  1887. let max = 2000 - this.aiLv * 100;
  1888. if (Math.random() > 0.8)
  1889. max += xGame.tools.random(100, 2000);
  1890. this.setState(AIState.turn, xGame.tools.random(500, max));
  1891. }
  1892. shoot() {
  1893. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  1894. if (Math.random() > 0.8) {
  1895. this.gameSrc.aiForce(1);
  1896. this.setState(AIState.wait);
  1897. }
  1898. }
  1899. else {
  1900. let df = xGame.tools.random(3, 8);
  1901. if (this.forceNum < this.forceMax)
  1902. this.forceNum += df;
  1903. else
  1904. this.forceNum -= df;
  1905. let startY = this.gameSrc.ui.powerNode.y;
  1906. let height = this.gameSrc.ui.powerNode.height;
  1907. let force = startY + height * this.forceNum * 0.01;
  1908. this.gameSrc.aiForce(2, force);
  1909. }
  1910. }
  1911. reset() {
  1912. for (let i = 0; i < 4; i++) {
  1913. this.setRate--;
  1914. this.setNum++;
  1915. let pos = this.posList[this.posIdx];
  1916. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  1917. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  1918. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  1919. this.rootPos.x = 387;
  1920. if (this.rootPos.x < this.rectL)
  1921. this.rootPos.x = this.rectL;
  1922. else if (this.rootPos.x > this.rectR)
  1923. this.rootPos.x = this.rectR;
  1924. if (this.rootPos.y < this.rectT)
  1925. this.rootPos.y = this.rectT;
  1926. else if (this.rootPos.y > this.rectB)
  1927. this.rootPos.y = this.rectB;
  1928. this.posIdx++;
  1929. let max = this.posList.length;
  1930. if (this.posIdx >= max)
  1931. this.posIdx -= max;
  1932. this.initHoleBall();
  1933. let ball = null;
  1934. if (this.scoreBall.length > 0)
  1935. ball = this.scoreBall[0];
  1936. else if (this.lineBall.length > 0)
  1937. ball = xGame.common.getRandArrEle(this.lineBall);
  1938. if (ball && ball.kickAngle < this.bestAngle) {
  1939. this.bestAngle = ball.kickAngle;
  1940. this.bestKick.x = ball.kickPos.x;
  1941. this.bestKick.y = ball.kickPos.y;
  1942. this.bestPos.x = this.rootPos.x;
  1943. this.bestPos.y = this.rootPos.y;
  1944. this.bestForce = ball.hard * 0.08;
  1945. }
  1946. }
  1947. if (this.setNum >= this.setMax)
  1948. this.setMax = 0;
  1949. if (this.setRate < 1) {
  1950. this.setState(AIState.move, 0);
  1951. this.rootMoveTime = Laya.timer.currTimer;
  1952. this.gameSrc.aiRootMove(true);
  1953. }
  1954. }
  1955. delayLine() {
  1956. this.gameSrc.aiRootMove(false);
  1957. }
  1958. move() {
  1959. if (this.bestPos.x < 1)
  1960. this.bestPos = this.rootPos;
  1961. let wObj = this.wBall.gameObj;
  1962. let destx = wObj.x;
  1963. let desty = wObj.y;
  1964. let dx = Math.abs(destx - this.bestPos.x);
  1965. let dy = Math.abs(desty - this.bestPos.y);
  1966. let mx = 3 + dx * 0.03;
  1967. let my = 3 + dy * 0.03;
  1968. if (dx < 4 && dy < 4) {
  1969. let dt = Laya.timer.currTimer - this.rootMoveTime;
  1970. dt = dt < 1000 ? 1000 - dt : 0;
  1971. if (this.setMax > 0) {
  1972. let min = this.setMax * 0.3 + this.aiLv * 5;
  1973. this.setRate = xGame.tools.random(min, this.setMax);
  1974. this.setState(AIState.reset, 0);
  1975. }
  1976. else {
  1977. this.destRot = 0;
  1978. this.forceMax = this.bestForce;
  1979. this.setKick(this.bestKick.x, this.bestKick.y);
  1980. }
  1981. if (dt > 100) {
  1982. Laya.timer.clear(this, this.delayLine);
  1983. Laya.timer.once(dt, this, this.delayLine);
  1984. }
  1985. else
  1986. this.gameSrc.aiRootMove(false);
  1987. }
  1988. else {
  1989. if (dx > 4)
  1990. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  1991. if (dy > 4)
  1992. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  1993. this.gameSrc.onRootMove({ x: destx, y: desty });
  1994. }
  1995. }
  1996. resetRoot() {
  1997. this.bestAngle = 180;
  1998. this.bestForce = 0;
  1999. this.setMax = this.posList.length;
  2000. this.posIdx = xGame.tools.random(0, this.setMax);
  2001. let min = this.setMax * 0.3 + this.aiLv * 5;
  2002. this.setRate = xGame.tools.random(min, this.setMax);
  2003. let max = 2000 - this.aiLv * 100;
  2004. if (Math.random() > 0.8)
  2005. max += xGame.tools.random(100, 1000);
  2006. if (this.isGuide)
  2007. this.setState(AIState.select, 500);
  2008. else if (this.onAway(2))
  2009. this.setState(AIState.reset, xGame.tools.random(400, max));
  2010. else
  2011. this.setState(AIState.none);
  2012. if (xGame.common.gameMgr.finishOneShoot)
  2013. this.chat();
  2014. }
  2015. runAI() {
  2016. if (this.state > AIState.idle)
  2017. return;
  2018. this.initBall();
  2019. this.onGame(2500);
  2020. if (Math.random() > 0.6)
  2021. this.chat();
  2022. }
  2023. stopRun() {
  2024. this.setState(AIState.idle);
  2025. }
  2026. onGame(base) {
  2027. let max = base - this.aiLv * 100;
  2028. if (Math.random() > 0.8)
  2029. max += xGame.tools.random(100, 1000);
  2030. if (this.onAway(2))
  2031. this.setState(AIState.select, xGame.tools.random(500, max));
  2032. else
  2033. this.setState(AIState.none);
  2034. }
  2035. setState(sta, wt = 0) {
  2036. if (this.state == AIState.none)
  2037. return;
  2038. this.state = sta;
  2039. this.waitTime = wt;
  2040. }
  2041. onUpdate() {
  2042. if (this.state == AIState.none)
  2043. return;
  2044. this.awayTime -= this.dtime;
  2045. if (this.awayTime < 1) {
  2046. this.awayTime = xGame.tools.random(6000, 10000);
  2047. this.awayNum += (11 - this.aiLv);
  2048. this.onAway(1);
  2049. }
  2050. if (this.waitTime >= 0) {
  2051. this.waitTime -= this.dtime;
  2052. return;
  2053. }
  2054. switch (this.state) {
  2055. case AIState.idle:
  2056. this.chat();
  2057. break;
  2058. case AIState.reset:
  2059. this.reset();
  2060. break;
  2061. case AIState.move:
  2062. this.move();
  2063. break;
  2064. case AIState.leave:
  2065. this.state = AIState.none;
  2066. xGame.common.gameMgr.aiGameEnd(true);
  2067. break;
  2068. case AIState.select:
  2069. this.selectBall();
  2070. break;
  2071. case AIState.turn:
  2072. this.turnPole();
  2073. break;
  2074. case AIState.shoot:
  2075. this.shoot();
  2076. break;
  2077. }
  2078. }
  2079. onAway(type) {
  2080. if (type == 1) {
  2081. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2082. let num = this.awayNum + db * 20;
  2083. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2084. xGame.common.gameMgr.aiLeave();
  2085. this.setState(AIState.leave, 6666);
  2086. }
  2087. }
  2088. else if (type == 2) {
  2089. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2090. let num = this.awayNum + db * 30;
  2091. if (xGame.tools.random(0, 10000) < num)
  2092. return false;
  2093. }
  2094. else if (type == 3) {
  2095. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2096. let num = this.awayNum + db * 10;
  2097. if (xGame.tools.random(0, 4000) < num)
  2098. return false;
  2099. }
  2100. return true;
  2101. }
  2102. chat() {
  2103. if (this.chatTime > 0) {
  2104. this.chatTime -= this.dtime;
  2105. return;
  2106. }
  2107. this.chatTime = xGame.tools.random(2000, 10000);
  2108. let rand = xGame.tools.random(0, 100);
  2109. if (rand < 15)
  2110. this.talk();
  2111. else if (rand < 35)
  2112. this.emotion();
  2113. }
  2114. talk() {
  2115. xGame.common.talkMgr.showAITalk(0);
  2116. }
  2117. emotion() {
  2118. xGame.common.talkMgr.showAIEmotion(0);
  2119. }
  2120. resetAI() {
  2121. this.stopRun();
  2122. this.state = AIState.none;
  2123. }
  2124. }
  2125. class Partical extends Laya.Script3D {
  2126. constructor() {
  2127. super();
  2128. this.duration = 2000;
  2129. }
  2130. ;
  2131. onAwake() {
  2132. this.gameObj = this.owner;
  2133. }
  2134. onEnable() {
  2135. this.openTimer();
  2136. }
  2137. openTimer() {
  2138. Laya.timer.once(this.duration, this, this.disappear);
  2139. }
  2140. setCallback(obj, callback) {
  2141. this.obj = obj;
  2142. this.callback = callback;
  2143. Laya.timer.clearAll(this);
  2144. Laya.timer.once(this.duration, this, this.disappear);
  2145. }
  2146. disappear() {
  2147. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2148. this.callback && this.callback(this.obj);
  2149. }
  2150. }
  2151. class Ball extends Laya.Script3D {
  2152. constructor() {
  2153. super();
  2154. this.posV3 = new Laya.Vector3();
  2155. this.rotRate = 2.1;
  2156. this.rotSpeed = new Laya.Vector3();
  2157. this.myIndex = 0;
  2158. }
  2159. onAwake() {
  2160. this.gameObj = this.owner;
  2161. this.transform = this.gameObj.transform;
  2162. this.ballNode = this.gameObj.getChildByName("Ball");
  2163. this.shadowNode = this.gameObj.getChildByName("shadow");
  2164. }
  2165. initSelf(index, x, y, owner) {
  2166. this.d2BallSrc = owner;
  2167. this.myIndex = index;
  2168. this.setAlbedoTexture();
  2169. this.setTransPos(x, y);
  2170. this.setScale();
  2171. this.ballNode.transform.localRotationEulerX = 90;
  2172. if (index == 0) {
  2173. }
  2174. }
  2175. setAlbedoTexture(isIce = false) {
  2176. let url;
  2177. if (isIce) {
  2178. url = `res/d3Res/ballTexture/ice.jpg`;
  2179. }
  2180. else {
  2181. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2182. }
  2183. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2184. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2185. }));
  2186. }
  2187. runFireworks(obj, delay, callback) {
  2188. Laya.timer.clearAll(this);
  2189. Laya.timer.once(delay + 1, this, () => {
  2190. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2191. fire.transform.localPositionX = this.transform.localPositionX;
  2192. fire.transform.localPositionY = this.transform.localPositionY;
  2193. fire.transform.localPositionZ = this.transform.localPositionZ;
  2194. let src = fire.getComponent(Partical);
  2195. src.duration = 1000;
  2196. src.setCallback(obj, callback);
  2197. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2198. eft.transform.localPositionX = this.transform.localPositionX;
  2199. eft.transform.localPositionY = this.transform.localPositionY;
  2200. eft.transform.localPositionZ = this.transform.localPositionZ;
  2201. });
  2202. }
  2203. setTransPos(x, y) {
  2204. this.setRotation();
  2205. xGame.common.pos2to3Convert(x, y, this.posV3);
  2206. this.transform.localPositionX = this.posV3.x;
  2207. this.transform.localPositionY = 0;
  2208. this.transform.localPositionZ = this.posV3.z;
  2209. this.transform.localRotationEulerX = 0;
  2210. this.transform.localRotationEulerY = 0;
  2211. this.transform.localRotationEulerZ = 0;
  2212. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2213. this.shadowNode.transform.localPositionY = 0.1;
  2214. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2215. }
  2216. setRotation() {
  2217. if (this.d2BallSrc.canRot) {
  2218. let speed = this.d2BallSrc.rigy.linearVelocity;
  2219. this.rotSpeed.x = speed.x * this.rotRate;
  2220. this.rotSpeed.z = speed.y * this.rotRate;
  2221. this.rotSpeed.y = this.d2BallSrc.rotY;
  2222. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2223. }
  2224. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2225. this.rotSpeed.x = this.rotSpeed.y = 0;
  2226. this.rotSpeed.y = this.d2BallSrc.rotY;
  2227. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2228. }
  2229. }
  2230. setScale() {
  2231. let radius = xGame.common.d2World.rootBall.ui.width;
  2232. let scale = xGame.common.scale2to3Convert(radius);
  2233. this.transform.localScaleX = scale;
  2234. this.transform.localScaleY = scale;
  2235. this.transform.localScaleZ = scale;
  2236. }
  2237. playInHoleEft() {
  2238. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2239. eft.transform.position = this.transform.position;
  2240. }
  2241. playIceEft() {
  2242. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2243. eft.transform.position = this.transform.position;
  2244. }
  2245. get scaleXYZ() {
  2246. return this.transform.localScaleX;
  2247. }
  2248. set scaleXYZ(val) {
  2249. this.transform.localScaleX = val;
  2250. this.transform.localScaleY = val;
  2251. this.transform.localScaleZ = val;
  2252. }
  2253. get posX() {
  2254. return this.transform.localPositionX;
  2255. }
  2256. set posX(val) {
  2257. this.transform.localPositionX = val;
  2258. }
  2259. get posY() {
  2260. return this.transform.localPositionY;
  2261. }
  2262. set posY(val) {
  2263. this.transform.localPositionY = val;
  2264. }
  2265. get posZ() {
  2266. return this.transform.localPositionZ;
  2267. }
  2268. set posZ(val) {
  2269. this.transform.localPositionZ = val;
  2270. }
  2271. destroySelf() {
  2272. this.posV3 = null;
  2273. this.rotSpeed = null;
  2274. this.d2BallSrc = null;
  2275. this.ballNode = null;
  2276. this.gameObj.destroy(true);
  2277. this.transform = null;
  2278. this.destroy();
  2279. }
  2280. }
  2281. class ui_D2Ball extends fgui.GComponent {
  2282. static createInstance() {
  2283. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2284. }
  2285. onConstruct() {
  2286. this.myIcon = (this.getChild("myIcon"));
  2287. this.inner = (this.getChild("inner"));
  2288. this.n8 = (this.getChild("n8"));
  2289. this.n4 = (this.getChild("n4"));
  2290. this.wrongTips = (this.getChild("wrongTips"));
  2291. this.rightTips = (this.getChild("rightTips"));
  2292. this.breathAni = this.getTransition("breathAni");
  2293. }
  2294. }
  2295. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2296. class D2BallSrc extends Laya.Script {
  2297. constructor() {
  2298. super();
  2299. this.number = 0;
  2300. this.startX = 0;
  2301. this.startY = 0;
  2302. this.angleV2 = new Laya.Vector2();
  2303. this.isRootBall = false;
  2304. this.isBlackBall = false;
  2305. this.ballType = "";
  2306. this.canRot = true;
  2307. this.rotY = 0;
  2308. this.poleAngle = 0;
  2309. this.kickPos = { x: 0, y: 0 };
  2310. this.hard = 0;
  2311. this.kickAngle = 0;
  2312. this.borderDis = 0;
  2313. this.speedP10 = 5.6;
  2314. this.lastSpeed = { x: 0, y: 0 };
  2315. this.stillSpeed = 0.12;
  2316. this.ballFunc = "normal";
  2317. this.isRunSkillAni = false;
  2318. this.isInHole = false;
  2319. this.iceOwner = "";
  2320. this.forceRun = false;
  2321. this.myUNID = "";
  2322. this.rectL = 0;
  2323. this.rectR = 0;
  2324. this.rectT = 0;
  2325. this.rectB = 0;
  2326. this.forceVec = new Laya.Vector2();
  2327. this.lastDis = 0;
  2328. this.helpOut = { type: "", x: 0, y: 0 };
  2329. }
  2330. initSelf(number, x, y, d3Ball) {
  2331. if (!this.gameObj)
  2332. this.gameObj = this.owner;
  2333. this.number = number;
  2334. this.startX = x;
  2335. this.startY = y;
  2336. this.d3Ball = d3Ball;
  2337. this.isRootBall = false;
  2338. this.isBlackBall = false;
  2339. this.ballType = "";
  2340. if (number == 0) {
  2341. this.isRootBall = true;
  2342. }
  2343. else if (number == 8) {
  2344. this.isBlackBall = true;
  2345. }
  2346. else {
  2347. if (number <= 7) {
  2348. this.ballType = ballCamp.full;
  2349. }
  2350. else {
  2351. this.ballType = ballCamp.flower;
  2352. }
  2353. }
  2354. this.setInfo();
  2355. this.setD3Ball();
  2356. this.owner["mySrc"] = this;
  2357. this.rigy.linearDamping = 1;
  2358. D2BallSrc._unid++;
  2359. this.myUNID = "d2ball" + D2BallSrc._unid;
  2360. let rect = xGame.common.d2World.borderRect;
  2361. this.rectL = Math.ceil(rect.x) + 20;
  2362. this.rectT = Math.ceil(rect.y) + 20;
  2363. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2364. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2365. }
  2366. setInfo() {
  2367. this.gameObj.x = this.startX;
  2368. this.gameObj.y = this.startY;
  2369. let radius = this.ui.width / 2;
  2370. this.gameObj.width = radius * 2;
  2371. this.gameObj.height = radius * 2;
  2372. if (xGame.common.showDebug) {
  2373. this.ui.myIcon.alpha = 1;
  2374. this.ui.inner.alpha = 1;
  2375. }
  2376. else {
  2377. this.ui.myIcon.alpha = 0;
  2378. this.ui.inner.alpha = 0;
  2379. }
  2380. }
  2381. setD3Ball() {
  2382. this.d3Ball = this.d3Ball;
  2383. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2384. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2385. }
  2386. onUpdate() {
  2387. if (xGame.common.gameMgr.gamePause)
  2388. return;
  2389. if (this.isInHole)
  2390. return;
  2391. if (!xGame.common.d2World.openCheckStill)
  2392. return;
  2393. this.runBall();
  2394. }
  2395. runBall() {
  2396. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2397. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2398. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2399. this.judgeBorder();
  2400. }
  2401. getDestDis(dest) {
  2402. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2403. }
  2404. setmyXY(x, y) {
  2405. this.d3BallSrc.setTransPos(x, y);
  2406. }
  2407. getSpeed() {
  2408. let speed = this.rigy.linearVelocity;
  2409. return speed.x * speed.x + speed.y * speed.y;
  2410. }
  2411. onTriggerEnter(collider) {
  2412. if (!collider || !collider.owner)
  2413. return;
  2414. let coll = "collide";
  2415. let speed = this.getSpeed();
  2416. let sv2 = this.speedP10 * this.speedP10;
  2417. if (collider.label == "ball") {
  2418. if (speed < 9 && this.number != 0)
  2419. coll = "";
  2420. else if (speed < sv2)
  2421. coll = "collide_4";
  2422. else if (speed < sv2 * 6.2)
  2423. coll = "collide_3";
  2424. else if (speed < sv2 * 25)
  2425. coll = "collide_2";
  2426. else if (speed < sv2 * 56)
  2427. coll = "collide_1";
  2428. xGame.soundMgr.playSound(coll);
  2429. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2430. if (collider.owner) {
  2431. let rig = collider.owner.getComponent(D2BallSrc);
  2432. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2433. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2434. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2435. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2436. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2437. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2438. let rx = 0;
  2439. let ry = 0;
  2440. if (this.gameObj.x < this.rectL)
  2441. rx = vx;
  2442. else if (this.gameObj.x > this.rectR)
  2443. rx = -vx;
  2444. else if (this.gameObj.y < this.rectT)
  2445. ry = vy;
  2446. else if (this.gameObj.y > this.rectB)
  2447. ry = -vy;
  2448. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2449. }
  2450. }
  2451. if (this.number != 0) {
  2452. return;
  2453. }
  2454. else {
  2455. if (this.forceRun) {
  2456. console.log("randon force");
  2457. this.applyForce(collider);
  2458. }
  2459. }
  2460. if (xGame.common.d2World.isOnSameLine) {
  2461. xGame.common.d2World.isOnSameLine = false;
  2462. this.rigy.linearVelocity = { x: 0, y: 0 };
  2463. }
  2464. if (xGame.common.gameMgr.firstColliObj == null) {
  2465. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2466. xGame.common.gameMgr.isTouchedBall = true;
  2467. }
  2468. }
  2469. else {
  2470. xGame.common.recoverCameraView();
  2471. let wallStr = "";
  2472. if (speed < 9) { }
  2473. else if (speed < sv2) { }
  2474. else if (speed < sv2 * 6.2)
  2475. wallStr = "wall_30";
  2476. else if (speed < sv2 * 25)
  2477. wallStr = "wall_50";
  2478. else if (speed < sv2 * 56)
  2479. wallStr = "wall_80";
  2480. xGame.soundMgr.playSound(wallStr);
  2481. }
  2482. }
  2483. applyForce(collider) {
  2484. let src = collider.owner.mySrc;
  2485. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2486. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2487. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2488. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2489. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2490. }
  2491. checkWrongBall(playEft = true) {
  2492. if (this.isInHole)
  2493. return;
  2494. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2495. if (this.number != 0 && playEft)
  2496. this.d3BallSrc.playInHoleEft();
  2497. let coll = "inpocket_1";
  2498. let speed = this.getSpeed();
  2499. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2500. if (speed < 9 && this.number != 0)
  2501. coll = "";
  2502. else if (speed < sv2 * 6.2)
  2503. coll = "inpocket_4";
  2504. else if (speed < sv2 * 25)
  2505. coll = "collide_3";
  2506. else if (speed < sv2 * 56)
  2507. coll = "collide_2";
  2508. xGame.soundMgr.playSound(coll);
  2509. this.isInHole = true;
  2510. if (this.number == 0) {
  2511. console.log("白球进了。。");
  2512. this.reset();
  2513. this.rigy.linearVelocity = { x: 0, y: 0 };
  2514. this.hideSelf();
  2515. xGame.common.gameUI.ui.whiteAni.visible = true;
  2516. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2517. xGame.common.gameUI.ui.whiteAni.visible = false;
  2518. }));
  2519. }
  2520. else {
  2521. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2522. xGame.common.d2World.removeOneBall(this);
  2523. this.destroySelf();
  2524. xGame.common.playHappySound(this.number);
  2525. this.runFlyEft();
  2526. }
  2527. }
  2528. runFlyEft() {
  2529. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2530. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2531. }
  2532. }
  2533. hideSelf() {
  2534. if (this.d3Ball)
  2535. this.d3Ball.active = false;
  2536. }
  2537. showSelf() {
  2538. this.isInHole = false;
  2539. if (this.d3Ball && !this.d3Ball.active)
  2540. this.d3Ball.active = true;
  2541. }
  2542. isStill() {
  2543. let speed = this.rigy.linearVelocity;
  2544. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2545. this.rigy.linearVelocity = { x: 0, y: 0 };
  2546. return true;
  2547. }
  2548. return false;
  2549. }
  2550. reset() {
  2551. }
  2552. destroySelf() {
  2553. this.d3BallSrc.destroySelf();
  2554. if (!this.ui.isDisposed) {
  2555. this.ui.removeFromParent();
  2556. this.ui.dispose();
  2557. this.ui = null;
  2558. }
  2559. this.outColli = null;
  2560. this.innerColli = null;
  2561. this.rigy = null;
  2562. this.d3Ball = null;
  2563. this.d3BallSrc = null;
  2564. this.angleV2 = null;
  2565. this.gameObj.destroy(true);
  2566. this.destroy();
  2567. }
  2568. judgeBorder() {
  2569. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2570. return;
  2571. }
  2572. if (this.destroyed)
  2573. return;
  2574. if (xGame.common.gameMode == GameMode.classic)
  2575. return;
  2576. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2577. if (isOver) {
  2578. this.checkWrongBall();
  2579. }
  2580. }
  2581. onClick(e, force = false) {
  2582. if (this.number == 0)
  2583. return;
  2584. if (force) {
  2585. }
  2586. else {
  2587. if (xGame.common.d2World.openCheckStill)
  2588. return;
  2589. if (!xGame.common.gameMgr.selfTurn) {
  2590. return;
  2591. }
  2592. }
  2593. if (!xGame.common.gameMgr.finishOneShoot)
  2594. return;
  2595. let root = xGame.common.d2World.rootBall.gameObj;
  2596. let x = this.gameObj.x - root.x;
  2597. let y = this.gameObj.y - root.y;
  2598. let angle = xGame.common.getfguiRotation(x, y);
  2599. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2600. xGame.common.d2World.getHelpLine();
  2601. xGame.common.clickedBall = true;
  2602. this.checkGuide();
  2603. }
  2604. checkGuide() {
  2605. let guide = DataMgr.getSkillGuide();
  2606. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2607. xGame.common.guideStep++;
  2608. xGame.common.gameUI.ui.guide1.visible = false;
  2609. xGame.common.gameUI.ui.guide2.visible = true;
  2610. }
  2611. }
  2612. checkDistance(disX, disY, angle) {
  2613. let diameter = this.gameObj.width - 1;
  2614. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2615. if (!this.lastDis)
  2616. this.lastDis = dis;
  2617. else {
  2618. if (dis > this.lastDis) {
  2619. this.helpOut.type = "remove";
  2620. return this.helpOut;
  2621. }
  2622. }
  2623. if (dis <= Math.pow(diameter, 2)) {
  2624. let del = 0.01;
  2625. let offest = 0;
  2626. let realX = disX - this.gameObj.x;
  2627. let realY = disY - this.gameObj.y;
  2628. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2629. offest += del;
  2630. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2631. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2632. }
  2633. this.helpOut.type = "ok";
  2634. this.helpOut.x = realX + this.gameObj.x;
  2635. this.helpOut.y = realY + this.gameObj.y;
  2636. return this.helpOut;
  2637. }
  2638. else {
  2639. this.helpOut.type = "no";
  2640. return this.helpOut;
  2641. }
  2642. }
  2643. clearBallEft() {
  2644. this.clearBallRightEft();
  2645. this.clearBallWrongEft();
  2646. }
  2647. clearBallRightEft() {
  2648. this.ui.breathAni.stop();
  2649. this.ui.rightTips.visible = false;
  2650. }
  2651. clearBallWrongEft() {
  2652. this.ui.wrongTips.visible = false;
  2653. }
  2654. showWrongEft() {
  2655. if (!xGame.common.gameMgr.selfTurn)
  2656. return;
  2657. this.ui.wrongTips.visible = true;
  2658. }
  2659. showRightEft() {
  2660. if (!xGame.common.gameMgr.selfTurn)
  2661. return;
  2662. this.ui.rightTips.visible = true;
  2663. this.ui.rightTips.scaleX = 1;
  2664. this.ui.rightTips.scaleY = 1;
  2665. this.ui.breathAni.play();
  2666. }
  2667. setBallFunc(type, owner) {
  2668. if (type == "ice") {
  2669. this.ballFunc = type;
  2670. this.d3BallSrc.setAlbedoTexture(true);
  2671. this.rigy.type = "static";
  2672. this.iceOwner = owner;
  2673. }
  2674. else {
  2675. if (owner == this.iceOwner) {
  2676. this.ballFunc = type;
  2677. this.d3BallSrc.setAlbedoTexture(false);
  2678. this.rigy.type = "dynamic";
  2679. }
  2680. }
  2681. }
  2682. }
  2683. D2BallSrc._unid = 0;
  2684. class D2RootBallSrc extends D2BallSrc {
  2685. constructor() {
  2686. super();
  2687. this.maxSpeed = 0;
  2688. this.classicMaxSpeed = 2.2;
  2689. this.bigSkillMaxSpeed = 4;
  2690. this.angle = 0;
  2691. this.allPercent = 0;
  2692. this.linearPercent = 0;
  2693. this.anglePercent = 0;
  2694. this.maxAngleRate = 0.6;
  2695. this.baseRot = 7;
  2696. this.angleMax = 0;
  2697. this.speed = new Laya.Vector2();
  2698. this.rotSpeed = new Laya.Vector2();
  2699. }
  2700. isStill() {
  2701. let speed = this.rigy.linearVelocity;
  2702. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2703. if (this.anglePercent <= 0.1) {
  2704. this.rigy.linearVelocity = { x: 0, y: 0 };
  2705. return true;
  2706. }
  2707. }
  2708. return false;
  2709. }
  2710. reset() {
  2711. this.linearPercent = 0;
  2712. this.anglePercent = 0;
  2713. }
  2714. setSpeed(percent, angle) {
  2715. this.allPercent = percent;
  2716. this.angle = angle;
  2717. this.setAngleSpeed();
  2718. this.setLinearSpeed();
  2719. let hit = "hit";
  2720. if (percent < 25)
  2721. hit = "hit03";
  2722. else if (percent < 50)
  2723. hit = "hit02";
  2724. else if (percent < 75)
  2725. hit = "hit01";
  2726. xGame.soundMgr.playSound(hit);
  2727. }
  2728. setAngleSpeed() {
  2729. let offest = xGame.common.rodOffest;
  2730. let radius = 82;
  2731. let rate = Math.abs(offest.y / radius) * 0.5;
  2732. if (offest.y > 0)
  2733. this.angleMax = -this.baseRot * 2;
  2734. else
  2735. this.angleMax = this.baseRot;
  2736. this.rotY = -offest.x / radius * 100;
  2737. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2738. this.linearPercent = this.allPercent - this.anglePercent;
  2739. }
  2740. setLinearSpeed() {
  2741. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2742. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2743. if (!xGame.common.longHelpLine) {
  2744. let offset = -150 + xGame.common.randomNum(0, 300);
  2745. offset /= 100;
  2746. this.angle += offset;
  2747. }
  2748. }
  2749. }
  2750. let sin = Math.sin(this.angle * Math.PI / 180);
  2751. let cos = Math.cos(this.angle * Math.PI / 180);
  2752. switch (xGame.common.gameMode) {
  2753. case GameMode.classic:
  2754. this.maxSpeed = this.classicMaxSpeed;
  2755. break;
  2756. case GameMode.bigMove:
  2757. this.maxSpeed = this.bigSkillMaxSpeed;
  2758. break;
  2759. case GameMode.placeBall:
  2760. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2761. if (data.type == 1) {
  2762. this.maxSpeed = this.bigSkillMaxSpeed;
  2763. }
  2764. else {
  2765. this.maxSpeed = this.classicMaxSpeed;
  2766. }
  2767. break;
  2768. default:
  2769. break;
  2770. }
  2771. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2772. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2773. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2774. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2775. this.rigy.applyLinearImpulseToCenter(this.speed);
  2776. }
  2777. onUpdate() {
  2778. if (this.anglePercent > 0.1) {
  2779. this.anglePercent *= 0.97;
  2780. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2781. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2782. this.rigy.applyForceToCenter(this.rotSpeed);
  2783. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2784. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2785. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2786. if (num > 0.9)
  2787. this.canRot = true;
  2788. }
  2789. else
  2790. this.canRot = true;
  2791. if (Math.abs(this.rotY) > 0.1)
  2792. this.rotY *= 0.98;
  2793. super.onUpdate();
  2794. }
  2795. destroySelf() {
  2796. super.destroySelf();
  2797. this.speed = null;
  2798. }
  2799. }
  2800. class D2Ball extends Laya.Sprite {
  2801. constructor(isRootBall = false) {
  2802. super();
  2803. this.ui = ui_D2Ball.createInstance();
  2804. this.pivotX = this.ui.width / 2;
  2805. this.pivotY = this.ui.width / 2;
  2806. this.x = 0;
  2807. this.y = 0;
  2808. this.addChild(this.ui.displayObject);
  2809. this.ui.displayObject.x += this.ui.width / 2;
  2810. this.ui.displayObject.y += this.ui.width / 2;
  2811. if (isRootBall) {
  2812. this.d2Src = this.addComponent(D2RootBallSrc);
  2813. }
  2814. else {
  2815. this.d2Src = this.addComponent(D2BallSrc);
  2816. }
  2817. this.d2Src.ui = this.ui;
  2818. this.addCircleCollider();
  2819. this.addInnerCircleCollider();
  2820. this.addRigyBody();
  2821. }
  2822. addCircleCollider() {
  2823. let colli = xGame.common.getCollider("circle");
  2824. colli.radius = this.ui.width / 2;
  2825. this.addComponentIntance(colli);
  2826. this.d2Src.outColli = colli;
  2827. colli.label = "ball";
  2828. }
  2829. addInnerCircleCollider() {
  2830. let colli = xGame.common.getCollider("circle");
  2831. colli.radius = this.ui.inner.width / 2;
  2832. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2833. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2834. this.addComponentIntance(colli);
  2835. this.d2Src.innerColli = colli;
  2836. colli.label = "inner";
  2837. }
  2838. addRigyBody() {
  2839. let rigy = xGame.common.getRigbody();
  2840. rigy.type = "dynamic";
  2841. this.addComponentIntance(rigy);
  2842. this.d2Src.rigy = rigy;
  2843. }
  2844. disposeSelf() {
  2845. if (!this.ui.isDisposed) {
  2846. this.ui.dispose();
  2847. this.ui.removeFromParent();
  2848. this.ui = null;
  2849. }
  2850. }
  2851. }
  2852. class ui_D2Gan extends fgui.GComponent {
  2853. static createInstance() {
  2854. return (fgui.UIPackage.createObject("game", "D2Gan"));
  2855. }
  2856. onConstruct() {
  2857. this.myIcon = (this.getChild("myIcon"));
  2858. this.selfRodIcon = (this.getChild("selfRodIcon"));
  2859. this.selfEftRoot = (this.getChild("selfEftRoot"));
  2860. this.self = (this.getChild("self"));
  2861. this.aiRodIcon = (this.getChild("aiRodIcon"));
  2862. this.aiEftRoot = (this.getChild("aiEftRoot"));
  2863. this.ai = (this.getChild("ai"));
  2864. }
  2865. }
  2866. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  2867. class D2Gan {
  2868. constructor() {
  2869. this.offset = 0.15;
  2870. this.cell = 1.5;
  2871. this.onBallCell = 0.4;
  2872. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  2873. this.moveNum = 70;
  2874. this.rulerRate = 0.1;
  2875. this.ui = ui_D2Gan.createInstance();
  2876. this.changeSelfRod();
  2877. this.changeAIRod();
  2878. }
  2879. changeSelfRod() {
  2880. let index = DataMgr.getCurBallRod();
  2881. let data = cfgTable.ballrodData[index + 1];
  2882. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2883. this.selfMySpine && this.selfMySpine.dispose();
  2884. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2885. if (data.spine) {
  2886. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2887. this.selfMySpine = new SpineMgr(data.spine, () => {
  2888. let xx = this.ui.selfEftRoot.width / 2;
  2889. let yy = this.ui.selfEftRoot.height / 2;
  2890. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2891. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  2892. outSpine.rotation = -90;
  2893. });
  2894. }
  2895. }
  2896. changeAIRod() {
  2897. let length = Object.keys(cfgTable.ballrodData).length;
  2898. let rand = Math.floor(length * Math.random()) + 1;
  2899. let data = cfgTable.ballrodData[rand];
  2900. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2901. this.aiMySpine && this.aiMySpine.dispose();
  2902. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2903. if (data.spine) {
  2904. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2905. this.aiMySpine = new SpineMgr(data.spine, () => {
  2906. let xx = this.ui.aiEftRoot.width / 2;
  2907. let yy = this.ui.aiEftRoot.height / 2;
  2908. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2909. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  2910. outSpine.rotation = -90;
  2911. });
  2912. }
  2913. }
  2914. setGanLastInfo() {
  2915. this.lastInfo.rotation = this.ui.rotation;
  2916. this.lastInfo.x = this.ui.x;
  2917. this.lastInfo.y = this.ui.y;
  2918. }
  2919. rotateSelf(flag, isRuler = false) {
  2920. let angle;
  2921. flag = flag * this.offset;
  2922. if (xGame.common.d2World.isHelpLineOnBall) {
  2923. angle = flag * this.onBallCell;
  2924. }
  2925. else {
  2926. angle = flag * this.cell;
  2927. }
  2928. if (isRuler) {
  2929. angle *= this.rulerRate;
  2930. }
  2931. this.ui.rotation += angle;
  2932. xGame.common.d2World.getHelpLine();
  2933. }
  2934. checkDistance() {
  2935. let target = xGame.common.d2World.targetBall;
  2936. let root = xGame.common.d2World.rootBall;
  2937. if (target == null) {
  2938. return 1;
  2939. }
  2940. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  2941. if (dis <= 2500) {
  2942. return 5;
  2943. }
  2944. return 1;
  2945. }
  2946. rotDest(rot) {
  2947. this.ui.rotation = rot;
  2948. xGame.common.d2World.getHelpLine();
  2949. }
  2950. storagePower(powerNum) {
  2951. let pos = (powerNum / 100) * this.moveNum;
  2952. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  2953. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  2954. this.ui.x = this.lastInfo.x + xx;
  2955. this.ui.y = this.lastInfo.y + yy;
  2956. }
  2957. shoot() {
  2958. this.storagePower(0);
  2959. this.ui.visible = false;
  2960. }
  2961. destroySelf() {
  2962. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2963. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2964. this.selfMySpine && this.selfMySpine.dispose();
  2965. this.aiMySpine && this.aiMySpine.dispose();
  2966. this.lastInfo = null;
  2967. if (!this.ui.isDisposed) {
  2968. this.ui.removeFromParent();
  2969. this.ui.dispose();
  2970. }
  2971. }
  2972. }
  2973. class ui_HelpLine extends fgui.GComponent {
  2974. static createInstance() {
  2975. return (fgui.UIPackage.createObject("game", "HelpLine"));
  2976. }
  2977. onConstruct() {
  2978. this.n10 = (this.getChild("n10"));
  2979. this.rect = (this.getChild("rect"));
  2980. this.dir11 = (this.getChild("dir11"));
  2981. this.dir = (this.getChild("dir"));
  2982. this.rootDir = (this.getChild("rootDir"));
  2983. this.dirDot = (this.getChild("dirDot"));
  2984. }
  2985. }
  2986. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  2987. class D2HelpLine {
  2988. constructor() {
  2989. this.starX = 0;
  2990. this.starY = 0;
  2991. this.ui = ui_HelpLine.createInstance();
  2992. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  2993. this.starX = this.ui.rect.x;
  2994. this.starY = this.ui.rect.y;
  2995. }
  2996. shoot() {
  2997. this.ui.visible = false;
  2998. }
  2999. destroySelf() {
  3000. if (this.ui.isDisposed) {
  3001. this.ui.removeFromParent();
  3002. this.ui.dispose();
  3003. }
  3004. }
  3005. }
  3006. class D2World extends Laya.Script {
  3007. constructor() {
  3008. super();
  3009. this.ballArr = [];
  3010. this.openCheckStill = false;
  3011. this.checkArr = [];
  3012. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3013. this.isHelpLineOnBall = false;
  3014. this.isOnSameLine = false;
  3015. this.reflectAngle = 0;
  3016. this.powerPercent = 0;
  3017. this.inHolesSpeed = [];
  3018. this.outDir = new Laya.Vector2();
  3019. this.rootDir = new Laya.Vector2();
  3020. this.aiLv = 0;
  3021. this.rootPos = new Laya.Vector2();
  3022. this.tempDir1 = new Laya.Vector2();
  3023. this.tempDir2 = new Laya.Vector2();
  3024. this.tempDir3 = new Laya.Vector2();
  3025. this.ballSize = 33;
  3026. this.destRot = 0;
  3027. }
  3028. initSelf() {
  3029. this.createBalls();
  3030. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3031. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3032. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3033. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3034. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3035. }
  3036. setBorderRect() {
  3037. let ui = xGame.common.gameUI.ui;
  3038. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3039. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3040. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3041. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3042. this.borderRect.x = starX;
  3043. this.borderRect.y = starY;
  3044. this.borderRect.width = width;
  3045. this.borderRect.height = height;
  3046. }
  3047. resetGame() {
  3048. this.openCheckStill = false;
  3049. let temp;
  3050. for (let index = 0; index < this.ballArr.length; index++) {
  3051. temp = this.ballArr[index];
  3052. temp.destroySelf();
  3053. }
  3054. xGame.common.d3World.ballRoot.destroyChildren();
  3055. xGame.common.gameUI.ui.ballNode.removeChildren();
  3056. console.log("进入摧毁逻辑");
  3057. this.d2Gan.destroySelf();
  3058. this.d2HelpLine.destroySelf();
  3059. this.ballArr = [];
  3060. }
  3061. setD2Gan() {
  3062. let ballNode = this.rootBall.ui;
  3063. let d2Gan = new D2Gan();
  3064. this.d2Gan = d2Gan;
  3065. let ganNode = d2Gan.ui;
  3066. ballNode.addChild(ganNode);
  3067. ganNode.pivotX = ganNode.pivotX;
  3068. ganNode.pivotY = ganNode.pivotY;
  3069. ganNode.x = ganNode.myIcon.width / 2;
  3070. ganNode.y = this.rootBall.gameObj.width;
  3071. d2Gan.setGanLastInfo();
  3072. }
  3073. setHelpLine() {
  3074. let d2Help = new D2HelpLine();
  3075. this.d2HelpLine = d2Help;
  3076. }
  3077. createBalls() {
  3078. let cfg;
  3079. switch (xGame.common.gameMode) {
  3080. case GameMode.classic:
  3081. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3082. break;
  3083. case GameMode.bigMove:
  3084. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3085. break;
  3086. case GameMode.placeBall:
  3087. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3088. break;
  3089. default:
  3090. break;
  3091. }
  3092. cfg = JSON.parse(JSON.stringify(cfg));
  3093. for (const key in cfg) {
  3094. if (cfg[key].value == 0) {
  3095. this.createRootBall(cfg[key]);
  3096. delete cfg[key];
  3097. break;
  3098. }
  3099. }
  3100. this.createOtherBalls(cfg);
  3101. }
  3102. createRootBall(data) {
  3103. let root = new D2Ball(true);
  3104. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3105. this.rootBall = root.d2Src;
  3106. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3107. let d3BallSrc = d3Ball.getComponent(Ball);
  3108. xGame.common.d3World.rootBall = d3Ball;
  3109. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3110. let xx = data.x;
  3111. let yy = data.y;
  3112. let numer = data.value;
  3113. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3114. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3115. this.ballArr.push(this.rootBall);
  3116. this.setD2Gan();
  3117. this.setHelpLine();
  3118. }
  3119. createOtherBalls(cfg) {
  3120. let temp;
  3121. let src;
  3122. let data;
  3123. for (const key in cfg) {
  3124. data = cfg[key];
  3125. temp = new D2Ball();
  3126. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3127. src = temp.d2Src;
  3128. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3129. src.initSelf(data.value, data.x, data.y, d3Ball);
  3130. this.ballArr.push(src);
  3131. }
  3132. }
  3133. shoot(percent) {
  3134. this.powerPercent = percent;
  3135. this.openCheckStill = true;
  3136. let d2Angle = this.d2Gan.ui.rotation;
  3137. this.rootBall.setSpeed(percent, d2Angle);
  3138. this.clearBallAllEft();
  3139. this.changePlayerView();
  3140. }
  3141. onUpdate() {
  3142. if (!this.openCheckStill)
  3143. return;
  3144. this.checkStill();
  3145. }
  3146. checkStill() {
  3147. for (let index = 0; index < this.ballArr.length; index++) {
  3148. if (!this.ballArr[index].isStill()) {
  3149. return;
  3150. }
  3151. }
  3152. xGame.eventMgr.event(ALL_BALL_STOP);
  3153. }
  3154. allBallStop() {
  3155. this.openCheckStill = false;
  3156. xGame.common.recoverCameraView();
  3157. }
  3158. waitShoot() {
  3159. if (!this.d2Gan.ui.isDisposed) {
  3160. this.d2Gan.ui.visible = true;
  3161. }
  3162. if (!this.d2HelpLine.ui.isDisposed) {
  3163. this.d2HelpLine.ui.visible = true;
  3164. }
  3165. this.clearBallAllEft();
  3166. this.showBallRightEft();
  3167. this.getHelpLine();
  3168. this.inHolesSpeed = [];
  3169. this.selectOneBall();
  3170. }
  3171. _getAllBallArr() {
  3172. let arr = this.ballArr;
  3173. let outArr = [];
  3174. for (let index = 0; index < arr.length; index++) {
  3175. if (arr[index] instanceof D2RootBallSrc)
  3176. continue;
  3177. if (arr[index].ballFunc == "ice")
  3178. continue;
  3179. if (arr[index].destroyed)
  3180. continue;
  3181. outArr.push(arr[index]);
  3182. }
  3183. return outArr;
  3184. }
  3185. _getBlackObj() {
  3186. let arr = this.ballArr;
  3187. for (let index = 0; index < arr.length; index++) {
  3188. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3189. return arr[index];
  3190. }
  3191. }
  3192. }
  3193. selectOneBall() {
  3194. let all = this._getAllBallArr();
  3195. let target;
  3196. switch (xGame.common.gameMode) {
  3197. case GameMode.classic:
  3198. if (xGame.common.gameMgr.selfTurn) {
  3199. let self = xGame.common.gameMgr.selfBallArr;
  3200. let black = this._getBlackObj();
  3201. if (xGame.common.gameMgr.ensureBallType) {
  3202. if (self.length > 0) {
  3203. let out = [];
  3204. for (let j = 0; j < all.length; j++) {
  3205. if (self.indexOf(all[j].number) > -1) {
  3206. out.push(all[j]);
  3207. }
  3208. }
  3209. target = this.selectBestEnterOne(out);
  3210. }
  3211. else {
  3212. target = this.selectBestEnterOne([black]);
  3213. }
  3214. }
  3215. else {
  3216. target = this.selectBestEnterOne(all);
  3217. }
  3218. }
  3219. else {
  3220. target = this.selectBestEnterOne(all);
  3221. }
  3222. break;
  3223. case GameMode.bigMove:
  3224. target = this.selectBestEnterOne(all);
  3225. break;
  3226. case GameMode.placeBall:
  3227. if (all.length > 0) {
  3228. target = this.selectBestEnterOne(all);
  3229. }
  3230. break;
  3231. default:
  3232. break;
  3233. }
  3234. if (target && !target.destroyed && target.onClick) {
  3235. target.onClick(0, true);
  3236. let num = -200 + xGame.common.randomNum(0, 400);
  3237. num /= 150;
  3238. if (xGame.common.longHelpLine) {
  3239. num = 0;
  3240. }
  3241. this.destRot += num;
  3242. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3243. }
  3244. }
  3245. removeOneBall(ball) {
  3246. for (let index = 0; index < this.ballArr.length; index++) {
  3247. if (this.ballArr[index].id == ball.id) {
  3248. this.ballArr.splice(index, 1);
  3249. break;
  3250. }
  3251. }
  3252. }
  3253. getHelpLine() {
  3254. this.d2HelpLine.ui.dirDot.visible = false;
  3255. this.isOnSameLine = false;
  3256. let startX = this.rootBall.gameObj.x;
  3257. let startY = this.rootBall.gameObj.y;
  3258. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3259. if (dis == null) {
  3260. this.d2HelpLine.ui.visible = false;
  3261. console.error("辅助线异常");
  3262. return;
  3263. }
  3264. this.d2HelpLine.ui.visible = true;
  3265. let angle = this.d2Gan.ui.rotation;
  3266. let radius = 16.5;
  3267. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3268. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3269. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3270. if (colliObj == null) {
  3271. this.getColliPos(disX, disY, radius, angle);
  3272. xGame.common.d2World.isHelpLineOnBall = false;
  3273. this.targetBall = null;
  3274. this.reflectAngle = 0;
  3275. this.showBallWrongEft();
  3276. }
  3277. else {
  3278. let target = colliObj.src;
  3279. let radius = 16.5;
  3280. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3281. dis1 = Math.sqrt(dis1);
  3282. let realDis = colliObj.disHon - dis1;
  3283. let dir = colliObj.dir;
  3284. let xx = startX + dir.x * realDis;
  3285. let yy = startY + dir.y * realDis;
  3286. this.getColliPos(xx, yy, radius, angle);
  3287. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3288. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3289. let offset = xGame.common.rodOffest;
  3290. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3291. this.isOnSameLine = true;
  3292. }
  3293. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3294. xGame.common.d2World.isHelpLineOnBall = true;
  3295. this.targetBall = target;
  3296. this.reflectAngle = reflectAngle;
  3297. this.showBallWrongEft();
  3298. if (xGame.common.longHelpLine) {
  3299. this.delayReflectLine(target, reflectAngle);
  3300. }
  3301. }
  3302. }
  3303. getBorderDot(startX, startY, angle) {
  3304. let radius = 17;
  3305. let distance;
  3306. let isDone;
  3307. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3308. isDone = this.judgeUpDown(distance, angle, startX);
  3309. if (isDone != null) {
  3310. return isDone;
  3311. }
  3312. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3313. isDone = this.judgeUpDown(distance, angle, startX);
  3314. if (isDone != null) {
  3315. return isDone;
  3316. }
  3317. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3318. isDone = this.judgeLeftRight(distance, angle, startY);
  3319. if (isDone != null) {
  3320. return isDone;
  3321. }
  3322. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3323. isDone = this.judgeLeftRight(distance, angle, startY);
  3324. if (isDone != null) {
  3325. return isDone;
  3326. }
  3327. }
  3328. judgeUpDown(distance, angle, startX) {
  3329. let flag = Math.sin(angle * Math.PI / 180);
  3330. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3331. if (distance >= 0) {
  3332. if (flag > 0) {
  3333. if (temp < this.borderRect.x + this.borderRect.width) {
  3334. return distance;
  3335. }
  3336. }
  3337. else {
  3338. if (temp > this.borderRect.x) {
  3339. return distance;
  3340. }
  3341. }
  3342. }
  3343. }
  3344. judgeLeftRight(distance, angle, starY) {
  3345. let flag = -Math.cos(angle * Math.PI / 180);
  3346. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3347. if (distance >= 0) {
  3348. if (flag > 0) {
  3349. if (temp < this.borderRect.y + this.borderRect.height) {
  3350. return distance;
  3351. }
  3352. }
  3353. else {
  3354. if (temp > this.borderRect.y) {
  3355. return distance;
  3356. }
  3357. }
  3358. }
  3359. }
  3360. clearBallAllEft() {
  3361. let temp;
  3362. for (let index = 0; index < this.ballArr.length; index++) {
  3363. temp = this.ballArr[index];
  3364. temp.clearBallEft();
  3365. }
  3366. }
  3367. showBallRightEft() {
  3368. let gameMgr = xGame.common.gameMgr;
  3369. let temp;
  3370. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3371. if (targetArr.length <= 0)
  3372. return;
  3373. for (let index = 0; index < this.ballArr.length; index++) {
  3374. temp = this.ballArr[index];
  3375. if (targetArr.indexOf(temp.number) > -1) {
  3376. temp.showRightEft();
  3377. }
  3378. }
  3379. }
  3380. showBallWrongEft() {
  3381. let gameMgr = xGame.common.gameMgr;
  3382. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3383. if (targetArr.length <= 0)
  3384. return;
  3385. let temp;
  3386. for (let index = 0; index < this.ballArr.length; index++) {
  3387. temp = this.ballArr[index];
  3388. if (this.targetBall && this.targetBall.number == temp.number) {
  3389. if (targetArr.indexOf(temp.number) <= -1) {
  3390. temp.showWrongEft();
  3391. }
  3392. else {
  3393. temp.clearBallWrongEft();
  3394. }
  3395. }
  3396. else {
  3397. temp.clearBallWrongEft();
  3398. }
  3399. }
  3400. }
  3401. getColliPos(x, y, radius, angle) {
  3402. this.d2HelpLine.ui.x = x;
  3403. this.d2HelpLine.ui.y = y;
  3404. let dirX = x - this.rootBall.gameObj.x;
  3405. let dirY = y - this.rootBall.gameObj.y;
  3406. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3407. if (rectH <= 0)
  3408. rectH = 0;
  3409. this.d2HelpLine.ui.rect.height = 0;
  3410. this.d2HelpLine.ui.rect.height = rectH;
  3411. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3412. if (rectH < this.rootBall.gameObj.width) {
  3413. this.d2HelpLine.ui.rect.visible = false;
  3414. }
  3415. else {
  3416. this.d2HelpLine.ui.rect.visible = true;
  3417. }
  3418. this.d2HelpLine.ui.dir.visible = false;
  3419. this.d2HelpLine.ui.rootDir.visible = false;
  3420. }
  3421. getReflectLine(x, y, radius, target) {
  3422. this.d2HelpLine.ui.dir.visible = true;
  3423. let dirX = target.x - x;
  3424. let dirY = target.y - y;
  3425. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3426. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3427. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3428. this.d2HelpLine.ui.dir.height = 48;
  3429. this.d2HelpLine.ui.dir.rotation = angle;
  3430. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3431. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3432. return angle;
  3433. }
  3434. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3435. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3436. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3437. let targetX = target.gameObj.x;
  3438. let targetY = target.gameObj.y;
  3439. this.outDir.setValue(targetX - xx, targetY - yy);
  3440. this.rootDir.setValue(rtX - xx, rtY - yy);
  3441. let ver = Math.PI / 2;
  3442. let sin = Math.sin(ver);
  3443. let cos = Math.cos(ver);
  3444. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3445. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3446. this.outDir.setValue(outX, outY);
  3447. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3448. Laya.Vector2.normalize(this.outDir, this.outDir);
  3449. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3450. if (Math.abs(result) <= 0.08) {
  3451. this.d2HelpLine.ui.rootDir.visible = false;
  3452. return;
  3453. }
  3454. if (result > 0) {
  3455. angle += 90;
  3456. }
  3457. else if (result < 0) {
  3458. angle -= 90;
  3459. }
  3460. this.d2HelpLine.ui.rootDir.visible = true;
  3461. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3462. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3463. this.d2HelpLine.ui.rootDir.rotation = angle;
  3464. }
  3465. delayReflectLine(obj, angle) {
  3466. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3467. return;
  3468. }
  3469. this.isOnSameLine = false;
  3470. let startX = obj.gameObj.x;
  3471. let startY = obj.gameObj.y;
  3472. let dis = this.getBorderDot(startX, startY, angle);
  3473. if (dis == null) {
  3474. this.d2HelpLine.ui.dirDot.visible = false;
  3475. return;
  3476. }
  3477. this.d2HelpLine.ui.visible = true;
  3478. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3479. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3480. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3481. if (colliObj == null) {
  3482. this.setDelayLine(disX, disY, obj, angle);
  3483. }
  3484. else {
  3485. let radius = 16;
  3486. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3487. dis1 = Math.sqrt(dis1);
  3488. let realDis = colliObj.disHon - dis1;
  3489. let dir = colliObj.dir;
  3490. let xx = startX + dir.x * realDis;
  3491. let yy = startY + dir.y * realDis;
  3492. this.setDelayLine(xx, yy, obj, angle);
  3493. }
  3494. }
  3495. setDelayLine(x, y, obj, angle) {
  3496. let dirX = x - obj.gameObj.x;
  3497. let dirY = y - obj.gameObj.y;
  3498. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3499. if (rectH <= 0)
  3500. rectH = 0;
  3501. this.d2HelpLine.ui.dir.height = rectH;
  3502. this.d2HelpLine.ui.dirDot.visible = true;
  3503. this.d2HelpLine.ui.dirDot.x = 17;
  3504. this.d2HelpLine.ui.dirDot.y = 17;
  3505. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3506. ;
  3507. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3508. }
  3509. changePlayerView() {
  3510. if (Math.random() >= 0.7)
  3511. return;
  3512. if (!this.targetBall) {
  3513. return;
  3514. }
  3515. if (!xGame.common.gameMgr.selfTurn)
  3516. return;
  3517. switch (xGame.common.gameMode) {
  3518. case GameMode.classic:
  3519. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3520. if (this.targetBall.number != 8) {
  3521. return;
  3522. }
  3523. }
  3524. break;
  3525. case GameMode.bigMove:
  3526. return;
  3527. case GameMode.placeBall:
  3528. break;
  3529. default:
  3530. break;
  3531. }
  3532. let startX = this.targetBall.gameObj.x;
  3533. let startY = this.targetBall.gameObj.y;
  3534. let angle = this.reflectAngle;
  3535. let dis = this.getBorderDot(startX, startY, angle);
  3536. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3537. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3538. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3539. if (colliObj) {
  3540. return;
  3541. }
  3542. let offset = 40;
  3543. let posObj = xGame.common.gameMgr.posObj;
  3544. let temp;
  3545. let radius;
  3546. let tarX, tarY;
  3547. for (const key in posObj) {
  3548. temp = posObj[key];
  3549. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3550. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3551. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3552. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3553. xGame.common.showOneCamera("angle" + key);
  3554. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3555. Laya.physicsTimer.scale = 0.7;
  3556. break;
  3557. }
  3558. }
  3559. }
  3560. selectBestEnterOne(arr) {
  3561. this.aiLv = xGame.tools.random(1, 11);
  3562. this.aiLv = 10;
  3563. this.wBall = xGame.common.d2World.rootBall;
  3564. this.rootPos.x = this.wBall.gameObj.x;
  3565. this.rootPos.y = this.wBall.gameObj.y;
  3566. this.initHoleBall(arr);
  3567. return this.selectBall();
  3568. }
  3569. selectBall() {
  3570. let ball = null;
  3571. this.destRot = 0;
  3572. let ai = 110 - this.aiLv * 10;
  3573. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3574. let score = false;
  3575. if (this.scoreBall.length < 1) {
  3576. if (this.lineBall.length < 1) {
  3577. for (let i = 0; i < this.kickBall.length; i++) {
  3578. let list = [];
  3579. let bo = this.kickBall[i];
  3580. let bobj = bo.gameObj;
  3581. let rect = xGame.common.d2World.borderRect;
  3582. let mobj = this.wBall.gameObj;
  3583. let minb = bobj.y - rect.y - 20;
  3584. let minw = mobj.y - rect.y - 50;
  3585. if (minb > 0 && minw > 0) {
  3586. let dlenx = 0;
  3587. let dleny = mobj.y - rect.y;
  3588. let spx = mobj.x;
  3589. let spy = rect.y - dleny;
  3590. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3591. }
  3592. minb = rect.y + rect.height - bobj.y - 20;
  3593. minw = rect.y + rect.height - mobj.y - 50;
  3594. if (minb > 0 && minw > 0) {
  3595. let dlenx = 0;
  3596. let dleny = rect.y + rect.height - mobj.y;
  3597. let spx = mobj.x;
  3598. let spy = rect.y + rect.height + dleny;
  3599. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3600. }
  3601. minb = bobj.x - rect.x - 20;
  3602. minw = mobj.x - rect.x - 50;
  3603. if (minb > 0 && minw > 0) {
  3604. let dlenx = mobj.x - rect.x;
  3605. let dleny = 0;
  3606. let spx = rect.x - dlenx;
  3607. let spy = mobj.y;
  3608. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3609. }
  3610. minb = rect.x + rect.width - bobj.x - 20;
  3611. minw = rect.x + rect.width - mobj.x - 50;
  3612. if (minb > 0 && minw > 0) {
  3613. let dlenx = rect.x + rect.width - mobj.x;
  3614. let dleny = 0;
  3615. let spx = rect.x + rect.width + dlenx;
  3616. let spy = mobj.y;
  3617. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3618. }
  3619. list.sort(function (a, b) {
  3620. return a.order - b.order;
  3621. });
  3622. for (let i = 0; i < list.length; i++) {
  3623. let data = list[i];
  3624. let mx = mobj.x - bobj.x;
  3625. let my = mobj.y - bobj.y;
  3626. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3627. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3628. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3629. if (num > 1)
  3630. num = 1;
  3631. let cos = Math.acos(num);
  3632. if (cos > 1.57)
  3633. cos = 1.57;
  3634. else if (cos < 0.01)
  3635. cos = 0.01;
  3636. let tan = Math.tan(cos);
  3637. let dx = tan * data.dleny;
  3638. let dy = tan * data.dlenx;
  3639. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3640. if (Math.abs(bx - 667) < 40)
  3641. continue;
  3642. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3643. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3644. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3645. this.forceMax = dis * 0.08;
  3646. this.destRot += mis * 0.1;
  3647. this.setKick(bx, by);
  3648. return true;
  3649. }
  3650. }
  3651. }
  3652. }
  3653. else {
  3654. ball = xGame.common.getRandArrEle(this.lineBall);
  3655. }
  3656. }
  3657. else {
  3658. for (let i = 0; i < this.scoreBall.length; i++) {
  3659. if (i < this.scoreBall.length - 1) {
  3660. let rand = 70 + this.aiLv * 10 + i * 10;
  3661. if (xGame.tools.random(0, 100) < rand) {
  3662. ball = this.scoreBall[i];
  3663. break;
  3664. }
  3665. }
  3666. else {
  3667. ball = this.scoreBall[i];
  3668. break;
  3669. }
  3670. }
  3671. score = true;
  3672. this.selectNum++;
  3673. }
  3674. if (!ball)
  3675. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3676. let dx = ball.gameObj.x;
  3677. let dy = ball.gameObj.y;
  3678. let kickAngle = 0;
  3679. if (score) {
  3680. dx = ball.kickPos.x;
  3681. dy = ball.kickPos.y;
  3682. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3683. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3684. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3685. if (adot > 1)
  3686. adot = 1;
  3687. kickAngle = Math.acos(adot) * 57.3;
  3688. if (kickAngle > 45) {
  3689. let kdx = ball.kickPos.x - ball.gameObj.x;
  3690. let kdy = ball.kickPos.y - ball.gameObj.y;
  3691. dx = ball.kickPos.x - kdx * mis * 0.3;
  3692. dy = ball.kickPos.y - kdy * mis * 0.3;
  3693. }
  3694. else
  3695. this.destRot += mis;
  3696. }
  3697. else if (ball.poleAngle != 0) {
  3698. this.destRot += ball.poleAngle;
  3699. }
  3700. if (xGame.common.gameMode == 0) {
  3701. let af = kickAngle * 0.08;
  3702. this.forceMax = ball.hard * 0.1 + af * af;
  3703. }
  3704. this.setKick(dx, dy);
  3705. return ball;
  3706. }
  3707. initHoleBall(arr) {
  3708. this.kickBall = [];
  3709. this.lineBall = [];
  3710. this.scoreBall = [];
  3711. this.holeBall = [];
  3712. this.selectNum = 0;
  3713. this.forceNum = 0;
  3714. this.forceMax = 0;
  3715. this.turnNum = 0;
  3716. let list = arr;
  3717. let holes = xGame.common.gameMgr.holePosList;
  3718. let self = xGame.common.aiPlayer;
  3719. for (let i = 0; i < list.length; i++) {
  3720. let obj = list[i];
  3721. if (!obj)
  3722. continue;
  3723. obj.kickPos.x = 0;
  3724. obj.kickPos.y = 0;
  3725. obj.poleAngle = 0;
  3726. obj.hard = 0;
  3727. obj.borderDis = 0;
  3728. obj.kickAngle = 180;
  3729. let b = obj.gameObj;
  3730. let wbp = this.rootPos;
  3731. let bx = wbp.x - b.x;
  3732. let by = wbp.y - b.y;
  3733. obj.borderDis = xGame.tools.random(0, 100);
  3734. this.kickBall.push(obj);
  3735. if (!this.isLine(wbp, obj))
  3736. continue;
  3737. obj.kickAngle = xGame.tools.random(90, 180);
  3738. obj.kickPos.x = b.x;
  3739. obj.kickPos.y = b.y;
  3740. this.lineBall.push(obj);
  3741. let minDis = 999999;
  3742. let hole = false;
  3743. for (let j = 0; j < holes.length; j++) {
  3744. let hp = holes[j];
  3745. if (bx >= 0 && hp.x > b.x + 100)
  3746. continue;
  3747. if (bx <= 0 && hp.x < b.x - 100)
  3748. continue;
  3749. if (by < -10 && hp.y < wbp.y)
  3750. continue;
  3751. if (by > 10 && hp.y > wbp.y)
  3752. continue;
  3753. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3754. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3755. if (dis < minDis) {
  3756. let dx = b.x - this.tempDir1.x * this.ballSize;
  3757. let dy = b.y - this.tempDir1.y * this.ballSize;
  3758. this.tempDir3.x = this.tempDir1.x;
  3759. this.tempDir3.y = this.tempDir1.y;
  3760. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3761. obj.kickPos.x = dx;
  3762. obj.kickPos.y = dy;
  3763. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3764. if (num > 1)
  3765. num = 1;
  3766. obj.kickAngle = Math.acos(num) * 57.3;
  3767. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3768. dis = dis * 2;
  3769. if (Math.abs(hp.x - 600) < 100)
  3770. dis += 50;
  3771. obj.hard = dis + obj.kickAngle * 3;
  3772. hole = true;
  3773. }
  3774. }
  3775. }
  3776. }
  3777. if (hole) {
  3778. this.scoreBall.push(obj);
  3779. this.holeBall.push(obj);
  3780. }
  3781. }
  3782. this.scoreBall.sort(function (a, b) {
  3783. return a.hard - b.hard;
  3784. });
  3785. this.holeBall.sort(function (a, b) {
  3786. return a.kickAngle - b.kickAngle;
  3787. });
  3788. this.kickBall.sort(function (a, b) {
  3789. return a.borderDis - b.borderDis;
  3790. });
  3791. }
  3792. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3793. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3794. let balls = xGame.common.d2World.ballArr;
  3795. let max = xGame.tools.getDis(hx, hy, bx, by);
  3796. for (let index = 0; index < balls.length; index++) {
  3797. let obj = balls[index];
  3798. if (obj.number == 0)
  3799. continue;
  3800. if (obj.number == bn || obj.number == dn)
  3801. continue;
  3802. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3803. if (dis * dis > max)
  3804. continue;
  3805. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3806. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3807. if (num > 1)
  3808. num = 1;
  3809. if (num < 0)
  3810. continue;
  3811. let gap = Math.sin(Math.acos(num)) * dis;
  3812. if (gap < this.ballSize)
  3813. return true;
  3814. }
  3815. return false;
  3816. }
  3817. isLine(xy, ball) {
  3818. let bx = xy.x;
  3819. let by = xy.y;
  3820. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3821. let dis = ball.getDestDis(xy);
  3822. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3823. let sin = Math.sin(angle);
  3824. let cos = Math.cos(angle);
  3825. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3826. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3827. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3828. let dx = bx + this.tempDir2.x * dis;
  3829. let dy = by + this.tempDir2.y * dis;
  3830. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3831. sin = Math.sin(-angle);
  3832. cos = Math.cos(-angle);
  3833. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3834. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3835. dx = bx + this.tempDir2.x * dis;
  3836. dy = by + this.tempDir2.y * dis;
  3837. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  3838. if (isr && isl)
  3839. return false;
  3840. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  3841. }
  3842. return true;
  3843. }
  3844. setKick(dx, dy) {
  3845. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  3846. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3847. this.tempDir1.x = 0;
  3848. this.tempDir1.y = 1;
  3849. this.tempDir2.y = -this.tempDir2.y;
  3850. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3851. if (num > 1)
  3852. num = 1;
  3853. let rot = Math.acos(num) * 57.3;
  3854. if (this.tempDir2.x < 0)
  3855. rot = 360 - rot;
  3856. this.destRot += rot;
  3857. }
  3858. }
  3859. class ui_UIGame extends fgui.GComponent {
  3860. static createInstance() {
  3861. return (fgui.UIPackage.createObject("game", "UIGame"));
  3862. }
  3863. onConstruct() {
  3864. this.c1 = this.getController("c1");
  3865. this.d3Root = (this.getChild("d3Root"));
  3866. this.clickNode = (this.getChild("clickNode"));
  3867. this.d2Root = (this.getChild("d2Root"));
  3868. this.topNode = (this.getChild("topNode"));
  3869. this.n72 = (this.getChild("n72"));
  3870. this.n40 = (this.getChild("n40"));
  3871. this.rulerNode = (this.getChild("rulerNode"));
  3872. this.rulerClickNode = (this.getChild("rulerClickNode"));
  3873. this.n50 = (this.getChild("n50"));
  3874. this.keduNode = (this.getChild("keduNode"));
  3875. this.powerTxt = (this.getChild("powerTxt"));
  3876. this.powerNode = (this.getChild("powerNode"));
  3877. this.colorNode = (this.getChild("colorNode"));
  3878. this.powerEft = (this.getChild("powerEft"));
  3879. this.myPowerNode = (this.getChild("myPowerNode"));
  3880. this.ganNode = (this.getChild("ganNode"));
  3881. this.rodMethodNode = (this.getChild("rodMethodNode"));
  3882. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  3883. this.placeNormalNode = (this.getChild("placeNormalNode"));
  3884. this.skillRod = (this.getChild("skillRod"));
  3885. this.border = (this.getChild("border"));
  3886. this.bigSkillNode = (this.getChild("bigSkillNode"));
  3887. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  3888. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  3889. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  3890. this.awardSpineNode = (this.getChild("awardSpineNode"));
  3891. this.guanyuNode = (this.getChild("guanyuNode"));
  3892. this.helpBtn = (this.getChild("helpBtn"));
  3893. this.wordsBtn = (this.getChild("wordsBtn"));
  3894. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  3895. this.returnBtn = (this.getChild("returnBtn"));
  3896. this.ballNode = (this.getChild("ballNode"));
  3897. this.whiteAni = (this.getChild("whiteAni"));
  3898. this.blackAni = (this.getChild("blackAni"));
  3899. this.selfTurn = (this.getChild("selfTurn"));
  3900. this.aiTurn = (this.getChild("aiTurn"));
  3901. this.deskNode = (this.getChild("deskNode"));
  3902. this.moveNode = (this.getChild("moveNode"));
  3903. this.selfTalk = (this.getChild("selfTalk"));
  3904. this.aiTalk = (this.getChild("aiTalk"));
  3905. this.d2Node = (this.getChild("d2Node"));
  3906. this.snowNode = (this.getChild("snowNode"));
  3907. this.guide2 = (this.getChild("guide2"));
  3908. this.guide1 = (this.getChild("guide1"));
  3909. this.guide3 = (this.getChild("guide3"));
  3910. this.guideNode = (this.getChild("guideNode"));
  3911. }
  3912. }
  3913. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  3914. class ui_UIGameEnd extends fgui.GComponent {
  3915. static createInstance() {
  3916. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  3917. }
  3918. onConstruct() {
  3919. this.c1 = this.getController("c1");
  3920. this.n22 = (this.getChild("n22"));
  3921. this.n2 = (this.getChild("n2"));
  3922. this.n52 = (this.getChild("n52"));
  3923. this.n53 = (this.getChild("n53"));
  3924. this.coinNode = (this.getChild("coinNode"));
  3925. this.closeNode = (this.getChild("closeNode"));
  3926. this.moneyNode = (this.getChild("moneyNode"));
  3927. this.secretary = (this.getChild("secretary"));
  3928. this.n27 = (this.getChild("n27"));
  3929. this.n29 = (this.getChild("n29"));
  3930. this.talkNode = (this.getChild("talkNode"));
  3931. this.n38 = (this.getChild("n38"));
  3932. this.n39 = (this.getChild("n39"));
  3933. this.n40 = (this.getChild("n40"));
  3934. this.awardNode = (this.getChild("awardNode"));
  3935. this.starNumNode = (this.getChild("starNumNode"));
  3936. this.n47 = (this.getChild("n47"));
  3937. this.conditionNode = (this.getChild("conditionNode"));
  3938. this.isGetAward = (this.getChild("isGetAward"));
  3939. this.leftBtn = (this.getChild("leftBtn"));
  3940. this.rightBtn = (this.getChild("rightBtn"));
  3941. this.btnNode = (this.getChild("btnNode"));
  3942. }
  3943. }
  3944. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  3945. class ui_UIAddCoin extends fgui.GComponent {
  3946. static createInstance() {
  3947. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  3948. }
  3949. onConstruct() {
  3950. this.n11 = (this.getChild("n11"));
  3951. this.myNode = (this.getChild("myNode"));
  3952. this.t0 = this.getTransition("t0");
  3953. }
  3954. }
  3955. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  3956. class UIAddCoin extends UIBase {
  3957. constructor() {
  3958. super();
  3959. this.coinNum = 2000;
  3960. }
  3961. onConstructor() {
  3962. this.ui = ui_UIAddCoin.createInstance();
  3963. this.contentPane = this.ui;
  3964. this.isEject = false;
  3965. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  3966. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  3967. }
  3968. show() {
  3969. super.show();
  3970. this.ui.t0.play();
  3971. }
  3972. videoAddCoin() {
  3973. Moyu.showVideoAd(() => {
  3974. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  3975. this.hide();
  3976. }, EAdType.addFailCoin);
  3977. }
  3978. }
  3979. UIAddCoin.uiName = "UIAddCoin";
  3980. class ui_UIInvitation extends fgui.GComponent {
  3981. static createInstance() {
  3982. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  3983. }
  3984. onConstruct() {
  3985. this.n14 = (this.getChild("n14"));
  3986. this.myNode = (this.getChild("myNode"));
  3987. this.t0 = this.getTransition("t0");
  3988. }
  3989. }
  3990. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  3991. class UIInvitation extends UIBase {
  3992. constructor() {
  3993. super();
  3994. }
  3995. onConstructor() {
  3996. this.ui = ui_UIInvitation.createInstance();
  3997. this.contentPane = this.ui;
  3998. this.isEject = false;
  3999. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4000. }
  4001. show() {
  4002. super.show();
  4003. }
  4004. enterGame() {
  4005. xGame.common.gameMode = GameMode.classic;
  4006. DataMgr.setChallengeTimes(1);
  4007. xGame.common.passAwardCoin = 2000;
  4008. let need = xGame.common.classicNiceNeddCoin;
  4009. if (DataMgr.coinEnough(need)) {
  4010. DataMgr.setCoin(-need);
  4011. xGame.eventMgr.event(RESTART_GAME, true);
  4012. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4013. }
  4014. else {
  4015. xGame.eventMgr.event(RESTART_GAME, true);
  4016. }
  4017. this.hide();
  4018. }
  4019. hide() {
  4020. super.hide();
  4021. }
  4022. }
  4023. UIInvitation.uiName = "UIInvitation";
  4024. class ui_UIMain extends fgui.GComponent {
  4025. static createInstance() {
  4026. return (fgui.UIPackage.createObject("game", "UIMain"));
  4027. }
  4028. onConstruct() {
  4029. this.n47 = (this.getChild("n47"));
  4030. this.n10 = (this.getChild("n10"));
  4031. this.secretary = (this.getChild("secretary"));
  4032. this.n33 = (this.getChild("n33"));
  4033. this.shopBtn = (this.getChild("shopBtn"));
  4034. this.moneyNode = (this.getChild("moneyNode"));
  4035. this.headNode = (this.getChild("headNode"));
  4036. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4037. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4038. this.classicBtn = (this.getChild("classicBtn"));
  4039. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4040. this.globalBtn = (this.getChild("globalBtn"));
  4041. this.n44 = (this.getChild("n44"));
  4042. this.signBtn = (this.getChild("signBtn"));
  4043. this.drawBtn = (this.getChild("drawBtn"));
  4044. this.settingNode = (this.getChild("settingNode"));
  4045. this.n45 = (this.getChild("n45"));
  4046. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4047. this.rankBtn = (this.getChild("rankBtn"));
  4048. this.n46 = (this.getChild("n46"));
  4049. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4050. this.liucheng1 = (this.getChild("liucheng1"));
  4051. this.rightBtn = (this.getChild("rightBtn"));
  4052. this.n75 = (this.getChild("n75"));
  4053. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4054. this.liucheng2 = (this.getChild("liucheng2"));
  4055. this.guideBtn = (this.getChild("guideBtn"));
  4056. this.n73 = (this.getChild("n73"));
  4057. this.wordsNode = (this.getChild("wordsNode"));
  4058. this.enterGuide = (this.getChild("enterGuide"));
  4059. this.talkNode = (this.getChild("talkNode"));
  4060. this.n83 = (this.getChild("n83"));
  4061. this.n84 = (this.getChild("n84"));
  4062. }
  4063. }
  4064. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4065. class ui_UIMoyu extends fgui.GComponent {
  4066. static createInstance() {
  4067. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4068. }
  4069. onConstruct() {
  4070. this.ageTip = (this.getChild("ageTip"));
  4071. this.mainBg = (this.getChild("mainBg"));
  4072. this.xyNode = (this.getChild("xyNode"));
  4073. this.rnNode = (this.getChild("rnNode"));
  4074. this.fcmNode = (this.getChild("fcmNode"));
  4075. this.ageNode = (this.getChild("ageNode"));
  4076. this.tipNode = (this.getChild("tipNode"));
  4077. this.msgNode = (this.getChild("msgNode"));
  4078. }
  4079. }
  4080. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4081. class MoyuMgr {
  4082. static initMoyu() {
  4083. this.moyuView = new MoyuView();
  4084. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4085. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4086. this.moyuView.ui.displayObject.zOrder = 1000;
  4087. this.moyuView.init();
  4088. this.moyuView.showTip(true);
  4089. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4090. window['XApk'] = this;
  4091. }
  4092. static showAge(show) {
  4093. if (this.moyuView)
  4094. this.moyuView.showAge(show);
  4095. }
  4096. static onPlatMsg(idx) {
  4097. if (!MoyuMgr.moyuView)
  4098. return;
  4099. if (idx == '0') {
  4100. MoyuMgr.moyuView.showTip(false);
  4101. }
  4102. }
  4103. static showAgree(call) {
  4104. if (this.moyuView)
  4105. this.moyuView.showAgree(call);
  4106. else
  4107. call && call();
  4108. }
  4109. static showXy(type = 1) {
  4110. if (this.moyuView)
  4111. this.moyuView.showXy(type);
  4112. }
  4113. }
  4114. MoyuMgr.isAdvise = false;
  4115. class MoyuView {
  4116. constructor() {
  4117. this.ysxyNum = 1;
  4118. this.ysJson = null;
  4119. this.ui = ui_UIMoyu.createInstance();
  4120. }
  4121. init() {
  4122. this.ui.mainBg.visible = false;
  4123. this.ui.xyNode.visible = false;
  4124. this.ui.ageNode.visible = false;
  4125. this.ui.tipNode.visible = false;
  4126. this.ui.rnNode.visible = false;
  4127. this.ui.fcmNode.visible = false;
  4128. this.ui.ageTip.visible = false;
  4129. this.ui.msgNode.visible = false;
  4130. this.ui.visible = false;
  4131. this.ui.xyNode.xyList.setVirtual();
  4132. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4133. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4134. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4135. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4136. this.ui.xyNode.btnKnown.visible = false;
  4137. this.ui.xyNode.xy1.visible = false;
  4138. this.ui.xyNode.xy2.visible = false;
  4139. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4140. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4141. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4142. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4143. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4144. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4145. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4146. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4147. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4148. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4149. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4150. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4151. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4152. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4153. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4154. this.ysxyNum = 2;
  4155. }
  4156. }
  4157. onClick(obj) {
  4158. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4159. switch (obj) {
  4160. case this.ui.ageTip:
  4161. if (Moyu.isTTApk) {
  4162. this.ui.ageNode.visible = true;
  4163. this.ui.mainBg.visible = true;
  4164. }
  4165. break;
  4166. case this.ui.tipNode:
  4167. this.showTip(false);
  4168. break;
  4169. case this.ui.ageNode.btnAge:
  4170. this.ui.ageNode.visible = false;
  4171. this.ui.mainBg.visible = false;
  4172. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4173. this.ui.visible = false;
  4174. break;
  4175. case this.ui.xyNode.btnXy3:
  4176. case this.ui.xyNode.btnXy1:
  4177. this.loadXy(1);
  4178. break;
  4179. case this.ui.xyNode.btnXy2:
  4180. this.loadXy(2);
  4181. break;
  4182. case this.ui.xyNode.btnBack:
  4183. this.ui.xyNode.xy1.visible = true;
  4184. this.ui.xyNode.xy2.visible = false;
  4185. break;
  4186. case this.ui.xyNode.btnKnown:
  4187. this.ui.xyNode.visible = false;
  4188. this.ui.mainBg.visible = false;
  4189. this.ui.visible = false;
  4190. break;
  4191. case this.ui.rnNode.btnCheck:
  4192. this.check();
  4193. break;
  4194. case this.ui.rnNode.btnExit:
  4195. case this.ui.xyNode.btnNo:
  4196. this.ysxyNum--;
  4197. if (this.ysxyNum > 0)
  4198. this.showMsg("Refuse to quit the game once again");
  4199. else {
  4200. Moyu.userAgree(false);
  4201. Moyu.exit();
  4202. }
  4203. break;
  4204. case this.ui.xyNode.btnSure:
  4205. case this.ui.xyNode.btnYes:
  4206. DataMgr.userData.isAgree = true;
  4207. DataMgr.saveUserData();
  4208. this.onAgree();
  4209. break;
  4210. case this.ui.rnNode.btnDone:
  4211. this.ui.rnNode.visible = false;
  4212. this.ui.visible = false;
  4213. break;
  4214. case this.ui.fcmNode.btnRn:
  4215. this.showRn();
  4216. break;
  4217. }
  4218. }
  4219. showTip(show) {
  4220. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4221. return;
  4222. if (show) {
  4223. MoyuMgr.isAdvise = true;
  4224. this.ui.visible = true;
  4225. this.ui.tipNode.visible = true;
  4226. this.ui.tipNode.alpha = 1;
  4227. Laya.timer.once(1000, this, this.showTip, [false]);
  4228. }
  4229. else {
  4230. this.ui.tipNode.alpha = 1;
  4231. this.ui.tipNode.visible = true;
  4232. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4233. this.ui.tipNode.visible = false;
  4234. MoyuMgr.isAdvise = false;
  4235. }), 1000);
  4236. }
  4237. }
  4238. showAge(show, px = 0, py = 0) {
  4239. if (Moyu.platType > 10 && !Moyu.isIos) {
  4240. this.ui.ageTip.x = px;
  4241. this.ui.ageTip.y = py;
  4242. this.ui.ageTip.visible = show;
  4243. if (show)
  4244. this.ui.visible = true;
  4245. }
  4246. }
  4247. showAgree(call) {
  4248. this.agreeCall = call;
  4249. this.onAgree();
  4250. return;
  4251. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4252. this.showXy(0);
  4253. }
  4254. else
  4255. this.onAgree();
  4256. }
  4257. onAgree() {
  4258. if (!this.ui.ageNode.visible)
  4259. this.ui.visible = false;
  4260. this.ui.xyNode.visible = false;
  4261. Moyu.userAgree(true);
  4262. this.showAge(false);
  4263. this.agreeCall && this.agreeCall();
  4264. this.showRn();
  4265. }
  4266. showMsg(txt) {
  4267. this.ui.msgNode.txtMsg.text = txt;
  4268. this.ui.msgNode.visible = true;
  4269. this.ui.msgNode.alpha = 1;
  4270. this.ui.visible = true;
  4271. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4272. this.ui.msgNode.visible = false;
  4273. }), 2500, true);
  4274. }
  4275. showRn() {
  4276. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4277. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4278. this.ui.rnNode.rn1.visible = true;
  4279. this.ui.rnNode.rn2.visible = false;
  4280. this.ui.rnNode.rn3.visible = false;
  4281. this.ui.rnNode.rn4.visible = false;
  4282. this.ui.rnNode.visible = true;
  4283. this.ui.mainBg.visible = true;
  4284. this.ui.rnNode.btnDone.visible = false;
  4285. this.ui.rnNode.btnExit.visible = true;
  4286. this.ui.rnNode.btnCheck.visible = true;
  4287. this.ui.fcmNode.visible = false;
  4288. this.ui.visible = true;
  4289. return;
  4290. }
  4291. }
  4292. this.showFcm();
  4293. }
  4294. showFcm() {
  4295. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4296. Moyu.initFCM(true);
  4297. if (Moyu.gameTime < 1)
  4298. this.fcmLoop();
  4299. else if (Moyu.gameTime < 999)
  4300. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4301. }
  4302. }
  4303. fcmLoop() {
  4304. if (Moyu.gameTime < 1) {
  4305. this.ui.rnNode.visible = false;
  4306. this.ui.fcmNode.visible = true;
  4307. this.ui.mainBg.visible = true;
  4308. this.ui.visible = true;
  4309. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4310. Laya.timer.clear(this.ui, this.fcmLoop);
  4311. }
  4312. }
  4313. check() {
  4314. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4315. this.ui.rnNode.rn1.visible = false;
  4316. this.ui.rnNode.rn2.visible = false;
  4317. this.ui.rnNode.rn4.visible = true;
  4318. }
  4319. else if (this.ui.rnNode.rn4.visible) {
  4320. let name = this.ui.rnNode.inputName.text;
  4321. let code = this.ui.rnNode.inputCode.text;
  4322. if (code && code.length == 18) {
  4323. this.ui.rnNode.rn1.visible = false;
  4324. this.ui.rnNode.rn4.visible = false;
  4325. Moyu.authenticate(name, code, (res) => {
  4326. this.ui.rnNode.rn2.visible = !res;
  4327. this.ui.rnNode.rn3.visible = res;
  4328. this.ui.rnNode.btnDone.visible = res;
  4329. this.ui.rnNode.btnExit.visible = !res;
  4330. this.ui.rnNode.btnCheck.visible = !res;
  4331. if (res)
  4332. this.showFcm();
  4333. });
  4334. }
  4335. else
  4336. this.showMsg("信息填写不完整");
  4337. }
  4338. }
  4339. loadXy(type = 0) {
  4340. this.ui.xyNode.xy1.visible = false;
  4341. this.ui.xyNode.xy2.visible = true;
  4342. this.ui.xyNode.xyList.scrollToView(0);
  4343. if (type == 1) {
  4344. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4345. }
  4346. else if (type == 2) {
  4347. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4348. }
  4349. }
  4350. showXy(type = 0) {
  4351. this.xyBtn();
  4352. if (type == 0) {
  4353. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4354. this.ui.xyNode.btnSure.visible = true;
  4355. }
  4356. else {
  4357. this.ui.xyNode.btnYes.visible = true;
  4358. this.ui.xyNode.btnNo.visible = true;
  4359. }
  4360. }
  4361. else {
  4362. this.ui.xyNode.btnKnown.visible = true;
  4363. this.ui.mainBg.visible = true;
  4364. }
  4365. this.ui.xyNode.xy1.visible = true;
  4366. this.ui.xyNode.xy2.visible = false;
  4367. this.ui.xyNode.visible = true;
  4368. this.ui.visible = true;
  4369. }
  4370. xyBtn() {
  4371. this.ui.xyNode.btnSure.visible = false;
  4372. this.ui.xyNode.btnYes.visible = false;
  4373. this.ui.xyNode.btnNo.visible = false;
  4374. this.ui.xyNode.btnKnown.visible = false;
  4375. {
  4376. this.ui.xyNode.btnXy3.visible = false;
  4377. this.ui.xyNode.btnXy2.visible = true;
  4378. this.ui.xyNode.btnXy1.visible = true;
  4379. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4380. }
  4381. }
  4382. createXY(json) {
  4383. this.ysJson = json.content;
  4384. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4385. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4386. this.ui.xyNode.xy2.visible = true;
  4387. }
  4388. renderListItem(idx, cell) {
  4389. let xy = this.ysJson[idx];
  4390. cell.height = xy.line * 30;
  4391. cell.xyItem.text = xy.text;
  4392. }
  4393. onDestroy() {
  4394. this.agreeCall = null;
  4395. }
  4396. }
  4397. class SettingNode {
  4398. constructor(ui) {
  4399. this.showSetting = false;
  4400. this.openSound = true;
  4401. this.openShake = true;
  4402. this.ui = ui;
  4403. this.ui.soundBtn.onClick(this, this.switchSound);
  4404. this.ui.shakeBtn.onClick(this, this.switchShake);
  4405. this.ui.xyBtn.onClick(this, this.onXy);
  4406. this.ui.clickNode.onClick(this, this.changeSetting);
  4407. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4408. }
  4409. changeSetting() {
  4410. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4411. this.showSetting = !this.showSetting;
  4412. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4413. }
  4414. switchSound() {
  4415. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4416. this.openSound = !this.openSound;
  4417. Moyu.onSetting(this.openSound, this.openShake);
  4418. xGame.soundMgr.onSetting(this.openSound);
  4419. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4420. }
  4421. switchShake() {
  4422. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4423. this.openShake = !this.openShake;
  4424. Moyu.onSetting(this.openSound, this.openShake);
  4425. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4426. }
  4427. onXy() {
  4428. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4429. MoyuMgr.showXy(1);
  4430. }
  4431. }
  4432. class ui_UILevelDisplay extends fgui.GComponent {
  4433. static createInstance() {
  4434. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4435. }
  4436. onConstruct() {
  4437. this.n9 = (this.getChild("n9"));
  4438. this.myNode = (this.getChild("myNode"));
  4439. this.closeNode = (this.getChild("closeNode"));
  4440. }
  4441. }
  4442. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4443. class ui_UILevelProp extends fgui.GComponent {
  4444. static createInstance() {
  4445. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4446. }
  4447. onConstruct() {
  4448. this.n16 = (this.getChild("n16"));
  4449. this.myNode = (this.getChild("myNode"));
  4450. this.closeBtn = (this.getChild("closeBtn"));
  4451. this.moneyNode = (this.getChild("moneyNode"));
  4452. this.t1 = this.getTransition("t1");
  4453. }
  4454. }
  4455. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4456. class ui_ShowItem extends fgui.GComponent {
  4457. static createInstance() {
  4458. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4459. }
  4460. onConstruct() {
  4461. this.myImg = (this.getChild("myImg"));
  4462. }
  4463. }
  4464. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4465. class ShowItem {
  4466. constructor() {
  4467. this.ui = ui_ShowItem.createInstance();
  4468. }
  4469. destroySelf() {
  4470. if (!this.ui.isDisposed) {
  4471. this.ui.removeFromParent();
  4472. this.ui.dispose();
  4473. }
  4474. }
  4475. setParent(parent) {
  4476. parent.addChild(this.ui);
  4477. }
  4478. setPos(x, y) {
  4479. this.ui.x = x;
  4480. this.ui.y = y;
  4481. }
  4482. setUrl(index) {
  4483. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4484. }
  4485. }
  4486. class ui_UIPower extends fgui.GComponent {
  4487. static createInstance() {
  4488. return (fgui.UIPackage.createObject("game", "UIPower"));
  4489. }
  4490. onConstruct() {
  4491. this.n11 = (this.getChild("n11"));
  4492. this.myNode = (this.getChild("myNode"));
  4493. this.t0 = this.getTransition("t0");
  4494. }
  4495. }
  4496. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4497. class UIPower extends UIBase {
  4498. constructor() {
  4499. super();
  4500. }
  4501. onConstructor() {
  4502. this.ui = ui_UIPower.createInstance();
  4503. this.contentPane = this.ui;
  4504. this.isEject = false;
  4505. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4506. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4507. }
  4508. show() {
  4509. super.show();
  4510. this.ui.t0.play();
  4511. }
  4512. videoGetPower() {
  4513. Moyu.showVideoAd(() => {
  4514. DataMgr.setPower(xGame.common.videoPower, true);
  4515. xGame.eventMgr.event(POWER_TIME);
  4516. this.hide();
  4517. }, EAdType.getPower);
  4518. }
  4519. }
  4520. UIPower.uiName = "UIPower";
  4521. class UILevelProp extends UIBase {
  4522. constructor() {
  4523. super();
  4524. this.firstPos = 385;
  4525. this.secondPos = 467;
  4526. this.showItemArr = [];
  4527. }
  4528. onConstructor() {
  4529. this.ui = ui_UILevelProp.createInstance();
  4530. this.contentPane = this.ui;
  4531. this.isEject = false;
  4532. this.addUIClick(this.ui.closeBtn, this.hide);
  4533. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4534. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4535. }
  4536. show(level) {
  4537. super.show();
  4538. this.ui.t1.play();
  4539. this.level = level;
  4540. this.data = cfgTable.placeballData[this.level];
  4541. this.updateSelf();
  4542. this.showPreView();
  4543. this.moneyNode.ui.c1.selectedIndex = 2;
  4544. this.moneyNode.checkPowerTime();
  4545. this.moneyNode.powerChange();
  4546. }
  4547. showPreView() {
  4548. let item;
  4549. let data;
  4550. for (let index = 0; index < this.showItemArr.length; index++) {
  4551. item = this.showItemArr[index];
  4552. item.destroySelf();
  4553. }
  4554. this.showItemArr = [];
  4555. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4556. for (const key in cfgData) {
  4557. data = cfgData[key];
  4558. item = new ShowItem();
  4559. item.setParent(this.ui.myNode.displayRoot);
  4560. item.setPos(data.x, data.y);
  4561. item.setUrl(data.value);
  4562. this.showItemArr.push(item);
  4563. }
  4564. }
  4565. updateSelf() {
  4566. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4567. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4568. if (this.data.ball == -1) {
  4569. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4570. }
  4571. else {
  4572. this.ui.myNode.conditionTxt.text = "Reward";
  4573. }
  4574. let localData = DataMgr.getPlaceBallLevel(this.level);
  4575. let getAward = localData.getAward;
  4576. let cfg = cfgTable.placeballData[this.level];
  4577. let coin = this.data.award[0];
  4578. let diamond = this.data.award[1];
  4579. if (cfg.type == PlaceBallType.challenge) {
  4580. diamond = 0;
  4581. coin = 100;
  4582. }
  4583. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4584. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4585. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4586. if (cfg.type == PlaceBallType.challenge) {
  4587. this.ui.myNode.coinNode.numTxt.text = "";
  4588. }
  4589. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4590. if (coin > 0 && diamond > 0) {
  4591. this.ui.myNode.diamondNode.x = 385;
  4592. this.ui.myNode.coinNode.x = 467;
  4593. }
  4594. else {
  4595. this.ui.myNode.diamondNode.x = 385;
  4596. this.ui.myNode.coinNode.x = 385;
  4597. }
  4598. if (!getAward) {
  4599. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4600. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4601. }
  4602. else {
  4603. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4604. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4605. }
  4606. }
  4607. startGame() {
  4608. if (DataMgr.powerEnough()) {
  4609. this.ui.myNode.startBtn.touchable = false;
  4610. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4611. console.log('zh:startGame ');
  4612. this.ui.myNode.startBtn.touchable = true;
  4613. DataMgr.setPower(-1);
  4614. xGame.eventMgr.event(POWER_TIME);
  4615. xGame.common.gameMode = GameMode.placeBall;
  4616. xGame.common.placeBallCurLevel = this.level;
  4617. xGame.uiMgr.Show(UIGame);
  4618. xGame.uiMgr.Hide(UILevelDisplay);
  4619. xGame.uiMgr.Hide(UIMain);
  4620. this.hide();
  4621. }));
  4622. }
  4623. else {
  4624. xGame.uiMgr.Show(UIPower);
  4625. }
  4626. }
  4627. hide() {
  4628. super.hide();
  4629. }
  4630. }
  4631. UILevelProp.uiName = "UILevelProp";
  4632. class PutBallLevelDisplay {
  4633. constructor(ui, index) {
  4634. this.index = 0;
  4635. this.ui = ui;
  4636. this.index = index;
  4637. this.ui.onClick(this, this.clickSelf);
  4638. this.updateSelf();
  4639. this.ui.levelTxt.text = (this.index + 1) + "";
  4640. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4641. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4642. }
  4643. updateSelf() {
  4644. let level = this.index + 1;
  4645. this.data = DataMgr.getPlaceBallLevel(level);
  4646. this.ui.starNode.c1.selectedIndex = this.data.star;
  4647. let isChallenge = cfgTable.placeballData[level].type;
  4648. if (this.data.isCur) {
  4649. if (isChallenge) {
  4650. this.ui.c1.selectedIndex = 5;
  4651. }
  4652. else {
  4653. this.ui.c1.selectedIndex = 2;
  4654. }
  4655. }
  4656. else {
  4657. if (this.data.play) {
  4658. if (this.data.star == 3) {
  4659. this.ui.c1.selectedIndex = 0;
  4660. }
  4661. else {
  4662. this.ui.c1.selectedIndex = 1;
  4663. }
  4664. }
  4665. else {
  4666. if (isChallenge) {
  4667. this.ui.c1.selectedIndex = 4;
  4668. }
  4669. else {
  4670. this.ui.c1.selectedIndex = 3;
  4671. }
  4672. }
  4673. }
  4674. }
  4675. clickSelf() {
  4676. if (!this.data.play)
  4677. return;
  4678. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4679. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4680. }
  4681. }
  4682. class UILevelDisplay extends UIBase {
  4683. constructor() {
  4684. super();
  4685. }
  4686. onConstructor() {
  4687. this.ui = ui_UILevelDisplay.createInstance();
  4688. this.contentPane = this.ui;
  4689. this.isEject = false;
  4690. this.myList = this.ui.myNode.myList;
  4691. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4692. this.levelItemArr = [];
  4693. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4694. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4695. this.myList.numItems = levelNum;
  4696. if (Moyu.isKs)
  4697. this.ui.closeNode.closeBtn.x += 100;
  4698. }
  4699. levelItemRender(index, target) {
  4700. let item = new PutBallLevelDisplay(target, index);
  4701. this.levelItemArr.push(item);
  4702. }
  4703. show() {
  4704. super.show();
  4705. this.updateLevel();
  4706. this.scrollToPlace();
  4707. }
  4708. updateLevel() {
  4709. let temp;
  4710. for (let index = 0; index < this.levelItemArr.length; index++) {
  4711. temp = this.levelItemArr[index];
  4712. temp.updateSelf();
  4713. }
  4714. }
  4715. scrollToPlace() {
  4716. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4717. let passArr = DataMgr.getPlaceBallLevelList();
  4718. let offest = passArr.length;
  4719. if (offest >= maxNum - 1)
  4720. offest = maxNum - 1;
  4721. this.myList.scrollToView(offest, true, true);
  4722. }
  4723. hide() {
  4724. super.hide();
  4725. }
  4726. }
  4727. UILevelDisplay.uiName = "UILevelDisplay";
  4728. class ui_UIMatching extends fgui.GComponent {
  4729. static createInstance() {
  4730. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4731. }
  4732. onConstruct() {
  4733. this.n5 = (this.getChild("n5"));
  4734. this.n49 = (this.getChild("n49"));
  4735. this.n51 = (this.getChild("n51"));
  4736. this.n64 = (this.getChild("n64"));
  4737. this.n2 = (this.getChild("n2"));
  4738. this.n53 = (this.getChild("n53"));
  4739. this.n54 = (this.getChild("n54"));
  4740. this.n56 = (this.getChild("n56"));
  4741. this.n58 = (this.getChild("n58"));
  4742. this.n59 = (this.getChild("n59"));
  4743. this.n57 = (this.getChild("n57"));
  4744. this.n60 = (this.getChild("n60"));
  4745. this.n62 = (this.getChild("n62"));
  4746. this.awardTxt = (this.getChild("awardTxt"));
  4747. this.n61 = (this.getChild("n61"));
  4748. this.selfHead = (this.getChild("selfHead"));
  4749. this.aiHead = (this.getChild("aiHead"));
  4750. this.n82 = (this.getChild("n82"));
  4751. this.n84 = (this.getChild("n84"));
  4752. this.n83 = (this.getChild("n83"));
  4753. this.t1 = this.getTransition("t1");
  4754. this.t2 = this.getTransition("t2");
  4755. this.t3 = this.getTransition("t3");
  4756. this.t4 = this.getTransition("t4");
  4757. }
  4758. }
  4759. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4760. class UIMatching extends UIBase {
  4761. constructor() {
  4762. super();
  4763. }
  4764. onConstructor() {
  4765. this.ui = ui_UIMatching.createInstance();
  4766. this.contentPane = this.ui;
  4767. this.isEject = false;
  4768. }
  4769. show(callback) {
  4770. super.show();
  4771. PlatMgr.showBanner(true);
  4772. this.callback = callback;
  4773. let user = Moyu.getUserInfo();
  4774. if (!this.selfPot) {
  4775. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4776. }
  4777. if (!this.aiPot) {
  4778. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4779. }
  4780. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4781. this.ui.selfHead.nameTxt.text = user.nickName;
  4782. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4783. this.ui.aiHead.nameTxt.text = "???";
  4784. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4785. this.ui.selfHead.c1.selectedIndex = 0;
  4786. this.ui.aiHead.c1.selectedIndex = 0;
  4787. this.ui.selfHead.x = this.selfPot.x;
  4788. this.ui.selfHead.y = this.selfPot.y;
  4789. this.ui.aiHead.x = this.aiPot.x;
  4790. this.ui.aiHead.y = this.aiPot.y;
  4791. switch (xGame.common.gameMode) {
  4792. case GameMode.classic:
  4793. break;
  4794. case GameMode.bigMove:
  4795. this.initSkillData();
  4796. break;
  4797. default:
  4798. break;
  4799. }
  4800. this.ui.t1.play(Laya.Handler.create(this, () => {
  4801. this.ui.t2.play(Laya.Handler.create(this, () => {
  4802. switch (xGame.common.gameMode) {
  4803. case GameMode.classic:
  4804. this.waitingPeople();
  4805. break;
  4806. case GameMode.bigMove:
  4807. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4808. break;
  4809. default:
  4810. break;
  4811. }
  4812. }));
  4813. }));
  4814. }
  4815. initSkillData() {
  4816. this.skillSelectData = [];
  4817. let skillUrl = xGame.common.skillIconList;
  4818. let skillName = xGame.common.skillNameList;
  4819. let skillLevel = DataMgr.getBigSkillList();
  4820. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4821. for (let index = 0; index < 5; index++) {
  4822. let obj = {};
  4823. obj.skillImg = skillUrl[index];
  4824. obj.skillName = skillName[index];
  4825. obj.skillType = skillType[index];
  4826. obj.skillLevel = skillLevel[index];
  4827. this.skillSelectData.push(obj);
  4828. }
  4829. }
  4830. getAISkillLevel(myLevel) {
  4831. let video = xGame.common.upSkillLevel;
  4832. let aiLevel;
  4833. let temp;
  4834. if (video) {
  4835. temp = xGame.common.randomNum(-2, -1);
  4836. }
  4837. else {
  4838. if (myLevel <= 5) {
  4839. temp = xGame.common.randomNum(1, 3);
  4840. }
  4841. else if (myLevel <= 9) {
  4842. temp = xGame.common.randomNum(-2, 1);
  4843. }
  4844. else {
  4845. temp = xGame.common.randomNum(-4, 0);
  4846. }
  4847. }
  4848. aiLevel = temp + myLevel;
  4849. if (aiLevel <= 1)
  4850. aiLevel = 1;
  4851. if (aiLevel >= 10)
  4852. aiLevel = 10;
  4853. return aiLevel;
  4854. }
  4855. getAISkillType() {
  4856. return xGame.common.randomNum(1, 4);
  4857. let successTimes = DataMgr.getSkillSuccessTimes();
  4858. let info = cfgTable.aiskillData[successTimes];
  4859. if (!info) {
  4860. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4861. info = cfgTable.aiskillData[max];
  4862. }
  4863. let dataArr = info.skillselect;
  4864. let myCfg = {};
  4865. for (let index = 0; index < dataArr.length; index++) {
  4866. let temp = dataArr[index].split('-');
  4867. myCfg[temp[0]] = {};
  4868. myCfg[temp[0]].id = parseInt(temp[0]);
  4869. myCfg[temp[0]].weight = parseInt(temp[1]);
  4870. }
  4871. let aiCfg = xGame.common.initWeight(myCfg);
  4872. let curData = xGame.common.getRandomWeightData(aiCfg);
  4873. return parseInt(curData.id);
  4874. }
  4875. getAISkillData(index) {
  4876. let myLevel = this.skillSelectData[index].skillLevel;
  4877. let aiLevel = this.getAISkillLevel(myLevel);
  4878. let aiType = this.getAISkillType() - 1;
  4879. return { aiLevel, aiType } = { aiLevel, aiType };
  4880. }
  4881. skillSelectFinish(index) {
  4882. let aiInfo = this.getAISkillData(index);
  4883. xGame.common.gameMgr.selfCurSkill = index;
  4884. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4885. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4886. this.ui.selfHead.c1.selectedIndex = 1;
  4887. this.ui.aiHead.c1.selectedIndex = 1;
  4888. let myData = this.skillSelectData[index];
  4889. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4890. let guide = DataMgr.getSkillGuide();
  4891. if (guide == 0) {
  4892. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  4893. }
  4894. else {
  4895. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4896. }
  4897. let aiData = this.skillSelectData[aiInfo.aiType];
  4898. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4899. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4900. this.waitingPeople();
  4901. }
  4902. waitingPeople() {
  4903. let time = xGame.common.randomNum(1000, 3000);
  4904. time += 1000;
  4905. Laya.timer.once(time, this, () => {
  4906. this.matchingSuccess();
  4907. });
  4908. }
  4909. matchingSuccess() {
  4910. let gameUI = xGame.common.gameUI;
  4911. let name = gameUI.ui.topNode.aiNameTxt.text;
  4912. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4913. this.ui.aiHead.nameTxt.text = name;
  4914. this.ui.aiHead.headImg.url = url;
  4915. name = gameUI.ui.topNode.selfNameTxt.text;
  4916. url = gameUI.ui.topNode.selfHeadLoader.url;
  4917. this.ui.selfHead.nameTxt.text = name;
  4918. this.ui.selfHead.headImg.url = url;
  4919. this.ui.t3.play(Laya.Handler.create(this, () => {
  4920. this.callback && this.callback();
  4921. this.ui.t4.play(Laya.Handler.create(this, () => {
  4922. this.destroySelf();
  4923. }));
  4924. }));
  4925. }
  4926. destroySelf() {
  4927. this.callback = null;
  4928. this.skillSelectData = null;
  4929. this.selfPot = null;
  4930. this.aiPot = null;
  4931. if (!this.ui.isDisposed) {
  4932. this.ui.removeFromParent();
  4933. this.ui.dispose();
  4934. }
  4935. xGame.uiMgr.destroyUI(this);
  4936. }
  4937. }
  4938. UIMatching.uiName = "UIMatching";
  4939. class ui_UIRanking extends fgui.GComponent {
  4940. static createInstance() {
  4941. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4942. }
  4943. onConstruct() {
  4944. this.n26 = (this.getChild("n26"));
  4945. this.myNode = (this.getChild("myNode"));
  4946. }
  4947. }
  4948. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4949. class UIRanking extends UIBase {
  4950. constructor() {
  4951. super();
  4952. this.showSelf = true;
  4953. this.rankType = 1;
  4954. this.rankList = [];
  4955. this.myIndex = 0;
  4956. this.myStar = 0;
  4957. }
  4958. onConstructor() {
  4959. this.ui = ui_UIRanking.createInstance();
  4960. this.contentPane = this.ui;
  4961. this.isEject = false;
  4962. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4963. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4964. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4965. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4966. this.ui.myNode.myList.setVirtual();
  4967. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4968. }
  4969. show() {
  4970. super.show();
  4971. this.myIndex = 51;
  4972. Moyu.getRankList({
  4973. rankId: xGame.common.curRankID,
  4974. type: MoyuRankType.total,
  4975. page: 1,
  4976. pageSize: 50,
  4977. }, this, this.updateItemData);
  4978. this.updateSelf();
  4979. let self = Moyu.getUserInfo();
  4980. if (!self.isAuth) {
  4981. Moyu.initUser(this, () => {
  4982. DataMgr.upRankData();
  4983. });
  4984. }
  4985. }
  4986. updateSelfItem() {
  4987. let self = Moyu.getUserInfo();
  4988. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4989. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4990. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4991. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  4992. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4993. }
  4994. updateItemData(data) {
  4995. this.myStar = xGame.common.getAllStarNum();
  4996. if (this.rankList.length < 2) {
  4997. this.rankList = data;
  4998. let self = Moyu.getUserInfo();
  4999. for (let i = 0; i < data.length; i++) {
  5000. let data = this.rankList[i];
  5001. if (data.userId == self.userId) {
  5002. this.rankList.splice(i, 1);
  5003. break;
  5004. }
  5005. }
  5006. for (let i = 0; i < data.length; i++) {
  5007. let data = this.rankList[i];
  5008. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5009. this.myIndex = i + 1;
  5010. let user = { headIcon: self.headIcon, nickName: "myself" };
  5011. let ud = { user: user, data: {} };
  5012. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5013. if (Moyu.platType < 11) {
  5014. user.headIcon = self.headIcon;
  5015. user.nickName = self.nickName;
  5016. }
  5017. this.rankList.splice(i, 0, md);
  5018. break;
  5019. }
  5020. }
  5021. }
  5022. this.updateSelfItem();
  5023. this.ui.myNode.myList.numItems = this.rankList.length;
  5024. }
  5025. updateItemUI(index, obj) {
  5026. let data = this.rankList[index];
  5027. let userData = JSON.parse(data.userData).user;
  5028. obj.nameTxt.text = userData.nickName.toString();
  5029. obj.valueTxt.text = data.rankScore;
  5030. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5031. obj.rankTxt.text = index + 1;
  5032. switch (index) {
  5033. case 0:
  5034. this.setImg(obj, 1, 0, 0);
  5035. obj.rankTxt.color = "#FFC047";
  5036. break;
  5037. case 1:
  5038. this.setImg(obj, 0, 1, 0);
  5039. obj.rankTxt.color = "#ACACAC";
  5040. break;
  5041. case 2:
  5042. this.setImg(obj, 0, 0, 1);
  5043. obj.rankTxt.color = "#D09672";
  5044. break;
  5045. default:
  5046. this.setImg(obj, 0, 0, 0);
  5047. obj.rankTxt.color = "#496FAB";
  5048. break;
  5049. }
  5050. }
  5051. setImg(obj, a, b, c) {
  5052. obj.img1.visible = a ? true : false;
  5053. obj.img2.visible = b ? true : false;
  5054. obj.img3.visible = c ? true : false;
  5055. }
  5056. changeList(type) {
  5057. this.rankType = type;
  5058. this.updateSelf();
  5059. }
  5060. changeSelfNode() {
  5061. this.showSelf = !this.showSelf;
  5062. this.updateSelf();
  5063. }
  5064. updateSelf() {
  5065. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5066. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5067. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5068. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5069. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5070. }
  5071. }
  5072. UIRanking.uiName = "UIRanking";
  5073. class ui_UISecretary extends fgui.GComponent {
  5074. static createInstance() {
  5075. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5076. }
  5077. onConstruct() {
  5078. this.n0 = (this.getChild("n0"));
  5079. this.myNode = (this.getChild("myNode"));
  5080. this.rightBtn = (this.getChild("rightBtn"));
  5081. this.leftBtn = (this.getChild("leftBtn"));
  5082. this.closeBtn = (this.getChild("closeBtn"));
  5083. this.t0 = this.getTransition("t0");
  5084. }
  5085. }
  5086. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5087. class UISecretary extends UIBase {
  5088. constructor() {
  5089. super();
  5090. this.curIndex = 1;
  5091. }
  5092. onConstructor() {
  5093. this.ui = ui_UISecretary.createInstance();
  5094. this.contentPane = this.ui;
  5095. this.isEject = false;
  5096. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5097. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  5098. this.addUIClick(this.ui.rightBtn, this.turnRight);
  5099. this.nodeObj = { left: null, right: null, cur: null };
  5100. this.nodeObj.left = this.ui.myNode.gameNode1;
  5101. this.nodeObj.right = this.ui.myNode.gameNode2;
  5102. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5103. }
  5104. show() {
  5105. super.show();
  5106. this.ui.t0.play();
  5107. this.updateData();
  5108. }
  5109. addSecretarySpine(node, spineName) {
  5110. if (spineName == "mishu") {
  5111. if (this.secretarySpine1) {
  5112. node.displayObject.destroyChildren();
  5113. this.playWoman(this.secretarySpine1, node.displayObject);
  5114. }
  5115. else {
  5116. let spine1 = new SpineMgr("mishu", () => {
  5117. this.secretarySpine1 = spine1;
  5118. this.playWoman(this.secretarySpine1, node.displayObject);
  5119. });
  5120. }
  5121. }
  5122. else {
  5123. if (this.secretarySpine2) {
  5124. node.displayObject.destroyChildren();
  5125. this.playWoman(this.secretarySpine2, node.displayObject);
  5126. }
  5127. else {
  5128. let spine2 = new SpineMgr("xiaomishu2", () => {
  5129. this.secretarySpine2 = spine2;
  5130. this.playWoman(this.secretarySpine2, node.displayObject);
  5131. });
  5132. }
  5133. }
  5134. }
  5135. playWoman(node, parent) {
  5136. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  5137. let yy = this.ui.myNode.gameNode1.secretary.height;
  5138. let scale = 1.5;
  5139. if (node == this.secretarySpine2) {
  5140. scale = 1.2;
  5141. }
  5142. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5143. node.play(data, 1, true, parent);
  5144. }
  5145. turnLeft() {
  5146. this.curIndex--;
  5147. if (this.curIndex < 1) {
  5148. this.curIndex = 2;
  5149. }
  5150. let left = this.nodeObj.left;
  5151. let right = this.nodeObj.right;
  5152. let cur = this.nodeObj.cur;
  5153. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5154. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5155. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5156. this.updateData();
  5157. }));
  5158. this.ui.myNode.setChildIndex(right, 2);
  5159. this.nodeObj.left = cur;
  5160. this.nodeObj.right = left;
  5161. this.nodeObj.cur = right;
  5162. }
  5163. turnRight() {
  5164. this.curIndex++;
  5165. if (this.curIndex > 2) {
  5166. this.curIndex = 1;
  5167. }
  5168. let left = this.nodeObj.left;
  5169. let right = this.nodeObj.right;
  5170. let cur = this.nodeObj.cur;
  5171. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5172. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5173. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5174. this.updateData();
  5175. }));
  5176. this.ui.myNode.setChildIndex(left, 2);
  5177. this.nodeObj.left = right;
  5178. this.nodeObj.right = cur;
  5179. this.nodeObj.cur = left;
  5180. }
  5181. updateData() {
  5182. let data = cfgTable.secretaryshopData;
  5183. let children = this.ui.myNode._children;
  5184. let temp;
  5185. let curData;
  5186. for (let index = 0; index < children.length; index++) {
  5187. temp = children[index];
  5188. if (index == 2) {
  5189. curData = data[this.curIndex];
  5190. temp.purchaseBtn.touchable = true;
  5191. }
  5192. else {
  5193. temp.purchaseBtn.touchable = false;
  5194. if (this.curIndex == 1) {
  5195. curData = data[2];
  5196. }
  5197. else {
  5198. curData = data[1];
  5199. }
  5200. }
  5201. temp.heightTxt.text = curData.height;
  5202. temp.foodTxt.text = curData.food;
  5203. temp.historyTxt.text = curData.history;
  5204. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5205. this.addSecretarySpine(temp.secretary, curData.spine);
  5206. let womanIndex = curData.id - 1;
  5207. let getWoman = DataMgr.getSecretary(womanIndex);
  5208. let curUse = DataMgr.getCurSecretary();
  5209. if (getWoman) {
  5210. if (curUse == womanIndex) {
  5211. temp.purchaseBtn.c1.selectedIndex = 1;
  5212. }
  5213. else {
  5214. temp.purchaseBtn.c1.selectedIndex = 2;
  5215. }
  5216. }
  5217. else {
  5218. temp.purchaseBtn.c1.selectedIndex = 0;
  5219. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5220. }
  5221. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5222. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5223. }
  5224. }
  5225. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5226. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5227. if (getWoman) {
  5228. if (curUse != womanIndex) {
  5229. console.log();
  5230. DataMgr.setCurSecretary(womanIndex);
  5231. this.updateData();
  5232. }
  5233. }
  5234. else {
  5235. let need = needDiamond;
  5236. if (DataMgr.diamondEnough(need)) {
  5237. DataMgr.setDiamond(-need);
  5238. DataMgr.setSecretary(womanIndex, 1);
  5239. DataMgr.setCurSecretary(womanIndex);
  5240. this.updateData();
  5241. }
  5242. else {
  5243. xGame.uiMgr.Show(UIAddProp, 1);
  5244. }
  5245. }
  5246. }
  5247. closeSelf() {
  5248. this.hide();
  5249. }
  5250. }
  5251. UISecretary.uiName = "UISecretary";
  5252. class ui_UIShop extends fgui.GComponent {
  5253. static createInstance() {
  5254. return (fgui.UIPackage.createObject("game", "UIShop"));
  5255. }
  5256. onConstruct() {
  5257. this.n48 = (this.getChild("n48"));
  5258. this.n0 = (this.getChild("n0"));
  5259. this.secretary = (this.getChild("secretary"));
  5260. this.talkNode = (this.getChild("talkNode"));
  5261. this.closeNode = (this.getChild("closeNode"));
  5262. this.moneyNode = (this.getChild("moneyNode"));
  5263. this.myNode = (this.getChild("myNode"));
  5264. }
  5265. }
  5266. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5267. class BallRodDisplay {
  5268. constructor(ui, index) {
  5269. this.index = 0;
  5270. this.uiIndex = 0;
  5271. this.ui = ui;
  5272. this.index = index;
  5273. this.initData();
  5274. }
  5275. initData() {
  5276. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5277. let data = cfgTable.ballrodData[this.index + 1];
  5278. this.ui.nameTxt.text = data.name;
  5279. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5280. this.ui.levelNode.c1.selectedIndex = data.quality;
  5281. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5282. if (data.spine) {
  5283. this.mySpine = new SpineMgr(data.spine, () => {
  5284. let xx = 150;
  5285. let yy = 70;
  5286. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5287. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5288. });
  5289. }
  5290. }
  5291. updateSelf() {
  5292. let get = DataMgr.getBallRod(this.index);
  5293. if (get == null)
  5294. get = 1;
  5295. let curUse = DataMgr.getCurBallRod();
  5296. if (get) {
  5297. if (curUse == this.index) {
  5298. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5299. }
  5300. else {
  5301. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5302. }
  5303. }
  5304. else {
  5305. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5306. }
  5307. }
  5308. buyBallRod() {
  5309. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5310. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5311. switch (selectedIndex) {
  5312. case 0:
  5313. break;
  5314. case 1:
  5315. DataMgr.setCurBallRod(this.index);
  5316. let ui = xGame.uiMgr.getUI(UIShop);
  5317. ui.updateBallRod();
  5318. break;
  5319. case 2:
  5320. let data = cfgTable.ballrodData[this.index + 1];
  5321. let need = data.price;
  5322. if (DataMgr.diamondEnough(need)) {
  5323. DataMgr.setDiamond(-need);
  5324. DataMgr.setBallRod(this.index, 1);
  5325. DataMgr.setCurBallRod(this.index);
  5326. let ui = xGame.uiMgr.getUI(UIShop);
  5327. ui.updateBallRod();
  5328. }
  5329. else {
  5330. xGame.uiMgr.Show(UIAddProp, 1);
  5331. }
  5332. break;
  5333. default:
  5334. break;
  5335. }
  5336. }
  5337. }
  5338. class UIShop extends UIBase {
  5339. constructor() {
  5340. super();
  5341. this.itemNums = 0;
  5342. }
  5343. onConstructor() {
  5344. this.ui = ui_UIShop.createInstance();
  5345. this.contentPane = this.ui;
  5346. this.isEject = false;
  5347. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5348. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5349. this.addUIClick(this.ui, this.interuptSecretary);
  5350. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5351. this.ballRodArr = [];
  5352. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5353. this.ui.myNode.myList.numItems = this.itemNums;
  5354. if (Moyu.isKs)
  5355. this.ui.closeNode.closeBtn.x += 100;
  5356. }
  5357. show() {
  5358. super.show();
  5359. this.playSecretaryIdle();
  5360. this.updateBallRod();
  5361. }
  5362. updateBallRod() {
  5363. for (let index = 0; index < this.ballRodArr.length; index++) {
  5364. this.ballRodArr[index].updateSelf();
  5365. }
  5366. }
  5367. renderBallRod(sort, obj) {
  5368. let index = this.getIndexBySort(sort + 1) - 1;
  5369. let ballRod = new BallRodDisplay(obj, index);
  5370. this.ballRodArr.push(ballRod);
  5371. }
  5372. getIndexBySort(sort) {
  5373. let object = cfgTable.ballrodData;
  5374. for (const key in object) {
  5375. if (object[key].sort == sort) {
  5376. return parseInt(key);
  5377. }
  5378. }
  5379. }
  5380. playSecretaryIdle() {
  5381. let parent = this.ui.secretary.displayObject;
  5382. parent.destroyChildren();
  5383. let xx = this.ui.secretary.width / 2;
  5384. let yy = this.ui.secretary.height;
  5385. let scale = xGame.common.getSecretaryScale();
  5386. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5387. xGame.common.secretary.play(data, 1, true, parent);
  5388. }
  5389. interuptSecretary() {
  5390. Laya.timer.clearAll(this);
  5391. this.playSecretaryRandomSound();
  5392. }
  5393. playSecretaryRandomSound() {
  5394. if (this.isHide)
  5395. return;
  5396. let time = xGame.common.randomNum(45000, 60000);
  5397. Laya.timer.once(time, this, () => {
  5398. if (this.isHide)
  5399. return;
  5400. let index = xGame.common.randomNum(4, 7);
  5401. xGame.soundMgr.playSound("s_main0" + index);
  5402. let words = 1;
  5403. switch (index) {
  5404. case 4:
  5405. words = 5;
  5406. break;
  5407. case 5:
  5408. words = 3;
  5409. break;
  5410. case 6:
  5411. words = 6;
  5412. break;
  5413. case 7:
  5414. words = 7;
  5415. break;
  5416. default:
  5417. break;
  5418. }
  5419. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5420. this.playSecretaryRandomSound();
  5421. });
  5422. }
  5423. closeSelf() {
  5424. this.hide();
  5425. }
  5426. }
  5427. UIShop.uiName = "UIShop";
  5428. class ui_UISign extends fgui.GComponent {
  5429. static createInstance() {
  5430. return (fgui.UIPackage.createObject("game", "UISign"));
  5431. }
  5432. onConstruct() {
  5433. this.n6 = (this.getChild("n6"));
  5434. this.closeNode = (this.getChild("closeNode"));
  5435. this.myNode = (this.getChild("myNode"));
  5436. this.moneyNode = (this.getChild("moneyNode"));
  5437. this.secretary = (this.getChild("secretary"));
  5438. this.talkNode = (this.getChild("talkNode"));
  5439. this.tripleBtn = (this.getChild("tripleBtn"));
  5440. this.normalBtn = (this.getChild("normalBtn"));
  5441. this.tipsNode = (this.getChild("tipsNode"));
  5442. this.againBtn = (this.getChild("againBtn"));
  5443. this.t0 = this.getTransition("t0");
  5444. }
  5445. }
  5446. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5447. class SignMax {
  5448. constructor(ui) {
  5449. this.ui = ui;
  5450. }
  5451. updateSelf(index, sameDay, curDayIndex) {
  5452. let data = cfgTable.signData[index + 1];
  5453. this.ui.titleTxt.text = data.title;
  5454. let arr1 = data.award[0].split('-');
  5455. let arr2 = data.award[1].split('-');
  5456. let num1 = parseInt(arr1[1]);
  5457. let num2 = parseInt(arr2[1]);
  5458. this.ui.numTxt1.text = num1 + "";
  5459. this.ui.numTxt2.text = num2 + "";
  5460. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5461. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5462. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5463. this.ui.numTxt1.visible = false;
  5464. }
  5465. else {
  5466. this.ui.numTxt1.visible = true;
  5467. }
  5468. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5469. this.ui.numTxt2.visible = false;
  5470. }
  5471. else {
  5472. this.ui.numTxt2.visible = true;
  5473. }
  5474. if (index < curDayIndex) {
  5475. this.ui.c1.selectedIndex = 1;
  5476. }
  5477. else if (index == curDayIndex) {
  5478. if (sameDay) {
  5479. this.ui.c1.selectedIndex = 2;
  5480. }
  5481. else {
  5482. this.ui.c1.selectedIndex = 2;
  5483. }
  5484. }
  5485. else {
  5486. this.ui.c1.selectedIndex = 0;
  5487. }
  5488. }
  5489. }
  5490. class SignNormal {
  5491. constructor(ui) {
  5492. this.ui = ui;
  5493. }
  5494. updateSelf(index, sameDay, curDayIndex) {
  5495. let data = cfgTable.signData[index + 1];
  5496. this.ui.titleTxt.text = data.title;
  5497. let arr = data.award[0].split('-');
  5498. let type = parseInt(arr[0]);
  5499. let num = parseInt(arr[1]);
  5500. this.ui.numTxt.text = num + "";
  5501. if (type > 2) {
  5502. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5503. this.ui.myIcon.rotation = 0;
  5504. }
  5505. else {
  5506. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5507. this.ui.myIcon.rotation = 0;
  5508. }
  5509. if (xGame.common.signAwardContainsRod(data.award)) {
  5510. this.ui.numTxt.visible = false;
  5511. }
  5512. else {
  5513. this.ui.numTxt.visible = true;
  5514. }
  5515. if (index < curDayIndex) {
  5516. this.ui.c1.selectedIndex = 1;
  5517. }
  5518. else if (index == curDayIndex) {
  5519. if (sameDay) {
  5520. this.ui.c1.selectedIndex = 2;
  5521. }
  5522. else {
  5523. this.ui.c1.selectedIndex = 2;
  5524. }
  5525. }
  5526. else {
  5527. this.ui.c1.selectedIndex = 0;
  5528. }
  5529. }
  5530. }
  5531. class UISign extends UIBase {
  5532. constructor() {
  5533. super();
  5534. this.curDayIndex = 0;
  5535. this.starX = 0;
  5536. }
  5537. onConstructor() {
  5538. this.ui = ui_UISign.createInstance();
  5539. this.contentPane = this.ui;
  5540. this.isEject = false;
  5541. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5542. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5543. this.initSignItem();
  5544. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5545. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5546. }
  5547. show() {
  5548. super.show();
  5549. this.ui.t0.play();
  5550. this.playSecretaryIdle();
  5551. this.updateSign();
  5552. }
  5553. initSignItem() {
  5554. this.signArr = [];
  5555. for (let index = 0; index < 6; index++) {
  5556. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5557. this.signArr.push(temp);
  5558. }
  5559. this.signMax = new SignMax(this.ui.myNode.day7);
  5560. if (Moyu.isKs)
  5561. this.ui.closeNode.closeBtn.x += 100;
  5562. }
  5563. updateSign() {
  5564. let sameDay = xGame.common.judgeSameDay();
  5565. let max = 7;
  5566. this.curDayIndex = DataMgr.getSignData();
  5567. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5568. this.curDayIndex = 0;
  5569. if (!sameDay) {
  5570. this.ui.normalBtn.visible = true;
  5571. this.ui.tipsNode.visible = false;
  5572. this.ui.againBtn.visible = false;
  5573. }
  5574. else {
  5575. this.ui.normalBtn.visible = false;
  5576. let again = DataMgr.getExtraSign();
  5577. let isCurrency = false;
  5578. let index = this.curDayIndex;
  5579. if (index == 0)
  5580. index = 7;
  5581. let award = cfgTable.signData[index].award;
  5582. let num = award[0].split("-")[0];
  5583. if (num == "1" || num == "2")
  5584. isCurrency = true;
  5585. let showAgain = again == 0 && isCurrency;
  5586. this.ui.againBtn.visible = showAgain;
  5587. this.ui.tipsNode.visible = !showAgain;
  5588. }
  5589. for (let index = 0; index < this.signArr.length; index++) {
  5590. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5591. }
  5592. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5593. }
  5594. playSecretaryIdle() {
  5595. let parent = this.ui.secretary.displayObject;
  5596. parent.destroyChildren();
  5597. let xx = this.ui.secretary.width / 2;
  5598. let yy = this.ui.secretary.height;
  5599. let scale = xGame.common.getSecretaryScale();
  5600. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5601. xGame.common.secretary.play(data, 1, true, parent);
  5602. }
  5603. closeSelf() {
  5604. this.hide();
  5605. }
  5606. normalGetAward() {
  5607. let sameDay = xGame.common.judgeSameDay();
  5608. if (!sameDay) {
  5609. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5610. let temp;
  5611. let type;
  5612. let num;
  5613. let arr = [];
  5614. for (let index = 0; index < award.length; index++) {
  5615. temp = award[index].split("-");
  5616. type = parseInt(temp[0]);
  5617. num = parseInt(temp[1]);
  5618. let awardType = new AwardType();
  5619. awardType.num = num;
  5620. awardType.type = type;
  5621. arr.push(awardType);
  5622. }
  5623. xGame.common.getAward(arr, (watchVideo) => {
  5624. this.curDayIndex++;
  5625. if (this.curDayIndex > 7)
  5626. this.curDayIndex = 0;
  5627. DataMgr.setSignData(this.curDayIndex);
  5628. DataMgr.setSignTime(new Date().getTime());
  5629. if (watchVideo) {
  5630. DataMgr.setExtraSign(1);
  5631. Moyu.sendDataEvent("signIn1");
  5632. }
  5633. this.updateSign();
  5634. });
  5635. }
  5636. }
  5637. againGetAward() {
  5638. Moyu.sendDataEvent("signIn2");
  5639. Moyu.showVideoAd(() => {
  5640. let index = this.curDayIndex;
  5641. if (index == 0)
  5642. index = 7;
  5643. let award = cfgTable.signData[index].award;
  5644. let temp;
  5645. let type;
  5646. let num;
  5647. for (let index = 0; index < award.length; index++) {
  5648. temp = award[index].split("-");
  5649. type = parseInt(temp[0]);
  5650. num = parseInt(temp[1]) * 3;
  5651. xGame.common.playObjFlyAnim(num, type);
  5652. }
  5653. DataMgr.setExtraSign(1);
  5654. this.updateSign();
  5655. }, EAdType.againSign);
  5656. }
  5657. }
  5658. UISign.uiName = "UISign";
  5659. class ui_UISkill extends fgui.GComponent {
  5660. static createInstance() {
  5661. return (fgui.UIPackage.createObject("game", "UISkill"));
  5662. }
  5663. onConstruct() {
  5664. this.n48 = (this.getChild("n48"));
  5665. this.n0 = (this.getChild("n0"));
  5666. this.secretary = (this.getChild("secretary"));
  5667. this.talkNode = (this.getChild("talkNode"));
  5668. this.closeNode = (this.getChild("closeNode"));
  5669. this.moneyNode = (this.getChild("moneyNode"));
  5670. this.skillNode = (this.getChild("skillNode"));
  5671. this.guideNode = (this.getChild("guideNode"));
  5672. }
  5673. }
  5674. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5675. class SkillDisplay {
  5676. constructor(ui, data, uiIndex) {
  5677. this.starX = 0;
  5678. this.starY = 0;
  5679. this.index = 0;
  5680. this.ui = ui;
  5681. this.data = data;
  5682. this.index = uiIndex;
  5683. this.initSelf();
  5684. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5685. }
  5686. initSelf() {
  5687. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5688. this.ui.nameTxt.text = this.data.name;
  5689. this.ui.describeTxt.text = this.data.describe;
  5690. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5691. this.ui.startBtn.onClick(this, this.startGame);
  5692. this.updateSelf();
  5693. }
  5694. updateSelf() {
  5695. this.checkTry();
  5696. let level = DataMgr.getBigSkillByIndex(this.index);
  5697. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5698. }
  5699. checkTry() {
  5700. let index = this.index;
  5701. let level = DataMgr.getBigSkillByIndex(index);
  5702. if (level == null) {
  5703. DataMgr.setBigSkill(index, 1, false);
  5704. level = 1;
  5705. }
  5706. this.ui.levelTxt.text = "LV." + level;
  5707. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5708. this.ui.tryNode.visible = true;
  5709. else
  5710. this.ui.tryNode.visible = false;
  5711. }
  5712. clickAddLevel() {
  5713. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5714. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5715. Moyu.showVideoAd(() => {
  5716. DataMgr.setBigSkill(this.data.index, 1);
  5717. this.updateSelf();
  5718. xGame.common.upSkillLevel = true;
  5719. }, EAdType.upSkill);
  5720. }
  5721. startGame() {
  5722. if (this.data.index == 3) {
  5723. alert('Coming soon!');
  5724. return;
  5725. }
  5726. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5727. let needCoin = xGame.common.bigMoveNeedCoin;
  5728. xGame.common.passAwardCoin = 2000;
  5729. let guide = DataMgr.getSkillGuide();
  5730. console.log('zh:startGame guide=' + guide);
  5731. xGame.common.temSelfLevel = 0;
  5732. if (guide == 0) {
  5733. needCoin = 0;
  5734. xGame.common.temSelfLevel = 100;
  5735. }
  5736. if (DataMgr.coinEnough(needCoin)) {
  5737. DataMgr.setCoin(-needCoin);
  5738. xGame.common.curPlayerSkillType = this.index;
  5739. if (guide == 0)
  5740. xGame.common.curPlayerSkillType = 0;
  5741. xGame.uiMgr.Show(UIGame);
  5742. xGame.uiMgr.Hide(UIMain);
  5743. xGame.uiMgr.Show(UIMatching, () => {
  5744. xGame.common.gameUI.ui.alpha = 1;
  5745. xGame.common.gameUI.startGame();
  5746. xGame.uiMgr.Hide(UISkill);
  5747. });
  5748. }
  5749. else {
  5750. xGame.uiMgr.Show(UIAddProp, 0);
  5751. Moyu.sendDataEvent("AddCoinVideo");
  5752. }
  5753. }
  5754. }
  5755. class UISkill extends UIBase {
  5756. constructor() {
  5757. super();
  5758. this.skillData = [];
  5759. }
  5760. onConstructor() {
  5761. this.ui = ui_UISkill.createInstance();
  5762. this.contentPane = this.ui;
  5763. this.isEject = false;
  5764. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5765. this.initSkillData();
  5766. console.log('zh:aaaaaa1111111111');
  5767. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5768. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5769. console.log('zh:aaaaaa22222222');
  5770. this.displayList = [];
  5771. this.ui.skillNode.skillList.numItems = 3;
  5772. this.addUIClick(this.ui, this.interuptSecretary);
  5773. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5774. this.ui.talkNode.visible = false;
  5775. if (Moyu.isKs)
  5776. this.ui.closeNode.closeBtn.x += 100;
  5777. }
  5778. show() {
  5779. super.show();
  5780. this.playSecretaryIdle();
  5781. this.moneyNode.ui.c1.selectedIndex = 1;
  5782. Laya.timer.clearAll(this);
  5783. xGame.soundMgr.playSound("s_start");
  5784. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5785. let guide = DataMgr.getSkillGuide();
  5786. this.ui.guideNode.visible = guide == 0;
  5787. let item = this.getSkillItemByUIIndex(0);
  5788. if (guide == 0) {
  5789. item.ui.c1.selectedIndex = 1;
  5790. }
  5791. else {
  5792. item.ui.c1.selectedIndex = 0;
  5793. }
  5794. this.ui.guideNode.guideBtn.visible = guide == 0;
  5795. for (let index = 0; index < this.displayList.length; index++) {
  5796. this.displayList[index].checkTry();
  5797. }
  5798. }
  5799. getSkillItemByUIIndex(cur) {
  5800. for (let index = 0; index < this.displayList.length; index++) {
  5801. if (this.displayList[index].index == cur) {
  5802. return this.displayList[index];
  5803. }
  5804. }
  5805. }
  5806. enterGuideLevel() {
  5807. let item = this.getSkillItemByUIIndex(0);
  5808. item.startGame();
  5809. if (DataMgr.getNewUser())
  5810. Moyu.sendDataEvent("gameStart1");
  5811. }
  5812. initSkillData() {
  5813. this.skillData = [];
  5814. let nameList = xGame.common.skillNameList;
  5815. let iconList = xGame.common.skillIconList;
  5816. let describeList = [
  5817. "Jump shot executed — ball bounced and pocketed an extra one!",
  5818. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5819. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5820. ];
  5821. console.log('zh:initSkillData 111111111');
  5822. let data;
  5823. for (let index = 0; index < nameList.length; index++) {
  5824. data = {};
  5825. data.name = nameList[index];
  5826. data.icon = iconList[index];
  5827. data.describe = describeList[index];
  5828. data.index = index;
  5829. this.skillData.push(data);
  5830. }
  5831. }
  5832. updateSkillItem(index, target) {
  5833. if (this.displayList[index] == null) {
  5834. let uiIndex;
  5835. switch (index) {
  5836. case 0:
  5837. uiIndex = 1;
  5838. break;
  5839. case 1:
  5840. uiIndex = 0;
  5841. break;
  5842. case 2:
  5843. uiIndex = 2;
  5844. break;
  5845. case 3:
  5846. uiIndex = 3;
  5847. break;
  5848. default:
  5849. break;
  5850. }
  5851. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5852. this.displayList.push(temp);
  5853. }
  5854. }
  5855. playSecretaryIdle() {
  5856. let parent = this.ui.secretary.displayObject;
  5857. parent.destroyChildren();
  5858. let xx = this.ui.secretary.width / 2;
  5859. let yy = this.ui.secretary.height;
  5860. let scale = xGame.common.getSecretaryScale();
  5861. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5862. xGame.common.secretary.play(data, 1, true, parent);
  5863. }
  5864. returnUIMain() {
  5865. this.hide();
  5866. xGame.common.stopGirlPop(this.ui.talkNode);
  5867. xGame.uiMgr.Show(UIMain);
  5868. }
  5869. interuptSecretary() {
  5870. Laya.timer.clearAll(this);
  5871. this.playSecretaryRandomSound();
  5872. }
  5873. playSecretaryRandomSound() {
  5874. if (this.isHide)
  5875. return;
  5876. let time = xGame.common.randomNum(45000, 60000);
  5877. Laya.timer.once(time, this, () => {
  5878. if (this.isHide)
  5879. return;
  5880. let index = xGame.common.randomNum(4, 7);
  5881. xGame.soundMgr.playSound("s_main0" + index);
  5882. let words = 1;
  5883. switch (index) {
  5884. case 4:
  5885. words = 5;
  5886. break;
  5887. case 5:
  5888. words = 3;
  5889. break;
  5890. case 6:
  5891. words = 6;
  5892. break;
  5893. case 7:
  5894. words = 7;
  5895. break;
  5896. default:
  5897. break;
  5898. }
  5899. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5900. this.playSecretaryRandomSound();
  5901. });
  5902. }
  5903. }
  5904. UISkill.uiName = "UISkill";
  5905. class ui_UIMsg extends fgui.GComponent {
  5906. static createInstance() {
  5907. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5908. }
  5909. onConstruct() {
  5910. this.tipsNode = (this.getChild("tipsNode"));
  5911. }
  5912. }
  5913. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5914. class UIMsg extends UIBase {
  5915. constructor() {
  5916. super();
  5917. }
  5918. onConstructor() {
  5919. this.ui = ui_UIMsg.createInstance();
  5920. this.contentPane = this.ui;
  5921. this.isEject = false;
  5922. this.isMuti = true;
  5923. }
  5924. show(msg, callback) {
  5925. super.show();
  5926. this.ui.tipsNode.msgTxt.text = msg;
  5927. this.ui.alpha = 1;
  5928. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5929. this.hide();
  5930. callback && callback();
  5931. }), 1000);
  5932. }
  5933. }
  5934. UIMsg.uiName = "UIMsg";
  5935. class ui_UIModeSelection extends fgui.GComponent {
  5936. static createInstance() {
  5937. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5938. }
  5939. onConstruct() {
  5940. this.n19 = (this.getChild("n19"));
  5941. this.closeBtn = (this.getChild("closeBtn"));
  5942. this.myNode = (this.getChild("myNode"));
  5943. this.t0 = this.getTransition("t0");
  5944. }
  5945. }
  5946. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5947. class UIModeSelection extends UIBase {
  5948. constructor() {
  5949. super();
  5950. }
  5951. onConstructor() {
  5952. this.ui = ui_UIModeSelection.createInstance();
  5953. this.contentPane = this.ui;
  5954. this.isEject = false;
  5955. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5956. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5957. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5958. this.addUIClick(this.ui.closeBtn, this.hide);
  5959. this.peopleArr = [650, 6900, 3800];
  5960. this.peopleOffest = [50, 500, 200];
  5961. this.updateSelf();
  5962. }
  5963. show(callback) {
  5964. super.show();
  5965. this.ui.t0.play();
  5966. this.callback = callback;
  5967. }
  5968. updateSelf() {
  5969. let cfg = cfgTable.modeselectData;
  5970. for (let index = 1; index <= 3; index++) {
  5971. let node = this.ui.myNode["type" + index];
  5972. node.need.text = cfg[index].need;
  5973. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  5974. node.peopleTxt.text = this.getRandPeople(index - 1);
  5975. }
  5976. }
  5977. enterGame(type) {
  5978. xGame.common.classicRoomType = type;
  5979. let cfg = cfgTable.modeselectData[type];
  5980. let need = cfg.need;
  5981. xGame.common.passAwardCoin = cfg.award;
  5982. if (DataMgr.coinEnough(need)) {
  5983. DataMgr.setCoin(-need);
  5984. this.ui.myNode["type" + type].t0.play();
  5985. Laya.timer.once(200, this, () => {
  5986. this.callback && this.callback();
  5987. });
  5988. }
  5989. else {
  5990. Moyu.sendDataEvent("AddCoinVideo");
  5991. xGame.uiMgr.Show(UIAddProp, 0);
  5992. }
  5993. }
  5994. getRandPeople(index) {
  5995. let rand = this.peopleOffest[index];
  5996. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5997. }
  5998. }
  5999. UIModeSelection.uiName = "UIModeSelection";
  6000. class UIMain extends UIBase {
  6001. constructor() {
  6002. super();
  6003. this.firstEnter = true;
  6004. }
  6005. onConstructor() {
  6006. this.ui = ui_UIMain.createInstance();
  6007. this.contentPane = this.ui;
  6008. this.isEject = false;
  6009. this.addEvent();
  6010. this.addClickSpine();
  6011. this.settingNode = new SettingNode(this.ui.settingNode);
  6012. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6013. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6014. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6015. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6016. let curUse = DataMgr.getCurSecretary();
  6017. this.changeSecretary(curUse);
  6018. this.ui.talkNode.visible = false;
  6019. let guide = DataMgr.getSkillGuide();
  6020. if (xGame.common.isNewDay && guide == 1) {
  6021. xGame.common.isNewDay = false;
  6022. xGame.soundMgr.playSound("s_main01");
  6023. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6024. console.log("播放小秘书每天语音");
  6025. }
  6026. this.onGetUserInfo();
  6027. this.ui.n83.visible = false;
  6028. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6029. }
  6030. changeSecretary(curUse) {
  6031. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6032. xGame.common.secretary && xGame.common.secretary.dispose();
  6033. this.addSecretarySpine(name);
  6034. }
  6035. addSecretarySpine(name) {
  6036. let spine = new SpineMgr(name, () => {
  6037. this.playSecretaryIdle();
  6038. });
  6039. xGame.common.secretary = spine;
  6040. }
  6041. addClickSpine() {
  6042. let clickSpine = new SpineMgr("dianji", () => {
  6043. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6044. let parent = Laya.stage;
  6045. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6046. clickSpine.play(data, 0, false, parent, (spine) => {
  6047. spine.destroy(true);
  6048. });
  6049. });
  6050. });
  6051. }
  6052. addEvent() {
  6053. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6054. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6055. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6056. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6057. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6058. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6059. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6060. this.addUIClick(this.ui, this.interuptSecretary);
  6061. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6062. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6063. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6064. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6065. this.addUIClick(this.ui.signBtn, this.openSignView);
  6066. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6067. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6068. }
  6069. show(showFailWords) {
  6070. super.show();
  6071. this.moneyNode.ui.c1.selectedIndex = 1;
  6072. this.playSecretaryIdle();
  6073. xGame.soundMgr.playMusic("caromhall01");
  6074. Laya.timer.clearAll(this);
  6075. this.playSecretaryRandomSound();
  6076. if (showFailWords) {
  6077. setTimeout(() => {
  6078. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6079. let words = -1;
  6080. if (str == "s_main02") {
  6081. words = 2;
  6082. }
  6083. else {
  6084. words = 3;
  6085. }
  6086. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6087. xGame.soundMgr.playSound(str);
  6088. }, 300);
  6089. }
  6090. this.showGuide();
  6091. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6092. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6093. let guide = DataMgr.getSkillGuide();
  6094. if (guide == 1) {
  6095. let randTime = xGame.common.randomNum(300, 800);
  6096. if (this.firstEnter) {
  6097. this.firstEnter = false;
  6098. randTime += 900;
  6099. }
  6100. Laya.timer.once(randTime, this, () => {
  6101. xGame.common.autoPopUIView();
  6102. });
  6103. }
  6104. }
  6105. checkActive(show) {
  6106. }
  6107. showGuide() {
  6108. let guide = DataMgr.getSkillGuide();
  6109. this.ui.guideBtn.visible = guide == 0;
  6110. this.ui.enterGuide.visible = false;
  6111. this.ui.secretaryGuide.visible = guide == 0;
  6112. if (guide == 0) {
  6113. xGame.soundMgr.playSound("s_guide");
  6114. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6115. }
  6116. }
  6117. ensureSecretary() {
  6118. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6119. this.ui.secretaryGuide.visible = false;
  6120. this.ui.enterGuide.visible = true;
  6121. this.ui.wordsNode.t0.play();
  6122. if (DataMgr.getNewUser())
  6123. Moyu.sendDataEvent("gameReady");
  6124. }
  6125. playSecretaryIdle() {
  6126. let parent = this.ui.secretary.displayObject;
  6127. parent.destroyChildren();
  6128. let xx = this.ui.secretary.width / 2;
  6129. let yy = this.ui.secretary.height;
  6130. let scale = xGame.common.getSecretaryScale();
  6131. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6132. xGame.common.secretary.play(data, 1, true, parent);
  6133. }
  6134. startGame(type) {
  6135. xGame.common.gameMode = type;
  6136. Moyu.sendDataEvent("PlayGame", { type: type });
  6137. switch (xGame.common.gameMode) {
  6138. case GameMode.classic:
  6139. let challengeTimes = DataMgr.getChallengeTimes();
  6140. if (challengeTimes == 0) {
  6141. xGame.uiMgr.Show(UIInvitation);
  6142. }
  6143. else {
  6144. this.beginGame();
  6145. }
  6146. break;
  6147. case GameMode.bigMove:
  6148. this.beginGame();
  6149. if (DataMgr.getNewUser())
  6150. Moyu.sendDataEvent("gameStart0");
  6151. break;
  6152. default:
  6153. break;
  6154. }
  6155. }
  6156. beginGame(isNice = false) {
  6157. if (xGame.common.gameMode == GameMode.classic) {
  6158. if (isNice) {
  6159. this.enterClassic();
  6160. }
  6161. else {
  6162. xGame.uiMgr.Show(UIModeSelection, () => {
  6163. this.enterClassic();
  6164. });
  6165. }
  6166. }
  6167. else if (xGame.common.gameMode == GameMode.bigMove) {
  6168. this.ui.enterGuide.visible = false;
  6169. xGame.uiMgr.Show(UISkill);
  6170. }
  6171. }
  6172. enterClassic() {
  6173. xGame.uiMgr.Show(UIGame);
  6174. xGame.uiMgr.Show(UIMatching, () => {
  6175. if (!this.isHide)
  6176. this.hide();
  6177. xGame.common.gameUI.ui.alpha = 1;
  6178. xGame.common.gameUI.startGame();
  6179. xGame.uiMgr.Hide(UIGameEnd);
  6180. });
  6181. }
  6182. startGlobal() {
  6183. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6184. }
  6185. startWeekly() {
  6186. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6187. }
  6188. startPlaceBall() {
  6189. xGame.uiMgr.Show(UILevelDisplay);
  6190. }
  6191. hide() {
  6192. super.hide();
  6193. xGame.common.stopGirlPop(this.ui.talkNode);
  6194. }
  6195. onGetUserInfo(force = false) {
  6196. if (Moyu.isWx) {
  6197. let info = Moyu.getSystemInfo();
  6198. if (info)
  6199. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6200. }
  6201. else {
  6202. Moyu.initUser(this, this.freshUser, force);
  6203. }
  6204. if (!Moyu.hasUserInfo) {
  6205. let user = Moyu.getUserInfo();
  6206. user.headIcon = 'res/ty_touxiang.png';
  6207. }
  6208. this.freshUser();
  6209. }
  6210. freshUser() {
  6211. let user = Moyu.getUserInfo();
  6212. if (!user.isAuth) {
  6213. user.headIcon = 'res/ty_touxiang.png';
  6214. }
  6215. else
  6216. DataMgr.upRankData();
  6217. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6218. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6219. }
  6220. interuptSecretary() {
  6221. Laya.timer.clearAll(this);
  6222. this.playSecretaryRandomSound();
  6223. }
  6224. playSecretaryRandomSound() {
  6225. if (this.isHide)
  6226. return;
  6227. let time = xGame.common.randomNum(45000, 60000);
  6228. Laya.timer.once(time, this, () => {
  6229. if (this.isHide)
  6230. return;
  6231. let index = xGame.common.randomNum(4, 7);
  6232. xGame.soundMgr.playSound("s_main0" + index);
  6233. let words = 1;
  6234. switch (index) {
  6235. case 4:
  6236. words = 5;
  6237. break;
  6238. case 5:
  6239. words = 3;
  6240. break;
  6241. case 6:
  6242. words = 6;
  6243. break;
  6244. case 7:
  6245. words = 7;
  6246. break;
  6247. default:
  6248. break;
  6249. }
  6250. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6251. this.playSecretaryRandomSound();
  6252. });
  6253. }
  6254. openSecretaryView() {
  6255. xGame.uiMgr.Show(UISecretary);
  6256. Moyu.sendDataEvent("secretary");
  6257. }
  6258. openShopView() {
  6259. xGame.uiMgr.Show(UIShop);
  6260. }
  6261. openSignView() {
  6262. xGame.uiMgr.Show(UISign);
  6263. }
  6264. openDrawView() {
  6265. xGame.uiMgr.Show(UIDraw);
  6266. }
  6267. openRanking() {
  6268. xGame.uiMgr.Show(UIRanking);
  6269. Moyu.sendDataEvent("rankingList");
  6270. }
  6271. }
  6272. UIMain.uiName = "UIMain";
  6273. class UIGameEnd extends UIBase {
  6274. constructor() {
  6275. super();
  6276. this.success = false;
  6277. this.awardCoinNum = 1000;
  6278. this.awardDiamondNum = 10;
  6279. }
  6280. onConstructor() {
  6281. this.ui = ui_UIGameEnd.createInstance();
  6282. this.contentPane = this.ui;
  6283. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6284. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6285. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6286. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6287. this.ui.talkNode.visible = false;
  6288. if (Moyu.isKs)
  6289. this.ui.closeNode.closeBtn.x += 100;
  6290. }
  6291. updateType() {
  6292. switch (xGame.common.gameMode) {
  6293. case GameMode.classic:
  6294. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6295. this.ui.coinNode.visible = this.success;
  6296. if (!this.success) {
  6297. Laya.timer.once(500, this, () => {
  6298. xGame.uiMgr.Show(UIAddCoin);
  6299. });
  6300. }
  6301. this.ui.isGetAward.visible = false;
  6302. this.ui.leftBtn.c1.selectedIndex = 3;
  6303. this.ui.rightBtn.c1.selectedIndex = 0;
  6304. this.moneyNode.ui.c1.selectedIndex = 1;
  6305. break;
  6306. case GameMode.bigMove:
  6307. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6308. this.ui.coinNode.visible = this.success;
  6309. if (xGame.common.gameMode == GameMode.bigMove) {
  6310. if (this.success) {
  6311. DataMgr.setSkillSuccessTimes(1, true);
  6312. DataMgr.setSkillAccTimes(1);
  6313. }
  6314. else {
  6315. DataMgr.setSkillSuccessTimes(0, false);
  6316. }
  6317. }
  6318. if (!this.success) {
  6319. Laya.timer.once(500, this, () => {
  6320. xGame.uiMgr.Show(UIAddCoin);
  6321. });
  6322. }
  6323. this.ui.isGetAward.visible = false;
  6324. this.ui.leftBtn.c1.selectedIndex = 3;
  6325. this.ui.rightBtn.c1.selectedIndex = 0;
  6326. this.moneyNode.ui.c1.selectedIndex = 1;
  6327. break;
  6328. case GameMode.placeBall:
  6329. this.ui.coinNode.visible = false;
  6330. if (this.success) {
  6331. if (xGame.common.placeBallStarNum == 3) {
  6332. this.ui.c1.selectedIndex = 2;
  6333. }
  6334. else {
  6335. this.ui.c1.selectedIndex = 3;
  6336. }
  6337. }
  6338. else {
  6339. this.ui.c1.selectedIndex = 4;
  6340. }
  6341. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6342. if (cfg.type == PlaceBallType.challenge) {
  6343. this.ui.c1.selectedIndex = 2;
  6344. }
  6345. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6346. this.updatePlaceBallBtn();
  6347. this.updatePlaceBallStarNum();
  6348. this.updatePlaceBallAwardState();
  6349. this.moneyNode.ui.c1.selectedIndex = 2;
  6350. this.moneyNode.checkPowerTime();
  6351. this.moneyNode.powerChange();
  6352. DataMgr.upRankData();
  6353. break;
  6354. default:
  6355. break;
  6356. }
  6357. }
  6358. updatePlaceBallBtn() {
  6359. this.ui.leftBtn.c1.selectedIndex = 5;
  6360. if (this.success) {
  6361. this.ui.rightBtn.c1.selectedIndex = 14;
  6362. }
  6363. else {
  6364. if (xGame.common.placeBallStarNum == 3) {
  6365. this.ui.rightBtn.c1.selectedIndex = 14;
  6366. }
  6367. else {
  6368. this.ui.rightBtn.c1.selectedIndex = 1;
  6369. }
  6370. }
  6371. }
  6372. updatePlaceBallStarNum() {
  6373. let starNum = xGame.common.placeBallStarNum;
  6374. if (starNum == 0)
  6375. this.ui.starNumNode.c1.selectedIndex = 3;
  6376. else {
  6377. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6378. }
  6379. }
  6380. updatePlaceBallAwardState() {
  6381. let level = xGame.common.placeBallCurLevel;
  6382. let starNum = xGame.common.placeBallStarNum;
  6383. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6384. let data = cfgTable.placeballData[level].award;
  6385. let cfg = cfgTable.placeballData[level];
  6386. this.awardDiamondNum = data[1];
  6387. this.awardCoinNum = data[0];
  6388. if (cfg.type == PlaceBallType.challenge) {
  6389. this.awardDiamondNum = 0;
  6390. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6391. }
  6392. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6393. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6394. if (cfg.type == PlaceBallType.challenge) {
  6395. this.ui.awardNode.coinNode.visible = true;
  6396. }
  6397. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6398. this.ui.awardNode.diamondNode.x = 265;
  6399. this.ui.awardNode.coinNode.x = 354;
  6400. }
  6401. else {
  6402. this.ui.awardNode.diamondNode.x = 291;
  6403. this.ui.awardNode.coinNode.x = 291;
  6404. }
  6405. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6406. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6407. if (this.awardCoinNum == 0) {
  6408. this.ui.awardNode.coinNode.numTxt.text = "";
  6409. }
  6410. if (getAward) {
  6411. this.ui.isGetAward.visible = true;
  6412. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6413. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6414. }
  6415. else {
  6416. this.ui.isGetAward.visible = false;
  6417. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6418. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6419. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6420. }
  6421. else {
  6422. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6423. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6424. }
  6425. }
  6426. }
  6427. show(success) {
  6428. super.show();
  6429. xGame.eventMgr.event(RESET_GAME);
  6430. this.success = success;
  6431. Laya.timer.clearAll(this);
  6432. this.playSecretaryAni();
  6433. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6434. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6435. offsetTime = Math.floor(offsetTime / 1000);
  6436. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6437. this.updateType();
  6438. Laya.timer.once(200, this, () => {
  6439. this.addAward(() => {
  6440. this.updateType();
  6441. Laya.timer.once(500, this, () => {
  6442. this.showChallengeLevel();
  6443. });
  6444. });
  6445. });
  6446. if (this.success) {
  6447. xGame.soundMgr.playSound('slots_roll01');
  6448. xGame.soundMgr.playSound("s_win");
  6449. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6450. }
  6451. else {
  6452. xGame.soundMgr.playSound('matchwin01');
  6453. xGame.soundMgr.playSound("s_lose");
  6454. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6455. }
  6456. if (!Moyu.isLegal)
  6457. PlatMgr.showBanner(true);
  6458. let challengeNum = DataMgr.getChallengeTimes();
  6459. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6460. DataMgr.setChallengeTimes(1);
  6461. }
  6462. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6463. DataMgr.setClassicTimes();
  6464. }
  6465. }
  6466. showChallengeLevel() {
  6467. if (DataMgr.getChallengeTimes() != 0)
  6468. return;
  6469. let skill = DataMgr.getSkillAccTimes();
  6470. let put = DataMgr.getPlaceBallLevelList().length;
  6471. if (skill >= 3 || put >= 5) {
  6472. xGame.uiMgr.Show(UIInvitation);
  6473. this.hide();
  6474. }
  6475. }
  6476. addAward(callback) {
  6477. if (!this.success) {
  6478. callback && callback();
  6479. return;
  6480. }
  6481. switch (xGame.common.gameMode) {
  6482. case GameMode.classic:
  6483. this.awardCoinNum = xGame.common.passAwardCoin;
  6484. this.awardDiamondNum = 0;
  6485. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6486. break;
  6487. case GameMode.bigMove:
  6488. this.awardCoinNum = xGame.common.passAwardCoin;
  6489. this.awardDiamondNum = 0;
  6490. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6491. callback && callback();
  6492. break;
  6493. case GameMode.placeBall:
  6494. let level = xGame.common.placeBallCurLevel;
  6495. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6496. if (xGame.common.placeBallStarNum != 3) {
  6497. callback && callback();
  6498. return;
  6499. }
  6500. else {
  6501. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6502. if (getAward) {
  6503. callback && callback();
  6504. return;
  6505. }
  6506. }
  6507. let cfg = cfgTable.placeballData[level];
  6508. let data = cfgTable.placeballData[level].award;
  6509. this.awardCoinNum = data[0];
  6510. this.awardDiamondNum = data[1];
  6511. if (cfg.type == PlaceBallType.challenge) {
  6512. this.awardDiamondNum = 0;
  6513. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6514. }
  6515. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6516. let diamondAward;
  6517. if (this.awardDiamondNum > 0) {
  6518. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6519. xGame.common.getAward([diamondAward, coinAward], callback);
  6520. }
  6521. else {
  6522. xGame.common.getAward([coinAward], callback);
  6523. }
  6524. if (cfg.type == PlaceBallType.normal) {
  6525. DataMgr.setPlaceBallAward(level);
  6526. }
  6527. break;
  6528. default:
  6529. break;
  6530. }
  6531. }
  6532. playSecretaryAni() {
  6533. let parent = this.ui.secretary.displayObject;
  6534. parent.destroyChildren();
  6535. let xx = this.ui.secretary.width / 2;
  6536. let yy = this.ui.secretary.height;
  6537. let scale = xGame.common.getSecretaryScale();
  6538. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6539. if (this.success) {
  6540. let rand = Math.random() <= 0.5 ? 2 : 3;
  6541. xGame.common.secretary.play(data, rand, false, parent, () => {
  6542. xGame.common.secretary.play(data, 1, true, parent);
  6543. });
  6544. }
  6545. else {
  6546. xGame.common.secretary.play(data, 0, true, parent);
  6547. }
  6548. }
  6549. restartGame() {
  6550. switch (xGame.common.gameMode) {
  6551. case GameMode.classic:
  6552. xGame.eventMgr.event(RESTART_GAME);
  6553. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6554. break;
  6555. case GameMode.bigMove:
  6556. this.hide();
  6557. xGame.eventMgr.event(RESTART_GAME);
  6558. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6559. break;
  6560. default:
  6561. break;
  6562. }
  6563. }
  6564. hide() {
  6565. super.hide();
  6566. xGame.common.stopGirlPop(this.ui.talkNode);
  6567. PlatMgr.showBanner(false);
  6568. }
  6569. returnHome() {
  6570. this.hide();
  6571. let showFailWords = !this.success;
  6572. xGame.uiMgr.Show(UIMain, showFailWords);
  6573. }
  6574. clickLeftBtn() {
  6575. switch (xGame.common.gameMode) {
  6576. case GameMode.classic:
  6577. case GameMode.bigMove:
  6578. this.returnHome();
  6579. break;
  6580. case GameMode.placeBall:
  6581. let level = xGame.common.placeBallCurLevel;
  6582. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6583. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6584. break;
  6585. default:
  6586. break;
  6587. }
  6588. }
  6589. powerStartPlaceBallLevel(level, btn) {
  6590. if (DataMgr.powerEnough()) {
  6591. btn.touchable = false;
  6592. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6593. btn.touchable = true;
  6594. DataMgr.setPower(-1);
  6595. xGame.eventMgr.event(POWER_TIME);
  6596. this.startPlaceBallLevel(level);
  6597. }));
  6598. }
  6599. else {
  6600. xGame.uiMgr.Show(UIPower, 0);
  6601. }
  6602. }
  6603. clickRightBtn() {
  6604. switch (xGame.common.gameMode) {
  6605. case GameMode.classic:
  6606. case GameMode.bigMove:
  6607. this.restartGame();
  6608. break;
  6609. case GameMode.placeBall:
  6610. let level = xGame.common.placeBallCurLevel;
  6611. let data = DataMgr.getPlaceBallLevel(level);
  6612. let curPss = data.play && !data.isCur;
  6613. if (curPss) {
  6614. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6615. }
  6616. else {
  6617. Moyu.sendDataEvent("placeBallNextLevel");
  6618. Moyu.showVideoAd(() => {
  6619. DataMgr.setPlaceBallLevel(level, 1);
  6620. this.startPlaceBallLevel(level + 1);
  6621. }, xGame.define.EAdType.placeBallNextLevel);
  6622. }
  6623. break;
  6624. default:
  6625. break;
  6626. }
  6627. }
  6628. startPlaceBallLevel(level) {
  6629. xGame.common.gameMode = GameMode.placeBall;
  6630. xGame.common.placeBallCurLevel = level;
  6631. xGame.uiMgr.Show(UIGame);
  6632. this.hide();
  6633. }
  6634. }
  6635. UIGameEnd.uiName = "UIGameEnd";
  6636. class ui_UIRepentProp extends fgui.GComponent {
  6637. static createInstance() {
  6638. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6639. }
  6640. onConstruct() {
  6641. this.c1 = this.getController("c1");
  6642. this.n11 = (this.getChild("n11"));
  6643. this.regretNode = (this.getChild("regretNode"));
  6644. this.helpLineNode = (this.getChild("helpLineNode"));
  6645. this.t0 = this.getTransition("t0");
  6646. }
  6647. }
  6648. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6649. class UIRepentProp extends UIBase {
  6650. constructor() {
  6651. super();
  6652. this.viewType = 0;
  6653. this.regretType = 0;
  6654. }
  6655. onConstructor() {
  6656. this.ui = ui_UIRepentProp.createInstance();
  6657. this.contentPane = this.ui;
  6658. this.isEject = false;
  6659. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6660. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6661. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6662. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6663. }
  6664. show(viewType, regretType, callback) {
  6665. PlatMgr.showInsert(true);
  6666. this.viewType = viewType;
  6667. this.regretType = regretType;
  6668. this.callback = callback;
  6669. super.show();
  6670. this.ui.t0.play();
  6671. this.ui.c1.selectedIndex = this.viewType;
  6672. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6673. if (this.viewType == 0) {
  6674. let guide = DataMgr.getGuideHelpLine();
  6675. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6676. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6677. }
  6678. xGame.common.gameMgr.gamePause = true;
  6679. }
  6680. hideSelf() {
  6681. xGame.common.gameMgr.gamePause = false;
  6682. this.callback && this.callback(false);
  6683. this.hide();
  6684. }
  6685. videoRegret() {
  6686. Moyu.showVideoAd(() => {
  6687. this.callback && this.callback(true);
  6688. this.hideSelf();
  6689. }, EAdType.regretBall);
  6690. }
  6691. videoAddHelpLine() {
  6692. let guide = DataMgr.getGuideHelpLine();
  6693. if (guide == 0) {
  6694. this.callback && this.callback(true);
  6695. this.hideSelf();
  6696. DataMgr.setGuideHelpLine();
  6697. xGame.common.gameUI.ui.guideNode.visible = false;
  6698. }
  6699. else {
  6700. Moyu.showVideoAd(() => {
  6701. this.callback && this.callback(true);
  6702. this.hideSelf();
  6703. }, EAdType.longHelpLine);
  6704. }
  6705. }
  6706. }
  6707. UIRepentProp.uiName = "UIRepentProp";
  6708. class ui_UIVideoShare extends fgui.GComponent {
  6709. static createInstance() {
  6710. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6711. }
  6712. onConstruct() {
  6713. this.n10 = (this.getChild("n10"));
  6714. this.myNode = (this.getChild("myNode"));
  6715. this.t0 = this.getTransition("t0");
  6716. }
  6717. }
  6718. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6719. class UIVideoShare extends UIBase {
  6720. constructor() {
  6721. super();
  6722. this.success = false;
  6723. this.awardNum = 0;
  6724. this.isShared = true;
  6725. }
  6726. onConstructor() {
  6727. this.ui = ui_UIVideoShare.createInstance();
  6728. this.contentPane = this.ui;
  6729. this.isEject = false;
  6730. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6731. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6732. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6733. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6734. }
  6735. show(success) {
  6736. super.show();
  6737. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6738. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6739. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6740. this.success = success;
  6741. let time = xGame.common.randomNum(600, 1500);
  6742. Moyu.showInsertAd(time, 60000);
  6743. if (success)
  6744. xGame.soundMgr.playSound("applause");
  6745. this.ui.t0.play();
  6746. this.checkShareState();
  6747. let times = DataMgr.getDailyVideoShareTimes();
  6748. this.awardNum = times == 0 ? 2000 : 200;
  6749. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6750. }
  6751. checkShareState() {
  6752. if (PlatMgr.forceShare == 0) {
  6753. this.ui.myNode.closeBtn.visible = true;
  6754. this.ui.myNode.tipsNode.visible = false;
  6755. this.ui.myNode.closeBtn.x = 90;
  6756. this.ui.myNode.shareBtn.x = 342;
  6757. }
  6758. else if (PlatMgr.forceShare == 1) {
  6759. this.ui.myNode.closeBtn.visible = false;
  6760. this.ui.myNode.tipsNode.visible = true;
  6761. this.ui.myNode.shareBtn.x = 218;
  6762. this.isShared = true;
  6763. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6764. }
  6765. }
  6766. checkForceShare() {
  6767. this.isShared = !this.isShared;
  6768. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6769. }
  6770. videoShare() {
  6771. if (PlatMgr.forceShare == 1) {
  6772. if (this.isShared) {
  6773. this.shareGame();
  6774. }
  6775. else {
  6776. this.hideSelf();
  6777. }
  6778. }
  6779. else {
  6780. this.shareGame();
  6781. }
  6782. }
  6783. shareGame() {
  6784. Moyu.sendDataEvent("VideoShare");
  6785. if (Moyu.canShare() > 100) {
  6786. Moyu.shareGame((success) => {
  6787. if (success) {
  6788. DataMgr.setDailyVideoShareTimes(1);
  6789. DataMgr.setCoin(this.awardNum);
  6790. }
  6791. this.hideSelf();
  6792. }, this);
  6793. }
  6794. else {
  6795. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6796. this.hideSelf();
  6797. }
  6798. }
  6799. hideSelf() {
  6800. this.hide();
  6801. xGame.uiMgr.Show(UIGameEnd, this.success);
  6802. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6803. xGame.common.screenImg.destroy();
  6804. xGame.common.screenImg = null;
  6805. }
  6806. }
  6807. }
  6808. UIVideoShare.uiName = "UIVideoShare";
  6809. class ui_UITips extends fgui.GComponent {
  6810. static createInstance() {
  6811. return (fgui.UIPackage.createObject("game", "UITips"));
  6812. }
  6813. onConstruct() {
  6814. this.n0 = (this.getChild("n0"));
  6815. this.myNode = (this.getChild("myNode"));
  6816. this.t0 = this.getTransition("t0");
  6817. }
  6818. }
  6819. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6820. class UITips extends UIBase {
  6821. constructor() {
  6822. super();
  6823. this.type = 0;
  6824. }
  6825. onConstructor() {
  6826. this.ui = ui_UITips.createInstance();
  6827. this.contentPane = this.ui;
  6828. this.isEject = false;
  6829. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  6830. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  6831. }
  6832. show(tipsTxt, womanTxt, type) {
  6833. super.show();
  6834. this.ui.t0.play();
  6835. this.ui.myNode.tipsTxt.text = tipsTxt;
  6836. this.ui.myNode.womanTxt.text = womanTxt;
  6837. PlatMgr.showInsert(true);
  6838. this.ui.myNode.c1.selectedIndex = type;
  6839. this.type = type;
  6840. switch (this.type) {
  6841. case TipsType.exitGame:
  6842. xGame.common.gameMgr.gamePause = true;
  6843. break;
  6844. case TipsType.foul:
  6845. Laya.timer.once(200, this, () => {
  6846. xGame.common.gameMgr.gamePause = true;
  6847. });
  6848. break;
  6849. default:
  6850. break;
  6851. }
  6852. }
  6853. clickLeftBtn() {
  6854. this.hide();
  6855. xGame.common.gameMgr.gamePause = false;
  6856. switch (this.type) {
  6857. case TipsType.exitGame:
  6858. break;
  6859. case TipsType.foul:
  6860. break;
  6861. default:
  6862. break;
  6863. }
  6864. }
  6865. clickRightBtn() {
  6866. this.hide();
  6867. switch (this.type) {
  6868. case TipsType.exitGame:
  6869. xGame.eventMgr.event(RESET_GAME);
  6870. xGame.uiMgr.Show(UIMain);
  6871. Moyu.recordEnd(this, null);
  6872. xGame.common.longHelpLine = false;
  6873. break;
  6874. case TipsType.foul:
  6875. xGame.common.gameMgr.gamePause = false;
  6876. Laya.timer.clearAll(this);
  6877. break;
  6878. default:
  6879. break;
  6880. }
  6881. }
  6882. }
  6883. UITips.uiName = "UITips";
  6884. class GameMgr {
  6885. constructor() {
  6886. this.selfCamp = "";
  6887. this.selfFoulNum = 0;
  6888. this.selfBallArr = [];
  6889. this.selfTimer = 0;
  6890. this.selfScore = 0;
  6891. this.aiCamp = "";
  6892. this.aiFoulNum = 0;
  6893. this.aiBallArr = [];
  6894. this.aiTimer = 0;
  6895. this.aiScore = 0;
  6896. this.aiSkillLevelNum = 1;
  6897. this.targertScore = 0;
  6898. this.setTime = 30;
  6899. this.selfTurnRate = 0.5;
  6900. this.accTime = 0;
  6901. this.curFoul = "";
  6902. this.maxFoulTimes = 3;
  6903. this.isFirstInGame = true;
  6904. this.firstColliObj = null;
  6905. this.inHoleBalls = [];
  6906. this.blackNum = 8;
  6907. this.success = false;
  6908. this.holePosList = [];
  6909. this.posObj = {};
  6910. this._selfTurn = false;
  6911. this.lastRootBallPos = new Laya.Vector2(311, 430);
  6912. this.ensureBallType = false;
  6913. this.isOpenBall = true;
  6914. this.finishOneShoot = true;
  6915. this.isEnd = false;
  6916. this.isChangeTurn = false;
  6917. this.isInterrupt = false;
  6918. this.aiPlayedBreakArmy = false;
  6919. this.isTouchedBall = false;
  6920. this.finishBalls = 0;
  6921. this.needBalls = 0;
  6922. this.allBallNum = 0;
  6923. this.placeBallPosData = {};
  6924. this.curHP = 0;
  6925. this.showLongView = false;
  6926. this.firstShoot = true;
  6927. this._gamePause = false;
  6928. this.trunCount = 0;
  6929. this.isBlackInHole = false;
  6930. this.isEnter = true;
  6931. xGame.eventMgr.offAll(ALL_BALL_STOP);
  6932. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  6933. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  6934. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  6935. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  6936. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  6937. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  6938. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  6939. }
  6940. get gamePause() {
  6941. return this._gamePause;
  6942. }
  6943. set gamePause(v) {
  6944. if (v) {
  6945. Laya.physicsTimer.pause();
  6946. }
  6947. else {
  6948. Laya.physicsTimer.resume();
  6949. }
  6950. this._gamePause = v;
  6951. }
  6952. get selfTurn() {
  6953. return this._selfTurn;
  6954. }
  6955. set selfTurn(val) {
  6956. this.trunCount++;
  6957. this._selfTurn = val;
  6958. if (val) {
  6959. xGame.common.d2World.d2Gan.ui.self.visible = true;
  6960. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  6961. }
  6962. else {
  6963. xGame.common.d2World.d2Gan.ui.self.visible = false;
  6964. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  6965. if (this.trunCount > 1)
  6966. PlatMgr.openBox();
  6967. }
  6968. }
  6969. resetGame() {
  6970. this.inHoleBalls = [];
  6971. this.isFirstInGame = true;
  6972. this.firstColliObj = null;
  6973. this.aiCamp = "";
  6974. this.selfCamp = "";
  6975. this.aiFoulNum = 0;
  6976. this.selfFoulNum = 0;
  6977. this.selfBallArr = [];
  6978. this.aiBallArr = [];
  6979. this.gamePause = false;
  6980. this.ensureBallType = false;
  6981. this.isInterrupt = false;
  6982. this.updateLeftBall();
  6983. this.clearTime();
  6984. this.aiPlayedBreakArmy = false;
  6985. this.isBlackInHole = false;
  6986. this.placeBallPosData = {};
  6987. if (xGame.common.d3World.knifeRoot) {
  6988. xGame.common.d3World.knifeRoot.destroyChildren();
  6989. }
  6990. }
  6991. gameReady() {
  6992. this.trunCount = 0;
  6993. this.firstColliObj = null;
  6994. this.isFirstInGame = true;
  6995. this.selfTurn = Math.random() <= this.selfTurnRate;
  6996. let challengeNum = DataMgr.getChallengeTimes();
  6997. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6998. this.selfTurn = true;
  6999. }
  7000. if (xGame.common.gameMode == GameMode.placeBall)
  7001. this.selfTurn = true;
  7002. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7003. this.selfTurn = true;
  7004. }
  7005. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7006. this.checkGuide();
  7007. if (xGame.common.uiRodMethod)
  7008. xGame.common.uiRodMethod.resetRod();
  7009. xGame.common.d2World.getHelpLine();
  7010. this.isOpenBall = true;
  7011. this.isTouchedBall = false;
  7012. xGame.common.aiPlayer.stopRun();
  7013. this.setTime = 30;
  7014. let ui = xGame.common.gameUI.ui;
  7015. switch (xGame.common.gameMode) {
  7016. case GameMode.classic:
  7017. xGame.common.aiPlayer.init();
  7018. this.blackNum = 8;
  7019. this.placeRootBall();
  7020. this.peoplePlay(9, 10);
  7021. ui.wordsBtn.visible = true;
  7022. ui.aiWordsBtn.visible = true;
  7023. xGame.common.talkMgr.changeAIState(true);
  7024. DataMgr.gameData.gameCount++;
  7025. DataMgr.saveGameData();
  7026. break;
  7027. case GameMode.bigMove:
  7028. this.blackNum = -1;
  7029. this.selfScore = 0;
  7030. this.aiScore = 0;
  7031. xGame.common.aiPlayer.init();
  7032. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7033. this.updateSelfScore();
  7034. this.updateAIScore();
  7035. this.updateTargetSroce();
  7036. this.placeRootBall();
  7037. this.peoplePlay(9, 10);
  7038. ui.wordsBtn.visible = true;
  7039. ui.aiWordsBtn.visible = true;
  7040. xGame.common.talkMgr.changeAIState(true);
  7041. if (DataMgr.getSkillGuide() < 1)
  7042. DataMgr.gameData.gameCount = 0;
  7043. else {
  7044. DataMgr.gameData.gameCount++;
  7045. DataMgr.saveGameData();
  7046. PlatMgr.openTry();
  7047. }
  7048. if (xGame.common.d3World.knifeRoot) {
  7049. xGame.common.d3World.knifeRoot.destroyChildren();
  7050. }
  7051. break;
  7052. case GameMode.placeBall:
  7053. this.blackNum = -1;
  7054. this.selfTurn = true;
  7055. this.setTime = 10000;
  7056. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7057. this.curHP = this.placeBallData.hp;
  7058. if (this.placeBallData.ball == -1)
  7059. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7060. else
  7061. this.needBalls = this.placeBallData.ball;
  7062. console.log("需要的进球数目", this.needBalls);
  7063. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7064. this.finishBalls = 0;
  7065. this.placeBallPosData = {};
  7066. this.updatePlaceBallPos();
  7067. this.updatePlaceBallState();
  7068. this.finishOneShoot = true;
  7069. xGame.common.gameUI.ui.moveNode.visible = false;
  7070. this.isOpenBall = false;
  7071. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7072. ui.wordsBtn.visible = false;
  7073. ui.aiWordsBtn.visible = false;
  7074. xGame.common.talkMgr.changeAIState(false);
  7075. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7076. PlatMgr.openBox();
  7077. });
  7078. break;
  7079. default:
  7080. break;
  7081. }
  7082. this.showLongView = false;
  7083. xGame.common.wordsMgr.comboTimes = 1;
  7084. let guide = DataMgr.getSkillGuide();
  7085. if (guide)
  7086. xGame.eventMgr.event(WAIT_SHOOT);
  7087. xGame.common.upSkillLevel = false;
  7088. xGame.common.gameStartTime = new Date().getTime();
  7089. this.firstShoot = true;
  7090. }
  7091. checkGuide() {
  7092. let guide = DataMgr.getSkillGuide();
  7093. let gameUI = xGame.common.gameUI.ui;
  7094. gameUI.guide1.visible = false;
  7095. gameUI.guide2.visible = false;
  7096. gameUI.guide3.visible = false;
  7097. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7098. this.selfTurn = true;
  7099. }
  7100. else {
  7101. return;
  7102. }
  7103. let oneBall = this.getOneBall();
  7104. gameUI.guide1.visible = true;
  7105. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7106. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7107. }
  7108. getOneBall() {
  7109. let arr = xGame.common.d2World.ballArr;
  7110. for (let index = 0; index < arr.length; index++) {
  7111. if (arr[index].number == 0)
  7112. continue;
  7113. return arr[index];
  7114. }
  7115. }
  7116. updateSelfScore() {
  7117. let ui = xGame.common.gameUI.ui.topNode;
  7118. ui.selfScoreTxt.text = this.selfScore + "";
  7119. }
  7120. updateAIScore() {
  7121. let ui = xGame.common.gameUI.ui.topNode;
  7122. ui.aiScoreTxt.text = this.aiScore + "";
  7123. }
  7124. updateTargetSroce() {
  7125. let ui = xGame.common.gameUI.ui.topNode;
  7126. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7127. }
  7128. updateLeftBall() {
  7129. let topUI = xGame.common.gameUI.ui.topNode;
  7130. topUI.selfBallList.numItems = this.selfBallArr.length;
  7131. topUI.aiBallList.numItems = this.aiBallArr.length;
  7132. }
  7133. ballShoot() {
  7134. this.clearTime();
  7135. this.finishOneShoot = false;
  7136. xGame.common.gameUI.ui.moveNode.visible = false;
  7137. if (xGame.common.gameUI.ui.guideNode.visible) {
  7138. xGame.common.gameUI.ui.guideNode.visible = false;
  7139. }
  7140. if (this.firstShoot) {
  7141. this.firstShoot = false;
  7142. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7143. }
  7144. }
  7145. ensureCamp(number) {
  7146. this.ensureBallType = true;
  7147. this.isOpenBall = false;
  7148. if (xGame.common.gameMode != GameMode.classic)
  7149. return;
  7150. let full = [1, 2, 3, 4, 5, 6, 7];
  7151. let flower = [9, 10, 11, 12, 13, 14, 15];
  7152. let sayWords = "";
  7153. if (this.selfTurn) {
  7154. if (number <= 7) {
  7155. this.selfCamp = ballCamp.full;
  7156. this.selfBallArr = full;
  7157. this.aiCamp = ballCamp.flower;
  7158. this.aiBallArr = flower;
  7159. sayWords = cfgTable.wordsData[3].msg;
  7160. }
  7161. else {
  7162. this.selfCamp = ballCamp.flower;
  7163. this.selfBallArr = flower;
  7164. this.aiCamp = ballCamp.full;
  7165. this.aiBallArr = full;
  7166. sayWords = cfgTable.wordsData[4].msg;
  7167. }
  7168. }
  7169. else {
  7170. if (number <= 7) {
  7171. this.selfCamp = ballCamp.flower;
  7172. this.selfBallArr = flower;
  7173. this.aiCamp = ballCamp.full;
  7174. this.aiBallArr = full;
  7175. sayWords = cfgTable.wordsData[2].msg;
  7176. }
  7177. else {
  7178. this.selfCamp = ballCamp.full;
  7179. this.selfBallArr = full;
  7180. this.aiCamp = ballCamp.flower;
  7181. this.aiBallArr = flower;
  7182. sayWords = cfgTable.wordsData[1].msg;
  7183. }
  7184. }
  7185. this.updateLeftBall();
  7186. xGame.uiMgr.Show(UIMsg, sayWords);
  7187. }
  7188. updatePlaceBallState() {
  7189. let ui = xGame.common.gameUI.ui;
  7190. switch (this.placeBallData.type) {
  7191. case PlaceBallType.normal:
  7192. let normal = ui.placeNormalNode;
  7193. normal.hpTxt.text = this.curHP + "";
  7194. this.updatePlaceBallStar(normal);
  7195. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7196. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7197. break;
  7198. case PlaceBallType.challenge:
  7199. let challenge = ui.placeChallengeNode;
  7200. challenge.hpTxt.text = "Shots:" + this.curHP;
  7201. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7202. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7203. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7204. break;
  7205. default:
  7206. break;
  7207. }
  7208. }
  7209. playSubHpAni() {
  7210. let ui = xGame.common.gameUI.ui;
  7211. switch (this.placeBallData.type) {
  7212. case PlaceBallType.normal:
  7213. let normal = ui.placeNormalNode;
  7214. normal.hpTxt.visible = false;
  7215. normal.starAni.c1.selectedIndex = 1;
  7216. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7217. normal.hpTxt.visible = true;
  7218. normal.starAni.c1.selectedIndex = 0;
  7219. }));
  7220. break;
  7221. default:
  7222. break;
  7223. }
  7224. }
  7225. getEndStarNum() {
  7226. let num;
  7227. let level = xGame.common.placeBallCurLevel;
  7228. if (this.curHP == this.placeBallData.hp) {
  7229. num = 3;
  7230. }
  7231. else if (this.curHP <= 1) {
  7232. num = 1;
  7233. }
  7234. else {
  7235. num = 2;
  7236. }
  7237. if (!this.success) {
  7238. num = 0;
  7239. }
  7240. else {
  7241. DataMgr.setPlaceBallLevel(level, num);
  7242. }
  7243. let myType = cfgTable.placeballData[level].type;
  7244. if (this.success && myType == 1) {
  7245. num = 3;
  7246. }
  7247. xGame.common.placeBallStarNum = num;
  7248. }
  7249. updatePlaceBallStar(node) {
  7250. let star = 0;
  7251. if (this.curHP == this.placeBallData.hp) {
  7252. star = 3;
  7253. }
  7254. else if (this.curHP >= 2) {
  7255. star = 2;
  7256. }
  7257. else if (this.curHP == 1) {
  7258. star = 1;
  7259. }
  7260. else {
  7261. star = 0;
  7262. }
  7263. let temp;
  7264. for (let index = 1; index <= 3; index++) {
  7265. temp = node["star" + index];
  7266. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7267. }
  7268. node.myProgress.value = (star / 3) * 100;
  7269. }
  7270. openRegretView(isFoul, GoalNum, challenge = false) {
  7271. let regretType = -1;
  7272. if (isFoul) {
  7273. regretType = 1;
  7274. }
  7275. else {
  7276. if (GoalNum <= 0) {
  7277. regretType = 0;
  7278. }
  7279. }
  7280. if (challenge) {
  7281. regretType = 1;
  7282. }
  7283. if (regretType != -1) {
  7284. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7285. if (success) {
  7286. this.curHP++;
  7287. this.updatePlaceBallState();
  7288. this.setPlaceBallAllPos();
  7289. xGame.common.gameUI.ui.moveNode.visible = false;
  7290. }
  7291. else {
  7292. if (this.curHP <= 0) {
  7293. this.success = false;
  7294. this.gameEnd();
  7295. }
  7296. this.playSubHpAni();
  7297. }
  7298. this.updatePlaceBallState();
  7299. this.updatePlaceBallPos();
  7300. });
  7301. }
  7302. }
  7303. setPlaceBallAllPos() {
  7304. let allBall = xGame.common.d2World.ballArr;
  7305. let cfgArr = this.placeBallPosData;
  7306. let temp;
  7307. let obj;
  7308. for (let index = 0; index < allBall.length; index++) {
  7309. temp = allBall[index];
  7310. if (temp.destroyed)
  7311. continue;
  7312. obj = cfgArr[temp.myUNID];
  7313. if (obj && obj.src && !obj.src.destroyed) {
  7314. temp.gameObj.x = obj.posX;
  7315. temp.gameObj.y = obj.posY;
  7316. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7317. }
  7318. }
  7319. xGame.common.d2World.getHelpLine();
  7320. }
  7321. updatePlaceBallPos() {
  7322. let arr = xGame.common.d2World.ballArr;
  7323. let temp;
  7324. for (let index = 0; index < arr.length; index++) {
  7325. temp = arr[index];
  7326. if (!this.placeBallPosData[temp.myUNID]) {
  7327. this.placeBallPosData[temp.myUNID] = {
  7328. src: temp,
  7329. posX: temp.gameObj.x,
  7330. posY: temp.gameObj.y
  7331. };
  7332. }
  7333. else {
  7334. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7335. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7336. }
  7337. }
  7338. let check;
  7339. for (const key in this.placeBallPosData) {
  7340. check = this.placeBallPosData[key];
  7341. if (check.src.destroyed) {
  7342. delete this.placeBallPosData[key];
  7343. }
  7344. }
  7345. }
  7346. gameRun(type) {
  7347. if (this.gamePause)
  7348. return;
  7349. this.curFoul = this.getFoulType();
  7350. if (type) {
  7351. xGame.common.d2World.d2Gan.shoot();
  7352. xGame.common.gameUI.forceCancel();
  7353. this.curFoul = type;
  7354. }
  7355. this.isEnd = false;
  7356. this.isChangeTurn = true;
  7357. if (xGame.common.gameMode == GameMode.classic) {
  7358. this.judgeClassic(this.curFoul);
  7359. this.checkClassicWords(() => {
  7360. xGame.common.destroyClassicEmotion();
  7361. if (this.isEnd) {
  7362. if (this.isBlackInHole) {
  7363. xGame.common.gameUI.ui.blackAni.visible = true;
  7364. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7365. xGame.common.gameUI.ui.blackAni.visible = false;
  7366. this.gameEnd();
  7367. }));
  7368. }
  7369. else {
  7370. this.gameEnd();
  7371. }
  7372. }
  7373. else {
  7374. this.waitShoot();
  7375. xGame.eventMgr.event(WAIT_SHOOT);
  7376. }
  7377. });
  7378. }
  7379. else if (xGame.common.gameMode == GameMode.bigMove) {
  7380. xGame.common.aiPlayer.stopRun();
  7381. let scoreArr = this.getScore(this.curFoul);
  7382. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7383. this.isEnd = true;
  7384. }
  7385. this.checkBigSkillWords(() => {
  7386. if (this.isEnd) {
  7387. this.gameEnd();
  7388. }
  7389. else {
  7390. this.waitShoot();
  7391. xGame.eventMgr.event(WAIT_SHOOT);
  7392. }
  7393. });
  7394. }
  7395. else if (xGame.common.gameMode == GameMode.placeBall) {
  7396. xGame.common.destroyAwardSpine();
  7397. let isFoul = this.curFoul == FoulType.rootHole;
  7398. let GoalNum = this.inHoleBalls.length;
  7399. if (this.inHoleBalls.indexOf(0) > -1)
  7400. GoalNum -= 1;
  7401. if (isFoul) {
  7402. this.placeRootBall();
  7403. }
  7404. console.log("neeballs", this.needBalls);
  7405. console.log("当前完成的goalNum", GoalNum);
  7406. this.finishBalls += GoalNum;
  7407. console.log("当前完成的finishballs", this.finishBalls);
  7408. let need = this.needBalls;
  7409. if (this.placeBallData.type == PlaceBallType.challenge) {
  7410. need += 100;
  7411. }
  7412. if (this.finishBalls >= need) {
  7413. this.success = true;
  7414. this.gameEnd();
  7415. }
  7416. else {
  7417. switch (this.placeBallData.type) {
  7418. case PlaceBallType.normal:
  7419. if (!isFoul && GoalNum > 0) {
  7420. this.updatePlaceBallPos();
  7421. this.updatePlaceBallState();
  7422. }
  7423. else {
  7424. this.curHP--;
  7425. this.openRegretView(isFoul, GoalNum);
  7426. }
  7427. this.waitShoot();
  7428. xGame.eventMgr.event(WAIT_SHOOT);
  7429. break;
  7430. case PlaceBallType.challenge:
  7431. this.curHP--;
  7432. this.updatePlaceBallState();
  7433. if (isFoul) {
  7434. this.openRegretView(isFoul, GoalNum, true);
  7435. }
  7436. else {
  7437. this.updatePlaceBallPos();
  7438. if (this.curHP <= 0) {
  7439. this.success = true;
  7440. this.gameEnd();
  7441. }
  7442. }
  7443. this.waitShoot();
  7444. xGame.eventMgr.event(WAIT_SHOOT);
  7445. break;
  7446. default:
  7447. break;
  7448. }
  7449. }
  7450. }
  7451. }
  7452. checkClassicWords(callback) {
  7453. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7454. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7455. let type = this.getClassicWordsType();
  7456. if (condition && type != -1) {
  7457. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7458. xGame.soundMgr.playSound(str);
  7459. xGame.common.wordsMgr.playClassicWords(type, callback);
  7460. }
  7461. else {
  7462. Laya.timer.once(300, this, () => {
  7463. callback && callback();
  7464. });
  7465. }
  7466. }
  7467. getClassicWordsType() {
  7468. let d2world = xGame.common.d2World;
  7469. let type = -1;
  7470. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7471. type = ClassicWordsType.perfectShow;
  7472. return type;
  7473. }
  7474. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7475. type = ClassicWordsType.directShoot;
  7476. return type;
  7477. }
  7478. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7479. type = ClassicWordsType.anotherShoot;
  7480. return type;
  7481. }
  7482. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7483. type = ClassicWordsType.bigPower;
  7484. return type;
  7485. }
  7486. let minSpeed = 1;
  7487. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7488. type = ClassicWordsType.hardShoot;
  7489. return type;
  7490. }
  7491. if (this.inHoleBalls.length > 0) {
  7492. type = ClassicWordsType.directShoot;
  7493. return type;
  7494. }
  7495. return type;
  7496. }
  7497. checkBigSkillWords(callback) {
  7498. if (this.curFoul == FoulType.timeOut) {
  7499. callback && callback();
  7500. }
  7501. else {
  7502. let playSkill = false;
  7503. if (this.selfTurn) {
  7504. playSkill = true;
  7505. }
  7506. else {
  7507. if (!this.aiPlayedBreakArmy) {
  7508. this.aiPlayedBreakArmy = true;
  7509. playSkill = true;
  7510. }
  7511. if (this.aiCurSkill != SkillType.breakArmy) {
  7512. playSkill = true;
  7513. }
  7514. }
  7515. if (xGame.common.skillMgr.playedLastSkill) {
  7516. xGame.common.skillMgr.playedLastSkill = false;
  7517. playSkill = false;
  7518. }
  7519. if (playSkill) {
  7520. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7521. let selfExtra = 0;
  7522. let aiExtra = 0;
  7523. if (this.selfTurn)
  7524. selfExtra += extraScore;
  7525. else
  7526. aiExtra += extraScore;
  7527. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7528. this.isEnd = true;
  7529. }
  7530. this.playBigSkillTimes(callback);
  7531. });
  7532. }
  7533. else {
  7534. this.playBigSkillTimes(callback);
  7535. }
  7536. }
  7537. }
  7538. playBigSkillTimes(callback) {
  7539. let length = this.inHoleBalls.length;
  7540. if (this.inHoleBalls.indexOf(0) > -1) {
  7541. length = this.inHoleBalls.length - 1;
  7542. }
  7543. if (length <= 0) {
  7544. callback && callback();
  7545. return;
  7546. }
  7547. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7548. callback && callback();
  7549. });
  7550. }
  7551. playSkillTips() {
  7552. let levelNum = 0;
  7553. let curType;
  7554. if (this.selfTurn) {
  7555. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7556. curType = this.selfCurSkill;
  7557. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7558. levelNum += 5;
  7559. }
  7560. }
  7561. else {
  7562. levelNum = this.aiSkillLevelNum;
  7563. curType = this.aiCurSkill;
  7564. }
  7565. let str = ``;
  7566. switch (curType) {
  7567. case SkillType.highSpace:
  7568. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7569. break;
  7570. case SkillType.breakArmy:
  7571. str = `You pocketed ${levelNum} extra balls`;
  7572. break;
  7573. case SkillType.ice:
  7574. str = `${levelNum * 2} extra balls were frozen`;
  7575. break;
  7576. case SkillType.fireworks:
  7577. str = `${levelNum} extra balls exploded `;
  7578. break;
  7579. case SkillType.GuanYu:
  7580. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  7581. break;
  7582. default:
  7583. break;
  7584. }
  7585. xGame.uiMgr.Show(UIMsg, str);
  7586. }
  7587. getFoulType() {
  7588. let foulType = "";
  7589. if (this.firstColliObj == null) {
  7590. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7591. return FoulType.rootHole;
  7592. }
  7593. return FoulType.notTouch;
  7594. }
  7595. else {
  7596. if (this.selfTurn) {
  7597. if (this.selfBallArr.length > 0) {
  7598. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7599. foulType = FoulType.wrongTouch;
  7600. }
  7601. }
  7602. else {
  7603. if (this.ensureBallType) {
  7604. }
  7605. else {
  7606. if (this.firstColliObj == this.blackNum) {
  7607. foulType = FoulType.wrongTouch;
  7608. }
  7609. }
  7610. }
  7611. }
  7612. else {
  7613. if (this.aiBallArr.length > 0) {
  7614. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7615. foulType = FoulType.wrongTouch;
  7616. }
  7617. }
  7618. else {
  7619. if (this.ensureBallType) {
  7620. }
  7621. else {
  7622. if (this.firstColliObj == this.blackNum) {
  7623. foulType = FoulType.wrongTouch;
  7624. }
  7625. }
  7626. }
  7627. }
  7628. if (this.inHoleBalls.length <= 0) {
  7629. return foulType;
  7630. }
  7631. let temp;
  7632. if (this.inHoleBalls.indexOf(0) > -1) {
  7633. foulType = FoulType.rootHole;
  7634. }
  7635. else {
  7636. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7637. temp = this.inHoleBalls[index];
  7638. if (this.selfTurn) {
  7639. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7640. foulType = FoulType.wrongHole;
  7641. break;
  7642. }
  7643. }
  7644. else {
  7645. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7646. foulType = FoulType.wrongHole;
  7647. break;
  7648. }
  7649. }
  7650. }
  7651. }
  7652. let foo;
  7653. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7654. temp = this.inHoleBalls[index];
  7655. foo = this.selfBallArr.indexOf(temp);
  7656. if (foo > -1) {
  7657. this.selfBallArr.splice(foo, 1);
  7658. }
  7659. foo = this.aiBallArr.indexOf(temp);
  7660. if (foo > -1) {
  7661. this.aiBallArr.splice(foo, 1);
  7662. }
  7663. }
  7664. this.updateLeftBall();
  7665. }
  7666. return foulType;
  7667. }
  7668. judgeGameEndByBlack(arr) {
  7669. if (this.selfTurn) {
  7670. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7671. this.selfFoulNum = this.maxFoulTimes;
  7672. return true;
  7673. }
  7674. }
  7675. else {
  7676. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7677. this.aiFoulNum = this.maxFoulTimes;
  7678. return true;
  7679. }
  7680. }
  7681. }
  7682. judgeClassic(type) {
  7683. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7684. xGame.common.aiPlayer.stopRun();
  7685. if (this.judgeNormalSuccess()) {
  7686. this.isEnd = true;
  7687. return;
  7688. }
  7689. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7690. if (this.selfTurn) {
  7691. if (isFoul) {
  7692. this.selfFoulNum++;
  7693. }
  7694. if (this.selfFoulNum >= this.maxFoulTimes) {
  7695. this.success = false;
  7696. this.isEnd = true;
  7697. return;
  7698. }
  7699. }
  7700. else {
  7701. if (isFoul)
  7702. this.aiFoulNum++;
  7703. if (this.aiFoulNum >= this.maxFoulTimes) {
  7704. this.success = true;
  7705. this.isEnd = true;
  7706. return;
  7707. }
  7708. }
  7709. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7710. this.isChangeTurn = false;
  7711. }
  7712. else {
  7713. this.isInterrupt = true;
  7714. }
  7715. }
  7716. waitShoot() {
  7717. if (xGame.common.gameMode == GameMode.classic) {
  7718. switch (this.curFoul) {
  7719. case FoulType.timeOut:
  7720. case FoulType.rootHole:
  7721. this.selfTurn = !this.selfTurn;
  7722. this.peoplePlay(5, 6, true);
  7723. break;
  7724. case FoulType.notTouch:
  7725. this.selfTurn = !this.selfTurn;
  7726. this.peoplePlay(7, 7);
  7727. break;
  7728. case FoulType.wrongHole:
  7729. this.selfTurn = !this.selfTurn;
  7730. this.peoplePlay(11, 11);
  7731. break;
  7732. default:
  7733. if (this.inHoleBalls.length > 0) {
  7734. this.peoplePlay(0, 0, false, false);
  7735. }
  7736. else {
  7737. this.selfTurn = !this.selfTurn;
  7738. this.peoplePlay(7, 7);
  7739. }
  7740. break;
  7741. }
  7742. }
  7743. else if (xGame.common.gameMode == GameMode.bigMove) {
  7744. if (this.curFoul == FoulType.timeOut) {
  7745. this.selfTurn = !this.selfTurn;
  7746. this.peoplePlay(14, 15);
  7747. this.placeRootBall();
  7748. }
  7749. else {
  7750. this.selfTurn = !this.selfTurn;
  7751. if (this.curFoul == FoulType.rootHole) {
  7752. this.peoplePlay(12, 13);
  7753. this.placeRootBall();
  7754. }
  7755. else {
  7756. this.peoplePlay(0, 0, false, false);
  7757. }
  7758. }
  7759. }
  7760. else if (xGame.common.gameMode == GameMode.placeBall) {
  7761. this.finishOneShoot = true;
  7762. }
  7763. this.gameResult();
  7764. }
  7765. gameResult() {
  7766. this.firstColliObj = null;
  7767. this.inHoleBalls = [];
  7768. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7769. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7770. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7771. if (xGame.common.uiRodMethod)
  7772. xGame.common.uiRodMethod.resetRod();
  7773. xGame.common.d2World.rootBall.showSelf();
  7774. this.clearIceSkill();
  7775. if (this.selfTurn) {
  7776. console.log("gameResult");
  7777. PlatMgr.gameInsert();
  7778. }
  7779. xGame.common.d3World.knifeRoot.destroyChildren();
  7780. if (this.selfTurn) {
  7781. xGame.common.gameUI.showHelpLineGuide();
  7782. xGame.common.gameUI.setTurnAlpha(true);
  7783. }
  7784. else {
  7785. xGame.common.gameUI.setTurnAlpha(false);
  7786. }
  7787. }
  7788. getScore(type) {
  7789. let selfAdd = 0;
  7790. let aiAdd = 0;
  7791. if (type == FoulType.timeOut) {
  7792. if (this.selfTurn)
  7793. aiAdd += 3;
  7794. else
  7795. selfAdd += 3;
  7796. }
  7797. else {
  7798. if (this.inHoleBalls.length > 0) {
  7799. if (this.selfTurn) {
  7800. if (type == FoulType.rootHole) {
  7801. aiAdd += 3;
  7802. if (this.inHoleBalls.length - 1 > 0) {
  7803. selfAdd += this.inHoleBalls.length - 1;
  7804. }
  7805. }
  7806. else {
  7807. selfAdd += this.inHoleBalls.length;
  7808. }
  7809. }
  7810. else {
  7811. if (type == FoulType.rootHole) {
  7812. selfAdd += 3;
  7813. if (this.inHoleBalls.length - 1 > 0) {
  7814. aiAdd += this.inHoleBalls.length - 1;
  7815. }
  7816. }
  7817. else {
  7818. aiAdd += this.inHoleBalls.length;
  7819. }
  7820. }
  7821. }
  7822. }
  7823. return [selfAdd, aiAdd];
  7824. }
  7825. judgeScoreEnd(selfAdd, aiAdd) {
  7826. this.selfScore += selfAdd;
  7827. this.aiScore += aiAdd;
  7828. this.updateAIScore();
  7829. this.updateSelfScore();
  7830. if (this.selfScore >= this.targertScore) {
  7831. this.success = true;
  7832. return true;
  7833. }
  7834. if (this.aiScore >= this.targertScore) {
  7835. this.success = false;
  7836. return true;
  7837. }
  7838. let ballArr = xGame.common.d2World.ballArr;
  7839. if (ballArr.length == 1 && ballArr[0].number == 0) {
  7840. if (this.selfScore > this.aiScore) {
  7841. this.success = true;
  7842. return true;
  7843. }
  7844. else if (this.selfScore < this.aiScore) {
  7845. this.success = false;
  7846. return true;
  7847. }
  7848. else {
  7849. if (this.selfTurn) {
  7850. this.success = false;
  7851. }
  7852. else {
  7853. this.success = true;
  7854. }
  7855. return true;
  7856. }
  7857. }
  7858. }
  7859. clearIceSkill() {
  7860. let arr = xGame.common.d2World.ballArr;
  7861. let temp;
  7862. if (this.selfTurn) {
  7863. if (this.selfCurSkill == SkillType.ice) {
  7864. for (let index = 0; index < arr.length; index++) {
  7865. temp = arr[index];
  7866. if (temp.ballFunc == "ice") {
  7867. temp.setBallFunc("normal", "self");
  7868. }
  7869. }
  7870. }
  7871. }
  7872. else {
  7873. if (this.aiCurSkill == SkillType.ice) {
  7874. for (let index = 0; index < arr.length; index++) {
  7875. temp = arr[index];
  7876. if (temp.ballFunc == "ice") {
  7877. temp.setBallFunc("normal", "ai");
  7878. }
  7879. }
  7880. }
  7881. }
  7882. }
  7883. judgeNormalSuccess() {
  7884. if (this.selfTurn) {
  7885. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7886. this.success = true;
  7887. return true;
  7888. }
  7889. }
  7890. else {
  7891. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7892. this.success = false;
  7893. return true;
  7894. }
  7895. }
  7896. }
  7897. gameEnd() {
  7898. if (Moyu.isTT) {
  7899. xGame.common.screenImg = getScreenImg();
  7900. }
  7901. console.log("游戏结束", this.success);
  7902. xGame.common.aiPlayer.stopRun();
  7903. if (xGame.common.gameMode == GameMode.placeBall) {
  7904. this.getEndStarNum();
  7905. this.updatePlaceBallState();
  7906. }
  7907. this.isEnter = false;
  7908. Moyu.recordEnd(this, () => {
  7909. if (this.isEnter)
  7910. return;
  7911. this.isEnter = true;
  7912. console.log("进入录结束回调");
  7913. this.enterNext();
  7914. });
  7915. Laya.timer.once(1000, this, () => {
  7916. if (this.isEnter)
  7917. return;
  7918. this.isEnter = true;
  7919. this.enterNext();
  7920. });
  7921. xGame.common.longHelpLine = false;
  7922. }
  7923. enterNext() {
  7924. Laya.timer.clearAll(this);
  7925. if (Moyu.canShare() > 100 || Moyu.isKs) {
  7926. xGame.uiMgr.Show(UIVideoShare, this.success);
  7927. }
  7928. else {
  7929. xGame.uiMgr.Show(UIGameEnd, this.success);
  7930. }
  7931. }
  7932. aiLeave() {
  7933. let ui = xGame.common.gameUI.ui;
  7934. ui.topNode.aiNameTxt.text = "offline";
  7935. }
  7936. aiGameEnd(suc) {
  7937. this.success = suc;
  7938. xGame.common.aiPlayer.stopRun();
  7939. if (this.success) {
  7940. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  7941. Laya.timer.once(1000, this, () => {
  7942. this.clearTime();
  7943. this.gameEnd();
  7944. });
  7945. }
  7946. }
  7947. openTimer() {
  7948. let src = xGame.common.gameUI;
  7949. if (this.selfTurn) {
  7950. src.ui.topNode.selfProgress.visible = true;
  7951. src.ui.topNode.aiProgress.visible = false;
  7952. this.curTimer = src.ui.topNode.selfProgress;
  7953. }
  7954. else {
  7955. src.ui.topNode.selfProgress.visible = false;
  7956. src.ui.topNode.aiProgress.visible = true;
  7957. this.curTimer = src.ui.topNode.aiProgress;
  7958. }
  7959. this.accTime = 0;
  7960. Laya.timer.clearAll(this);
  7961. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  7962. this.curTimer.value = 100;
  7963. }
  7964. updateTime(dt) {
  7965. if (this.gamePause)
  7966. return;
  7967. this.accTime += dt;
  7968. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  7969. if (this.accTime >= this.setTime) {
  7970. this.clearTime();
  7971. console.log("时钟进入了gameRun");
  7972. this.gameRun(FoulType.timeOut);
  7973. }
  7974. }
  7975. clearTime() {
  7976. let src = xGame.common.gameUI;
  7977. src.ui.topNode.selfProgress.visible = false;
  7978. src.ui.topNode.aiProgress.visible = false;
  7979. Laya.timer.clearAll(this);
  7980. }
  7981. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  7982. let ui = xGame.common.gameUI.ui;
  7983. let selfMsg, aiMsg;
  7984. if (sayWords) {
  7985. selfMsg = cfgTable.wordsData[selfIndex].msg;
  7986. aiMsg = cfgTable.wordsData[aiIndex].msg;
  7987. if (Foul) {
  7988. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  7989. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  7990. this.placeRootBall();
  7991. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  7992. if (this.curFoul == FoulType.rootHole) {
  7993. if (!DataMgr.getRootBallFoul()) {
  7994. DataMgr.setRootBallFoul();
  7995. aiMsg = "";
  7996. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  7997. let woman = "Boss, pay attention next time~";
  7998. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7999. }
  8000. }
  8001. else if (this.curFoul == FoulType.timeOut) {
  8002. if (!DataMgr.getTimeoutFoul()) {
  8003. DataMgr.setTimeoutFoul();
  8004. aiMsg = "";
  8005. let tips = "Game timeout, 3 fouls, this game failed.";
  8006. let woman = "Boss, pay attention to the timeline~";
  8007. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8008. }
  8009. }
  8010. }
  8011. }
  8012. }
  8013. if (this.selfTurn) {
  8014. if (sayWords) {
  8015. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8016. ui.selfTurn.visible = true;
  8017. ui.aiTurn.visible = false;
  8018. ui.selfTurn.t0.play();
  8019. Moyu.vibration();
  8020. });
  8021. }
  8022. }
  8023. else {
  8024. let aiNum = xGame.tools.random(1, 11);
  8025. let challengeNum = DataMgr.getChallengeTimes();
  8026. let delay = false;
  8027. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8028. aiNum = 9;
  8029. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8030. aiNum = 3;
  8031. if (challengeNum == 3) {
  8032. if (!this.showLongView) {
  8033. this.showLongView = true;
  8034. delay = true;
  8035. }
  8036. }
  8037. }
  8038. }
  8039. if (delay) {
  8040. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8041. if (success) {
  8042. xGame.common.longHelpLine = true;
  8043. xGame.common.d2World.getHelpLine();
  8044. }
  8045. else {
  8046. aiNum = 10;
  8047. }
  8048. xGame.common.aiPlayer.setAiLevel(aiNum);
  8049. if (sayWords) {
  8050. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8051. xGame.common.aiPlayer.runAI();
  8052. ui.selfTurn.visible = false;
  8053. ui.aiTurn.visible = true;
  8054. ui.aiTurn.t0.play();
  8055. });
  8056. }
  8057. else {
  8058. xGame.common.aiPlayer.runAI();
  8059. }
  8060. this.openTimer();
  8061. this.finishOneShoot = true;
  8062. if (this.selfTurn) {
  8063. ui.topNode.selfKuang.visible = true;
  8064. ui.topNode.aiKuang.visible = false;
  8065. ui.topNode.selfTips.visible = true;
  8066. ui.topNode.aiTips.visible = false;
  8067. }
  8068. else {
  8069. ui.topNode.selfKuang.visible = false;
  8070. ui.topNode.aiKuang.visible = true;
  8071. ui.topNode.selfTips.visible = false;
  8072. ui.topNode.aiTips.visible = true;
  8073. }
  8074. });
  8075. return;
  8076. }
  8077. if (xGame.common.gameMode == GameMode.classic) {
  8078. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8079. if (cfg) {
  8080. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8081. aiNum = aiLevel;
  8082. }
  8083. }
  8084. xGame.common.aiPlayer.setAiLevel(aiNum);
  8085. if (sayWords) {
  8086. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8087. xGame.common.aiPlayer.runAI();
  8088. ui.selfTurn.visible = false;
  8089. ui.aiTurn.visible = true;
  8090. ui.aiTurn.t0.play();
  8091. });
  8092. }
  8093. else {
  8094. xGame.common.aiPlayer.runAI();
  8095. }
  8096. }
  8097. this.openTimer();
  8098. this.finishOneShoot = true;
  8099. if (this.selfTurn) {
  8100. ui.topNode.selfKuang.visible = true;
  8101. ui.topNode.aiKuang.visible = false;
  8102. ui.topNode.selfTips.visible = true;
  8103. ui.topNode.aiTips.visible = false;
  8104. }
  8105. else {
  8106. ui.topNode.selfKuang.visible = false;
  8107. ui.topNode.aiKuang.visible = true;
  8108. ui.topNode.selfTips.visible = false;
  8109. ui.topNode.aiTips.visible = true;
  8110. }
  8111. }
  8112. placeRootBall() {
  8113. let rootBall = xGame.common.d2World.rootBall;
  8114. if (!rootBall)
  8115. return;
  8116. rootBall.gameObj.x = this.lastRootBallPos.x;
  8117. rootBall.gameObj.y = this.lastRootBallPos.y;
  8118. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8119. let moveNode = xGame.common.gameUI.ui.moveNode;
  8120. moveNode.visible = true;
  8121. moveNode.x = this.lastRootBallPos.x;
  8122. moveNode.y = this.lastRootBallPos.y;
  8123. if (!this.selfTurn) {
  8124. xGame.common.aiPlayer.resetRoot();
  8125. }
  8126. }
  8127. }
  8128. class ui_guanyuAni extends fgui.GComponent {
  8129. static createInstance() {
  8130. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8131. }
  8132. onConstruct() {
  8133. this.n0 = (this.getChild("n0"));
  8134. }
  8135. }
  8136. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8137. class UIFireworks extends UIBase {
  8138. constructor() {
  8139. super();
  8140. }
  8141. onConstructor() {
  8142. this.isEject = false;
  8143. }
  8144. show(callback) {
  8145. super.show();
  8146. }
  8147. }
  8148. UIFireworks.uiName = "UIFireworks";
  8149. class ui_UIGuanYu extends fgui.GComponent {
  8150. static createInstance() {
  8151. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8152. }
  8153. onConstruct() {
  8154. this.n2 = (this.getChild("n2"));
  8155. this.n1 = (this.getChild("n1"));
  8156. this.n3 = (this.getChild("n3"));
  8157. this.n4 = (this.getChild("n4"));
  8158. this.n5 = (this.getChild("n5"));
  8159. this.n6 = (this.getChild("n6"));
  8160. this.n8 = (this.getChild("n8"));
  8161. this.n7 = (this.getChild("n7"));
  8162. this.t0 = this.getTransition("t0");
  8163. }
  8164. }
  8165. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8166. class UIGuanYu extends UIBase {
  8167. constructor() {
  8168. super();
  8169. }
  8170. onConstructor() {
  8171. this.ui = ui_UIGuanYu.createInstance();
  8172. this.contentPane = this.ui;
  8173. this.isEject = false;
  8174. }
  8175. show(callback) {
  8176. super.show();
  8177. this.ui.t0.play(Laya.Handler.create(this, () => {
  8178. callback && callback();
  8179. this.hide();
  8180. }));
  8181. }
  8182. }
  8183. UIGuanYu.uiName = "UIGuanYu";
  8184. class SkillMgr {
  8185. constructor() {
  8186. this.leveNum = 0;
  8187. this.extraScore = 0;
  8188. this.selfTurn = false;
  8189. this.playedLastSkill = false;
  8190. this.tweenArr = [];
  8191. this._finishNum = 0;
  8192. this._curFinish = 0;
  8193. this._rootX = 0;
  8194. this._rootY = 0;
  8195. this.knifeTimes = 0;
  8196. this.knifeV2 = new Laya.Vector2();
  8197. this.knifeV3 = new Laya.Vector3();
  8198. this.rtStarX = 0;
  8199. this.rtStarY = 0;
  8200. this.addBigSkillSpine();
  8201. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8202. }
  8203. addBigSkillSpine() {
  8204. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8205. console.log("extra2 success");
  8206. });
  8207. }
  8208. runBigSkill(callback) {
  8209. this.tweenArr = [];
  8210. this.callback = callback;
  8211. this.judgeSkill();
  8212. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8213. let guide = DataMgr.getSkillGuide();
  8214. if (!xGame.common.gameMgr.selfTurn) {
  8215. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8216. }
  8217. else {
  8218. if (xGame.common.temSelfLevel != 0) {
  8219. this.leveNum = xGame.common.temSelfLevel;
  8220. }
  8221. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8222. this.leveNum += 5;
  8223. }
  8224. }
  8225. if (guide == 0) {
  8226. DataMgr.setSkillGuide(1);
  8227. if (DataMgr.getNewUser()) {
  8228. Moyu.sendDataEvent("gameFirstPlay");
  8229. DataMgr.setNewUser();
  8230. }
  8231. }
  8232. this.playSpineAni(() => {
  8233. switch (this.curSkill) {
  8234. case SkillType.highSpace:
  8235. this.runHighSpace();
  8236. break;
  8237. case SkillType.breakArmy:
  8238. this.runBreakArmy();
  8239. break;
  8240. case SkillType.ice:
  8241. this.runIce();
  8242. break;
  8243. case SkillType.fireworks:
  8244. this.runFireworks();
  8245. break;
  8246. case SkillType.GuanYu:
  8247. this.runGuanYu();
  8248. break;
  8249. default:
  8250. break;
  8251. }
  8252. });
  8253. }
  8254. judgeSkill() {
  8255. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8256. let gameMgr = xGame.common.gameMgr;
  8257. let type;
  8258. for (let index = 0; index < typeArr.length; index++) {
  8259. type = typeArr[index];
  8260. if (gameMgr.selfTurn) {
  8261. if (gameMgr.selfCurSkill == type) {
  8262. this.selfTurn = true;
  8263. this.curSkill = type;
  8264. return;
  8265. }
  8266. }
  8267. else {
  8268. if (gameMgr.aiCurSkill == type) {
  8269. this.selfTurn = false;
  8270. this.curSkill = type;
  8271. return;
  8272. }
  8273. }
  8274. }
  8275. }
  8276. playSpineAni(callback) {
  8277. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8278. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8279. parent.destroyChildren();
  8280. let aniIndex = 0;
  8281. let skillSpine;
  8282. switch (this.curSkill) {
  8283. case SkillType.highSpace:
  8284. aniIndex = 1;
  8285. xGame.soundMgr.playSound("skill01");
  8286. skillSpine = this.skillSpine2;
  8287. data.scaleX = 0.5;
  8288. data.scaleY = 0.5;
  8289. skillSpine.play(data, 1, false, parent, () => {
  8290. callback && callback();
  8291. });
  8292. break;
  8293. case SkillType.breakArmy:
  8294. aniIndex = 2;
  8295. xGame.soundMgr.playSound("skill02");
  8296. skillSpine = this.skillSpine2;
  8297. data.scaleX = 0.5;
  8298. data.scaleY = 0.5;
  8299. skillSpine.play(data, 2, false, parent, () => {
  8300. callback && callback();
  8301. });
  8302. break;
  8303. case SkillType.ice:
  8304. aniIndex = 0;
  8305. xGame.soundMgr.playSound("skill03");
  8306. skillSpine = this.skillSpine2;
  8307. data.scaleX = 0.5;
  8308. data.scaleY = 0.5;
  8309. skillSpine.play(data, 0, false, parent, () => {
  8310. callback && callback();
  8311. });
  8312. break;
  8313. case SkillType.fireworks:
  8314. xGame.soundMgr.playSound("skill_04_01");
  8315. xGame.soundMgr.playSound("skill04");
  8316. xGame.uiMgr.Show(UIFireworks, callback);
  8317. break;
  8318. case SkillType.GuanYu:
  8319. xGame.soundMgr.playSound("skill05_1");
  8320. xGame.soundMgr.playSound("skill05");
  8321. xGame.uiMgr.Show(UIGuanYu, callback);
  8322. break;
  8323. default:
  8324. break;
  8325. }
  8326. }
  8327. getAllBallArr() {
  8328. let arr = xGame.common.d2World.ballArr;
  8329. let outArr = [];
  8330. for (let index = 0; index < arr.length; index++) {
  8331. if (arr[index] instanceof D2RootBallSrc)
  8332. continue;
  8333. if (arr[index].ballFunc == "ice")
  8334. continue;
  8335. if (arr[index].destroyed)
  8336. continue;
  8337. outArr.push(arr[index]);
  8338. }
  8339. return outArr;
  8340. }
  8341. getOneArr(deletObj) {
  8342. let allArr = this.getAllBallArr();
  8343. let temp;
  8344. for (let index = 0; index < allArr.length; index++) {
  8345. temp = allArr[index];
  8346. if (temp.id == deletObj.id) {
  8347. allArr.splice(index, 1);
  8348. break;
  8349. }
  8350. }
  8351. return allArr;
  8352. }
  8353. getNearBallBag(ball) {
  8354. let ui = xGame.common.gameUI.ui;
  8355. let circleArr = [];
  8356. for (let index = 1; index <= 6; index++) {
  8357. circleArr.push(ui.border["circle" + index]);
  8358. }
  8359. let outIndex = 0;
  8360. let temp;
  8361. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8362. ;
  8363. let dis = 0;
  8364. for (let index = 1; index < circleArr.length; index++) {
  8365. temp = circleArr[index];
  8366. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8367. if (dis < min) {
  8368. min = dis;
  8369. outIndex = index;
  8370. }
  8371. }
  8372. return [circleArr[outIndex], outIndex];
  8373. }
  8374. ballFlyToBag(ballArr, time = 300) {
  8375. let temp;
  8376. let hole;
  8377. this._finishNum = ballArr.length;
  8378. this._curFinish = 0;
  8379. let holeObj = {};
  8380. let holeCfg = {
  8381. "1": 0,
  8382. "2": 0,
  8383. "3": 0,
  8384. "4": 0,
  8385. "5": 0,
  8386. "6": 0
  8387. };
  8388. for (let index = 0; index < ballArr.length; index++) {
  8389. temp = ballArr[index];
  8390. temp.outColli.isSensor = true;
  8391. temp.innerColli.isSensor = true;
  8392. temp.isRunSkillAni = true;
  8393. let holeArr = this.getNearBallBag(temp);
  8394. hole = holeArr[0];
  8395. holeObj[index] = holeArr[1];
  8396. temp.d3BallSrc.scaleXYZ = 0.5;
  8397. this.tweenArr.push(temp.d3BallSrc, temp);
  8398. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8399. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8400. }));
  8401. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8402. let mIndex = holeObj[this._curFinish];
  8403. let isDone = holeCfg[mIndex];
  8404. if (isDone) {
  8405. ballArr[this._curFinish].checkWrongBall(false);
  8406. }
  8407. else {
  8408. holeCfg[mIndex] = 1;
  8409. ballArr[this._curFinish].checkWrongBall();
  8410. }
  8411. this._curFinish++;
  8412. if (this._curFinish >= this._finishNum) {
  8413. if (this.curSkill == SkillType.highSpace) {
  8414. }
  8415. else if (this.curSkill == SkillType.breakArmy) {
  8416. let rootBall = xGame.common.d2World.rootBall;
  8417. rootBall.gameObj.x = this._rootX;
  8418. rootBall.gameObj.y = this._rootY;
  8419. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8420. xGame.common.d2World.d2Gan.ui.visible = true;
  8421. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8422. xGame.common.d2World.getHelpLine();
  8423. this.callback && this.callback(this.extraScore);
  8424. }
  8425. }
  8426. }));
  8427. }
  8428. }
  8429. runHighSpace() {
  8430. let rootBall = xGame.common.d2World.rootBall;
  8431. rootBall.showSelf();
  8432. let d3Src = rootBall.d3BallSrc;
  8433. let allArr = this.getAllBallArr();
  8434. if (allArr.length <= 0) {
  8435. this.callback && this.callback(0);
  8436. return;
  8437. }
  8438. let selectBall = xGame.common.d2World.targetBall;
  8439. let wrong = selectBall && selectBall.destroyed;
  8440. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8441. selectBall = xGame.common.getRandArrEle(allArr);
  8442. }
  8443. let targetD3Src = selectBall.d3BallSrc;
  8444. xGame.common.d2World.d2Gan.ui.visible = false;
  8445. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8446. d3Src.scaleXYZ = 0.5;
  8447. this.tweenArr.push(d3Src);
  8448. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8449. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8450. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8451. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8452. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8453. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8454. let outArr = [selectBall];
  8455. let other = this.leveNum - 1;
  8456. if (other > 0) {
  8457. let nearArr = this.getOneArr(selectBall);
  8458. if (nearArr.length > 0) {
  8459. xGame.common.botherArr(nearArr);
  8460. if (other >= nearArr.length)
  8461. other = nearArr.length;
  8462. for (let index = 0; index < other; index++) {
  8463. outArr.push(nearArr[index]);
  8464. }
  8465. }
  8466. }
  8467. xGame.common.extraMoveNum = other + 1;
  8468. this.extraScore = other + 1;
  8469. this._rootX = selectBall.gameObj.x;
  8470. this._rootY = selectBall.gameObj.y;
  8471. rootBall.gameObj.x = this._rootX;
  8472. rootBall.gameObj.y = this._rootY;
  8473. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8474. Laya.Tween.clearAll(d3Src);
  8475. this.addRandomForce(outArr);
  8476. }));
  8477. }));
  8478. }
  8479. addRandomForce(outArr) {
  8480. if (outArr.length > 0) {
  8481. xGame.common.d2World.openCheckStill = true;
  8482. this.playedLastSkill = true;
  8483. }
  8484. let temp;
  8485. for (let index = 0; index < outArr.length; index++) {
  8486. let angle = xGame.common.randomNum(0, 360);
  8487. let linearPercent = xGame.common.randomNum(65, 100);
  8488. temp = outArr[index];
  8489. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8490. }
  8491. }
  8492. setLinearSpeed(angle, rigy, linearPercent) {
  8493. let sin = Math.sin(angle * Math.PI / 180);
  8494. let cos = Math.cos(angle * Math.PI / 180);
  8495. let maxSpeed = 4;
  8496. let speed = new Laya.Vector2();
  8497. speed.x = maxSpeed * linearPercent * sin;
  8498. speed.y = -maxSpeed * linearPercent * cos;
  8499. rigy.applyLinearImpulseToCenter(speed);
  8500. }
  8501. runBreakArmy() {
  8502. xGame.common.d2World.d2Gan.ui.visible = false;
  8503. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8504. let gameUI = xGame.common.gameUI.ui;
  8505. gameUI.skillRod.visible = true;
  8506. gameUI.skillRod.rotation = 110;
  8507. let outArr = this.getAllBallArr();
  8508. if (outArr.length <= 0) {
  8509. gameUI.skillRod.visible = false;
  8510. this.callback && this.callback(0);
  8511. return;
  8512. }
  8513. xGame.common.botherArr(outArr);
  8514. if (this.leveNum >= outArr.length)
  8515. this.leveNum = outArr.length;
  8516. let deleteNum = outArr.length - this.leveNum;
  8517. outArr.splice(0, deleteNum);
  8518. this.extraScore = this.leveNum;
  8519. let potX = gameUI.skillRod.x;
  8520. let potY = gameUI.skillRod.y;
  8521. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8522. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8523. let disArr = [];
  8524. for (let index = 0; index < outArr.length; index++) {
  8525. let obj = outArr[index];
  8526. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8527. dis = Math.pow(dis, 0.5);
  8528. disArr.push(dis);
  8529. }
  8530. this.tweenArr.push(gameUI.skillRod);
  8531. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8532. })).update = Laya.Handler.create(this, (e, t, c) => {
  8533. let angle = gameUI.skillRod.rotation;
  8534. let xx;
  8535. let yy;
  8536. let temp;
  8537. for (let index = 0; index < outArr.length; index++) {
  8538. temp = outArr[index];
  8539. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8540. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8541. yy -= 20;
  8542. temp.gameObj.x = xx;
  8543. temp.gameObj.y = yy;
  8544. temp.d3BallSrc.setTransPos(xx, yy);
  8545. }
  8546. if (angle <= 60) {
  8547. Laya.Tween.clearAll(gameUI.skillRod);
  8548. this.ballFlyToBag(outArr, 150);
  8549. gameUI.skillRod.visible = false;
  8550. }
  8551. }, null, false);
  8552. }
  8553. runIce() {
  8554. let ballArr = xGame.common.d2World.ballArr;
  8555. this.leveNum *= 2;
  8556. if (this.leveNum >= ballArr.length - 1)
  8557. this.leveNum = ballArr.length - 1;
  8558. let tempArr = [];
  8559. let outArr = [];
  8560. for (let index = 0; index < ballArr.length; index++) {
  8561. if (ballArr[index] instanceof D2RootBallSrc)
  8562. continue;
  8563. tempArr.push(ballArr[index]);
  8564. }
  8565. if (tempArr.length <= 0) {
  8566. this.callback && this.callback(0);
  8567. return;
  8568. }
  8569. xGame.common.botherArr(tempArr);
  8570. for (let index = 0; index < this.leveNum; index++) {
  8571. outArr.push(tempArr[index]);
  8572. }
  8573. this.extraScore = this.leveNum;
  8574. let temp;
  8575. for (let index = 0; index < outArr.length; index++) {
  8576. temp = outArr[index];
  8577. temp.d3BallSrc.playIceEft();
  8578. }
  8579. Laya.timer.once(2000, this, () => {
  8580. for (let index = 0; index < outArr.length; index++) {
  8581. temp = outArr[index];
  8582. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8583. temp.setBallFunc("ice", str);
  8584. }
  8585. this.callback && this.callback(0);
  8586. });
  8587. }
  8588. runFireworks() {
  8589. let allArr = this.getAllBallArr();
  8590. if (allArr.length <= 0) {
  8591. this.callback && this.callback(0);
  8592. return;
  8593. }
  8594. xGame.common.d2World.d2Gan.ui.visible = false;
  8595. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8596. let outArr = [];
  8597. let other = this.leveNum;
  8598. if (other > 0) {
  8599. if (allArr.length > 0) {
  8600. xGame.common.botherArr(allArr);
  8601. if (other >= allArr.length)
  8602. other = allArr.length;
  8603. for (let index = 0; index < other; index++) {
  8604. outArr.push(allArr[index]);
  8605. }
  8606. }
  8607. }
  8608. xGame.common.extraMoveNum = other;
  8609. this.extraScore = other;
  8610. this.addRandmomFireworks(outArr);
  8611. }
  8612. addRandmomFireworks(outArr) {
  8613. Laya.timer.once(1100, this, () => {
  8614. if (outArr.length > 0) {
  8615. xGame.common.d2World.openCheckStill = true;
  8616. this.playedLastSkill = true;
  8617. }
  8618. });
  8619. xGame.soundMgr.playSound("skill_04_02");
  8620. let temp;
  8621. let delay = -200;
  8622. for (let index = 0; index < outArr.length; index++) {
  8623. temp = outArr[index];
  8624. delay += 200;
  8625. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8626. let angle = xGame.common.randomNum(0, 360);
  8627. angle = this.getFireworksAngle(obj);
  8628. let linearPercent = xGame.common.randomNum(45, 80);
  8629. if (!obj.destroyed)
  8630. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8631. });
  8632. }
  8633. }
  8634. getFireworksAngle(obj) {
  8635. let rootBall = xGame.common.d2World.rootBall;
  8636. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8637. }
  8638. resetGame() {
  8639. Laya.timer.clearAll(this);
  8640. if (this.tweenArr) {
  8641. for (let index = 0; index < this.tweenArr.length; index++) {
  8642. Laya.Tween.clearAll(this.tweenArr[index]);
  8643. }
  8644. }
  8645. this.tweenArr = null;
  8646. }
  8647. runGuanYu() {
  8648. xGame.common.d2World.d2Gan.ui.visible = false;
  8649. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8650. let rootBall = xGame.common.d2World.rootBall;
  8651. if (rootBall.isInHole) {
  8652. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8653. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8654. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8655. rootBall.showSelf();
  8656. }
  8657. this.rtStarX = rootBall.gameObj.x;
  8658. this.rtStarY = rootBall.gameObj.y;
  8659. this.knifeTimes = 0;
  8660. this.playedLastSkill = true;
  8661. rootBall.forceRun = true;
  8662. rootBall.rigy.type = "static";
  8663. xGame.common.d2World.openCheckStill = true;
  8664. this.guanyuRandomKnife();
  8665. }
  8666. guanyuRandomKnife() {
  8667. let rootBall = xGame.common.d2World.rootBall;
  8668. let dir = this.getRandDir();
  8669. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8670. console.log("当前angle", angle);
  8671. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8672. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8673. let dis = 324;
  8674. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8675. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8676. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8677. this.rtStarX = rootBall.gameObj.x;
  8678. this.rtStarY = rootBall.gameObj.y;
  8679. this.knifeTimes++;
  8680. let skillLevel;
  8681. if (xGame.common.gameMgr.selfTurn) {
  8682. skillLevel = DataMgr.getBigSkillByIndex(4);
  8683. }
  8684. else {
  8685. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8686. }
  8687. if (!skillLevel)
  8688. skillLevel = 1;
  8689. skillLevel += 2;
  8690. if (this.knifeTimes < skillLevel) {
  8691. Laya.timer.once(400, this, () => {
  8692. this.guanyuRandomKnife();
  8693. });
  8694. }
  8695. else {
  8696. rootBall.forceRun = false;
  8697. rootBall.rigy.type = "dynamic";
  8698. xGame.common.extraMoveNum = skillLevel;
  8699. }
  8700. }));
  8701. }
  8702. getRandDir() {
  8703. let rootBall = xGame.common.d2World.rootBall;
  8704. let allBall = this.getAllBallArr();
  8705. let target = xGame.common.getRandArrEle(allBall);
  8706. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8707. return this.knifeV2;
  8708. }
  8709. cloneKnife(x, y, rotation) {
  8710. let parent = xGame.common.d3World.knifeRoot;
  8711. let prefab = xGame.common.d3World.knife;
  8712. let clone = prefab.clone();
  8713. parent.addChild(clone);
  8714. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8715. clone.transform.localPositionX = this.knifeV3.x;
  8716. clone.transform.localPositionY = 0;
  8717. clone.transform.localPositionZ = this.knifeV3.z;
  8718. clone.transform.localRotationEulerX = 0;
  8719. clone.transform.localRotationEulerY = rotation;
  8720. clone.transform.localRotationEulerZ = 0;
  8721. clone.active = true;
  8722. return clone;
  8723. }
  8724. cloneGuanYuEft(x, y, angle) {
  8725. return;
  8726. let parent = xGame.common.gameUI.ui.guanyuNode;
  8727. let eft = new ui_guanyuAni();
  8728. eft.parent = parent;
  8729. eft.x = x;
  8730. eft.y = y;
  8731. eft.rotation = angle;
  8732. }
  8733. }
  8734. class ui_UIWordsList extends fgui.GComponent {
  8735. static createInstance() {
  8736. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8737. }
  8738. onConstruct() {
  8739. this.c1 = this.getController("c1");
  8740. this.n74 = (this.getChild("n74"));
  8741. this.clickNode = (this.getChild("clickNode"));
  8742. this.myNode = (this.getChild("myNode"));
  8743. this.n68 = (this.getChild("n68"));
  8744. this.n66 = (this.getChild("n66"));
  8745. this.n55 = (this.getChild("n55"));
  8746. this.wordsBtn = (this.getChild("wordsBtn"));
  8747. this.emotionBtn = (this.getChild("emotionBtn"));
  8748. this.mybggg = (this.getChild("mybggg"));
  8749. this.wordsList = (this.getChild("wordsList"));
  8750. this.emotionList = (this.getChild("emotionList"));
  8751. this.myRoot = (this.getChild("myRoot"));
  8752. }
  8753. }
  8754. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8755. class EmotionDisplay {
  8756. constructor(index, ui) {
  8757. this.ui = ui;
  8758. this.index = index;
  8759. this.ui.onClick(this, this.clickSelf);
  8760. this.updateSelf();
  8761. }
  8762. updateSelf() {
  8763. let data = cfgTable.emotionData[this.index + 1];
  8764. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8765. }
  8766. clickSelf() {
  8767. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8768. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8769. xGame.common.talkMgr.closeTalkView();
  8770. }
  8771. }
  8772. class WordsDisplay {
  8773. constructor(index, ui) {
  8774. this.ui = ui;
  8775. this.index = index;
  8776. this.ui.onClick(this, this.clickSelf);
  8777. this.updateSelf();
  8778. }
  8779. updateSelf() {
  8780. let data = cfgTable.talkwordsData[this.index + 1];
  8781. this.ui.txt.text = data.msg;
  8782. }
  8783. clickSelf() {
  8784. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8785. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8786. xGame.common.talkMgr.closeTalkView();
  8787. }
  8788. }
  8789. class UIWordsList extends UIBase {
  8790. constructor() {
  8791. super();
  8792. }
  8793. onConstructor() {
  8794. this.ui = ui_UIWordsList.createInstance();
  8795. this.contentPane = this.ui;
  8796. this.isEject = false;
  8797. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8798. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8799. this.addUIClick(this.ui.clickNode, this.hide);
  8800. this.initTalkList();
  8801. this.initEmotionList();
  8802. }
  8803. show() {
  8804. super.show();
  8805. }
  8806. initTalkList() {
  8807. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8808. let data = cfgTable.talkwordsData;
  8809. let length = Object.keys(data).length;
  8810. this.ui.wordsList.numItems = length;
  8811. }
  8812. initEmotionList() {
  8813. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8814. let data = cfgTable.emotionData;
  8815. let length = Object.keys(data).length;
  8816. this.ui.emotionList.numItems = length;
  8817. }
  8818. renderTalkItem(index, obj) {
  8819. let temp = new WordsDisplay(index, obj);
  8820. }
  8821. renderEmotionItem(index, obj) {
  8822. let temp = new EmotionDisplay(index, obj);
  8823. }
  8824. openTalkList() {
  8825. this.ui.c1.selectedIndex = 0;
  8826. }
  8827. openEmotionList() {
  8828. this.ui.c1.selectedIndex = 1;
  8829. }
  8830. }
  8831. UIWordsList.uiName = "UIWordsList";
  8832. class TalkMgr {
  8833. constructor() {
  8834. this.aiSpeak = true;
  8835. this.emotionList = [];
  8836. this.talkList = [];
  8837. this.addEvent();
  8838. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8839. this.emotionList = [];
  8840. this.talkList = [];
  8841. for (let k in cfgTable.emotionData) {
  8842. this.emotionList.push(cfgTable.emotionData[k].id);
  8843. }
  8844. for (let k in cfgTable.talkwordsData) {
  8845. this.talkList.push(cfgTable.talkwordsData[k].id);
  8846. }
  8847. }
  8848. addEvent() {
  8849. let ui = xGame.common.gameUI.ui;
  8850. ui.wordsBtn.visible = true;
  8851. ui.wordsBtn.onClick(this, this.openTalkView);
  8852. ui.aiWordsBtn.visible = true;
  8853. ui.aiWordsBtn.onClick(this, this.clickAIState);
  8854. }
  8855. openTalkView() {
  8856. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8857. xGame.uiMgr.Show(UIWordsList);
  8858. }
  8859. closeTalkView() {
  8860. xGame.uiMgr.Hide(UIWordsList);
  8861. }
  8862. clickAIState() {
  8863. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8864. this.aiSpeak = !this.aiSpeak;
  8865. this.changeAIState(this.aiSpeak);
  8866. }
  8867. changeAIState(speak) {
  8868. this.aiSpeak = speak;
  8869. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  8870. if (speak) {
  8871. btn.c1.selectedIndex = 0;
  8872. }
  8873. else {
  8874. btn.c1.selectedIndex = 1;
  8875. }
  8876. }
  8877. showSelfTalk(wordsId) {
  8878. let ui = xGame.common.gameUI.ui;
  8879. ui.selfTalk.visible = true;
  8880. ui.selfTalk.myNode.c1.selectedIndex = 1;
  8881. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8882. ui.selfTalk.t0.play();
  8883. }
  8884. showSelfEmotion(emotionId) {
  8885. let ui = xGame.common.gameUI.ui;
  8886. ui.selfTalk.visible = true;
  8887. ui.selfTalk.myNode.c1.selectedIndex = 0;
  8888. this.selfSpine && this.selfSpine.dispose();
  8889. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8890. let spineData = cfgTable.emotionData[emotionId].spine;
  8891. this.selfSpine = new SpineMgr(spineData, () => {
  8892. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  8893. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  8894. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8895. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  8896. });
  8897. ui.selfTalk.t0.play();
  8898. }
  8899. showAITalk(wordsId) {
  8900. if (!this.aiSpeak)
  8901. return;
  8902. if (DataMgr.gameData.gameCount < 2)
  8903. return;
  8904. if (wordsId < 1)
  8905. wordsId = this.getRandTalk();
  8906. let ui = xGame.common.gameUI.ui;
  8907. ui.aiTalk.visible = true;
  8908. ui.aiTalk.myNode.c1.selectedIndex = 1;
  8909. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8910. ui.aiTalk.t0.play();
  8911. }
  8912. getRandTalk() {
  8913. let rand = xGame.tools.random(0, this.talkList.length);
  8914. return this.emotionList[rand];
  8915. }
  8916. getRandEmotion() {
  8917. let rand = xGame.tools.random(0, this.emotionList.length);
  8918. return this.emotionList[rand];
  8919. }
  8920. showAIEmotion(emotionId) {
  8921. if (!this.aiSpeak)
  8922. return;
  8923. if (DataMgr.gameData.gameCount < 2)
  8924. return;
  8925. if (emotionId < 1)
  8926. emotionId = this.getRandEmotion();
  8927. let ui = xGame.common.gameUI.ui;
  8928. ui.aiTalk.visible = true;
  8929. ui.aiTalk.myNode.c1.selectedIndex = 0;
  8930. this.aiSpine && this.aiSpine.dispose();
  8931. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8932. let spineData = cfgTable.emotionData[emotionId].spine;
  8933. this.aiSpine = new SpineMgr(spineData, () => {
  8934. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  8935. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  8936. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8937. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  8938. });
  8939. ui.aiTalk.t0.play();
  8940. }
  8941. resetGame() {
  8942. let ui = xGame.common.gameUI.ui;
  8943. ui.aiTalk.visible = false;
  8944. ui.selfTalk.visible = false;
  8945. this.aiSpine && this.aiSpine.dispose();
  8946. this.selfSpine && this.selfSpine.dispose();
  8947. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8948. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8949. this.closeTalkView();
  8950. }
  8951. }
  8952. class WordsMgr {
  8953. constructor() {
  8954. this.comboTimes = 1;
  8955. this.skillTimes = 0;
  8956. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  8957. this.comboSpine = new SpineMgr("yxz_liangan");
  8958. this.skillSpine = new SpineMgr("yiganxqiu");
  8959. this.scoreSpine = new SpineMgr("defen");
  8960. }
  8961. setClassicCombo(isInterrupt) {
  8962. if (isInterrupt) {
  8963. this.comboTimes = 0;
  8964. }
  8965. }
  8966. playClassicWords(type, callback) {
  8967. this.callback = callback;
  8968. let aniIndex = type;
  8969. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8970. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8971. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  8972. mySpine.destroy(true);
  8973. this.playClassicTimes();
  8974. });
  8975. }
  8976. playClassicTimes() {
  8977. this.comboTimes++;
  8978. if (this.comboTimes <= 1) {
  8979. this.callback && this.callback();
  8980. }
  8981. else {
  8982. let aniIndex = this.comboTimes - 1;
  8983. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8984. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8985. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  8986. mySpine.destroy(true);
  8987. this.callback && this.callback();
  8988. });
  8989. }
  8990. }
  8991. playBigSkillTimes(times, callback) {
  8992. if (times <= 0) {
  8993. callback && callback();
  8994. return;
  8995. }
  8996. this.callback = callback;
  8997. let pre = "sz_0";
  8998. let aniIndex = 0;
  8999. this.getWordsImg(times, pre, () => {
  9000. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9001. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9002. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9003. let r1 = ``;
  9004. let r2 = ``;
  9005. if (times <= 9) {
  9006. r1 = `res/d2Res/${pre}${times}.png`;
  9007. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9008. aniIndex = 0;
  9009. }
  9010. else {
  9011. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9012. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9013. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9014. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9015. aniIndex = 1;
  9016. }
  9017. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9018. mySpine.destroy(true);
  9019. xGame.common.gameMgr.playSkillTips();
  9020. this.playScore(times);
  9021. xGame.common.playRandomMutiBallBigSkillSound();
  9022. }, mySpine);
  9023. });
  9024. }
  9025. playScore(score) {
  9026. let pre = "sz_";
  9027. let aniIndex = 0;
  9028. this.getWordsImg(score, pre, () => {
  9029. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9030. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9031. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9032. let r1 = ``;
  9033. let r2 = ``;
  9034. if (score <= 9) {
  9035. r1 = `res/d2Res/${pre}${score}.png`;
  9036. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9037. aniIndex = 0;
  9038. }
  9039. else {
  9040. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9041. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9042. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9043. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9044. aniIndex = 1;
  9045. }
  9046. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9047. mySpine.destroy(true);
  9048. this.callback && this.callback();
  9049. }, mySpine);
  9050. });
  9051. }
  9052. getWordsImg(number, pre = "", callback) {
  9053. let arr = [];
  9054. if (number <= 9) {
  9055. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9056. }
  9057. else {
  9058. 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 });
  9059. }
  9060. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9061. callback && callback();
  9062. }));
  9063. }
  9064. }
  9065. class ui_UIRodMethod extends fgui.GComponent {
  9066. static createInstance() {
  9067. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9068. }
  9069. onConstruct() {
  9070. this.n24 = (this.getChild("n24"));
  9071. this.white = (this.getChild("white"));
  9072. this.dot = (this.getChild("dot"));
  9073. this.sureBtn = (this.getChild("sureBtn"));
  9074. this.n20 = (this.getChild("n20"));
  9075. this.n21 = (this.getChild("n21"));
  9076. this.n22 = (this.getChild("n22"));
  9077. this.n23 = (this.getChild("n23"));
  9078. this.n5 = (this.getChild("n5"));
  9079. this.n14 = (this.getChild("n14"));
  9080. this.t0 = this.getTransition("t0");
  9081. }
  9082. }
  9083. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9084. class UIRodMethod extends UIBase {
  9085. constructor() {
  9086. super();
  9087. this.isPressd = false;
  9088. }
  9089. onConstructor() {
  9090. this.ui = ui_UIRodMethod.createInstance();
  9091. this.contentPane = this.ui;
  9092. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9093. this.moveDir = new Laya.Vector2();
  9094. this.moveDest = new Laya.Vector2();
  9095. this.centerPos = new Laya.Vector2();
  9096. xGame.common.uiRodMethod = this;
  9097. }
  9098. show() {
  9099. super.show();
  9100. xGame.common.gameMgr.gamePause = true;
  9101. this.openPressDotEvent();
  9102. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9103. this.centerPos.x = this.ui.white.x;
  9104. this.centerPos.y = this.ui.white.y;
  9105. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9106. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9107. this.setDot();
  9108. }
  9109. setDot() {
  9110. this.ui.dot.x = this.moveDest.x;
  9111. this.ui.dot.y = this.moveDest.y;
  9112. }
  9113. closeSelf() {
  9114. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9115. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9116. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9117. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9118. xGame.common.gameMgr.gamePause = false;
  9119. this.hide();
  9120. }
  9121. openPressDotEvent() {
  9122. this.closePressDotEvent();
  9123. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9124. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9125. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9126. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9127. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9128. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9129. }
  9130. closePressDotEvent() {
  9131. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9132. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9133. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9134. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9135. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9136. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9137. }
  9138. onDown(e) {
  9139. if (e.type == Laya.Event.MOUSE_DOWN)
  9140. this.isPressd = true;
  9141. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9142. this.isPressd = false;
  9143. if (!this.isPressd)
  9144. return;
  9145. this.moveDest.x = e.stageX;
  9146. this.moveDest.y = e.stageY;
  9147. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9148. if (dis > 6724) {
  9149. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9150. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9151. }
  9152. this.setDot();
  9153. }
  9154. resetRod() {
  9155. this.ui.dot.x = this.ui.white.x;
  9156. this.ui.dot.y = this.ui.white.y;
  9157. this.gameRod.dot.x = this.gameRod.bg.x;
  9158. this.gameRod.dot.y = this.gameRod.bg.y;
  9159. xGame.common.rodOffest.x = 0;
  9160. xGame.common.rodOffest.y = 0;
  9161. }
  9162. }
  9163. UIRodMethod.uiName = "UIRodMethod";
  9164. class UIGame extends UIBase {
  9165. constructor() {
  9166. super();
  9167. this.powerNum = 0;
  9168. this.isD3Inited = false;
  9169. this.isPrePlay = false;
  9170. this.isMoveRod = false;
  9171. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9172. this.rulerDis = 20;
  9173. this.rulerOffset = 0;
  9174. }
  9175. onConstructor() {
  9176. this.ui = ui_UIGame.createInstance();
  9177. this.contentPane = this.ui;
  9178. this.ui.x += xGame.common.sysOffestNum;
  9179. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9180. this.isEject = false;
  9181. xGame.common.gameUI = this;
  9182. this.initSelf();
  9183. }
  9184. isTurnSelf() {
  9185. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9186. return true;
  9187. }
  9188. }
  9189. initSelf() {
  9190. let topUI = this.ui.topNode;
  9191. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9192. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9193. this.barInfo = {};
  9194. this.barInfo.curY = 0;
  9195. this.barInfo.height = this.ui.powerNode.height;
  9196. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9197. this.barInfo.powerStartY = this.ui.powerNode.y;
  9198. xGame.common.aiPlayer = new AIPlayer();
  9199. xGame.common.gameMgr = new GameMgr();
  9200. xGame.common.skillMgr = new SkillMgr();
  9201. xGame.common.wordsMgr = new WordsMgr();
  9202. xGame.common.talkMgr = new TalkMgr();
  9203. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9204. console.log("加载经典模式表情文件chenggon !");
  9205. });
  9206. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9207. console.log("挑战模式奖励模式spine加载成功!");
  9208. });
  9209. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9210. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9211. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9212. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9213. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9214. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9215. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9216. }
  9217. returnHome() {
  9218. let tips = "Are you sure to exit the game?";
  9219. let woman = "Boss, why don't you play for a while longer?";
  9220. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9221. }
  9222. addRodMethodClick() {
  9223. if (this.isTurnSelf()) {
  9224. xGame.uiMgr.Show(UIRodMethod);
  9225. }
  9226. }
  9227. clickHelpLineBtn(force = false) {
  9228. if (!this.isTurnSelf())
  9229. return;
  9230. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9231. if (success) {
  9232. xGame.common.longHelpLine = true;
  9233. xGame.common.d2World.getHelpLine();
  9234. Moyu.sendDataEvent("guideNum");
  9235. }
  9236. else {
  9237. }
  9238. });
  9239. }
  9240. renderSelfDisplayBalls(index, target) {
  9241. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9242. target.myImg.url = xGame.common.getGameIconUrl(str);
  9243. }
  9244. renderAIDisplayBalls(index, target) {
  9245. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9246. target.myImg.url = xGame.common.getGameIconUrl(str);
  9247. ;
  9248. }
  9249. updateMode() {
  9250. if (xGame.common.gameMode == GameMode.classic) {
  9251. this.ui.topNode.scoreNode.visible = false;
  9252. }
  9253. else if (xGame.common.gameMode == GameMode.bigMove) {
  9254. this.ui.topNode.scoreNode.visible = true;
  9255. }
  9256. }
  9257. show() {
  9258. super.show();
  9259. console.log("zh:uigame show");
  9260. this.ui.alpha = 0;
  9261. this.updateSelf();
  9262. console.log("zh:uigame bf gamemusic01 start");
  9263. xGame.soundMgr.playMusic("gamemusic01");
  9264. console.log("zh:uigame bf gamemusic01 end");
  9265. xGame.common.gameMgr.gamePause = false;
  9266. xGame.common.gameUI.ui.blackAni.visible = false;
  9267. xGame.common.gameUI.ui.whiteAni.visible = false;
  9268. this.ui.powerEft.visible = false;
  9269. this.ui.colorNode.visible = false;
  9270. this.updateHead();
  9271. }
  9272. updateSelf() {
  9273. if (xGame.common.gameMode == GameMode.classic) {
  9274. this.ui.c1.selectedIndex = 0;
  9275. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9276. this.ui.topNode.middleNode.visible = true;
  9277. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9278. }
  9279. else if (xGame.common.gameMode == GameMode.bigMove) {
  9280. this.ui.c1.selectedIndex = 0;
  9281. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9282. this.ui.topNode.middleNode.visible = false;
  9283. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9284. let rand = xGame.common.randomNum(1, max);
  9285. let guide = DataMgr.getSkillGuide();
  9286. if (guide == 0)
  9287. rand = 1;
  9288. xGame.common.bigMoveLevelIndex = rand;
  9289. }
  9290. else if (xGame.common.gameMode == GameMode.placeBall) {
  9291. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9292. this.ui.c1.selectedIndex = 1 + data.type;
  9293. this.ui.alpha = 1;
  9294. this.startGame();
  9295. }
  9296. this.updateMode();
  9297. this.initD3world();
  9298. this.initD2world();
  9299. }
  9300. startGame() {
  9301. this.ui.snowNode.visible = Math.random() <= 0.1;
  9302. this.ui.d2Node.visible = false;
  9303. xGame.common.d3World.d3Hand.gameObj.active = false;
  9304. xGame.common.d3World.tableSrc.init();
  9305. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9306. this.cameraViewChange(() => {
  9307. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9308. switch (xGame.common.gameMode) {
  9309. case GameMode.classic:
  9310. xGame.common.d3World.d3Hand.gameObj.active = true;
  9311. this.playPutBallD3Ani();
  9312. break;
  9313. case GameMode.bigMove:
  9314. this.enterGame();
  9315. Laya.timer.once(500, this, () => {
  9316. this.ui.topNode.middleNode.visible = true;
  9317. this.ui.topNode.middleNode.t0.play();
  9318. });
  9319. break;
  9320. case GameMode.placeBall:
  9321. this.enterGame();
  9322. break;
  9323. default:
  9324. break;
  9325. }
  9326. });
  9327. PlatMgr.showBanner(false);
  9328. }
  9329. enterGame() {
  9330. this.ui.d2Node.visible = true;
  9331. xGame.common.d3World.d3Hand.gameObj.active = false;
  9332. xGame.common.showOneCamera("mainCamera");
  9333. Moyu.recordGame(30, true);
  9334. if (!this.isPrePlay) {
  9335. this.isPrePlay = true;
  9336. xGame.common.d3World.prePlayEft();
  9337. }
  9338. xGame.common.gameMgr.gameReady();
  9339. this.openAllEvent();
  9340. this.ui.snowNode.visible = false;
  9341. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9342. this.ui.helpBtn.visible = condition;
  9343. }
  9344. showHelpLineGuide() {
  9345. let longGuide = DataMgr.getGuideHelpLine();
  9346. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9347. this.ui.helpBtn.visible = true;
  9348. this.ui.guideNode.visible = true;
  9349. }
  9350. }
  9351. setTurnAlpha(alpha) {
  9352. this.ui.keduNode.alpha = alpha;
  9353. this.ui.ganNode.alpha = alpha;
  9354. this.ui.rodMethodNode.alpha = alpha;
  9355. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9356. }
  9357. cameraViewChange(callback) {
  9358. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9359. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9360. xGame.common.showOneCamera("visitAngle");
  9361. cameraSrc.localRotationEulerY = 180;
  9362. cameraSrc.localRotationEulerZ = 0;
  9363. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9364. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9365. callback && callback();
  9366. }));
  9367. }));
  9368. }
  9369. playPutBallD3Ani() {
  9370. xGame.common.showOneCamera("mainCamera");
  9371. let handSrc = xGame.common.d3World.d3Hand;
  9372. handSrc.gameObj.active = true;
  9373. handSrc.transform.localPositionZ = 3;
  9374. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9375. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9376. handSrc.gameObj.active = false;
  9377. this.enterGame();
  9378. }), 400);
  9379. }));
  9380. }
  9381. updateHead() {
  9382. let user = Moyu.getUserInfo();
  9383. this.ui.topNode.selfNameTxt.text = user.nickName;
  9384. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9385. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9386. if (DataMgr.getSkillGuide() < 1) {
  9387. this.ui.topNode.aiNameTxt.text = 'billiards';
  9388. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9389. }
  9390. else {
  9391. this.ui.topNode.aiNameTxt.text = aiData.name;
  9392. let randNo = Math.floor(Math.random() * 10) + 1;
  9393. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9394. }
  9395. }
  9396. initD2world() {
  9397. let node = this.ui.d2Root.displayObject;
  9398. let src = node.getComponent(D2World);
  9399. if (!src) {
  9400. xGame.common.d2World = node.addComponent(D2World);
  9401. }
  9402. xGame.common.d2World.initSelf();
  9403. }
  9404. initD3world() {
  9405. if (this.isD3Inited)
  9406. return;
  9407. this.isD3Inited = true;
  9408. let scene3D = xGame.common.d3Scene;
  9409. this.ui.d3Root.displayObject.addChild(scene3D);
  9410. scene3D.active = true;
  9411. xGame.common.d3World.tableSrc.setBorderPos();
  9412. }
  9413. onRootMove(e) {
  9414. let rootBall = xGame.common.d2World.rootBall;
  9415. this.ui.moveNode.x = e.x;
  9416. this.ui.moveNode.y = e.y;
  9417. rootBall.gameObj.x = e.x;
  9418. rootBall.gameObj.y = e.y;
  9419. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9420. }
  9421. aiRootMove(move) {
  9422. if (move)
  9423. this.hideBallUI();
  9424. else {
  9425. this.showBallUI();
  9426. xGame.common.d2World.getHelpLine();
  9427. }
  9428. }
  9429. aiForce(type, force = 0) {
  9430. this.pressTarget = PressType.powerNode;
  9431. if (type == 1)
  9432. this.onEventUp({ force: true });
  9433. else if (type == 2)
  9434. this.onEventMove({ stageY: force, force: true });
  9435. }
  9436. onEventPress(e) {
  9437. if (e.stopPropagation)
  9438. e.stopPropagation();
  9439. if (!this.isTurnSelf())
  9440. return;
  9441. let target = e.target;
  9442. switch (target) {
  9443. case this.ui.myPowerNode.displayObject:
  9444. this.pressTarget = PressType.powerNode;
  9445. this.barInfo.curY = e.stageY;
  9446. this.updateBarInfo();
  9447. break;
  9448. case this.ui.moveNode.displayObject:
  9449. this.pressTarget = PressType.moveNode;
  9450. this.hideBallUI();
  9451. this.eventObj.curX = this.ui.moveNode.x;
  9452. this.eventObj.curY = this.ui.moveNode.y;
  9453. this.ui.moveNode.finger.visible = false;
  9454. this.eventObj.lastX = e.stageX;
  9455. this.eventObj.lastY = e.stageY;
  9456. break;
  9457. case this.ui.rulerClickNode.displayObject:
  9458. this.pressTarget = PressType.rulerNode;
  9459. this.eventObj.lastY = e.stageY;
  9460. break;
  9461. case this.ui.d2Root.displayObject:
  9462. this.pressTarget = PressType.d2Root;
  9463. this.eventObj.lastX = e.stageX;
  9464. this.eventObj.lastY = e.stageY;
  9465. this.eventObj.starX = e.stageX;
  9466. this.eventObj.starY = e.stageY;
  9467. this.eventObj.curX = 0;
  9468. this.eventObj.curY = 0;
  9469. xGame.common.d2World.d2Gan.setGanLastInfo();
  9470. this.rulerOffset = 0;
  9471. break;
  9472. default:
  9473. break;
  9474. }
  9475. }
  9476. onEventMove(e) {
  9477. if (e.stopPropagation)
  9478. e.stopPropagation();
  9479. if (e && e.force) {
  9480. }
  9481. else {
  9482. if (!this.isTurnSelf())
  9483. return;
  9484. }
  9485. switch (this.pressTarget) {
  9486. case PressType.powerNode:
  9487. this.barInfo.curY = e.stageY;
  9488. this.updateBarInfo();
  9489. this.isMoveRod = true;
  9490. break;
  9491. case PressType.moveNode:
  9492. let rootBall = xGame.common.d2World.rootBall;
  9493. let radius = rootBall.gameObj.width / 2;
  9494. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9495. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9496. let border = xGame.common.d2World.borderRect;
  9497. if (curX <= border.x + radius)
  9498. curX = border.x + radius;
  9499. else if (curX >= border.x + border.width - radius)
  9500. curX = border.x + border.width - radius;
  9501. if (curY <= border.y + radius)
  9502. curY = border.y + radius;
  9503. else if (curY >= border.y + border.height - radius)
  9504. curY = border.y + border.height - radius;
  9505. if (xGame.common.gameMgr.isOpenBall) {
  9506. if (curX >= border.x + border.openBallW - radius)
  9507. curX = border.x + border.openBallW - radius;
  9508. }
  9509. this.ui.moveNode.x = curX;
  9510. this.ui.moveNode.y = curY;
  9511. rootBall.gameObj.x = curX;
  9512. rootBall.gameObj.y = curY;
  9513. rootBall.d3BallSrc.setTransPos(curX, curY);
  9514. this.isMoveRod = true;
  9515. break;
  9516. case PressType.rulerNode:
  9517. let yy = e.stageY - this.eventObj.lastY;
  9518. this.eventObj.lastY = e.stageY;
  9519. let ruler1 = this.ui.rulerNode.img1;
  9520. let ruler2 = this.ui.rulerNode.img2;
  9521. ruler1.y += yy;
  9522. ruler2.y += yy;
  9523. this.rulerOffset += yy;
  9524. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9525. this.rulerOffset = 0;
  9526. xGame.soundMgr.playSound("inch", 1, 10);
  9527. }
  9528. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9529. let h = ruler1.height;
  9530. this.checkGuide();
  9531. this.isMoveRod = true;
  9532. if (ruler1.y >= h) {
  9533. ruler1.y = -h;
  9534. ruler2.y = 0;
  9535. return;
  9536. }
  9537. else if (ruler1.y <= -h) {
  9538. ruler1.y = h;
  9539. ruler2.y = 0;
  9540. return;
  9541. }
  9542. if (ruler2.y >= h) {
  9543. ruler2.y = -h;
  9544. ruler1.y = 0;
  9545. return;
  9546. }
  9547. else if (ruler2.y <= -h) {
  9548. ruler2.y = h;
  9549. ruler1.y = 0;
  9550. return;
  9551. }
  9552. break;
  9553. case PressType.d2Root:
  9554. this.eventObj.curX = e.stageX;
  9555. this.eventObj.curY = e.stageY;
  9556. let offset = this.checkRodMoveDir();
  9557. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9558. this.eventObj.lastX = e.stageX;
  9559. this.eventObj.lastY = e.stageY;
  9560. break;
  9561. default:
  9562. break;
  9563. }
  9564. }
  9565. onEventUp(e) {
  9566. if (e.stopPropagation)
  9567. e.stopPropagation();
  9568. if (e && e.force) {
  9569. }
  9570. else {
  9571. if (!this.isTurnSelf())
  9572. return;
  9573. }
  9574. switch (this.pressTarget) {
  9575. case PressType.powerNode:
  9576. this.ui.powerNode.value = 0;
  9577. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9578. this.ui.powerTxt.text = "";
  9579. if (this.powerNum > 0) {
  9580. xGame.eventMgr.event(BALL_SHOOT);
  9581. xGame.common.d2World.shoot(this.powerNum);
  9582. xGame.common.d2World.d2Gan.shoot();
  9583. xGame.common.d2World.d2HelpLine.shoot();
  9584. this.finishGuide();
  9585. this.ui.powerEft.visible = false;
  9586. this.ui.colorNode.visible = false;
  9587. let ganStr = "";
  9588. if (this.powerNum <= 30) {
  9589. ganStr = "gan_30";
  9590. }
  9591. else if (this.powerNum <= 60) {
  9592. ganStr = "gan_50";
  9593. }
  9594. else {
  9595. ganStr = "gan_80";
  9596. }
  9597. xGame.soundMgr.playSound(ganStr);
  9598. }
  9599. break;
  9600. case PressType.moveNode:
  9601. let rootBall = xGame.common.d2World.rootBall;
  9602. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9603. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9604. let isIntersect = this.judgeBallIntersect();
  9605. if (isIntersect) {
  9606. this.ui.moveNode.x = lastX;
  9607. this.ui.moveNode.y = lastY;
  9608. rootBall.gameObj.x = lastX;
  9609. rootBall.gameObj.y = lastY;
  9610. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9611. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9612. }
  9613. else {
  9614. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9615. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9616. }
  9617. this.showBallUI();
  9618. this.ui.moveNode.finger.visible = true;
  9619. xGame.common.d2World.getHelpLine();
  9620. break;
  9621. case PressType.rulerNode:
  9622. break;
  9623. case PressType.d2Root:
  9624. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9625. if (dis <= 25) {
  9626. this.moveToClickDot(e);
  9627. }
  9628. break;
  9629. default:
  9630. break;
  9631. }
  9632. this.pressTarget = -1;
  9633. }
  9634. checkGuide() {
  9635. let guide = DataMgr.getSkillGuide();
  9636. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9637. xGame.common.guideStep++;
  9638. xGame.common.gameUI.ui.guide2.visible = false;
  9639. xGame.common.gameUI.ui.guide3.visible = true;
  9640. }
  9641. }
  9642. finishGuide() {
  9643. let guide = DataMgr.getSkillGuide();
  9644. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9645. xGame.common.guideStep = 10;
  9646. this.closeAllGuide();
  9647. }
  9648. }
  9649. closeAllGuide() {
  9650. xGame.common.gameUI.ui.guide1.visible = false;
  9651. xGame.common.gameUI.ui.guide2.visible = false;
  9652. xGame.common.gameUI.ui.guide3.visible = false;
  9653. }
  9654. updateBarInfo() {
  9655. let star = this.ui.powerNode.y;
  9656. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9657. if (rate >= 1)
  9658. rate = 1;
  9659. if (rate <= 0)
  9660. rate = 0;
  9661. this.powerNum = Math.ceil(rate * 100);
  9662. this.ui.powerNode.value = this.powerNum;
  9663. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9664. this.ui.colorNode.value = this.powerNum;
  9665. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9666. this.ui.powerEft.visible = this.powerNum != 0;
  9667. this.ui.colorNode.visible = this.powerNum != 0;
  9668. this.ui.powerTxt.text = this.powerNum + "";
  9669. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9670. }
  9671. forceCancel() {
  9672. this.ui.powerNode.value = 0;
  9673. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9674. this.ui.powerTxt.text = "";
  9675. }
  9676. checkRodMoveDir() {
  9677. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9678. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9679. if (tempX >= 0 && tempY <= 0) {
  9680. return this.checkDir();
  9681. }
  9682. else if (tempX < 0 && tempY < 0) {
  9683. return this.checkDir(1, -1);
  9684. }
  9685. else if (tempX < 0 && tempY > 0) {
  9686. return this.checkDir(-1, -1);
  9687. }
  9688. else {
  9689. return this.checkDir(-1, 1);
  9690. }
  9691. }
  9692. checkDir(flagX = 1, flagY = 1) {
  9693. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9694. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9695. if (offsetY == 0) {
  9696. return offsetX * flagX;
  9697. }
  9698. if (offsetX == 0) {
  9699. return offsetY * flagY;
  9700. }
  9701. let angle = offsetY / offsetX;
  9702. if (Math.abs(angle) >= 1) {
  9703. return offsetY * flagY;
  9704. }
  9705. else {
  9706. return offsetX * flagX;
  9707. }
  9708. }
  9709. judgeBallIntersect() {
  9710. let rootBall = xGame.common.d2World.rootBall;
  9711. let ballArr = xGame.common.d2World.ballArr;
  9712. let radius = rootBall.gameObj.width / 2;
  9713. let temp;
  9714. let isIntersect = false;
  9715. for (let index = 0; index < ballArr.length; index++) {
  9716. temp = ballArr[index];
  9717. if (temp.number == rootBall.number)
  9718. continue;
  9719. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9720. if (isIntersect) {
  9721. break;
  9722. }
  9723. }
  9724. return isIntersect;
  9725. }
  9726. hideBallUI() {
  9727. let d2Gan = xGame.common.d2World.d2Gan;
  9728. if (!d2Gan.ui.isDisposed)
  9729. d2Gan.ui.visible = false;
  9730. let d2Help = xGame.common.d2World.d2HelpLine;
  9731. if (!d2Help.ui.isDisposed)
  9732. d2Help.ui.visible = false;
  9733. let rootBall = xGame.common.d2World.rootBall;
  9734. if (!rootBall.destroyed) {
  9735. rootBall.gameObj.active = false;
  9736. }
  9737. }
  9738. showBallUI() {
  9739. let d2Gan = xGame.common.d2World.d2Gan;
  9740. if (!d2Gan.ui.isDisposed)
  9741. d2Gan.ui.visible = true;
  9742. let d2Help = xGame.common.d2World.d2HelpLine;
  9743. if (!d2Help.ui.isDisposed)
  9744. d2Help.ui.visible = true;
  9745. let rootBall = xGame.common.d2World.rootBall;
  9746. if (!rootBall.destroyed) {
  9747. rootBall.gameObj.active = true;
  9748. }
  9749. }
  9750. moveToClickDot(e) {
  9751. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9752. let root = xGame.common.d2World.rootBall.gameObj;
  9753. let xx = e.stageX - xGame.common.sysOffestNum;
  9754. let yy = e.stageY;
  9755. let x = xx - root.x;
  9756. let y = yy - root.y;
  9757. let angle = xGame.common.getfguiRotation(x, y);
  9758. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9759. xGame.common.d2World.getHelpLine();
  9760. }
  9761. this.isMoveRod = false;
  9762. xGame.common.clickedBall = false;
  9763. }
  9764. openAllEvent() {
  9765. this.closeAllEvent();
  9766. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9767. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9768. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9769. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9770. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9771. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9772. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9773. }
  9774. closeAllEvent() {
  9775. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9776. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9777. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9778. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9779. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9780. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9781. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9782. }
  9783. resetGame() {
  9784. this.closeAllEvent();
  9785. this.hideBallUI();
  9786. xGame.common.gameMgr.gamePause = true;
  9787. }
  9788. }
  9789. UIGame.uiName = "UIGame";
  9790. class UIAddProp extends UIBase {
  9791. constructor() {
  9792. super();
  9793. this.curType = "";
  9794. }
  9795. onConstructor() {
  9796. this.ui = ui_UIAddProp.createInstance();
  9797. this.contentPane = this.ui;
  9798. this.isEject = false;
  9799. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9800. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9801. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9802. this.updateUI();
  9803. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9804. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9805. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9806. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9807. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9808. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9809. }
  9810. show(type) {
  9811. super.show();
  9812. this.curType = type == 0 ? "coin" : "diamond";
  9813. this.switchBtn("");
  9814. this.ui.t0.play();
  9815. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9816. PlatMgr.showInsert(true);
  9817. }
  9818. closeSelf() {
  9819. this.hide();
  9820. }
  9821. updateUI() {
  9822. let data = cfgTable.moneyData;
  9823. let temp;
  9824. let obj;
  9825. for (const key in data) {
  9826. temp = data[key];
  9827. obj = this.ui.myNode["node" + key];
  9828. if (parseInt(key) <= 2) {
  9829. obj.diamondTxt.text = "+" + temp.num;
  9830. }
  9831. else {
  9832. obj.coinTxt.text = temp.num;
  9833. obj.diamondTxt.text = temp.get.split('_')[1];
  9834. }
  9835. }
  9836. this.updateDiamondShare();
  9837. }
  9838. updateDiamondShare() {
  9839. let data = DataMgr.getShareDiamondTimes();
  9840. if (data >= xGame.common.maxShareDiamondTimes) {
  9841. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  9842. this.ui.myNode.node1.touchable = false;
  9843. }
  9844. else {
  9845. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9846. this.ui.myNode.node1.touchable = true;
  9847. }
  9848. }
  9849. switchBtn(type) {
  9850. if (type == "")
  9851. type = this.curType;
  9852. else {
  9853. if (this.curType == type) {
  9854. return;
  9855. }
  9856. else {
  9857. this.curType = type;
  9858. }
  9859. }
  9860. if (type == "coin") {
  9861. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9862. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9863. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9864. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9865. this.ui.myNode.c1.selectedIndex = 0;
  9866. }
  9867. else {
  9868. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9869. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9870. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9871. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9872. this.ui.myNode.c1.selectedIndex = 1;
  9873. }
  9874. }
  9875. convertCoin(index) {
  9876. let data = cfgTable.moneyData[index];
  9877. let coinNum = data.num;
  9878. let str = data.get.split('_')[1];
  9879. let needDiamond = parseInt(str);
  9880. if (DataMgr.diamondEnough(needDiamond)) {
  9881. DataMgr.setDiamond(-needDiamond);
  9882. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9883. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  9884. }
  9885. else {
  9886. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  9887. this.switchBtn("diamond");
  9888. }
  9889. }
  9890. videoGetDiamond() {
  9891. let num = cfgTable.moneyData[2].num;
  9892. Moyu.showVideoAd(() => {
  9893. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9894. this.closeSelf();
  9895. }, EAdType.addDiamond);
  9896. }
  9897. videoGetCoin() {
  9898. Moyu.showVideoAd(() => {
  9899. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9900. this.closeSelf();
  9901. }, EAdType.addCoin);
  9902. }
  9903. shareGetDiamond() {
  9904. let times = DataMgr.getShareDiamondTimes();
  9905. if (times >= xGame.common.maxShareDiamondTimes) {
  9906. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  9907. }
  9908. else {
  9909. if (Moyu.isTT) {
  9910. let num = cfgTable.moneyData[1].num;
  9911. Moyu.shareVideo = '';
  9912. Moyu.shareGame((success) => {
  9913. if (success) {
  9914. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9915. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9916. DataMgr.setShareDiamondTimes(1);
  9917. this.updateDiamondShare();
  9918. }
  9919. else {
  9920. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9921. }
  9922. });
  9923. }
  9924. else {
  9925. Moyu.showVideoAd(() => {
  9926. let diamond = xGame.common.randomNum(50, 100);
  9927. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9928. DataMgr.setShareDiamondTimes(1);
  9929. this.updateDiamondShare();
  9930. }, EAdType.randomDiamond);
  9931. }
  9932. }
  9933. }
  9934. openPutBallView() {
  9935. let end = xGame.uiMgr.getUI(UIGameEnd);
  9936. let skill = xGame.uiMgr.getUI(UISkill);
  9937. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9938. let uigame = xGame.uiMgr.getUI(UIGame);
  9939. if (end && !end.isHide) {
  9940. xGame.uiMgr.Hide(UIGameEnd);
  9941. xGame.uiMgr.Show(UIMain);
  9942. }
  9943. if (skill && !skill.isHide)
  9944. xGame.uiMgr.Hide(UISkill);
  9945. if (uigame && !uigame.isHide)
  9946. xGame.uiMgr.Hide(UIGame);
  9947. if (level && !level.isHide) {
  9948. }
  9949. else {
  9950. xGame.uiMgr.Show(UILevelDisplay);
  9951. }
  9952. this.closeSelf();
  9953. }
  9954. }
  9955. UIAddProp.uiName = "UIAddProp";
  9956. class MoneyNode {
  9957. constructor(ui) {
  9958. this.leftTime = 0;
  9959. this.ui = ui;
  9960. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9961. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9962. this.ui.addPowerBtn.onClick(this, this.addPower);
  9963. this.ui.c1.selectedIndex = 1;
  9964. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9965. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9966. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9967. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  9968. this.coinChange();
  9969. this.diamondChange();
  9970. this.powerChange();
  9971. }
  9972. addPower() {
  9973. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9974. xGame.uiMgr.Show(UIPower);
  9975. }
  9976. powerChange() {
  9977. let powerNum = DataMgr.getPower();
  9978. this.ui.powerTxt.text = powerNum + "";
  9979. }
  9980. checkPowerTime() {
  9981. let cur = new Date().getTime();
  9982. let last = DataMgr.getPowerTime();
  9983. if (last == 0) {
  9984. last = cur;
  9985. DataMgr.setPowerTime(cur);
  9986. }
  9987. let power = DataMgr.getPower();
  9988. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  9989. Laya.timer.clearAll(this);
  9990. if (power >= xGame.common.natureMaxPower) {
  9991. this.ui.powerTimeTxt.text = "";
  9992. DataMgr.setPowerTime(cur);
  9993. return;
  9994. }
  9995. if (power + offset >= xGame.common.natureMaxPower) {
  9996. DataMgr.setPower(xGame.common.natureMaxPower, false);
  9997. this.ui.powerTimeTxt.text = "";
  9998. DataMgr.setPowerTime(cur);
  9999. }
  10000. else {
  10001. if (offset > 0) {
  10002. DataMgr.setPower(offset);
  10003. DataMgr.setPowerTime(cur);
  10004. }
  10005. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10006. this.leftTime = xGame.common.powerRecoverNum - time;
  10007. if (this.leftTime <= 0)
  10008. this.leftTime = 0;
  10009. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10010. Laya.timer.loop(1000, this, this.updatePowerTime);
  10011. }
  10012. }
  10013. updatePowerTime() {
  10014. this.leftTime -= 1;
  10015. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10016. if (this.leftTime <= 0) {
  10017. this.checkPowerTime();
  10018. }
  10019. }
  10020. coinChange() {
  10021. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10022. }
  10023. diamondChange() {
  10024. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10025. }
  10026. addCoin() {
  10027. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10028. Moyu.sendDataEvent("AddCoinBtn");
  10029. xGame.uiMgr.Show(UIAddProp, 0);
  10030. }
  10031. addDiamond() {
  10032. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10033. Moyu.sendDataEvent("AddDiamondBtn");
  10034. xGame.uiMgr.Show(UIAddProp, 1);
  10035. }
  10036. }
  10037. class UIDraw extends UIBase {
  10038. constructor() {
  10039. super();
  10040. this.curKey = 0;
  10041. }
  10042. onConstructor() {
  10043. this.ui = ui_UIDraw.createInstance();
  10044. this.contentPane = this.ui;
  10045. this.isEject = false;
  10046. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10047. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10048. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10049. this.initDraw();
  10050. this.initUI();
  10051. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10052. if (Moyu.isKs)
  10053. this.ui.closeNode.closeBtn.x += 100;
  10054. }
  10055. show() {
  10056. super.show();
  10057. this.ui.t0.play();
  10058. this.playSecretaryIdle();
  10059. this.updateDraw();
  10060. this.checkFree();
  10061. if (PlatMgr.bannerDelay > 0) {
  10062. this.ui.closeNode.closeBtn.visible = false;
  10063. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10064. this.ui.closeNode.closeBtn.visible = true;
  10065. });
  10066. }
  10067. PlatMgr.showRateBanner();
  10068. }
  10069. hide() {
  10070. Laya.timer.clearAll(this);
  10071. super.hide();
  10072. }
  10073. checkFree() {
  10074. let isFree = DataMgr.getDailyfreeDrawTimes();
  10075. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10076. }
  10077. initDraw() {
  10078. this.drawObj = [];
  10079. let data = cfgTable.drawData;
  10080. let temp;
  10081. let weight = 0;
  10082. for (const key in data) {
  10083. temp = data[key];
  10084. weight += temp.weight;
  10085. this.drawObj.push(weight);
  10086. }
  10087. this.allWeight = weight;
  10088. }
  10089. initUI() {
  10090. let data = cfgTable.drawData;
  10091. let temp;
  10092. let img;
  10093. let txt;
  10094. for (const key in data) {
  10095. temp = data[key];
  10096. img = this.ui.myNode.rotNode["img" + key];
  10097. txt = this.ui.myNode.rotNode["txt" + key];
  10098. img.url = xGame.common.getGameIconUrl(temp.icon);
  10099. txt.visible = true;
  10100. if (temp.award > 2) {
  10101. img.rotation = 0;
  10102. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10103. }
  10104. else {
  10105. img.rotation = temp.rotation;
  10106. txt.text = temp.num;
  10107. }
  10108. }
  10109. }
  10110. getCurkey() {
  10111. let rand = Math.random() * this.allWeight;
  10112. let temp;
  10113. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10114. temp = this.drawObj[index];
  10115. if (index == 0) {
  10116. if (rand < temp) {
  10117. return index + 1;
  10118. }
  10119. }
  10120. else {
  10121. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10122. return index + 1;
  10123. }
  10124. }
  10125. }
  10126. return 2;
  10127. }
  10128. startDraw() {
  10129. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10130. if (freeTimes > 0) {
  10131. this.beginDraw();
  10132. DataMgr.setDailyfreeDrawTimes(0);
  10133. this.checkFree();
  10134. }
  10135. else {
  10136. Moyu.sendDataEvent("turntable");
  10137. Moyu.showVideoAd(() => {
  10138. this.beginDraw();
  10139. }, EAdType.draw);
  10140. }
  10141. }
  10142. beginDraw() {
  10143. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10144. this.ui.drawBtn.touchable = false;
  10145. this.curKey = this.getCurkey();
  10146. console.log("当前key", this.curKey);
  10147. let cell = 60;
  10148. let lap = 3;
  10149. let angle = cell * (this.curKey - 1) + lap * 360;
  10150. let target = this.ui.myNode.rotNode;
  10151. target.rotation = 0;
  10152. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10153. console.log("旋转完成");
  10154. this.ui.drawBtn.touchable = true;
  10155. this.getAward();
  10156. }));
  10157. }
  10158. getAward() {
  10159. let data = cfgTable.drawData[this.curKey];
  10160. let temp = new AwardType();
  10161. temp.type = data.award;
  10162. temp.num = data.num;
  10163. xGame.common.getAward([temp], () => {
  10164. DataMgr.setDrawTimes(1);
  10165. this.updateDraw();
  10166. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10167. });
  10168. }
  10169. updateDraw() {
  10170. let drawTimes = DataMgr.getDrawTimes();
  10171. let awardTimes = DataMgr.getDrawAwardTimes();
  10172. if (Math.floor(drawTimes / 3) > awardTimes) {
  10173. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10174. this.ui.extraNode.boxBtn.touchable = true;
  10175. this.ui.extraNode.tipsTxt.text = "3/3";
  10176. this.ui.extraNode.barNode.width = 265;
  10177. this.getExtraAward();
  10178. }
  10179. else {
  10180. this.ui.extraNode.boxBtn.t0.stop();
  10181. this.ui.extraNode.boxBtn.touchable = false;
  10182. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10183. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10184. }
  10185. let data = cfgTable.drawData[1];
  10186. if (awardTimes == 0) {
  10187. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10188. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10189. this.ui.myNode.rotNode.img1.rotation = 0;
  10190. }
  10191. else {
  10192. let award = data.nextid;
  10193. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10194. this.ui.myNode.rotNode.txt1.text = award[1];
  10195. this.ui.myNode.rotNode.img1.rotation = 0;
  10196. }
  10197. }
  10198. getExtraAward() {
  10199. let drawTimes = DataMgr.getDrawTimes();
  10200. let awardTimes = DataMgr.getDrawAwardTimes();
  10201. let data = cfgTable.drawData[1];
  10202. let award = new AwardType();
  10203. if (awardTimes == 0) {
  10204. award.num = data.num;
  10205. award.type = data.award;
  10206. xGame.common.getAward([award], () => {
  10207. let all = Math.floor(drawTimes / 3);
  10208. DataMgr.setDrawAwardTimes(all);
  10209. this.updateDraw();
  10210. });
  10211. }
  10212. else {
  10213. award.num = parseInt(data.nextid[1]);
  10214. award.type = parseInt(data.nextid[0]);
  10215. xGame.common.getAward([award], () => {
  10216. let all = Math.floor(drawTimes / 3);
  10217. DataMgr.setDrawAwardTimes(all);
  10218. this.updateDraw();
  10219. });
  10220. }
  10221. }
  10222. closeSelf() {
  10223. this.hide();
  10224. }
  10225. playSecretaryIdle() {
  10226. let parent = this.ui.secretary.displayObject;
  10227. parent.destroyChildren();
  10228. let xx = this.ui.secretary.width / 2;
  10229. let yy = this.ui.secretary.height;
  10230. let scale = xGame.common.getSecretaryScale();
  10231. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10232. xGame.common.secretary.play(data, 1, true, parent);
  10233. }
  10234. }
  10235. UIDraw.uiName = "UIDraw";
  10236. class ui_UIFlyEft extends fgui.GComponent {
  10237. static createInstance() {
  10238. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10239. }
  10240. onConstruct() {
  10241. this.n0 = (this.getChild("n0"));
  10242. this.n1 = (this.getChild("n1"));
  10243. this.n2 = (this.getChild("n2"));
  10244. this.n3 = (this.getChild("n3"));
  10245. this.n4 = (this.getChild("n4"));
  10246. this.n5 = (this.getChild("n5"));
  10247. this.n6 = (this.getChild("n6"));
  10248. this.n7 = (this.getChild("n7"));
  10249. this.iconNode = (this.getChild("iconNode"));
  10250. this.txt = (this.getChild("txt"));
  10251. this.txtNode = (this.getChild("txtNode"));
  10252. }
  10253. }
  10254. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10255. class UIFlyEft extends UIBase {
  10256. constructor() {
  10257. super();
  10258. this.max = 8;
  10259. this.delay = 0;
  10260. }
  10261. onConstructor() {
  10262. this.ui = ui_UIFlyEft.createInstance();
  10263. this.contentPane = this.ui;
  10264. this.isEject = false;
  10265. this.isMuti = true;
  10266. this.ui.x += xGame.common.sysOffestNum;
  10267. }
  10268. getArrPos() {
  10269. if (this.iconPos && this.iconPos.length > 0)
  10270. return;
  10271. this.iconPos = [];
  10272. let temp;
  10273. for (let index = 0; index < this.max; index++) {
  10274. temp = this.ui["n" + index];
  10275. this.iconPos.push([temp.x, temp.y]);
  10276. }
  10277. }
  10278. show(stPos, edPos, num, type, callback) {
  10279. super.show();
  10280. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10281. this.getArrPos();
  10282. this.updateUI(type);
  10283. this.updatePos();
  10284. this.runFly(edPos, callback);
  10285. this.runWorlds(stPos, num);
  10286. }
  10287. updateUI(type) {
  10288. let temp;
  10289. let str;
  10290. for (let index = 0; index < this.max; index++) {
  10291. temp = this.ui["n" + index];
  10292. str = this.getIconStr(type);
  10293. temp.url = xGame.common.getGameIconUrl(str);
  10294. }
  10295. }
  10296. getIconStr(type) {
  10297. switch (type) {
  10298. case Prop.diamond:
  10299. return "ty_zs";
  10300. case Prop.coin:
  10301. return "ty_jb";
  10302. default:
  10303. break;
  10304. }
  10305. }
  10306. updatePos() {
  10307. let temp;
  10308. for (let index = 0; index < this.max; index++) {
  10309. temp = this.ui["n" + index];
  10310. temp.x = this.iconPos[index][0];
  10311. temp.y = this.iconPos[index][1];
  10312. }
  10313. }
  10314. runFly(endPos, callback) {
  10315. let all = 0;
  10316. let temp;
  10317. for (let index = 0; index < this.max; index++) {
  10318. temp = this.ui["n" + index];
  10319. temp.visible = true;
  10320. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10321. temp.visible = false;
  10322. all++;
  10323. if (all >= this.max) {
  10324. callback && callback();
  10325. }
  10326. }), 20 * index);
  10327. }
  10328. }
  10329. runWorlds(stPos, num) {
  10330. let str = "+" + num;
  10331. this.ui.txt.text = str;
  10332. let starX = stPos.x;
  10333. let starY = stPos.y + 50;
  10334. this.ui.txt.x = starX;
  10335. this.ui.txt.y = starY;
  10336. this.ui.txt.visible = true;
  10337. this.ui.txt.alpha = 1;
  10338. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10339. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10340. this.ui.txt.visible = false;
  10341. this.hide();
  10342. }));
  10343. }));
  10344. }
  10345. }
  10346. UIFlyEft.uiName = "UIFlyEft";
  10347. class ui_UIGetAward extends fgui.GComponent {
  10348. static createInstance() {
  10349. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10350. }
  10351. onConstruct() {
  10352. this.n4 = (this.getChild("n4"));
  10353. this.n0 = (this.getChild("n0"));
  10354. this.myList = (this.getChild("myList"));
  10355. this.n1 = (this.getChild("n1"));
  10356. this.eftNode = (this.getChild("eftNode"));
  10357. this.btnNode = (this.getChild("btnNode"));
  10358. this.t0 = this.getTransition("t0");
  10359. }
  10360. }
  10361. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10362. class UIGetAward extends UIBase {
  10363. constructor() {
  10364. super();
  10365. this.showTriple = true;
  10366. }
  10367. onConstructor() {
  10368. this.ui = ui_UIGetAward.createInstance();
  10369. this.contentPane = this.ui;
  10370. this.isEject = false;
  10371. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10372. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10373. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10374. }
  10375. show(arr, showTriple, callback) {
  10376. super.show();
  10377. this.ui.t0.play();
  10378. this.ui.eftNode.visible = true;
  10379. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10380. this.ui.eftNode.visible = false;
  10381. }), 1, 0, 0, 0.9);
  10382. this.awardArr = arr;
  10383. this.showTriple = showTriple;
  10384. this.callback = callback;
  10385. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10386. this.ui.myList.numItems = arr.length;
  10387. xGame.soundMgr.playSound("getaward");
  10388. }
  10389. updateSelf(index, obj) {
  10390. let temp = this.awardArr[index];
  10391. let icon = this.getIcon(temp.type);
  10392. let str = icon;
  10393. if (temp.type > 2) {
  10394. str = "s" + icon;
  10395. }
  10396. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10397. obj.myIcon.rotation = 0;
  10398. obj.numTxt.text = temp.num + "";
  10399. obj.numTxt.visible = temp.type > 2 ? false : true;
  10400. obj.nameTxt.text = this.getNameStr(temp.type);
  10401. }
  10402. renderItem(index, obj) {
  10403. this.updateSelf(index, obj);
  10404. }
  10405. tripleGetAward() {
  10406. Moyu.showVideoAd(() => {
  10407. this.getAward(3);
  10408. }, EAdType.triple);
  10409. }
  10410. normalGetAward() {
  10411. if (PlatMgr.isMisVideo())
  10412. this.tripleGetAward();
  10413. else
  10414. this.getAward();
  10415. }
  10416. getAward(times = 1) {
  10417. this.hide();
  10418. for (let index = 0; index < this.awardArr.length; index++) {
  10419. this.awardArr[index].num *= times;
  10420. }
  10421. this.callback && this.callback(times != 1);
  10422. }
  10423. getIcon(type) {
  10424. switch (type) {
  10425. case Prop.diamond:
  10426. return "ty_zs";
  10427. case Prop.coin:
  10428. return "ty_jb";
  10429. case Prop.gan1:
  10430. return "qg1";
  10431. case Prop.gan2:
  10432. return "qg2";
  10433. case Prop.gan3:
  10434. return "qg3";
  10435. case Prop.gan4:
  10436. return "qg4";
  10437. default:
  10438. break;
  10439. }
  10440. }
  10441. getNameStr(type) {
  10442. switch (type) {
  10443. case Prop.diamond:
  10444. return "Diamond";
  10445. case Prop.coin:
  10446. return "Coins";
  10447. case Prop.gan1:
  10448. case Prop.gan2:
  10449. case Prop.gan3:
  10450. case Prop.gan4:
  10451. return cfgTable.ballrodData[type - 1].name;
  10452. default:
  10453. break;
  10454. }
  10455. }
  10456. }
  10457. UIGetAward.uiName = "UIGetAward";
  10458. class Common {
  10459. constructor() {
  10460. this.convertNum = 0.025;
  10461. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10462. this.scaleV3One = new Laya.Vector3();
  10463. this.scaleV3Two = new Laya.Vector3();
  10464. this.posV4 = new Laya.Vector4();
  10465. this.showDebug = false;
  10466. this.openGuide = true;
  10467. this.rodOffest = new Laya.Vector2(0, 0);
  10468. this.rodAngle = 0;
  10469. this.gameMode = GameMode.classic;
  10470. this.bigMoveLevelIndex = 1;
  10471. this.bigMoveNeedCoin = 1000;
  10472. this.classicNiceNeddCoin = 1000;
  10473. this.passAwardCoin = 2000;
  10474. this.classicRoomType = 1;
  10475. this.maxPower = 20;
  10476. this.natureMaxPower = 5;
  10477. this.videoPower = 2;
  10478. this.powerRecoverNum = 900;
  10479. this.curPlayerSkillType = 0;
  10480. this.isNewDay = false;
  10481. this.clickedBall = false;
  10482. this.placeBallCurLevel = 0;
  10483. this.placeBallStarNum = 0;
  10484. this.longHelpLine = false;
  10485. this.maxShareDiamondTimes = 3;
  10486. this.guideStep = 0;
  10487. this.temSelfLevel = 0;
  10488. this.extraMoveNum = 0;
  10489. this.curRankID = 0;
  10490. this.rankID = {
  10491. normalStar: 12000,
  10492. wxStar: 12001
  10493. };
  10494. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10495. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10496. this.btnClickStr = "buttonclick";
  10497. this.maxSkillLevel = 10;
  10498. this.upSkillLevel = false;
  10499. this.gameStartTime = 0;
  10500. this._sysOffestNum = 0;
  10501. this.angleV2 = new Laya.Vector2();
  10502. this.rootV = new Laya.Vector2(0, 1);
  10503. this.tempDir1 = new Laya.Vector2();
  10504. this.tempDir2 = new Laya.Vector2();
  10505. this.ballSize = 33;
  10506. this.stPos = new Laya.Point();
  10507. this.edPos = new Laya.Point();
  10508. Common._instance = this;
  10509. window["common"] = this;
  10510. }
  10511. static getInstance() {
  10512. if (!this._instance) {
  10513. this._instance = new Common();
  10514. }
  10515. return this._instance;
  10516. }
  10517. get sysOffestNum() {
  10518. if (this._sysOffestNum == 0) {
  10519. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10520. }
  10521. return this._sysOffestNum;
  10522. }
  10523. testShader() {
  10524. let test = new LightShader();
  10525. test.texture = "res/d3Res/ballTexture/ball1.png";
  10526. Laya.stage.addChild(test);
  10527. }
  10528. playScale(node) {
  10529. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10530. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10531. }));
  10532. }));
  10533. }
  10534. setGroup(colli, ...group) {
  10535. let out = 0;
  10536. for (let index = 0; index < group.length; index++) {
  10537. if (index == 0) {
  10538. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10539. }
  10540. else {
  10541. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10542. }
  10543. }
  10544. colli.collisionGroup = out;
  10545. }
  10546. setCanGroupWith(colli, ...group) {
  10547. let out = 0;
  10548. for (let index = 0; index < group.length; index++) {
  10549. if (index == 0) {
  10550. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10551. }
  10552. else {
  10553. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10554. }
  10555. }
  10556. colli.canCollideWith = out;
  10557. }
  10558. loadPrefab(name, callback) {
  10559. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10560. let prefab = new Laya.Prefab();
  10561. prefab.json = obj;
  10562. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10563. callback && callback(img);
  10564. }));
  10565. }
  10566. pos2to3Convert(x, y, d3Pos) {
  10567. x = x + this.sysOffestNum;
  10568. d3Pos.setValue(x, y, 0);
  10569. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10570. if (success) {
  10571. }
  10572. else {
  10573. console.error("转换出错了。。。。。。。。");
  10574. }
  10575. }
  10576. scale2to3Convert(num) {
  10577. this.scaleV3One.setValue(0, 0, 0);
  10578. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10579. this.scaleV3Two.setValue(0, num, 0);
  10580. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10581. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10582. return outNum;
  10583. }
  10584. pos3to2Convert(d3Pos) {
  10585. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10586. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10587. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10588. d3Pos.x -= this.sysOffestNum;
  10589. }
  10590. scale3to2Convert(num) {
  10591. let scale = this.scale2to3Convert(1);
  10592. let d2Out = num / scale;
  10593. return d2Out;
  10594. }
  10595. getCollider(type, restitution = 0.9, density = 10) {
  10596. let colli;
  10597. if (type == "box")
  10598. colli = new Laya.BoxCollider();
  10599. else
  10600. colli = new Laya.CircleCollider();
  10601. colli.friction = 0;
  10602. colli.restitution = restitution;
  10603. colli.density = density;
  10604. return colli;
  10605. }
  10606. getRigbody() {
  10607. let rigy = new Laya.RigidBody();
  10608. rigy.bullet = true;
  10609. rigy.allowRotation = false;
  10610. rigy.allowSleep = false;
  10611. rigy.gravityScale = 0;
  10612. return rigy;
  10613. }
  10614. getfguiRotation(x, y) {
  10615. this.angleV2.setValue(x, y);
  10616. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10617. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10618. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10619. angle = -angle;
  10620. }
  10621. return 180 + angle;
  10622. }
  10623. getAngle(x, y) {
  10624. this.angleV2.setValue(x, y);
  10625. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10626. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10627. return angle;
  10628. }
  10629. randomNum(a, b) {
  10630. return a + Math.floor((b - a + 1) * Math.random());
  10631. }
  10632. getRandArrEle(arr) {
  10633. return arr[Math.floor(arr.length * Math.random())];
  10634. }
  10635. getSign(val) {
  10636. return val >= 0 ? 1 : -1;
  10637. }
  10638. botherArr(arr) {
  10639. let times = arr.length + 2;
  10640. let length = arr.length;
  10641. let a;
  10642. let b;
  10643. let temp;
  10644. for (let index = 0; index < times; index++) {
  10645. a = Math.floor(Math.random() * length);
  10646. b = Math.floor(Math.random() * length);
  10647. temp = arr[a];
  10648. arr[a] = arr[b];
  10649. arr[b] = temp;
  10650. }
  10651. }
  10652. getGameIconUrl(id) {
  10653. return "ui://game/" + id;
  10654. }
  10655. getComponentUrl(id) {
  10656. return "ui://game/" + id;
  10657. }
  10658. getAnimation() {
  10659. }
  10660. judgeSkillType(type = SkillType.highSpace) {
  10661. if (this.gameMode == GameMode.classic)
  10662. return;
  10663. let gameMgr = this.gameMgr;
  10664. if (gameMgr.selfTurn) {
  10665. if (gameMgr.selfCurSkill == type) {
  10666. return true;
  10667. }
  10668. }
  10669. else {
  10670. if (gameMgr.aiCurSkill == type) {
  10671. return true;
  10672. }
  10673. }
  10674. }
  10675. ballColliHole(collider) {
  10676. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10677. xGame.common.gameMgr.isFirstInGame = false;
  10678. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10679. }
  10680. collider.owner.mySrc.checkWrongBall();
  10681. }
  10682. getArrMaxEle(arr) {
  10683. let max = -Infinity;
  10684. for (let index = 0; index < arr.length; index++) {
  10685. max = Math.max(arr[index], max);
  10686. }
  10687. return max;
  10688. }
  10689. getArrMinEle(arr) {
  10690. let min = Infinity;
  10691. for (let index = 0; index < arr.length; index++) {
  10692. min = Math.min(arr[index], min);
  10693. }
  10694. return min;
  10695. }
  10696. playRandomMutiBallBigSkillSound() {
  10697. if (Math.random() <= 0.5)
  10698. return;
  10699. let rand = this.randomNum(1, 6);
  10700. let str = "ganfa0" + rand;
  10701. xGame.soundMgr.playSound(str);
  10702. }
  10703. showOneCamera(type) {
  10704. let object = xGame.common.d3World.cameraObj;
  10705. for (const key in object) {
  10706. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10707. object[key].init();
  10708. object[key].owner.active = key == type;
  10709. }
  10710. }
  10711. }
  10712. checkBallOverBorder(x, y) {
  10713. let radius = 17;
  10714. let condition = this._checkBorder(x + radius, y) ||
  10715. this._checkBorder(x - radius, y) ||
  10716. this._checkBorder(x, y + radius) ||
  10717. this._checkBorder(x, y - radius);
  10718. if (condition) {
  10719. return true;
  10720. }
  10721. }
  10722. _checkBorder(x, y) {
  10723. let borderRect = this.d2World.borderRect;
  10724. let xOffest = 20;
  10725. let yOffest = 20;
  10726. if (y <= borderRect.y - yOffest) {
  10727. return true;
  10728. }
  10729. if (y >= borderRect.y + borderRect.height + yOffest) {
  10730. return true;
  10731. }
  10732. if (x <= borderRect.x - xOffest) {
  10733. return true;
  10734. }
  10735. if (x >= borderRect.x + borderRect.width + xOffest) {
  10736. return true;
  10737. }
  10738. }
  10739. initWeight(cfg) {
  10740. let allCfgData = { data: {}, allWeightNum: 0 };
  10741. let weightCfg = allCfgData.data;
  10742. let weight = 0;
  10743. for (const key in cfg) {
  10744. weightCfg[key] = {};
  10745. weightCfg[key].id = cfg[key].id;
  10746. weightCfg[key].minWeight = weight;
  10747. weight += cfg[key].weight;
  10748. weightCfg[key].maxWeight = weight;
  10749. }
  10750. allCfgData.allWeightNum = weight;
  10751. return allCfgData;
  10752. }
  10753. getRandomWeightData(cfg) {
  10754. let weightCfg = cfg.data;
  10755. let allWeightNum = cfg.allWeightNum;
  10756. let rand = Math.floor(Math.random() * allWeightNum);
  10757. for (const key in weightCfg) {
  10758. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10759. return weightCfg[key];
  10760. }
  10761. }
  10762. return weightCfg[1];
  10763. }
  10764. showGirlTalkPop(wordsIndex, node, msgNode) {
  10765. node.visible = true;
  10766. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10767. node.t0.play(Laya.Handler.create(this, () => {
  10768. node.visible = false;
  10769. }));
  10770. }
  10771. stopGirlPop(node) {
  10772. node.t0.stop();
  10773. node.visible = false;
  10774. }
  10775. createHead(loader, url, size = 107) {
  10776. if (Laya.Browser.name == "Browser") {
  10777. loader.url = url;
  10778. return;
  10779. }
  10780. if (Moyu.isTT) {
  10781. let localImage = new Image();
  10782. localImage.src = url;
  10783. localImage.onload = () => {
  10784. let t2d = new Laya.Texture2D();
  10785. t2d.width = size;
  10786. t2d.height = size;
  10787. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10788. t2d.loadImageSource(localImage);
  10789. };
  10790. }
  10791. else {
  10792. console.log('zh:url=', url);
  10793. loader.url = url;
  10794. }
  10795. }
  10796. addTestCoin(num) {
  10797. DataMgr.setCoin(num);
  10798. }
  10799. addTestDiamond(num) {
  10800. DataMgr.setDiamond(num);
  10801. }
  10802. addTestSkill() {
  10803. DataMgr.setBigSkill(0, 99);
  10804. DataMgr.setBigSkill(1, 99);
  10805. DataMgr.setBigSkill(2, 99);
  10806. }
  10807. playClassicEmotion(number, x, y) {
  10808. if (this.gameMode == GameMode.bigMove)
  10809. return;
  10810. let randIndex = this.randomNum(0, 2);
  10811. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10812. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10813. if (this.gameMgr.selfTurn) {
  10814. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10815. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10816. }
  10817. else {
  10818. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10819. }
  10820. else {
  10821. if (number == this.gameMgr.blackNum) {
  10822. if (this.gameMgr.selfBallArr.length == 0) {
  10823. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10824. }
  10825. else {
  10826. }
  10827. }
  10828. else {
  10829. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10830. }
  10831. }
  10832. }
  10833. }
  10834. else {
  10835. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10836. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10837. }
  10838. else {
  10839. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10840. }
  10841. else {
  10842. if (number == this.gameMgr.blackNum) {
  10843. if (this.gameMgr.aiBallArr.length == 0) {
  10844. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10845. }
  10846. else {
  10847. }
  10848. }
  10849. else {
  10850. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10851. }
  10852. }
  10853. }
  10854. }
  10855. }
  10856. playHappySound(number) {
  10857. if (this.gameMode != GameMode.classic)
  10858. return;
  10859. if (number == 8)
  10860. return;
  10861. let play = false;
  10862. if (this.gameMgr.selfTurn) {
  10863. if (this.gameMgr.ensureBallType) {
  10864. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10865. play = true;
  10866. }
  10867. }
  10868. else {
  10869. play = true;
  10870. }
  10871. }
  10872. else {
  10873. if (this.gameMgr.ensureBallType) {
  10874. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10875. play = true;
  10876. }
  10877. }
  10878. else {
  10879. play = true;
  10880. }
  10881. }
  10882. if (play)
  10883. xGame.soundMgr.playSound("applause");
  10884. }
  10885. destroyClassicEmotion() {
  10886. if (this.gameMode == GameMode.bigMove)
  10887. return;
  10888. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10889. parent.destroyChildren();
  10890. }
  10891. playAwardSpine(x, y) {
  10892. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10893. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10894. this.awardSpine.play(data, 0, false, parent);
  10895. }
  10896. destroyAwardSpine() {
  10897. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10898. parent.destroyChildren();
  10899. }
  10900. isBlock(bx, by, hx, hy, except = null) {
  10901. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10902. let balls = xGame.common.d2World.ballArr;
  10903. let outArr = [];
  10904. for (let index = 0; index < balls.length; index++) {
  10905. let obj = balls[index];
  10906. if (obj.number == 0)
  10907. continue;
  10908. if (obj == except)
  10909. continue;
  10910. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10911. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10912. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10913. if (num >= 1)
  10914. num = 1;
  10915. if (num < 0)
  10916. continue;
  10917. let gap = Math.sin(Math.acos(num)) * dis;
  10918. if (gap < this.ballSize) {
  10919. outArr.push({
  10920. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10921. disHon: Math.cos(Math.acos(num)) * dis,
  10922. disVer: Math.sin(Math.acos(num)) * dis,
  10923. src: balls[index],
  10924. dir: this.tempDir1
  10925. });
  10926. }
  10927. }
  10928. if (outArr.length > 0) {
  10929. outArr.sort((a, b) => { return a.dis - b.dis; });
  10930. return outArr[0];
  10931. }
  10932. }
  10933. AngleBetween(vector1, vector2) {
  10934. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10935. return rad * (180 / Math.PI);
  10936. }
  10937. getSecretaryScale() {
  10938. if (this.secretary.spineName == "mishu") {
  10939. return 1.28;
  10940. }
  10941. else {
  10942. return 1.024;
  10943. }
  10944. }
  10945. signAwardContainsRod(arr) {
  10946. let temp;
  10947. for (let index = 0; index < arr.length; index++) {
  10948. temp = arr[index].split('-')[0];
  10949. if (parseInt(temp) > 2) {
  10950. return true;
  10951. }
  10952. }
  10953. }
  10954. judgeSameDay() {
  10955. let lastTime = DataMgr.getSignTime();
  10956. let curTime = new Date().getTime();
  10957. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10958. return true;
  10959. }
  10960. return false;
  10961. }
  10962. getAward(arr, callback) {
  10963. let showTriple = arr[0].type <= 2;
  10964. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10965. let temp;
  10966. for (let index = 0; index < arr.length; index++) {
  10967. temp = arr[index];
  10968. switch (temp.type) {
  10969. case 1:
  10970. this.playObjFlyAnim(temp.num, temp.type);
  10971. break;
  10972. case 2:
  10973. this.playObjFlyAnim(temp.num, temp.type);
  10974. break;
  10975. case 3:
  10976. case 4:
  10977. case 5:
  10978. case 6:
  10979. DataMgr.setBallRod(temp.type - 2, 1);
  10980. DataMgr.setCurBallRod(temp.type - 2);
  10981. break;
  10982. default:
  10983. break;
  10984. }
  10985. }
  10986. callback && callback(watchVideo);
  10987. });
  10988. }
  10989. getMoneyNode() {
  10990. let moneyNode;
  10991. let sign = xGame.uiMgr.getUI(UISign);
  10992. let draw = xGame.uiMgr.getUI(UIDraw);
  10993. let end = xGame.uiMgr.getUI(UIGameEnd);
  10994. let skill = xGame.uiMgr.getUI(UISkill);
  10995. if (sign && !sign.isHide)
  10996. moneyNode = sign.ui.moneyNode;
  10997. if (draw && !draw.isHide)
  10998. moneyNode = draw.ui.moneyNode;
  10999. if (end && !end.isHide)
  11000. moneyNode = end.ui.moneyNode;
  11001. if (skill && !skill.isHide)
  11002. moneyNode = skill.ui.moneyNode;
  11003. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11004. let main = xGame.uiMgr.getUI(UIMain);
  11005. if (condition1 && main && !main.isHide) {
  11006. moneyNode = main.ui.moneyNode;
  11007. }
  11008. return moneyNode;
  11009. }
  11010. playObjFlyAnim(num, type, callback = null) {
  11011. this.stPos.x = Laya.stage.width / 2;
  11012. this.stPos.y = Laya.stage.height / 2;
  11013. let moneyNode = this.getMoneyNode();
  11014. switch (type) {
  11015. case Prop.diamond:
  11016. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11017. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11018. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11019. this.edPos.x /= 2;
  11020. this.edPos.y /= 2;
  11021. break;
  11022. case Prop.coin:
  11023. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11024. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11025. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11026. this.edPos.x /= 2;
  11027. this.edPos.y /= 2;
  11028. break;
  11029. default:
  11030. break;
  11031. }
  11032. xGame.soundMgr.playSound("coinbag");
  11033. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11034. switch (type) {
  11035. case Prop.diamond:
  11036. DataMgr.setDiamond(num);
  11037. break;
  11038. case Prop.coin:
  11039. DataMgr.setCoin(num);
  11040. break;
  11041. default:
  11042. break;
  11043. }
  11044. callback && callback();
  11045. });
  11046. }
  11047. autoPopUIView() {
  11048. let arr = [];
  11049. let sign = this.judgeSameDay() ? false : true;
  11050. if (sign)
  11051. arr.push("sign");
  11052. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11053. if (draw)
  11054. arr.push("draw");
  11055. if (arr.length <= 0)
  11056. return;
  11057. let str = this.getRandArrEle(arr);
  11058. switch (str) {
  11059. case "sign":
  11060. xGame.uiMgr.Show(UISign);
  11061. break;
  11062. case "draw":
  11063. xGame.uiMgr.Show(UIDraw);
  11064. break;
  11065. default:
  11066. break;
  11067. }
  11068. }
  11069. getMSTime(time) {
  11070. let min = Math.floor(time / 60);
  11071. let sec = Math.floor((time - min * 60));
  11072. if (sec < 10)
  11073. sec = "0" + sec;
  11074. if (min < 10)
  11075. min = "0" + min;
  11076. return `${min}:${sec}`;
  11077. }
  11078. testPower() {
  11079. DataMgr.setPower(0, false);
  11080. }
  11081. getAllStarNum() {
  11082. let data = DataMgr.getPlaceBallLevelList();
  11083. let out = 0;
  11084. for (let index = 0; index < data.length; index++) {
  11085. out += data[index].star;
  11086. }
  11087. return out;
  11088. }
  11089. recoverCameraView() {
  11090. Laya.timer.once(900, this, () => {
  11091. xGame.common.showOneCamera("mainCamera");
  11092. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11093. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11094. xGame.common.gameUI.ui.border.alpha = 0;
  11095. if (Laya.physicsTimer.scale < 1) {
  11096. Laya.physicsTimer.scale = 1;
  11097. }
  11098. }
  11099. });
  11100. }
  11101. getClassicLevel() {
  11102. let successTimes = DataMgr.getClassicTimes();
  11103. let needKey = "";
  11104. let lastKey = "";
  11105. let cfg = cfgTable.classictimesData;
  11106. let data;
  11107. for (const key in cfg) {
  11108. data = cfg[key];
  11109. if (successTimes <= data.times) {
  11110. needKey = key;
  11111. }
  11112. lastKey = key;
  11113. }
  11114. if (needKey == "")
  11115. needKey = lastKey;
  11116. return cfg[needKey];
  11117. }
  11118. }
  11119. Common._instance = null;
  11120. class ui_Component92 extends fgui.GComponent {
  11121. static createInstance() {
  11122. return (fgui.UIPackage.createObject("game", "Component92"));
  11123. }
  11124. onConstruct() {
  11125. this.n0 = (this.getChild("n0"));
  11126. }
  11127. }
  11128. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11129. class ui_Component129 extends fgui.GProgressBar {
  11130. static createInstance() {
  11131. return (fgui.UIPackage.createObject("game", "Component129"));
  11132. }
  11133. onConstruct() {
  11134. this.bar_v = (this.getChild("bar_v"));
  11135. this.n84 = (this.getChild("n84"));
  11136. }
  11137. }
  11138. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11139. class ui_Component130 extends fgui.GComponent {
  11140. static createInstance() {
  11141. return (fgui.UIPackage.createObject("game", "Component130"));
  11142. }
  11143. onConstruct() {
  11144. this.ani = (this.getChild("ani"));
  11145. this.t0 = this.getTransition("t0");
  11146. }
  11147. }
  11148. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11149. class ui_powerEft extends fgui.GComponent {
  11150. static createInstance() {
  11151. return (fgui.UIPackage.createObject("game", "powerEft"));
  11152. }
  11153. onConstruct() {
  11154. this.ani = (this.getChild("ani"));
  11155. this.n88 = (this.getChild("n88"));
  11156. this.n89 = (this.getChild("n89"));
  11157. }
  11158. }
  11159. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11160. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11161. static createInstance() {
  11162. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11163. }
  11164. onConstruct() {
  11165. this.c1 = this.getController("c1");
  11166. this.n2 = (this.getChild("n2"));
  11167. this.n22 = (this.getChild("n22"));
  11168. this.n23 = (this.getChild("n23"));
  11169. this.n15 = (this.getChild("n15"));
  11170. this.challenge = (this.getChild("challenge"));
  11171. this.n17 = (this.getChild("n17"));
  11172. this.n3 = (this.getChild("n3"));
  11173. this.starNode = (this.getChild("starNode"));
  11174. this.levelTxt = (this.getChild("levelTxt"));
  11175. this.n14 = (this.getChild("n14"));
  11176. this.n19 = (this.getChild("n19"));
  11177. this.n20 = (this.getChild("n20"));
  11178. this.n21 = (this.getChild("n21"));
  11179. this.special = (this.getChild("special"));
  11180. }
  11181. }
  11182. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11183. class ui_Component79 extends fgui.GComponent {
  11184. static createInstance() {
  11185. return (fgui.UIPackage.createObject("game", "Component79"));
  11186. }
  11187. onConstruct() {
  11188. this.c1 = this.getController("c1");
  11189. this.n7 = (this.getChild("n7"));
  11190. this.n8 = (this.getChild("n8"));
  11191. this.n9 = (this.getChild("n9"));
  11192. this.n10 = (this.getChild("n10"));
  11193. this.n11 = (this.getChild("n11"));
  11194. this.n12 = (this.getChild("n12"));
  11195. }
  11196. }
  11197. ui_Component79.URL = "ui://isxx5ak7avag477";
  11198. class ui_Component80 extends fgui.GComponent {
  11199. static createInstance() {
  11200. return (fgui.UIPackage.createObject("game", "Component80"));
  11201. }
  11202. onConstruct() {
  11203. this.n0 = (this.getChild("n0"));
  11204. this.n1 = (this.getChild("n1"));
  11205. this.myList = (this.getChild("myList"));
  11206. this.t0 = this.getTransition("t0");
  11207. }
  11208. }
  11209. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11210. class ui_SignNormal extends fgui.GComponent {
  11211. static createInstance() {
  11212. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11213. }
  11214. onConstruct() {
  11215. this.c1 = this.getController("c1");
  11216. this.n7 = (this.getChild("n7"));
  11217. this.n15 = (this.getChild("n15"));
  11218. this.titleTxt = (this.getChild("titleTxt"));
  11219. this.n8 = (this.getChild("n8"));
  11220. this.myIcon = (this.getChild("myIcon"));
  11221. this.numTxt = (this.getChild("numTxt"));
  11222. this.n12 = (this.getChild("n12"));
  11223. this.n13 = (this.getChild("n13"));
  11224. this.n17 = (this.getChild("n17"));
  11225. this.n14 = (this.getChild("n14"));
  11226. }
  11227. }
  11228. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11229. class ui_screenNode extends fgui.GComponent {
  11230. static createInstance() {
  11231. return (fgui.UIPackage.createObject("game", "screenNode"));
  11232. }
  11233. onConstruct() {
  11234. this.n9 = (this.getChild("n9"));
  11235. this.screenImg = (this.getChild("screenImg"));
  11236. }
  11237. }
  11238. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11239. class ui_GetAwrad_com1 extends fgui.GComponent {
  11240. static createInstance() {
  11241. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11242. }
  11243. onConstruct() {
  11244. this.n38 = (this.getChild("n38"));
  11245. this.n39 = (this.getChild("n39"));
  11246. this.n40 = (this.getChild("n40"));
  11247. this.t0 = this.getTransition("t0");
  11248. this.t1 = this.getTransition("t1");
  11249. }
  11250. }
  11251. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11252. class ui_GetAwrad_com2 extends fgui.GComponent {
  11253. static createInstance() {
  11254. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11255. }
  11256. onConstruct() {
  11257. this.n39 = (this.getChild("n39"));
  11258. this.n40 = (this.getChild("n40"));
  11259. this.t0 = this.getTransition("t0");
  11260. }
  11261. }
  11262. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11263. class ui_Component128 extends fgui.GComponent {
  11264. static createInstance() {
  11265. return (fgui.UIPackage.createObject("game", "Component128"));
  11266. }
  11267. onConstruct() {
  11268. this.n38 = (this.getChild("n38"));
  11269. this.n40 = (this.getChild("n40"));
  11270. }
  11271. }
  11272. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11273. class ui_Component100_1 extends fgui.GComponent {
  11274. static createInstance() {
  11275. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11276. }
  11277. onConstruct() {
  11278. this.myNode = (this.getChild("myNode"));
  11279. this.t0 = this.getTransition("t0");
  11280. }
  11281. }
  11282. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11283. class ui_Component142 extends fgui.GComponent {
  11284. static createInstance() {
  11285. return (fgui.UIPackage.createObject("game", "Component142"));
  11286. }
  11287. onConstruct() {
  11288. this.n41 = (this.getChild("n41"));
  11289. this.n42 = (this.getChild("n42"));
  11290. }
  11291. }
  11292. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11293. class ui_main_guang extends fgui.GComponent {
  11294. static createInstance() {
  11295. return (fgui.UIPackage.createObject("game", "main_guang"));
  11296. }
  11297. onConstruct() {
  11298. this.n1 = (this.getChild("n1"));
  11299. this.n2 = (this.getChild("n2"));
  11300. this.n3 = (this.getChild("n3"));
  11301. this.n4 = (this.getChild("n4"));
  11302. this.n5 = (this.getChild("n5"));
  11303. this.n6 = (this.getChild("n6"));
  11304. this.n8 = (this.getChild("n8"));
  11305. this.t0 = this.getTransition("t0");
  11306. }
  11307. }
  11308. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11309. class ui_try_com1 extends fgui.GComponent {
  11310. static createInstance() {
  11311. return (fgui.UIPackage.createObject("game", "try_com1"));
  11312. }
  11313. onConstruct() {
  11314. this.c1 = this.getController("c1");
  11315. this.n0 = (this.getChild("n0"));
  11316. this.n2 = (this.getChild("n2"));
  11317. this.cancelBtn = (this.getChild("cancelBtn"));
  11318. this.videoBtn = (this.getChild("videoBtn"));
  11319. this.n9 = (this.getChild("n9"));
  11320. this.n24 = (this.getChild("n24"));
  11321. this.titleTxt = (this.getChild("titleTxt"));
  11322. this.n32 = (this.getChild("n32"));
  11323. this.n29 = (this.getChild("n29"));
  11324. this.n36 = (this.getChild("n36"));
  11325. this.txtTime = (this.getChild("txtTime"));
  11326. this.t0 = this.getTransition("t0");
  11327. }
  11328. }
  11329. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11330. class ui_try_com2 extends fgui.GComponent {
  11331. static createInstance() {
  11332. return (fgui.UIPackage.createObject("game", "try_com2"));
  11333. }
  11334. onConstruct() {
  11335. this.skillicon = (this.getChild("skillicon"));
  11336. this.n35 = (this.getChild("n35"));
  11337. this.n31 = (this.getChild("n31"));
  11338. this.n32 = (this.getChild("n32"));
  11339. this.n33 = (this.getChild("n33"));
  11340. this.n34 = (this.getChild("n34"));
  11341. }
  11342. }
  11343. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11344. class ui_try_com3 extends fgui.GComponent {
  11345. static createInstance() {
  11346. return (fgui.UIPackage.createObject("game", "try_com3"));
  11347. }
  11348. onConstruct() {
  11349. this.n33 = (this.getChild("n33"));
  11350. this.n34 = (this.getChild("n34"));
  11351. this.n35 = (this.getChild("n35"));
  11352. this.t0 = this.getTransition("t0");
  11353. }
  11354. }
  11355. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11356. class ui_Component121 extends fgui.GButton {
  11357. static createInstance() {
  11358. return (fgui.UIPackage.createObject("game", "Component121"));
  11359. }
  11360. onConstruct() {
  11361. this.n3 = (this.getChild("n3"));
  11362. this.t0 = this.getTransition("t0");
  11363. }
  11364. }
  11365. ui_Component121.URL = "ui://isxx5ak7cy72v4ib";
  11366. class ui_huihe1 extends fgui.GComponent {
  11367. static createInstance() {
  11368. return (fgui.UIPackage.createObject("game", "huihe1"));
  11369. }
  11370. onConstruct() {
  11371. this.n0 = (this.getChild("n0"));
  11372. this.n1 = (this.getChild("n1"));
  11373. this.t0 = this.getTransition("t0");
  11374. }
  11375. }
  11376. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11377. class ui_huihe2 extends fgui.GComponent {
  11378. static createInstance() {
  11379. return (fgui.UIPackage.createObject("game", "huihe2"));
  11380. }
  11381. onConstruct() {
  11382. this.n0 = (this.getChild("n0"));
  11383. this.n1 = (this.getChild("n1"));
  11384. this.t0 = this.getTransition("t0");
  11385. }
  11386. }
  11387. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11388. class ui_Component143 extends fgui.GComponent {
  11389. static createInstance() {
  11390. return (fgui.UIPackage.createObject("game", "Component143"));
  11391. }
  11392. onConstruct() {
  11393. this.n3 = (this.getChild("n3"));
  11394. this.n4 = (this.getChild("n4"));
  11395. this.n5 = (this.getChild("n5"));
  11396. this.n6 = (this.getChild("n6"));
  11397. this.n7 = (this.getChild("n7"));
  11398. this.n8 = (this.getChild("n8"));
  11399. this.n9 = (this.getChild("n9"));
  11400. this.n10 = (this.getChild("n10"));
  11401. this.t0 = this.getTransition("t0");
  11402. }
  11403. }
  11404. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11405. class ui_dh_jingbi2 extends fgui.GComponent {
  11406. static createInstance() {
  11407. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11408. }
  11409. onConstruct() {
  11410. this.n0 = (this.getChild("n0"));
  11411. this.n1 = (this.getChild("n1"));
  11412. this.n2 = (this.getChild("n2"));
  11413. this.n3 = (this.getChild("n3"));
  11414. this.n4 = (this.getChild("n4"));
  11415. this.n5 = (this.getChild("n5"));
  11416. this.n6 = (this.getChild("n6"));
  11417. this.n8 = (this.getChild("n8"));
  11418. this.n10 = (this.getChild("n10"));
  11419. this.t0 = this.getTransition("t0");
  11420. }
  11421. }
  11422. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11423. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11424. static createInstance() {
  11425. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11426. }
  11427. onConstruct() {
  11428. this.n1 = (this.getChild("n1"));
  11429. this.n4 = (this.getChild("n4"));
  11430. this.t0 = this.getTransition("t0");
  11431. }
  11432. }
  11433. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11434. class ui_dh_jingbi3 extends fgui.GComponent {
  11435. static createInstance() {
  11436. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11437. }
  11438. onConstruct() {
  11439. this.n0 = (this.getChild("n0"));
  11440. this.n1 = (this.getChild("n1"));
  11441. this.n2 = (this.getChild("n2"));
  11442. this.n3 = (this.getChild("n3"));
  11443. this.n4 = (this.getChild("n4"));
  11444. this.n5 = (this.getChild("n5"));
  11445. this.n6 = (this.getChild("n6"));
  11446. this.n8 = (this.getChild("n8"));
  11447. this.n10 = (this.getChild("n10"));
  11448. this.t0 = this.getTransition("t0");
  11449. }
  11450. }
  11451. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11452. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11453. static createInstance() {
  11454. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11455. }
  11456. onConstruct() {
  11457. this.n3 = (this.getChild("n3"));
  11458. this.n1 = (this.getChild("n1"));
  11459. this.t0 = this.getTransition("t0");
  11460. }
  11461. }
  11462. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11463. class ui_hb_jinbi1 extends fgui.GButton {
  11464. static createInstance() {
  11465. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11466. }
  11467. onConstruct() {
  11468. this.n20 = (this.getChild("n20"));
  11469. this.n25 = (this.getChild("n25"));
  11470. this.coinTxt = (this.getChild("coinTxt"));
  11471. this.n28 = (this.getChild("n28"));
  11472. this.n32 = (this.getChild("n32"));
  11473. this.n38 = (this.getChild("n38"));
  11474. this.n45 = (this.getChild("n45"));
  11475. this.getTips = (this.getChild("getTips"));
  11476. this.n39 = (this.getChild("n39"));
  11477. this.diamondTxt = (this.getChild("diamondTxt"));
  11478. this.n41 = (this.getChild("n41"));
  11479. this.n42 = (this.getChild("n42"));
  11480. this.n46 = (this.getChild("n46"));
  11481. this.n47 = (this.getChild("n47"));
  11482. this.n48 = (this.getChild("n48"));
  11483. this.t0 = this.getTransition("t0");
  11484. }
  11485. }
  11486. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11487. class ui_hb_jinbi2 extends fgui.GButton {
  11488. static createInstance() {
  11489. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11490. }
  11491. onConstruct() {
  11492. this.n20 = (this.getChild("n20"));
  11493. this.n25 = (this.getChild("n25"));
  11494. this.coinTxt = (this.getChild("coinTxt"));
  11495. this.n28 = (this.getChild("n28"));
  11496. this.n32 = (this.getChild("n32"));
  11497. this.n38 = (this.getChild("n38"));
  11498. this.n39 = (this.getChild("n39"));
  11499. this.diamondTxt = (this.getChild("diamondTxt"));
  11500. this.n41 = (this.getChild("n41"));
  11501. this.n42 = (this.getChild("n42"));
  11502. this.n43 = (this.getChild("n43"));
  11503. this.n44 = (this.getChild("n44"));
  11504. this.n45 = (this.getChild("n45"));
  11505. this.t0 = this.getTransition("t0");
  11506. }
  11507. }
  11508. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11509. class ui_hb_jinbi3 extends fgui.GButton {
  11510. static createInstance() {
  11511. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11512. }
  11513. onConstruct() {
  11514. this.n20 = (this.getChild("n20"));
  11515. this.n25 = (this.getChild("n25"));
  11516. this.coinTxt = (this.getChild("coinTxt"));
  11517. this.n28 = (this.getChild("n28"));
  11518. this.n32 = (this.getChild("n32"));
  11519. this.n38 = (this.getChild("n38"));
  11520. this.n39 = (this.getChild("n39"));
  11521. this.diamondTxt = (this.getChild("diamondTxt"));
  11522. this.n41 = (this.getChild("n41"));
  11523. this.n42 = (this.getChild("n42"));
  11524. this.n43 = (this.getChild("n43"));
  11525. this.n44 = (this.getChild("n44"));
  11526. this.n45 = (this.getChild("n45"));
  11527. this.t0 = this.getTransition("t0");
  11528. }
  11529. }
  11530. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11531. class ui_Component104 extends fgui.GComponent {
  11532. static createInstance() {
  11533. return (fgui.UIPackage.createObject("game", "Component104"));
  11534. }
  11535. onConstruct() {
  11536. this.c1 = this.getController("c1");
  11537. this.n12 = (this.getChild("n12"));
  11538. this.coinBtn = (this.getChild("coinBtn"));
  11539. this.diamondBtn = (this.getChild("diamondBtn"));
  11540. this.node3 = (this.getChild("node3"));
  11541. this.node4 = (this.getChild("node4"));
  11542. this.node5 = (this.getChild("node5"));
  11543. this.node1 = (this.getChild("node1"));
  11544. this.node2 = (this.getChild("node2"));
  11545. this.node6 = (this.getChild("node6"));
  11546. this.t0 = this.getTransition("t0");
  11547. }
  11548. }
  11549. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11550. class ui_Component105 extends fgui.GButton {
  11551. static createInstance() {
  11552. return (fgui.UIPackage.createObject("game", "Component105"));
  11553. }
  11554. onConstruct() {
  11555. this.c1 = this.getController("c1");
  11556. this.n49 = (this.getChild("n49"));
  11557. this.n18 = (this.getChild("n18"));
  11558. this.n46 = (this.getChild("n46"));
  11559. this.n48 = (this.getChild("n48"));
  11560. }
  11561. }
  11562. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11563. class ui_Component106 extends fgui.GButton {
  11564. static createInstance() {
  11565. return (fgui.UIPackage.createObject("game", "Component106"));
  11566. }
  11567. onConstruct() {
  11568. this.c1 = this.getController("c1");
  11569. this.n49 = (this.getChild("n49"));
  11570. this.n18 = (this.getChild("n18"));
  11571. this.n46 = (this.getChild("n46"));
  11572. this.n48 = (this.getChild("n48"));
  11573. }
  11574. }
  11575. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11576. class ui_hb_zs1 extends fgui.GButton {
  11577. static createInstance() {
  11578. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11579. }
  11580. onConstruct() {
  11581. this.c1 = this.getController("c1");
  11582. this.n20 = (this.getChild("n20"));
  11583. this.n21 = (this.getChild("n21"));
  11584. this.n26 = (this.getChild("n26"));
  11585. this.n27 = (this.getChild("n27"));
  11586. this.shareTxt = (this.getChild("shareTxt"));
  11587. this.n32 = (this.getChild("n32"));
  11588. this.n38 = (this.getChild("n38"));
  11589. this.n39 = (this.getChild("n39"));
  11590. this.n44 = (this.getChild("n44"));
  11591. this.diamondTxt = (this.getChild("diamondTxt"));
  11592. this.n41 = (this.getChild("n41"));
  11593. this.n45 = (this.getChild("n45"));
  11594. this.n47 = (this.getChild("n47"));
  11595. this.n48 = (this.getChild("n48"));
  11596. this.randTxt = (this.getChild("randTxt"));
  11597. this.n50 = (this.getChild("n50"));
  11598. this.t0 = this.getTransition("t0");
  11599. }
  11600. }
  11601. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11602. class ui_dh_zs1 extends fgui.GComponent {
  11603. static createInstance() {
  11604. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11605. }
  11606. onConstruct() {
  11607. this.n10 = (this.getChild("n10"));
  11608. this.n9 = (this.getChild("n9"));
  11609. this.n1 = (this.getChild("n1"));
  11610. this.n2 = (this.getChild("n2"));
  11611. this.n3 = (this.getChild("n3"));
  11612. this.n4 = (this.getChild("n4"));
  11613. this.n5 = (this.getChild("n5"));
  11614. this.n6 = (this.getChild("n6"));
  11615. this.n8 = (this.getChild("n8"));
  11616. this.n11 = (this.getChild("n11"));
  11617. this.t0 = this.getTransition("t0");
  11618. }
  11619. }
  11620. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11621. class ui_dh_zs1_1 extends fgui.GComponent {
  11622. static createInstance() {
  11623. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11624. }
  11625. onConstruct() {
  11626. this.n3 = (this.getChild("n3"));
  11627. this.n1 = (this.getChild("n1"));
  11628. this.t0 = this.getTransition("t0");
  11629. }
  11630. }
  11631. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11632. class ui_hb_zs2 extends fgui.GButton {
  11633. static createInstance() {
  11634. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11635. }
  11636. onConstruct() {
  11637. this.n20 = (this.getChild("n20"));
  11638. this.n21 = (this.getChild("n21"));
  11639. this.n26 = (this.getChild("n26"));
  11640. this.n27 = (this.getChild("n27"));
  11641. this.n32 = (this.getChild("n32"));
  11642. this.n38 = (this.getChild("n38"));
  11643. this.n39 = (this.getChild("n39"));
  11644. this.n44 = (this.getChild("n44"));
  11645. this.diamondTxt = (this.getChild("diamondTxt"));
  11646. this.n41 = (this.getChild("n41"));
  11647. this.n45 = (this.getChild("n45"));
  11648. this.t0 = this.getTransition("t0");
  11649. }
  11650. }
  11651. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11652. class ui_hb_zs3 extends fgui.GButton {
  11653. static createInstance() {
  11654. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11655. }
  11656. onConstruct() {
  11657. this.n20 = (this.getChild("n20"));
  11658. this.n21 = (this.getChild("n21"));
  11659. this.n26 = (this.getChild("n26"));
  11660. this.n27 = (this.getChild("n27"));
  11661. this.n32 = (this.getChild("n32"));
  11662. this.n38 = (this.getChild("n38"));
  11663. this.n47 = (this.getChild("n47"));
  11664. this.t0 = this.getTransition("t0");
  11665. }
  11666. }
  11667. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11668. class ui_dh_zs2 extends fgui.GComponent {
  11669. static createInstance() {
  11670. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11671. }
  11672. onConstruct() {
  11673. this.n10 = (this.getChild("n10"));
  11674. this.n9 = (this.getChild("n9"));
  11675. this.n1 = (this.getChild("n1"));
  11676. this.n2 = (this.getChild("n2"));
  11677. this.n3 = (this.getChild("n3"));
  11678. this.n4 = (this.getChild("n4"));
  11679. this.n5 = (this.getChild("n5"));
  11680. this.n6 = (this.getChild("n6"));
  11681. this.n8 = (this.getChild("n8"));
  11682. this.n11 = (this.getChild("n11"));
  11683. this.t0 = this.getTransition("t0");
  11684. }
  11685. }
  11686. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11687. class ui_dh_zs2_1 extends fgui.GComponent {
  11688. static createInstance() {
  11689. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11690. }
  11691. onConstruct() {
  11692. this.n3 = (this.getChild("n3"));
  11693. this.n1 = (this.getChild("n1"));
  11694. this.t0 = this.getTransition("t0");
  11695. }
  11696. }
  11697. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11698. class ui_dh_zs3 extends fgui.GComponent {
  11699. static createInstance() {
  11700. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11701. }
  11702. onConstruct() {
  11703. this.n10 = (this.getChild("n10"));
  11704. this.n9 = (this.getChild("n9"));
  11705. this.n1 = (this.getChild("n1"));
  11706. this.n2 = (this.getChild("n2"));
  11707. this.n3 = (this.getChild("n3"));
  11708. this.n4 = (this.getChild("n4"));
  11709. this.n5 = (this.getChild("n5"));
  11710. this.n6 = (this.getChild("n6"));
  11711. this.n8 = (this.getChild("n8"));
  11712. this.n11 = (this.getChild("n11"));
  11713. this.t0 = this.getTransition("t0");
  11714. }
  11715. }
  11716. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11717. class ui_dh_zs3_1 extends fgui.GComponent {
  11718. static createInstance() {
  11719. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11720. }
  11721. onConstruct() {
  11722. this.n3 = (this.getChild("n3"));
  11723. this.n1 = (this.getChild("n1"));
  11724. this.t0 = this.getTransition("t0");
  11725. }
  11726. }
  11727. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11728. class ui_Component107 extends fgui.GComponent {
  11729. static createInstance() {
  11730. return (fgui.UIPackage.createObject("game", "Component107"));
  11731. }
  11732. onConstruct() {
  11733. this.n18 = (this.getChild("n18"));
  11734. this.n19 = (this.getChild("n19"));
  11735. this.n20 = (this.getChild("n20"));
  11736. this.n21 = (this.getChild("n21"));
  11737. this.n22 = (this.getChild("n22"));
  11738. this.levelTxt = (this.getChild("levelTxt"));
  11739. this.t0 = this.getTransition("t0");
  11740. }
  11741. }
  11742. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11743. class ui_box_com1 extends fgui.GComponent {
  11744. static createInstance() {
  11745. return (fgui.UIPackage.createObject("game", "box_com1"));
  11746. }
  11747. onConstruct() {
  11748. this.n14 = (this.getChild("n14"));
  11749. this.n6 = (this.getChild("n6"));
  11750. this.t0 = this.getTransition("t0");
  11751. }
  11752. }
  11753. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11754. class ui_box_com2 extends fgui.GProgressBar {
  11755. static createInstance() {
  11756. return (fgui.UIPackage.createObject("game", "box_com2"));
  11757. }
  11758. onConstruct() {
  11759. this.bg0 = (this.getChild("bg0"));
  11760. this.bg = (this.getChild("bg"));
  11761. this.bar = (this.getChild("bar"));
  11762. this.n7 = (this.getChild("n7"));
  11763. this.n8 = (this.getChild("n8"));
  11764. this.n10 = (this.getChild("n10"));
  11765. this.n11 = (this.getChild("n11"));
  11766. this.n12 = (this.getChild("n12"));
  11767. }
  11768. }
  11769. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11770. class ui_box_com4 extends fgui.GComponent {
  11771. static createInstance() {
  11772. return (fgui.UIPackage.createObject("game", "box_com4"));
  11773. }
  11774. onConstruct() {
  11775. this.n8 = (this.getChild("n8"));
  11776. this.t0 = this.getTransition("t0");
  11777. }
  11778. }
  11779. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11780. class ui_box_com3 extends fgui.GComponent {
  11781. static createInstance() {
  11782. return (fgui.UIPackage.createObject("game", "box_com3"));
  11783. }
  11784. onConstruct() {
  11785. this.n2 = (this.getChild("n2"));
  11786. this.n3 = (this.getChild("n3"));
  11787. this.n4 = (this.getChild("n4"));
  11788. this.n5 = (this.getChild("n5"));
  11789. this.t0 = this.getTransition("t0");
  11790. this.t1 = this.getTransition("t1");
  11791. }
  11792. }
  11793. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11794. class ui_Component97 extends fgui.GComponent {
  11795. static createInstance() {
  11796. return (fgui.UIPackage.createObject("game", "Component97"));
  11797. }
  11798. onConstruct() {
  11799. this.c1 = this.getController("c1");
  11800. this.n46 = (this.getChild("n46"));
  11801. this.diamondNode = (this.getChild("diamondNode"));
  11802. this.coinNode = (this.getChild("coinNode"));
  11803. this.t0 = this.getTransition("t0");
  11804. }
  11805. }
  11806. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11807. class ui_Component98 extends fgui.GButton {
  11808. static createInstance() {
  11809. return (fgui.UIPackage.createObject("game", "Component98"));
  11810. }
  11811. onConstruct() {
  11812. this.n8 = (this.getChild("n8"));
  11813. this.n40 = (this.getChild("n40"));
  11814. }
  11815. }
  11816. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11817. class ui_Component28_11 extends fgui.GButton {
  11818. static createInstance() {
  11819. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11820. }
  11821. onConstruct() {
  11822. this.c1 = this.getController("c1");
  11823. this.n12 = (this.getChild("n12"));
  11824. this.n17 = (this.getChild("n17"));
  11825. this.n13 = (this.getChild("n13"));
  11826. this.diamondTxt = (this.getChild("diamondTxt"));
  11827. this.n15 = (this.getChild("n15"));
  11828. this.n16 = (this.getChild("n16"));
  11829. }
  11830. }
  11831. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11832. class ui_Component58_11 extends fgui.GComponent {
  11833. static createInstance() {
  11834. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11835. }
  11836. onConstruct() {
  11837. this.n23 = (this.getChild("n23"));
  11838. this.n41 = (this.getChild("n41"));
  11839. this.myList = (this.getChild("myList"));
  11840. this.n45 = (this.getChild("n45"));
  11841. this.n44 = (this.getChild("n44"));
  11842. this.t0 = this.getTransition("t0");
  11843. }
  11844. }
  11845. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11846. class ui_Component100 extends fgui.GComponent {
  11847. static createInstance() {
  11848. return (fgui.UIPackage.createObject("game", "Component100"));
  11849. }
  11850. onConstruct() {
  11851. this.c1 = this.getController("c1");
  11852. this.n75 = (this.getChild("n75"));
  11853. this.n76 = (this.getChild("n76"));
  11854. this.n80 = (this.getChild("n80"));
  11855. this.txt = (this.getChild("txt"));
  11856. this.spineRoot = (this.getChild("spineRoot"));
  11857. }
  11858. }
  11859. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11860. class ui_Component101 extends fgui.GComponent {
  11861. static createInstance() {
  11862. return (fgui.UIPackage.createObject("game", "Component101"));
  11863. }
  11864. onConstruct() {
  11865. this.c1 = this.getController("c1");
  11866. this.n36 = (this.getChild("n36"));
  11867. this.n35 = (this.getChild("n35"));
  11868. this.n33 = (this.getChild("n33"));
  11869. this.n34 = (this.getChild("n34"));
  11870. }
  11871. }
  11872. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11873. class ui_Component53 extends fgui.GComponent {
  11874. static createInstance() {
  11875. return (fgui.UIPackage.createObject("game", "Component53"));
  11876. }
  11877. onConstruct() {
  11878. this.n0 = (this.getChild("n0"));
  11879. this.n1 = (this.getChild("n1"));
  11880. this.n2 = (this.getChild("n2"));
  11881. this.n3 = (this.getChild("n3"));
  11882. this.n4 = (this.getChild("n4"));
  11883. this.n5 = (this.getChild("n5"));
  11884. this.n6 = (this.getChild("n6"));
  11885. this.n7 = (this.getChild("n7"));
  11886. this.n8 = (this.getChild("n8"));
  11887. this.n9 = (this.getChild("n9"));
  11888. this.n10 = (this.getChild("n10"));
  11889. this.n11 = (this.getChild("n11"));
  11890. this.n12 = (this.getChild("n12"));
  11891. this.n13 = (this.getChild("n13"));
  11892. this.n14 = (this.getChild("n14"));
  11893. this.n15 = (this.getChild("n15"));
  11894. this.n16 = (this.getChild("n16"));
  11895. this.n19 = (this.getChild("n19"));
  11896. this.n20 = (this.getChild("n20"));
  11897. this.n21 = (this.getChild("n21"));
  11898. this.n22 = (this.getChild("n22"));
  11899. this.n23 = (this.getChild("n23"));
  11900. this.n24 = (this.getChild("n24"));
  11901. this.n25 = (this.getChild("n25"));
  11902. this.n26 = (this.getChild("n26"));
  11903. this.n27 = (this.getChild("n27"));
  11904. this.n28 = (this.getChild("n28"));
  11905. this.n29 = (this.getChild("n29"));
  11906. this.n30 = (this.getChild("n30"));
  11907. this.n31 = (this.getChild("n31"));
  11908. this.n32 = (this.getChild("n32"));
  11909. this.n33 = (this.getChild("n33"));
  11910. this.n34 = (this.getChild("n34"));
  11911. this.n35 = (this.getChild("n35"));
  11912. this.t0 = this.getTransition("t0");
  11913. }
  11914. }
  11915. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11916. class ui_Component58 extends fgui.GComponent {
  11917. static createInstance() {
  11918. return (fgui.UIPackage.createObject("game", "Component58"));
  11919. }
  11920. onConstruct() {
  11921. this.n23 = (this.getChild("n23"));
  11922. this.n41 = (this.getChild("n41"));
  11923. this.n8 = (this.getChild("n8"));
  11924. this.skillList = (this.getChild("skillList"));
  11925. this.t0 = this.getTransition("t0");
  11926. }
  11927. }
  11928. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11929. class ui_Component59 extends fgui.GComponent {
  11930. static createInstance() {
  11931. return (fgui.UIPackage.createObject("game", "Component59"));
  11932. }
  11933. onConstruct() {
  11934. this.n3 = (this.getChild("n3"));
  11935. this.msgTxt = (this.getChild("msgTxt"));
  11936. this.t0 = this.getTransition("t0");
  11937. }
  11938. }
  11939. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11940. class ui_RulerNode extends fgui.GComponent {
  11941. static createInstance() {
  11942. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11943. }
  11944. onConstruct() {
  11945. this.n6 = (this.getChild("n6"));
  11946. this.n4 = (this.getChild("n4"));
  11947. this.img1 = (this.getChild("img1"));
  11948. this.img2 = (this.getChild("img2"));
  11949. }
  11950. }
  11951. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11952. class ui_Component108 extends fgui.GComponent {
  11953. static createInstance() {
  11954. return (fgui.UIPackage.createObject("game", "Component108"));
  11955. }
  11956. onConstruct() {
  11957. this.n19 = (this.getChild("n19"));
  11958. this.t0 = this.getTransition("t0");
  11959. }
  11960. }
  11961. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11962. class ui_Component63 extends fgui.GComponent {
  11963. static createInstance() {
  11964. return (fgui.UIPackage.createObject("game", "Component63"));
  11965. }
  11966. onConstruct() {
  11967. this.n66 = (this.getChild("n66"));
  11968. this.n56 = (this.getChild("n56"));
  11969. this.n63 = (this.getChild("n63"));
  11970. this.n65 = (this.getChild("n65"));
  11971. this.t0 = this.getTransition("t0");
  11972. }
  11973. }
  11974. ui_Component63.URL = "ui://isxx5ak7h657452";
  11975. class ui_topNode extends fgui.GComponent {
  11976. static createInstance() {
  11977. return (fgui.UIPackage.createObject("game", "topNode"));
  11978. }
  11979. onConstruct() {
  11980. this.selfProgress = (this.getChild("selfProgress"));
  11981. this.aiProgress = (this.getChild("aiProgress"));
  11982. this.selfKuang = (this.getChild("selfKuang"));
  11983. this.aiKuang = (this.getChild("aiKuang"));
  11984. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  11985. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  11986. this.n33 = (this.getChild("n33"));
  11987. this.n34 = (this.getChild("n34"));
  11988. this.selfNameTxt = (this.getChild("selfNameTxt"));
  11989. this.aiNameTxt = (this.getChild("aiNameTxt"));
  11990. this.selfBallList = (this.getChild("selfBallList"));
  11991. this.aiBallList = (this.getChild("aiBallList"));
  11992. this.middleNode = (this.getChild("middleNode"));
  11993. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  11994. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  11995. this.scoreNode = (this.getChild("scoreNode"));
  11996. this.selfTips = (this.getChild("selfTips"));
  11997. this.aiTips = (this.getChild("aiTips"));
  11998. }
  11999. }
  12000. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12001. class ui_selfProgress extends fgui.GProgressBar {
  12002. static createInstance() {
  12003. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12004. }
  12005. onConstruct() {
  12006. this.n3 = (this.getChild("n3"));
  12007. this.bar = (this.getChild("bar"));
  12008. }
  12009. }
  12010. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12011. class ui_aiProgress extends fgui.GProgressBar {
  12012. static createInstance() {
  12013. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12014. }
  12015. onConstruct() {
  12016. this.n3 = (this.getChild("n3"));
  12017. this.bar = (this.getChild("bar"));
  12018. }
  12019. }
  12020. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12021. class ui_ballDisplay extends fgui.GComponent {
  12022. static createInstance() {
  12023. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12024. }
  12025. onConstruct() {
  12026. this.myImg = (this.getChild("myImg"));
  12027. }
  12028. }
  12029. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12030. class ui_moveNode extends fgui.GComponent {
  12031. static createInstance() {
  12032. return (fgui.UIPackage.createObject("game", "moveNode"));
  12033. }
  12034. onConstruct() {
  12035. this.n8 = (this.getChild("n8"));
  12036. this.finger = (this.getChild("finger"));
  12037. }
  12038. }
  12039. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12040. class ui_cancelBtn extends fgui.GButton {
  12041. static createInstance() {
  12042. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12043. }
  12044. onConstruct() {
  12045. this.c1 = this.getController("c1");
  12046. this.n0 = (this.getChild("n0"));
  12047. this.n1 = (this.getChild("n1"));
  12048. }
  12049. }
  12050. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12051. class ui_shareBtn extends fgui.GButton {
  12052. static createInstance() {
  12053. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12054. }
  12055. onConstruct() {
  12056. this.c1 = this.getController("c1");
  12057. this.n2 = (this.getChild("n2"));
  12058. this.n1 = (this.getChild("n1"));
  12059. this.n3 = (this.getChild("n3"));
  12060. this.n4 = (this.getChild("n4"));
  12061. this.n5 = (this.getChild("n5"));
  12062. this.n6 = (this.getChild("n6"));
  12063. }
  12064. }
  12065. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12066. class ui_share2Btn extends fgui.GButton {
  12067. static createInstance() {
  12068. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12069. }
  12070. onConstruct() {
  12071. this.n3 = (this.getChild("n3"));
  12072. }
  12073. }
  12074. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12075. class ui_rodMethodNode extends fgui.GComponent {
  12076. static createInstance() {
  12077. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12078. }
  12079. onConstruct() {
  12080. this.bg = (this.getChild("bg"));
  12081. this.dot = (this.getChild("dot"));
  12082. }
  12083. }
  12084. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12085. class ui_sureBtn extends fgui.GButton {
  12086. static createInstance() {
  12087. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12088. }
  12089. onConstruct() {
  12090. this.n2 = (this.getChild("n2"));
  12091. this.n1 = (this.getChild("n1"));
  12092. }
  12093. }
  12094. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12095. class ui_Component18 extends fgui.GComponent {
  12096. static createInstance() {
  12097. return (fgui.UIPackage.createObject("game", "Component18"));
  12098. }
  12099. onConstruct() {
  12100. this.c1 = this.getController("c1");
  12101. this.nameTxt = (this.getChild("nameTxt"));
  12102. this.headImg = (this.getChild("headImg"));
  12103. this.n24 = (this.getChild("n24"));
  12104. this.skillImg = (this.getChild("skillImg"));
  12105. this.skillTxt = (this.getChild("skillTxt"));
  12106. }
  12107. }
  12108. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12109. class ui_Component45 extends fgui.GComponent {
  12110. static createInstance() {
  12111. return (fgui.UIPackage.createObject("game", "Component45"));
  12112. }
  12113. onConstruct() {
  12114. this.c1 = this.getController("c1");
  12115. this.n40 = (this.getChild("n40"));
  12116. this.n41 = (this.getChild("n41"));
  12117. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12118. this.n42 = (this.getChild("n42"));
  12119. this.awardTxt = (this.getChild("awardTxt"));
  12120. this.n44 = (this.getChild("n44"));
  12121. this.t0 = this.getTransition("t0");
  12122. }
  12123. }
  12124. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12125. class ui_emotionDisplay extends fgui.GButton {
  12126. static createInstance() {
  12127. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12128. }
  12129. onConstruct() {
  12130. this.myIcon = (this.getChild("myIcon"));
  12131. }
  12132. }
  12133. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12134. class ui_Component49 extends fgui.GButton {
  12135. static createInstance() {
  12136. return (fgui.UIPackage.createObject("game", "Component49"));
  12137. }
  12138. onConstruct() {
  12139. this.n69 = (this.getChild("n69"));
  12140. this.n56 = (this.getChild("n56"));
  12141. }
  12142. }
  12143. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12144. class ui_Component50 extends fgui.GButton {
  12145. static createInstance() {
  12146. return (fgui.UIPackage.createObject("game", "Component50"));
  12147. }
  12148. onConstruct() {
  12149. this.n54 = (this.getChild("n54"));
  12150. this.n65 = (this.getChild("n65"));
  12151. }
  12152. }
  12153. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12154. class ui_Component51 extends fgui.GButton {
  12155. static createInstance() {
  12156. return (fgui.UIPackage.createObject("game", "Component51"));
  12157. }
  12158. onConstruct() {
  12159. this.c1 = this.getController("c1");
  12160. this.n51 = (this.getChild("n51"));
  12161. this.n54 = (this.getChild("n54"));
  12162. }
  12163. }
  12164. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12165. class ui_Button5 extends fgui.GButton {
  12166. static createInstance() {
  12167. return (fgui.UIPackage.createObject("game", "Button5"));
  12168. }
  12169. onConstruct() {
  12170. this.c1 = this.getController("c1");
  12171. this.n0 = (this.getChild("n0"));
  12172. this.n2 = (this.getChild("n2"));
  12173. }
  12174. }
  12175. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12176. class ui_Component124 extends fgui.GComponent {
  12177. static createInstance() {
  12178. return (fgui.UIPackage.createObject("game", "Component124"));
  12179. }
  12180. onConstruct() {
  12181. this.n22 = (this.getChild("n22"));
  12182. this.shareNode = (this.getChild("shareNode"));
  12183. }
  12184. }
  12185. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12186. class ui_Component125 extends fgui.GComponent {
  12187. static createInstance() {
  12188. return (fgui.UIPackage.createObject("game", "Component125"));
  12189. }
  12190. onConstruct() {
  12191. this.n29 = (this.getChild("n29"));
  12192. this.coinTxt = (this.getChild("coinTxt"));
  12193. }
  12194. }
  12195. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12196. class ui_Component52 extends fgui.GButton {
  12197. static createInstance() {
  12198. return (fgui.UIPackage.createObject("game", "Component52"));
  12199. }
  12200. onConstruct() {
  12201. this.n35 = (this.getChild("n35"));
  12202. this.n36 = (this.getChild("n36"));
  12203. }
  12204. }
  12205. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12206. class ui_drawBtn extends fgui.GButton {
  12207. static createInstance() {
  12208. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12209. }
  12210. onConstruct() {
  12211. this.c1 = this.getController("c1");
  12212. this.n2 = (this.getChild("n2"));
  12213. this.n1 = (this.getChild("n1"));
  12214. }
  12215. }
  12216. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12217. class ui_Component43 extends fgui.GButton {
  12218. static createInstance() {
  12219. return (fgui.UIPackage.createObject("game", "Component43"));
  12220. }
  12221. onConstruct() {
  12222. this.n49 = (this.getChild("n49"));
  12223. }
  12224. }
  12225. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12226. class ui_wordsDisplay extends fgui.GComponent {
  12227. static createInstance() {
  12228. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12229. }
  12230. onConstruct() {
  12231. this.txt = (this.getChild("txt"));
  12232. this.n63 = (this.getChild("n63"));
  12233. }
  12234. }
  12235. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12236. class ui_Component3 extends fgui.GComponent {
  12237. static createInstance() {
  12238. return (fgui.UIPackage.createObject("game", "Component3"));
  12239. }
  12240. onConstruct() {
  12241. this.n26 = (this.getChild("n26"));
  12242. this.n24 = (this.getChild("n24"));
  12243. this.nameTxt = (this.getChild("nameTxt"));
  12244. this.headRoot = (this.getChild("headRoot"));
  12245. }
  12246. }
  12247. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12248. class ui_Component4 extends fgui.GComponent {
  12249. static createInstance() {
  12250. return (fgui.UIPackage.createObject("game", "Component4"));
  12251. }
  12252. onConstruct() {
  12253. this.headImg = (this.getChild("headImg"));
  12254. }
  12255. }
  12256. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12257. class ui_Component7 extends fgui.GButton {
  12258. static createInstance() {
  12259. return (fgui.UIPackage.createObject("game", "Component7"));
  12260. }
  12261. onConstruct() {
  12262. this.n17 = (this.getChild("n17"));
  12263. }
  12264. }
  12265. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12266. class ui_Component8 extends fgui.GButton {
  12267. static createInstance() {
  12268. return (fgui.UIPackage.createObject("game", "Component8"));
  12269. }
  12270. onConstruct() {
  12271. this.n19 = (this.getChild("n19"));
  12272. }
  12273. }
  12274. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12275. class ui_Component9 extends fgui.GButton {
  12276. static createInstance() {
  12277. return (fgui.UIPackage.createObject("game", "Component9"));
  12278. }
  12279. onConstruct() {
  12280. this.n18 = (this.getChild("n18"));
  12281. }
  12282. }
  12283. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12284. class ui_Component10 extends fgui.GButton {
  12285. static createInstance() {
  12286. return (fgui.UIPackage.createObject("game", "Component10"));
  12287. }
  12288. onConstruct() {
  12289. this.c1 = this.getController("c1");
  12290. this.n40 = (this.getChild("n40"));
  12291. }
  12292. }
  12293. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12294. class ui_Component11 extends fgui.GButton {
  12295. static createInstance() {
  12296. return (fgui.UIPackage.createObject("game", "Component11"));
  12297. }
  12298. onConstruct() {
  12299. this.n34 = (this.getChild("n34"));
  12300. }
  12301. }
  12302. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12303. class ui_Component12 extends fgui.GButton {
  12304. static createInstance() {
  12305. return (fgui.UIPackage.createObject("game", "Component12"));
  12306. }
  12307. onConstruct() {
  12308. this.n35 = (this.getChild("n35"));
  12309. }
  12310. }
  12311. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12312. class ui_Component13 extends fgui.GButton {
  12313. static createInstance() {
  12314. return (fgui.UIPackage.createObject("game", "Component13"));
  12315. }
  12316. onConstruct() {
  12317. this.n27 = (this.getChild("n27"));
  12318. this.n36 = (this.getChild("n36"));
  12319. }
  12320. }
  12321. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12322. class ui_Component16 extends fgui.GButton {
  12323. static createInstance() {
  12324. return (fgui.UIPackage.createObject("game", "Component16"));
  12325. }
  12326. onConstruct() {
  12327. }
  12328. }
  12329. ui_Component16.URL = "ui://isxx5ak7ixm43xz";
  12330. class ui_dh_js_tuowei extends fgui.GComponent {
  12331. static createInstance() {
  12332. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12333. }
  12334. onConstruct() {
  12335. this.n19 = (this.getChild("n19"));
  12336. this.n18 = (this.getChild("n18"));
  12337. this.n0 = (this.getChild("n0"));
  12338. this.n3 = (this.getChild("n3"));
  12339. this.n4 = (this.getChild("n4"));
  12340. this.n5 = (this.getChild("n5"));
  12341. this.n6 = (this.getChild("n6"));
  12342. this.n8 = (this.getChild("n8"));
  12343. this.n9 = (this.getChild("n9"));
  12344. this.n10 = (this.getChild("n10"));
  12345. this.n11 = (this.getChild("n11"));
  12346. this.n12 = (this.getChild("n12"));
  12347. this.n13 = (this.getChild("n13"));
  12348. this.n14 = (this.getChild("n14"));
  12349. this.n15 = (this.getChild("n15"));
  12350. this.n20 = (this.getChild("n20"));
  12351. this.t0 = this.getTransition("t0");
  12352. this.t1 = this.getTransition("t1");
  12353. }
  12354. }
  12355. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12356. class ui_dh_js_tw_g extends fgui.GComponent {
  12357. static createInstance() {
  12358. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12359. }
  12360. onConstruct() {
  12361. this.n0 = (this.getChild("n0"));
  12362. this.n1 = (this.getChild("n1"));
  12363. this.t0 = this.getTransition("t0");
  12364. }
  12365. }
  12366. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12367. class ui_dh_js_xingxing extends fgui.GComponent {
  12368. static createInstance() {
  12369. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12370. }
  12371. onConstruct() {
  12372. this.n1 = (this.getChild("n1"));
  12373. this.n2 = (this.getChild("n2"));
  12374. this.n3 = (this.getChild("n3"));
  12375. this.n4 = (this.getChild("n4"));
  12376. this.n0 = (this.getChild("n0"));
  12377. this.t2 = this.getTransition("t2");
  12378. this.t1 = this.getTransition("t1");
  12379. }
  12380. }
  12381. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12382. class ui_dh_zy_jiazai extends fgui.GComponent {
  12383. static createInstance() {
  12384. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12385. }
  12386. onConstruct() {
  12387. this.c1 = this.getController("c1");
  12388. this.n0 = (this.getChild("n0"));
  12389. this.n1 = (this.getChild("n1"));
  12390. this.n2 = (this.getChild("n2"));
  12391. this.n4 = (this.getChild("n4"));
  12392. this.n5 = (this.getChild("n5"));
  12393. this.n6 = (this.getChild("n6"));
  12394. this.n8 = (this.getChild("n8"));
  12395. this.n7 = (this.getChild("n7"));
  12396. this.t0 = this.getTransition("t0");
  12397. }
  12398. }
  12399. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12400. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12401. static createInstance() {
  12402. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12403. }
  12404. onConstruct() {
  12405. this.c1 = this.getController("c1");
  12406. this.n3 = (this.getChild("n3"));
  12407. this.n5 = (this.getChild("n5"));
  12408. this.n4 = (this.getChild("n4"));
  12409. this.n0 = (this.getChild("n0"));
  12410. this.n1 = (this.getChild("n1"));
  12411. this.n2 = (this.getChild("n2"));
  12412. }
  12413. }
  12414. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12415. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12416. static createInstance() {
  12417. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12418. }
  12419. onConstruct() {
  12420. this.n19 = (this.getChild("n19"));
  12421. this.n21 = (this.getChild("n21"));
  12422. this.n0 = (this.getChild("n0"));
  12423. this.n3 = (this.getChild("n3"));
  12424. this.n4 = (this.getChild("n4"));
  12425. this.n5 = (this.getChild("n5"));
  12426. this.n6 = (this.getChild("n6"));
  12427. this.n8 = (this.getChild("n8"));
  12428. this.n9 = (this.getChild("n9"));
  12429. this.n10 = (this.getChild("n10"));
  12430. this.n11 = (this.getChild("n11"));
  12431. this.n12 = (this.getChild("n12"));
  12432. this.n13 = (this.getChild("n13"));
  12433. this.n14 = (this.getChild("n14"));
  12434. this.n15 = (this.getChild("n15"));
  12435. this.n23 = (this.getChild("n23"));
  12436. this.t0 = this.getTransition("t0");
  12437. this.t1 = this.getTransition("t1");
  12438. }
  12439. }
  12440. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12441. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12442. static createInstance() {
  12443. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12444. }
  12445. onConstruct() {
  12446. this.n1 = (this.getChild("n1"));
  12447. this.n2 = (this.getChild("n2"));
  12448. this.t0 = this.getTransition("t0");
  12449. }
  12450. }
  12451. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12452. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12453. static createInstance() {
  12454. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12455. }
  12456. onConstruct() {
  12457. this.n4 = (this.getChild("n4"));
  12458. this.n2 = (this.getChild("n2"));
  12459. this.n3 = (this.getChild("n3"));
  12460. this.idle = this.getTransition("idle");
  12461. this.attack = this.getTransition("attack");
  12462. }
  12463. }
  12464. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12465. class ui_special extends fgui.GComponent {
  12466. static createInstance() {
  12467. return (fgui.UIPackage.createObject("game", "special"));
  12468. }
  12469. onConstruct() {
  12470. this.n18 = (this.getChild("n18"));
  12471. this.n19 = (this.getChild("n19"));
  12472. this.n20 = (this.getChild("n20"));
  12473. this.n21 = (this.getChild("n21"));
  12474. this.n22 = (this.getChild("n22"));
  12475. this.levelTxt = (this.getChild("levelTxt"));
  12476. this.n24 = (this.getChild("n24"));
  12477. this.n25 = (this.getChild("n25"));
  12478. this.t0 = this.getTransition("t0");
  12479. }
  12480. }
  12481. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12482. class ui_Component145 extends fgui.GComponent {
  12483. static createInstance() {
  12484. return (fgui.UIPackage.createObject("game", "Component145"));
  12485. }
  12486. onConstruct() {
  12487. this.guanyuNode = (this.getChild("guanyuNode"));
  12488. }
  12489. }
  12490. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12491. class ui_longBtn extends fgui.GButton {
  12492. static createInstance() {
  12493. return (fgui.UIPackage.createObject("game", "longBtn"));
  12494. }
  12495. onConstruct() {
  12496. this.c1 = this.getController("c1");
  12497. this.n2 = (this.getChild("n2"));
  12498. this.n1 = (this.getChild("n1"));
  12499. this.n4 = (this.getChild("n4"));
  12500. }
  12501. }
  12502. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12503. class ui_Component146 extends fgui.GComponent {
  12504. static createInstance() {
  12505. return (fgui.UIPackage.createObject("game", "Component146"));
  12506. }
  12507. onConstruct() {
  12508. this.n89 = (this.getChild("n89"));
  12509. this.n90 = (this.getChild("n90"));
  12510. this.guideBtn = (this.getChild("guideBtn"));
  12511. }
  12512. }
  12513. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12514. class ui_Component146_11 extends fgui.GComponent {
  12515. static createInstance() {
  12516. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12517. }
  12518. onConstruct() {
  12519. this.n89 = (this.getChild("n89"));
  12520. this.n90 = (this.getChild("n90"));
  12521. this.guideBtn = (this.getChild("guideBtn"));
  12522. }
  12523. }
  12524. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12525. class ui_Component111_1 extends fgui.GComponent {
  12526. static createInstance() {
  12527. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12528. }
  12529. onConstruct() {
  12530. this.n68 = (this.getChild("n68"));
  12531. this.myMask = (this.getChild("myMask"));
  12532. }
  12533. }
  12534. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12535. class ui_Component64_1 extends fgui.GComponent {
  12536. static createInstance() {
  12537. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12538. }
  12539. onConstruct() {
  12540. this.n57 = (this.getChild("n57"));
  12541. this.n54 = (this.getChild("n54"));
  12542. this.n55 = (this.getChild("n55"));
  12543. this.n56 = (this.getChild("n56"));
  12544. this.t1 = this.getTransition("t1");
  12545. }
  12546. }
  12547. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12548. class ui_ModeSelection_com123 extends fgui.GComponent {
  12549. static createInstance() {
  12550. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12551. }
  12552. onConstruct() {
  12553. this.type1 = (this.getChild("type1"));
  12554. this.type2 = (this.getChild("type2"));
  12555. this.type3 = (this.getChild("type3"));
  12556. this.n38 = (this.getChild("n38"));
  12557. this.t0 = this.getTransition("t0");
  12558. }
  12559. }
  12560. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12561. class ui_Component132_2 extends fgui.GComponent {
  12562. static createInstance() {
  12563. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12564. }
  12565. onConstruct() {
  12566. this.n25 = (this.getChild("n25"));
  12567. this.n26 = (this.getChild("n26"));
  12568. this.n27 = (this.getChild("n27"));
  12569. this.t0 = this.getTransition("t0");
  12570. }
  12571. }
  12572. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12573. class ui_UIPower$1 extends fgui.GComponent {
  12574. static createInstance() {
  12575. return (fgui.UIPackage.createObject("game", "UIPower"));
  12576. }
  12577. onConstruct() {
  12578. this.n11 = (this.getChild("n11"));
  12579. this.myNode = (this.getChild("myNode"));
  12580. this.t0 = this.getTransition("t0");
  12581. }
  12582. }
  12583. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12584. class ui_Component133 extends fgui.GComponent {
  12585. static createInstance() {
  12586. return (fgui.UIPackage.createObject("game", "Component133"));
  12587. }
  12588. onConstruct() {
  12589. this.n29 = (this.getChild("n29"));
  12590. this.n30 = (this.getChild("n30"));
  12591. }
  12592. }
  12593. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12594. class ui_Component134 extends fgui.GComponent {
  12595. static createInstance() {
  12596. return (fgui.UIPackage.createObject("game", "Component134"));
  12597. }
  12598. onConstruct() {
  12599. this.n30 = (this.getChild("n30"));
  12600. this.n31 = (this.getChild("n31"));
  12601. this.t0 = this.getTransition("t0");
  12602. }
  12603. }
  12604. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12605. class ui_Component135 extends fgui.GComponent {
  12606. static createInstance() {
  12607. return (fgui.UIPackage.createObject("game", "Component135"));
  12608. }
  12609. onConstruct() {
  12610. this.n30 = (this.getChild("n30"));
  12611. this.t0 = this.getTransition("t0");
  12612. }
  12613. }
  12614. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12615. class ui_Component137 extends fgui.GComponent {
  12616. static createInstance() {
  12617. return (fgui.UIPackage.createObject("game", "Component137"));
  12618. }
  12619. onConstruct() {
  12620. this.n28 = (this.getChild("n28"));
  12621. this.n29 = (this.getChild("n29"));
  12622. this.n30 = (this.getChild("n30"));
  12623. this.n32 = (this.getChild("n32"));
  12624. }
  12625. }
  12626. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12627. class ui_dh_zuanshi extends fgui.GButton {
  12628. static createInstance() {
  12629. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12630. }
  12631. onConstruct() {
  12632. this.n1 = (this.getChild("n1"));
  12633. this.n2 = (this.getChild("n2"));
  12634. this.n0 = (this.getChild("n0"));
  12635. this.n3 = (this.getChild("n3"));
  12636. this.n4 = (this.getChild("n4"));
  12637. }
  12638. }
  12639. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12640. class ui_Component138 extends fgui.GComponent {
  12641. static createInstance() {
  12642. return (fgui.UIPackage.createObject("game", "Component138"));
  12643. }
  12644. onConstruct() {
  12645. this.n1 = (this.getChild("n1"));
  12646. this.n2 = (this.getChild("n2"));
  12647. this.t0 = this.getTransition("t0");
  12648. }
  12649. }
  12650. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12651. class ui_Component139 extends fgui.GComponent {
  12652. static createInstance() {
  12653. return (fgui.UIPackage.createObject("game", "Component139"));
  12654. }
  12655. onConstruct() {
  12656. this.n0 = (this.getChild("n0"));
  12657. this.t0 = this.getTransition("t0");
  12658. }
  12659. }
  12660. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12661. class ui_Component140 extends fgui.GComponent {
  12662. static createInstance() {
  12663. return (fgui.UIPackage.createObject("game", "Component140"));
  12664. }
  12665. onConstruct() {
  12666. this.n2 = (this.getChild("n2"));
  12667. this.n3 = (this.getChild("n3"));
  12668. this.t0 = this.getTransition("t0");
  12669. }
  12670. }
  12671. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12672. class ui_Component141 extends fgui.GComponent {
  12673. static createInstance() {
  12674. return (fgui.UIPackage.createObject("game", "Component141"));
  12675. }
  12676. onConstruct() {
  12677. this.n0 = (this.getChild("n0"));
  12678. this.t0 = this.getTransition("t0");
  12679. }
  12680. }
  12681. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12682. class ui_powerNode extends fgui.GProgressBar {
  12683. static createInstance() {
  12684. return (fgui.UIPackage.createObject("game", "powerNode"));
  12685. }
  12686. onConstruct() {
  12687. this.n2 = (this.getChild("n2"));
  12688. this.bar_v = (this.getChild("bar_v"));
  12689. this.showImg = (this.getChild("showImg"));
  12690. this.n12 = (this.getChild("n12"));
  12691. }
  12692. }
  12693. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12694. class ui_dh_jingbi1 extends fgui.GComponent {
  12695. static createInstance() {
  12696. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12697. }
  12698. onConstruct() {
  12699. this.n0 = (this.getChild("n0"));
  12700. this.n1 = (this.getChild("n1"));
  12701. this.n2 = (this.getChild("n2"));
  12702. this.n3 = (this.getChild("n3"));
  12703. this.n4 = (this.getChild("n4"));
  12704. this.n5 = (this.getChild("n5"));
  12705. this.n6 = (this.getChild("n6"));
  12706. this.n8 = (this.getChild("n8"));
  12707. this.t0 = this.getTransition("t0");
  12708. }
  12709. }
  12710. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12711. class ui_Component94 extends fgui.GButton {
  12712. static createInstance() {
  12713. return (fgui.UIPackage.createObject("game", "Component94"));
  12714. }
  12715. onConstruct() {
  12716. this.n77 = (this.getChild("n77"));
  12717. }
  12718. }
  12719. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12720. class ui_Component95 extends fgui.GButton {
  12721. static createInstance() {
  12722. return (fgui.UIPackage.createObject("game", "Component95"));
  12723. }
  12724. onConstruct() {
  12725. this.n77 = (this.getChild("n77"));
  12726. }
  12727. }
  12728. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12729. class ui_Component126 extends fgui.GComponent {
  12730. static createInstance() {
  12731. return (fgui.UIPackage.createObject("game", "Component126"));
  12732. }
  12733. onConstruct() {
  12734. this.c1 = this.getController("c1");
  12735. this.normalBtn = (this.getChild("normalBtn"));
  12736. this.tripleBtn = (this.getChild("tripleBtn"));
  12737. }
  12738. }
  12739. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12740. class ui_Component60 extends fgui.GComponent {
  12741. static createInstance() {
  12742. return (fgui.UIPackage.createObject("game", "Component60"));
  12743. }
  12744. onConstruct() {
  12745. this.c1 = this.getController("c1");
  12746. this.n48 = (this.getChild("n48"));
  12747. this.womanTxt = (this.getChild("womanTxt"));
  12748. this.t0 = this.getTransition("t0");
  12749. }
  12750. }
  12751. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12752. class ui_Component98_3 extends fgui.GButton {
  12753. static createInstance() {
  12754. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12755. }
  12756. onConstruct() {
  12757. this.c1 = this.getController("c1");
  12758. this.n8 = (this.getChild("n8"));
  12759. this.n41 = (this.getChild("n41"));
  12760. this.n40 = (this.getChild("n40"));
  12761. }
  12762. }
  12763. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12764. class ui_ModeSelection_com1 extends fgui.GButton {
  12765. static createInstance() {
  12766. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12767. }
  12768. onConstruct() {
  12769. this.n34 = (this.getChild("n34"));
  12770. this.n36 = (this.getChild("n36"));
  12771. this.n22 = (this.getChild("n22"));
  12772. this.n20 = (this.getChild("n20"));
  12773. this.n23 = (this.getChild("n23"));
  12774. this.n24 = (this.getChild("n24"));
  12775. this.n26 = (this.getChild("n26"));
  12776. this.n33 = (this.getChild("n33"));
  12777. this.coinImg = (this.getChild("coinImg"));
  12778. this.need = (this.getChild("need"));
  12779. this.n35 = (this.getChild("n35"));
  12780. this.n29 = (this.getChild("n29"));
  12781. this.tipsTxt = (this.getChild("tipsTxt"));
  12782. this.n30 = (this.getChild("n30"));
  12783. this.peopleTxt = (this.getChild("peopleTxt"));
  12784. this.t0 = this.getTransition("t0");
  12785. }
  12786. }
  12787. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12788. class ui_ModeSelection_com2 extends fgui.GButton {
  12789. static createInstance() {
  12790. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12791. }
  12792. onConstruct() {
  12793. this.n36 = (this.getChild("n36"));
  12794. this.n34 = (this.getChild("n34"));
  12795. this.n22 = (this.getChild("n22"));
  12796. this.n20 = (this.getChild("n20"));
  12797. this.n23 = (this.getChild("n23"));
  12798. this.n24 = (this.getChild("n24"));
  12799. this.n26 = (this.getChild("n26"));
  12800. this.n33 = (this.getChild("n33"));
  12801. this.coinImg = (this.getChild("coinImg"));
  12802. this.need = (this.getChild("need"));
  12803. this.n35 = (this.getChild("n35"));
  12804. this.n29 = (this.getChild("n29"));
  12805. this.tipsTxt = (this.getChild("tipsTxt"));
  12806. this.n30 = (this.getChild("n30"));
  12807. this.peopleTxt = (this.getChild("peopleTxt"));
  12808. this.t0 = this.getTransition("t0");
  12809. }
  12810. }
  12811. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12812. class ui_ModeSelection_com3 extends fgui.GButton {
  12813. static createInstance() {
  12814. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12815. }
  12816. onConstruct() {
  12817. this.n34 = (this.getChild("n34"));
  12818. this.n36 = (this.getChild("n36"));
  12819. this.n22 = (this.getChild("n22"));
  12820. this.n20 = (this.getChild("n20"));
  12821. this.n23 = (this.getChild("n23"));
  12822. this.n24 = (this.getChild("n24"));
  12823. this.n26 = (this.getChild("n26"));
  12824. this.n33 = (this.getChild("n33"));
  12825. this.coinImg = (this.getChild("coinImg"));
  12826. this.need = (this.getChild("need"));
  12827. this.n35 = (this.getChild("n35"));
  12828. this.n29 = (this.getChild("n29"));
  12829. this.tipsTxt = (this.getChild("tipsTxt"));
  12830. this.n30 = (this.getChild("n30"));
  12831. this.peopleTxt = (this.getChild("peopleTxt"));
  12832. this.t0 = this.getTransition("t0");
  12833. }
  12834. }
  12835. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12836. class ui_Invitation_com1 extends fgui.GComponent {
  12837. static createInstance() {
  12838. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12839. }
  12840. onConstruct() {
  12841. this.n14 = (this.getChild("n14"));
  12842. this.n13 = (this.getChild("n13"));
  12843. this.n3 = (this.getChild("n3"));
  12844. this.n1 = (this.getChild("n1"));
  12845. this.n6 = (this.getChild("n6"));
  12846. this.n7 = (this.getChild("n7"));
  12847. this.enterBtn = (this.getChild("enterBtn"));
  12848. this.n11 = (this.getChild("n11"));
  12849. this.n12 = (this.getChild("n12"));
  12850. this.n15 = (this.getChild("n15"));
  12851. this.t0 = this.getTransition("t0");
  12852. this.t1 = this.getTransition("t1");
  12853. }
  12854. }
  12855. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12856. class ui_Component87_1 extends fgui.GComponent {
  12857. static createInstance() {
  12858. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12859. }
  12860. onConstruct() {
  12861. this.n74 = (this.getChild("n74"));
  12862. this.n73 = (this.getChild("n73"));
  12863. this.ballTxt = (this.getChild("ballTxt"));
  12864. this.n76 = (this.getChild("n76"));
  12865. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12866. this.levelTxt = (this.getChild("levelTxt"));
  12867. this.n87 = (this.getChild("n87"));
  12868. this.n84 = (this.getChild("n84"));
  12869. this.hpTxt = (this.getChild("hpTxt"));
  12870. this.n89 = (this.getChild("n89"));
  12871. this.tipsTxt = (this.getChild("tipsTxt"));
  12872. }
  12873. }
  12874. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12875. class ui_sqg1 extends fgui.GComponent {
  12876. static createInstance() {
  12877. return (fgui.UIPackage.createObject("game", "sqg1"));
  12878. }
  12879. onConstruct() {
  12880. this.n1 = (this.getChild("n1"));
  12881. this.n0 = (this.getChild("n0"));
  12882. }
  12883. }
  12884. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12885. class ui_sqg2 extends fgui.GComponent {
  12886. static createInstance() {
  12887. return (fgui.UIPackage.createObject("game", "sqg2"));
  12888. }
  12889. onConstruct() {
  12890. this.n1 = (this.getChild("n1"));
  12891. this.n0 = (this.getChild("n0"));
  12892. }
  12893. }
  12894. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12895. class ui_sqg3 extends fgui.GComponent {
  12896. static createInstance() {
  12897. return (fgui.UIPackage.createObject("game", "sqg3"));
  12898. }
  12899. onConstruct() {
  12900. this.n1 = (this.getChild("n1"));
  12901. this.n0 = (this.getChild("n0"));
  12902. }
  12903. }
  12904. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12905. class ui_sqg4 extends fgui.GComponent {
  12906. static createInstance() {
  12907. return (fgui.UIPackage.createObject("game", "sqg4"));
  12908. }
  12909. onConstruct() {
  12910. this.n1 = (this.getChild("n1"));
  12911. this.n0 = (this.getChild("n0"));
  12912. }
  12913. }
  12914. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12915. class ui_Component36 extends fgui.GButton {
  12916. static createInstance() {
  12917. return (fgui.UIPackage.createObject("game", "Component36"));
  12918. }
  12919. onConstruct() {
  12920. this.c1 = this.getController("c1");
  12921. this.n53 = (this.getChild("n53"));
  12922. this.n56 = (this.getChild("n56"));
  12923. }
  12924. }
  12925. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12926. class ui_Component37 extends fgui.GButton {
  12927. static createInstance() {
  12928. return (fgui.UIPackage.createObject("game", "Component37"));
  12929. }
  12930. onConstruct() {
  12931. this.c1 = this.getController("c1");
  12932. this.n52 = (this.getChild("n52"));
  12933. this.n54 = (this.getChild("n54"));
  12934. }
  12935. }
  12936. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12937. class ui_UISetting extends fgui.GComponent {
  12938. static createInstance() {
  12939. return (fgui.UIPackage.createObject("game", "UISetting"));
  12940. }
  12941. onConstruct() {
  12942. this.c1 = this.getController("c1");
  12943. this.n4 = (this.getChild("n4"));
  12944. this.soundBtn = (this.getChild("soundBtn"));
  12945. this.shakeBtn = (this.getChild("shakeBtn"));
  12946. this.clickNode = (this.getChild("clickNode"));
  12947. this.xyBtn = (this.getChild("xyBtn"));
  12948. }
  12949. }
  12950. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12951. class ui_Component39 extends fgui.GComponent {
  12952. static createInstance() {
  12953. return (fgui.UIPackage.createObject("game", "Component39"));
  12954. }
  12955. onConstruct() {
  12956. this.n5 = (this.getChild("n5"));
  12957. this.n6 = (this.getChild("n6"));
  12958. this.n7 = (this.getChild("n7"));
  12959. this.t0 = this.getTransition("t0");
  12960. }
  12961. }
  12962. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12963. class ui_Component40 extends fgui.GButton {
  12964. static createInstance() {
  12965. return (fgui.UIPackage.createObject("game", "Component40"));
  12966. }
  12967. onConstruct() {
  12968. this.n46 = (this.getChild("n46"));
  12969. this.n47 = (this.getChild("n47"));
  12970. }
  12971. }
  12972. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  12973. class ui_Component41 extends fgui.GComponent {
  12974. static createInstance() {
  12975. return (fgui.UIPackage.createObject("game", "Component41"));
  12976. }
  12977. onConstruct() {
  12978. this.c1 = this.getController("c1");
  12979. this.n0 = (this.getChild("n0"));
  12980. this.titleTxt = (this.getChild("titleTxt"));
  12981. this.n2 = (this.getChild("n2"));
  12982. this.msgTips = (this.getChild("msgTips"));
  12983. this.numTxt = (this.getChild("numTxt"));
  12984. this.n18 = (this.getChild("n18"));
  12985. this.cancelBtn = (this.getChild("cancelBtn"));
  12986. this.videoBtn = (this.getChild("videoBtn"));
  12987. this.n10 = (this.getChild("n10"));
  12988. }
  12989. }
  12990. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  12991. class ui_Component42 extends fgui.GComponent {
  12992. static createInstance() {
  12993. return (fgui.UIPackage.createObject("game", "Component42"));
  12994. }
  12995. onConstruct() {
  12996. this.c1 = this.getController("c1");
  12997. this.n1 = (this.getChild("n1"));
  12998. this.n2 = (this.getChild("n2"));
  12999. this.n3 = (this.getChild("n3"));
  13000. this.tipsTxt = (this.getChild("tipsTxt"));
  13001. this.cancelBtn = (this.getChild("cancelBtn"));
  13002. this.sureBtn = (this.getChild("sureBtn"));
  13003. this.n11 = (this.getChild("n11"));
  13004. this.n13 = (this.getChild("n13"));
  13005. this.n14 = (this.getChild("n14"));
  13006. this.womanTxt = (this.getChild("womanTxt"));
  13007. this.t0 = this.getTransition("t0");
  13008. }
  13009. }
  13010. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13011. class ui_dh_js_shengli extends fgui.GComponent {
  13012. static createInstance() {
  13013. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13014. }
  13015. onConstruct() {
  13016. this.n3 = (this.getChild("n3"));
  13017. this.n4 = (this.getChild("n4"));
  13018. this.n1 = (this.getChild("n1"));
  13019. this.n2 = (this.getChild("n2"));
  13020. this.n5 = (this.getChild("n5"));
  13021. this.n6 = (this.getChild("n6"));
  13022. this.n7 = (this.getChild("n7"));
  13023. this.n8 = (this.getChild("n8"));
  13024. this.attack = this.getTransition("attack");
  13025. this.idle = this.getTransition("idle");
  13026. }
  13027. }
  13028. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13029. class ui_dh_js_shengli_g extends fgui.GComponent {
  13030. static createInstance() {
  13031. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13032. }
  13033. onConstruct() {
  13034. this.n3 = (this.getChild("n3"));
  13035. this.n1 = (this.getChild("n1"));
  13036. this.t0 = this.getTransition("t0");
  13037. }
  13038. }
  13039. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13040. class ui_dh_js_shibai extends fgui.GComponent {
  13041. static createInstance() {
  13042. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13043. }
  13044. onConstruct() {
  13045. this.n0 = (this.getChild("n0"));
  13046. this.n1 = (this.getChild("n1"));
  13047. this.n2 = (this.getChild("n2"));
  13048. this.n3 = (this.getChild("n3"));
  13049. this.idle = this.getTransition("idle");
  13050. this.attack = this.getTransition("attack");
  13051. }
  13052. }
  13053. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13054. class ui_dh_zy_ganfa extends fgui.GButton {
  13055. static createInstance() {
  13056. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13057. }
  13058. onConstruct() {
  13059. this.n0 = (this.getChild("n0"));
  13060. }
  13061. }
  13062. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13063. class ui_dh_zy_sc_guang extends fgui.GButton {
  13064. static createInstance() {
  13065. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13066. }
  13067. onConstruct() {
  13068. this.n0 = (this.getChild("n0"));
  13069. this.n2 = (this.getChild("n2"));
  13070. }
  13071. }
  13072. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13073. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13074. static createInstance() {
  13075. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13076. }
  13077. onConstruct() {
  13078. this.n0 = (this.getChild("n0"));
  13079. this.n3 = (this.getChild("n3"));
  13080. this.t0 = this.getTransition("t0");
  13081. }
  13082. }
  13083. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13084. class ui_dh_zy_wanfa extends fgui.GButton {
  13085. static createInstance() {
  13086. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13087. }
  13088. onConstruct() {
  13089. this.n0 = (this.getChild("n0"));
  13090. }
  13091. }
  13092. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13093. class ui_Component53_1 extends fgui.GComponent {
  13094. static createInstance() {
  13095. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13096. }
  13097. onConstruct() {
  13098. this.n0 = (this.getChild("n0"));
  13099. this.n1 = (this.getChild("n1"));
  13100. this.n2 = (this.getChild("n2"));
  13101. this.n3 = (this.getChild("n3"));
  13102. this.n4 = (this.getChild("n4"));
  13103. this.n5 = (this.getChild("n5"));
  13104. this.n6 = (this.getChild("n6"));
  13105. this.n7 = (this.getChild("n7"));
  13106. this.n8 = (this.getChild("n8"));
  13107. this.n9 = (this.getChild("n9"));
  13108. this.n10 = (this.getChild("n10"));
  13109. this.n11 = (this.getChild("n11"));
  13110. this.n12 = (this.getChild("n12"));
  13111. this.n13 = (this.getChild("n13"));
  13112. this.n14 = (this.getChild("n14"));
  13113. this.n15 = (this.getChild("n15"));
  13114. this.n16 = (this.getChild("n16"));
  13115. this.n19 = (this.getChild("n19"));
  13116. this.n20 = (this.getChild("n20"));
  13117. this.n21 = (this.getChild("n21"));
  13118. this.n22 = (this.getChild("n22"));
  13119. this.n23 = (this.getChild("n23"));
  13120. this.n24 = (this.getChild("n24"));
  13121. this.n25 = (this.getChild("n25"));
  13122. this.n26 = (this.getChild("n26"));
  13123. this.n27 = (this.getChild("n27"));
  13124. this.n28 = (this.getChild("n28"));
  13125. this.n29 = (this.getChild("n29"));
  13126. this.n30 = (this.getChild("n30"));
  13127. this.n31 = (this.getChild("n31"));
  13128. this.n32 = (this.getChild("n32"));
  13129. this.n33 = (this.getChild("n33"));
  13130. this.n34 = (this.getChild("n34"));
  13131. this.n35 = (this.getChild("n35"));
  13132. this.t0 = this.getTransition("t0");
  13133. }
  13134. }
  13135. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13136. class ui_Component30 extends fgui.GComponent {
  13137. static createInstance() {
  13138. return (fgui.UIPackage.createObject("game", "Component30"));
  13139. }
  13140. onConstruct() {
  13141. this.c1 = this.getController("c1");
  13142. this.n46 = (this.getChild("n46"));
  13143. this.n47 = (this.getChild("n47"));
  13144. this.numTxt = (this.getChild("numTxt"));
  13145. this.n50 = (this.getChild("n50"));
  13146. this.n53 = (this.getChild("n53"));
  13147. this.n54 = (this.getChild("n54"));
  13148. this.n55 = (this.getChild("n55"));
  13149. this.n56 = (this.getChild("n56"));
  13150. }
  13151. }
  13152. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13153. class ui_Component30_1 extends fgui.GComponent {
  13154. static createInstance() {
  13155. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13156. }
  13157. onConstruct() {
  13158. this.c1 = this.getController("c1");
  13159. this.n46 = (this.getChild("n46"));
  13160. this.n47 = (this.getChild("n47"));
  13161. this.numTxt = (this.getChild("numTxt"));
  13162. this.n50 = (this.getChild("n50"));
  13163. this.n51 = (this.getChild("n51"));
  13164. this.n52 = (this.getChild("n52"));
  13165. this.n53 = (this.getChild("n53"));
  13166. this.n54 = (this.getChild("n54"));
  13167. }
  13168. }
  13169. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13170. class ui_Component31 extends fgui.GComponent {
  13171. static createInstance() {
  13172. return (fgui.UIPackage.createObject("game", "Component31"));
  13173. }
  13174. onConstruct() {
  13175. this.n55 = (this.getChild("n55"));
  13176. this.n54 = (this.getChild("n54"));
  13177. this.conditionTxt = (this.getChild("conditionTxt"));
  13178. this.n57 = (this.getChild("n57"));
  13179. this.t0 = this.getTransition("t0");
  13180. }
  13181. }
  13182. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13183. class ui_Component32 extends fgui.GComponent {
  13184. static createInstance() {
  13185. return (fgui.UIPackage.createObject("game", "Component32"));
  13186. }
  13187. onConstruct() {
  13188. this.n5 = (this.getChild("n5"));
  13189. this.n6 = (this.getChild("n6"));
  13190. this.n7 = (this.getChild("n7"));
  13191. this.t0 = this.getTransition("t0");
  13192. }
  13193. }
  13194. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13195. class ui_AwardItem extends fgui.GComponent {
  13196. static createInstance() {
  13197. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13198. }
  13199. onConstruct() {
  13200. this.n9 = (this.getChild("n9"));
  13201. this.myIcon = (this.getChild("myIcon"));
  13202. this.numTxt = (this.getChild("numTxt"));
  13203. this.nameTxt = (this.getChild("nameTxt"));
  13204. this.n16 = (this.getChild("n16"));
  13205. this.n17 = (this.getChild("n17"));
  13206. }
  13207. }
  13208. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13209. class ui_ranking_com1 extends fgui.GButton {
  13210. static createInstance() {
  13211. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13212. }
  13213. onConstruct() {
  13214. this.c1 = this.getController("c1");
  13215. this.n49 = (this.getChild("n49"));
  13216. this.n18 = (this.getChild("n18"));
  13217. this.n46 = (this.getChild("n46"));
  13218. this.n48 = (this.getChild("n48"));
  13219. this.n50 = (this.getChild("n50"));
  13220. }
  13221. }
  13222. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13223. class ui_ranking_com2 extends fgui.GButton {
  13224. static createInstance() {
  13225. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13226. }
  13227. onConstruct() {
  13228. this.c1 = this.getController("c1");
  13229. this.n49 = (this.getChild("n49"));
  13230. this.n18 = (this.getChild("n18"));
  13231. this.n46 = (this.getChild("n46"));
  13232. this.n48 = (this.getChild("n48"));
  13233. this.n50 = (this.getChild("n50"));
  13234. }
  13235. }
  13236. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13237. class ui_ranking_com3 extends fgui.GComponent {
  13238. static createInstance() {
  13239. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13240. }
  13241. onConstruct() {
  13242. this.n17 = (this.getChild("n17"));
  13243. this.myIcon = (this.getChild("myIcon"));
  13244. }
  13245. }
  13246. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13247. class ui_ranking_com4 extends fgui.GComponent {
  13248. static createInstance() {
  13249. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13250. }
  13251. onConstruct() {
  13252. this.n16 = (this.getChild("n16"));
  13253. this.head = (this.getChild("head"));
  13254. }
  13255. }
  13256. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13257. class ui_ranking_com5 extends fgui.GComponent {
  13258. static createInstance() {
  13259. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13260. }
  13261. onConstruct() {
  13262. this.c1 = this.getController("c1");
  13263. this.c2 = this.getController("c2");
  13264. this.n2 = (this.getChild("n2"));
  13265. this.n3 = (this.getChild("n3"));
  13266. this.levelBtn = (this.getChild("levelBtn"));
  13267. this.starBtn = (this.getChild("starBtn"));
  13268. this.n23 = (this.getChild("n23"));
  13269. this.n24 = (this.getChild("n24"));
  13270. this.n25 = (this.getChild("n25"));
  13271. this.myList = (this.getChild("myList"));
  13272. this.selfNode = (this.getChild("selfNode"));
  13273. this.n9 = (this.getChild("n9"));
  13274. this.n12 = (this.getChild("n12"));
  13275. this.n13 = (this.getChild("n13"));
  13276. this.n14 = (this.getChild("n14"));
  13277. this.n39 = (this.getChild("n39"));
  13278. this.n41 = (this.getChild("n41"));
  13279. this.n42 = (this.getChild("n42"));
  13280. this.n45 = (this.getChild("n45"));
  13281. this.changeBtn = (this.getChild("changeBtn"));
  13282. this.closeBtn = (this.getChild("closeBtn"));
  13283. this.t0 = this.getTransition("t0");
  13284. }
  13285. }
  13286. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13287. class ui_RankItem extends fgui.GComponent {
  13288. static createInstance() {
  13289. return (fgui.UIPackage.createObject("game", "RankItem"));
  13290. }
  13291. onConstruct() {
  13292. this.n10 = (this.getChild("n10"));
  13293. this.n11 = (this.getChild("n11"));
  13294. this.rankTxt = (this.getChild("rankTxt"));
  13295. this.headNode = (this.getChild("headNode"));
  13296. this.nameTxt = (this.getChild("nameTxt"));
  13297. this.n19 = (this.getChild("n19"));
  13298. this.valueTxt = (this.getChild("valueTxt"));
  13299. this.img1 = (this.getChild("img1"));
  13300. this.img2 = (this.getChild("img2"));
  13301. this.img3 = (this.getChild("img3"));
  13302. }
  13303. }
  13304. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13305. class ui_ranking_com9 extends fgui.GComponent {
  13306. static createInstance() {
  13307. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13308. }
  13309. onConstruct() {
  13310. this.c1 = this.getController("c1");
  13311. this.n27 = (this.getChild("n27"));
  13312. this.n28 = (this.getChild("n28"));
  13313. this.headNode = (this.getChild("headNode"));
  13314. this.rankTxt = (this.getChild("rankTxt"));
  13315. this.nameTxt = (this.getChild("nameTxt"));
  13316. this.n34 = (this.getChild("n34"));
  13317. this.valueTxt = (this.getChild("valueTxt"));
  13318. this.n36 = (this.getChild("n36"));
  13319. this.n37 = (this.getChild("n37"));
  13320. this.n38 = (this.getChild("n38"));
  13321. this.n39 = (this.getChild("n39"));
  13322. this.n40 = (this.getChild("n40"));
  13323. }
  13324. }
  13325. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13326. class ui_ranking_com10 extends fgui.GComponent {
  13327. static createInstance() {
  13328. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13329. }
  13330. onConstruct() {
  13331. this.n23 = (this.getChild("n23"));
  13332. this.n24 = (this.getChild("n24"));
  13333. }
  13334. }
  13335. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13336. class ui_ranking_com11 extends fgui.GComponent {
  13337. static createInstance() {
  13338. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13339. }
  13340. onConstruct() {
  13341. this.n24 = (this.getChild("n24"));
  13342. this.n25 = (this.getChild("n25"));
  13343. this.t0 = this.getTransition("t0");
  13344. }
  13345. }
  13346. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13347. class ui_ranking_com13 extends fgui.GButton {
  13348. static createInstance() {
  13349. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13350. }
  13351. onConstruct() {
  13352. this.c1 = this.getController("c1");
  13353. this.n44 = (this.getChild("n44"));
  13354. this.n45 = (this.getChild("n45"));
  13355. this.n46 = (this.getChild("n46"));
  13356. }
  13357. }
  13358. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13359. class ui_Component122 extends fgui.GComponent {
  13360. static createInstance() {
  13361. return (fgui.UIPackage.createObject("game", "Component122"));
  13362. }
  13363. onConstruct() {
  13364. this.gameNode1 = (this.getChild("gameNode1"));
  13365. this.gameNode2 = (this.getChild("gameNode2"));
  13366. this.gameNode3 = (this.getChild("gameNode3"));
  13367. }
  13368. }
  13369. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13370. class ui_skillItem extends fgui.GComponent {
  13371. static createInstance() {
  13372. return (fgui.UIPackage.createObject("game", "skillItem"));
  13373. }
  13374. onConstruct() {
  13375. this.c1 = this.getController("c1");
  13376. this.n31 = (this.getChild("n31"));
  13377. this.n6 = (this.getChild("n6"));
  13378. this.skillImg = (this.getChild("skillImg"));
  13379. this.nameTxt = (this.getChild("nameTxt"));
  13380. this.levelTxt = (this.getChild("levelTxt"));
  13381. this.n28 = (this.getChild("n28"));
  13382. this.describeTxt = (this.getChild("describeTxt"));
  13383. this.n32 = (this.getChild("n32"));
  13384. this.mutiBtn = (this.getChild("mutiBtn"));
  13385. this.tryNode = (this.getChild("tryNode"));
  13386. this.normalBtn = (this.getChild("normalBtn"));
  13387. this.startBtn = (this.getChild("startBtn"));
  13388. this.n42 = (this.getChild("n42"));
  13389. this.n43 = (this.getChild("n43"));
  13390. this.n44 = (this.getChild("n44"));
  13391. }
  13392. }
  13393. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13394. class ui_Component26 extends fgui.GButton {
  13395. static createInstance() {
  13396. return (fgui.UIPackage.createObject("game", "Component26"));
  13397. }
  13398. onConstruct() {
  13399. this.n11 = (this.getChild("n11"));
  13400. this.n30 = (this.getChild("n30"));
  13401. this.n34 = (this.getChild("n34"));
  13402. }
  13403. }
  13404. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13405. class ui_Component28 extends fgui.GButton {
  13406. static createInstance() {
  13407. return (fgui.UIPackage.createObject("game", "Component28"));
  13408. }
  13409. onConstruct() {
  13410. this.n12 = (this.getChild("n12"));
  13411. this.n31 = (this.getChild("n31"));
  13412. this.curTxt = (this.getChild("curTxt"));
  13413. this.n33 = (this.getChild("n33"));
  13414. }
  13415. }
  13416. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13417. class ui_Component1302 extends fgui.GComponent {
  13418. static createInstance() {
  13419. return (fgui.UIPackage.createObject("game", "Component1302"));
  13420. }
  13421. onConstruct() {
  13422. this.n2 = (this.getChild("n2"));
  13423. this.n3 = (this.getChild("n3"));
  13424. }
  13425. }
  13426. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13427. class ui_Component113 extends fgui.GComponent {
  13428. static createInstance() {
  13429. return (fgui.UIPackage.createObject("game", "Component113"));
  13430. }
  13431. onConstruct() {
  13432. this.n85 = (this.getChild("n85"));
  13433. this.n86 = (this.getChild("n86"));
  13434. this.n77 = (this.getChild("n77"));
  13435. this.n79 = (this.getChild("n79"));
  13436. this.n80 = (this.getChild("n80"));
  13437. this.n81 = (this.getChild("n81"));
  13438. this.n82 = (this.getChild("n82"));
  13439. this.n84 = (this.getChild("n84"));
  13440. this.n87 = (this.getChild("n87"));
  13441. this.t0 = this.getTransition("t0");
  13442. }
  13443. }
  13444. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13445. class ui_Component114 extends fgui.GComponent {
  13446. static createInstance() {
  13447. return (fgui.UIPackage.createObject("game", "Component114"));
  13448. }
  13449. onConstruct() {
  13450. this.n77 = (this.getChild("n77"));
  13451. this.t0 = this.getTransition("t0");
  13452. }
  13453. }
  13454. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13455. class ui_Component115 extends fgui.GComponent {
  13456. static createInstance() {
  13457. return (fgui.UIPackage.createObject("game", "Component115"));
  13458. }
  13459. onConstruct() {
  13460. this.n83 = (this.getChild("n83"));
  13461. this.fingerNode = (this.getChild("fingerNode"));
  13462. this.n84 = (this.getChild("n84"));
  13463. }
  13464. }
  13465. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13466. class ui_Component117 extends fgui.GComponent {
  13467. static createInstance() {
  13468. return (fgui.UIPackage.createObject("game", "Component117"));
  13469. }
  13470. onConstruct() {
  13471. this.n87 = (this.getChild("n87"));
  13472. this.n88 = (this.getChild("n88"));
  13473. this.n84 = (this.getChild("n84"));
  13474. this.n85 = (this.getChild("n85"));
  13475. this.n86 = (this.getChild("n86"));
  13476. this.t0 = this.getTransition("t0");
  13477. }
  13478. }
  13479. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13480. class ui_Component98_1 extends fgui.GButton {
  13481. static createInstance() {
  13482. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13483. }
  13484. onConstruct() {
  13485. this.c1 = this.getController("c1");
  13486. this.n8 = (this.getChild("n8"));
  13487. this.n41 = (this.getChild("n41"));
  13488. this.n40 = (this.getChild("n40"));
  13489. }
  13490. }
  13491. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13492. class ui_Component61 extends fgui.GComponent {
  13493. static createInstance() {
  13494. return (fgui.UIPackage.createObject("game", "Component61"));
  13495. }
  13496. onConstruct() {
  13497. this.n14 = (this.getChild("n14"));
  13498. this.n6 = (this.getChild("n6"));
  13499. this.t0 = this.getTransition("t0");
  13500. }
  13501. }
  13502. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13503. class ui_Component62 extends fgui.GComponent {
  13504. static createInstance() {
  13505. return (fgui.UIPackage.createObject("game", "Component62"));
  13506. }
  13507. onConstruct() {
  13508. this.n66 = (this.getChild("n66"));
  13509. this.n56 = (this.getChild("n56"));
  13510. this.n63 = (this.getChild("n63"));
  13511. this.n65 = (this.getChild("n65"));
  13512. this.t0 = this.getTransition("t0");
  13513. }
  13514. }
  13515. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13516. class ui_d3Root extends fgui.GComponent {
  13517. static createInstance() {
  13518. return (fgui.UIPackage.createObject("game", "d3Root"));
  13519. }
  13520. onConstruct() {
  13521. }
  13522. }
  13523. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13524. class ui_d2Root extends fgui.GComponent {
  13525. static createInstance() {
  13526. return (fgui.UIPackage.createObject("game", "d2Root"));
  13527. }
  13528. onConstruct() {
  13529. }
  13530. }
  13531. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13532. class ui_ballNode extends fgui.GComponent {
  13533. static createInstance() {
  13534. return (fgui.UIPackage.createObject("game", "ballNode"));
  13535. }
  13536. onConstruct() {
  13537. }
  13538. }
  13539. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13540. class ui_border extends fgui.GComponent {
  13541. static createInstance() {
  13542. return (fgui.UIPackage.createObject("game", "border"));
  13543. }
  13544. onConstruct() {
  13545. this.bar1 = (this.getChild("bar1"));
  13546. this.bar2 = (this.getChild("bar2"));
  13547. this.bar3 = (this.getChild("bar3"));
  13548. this.bar4 = (this.getChild("bar4"));
  13549. this.bar5 = (this.getChild("bar5"));
  13550. this.bar6 = (this.getChild("bar6"));
  13551. this.circle1 = (this.getChild("circle1"));
  13552. this.circle2 = (this.getChild("circle2"));
  13553. this.circle3 = (this.getChild("circle3"));
  13554. this.circle4 = (this.getChild("circle4"));
  13555. this.circle5 = (this.getChild("circle5"));
  13556. this.circle6 = (this.getChild("circle6"));
  13557. this.n28 = (this.getChild("n28"));
  13558. }
  13559. }
  13560. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13561. class ui_Component41_2 extends fgui.GComponent {
  13562. static createInstance() {
  13563. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13564. }
  13565. onConstruct() {
  13566. this.c1 = this.getController("c1");
  13567. this.n0 = (this.getChild("n0"));
  13568. this.n2 = (this.getChild("n2"));
  13569. this.n19 = (this.getChild("n19"));
  13570. this.cancelBtn = (this.getChild("cancelBtn"));
  13571. this.videoBtn = (this.getChild("videoBtn"));
  13572. this.n9 = (this.getChild("n9"));
  13573. this.n22 = (this.getChild("n22"));
  13574. this.tipsTxt = (this.getChild("tipsTxt"));
  13575. this.n23 = (this.getChild("n23"));
  13576. this.n24 = (this.getChild("n24"));
  13577. this.n26 = (this.getChild("n26"));
  13578. this.n27 = (this.getChild("n27"));
  13579. this.titleTxt = (this.getChild("titleTxt"));
  13580. }
  13581. }
  13582. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13583. class ui_Component41_1 extends fgui.GComponent {
  13584. static createInstance() {
  13585. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13586. }
  13587. onConstruct() {
  13588. this.c1 = this.getController("c1");
  13589. this.n0 = (this.getChild("n0"));
  13590. this.n2 = (this.getChild("n2"));
  13591. this.cancelBtn = (this.getChild("cancelBtn"));
  13592. this.videoBtn = (this.getChild("videoBtn"));
  13593. this.n27 = (this.getChild("n27"));
  13594. this.n30 = (this.getChild("n30"));
  13595. this.n31 = (this.getChild("n31"));
  13596. this.n32 = (this.getChild("n32"));
  13597. this.n33 = (this.getChild("n33"));
  13598. this.n34 = (this.getChild("n34"));
  13599. this.n35 = (this.getChild("n35"));
  13600. this.n36 = (this.getChild("n36"));
  13601. this.n1 = (this.getChild("n1"));
  13602. this.n37 = (this.getChild("n37"));
  13603. this.t0 = this.getTransition("t0");
  13604. this.t1 = this.getTransition("t1");
  13605. this.t2 = this.getTransition("t2");
  13606. this.t3 = this.getTransition("t3");
  13607. }
  13608. }
  13609. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13610. class ui_againBtn extends fgui.GButton {
  13611. static createInstance() {
  13612. return (fgui.UIPackage.createObject("game", "againBtn"));
  13613. }
  13614. onConstruct() {
  13615. this.n2 = (this.getChild("n2"));
  13616. this.n1 = (this.getChild("n1"));
  13617. this.n5 = (this.getChild("n5"));
  13618. }
  13619. }
  13620. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13621. class ui_Component118 extends fgui.GButton {
  13622. static createInstance() {
  13623. return (fgui.UIPackage.createObject("game", "Component118"));
  13624. }
  13625. onConstruct() {
  13626. this.c1 = this.getController("c1");
  13627. this.n14 = (this.getChild("n14"));
  13628. this.n9 = (this.getChild("n9"));
  13629. this.n10 = (this.getChild("n10"));
  13630. this.diamondTxt = (this.getChild("diamondTxt"));
  13631. this.n13 = (this.getChild("n13"));
  13632. this.n15 = (this.getChild("n15"));
  13633. }
  13634. }
  13635. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13636. class ui_Component119 extends fgui.GComponent {
  13637. static createInstance() {
  13638. return (fgui.UIPackage.createObject("game", "Component119"));
  13639. }
  13640. onConstruct() {
  13641. this.n1 = (this.getChild("n1"));
  13642. this.n2 = (this.getChild("n2"));
  13643. this.n13 = (this.getChild("n13"));
  13644. this.n6 = (this.getChild("n6"));
  13645. this.screenNode = (this.getChild("screenNode"));
  13646. this.n15 = (this.getChild("n15"));
  13647. this.closeBtn = (this.getChild("closeBtn"));
  13648. this.share2Btn = (this.getChild("share2Btn"));
  13649. this.shareBtn = (this.getChild("shareBtn"));
  13650. this.tipsNode = (this.getChild("tipsNode"));
  13651. this.awardNode = (this.getChild("awardNode"));
  13652. }
  13653. }
  13654. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13655. class ui_Component132_1 extends fgui.GComponent {
  13656. static createInstance() {
  13657. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13658. }
  13659. onConstruct() {
  13660. this.n25 = (this.getChild("n25"));
  13661. this.n26 = (this.getChild("n26"));
  13662. this.n27 = (this.getChild("n27"));
  13663. this.t0 = this.getTransition("t0");
  13664. }
  13665. }
  13666. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13667. class ui_SecretaryDisplay extends fgui.GComponent {
  13668. static createInstance() {
  13669. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13670. }
  13671. onConstruct() {
  13672. this.n2 = (this.getChild("n2"));
  13673. this.levelTxt = (this.getChild("levelTxt"));
  13674. this.n4 = (this.getChild("n4"));
  13675. this.secretary = (this.getChild("secretary"));
  13676. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13677. this.n16 = (this.getChild("n16"));
  13678. this.n37 = (this.getChild("n37"));
  13679. this.n41 = (this.getChild("n41"));
  13680. this.n14 = (this.getChild("n14"));
  13681. this.n17 = (this.getChild("n17"));
  13682. this.heightTxt = (this.getChild("heightTxt"));
  13683. this.n46 = (this.getChild("n46"));
  13684. this.n36 = (this.getChild("n36"));
  13685. this.n38 = (this.getChild("n38"));
  13686. this.foodTxt = (this.getChild("foodTxt"));
  13687. this.n47 = (this.getChild("n47"));
  13688. this.n40 = (this.getChild("n40"));
  13689. this.n42 = (this.getChild("n42"));
  13690. this.historyTxt = (this.getChild("historyTxt"));
  13691. this.n48 = (this.getChild("n48"));
  13692. this.nameImg = (this.getChild("nameImg"));
  13693. this.n12 = (this.getChild("n12"));
  13694. this.n49 = (this.getChild("n49"));
  13695. this.t0 = this.getTransition("t0");
  13696. }
  13697. }
  13698. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13699. class ui_BallRodDisplay extends fgui.GComponent {
  13700. static createInstance() {
  13701. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13702. }
  13703. onConstruct() {
  13704. this.c1 = this.getController("c1");
  13705. this.n31 = (this.getChild("n31"));
  13706. this.n6 = (this.getChild("n6"));
  13707. this.nameTxt = (this.getChild("nameTxt"));
  13708. this.rodImg = (this.getChild("rodImg"));
  13709. this.levelNode = (this.getChild("levelNode"));
  13710. this.eftRod = (this.getChild("eftRod"));
  13711. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13712. }
  13713. }
  13714. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13715. class ui_Component111_11 extends fgui.GComponent {
  13716. static createInstance() {
  13717. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13718. }
  13719. onConstruct() {
  13720. this.n68 = (this.getChild("n68"));
  13721. this.n69 = (this.getChild("n69"));
  13722. }
  13723. }
  13724. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13725. class ui_Component112 extends fgui.GComponent {
  13726. static createInstance() {
  13727. return (fgui.UIPackage.createObject("game", "Component112"));
  13728. }
  13729. onConstruct() {
  13730. this.n68 = (this.getChild("n68"));
  13731. this.n70 = (this.getChild("n70"));
  13732. this.myMask = (this.getChild("myMask"));
  13733. }
  13734. }
  13735. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13736. class ui_Component111 extends fgui.GComponent {
  13737. static createInstance() {
  13738. return (fgui.UIPackage.createObject("game", "Component111"));
  13739. }
  13740. onConstruct() {
  13741. this.n68 = (this.getChild("n68"));
  13742. this.myMask = (this.getChild("myMask"));
  13743. }
  13744. }
  13745. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13746. class ui_Component144 extends fgui.GButton {
  13747. static createInstance() {
  13748. return (fgui.UIPackage.createObject("game", "Component144"));
  13749. }
  13750. onConstruct() {
  13751. this.n8 = (this.getChild("n8"));
  13752. }
  13753. }
  13754. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13755. class ui_Sign_com2 extends fgui.GComponent {
  13756. static createInstance() {
  13757. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13758. }
  13759. onConstruct() {
  13760. this.n0 = (this.getChild("n0"));
  13761. this.n1 = (this.getChild("n1"));
  13762. this.t0 = this.getTransition("t0");
  13763. }
  13764. }
  13765. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13766. class ui_Sign_guang extends fgui.GComponent {
  13767. static createInstance() {
  13768. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13769. }
  13770. onConstruct() {
  13771. this.n1 = (this.getChild("n1"));
  13772. this.n2 = (this.getChild("n2"));
  13773. this.n3 = (this.getChild("n3"));
  13774. this.n4 = (this.getChild("n4"));
  13775. this.n5 = (this.getChild("n5"));
  13776. this.n6 = (this.getChild("n6"));
  13777. this.n8 = (this.getChild("n8"));
  13778. }
  13779. }
  13780. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13781. class ui_SignMax extends fgui.GComponent {
  13782. static createInstance() {
  13783. return (fgui.UIPackage.createObject("game", "SignMax"));
  13784. }
  13785. onConstruct() {
  13786. this.c1 = this.getController("c1");
  13787. this.n7 = (this.getChild("n7"));
  13788. this.n15 = (this.getChild("n15"));
  13789. this.n8 = (this.getChild("n8"));
  13790. this.titleTxt = (this.getChild("titleTxt"));
  13791. this.myIcon1 = (this.getChild("myIcon1"));
  13792. this.numTxt1 = (this.getChild("numTxt1"));
  13793. this.myIcon2 = (this.getChild("myIcon2"));
  13794. this.n20 = (this.getChild("n20"));
  13795. this.n17 = (this.getChild("n17"));
  13796. this.numTxt2 = (this.getChild("numTxt2"));
  13797. this.n12 = (this.getChild("n12"));
  13798. this.n13 = (this.getChild("n13"));
  13799. this.n21 = (this.getChild("n21"));
  13800. this.n14 = (this.getChild("n14"));
  13801. }
  13802. }
  13803. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13804. class ui_Sign_com2_1 extends fgui.GComponent {
  13805. static createInstance() {
  13806. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13807. }
  13808. onConstruct() {
  13809. this.n0 = (this.getChild("n0"));
  13810. this.n1 = (this.getChild("n1"));
  13811. this.t0 = this.getTransition("t0");
  13812. }
  13813. }
  13814. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13815. class ui_Sign_com5 extends fgui.GComponent {
  13816. static createInstance() {
  13817. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13818. }
  13819. onConstruct() {
  13820. this.n3 = (this.getChild("n3"));
  13821. this.n29 = (this.getChild("n29"));
  13822. this.n4 = (this.getChild("n4"));
  13823. this.day1 = (this.getChild("day1"));
  13824. this.day2 = (this.getChild("day2"));
  13825. this.day3 = (this.getChild("day3"));
  13826. this.day4 = (this.getChild("day4"));
  13827. this.day5 = (this.getChild("day5"));
  13828. this.day6 = (this.getChild("day6"));
  13829. this.day7 = (this.getChild("day7"));
  13830. this.t0 = this.getTransition("t0");
  13831. }
  13832. }
  13833. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13834. class ui_Sign_com8 extends fgui.GComponent {
  13835. static createInstance() {
  13836. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13837. }
  13838. onConstruct() {
  13839. this.n48 = (this.getChild("n48"));
  13840. this.womanTxt = (this.getChild("womanTxt"));
  13841. this.t0 = this.getTransition("t0");
  13842. }
  13843. }
  13844. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13845. class ui_Sign_com6 extends fgui.GComponent {
  13846. static createInstance() {
  13847. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13848. }
  13849. onConstruct() {
  13850. this.n2 = (this.getChild("n2"));
  13851. this.n3 = (this.getChild("n3"));
  13852. this.t0 = this.getTransition("t0");
  13853. }
  13854. }
  13855. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13856. class ui_Sign_com7 extends fgui.GComponent {
  13857. static createInstance() {
  13858. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13859. }
  13860. onConstruct() {
  13861. this.n29 = (this.getChild("n29"));
  13862. this.n2 = (this.getChild("n2"));
  13863. }
  13864. }
  13865. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13866. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13867. static createInstance() {
  13868. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13869. }
  13870. onConstruct() {
  13871. this.n5 = (this.getChild("n5"));
  13872. this.n4 = (this.getChild("n4"));
  13873. this.t0 = this.getTransition("t0");
  13874. }
  13875. }
  13876. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13877. class ui_UITurntable_com2 extends fgui.GComponent {
  13878. static createInstance() {
  13879. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13880. }
  13881. onConstruct() {
  13882. this.c1 = this.getController("c1");
  13883. this.n4 = (this.getChild("n4"));
  13884. this.n6 = (this.getChild("n6"));
  13885. this.n10 = (this.getChild("n10"));
  13886. this.n11 = (this.getChild("n11"));
  13887. this.n12 = (this.getChild("n12"));
  13888. this.n13 = (this.getChild("n13"));
  13889. this.n14 = (this.getChild("n14"));
  13890. this.n15 = (this.getChild("n15"));
  13891. this.n16 = (this.getChild("n16"));
  13892. this.n17 = (this.getChild("n17"));
  13893. this.n18 = (this.getChild("n18"));
  13894. this.n19 = (this.getChild("n19"));
  13895. this.n20 = (this.getChild("n20"));
  13896. this.n21 = (this.getChild("n21"));
  13897. this.n22 = (this.getChild("n22"));
  13898. this.n23 = (this.getChild("n23"));
  13899. this.n24 = (this.getChild("n24"));
  13900. this.n25 = (this.getChild("n25"));
  13901. this.n26 = (this.getChild("n26"));
  13902. this.n27 = (this.getChild("n27"));
  13903. this.n28 = (this.getChild("n28"));
  13904. this.n29 = (this.getChild("n29"));
  13905. this.n30 = (this.getChild("n30"));
  13906. this.n31 = (this.getChild("n31"));
  13907. this.n32 = (this.getChild("n32"));
  13908. this.n33 = (this.getChild("n33"));
  13909. }
  13910. }
  13911. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13912. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13913. static createInstance() {
  13914. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13915. }
  13916. onConstruct() {
  13917. this.n5 = (this.getChild("n5"));
  13918. this.n4 = (this.getChild("n4"));
  13919. this.t0 = this.getTransition("t0");
  13920. }
  13921. }
  13922. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13923. class ui_UITurntable_com5 extends fgui.GComponent {
  13924. static createInstance() {
  13925. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13926. }
  13927. onConstruct() {
  13928. this.flashNode = (this.getChild("flashNode"));
  13929. this.rotNode = (this.getChild("rotNode"));
  13930. this.n3 = (this.getChild("n3"));
  13931. this.n21 = (this.getChild("n21"));
  13932. this.t0 = this.getTransition("t0");
  13933. }
  13934. }
  13935. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  13936. class ui_UITurntable_com7 extends fgui.GComponent {
  13937. static createInstance() {
  13938. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  13939. }
  13940. onConstruct() {
  13941. this.n2 = (this.getChild("n2"));
  13942. this.n35 = (this.getChild("n35"));
  13943. this.img1 = (this.getChild("img1"));
  13944. this.img2 = (this.getChild("img2"));
  13945. this.img3 = (this.getChild("img3"));
  13946. this.img4 = (this.getChild("img4"));
  13947. this.img6 = (this.getChild("img6"));
  13948. this.img5 = (this.getChild("img5"));
  13949. this.txt1 = (this.getChild("txt1"));
  13950. this.txt2 = (this.getChild("txt2"));
  13951. this.txt3 = (this.getChild("txt3"));
  13952. this.txt4 = (this.getChild("txt4"));
  13953. this.txt5 = (this.getChild("txt5"));
  13954. this.txt6 = (this.getChild("txt6"));
  13955. }
  13956. }
  13957. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  13958. class ui_UITurntable_com9 extends fgui.GComponent {
  13959. static createInstance() {
  13960. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  13961. }
  13962. onConstruct() {
  13963. this.n38 = (this.getChild("n38"));
  13964. this.n39 = (this.getChild("n39"));
  13965. }
  13966. }
  13967. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  13968. class ui_UITurntable_com10 extends fgui.GComponent {
  13969. static createInstance() {
  13970. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  13971. }
  13972. onConstruct() {
  13973. this.n39 = (this.getChild("n39"));
  13974. this.n40 = (this.getChild("n40"));
  13975. this.t0 = this.getTransition("t0");
  13976. }
  13977. }
  13978. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  13979. class ui_UITurntable_com11 extends fgui.GComponent {
  13980. static createInstance() {
  13981. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  13982. }
  13983. onConstruct() {
  13984. this.n38 = (this.getChild("n38"));
  13985. this.n39 = (this.getChild("n39"));
  13986. this.n40 = (this.getChild("n40"));
  13987. this.t0 = this.getTransition("t0");
  13988. }
  13989. }
  13990. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  13991. class ui_UITurntable_com12 extends fgui.GComponent {
  13992. static createInstance() {
  13993. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  13994. }
  13995. onConstruct() {
  13996. this.n43 = (this.getChild("n43"));
  13997. this.barNode = (this.getChild("barNode"));
  13998. this.tipsTxt = (this.getChild("tipsTxt"));
  13999. this.n45 = (this.getChild("n45"));
  14000. this.boxBtn = (this.getChild("boxBtn"));
  14001. }
  14002. }
  14003. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14004. class ui_UITurntable_com1 extends fgui.GButton {
  14005. static createInstance() {
  14006. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14007. }
  14008. onConstruct() {
  14009. this.n41 = (this.getChild("n41"));
  14010. this.n42 = (this.getChild("n42"));
  14011. this.t0 = this.getTransition("t0");
  14012. }
  14013. }
  14014. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14015. class ui_UITurntable_com3 extends fgui.GComponent {
  14016. static createInstance() {
  14017. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14018. }
  14019. onConstruct() {
  14020. this.n48 = (this.getChild("n48"));
  14021. this.womanTxt = (this.getChild("womanTxt"));
  14022. this.t0 = this.getTransition("t0");
  14023. }
  14024. }
  14025. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14026. class ui_cancelBtn2 extends fgui.GButton {
  14027. static createInstance() {
  14028. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14029. }
  14030. onConstruct() {
  14031. this.c1 = this.getController("c1");
  14032. this.n0 = (this.getChild("n0"));
  14033. this.n1 = (this.getChild("n1"));
  14034. this.n2 = (this.getChild("n2"));
  14035. this.n3 = (this.getChild("n3"));
  14036. this.n4 = (this.getChild("n4"));
  14037. this.n5 = (this.getChild("n5"));
  14038. this.n6 = (this.getChild("n6"));
  14039. this.n7 = (this.getChild("n7"));
  14040. this.n8 = (this.getChild("n8"));
  14041. this.powerEft = (this.getChild("powerEft"));
  14042. }
  14043. }
  14044. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14045. class ui_shareBtn2 extends fgui.GButton {
  14046. static createInstance() {
  14047. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14048. }
  14049. onConstruct() {
  14050. this.c1 = this.getController("c1");
  14051. this.n2 = (this.getChild("n2"));
  14052. this.n24 = (this.getChild("n24"));
  14053. this.n1 = (this.getChild("n1"));
  14054. this.n3 = (this.getChild("n3"));
  14055. this.n23 = (this.getChild("n23"));
  14056. this.n4 = (this.getChild("n4"));
  14057. this.n5 = (this.getChild("n5"));
  14058. this.n6 = (this.getChild("n6"));
  14059. this.n20 = (this.getChild("n20"));
  14060. this.n21 = (this.getChild("n21"));
  14061. this.n22 = (this.getChild("n22"));
  14062. this.powerEft = (this.getChild("powerEft"));
  14063. }
  14064. }
  14065. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14066. class ui_UIMoney extends fgui.GComponent {
  14067. static createInstance() {
  14068. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14069. }
  14070. onConstruct() {
  14071. this.c1 = this.getController("c1");
  14072. this.n4 = (this.getChild("n4"));
  14073. this.coinImg = (this.getChild("coinImg"));
  14074. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14075. this.coinTxt = (this.getChild("coinTxt"));
  14076. this.n7 = (this.getChild("n7"));
  14077. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14078. this.diamondTxt = (this.getChild("diamondTxt"));
  14079. this.diamondImg = (this.getChild("diamondImg"));
  14080. this.n12 = (this.getChild("n12"));
  14081. this.powerImg = (this.getChild("powerImg"));
  14082. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14083. this.powerTxt = (this.getChild("powerTxt"));
  14084. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14085. }
  14086. }
  14087. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14088. class ui_backBtn extends fgui.GButton {
  14089. static createInstance() {
  14090. return (fgui.UIPackage.createObject("game", "backBtn"));
  14091. }
  14092. onConstruct() {
  14093. this.n0 = (this.getChild("n0"));
  14094. this.t0 = this.getTransition("t0");
  14095. this.t1 = this.getTransition("t1");
  14096. }
  14097. }
  14098. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14099. class ui_MoneyBtn extends fgui.GButton {
  14100. static createInstance() {
  14101. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14102. }
  14103. onConstruct() {
  14104. this.button = this.getController("button");
  14105. this.n0 = (this.getChild("n0"));
  14106. }
  14107. }
  14108. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14109. class ui_UIMoneyBtn extends fgui.GComponent {
  14110. static createInstance() {
  14111. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14112. }
  14113. onConstruct() {
  14114. this.n1 = (this.getChild("n1"));
  14115. this.closeBtn = (this.getChild("closeBtn"));
  14116. }
  14117. }
  14118. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14119. class ui_Component64 extends fgui.GComponent {
  14120. static createInstance() {
  14121. return (fgui.UIPackage.createObject("game", "Component64"));
  14122. }
  14123. onConstruct() {
  14124. this.n57 = (this.getChild("n57"));
  14125. this.n54 = (this.getChild("n54"));
  14126. this.n55 = (this.getChild("n55"));
  14127. this.n56 = (this.getChild("n56"));
  14128. this.t1 = this.getTransition("t1");
  14129. }
  14130. }
  14131. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14132. class ui_Component41_3 extends fgui.GComponent {
  14133. static createInstance() {
  14134. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14135. }
  14136. onConstruct() {
  14137. this.c1 = this.getController("c1");
  14138. this.n0 = (this.getChild("n0"));
  14139. this.n2 = (this.getChild("n2"));
  14140. this.cancelBtn = (this.getChild("cancelBtn"));
  14141. this.videoBtn = (this.getChild("videoBtn"));
  14142. this.n9 = (this.getChild("n9"));
  14143. this.n24 = (this.getChild("n24"));
  14144. this.n27 = (this.getChild("n27"));
  14145. this.titleTxt = (this.getChild("titleTxt"));
  14146. this.n28 = (this.getChild("n28"));
  14147. this.t0 = this.getTransition("t0");
  14148. }
  14149. }
  14150. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14151. class ui_dh_zs_4 extends fgui.GComponent {
  14152. static createInstance() {
  14153. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14154. }
  14155. onConstruct() {
  14156. this.n1 = (this.getChild("n1"));
  14157. this.n2 = (this.getChild("n2"));
  14158. this.n3 = (this.getChild("n3"));
  14159. this.n4 = (this.getChild("n4"));
  14160. this.n5 = (this.getChild("n5"));
  14161. this.n6 = (this.getChild("n6"));
  14162. this.n8 = (this.getChild("n8"));
  14163. this.t0 = this.getTransition("t0");
  14164. }
  14165. }
  14166. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14167. class ui_Component71_1 extends fgui.GButton {
  14168. static createInstance() {
  14169. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14170. }
  14171. onConstruct() {
  14172. this.n17 = (this.getChild("n17"));
  14173. this.t0 = this.getTransition("t0");
  14174. }
  14175. }
  14176. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14177. class ui_Component83 extends fgui.GComponent {
  14178. static createInstance() {
  14179. return (fgui.UIPackage.createObject("game", "Component83"));
  14180. }
  14181. onConstruct() {
  14182. this.c1 = this.getController("c1");
  14183. this.n17 = (this.getChild("n17"));
  14184. this.n19 = (this.getChild("n19"));
  14185. this.n20 = (this.getChild("n20"));
  14186. }
  14187. }
  14188. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14189. class ui_Component84 extends fgui.GComponent {
  14190. static createInstance() {
  14191. return (fgui.UIPackage.createObject("game", "Component84"));
  14192. }
  14193. onConstruct() {
  14194. this.c1 = this.getController("c1");
  14195. this.n4 = (this.getChild("n4"));
  14196. this.n22 = (this.getChild("n22"));
  14197. this.n23 = (this.getChild("n23"));
  14198. this.numTxt = (this.getChild("numTxt"));
  14199. this.n25 = (this.getChild("n25"));
  14200. this.n26 = (this.getChild("n26"));
  14201. }
  14202. }
  14203. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14204. class ui_Component84_1 extends fgui.GComponent {
  14205. static createInstance() {
  14206. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14207. }
  14208. onConstruct() {
  14209. this.c1 = this.getController("c1");
  14210. this.n4 = (this.getChild("n4"));
  14211. this.n22 = (this.getChild("n22"));
  14212. this.n23 = (this.getChild("n23"));
  14213. this.numTxt = (this.getChild("numTxt"));
  14214. this.n25 = (this.getChild("n25"));
  14215. this.n26 = (this.getChild("n26"));
  14216. }
  14217. }
  14218. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14219. class ui_Component85 extends fgui.GComponent {
  14220. static createInstance() {
  14221. return (fgui.UIPackage.createObject("game", "Component85"));
  14222. }
  14223. onConstruct() {
  14224. this.n1 = (this.getChild("n1"));
  14225. this.n6 = (this.getChild("n6"));
  14226. this.n2 = (this.getChild("n2"));
  14227. this.n3 = (this.getChild("n3"));
  14228. this.levelTxt = (this.getChild("levelTxt"));
  14229. this.n10 = (this.getChild("n10"));
  14230. this.n11 = (this.getChild("n11"));
  14231. this.n12 = (this.getChild("n12"));
  14232. this.n13 = (this.getChild("n13"));
  14233. this.n14 = (this.getChild("n14"));
  14234. this.modeNode = (this.getChild("modeNode"));
  14235. this.n18 = (this.getChild("n18"));
  14236. this.conditionTxt = (this.getChild("conditionTxt"));
  14237. this.diamondNode = (this.getChild("diamondNode"));
  14238. this.coinNode = (this.getChild("coinNode"));
  14239. this.startBtn = (this.getChild("startBtn"));
  14240. this.n28 = (this.getChild("n28"));
  14241. this.displayRoot = (this.getChild("displayRoot"));
  14242. this.t0 = this.getTransition("t0");
  14243. }
  14244. }
  14245. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14246. class ui_Component86 extends fgui.GButton {
  14247. static createInstance() {
  14248. return (fgui.UIPackage.createObject("game", "Component86"));
  14249. }
  14250. onConstruct() {
  14251. this.n15 = (this.getChild("n15"));
  14252. this.t0 = this.getTransition("t0");
  14253. }
  14254. }
  14255. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14256. class ui_Component87 extends fgui.GComponent {
  14257. static createInstance() {
  14258. return (fgui.UIPackage.createObject("game", "Component87"));
  14259. }
  14260. onConstruct() {
  14261. this.n66 = (this.getChild("n66"));
  14262. this.myProgress = (this.getChild("myProgress"));
  14263. this.starAni = (this.getChild("starAni"));
  14264. this.hpTxt = (this.getChild("hpTxt"));
  14265. this.n74 = (this.getChild("n74"));
  14266. this.n73 = (this.getChild("n73"));
  14267. this.ballTxt = (this.getChild("ballTxt"));
  14268. this.n76 = (this.getChild("n76"));
  14269. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14270. this.levelTxt = (this.getChild("levelTxt"));
  14271. this.star1 = (this.getChild("star1"));
  14272. this.star2 = (this.getChild("star2"));
  14273. this.star3 = (this.getChild("star3"));
  14274. }
  14275. }
  14276. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14277. class ui_Component88 extends fgui.GProgressBar {
  14278. static createInstance() {
  14279. return (fgui.UIPackage.createObject("game", "Component88"));
  14280. }
  14281. onConstruct() {
  14282. this.n68 = (this.getChild("n68"));
  14283. this.bar = (this.getChild("bar"));
  14284. }
  14285. }
  14286. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14287. class ui_Component89 extends fgui.GComponent {
  14288. static createInstance() {
  14289. return (fgui.UIPackage.createObject("game", "Component89"));
  14290. }
  14291. onConstruct() {
  14292. this.c1 = this.getController("c1");
  14293. this.n71 = (this.getChild("n71"));
  14294. this.n72 = (this.getChild("n72"));
  14295. }
  14296. }
  14297. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14298. class ui_Component90 extends fgui.GComponent {
  14299. static createInstance() {
  14300. return (fgui.UIPackage.createObject("game", "Component90"));
  14301. }
  14302. onConstruct() {
  14303. this.c1 = this.getController("c1");
  14304. this.n64 = (this.getChild("n64"));
  14305. this.n65 = (this.getChild("n65"));
  14306. this.n66 = (this.getChild("n66"));
  14307. this.t0 = this.getTransition("t0");
  14308. }
  14309. }
  14310. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14311. class ui_Component127 extends fgui.GButton {
  14312. static createInstance() {
  14313. return (fgui.UIPackage.createObject("game", "Component127"));
  14314. }
  14315. onConstruct() {
  14316. this.n5 = (this.getChild("n5"));
  14317. }
  14318. }
  14319. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14320. class gameBinder {
  14321. static bindAll() {
  14322. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14323. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14324. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14325. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14326. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14327. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14328. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14329. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14330. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14331. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14332. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14333. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14334. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14335. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14336. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14337. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14338. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14339. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14340. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14341. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14342. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14343. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14344. fgui.UIObjectFactory.setExtension(ui_Component121.URL, ui_Component121);
  14345. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14346. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14347. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14348. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14349. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14350. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14351. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14352. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14353. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14354. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14355. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14356. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14357. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14358. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14359. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14360. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14361. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14362. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14363. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14364. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14365. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14366. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14367. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14368. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14369. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14370. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14371. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14372. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14373. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14374. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14375. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14376. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14377. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14378. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14379. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14380. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14381. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14382. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14383. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14384. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14385. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14386. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14387. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14388. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14389. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14390. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14391. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14392. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14393. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14394. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14395. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14396. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14397. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14398. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14399. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14400. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14401. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14402. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14403. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14404. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14405. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14406. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14407. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14408. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14409. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14410. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14411. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14412. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14413. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14414. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14415. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14416. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14417. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14418. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14419. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14420. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14421. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14422. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14423. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14424. fgui.UIObjectFactory.setExtension(ui_Component16.URL, ui_Component16);
  14425. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14426. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14427. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14428. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14429. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14430. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14431. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14432. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14433. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14434. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14435. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14436. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14437. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14438. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14439. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14440. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14441. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14442. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14443. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14444. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14445. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14446. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14447. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14448. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14449. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14450. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14451. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14452. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14453. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14454. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14455. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14456. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14457. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14458. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14459. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14460. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14461. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14462. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14463. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14464. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14465. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14466. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14467. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14468. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14469. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14470. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14471. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14472. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14473. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14474. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14475. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14476. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14477. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14478. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14479. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14480. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14481. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14482. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14483. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14484. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14485. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14486. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14487. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14488. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14489. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14490. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14491. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14492. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14493. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14494. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14495. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14496. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14497. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14498. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14499. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14500. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14501. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14502. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14503. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14504. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14505. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14506. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14507. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14508. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14509. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14510. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14511. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14512. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14513. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14514. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14515. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14516. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14517. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14518. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14519. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14520. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14521. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14522. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14523. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14524. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14525. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14526. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14527. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14528. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14529. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14530. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14531. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14532. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14533. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14534. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14535. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14536. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14537. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14538. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14539. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14540. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14541. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14542. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14543. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14544. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14545. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14546. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14547. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14548. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14549. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14550. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14551. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14552. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14553. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14554. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14555. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14556. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14557. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14558. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14559. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14560. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14561. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14562. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14563. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14564. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14565. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14566. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14567. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14568. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14569. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14570. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14571. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14572. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14573. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14574. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14575. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14576. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14577. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14578. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14579. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14580. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14581. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14582. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14583. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14584. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14585. }
  14586. }
  14587. class ui_btn6 extends fgui.GButton {
  14588. static createInstance() {
  14589. return (fgui.UIPackage.createObject("loading", "btn6"));
  14590. }
  14591. onConstruct() {
  14592. this.n6 = (this.getChild("n6"));
  14593. this.n1 = (this.getChild("n1"));
  14594. }
  14595. }
  14596. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14597. class ui_xyItem extends fgui.GComponent {
  14598. static createInstance() {
  14599. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14600. }
  14601. onConstruct() {
  14602. this.xyItem = (this.getChild("xyItem"));
  14603. }
  14604. }
  14605. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14606. class ui_loadinfo extends fgui.GProgressBar {
  14607. static createInstance() {
  14608. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14609. }
  14610. onConstruct() {
  14611. this.bg = (this.getChild("bg"));
  14612. this.bar = (this.getChild("bar"));
  14613. this.title = (this.getChild("title"));
  14614. this.ani = (this.getChild("ani"));
  14615. }
  14616. }
  14617. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14618. class ui_xyNode extends fgui.GComponent {
  14619. static createInstance() {
  14620. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14621. }
  14622. onConstruct() {
  14623. this.n0 = (this.getChild("n0"));
  14624. this.btnYes = (this.getChild("btnYes"));
  14625. this.btnNo = (this.getChild("btnNo"));
  14626. this.btnKnown = (this.getChild("btnKnown"));
  14627. this.btnSure = (this.getChild("btnSure"));
  14628. this.txtWelcom = (this.getChild("txtWelcom"));
  14629. this.txtXy = (this.getChild("txtXy"));
  14630. this.n75 = (this.getChild("n75"));
  14631. this.btnXy1 = (this.getChild("btnXy1"));
  14632. this.btnXy3 = (this.getChild("btnXy3"));
  14633. this.btnXy2 = (this.getChild("btnXy2"));
  14634. this.n74 = (this.getChild("n74"));
  14635. this.xy1 = (this.getChild("xy1"));
  14636. this.txtTitle = (this.getChild("txtTitle"));
  14637. this.btnBack = (this.getChild("btnBack"));
  14638. this.xyList = (this.getChild("xyList"));
  14639. this.xy2 = (this.getChild("xy2"));
  14640. this.xyNode = (this.getChild("xyNode"));
  14641. }
  14642. }
  14643. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14644. class ui_ageNode extends fgui.GComponent {
  14645. static createInstance() {
  14646. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14647. }
  14648. onConstruct() {
  14649. this.n3 = (this.getChild("n3"));
  14650. this.n7 = (this.getChild("n7"));
  14651. this.n4 = (this.getChild("n4"));
  14652. this.btnAge = (this.getChild("btnAge"));
  14653. this.ageNode = (this.getChild("ageNode"));
  14654. }
  14655. }
  14656. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14657. class ui_rnNode extends fgui.GComponent {
  14658. static createInstance() {
  14659. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14660. }
  14661. onConstruct() {
  14662. this.n28 = (this.getChild("n28"));
  14663. this.n30 = (this.getChild("n30"));
  14664. this.n33 = (this.getChild("n33"));
  14665. this.rn1 = (this.getChild("rn1"));
  14666. this.n40 = (this.getChild("n40"));
  14667. this.n41 = (this.getChild("n41"));
  14668. this.rn3 = (this.getChild("rn3"));
  14669. this.n37 = (this.getChild("n37"));
  14670. this.n39 = (this.getChild("n39"));
  14671. this.rn2 = (this.getChild("rn2"));
  14672. this.n47 = (this.getChild("n47"));
  14673. this.n49 = (this.getChild("n49"));
  14674. this.n44 = (this.getChild("n44"));
  14675. this.inputCode = (this.getChild("inputCode"));
  14676. this.inputName = (this.getChild("inputName"));
  14677. this.n48 = (this.getChild("n48"));
  14678. this.n50 = (this.getChild("n50"));
  14679. this.rn4 = (this.getChild("rn4"));
  14680. this.btnCheck = (this.getChild("btnCheck"));
  14681. this.btnExit = (this.getChild("btnExit"));
  14682. this.btnDone = (this.getChild("btnDone"));
  14683. this.rnNode = (this.getChild("rnNode"));
  14684. }
  14685. }
  14686. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14687. class ui_tipNode extends fgui.GComponent {
  14688. static createInstance() {
  14689. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14690. }
  14691. onConstruct() {
  14692. this.bg = (this.getChild("bg"));
  14693. this.n55 = (this.getChild("n55"));
  14694. this.n56 = (this.getChild("n56"));
  14695. this.tipNode = (this.getChild("tipNode"));
  14696. }
  14697. }
  14698. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14699. class ui_fcmNode extends fgui.GComponent {
  14700. static createInstance() {
  14701. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14702. }
  14703. onConstruct() {
  14704. this.n63 = (this.getChild("n63"));
  14705. this.n62 = (this.getChild("n62"));
  14706. this.btnRn = (this.getChild("btnRn"));
  14707. this.n61 = (this.getChild("n61"));
  14708. this.n58 = (this.getChild("n58"));
  14709. this.fcmNode = (this.getChild("fcmNode"));
  14710. }
  14711. }
  14712. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14713. class ui_msgNode extends fgui.GComponent {
  14714. static createInstance() {
  14715. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14716. }
  14717. onConstruct() {
  14718. this.n69 = (this.getChild("n69"));
  14719. this.txtMsg = (this.getChild("txtMsg"));
  14720. this.msgNode = (this.getChild("msgNode"));
  14721. }
  14722. }
  14723. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14724. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14725. static createInstance() {
  14726. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14727. }
  14728. onConstruct() {
  14729. this.n1 = (this.getChild("n1"));
  14730. this.n13 = (this.getChild("n13"));
  14731. this.n14 = (this.getChild("n14"));
  14732. this.n15 = (this.getChild("n15"));
  14733. this.n3 = (this.getChild("n3"));
  14734. this.n4 = (this.getChild("n4"));
  14735. this.n5 = (this.getChild("n5"));
  14736. this.n6 = (this.getChild("n6"));
  14737. this.n7 = (this.getChild("n7"));
  14738. this.n8 = (this.getChild("n8"));
  14739. this.n9 = (this.getChild("n9"));
  14740. this.n10 = (this.getChild("n10"));
  14741. this.n12 = (this.getChild("n12"));
  14742. this.n11 = (this.getChild("n11"));
  14743. this.n16 = (this.getChild("n16"));
  14744. this.n17 = (this.getChild("n17"));
  14745. this.n18 = (this.getChild("n18"));
  14746. this.n20 = (this.getChild("n20"));
  14747. this.n21 = (this.getChild("n21"));
  14748. this.t0 = this.getTransition("t0");
  14749. }
  14750. }
  14751. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14752. class ui_btn5 extends fgui.GButton {
  14753. static createInstance() {
  14754. return (fgui.UIPackage.createObject("loading", "btn5"));
  14755. }
  14756. onConstruct() {
  14757. this.n9 = (this.getChild("n9"));
  14758. this.n1 = (this.getChild("n1"));
  14759. }
  14760. }
  14761. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14762. class ui_UILoading extends fgui.GComponent {
  14763. static createInstance() {
  14764. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14765. }
  14766. onConstruct() {
  14767. this.n12 = (this.getChild("n12"));
  14768. this.loadinfo = (this.getChild("loadinfo"));
  14769. this.n13 = (this.getChild("n13"));
  14770. this.txtLoad = (this.getChild("txtLoad"));
  14771. this.n18 = (this.getChild("n18"));
  14772. }
  14773. }
  14774. ui_UILoading.URL = "ui://37nctnhwphc33";
  14775. class ui_AgeItem extends fgui.GComponent {
  14776. static createInstance() {
  14777. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14778. }
  14779. onConstruct() {
  14780. this.txtAge = (this.getChild("txtAge"));
  14781. }
  14782. }
  14783. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14784. class ui_btn1 extends fgui.GButton {
  14785. static createInstance() {
  14786. return (fgui.UIPackage.createObject("loading", "btn1"));
  14787. }
  14788. onConstruct() {
  14789. this.n6 = (this.getChild("n6"));
  14790. this.n1 = (this.getChild("n1"));
  14791. }
  14792. }
  14793. ui_btn1.URL = "ui://37nctnhwxe622p";
  14794. class ui_btn3 extends fgui.GButton {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("loading", "btn3"));
  14797. }
  14798. onConstruct() {
  14799. this.n9 = (this.getChild("n9"));
  14800. this.n1 = (this.getChild("n1"));
  14801. }
  14802. }
  14803. ui_btn3.URL = "ui://37nctnhwxe622s";
  14804. class ui_btn2 extends fgui.GButton {
  14805. static createInstance() {
  14806. return (fgui.UIPackage.createObject("loading", "btn2"));
  14807. }
  14808. onConstruct() {
  14809. this.n6 = (this.getChild("n6"));
  14810. this.n1 = (this.getChild("n1"));
  14811. }
  14812. }
  14813. ui_btn2.URL = "ui://37nctnhwxe622t";
  14814. class ui_btnBack extends fgui.GButton {
  14815. static createInstance() {
  14816. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14817. }
  14818. onConstruct() {
  14819. this.n6 = (this.getChild("n6"));
  14820. this.n7 = (this.getChild("n7"));
  14821. }
  14822. }
  14823. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14824. class ui_btnXy1 extends fgui.GButton {
  14825. static createInstance() {
  14826. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14827. }
  14828. onConstruct() {
  14829. this.n1 = (this.getChild("n1"));
  14830. }
  14831. }
  14832. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14833. class ui_btnXy2 extends fgui.GButton {
  14834. static createInstance() {
  14835. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14836. }
  14837. onConstruct() {
  14838. this.n1 = (this.getChild("n1"));
  14839. }
  14840. }
  14841. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14842. class ui_btnXy3 extends fgui.GButton {
  14843. static createInstance() {
  14844. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14845. }
  14846. onConstruct() {
  14847. this.n1 = (this.getChild("n1"));
  14848. }
  14849. }
  14850. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14851. class ui_btn4 extends fgui.GButton {
  14852. static createInstance() {
  14853. return (fgui.UIPackage.createObject("loading", "btn4"));
  14854. }
  14855. onConstruct() {
  14856. this.n9 = (this.getChild("n9"));
  14857. this.n1 = (this.getChild("n1"));
  14858. }
  14859. }
  14860. ui_btn4.URL = "ui://37nctnhwxe622z";
  14861. class loadingBinder {
  14862. static bindAll() {
  14863. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14864. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14865. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14866. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14867. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14868. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14869. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14870. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14871. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14872. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14873. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14874. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14875. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14876. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14877. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14878. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14879. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14880. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14881. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14882. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14883. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14884. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14885. }
  14886. }
  14887. class UIMgr {
  14888. constructor() {
  14889. this._stage = null;
  14890. this._uiList = [];
  14891. this._showList = [];
  14892. this._bindPkgList = [];
  14893. this.uiIndex = 0;
  14894. }
  14895. static get inst() {
  14896. if (UIMgr._inst == null) {
  14897. UIMgr._inst = new UIMgr();
  14898. }
  14899. return UIMgr._inst;
  14900. }
  14901. setStage(s) {
  14902. if (this._stage) {
  14903. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14904. return;
  14905. }
  14906. this._stage = s;
  14907. }
  14908. init() {
  14909. this.setStage(Laya.stage);
  14910. fairygui.UIConfig.defaultFont = "微软雅黑";
  14911. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14912. fairygui.UIConfig.packageFileExtension = "obj";
  14913. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14914. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14915. fairygui.GRoot.inst.width = Laya.stage.width;
  14916. fairygui.GRoot.inst.height = Laya.stage.height;
  14917. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14918. }
  14919. addAllUpdate() {
  14920. this.uiIndex = 0;
  14921. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14922. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14923. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14924. }
  14925. }
  14926. }
  14927. bindFUI(pkgname) {
  14928. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  14929. return;
  14930. }
  14931. switch (pkgname) {
  14932. case fguiRes.loading:
  14933. fairygui.UIPackage.addPackage(pkgname);
  14934. loadingBinder.bindAll();
  14935. this._bindPkgList.push(pkgname);
  14936. break;
  14937. case fguiRes.game:
  14938. fairygui.UIPackage.addPackage(pkgname);
  14939. gameBinder.bindAll();
  14940. this._bindPkgList.push(pkgname);
  14941. break;
  14942. default:
  14943. break;
  14944. }
  14945. }
  14946. Show(cls, ...param) {
  14947. let nameStr = cls.uiName;
  14948. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14949. let temp = this._uiList[i];
  14950. let str = temp.className;
  14951. if (str == nameStr) {
  14952. if (temp.isMuti) {
  14953. if (temp.isHide) {
  14954. temp.show(...param);
  14955. this._uiList.splice(i, 1);
  14956. this._uiList.push(temp);
  14957. return temp;
  14958. }
  14959. }
  14960. else {
  14961. temp.show(...param);
  14962. this._uiList.splice(i, 1);
  14963. this._uiList.push(temp);
  14964. return temp;
  14965. }
  14966. }
  14967. }
  14968. let ui = new cls();
  14969. ui.className = nameStr;
  14970. this._showUI(ui, param);
  14971. return ui;
  14972. }
  14973. destroyUI(ui) {
  14974. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14975. let temp = this._uiList[i].className;
  14976. if (temp == ui.className) {
  14977. this._uiList.splice(i, 1);
  14978. break;
  14979. }
  14980. }
  14981. this.checkUIState();
  14982. }
  14983. _showUI(ui, param) {
  14984. this._uiList.push(ui);
  14985. ui.show(...param);
  14986. }
  14987. Hide(uiClass) {
  14988. let ui = this.getUI(uiClass);
  14989. if (ui && !ui.isHide) {
  14990. ui.hide();
  14991. }
  14992. }
  14993. getUI(ui) {
  14994. let nameStr = ui.uiName;
  14995. for (let index = 0; index < this._uiList.length; index++) {
  14996. let temp = this._uiList[index];
  14997. if (temp.className == nameStr) {
  14998. return temp;
  14999. }
  15000. }
  15001. return null;
  15002. }
  15003. isShow(cls) {
  15004. for (var i of this._uiList) {
  15005. if (i instanceof cls) {
  15006. return i.isShowing;
  15007. }
  15008. }
  15009. return false;
  15010. }
  15011. showUINum() {
  15012. let num = 0;
  15013. for (var i of this._uiList) {
  15014. if (i.isShowing) {
  15015. num++;
  15016. }
  15017. }
  15018. return num;
  15019. }
  15020. checkUIState() {
  15021. Laya.timer.clear(this, this._uiCheck);
  15022. Laya.timer.once(400, this, this._uiCheck);
  15023. }
  15024. _uiCheck() {
  15025. let showList = [];
  15026. for (var i of this._uiList) {
  15027. if (!i.isHide) {
  15028. showList.push(i);
  15029. }
  15030. }
  15031. for (let index = 0; index < showList.length; index++) {
  15032. if (index == showList.length - 1) {
  15033. showList[index].checkActive(true);
  15034. }
  15035. else {
  15036. showList[index].checkActive(false);
  15037. }
  15038. }
  15039. }
  15040. showTip(msg, time = 600, size = 30) {
  15041. }
  15042. }
  15043. class UIShowList {
  15044. }
  15045. class SoundMgr {
  15046. constructor() {
  15047. this.soundMax = 4;
  15048. this.isLoad = false;
  15049. this.soundMap = {};
  15050. this.isSound = true;
  15051. this.openShake = true;
  15052. SoundMgr._instance = this;
  15053. }
  15054. static getInstance() {
  15055. if (!this._instance) {
  15056. this._instance = new SoundMgr();
  15057. }
  15058. return this._instance;
  15059. }
  15060. init() {
  15061. console.log('zh:sm init 1');
  15062. Laya.SoundManager.autoReleaseSound = true;
  15063. Laya.SoundManager.autoStopMusic = true;
  15064. Laya.SoundManager.musicVolume = 0.3;
  15065. Laya.SoundManager.soundVolume = 0.5;
  15066. this.musicPlayed = false;
  15067. this.audioUrl = "asset/sound/ogg/";
  15068. console.log('zh:sm init 2');
  15069. console.log('zh:dev type ');
  15070. if (Laya.Browser.onAndroid) {
  15071. console.log('zh:dev type android');
  15072. this.audioUrl = "asset/sound/ogg/";
  15073. this.isLoad = true;
  15074. }
  15075. else {
  15076. console.log('zh:dev type not android');
  15077. this.audioUrl = "asset/sound/mp3/";
  15078. this.isLoad = true;
  15079. }
  15080. }
  15081. onSetting(isS) {
  15082. this.isSound = isS;
  15083. this.mute(!this.isSound);
  15084. }
  15085. clearCount() {
  15086. for (var key in this.soundMap) {
  15087. delete this.soundMap[key];
  15088. }
  15089. }
  15090. playMusic(path, loop = 0) {
  15091. console.log('zh:playMusic 1 PATH=' + path);
  15092. this.musicPath = path;
  15093. if (!this.isLoad)
  15094. console.log('zh:playMusic 2');
  15095. return;
  15096. if (!path || path == "")
  15097. console.log('zh:playMusic 3');
  15098. return;
  15099. if (!this.isSound)
  15100. console.log('zh:playMusic 4');
  15101. return;
  15102. this.musicPlayed = true;
  15103. console.log('zh:playMusic 5');
  15104. let url = this.getUrl(path);
  15105. console.log('zh:playMusic 6' + url);
  15106. if (Laya.Browser.onPC) {
  15107. console.log('zh:playMusic 7');
  15108. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15109. console.log('zh:playMusic 8');
  15110. this.play(url, loop);
  15111. }));
  15112. }
  15113. else
  15114. this.play(url, loop);
  15115. }
  15116. play(url, loop) {
  15117. Laya.SoundManager.playMusic(url, loop);
  15118. }
  15119. getUrl(path) {
  15120. let url = this.audioUrl + path;
  15121. if (Laya.Browser.onAndroid) {
  15122. url += ".ogg";
  15123. }
  15124. else {
  15125. url += ".mp3";
  15126. }
  15127. return url;
  15128. }
  15129. pauseMusic(pause) {
  15130. if (pause) {
  15131. this.mute(true);
  15132. }
  15133. else if (this.isSound)
  15134. this.mute(false);
  15135. }
  15136. stopMusic() {
  15137. Laya.SoundManager.stopMusic();
  15138. if (Moyu.isNeedPlatAudio) {
  15139. Moyu.stopMusic();
  15140. }
  15141. }
  15142. mute(mute) {
  15143. if (Moyu.isNeedPlatAudio) {
  15144. Moyu.pauseMusic(mute);
  15145. }
  15146. else {
  15147. Laya.SoundManager.musicMuted = mute;
  15148. if (!mute && !this.musicPlayed && this.musicPath) {
  15149. this.playMusic(this.musicPath);
  15150. }
  15151. }
  15152. }
  15153. stopSound(path) {
  15154. let url = this.getUrl(path);
  15155. Laya.SoundManager.stopSound(url);
  15156. }
  15157. playSound(path, loop = 1, soundMax = this.soundMax) {
  15158. if (!this.isLoad)
  15159. return;
  15160. if (!this.isSound)
  15161. return;
  15162. if (!path || path == "")
  15163. return;
  15164. let url = this.getUrl(path);
  15165. if (Moyu.isNeedPlatAudio) {
  15166. Moyu.playSound(path, loop == 0);
  15167. }
  15168. else {
  15169. let count = 1;
  15170. if (this.soundMap[path])
  15171. count = this.soundMap[path] + 1;
  15172. if (count > soundMax)
  15173. return;
  15174. this.soundMap[path] = count;
  15175. Laya.SoundManager.playSound(url, loop);
  15176. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15177. }
  15178. }
  15179. removePath(path) {
  15180. if (this.soundMap[path]) {
  15181. let count = this.soundMap[path];
  15182. count--;
  15183. if (count < 1)
  15184. delete this.soundMap[path];
  15185. else
  15186. this.soundMap[path] = count;
  15187. }
  15188. }
  15189. playBtnSound() {
  15190. this.playSound("btn");
  15191. }
  15192. playGetSound() {
  15193. }
  15194. playCloseUISound() {
  15195. }
  15196. }
  15197. SoundMgr._instance = null;
  15198. var Handler$1 = Laya.Handler;
  15199. var EResType;
  15200. (function (EResType) {
  15201. EResType[EResType["none"] = 0] = "none";
  15202. EResType[EResType["nromal"] = 1] = "nromal";
  15203. EResType[EResType["td"] = 2] = "td";
  15204. EResType[EResType["sk"] = 3] = "sk";
  15205. })(EResType || (EResType = {}));
  15206. class CResLoader {
  15207. constructor(doneCall, proCall) {
  15208. this.completrCall = doneCall;
  15209. this.progressCall = proCall;
  15210. this.progressHander = new Handler$1(this, this.onProgress);
  15211. this.tdResMap = {};
  15212. }
  15213. load(resList) {
  15214. this.resCount = 0;
  15215. this.loadCount = 0;
  15216. for (let i = 0; i < resList.length; i++) {
  15217. let path = resList[i];
  15218. if (!path)
  15219. continue;
  15220. this.resCount++;
  15221. let type = this.getResType(path);
  15222. if (type == EResType.nromal)
  15223. this.loadNromal(path);
  15224. else if (type == EResType.td)
  15225. this.loadTd(path);
  15226. }
  15227. }
  15228. getRes(path) {
  15229. let type = this.getResType(path);
  15230. if (type == EResType.nromal)
  15231. return Laya.loader.getRes(path);
  15232. else if (type == EResType.td) {
  15233. let res = this.tdResMap[path];
  15234. if (res)
  15235. return res.clone();
  15236. return null;
  15237. }
  15238. }
  15239. destroy() {
  15240. this.progressHander.clear();
  15241. this.progressHander = null;
  15242. }
  15243. clearRes(path) {
  15244. let type = this.getResType(path);
  15245. if (type == EResType.nromal)
  15246. Laya.loader.clearRes(path);
  15247. else if (type == EResType.td) {
  15248. let obj = this.tdResMap[path];
  15249. if (obj)
  15250. obj.destroy();
  15251. delete this.tdResMap[path];
  15252. }
  15253. }
  15254. getResType(path) {
  15255. let exs = this.getExtension(path);
  15256. if (exs == "sk")
  15257. return EResType.sk;
  15258. if (exs == "ls" || exs == "lh" || exs == "lm")
  15259. return EResType.td;
  15260. else
  15261. return EResType.nromal;
  15262. }
  15263. getExtension(res) {
  15264. var index = res.lastIndexOf(".");
  15265. return res.substr(index + 1);
  15266. }
  15267. loadNromal(path) {
  15268. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15269. if (res) {
  15270. this.onLoad();
  15271. }
  15272. else
  15273. console.log("load res fail:" + path);
  15274. }), this.progressHander);
  15275. }
  15276. loadSk() {
  15277. }
  15278. loadTd(path) {
  15279. if (this.tdResMap[path]) {
  15280. this.onLoad();
  15281. return;
  15282. }
  15283. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15284. if (res) {
  15285. this.tdResMap[path] = res;
  15286. this.onLoad();
  15287. }
  15288. else
  15289. console.log("load res fail:" + path);
  15290. }));
  15291. }
  15292. onLoad() {
  15293. this.loadCount++;
  15294. this.onProgress(1);
  15295. if (this.loadCount >= this.resCount) {
  15296. this.completrCall.run();
  15297. }
  15298. }
  15299. onProgress(pro) {
  15300. let progress = (this.loadCount + pro) / this.resCount;
  15301. this.progressCall.runWith(progress);
  15302. }
  15303. }
  15304. var Handler$2 = Laya.Handler;
  15305. class ResInfo {
  15306. constructor() {
  15307. this.index = 0;
  15308. }
  15309. }
  15310. class ResMgr {
  15311. constructor() {
  15312. this.resList = [];
  15313. this.doneList = [];
  15314. this.resMap = {};
  15315. this.currentLoad = null;
  15316. this.completeHandler = new Handler$2(this, this.onComplete);
  15317. this.progressHandler = new Handler$2(this, this.onProgress);
  15318. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15319. }
  15320. static getInstance() {
  15321. if (ResMgr._instance == null) {
  15322. ResMgr._instance = new ResMgr();
  15323. }
  15324. return ResMgr._instance;
  15325. }
  15326. loadList(list, completeHandler, progressHandler) {
  15327. if (list.length < 1) {
  15328. completeHandler.run();
  15329. return;
  15330. }
  15331. let info = this.getResInfo();
  15332. info.resList = list;
  15333. info.completeHandler = completeHandler;
  15334. info.progressHandler = progressHandler;
  15335. this.resList.push(info);
  15336. this.startLoad();
  15337. }
  15338. loadFguiRes(list, completeHandler, progressHandler) {
  15339. Laya.loader.load(list, completeHandler, progressHandler);
  15340. }
  15341. loadAny(list, completeHandler, progressHandler) {
  15342. Laya.loader.load(list, completeHandler, progressHandler);
  15343. }
  15344. load(path, completeHandler, progressHandler) {
  15345. let count = this.resMap[path];
  15346. if (count && count > 0) {
  15347. if (completeHandler)
  15348. completeHandler.run();
  15349. }
  15350. else
  15351. this.loadList([path], completeHandler, progressHandler);
  15352. }
  15353. getRes(path) {
  15354. let res = this.resMap[path];
  15355. if (!res)
  15356. this.showLog("资源不存在:" + path);
  15357. else
  15358. return this.loader.getRes(path);
  15359. }
  15360. clearList(list, force = false) {
  15361. if (!list || list.length < 1)
  15362. return;
  15363. let cr = () => {
  15364. for (const k in list) {
  15365. let v = list[k];
  15366. if (!v)
  15367. continue;
  15368. if (force) {
  15369. this.loader.clearRes(v);
  15370. delete this.resMap[v];
  15371. }
  15372. else {
  15373. let count = this.resMap[v];
  15374. if (count && count > 1) {
  15375. count--;
  15376. this.resMap[v] = count;
  15377. }
  15378. else {
  15379. this.loader.clearRes(v);
  15380. delete this.resMap[v];
  15381. }
  15382. }
  15383. }
  15384. if (!window.hasOwnProperty("ks"))
  15385. Laya.Resource.destroyUnusedResources();
  15386. };
  15387. Laya.timer.clearAll(this);
  15388. Laya.timer.once(2000, this, cr);
  15389. }
  15390. clear3D() {
  15391. for (const k in this.loader.tdResMap) {
  15392. this.loader.clearRes(k);
  15393. if (this.resMap[k])
  15394. delete this.resMap[k];
  15395. }
  15396. if (!window.hasOwnProperty("ks"))
  15397. Laya.Resource.destroyUnusedResources();
  15398. }
  15399. clear(path, force = false) {
  15400. this.clearList([path], force);
  15401. }
  15402. getResInfo() {
  15403. if (this.doneList.length > 0)
  15404. return this.doneList.pop();
  15405. else
  15406. return new ResInfo();
  15407. }
  15408. startLoad() {
  15409. if (this.currentLoad)
  15410. return;
  15411. this.currentLoad = this.resList.pop();
  15412. if (this.currentLoad) {
  15413. this.loader.load(this.currentLoad.resList);
  15414. }
  15415. }
  15416. onComplete() {
  15417. if (!this.currentLoad)
  15418. return;
  15419. for (const k in this.currentLoad.resList) {
  15420. let v = this.currentLoad.resList[k];
  15421. let count = this.resMap[v];
  15422. if (count)
  15423. count++;
  15424. else
  15425. count = 1;
  15426. this.resMap[v] = count;
  15427. }
  15428. if (this.currentLoad.completeHandler)
  15429. this.currentLoad.completeHandler.run();
  15430. this.doneList.push(this.currentLoad);
  15431. this.currentLoad = null;
  15432. this.startLoad();
  15433. }
  15434. onProgress(pro) {
  15435. if (!this.currentLoad)
  15436. return;
  15437. if (this.currentLoad.progressHandler)
  15438. this.currentLoad.progressHandler.runWith(pro);
  15439. }
  15440. showLog(str, ...args) {
  15441. console.log("[ResLoader] " + str);
  15442. }
  15443. }
  15444. ResMgr._instance = null;
  15445. class EventMgr extends Laya.EventDispatcher {
  15446. }
  15447. let eventMgr = new EventMgr();
  15448. class ConfigMgr {
  15449. static getInstance() {
  15450. if (!this._instance) {
  15451. this._instance = new ConfigMgr();
  15452. }
  15453. return this._instance;
  15454. }
  15455. init() {
  15456. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15457. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15458. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15459. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15460. }
  15461. getUserInfoByIndex(index) {
  15462. return this.npcJson[index];
  15463. }
  15464. getRandomUserInfo() {
  15465. let index = xGame.tools.random(0, this.npcJson.length);
  15466. return this.npcJson[index];
  15467. }
  15468. getMaxBigMoveLength() {
  15469. return Object.keys(this.levelCfg).length;
  15470. }
  15471. getBigMoveLevelByIndex(index) {
  15472. let cfg = this.levelCfg;
  15473. cfg = cfg[index];
  15474. return cfg;
  15475. }
  15476. getRandomClassicLevel() {
  15477. let cfg = this.classicCfg;
  15478. let num = Object.keys(cfg).length;
  15479. let rand = xGame.common.randomNum(1, num);
  15480. return cfg[rand];
  15481. }
  15482. getPlaceBallByLevel(level) {
  15483. return this.placeBallCfg[level];
  15484. }
  15485. getMaxPlaceBall() {
  15486. return Object.keys(this.placeBallCfg).length;
  15487. }
  15488. }
  15489. class PoolD3Mgr {
  15490. constructor() {
  15491. this.pool = {};
  15492. }
  15493. static get ins() {
  15494. return this._ins || (this._ins = new PoolD3Mgr);
  15495. }
  15496. createList(key, prefab, parent) {
  15497. if (!this.pool[key]) {
  15498. this.pool[key] = {};
  15499. this.pool[key].prefab = prefab;
  15500. this.pool[key].list = [];
  15501. this.pool[key].parent = parent;
  15502. }
  15503. }
  15504. getItem(key) {
  15505. if (!this.pool[key]) {
  15506. return;
  15507. }
  15508. let temp;
  15509. if (this.pool[key].list.length > 0) {
  15510. temp = this.pool[key].list.pop();
  15511. }
  15512. else {
  15513. temp = this.pool[key].prefab.clone();
  15514. if (this.pool[key].parent) {
  15515. this.pool[key].parent.addChild(temp);
  15516. }
  15517. }
  15518. temp.active = true;
  15519. return temp;
  15520. }
  15521. putItem(key, obj) {
  15522. if (!this.pool[key]) {
  15523. return;
  15524. }
  15525. obj.active = false;
  15526. this.pool[key].list.push(obj);
  15527. }
  15528. }
  15529. let context$1 = context;
  15530. let uiMgr = UIMgr.inst;
  15531. let soundMgr = SoundMgr.getInstance();
  15532. let resMgr = ResMgr.getInstance();
  15533. let httpMgr = HttpMgr.getInstance();
  15534. let common = Common.getInstance();
  15535. let cfgMgr = ConfigMgr.getInstance();
  15536. let poolD3Mgr = PoolD3Mgr.ins;
  15537. let d3TexUrl = "res/d3Res/";
  15538. let d3ModeUrl = "res/unityRes/";
  15539. function setStageSize(view) {
  15540. if (view.width) {
  15541. view.width = Laya.stage.width;
  15542. view.height = Laya.stage.height;
  15543. }
  15544. }
  15545. function filledBg(view) {
  15546. let wh = Laya.stage.height / Laya.stage.width;
  15547. if (wh > 16 / 9) {
  15548. view.height = Laya.stage.height;
  15549. view.width = Laya.stage.height / 1334 * 750;
  15550. }
  15551. else {
  15552. view.width = Laya.stage.width;
  15553. view.height = Laya.stage.width / 750 * 1334;
  15554. }
  15555. }
  15556. function setNotch(view) {
  15557. if (view.height) {
  15558. view.y += context$1.notchHeight;
  15559. }
  15560. }
  15561. function showTip(str) {
  15562. uiMgr.Show(UIMsg, str);
  15563. }
  15564. function log(...args) {
  15565. console.log(args);
  15566. }
  15567. let xGame = {
  15568. context: context$1,
  15569. eventMgr,
  15570. resMgr,
  15571. uiMgr,
  15572. soundMgr,
  15573. define,
  15574. tools,
  15575. httpMgr,
  15576. d3TexUrl,
  15577. d3ModeUrl,
  15578. common,
  15579. cfgMgr,
  15580. poolD3Mgr,
  15581. setStageSize,
  15582. filledBg,
  15583. setNotch,
  15584. showTip,
  15585. log,
  15586. };
  15587. window["xGame"] = xGame;
  15588. let dataName = 'tBall_';
  15589. class UserData {
  15590. constructor() {
  15591. this.userId = "";
  15592. this.isAgree = false;
  15593. this.coinNum = 0;
  15594. this.gemNum = 0;
  15595. this.sound = true;
  15596. this.vibration = true;
  15597. this.currentDate = 0;
  15598. this.createTime = 0;
  15599. this.awardTime = 0;
  15600. this.roleId = 1;
  15601. this.roleList = [];
  15602. this.roleAds = [];
  15603. this.dressId = 101;
  15604. this.itemId = 201;
  15605. this.bigSkills = [1, 1, 1, 1, 1];
  15606. this.coin = 4000;
  15607. this.diamond = 0;
  15608. this.skillSuccessTimes = 0;
  15609. this.skillGuide = 0;
  15610. this.skillAccTimes = 0;
  15611. this.placeBallData = [];
  15612. this.shareDiamondTimes = 0;
  15613. this.dailyVideoShareTimes = 0;
  15614. this.secretary = [1, 0];
  15615. this.curSecretary = 0;
  15616. this.ballRod = [1, 0, 0, 0, 0, 1];
  15617. this.curBallRod = 5;
  15618. this.signData = 0;
  15619. this.signTime = 0;
  15620. this.drawTimes = 0;
  15621. this.drawAwardTimes = 0;
  15622. this.dailyfreeDrawTimes = 1;
  15623. this.power = 5;
  15624. this.powerTime = 0;
  15625. this.challengeTimes = 0;
  15626. this.extraSign = 0;
  15627. this.classicTimes = 0;
  15628. this.guideHelpLine = 0;
  15629. this.newUser = true;
  15630. this.rootBallFoul = 0;
  15631. this.timeoutFoul = 0;
  15632. this.roleList = [1];
  15633. }
  15634. saveData() {
  15635. let data = {};
  15636. for (let k in this) {
  15637. data[k.toString()] = this[k];
  15638. }
  15639. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15640. }
  15641. getData() {
  15642. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15643. if (ld) {
  15644. let localData = JSON.parse(ld);
  15645. if (localData) {
  15646. for (let k in this) {
  15647. let key = k.toString();
  15648. let data = localData[key];
  15649. if (data != undefined) {
  15650. this[k] = data;
  15651. }
  15652. }
  15653. }
  15654. }
  15655. }
  15656. }
  15657. class ItemData {
  15658. constructor() {
  15659. this.itemList = {};
  15660. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15661. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15662. }
  15663. saveData() {
  15664. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15665. }
  15666. getData() {
  15667. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15668. if (ld) {
  15669. let localData = JSON.parse(ld);
  15670. if (localData) {
  15671. this.itemList = localData;
  15672. }
  15673. }
  15674. }
  15675. }
  15676. class GameData {
  15677. constructor() {
  15678. this.curLevel = 0;
  15679. this.gameType = 1;
  15680. this.signIdx = 0;
  15681. this.signMax = 0;
  15682. this.rotaryTime = 0;
  15683. this.rotaryCount = 0;
  15684. this.rotaryList = [];
  15685. this.diyCount = 3;
  15686. this.awardIdx = 0;
  15687. this.shareNum = 2;
  15688. this.rankWeek = 0;
  15689. this.rankScore = 0;
  15690. this.gameCount = 0;
  15691. this.trySkill = -1;
  15692. this.tryTime = 0;
  15693. }
  15694. saveData() {
  15695. let data = {};
  15696. for (let k in this) {
  15697. data[k.toString()] = this[k];
  15698. }
  15699. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15700. }
  15701. getData() {
  15702. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15703. if (ld) {
  15704. let localData = JSON.parse(ld);
  15705. if (localData) {
  15706. for (let k in this) {
  15707. let key = k.toString();
  15708. let data = localData[key];
  15709. if (data != undefined) {
  15710. this[k] = data;
  15711. }
  15712. }
  15713. }
  15714. }
  15715. }
  15716. }
  15717. class DataMgr {
  15718. static Init() {
  15719. this.userData = new UserData();
  15720. this.gameData = new GameData();
  15721. this.itemData = new ItemData();
  15722. this.userData.getData();
  15723. this.gameData.getData();
  15724. this.itemData.getData();
  15725. this.roleId = this.userData.roleId;
  15726. this.resetUse();
  15727. }
  15728. static isNewDay() {
  15729. Moyu.isNewDay(this, (isnew) => {
  15730. xGame.common.isNewDay = isnew;
  15731. if (!isnew)
  15732. return;
  15733. DataMgr.setShareDiamondTimes(0, false);
  15734. DataMgr.setDailyVideoShareTimes(0, false);
  15735. DataMgr.setDailyfreeDrawTimes(1);
  15736. DataMgr.setExtraSign(0);
  15737. });
  15738. }
  15739. static deletData() {
  15740. Laya.LocalStorage.clear();
  15741. }
  15742. static upRankData() {
  15743. let num = xGame.common.getAllStarNum();
  15744. if (num > 0)
  15745. Moyu.upRankData(xGame.common.curRankID, num);
  15746. }
  15747. static addItem(id, count = 1) {
  15748. let v = this.itemData.itemList[id];
  15749. if (!v)
  15750. v = { id: id, count: count, adnum: 0, active: true };
  15751. else {
  15752. if (v.active) {
  15753. v.count += count;
  15754. }
  15755. else {
  15756. v.count = count;
  15757. v.active = true;
  15758. }
  15759. }
  15760. this.itemData.itemList[id] = v;
  15761. xGame.soundMgr.playGetSound();
  15762. this.saveItemData();
  15763. }
  15764. static hasItem(id) {
  15765. let v = this.itemData.itemList[id];
  15766. if (v && v.active)
  15767. return true;
  15768. return false;
  15769. }
  15770. static getItem(id) {
  15771. let v = this.itemData.itemList[id];
  15772. return v;
  15773. }
  15774. static getItemCount(id) {
  15775. let v = this.itemData.itemList[id];
  15776. if (v && v.active)
  15777. return v.count;
  15778. return 0;
  15779. }
  15780. static getItemAd(id) {
  15781. let v = this.itemData.itemList[id];
  15782. if (v) {
  15783. return v.adnum;
  15784. }
  15785. return 0;
  15786. }
  15787. static onItemAd(id, num = 1) {
  15788. let v = this.itemData.itemList[id];
  15789. if (!v)
  15790. v = { id: id, count: 1, adnum: num, active: false };
  15791. else
  15792. v.adnum += num;
  15793. this.itemData.itemList[id] = v;
  15794. this.saveItemData();
  15795. }
  15796. static costItem(id, count) {
  15797. let v = this.itemData.itemList[id];
  15798. if (v && v.active) {
  15799. if (v.count < count)
  15800. return false;
  15801. else {
  15802. v.count -= count;
  15803. this.itemData.itemList[id] = v;
  15804. return true;
  15805. }
  15806. }
  15807. return false;
  15808. }
  15809. static resetUse() {
  15810. this.dressId = this.userData.dressId;
  15811. this.itemId = this.userData.itemId;
  15812. }
  15813. static passLevel() {
  15814. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15815. this.gameData.curLevel++;
  15816. this.curLevel = this.gameData.curLevel;
  15817. this.saveGameData();
  15818. }
  15819. static useRole(id) {
  15820. this.roleId = id;
  15821. if (this.hasRole(id)) {
  15822. this.userData.roleId = id;
  15823. this.saveUserData();
  15824. }
  15825. }
  15826. static addRole(id) {
  15827. if (this.hasRole(id))
  15828. return;
  15829. this.userData.roleList.push(id);
  15830. this.saveUserData();
  15831. }
  15832. static hasRole(id) {
  15833. return this.userData.roleList.indexOf(id) >= 0;
  15834. }
  15835. static gemEnough(num) {
  15836. return this.userData.gemNum >= num;
  15837. }
  15838. static roleHasAd(id) {
  15839. let count = this.userData.roleAds[id];
  15840. if (count != undefined && count >= 0)
  15841. return true;
  15842. else
  15843. return false;
  15844. }
  15845. static saveUserData(time = 1000, event, arg) {
  15846. if (this.userSaving)
  15847. return;
  15848. this.userSaving = true;
  15849. Laya.timer.once(time, this, () => {
  15850. this.userSaving = false;
  15851. this.userData.saveData();
  15852. if (event)
  15853. xGame.eventMgr.event(event, arg);
  15854. });
  15855. }
  15856. static saveGameData() {
  15857. if (this.gameSaving)
  15858. return;
  15859. this.gameSaving = true;
  15860. Laya.timer.once(1000, this, () => {
  15861. this.gameSaving = false;
  15862. this.gameData.saveData();
  15863. });
  15864. }
  15865. static saveItemData() {
  15866. let fun = () => {
  15867. this.itemData.saveData();
  15868. };
  15869. Laya.timer.clear(this, fun);
  15870. Laya.timer.once(500, this, fun);
  15871. }
  15872. static saveData() {
  15873. this.saveUserData();
  15874. this.saveGameData();
  15875. }
  15876. static getBigSkillList() {
  15877. return this.userData.bigSkills;
  15878. }
  15879. static getBigSkillByIndex(index) {
  15880. return this.userData.bigSkills[index];
  15881. }
  15882. static setBigSkill(index, val, addUp = true) {
  15883. if (addUp) {
  15884. this.userData.bigSkills[index] += val;
  15885. }
  15886. else {
  15887. this.userData.bigSkills[index] = val;
  15888. }
  15889. this.saveUserData();
  15890. }
  15891. static coinEnough(need) {
  15892. if (typeof need != "number") {
  15893. console.error("金币格式错误");
  15894. return;
  15895. }
  15896. return this.userData.coin >= need;
  15897. }
  15898. static setCoin(val) {
  15899. if (typeof val != "number") {
  15900. return;
  15901. }
  15902. this.userData.coin += val;
  15903. this.saveUserData();
  15904. xGame.eventMgr.event(COIN_CHANGE);
  15905. }
  15906. static getCoin() {
  15907. return this.userData.coin;
  15908. }
  15909. static diamondEnough(need) {
  15910. if (typeof need != "number") {
  15911. console.error("金币格式错误");
  15912. return;
  15913. }
  15914. return this.userData.diamond >= need;
  15915. }
  15916. static setDiamond(val) {
  15917. if (typeof val != "number") {
  15918. return;
  15919. }
  15920. this.userData.diamond += val;
  15921. this.saveUserData();
  15922. xGame.eventMgr.event(DIAMOND_CHANGE);
  15923. }
  15924. static getDiamond() {
  15925. return this.userData.diamond;
  15926. }
  15927. static getSkillSuccessTimes() {
  15928. return this.userData.skillSuccessTimes;
  15929. }
  15930. static setSkillSuccessTimes(val, addUp = true) {
  15931. if (addUp)
  15932. this.userData.skillSuccessTimes += val;
  15933. else
  15934. this.userData.skillSuccessTimes = val;
  15935. this.saveUserData();
  15936. }
  15937. static getSkillAccTimes() {
  15938. return this.userData.skillAccTimes;
  15939. }
  15940. static setSkillAccTimes(val) {
  15941. this.userData.skillAccTimes += val;
  15942. this.saveUserData();
  15943. }
  15944. static getSkillGuide() {
  15945. if (!xGame.common.openGuide) {
  15946. return 1;
  15947. }
  15948. return this.userData.skillGuide;
  15949. }
  15950. static setSkillGuide(val) {
  15951. this.userData.skillGuide = val;
  15952. this.saveUserData();
  15953. }
  15954. static getPlaceBallLevelList() {
  15955. return this.userData.placeBallData;
  15956. }
  15957. static getPlaceBallLevel(level) {
  15958. let arr = this.userData.placeBallData;
  15959. let index = level - 1;
  15960. let out;
  15961. if (arr[index]) {
  15962. out = arr[index];
  15963. }
  15964. else {
  15965. let max = arr.length;
  15966. if (max == index) {
  15967. out = {
  15968. star: 0,
  15969. play: true,
  15970. isCur: true,
  15971. getAward: false
  15972. };
  15973. }
  15974. else {
  15975. out = {
  15976. star: 0,
  15977. play: false,
  15978. getAward: false
  15979. };
  15980. }
  15981. }
  15982. return out;
  15983. }
  15984. static setPlaceBallLevel(level, star) {
  15985. let arr = this.userData.placeBallData;
  15986. let index = level - 1;
  15987. if (arr[index]) {
  15988. arr[index].star = Math.max(arr[index].star, star);
  15989. }
  15990. else {
  15991. let max = arr.length;
  15992. if (max == index) {
  15993. arr.push({
  15994. star: star,
  15995. play: true,
  15996. getAward: false
  15997. });
  15998. }
  15999. else {
  16000. console.error("关卡存储出错");
  16001. }
  16002. }
  16003. this.saveUserData();
  16004. }
  16005. static setPlaceBallAward(level) {
  16006. let arr = this.userData.placeBallData;
  16007. let index = level - 1;
  16008. if (arr[index]) {
  16009. arr[index].getAward = true;
  16010. }
  16011. this.saveUserData();
  16012. }
  16013. static getShareDiamondTimes() {
  16014. return this.userData.shareDiamondTimes;
  16015. }
  16016. static setShareDiamondTimes(val, addUp = true) {
  16017. if (addUp) {
  16018. this.userData.shareDiamondTimes += val;
  16019. }
  16020. else {
  16021. this.userData.shareDiamondTimes = val;
  16022. }
  16023. this.saveUserData();
  16024. }
  16025. static getDailyVideoShareTimes() {
  16026. return this.userData.dailyVideoShareTimes;
  16027. }
  16028. static setDailyVideoShareTimes(val, addUp = true) {
  16029. if (addUp) {
  16030. this.userData.dailyVideoShareTimes += val;
  16031. }
  16032. else {
  16033. this.userData.dailyVideoShareTimes = val;
  16034. }
  16035. this.saveUserData();
  16036. }
  16037. static getSecretary(index) {
  16038. return this.userData.secretary[index];
  16039. }
  16040. static setSecretary(index, val) {
  16041. this.userData.secretary[index] = val;
  16042. this.saveUserData();
  16043. }
  16044. static getCurSecretary() {
  16045. return this.userData.curSecretary;
  16046. }
  16047. static setCurSecretary(index) {
  16048. this.userData.curSecretary = index;
  16049. this.saveUserData();
  16050. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16051. }
  16052. static getBallRod(index) {
  16053. return this.userData.ballRod[index];
  16054. }
  16055. static setBallRod(index, val) {
  16056. this.userData.ballRod[index] = val;
  16057. this.saveUserData();
  16058. }
  16059. static getCurBallRod() {
  16060. return this.userData.curBallRod;
  16061. }
  16062. static setCurBallRod(index) {
  16063. this.userData.curBallRod = index;
  16064. this.saveUserData();
  16065. }
  16066. static setSignData(val) {
  16067. this.userData.signData = val;
  16068. this.saveUserData();
  16069. }
  16070. static getSignData() {
  16071. return this.userData.signData;
  16072. }
  16073. static setSignTime(val) {
  16074. this.userData.signTime = val;
  16075. this.saveUserData();
  16076. }
  16077. static getSignTime() {
  16078. return this.userData.signTime;
  16079. }
  16080. static getDrawTimes() {
  16081. return this.userData.drawTimes;
  16082. }
  16083. static setDrawTimes(val, addUp = true) {
  16084. if (addUp) {
  16085. this.userData.drawTimes += val;
  16086. }
  16087. else {
  16088. this.userData.drawTimes = val;
  16089. }
  16090. this.saveUserData();
  16091. }
  16092. static getDrawAwardTimes() {
  16093. return this.userData.drawAwardTimes;
  16094. }
  16095. static setDrawAwardTimes(val) {
  16096. this.userData.drawAwardTimes = val;
  16097. this.saveUserData();
  16098. }
  16099. static getDailyfreeDrawTimes() {
  16100. return this.userData.dailyfreeDrawTimes;
  16101. }
  16102. static setDailyfreeDrawTimes(val) {
  16103. this.userData.dailyfreeDrawTimes = val;
  16104. this.saveUserData();
  16105. }
  16106. static setPower(val, addUp = true) {
  16107. if (addUp)
  16108. this.userData.power += val;
  16109. else
  16110. this.userData.power = val;
  16111. if (this.userData.power >= xGame.common.maxPower) {
  16112. this.userData.power = xGame.common.maxPower;
  16113. }
  16114. xGame.eventMgr.event(POWER_CHANGE, val);
  16115. this.saveUserData();
  16116. }
  16117. static getPower() {
  16118. return this.userData.power;
  16119. }
  16120. static setPowerTime(val) {
  16121. this.userData.powerTime = val;
  16122. this.saveUserData();
  16123. }
  16124. static getPowerTime() {
  16125. return this.userData.powerTime;
  16126. }
  16127. static powerEnough() {
  16128. return this.getPower() > 0;
  16129. }
  16130. static getChallengeTimes() {
  16131. return this.userData.challengeTimes;
  16132. }
  16133. static setChallengeTimes(val) {
  16134. this.userData.challengeTimes += val;
  16135. this.saveUserData();
  16136. }
  16137. static getExtraSign() {
  16138. return this.userData.extraSign;
  16139. }
  16140. static setExtraSign(val) {
  16141. this.userData.extraSign = val;
  16142. this.saveUserData();
  16143. }
  16144. static getClassicTimes() {
  16145. return this.userData.classicTimes;
  16146. }
  16147. static setClassicTimes() {
  16148. this.userData.classicTimes += 1;
  16149. this.saveUserData();
  16150. }
  16151. static getGuideHelpLine() {
  16152. return this.userData.guideHelpLine;
  16153. }
  16154. static setGuideHelpLine() {
  16155. this.userData.guideHelpLine = 1;
  16156. this.saveUserData();
  16157. }
  16158. static getNewUser() {
  16159. return this.userData.newUser;
  16160. }
  16161. static setNewUser() {
  16162. this.userData.newUser = false;
  16163. this.saveUserData();
  16164. }
  16165. static getRootBallFoul() {
  16166. return this.userData.rootBallFoul;
  16167. }
  16168. static setRootBallFoul() {
  16169. this.userData.rootBallFoul = 1;
  16170. this.saveUserData();
  16171. }
  16172. static getTimeoutFoul() {
  16173. return this.userData.timeoutFoul;
  16174. }
  16175. static setTimeoutFoul() {
  16176. this.userData.timeoutFoul = 1;
  16177. this.saveUserData();
  16178. }
  16179. }
  16180. DataMgr.isNewUser = false;
  16181. DataMgr.fristEnter = true;
  16182. DataMgr.levelType = 0;
  16183. DataMgr.awardId = 0;
  16184. DataMgr.awardCoin = 0;
  16185. DataMgr.sceneId = -1;
  16186. DataMgr.tryId = 0;
  16187. DataMgr.curLevel = 1;
  16188. DataMgr.vipLevel = 0;
  16189. DataMgr.maxLevel = 0;
  16190. DataMgr.awardRatio = 1;
  16191. DataMgr.gameList = [];
  16192. DataMgr.rankList = [];
  16193. DataMgr.recoverTime = 480000;
  16194. DataMgr.minScore = 0;
  16195. DataMgr.rankDis = 0;
  16196. DataMgr.userSaving = false;
  16197. DataMgr.gameSaving = false;
  16198. class D3Tween extends Laya.Script3D {
  16199. constructor() {
  16200. super();
  16201. this.isInited = false;
  16202. }
  16203. ;
  16204. init() {
  16205. if (this.isInited)
  16206. return;
  16207. this.isInited = true;
  16208. this.gameObj = this.owner;
  16209. this.transform = this.gameObj.transform;
  16210. }
  16211. get rotX() {
  16212. return this.transform.localRotationEulerX;
  16213. }
  16214. set rotX(v) {
  16215. this.transform.localRotationEulerX = v;
  16216. }
  16217. get rotY() {
  16218. return this.transform.localRotationEulerY;
  16219. }
  16220. set rotY(v) {
  16221. this.transform.localRotationEulerY = v;
  16222. }
  16223. get rotZ() {
  16224. return this.transform.localRotationEulerZ;
  16225. }
  16226. set rotZ(v) {
  16227. this.transform.localRotationEulerZ = v;
  16228. }
  16229. get posX() {
  16230. return this.transform.localPositionX;
  16231. }
  16232. set posX(v) {
  16233. this.transform.localPositionX = v;
  16234. }
  16235. get posY() {
  16236. return this.transform.localPositionY;
  16237. }
  16238. set posY(v) {
  16239. this.transform.localPositionY = v;
  16240. }
  16241. get posZ() {
  16242. return this.transform.localPositionZ;
  16243. }
  16244. set posZ(v) {
  16245. this.transform.localPositionZ = v;
  16246. }
  16247. get rotation() {
  16248. return this.transform.localRotation;
  16249. }
  16250. set rotation(v) {
  16251. this.transform.localRotation = v;
  16252. }
  16253. }
  16254. class D2Hole extends Laya.Script {
  16255. constructor() { super(); }
  16256. onTriggerEnter(collider) {
  16257. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16258. return;
  16259. }
  16260. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16261. if (collider.owner["mySrc"].isRunSkillAni) {
  16262. return;
  16263. }
  16264. if (collider.owner["mySrc"].number != 0) {
  16265. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16266. }
  16267. xGame.common.ballColliHole(collider);
  16268. xGame.common.recoverCameraView();
  16269. }
  16270. }
  16271. }
  16272. class Table extends Laya.Script3D {
  16273. constructor() {
  16274. super();
  16275. this.isSetBorder = false;
  16276. this.inited = false;
  16277. }
  16278. ;
  16279. onAwake() {
  16280. this.init();
  16281. }
  16282. init() {
  16283. if (this.inited)
  16284. return;
  16285. this.inited = true;
  16286. this.gameObj = this.owner;
  16287. this.border = this.gameObj.getChildByName("border");
  16288. }
  16289. setBorderPos() {
  16290. if (this.isSetBorder)
  16291. return;
  16292. this.isSetBorder = true;
  16293. let ui = xGame.common.gameUI.ui;
  16294. let bar1 = this.border.getChildByName("bar1");
  16295. let bar2 = this.border.getChildByName("bar2");
  16296. let bar3 = this.border.getChildByName("bar3");
  16297. let bar4 = this.border.getChildByName("bar4");
  16298. let bar5 = this.border.getChildByName("bar5");
  16299. let bar6 = this.border.getChildByName("bar6");
  16300. this.setInfo(bar1, ui.border.bar1, "box");
  16301. this.setInfo(bar2, ui.border.bar2, "box");
  16302. this.setInfo(bar3, ui.border.bar3, "box");
  16303. this.setInfo(bar4, ui.border.bar4, "box");
  16304. this.setInfo(bar5, ui.border.bar5, "box");
  16305. this.setInfo(bar6, ui.border.bar6, "box");
  16306. let circle1 = this.border.getChildByName("circle1");
  16307. let circle2 = this.border.getChildByName("circle2");
  16308. let circle3 = this.border.getChildByName("circle3");
  16309. let circle4 = this.border.getChildByName("circle4");
  16310. let circle5 = this.border.getChildByName("circle5");
  16311. let circle6 = this.border.getChildByName("circle6");
  16312. this.setInfo(circle1, ui.border.circle1, "circle");
  16313. this.setInfo(circle2, ui.border.circle2, "circle");
  16314. this.setInfo(circle3, ui.border.circle3, "circle");
  16315. this.setInfo(circle4, ui.border.circle4, "circle");
  16316. this.setInfo(circle5, ui.border.circle5, "circle");
  16317. this.setInfo(circle6, ui.border.circle6, "circle");
  16318. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16319. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16320. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16321. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16322. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16323. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16324. let arr = xGame.common.gameMgr.holePosList;
  16325. xGame.common.gameMgr.posObj = {
  16326. "1": arr[0],
  16327. "3": arr[2],
  16328. "4": arr[3],
  16329. "6": arr[5]
  16330. };
  16331. }
  16332. initHolePos(x, y) {
  16333. if (x < 300)
  16334. x += 25;
  16335. else if (x > 1000)
  16336. x -= 25;
  16337. else if (y > 200)
  16338. y -= 10;
  16339. else
  16340. y += 10;
  16341. if (y < 200)
  16342. y += 30;
  16343. else if (y > 500)
  16344. y -= 30;
  16345. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16346. }
  16347. setInfo(d3Obj, d2Obj, type) {
  16348. let ui = xGame.common.gameUI.ui;
  16349. let sprite = new Laya.Sprite();
  16350. ui.border.displayObject.addChild(sprite);
  16351. let colli = xGame.common.getCollider(type);
  16352. sprite.addComponentIntance(colli);
  16353. let rigy = xGame.common.getRigbody();
  16354. rigy.type = "static";
  16355. sprite.addComponentIntance(rigy);
  16356. let d3Pos = d3Obj.transform.position;
  16357. xGame.common.pos3to2Convert(d3Pos);
  16358. let scaleX = d3Obj.transform.localScaleX;
  16359. let scaleZ = d3Obj.transform.localScaleZ;
  16360. let width = xGame.common.scale3to2Convert(scaleZ);
  16361. let height = xGame.common.scale3to2Convert(scaleX);
  16362. sprite.pivotX = width / 2;
  16363. sprite.pivotY = height / 2;
  16364. sprite.x = d3Pos.x;
  16365. sprite.y = d3Pos.y;
  16366. sprite.width = width;
  16367. sprite.height = height;
  16368. d2Obj.x = d3Pos.x;
  16369. d2Obj.y = d3Pos.y;
  16370. d2Obj.width = width;
  16371. d2Obj.height = height;
  16372. if (type == "box") {
  16373. colli.width = width;
  16374. colli.height = height;
  16375. colli.isSensor = false;
  16376. colli.label = "border";
  16377. }
  16378. else {
  16379. colli.radius = width / 2;
  16380. colli.isSensor = true;
  16381. colli.label = "hole";
  16382. sprite.addComponent(D2Hole);
  16383. }
  16384. }
  16385. }
  16386. class D3World extends Laya.Script3D {
  16387. constructor() {
  16388. super();
  16389. this.loadNum = 0;
  16390. this.setLoadNum = 7;
  16391. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16392. }
  16393. onAwake() {
  16394. }
  16395. loadScene() {
  16396. this.scene = this.owner;
  16397. let url = `res/unityRes/root.lh`;
  16398. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16399. this.scene.addChild(prefab);
  16400. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16401. this.putCameraInfo();
  16402. this.camera.enableHDR = false;
  16403. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16404. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16405. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16406. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16407. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16408. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16409. this.knife.active = false;
  16410. this.loadD3Obj();
  16411. }));
  16412. }
  16413. putCameraInfo() {
  16414. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16415. this.cameraObj = new cameraType();
  16416. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16417. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16418. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16419. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16420. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16421. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16422. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16423. this.visitAngleChild.init();
  16424. this.visitRootObj.posX = this.visitAngleChild.posX;
  16425. this.visitRootObj.posY = this.visitAngleChild.posY;
  16426. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16427. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16428. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16429. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16430. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16431. xGame.common.showOneCamera("mainCamera");
  16432. }
  16433. loadD3Obj() {
  16434. this.loadTable();
  16435. this.loadRoom();
  16436. this.loadInHoleParticial();
  16437. this.loadIceParticial();
  16438. this.loadHitParticial();
  16439. this.loadFireworksParticial();
  16440. this.loadBall();
  16441. }
  16442. loadInHoleParticial() {
  16443. this.loadD3Res("inHoleEft", "", (prefab) => {
  16444. prefab.addComponent(Partical);
  16445. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16446. });
  16447. }
  16448. loadIceParticial() {
  16449. this.loadD3Res("iceEft", "", (prefab) => {
  16450. prefab.addComponent(Partical);
  16451. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16452. });
  16453. }
  16454. loadHitParticial() {
  16455. this.loadD3Res("hitEft", "", (prefab) => {
  16456. prefab.addComponent(Partical);
  16457. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16458. });
  16459. }
  16460. loadFireworksParticial() {
  16461. this.loadD3Res("fireworksEft", "", (prefab) => {
  16462. prefab.addComponent(Partical);
  16463. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16464. });
  16465. }
  16466. loadBall(index = 1) {
  16467. this.loadD3Res("ball", index, (prefab) => {
  16468. this.ballPrefab = prefab;
  16469. this.ballPrefab.addComponent(Ball);
  16470. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16471. });
  16472. }
  16473. loadTable(index = 1) {
  16474. this.loadD3Res("table", index, (prefab) => {
  16475. this.tableSrc = prefab.addComponent(Table);
  16476. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16477. this.d3Hand.init();
  16478. this.tableRoot.addChild(prefab);
  16479. });
  16480. }
  16481. loadRoom(index = 1) {
  16482. this.loadD3Res("room", index, (prefab) => {
  16483. this.roomRoot.addChild(prefab);
  16484. });
  16485. }
  16486. loadD3Res(type, index, callback) {
  16487. let url = `res/unityRes/${type}${index}.lh`;
  16488. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16489. callback && callback(prefab);
  16490. this.checkResLoad();
  16491. }));
  16492. }
  16493. checkResLoad() {
  16494. this.loadNum++;
  16495. if (this.loadNum >= this.setLoadNum) {
  16496. xGame.eventMgr.event(D3RES_LOADED);
  16497. }
  16498. }
  16499. prePlayEft() {
  16500. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16501. eft.transform.localPositionX = 0;
  16502. eft.transform.localPositionY = -5;
  16503. eft.transform.localPositionZ = 0;
  16504. eft.active = true;
  16505. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16506. ice.transform.localPositionX = 0;
  16507. ice.transform.localPositionY = -5;
  16508. ice.transform.localPositionZ = 0;
  16509. ice.active = true;
  16510. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16511. hit.transform.localPositionX = 0;
  16512. hit.transform.localPositionY = -5;
  16513. hit.transform.localPositionZ = 0;
  16514. hit.active = true;
  16515. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16516. fireworks.transform.localPositionX = 0;
  16517. fireworks.transform.localPositionY = -5;
  16518. fireworks.transform.localPositionZ = 0;
  16519. fireworks.active = true;
  16520. }
  16521. }
  16522. class cameraType {
  16523. }
  16524. class MoyuMgr$1 {
  16525. static initMoyu() {
  16526. this.moyuView = new MoyuView$1();
  16527. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16528. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16529. this.moyuView.ui.displayObject.zOrder = 1000;
  16530. this.moyuView.init();
  16531. this.moyuView.showTip(true);
  16532. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16533. window['XApk'] = this;
  16534. }
  16535. static showAge(show) {
  16536. if (this.moyuView)
  16537. this.moyuView.showAge(show);
  16538. }
  16539. static onPlatMsg(idx) {
  16540. if (!MoyuMgr$1.moyuView)
  16541. return;
  16542. if (idx == '0') {
  16543. MoyuMgr$1.moyuView.showTip(false);
  16544. }
  16545. }
  16546. static showAgree(call) {
  16547. if (this.moyuView)
  16548. this.moyuView.showAgree(call);
  16549. else
  16550. call && call();
  16551. }
  16552. static showXy(type = 1) {
  16553. if (this.moyuView)
  16554. this.moyuView.showXy(type);
  16555. }
  16556. }
  16557. MoyuMgr$1.isAdvise = false;
  16558. class MoyuView$1 {
  16559. constructor() {
  16560. this.ysxyNum = 1;
  16561. this.ysJson = null;
  16562. this.ui = ui_UIMoyu.createInstance();
  16563. }
  16564. init() {
  16565. this.ui.mainBg.visible = false;
  16566. this.ui.xyNode.visible = false;
  16567. this.ui.ageNode.visible = false;
  16568. this.ui.tipNode.visible = false;
  16569. this.ui.rnNode.visible = false;
  16570. this.ui.fcmNode.visible = false;
  16571. this.ui.ageTip.visible = false;
  16572. this.ui.msgNode.visible = false;
  16573. this.ui.visible = false;
  16574. this.ui.xyNode.xyList.setVirtual();
  16575. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16576. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16577. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16578. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16579. this.ui.xyNode.btnKnown.visible = false;
  16580. this.ui.xyNode.xy1.visible = false;
  16581. this.ui.xyNode.xy2.visible = false;
  16582. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16583. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16584. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16585. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16586. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16587. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16588. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16589. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16590. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16591. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16592. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16593. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16594. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16595. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16596. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16597. this.ysxyNum = 2;
  16598. }
  16599. }
  16600. onClick(obj) {
  16601. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16602. switch (obj) {
  16603. case this.ui.ageTip:
  16604. if (Moyu.isTTApk) {
  16605. this.ui.ageNode.visible = true;
  16606. this.ui.mainBg.visible = true;
  16607. }
  16608. break;
  16609. case this.ui.tipNode:
  16610. this.showTip(false);
  16611. break;
  16612. case this.ui.ageNode.btnAge:
  16613. this.ui.ageNode.visible = false;
  16614. this.ui.mainBg.visible = false;
  16615. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16616. this.ui.visible = false;
  16617. break;
  16618. case this.ui.xyNode.btnXy3:
  16619. case this.ui.xyNode.btnXy1:
  16620. this.loadXy(1);
  16621. break;
  16622. case this.ui.xyNode.btnXy2:
  16623. this.loadXy(2);
  16624. break;
  16625. case this.ui.xyNode.btnBack:
  16626. this.ui.xyNode.xy1.visible = true;
  16627. this.ui.xyNode.xy2.visible = false;
  16628. break;
  16629. case this.ui.xyNode.btnKnown:
  16630. this.ui.xyNode.visible = false;
  16631. this.ui.mainBg.visible = false;
  16632. this.ui.visible = false;
  16633. break;
  16634. case this.ui.rnNode.btnCheck:
  16635. this.check();
  16636. break;
  16637. case this.ui.rnNode.btnExit:
  16638. case this.ui.xyNode.btnNo:
  16639. this.ysxyNum--;
  16640. if (this.ysxyNum > 0)
  16641. this.showMsg("Refuse to quit the game once again");
  16642. else {
  16643. Moyu.userAgree(false);
  16644. Moyu.exit();
  16645. }
  16646. break;
  16647. case this.ui.xyNode.btnSure:
  16648. case this.ui.xyNode.btnYes:
  16649. DataMgr.userData.isAgree = true;
  16650. DataMgr.saveUserData();
  16651. this.onAgree();
  16652. break;
  16653. case this.ui.rnNode.btnDone:
  16654. this.ui.rnNode.visible = false;
  16655. this.ui.visible = false;
  16656. break;
  16657. case this.ui.fcmNode.btnRn:
  16658. this.showRn();
  16659. break;
  16660. }
  16661. }
  16662. showTip(show) {
  16663. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16664. return;
  16665. if (show) {
  16666. MoyuMgr$1.isAdvise = true;
  16667. this.ui.visible = true;
  16668. this.ui.tipNode.visible = true;
  16669. this.ui.tipNode.alpha = 1;
  16670. Laya.timer.once(1000, this, this.showTip, [false]);
  16671. }
  16672. else {
  16673. this.ui.tipNode.alpha = 1;
  16674. this.ui.tipNode.visible = true;
  16675. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16676. this.ui.tipNode.visible = false;
  16677. MoyuMgr$1.isAdvise = false;
  16678. }), 1000);
  16679. }
  16680. }
  16681. showAge(show, px = 0, py = 0) {
  16682. if (Moyu.platType > 10 && !Moyu.isIos) {
  16683. this.ui.ageTip.x = px;
  16684. this.ui.ageTip.y = py;
  16685. this.ui.ageTip.visible = show;
  16686. if (show)
  16687. this.ui.visible = true;
  16688. }
  16689. }
  16690. showAgree(call) {
  16691. this.agreeCall = call;
  16692. this.onAgree();
  16693. return;
  16694. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16695. this.showXy(0);
  16696. }
  16697. else
  16698. this.onAgree();
  16699. }
  16700. onAgree() {
  16701. if (!this.ui.ageNode.visible)
  16702. this.ui.visible = false;
  16703. this.ui.xyNode.visible = false;
  16704. Moyu.userAgree(true);
  16705. this.showAge(false);
  16706. this.agreeCall && this.agreeCall();
  16707. this.showRn();
  16708. }
  16709. showMsg(txt) {
  16710. this.ui.msgNode.txtMsg.text = txt;
  16711. this.ui.msgNode.visible = true;
  16712. this.ui.msgNode.alpha = 1;
  16713. this.ui.visible = true;
  16714. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16715. this.ui.msgNode.visible = false;
  16716. }), 2500, true);
  16717. }
  16718. showRn() {
  16719. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16720. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16721. this.ui.rnNode.rn1.visible = true;
  16722. this.ui.rnNode.rn2.visible = false;
  16723. this.ui.rnNode.rn3.visible = false;
  16724. this.ui.rnNode.rn4.visible = false;
  16725. this.ui.rnNode.visible = true;
  16726. this.ui.mainBg.visible = true;
  16727. this.ui.rnNode.btnDone.visible = false;
  16728. this.ui.rnNode.btnExit.visible = true;
  16729. this.ui.rnNode.btnCheck.visible = true;
  16730. this.ui.fcmNode.visible = false;
  16731. this.ui.visible = true;
  16732. return;
  16733. }
  16734. }
  16735. this.showFcm();
  16736. }
  16737. showFcm() {
  16738. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16739. Moyu.initFCM(true);
  16740. if (Moyu.gameTime < 1)
  16741. this.fcmLoop();
  16742. else if (Moyu.gameTime < 999)
  16743. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16744. }
  16745. }
  16746. fcmLoop() {
  16747. if (Moyu.gameTime < 1) {
  16748. this.ui.rnNode.visible = false;
  16749. this.ui.fcmNode.visible = true;
  16750. this.ui.mainBg.visible = true;
  16751. this.ui.visible = true;
  16752. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16753. Laya.timer.clear(this.ui, this.fcmLoop);
  16754. }
  16755. }
  16756. check() {
  16757. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16758. this.ui.rnNode.rn1.visible = false;
  16759. this.ui.rnNode.rn2.visible = false;
  16760. this.ui.rnNode.rn4.visible = true;
  16761. }
  16762. else if (this.ui.rnNode.rn4.visible) {
  16763. let name = this.ui.rnNode.inputName.text;
  16764. let code = this.ui.rnNode.inputCode.text;
  16765. if (code && code.length == 18) {
  16766. this.ui.rnNode.rn1.visible = false;
  16767. this.ui.rnNode.rn4.visible = false;
  16768. Moyu.authenticate(name, code, (res) => {
  16769. this.ui.rnNode.rn2.visible = !res;
  16770. this.ui.rnNode.rn3.visible = res;
  16771. this.ui.rnNode.btnDone.visible = res;
  16772. this.ui.rnNode.btnExit.visible = !res;
  16773. this.ui.rnNode.btnCheck.visible = !res;
  16774. if (res)
  16775. this.showFcm();
  16776. });
  16777. }
  16778. else
  16779. this.showMsg("信息填写不完整");
  16780. }
  16781. }
  16782. loadXy(type = 0) {
  16783. this.ui.xyNode.xy1.visible = false;
  16784. this.ui.xyNode.xy2.visible = true;
  16785. this.ui.xyNode.xyList.scrollToView(0);
  16786. if (type == 1) {
  16787. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16788. }
  16789. else if (type == 2) {
  16790. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16791. }
  16792. }
  16793. showXy(type = 0) {
  16794. this.xyBtn();
  16795. if (type == 0) {
  16796. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16797. this.ui.xyNode.btnSure.visible = true;
  16798. }
  16799. else {
  16800. this.ui.xyNode.btnYes.visible = true;
  16801. this.ui.xyNode.btnNo.visible = true;
  16802. }
  16803. }
  16804. else {
  16805. this.ui.xyNode.btnKnown.visible = true;
  16806. this.ui.mainBg.visible = true;
  16807. }
  16808. this.ui.xyNode.xy1.visible = true;
  16809. this.ui.xyNode.xy2.visible = false;
  16810. this.ui.xyNode.visible = true;
  16811. this.ui.visible = true;
  16812. }
  16813. xyBtn() {
  16814. this.ui.xyNode.btnSure.visible = false;
  16815. this.ui.xyNode.btnYes.visible = false;
  16816. this.ui.xyNode.btnNo.visible = false;
  16817. this.ui.xyNode.btnKnown.visible = false;
  16818. {
  16819. this.ui.xyNode.btnXy3.visible = false;
  16820. this.ui.xyNode.btnXy2.visible = true;
  16821. this.ui.xyNode.btnXy1.visible = true;
  16822. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16823. }
  16824. }
  16825. createXY(json) {
  16826. this.ysJson = json.content;
  16827. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16828. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16829. this.ui.xyNode.xy2.visible = true;
  16830. }
  16831. renderListItem(idx, cell) {
  16832. let xy = this.ysJson[idx];
  16833. cell.height = xy.line * 30;
  16834. cell.xyItem.text = xy.text;
  16835. }
  16836. onDestroy() {
  16837. this.agreeCall = null;
  16838. }
  16839. }
  16840. class UILoading extends UIBase {
  16841. constructor() {
  16842. super();
  16843. this.accTime = 0;
  16844. this.curNum = 0;
  16845. this.rate = 1;
  16846. this.loadSubOk = false;
  16847. this.loadResOK = false;
  16848. this.openLoading = true;
  16849. this.beginLoadRes = false;
  16850. this.finishD2 = false;
  16851. this.finishD3 = false;
  16852. }
  16853. onConstructor() {
  16854. this.ui = ui_UILoading.createInstance();
  16855. this.contentPane = this.ui;
  16856. this.isEject = false;
  16857. this._initUI();
  16858. this._addEvent();
  16859. }
  16860. _initUI() {
  16861. MoyuMgr$1.initMoyu();
  16862. }
  16863. _addEvent() {
  16864. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16865. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16866. }
  16867. show() {
  16868. super.show();
  16869. console.log('zh:加载分包资源');
  16870. loadSubRes(this.subResProgress.bind(this));
  16871. this.ui.txtLoad.text = "Loading...";
  16872. }
  16873. subResProgress(pro, finish) {
  16874. this.curNum = pro;
  16875. if (finish) {
  16876. this.curNum = 1;
  16877. this.loadSubOk = true;
  16878. }
  16879. }
  16880. laodD3Res() {
  16881. let scene3D = new Laya.Scene3D();
  16882. xGame.common.d3Scene = scene3D;
  16883. xGame.common.d3World = scene3D.addComponent(D3World);
  16884. xGame.common.d3World.loadScene();
  16885. }
  16886. loadD2Res() {
  16887. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16888. this.finishD2 = true;
  16889. this.checkLoadAll();
  16890. this.curNum = 1;
  16891. }), Laya.Handler.create(this, (pro) => {
  16892. this.curNum = pro;
  16893. }, null, false));
  16894. }
  16895. d3ResFinish() {
  16896. this.finishD3 = true;
  16897. this.checkLoadAll();
  16898. }
  16899. checkLoadAll() {
  16900. if (this.finishD2 && this.finishD3) {
  16901. this.loadResOK = true;
  16902. }
  16903. }
  16904. loadRes() {
  16905. this.laodD3Res();
  16906. this.loadD2Res();
  16907. }
  16908. myUpdate(dt) {
  16909. if (!this.openLoading)
  16910. return;
  16911. this.accTime += dt * this.rate;
  16912. if (this.accTime >= this.curNum)
  16913. this.accTime = this.curNum;
  16914. this.ui.loadinfo.value = this.accTime * 100;
  16915. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16916. if (!this.beginLoadRes) {
  16917. this.beginLoadRes = true;
  16918. this.ui.txtLoad.text = "Loading...";
  16919. this.curNum = 0;
  16920. this.accTime = 0;
  16921. this.loadRes();
  16922. }
  16923. if (this.loadResOK) {
  16924. this.openLoading = false;
  16925. Laya.timer.once(300, this, () => {
  16926. xGame.common.d3Scene.active = false;
  16927. MoyuMgr$1.showAgree(enterGame);
  16928. });
  16929. }
  16930. }
  16931. }
  16932. release() {
  16933. }
  16934. hide() {
  16935. super.hide();
  16936. this.release();
  16937. }
  16938. onClose() {
  16939. this.hide();
  16940. }
  16941. }
  16942. UILoading.uiName = "UILoading";
  16943. class UIRepentProp$1 extends UIBase {
  16944. constructor() {
  16945. super();
  16946. this.viewType = 0;
  16947. this.regretType = 0;
  16948. }
  16949. onConstructor() {
  16950. this.ui = ui_UIRepentProp.createInstance();
  16951. this.contentPane = this.ui;
  16952. this.isEject = false;
  16953. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  16954. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  16955. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  16956. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  16957. }
  16958. show(viewType, regretType, callback) {
  16959. PlatMgr.showInsert(true);
  16960. this.viewType = viewType;
  16961. this.regretType = regretType;
  16962. this.callback = callback;
  16963. super.show();
  16964. this.ui.t0.play();
  16965. this.ui.c1.selectedIndex = this.viewType;
  16966. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  16967. if (this.viewType == 0) {
  16968. let guide = DataMgr.getGuideHelpLine();
  16969. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  16970. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  16971. }
  16972. xGame.common.gameMgr.gamePause = true;
  16973. }
  16974. hideSelf() {
  16975. xGame.common.gameMgr.gamePause = false;
  16976. this.callback && this.callback(false);
  16977. this.hide();
  16978. }
  16979. videoRegret() {
  16980. Moyu.showVideoAd(() => {
  16981. this.callback && this.callback(true);
  16982. this.hideSelf();
  16983. }, EAdType.regretBall);
  16984. }
  16985. videoAddHelpLine() {
  16986. let guide = DataMgr.getGuideHelpLine();
  16987. if (guide == 0) {
  16988. this.callback && this.callback(true);
  16989. this.hideSelf();
  16990. DataMgr.setGuideHelpLine();
  16991. xGame.common.gameUI.ui.guideNode.visible = false;
  16992. }
  16993. else {
  16994. Moyu.showVideoAd(() => {
  16995. this.callback && this.callback(true);
  16996. this.hideSelf();
  16997. }, EAdType.longHelpLine);
  16998. }
  16999. }
  17000. }
  17001. UIRepentProp$1.uiName = "UIRepentProp";
  17002. class UIRodMethod$1 extends UIBase {
  17003. constructor() {
  17004. super();
  17005. this.isPressd = false;
  17006. }
  17007. onConstructor() {
  17008. this.ui = ui_UIRodMethod.createInstance();
  17009. this.contentPane = this.ui;
  17010. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17011. this.moveDir = new Laya.Vector2();
  17012. this.moveDest = new Laya.Vector2();
  17013. this.centerPos = new Laya.Vector2();
  17014. xGame.common.uiRodMethod = this;
  17015. }
  17016. show() {
  17017. super.show();
  17018. xGame.common.gameMgr.gamePause = true;
  17019. this.openPressDotEvent();
  17020. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17021. this.centerPos.x = this.ui.white.x;
  17022. this.centerPos.y = this.ui.white.y;
  17023. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17024. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17025. this.setDot();
  17026. }
  17027. setDot() {
  17028. this.ui.dot.x = this.moveDest.x;
  17029. this.ui.dot.y = this.moveDest.y;
  17030. }
  17031. closeSelf() {
  17032. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17033. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17034. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17035. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17036. xGame.common.gameMgr.gamePause = false;
  17037. this.hide();
  17038. }
  17039. openPressDotEvent() {
  17040. this.closePressDotEvent();
  17041. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17042. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17043. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17044. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17045. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17046. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17047. }
  17048. closePressDotEvent() {
  17049. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17050. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17051. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17052. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17053. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17054. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17055. }
  17056. onDown(e) {
  17057. if (e.type == Laya.Event.MOUSE_DOWN)
  17058. this.isPressd = true;
  17059. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17060. this.isPressd = false;
  17061. if (!this.isPressd)
  17062. return;
  17063. this.moveDest.x = e.stageX;
  17064. this.moveDest.y = e.stageY;
  17065. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17066. if (dis > 6724) {
  17067. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17068. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17069. }
  17070. this.setDot();
  17071. }
  17072. resetRod() {
  17073. this.ui.dot.x = this.ui.white.x;
  17074. this.ui.dot.y = this.ui.white.y;
  17075. this.gameRod.dot.x = this.gameRod.bg.x;
  17076. this.gameRod.dot.y = this.gameRod.bg.y;
  17077. xGame.common.rodOffest.x = 0;
  17078. xGame.common.rodOffest.y = 0;
  17079. }
  17080. }
  17081. UIRodMethod$1.uiName = "UIRodMethod";
  17082. class UIMsg$1 extends UIBase {
  17083. constructor() {
  17084. super();
  17085. }
  17086. onConstructor() {
  17087. this.ui = ui_UIMsg.createInstance();
  17088. this.contentPane = this.ui;
  17089. this.isEject = false;
  17090. this.isMuti = true;
  17091. }
  17092. show(msg, callback) {
  17093. super.show();
  17094. this.ui.tipsNode.msgTxt.text = msg;
  17095. this.ui.alpha = 1;
  17096. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17097. this.hide();
  17098. callback && callback();
  17099. }), 1000);
  17100. }
  17101. }
  17102. UIMsg$1.uiName = "UIMsg";
  17103. class UITips$1 extends UIBase {
  17104. constructor() {
  17105. super();
  17106. this.type = 0;
  17107. }
  17108. onConstructor() {
  17109. this.ui = ui_UITips.createInstance();
  17110. this.contentPane = this.ui;
  17111. this.isEject = false;
  17112. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17113. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17114. }
  17115. show(tipsTxt, womanTxt, type) {
  17116. super.show();
  17117. this.ui.t0.play();
  17118. this.ui.myNode.tipsTxt.text = tipsTxt;
  17119. this.ui.myNode.womanTxt.text = womanTxt;
  17120. PlatMgr.showInsert(true);
  17121. this.ui.myNode.c1.selectedIndex = type;
  17122. this.type = type;
  17123. switch (this.type) {
  17124. case TipsType.exitGame:
  17125. xGame.common.gameMgr.gamePause = true;
  17126. break;
  17127. case TipsType.foul:
  17128. Laya.timer.once(200, this, () => {
  17129. xGame.common.gameMgr.gamePause = true;
  17130. });
  17131. break;
  17132. default:
  17133. break;
  17134. }
  17135. }
  17136. clickLeftBtn() {
  17137. this.hide();
  17138. xGame.common.gameMgr.gamePause = false;
  17139. switch (this.type) {
  17140. case TipsType.exitGame:
  17141. break;
  17142. case TipsType.foul:
  17143. break;
  17144. default:
  17145. break;
  17146. }
  17147. }
  17148. clickRightBtn() {
  17149. this.hide();
  17150. switch (this.type) {
  17151. case TipsType.exitGame:
  17152. xGame.eventMgr.event(RESET_GAME);
  17153. xGame.uiMgr.Show(UIMain$1);
  17154. Moyu.recordEnd(this, null);
  17155. xGame.common.longHelpLine = false;
  17156. break;
  17157. case TipsType.foul:
  17158. xGame.common.gameMgr.gamePause = false;
  17159. Laya.timer.clearAll(this);
  17160. break;
  17161. default:
  17162. break;
  17163. }
  17164. }
  17165. }
  17166. UITips$1.uiName = "UITips";
  17167. class UIGame$1 extends UIBase {
  17168. constructor() {
  17169. super();
  17170. this.powerNum = 0;
  17171. this.isD3Inited = false;
  17172. this.isPrePlay = false;
  17173. this.isMoveRod = false;
  17174. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17175. this.rulerDis = 20;
  17176. this.rulerOffset = 0;
  17177. }
  17178. onConstructor() {
  17179. this.ui = ui_UIGame.createInstance();
  17180. this.contentPane = this.ui;
  17181. this.ui.x += xGame.common.sysOffestNum;
  17182. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17183. this.isEject = false;
  17184. xGame.common.gameUI = this;
  17185. this.initSelf();
  17186. }
  17187. isTurnSelf() {
  17188. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17189. return true;
  17190. }
  17191. }
  17192. initSelf() {
  17193. let topUI = this.ui.topNode;
  17194. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17195. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17196. this.barInfo = {};
  17197. this.barInfo.curY = 0;
  17198. this.barInfo.height = this.ui.powerNode.height;
  17199. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17200. this.barInfo.powerStartY = this.ui.powerNode.y;
  17201. xGame.common.aiPlayer = new AIPlayer();
  17202. xGame.common.gameMgr = new GameMgr();
  17203. xGame.common.skillMgr = new SkillMgr();
  17204. xGame.common.wordsMgr = new WordsMgr();
  17205. xGame.common.talkMgr = new TalkMgr();
  17206. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17207. console.log("加载经典模式表情文件chenggon !");
  17208. });
  17209. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17210. console.log("挑战模式奖励模式spine加载成功!");
  17211. });
  17212. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17213. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17214. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17215. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17216. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17217. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17218. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17219. }
  17220. returnHome() {
  17221. let tips = "Are you sure to exit the game?";
  17222. let woman = "Boss, why don't you play for a while longer?";
  17223. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17224. }
  17225. addRodMethodClick() {
  17226. if (this.isTurnSelf()) {
  17227. xGame.uiMgr.Show(UIRodMethod$1);
  17228. }
  17229. }
  17230. clickHelpLineBtn(force = false) {
  17231. if (!this.isTurnSelf())
  17232. return;
  17233. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17234. if (success) {
  17235. xGame.common.longHelpLine = true;
  17236. xGame.common.d2World.getHelpLine();
  17237. Moyu.sendDataEvent("guideNum");
  17238. }
  17239. else {
  17240. }
  17241. });
  17242. }
  17243. renderSelfDisplayBalls(index, target) {
  17244. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17245. target.myImg.url = xGame.common.getGameIconUrl(str);
  17246. }
  17247. renderAIDisplayBalls(index, target) {
  17248. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17249. target.myImg.url = xGame.common.getGameIconUrl(str);
  17250. ;
  17251. }
  17252. updateMode() {
  17253. if (xGame.common.gameMode == GameMode.classic) {
  17254. this.ui.topNode.scoreNode.visible = false;
  17255. }
  17256. else if (xGame.common.gameMode == GameMode.bigMove) {
  17257. this.ui.topNode.scoreNode.visible = true;
  17258. }
  17259. }
  17260. show() {
  17261. super.show();
  17262. console.log("zh:uigame show");
  17263. this.ui.alpha = 0;
  17264. this.updateSelf();
  17265. console.log("zh:uigame bf gamemusic01 start");
  17266. xGame.soundMgr.playMusic("gamemusic01");
  17267. console.log("zh:uigame bf gamemusic01 end");
  17268. xGame.common.gameMgr.gamePause = false;
  17269. xGame.common.gameUI.ui.blackAni.visible = false;
  17270. xGame.common.gameUI.ui.whiteAni.visible = false;
  17271. this.ui.powerEft.visible = false;
  17272. this.ui.colorNode.visible = false;
  17273. this.updateHead();
  17274. }
  17275. updateSelf() {
  17276. if (xGame.common.gameMode == GameMode.classic) {
  17277. this.ui.c1.selectedIndex = 0;
  17278. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17279. this.ui.topNode.middleNode.visible = true;
  17280. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17281. }
  17282. else if (xGame.common.gameMode == GameMode.bigMove) {
  17283. this.ui.c1.selectedIndex = 0;
  17284. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17285. this.ui.topNode.middleNode.visible = false;
  17286. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17287. let rand = xGame.common.randomNum(1, max);
  17288. let guide = DataMgr.getSkillGuide();
  17289. if (guide == 0)
  17290. rand = 1;
  17291. xGame.common.bigMoveLevelIndex = rand;
  17292. }
  17293. else if (xGame.common.gameMode == GameMode.placeBall) {
  17294. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17295. this.ui.c1.selectedIndex = 1 + data.type;
  17296. this.ui.alpha = 1;
  17297. this.startGame();
  17298. }
  17299. this.updateMode();
  17300. this.initD3world();
  17301. this.initD2world();
  17302. }
  17303. startGame() {
  17304. this.ui.snowNode.visible = Math.random() <= 0.1;
  17305. this.ui.d2Node.visible = false;
  17306. xGame.common.d3World.d3Hand.gameObj.active = false;
  17307. xGame.common.d3World.tableSrc.init();
  17308. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17309. this.cameraViewChange(() => {
  17310. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17311. switch (xGame.common.gameMode) {
  17312. case GameMode.classic:
  17313. xGame.common.d3World.d3Hand.gameObj.active = true;
  17314. this.playPutBallD3Ani();
  17315. break;
  17316. case GameMode.bigMove:
  17317. this.enterGame();
  17318. Laya.timer.once(500, this, () => {
  17319. this.ui.topNode.middleNode.visible = true;
  17320. this.ui.topNode.middleNode.t0.play();
  17321. });
  17322. break;
  17323. case GameMode.placeBall:
  17324. this.enterGame();
  17325. break;
  17326. default:
  17327. break;
  17328. }
  17329. });
  17330. PlatMgr.showBanner(false);
  17331. }
  17332. enterGame() {
  17333. this.ui.d2Node.visible = true;
  17334. xGame.common.d3World.d3Hand.gameObj.active = false;
  17335. xGame.common.showOneCamera("mainCamera");
  17336. Moyu.recordGame(30, true);
  17337. if (!this.isPrePlay) {
  17338. this.isPrePlay = true;
  17339. xGame.common.d3World.prePlayEft();
  17340. }
  17341. xGame.common.gameMgr.gameReady();
  17342. this.openAllEvent();
  17343. this.ui.snowNode.visible = false;
  17344. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17345. this.ui.helpBtn.visible = condition;
  17346. }
  17347. showHelpLineGuide() {
  17348. let longGuide = DataMgr.getGuideHelpLine();
  17349. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17350. this.ui.helpBtn.visible = true;
  17351. this.ui.guideNode.visible = true;
  17352. }
  17353. }
  17354. setTurnAlpha(alpha) {
  17355. this.ui.keduNode.alpha = alpha;
  17356. this.ui.ganNode.alpha = alpha;
  17357. this.ui.rodMethodNode.alpha = alpha;
  17358. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17359. }
  17360. cameraViewChange(callback) {
  17361. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17362. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17363. xGame.common.showOneCamera("visitAngle");
  17364. cameraSrc.localRotationEulerY = 180;
  17365. cameraSrc.localRotationEulerZ = 0;
  17366. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17367. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17368. callback && callback();
  17369. }));
  17370. }));
  17371. }
  17372. playPutBallD3Ani() {
  17373. xGame.common.showOneCamera("mainCamera");
  17374. let handSrc = xGame.common.d3World.d3Hand;
  17375. handSrc.gameObj.active = true;
  17376. handSrc.transform.localPositionZ = 3;
  17377. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17378. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17379. handSrc.gameObj.active = false;
  17380. this.enterGame();
  17381. }), 400);
  17382. }));
  17383. }
  17384. updateHead() {
  17385. let user = Moyu.getUserInfo();
  17386. this.ui.topNode.selfNameTxt.text = user.nickName;
  17387. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17388. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17389. if (DataMgr.getSkillGuide() < 1) {
  17390. this.ui.topNode.aiNameTxt.text = 'billiards';
  17391. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17392. }
  17393. else {
  17394. this.ui.topNode.aiNameTxt.text = aiData.name;
  17395. let randNo = Math.floor(Math.random() * 10) + 1;
  17396. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17397. }
  17398. }
  17399. initD2world() {
  17400. let node = this.ui.d2Root.displayObject;
  17401. let src = node.getComponent(D2World);
  17402. if (!src) {
  17403. xGame.common.d2World = node.addComponent(D2World);
  17404. }
  17405. xGame.common.d2World.initSelf();
  17406. }
  17407. initD3world() {
  17408. if (this.isD3Inited)
  17409. return;
  17410. this.isD3Inited = true;
  17411. let scene3D = xGame.common.d3Scene;
  17412. this.ui.d3Root.displayObject.addChild(scene3D);
  17413. scene3D.active = true;
  17414. xGame.common.d3World.tableSrc.setBorderPos();
  17415. }
  17416. onRootMove(e) {
  17417. let rootBall = xGame.common.d2World.rootBall;
  17418. this.ui.moveNode.x = e.x;
  17419. this.ui.moveNode.y = e.y;
  17420. rootBall.gameObj.x = e.x;
  17421. rootBall.gameObj.y = e.y;
  17422. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17423. }
  17424. aiRootMove(move) {
  17425. if (move)
  17426. this.hideBallUI();
  17427. else {
  17428. this.showBallUI();
  17429. xGame.common.d2World.getHelpLine();
  17430. }
  17431. }
  17432. aiForce(type, force = 0) {
  17433. this.pressTarget = PressType.powerNode;
  17434. if (type == 1)
  17435. this.onEventUp({ force: true });
  17436. else if (type == 2)
  17437. this.onEventMove({ stageY: force, force: true });
  17438. }
  17439. onEventPress(e) {
  17440. if (e.stopPropagation)
  17441. e.stopPropagation();
  17442. if (!this.isTurnSelf())
  17443. return;
  17444. let target = e.target;
  17445. switch (target) {
  17446. case this.ui.myPowerNode.displayObject:
  17447. this.pressTarget = PressType.powerNode;
  17448. this.barInfo.curY = e.stageY;
  17449. this.updateBarInfo();
  17450. break;
  17451. case this.ui.moveNode.displayObject:
  17452. this.pressTarget = PressType.moveNode;
  17453. this.hideBallUI();
  17454. this.eventObj.curX = this.ui.moveNode.x;
  17455. this.eventObj.curY = this.ui.moveNode.y;
  17456. this.ui.moveNode.finger.visible = false;
  17457. this.eventObj.lastX = e.stageX;
  17458. this.eventObj.lastY = e.stageY;
  17459. break;
  17460. case this.ui.rulerClickNode.displayObject:
  17461. this.pressTarget = PressType.rulerNode;
  17462. this.eventObj.lastY = e.stageY;
  17463. break;
  17464. case this.ui.d2Root.displayObject:
  17465. this.pressTarget = PressType.d2Root;
  17466. this.eventObj.lastX = e.stageX;
  17467. this.eventObj.lastY = e.stageY;
  17468. this.eventObj.starX = e.stageX;
  17469. this.eventObj.starY = e.stageY;
  17470. this.eventObj.curX = 0;
  17471. this.eventObj.curY = 0;
  17472. xGame.common.d2World.d2Gan.setGanLastInfo();
  17473. this.rulerOffset = 0;
  17474. break;
  17475. default:
  17476. break;
  17477. }
  17478. }
  17479. onEventMove(e) {
  17480. if (e.stopPropagation)
  17481. e.stopPropagation();
  17482. if (e && e.force) {
  17483. }
  17484. else {
  17485. if (!this.isTurnSelf())
  17486. return;
  17487. }
  17488. switch (this.pressTarget) {
  17489. case PressType.powerNode:
  17490. this.barInfo.curY = e.stageY;
  17491. this.updateBarInfo();
  17492. this.isMoveRod = true;
  17493. break;
  17494. case PressType.moveNode:
  17495. let rootBall = xGame.common.d2World.rootBall;
  17496. let radius = rootBall.gameObj.width / 2;
  17497. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17498. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17499. let border = xGame.common.d2World.borderRect;
  17500. if (curX <= border.x + radius)
  17501. curX = border.x + radius;
  17502. else if (curX >= border.x + border.width - radius)
  17503. curX = border.x + border.width - radius;
  17504. if (curY <= border.y + radius)
  17505. curY = border.y + radius;
  17506. else if (curY >= border.y + border.height - radius)
  17507. curY = border.y + border.height - radius;
  17508. if (xGame.common.gameMgr.isOpenBall) {
  17509. if (curX >= border.x + border.openBallW - radius)
  17510. curX = border.x + border.openBallW - radius;
  17511. }
  17512. this.ui.moveNode.x = curX;
  17513. this.ui.moveNode.y = curY;
  17514. rootBall.gameObj.x = curX;
  17515. rootBall.gameObj.y = curY;
  17516. rootBall.d3BallSrc.setTransPos(curX, curY);
  17517. this.isMoveRod = true;
  17518. break;
  17519. case PressType.rulerNode:
  17520. let yy = e.stageY - this.eventObj.lastY;
  17521. this.eventObj.lastY = e.stageY;
  17522. let ruler1 = this.ui.rulerNode.img1;
  17523. let ruler2 = this.ui.rulerNode.img2;
  17524. ruler1.y += yy;
  17525. ruler2.y += yy;
  17526. this.rulerOffset += yy;
  17527. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17528. this.rulerOffset = 0;
  17529. xGame.soundMgr.playSound("inch", 1, 10);
  17530. }
  17531. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17532. let h = ruler1.height;
  17533. this.checkGuide();
  17534. this.isMoveRod = true;
  17535. if (ruler1.y >= h) {
  17536. ruler1.y = -h;
  17537. ruler2.y = 0;
  17538. return;
  17539. }
  17540. else if (ruler1.y <= -h) {
  17541. ruler1.y = h;
  17542. ruler2.y = 0;
  17543. return;
  17544. }
  17545. if (ruler2.y >= h) {
  17546. ruler2.y = -h;
  17547. ruler1.y = 0;
  17548. return;
  17549. }
  17550. else if (ruler2.y <= -h) {
  17551. ruler2.y = h;
  17552. ruler1.y = 0;
  17553. return;
  17554. }
  17555. break;
  17556. case PressType.d2Root:
  17557. this.eventObj.curX = e.stageX;
  17558. this.eventObj.curY = e.stageY;
  17559. let offset = this.checkRodMoveDir();
  17560. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17561. this.eventObj.lastX = e.stageX;
  17562. this.eventObj.lastY = e.stageY;
  17563. break;
  17564. default:
  17565. break;
  17566. }
  17567. }
  17568. onEventUp(e) {
  17569. if (e.stopPropagation)
  17570. e.stopPropagation();
  17571. if (e && e.force) {
  17572. }
  17573. else {
  17574. if (!this.isTurnSelf())
  17575. return;
  17576. }
  17577. switch (this.pressTarget) {
  17578. case PressType.powerNode:
  17579. this.ui.powerNode.value = 0;
  17580. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17581. this.ui.powerTxt.text = "";
  17582. if (this.powerNum > 0) {
  17583. xGame.eventMgr.event(BALL_SHOOT);
  17584. xGame.common.d2World.shoot(this.powerNum);
  17585. xGame.common.d2World.d2Gan.shoot();
  17586. xGame.common.d2World.d2HelpLine.shoot();
  17587. this.finishGuide();
  17588. this.ui.powerEft.visible = false;
  17589. this.ui.colorNode.visible = false;
  17590. let ganStr = "";
  17591. if (this.powerNum <= 30) {
  17592. ganStr = "gan_30";
  17593. }
  17594. else if (this.powerNum <= 60) {
  17595. ganStr = "gan_50";
  17596. }
  17597. else {
  17598. ganStr = "gan_80";
  17599. }
  17600. xGame.soundMgr.playSound(ganStr);
  17601. }
  17602. break;
  17603. case PressType.moveNode:
  17604. let rootBall = xGame.common.d2World.rootBall;
  17605. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17606. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17607. let isIntersect = this.judgeBallIntersect();
  17608. if (isIntersect) {
  17609. this.ui.moveNode.x = lastX;
  17610. this.ui.moveNode.y = lastY;
  17611. rootBall.gameObj.x = lastX;
  17612. rootBall.gameObj.y = lastY;
  17613. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17614. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17615. }
  17616. else {
  17617. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17618. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17619. }
  17620. this.showBallUI();
  17621. this.ui.moveNode.finger.visible = true;
  17622. xGame.common.d2World.getHelpLine();
  17623. break;
  17624. case PressType.rulerNode:
  17625. break;
  17626. case PressType.d2Root:
  17627. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17628. if (dis <= 25) {
  17629. this.moveToClickDot(e);
  17630. }
  17631. break;
  17632. default:
  17633. break;
  17634. }
  17635. this.pressTarget = -1;
  17636. }
  17637. checkGuide() {
  17638. let guide = DataMgr.getSkillGuide();
  17639. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17640. xGame.common.guideStep++;
  17641. xGame.common.gameUI.ui.guide2.visible = false;
  17642. xGame.common.gameUI.ui.guide3.visible = true;
  17643. }
  17644. }
  17645. finishGuide() {
  17646. let guide = DataMgr.getSkillGuide();
  17647. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17648. xGame.common.guideStep = 10;
  17649. this.closeAllGuide();
  17650. }
  17651. }
  17652. closeAllGuide() {
  17653. xGame.common.gameUI.ui.guide1.visible = false;
  17654. xGame.common.gameUI.ui.guide2.visible = false;
  17655. xGame.common.gameUI.ui.guide3.visible = false;
  17656. }
  17657. updateBarInfo() {
  17658. let star = this.ui.powerNode.y;
  17659. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17660. if (rate >= 1)
  17661. rate = 1;
  17662. if (rate <= 0)
  17663. rate = 0;
  17664. this.powerNum = Math.ceil(rate * 100);
  17665. this.ui.powerNode.value = this.powerNum;
  17666. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17667. this.ui.colorNode.value = this.powerNum;
  17668. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17669. this.ui.powerEft.visible = this.powerNum != 0;
  17670. this.ui.colorNode.visible = this.powerNum != 0;
  17671. this.ui.powerTxt.text = this.powerNum + "";
  17672. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17673. }
  17674. forceCancel() {
  17675. this.ui.powerNode.value = 0;
  17676. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17677. this.ui.powerTxt.text = "";
  17678. }
  17679. checkRodMoveDir() {
  17680. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17681. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17682. if (tempX >= 0 && tempY <= 0) {
  17683. return this.checkDir();
  17684. }
  17685. else if (tempX < 0 && tempY < 0) {
  17686. return this.checkDir(1, -1);
  17687. }
  17688. else if (tempX < 0 && tempY > 0) {
  17689. return this.checkDir(-1, -1);
  17690. }
  17691. else {
  17692. return this.checkDir(-1, 1);
  17693. }
  17694. }
  17695. checkDir(flagX = 1, flagY = 1) {
  17696. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17697. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17698. if (offsetY == 0) {
  17699. return offsetX * flagX;
  17700. }
  17701. if (offsetX == 0) {
  17702. return offsetY * flagY;
  17703. }
  17704. let angle = offsetY / offsetX;
  17705. if (Math.abs(angle) >= 1) {
  17706. return offsetY * flagY;
  17707. }
  17708. else {
  17709. return offsetX * flagX;
  17710. }
  17711. }
  17712. judgeBallIntersect() {
  17713. let rootBall = xGame.common.d2World.rootBall;
  17714. let ballArr = xGame.common.d2World.ballArr;
  17715. let radius = rootBall.gameObj.width / 2;
  17716. let temp;
  17717. let isIntersect = false;
  17718. for (let index = 0; index < ballArr.length; index++) {
  17719. temp = ballArr[index];
  17720. if (temp.number == rootBall.number)
  17721. continue;
  17722. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17723. if (isIntersect) {
  17724. break;
  17725. }
  17726. }
  17727. return isIntersect;
  17728. }
  17729. hideBallUI() {
  17730. let d2Gan = xGame.common.d2World.d2Gan;
  17731. if (!d2Gan.ui.isDisposed)
  17732. d2Gan.ui.visible = false;
  17733. let d2Help = xGame.common.d2World.d2HelpLine;
  17734. if (!d2Help.ui.isDisposed)
  17735. d2Help.ui.visible = false;
  17736. let rootBall = xGame.common.d2World.rootBall;
  17737. if (!rootBall.destroyed) {
  17738. rootBall.gameObj.active = false;
  17739. }
  17740. }
  17741. showBallUI() {
  17742. let d2Gan = xGame.common.d2World.d2Gan;
  17743. if (!d2Gan.ui.isDisposed)
  17744. d2Gan.ui.visible = true;
  17745. let d2Help = xGame.common.d2World.d2HelpLine;
  17746. if (!d2Help.ui.isDisposed)
  17747. d2Help.ui.visible = true;
  17748. let rootBall = xGame.common.d2World.rootBall;
  17749. if (!rootBall.destroyed) {
  17750. rootBall.gameObj.active = true;
  17751. }
  17752. }
  17753. moveToClickDot(e) {
  17754. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17755. let root = xGame.common.d2World.rootBall.gameObj;
  17756. let xx = e.stageX - xGame.common.sysOffestNum;
  17757. let yy = e.stageY;
  17758. let x = xx - root.x;
  17759. let y = yy - root.y;
  17760. let angle = xGame.common.getfguiRotation(x, y);
  17761. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17762. xGame.common.d2World.getHelpLine();
  17763. }
  17764. this.isMoveRod = false;
  17765. xGame.common.clickedBall = false;
  17766. }
  17767. openAllEvent() {
  17768. this.closeAllEvent();
  17769. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17770. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17771. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17772. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17773. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17774. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17775. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17776. }
  17777. closeAllEvent() {
  17778. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17779. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17780. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17781. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17782. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17783. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17784. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17785. }
  17786. resetGame() {
  17787. this.closeAllEvent();
  17788. this.hideBallUI();
  17789. xGame.common.gameMgr.gamePause = true;
  17790. }
  17791. }
  17792. UIGame$1.uiName = "UIGame";
  17793. class UIAddCoin$1 extends UIBase {
  17794. constructor() {
  17795. super();
  17796. this.coinNum = 2000;
  17797. }
  17798. onConstructor() {
  17799. this.ui = ui_UIAddCoin.createInstance();
  17800. this.contentPane = this.ui;
  17801. this.isEject = false;
  17802. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17803. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17804. }
  17805. show() {
  17806. super.show();
  17807. this.ui.t0.play();
  17808. }
  17809. videoAddCoin() {
  17810. Moyu.showVideoAd(() => {
  17811. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17812. this.hide();
  17813. }, EAdType.addFailCoin);
  17814. }
  17815. }
  17816. UIAddCoin$1.uiName = "UIAddCoin";
  17817. class UIInvitation$1 extends UIBase {
  17818. constructor() {
  17819. super();
  17820. }
  17821. onConstructor() {
  17822. this.ui = ui_UIInvitation.createInstance();
  17823. this.contentPane = this.ui;
  17824. this.isEject = false;
  17825. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17826. }
  17827. show() {
  17828. super.show();
  17829. }
  17830. enterGame() {
  17831. xGame.common.gameMode = GameMode.classic;
  17832. DataMgr.setChallengeTimes(1);
  17833. xGame.common.passAwardCoin = 2000;
  17834. let need = xGame.common.classicNiceNeddCoin;
  17835. if (DataMgr.coinEnough(need)) {
  17836. DataMgr.setCoin(-need);
  17837. xGame.eventMgr.event(RESTART_GAME, true);
  17838. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17839. }
  17840. else {
  17841. xGame.eventMgr.event(RESTART_GAME, true);
  17842. }
  17843. this.hide();
  17844. }
  17845. hide() {
  17846. super.hide();
  17847. }
  17848. }
  17849. UIInvitation$1.uiName = "UIInvitation";
  17850. class UIPower$1 extends UIBase {
  17851. constructor() {
  17852. super();
  17853. }
  17854. onConstructor() {
  17855. this.ui = ui_UIPower.createInstance();
  17856. this.contentPane = this.ui;
  17857. this.isEject = false;
  17858. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17859. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17860. }
  17861. show() {
  17862. super.show();
  17863. this.ui.t0.play();
  17864. }
  17865. videoGetPower() {
  17866. Moyu.showVideoAd(() => {
  17867. DataMgr.setPower(xGame.common.videoPower, true);
  17868. xGame.eventMgr.event(POWER_TIME);
  17869. this.hide();
  17870. }, EAdType.getPower);
  17871. }
  17872. }
  17873. UIPower$1.uiName = "UIPower";
  17874. class UIGameEnd$1 extends UIBase {
  17875. constructor() {
  17876. super();
  17877. this.success = false;
  17878. this.awardCoinNum = 1000;
  17879. this.awardDiamondNum = 10;
  17880. }
  17881. onConstructor() {
  17882. this.ui = ui_UIGameEnd.createInstance();
  17883. this.contentPane = this.ui;
  17884. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17885. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17886. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17887. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17888. this.ui.talkNode.visible = false;
  17889. if (Moyu.isKs)
  17890. this.ui.closeNode.closeBtn.x += 100;
  17891. }
  17892. updateType() {
  17893. switch (xGame.common.gameMode) {
  17894. case GameMode.classic:
  17895. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17896. this.ui.coinNode.visible = this.success;
  17897. if (!this.success) {
  17898. Laya.timer.once(500, this, () => {
  17899. xGame.uiMgr.Show(UIAddCoin$1);
  17900. });
  17901. }
  17902. this.ui.isGetAward.visible = false;
  17903. this.ui.leftBtn.c1.selectedIndex = 3;
  17904. this.ui.rightBtn.c1.selectedIndex = 0;
  17905. this.moneyNode.ui.c1.selectedIndex = 1;
  17906. break;
  17907. case GameMode.bigMove:
  17908. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17909. this.ui.coinNode.visible = this.success;
  17910. if (xGame.common.gameMode == GameMode.bigMove) {
  17911. if (this.success) {
  17912. DataMgr.setSkillSuccessTimes(1, true);
  17913. DataMgr.setSkillAccTimes(1);
  17914. }
  17915. else {
  17916. DataMgr.setSkillSuccessTimes(0, false);
  17917. }
  17918. }
  17919. if (!this.success) {
  17920. Laya.timer.once(500, this, () => {
  17921. xGame.uiMgr.Show(UIAddCoin$1);
  17922. });
  17923. }
  17924. this.ui.isGetAward.visible = false;
  17925. this.ui.leftBtn.c1.selectedIndex = 3;
  17926. this.ui.rightBtn.c1.selectedIndex = 0;
  17927. this.moneyNode.ui.c1.selectedIndex = 1;
  17928. break;
  17929. case GameMode.placeBall:
  17930. this.ui.coinNode.visible = false;
  17931. if (this.success) {
  17932. if (xGame.common.placeBallStarNum == 3) {
  17933. this.ui.c1.selectedIndex = 2;
  17934. }
  17935. else {
  17936. this.ui.c1.selectedIndex = 3;
  17937. }
  17938. }
  17939. else {
  17940. this.ui.c1.selectedIndex = 4;
  17941. }
  17942. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17943. if (cfg.type == PlaceBallType.challenge) {
  17944. this.ui.c1.selectedIndex = 2;
  17945. }
  17946. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  17947. this.updatePlaceBallBtn();
  17948. this.updatePlaceBallStarNum();
  17949. this.updatePlaceBallAwardState();
  17950. this.moneyNode.ui.c1.selectedIndex = 2;
  17951. this.moneyNode.checkPowerTime();
  17952. this.moneyNode.powerChange();
  17953. DataMgr.upRankData();
  17954. break;
  17955. default:
  17956. break;
  17957. }
  17958. }
  17959. updatePlaceBallBtn() {
  17960. this.ui.leftBtn.c1.selectedIndex = 5;
  17961. if (this.success) {
  17962. this.ui.rightBtn.c1.selectedIndex = 14;
  17963. }
  17964. else {
  17965. if (xGame.common.placeBallStarNum == 3) {
  17966. this.ui.rightBtn.c1.selectedIndex = 14;
  17967. }
  17968. else {
  17969. this.ui.rightBtn.c1.selectedIndex = 1;
  17970. }
  17971. }
  17972. }
  17973. updatePlaceBallStarNum() {
  17974. let starNum = xGame.common.placeBallStarNum;
  17975. if (starNum == 0)
  17976. this.ui.starNumNode.c1.selectedIndex = 3;
  17977. else {
  17978. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  17979. }
  17980. }
  17981. updatePlaceBallAwardState() {
  17982. let level = xGame.common.placeBallCurLevel;
  17983. let starNum = xGame.common.placeBallStarNum;
  17984. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  17985. let data = cfgTable.placeballData[level].award;
  17986. let cfg = cfgTable.placeballData[level];
  17987. this.awardDiamondNum = data[1];
  17988. this.awardCoinNum = data[0];
  17989. if (cfg.type == PlaceBallType.challenge) {
  17990. this.awardDiamondNum = 0;
  17991. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  17992. }
  17993. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  17994. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  17995. if (cfg.type == PlaceBallType.challenge) {
  17996. this.ui.awardNode.coinNode.visible = true;
  17997. }
  17998. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  17999. this.ui.awardNode.diamondNode.x = 265;
  18000. this.ui.awardNode.coinNode.x = 354;
  18001. }
  18002. else {
  18003. this.ui.awardNode.diamondNode.x = 291;
  18004. this.ui.awardNode.coinNode.x = 291;
  18005. }
  18006. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18007. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18008. if (this.awardCoinNum == 0) {
  18009. this.ui.awardNode.coinNode.numTxt.text = "";
  18010. }
  18011. if (getAward) {
  18012. this.ui.isGetAward.visible = true;
  18013. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18014. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18015. }
  18016. else {
  18017. this.ui.isGetAward.visible = false;
  18018. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18019. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18020. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18021. }
  18022. else {
  18023. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18024. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18025. }
  18026. }
  18027. }
  18028. show(success) {
  18029. super.show();
  18030. xGame.eventMgr.event(RESET_GAME);
  18031. this.success = success;
  18032. Laya.timer.clearAll(this);
  18033. this.playSecretaryAni();
  18034. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18035. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18036. offsetTime = Math.floor(offsetTime / 1000);
  18037. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18038. this.updateType();
  18039. Laya.timer.once(200, this, () => {
  18040. this.addAward(() => {
  18041. this.updateType();
  18042. Laya.timer.once(500, this, () => {
  18043. this.showChallengeLevel();
  18044. });
  18045. });
  18046. });
  18047. if (this.success) {
  18048. xGame.soundMgr.playSound('slots_roll01');
  18049. xGame.soundMgr.playSound("s_win");
  18050. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18051. }
  18052. else {
  18053. xGame.soundMgr.playSound('matchwin01');
  18054. xGame.soundMgr.playSound("s_lose");
  18055. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18056. }
  18057. if (!Moyu.isLegal)
  18058. PlatMgr.showBanner(true);
  18059. let challengeNum = DataMgr.getChallengeTimes();
  18060. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18061. DataMgr.setChallengeTimes(1);
  18062. }
  18063. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18064. DataMgr.setClassicTimes();
  18065. }
  18066. }
  18067. showChallengeLevel() {
  18068. if (DataMgr.getChallengeTimes() != 0)
  18069. return;
  18070. let skill = DataMgr.getSkillAccTimes();
  18071. let put = DataMgr.getPlaceBallLevelList().length;
  18072. if (skill >= 3 || put >= 5) {
  18073. xGame.uiMgr.Show(UIInvitation$1);
  18074. this.hide();
  18075. }
  18076. }
  18077. addAward(callback) {
  18078. if (!this.success) {
  18079. callback && callback();
  18080. return;
  18081. }
  18082. switch (xGame.common.gameMode) {
  18083. case GameMode.classic:
  18084. this.awardCoinNum = xGame.common.passAwardCoin;
  18085. this.awardDiamondNum = 0;
  18086. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18087. break;
  18088. case GameMode.bigMove:
  18089. this.awardCoinNum = xGame.common.passAwardCoin;
  18090. this.awardDiamondNum = 0;
  18091. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18092. callback && callback();
  18093. break;
  18094. case GameMode.placeBall:
  18095. let level = xGame.common.placeBallCurLevel;
  18096. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18097. if (xGame.common.placeBallStarNum != 3) {
  18098. callback && callback();
  18099. return;
  18100. }
  18101. else {
  18102. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18103. if (getAward) {
  18104. callback && callback();
  18105. return;
  18106. }
  18107. }
  18108. let cfg = cfgTable.placeballData[level];
  18109. let data = cfgTable.placeballData[level].award;
  18110. this.awardCoinNum = data[0];
  18111. this.awardDiamondNum = data[1];
  18112. if (cfg.type == PlaceBallType.challenge) {
  18113. this.awardDiamondNum = 0;
  18114. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18115. }
  18116. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18117. let diamondAward;
  18118. if (this.awardDiamondNum > 0) {
  18119. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18120. xGame.common.getAward([diamondAward, coinAward], callback);
  18121. }
  18122. else {
  18123. xGame.common.getAward([coinAward], callback);
  18124. }
  18125. if (cfg.type == PlaceBallType.normal) {
  18126. DataMgr.setPlaceBallAward(level);
  18127. }
  18128. break;
  18129. default:
  18130. break;
  18131. }
  18132. }
  18133. playSecretaryAni() {
  18134. let parent = this.ui.secretary.displayObject;
  18135. parent.destroyChildren();
  18136. let xx = this.ui.secretary.width / 2;
  18137. let yy = this.ui.secretary.height;
  18138. let scale = xGame.common.getSecretaryScale();
  18139. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18140. if (this.success) {
  18141. let rand = Math.random() <= 0.5 ? 2 : 3;
  18142. xGame.common.secretary.play(data, rand, false, parent, () => {
  18143. xGame.common.secretary.play(data, 1, true, parent);
  18144. });
  18145. }
  18146. else {
  18147. xGame.common.secretary.play(data, 0, true, parent);
  18148. }
  18149. }
  18150. restartGame() {
  18151. switch (xGame.common.gameMode) {
  18152. case GameMode.classic:
  18153. xGame.eventMgr.event(RESTART_GAME);
  18154. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18155. break;
  18156. case GameMode.bigMove:
  18157. this.hide();
  18158. xGame.eventMgr.event(RESTART_GAME);
  18159. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18160. break;
  18161. default:
  18162. break;
  18163. }
  18164. }
  18165. hide() {
  18166. super.hide();
  18167. xGame.common.stopGirlPop(this.ui.talkNode);
  18168. PlatMgr.showBanner(false);
  18169. }
  18170. returnHome() {
  18171. this.hide();
  18172. let showFailWords = !this.success;
  18173. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18174. }
  18175. clickLeftBtn() {
  18176. switch (xGame.common.gameMode) {
  18177. case GameMode.classic:
  18178. case GameMode.bigMove:
  18179. this.returnHome();
  18180. break;
  18181. case GameMode.placeBall:
  18182. let level = xGame.common.placeBallCurLevel;
  18183. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18184. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18185. break;
  18186. default:
  18187. break;
  18188. }
  18189. }
  18190. powerStartPlaceBallLevel(level, btn) {
  18191. if (DataMgr.powerEnough()) {
  18192. btn.touchable = false;
  18193. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18194. btn.touchable = true;
  18195. DataMgr.setPower(-1);
  18196. xGame.eventMgr.event(POWER_TIME);
  18197. this.startPlaceBallLevel(level);
  18198. }));
  18199. }
  18200. else {
  18201. xGame.uiMgr.Show(UIPower$1, 0);
  18202. }
  18203. }
  18204. clickRightBtn() {
  18205. switch (xGame.common.gameMode) {
  18206. case GameMode.classic:
  18207. case GameMode.bigMove:
  18208. this.restartGame();
  18209. break;
  18210. case GameMode.placeBall:
  18211. let level = xGame.common.placeBallCurLevel;
  18212. let data = DataMgr.getPlaceBallLevel(level);
  18213. let curPss = data.play && !data.isCur;
  18214. if (curPss) {
  18215. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18216. }
  18217. else {
  18218. Moyu.sendDataEvent("placeBallNextLevel");
  18219. Moyu.showVideoAd(() => {
  18220. DataMgr.setPlaceBallLevel(level, 1);
  18221. this.startPlaceBallLevel(level + 1);
  18222. }, xGame.define.EAdType.placeBallNextLevel);
  18223. }
  18224. break;
  18225. default:
  18226. break;
  18227. }
  18228. }
  18229. startPlaceBallLevel(level) {
  18230. xGame.common.gameMode = GameMode.placeBall;
  18231. xGame.common.placeBallCurLevel = level;
  18232. xGame.uiMgr.Show(UIGame$1);
  18233. this.hide();
  18234. }
  18235. }
  18236. UIGameEnd$1.uiName = "UIGameEnd";
  18237. class ShowItem$1 {
  18238. constructor() {
  18239. this.ui = ui_ShowItem.createInstance();
  18240. }
  18241. destroySelf() {
  18242. if (!this.ui.isDisposed) {
  18243. this.ui.removeFromParent();
  18244. this.ui.dispose();
  18245. }
  18246. }
  18247. setParent(parent) {
  18248. parent.addChild(this.ui);
  18249. }
  18250. setPos(x, y) {
  18251. this.ui.x = x;
  18252. this.ui.y = y;
  18253. }
  18254. setUrl(index) {
  18255. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18256. }
  18257. }
  18258. class UILevelProp$1 extends UIBase {
  18259. constructor() {
  18260. super();
  18261. this.firstPos = 385;
  18262. this.secondPos = 467;
  18263. this.showItemArr = [];
  18264. }
  18265. onConstructor() {
  18266. this.ui = ui_UILevelProp.createInstance();
  18267. this.contentPane = this.ui;
  18268. this.isEject = false;
  18269. this.addUIClick(this.ui.closeBtn, this.hide);
  18270. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18271. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18272. }
  18273. show(level) {
  18274. super.show();
  18275. this.ui.t1.play();
  18276. this.level = level;
  18277. this.data = cfgTable.placeballData[this.level];
  18278. this.updateSelf();
  18279. this.showPreView();
  18280. this.moneyNode.ui.c1.selectedIndex = 2;
  18281. this.moneyNode.checkPowerTime();
  18282. this.moneyNode.powerChange();
  18283. }
  18284. showPreView() {
  18285. let item;
  18286. let data;
  18287. for (let index = 0; index < this.showItemArr.length; index++) {
  18288. item = this.showItemArr[index];
  18289. item.destroySelf();
  18290. }
  18291. this.showItemArr = [];
  18292. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18293. for (const key in cfgData) {
  18294. data = cfgData[key];
  18295. item = new ShowItem$1();
  18296. item.setParent(this.ui.myNode.displayRoot);
  18297. item.setPos(data.x, data.y);
  18298. item.setUrl(data.value);
  18299. this.showItemArr.push(item);
  18300. }
  18301. }
  18302. updateSelf() {
  18303. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18304. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18305. if (this.data.ball == -1) {
  18306. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18307. }
  18308. else {
  18309. this.ui.myNode.conditionTxt.text = "Reward";
  18310. }
  18311. let localData = DataMgr.getPlaceBallLevel(this.level);
  18312. let getAward = localData.getAward;
  18313. let cfg = cfgTable.placeballData[this.level];
  18314. let coin = this.data.award[0];
  18315. let diamond = this.data.award[1];
  18316. if (cfg.type == PlaceBallType.challenge) {
  18317. diamond = 0;
  18318. coin = 100;
  18319. }
  18320. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18321. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18322. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18323. if (cfg.type == PlaceBallType.challenge) {
  18324. this.ui.myNode.coinNode.numTxt.text = "";
  18325. }
  18326. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18327. if (coin > 0 && diamond > 0) {
  18328. this.ui.myNode.diamondNode.x = 385;
  18329. this.ui.myNode.coinNode.x = 467;
  18330. }
  18331. else {
  18332. this.ui.myNode.diamondNode.x = 385;
  18333. this.ui.myNode.coinNode.x = 385;
  18334. }
  18335. if (!getAward) {
  18336. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18337. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18338. }
  18339. else {
  18340. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18341. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18342. }
  18343. }
  18344. startGame() {
  18345. if (DataMgr.powerEnough()) {
  18346. this.ui.myNode.startBtn.touchable = false;
  18347. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18348. console.log('zh:startGame ');
  18349. this.ui.myNode.startBtn.touchable = true;
  18350. DataMgr.setPower(-1);
  18351. xGame.eventMgr.event(POWER_TIME);
  18352. xGame.common.gameMode = GameMode.placeBall;
  18353. xGame.common.placeBallCurLevel = this.level;
  18354. xGame.uiMgr.Show(UIGame$1);
  18355. xGame.uiMgr.Hide(UILevelDisplay$1);
  18356. xGame.uiMgr.Hide(UIMain$1);
  18357. this.hide();
  18358. }));
  18359. }
  18360. else {
  18361. xGame.uiMgr.Show(UIPower$1);
  18362. }
  18363. }
  18364. hide() {
  18365. super.hide();
  18366. }
  18367. }
  18368. UILevelProp$1.uiName = "UILevelProp";
  18369. class PutBallLevelDisplay$1 {
  18370. constructor(ui, index) {
  18371. this.index = 0;
  18372. this.ui = ui;
  18373. this.index = index;
  18374. this.ui.onClick(this, this.clickSelf);
  18375. this.updateSelf();
  18376. this.ui.levelTxt.text = (this.index + 1) + "";
  18377. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18378. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18379. }
  18380. updateSelf() {
  18381. let level = this.index + 1;
  18382. this.data = DataMgr.getPlaceBallLevel(level);
  18383. this.ui.starNode.c1.selectedIndex = this.data.star;
  18384. let isChallenge = cfgTable.placeballData[level].type;
  18385. if (this.data.isCur) {
  18386. if (isChallenge) {
  18387. this.ui.c1.selectedIndex = 5;
  18388. }
  18389. else {
  18390. this.ui.c1.selectedIndex = 2;
  18391. }
  18392. }
  18393. else {
  18394. if (this.data.play) {
  18395. if (this.data.star == 3) {
  18396. this.ui.c1.selectedIndex = 0;
  18397. }
  18398. else {
  18399. this.ui.c1.selectedIndex = 1;
  18400. }
  18401. }
  18402. else {
  18403. if (isChallenge) {
  18404. this.ui.c1.selectedIndex = 4;
  18405. }
  18406. else {
  18407. this.ui.c1.selectedIndex = 3;
  18408. }
  18409. }
  18410. }
  18411. }
  18412. clickSelf() {
  18413. if (!this.data.play)
  18414. return;
  18415. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18416. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18417. }
  18418. }
  18419. class UILevelDisplay$1 extends UIBase {
  18420. constructor() {
  18421. super();
  18422. }
  18423. onConstructor() {
  18424. this.ui = ui_UILevelDisplay.createInstance();
  18425. this.contentPane = this.ui;
  18426. this.isEject = false;
  18427. this.myList = this.ui.myNode.myList;
  18428. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18429. this.levelItemArr = [];
  18430. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18431. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18432. this.myList.numItems = levelNum;
  18433. if (Moyu.isKs)
  18434. this.ui.closeNode.closeBtn.x += 100;
  18435. }
  18436. levelItemRender(index, target) {
  18437. let item = new PutBallLevelDisplay$1(target, index);
  18438. this.levelItemArr.push(item);
  18439. }
  18440. show() {
  18441. super.show();
  18442. this.updateLevel();
  18443. this.scrollToPlace();
  18444. }
  18445. updateLevel() {
  18446. let temp;
  18447. for (let index = 0; index < this.levelItemArr.length; index++) {
  18448. temp = this.levelItemArr[index];
  18449. temp.updateSelf();
  18450. }
  18451. }
  18452. scrollToPlace() {
  18453. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18454. let passArr = DataMgr.getPlaceBallLevelList();
  18455. let offest = passArr.length;
  18456. if (offest >= maxNum - 1)
  18457. offest = maxNum - 1;
  18458. this.myList.scrollToView(offest, true, true);
  18459. }
  18460. hide() {
  18461. super.hide();
  18462. }
  18463. }
  18464. UILevelDisplay$1.uiName = "UILevelDisplay";
  18465. class UIMatching$1 extends UIBase {
  18466. constructor() {
  18467. super();
  18468. }
  18469. onConstructor() {
  18470. this.ui = ui_UIMatching.createInstance();
  18471. this.contentPane = this.ui;
  18472. this.isEject = false;
  18473. }
  18474. show(callback) {
  18475. super.show();
  18476. PlatMgr.showBanner(true);
  18477. this.callback = callback;
  18478. let user = Moyu.getUserInfo();
  18479. if (!this.selfPot) {
  18480. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18481. }
  18482. if (!this.aiPot) {
  18483. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18484. }
  18485. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18486. this.ui.selfHead.nameTxt.text = user.nickName;
  18487. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18488. this.ui.aiHead.nameTxt.text = "???";
  18489. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18490. this.ui.selfHead.c1.selectedIndex = 0;
  18491. this.ui.aiHead.c1.selectedIndex = 0;
  18492. this.ui.selfHead.x = this.selfPot.x;
  18493. this.ui.selfHead.y = this.selfPot.y;
  18494. this.ui.aiHead.x = this.aiPot.x;
  18495. this.ui.aiHead.y = this.aiPot.y;
  18496. switch (xGame.common.gameMode) {
  18497. case GameMode.classic:
  18498. break;
  18499. case GameMode.bigMove:
  18500. this.initSkillData();
  18501. break;
  18502. default:
  18503. break;
  18504. }
  18505. this.ui.t1.play(Laya.Handler.create(this, () => {
  18506. this.ui.t2.play(Laya.Handler.create(this, () => {
  18507. switch (xGame.common.gameMode) {
  18508. case GameMode.classic:
  18509. this.waitingPeople();
  18510. break;
  18511. case GameMode.bigMove:
  18512. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18513. break;
  18514. default:
  18515. break;
  18516. }
  18517. }));
  18518. }));
  18519. }
  18520. initSkillData() {
  18521. this.skillSelectData = [];
  18522. let skillUrl = xGame.common.skillIconList;
  18523. let skillName = xGame.common.skillNameList;
  18524. let skillLevel = DataMgr.getBigSkillList();
  18525. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18526. for (let index = 0; index < 5; index++) {
  18527. let obj = {};
  18528. obj.skillImg = skillUrl[index];
  18529. obj.skillName = skillName[index];
  18530. obj.skillType = skillType[index];
  18531. obj.skillLevel = skillLevel[index];
  18532. this.skillSelectData.push(obj);
  18533. }
  18534. }
  18535. getAISkillLevel(myLevel) {
  18536. let video = xGame.common.upSkillLevel;
  18537. let aiLevel;
  18538. let temp;
  18539. if (video) {
  18540. temp = xGame.common.randomNum(-2, -1);
  18541. }
  18542. else {
  18543. if (myLevel <= 5) {
  18544. temp = xGame.common.randomNum(1, 3);
  18545. }
  18546. else if (myLevel <= 9) {
  18547. temp = xGame.common.randomNum(-2, 1);
  18548. }
  18549. else {
  18550. temp = xGame.common.randomNum(-4, 0);
  18551. }
  18552. }
  18553. aiLevel = temp + myLevel;
  18554. if (aiLevel <= 1)
  18555. aiLevel = 1;
  18556. if (aiLevel >= 10)
  18557. aiLevel = 10;
  18558. return aiLevel;
  18559. }
  18560. getAISkillType() {
  18561. return xGame.common.randomNum(1, 4);
  18562. let successTimes = DataMgr.getSkillSuccessTimes();
  18563. let info = cfgTable.aiskillData[successTimes];
  18564. if (!info) {
  18565. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18566. info = cfgTable.aiskillData[max];
  18567. }
  18568. let dataArr = info.skillselect;
  18569. let myCfg = {};
  18570. for (let index = 0; index < dataArr.length; index++) {
  18571. let temp = dataArr[index].split('-');
  18572. myCfg[temp[0]] = {};
  18573. myCfg[temp[0]].id = parseInt(temp[0]);
  18574. myCfg[temp[0]].weight = parseInt(temp[1]);
  18575. }
  18576. let aiCfg = xGame.common.initWeight(myCfg);
  18577. let curData = xGame.common.getRandomWeightData(aiCfg);
  18578. return parseInt(curData.id);
  18579. }
  18580. getAISkillData(index) {
  18581. let myLevel = this.skillSelectData[index].skillLevel;
  18582. let aiLevel = this.getAISkillLevel(myLevel);
  18583. let aiType = this.getAISkillType() - 1;
  18584. return { aiLevel, aiType } = { aiLevel, aiType };
  18585. }
  18586. skillSelectFinish(index) {
  18587. let aiInfo = this.getAISkillData(index);
  18588. xGame.common.gameMgr.selfCurSkill = index;
  18589. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18590. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18591. this.ui.selfHead.c1.selectedIndex = 1;
  18592. this.ui.aiHead.c1.selectedIndex = 1;
  18593. let myData = this.skillSelectData[index];
  18594. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18595. let guide = DataMgr.getSkillGuide();
  18596. if (guide == 0) {
  18597. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18598. }
  18599. else {
  18600. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18601. }
  18602. let aiData = this.skillSelectData[aiInfo.aiType];
  18603. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18604. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18605. this.waitingPeople();
  18606. }
  18607. waitingPeople() {
  18608. let time = xGame.common.randomNum(1000, 3000);
  18609. time += 1000;
  18610. Laya.timer.once(time, this, () => {
  18611. this.matchingSuccess();
  18612. });
  18613. }
  18614. matchingSuccess() {
  18615. let gameUI = xGame.common.gameUI;
  18616. let name = gameUI.ui.topNode.aiNameTxt.text;
  18617. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18618. this.ui.aiHead.nameTxt.text = name;
  18619. this.ui.aiHead.headImg.url = url;
  18620. name = gameUI.ui.topNode.selfNameTxt.text;
  18621. url = gameUI.ui.topNode.selfHeadLoader.url;
  18622. this.ui.selfHead.nameTxt.text = name;
  18623. this.ui.selfHead.headImg.url = url;
  18624. this.ui.t3.play(Laya.Handler.create(this, () => {
  18625. this.callback && this.callback();
  18626. this.ui.t4.play(Laya.Handler.create(this, () => {
  18627. this.destroySelf();
  18628. }));
  18629. }));
  18630. }
  18631. destroySelf() {
  18632. this.callback = null;
  18633. this.skillSelectData = null;
  18634. this.selfPot = null;
  18635. this.aiPot = null;
  18636. if (!this.ui.isDisposed) {
  18637. this.ui.removeFromParent();
  18638. this.ui.dispose();
  18639. }
  18640. xGame.uiMgr.destroyUI(this);
  18641. }
  18642. }
  18643. UIMatching$1.uiName = "UIMatching";
  18644. class SkillDisplay$1 {
  18645. constructor(ui, data, uiIndex) {
  18646. this.starX = 0;
  18647. this.starY = 0;
  18648. this.index = 0;
  18649. this.ui = ui;
  18650. this.data = data;
  18651. this.index = uiIndex;
  18652. this.initSelf();
  18653. console.log('zh:SkillDisplay constructor this.skillData=', data);
  18654. }
  18655. initSelf() {
  18656. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18657. this.ui.nameTxt.text = this.data.name;
  18658. this.ui.describeTxt.text = this.data.describe;
  18659. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18660. this.ui.startBtn.onClick(this, this.startGame);
  18661. this.updateSelf();
  18662. }
  18663. updateSelf() {
  18664. this.checkTry();
  18665. let level = DataMgr.getBigSkillByIndex(this.index);
  18666. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18667. }
  18668. checkTry() {
  18669. let index = this.index;
  18670. let level = DataMgr.getBigSkillByIndex(index);
  18671. if (level == null) {
  18672. DataMgr.setBigSkill(index, 1, false);
  18673. level = 1;
  18674. }
  18675. this.ui.levelTxt.text = "LV." + level;
  18676. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18677. this.ui.tryNode.visible = true;
  18678. else
  18679. this.ui.tryNode.visible = false;
  18680. }
  18681. clickAddLevel() {
  18682. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18683. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18684. Moyu.showVideoAd(() => {
  18685. DataMgr.setBigSkill(this.data.index, 1);
  18686. this.updateSelf();
  18687. xGame.common.upSkillLevel = true;
  18688. }, EAdType.upSkill);
  18689. }
  18690. startGame() {
  18691. if (this.data.index == 3) {
  18692. alert('Coming soon!');
  18693. return;
  18694. }
  18695. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18696. let needCoin = xGame.common.bigMoveNeedCoin;
  18697. xGame.common.passAwardCoin = 2000;
  18698. let guide = DataMgr.getSkillGuide();
  18699. console.log('zh:startGame guide=' + guide);
  18700. xGame.common.temSelfLevel = 0;
  18701. if (guide == 0) {
  18702. needCoin = 0;
  18703. xGame.common.temSelfLevel = 100;
  18704. }
  18705. if (DataMgr.coinEnough(needCoin)) {
  18706. DataMgr.setCoin(-needCoin);
  18707. xGame.common.curPlayerSkillType = this.index;
  18708. if (guide == 0)
  18709. xGame.common.curPlayerSkillType = 0;
  18710. xGame.uiMgr.Show(UIGame$1);
  18711. xGame.uiMgr.Hide(UIMain$1);
  18712. xGame.uiMgr.Show(UIMatching$1, () => {
  18713. xGame.common.gameUI.ui.alpha = 1;
  18714. xGame.common.gameUI.startGame();
  18715. xGame.uiMgr.Hide(UISkill$1);
  18716. });
  18717. }
  18718. else {
  18719. xGame.uiMgr.Show(UIAddProp$1, 0);
  18720. Moyu.sendDataEvent("AddCoinVideo");
  18721. }
  18722. }
  18723. }
  18724. class UISkill$1 extends UIBase {
  18725. constructor() {
  18726. super();
  18727. this.skillData = [];
  18728. }
  18729. onConstructor() {
  18730. this.ui = ui_UISkill.createInstance();
  18731. this.contentPane = this.ui;
  18732. this.isEject = false;
  18733. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18734. this.initSkillData();
  18735. console.log('zh:aaaaaa1111111111');
  18736. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18737. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18738. console.log('zh:aaaaaa22222222');
  18739. this.displayList = [];
  18740. this.ui.skillNode.skillList.numItems = 3;
  18741. this.addUIClick(this.ui, this.interuptSecretary);
  18742. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18743. this.ui.talkNode.visible = false;
  18744. if (Moyu.isKs)
  18745. this.ui.closeNode.closeBtn.x += 100;
  18746. }
  18747. show() {
  18748. super.show();
  18749. this.playSecretaryIdle();
  18750. this.moneyNode.ui.c1.selectedIndex = 1;
  18751. Laya.timer.clearAll(this);
  18752. xGame.soundMgr.playSound("s_start");
  18753. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18754. let guide = DataMgr.getSkillGuide();
  18755. this.ui.guideNode.visible = guide == 0;
  18756. let item = this.getSkillItemByUIIndex(0);
  18757. if (guide == 0) {
  18758. item.ui.c1.selectedIndex = 1;
  18759. }
  18760. else {
  18761. item.ui.c1.selectedIndex = 0;
  18762. }
  18763. this.ui.guideNode.guideBtn.visible = guide == 0;
  18764. for (let index = 0; index < this.displayList.length; index++) {
  18765. this.displayList[index].checkTry();
  18766. }
  18767. }
  18768. getSkillItemByUIIndex(cur) {
  18769. for (let index = 0; index < this.displayList.length; index++) {
  18770. if (this.displayList[index].index == cur) {
  18771. return this.displayList[index];
  18772. }
  18773. }
  18774. }
  18775. enterGuideLevel() {
  18776. let item = this.getSkillItemByUIIndex(0);
  18777. item.startGame();
  18778. if (DataMgr.getNewUser())
  18779. Moyu.sendDataEvent("gameStart1");
  18780. }
  18781. initSkillData() {
  18782. this.skillData = [];
  18783. let nameList = xGame.common.skillNameList;
  18784. let iconList = xGame.common.skillIconList;
  18785. let describeList = [
  18786. "Jump shot executed — ball bounced and pocketed an extra one!",
  18787. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  18788. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  18789. ];
  18790. console.log('zh:initSkillData 111111111');
  18791. let data;
  18792. for (let index = 0; index < nameList.length; index++) {
  18793. data = {};
  18794. data.name = nameList[index];
  18795. data.icon = iconList[index];
  18796. data.describe = describeList[index];
  18797. data.index = index;
  18798. this.skillData.push(data);
  18799. }
  18800. }
  18801. updateSkillItem(index, target) {
  18802. if (this.displayList[index] == null) {
  18803. let uiIndex;
  18804. switch (index) {
  18805. case 0:
  18806. uiIndex = 1;
  18807. break;
  18808. case 1:
  18809. uiIndex = 0;
  18810. break;
  18811. case 2:
  18812. uiIndex = 2;
  18813. break;
  18814. case 3:
  18815. uiIndex = 3;
  18816. break;
  18817. default:
  18818. break;
  18819. }
  18820. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18821. this.displayList.push(temp);
  18822. }
  18823. }
  18824. playSecretaryIdle() {
  18825. let parent = this.ui.secretary.displayObject;
  18826. parent.destroyChildren();
  18827. let xx = this.ui.secretary.width / 2;
  18828. let yy = this.ui.secretary.height;
  18829. let scale = xGame.common.getSecretaryScale();
  18830. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18831. xGame.common.secretary.play(data, 1, true, parent);
  18832. }
  18833. returnUIMain() {
  18834. this.hide();
  18835. xGame.common.stopGirlPop(this.ui.talkNode);
  18836. xGame.uiMgr.Show(UIMain$1);
  18837. }
  18838. interuptSecretary() {
  18839. Laya.timer.clearAll(this);
  18840. this.playSecretaryRandomSound();
  18841. }
  18842. playSecretaryRandomSound() {
  18843. if (this.isHide)
  18844. return;
  18845. let time = xGame.common.randomNum(45000, 60000);
  18846. Laya.timer.once(time, this, () => {
  18847. if (this.isHide)
  18848. return;
  18849. let index = xGame.common.randomNum(4, 7);
  18850. xGame.soundMgr.playSound("s_main0" + index);
  18851. let words = 1;
  18852. switch (index) {
  18853. case 4:
  18854. words = 5;
  18855. break;
  18856. case 5:
  18857. words = 3;
  18858. break;
  18859. case 6:
  18860. words = 6;
  18861. break;
  18862. case 7:
  18863. words = 7;
  18864. break;
  18865. default:
  18866. break;
  18867. }
  18868. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18869. this.playSecretaryRandomSound();
  18870. });
  18871. }
  18872. }
  18873. UISkill$1.uiName = "UISkill";
  18874. class UIAddProp$1 extends UIBase {
  18875. constructor() {
  18876. super();
  18877. this.curType = "";
  18878. }
  18879. onConstructor() {
  18880. this.ui = ui_UIAddProp.createInstance();
  18881. this.contentPane = this.ui;
  18882. this.isEject = false;
  18883. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18884. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18885. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18886. this.updateUI();
  18887. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18888. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18889. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18890. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18891. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18892. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18893. }
  18894. show(type) {
  18895. super.show();
  18896. this.curType = type == 0 ? "coin" : "diamond";
  18897. this.switchBtn("");
  18898. this.ui.t0.play();
  18899. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18900. PlatMgr.showInsert(true);
  18901. }
  18902. closeSelf() {
  18903. this.hide();
  18904. }
  18905. updateUI() {
  18906. let data = cfgTable.moneyData;
  18907. let temp;
  18908. let obj;
  18909. for (const key in data) {
  18910. temp = data[key];
  18911. obj = this.ui.myNode["node" + key];
  18912. if (parseInt(key) <= 2) {
  18913. obj.diamondTxt.text = "+" + temp.num;
  18914. }
  18915. else {
  18916. obj.coinTxt.text = temp.num;
  18917. obj.diamondTxt.text = temp.get.split('_')[1];
  18918. }
  18919. }
  18920. this.updateDiamondShare();
  18921. }
  18922. updateDiamondShare() {
  18923. let data = DataMgr.getShareDiamondTimes();
  18924. if (data >= xGame.common.maxShareDiamondTimes) {
  18925. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  18926. this.ui.myNode.node1.touchable = false;
  18927. }
  18928. else {
  18929. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  18930. this.ui.myNode.node1.touchable = true;
  18931. }
  18932. }
  18933. switchBtn(type) {
  18934. if (type == "")
  18935. type = this.curType;
  18936. else {
  18937. if (this.curType == type) {
  18938. return;
  18939. }
  18940. else {
  18941. this.curType = type;
  18942. }
  18943. }
  18944. if (type == "coin") {
  18945. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  18946. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  18947. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  18948. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  18949. this.ui.myNode.c1.selectedIndex = 0;
  18950. }
  18951. else {
  18952. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  18953. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  18954. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  18955. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  18956. this.ui.myNode.c1.selectedIndex = 1;
  18957. }
  18958. }
  18959. convertCoin(index) {
  18960. let data = cfgTable.moneyData[index];
  18961. let coinNum = data.num;
  18962. let str = data.get.split('_')[1];
  18963. let needDiamond = parseInt(str);
  18964. if (DataMgr.diamondEnough(needDiamond)) {
  18965. DataMgr.setDiamond(-needDiamond);
  18966. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  18967. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  18968. }
  18969. else {
  18970. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  18971. this.switchBtn("diamond");
  18972. }
  18973. }
  18974. videoGetDiamond() {
  18975. let num = cfgTable.moneyData[2].num;
  18976. Moyu.showVideoAd(() => {
  18977. xGame.common.playObjFlyAnim(num, Prop.diamond);
  18978. this.closeSelf();
  18979. }, EAdType.addDiamond);
  18980. }
  18981. videoGetCoin() {
  18982. Moyu.showVideoAd(() => {
  18983. xGame.common.playObjFlyAnim(2000, Prop.coin);
  18984. this.closeSelf();
  18985. }, EAdType.addCoin);
  18986. }
  18987. shareGetDiamond() {
  18988. let times = DataMgr.getShareDiamondTimes();
  18989. if (times >= xGame.common.maxShareDiamondTimes) {
  18990. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  18991. }
  18992. else {
  18993. if (Moyu.isTT) {
  18994. let num = cfgTable.moneyData[1].num;
  18995. Moyu.shareVideo = '';
  18996. Moyu.shareGame((success) => {
  18997. if (success) {
  18998. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  18999. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19000. DataMgr.setShareDiamondTimes(1);
  19001. this.updateDiamondShare();
  19002. }
  19003. else {
  19004. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19005. }
  19006. });
  19007. }
  19008. else {
  19009. Moyu.showVideoAd(() => {
  19010. let diamond = xGame.common.randomNum(50, 100);
  19011. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19012. DataMgr.setShareDiamondTimes(1);
  19013. this.updateDiamondShare();
  19014. }, EAdType.randomDiamond);
  19015. }
  19016. }
  19017. }
  19018. openPutBallView() {
  19019. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19020. let skill = xGame.uiMgr.getUI(UISkill$1);
  19021. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19022. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19023. if (end && !end.isHide) {
  19024. xGame.uiMgr.Hide(UIGameEnd$1);
  19025. xGame.uiMgr.Show(UIMain$1);
  19026. }
  19027. if (skill && !skill.isHide)
  19028. xGame.uiMgr.Hide(UISkill$1);
  19029. if (uigame && !uigame.isHide)
  19030. xGame.uiMgr.Hide(UIGame$1);
  19031. if (level && !level.isHide) {
  19032. }
  19033. else {
  19034. xGame.uiMgr.Show(UILevelDisplay$1);
  19035. }
  19036. this.closeSelf();
  19037. }
  19038. }
  19039. UIAddProp$1.uiName = "UIAddProp";
  19040. class MoneyNode$1 {
  19041. constructor(ui) {
  19042. this.leftTime = 0;
  19043. this.ui = ui;
  19044. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19045. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19046. this.ui.addPowerBtn.onClick(this, this.addPower);
  19047. this.ui.c1.selectedIndex = 1;
  19048. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19049. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19050. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19051. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19052. this.coinChange();
  19053. this.diamondChange();
  19054. this.powerChange();
  19055. }
  19056. addPower() {
  19057. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19058. xGame.uiMgr.Show(UIPower$1);
  19059. }
  19060. powerChange() {
  19061. let powerNum = DataMgr.getPower();
  19062. this.ui.powerTxt.text = powerNum + "";
  19063. }
  19064. checkPowerTime() {
  19065. let cur = new Date().getTime();
  19066. let last = DataMgr.getPowerTime();
  19067. if (last == 0) {
  19068. last = cur;
  19069. DataMgr.setPowerTime(cur);
  19070. }
  19071. let power = DataMgr.getPower();
  19072. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19073. Laya.timer.clearAll(this);
  19074. if (power >= xGame.common.natureMaxPower) {
  19075. this.ui.powerTimeTxt.text = "";
  19076. DataMgr.setPowerTime(cur);
  19077. return;
  19078. }
  19079. if (power + offset >= xGame.common.natureMaxPower) {
  19080. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19081. this.ui.powerTimeTxt.text = "";
  19082. DataMgr.setPowerTime(cur);
  19083. }
  19084. else {
  19085. if (offset > 0) {
  19086. DataMgr.setPower(offset);
  19087. DataMgr.setPowerTime(cur);
  19088. }
  19089. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19090. this.leftTime = xGame.common.powerRecoverNum - time;
  19091. if (this.leftTime <= 0)
  19092. this.leftTime = 0;
  19093. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19094. Laya.timer.loop(1000, this, this.updatePowerTime);
  19095. }
  19096. }
  19097. updatePowerTime() {
  19098. this.leftTime -= 1;
  19099. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19100. if (this.leftTime <= 0) {
  19101. this.checkPowerTime();
  19102. }
  19103. }
  19104. coinChange() {
  19105. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19106. }
  19107. diamondChange() {
  19108. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19109. }
  19110. addCoin() {
  19111. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19112. Moyu.sendDataEvent("AddCoinBtn");
  19113. xGame.uiMgr.Show(UIAddProp$1, 0);
  19114. }
  19115. addDiamond() {
  19116. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19117. Moyu.sendDataEvent("AddDiamondBtn");
  19118. xGame.uiMgr.Show(UIAddProp$1, 1);
  19119. }
  19120. }
  19121. class SettingNode$1 {
  19122. constructor(ui) {
  19123. this.showSetting = false;
  19124. this.openSound = true;
  19125. this.openShake = true;
  19126. this.ui = ui;
  19127. this.ui.soundBtn.onClick(this, this.switchSound);
  19128. this.ui.shakeBtn.onClick(this, this.switchShake);
  19129. this.ui.xyBtn.onClick(this, this.onXy);
  19130. this.ui.clickNode.onClick(this, this.changeSetting);
  19131. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19132. }
  19133. changeSetting() {
  19134. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19135. this.showSetting = !this.showSetting;
  19136. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19137. }
  19138. switchSound() {
  19139. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19140. this.openSound = !this.openSound;
  19141. Moyu.onSetting(this.openSound, this.openShake);
  19142. xGame.soundMgr.onSetting(this.openSound);
  19143. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19144. }
  19145. switchShake() {
  19146. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19147. this.openShake = !this.openShake;
  19148. Moyu.onSetting(this.openSound, this.openShake);
  19149. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19150. }
  19151. onXy() {
  19152. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19153. MoyuMgr$1.showXy(1);
  19154. }
  19155. }
  19156. class UIDraw$1 extends UIBase {
  19157. constructor() {
  19158. super();
  19159. this.curKey = 0;
  19160. }
  19161. onConstructor() {
  19162. this.ui = ui_UIDraw.createInstance();
  19163. this.contentPane = this.ui;
  19164. this.isEject = false;
  19165. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19166. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19167. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19168. this.initDraw();
  19169. this.initUI();
  19170. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19171. if (Moyu.isKs)
  19172. this.ui.closeNode.closeBtn.x += 100;
  19173. }
  19174. show() {
  19175. super.show();
  19176. this.ui.t0.play();
  19177. this.playSecretaryIdle();
  19178. this.updateDraw();
  19179. this.checkFree();
  19180. if (PlatMgr.bannerDelay > 0) {
  19181. this.ui.closeNode.closeBtn.visible = false;
  19182. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19183. this.ui.closeNode.closeBtn.visible = true;
  19184. });
  19185. }
  19186. PlatMgr.showRateBanner();
  19187. }
  19188. hide() {
  19189. Laya.timer.clearAll(this);
  19190. super.hide();
  19191. }
  19192. checkFree() {
  19193. let isFree = DataMgr.getDailyfreeDrawTimes();
  19194. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19195. }
  19196. initDraw() {
  19197. this.drawObj = [];
  19198. let data = cfgTable.drawData;
  19199. let temp;
  19200. let weight = 0;
  19201. for (const key in data) {
  19202. temp = data[key];
  19203. weight += temp.weight;
  19204. this.drawObj.push(weight);
  19205. }
  19206. this.allWeight = weight;
  19207. }
  19208. initUI() {
  19209. let data = cfgTable.drawData;
  19210. let temp;
  19211. let img;
  19212. let txt;
  19213. for (const key in data) {
  19214. temp = data[key];
  19215. img = this.ui.myNode.rotNode["img" + key];
  19216. txt = this.ui.myNode.rotNode["txt" + key];
  19217. img.url = xGame.common.getGameIconUrl(temp.icon);
  19218. txt.visible = true;
  19219. if (temp.award > 2) {
  19220. img.rotation = 0;
  19221. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19222. }
  19223. else {
  19224. img.rotation = temp.rotation;
  19225. txt.text = temp.num;
  19226. }
  19227. }
  19228. }
  19229. getCurkey() {
  19230. let rand = Math.random() * this.allWeight;
  19231. let temp;
  19232. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19233. temp = this.drawObj[index];
  19234. if (index == 0) {
  19235. if (rand < temp) {
  19236. return index + 1;
  19237. }
  19238. }
  19239. else {
  19240. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19241. return index + 1;
  19242. }
  19243. }
  19244. }
  19245. return 2;
  19246. }
  19247. startDraw() {
  19248. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19249. if (freeTimes > 0) {
  19250. this.beginDraw();
  19251. DataMgr.setDailyfreeDrawTimes(0);
  19252. this.checkFree();
  19253. }
  19254. else {
  19255. Moyu.sendDataEvent("turntable");
  19256. Moyu.showVideoAd(() => {
  19257. this.beginDraw();
  19258. }, EAdType.draw);
  19259. }
  19260. }
  19261. beginDraw() {
  19262. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19263. this.ui.drawBtn.touchable = false;
  19264. this.curKey = this.getCurkey();
  19265. console.log("当前key", this.curKey);
  19266. let cell = 60;
  19267. let lap = 3;
  19268. let angle = cell * (this.curKey - 1) + lap * 360;
  19269. let target = this.ui.myNode.rotNode;
  19270. target.rotation = 0;
  19271. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19272. console.log("旋转完成");
  19273. this.ui.drawBtn.touchable = true;
  19274. this.getAward();
  19275. }));
  19276. }
  19277. getAward() {
  19278. let data = cfgTable.drawData[this.curKey];
  19279. let temp = new AwardType();
  19280. temp.type = data.award;
  19281. temp.num = data.num;
  19282. xGame.common.getAward([temp], () => {
  19283. DataMgr.setDrawTimes(1);
  19284. this.updateDraw();
  19285. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19286. });
  19287. }
  19288. updateDraw() {
  19289. let drawTimes = DataMgr.getDrawTimes();
  19290. let awardTimes = DataMgr.getDrawAwardTimes();
  19291. if (Math.floor(drawTimes / 3) > awardTimes) {
  19292. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19293. this.ui.extraNode.boxBtn.touchable = true;
  19294. this.ui.extraNode.tipsTxt.text = "3/3";
  19295. this.ui.extraNode.barNode.width = 265;
  19296. this.getExtraAward();
  19297. }
  19298. else {
  19299. this.ui.extraNode.boxBtn.t0.stop();
  19300. this.ui.extraNode.boxBtn.touchable = false;
  19301. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19302. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19303. }
  19304. let data = cfgTable.drawData[1];
  19305. if (awardTimes == 0) {
  19306. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19307. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19308. this.ui.myNode.rotNode.img1.rotation = 0;
  19309. }
  19310. else {
  19311. let award = data.nextid;
  19312. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19313. this.ui.myNode.rotNode.txt1.text = award[1];
  19314. this.ui.myNode.rotNode.img1.rotation = 0;
  19315. }
  19316. }
  19317. getExtraAward() {
  19318. let drawTimes = DataMgr.getDrawTimes();
  19319. let awardTimes = DataMgr.getDrawAwardTimes();
  19320. let data = cfgTable.drawData[1];
  19321. let award = new AwardType();
  19322. if (awardTimes == 0) {
  19323. award.num = data.num;
  19324. award.type = data.award;
  19325. xGame.common.getAward([award], () => {
  19326. let all = Math.floor(drawTimes / 3);
  19327. DataMgr.setDrawAwardTimes(all);
  19328. this.updateDraw();
  19329. });
  19330. }
  19331. else {
  19332. award.num = parseInt(data.nextid[1]);
  19333. award.type = parseInt(data.nextid[0]);
  19334. xGame.common.getAward([award], () => {
  19335. let all = Math.floor(drawTimes / 3);
  19336. DataMgr.setDrawAwardTimes(all);
  19337. this.updateDraw();
  19338. });
  19339. }
  19340. }
  19341. closeSelf() {
  19342. this.hide();
  19343. }
  19344. playSecretaryIdle() {
  19345. let parent = this.ui.secretary.displayObject;
  19346. parent.destroyChildren();
  19347. let xx = this.ui.secretary.width / 2;
  19348. let yy = this.ui.secretary.height;
  19349. let scale = xGame.common.getSecretaryScale();
  19350. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19351. xGame.common.secretary.play(data, 1, true, parent);
  19352. }
  19353. }
  19354. UIDraw$1.uiName = "UIDraw";
  19355. class UIRanking$1 extends UIBase {
  19356. constructor() {
  19357. super();
  19358. this.showSelf = true;
  19359. this.rankType = 1;
  19360. this.rankList = [];
  19361. this.myIndex = 0;
  19362. this.myStar = 0;
  19363. }
  19364. onConstructor() {
  19365. this.ui = ui_UIRanking.createInstance();
  19366. this.contentPane = this.ui;
  19367. this.isEject = false;
  19368. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19369. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19370. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19371. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19372. this.ui.myNode.myList.setVirtual();
  19373. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19374. }
  19375. show() {
  19376. super.show();
  19377. this.myIndex = 51;
  19378. Moyu.getRankList({
  19379. rankId: xGame.common.curRankID,
  19380. type: MoyuRankType.total,
  19381. page: 1,
  19382. pageSize: 50,
  19383. }, this, this.updateItemData);
  19384. this.updateSelf();
  19385. let self = Moyu.getUserInfo();
  19386. if (!self.isAuth) {
  19387. Moyu.initUser(this, () => {
  19388. DataMgr.upRankData();
  19389. });
  19390. }
  19391. }
  19392. updateSelfItem() {
  19393. let self = Moyu.getUserInfo();
  19394. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19395. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19396. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19397. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19398. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19399. }
  19400. updateItemData(data) {
  19401. this.myStar = xGame.common.getAllStarNum();
  19402. if (this.rankList.length < 2) {
  19403. this.rankList = data;
  19404. let self = Moyu.getUserInfo();
  19405. for (let i = 0; i < data.length; i++) {
  19406. let data = this.rankList[i];
  19407. if (data.userId == self.userId) {
  19408. this.rankList.splice(i, 1);
  19409. break;
  19410. }
  19411. }
  19412. for (let i = 0; i < data.length; i++) {
  19413. let data = this.rankList[i];
  19414. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19415. this.myIndex = i + 1;
  19416. let user = { headIcon: self.headIcon, nickName: "myself" };
  19417. let ud = { user: user, data: {} };
  19418. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19419. if (Moyu.platType < 11) {
  19420. user.headIcon = self.headIcon;
  19421. user.nickName = self.nickName;
  19422. }
  19423. this.rankList.splice(i, 0, md);
  19424. break;
  19425. }
  19426. }
  19427. }
  19428. this.updateSelfItem();
  19429. this.ui.myNode.myList.numItems = this.rankList.length;
  19430. }
  19431. updateItemUI(index, obj) {
  19432. let data = this.rankList[index];
  19433. let userData = JSON.parse(data.userData).user;
  19434. obj.nameTxt.text = userData.nickName.toString();
  19435. obj.valueTxt.text = data.rankScore;
  19436. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19437. obj.rankTxt.text = index + 1;
  19438. switch (index) {
  19439. case 0:
  19440. this.setImg(obj, 1, 0, 0);
  19441. obj.rankTxt.color = "#FFC047";
  19442. break;
  19443. case 1:
  19444. this.setImg(obj, 0, 1, 0);
  19445. obj.rankTxt.color = "#ACACAC";
  19446. break;
  19447. case 2:
  19448. this.setImg(obj, 0, 0, 1);
  19449. obj.rankTxt.color = "#D09672";
  19450. break;
  19451. default:
  19452. this.setImg(obj, 0, 0, 0);
  19453. obj.rankTxt.color = "#496FAB";
  19454. break;
  19455. }
  19456. }
  19457. setImg(obj, a, b, c) {
  19458. obj.img1.visible = a ? true : false;
  19459. obj.img2.visible = b ? true : false;
  19460. obj.img3.visible = c ? true : false;
  19461. }
  19462. changeList(type) {
  19463. this.rankType = type;
  19464. this.updateSelf();
  19465. }
  19466. changeSelfNode() {
  19467. this.showSelf = !this.showSelf;
  19468. this.updateSelf();
  19469. }
  19470. updateSelf() {
  19471. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19472. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19473. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19474. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19475. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19476. }
  19477. }
  19478. UIRanking$1.uiName = "UIRanking";
  19479. class UISecretary$1 extends UIBase {
  19480. constructor() {
  19481. super();
  19482. this.curIndex = 1;
  19483. }
  19484. onConstructor() {
  19485. this.ui = ui_UISecretary.createInstance();
  19486. this.contentPane = this.ui;
  19487. this.isEject = false;
  19488. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19489. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  19490. this.addUIClick(this.ui.rightBtn, this.turnRight);
  19491. this.nodeObj = { left: null, right: null, cur: null };
  19492. this.nodeObj.left = this.ui.myNode.gameNode1;
  19493. this.nodeObj.right = this.ui.myNode.gameNode2;
  19494. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19495. }
  19496. show() {
  19497. super.show();
  19498. this.ui.t0.play();
  19499. this.updateData();
  19500. }
  19501. addSecretarySpine(node, spineName) {
  19502. if (spineName == "mishu") {
  19503. if (this.secretarySpine1) {
  19504. node.displayObject.destroyChildren();
  19505. this.playWoman(this.secretarySpine1, node.displayObject);
  19506. }
  19507. else {
  19508. let spine1 = new SpineMgr("mishu", () => {
  19509. this.secretarySpine1 = spine1;
  19510. this.playWoman(this.secretarySpine1, node.displayObject);
  19511. });
  19512. }
  19513. }
  19514. else {
  19515. if (this.secretarySpine2) {
  19516. node.displayObject.destroyChildren();
  19517. this.playWoman(this.secretarySpine2, node.displayObject);
  19518. }
  19519. else {
  19520. let spine2 = new SpineMgr("xiaomishu2", () => {
  19521. this.secretarySpine2 = spine2;
  19522. this.playWoman(this.secretarySpine2, node.displayObject);
  19523. });
  19524. }
  19525. }
  19526. }
  19527. playWoman(node, parent) {
  19528. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  19529. let yy = this.ui.myNode.gameNode1.secretary.height;
  19530. let scale = 1.5;
  19531. if (node == this.secretarySpine2) {
  19532. scale = 1.2;
  19533. }
  19534. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19535. node.play(data, 1, true, parent);
  19536. }
  19537. turnLeft() {
  19538. this.curIndex--;
  19539. if (this.curIndex < 1) {
  19540. this.curIndex = 2;
  19541. }
  19542. let left = this.nodeObj.left;
  19543. let right = this.nodeObj.right;
  19544. let cur = this.nodeObj.cur;
  19545. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19546. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19547. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19548. this.updateData();
  19549. }));
  19550. this.ui.myNode.setChildIndex(right, 2);
  19551. this.nodeObj.left = cur;
  19552. this.nodeObj.right = left;
  19553. this.nodeObj.cur = right;
  19554. }
  19555. turnRight() {
  19556. this.curIndex++;
  19557. if (this.curIndex > 2) {
  19558. this.curIndex = 1;
  19559. }
  19560. let left = this.nodeObj.left;
  19561. let right = this.nodeObj.right;
  19562. let cur = this.nodeObj.cur;
  19563. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19564. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19565. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19566. this.updateData();
  19567. }));
  19568. this.ui.myNode.setChildIndex(left, 2);
  19569. this.nodeObj.left = right;
  19570. this.nodeObj.right = cur;
  19571. this.nodeObj.cur = left;
  19572. }
  19573. updateData() {
  19574. let data = cfgTable.secretaryshopData;
  19575. let children = this.ui.myNode._children;
  19576. let temp;
  19577. let curData;
  19578. for (let index = 0; index < children.length; index++) {
  19579. temp = children[index];
  19580. if (index == 2) {
  19581. curData = data[this.curIndex];
  19582. temp.purchaseBtn.touchable = true;
  19583. }
  19584. else {
  19585. temp.purchaseBtn.touchable = false;
  19586. if (this.curIndex == 1) {
  19587. curData = data[2];
  19588. }
  19589. else {
  19590. curData = data[1];
  19591. }
  19592. }
  19593. temp.heightTxt.text = curData.height;
  19594. temp.foodTxt.text = curData.food;
  19595. temp.historyTxt.text = curData.history;
  19596. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19597. this.addSecretarySpine(temp.secretary, curData.spine);
  19598. let womanIndex = curData.id - 1;
  19599. let getWoman = DataMgr.getSecretary(womanIndex);
  19600. let curUse = DataMgr.getCurSecretary();
  19601. if (getWoman) {
  19602. if (curUse == womanIndex) {
  19603. temp.purchaseBtn.c1.selectedIndex = 1;
  19604. }
  19605. else {
  19606. temp.purchaseBtn.c1.selectedIndex = 2;
  19607. }
  19608. }
  19609. else {
  19610. temp.purchaseBtn.c1.selectedIndex = 0;
  19611. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19612. }
  19613. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19614. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19615. }
  19616. }
  19617. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19618. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19619. if (getWoman) {
  19620. if (curUse != womanIndex) {
  19621. console.log();
  19622. DataMgr.setCurSecretary(womanIndex);
  19623. this.updateData();
  19624. }
  19625. }
  19626. else {
  19627. let need = needDiamond;
  19628. if (DataMgr.diamondEnough(need)) {
  19629. DataMgr.setDiamond(-need);
  19630. DataMgr.setSecretary(womanIndex, 1);
  19631. DataMgr.setCurSecretary(womanIndex);
  19632. this.updateData();
  19633. }
  19634. else {
  19635. xGame.uiMgr.Show(UIAddProp$1, 1);
  19636. }
  19637. }
  19638. }
  19639. closeSelf() {
  19640. this.hide();
  19641. }
  19642. }
  19643. UISecretary$1.uiName = "UISecretary";
  19644. class BallRodDisplay$1 {
  19645. constructor(ui, index) {
  19646. this.index = 0;
  19647. this.uiIndex = 0;
  19648. this.ui = ui;
  19649. this.index = index;
  19650. this.initData();
  19651. }
  19652. initData() {
  19653. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19654. let data = cfgTable.ballrodData[this.index + 1];
  19655. this.ui.nameTxt.text = data.name;
  19656. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19657. this.ui.levelNode.c1.selectedIndex = data.quality;
  19658. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19659. if (data.spine) {
  19660. this.mySpine = new SpineMgr(data.spine, () => {
  19661. let xx = 150;
  19662. let yy = 70;
  19663. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19664. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19665. });
  19666. }
  19667. }
  19668. updateSelf() {
  19669. let get = DataMgr.getBallRod(this.index);
  19670. if (get == null)
  19671. get = 1;
  19672. let curUse = DataMgr.getCurBallRod();
  19673. if (get) {
  19674. if (curUse == this.index) {
  19675. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19676. }
  19677. else {
  19678. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19679. }
  19680. }
  19681. else {
  19682. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19683. }
  19684. }
  19685. buyBallRod() {
  19686. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19687. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19688. switch (selectedIndex) {
  19689. case 0:
  19690. break;
  19691. case 1:
  19692. DataMgr.setCurBallRod(this.index);
  19693. let ui = xGame.uiMgr.getUI(UIShop$1);
  19694. ui.updateBallRod();
  19695. break;
  19696. case 2:
  19697. let data = cfgTable.ballrodData[this.index + 1];
  19698. let need = data.price;
  19699. if (DataMgr.diamondEnough(need)) {
  19700. DataMgr.setDiamond(-need);
  19701. DataMgr.setBallRod(this.index, 1);
  19702. DataMgr.setCurBallRod(this.index);
  19703. let ui = xGame.uiMgr.getUI(UIShop$1);
  19704. ui.updateBallRod();
  19705. }
  19706. else {
  19707. xGame.uiMgr.Show(UIAddProp$1, 1);
  19708. }
  19709. break;
  19710. default:
  19711. break;
  19712. }
  19713. }
  19714. }
  19715. class UIShop$1 extends UIBase {
  19716. constructor() {
  19717. super();
  19718. this.itemNums = 0;
  19719. }
  19720. onConstructor() {
  19721. this.ui = ui_UIShop.createInstance();
  19722. this.contentPane = this.ui;
  19723. this.isEject = false;
  19724. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19725. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19726. this.addUIClick(this.ui, this.interuptSecretary);
  19727. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19728. this.ballRodArr = [];
  19729. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19730. this.ui.myNode.myList.numItems = this.itemNums;
  19731. if (Moyu.isKs)
  19732. this.ui.closeNode.closeBtn.x += 100;
  19733. }
  19734. show() {
  19735. super.show();
  19736. this.playSecretaryIdle();
  19737. this.updateBallRod();
  19738. }
  19739. updateBallRod() {
  19740. for (let index = 0; index < this.ballRodArr.length; index++) {
  19741. this.ballRodArr[index].updateSelf();
  19742. }
  19743. }
  19744. renderBallRod(sort, obj) {
  19745. let index = this.getIndexBySort(sort + 1) - 1;
  19746. let ballRod = new BallRodDisplay$1(obj, index);
  19747. this.ballRodArr.push(ballRod);
  19748. }
  19749. getIndexBySort(sort) {
  19750. let object = cfgTable.ballrodData;
  19751. for (const key in object) {
  19752. if (object[key].sort == sort) {
  19753. return parseInt(key);
  19754. }
  19755. }
  19756. }
  19757. playSecretaryIdle() {
  19758. let parent = this.ui.secretary.displayObject;
  19759. parent.destroyChildren();
  19760. let xx = this.ui.secretary.width / 2;
  19761. let yy = this.ui.secretary.height;
  19762. let scale = xGame.common.getSecretaryScale();
  19763. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19764. xGame.common.secretary.play(data, 1, true, parent);
  19765. }
  19766. interuptSecretary() {
  19767. Laya.timer.clearAll(this);
  19768. this.playSecretaryRandomSound();
  19769. }
  19770. playSecretaryRandomSound() {
  19771. if (this.isHide)
  19772. return;
  19773. let time = xGame.common.randomNum(45000, 60000);
  19774. Laya.timer.once(time, this, () => {
  19775. if (this.isHide)
  19776. return;
  19777. let index = xGame.common.randomNum(4, 7);
  19778. xGame.soundMgr.playSound("s_main0" + index);
  19779. let words = 1;
  19780. switch (index) {
  19781. case 4:
  19782. words = 5;
  19783. break;
  19784. case 5:
  19785. words = 3;
  19786. break;
  19787. case 6:
  19788. words = 6;
  19789. break;
  19790. case 7:
  19791. words = 7;
  19792. break;
  19793. default:
  19794. break;
  19795. }
  19796. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19797. this.playSecretaryRandomSound();
  19798. });
  19799. }
  19800. closeSelf() {
  19801. this.hide();
  19802. }
  19803. }
  19804. UIShop$1.uiName = "UIShop";
  19805. class SignMax$1 {
  19806. constructor(ui) {
  19807. this.ui = ui;
  19808. }
  19809. updateSelf(index, sameDay, curDayIndex) {
  19810. let data = cfgTable.signData[index + 1];
  19811. this.ui.titleTxt.text = data.title;
  19812. let arr1 = data.award[0].split('-');
  19813. let arr2 = data.award[1].split('-');
  19814. let num1 = parseInt(arr1[1]);
  19815. let num2 = parseInt(arr2[1]);
  19816. this.ui.numTxt1.text = num1 + "";
  19817. this.ui.numTxt2.text = num2 + "";
  19818. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19819. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19820. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19821. this.ui.numTxt1.visible = false;
  19822. }
  19823. else {
  19824. this.ui.numTxt1.visible = true;
  19825. }
  19826. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19827. this.ui.numTxt2.visible = false;
  19828. }
  19829. else {
  19830. this.ui.numTxt2.visible = true;
  19831. }
  19832. if (index < curDayIndex) {
  19833. this.ui.c1.selectedIndex = 1;
  19834. }
  19835. else if (index == curDayIndex) {
  19836. if (sameDay) {
  19837. this.ui.c1.selectedIndex = 2;
  19838. }
  19839. else {
  19840. this.ui.c1.selectedIndex = 2;
  19841. }
  19842. }
  19843. else {
  19844. this.ui.c1.selectedIndex = 0;
  19845. }
  19846. }
  19847. }
  19848. class SignNormal$1 {
  19849. constructor(ui) {
  19850. this.ui = ui;
  19851. }
  19852. updateSelf(index, sameDay, curDayIndex) {
  19853. let data = cfgTable.signData[index + 1];
  19854. this.ui.titleTxt.text = data.title;
  19855. let arr = data.award[0].split('-');
  19856. let type = parseInt(arr[0]);
  19857. let num = parseInt(arr[1]);
  19858. this.ui.numTxt.text = num + "";
  19859. if (type > 2) {
  19860. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19861. this.ui.myIcon.rotation = 0;
  19862. }
  19863. else {
  19864. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19865. this.ui.myIcon.rotation = 0;
  19866. }
  19867. if (xGame.common.signAwardContainsRod(data.award)) {
  19868. this.ui.numTxt.visible = false;
  19869. }
  19870. else {
  19871. this.ui.numTxt.visible = true;
  19872. }
  19873. if (index < curDayIndex) {
  19874. this.ui.c1.selectedIndex = 1;
  19875. }
  19876. else if (index == curDayIndex) {
  19877. if (sameDay) {
  19878. this.ui.c1.selectedIndex = 2;
  19879. }
  19880. else {
  19881. this.ui.c1.selectedIndex = 2;
  19882. }
  19883. }
  19884. else {
  19885. this.ui.c1.selectedIndex = 0;
  19886. }
  19887. }
  19888. }
  19889. class UISign$1 extends UIBase {
  19890. constructor() {
  19891. super();
  19892. this.curDayIndex = 0;
  19893. this.starX = 0;
  19894. }
  19895. onConstructor() {
  19896. this.ui = ui_UISign.createInstance();
  19897. this.contentPane = this.ui;
  19898. this.isEject = false;
  19899. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19900. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19901. this.initSignItem();
  19902. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19903. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19904. }
  19905. show() {
  19906. super.show();
  19907. this.ui.t0.play();
  19908. this.playSecretaryIdle();
  19909. this.updateSign();
  19910. }
  19911. initSignItem() {
  19912. this.signArr = [];
  19913. for (let index = 0; index < 6; index++) {
  19914. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19915. this.signArr.push(temp);
  19916. }
  19917. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19918. if (Moyu.isKs)
  19919. this.ui.closeNode.closeBtn.x += 100;
  19920. }
  19921. updateSign() {
  19922. let sameDay = xGame.common.judgeSameDay();
  19923. let max = 7;
  19924. this.curDayIndex = DataMgr.getSignData();
  19925. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19926. this.curDayIndex = 0;
  19927. if (!sameDay) {
  19928. this.ui.normalBtn.visible = true;
  19929. this.ui.tipsNode.visible = false;
  19930. this.ui.againBtn.visible = false;
  19931. }
  19932. else {
  19933. this.ui.normalBtn.visible = false;
  19934. let again = DataMgr.getExtraSign();
  19935. let isCurrency = false;
  19936. let index = this.curDayIndex;
  19937. if (index == 0)
  19938. index = 7;
  19939. let award = cfgTable.signData[index].award;
  19940. let num = award[0].split("-")[0];
  19941. if (num == "1" || num == "2")
  19942. isCurrency = true;
  19943. let showAgain = again == 0 && isCurrency;
  19944. this.ui.againBtn.visible = showAgain;
  19945. this.ui.tipsNode.visible = !showAgain;
  19946. }
  19947. for (let index = 0; index < this.signArr.length; index++) {
  19948. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  19949. }
  19950. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  19951. }
  19952. playSecretaryIdle() {
  19953. let parent = this.ui.secretary.displayObject;
  19954. parent.destroyChildren();
  19955. let xx = this.ui.secretary.width / 2;
  19956. let yy = this.ui.secretary.height;
  19957. let scale = xGame.common.getSecretaryScale();
  19958. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19959. xGame.common.secretary.play(data, 1, true, parent);
  19960. }
  19961. closeSelf() {
  19962. this.hide();
  19963. }
  19964. normalGetAward() {
  19965. let sameDay = xGame.common.judgeSameDay();
  19966. if (!sameDay) {
  19967. let award = cfgTable.signData[this.curDayIndex + 1].award;
  19968. let temp;
  19969. let type;
  19970. let num;
  19971. let arr = [];
  19972. for (let index = 0; index < award.length; index++) {
  19973. temp = award[index].split("-");
  19974. type = parseInt(temp[0]);
  19975. num = parseInt(temp[1]);
  19976. let awardType = new AwardType();
  19977. awardType.num = num;
  19978. awardType.type = type;
  19979. arr.push(awardType);
  19980. }
  19981. xGame.common.getAward(arr, (watchVideo) => {
  19982. this.curDayIndex++;
  19983. if (this.curDayIndex > 7)
  19984. this.curDayIndex = 0;
  19985. DataMgr.setSignData(this.curDayIndex);
  19986. DataMgr.setSignTime(new Date().getTime());
  19987. if (watchVideo) {
  19988. DataMgr.setExtraSign(1);
  19989. Moyu.sendDataEvent("signIn1");
  19990. }
  19991. this.updateSign();
  19992. });
  19993. }
  19994. }
  19995. againGetAward() {
  19996. Moyu.sendDataEvent("signIn2");
  19997. Moyu.showVideoAd(() => {
  19998. let index = this.curDayIndex;
  19999. if (index == 0)
  20000. index = 7;
  20001. let award = cfgTable.signData[index].award;
  20002. let temp;
  20003. let type;
  20004. let num;
  20005. for (let index = 0; index < award.length; index++) {
  20006. temp = award[index].split("-");
  20007. type = parseInt(temp[0]);
  20008. num = parseInt(temp[1]) * 3;
  20009. xGame.common.playObjFlyAnim(num, type);
  20010. }
  20011. DataMgr.setExtraSign(1);
  20012. this.updateSign();
  20013. }, EAdType.againSign);
  20014. }
  20015. }
  20016. UISign$1.uiName = "UISign";
  20017. class UIModeSelection$1 extends UIBase {
  20018. constructor() {
  20019. super();
  20020. }
  20021. onConstructor() {
  20022. this.ui = ui_UIModeSelection.createInstance();
  20023. this.contentPane = this.ui;
  20024. this.isEject = false;
  20025. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20026. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20027. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20028. this.addUIClick(this.ui.closeBtn, this.hide);
  20029. this.peopleArr = [650, 6900, 3800];
  20030. this.peopleOffest = [50, 500, 200];
  20031. this.updateSelf();
  20032. }
  20033. show(callback) {
  20034. super.show();
  20035. this.ui.t0.play();
  20036. this.callback = callback;
  20037. }
  20038. updateSelf() {
  20039. let cfg = cfgTable.modeselectData;
  20040. for (let index = 1; index <= 3; index++) {
  20041. let node = this.ui.myNode["type" + index];
  20042. node.need.text = cfg[index].need;
  20043. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20044. node.peopleTxt.text = this.getRandPeople(index - 1);
  20045. }
  20046. }
  20047. enterGame(type) {
  20048. xGame.common.classicRoomType = type;
  20049. let cfg = cfgTable.modeselectData[type];
  20050. let need = cfg.need;
  20051. xGame.common.passAwardCoin = cfg.award;
  20052. if (DataMgr.coinEnough(need)) {
  20053. DataMgr.setCoin(-need);
  20054. this.ui.myNode["type" + type].t0.play();
  20055. Laya.timer.once(200, this, () => {
  20056. this.callback && this.callback();
  20057. });
  20058. }
  20059. else {
  20060. Moyu.sendDataEvent("AddCoinVideo");
  20061. xGame.uiMgr.Show(UIAddProp$1, 0);
  20062. }
  20063. }
  20064. getRandPeople(index) {
  20065. let rand = this.peopleOffest[index];
  20066. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20067. }
  20068. }
  20069. UIModeSelection$1.uiName = "UIModeSelection";
  20070. class UIMain$1 extends UIBase {
  20071. constructor() {
  20072. super();
  20073. this.firstEnter = true;
  20074. }
  20075. onConstructor() {
  20076. this.ui = ui_UIMain.createInstance();
  20077. this.contentPane = this.ui;
  20078. this.isEject = false;
  20079. this.addEvent();
  20080. this.addClickSpine();
  20081. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20082. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20083. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20084. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20085. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20086. let curUse = DataMgr.getCurSecretary();
  20087. this.changeSecretary(curUse);
  20088. this.ui.talkNode.visible = false;
  20089. let guide = DataMgr.getSkillGuide();
  20090. if (xGame.common.isNewDay && guide == 1) {
  20091. xGame.common.isNewDay = false;
  20092. xGame.soundMgr.playSound("s_main01");
  20093. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20094. console.log("播放小秘书每天语音");
  20095. }
  20096. this.onGetUserInfo();
  20097. this.ui.n83.visible = false;
  20098. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20099. }
  20100. changeSecretary(curUse) {
  20101. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20102. xGame.common.secretary && xGame.common.secretary.dispose();
  20103. this.addSecretarySpine(name);
  20104. }
  20105. addSecretarySpine(name) {
  20106. let spine = new SpineMgr(name, () => {
  20107. this.playSecretaryIdle();
  20108. });
  20109. xGame.common.secretary = spine;
  20110. }
  20111. addClickSpine() {
  20112. let clickSpine = new SpineMgr("dianji", () => {
  20113. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20114. let parent = Laya.stage;
  20115. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20116. clickSpine.play(data, 0, false, parent, (spine) => {
  20117. spine.destroy(true);
  20118. });
  20119. });
  20120. });
  20121. }
  20122. addEvent() {
  20123. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20124. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20125. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20126. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20127. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20128. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20129. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20130. this.addUIClick(this.ui, this.interuptSecretary);
  20131. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20132. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20133. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20134. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20135. this.addUIClick(this.ui.signBtn, this.openSignView);
  20136. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20137. this.addUIClick(this.ui.rankBtn, this.openRanking);
  20138. }
  20139. show(showFailWords) {
  20140. super.show();
  20141. this.moneyNode.ui.c1.selectedIndex = 1;
  20142. this.playSecretaryIdle();
  20143. xGame.soundMgr.playMusic("caromhall01");
  20144. Laya.timer.clearAll(this);
  20145. this.playSecretaryRandomSound();
  20146. if (showFailWords) {
  20147. setTimeout(() => {
  20148. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20149. let words = -1;
  20150. if (str == "s_main02") {
  20151. words = 2;
  20152. }
  20153. else {
  20154. words = 3;
  20155. }
  20156. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20157. xGame.soundMgr.playSound(str);
  20158. }, 300);
  20159. }
  20160. this.showGuide();
  20161. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20162. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20163. let guide = DataMgr.getSkillGuide();
  20164. if (guide == 1) {
  20165. let randTime = xGame.common.randomNum(300, 800);
  20166. if (this.firstEnter) {
  20167. this.firstEnter = false;
  20168. randTime += 900;
  20169. }
  20170. Laya.timer.once(randTime, this, () => {
  20171. xGame.common.autoPopUIView();
  20172. });
  20173. }
  20174. }
  20175. checkActive(show) {
  20176. }
  20177. showGuide() {
  20178. let guide = DataMgr.getSkillGuide();
  20179. this.ui.guideBtn.visible = guide == 0;
  20180. this.ui.enterGuide.visible = false;
  20181. this.ui.secretaryGuide.visible = guide == 0;
  20182. if (guide == 0) {
  20183. xGame.soundMgr.playSound("s_guide");
  20184. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20185. }
  20186. }
  20187. ensureSecretary() {
  20188. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20189. this.ui.secretaryGuide.visible = false;
  20190. this.ui.enterGuide.visible = true;
  20191. this.ui.wordsNode.t0.play();
  20192. if (DataMgr.getNewUser())
  20193. Moyu.sendDataEvent("gameReady");
  20194. }
  20195. playSecretaryIdle() {
  20196. let parent = this.ui.secretary.displayObject;
  20197. parent.destroyChildren();
  20198. let xx = this.ui.secretary.width / 2;
  20199. let yy = this.ui.secretary.height;
  20200. let scale = xGame.common.getSecretaryScale();
  20201. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20202. xGame.common.secretary.play(data, 1, true, parent);
  20203. }
  20204. startGame(type) {
  20205. xGame.common.gameMode = type;
  20206. Moyu.sendDataEvent("PlayGame", { type: type });
  20207. switch (xGame.common.gameMode) {
  20208. case GameMode.classic:
  20209. let challengeTimes = DataMgr.getChallengeTimes();
  20210. if (challengeTimes == 0) {
  20211. xGame.uiMgr.Show(UIInvitation$1);
  20212. }
  20213. else {
  20214. this.beginGame();
  20215. }
  20216. break;
  20217. case GameMode.bigMove:
  20218. this.beginGame();
  20219. if (DataMgr.getNewUser())
  20220. Moyu.sendDataEvent("gameStart0");
  20221. break;
  20222. default:
  20223. break;
  20224. }
  20225. }
  20226. beginGame(isNice = false) {
  20227. if (xGame.common.gameMode == GameMode.classic) {
  20228. if (isNice) {
  20229. this.enterClassic();
  20230. }
  20231. else {
  20232. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20233. this.enterClassic();
  20234. });
  20235. }
  20236. }
  20237. else if (xGame.common.gameMode == GameMode.bigMove) {
  20238. this.ui.enterGuide.visible = false;
  20239. xGame.uiMgr.Show(UISkill$1);
  20240. }
  20241. }
  20242. enterClassic() {
  20243. xGame.uiMgr.Show(UIGame$1);
  20244. xGame.uiMgr.Show(UIMatching$1, () => {
  20245. if (!this.isHide)
  20246. this.hide();
  20247. xGame.common.gameUI.ui.alpha = 1;
  20248. xGame.common.gameUI.startGame();
  20249. xGame.uiMgr.Hide(UIGameEnd$1);
  20250. });
  20251. }
  20252. startGlobal() {
  20253. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20254. }
  20255. startWeekly() {
  20256. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20257. }
  20258. startPlaceBall() {
  20259. xGame.uiMgr.Show(UILevelDisplay$1);
  20260. }
  20261. hide() {
  20262. super.hide();
  20263. xGame.common.stopGirlPop(this.ui.talkNode);
  20264. }
  20265. onGetUserInfo(force = false) {
  20266. if (Moyu.isWx) {
  20267. let info = Moyu.getSystemInfo();
  20268. if (info)
  20269. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20270. }
  20271. else {
  20272. Moyu.initUser(this, this.freshUser, force);
  20273. }
  20274. if (!Moyu.hasUserInfo) {
  20275. let user = Moyu.getUserInfo();
  20276. user.headIcon = 'res/ty_touxiang.png';
  20277. }
  20278. this.freshUser();
  20279. }
  20280. freshUser() {
  20281. let user = Moyu.getUserInfo();
  20282. if (!user.isAuth) {
  20283. user.headIcon = 'res/ty_touxiang.png';
  20284. }
  20285. else
  20286. DataMgr.upRankData();
  20287. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20288. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20289. }
  20290. interuptSecretary() {
  20291. Laya.timer.clearAll(this);
  20292. this.playSecretaryRandomSound();
  20293. }
  20294. playSecretaryRandomSound() {
  20295. if (this.isHide)
  20296. return;
  20297. let time = xGame.common.randomNum(45000, 60000);
  20298. Laya.timer.once(time, this, () => {
  20299. if (this.isHide)
  20300. return;
  20301. let index = xGame.common.randomNum(4, 7);
  20302. xGame.soundMgr.playSound("s_main0" + index);
  20303. let words = 1;
  20304. switch (index) {
  20305. case 4:
  20306. words = 5;
  20307. break;
  20308. case 5:
  20309. words = 3;
  20310. break;
  20311. case 6:
  20312. words = 6;
  20313. break;
  20314. case 7:
  20315. words = 7;
  20316. break;
  20317. default:
  20318. break;
  20319. }
  20320. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20321. this.playSecretaryRandomSound();
  20322. });
  20323. }
  20324. openSecretaryView() {
  20325. xGame.uiMgr.Show(UISecretary$1);
  20326. Moyu.sendDataEvent("secretary");
  20327. }
  20328. openShopView() {
  20329. xGame.uiMgr.Show(UIShop$1);
  20330. }
  20331. openSignView() {
  20332. xGame.uiMgr.Show(UISign$1);
  20333. }
  20334. openDrawView() {
  20335. xGame.uiMgr.Show(UIDraw$1);
  20336. }
  20337. openRanking() {
  20338. xGame.uiMgr.Show(UIRanking$1);
  20339. Moyu.sendDataEvent("rankingList");
  20340. }
  20341. }
  20342. UIMain$1.uiName = "UIMain";
  20343. function InitShader() {
  20344. }
  20345. function appInit() {
  20346. xGame.context.init(getLoadingResList(), initCallback);
  20347. }
  20348. function getLoadingResList() {
  20349. return [
  20350. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20351. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20352. ];
  20353. }
  20354. function getGameResList() {
  20355. return [
  20356. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20357. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20358. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20359. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20360. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20361. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20362. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20363. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20364. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20365. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20366. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20367. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20368. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20369. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20370. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20371. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20372. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20373. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20374. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20375. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20376. ];
  20377. }
  20378. function initCallback() {
  20379. window["DataMgr"] = DataMgr;
  20380. DataMgr.Init();
  20381. Moyu.init(getPlat(), this, () => {
  20382. DataMgr.isNewDay();
  20383. PlatMgr.initConfig();
  20384. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20385. }, true);
  20386. console.log('zh:开始sm init1 start');
  20387. xGame.soundMgr.init();
  20388. console.log('zh:开始sm init1 end');
  20389. xGame.uiMgr.init();
  20390. xGame.uiMgr.bindFUI(fguiRes.loading);
  20391. xGame.uiMgr.Show(UILoading);
  20392. }
  20393. function loadSubRes(callback) {
  20394. var tab = ["asset", "res", "spine"];
  20395. let subDone = 0;
  20396. for (var i = 0; i < tab.length; i++) {
  20397. let sub = tab[i];
  20398. Moyu.loadSubRes(sub, (pro) => {
  20399. callback && callback(pro, false);
  20400. }).then(() => {
  20401. subDone++;
  20402. if (subDone >= tab.length)
  20403. callback && callback(1, true);
  20404. });
  20405. }
  20406. }
  20407. function enterGame() {
  20408. xGame.cfgMgr.init();
  20409. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20410. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20411. xGame.uiMgr.Hide(UILoading);
  20412. fgui.UIPackage.removePackage(fguiRes.loading);
  20413. xGame.uiMgr.bindFUI(fguiRes.game);
  20414. xGame.uiMgr.Show(UIMain$1);
  20415. if (DataMgr.getNewUser())
  20416. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20417. }
  20418. function getPlat() {
  20419. let cfg = new MoyuCfg();
  20420. cfg.plat = MoyuPlat.web;
  20421. cfg.myId = 120;
  20422. cfg.myKey = '8848a885774230a4';
  20423. cfg.version = 0;
  20424. if (window.hasOwnProperty("gamebox")) {
  20425. cfg.plat = MoyuPlat.f399;
  20426. cfg.version = 0;
  20427. }
  20428. else if (window.hasOwnProperty("ks")) {
  20429. cfg.plat = MoyuPlat.ks;
  20430. cfg.version = 0;
  20431. cfg.ads.ksVideoId = '2300002254_01';
  20432. cfg.ads.ksInsertId = '2300002254_02';
  20433. }
  20434. else if (Laya.Browser.onTTMiniGame) {
  20435. cfg.plat = MoyuPlat.tt;
  20436. cfg.version = 0;
  20437. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20438. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20439. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20440. }
  20441. else if (Laya.Browser.onMiniGame) {
  20442. cfg.plat = MoyuPlat.wx;
  20443. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20444. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20445. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20446. }
  20447. else if (Laya.Browser.onQQMiniGame) {
  20448. cfg.plat = MoyuPlat.qq;
  20449. }
  20450. else if (Laya.Browser.onQGMiniGame) {
  20451. cfg.plat = MoyuPlat.op;
  20452. cfg.ads.opVideoId = '455502';
  20453. cfg.ads.opBannerId = '455507';
  20454. }
  20455. else if (Laya.Browser.onVVMiniGame) {
  20456. cfg.plat = MoyuPlat.vv;
  20457. cfg.version = 0;
  20458. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20459. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20460. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20461. }
  20462. else if (Laya.Browser.onHWMiniGame) {
  20463. cfg.plat = MoyuPlat.hw;
  20464. }
  20465. else if (window["mz"]) {
  20466. cfg.plat = MoyuPlat.mz;
  20467. }
  20468. else {
  20469. let cfg = window['conchConfig'];
  20470. if (cfg) {
  20471. var os = cfg.getOS();
  20472. if (os == "Conch-ios") {
  20473. cfg.plat = MoyuPlat.ios;
  20474. }
  20475. else if (os == "Conch-android") {
  20476. }
  20477. }
  20478. }
  20479. return cfg;
  20480. }
  20481. class Main {
  20482. constructor() {
  20483. if (window["Laya3D"])
  20484. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20485. else {
  20486. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20487. this.initMain();
  20488. }
  20489. }
  20490. initMain() {
  20491. Laya["Physics"] && Laya["Physics"].enable();
  20492. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20493. Laya.stage.scaleMode = GameConfig.scaleMode;
  20494. Laya.stage.screenMode = GameConfig.screenMode;
  20495. Laya.stage.alignV = GameConfig.alignV;
  20496. Laya.stage.alignH = GameConfig.alignH;
  20497. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20498. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20499. Laya.enableDebugPanel();
  20500. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20501. Laya["PhysicsDebugDraw"].enable();
  20502. if (GameConfig.stat)
  20503. Laya.Stat.show();
  20504. Laya.alertGlobalError(true);
  20505. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20506. }
  20507. onVersionLoaded() {
  20508. appInit();
  20509. }
  20510. }
  20511. new Main();
  20512. }());
  20513. //# sourceMappingURL=bundle.js.map