bundle.js 798 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921
  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/nvmishu.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("zh: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.n46 = (this.getChild("n46"));
  4048. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4049. this.liucheng1 = (this.getChild("liucheng1"));
  4050. this.rightBtn = (this.getChild("rightBtn"));
  4051. this.n75 = (this.getChild("n75"));
  4052. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4053. this.liucheng2 = (this.getChild("liucheng2"));
  4054. this.guideBtn = (this.getChild("guideBtn"));
  4055. this.n73 = (this.getChild("n73"));
  4056. this.wordsNode = (this.getChild("wordsNode"));
  4057. this.enterGuide = (this.getChild("enterGuide"));
  4058. this.talkNode = (this.getChild("talkNode"));
  4059. this.n83 = (this.getChild("n83"));
  4060. this.n84 = (this.getChild("n84"));
  4061. }
  4062. }
  4063. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4064. class ui_UIMoyu extends fgui.GComponent {
  4065. static createInstance() {
  4066. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4067. }
  4068. onConstruct() {
  4069. this.ageTip = (this.getChild("ageTip"));
  4070. this.mainBg = (this.getChild("mainBg"));
  4071. this.xyNode = (this.getChild("xyNode"));
  4072. this.rnNode = (this.getChild("rnNode"));
  4073. this.fcmNode = (this.getChild("fcmNode"));
  4074. this.ageNode = (this.getChild("ageNode"));
  4075. this.tipNode = (this.getChild("tipNode"));
  4076. this.msgNode = (this.getChild("msgNode"));
  4077. }
  4078. }
  4079. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4080. class MoyuMgr {
  4081. static initMoyu() {
  4082. this.moyuView = new MoyuView();
  4083. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4084. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4085. this.moyuView.ui.displayObject.zOrder = 1000;
  4086. this.moyuView.init();
  4087. this.moyuView.showTip(true);
  4088. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4089. window['XApk'] = this;
  4090. }
  4091. static showAge(show) {
  4092. if (this.moyuView)
  4093. this.moyuView.showAge(show);
  4094. }
  4095. static onPlatMsg(idx) {
  4096. if (!MoyuMgr.moyuView)
  4097. return;
  4098. if (idx == '0') {
  4099. MoyuMgr.moyuView.showTip(false);
  4100. }
  4101. }
  4102. static showAgree(call) {
  4103. if (this.moyuView)
  4104. this.moyuView.showAgree(call);
  4105. else
  4106. call && call();
  4107. }
  4108. static showXy(type = 1) {
  4109. if (this.moyuView)
  4110. this.moyuView.showXy(type);
  4111. }
  4112. }
  4113. MoyuMgr.isAdvise = false;
  4114. class MoyuView {
  4115. constructor() {
  4116. this.ysxyNum = 1;
  4117. this.ysJson = null;
  4118. this.ui = ui_UIMoyu.createInstance();
  4119. }
  4120. init() {
  4121. this.ui.mainBg.visible = false;
  4122. this.ui.xyNode.visible = false;
  4123. this.ui.ageNode.visible = false;
  4124. this.ui.tipNode.visible = false;
  4125. this.ui.rnNode.visible = false;
  4126. this.ui.fcmNode.visible = false;
  4127. this.ui.ageTip.visible = false;
  4128. this.ui.msgNode.visible = false;
  4129. this.ui.visible = false;
  4130. this.ui.xyNode.xyList.setVirtual();
  4131. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4132. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4133. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4134. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4135. this.ui.xyNode.btnKnown.visible = false;
  4136. this.ui.xyNode.xy1.visible = false;
  4137. this.ui.xyNode.xy2.visible = false;
  4138. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4139. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4140. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4141. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4142. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4143. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4144. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4145. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4146. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4147. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4148. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4149. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4150. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4151. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4152. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4153. this.ysxyNum = 2;
  4154. }
  4155. }
  4156. onClick(obj) {
  4157. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4158. switch (obj) {
  4159. case this.ui.ageTip:
  4160. if (Moyu.isTTApk) {
  4161. this.ui.ageNode.visible = true;
  4162. this.ui.mainBg.visible = true;
  4163. }
  4164. break;
  4165. case this.ui.tipNode:
  4166. this.showTip(false);
  4167. break;
  4168. case this.ui.ageNode.btnAge:
  4169. this.ui.ageNode.visible = false;
  4170. this.ui.mainBg.visible = false;
  4171. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4172. this.ui.visible = false;
  4173. break;
  4174. case this.ui.xyNode.btnXy3:
  4175. case this.ui.xyNode.btnXy1:
  4176. this.loadXy(1);
  4177. break;
  4178. case this.ui.xyNode.btnXy2:
  4179. this.loadXy(2);
  4180. break;
  4181. case this.ui.xyNode.btnBack:
  4182. this.ui.xyNode.xy1.visible = true;
  4183. this.ui.xyNode.xy2.visible = false;
  4184. break;
  4185. case this.ui.xyNode.btnKnown:
  4186. this.ui.xyNode.visible = false;
  4187. this.ui.mainBg.visible = false;
  4188. this.ui.visible = false;
  4189. break;
  4190. case this.ui.rnNode.btnCheck:
  4191. this.check();
  4192. break;
  4193. case this.ui.rnNode.btnExit:
  4194. case this.ui.xyNode.btnNo:
  4195. this.ysxyNum--;
  4196. if (this.ysxyNum > 0)
  4197. this.showMsg("Refuse to quit the game once again");
  4198. else {
  4199. Moyu.userAgree(false);
  4200. Moyu.exit();
  4201. }
  4202. break;
  4203. case this.ui.xyNode.btnSure:
  4204. case this.ui.xyNode.btnYes:
  4205. DataMgr.userData.isAgree = true;
  4206. DataMgr.saveUserData();
  4207. this.onAgree();
  4208. break;
  4209. case this.ui.rnNode.btnDone:
  4210. this.ui.rnNode.visible = false;
  4211. this.ui.visible = false;
  4212. break;
  4213. case this.ui.fcmNode.btnRn:
  4214. this.showRn();
  4215. break;
  4216. }
  4217. }
  4218. showTip(show) {
  4219. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4220. return;
  4221. if (show) {
  4222. MoyuMgr.isAdvise = true;
  4223. this.ui.visible = true;
  4224. this.ui.tipNode.visible = true;
  4225. this.ui.tipNode.alpha = 1;
  4226. Laya.timer.once(1000, this, this.showTip, [false]);
  4227. }
  4228. else {
  4229. this.ui.tipNode.alpha = 1;
  4230. this.ui.tipNode.visible = true;
  4231. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4232. this.ui.tipNode.visible = false;
  4233. MoyuMgr.isAdvise = false;
  4234. }), 1000);
  4235. }
  4236. }
  4237. showAge(show, px = 0, py = 0) {
  4238. if (Moyu.platType > 10 && !Moyu.isIos) {
  4239. this.ui.ageTip.x = px;
  4240. this.ui.ageTip.y = py;
  4241. this.ui.ageTip.visible = show;
  4242. if (show)
  4243. this.ui.visible = true;
  4244. }
  4245. }
  4246. showAgree(call) {
  4247. this.agreeCall = call;
  4248. this.onAgree();
  4249. return;
  4250. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4251. this.showXy(0);
  4252. }
  4253. else
  4254. this.onAgree();
  4255. }
  4256. onAgree() {
  4257. if (!this.ui.ageNode.visible)
  4258. this.ui.visible = false;
  4259. this.ui.xyNode.visible = false;
  4260. Moyu.userAgree(true);
  4261. this.showAge(false);
  4262. this.agreeCall && this.agreeCall();
  4263. this.showRn();
  4264. }
  4265. showMsg(txt) {
  4266. this.ui.msgNode.txtMsg.text = txt;
  4267. this.ui.msgNode.visible = true;
  4268. this.ui.msgNode.alpha = 1;
  4269. this.ui.visible = true;
  4270. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4271. this.ui.msgNode.visible = false;
  4272. }), 2500, true);
  4273. }
  4274. showRn() {
  4275. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4276. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4277. this.ui.rnNode.rn1.visible = true;
  4278. this.ui.rnNode.rn2.visible = false;
  4279. this.ui.rnNode.rn3.visible = false;
  4280. this.ui.rnNode.rn4.visible = false;
  4281. this.ui.rnNode.visible = true;
  4282. this.ui.mainBg.visible = true;
  4283. this.ui.rnNode.btnDone.visible = false;
  4284. this.ui.rnNode.btnExit.visible = true;
  4285. this.ui.rnNode.btnCheck.visible = true;
  4286. this.ui.fcmNode.visible = false;
  4287. this.ui.visible = true;
  4288. return;
  4289. }
  4290. }
  4291. this.showFcm();
  4292. }
  4293. showFcm() {
  4294. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4295. Moyu.initFCM(true);
  4296. if (Moyu.gameTime < 1)
  4297. this.fcmLoop();
  4298. else if (Moyu.gameTime < 999)
  4299. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4300. }
  4301. }
  4302. fcmLoop() {
  4303. if (Moyu.gameTime < 1) {
  4304. this.ui.rnNode.visible = false;
  4305. this.ui.fcmNode.visible = true;
  4306. this.ui.mainBg.visible = true;
  4307. this.ui.visible = true;
  4308. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4309. Laya.timer.clear(this.ui, this.fcmLoop);
  4310. }
  4311. }
  4312. check() {
  4313. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4314. this.ui.rnNode.rn1.visible = false;
  4315. this.ui.rnNode.rn2.visible = false;
  4316. this.ui.rnNode.rn4.visible = true;
  4317. }
  4318. else if (this.ui.rnNode.rn4.visible) {
  4319. let name = this.ui.rnNode.inputName.text;
  4320. let code = this.ui.rnNode.inputCode.text;
  4321. if (code && code.length == 18) {
  4322. this.ui.rnNode.rn1.visible = false;
  4323. this.ui.rnNode.rn4.visible = false;
  4324. Moyu.authenticate(name, code, (res) => {
  4325. this.ui.rnNode.rn2.visible = !res;
  4326. this.ui.rnNode.rn3.visible = res;
  4327. this.ui.rnNode.btnDone.visible = res;
  4328. this.ui.rnNode.btnExit.visible = !res;
  4329. this.ui.rnNode.btnCheck.visible = !res;
  4330. if (res)
  4331. this.showFcm();
  4332. });
  4333. }
  4334. else
  4335. this.showMsg("信息填写不完整");
  4336. }
  4337. }
  4338. loadXy(type = 0) {
  4339. this.ui.xyNode.xy1.visible = false;
  4340. this.ui.xyNode.xy2.visible = true;
  4341. this.ui.xyNode.xyList.scrollToView(0);
  4342. if (type == 1) {
  4343. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4344. }
  4345. else if (type == 2) {
  4346. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4347. }
  4348. }
  4349. showXy(type = 0) {
  4350. this.xyBtn();
  4351. if (type == 0) {
  4352. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4353. this.ui.xyNode.btnSure.visible = true;
  4354. }
  4355. else {
  4356. this.ui.xyNode.btnYes.visible = true;
  4357. this.ui.xyNode.btnNo.visible = true;
  4358. }
  4359. }
  4360. else {
  4361. this.ui.xyNode.btnKnown.visible = true;
  4362. this.ui.mainBg.visible = true;
  4363. }
  4364. this.ui.xyNode.xy1.visible = true;
  4365. this.ui.xyNode.xy2.visible = false;
  4366. this.ui.xyNode.visible = true;
  4367. this.ui.visible = true;
  4368. }
  4369. xyBtn() {
  4370. this.ui.xyNode.btnSure.visible = false;
  4371. this.ui.xyNode.btnYes.visible = false;
  4372. this.ui.xyNode.btnNo.visible = false;
  4373. this.ui.xyNode.btnKnown.visible = false;
  4374. {
  4375. this.ui.xyNode.btnXy3.visible = false;
  4376. this.ui.xyNode.btnXy2.visible = true;
  4377. this.ui.xyNode.btnXy1.visible = true;
  4378. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4379. }
  4380. }
  4381. createXY(json) {
  4382. this.ysJson = json.content;
  4383. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4384. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4385. this.ui.xyNode.xy2.visible = true;
  4386. }
  4387. renderListItem(idx, cell) {
  4388. let xy = this.ysJson[idx];
  4389. cell.height = xy.line * 30;
  4390. cell.xyItem.text = xy.text;
  4391. }
  4392. onDestroy() {
  4393. this.agreeCall = null;
  4394. }
  4395. }
  4396. class SettingNode {
  4397. constructor(ui) {
  4398. this.showSetting = false;
  4399. this.openSound = true;
  4400. this.openShake = true;
  4401. this.ui = ui;
  4402. this.ui.soundBtn.onClick(this, this.switchSound);
  4403. this.ui.shakeBtn.onClick(this, this.switchShake);
  4404. this.ui.xyBtn.onClick(this, this.onXy);
  4405. this.ui.clickNode.onClick(this, this.changeSetting);
  4406. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4407. }
  4408. changeSetting() {
  4409. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4410. this.showSetting = !this.showSetting;
  4411. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4412. }
  4413. switchSound() {
  4414. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4415. this.openSound = !this.openSound;
  4416. Moyu.onSetting(this.openSound, this.openShake);
  4417. xGame.soundMgr.onSetting(this.openSound);
  4418. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4419. }
  4420. switchShake() {
  4421. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4422. this.openShake = !this.openShake;
  4423. Moyu.onSetting(this.openSound, this.openShake);
  4424. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4425. }
  4426. onXy() {
  4427. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4428. MoyuMgr.showXy(1);
  4429. }
  4430. }
  4431. class ui_UILevelDisplay extends fgui.GComponent {
  4432. static createInstance() {
  4433. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4434. }
  4435. onConstruct() {
  4436. this.n9 = (this.getChild("n9"));
  4437. this.myNode = (this.getChild("myNode"));
  4438. this.closeNode = (this.getChild("closeNode"));
  4439. }
  4440. }
  4441. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4442. class ui_UILevelProp extends fgui.GComponent {
  4443. static createInstance() {
  4444. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4445. }
  4446. onConstruct() {
  4447. this.n16 = (this.getChild("n16"));
  4448. this.myNode = (this.getChild("myNode"));
  4449. this.closeBtn = (this.getChild("closeBtn"));
  4450. this.moneyNode = (this.getChild("moneyNode"));
  4451. this.t1 = this.getTransition("t1");
  4452. }
  4453. }
  4454. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4455. class ui_ShowItem extends fgui.GComponent {
  4456. static createInstance() {
  4457. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4458. }
  4459. onConstruct() {
  4460. this.myImg = (this.getChild("myImg"));
  4461. }
  4462. }
  4463. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4464. class ShowItem {
  4465. constructor() {
  4466. this.ui = ui_ShowItem.createInstance();
  4467. }
  4468. destroySelf() {
  4469. if (!this.ui.isDisposed) {
  4470. this.ui.removeFromParent();
  4471. this.ui.dispose();
  4472. }
  4473. }
  4474. setParent(parent) {
  4475. parent.addChild(this.ui);
  4476. }
  4477. setPos(x, y) {
  4478. this.ui.x = x;
  4479. this.ui.y = y;
  4480. }
  4481. setUrl(index) {
  4482. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4483. }
  4484. }
  4485. class ui_UIPower extends fgui.GComponent {
  4486. static createInstance() {
  4487. return (fgui.UIPackage.createObject("game", "UIPower"));
  4488. }
  4489. onConstruct() {
  4490. this.n11 = (this.getChild("n11"));
  4491. this.myNode = (this.getChild("myNode"));
  4492. this.t0 = this.getTransition("t0");
  4493. }
  4494. }
  4495. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4496. class UIPower extends UIBase {
  4497. constructor() {
  4498. super();
  4499. }
  4500. onConstructor() {
  4501. this.ui = ui_UIPower.createInstance();
  4502. this.contentPane = this.ui;
  4503. this.isEject = false;
  4504. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4505. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4506. }
  4507. show() {
  4508. super.show();
  4509. this.ui.t0.play();
  4510. }
  4511. videoGetPower() {
  4512. Moyu.showVideoAd(() => {
  4513. DataMgr.setPower(xGame.common.videoPower, true);
  4514. xGame.eventMgr.event(POWER_TIME);
  4515. this.hide();
  4516. }, EAdType.getPower);
  4517. }
  4518. }
  4519. UIPower.uiName = "UIPower";
  4520. class UILevelProp extends UIBase {
  4521. constructor() {
  4522. super();
  4523. this.firstPos = 385;
  4524. this.secondPos = 467;
  4525. this.showItemArr = [];
  4526. }
  4527. onConstructor() {
  4528. this.ui = ui_UILevelProp.createInstance();
  4529. this.contentPane = this.ui;
  4530. this.isEject = false;
  4531. this.addUIClick(this.ui.closeBtn, this.hide);
  4532. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4533. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4534. }
  4535. show(level) {
  4536. super.show();
  4537. this.ui.t1.play();
  4538. this.level = level;
  4539. this.data = cfgTable.placeballData[this.level];
  4540. this.updateSelf();
  4541. this.showPreView();
  4542. this.moneyNode.ui.c1.selectedIndex = 2;
  4543. this.moneyNode.checkPowerTime();
  4544. this.moneyNode.powerChange();
  4545. }
  4546. showPreView() {
  4547. let item;
  4548. let data;
  4549. for (let index = 0; index < this.showItemArr.length; index++) {
  4550. item = this.showItemArr[index];
  4551. item.destroySelf();
  4552. }
  4553. this.showItemArr = [];
  4554. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4555. for (const key in cfgData) {
  4556. data = cfgData[key];
  4557. item = new ShowItem();
  4558. item.setParent(this.ui.myNode.displayRoot);
  4559. item.setPos(data.x, data.y);
  4560. item.setUrl(data.value);
  4561. this.showItemArr.push(item);
  4562. }
  4563. }
  4564. updateSelf() {
  4565. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4566. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4567. if (this.data.ball == -1) {
  4568. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4569. }
  4570. else {
  4571. this.ui.myNode.conditionTxt.text = "Reward";
  4572. }
  4573. let localData = DataMgr.getPlaceBallLevel(this.level);
  4574. let getAward = localData.getAward;
  4575. let cfg = cfgTable.placeballData[this.level];
  4576. let coin = this.data.award[0];
  4577. let diamond = this.data.award[1];
  4578. if (cfg.type == PlaceBallType.challenge) {
  4579. diamond = 0;
  4580. coin = 100;
  4581. }
  4582. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4583. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4584. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4585. if (cfg.type == PlaceBallType.challenge) {
  4586. this.ui.myNode.coinNode.numTxt.text = "";
  4587. }
  4588. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4589. if (coin > 0 && diamond > 0) {
  4590. this.ui.myNode.diamondNode.x = 385;
  4591. this.ui.myNode.coinNode.x = 467;
  4592. }
  4593. else {
  4594. this.ui.myNode.diamondNode.x = 385;
  4595. this.ui.myNode.coinNode.x = 385;
  4596. }
  4597. if (!getAward) {
  4598. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4599. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4600. }
  4601. else {
  4602. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4603. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4604. }
  4605. }
  4606. startGame() {
  4607. if (DataMgr.powerEnough()) {
  4608. this.ui.myNode.startBtn.touchable = false;
  4609. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4610. console.log('zh:startGame ');
  4611. this.ui.myNode.startBtn.touchable = true;
  4612. DataMgr.setPower(-1);
  4613. xGame.eventMgr.event(POWER_TIME);
  4614. xGame.common.gameMode = GameMode.placeBall;
  4615. xGame.common.placeBallCurLevel = this.level;
  4616. xGame.uiMgr.Show(UIGame);
  4617. xGame.uiMgr.Hide(UILevelDisplay);
  4618. xGame.uiMgr.Hide(UIMain);
  4619. this.hide();
  4620. }));
  4621. }
  4622. else {
  4623. console.log('zh:startGame no power');
  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.closeBtn = (this.getChild("closeBtn"));
  5081. this.t0 = this.getTransition("t0");
  5082. }
  5083. }
  5084. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5085. class UISecretary extends UIBase {
  5086. constructor() {
  5087. super();
  5088. this.curIndex = 1;
  5089. }
  5090. onConstructor() {
  5091. this.ui = ui_UISecretary.createInstance();
  5092. this.contentPane = this.ui;
  5093. this.isEject = false;
  5094. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5095. this.nodeObj = { left: null, right: null, cur: null };
  5096. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5097. }
  5098. show() {
  5099. super.show();
  5100. this.ui.t0.play();
  5101. this.updateData();
  5102. }
  5103. addSecretarySpine(node, spineName) {
  5104. if (spineName == "mishu") {
  5105. if (this.secretarySpine1) {
  5106. node.displayObject.destroyChildren();
  5107. this.playWoman(this.secretarySpine1, node.displayObject);
  5108. }
  5109. else {
  5110. let spine1 = new SpineMgr("mishu", () => {
  5111. this.secretarySpine1 = spine1;
  5112. this.playWoman(this.secretarySpine1, node.displayObject);
  5113. });
  5114. }
  5115. }
  5116. else {
  5117. if (this.secretarySpine2) {
  5118. node.displayObject.destroyChildren();
  5119. this.playWoman(this.secretarySpine2, node.displayObject);
  5120. }
  5121. else {
  5122. let spine2 = new SpineMgr("xiaomishu2", () => {
  5123. this.secretarySpine2 = spine2;
  5124. this.playWoman(this.secretarySpine2, node.displayObject);
  5125. });
  5126. }
  5127. }
  5128. }
  5129. playWoman(node, parent) {
  5130. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5131. let yy = this.ui.myNode.gameNode3.secretary.height;
  5132. let scale = 1.5;
  5133. if (node == this.secretarySpine2) {
  5134. scale = 1.2;
  5135. }
  5136. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5137. node.play(data, 0, true, parent);
  5138. }
  5139. turnLeft() {
  5140. this.curIndex--;
  5141. if (this.curIndex < 1) {
  5142. this.curIndex = 2;
  5143. }
  5144. let left = this.nodeObj.left;
  5145. let right = this.nodeObj.right;
  5146. let cur = this.nodeObj.cur;
  5147. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5148. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5149. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5150. this.updateData();
  5151. }));
  5152. this.ui.myNode.setChildIndex(right, 2);
  5153. this.nodeObj.left = cur;
  5154. this.nodeObj.right = left;
  5155. this.nodeObj.cur = right;
  5156. }
  5157. turnRight() {
  5158. this.curIndex++;
  5159. if (this.curIndex > 2) {
  5160. this.curIndex = 1;
  5161. }
  5162. let left = this.nodeObj.left;
  5163. let right = this.nodeObj.right;
  5164. let cur = this.nodeObj.cur;
  5165. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5166. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5167. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5168. this.updateData();
  5169. }));
  5170. this.ui.myNode.setChildIndex(left, 2);
  5171. this.nodeObj.left = right;
  5172. this.nodeObj.right = cur;
  5173. this.nodeObj.cur = left;
  5174. }
  5175. updateData() {
  5176. let data = cfgTable.secretaryshopData;
  5177. let children = this.ui.myNode._children;
  5178. let temp;
  5179. let curData;
  5180. for (let index = 0; index < children.length; index++) {
  5181. temp = children[index];
  5182. curData = data[1];
  5183. temp.heightTxt.text = curData.height;
  5184. temp.foodTxt.text = curData.food;
  5185. temp.historyTxt.text = curData.history;
  5186. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5187. this.addSecretarySpine(temp.secretary, curData.spine);
  5188. let womanIndex = curData.id - 1;
  5189. let getWoman = DataMgr.getSecretary(womanIndex);
  5190. let curUse = DataMgr.getCurSecretary();
  5191. if (getWoman) {
  5192. if (curUse == womanIndex) {
  5193. temp.purchaseBtn.c1.selectedIndex = 1;
  5194. }
  5195. else {
  5196. temp.purchaseBtn.c1.selectedIndex = 2;
  5197. }
  5198. }
  5199. else {
  5200. temp.purchaseBtn.c1.selectedIndex = 0;
  5201. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5202. }
  5203. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5204. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5205. }
  5206. }
  5207. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5208. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5209. if (getWoman) {
  5210. if (curUse != womanIndex) {
  5211. console.log();
  5212. DataMgr.setCurSecretary(womanIndex);
  5213. this.updateData();
  5214. }
  5215. }
  5216. else {
  5217. let need = needDiamond;
  5218. if (DataMgr.diamondEnough(need)) {
  5219. DataMgr.setDiamond(-need);
  5220. DataMgr.setSecretary(womanIndex, 1);
  5221. DataMgr.setCurSecretary(womanIndex);
  5222. this.updateData();
  5223. }
  5224. else {
  5225. xGame.uiMgr.Show(UIAddProp, 1);
  5226. }
  5227. }
  5228. }
  5229. closeSelf() {
  5230. this.hide();
  5231. }
  5232. }
  5233. UISecretary.uiName = "UISecretary";
  5234. class ui_UIShop extends fgui.GComponent {
  5235. static createInstance() {
  5236. return (fgui.UIPackage.createObject("game", "UIShop"));
  5237. }
  5238. onConstruct() {
  5239. this.n48 = (this.getChild("n48"));
  5240. this.n0 = (this.getChild("n0"));
  5241. this.secretary = (this.getChild("secretary"));
  5242. this.talkNode = (this.getChild("talkNode"));
  5243. this.closeNode = (this.getChild("closeNode"));
  5244. this.moneyNode = (this.getChild("moneyNode"));
  5245. this.myNode = (this.getChild("myNode"));
  5246. }
  5247. }
  5248. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5249. class BallRodDisplay {
  5250. constructor(ui, index) {
  5251. this.index = 0;
  5252. this.uiIndex = 0;
  5253. this.ui = ui;
  5254. this.index = index;
  5255. this.initData();
  5256. }
  5257. initData() {
  5258. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5259. let data = cfgTable.ballrodData[this.index + 1];
  5260. this.ui.nameTxt.text = data.name;
  5261. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5262. this.ui.levelNode.c1.selectedIndex = data.quality;
  5263. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5264. if (data.spine) {
  5265. this.mySpine = new SpineMgr(data.spine, () => {
  5266. let xx = 150;
  5267. let yy = 70;
  5268. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5269. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5270. });
  5271. }
  5272. }
  5273. updateSelf() {
  5274. let get = DataMgr.getBallRod(this.index);
  5275. if (get == null)
  5276. get = 1;
  5277. let curUse = DataMgr.getCurBallRod();
  5278. if (get) {
  5279. if (curUse == this.index) {
  5280. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5281. }
  5282. else {
  5283. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5284. }
  5285. }
  5286. else {
  5287. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5288. }
  5289. }
  5290. buyBallRod() {
  5291. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5292. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5293. switch (selectedIndex) {
  5294. case 0:
  5295. break;
  5296. case 1:
  5297. DataMgr.setCurBallRod(this.index);
  5298. let ui = xGame.uiMgr.getUI(UIShop);
  5299. ui.updateBallRod();
  5300. break;
  5301. case 2:
  5302. let data = cfgTable.ballrodData[this.index + 1];
  5303. let need = data.price;
  5304. if (DataMgr.diamondEnough(need)) {
  5305. DataMgr.setDiamond(-need);
  5306. DataMgr.setBallRod(this.index, 1);
  5307. DataMgr.setCurBallRod(this.index);
  5308. let ui = xGame.uiMgr.getUI(UIShop);
  5309. ui.updateBallRod();
  5310. }
  5311. else {
  5312. xGame.uiMgr.Show(UIAddProp, 1);
  5313. }
  5314. break;
  5315. default:
  5316. break;
  5317. }
  5318. }
  5319. }
  5320. class UIShop extends UIBase {
  5321. constructor() {
  5322. super();
  5323. this.itemNums = 0;
  5324. }
  5325. onConstructor() {
  5326. this.ui = ui_UIShop.createInstance();
  5327. this.contentPane = this.ui;
  5328. this.isEject = false;
  5329. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5330. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5331. this.addUIClick(this.ui, this.interuptSecretary);
  5332. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5333. this.ballRodArr = [];
  5334. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5335. this.ui.myNode.myList.numItems = this.itemNums;
  5336. if (Moyu.isKs)
  5337. this.ui.closeNode.closeBtn.x += 100;
  5338. }
  5339. show() {
  5340. super.show();
  5341. this.playSecretaryIdle();
  5342. this.updateBallRod();
  5343. }
  5344. updateBallRod() {
  5345. for (let index = 0; index < this.ballRodArr.length; index++) {
  5346. this.ballRodArr[index].updateSelf();
  5347. }
  5348. }
  5349. renderBallRod(sort, obj) {
  5350. let index = this.getIndexBySort(sort + 1) - 1;
  5351. let ballRod = new BallRodDisplay(obj, index);
  5352. this.ballRodArr.push(ballRod);
  5353. }
  5354. getIndexBySort(sort) {
  5355. let object = cfgTable.ballrodData;
  5356. for (const key in object) {
  5357. if (object[key].sort == sort) {
  5358. return parseInt(key);
  5359. }
  5360. }
  5361. }
  5362. playSecretaryIdle() {
  5363. let parent = this.ui.secretary.displayObject;
  5364. parent.destroyChildren();
  5365. let xx = this.ui.secretary.width / 2;
  5366. let yy = this.ui.secretary.height;
  5367. let scale = xGame.common.getSecretaryScale();
  5368. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5369. xGame.common.secretary.play(data, 0, true, parent);
  5370. }
  5371. interuptSecretary() {
  5372. Laya.timer.clearAll(this);
  5373. this.playSecretaryRandomSound();
  5374. }
  5375. playSecretaryRandomSound() {
  5376. if (this.isHide)
  5377. return;
  5378. let time = xGame.common.randomNum(45000, 60000);
  5379. Laya.timer.once(time, this, () => {
  5380. if (this.isHide)
  5381. return;
  5382. let index = xGame.common.randomNum(4, 7);
  5383. xGame.soundMgr.playSound("s_main0" + index);
  5384. let words = 1;
  5385. switch (index) {
  5386. case 4:
  5387. words = 5;
  5388. break;
  5389. case 5:
  5390. words = 3;
  5391. break;
  5392. case 6:
  5393. words = 6;
  5394. break;
  5395. case 7:
  5396. words = 7;
  5397. break;
  5398. default:
  5399. break;
  5400. }
  5401. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5402. this.playSecretaryRandomSound();
  5403. });
  5404. }
  5405. closeSelf() {
  5406. this.hide();
  5407. }
  5408. }
  5409. UIShop.uiName = "UIShop";
  5410. class ui_UISign extends fgui.GComponent {
  5411. static createInstance() {
  5412. return (fgui.UIPackage.createObject("game", "UISign"));
  5413. }
  5414. onConstruct() {
  5415. this.n6 = (this.getChild("n6"));
  5416. this.closeNode = (this.getChild("closeNode"));
  5417. this.myNode = (this.getChild("myNode"));
  5418. this.moneyNode = (this.getChild("moneyNode"));
  5419. this.secretary = (this.getChild("secretary"));
  5420. this.talkNode = (this.getChild("talkNode"));
  5421. this.tripleBtn = (this.getChild("tripleBtn"));
  5422. this.normalBtn = (this.getChild("normalBtn"));
  5423. this.tipsNode = (this.getChild("tipsNode"));
  5424. this.againBtn = (this.getChild("againBtn"));
  5425. this.t0 = this.getTransition("t0");
  5426. }
  5427. }
  5428. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5429. class SignMax {
  5430. constructor(ui) {
  5431. this.ui = ui;
  5432. }
  5433. updateSelf(index, sameDay, curDayIndex) {
  5434. let data = cfgTable.signData[index + 1];
  5435. this.ui.titleTxt.text = data.title;
  5436. let arr1 = data.award[0].split('-');
  5437. let arr2 = data.award[1].split('-');
  5438. let num1 = parseInt(arr1[1]);
  5439. let num2 = parseInt(arr2[1]);
  5440. this.ui.numTxt1.text = num1 + "";
  5441. this.ui.numTxt2.text = num2 + "";
  5442. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5443. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5444. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5445. this.ui.numTxt1.visible = false;
  5446. }
  5447. else {
  5448. this.ui.numTxt1.visible = true;
  5449. }
  5450. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5451. this.ui.numTxt2.visible = false;
  5452. }
  5453. else {
  5454. this.ui.numTxt2.visible = true;
  5455. }
  5456. if (index < curDayIndex) {
  5457. this.ui.c1.selectedIndex = 1;
  5458. }
  5459. else if (index == curDayIndex) {
  5460. if (sameDay) {
  5461. this.ui.c1.selectedIndex = 2;
  5462. }
  5463. else {
  5464. this.ui.c1.selectedIndex = 2;
  5465. }
  5466. }
  5467. else {
  5468. this.ui.c1.selectedIndex = 0;
  5469. }
  5470. }
  5471. }
  5472. class SignNormal {
  5473. constructor(ui) {
  5474. this.ui = ui;
  5475. }
  5476. updateSelf(index, sameDay, curDayIndex) {
  5477. let data = cfgTable.signData[index + 1];
  5478. this.ui.titleTxt.text = data.title;
  5479. let arr = data.award[0].split('-');
  5480. let type = parseInt(arr[0]);
  5481. let num = parseInt(arr[1]);
  5482. this.ui.numTxt.text = num + "";
  5483. if (type > 2) {
  5484. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5485. this.ui.myIcon.rotation = 0;
  5486. }
  5487. else {
  5488. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5489. this.ui.myIcon.rotation = 0;
  5490. }
  5491. if (xGame.common.signAwardContainsRod(data.award)) {
  5492. this.ui.numTxt.visible = false;
  5493. }
  5494. else {
  5495. this.ui.numTxt.visible = true;
  5496. }
  5497. if (index < curDayIndex) {
  5498. this.ui.c1.selectedIndex = 1;
  5499. }
  5500. else if (index == curDayIndex) {
  5501. if (sameDay) {
  5502. this.ui.c1.selectedIndex = 2;
  5503. }
  5504. else {
  5505. this.ui.c1.selectedIndex = 2;
  5506. }
  5507. }
  5508. else {
  5509. this.ui.c1.selectedIndex = 0;
  5510. }
  5511. }
  5512. }
  5513. class UISign extends UIBase {
  5514. constructor() {
  5515. super();
  5516. this.curDayIndex = 0;
  5517. this.starX = 0;
  5518. }
  5519. onConstructor() {
  5520. this.ui = ui_UISign.createInstance();
  5521. this.contentPane = this.ui;
  5522. this.isEject = false;
  5523. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5524. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5525. this.initSignItem();
  5526. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5527. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5528. }
  5529. show() {
  5530. super.show();
  5531. this.ui.t0.play();
  5532. this.playSecretaryIdle();
  5533. this.updateSign();
  5534. }
  5535. initSignItem() {
  5536. this.signArr = [];
  5537. for (let index = 0; index < 6; index++) {
  5538. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5539. this.signArr.push(temp);
  5540. }
  5541. this.signMax = new SignMax(this.ui.myNode.day7);
  5542. if (Moyu.isKs)
  5543. this.ui.closeNode.closeBtn.x += 100;
  5544. }
  5545. updateSign() {
  5546. let sameDay = xGame.common.judgeSameDay();
  5547. let max = 7;
  5548. this.curDayIndex = DataMgr.getSignData();
  5549. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5550. this.curDayIndex = 0;
  5551. if (!sameDay) {
  5552. this.ui.normalBtn.visible = true;
  5553. this.ui.tipsNode.visible = false;
  5554. this.ui.againBtn.visible = false;
  5555. }
  5556. else {
  5557. this.ui.normalBtn.visible = false;
  5558. let again = DataMgr.getExtraSign();
  5559. let isCurrency = false;
  5560. let index = this.curDayIndex;
  5561. if (index == 0)
  5562. index = 7;
  5563. let award = cfgTable.signData[index].award;
  5564. let num = award[0].split("-")[0];
  5565. if (num == "1" || num == "2")
  5566. isCurrency = true;
  5567. let showAgain = again == 0 && isCurrency;
  5568. this.ui.againBtn.visible = showAgain;
  5569. this.ui.tipsNode.visible = !showAgain;
  5570. }
  5571. for (let index = 0; index < this.signArr.length; index++) {
  5572. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5573. }
  5574. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5575. }
  5576. playSecretaryIdle() {
  5577. let parent = this.ui.secretary.displayObject;
  5578. parent.destroyChildren();
  5579. let xx = this.ui.secretary.width / 2;
  5580. let yy = this.ui.secretary.height;
  5581. let scale = xGame.common.getSecretaryScale();
  5582. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5583. xGame.common.secretary.play(data, 0, true, parent);
  5584. }
  5585. closeSelf() {
  5586. this.hide();
  5587. }
  5588. normalGetAward() {
  5589. let sameDay = xGame.common.judgeSameDay();
  5590. if (!sameDay) {
  5591. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5592. let temp;
  5593. let type;
  5594. let num;
  5595. let arr = [];
  5596. for (let index = 0; index < award.length; index++) {
  5597. temp = award[index].split("-");
  5598. type = parseInt(temp[0]);
  5599. num = parseInt(temp[1]);
  5600. let awardType = new AwardType();
  5601. awardType.num = num;
  5602. awardType.type = type;
  5603. arr.push(awardType);
  5604. }
  5605. xGame.common.getAward(arr, (watchVideo) => {
  5606. this.curDayIndex++;
  5607. if (this.curDayIndex > 7)
  5608. this.curDayIndex = 0;
  5609. DataMgr.setSignData(this.curDayIndex);
  5610. DataMgr.setSignTime(new Date().getTime());
  5611. if (watchVideo) {
  5612. DataMgr.setExtraSign(1);
  5613. Moyu.sendDataEvent("signIn1");
  5614. }
  5615. this.updateSign();
  5616. });
  5617. }
  5618. }
  5619. againGetAward() {
  5620. Moyu.sendDataEvent("signIn2");
  5621. Moyu.showVideoAd(() => {
  5622. let index = this.curDayIndex;
  5623. if (index == 0)
  5624. index = 7;
  5625. let award = cfgTable.signData[index].award;
  5626. let temp;
  5627. let type;
  5628. let num;
  5629. for (let index = 0; index < award.length; index++) {
  5630. temp = award[index].split("-");
  5631. type = parseInt(temp[0]);
  5632. num = parseInt(temp[1]) * 3;
  5633. xGame.common.playObjFlyAnim(num, type);
  5634. }
  5635. DataMgr.setExtraSign(1);
  5636. this.updateSign();
  5637. }, EAdType.againSign);
  5638. }
  5639. }
  5640. UISign.uiName = "UISign";
  5641. class ui_UISkill extends fgui.GComponent {
  5642. static createInstance() {
  5643. return (fgui.UIPackage.createObject("game", "UISkill"));
  5644. }
  5645. onConstruct() {
  5646. this.n48 = (this.getChild("n48"));
  5647. this.n0 = (this.getChild("n0"));
  5648. this.secretary = (this.getChild("secretary"));
  5649. this.talkNode = (this.getChild("talkNode"));
  5650. this.closeNode = (this.getChild("closeNode"));
  5651. this.moneyNode = (this.getChild("moneyNode"));
  5652. this.skillNode = (this.getChild("skillNode"));
  5653. this.guideNode = (this.getChild("guideNode"));
  5654. }
  5655. }
  5656. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5657. class SkillDisplay {
  5658. constructor(ui, data, uiIndex) {
  5659. this.starX = 0;
  5660. this.starY = 0;
  5661. this.index = 0;
  5662. this.ui = ui;
  5663. this.data = data;
  5664. this.index = uiIndex;
  5665. this.initSelf();
  5666. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5667. }
  5668. initSelf() {
  5669. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5670. this.ui.nameTxt.text = this.data.name;
  5671. this.ui.describeTxt.text = this.data.describe;
  5672. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5673. this.ui.startBtn.onClick(this, this.startGame);
  5674. this.updateSelf();
  5675. }
  5676. updateSelf() {
  5677. this.checkTry();
  5678. let level = DataMgr.getBigSkillByIndex(this.index);
  5679. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5680. }
  5681. checkTry() {
  5682. let index = this.index;
  5683. let level = DataMgr.getBigSkillByIndex(index);
  5684. if (level == null) {
  5685. DataMgr.setBigSkill(index, 1, false);
  5686. level = 1;
  5687. }
  5688. this.ui.levelTxt.text = "LV." + level;
  5689. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5690. this.ui.tryNode.visible = true;
  5691. else
  5692. this.ui.tryNode.visible = false;
  5693. }
  5694. clickAddLevel() {
  5695. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5696. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5697. Moyu.showVideoAd(() => {
  5698. DataMgr.setBigSkill(this.data.index, 1);
  5699. this.updateSelf();
  5700. xGame.common.upSkillLevel = true;
  5701. }, EAdType.upSkill);
  5702. }
  5703. startGame() {
  5704. if (this.data.index == 3) {
  5705. alert('Coming soon!');
  5706. return;
  5707. }
  5708. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5709. let needCoin = xGame.common.bigMoveNeedCoin;
  5710. xGame.common.passAwardCoin = 2000;
  5711. let guide = DataMgr.getSkillGuide();
  5712. console.log('zh:startGame guide=' + guide);
  5713. xGame.common.temSelfLevel = 0;
  5714. if (guide == 0) {
  5715. needCoin = 0;
  5716. xGame.common.temSelfLevel = 100;
  5717. }
  5718. if (DataMgr.coinEnough(needCoin)) {
  5719. DataMgr.setCoin(-needCoin);
  5720. xGame.common.curPlayerSkillType = this.index;
  5721. if (guide == 0)
  5722. xGame.common.curPlayerSkillType = 0;
  5723. xGame.uiMgr.Show(UIGame);
  5724. xGame.uiMgr.Hide(UIMain);
  5725. xGame.uiMgr.Show(UIMatching, () => {
  5726. xGame.common.gameUI.ui.alpha = 1;
  5727. xGame.common.gameUI.startGame();
  5728. xGame.uiMgr.Hide(UISkill);
  5729. });
  5730. }
  5731. else {
  5732. xGame.uiMgr.Show(UIAddProp, 0);
  5733. Moyu.sendDataEvent("AddCoinVideo");
  5734. }
  5735. }
  5736. }
  5737. class UISkill extends UIBase {
  5738. constructor() {
  5739. super();
  5740. this.skillData = [];
  5741. }
  5742. onConstructor() {
  5743. this.ui = ui_UISkill.createInstance();
  5744. this.contentPane = this.ui;
  5745. this.isEject = false;
  5746. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5747. this.initSkillData();
  5748. console.log('zh:aaaaaa1111111111');
  5749. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5750. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5751. console.log('zh:aaaaaa22222222');
  5752. this.displayList = [];
  5753. this.ui.skillNode.skillList.numItems = 3;
  5754. this.addUIClick(this.ui, this.interuptSecretary);
  5755. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5756. this.ui.talkNode.visible = false;
  5757. if (Moyu.isKs)
  5758. this.ui.closeNode.closeBtn.x += 100;
  5759. }
  5760. show() {
  5761. super.show();
  5762. this.playSecretaryIdle();
  5763. this.moneyNode.ui.c1.selectedIndex = 1;
  5764. Laya.timer.clearAll(this);
  5765. xGame.soundMgr.playSound("s_start");
  5766. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5767. let guide = DataMgr.getSkillGuide();
  5768. this.ui.guideNode.visible = guide == 0;
  5769. let item = this.getSkillItemByUIIndex(0);
  5770. if (guide == 0) {
  5771. item.ui.c1.selectedIndex = 1;
  5772. }
  5773. else {
  5774. item.ui.c1.selectedIndex = 0;
  5775. }
  5776. this.ui.guideNode.guideBtn.visible = guide == 0;
  5777. for (let index = 0; index < this.displayList.length; index++) {
  5778. this.displayList[index].checkTry();
  5779. }
  5780. }
  5781. getSkillItemByUIIndex(cur) {
  5782. for (let index = 0; index < this.displayList.length; index++) {
  5783. if (this.displayList[index].index == cur) {
  5784. return this.displayList[index];
  5785. }
  5786. }
  5787. }
  5788. enterGuideLevel() {
  5789. let item = this.getSkillItemByUIIndex(0);
  5790. item.startGame();
  5791. if (DataMgr.getNewUser())
  5792. Moyu.sendDataEvent("gameStart1");
  5793. }
  5794. initSkillData() {
  5795. this.skillData = [];
  5796. let nameList = xGame.common.skillNameList;
  5797. let iconList = xGame.common.skillIconList;
  5798. let describeList = [
  5799. "Jump shot executed — ball bounced and pocketed an extra one!",
  5800. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5801. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5802. ];
  5803. console.log('zh:initSkillData 111111111');
  5804. let data;
  5805. for (let index = 0; index < nameList.length; index++) {
  5806. data = {};
  5807. data.name = nameList[index];
  5808. data.icon = iconList[index];
  5809. data.describe = describeList[index];
  5810. data.index = index;
  5811. this.skillData.push(data);
  5812. }
  5813. }
  5814. updateSkillItem(index, target) {
  5815. if (this.displayList[index] == null) {
  5816. let uiIndex;
  5817. switch (index) {
  5818. case 0:
  5819. uiIndex = 1;
  5820. break;
  5821. case 1:
  5822. uiIndex = 0;
  5823. break;
  5824. case 2:
  5825. uiIndex = 2;
  5826. break;
  5827. case 3:
  5828. uiIndex = 3;
  5829. break;
  5830. default:
  5831. break;
  5832. }
  5833. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5834. this.displayList.push(temp);
  5835. }
  5836. }
  5837. playSecretaryIdle() {
  5838. let parent = this.ui.secretary.displayObject;
  5839. parent.destroyChildren();
  5840. let xx = this.ui.secretary.width / 2;
  5841. let yy = this.ui.secretary.height;
  5842. let scale = xGame.common.getSecretaryScale();
  5843. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5844. xGame.common.secretary.play(data, 0, true, parent);
  5845. }
  5846. returnUIMain() {
  5847. this.hide();
  5848. xGame.common.stopGirlPop(this.ui.talkNode);
  5849. xGame.uiMgr.Show(UIMain);
  5850. }
  5851. interuptSecretary() {
  5852. Laya.timer.clearAll(this);
  5853. this.playSecretaryRandomSound();
  5854. }
  5855. playSecretaryRandomSound() {
  5856. if (this.isHide)
  5857. return;
  5858. let time = xGame.common.randomNum(45000, 60000);
  5859. Laya.timer.once(time, this, () => {
  5860. if (this.isHide)
  5861. return;
  5862. let index = xGame.common.randomNum(4, 7);
  5863. xGame.soundMgr.playSound("s_main0" + index);
  5864. let words = 1;
  5865. switch (index) {
  5866. case 4:
  5867. words = 5;
  5868. break;
  5869. case 5:
  5870. words = 3;
  5871. break;
  5872. case 6:
  5873. words = 6;
  5874. break;
  5875. case 7:
  5876. words = 7;
  5877. break;
  5878. default:
  5879. break;
  5880. }
  5881. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5882. this.playSecretaryRandomSound();
  5883. });
  5884. }
  5885. }
  5886. UISkill.uiName = "UISkill";
  5887. class ui_UIMsg extends fgui.GComponent {
  5888. static createInstance() {
  5889. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5890. }
  5891. onConstruct() {
  5892. this.tipsNode = (this.getChild("tipsNode"));
  5893. }
  5894. }
  5895. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5896. class UIMsg extends UIBase {
  5897. constructor() {
  5898. super();
  5899. }
  5900. onConstructor() {
  5901. this.ui = ui_UIMsg.createInstance();
  5902. this.contentPane = this.ui;
  5903. this.isEject = false;
  5904. this.isMuti = true;
  5905. }
  5906. show(msg, callback) {
  5907. super.show();
  5908. this.ui.tipsNode.msgTxt.text = msg;
  5909. this.ui.alpha = 1;
  5910. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5911. this.hide();
  5912. callback && callback();
  5913. }), 1000);
  5914. }
  5915. }
  5916. UIMsg.uiName = "UIMsg";
  5917. class ui_UIModeSelection extends fgui.GComponent {
  5918. static createInstance() {
  5919. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5920. }
  5921. onConstruct() {
  5922. this.n19 = (this.getChild("n19"));
  5923. this.closeBtn = (this.getChild("closeBtn"));
  5924. this.myNode = (this.getChild("myNode"));
  5925. this.t0 = this.getTransition("t0");
  5926. }
  5927. }
  5928. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5929. class UIModeSelection extends UIBase {
  5930. constructor() {
  5931. super();
  5932. }
  5933. onConstructor() {
  5934. this.ui = ui_UIModeSelection.createInstance();
  5935. this.contentPane = this.ui;
  5936. this.isEject = false;
  5937. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5938. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5939. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5940. this.addUIClick(this.ui.closeBtn, this.hide);
  5941. this.peopleArr = [650, 6900, 3800];
  5942. this.peopleOffest = [50, 500, 200];
  5943. this.updateSelf();
  5944. }
  5945. show(callback) {
  5946. super.show();
  5947. this.ui.t0.play();
  5948. this.callback = callback;
  5949. }
  5950. updateSelf() {
  5951. let cfg = cfgTable.modeselectData;
  5952. for (let index = 1; index <= 3; index++) {
  5953. let node = this.ui.myNode["type" + index];
  5954. node.need.text = cfg[index].need;
  5955. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  5956. node.peopleTxt.text = this.getRandPeople(index - 1);
  5957. }
  5958. }
  5959. enterGame(type) {
  5960. xGame.common.classicRoomType = type;
  5961. let cfg = cfgTable.modeselectData[type];
  5962. let need = cfg.need;
  5963. xGame.common.passAwardCoin = cfg.award;
  5964. if (DataMgr.coinEnough(need)) {
  5965. DataMgr.setCoin(-need);
  5966. this.ui.myNode["type" + type].t0.play();
  5967. Laya.timer.once(200, this, () => {
  5968. this.callback && this.callback();
  5969. });
  5970. }
  5971. else {
  5972. Moyu.sendDataEvent("AddCoinVideo");
  5973. xGame.uiMgr.Show(UIAddProp, 0);
  5974. }
  5975. }
  5976. getRandPeople(index) {
  5977. let rand = this.peopleOffest[index];
  5978. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5979. }
  5980. }
  5981. UIModeSelection.uiName = "UIModeSelection";
  5982. class UIMain extends UIBase {
  5983. constructor() {
  5984. super();
  5985. this.firstEnter = true;
  5986. }
  5987. onConstructor() {
  5988. this.ui = ui_UIMain.createInstance();
  5989. this.contentPane = this.ui;
  5990. this.isEject = false;
  5991. this.addEvent();
  5992. this.addClickSpine();
  5993. this.settingNode = new SettingNode(this.ui.settingNode);
  5994. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5995. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  5996. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  5997. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  5998. let curUse = DataMgr.getCurSecretary();
  5999. this.changeSecretary(curUse);
  6000. this.ui.talkNode.visible = false;
  6001. let guide = DataMgr.getSkillGuide();
  6002. if (xGame.common.isNewDay && guide == 1) {
  6003. xGame.common.isNewDay = false;
  6004. xGame.soundMgr.playSound("s_main01");
  6005. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6006. console.log("播放小秘书每天语音");
  6007. }
  6008. this.onGetUserInfo();
  6009. this.ui.n83.visible = false;
  6010. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6011. }
  6012. changeSecretary(curUse) {
  6013. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6014. xGame.common.secretary && xGame.common.secretary.dispose();
  6015. this.addSecretarySpine(name);
  6016. }
  6017. addSecretarySpine(name) {
  6018. let spine = new SpineMgr(name, () => {
  6019. this.playSecretaryIdle();
  6020. });
  6021. xGame.common.secretary = spine;
  6022. }
  6023. addClickSpine() {
  6024. let clickSpine = new SpineMgr("dianji", () => {
  6025. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6026. let parent = Laya.stage;
  6027. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6028. clickSpine.play(data, 0, false, parent, (spine) => {
  6029. spine.destroy(true);
  6030. });
  6031. });
  6032. });
  6033. }
  6034. addEvent() {
  6035. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6036. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6037. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6038. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6039. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6040. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6041. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6042. this.addUIClick(this.ui, this.interuptSecretary);
  6043. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6044. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6045. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6046. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6047. this.addUIClick(this.ui.signBtn, this.openSignView);
  6048. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6049. }
  6050. show(showFailWords) {
  6051. super.show();
  6052. this.moneyNode.ui.c1.selectedIndex = 1;
  6053. this.playSecretaryIdle();
  6054. xGame.soundMgr.playMusic("caromhall01");
  6055. Laya.timer.clearAll(this);
  6056. this.playSecretaryRandomSound();
  6057. if (showFailWords) {
  6058. setTimeout(() => {
  6059. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6060. let words = -1;
  6061. if (str == "s_main02") {
  6062. words = 2;
  6063. }
  6064. else {
  6065. words = 3;
  6066. }
  6067. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6068. xGame.soundMgr.playSound(str);
  6069. }, 300);
  6070. }
  6071. this.showGuide();
  6072. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6073. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6074. let guide = DataMgr.getSkillGuide();
  6075. if (guide == 1) {
  6076. let randTime = xGame.common.randomNum(300, 800);
  6077. if (this.firstEnter) {
  6078. this.firstEnter = false;
  6079. randTime += 900;
  6080. }
  6081. Laya.timer.once(randTime, this, () => {
  6082. xGame.common.autoPopUIView();
  6083. });
  6084. }
  6085. }
  6086. checkActive(show) {
  6087. }
  6088. showGuide() {
  6089. let guide = DataMgr.getSkillGuide();
  6090. this.ui.guideBtn.visible = guide == 0;
  6091. this.ui.enterGuide.visible = false;
  6092. this.ui.secretaryGuide.visible = guide == 0;
  6093. if (guide == 0) {
  6094. xGame.soundMgr.playSound("s_guide");
  6095. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6096. }
  6097. }
  6098. ensureSecretary() {
  6099. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6100. this.ui.secretaryGuide.visible = false;
  6101. this.ui.enterGuide.visible = true;
  6102. this.ui.wordsNode.t0.play();
  6103. if (DataMgr.getNewUser())
  6104. Moyu.sendDataEvent("gameReady");
  6105. }
  6106. playSecretaryIdle() {
  6107. let parent = this.ui.secretary.displayObject;
  6108. parent.destroyChildren();
  6109. let xx = this.ui.secretary.width / 2;
  6110. let yy = this.ui.secretary.height;
  6111. let scale = xGame.common.getSecretaryScale();
  6112. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6113. console.log("zh:playSecretaryIdle", data);
  6114. xGame.common.secretary.play(data, 0, true, parent);
  6115. }
  6116. startGame(type) {
  6117. xGame.common.gameMode = type;
  6118. Moyu.sendDataEvent("PlayGame", { type: type });
  6119. switch (xGame.common.gameMode) {
  6120. case GameMode.classic:
  6121. let challengeTimes = DataMgr.getChallengeTimes();
  6122. if (challengeTimes == 0) {
  6123. xGame.uiMgr.Show(UIInvitation);
  6124. }
  6125. else {
  6126. this.beginGame();
  6127. }
  6128. break;
  6129. case GameMode.bigMove:
  6130. this.beginGame();
  6131. if (DataMgr.getNewUser())
  6132. Moyu.sendDataEvent("gameStart0");
  6133. break;
  6134. default:
  6135. break;
  6136. }
  6137. }
  6138. beginGame(isNice = false) {
  6139. if (xGame.common.gameMode == GameMode.classic) {
  6140. if (isNice) {
  6141. this.enterClassic();
  6142. }
  6143. else {
  6144. xGame.uiMgr.Show(UIModeSelection, () => {
  6145. this.enterClassic();
  6146. });
  6147. }
  6148. }
  6149. else if (xGame.common.gameMode == GameMode.bigMove) {
  6150. this.ui.enterGuide.visible = false;
  6151. xGame.uiMgr.Show(UISkill);
  6152. }
  6153. }
  6154. enterClassic() {
  6155. xGame.uiMgr.Show(UIGame);
  6156. xGame.uiMgr.Show(UIMatching, () => {
  6157. if (!this.isHide)
  6158. this.hide();
  6159. xGame.common.gameUI.ui.alpha = 1;
  6160. xGame.common.gameUI.startGame();
  6161. xGame.uiMgr.Hide(UIGameEnd);
  6162. });
  6163. }
  6164. startGlobal() {
  6165. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6166. }
  6167. startWeekly() {
  6168. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6169. }
  6170. startPlaceBall() {
  6171. xGame.uiMgr.Show(UILevelDisplay);
  6172. }
  6173. hide() {
  6174. super.hide();
  6175. xGame.common.stopGirlPop(this.ui.talkNode);
  6176. }
  6177. onGetUserInfo(force = false) {
  6178. if (Moyu.isWx) {
  6179. let info = Moyu.getSystemInfo();
  6180. if (info)
  6181. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6182. }
  6183. else {
  6184. Moyu.initUser(this, this.freshUser, force);
  6185. }
  6186. if (!Moyu.hasUserInfo) {
  6187. let user = Moyu.getUserInfo();
  6188. user.headIcon = 'res/ty_touxiang.png';
  6189. }
  6190. this.freshUser();
  6191. }
  6192. freshUser() {
  6193. let user = Moyu.getUserInfo();
  6194. if (!user.isAuth) {
  6195. user.headIcon = 'res/ty_touxiang.png';
  6196. }
  6197. else
  6198. DataMgr.upRankData();
  6199. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6200. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6201. }
  6202. interuptSecretary() {
  6203. Laya.timer.clearAll(this);
  6204. this.playSecretaryRandomSound();
  6205. }
  6206. playSecretaryRandomSound() {
  6207. if (this.isHide)
  6208. return;
  6209. let time = xGame.common.randomNum(45000, 60000);
  6210. Laya.timer.once(time, this, () => {
  6211. if (this.isHide)
  6212. return;
  6213. let index = xGame.common.randomNum(4, 7);
  6214. xGame.soundMgr.playSound("s_main0" + index);
  6215. let words = 1;
  6216. switch (index) {
  6217. case 4:
  6218. words = 5;
  6219. break;
  6220. case 5:
  6221. words = 3;
  6222. break;
  6223. case 6:
  6224. words = 6;
  6225. break;
  6226. case 7:
  6227. words = 7;
  6228. break;
  6229. default:
  6230. break;
  6231. }
  6232. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6233. this.playSecretaryRandomSound();
  6234. });
  6235. }
  6236. openSecretaryView() {
  6237. xGame.uiMgr.Show(UISecretary);
  6238. Moyu.sendDataEvent("secretary");
  6239. }
  6240. openShopView() {
  6241. xGame.uiMgr.Show(UIShop);
  6242. }
  6243. openSignView() {
  6244. xGame.uiMgr.Show(UISign);
  6245. }
  6246. openDrawView() {
  6247. xGame.uiMgr.Show(UIDraw);
  6248. }
  6249. openRanking() {
  6250. xGame.uiMgr.Show(UIRanking);
  6251. Moyu.sendDataEvent("rankingList");
  6252. }
  6253. }
  6254. UIMain.uiName = "UIMain";
  6255. class UIGameEnd extends UIBase {
  6256. constructor() {
  6257. super();
  6258. this.success = false;
  6259. this.awardCoinNum = 1000;
  6260. this.awardDiamondNum = 10;
  6261. }
  6262. onConstructor() {
  6263. this.ui = ui_UIGameEnd.createInstance();
  6264. this.contentPane = this.ui;
  6265. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6266. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6267. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6268. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6269. this.ui.talkNode.visible = false;
  6270. if (Moyu.isKs)
  6271. this.ui.closeNode.closeBtn.x += 100;
  6272. }
  6273. updateType() {
  6274. switch (xGame.common.gameMode) {
  6275. case GameMode.classic:
  6276. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6277. this.ui.coinNode.visible = this.success;
  6278. if (!this.success) {
  6279. Laya.timer.once(500, this, () => {
  6280. xGame.uiMgr.Show(UIAddCoin);
  6281. });
  6282. }
  6283. this.ui.isGetAward.visible = false;
  6284. this.ui.leftBtn.c1.selectedIndex = 3;
  6285. this.ui.rightBtn.c1.selectedIndex = 0;
  6286. this.moneyNode.ui.c1.selectedIndex = 1;
  6287. break;
  6288. case GameMode.bigMove:
  6289. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6290. this.ui.coinNode.visible = this.success;
  6291. if (xGame.common.gameMode == GameMode.bigMove) {
  6292. if (this.success) {
  6293. DataMgr.setSkillSuccessTimes(1, true);
  6294. DataMgr.setSkillAccTimes(1);
  6295. }
  6296. else {
  6297. DataMgr.setSkillSuccessTimes(0, false);
  6298. }
  6299. }
  6300. if (!this.success) {
  6301. Laya.timer.once(500, this, () => {
  6302. xGame.uiMgr.Show(UIAddCoin);
  6303. });
  6304. }
  6305. this.ui.isGetAward.visible = false;
  6306. this.ui.leftBtn.c1.selectedIndex = 3;
  6307. this.ui.rightBtn.c1.selectedIndex = 0;
  6308. this.moneyNode.ui.c1.selectedIndex = 1;
  6309. break;
  6310. case GameMode.placeBall:
  6311. this.ui.coinNode.visible = false;
  6312. if (this.success) {
  6313. if (xGame.common.placeBallStarNum == 3) {
  6314. this.ui.c1.selectedIndex = 2;
  6315. }
  6316. else {
  6317. this.ui.c1.selectedIndex = 3;
  6318. }
  6319. }
  6320. else {
  6321. this.ui.c1.selectedIndex = 4;
  6322. }
  6323. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6324. if (cfg.type == PlaceBallType.challenge) {
  6325. this.ui.c1.selectedIndex = 2;
  6326. }
  6327. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6328. this.updatePlaceBallBtn();
  6329. this.updatePlaceBallStarNum();
  6330. this.updatePlaceBallAwardState();
  6331. this.moneyNode.ui.c1.selectedIndex = 2;
  6332. this.moneyNode.checkPowerTime();
  6333. this.moneyNode.powerChange();
  6334. DataMgr.upRankData();
  6335. break;
  6336. default:
  6337. break;
  6338. }
  6339. }
  6340. updatePlaceBallBtn() {
  6341. this.ui.leftBtn.c1.selectedIndex = 5;
  6342. if (this.success) {
  6343. this.ui.rightBtn.c1.selectedIndex = 14;
  6344. }
  6345. else {
  6346. if (xGame.common.placeBallStarNum == 3) {
  6347. this.ui.rightBtn.c1.selectedIndex = 14;
  6348. }
  6349. else {
  6350. this.ui.rightBtn.c1.selectedIndex = 1;
  6351. }
  6352. }
  6353. }
  6354. updatePlaceBallStarNum() {
  6355. let starNum = xGame.common.placeBallStarNum;
  6356. if (starNum == 0)
  6357. this.ui.starNumNode.c1.selectedIndex = 3;
  6358. else {
  6359. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6360. }
  6361. }
  6362. updatePlaceBallAwardState() {
  6363. let level = xGame.common.placeBallCurLevel;
  6364. let starNum = xGame.common.placeBallStarNum;
  6365. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6366. let data = cfgTable.placeballData[level].award;
  6367. let cfg = cfgTable.placeballData[level];
  6368. this.awardDiamondNum = data[1];
  6369. this.awardCoinNum = data[0];
  6370. if (cfg.type == PlaceBallType.challenge) {
  6371. this.awardDiamondNum = 0;
  6372. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6373. }
  6374. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6375. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6376. if (cfg.type == PlaceBallType.challenge) {
  6377. this.ui.awardNode.coinNode.visible = true;
  6378. }
  6379. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6380. this.ui.awardNode.diamondNode.x = 265;
  6381. this.ui.awardNode.coinNode.x = 354;
  6382. }
  6383. else {
  6384. this.ui.awardNode.diamondNode.x = 291;
  6385. this.ui.awardNode.coinNode.x = 291;
  6386. }
  6387. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6388. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6389. if (this.awardCoinNum == 0) {
  6390. this.ui.awardNode.coinNode.numTxt.text = "";
  6391. }
  6392. if (getAward) {
  6393. this.ui.isGetAward.visible = true;
  6394. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6395. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6396. }
  6397. else {
  6398. this.ui.isGetAward.visible = false;
  6399. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6400. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6401. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6402. }
  6403. else {
  6404. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6405. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6406. }
  6407. }
  6408. }
  6409. show(success) {
  6410. super.show();
  6411. xGame.eventMgr.event(RESET_GAME);
  6412. this.success = success;
  6413. Laya.timer.clearAll(this);
  6414. this.playSecretaryAni();
  6415. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6416. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6417. offsetTime = Math.floor(offsetTime / 1000);
  6418. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6419. this.updateType();
  6420. Laya.timer.once(200, this, () => {
  6421. this.addAward(() => {
  6422. this.updateType();
  6423. Laya.timer.once(500, this, () => {
  6424. this.showChallengeLevel();
  6425. });
  6426. });
  6427. });
  6428. if (this.success) {
  6429. xGame.soundMgr.playSound('slots_roll01');
  6430. xGame.soundMgr.playSound("s_win");
  6431. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6432. }
  6433. else {
  6434. xGame.soundMgr.playSound('matchwin01');
  6435. xGame.soundMgr.playSound("s_lose");
  6436. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6437. }
  6438. if (!Moyu.isLegal)
  6439. PlatMgr.showBanner(true);
  6440. let challengeNum = DataMgr.getChallengeTimes();
  6441. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6442. DataMgr.setChallengeTimes(1);
  6443. }
  6444. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6445. DataMgr.setClassicTimes();
  6446. }
  6447. }
  6448. showChallengeLevel() {
  6449. if (DataMgr.getChallengeTimes() != 0)
  6450. return;
  6451. let skill = DataMgr.getSkillAccTimes();
  6452. let put = DataMgr.getPlaceBallLevelList().length;
  6453. if (skill >= 3 || put >= 5) {
  6454. xGame.uiMgr.Show(UIInvitation);
  6455. this.hide();
  6456. }
  6457. }
  6458. addAward(callback) {
  6459. if (!this.success) {
  6460. callback && callback();
  6461. return;
  6462. }
  6463. switch (xGame.common.gameMode) {
  6464. case GameMode.classic:
  6465. this.awardCoinNum = xGame.common.passAwardCoin;
  6466. this.awardDiamondNum = 0;
  6467. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6468. break;
  6469. case GameMode.bigMove:
  6470. this.awardCoinNum = xGame.common.passAwardCoin;
  6471. this.awardDiamondNum = 0;
  6472. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6473. callback && callback();
  6474. break;
  6475. case GameMode.placeBall:
  6476. let level = xGame.common.placeBallCurLevel;
  6477. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6478. if (xGame.common.placeBallStarNum != 3) {
  6479. callback && callback();
  6480. return;
  6481. }
  6482. else {
  6483. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6484. if (getAward) {
  6485. callback && callback();
  6486. return;
  6487. }
  6488. }
  6489. let cfg = cfgTable.placeballData[level];
  6490. let data = cfgTable.placeballData[level].award;
  6491. this.awardCoinNum = data[0];
  6492. this.awardDiamondNum = data[1];
  6493. if (cfg.type == PlaceBallType.challenge) {
  6494. this.awardDiamondNum = 0;
  6495. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6496. }
  6497. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6498. let diamondAward;
  6499. if (this.awardDiamondNum > 0) {
  6500. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6501. xGame.common.getAward([diamondAward, coinAward], callback);
  6502. }
  6503. else {
  6504. xGame.common.getAward([coinAward], callback);
  6505. }
  6506. if (cfg.type == PlaceBallType.normal) {
  6507. DataMgr.setPlaceBallAward(level);
  6508. }
  6509. break;
  6510. default:
  6511. break;
  6512. }
  6513. }
  6514. playSecretaryAni_old() {
  6515. let parent = this.ui.secretary.displayObject;
  6516. parent.destroyChildren();
  6517. let xx = this.ui.secretary.width / 2;
  6518. let yy = this.ui.secretary.height;
  6519. let scale = xGame.common.getSecretaryScale();
  6520. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6521. if (this.success) {
  6522. let rand = Math.random() <= 0.5 ? 2 : 3;
  6523. xGame.common.secretary.play(data, rand, false, parent, () => {
  6524. xGame.common.secretary.play(data, 1, true, parent);
  6525. });
  6526. }
  6527. else {
  6528. xGame.common.secretary.play(data, 0, true, parent);
  6529. }
  6530. }
  6531. playSecretaryAni() {
  6532. let parent = this.ui.secretary.displayObject;
  6533. parent.destroyChildren();
  6534. let xx = this.ui.secretary.width / 2;
  6535. let yy = this.ui.secretary.height;
  6536. let scale = xGame.common.getSecretaryScale();
  6537. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6538. if (this.success) {
  6539. let rand = 0;
  6540. xGame.common.secretary.play(data, 0, true, parent);
  6541. }
  6542. else {
  6543. xGame.common.secretary.play(data, 0, true, parent);
  6544. }
  6545. }
  6546. restartGame() {
  6547. switch (xGame.common.gameMode) {
  6548. case GameMode.classic:
  6549. xGame.eventMgr.event(RESTART_GAME);
  6550. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6551. break;
  6552. case GameMode.bigMove:
  6553. this.hide();
  6554. xGame.eventMgr.event(RESTART_GAME);
  6555. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6556. break;
  6557. default:
  6558. break;
  6559. }
  6560. }
  6561. hide() {
  6562. super.hide();
  6563. xGame.common.stopGirlPop(this.ui.talkNode);
  6564. PlatMgr.showBanner(false);
  6565. }
  6566. returnHome() {
  6567. this.hide();
  6568. let showFailWords = !this.success;
  6569. xGame.uiMgr.Show(UIMain, showFailWords);
  6570. }
  6571. clickLeftBtn() {
  6572. switch (xGame.common.gameMode) {
  6573. case GameMode.classic:
  6574. case GameMode.bigMove:
  6575. this.returnHome();
  6576. break;
  6577. case GameMode.placeBall:
  6578. let level = xGame.common.placeBallCurLevel;
  6579. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6580. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6581. break;
  6582. default:
  6583. break;
  6584. }
  6585. }
  6586. powerStartPlaceBallLevel(level, btn) {
  6587. if (DataMgr.powerEnough()) {
  6588. btn.touchable = false;
  6589. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6590. btn.touchable = true;
  6591. DataMgr.setPower(-1);
  6592. xGame.eventMgr.event(POWER_TIME);
  6593. this.startPlaceBallLevel(level);
  6594. }));
  6595. }
  6596. else {
  6597. xGame.uiMgr.Show(UIPower, 0);
  6598. }
  6599. }
  6600. clickRightBtn() {
  6601. switch (xGame.common.gameMode) {
  6602. case GameMode.classic:
  6603. console.log('zh:clickRightBtn 111');
  6604. case GameMode.bigMove:
  6605. console.log('zh:clickRightBtn 222');
  6606. this.restartGame();
  6607. break;
  6608. case GameMode.placeBall:
  6609. console.log('zh:clickRightBtn 333');
  6610. let level = xGame.common.placeBallCurLevel;
  6611. let data = DataMgr.getPlaceBallLevel(level);
  6612. let curPss = data.play && !data.isCur;
  6613. if (curPss) {
  6614. console.log('zh:clickRightBtn 333-111');
  6615. console.log('zh:当前LV=' + level);
  6616. if (level == 60) {
  6617. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  6618. Laya.timer.once(3000, this, () => {
  6619. this.returnHome();
  6620. });
  6621. }
  6622. else {
  6623. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6624. }
  6625. }
  6626. else {
  6627. console.log('zh:clickRightBtn 333-000');
  6628. Moyu.sendDataEvent("placeBallNextLevel");
  6629. Moyu.showVideoAd(() => {
  6630. DataMgr.setPlaceBallLevel(level, 1);
  6631. this.startPlaceBallLevel(level + 1);
  6632. }, xGame.define.EAdType.placeBallNextLevel);
  6633. }
  6634. break;
  6635. default:
  6636. console.log('zh:clickRightBtn 444');
  6637. break;
  6638. }
  6639. }
  6640. startPlaceBallLevel(level) {
  6641. xGame.common.gameMode = GameMode.placeBall;
  6642. xGame.common.placeBallCurLevel = level;
  6643. xGame.uiMgr.Show(UIGame);
  6644. this.hide();
  6645. }
  6646. }
  6647. UIGameEnd.uiName = "UIGameEnd";
  6648. class ui_UIRepentProp extends fgui.GComponent {
  6649. static createInstance() {
  6650. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6651. }
  6652. onConstruct() {
  6653. this.c1 = this.getController("c1");
  6654. this.n11 = (this.getChild("n11"));
  6655. this.regretNode = (this.getChild("regretNode"));
  6656. this.helpLineNode = (this.getChild("helpLineNode"));
  6657. this.t0 = this.getTransition("t0");
  6658. }
  6659. }
  6660. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6661. class UIRepentProp extends UIBase {
  6662. constructor() {
  6663. super();
  6664. this.viewType = 0;
  6665. this.regretType = 0;
  6666. }
  6667. onConstructor() {
  6668. this.ui = ui_UIRepentProp.createInstance();
  6669. this.contentPane = this.ui;
  6670. this.isEject = false;
  6671. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6672. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6673. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6674. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6675. }
  6676. show(viewType, regretType, callback) {
  6677. PlatMgr.showInsert(true);
  6678. this.viewType = viewType;
  6679. this.regretType = regretType;
  6680. this.callback = callback;
  6681. super.show();
  6682. this.ui.t0.play();
  6683. this.ui.c1.selectedIndex = this.viewType;
  6684. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6685. if (this.viewType == 0) {
  6686. let guide = DataMgr.getGuideHelpLine();
  6687. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6688. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6689. }
  6690. xGame.common.gameMgr.gamePause = true;
  6691. }
  6692. hideSelf() {
  6693. xGame.common.gameMgr.gamePause = false;
  6694. this.callback && this.callback(false);
  6695. this.hide();
  6696. }
  6697. videoRegret() {
  6698. Moyu.showVideoAd(() => {
  6699. this.callback && this.callback(true);
  6700. this.hideSelf();
  6701. }, EAdType.regretBall);
  6702. }
  6703. videoAddHelpLine() {
  6704. let guide = DataMgr.getGuideHelpLine();
  6705. if (guide == 0) {
  6706. this.callback && this.callback(true);
  6707. this.hideSelf();
  6708. DataMgr.setGuideHelpLine();
  6709. xGame.common.gameUI.ui.guideNode.visible = false;
  6710. }
  6711. else {
  6712. Moyu.showVideoAd(() => {
  6713. this.callback && this.callback(true);
  6714. this.hideSelf();
  6715. }, EAdType.longHelpLine);
  6716. }
  6717. }
  6718. }
  6719. UIRepentProp.uiName = "UIRepentProp";
  6720. class ui_UIVideoShare extends fgui.GComponent {
  6721. static createInstance() {
  6722. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6723. }
  6724. onConstruct() {
  6725. this.n10 = (this.getChild("n10"));
  6726. this.myNode = (this.getChild("myNode"));
  6727. this.t0 = this.getTransition("t0");
  6728. }
  6729. }
  6730. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6731. class UIVideoShare extends UIBase {
  6732. constructor() {
  6733. super();
  6734. this.success = false;
  6735. this.awardNum = 0;
  6736. this.isShared = true;
  6737. }
  6738. onConstructor() {
  6739. this.ui = ui_UIVideoShare.createInstance();
  6740. this.contentPane = this.ui;
  6741. this.isEject = false;
  6742. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6743. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6744. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6745. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6746. }
  6747. show(success) {
  6748. super.show();
  6749. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6750. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6751. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6752. this.success = success;
  6753. let time = xGame.common.randomNum(600, 1500);
  6754. Moyu.showInsertAd(time, 60000);
  6755. if (success)
  6756. xGame.soundMgr.playSound("applause");
  6757. this.ui.t0.play();
  6758. this.checkShareState();
  6759. let times = DataMgr.getDailyVideoShareTimes();
  6760. this.awardNum = times == 0 ? 2000 : 200;
  6761. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6762. }
  6763. checkShareState() {
  6764. if (PlatMgr.forceShare == 0) {
  6765. this.ui.myNode.closeBtn.visible = true;
  6766. this.ui.myNode.tipsNode.visible = false;
  6767. this.ui.myNode.closeBtn.x = 90;
  6768. this.ui.myNode.shareBtn.x = 342;
  6769. }
  6770. else if (PlatMgr.forceShare == 1) {
  6771. this.ui.myNode.closeBtn.visible = false;
  6772. this.ui.myNode.tipsNode.visible = true;
  6773. this.ui.myNode.shareBtn.x = 218;
  6774. this.isShared = true;
  6775. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6776. }
  6777. }
  6778. checkForceShare() {
  6779. this.isShared = !this.isShared;
  6780. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6781. }
  6782. videoShare() {
  6783. if (PlatMgr.forceShare == 1) {
  6784. if (this.isShared) {
  6785. this.shareGame();
  6786. }
  6787. else {
  6788. this.hideSelf();
  6789. }
  6790. }
  6791. else {
  6792. this.shareGame();
  6793. }
  6794. }
  6795. shareGame() {
  6796. Moyu.sendDataEvent("VideoShare");
  6797. if (Moyu.canShare() > 100) {
  6798. Moyu.shareGame((success) => {
  6799. if (success) {
  6800. DataMgr.setDailyVideoShareTimes(1);
  6801. DataMgr.setCoin(this.awardNum);
  6802. }
  6803. this.hideSelf();
  6804. }, this);
  6805. }
  6806. else {
  6807. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6808. this.hideSelf();
  6809. }
  6810. }
  6811. hideSelf() {
  6812. this.hide();
  6813. xGame.uiMgr.Show(UIGameEnd, this.success);
  6814. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6815. xGame.common.screenImg.destroy();
  6816. xGame.common.screenImg = null;
  6817. }
  6818. }
  6819. }
  6820. UIVideoShare.uiName = "UIVideoShare";
  6821. class ui_UITips extends fgui.GComponent {
  6822. static createInstance() {
  6823. return (fgui.UIPackage.createObject("game", "UITips"));
  6824. }
  6825. onConstruct() {
  6826. this.n0 = (this.getChild("n0"));
  6827. this.myNode = (this.getChild("myNode"));
  6828. this.t0 = this.getTransition("t0");
  6829. }
  6830. }
  6831. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6832. class UITips extends UIBase {
  6833. constructor() {
  6834. super();
  6835. this.type = 0;
  6836. }
  6837. onConstructor() {
  6838. this.ui = ui_UITips.createInstance();
  6839. this.contentPane = this.ui;
  6840. this.isEject = false;
  6841. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  6842. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  6843. }
  6844. show(tipsTxt, womanTxt, type) {
  6845. super.show();
  6846. this.ui.t0.play();
  6847. this.ui.myNode.tipsTxt.text = tipsTxt;
  6848. this.ui.myNode.womanTxt.text = womanTxt;
  6849. PlatMgr.showInsert(true);
  6850. this.ui.myNode.c1.selectedIndex = type;
  6851. this.type = type;
  6852. switch (this.type) {
  6853. case TipsType.exitGame:
  6854. xGame.common.gameMgr.gamePause = true;
  6855. break;
  6856. case TipsType.foul:
  6857. Laya.timer.once(200, this, () => {
  6858. xGame.common.gameMgr.gamePause = true;
  6859. });
  6860. break;
  6861. default:
  6862. break;
  6863. }
  6864. }
  6865. clickLeftBtn() {
  6866. this.hide();
  6867. xGame.common.gameMgr.gamePause = false;
  6868. switch (this.type) {
  6869. case TipsType.exitGame:
  6870. break;
  6871. case TipsType.foul:
  6872. break;
  6873. default:
  6874. break;
  6875. }
  6876. }
  6877. clickRightBtn() {
  6878. this.hide();
  6879. switch (this.type) {
  6880. case TipsType.exitGame:
  6881. xGame.eventMgr.event(RESET_GAME);
  6882. xGame.uiMgr.Show(UIMain);
  6883. Moyu.recordEnd(this, null);
  6884. xGame.common.longHelpLine = false;
  6885. break;
  6886. case TipsType.foul:
  6887. xGame.common.gameMgr.gamePause = false;
  6888. Laya.timer.clearAll(this);
  6889. break;
  6890. default:
  6891. break;
  6892. }
  6893. }
  6894. }
  6895. UITips.uiName = "UITips";
  6896. class GameMgr {
  6897. constructor() {
  6898. this.selfCamp = "";
  6899. this.selfFoulNum = 0;
  6900. this.selfBallArr = [];
  6901. this.selfTimer = 0;
  6902. this.selfScore = 0;
  6903. this.aiCamp = "";
  6904. this.aiFoulNum = 0;
  6905. this.aiBallArr = [];
  6906. this.aiTimer = 0;
  6907. this.aiScore = 0;
  6908. this.aiSkillLevelNum = 1;
  6909. this.targertScore = 0;
  6910. this.setTime = 30;
  6911. this.selfTurnRate = 0.5;
  6912. this.accTime = 0;
  6913. this.curFoul = "";
  6914. this.maxFoulTimes = 3;
  6915. this.isFirstInGame = true;
  6916. this.firstColliObj = null;
  6917. this.inHoleBalls = [];
  6918. this.blackNum = 8;
  6919. this.success = false;
  6920. this.holePosList = [];
  6921. this.posObj = {};
  6922. this._selfTurn = false;
  6923. this.lastRootBallPos = new Laya.Vector2(311, 430);
  6924. this.ensureBallType = false;
  6925. this.isOpenBall = true;
  6926. this.finishOneShoot = true;
  6927. this.isEnd = false;
  6928. this.isChangeTurn = false;
  6929. this.isInterrupt = false;
  6930. this.aiPlayedBreakArmy = false;
  6931. this.isTouchedBall = false;
  6932. this.finishBalls = 0;
  6933. this.needBalls = 0;
  6934. this.allBallNum = 0;
  6935. this.placeBallPosData = {};
  6936. this.curHP = 0;
  6937. this.showLongView = false;
  6938. this.firstShoot = true;
  6939. this._gamePause = false;
  6940. this.trunCount = 0;
  6941. this.isBlackInHole = false;
  6942. this.isEnter = true;
  6943. xGame.eventMgr.offAll(ALL_BALL_STOP);
  6944. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  6945. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  6946. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  6947. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  6948. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  6949. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  6950. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  6951. }
  6952. get gamePause() {
  6953. return this._gamePause;
  6954. }
  6955. set gamePause(v) {
  6956. if (v) {
  6957. Laya.physicsTimer.pause();
  6958. }
  6959. else {
  6960. Laya.physicsTimer.resume();
  6961. }
  6962. this._gamePause = v;
  6963. }
  6964. get selfTurn() {
  6965. return this._selfTurn;
  6966. }
  6967. set selfTurn(val) {
  6968. this.trunCount++;
  6969. this._selfTurn = val;
  6970. if (val) {
  6971. xGame.common.d2World.d2Gan.ui.self.visible = true;
  6972. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  6973. }
  6974. else {
  6975. xGame.common.d2World.d2Gan.ui.self.visible = false;
  6976. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  6977. if (this.trunCount > 1)
  6978. PlatMgr.openBox();
  6979. }
  6980. }
  6981. resetGame() {
  6982. this.inHoleBalls = [];
  6983. this.isFirstInGame = true;
  6984. this.firstColliObj = null;
  6985. this.aiCamp = "";
  6986. this.selfCamp = "";
  6987. this.aiFoulNum = 0;
  6988. this.selfFoulNum = 0;
  6989. this.selfBallArr = [];
  6990. this.aiBallArr = [];
  6991. this.gamePause = false;
  6992. this.ensureBallType = false;
  6993. this.isInterrupt = false;
  6994. this.updateLeftBall();
  6995. this.clearTime();
  6996. this.aiPlayedBreakArmy = false;
  6997. this.isBlackInHole = false;
  6998. this.placeBallPosData = {};
  6999. if (xGame.common.d3World.knifeRoot) {
  7000. xGame.common.d3World.knifeRoot.destroyChildren();
  7001. }
  7002. }
  7003. gameReady() {
  7004. this.trunCount = 0;
  7005. this.firstColliObj = null;
  7006. this.isFirstInGame = true;
  7007. this.selfTurn = Math.random() <= this.selfTurnRate;
  7008. let challengeNum = DataMgr.getChallengeTimes();
  7009. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7010. this.selfTurn = true;
  7011. }
  7012. if (xGame.common.gameMode == GameMode.placeBall)
  7013. this.selfTurn = true;
  7014. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7015. this.selfTurn = true;
  7016. }
  7017. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7018. this.checkGuide();
  7019. if (xGame.common.uiRodMethod)
  7020. xGame.common.uiRodMethod.resetRod();
  7021. xGame.common.d2World.getHelpLine();
  7022. this.isOpenBall = true;
  7023. this.isTouchedBall = false;
  7024. xGame.common.aiPlayer.stopRun();
  7025. this.setTime = 30;
  7026. let ui = xGame.common.gameUI.ui;
  7027. switch (xGame.common.gameMode) {
  7028. case GameMode.classic:
  7029. xGame.common.aiPlayer.init();
  7030. this.blackNum = 8;
  7031. this.placeRootBall();
  7032. this.peoplePlay(9, 10);
  7033. ui.wordsBtn.visible = true;
  7034. ui.aiWordsBtn.visible = true;
  7035. xGame.common.talkMgr.changeAIState(true);
  7036. DataMgr.gameData.gameCount++;
  7037. DataMgr.saveGameData();
  7038. break;
  7039. case GameMode.bigMove:
  7040. this.blackNum = -1;
  7041. this.selfScore = 0;
  7042. this.aiScore = 0;
  7043. xGame.common.aiPlayer.init();
  7044. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7045. this.updateSelfScore();
  7046. this.updateAIScore();
  7047. this.updateTargetSroce();
  7048. this.placeRootBall();
  7049. this.peoplePlay(9, 10);
  7050. ui.wordsBtn.visible = true;
  7051. ui.aiWordsBtn.visible = true;
  7052. xGame.common.talkMgr.changeAIState(true);
  7053. if (DataMgr.getSkillGuide() < 1)
  7054. DataMgr.gameData.gameCount = 0;
  7055. else {
  7056. DataMgr.gameData.gameCount++;
  7057. DataMgr.saveGameData();
  7058. PlatMgr.openTry();
  7059. }
  7060. if (xGame.common.d3World.knifeRoot) {
  7061. xGame.common.d3World.knifeRoot.destroyChildren();
  7062. }
  7063. break;
  7064. case GameMode.placeBall:
  7065. this.blackNum = -1;
  7066. this.selfTurn = true;
  7067. this.setTime = 10000;
  7068. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7069. this.curHP = this.placeBallData.hp;
  7070. if (this.placeBallData.ball == -1)
  7071. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7072. else
  7073. this.needBalls = this.placeBallData.ball;
  7074. console.log("需要的进球数目", this.needBalls);
  7075. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7076. this.finishBalls = 0;
  7077. this.placeBallPosData = {};
  7078. this.updatePlaceBallPos();
  7079. this.updatePlaceBallState();
  7080. this.finishOneShoot = true;
  7081. xGame.common.gameUI.ui.moveNode.visible = false;
  7082. this.isOpenBall = false;
  7083. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7084. ui.wordsBtn.visible = false;
  7085. ui.aiWordsBtn.visible = false;
  7086. xGame.common.talkMgr.changeAIState(false);
  7087. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7088. PlatMgr.openBox();
  7089. });
  7090. break;
  7091. default:
  7092. break;
  7093. }
  7094. this.showLongView = false;
  7095. xGame.common.wordsMgr.comboTimes = 1;
  7096. let guide = DataMgr.getSkillGuide();
  7097. if (guide)
  7098. xGame.eventMgr.event(WAIT_SHOOT);
  7099. xGame.common.upSkillLevel = false;
  7100. xGame.common.gameStartTime = new Date().getTime();
  7101. this.firstShoot = true;
  7102. }
  7103. checkGuide() {
  7104. let guide = DataMgr.getSkillGuide();
  7105. let gameUI = xGame.common.gameUI.ui;
  7106. gameUI.guide1.visible = false;
  7107. gameUI.guide2.visible = false;
  7108. gameUI.guide3.visible = false;
  7109. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7110. this.selfTurn = true;
  7111. }
  7112. else {
  7113. return;
  7114. }
  7115. let oneBall = this.getOneBall();
  7116. gameUI.guide1.visible = true;
  7117. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7118. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7119. }
  7120. getOneBall() {
  7121. let arr = xGame.common.d2World.ballArr;
  7122. for (let index = 0; index < arr.length; index++) {
  7123. if (arr[index].number == 0)
  7124. continue;
  7125. return arr[index];
  7126. }
  7127. }
  7128. updateSelfScore() {
  7129. let ui = xGame.common.gameUI.ui.topNode;
  7130. ui.selfScoreTxt.text = this.selfScore + "";
  7131. }
  7132. updateAIScore() {
  7133. let ui = xGame.common.gameUI.ui.topNode;
  7134. ui.aiScoreTxt.text = this.aiScore + "";
  7135. }
  7136. updateTargetSroce() {
  7137. let ui = xGame.common.gameUI.ui.topNode;
  7138. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7139. }
  7140. updateLeftBall() {
  7141. let topUI = xGame.common.gameUI.ui.topNode;
  7142. topUI.selfBallList.numItems = this.selfBallArr.length;
  7143. topUI.aiBallList.numItems = this.aiBallArr.length;
  7144. }
  7145. ballShoot() {
  7146. this.clearTime();
  7147. this.finishOneShoot = false;
  7148. xGame.common.gameUI.ui.moveNode.visible = false;
  7149. if (xGame.common.gameUI.ui.guideNode.visible) {
  7150. xGame.common.gameUI.ui.guideNode.visible = false;
  7151. }
  7152. if (this.firstShoot) {
  7153. this.firstShoot = false;
  7154. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7155. }
  7156. }
  7157. ensureCamp(number) {
  7158. this.ensureBallType = true;
  7159. this.isOpenBall = false;
  7160. if (xGame.common.gameMode != GameMode.classic)
  7161. return;
  7162. let full = [1, 2, 3, 4, 5, 6, 7];
  7163. let flower = [9, 10, 11, 12, 13, 14, 15];
  7164. let sayWords = "";
  7165. if (this.selfTurn) {
  7166. if (number <= 7) {
  7167. this.selfCamp = ballCamp.full;
  7168. this.selfBallArr = full;
  7169. this.aiCamp = ballCamp.flower;
  7170. this.aiBallArr = flower;
  7171. sayWords = cfgTable.wordsData[3].msg;
  7172. }
  7173. else {
  7174. this.selfCamp = ballCamp.flower;
  7175. this.selfBallArr = flower;
  7176. this.aiCamp = ballCamp.full;
  7177. this.aiBallArr = full;
  7178. sayWords = cfgTable.wordsData[4].msg;
  7179. }
  7180. }
  7181. else {
  7182. if (number <= 7) {
  7183. this.selfCamp = ballCamp.flower;
  7184. this.selfBallArr = flower;
  7185. this.aiCamp = ballCamp.full;
  7186. this.aiBallArr = full;
  7187. sayWords = cfgTable.wordsData[2].msg;
  7188. }
  7189. else {
  7190. this.selfCamp = ballCamp.full;
  7191. this.selfBallArr = full;
  7192. this.aiCamp = ballCamp.flower;
  7193. this.aiBallArr = flower;
  7194. sayWords = cfgTable.wordsData[1].msg;
  7195. }
  7196. }
  7197. this.updateLeftBall();
  7198. xGame.uiMgr.Show(UIMsg, sayWords);
  7199. }
  7200. updatePlaceBallState() {
  7201. let ui = xGame.common.gameUI.ui;
  7202. switch (this.placeBallData.type) {
  7203. case PlaceBallType.normal:
  7204. let normal = ui.placeNormalNode;
  7205. normal.hpTxt.text = this.curHP + "";
  7206. this.updatePlaceBallStar(normal);
  7207. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7208. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7209. break;
  7210. case PlaceBallType.challenge:
  7211. let challenge = ui.placeChallengeNode;
  7212. challenge.hpTxt.text = "Shots:" + this.curHP;
  7213. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7214. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7215. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7216. break;
  7217. default:
  7218. break;
  7219. }
  7220. }
  7221. playSubHpAni() {
  7222. let ui = xGame.common.gameUI.ui;
  7223. switch (this.placeBallData.type) {
  7224. case PlaceBallType.normal:
  7225. let normal = ui.placeNormalNode;
  7226. normal.hpTxt.visible = false;
  7227. normal.starAni.c1.selectedIndex = 1;
  7228. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7229. normal.hpTxt.visible = true;
  7230. normal.starAni.c1.selectedIndex = 0;
  7231. }));
  7232. break;
  7233. default:
  7234. break;
  7235. }
  7236. }
  7237. getEndStarNum() {
  7238. let num;
  7239. let level = xGame.common.placeBallCurLevel;
  7240. if (this.curHP == this.placeBallData.hp) {
  7241. num = 3;
  7242. }
  7243. else if (this.curHP <= 1) {
  7244. num = 1;
  7245. }
  7246. else {
  7247. num = 2;
  7248. }
  7249. if (!this.success) {
  7250. num = 0;
  7251. }
  7252. else {
  7253. DataMgr.setPlaceBallLevel(level, num);
  7254. }
  7255. let myType = cfgTable.placeballData[level].type;
  7256. if (this.success && myType == 1) {
  7257. num = 3;
  7258. }
  7259. xGame.common.placeBallStarNum = num;
  7260. }
  7261. updatePlaceBallStar(node) {
  7262. let star = 0;
  7263. if (this.curHP == this.placeBallData.hp) {
  7264. star = 3;
  7265. }
  7266. else if (this.curHP >= 2) {
  7267. star = 2;
  7268. }
  7269. else if (this.curHP == 1) {
  7270. star = 1;
  7271. }
  7272. else {
  7273. star = 0;
  7274. }
  7275. let temp;
  7276. for (let index = 1; index <= 3; index++) {
  7277. temp = node["star" + index];
  7278. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7279. }
  7280. node.myProgress.value = (star / 3) * 100;
  7281. }
  7282. openRegretView(isFoul, GoalNum, challenge = false) {
  7283. let regretType = -1;
  7284. if (isFoul) {
  7285. regretType = 1;
  7286. }
  7287. else {
  7288. if (GoalNum <= 0) {
  7289. regretType = 0;
  7290. }
  7291. }
  7292. if (challenge) {
  7293. regretType = 1;
  7294. }
  7295. if (regretType != -1) {
  7296. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7297. if (success) {
  7298. this.curHP++;
  7299. this.updatePlaceBallState();
  7300. this.setPlaceBallAllPos();
  7301. xGame.common.gameUI.ui.moveNode.visible = false;
  7302. }
  7303. else {
  7304. if (this.curHP <= 0) {
  7305. this.success = false;
  7306. this.gameEnd();
  7307. }
  7308. this.playSubHpAni();
  7309. }
  7310. this.updatePlaceBallState();
  7311. this.updatePlaceBallPos();
  7312. });
  7313. }
  7314. }
  7315. setPlaceBallAllPos() {
  7316. let allBall = xGame.common.d2World.ballArr;
  7317. let cfgArr = this.placeBallPosData;
  7318. let temp;
  7319. let obj;
  7320. for (let index = 0; index < allBall.length; index++) {
  7321. temp = allBall[index];
  7322. if (temp.destroyed)
  7323. continue;
  7324. obj = cfgArr[temp.myUNID];
  7325. if (obj && obj.src && !obj.src.destroyed) {
  7326. temp.gameObj.x = obj.posX;
  7327. temp.gameObj.y = obj.posY;
  7328. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7329. }
  7330. }
  7331. xGame.common.d2World.getHelpLine();
  7332. }
  7333. updatePlaceBallPos() {
  7334. let arr = xGame.common.d2World.ballArr;
  7335. let temp;
  7336. for (let index = 0; index < arr.length; index++) {
  7337. temp = arr[index];
  7338. if (!this.placeBallPosData[temp.myUNID]) {
  7339. this.placeBallPosData[temp.myUNID] = {
  7340. src: temp,
  7341. posX: temp.gameObj.x,
  7342. posY: temp.gameObj.y
  7343. };
  7344. }
  7345. else {
  7346. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7347. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7348. }
  7349. }
  7350. let check;
  7351. for (const key in this.placeBallPosData) {
  7352. check = this.placeBallPosData[key];
  7353. if (check.src.destroyed) {
  7354. delete this.placeBallPosData[key];
  7355. }
  7356. }
  7357. }
  7358. gameRun(type) {
  7359. if (this.gamePause)
  7360. return;
  7361. this.curFoul = this.getFoulType();
  7362. if (type) {
  7363. xGame.common.d2World.d2Gan.shoot();
  7364. xGame.common.gameUI.forceCancel();
  7365. this.curFoul = type;
  7366. }
  7367. this.isEnd = false;
  7368. this.isChangeTurn = true;
  7369. if (xGame.common.gameMode == GameMode.classic) {
  7370. this.judgeClassic(this.curFoul);
  7371. this.checkClassicWords(() => {
  7372. xGame.common.destroyClassicEmotion();
  7373. if (this.isEnd) {
  7374. if (this.isBlackInHole) {
  7375. xGame.common.gameUI.ui.blackAni.visible = true;
  7376. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7377. xGame.common.gameUI.ui.blackAni.visible = false;
  7378. this.gameEnd();
  7379. }));
  7380. }
  7381. else {
  7382. this.gameEnd();
  7383. }
  7384. }
  7385. else {
  7386. this.waitShoot();
  7387. xGame.eventMgr.event(WAIT_SHOOT);
  7388. }
  7389. });
  7390. }
  7391. else if (xGame.common.gameMode == GameMode.bigMove) {
  7392. xGame.common.aiPlayer.stopRun();
  7393. let scoreArr = this.getScore(this.curFoul);
  7394. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7395. this.isEnd = true;
  7396. }
  7397. this.checkBigSkillWords(() => {
  7398. if (this.isEnd) {
  7399. this.gameEnd();
  7400. }
  7401. else {
  7402. this.waitShoot();
  7403. xGame.eventMgr.event(WAIT_SHOOT);
  7404. }
  7405. });
  7406. }
  7407. else if (xGame.common.gameMode == GameMode.placeBall) {
  7408. xGame.common.destroyAwardSpine();
  7409. let isFoul = this.curFoul == FoulType.rootHole;
  7410. let GoalNum = this.inHoleBalls.length;
  7411. if (this.inHoleBalls.indexOf(0) > -1)
  7412. GoalNum -= 1;
  7413. if (isFoul) {
  7414. this.placeRootBall();
  7415. }
  7416. console.log("neeballs", this.needBalls);
  7417. console.log("当前完成的goalNum", GoalNum);
  7418. this.finishBalls += GoalNum;
  7419. console.log("当前完成的finishballs", this.finishBalls);
  7420. let need = this.needBalls;
  7421. if (this.placeBallData.type == PlaceBallType.challenge) {
  7422. need += 100;
  7423. }
  7424. if (this.finishBalls >= need) {
  7425. this.success = true;
  7426. this.gameEnd();
  7427. }
  7428. else {
  7429. switch (this.placeBallData.type) {
  7430. case PlaceBallType.normal:
  7431. if (!isFoul && GoalNum > 0) {
  7432. this.updatePlaceBallPos();
  7433. this.updatePlaceBallState();
  7434. }
  7435. else {
  7436. this.curHP--;
  7437. this.openRegretView(isFoul, GoalNum);
  7438. }
  7439. this.waitShoot();
  7440. xGame.eventMgr.event(WAIT_SHOOT);
  7441. break;
  7442. case PlaceBallType.challenge:
  7443. this.curHP--;
  7444. this.updatePlaceBallState();
  7445. if (isFoul) {
  7446. this.openRegretView(isFoul, GoalNum, true);
  7447. }
  7448. else {
  7449. this.updatePlaceBallPos();
  7450. if (this.curHP <= 0) {
  7451. this.success = true;
  7452. this.gameEnd();
  7453. }
  7454. }
  7455. this.waitShoot();
  7456. xGame.eventMgr.event(WAIT_SHOOT);
  7457. break;
  7458. default:
  7459. break;
  7460. }
  7461. }
  7462. }
  7463. }
  7464. checkClassicWords(callback) {
  7465. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7466. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7467. let type = this.getClassicWordsType();
  7468. if (condition && type != -1) {
  7469. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7470. xGame.soundMgr.playSound(str);
  7471. xGame.common.wordsMgr.playClassicWords(type, callback);
  7472. }
  7473. else {
  7474. Laya.timer.once(300, this, () => {
  7475. callback && callback();
  7476. });
  7477. }
  7478. }
  7479. getClassicWordsType() {
  7480. let d2world = xGame.common.d2World;
  7481. let type = -1;
  7482. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7483. type = ClassicWordsType.perfectShow;
  7484. return type;
  7485. }
  7486. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7487. type = ClassicWordsType.directShoot;
  7488. return type;
  7489. }
  7490. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7491. type = ClassicWordsType.anotherShoot;
  7492. return type;
  7493. }
  7494. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7495. type = ClassicWordsType.bigPower;
  7496. return type;
  7497. }
  7498. let minSpeed = 1;
  7499. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7500. type = ClassicWordsType.hardShoot;
  7501. return type;
  7502. }
  7503. if (this.inHoleBalls.length > 0) {
  7504. type = ClassicWordsType.directShoot;
  7505. return type;
  7506. }
  7507. return type;
  7508. }
  7509. checkBigSkillWords(callback) {
  7510. if (this.curFoul == FoulType.timeOut) {
  7511. callback && callback();
  7512. }
  7513. else {
  7514. let playSkill = false;
  7515. if (this.selfTurn) {
  7516. playSkill = true;
  7517. }
  7518. else {
  7519. if (!this.aiPlayedBreakArmy) {
  7520. this.aiPlayedBreakArmy = true;
  7521. playSkill = true;
  7522. }
  7523. if (this.aiCurSkill != SkillType.breakArmy) {
  7524. playSkill = true;
  7525. }
  7526. }
  7527. if (xGame.common.skillMgr.playedLastSkill) {
  7528. xGame.common.skillMgr.playedLastSkill = false;
  7529. playSkill = false;
  7530. }
  7531. if (playSkill) {
  7532. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7533. let selfExtra = 0;
  7534. let aiExtra = 0;
  7535. if (this.selfTurn)
  7536. selfExtra += extraScore;
  7537. else
  7538. aiExtra += extraScore;
  7539. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7540. this.isEnd = true;
  7541. }
  7542. this.playBigSkillTimes(callback);
  7543. });
  7544. }
  7545. else {
  7546. this.playBigSkillTimes(callback);
  7547. }
  7548. }
  7549. }
  7550. playBigSkillTimes(callback) {
  7551. let length = this.inHoleBalls.length;
  7552. if (this.inHoleBalls.indexOf(0) > -1) {
  7553. length = this.inHoleBalls.length - 1;
  7554. }
  7555. if (length <= 0) {
  7556. callback && callback();
  7557. return;
  7558. }
  7559. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7560. callback && callback();
  7561. });
  7562. }
  7563. playSkillTips() {
  7564. let levelNum = 0;
  7565. let curType;
  7566. if (this.selfTurn) {
  7567. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7568. curType = this.selfCurSkill;
  7569. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7570. levelNum += 5;
  7571. }
  7572. }
  7573. else {
  7574. levelNum = this.aiSkillLevelNum;
  7575. curType = this.aiCurSkill;
  7576. }
  7577. let str = ``;
  7578. switch (curType) {
  7579. case SkillType.highSpace:
  7580. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7581. break;
  7582. case SkillType.breakArmy:
  7583. str = `You pocketed ${levelNum} extra balls`;
  7584. break;
  7585. case SkillType.ice:
  7586. str = `${levelNum * 2} extra balls were frozen`;
  7587. break;
  7588. case SkillType.fireworks:
  7589. str = `${levelNum} extra balls exploded `;
  7590. break;
  7591. case SkillType.GuanYu:
  7592. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  7593. break;
  7594. default:
  7595. break;
  7596. }
  7597. xGame.uiMgr.Show(UIMsg, str);
  7598. }
  7599. getFoulType() {
  7600. let foulType = "";
  7601. if (this.firstColliObj == null) {
  7602. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7603. return FoulType.rootHole;
  7604. }
  7605. return FoulType.notTouch;
  7606. }
  7607. else {
  7608. if (this.selfTurn) {
  7609. if (this.selfBallArr.length > 0) {
  7610. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7611. foulType = FoulType.wrongTouch;
  7612. }
  7613. }
  7614. else {
  7615. if (this.ensureBallType) {
  7616. }
  7617. else {
  7618. if (this.firstColliObj == this.blackNum) {
  7619. foulType = FoulType.wrongTouch;
  7620. }
  7621. }
  7622. }
  7623. }
  7624. else {
  7625. if (this.aiBallArr.length > 0) {
  7626. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7627. foulType = FoulType.wrongTouch;
  7628. }
  7629. }
  7630. else {
  7631. if (this.ensureBallType) {
  7632. }
  7633. else {
  7634. if (this.firstColliObj == this.blackNum) {
  7635. foulType = FoulType.wrongTouch;
  7636. }
  7637. }
  7638. }
  7639. }
  7640. if (this.inHoleBalls.length <= 0) {
  7641. return foulType;
  7642. }
  7643. let temp;
  7644. if (this.inHoleBalls.indexOf(0) > -1) {
  7645. foulType = FoulType.rootHole;
  7646. }
  7647. else {
  7648. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7649. temp = this.inHoleBalls[index];
  7650. if (this.selfTurn) {
  7651. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7652. foulType = FoulType.wrongHole;
  7653. break;
  7654. }
  7655. }
  7656. else {
  7657. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7658. foulType = FoulType.wrongHole;
  7659. break;
  7660. }
  7661. }
  7662. }
  7663. }
  7664. let foo;
  7665. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7666. temp = this.inHoleBalls[index];
  7667. foo = this.selfBallArr.indexOf(temp);
  7668. if (foo > -1) {
  7669. this.selfBallArr.splice(foo, 1);
  7670. }
  7671. foo = this.aiBallArr.indexOf(temp);
  7672. if (foo > -1) {
  7673. this.aiBallArr.splice(foo, 1);
  7674. }
  7675. }
  7676. this.updateLeftBall();
  7677. }
  7678. return foulType;
  7679. }
  7680. judgeGameEndByBlack(arr) {
  7681. if (this.selfTurn) {
  7682. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7683. this.selfFoulNum = this.maxFoulTimes;
  7684. return true;
  7685. }
  7686. }
  7687. else {
  7688. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7689. this.aiFoulNum = this.maxFoulTimes;
  7690. return true;
  7691. }
  7692. }
  7693. }
  7694. judgeClassic(type) {
  7695. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7696. xGame.common.aiPlayer.stopRun();
  7697. if (this.judgeNormalSuccess()) {
  7698. this.isEnd = true;
  7699. return;
  7700. }
  7701. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7702. if (this.selfTurn) {
  7703. if (isFoul) {
  7704. this.selfFoulNum++;
  7705. }
  7706. if (this.selfFoulNum >= this.maxFoulTimes) {
  7707. this.success = false;
  7708. this.isEnd = true;
  7709. return;
  7710. }
  7711. }
  7712. else {
  7713. if (isFoul)
  7714. this.aiFoulNum++;
  7715. if (this.aiFoulNum >= this.maxFoulTimes) {
  7716. this.success = true;
  7717. this.isEnd = true;
  7718. return;
  7719. }
  7720. }
  7721. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7722. this.isChangeTurn = false;
  7723. }
  7724. else {
  7725. this.isInterrupt = true;
  7726. }
  7727. }
  7728. waitShoot() {
  7729. if (xGame.common.gameMode == GameMode.classic) {
  7730. switch (this.curFoul) {
  7731. case FoulType.timeOut:
  7732. case FoulType.rootHole:
  7733. this.selfTurn = !this.selfTurn;
  7734. this.peoplePlay(5, 6, true);
  7735. break;
  7736. case FoulType.notTouch:
  7737. this.selfTurn = !this.selfTurn;
  7738. this.peoplePlay(7, 7);
  7739. break;
  7740. case FoulType.wrongHole:
  7741. this.selfTurn = !this.selfTurn;
  7742. this.peoplePlay(11, 11);
  7743. break;
  7744. default:
  7745. if (this.inHoleBalls.length > 0) {
  7746. this.peoplePlay(0, 0, false, false);
  7747. }
  7748. else {
  7749. this.selfTurn = !this.selfTurn;
  7750. this.peoplePlay(7, 7);
  7751. }
  7752. break;
  7753. }
  7754. }
  7755. else if (xGame.common.gameMode == GameMode.bigMove) {
  7756. if (this.curFoul == FoulType.timeOut) {
  7757. this.selfTurn = !this.selfTurn;
  7758. this.peoplePlay(14, 15);
  7759. this.placeRootBall();
  7760. }
  7761. else {
  7762. this.selfTurn = !this.selfTurn;
  7763. if (this.curFoul == FoulType.rootHole) {
  7764. this.peoplePlay(12, 13);
  7765. this.placeRootBall();
  7766. }
  7767. else {
  7768. this.peoplePlay(0, 0, false, false);
  7769. }
  7770. }
  7771. }
  7772. else if (xGame.common.gameMode == GameMode.placeBall) {
  7773. this.finishOneShoot = true;
  7774. }
  7775. this.gameResult();
  7776. }
  7777. gameResult() {
  7778. this.firstColliObj = null;
  7779. this.inHoleBalls = [];
  7780. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7781. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7782. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7783. if (xGame.common.uiRodMethod)
  7784. xGame.common.uiRodMethod.resetRod();
  7785. xGame.common.d2World.rootBall.showSelf();
  7786. this.clearIceSkill();
  7787. if (this.selfTurn) {
  7788. console.log("gameResult");
  7789. PlatMgr.gameInsert();
  7790. }
  7791. xGame.common.d3World.knifeRoot.destroyChildren();
  7792. if (this.selfTurn) {
  7793. xGame.common.gameUI.showHelpLineGuide();
  7794. xGame.common.gameUI.setTurnAlpha(true);
  7795. }
  7796. else {
  7797. xGame.common.gameUI.setTurnAlpha(false);
  7798. }
  7799. }
  7800. getScore(type) {
  7801. let selfAdd = 0;
  7802. let aiAdd = 0;
  7803. if (type == FoulType.timeOut) {
  7804. if (this.selfTurn)
  7805. aiAdd += 3;
  7806. else
  7807. selfAdd += 3;
  7808. }
  7809. else {
  7810. if (this.inHoleBalls.length > 0) {
  7811. if (this.selfTurn) {
  7812. if (type == FoulType.rootHole) {
  7813. aiAdd += 3;
  7814. if (this.inHoleBalls.length - 1 > 0) {
  7815. selfAdd += this.inHoleBalls.length - 1;
  7816. }
  7817. }
  7818. else {
  7819. selfAdd += this.inHoleBalls.length;
  7820. }
  7821. }
  7822. else {
  7823. if (type == FoulType.rootHole) {
  7824. selfAdd += 3;
  7825. if (this.inHoleBalls.length - 1 > 0) {
  7826. aiAdd += this.inHoleBalls.length - 1;
  7827. }
  7828. }
  7829. else {
  7830. aiAdd += this.inHoleBalls.length;
  7831. }
  7832. }
  7833. }
  7834. }
  7835. return [selfAdd, aiAdd];
  7836. }
  7837. judgeScoreEnd(selfAdd, aiAdd) {
  7838. this.selfScore += selfAdd;
  7839. this.aiScore += aiAdd;
  7840. this.updateAIScore();
  7841. this.updateSelfScore();
  7842. if (this.selfScore >= this.targertScore) {
  7843. this.success = true;
  7844. return true;
  7845. }
  7846. if (this.aiScore >= this.targertScore) {
  7847. this.success = false;
  7848. return true;
  7849. }
  7850. let ballArr = xGame.common.d2World.ballArr;
  7851. if (ballArr.length == 1 && ballArr[0].number == 0) {
  7852. if (this.selfScore > this.aiScore) {
  7853. this.success = true;
  7854. return true;
  7855. }
  7856. else if (this.selfScore < this.aiScore) {
  7857. this.success = false;
  7858. return true;
  7859. }
  7860. else {
  7861. if (this.selfTurn) {
  7862. this.success = false;
  7863. }
  7864. else {
  7865. this.success = true;
  7866. }
  7867. return true;
  7868. }
  7869. }
  7870. }
  7871. clearIceSkill() {
  7872. let arr = xGame.common.d2World.ballArr;
  7873. let temp;
  7874. if (this.selfTurn) {
  7875. if (this.selfCurSkill == SkillType.ice) {
  7876. for (let index = 0; index < arr.length; index++) {
  7877. temp = arr[index];
  7878. if (temp.ballFunc == "ice") {
  7879. temp.setBallFunc("normal", "self");
  7880. }
  7881. }
  7882. }
  7883. }
  7884. else {
  7885. if (this.aiCurSkill == SkillType.ice) {
  7886. for (let index = 0; index < arr.length; index++) {
  7887. temp = arr[index];
  7888. if (temp.ballFunc == "ice") {
  7889. temp.setBallFunc("normal", "ai");
  7890. }
  7891. }
  7892. }
  7893. }
  7894. }
  7895. judgeNormalSuccess() {
  7896. if (this.selfTurn) {
  7897. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7898. this.success = true;
  7899. return true;
  7900. }
  7901. }
  7902. else {
  7903. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7904. this.success = false;
  7905. return true;
  7906. }
  7907. }
  7908. }
  7909. gameEnd() {
  7910. if (Moyu.isTT) {
  7911. xGame.common.screenImg = getScreenImg();
  7912. }
  7913. console.log("游戏结束", this.success);
  7914. xGame.common.aiPlayer.stopRun();
  7915. if (xGame.common.gameMode == GameMode.placeBall) {
  7916. this.getEndStarNum();
  7917. this.updatePlaceBallState();
  7918. }
  7919. this.isEnter = false;
  7920. Moyu.recordEnd(this, () => {
  7921. if (this.isEnter)
  7922. return;
  7923. this.isEnter = true;
  7924. console.log("进入录结束回调");
  7925. this.enterNext();
  7926. });
  7927. Laya.timer.once(1000, this, () => {
  7928. if (this.isEnter)
  7929. return;
  7930. this.isEnter = true;
  7931. this.enterNext();
  7932. });
  7933. xGame.common.longHelpLine = false;
  7934. }
  7935. enterNext() {
  7936. Laya.timer.clearAll(this);
  7937. if (Moyu.canShare() > 100 || Moyu.isKs) {
  7938. xGame.uiMgr.Show(UIVideoShare, this.success);
  7939. }
  7940. else {
  7941. xGame.uiMgr.Show(UIGameEnd, this.success);
  7942. }
  7943. }
  7944. aiLeave() {
  7945. let ui = xGame.common.gameUI.ui;
  7946. ui.topNode.aiNameTxt.text = "offline";
  7947. }
  7948. aiGameEnd(suc) {
  7949. this.success = suc;
  7950. xGame.common.aiPlayer.stopRun();
  7951. if (this.success) {
  7952. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  7953. Laya.timer.once(1000, this, () => {
  7954. this.clearTime();
  7955. this.gameEnd();
  7956. });
  7957. }
  7958. }
  7959. openTimer() {
  7960. let src = xGame.common.gameUI;
  7961. if (this.selfTurn) {
  7962. src.ui.topNode.selfProgress.visible = true;
  7963. src.ui.topNode.aiProgress.visible = false;
  7964. this.curTimer = src.ui.topNode.selfProgress;
  7965. }
  7966. else {
  7967. src.ui.topNode.selfProgress.visible = false;
  7968. src.ui.topNode.aiProgress.visible = true;
  7969. this.curTimer = src.ui.topNode.aiProgress;
  7970. }
  7971. this.accTime = 0;
  7972. Laya.timer.clearAll(this);
  7973. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  7974. this.curTimer.value = 100;
  7975. }
  7976. updateTime(dt) {
  7977. if (this.gamePause)
  7978. return;
  7979. this.accTime += dt;
  7980. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  7981. if (this.accTime >= this.setTime) {
  7982. this.clearTime();
  7983. console.log("时钟进入了gameRun");
  7984. this.gameRun(FoulType.timeOut);
  7985. }
  7986. }
  7987. clearTime() {
  7988. let src = xGame.common.gameUI;
  7989. src.ui.topNode.selfProgress.visible = false;
  7990. src.ui.topNode.aiProgress.visible = false;
  7991. Laya.timer.clearAll(this);
  7992. }
  7993. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  7994. let ui = xGame.common.gameUI.ui;
  7995. let selfMsg, aiMsg;
  7996. if (sayWords) {
  7997. selfMsg = cfgTable.wordsData[selfIndex].msg;
  7998. aiMsg = cfgTable.wordsData[aiIndex].msg;
  7999. if (Foul) {
  8000. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8001. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8002. this.placeRootBall();
  8003. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8004. if (this.curFoul == FoulType.rootHole) {
  8005. if (!DataMgr.getRootBallFoul()) {
  8006. DataMgr.setRootBallFoul();
  8007. aiMsg = "";
  8008. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8009. let woman = "Boss, pay attention next time~";
  8010. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8011. }
  8012. }
  8013. else if (this.curFoul == FoulType.timeOut) {
  8014. if (!DataMgr.getTimeoutFoul()) {
  8015. DataMgr.setTimeoutFoul();
  8016. aiMsg = "";
  8017. let tips = "Game timeout, 3 fouls, this game failed.";
  8018. let woman = "Boss, pay attention to the timeline~";
  8019. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8020. }
  8021. }
  8022. }
  8023. }
  8024. }
  8025. if (this.selfTurn) {
  8026. if (sayWords) {
  8027. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8028. ui.selfTurn.visible = true;
  8029. ui.aiTurn.visible = false;
  8030. ui.selfTurn.t0.play();
  8031. Moyu.vibration();
  8032. });
  8033. }
  8034. }
  8035. else {
  8036. let aiNum = xGame.tools.random(1, 11);
  8037. let challengeNum = DataMgr.getChallengeTimes();
  8038. let delay = false;
  8039. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8040. aiNum = 9;
  8041. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8042. aiNum = 3;
  8043. if (challengeNum == 3) {
  8044. if (!this.showLongView) {
  8045. this.showLongView = true;
  8046. delay = true;
  8047. }
  8048. }
  8049. }
  8050. }
  8051. if (delay) {
  8052. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8053. if (success) {
  8054. xGame.common.longHelpLine = true;
  8055. xGame.common.d2World.getHelpLine();
  8056. }
  8057. else {
  8058. aiNum = 10;
  8059. }
  8060. xGame.common.aiPlayer.setAiLevel(aiNum);
  8061. if (sayWords) {
  8062. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8063. xGame.common.aiPlayer.runAI();
  8064. ui.selfTurn.visible = false;
  8065. ui.aiTurn.visible = true;
  8066. ui.aiTurn.t0.play();
  8067. });
  8068. }
  8069. else {
  8070. xGame.common.aiPlayer.runAI();
  8071. }
  8072. this.openTimer();
  8073. this.finishOneShoot = true;
  8074. if (this.selfTurn) {
  8075. ui.topNode.selfKuang.visible = true;
  8076. ui.topNode.aiKuang.visible = false;
  8077. ui.topNode.selfTips.visible = true;
  8078. ui.topNode.aiTips.visible = false;
  8079. }
  8080. else {
  8081. ui.topNode.selfKuang.visible = false;
  8082. ui.topNode.aiKuang.visible = true;
  8083. ui.topNode.selfTips.visible = false;
  8084. ui.topNode.aiTips.visible = true;
  8085. }
  8086. });
  8087. return;
  8088. }
  8089. if (xGame.common.gameMode == GameMode.classic) {
  8090. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8091. if (cfg) {
  8092. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8093. aiNum = aiLevel;
  8094. }
  8095. }
  8096. xGame.common.aiPlayer.setAiLevel(aiNum);
  8097. if (sayWords) {
  8098. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8099. xGame.common.aiPlayer.runAI();
  8100. ui.selfTurn.visible = false;
  8101. ui.aiTurn.visible = true;
  8102. ui.aiTurn.t0.play();
  8103. });
  8104. }
  8105. else {
  8106. xGame.common.aiPlayer.runAI();
  8107. }
  8108. }
  8109. this.openTimer();
  8110. this.finishOneShoot = true;
  8111. if (this.selfTurn) {
  8112. ui.topNode.selfKuang.visible = true;
  8113. ui.topNode.aiKuang.visible = false;
  8114. ui.topNode.selfTips.visible = true;
  8115. ui.topNode.aiTips.visible = false;
  8116. }
  8117. else {
  8118. ui.topNode.selfKuang.visible = false;
  8119. ui.topNode.aiKuang.visible = true;
  8120. ui.topNode.selfTips.visible = false;
  8121. ui.topNode.aiTips.visible = true;
  8122. }
  8123. }
  8124. placeRootBall() {
  8125. let rootBall = xGame.common.d2World.rootBall;
  8126. if (!rootBall)
  8127. return;
  8128. rootBall.gameObj.x = this.lastRootBallPos.x;
  8129. rootBall.gameObj.y = this.lastRootBallPos.y;
  8130. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8131. let moveNode = xGame.common.gameUI.ui.moveNode;
  8132. moveNode.visible = true;
  8133. moveNode.x = this.lastRootBallPos.x;
  8134. moveNode.y = this.lastRootBallPos.y;
  8135. if (!this.selfTurn) {
  8136. xGame.common.aiPlayer.resetRoot();
  8137. }
  8138. }
  8139. }
  8140. class ui_guanyuAni extends fgui.GComponent {
  8141. static createInstance() {
  8142. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8143. }
  8144. onConstruct() {
  8145. this.n0 = (this.getChild("n0"));
  8146. }
  8147. }
  8148. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8149. class UIFireworks extends UIBase {
  8150. constructor() {
  8151. super();
  8152. }
  8153. onConstructor() {
  8154. this.isEject = false;
  8155. }
  8156. show(callback) {
  8157. super.show();
  8158. }
  8159. }
  8160. UIFireworks.uiName = "UIFireworks";
  8161. class ui_UIGuanYu extends fgui.GComponent {
  8162. static createInstance() {
  8163. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8164. }
  8165. onConstruct() {
  8166. this.n2 = (this.getChild("n2"));
  8167. this.n1 = (this.getChild("n1"));
  8168. this.n3 = (this.getChild("n3"));
  8169. this.n4 = (this.getChild("n4"));
  8170. this.n5 = (this.getChild("n5"));
  8171. this.n6 = (this.getChild("n6"));
  8172. this.n8 = (this.getChild("n8"));
  8173. this.n7 = (this.getChild("n7"));
  8174. this.t0 = this.getTransition("t0");
  8175. }
  8176. }
  8177. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8178. class UIGuanYu extends UIBase {
  8179. constructor() {
  8180. super();
  8181. }
  8182. onConstructor() {
  8183. this.ui = ui_UIGuanYu.createInstance();
  8184. this.contentPane = this.ui;
  8185. this.isEject = false;
  8186. }
  8187. show(callback) {
  8188. super.show();
  8189. this.ui.t0.play(Laya.Handler.create(this, () => {
  8190. callback && callback();
  8191. this.hide();
  8192. }));
  8193. }
  8194. }
  8195. UIGuanYu.uiName = "UIGuanYu";
  8196. class SkillMgr {
  8197. constructor() {
  8198. this.leveNum = 0;
  8199. this.extraScore = 0;
  8200. this.selfTurn = false;
  8201. this.playedLastSkill = false;
  8202. this.tweenArr = [];
  8203. this._finishNum = 0;
  8204. this._curFinish = 0;
  8205. this._rootX = 0;
  8206. this._rootY = 0;
  8207. this.knifeTimes = 0;
  8208. this.knifeV2 = new Laya.Vector2();
  8209. this.knifeV3 = new Laya.Vector3();
  8210. this.rtStarX = 0;
  8211. this.rtStarY = 0;
  8212. this.addBigSkillSpine();
  8213. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8214. }
  8215. addBigSkillSpine() {
  8216. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8217. console.log("extra2 success");
  8218. });
  8219. }
  8220. runBigSkill(callback) {
  8221. this.tweenArr = [];
  8222. this.callback = callback;
  8223. this.judgeSkill();
  8224. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8225. let guide = DataMgr.getSkillGuide();
  8226. if (!xGame.common.gameMgr.selfTurn) {
  8227. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8228. }
  8229. else {
  8230. if (xGame.common.temSelfLevel != 0) {
  8231. this.leveNum = xGame.common.temSelfLevel;
  8232. }
  8233. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8234. this.leveNum += 5;
  8235. }
  8236. }
  8237. if (guide == 0) {
  8238. DataMgr.setSkillGuide(1);
  8239. if (DataMgr.getNewUser()) {
  8240. Moyu.sendDataEvent("gameFirstPlay");
  8241. DataMgr.setNewUser();
  8242. }
  8243. }
  8244. this.playSpineAni(() => {
  8245. switch (this.curSkill) {
  8246. case SkillType.highSpace:
  8247. this.runHighSpace();
  8248. break;
  8249. case SkillType.breakArmy:
  8250. this.runBreakArmy();
  8251. break;
  8252. case SkillType.ice:
  8253. this.runIce();
  8254. break;
  8255. case SkillType.fireworks:
  8256. this.runFireworks();
  8257. break;
  8258. case SkillType.GuanYu:
  8259. this.runGuanYu();
  8260. break;
  8261. default:
  8262. break;
  8263. }
  8264. });
  8265. }
  8266. judgeSkill() {
  8267. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8268. let gameMgr = xGame.common.gameMgr;
  8269. let type;
  8270. for (let index = 0; index < typeArr.length; index++) {
  8271. type = typeArr[index];
  8272. if (gameMgr.selfTurn) {
  8273. if (gameMgr.selfCurSkill == type) {
  8274. this.selfTurn = true;
  8275. this.curSkill = type;
  8276. return;
  8277. }
  8278. }
  8279. else {
  8280. if (gameMgr.aiCurSkill == type) {
  8281. this.selfTurn = false;
  8282. this.curSkill = type;
  8283. return;
  8284. }
  8285. }
  8286. }
  8287. }
  8288. playSpineAni(callback) {
  8289. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8290. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8291. parent.destroyChildren();
  8292. let aniIndex = 0;
  8293. let skillSpine;
  8294. switch (this.curSkill) {
  8295. case SkillType.highSpace:
  8296. aniIndex = 1;
  8297. xGame.soundMgr.playSound("skill01");
  8298. skillSpine = this.skillSpine2;
  8299. data.scaleX = 0.5;
  8300. data.scaleY = 0.5;
  8301. skillSpine.play(data, 1, false, parent, () => {
  8302. callback && callback();
  8303. });
  8304. break;
  8305. case SkillType.breakArmy:
  8306. aniIndex = 2;
  8307. xGame.soundMgr.playSound("skill02");
  8308. skillSpine = this.skillSpine2;
  8309. data.scaleX = 0.5;
  8310. data.scaleY = 0.5;
  8311. skillSpine.play(data, 2, false, parent, () => {
  8312. callback && callback();
  8313. });
  8314. break;
  8315. case SkillType.ice:
  8316. aniIndex = 0;
  8317. xGame.soundMgr.playSound("skill03");
  8318. skillSpine = this.skillSpine2;
  8319. data.scaleX = 0.5;
  8320. data.scaleY = 0.5;
  8321. skillSpine.play(data, 0, false, parent, () => {
  8322. callback && callback();
  8323. });
  8324. break;
  8325. case SkillType.fireworks:
  8326. xGame.soundMgr.playSound("skill_04_01");
  8327. xGame.soundMgr.playSound("skill04");
  8328. xGame.uiMgr.Show(UIFireworks, callback);
  8329. break;
  8330. case SkillType.GuanYu:
  8331. xGame.soundMgr.playSound("skill05_1");
  8332. xGame.soundMgr.playSound("skill05");
  8333. xGame.uiMgr.Show(UIGuanYu, callback);
  8334. break;
  8335. default:
  8336. break;
  8337. }
  8338. }
  8339. getAllBallArr() {
  8340. let arr = xGame.common.d2World.ballArr;
  8341. let outArr = [];
  8342. for (let index = 0; index < arr.length; index++) {
  8343. if (arr[index] instanceof D2RootBallSrc)
  8344. continue;
  8345. if (arr[index].ballFunc == "ice")
  8346. continue;
  8347. if (arr[index].destroyed)
  8348. continue;
  8349. outArr.push(arr[index]);
  8350. }
  8351. return outArr;
  8352. }
  8353. getOneArr(deletObj) {
  8354. let allArr = this.getAllBallArr();
  8355. let temp;
  8356. for (let index = 0; index < allArr.length; index++) {
  8357. temp = allArr[index];
  8358. if (temp.id == deletObj.id) {
  8359. allArr.splice(index, 1);
  8360. break;
  8361. }
  8362. }
  8363. return allArr;
  8364. }
  8365. getNearBallBag(ball) {
  8366. let ui = xGame.common.gameUI.ui;
  8367. let circleArr = [];
  8368. for (let index = 1; index <= 6; index++) {
  8369. circleArr.push(ui.border["circle" + index]);
  8370. }
  8371. let outIndex = 0;
  8372. let temp;
  8373. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8374. ;
  8375. let dis = 0;
  8376. for (let index = 1; index < circleArr.length; index++) {
  8377. temp = circleArr[index];
  8378. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8379. if (dis < min) {
  8380. min = dis;
  8381. outIndex = index;
  8382. }
  8383. }
  8384. return [circleArr[outIndex], outIndex];
  8385. }
  8386. ballFlyToBag(ballArr, time = 300) {
  8387. let temp;
  8388. let hole;
  8389. this._finishNum = ballArr.length;
  8390. this._curFinish = 0;
  8391. let holeObj = {};
  8392. let holeCfg = {
  8393. "1": 0,
  8394. "2": 0,
  8395. "3": 0,
  8396. "4": 0,
  8397. "5": 0,
  8398. "6": 0
  8399. };
  8400. for (let index = 0; index < ballArr.length; index++) {
  8401. temp = ballArr[index];
  8402. temp.outColli.isSensor = true;
  8403. temp.innerColli.isSensor = true;
  8404. temp.isRunSkillAni = true;
  8405. let holeArr = this.getNearBallBag(temp);
  8406. hole = holeArr[0];
  8407. holeObj[index] = holeArr[1];
  8408. temp.d3BallSrc.scaleXYZ = 0.5;
  8409. this.tweenArr.push(temp.d3BallSrc, temp);
  8410. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8411. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8412. }));
  8413. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8414. let mIndex = holeObj[this._curFinish];
  8415. let isDone = holeCfg[mIndex];
  8416. if (isDone) {
  8417. ballArr[this._curFinish].checkWrongBall(false);
  8418. }
  8419. else {
  8420. holeCfg[mIndex] = 1;
  8421. ballArr[this._curFinish].checkWrongBall();
  8422. }
  8423. this._curFinish++;
  8424. if (this._curFinish >= this._finishNum) {
  8425. if (this.curSkill == SkillType.highSpace) {
  8426. }
  8427. else if (this.curSkill == SkillType.breakArmy) {
  8428. let rootBall = xGame.common.d2World.rootBall;
  8429. rootBall.gameObj.x = this._rootX;
  8430. rootBall.gameObj.y = this._rootY;
  8431. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8432. xGame.common.d2World.d2Gan.ui.visible = true;
  8433. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8434. xGame.common.d2World.getHelpLine();
  8435. this.callback && this.callback(this.extraScore);
  8436. }
  8437. }
  8438. }));
  8439. }
  8440. }
  8441. runHighSpace() {
  8442. let rootBall = xGame.common.d2World.rootBall;
  8443. rootBall.showSelf();
  8444. let d3Src = rootBall.d3BallSrc;
  8445. let allArr = this.getAllBallArr();
  8446. if (allArr.length <= 0) {
  8447. this.callback && this.callback(0);
  8448. return;
  8449. }
  8450. let selectBall = xGame.common.d2World.targetBall;
  8451. let wrong = selectBall && selectBall.destroyed;
  8452. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8453. selectBall = xGame.common.getRandArrEle(allArr);
  8454. }
  8455. let targetD3Src = selectBall.d3BallSrc;
  8456. xGame.common.d2World.d2Gan.ui.visible = false;
  8457. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8458. d3Src.scaleXYZ = 0.5;
  8459. this.tweenArr.push(d3Src);
  8460. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8461. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8462. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8463. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8464. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8465. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8466. let outArr = [selectBall];
  8467. let other = this.leveNum - 1;
  8468. if (other > 0) {
  8469. let nearArr = this.getOneArr(selectBall);
  8470. if (nearArr.length > 0) {
  8471. xGame.common.botherArr(nearArr);
  8472. if (other >= nearArr.length)
  8473. other = nearArr.length;
  8474. for (let index = 0; index < other; index++) {
  8475. outArr.push(nearArr[index]);
  8476. }
  8477. }
  8478. }
  8479. xGame.common.extraMoveNum = other + 1;
  8480. this.extraScore = other + 1;
  8481. this._rootX = selectBall.gameObj.x;
  8482. this._rootY = selectBall.gameObj.y;
  8483. rootBall.gameObj.x = this._rootX;
  8484. rootBall.gameObj.y = this._rootY;
  8485. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8486. Laya.Tween.clearAll(d3Src);
  8487. this.addRandomForce(outArr);
  8488. }));
  8489. }));
  8490. }
  8491. addRandomForce(outArr) {
  8492. if (outArr.length > 0) {
  8493. xGame.common.d2World.openCheckStill = true;
  8494. this.playedLastSkill = true;
  8495. }
  8496. let temp;
  8497. for (let index = 0; index < outArr.length; index++) {
  8498. let angle = xGame.common.randomNum(0, 360);
  8499. let linearPercent = xGame.common.randomNum(65, 100);
  8500. temp = outArr[index];
  8501. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8502. }
  8503. }
  8504. setLinearSpeed(angle, rigy, linearPercent) {
  8505. let sin = Math.sin(angle * Math.PI / 180);
  8506. let cos = Math.cos(angle * Math.PI / 180);
  8507. let maxSpeed = 4;
  8508. let speed = new Laya.Vector2();
  8509. speed.x = maxSpeed * linearPercent * sin;
  8510. speed.y = -maxSpeed * linearPercent * cos;
  8511. rigy.applyLinearImpulseToCenter(speed);
  8512. }
  8513. runBreakArmy() {
  8514. xGame.common.d2World.d2Gan.ui.visible = false;
  8515. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8516. let gameUI = xGame.common.gameUI.ui;
  8517. gameUI.skillRod.visible = true;
  8518. gameUI.skillRod.rotation = 110;
  8519. let outArr = this.getAllBallArr();
  8520. if (outArr.length <= 0) {
  8521. gameUI.skillRod.visible = false;
  8522. this.callback && this.callback(0);
  8523. return;
  8524. }
  8525. xGame.common.botherArr(outArr);
  8526. if (this.leveNum >= outArr.length)
  8527. this.leveNum = outArr.length;
  8528. let deleteNum = outArr.length - this.leveNum;
  8529. outArr.splice(0, deleteNum);
  8530. this.extraScore = this.leveNum;
  8531. let potX = gameUI.skillRod.x;
  8532. let potY = gameUI.skillRod.y;
  8533. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8534. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8535. let disArr = [];
  8536. for (let index = 0; index < outArr.length; index++) {
  8537. let obj = outArr[index];
  8538. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8539. dis = Math.pow(dis, 0.5);
  8540. disArr.push(dis);
  8541. }
  8542. this.tweenArr.push(gameUI.skillRod);
  8543. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8544. })).update = Laya.Handler.create(this, (e, t, c) => {
  8545. let angle = gameUI.skillRod.rotation;
  8546. let xx;
  8547. let yy;
  8548. let temp;
  8549. for (let index = 0; index < outArr.length; index++) {
  8550. temp = outArr[index];
  8551. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8552. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8553. yy -= 20;
  8554. temp.gameObj.x = xx;
  8555. temp.gameObj.y = yy;
  8556. temp.d3BallSrc.setTransPos(xx, yy);
  8557. }
  8558. if (angle <= 60) {
  8559. Laya.Tween.clearAll(gameUI.skillRod);
  8560. this.ballFlyToBag(outArr, 150);
  8561. gameUI.skillRod.visible = false;
  8562. }
  8563. }, null, false);
  8564. }
  8565. runIce() {
  8566. let ballArr = xGame.common.d2World.ballArr;
  8567. this.leveNum *= 2;
  8568. if (this.leveNum >= ballArr.length - 1)
  8569. this.leveNum = ballArr.length - 1;
  8570. let tempArr = [];
  8571. let outArr = [];
  8572. for (let index = 0; index < ballArr.length; index++) {
  8573. if (ballArr[index] instanceof D2RootBallSrc)
  8574. continue;
  8575. tempArr.push(ballArr[index]);
  8576. }
  8577. if (tempArr.length <= 0) {
  8578. this.callback && this.callback(0);
  8579. return;
  8580. }
  8581. xGame.common.botherArr(tempArr);
  8582. for (let index = 0; index < this.leveNum; index++) {
  8583. outArr.push(tempArr[index]);
  8584. }
  8585. this.extraScore = this.leveNum;
  8586. let temp;
  8587. for (let index = 0; index < outArr.length; index++) {
  8588. temp = outArr[index];
  8589. temp.d3BallSrc.playIceEft();
  8590. }
  8591. Laya.timer.once(2000, this, () => {
  8592. for (let index = 0; index < outArr.length; index++) {
  8593. temp = outArr[index];
  8594. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8595. temp.setBallFunc("ice", str);
  8596. }
  8597. this.callback && this.callback(0);
  8598. });
  8599. }
  8600. runFireworks() {
  8601. let allArr = this.getAllBallArr();
  8602. if (allArr.length <= 0) {
  8603. this.callback && this.callback(0);
  8604. return;
  8605. }
  8606. xGame.common.d2World.d2Gan.ui.visible = false;
  8607. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8608. let outArr = [];
  8609. let other = this.leveNum;
  8610. if (other > 0) {
  8611. if (allArr.length > 0) {
  8612. xGame.common.botherArr(allArr);
  8613. if (other >= allArr.length)
  8614. other = allArr.length;
  8615. for (let index = 0; index < other; index++) {
  8616. outArr.push(allArr[index]);
  8617. }
  8618. }
  8619. }
  8620. xGame.common.extraMoveNum = other;
  8621. this.extraScore = other;
  8622. this.addRandmomFireworks(outArr);
  8623. }
  8624. addRandmomFireworks(outArr) {
  8625. Laya.timer.once(1100, this, () => {
  8626. if (outArr.length > 0) {
  8627. xGame.common.d2World.openCheckStill = true;
  8628. this.playedLastSkill = true;
  8629. }
  8630. });
  8631. xGame.soundMgr.playSound("skill_04_02");
  8632. let temp;
  8633. let delay = -200;
  8634. for (let index = 0; index < outArr.length; index++) {
  8635. temp = outArr[index];
  8636. delay += 200;
  8637. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8638. let angle = xGame.common.randomNum(0, 360);
  8639. angle = this.getFireworksAngle(obj);
  8640. let linearPercent = xGame.common.randomNum(45, 80);
  8641. if (!obj.destroyed)
  8642. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8643. });
  8644. }
  8645. }
  8646. getFireworksAngle(obj) {
  8647. let rootBall = xGame.common.d2World.rootBall;
  8648. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8649. }
  8650. resetGame() {
  8651. Laya.timer.clearAll(this);
  8652. if (this.tweenArr) {
  8653. for (let index = 0; index < this.tweenArr.length; index++) {
  8654. Laya.Tween.clearAll(this.tweenArr[index]);
  8655. }
  8656. }
  8657. this.tweenArr = null;
  8658. }
  8659. runGuanYu() {
  8660. xGame.common.d2World.d2Gan.ui.visible = false;
  8661. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8662. let rootBall = xGame.common.d2World.rootBall;
  8663. if (rootBall.isInHole) {
  8664. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8665. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8666. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8667. rootBall.showSelf();
  8668. }
  8669. this.rtStarX = rootBall.gameObj.x;
  8670. this.rtStarY = rootBall.gameObj.y;
  8671. this.knifeTimes = 0;
  8672. this.playedLastSkill = true;
  8673. rootBall.forceRun = true;
  8674. rootBall.rigy.type = "static";
  8675. xGame.common.d2World.openCheckStill = true;
  8676. this.guanyuRandomKnife();
  8677. }
  8678. guanyuRandomKnife() {
  8679. let rootBall = xGame.common.d2World.rootBall;
  8680. let dir = this.getRandDir();
  8681. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8682. console.log("当前angle", angle);
  8683. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8684. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8685. let dis = 324;
  8686. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8687. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8688. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8689. this.rtStarX = rootBall.gameObj.x;
  8690. this.rtStarY = rootBall.gameObj.y;
  8691. this.knifeTimes++;
  8692. let skillLevel;
  8693. if (xGame.common.gameMgr.selfTurn) {
  8694. skillLevel = DataMgr.getBigSkillByIndex(4);
  8695. }
  8696. else {
  8697. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8698. }
  8699. if (!skillLevel)
  8700. skillLevel = 1;
  8701. skillLevel += 2;
  8702. if (this.knifeTimes < skillLevel) {
  8703. Laya.timer.once(400, this, () => {
  8704. this.guanyuRandomKnife();
  8705. });
  8706. }
  8707. else {
  8708. rootBall.forceRun = false;
  8709. rootBall.rigy.type = "dynamic";
  8710. xGame.common.extraMoveNum = skillLevel;
  8711. }
  8712. }));
  8713. }
  8714. getRandDir() {
  8715. let rootBall = xGame.common.d2World.rootBall;
  8716. let allBall = this.getAllBallArr();
  8717. let target = xGame.common.getRandArrEle(allBall);
  8718. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8719. return this.knifeV2;
  8720. }
  8721. cloneKnife(x, y, rotation) {
  8722. let parent = xGame.common.d3World.knifeRoot;
  8723. let prefab = xGame.common.d3World.knife;
  8724. let clone = prefab.clone();
  8725. parent.addChild(clone);
  8726. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8727. clone.transform.localPositionX = this.knifeV3.x;
  8728. clone.transform.localPositionY = 0;
  8729. clone.transform.localPositionZ = this.knifeV3.z;
  8730. clone.transform.localRotationEulerX = 0;
  8731. clone.transform.localRotationEulerY = rotation;
  8732. clone.transform.localRotationEulerZ = 0;
  8733. clone.active = true;
  8734. return clone;
  8735. }
  8736. cloneGuanYuEft(x, y, angle) {
  8737. return;
  8738. let parent = xGame.common.gameUI.ui.guanyuNode;
  8739. let eft = new ui_guanyuAni();
  8740. eft.parent = parent;
  8741. eft.x = x;
  8742. eft.y = y;
  8743. eft.rotation = angle;
  8744. }
  8745. }
  8746. class ui_UIWordsList extends fgui.GComponent {
  8747. static createInstance() {
  8748. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8749. }
  8750. onConstruct() {
  8751. this.c1 = this.getController("c1");
  8752. this.n74 = (this.getChild("n74"));
  8753. this.clickNode = (this.getChild("clickNode"));
  8754. this.myNode = (this.getChild("myNode"));
  8755. this.n68 = (this.getChild("n68"));
  8756. this.n66 = (this.getChild("n66"));
  8757. this.n55 = (this.getChild("n55"));
  8758. this.wordsBtn = (this.getChild("wordsBtn"));
  8759. this.emotionBtn = (this.getChild("emotionBtn"));
  8760. this.mybggg = (this.getChild("mybggg"));
  8761. this.wordsList = (this.getChild("wordsList"));
  8762. this.emotionList = (this.getChild("emotionList"));
  8763. this.myRoot = (this.getChild("myRoot"));
  8764. }
  8765. }
  8766. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8767. class EmotionDisplay {
  8768. constructor(index, ui) {
  8769. this.ui = ui;
  8770. this.index = index;
  8771. this.ui.onClick(this, this.clickSelf);
  8772. this.updateSelf();
  8773. }
  8774. updateSelf() {
  8775. let data = cfgTable.emotionData[this.index + 1];
  8776. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8777. }
  8778. clickSelf() {
  8779. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8780. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8781. xGame.common.talkMgr.closeTalkView();
  8782. }
  8783. }
  8784. class WordsDisplay {
  8785. constructor(index, ui) {
  8786. this.ui = ui;
  8787. this.index = index;
  8788. this.ui.onClick(this, this.clickSelf);
  8789. this.updateSelf();
  8790. }
  8791. updateSelf() {
  8792. let data = cfgTable.talkwordsData[this.index + 1];
  8793. this.ui.txt.text = data.msg;
  8794. }
  8795. clickSelf() {
  8796. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8797. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8798. xGame.common.talkMgr.closeTalkView();
  8799. }
  8800. }
  8801. class UIWordsList extends UIBase {
  8802. constructor() {
  8803. super();
  8804. }
  8805. onConstructor() {
  8806. this.ui = ui_UIWordsList.createInstance();
  8807. this.contentPane = this.ui;
  8808. this.isEject = false;
  8809. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8810. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8811. this.addUIClick(this.ui.clickNode, this.hide);
  8812. this.initTalkList();
  8813. this.initEmotionList();
  8814. }
  8815. show() {
  8816. super.show();
  8817. }
  8818. initTalkList() {
  8819. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8820. let data = cfgTable.talkwordsData;
  8821. let length = Object.keys(data).length;
  8822. this.ui.wordsList.numItems = length;
  8823. }
  8824. initEmotionList() {
  8825. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8826. let data = cfgTable.emotionData;
  8827. let length = Object.keys(data).length;
  8828. this.ui.emotionList.numItems = length;
  8829. }
  8830. renderTalkItem(index, obj) {
  8831. let temp = new WordsDisplay(index, obj);
  8832. }
  8833. renderEmotionItem(index, obj) {
  8834. let temp = new EmotionDisplay(index, obj);
  8835. }
  8836. openTalkList() {
  8837. this.ui.c1.selectedIndex = 0;
  8838. }
  8839. openEmotionList() {
  8840. this.ui.c1.selectedIndex = 1;
  8841. }
  8842. }
  8843. UIWordsList.uiName = "UIWordsList";
  8844. class TalkMgr {
  8845. constructor() {
  8846. this.aiSpeak = true;
  8847. this.emotionList = [];
  8848. this.talkList = [];
  8849. this.addEvent();
  8850. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8851. this.emotionList = [];
  8852. this.talkList = [];
  8853. for (let k in cfgTable.emotionData) {
  8854. this.emotionList.push(cfgTable.emotionData[k].id);
  8855. }
  8856. for (let k in cfgTable.talkwordsData) {
  8857. this.talkList.push(cfgTable.talkwordsData[k].id);
  8858. }
  8859. }
  8860. addEvent() {
  8861. let ui = xGame.common.gameUI.ui;
  8862. ui.wordsBtn.visible = true;
  8863. ui.wordsBtn.onClick(this, this.openTalkView);
  8864. ui.aiWordsBtn.visible = true;
  8865. ui.aiWordsBtn.onClick(this, this.clickAIState);
  8866. }
  8867. openTalkView() {
  8868. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8869. xGame.uiMgr.Show(UIWordsList);
  8870. }
  8871. closeTalkView() {
  8872. xGame.uiMgr.Hide(UIWordsList);
  8873. }
  8874. clickAIState() {
  8875. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8876. this.aiSpeak = !this.aiSpeak;
  8877. this.changeAIState(this.aiSpeak);
  8878. }
  8879. changeAIState(speak) {
  8880. this.aiSpeak = speak;
  8881. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  8882. if (speak) {
  8883. btn.c1.selectedIndex = 0;
  8884. }
  8885. else {
  8886. btn.c1.selectedIndex = 1;
  8887. }
  8888. }
  8889. showSelfTalk(wordsId) {
  8890. let ui = xGame.common.gameUI.ui;
  8891. ui.selfTalk.visible = true;
  8892. ui.selfTalk.myNode.c1.selectedIndex = 1;
  8893. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8894. ui.selfTalk.t0.play();
  8895. }
  8896. showSelfEmotion(emotionId) {
  8897. let ui = xGame.common.gameUI.ui;
  8898. ui.selfTalk.visible = true;
  8899. ui.selfTalk.myNode.c1.selectedIndex = 0;
  8900. this.selfSpine && this.selfSpine.dispose();
  8901. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8902. let spineData = cfgTable.emotionData[emotionId].spine;
  8903. this.selfSpine = new SpineMgr(spineData, () => {
  8904. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  8905. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  8906. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8907. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  8908. });
  8909. ui.selfTalk.t0.play();
  8910. }
  8911. showAITalk(wordsId) {
  8912. if (!this.aiSpeak)
  8913. return;
  8914. if (DataMgr.gameData.gameCount < 2)
  8915. return;
  8916. if (wordsId < 1)
  8917. wordsId = this.getRandTalk();
  8918. let ui = xGame.common.gameUI.ui;
  8919. ui.aiTalk.visible = true;
  8920. ui.aiTalk.myNode.c1.selectedIndex = 1;
  8921. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8922. ui.aiTalk.t0.play();
  8923. }
  8924. getRandTalk() {
  8925. let rand = xGame.tools.random(0, this.talkList.length);
  8926. return this.emotionList[rand];
  8927. }
  8928. getRandEmotion() {
  8929. let rand = xGame.tools.random(0, this.emotionList.length);
  8930. return this.emotionList[rand];
  8931. }
  8932. showAIEmotion(emotionId) {
  8933. if (!this.aiSpeak)
  8934. return;
  8935. if (DataMgr.gameData.gameCount < 2)
  8936. return;
  8937. if (emotionId < 1)
  8938. emotionId = this.getRandEmotion();
  8939. let ui = xGame.common.gameUI.ui;
  8940. ui.aiTalk.visible = true;
  8941. ui.aiTalk.myNode.c1.selectedIndex = 0;
  8942. this.aiSpine && this.aiSpine.dispose();
  8943. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8944. let spineData = cfgTable.emotionData[emotionId].spine;
  8945. this.aiSpine = new SpineMgr(spineData, () => {
  8946. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  8947. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  8948. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8949. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  8950. });
  8951. ui.aiTalk.t0.play();
  8952. }
  8953. resetGame() {
  8954. let ui = xGame.common.gameUI.ui;
  8955. ui.aiTalk.visible = false;
  8956. ui.selfTalk.visible = false;
  8957. this.aiSpine && this.aiSpine.dispose();
  8958. this.selfSpine && this.selfSpine.dispose();
  8959. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8960. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8961. this.closeTalkView();
  8962. }
  8963. }
  8964. class WordsMgr {
  8965. constructor() {
  8966. this.comboTimes = 1;
  8967. this.skillTimes = 0;
  8968. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  8969. this.comboSpine = new SpineMgr("yxz_liangan");
  8970. this.skillSpine = new SpineMgr("yiganxqiu");
  8971. this.scoreSpine = new SpineMgr("defen");
  8972. }
  8973. setClassicCombo(isInterrupt) {
  8974. if (isInterrupt) {
  8975. this.comboTimes = 0;
  8976. }
  8977. }
  8978. playClassicWords(type, callback) {
  8979. this.callback = callback;
  8980. let aniIndex = type;
  8981. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8982. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8983. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  8984. mySpine.destroy(true);
  8985. this.playClassicTimes();
  8986. });
  8987. }
  8988. playClassicTimes() {
  8989. this.comboTimes++;
  8990. if (this.comboTimes <= 1) {
  8991. this.callback && this.callback();
  8992. }
  8993. else {
  8994. let aniIndex = this.comboTimes - 1;
  8995. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8996. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8997. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  8998. mySpine.destroy(true);
  8999. this.callback && this.callback();
  9000. });
  9001. }
  9002. }
  9003. playBigSkillTimes(times, callback) {
  9004. if (times <= 0) {
  9005. callback && callback();
  9006. return;
  9007. }
  9008. this.callback = callback;
  9009. let pre = "sz_0";
  9010. let aniIndex = 0;
  9011. this.getWordsImg(times, pre, () => {
  9012. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9013. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9014. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9015. let r1 = ``;
  9016. let r2 = ``;
  9017. if (times <= 9) {
  9018. r1 = `res/d2Res/${pre}${times}.png`;
  9019. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9020. aniIndex = 0;
  9021. }
  9022. else {
  9023. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9024. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9025. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9026. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9027. aniIndex = 1;
  9028. }
  9029. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9030. mySpine.destroy(true);
  9031. xGame.common.gameMgr.playSkillTips();
  9032. this.playScore(times);
  9033. xGame.common.playRandomMutiBallBigSkillSound();
  9034. }, mySpine);
  9035. });
  9036. }
  9037. playScore(score) {
  9038. let pre = "sz_";
  9039. let aniIndex = 0;
  9040. this.getWordsImg(score, pre, () => {
  9041. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9042. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9043. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9044. let r1 = ``;
  9045. let r2 = ``;
  9046. if (score <= 9) {
  9047. r1 = `res/d2Res/${pre}${score}.png`;
  9048. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9049. aniIndex = 0;
  9050. }
  9051. else {
  9052. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9053. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9054. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9055. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9056. aniIndex = 1;
  9057. }
  9058. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9059. mySpine.destroy(true);
  9060. this.callback && this.callback();
  9061. }, mySpine);
  9062. });
  9063. }
  9064. getWordsImg(number, pre = "", callback) {
  9065. let arr = [];
  9066. if (number <= 9) {
  9067. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9068. }
  9069. else {
  9070. 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 });
  9071. }
  9072. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9073. callback && callback();
  9074. }));
  9075. }
  9076. }
  9077. class ui_UIRodMethod extends fgui.GComponent {
  9078. static createInstance() {
  9079. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9080. }
  9081. onConstruct() {
  9082. this.n24 = (this.getChild("n24"));
  9083. this.white = (this.getChild("white"));
  9084. this.dot = (this.getChild("dot"));
  9085. this.sureBtn = (this.getChild("sureBtn"));
  9086. this.n20 = (this.getChild("n20"));
  9087. this.n21 = (this.getChild("n21"));
  9088. this.n22 = (this.getChild("n22"));
  9089. this.n23 = (this.getChild("n23"));
  9090. this.n5 = (this.getChild("n5"));
  9091. this.n14 = (this.getChild("n14"));
  9092. this.t0 = this.getTransition("t0");
  9093. }
  9094. }
  9095. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9096. class UIRodMethod extends UIBase {
  9097. constructor() {
  9098. super();
  9099. this.isPressd = false;
  9100. }
  9101. onConstructor() {
  9102. this.ui = ui_UIRodMethod.createInstance();
  9103. this.contentPane = this.ui;
  9104. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9105. this.moveDir = new Laya.Vector2();
  9106. this.moveDest = new Laya.Vector2();
  9107. this.centerPos = new Laya.Vector2();
  9108. xGame.common.uiRodMethod = this;
  9109. }
  9110. show() {
  9111. super.show();
  9112. xGame.common.gameMgr.gamePause = true;
  9113. this.openPressDotEvent();
  9114. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9115. this.centerPos.x = this.ui.white.x;
  9116. this.centerPos.y = this.ui.white.y;
  9117. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9118. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9119. this.setDot();
  9120. }
  9121. setDot() {
  9122. this.ui.dot.x = this.moveDest.x;
  9123. this.ui.dot.y = this.moveDest.y;
  9124. }
  9125. closeSelf() {
  9126. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9127. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9128. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9129. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9130. xGame.common.gameMgr.gamePause = false;
  9131. this.hide();
  9132. }
  9133. openPressDotEvent() {
  9134. this.closePressDotEvent();
  9135. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9136. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9137. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9138. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9139. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9140. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9141. }
  9142. closePressDotEvent() {
  9143. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9144. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9145. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9146. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9147. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9148. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9149. }
  9150. onDown(e) {
  9151. if (e.type == Laya.Event.MOUSE_DOWN)
  9152. this.isPressd = true;
  9153. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9154. this.isPressd = false;
  9155. if (!this.isPressd)
  9156. return;
  9157. this.moveDest.x = e.stageX;
  9158. this.moveDest.y = e.stageY;
  9159. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9160. if (dis > 6724) {
  9161. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9162. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9163. }
  9164. this.setDot();
  9165. }
  9166. resetRod() {
  9167. this.ui.dot.x = this.ui.white.x;
  9168. this.ui.dot.y = this.ui.white.y;
  9169. this.gameRod.dot.x = this.gameRod.bg.x;
  9170. this.gameRod.dot.y = this.gameRod.bg.y;
  9171. xGame.common.rodOffest.x = 0;
  9172. xGame.common.rodOffest.y = 0;
  9173. }
  9174. }
  9175. UIRodMethod.uiName = "UIRodMethod";
  9176. class UIGame extends UIBase {
  9177. constructor() {
  9178. super();
  9179. this.powerNum = 0;
  9180. this.isD3Inited = false;
  9181. this.isPrePlay = false;
  9182. this.isMoveRod = false;
  9183. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9184. this.rulerDis = 20;
  9185. this.rulerOffset = 0;
  9186. }
  9187. onConstructor() {
  9188. this.ui = ui_UIGame.createInstance();
  9189. this.contentPane = this.ui;
  9190. this.ui.x += xGame.common.sysOffestNum;
  9191. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9192. this.isEject = false;
  9193. xGame.common.gameUI = this;
  9194. this.initSelf();
  9195. }
  9196. isTurnSelf() {
  9197. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9198. return true;
  9199. }
  9200. }
  9201. initSelf() {
  9202. let topUI = this.ui.topNode;
  9203. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9204. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9205. this.barInfo = {};
  9206. this.barInfo.curY = 0;
  9207. this.barInfo.height = this.ui.powerNode.height;
  9208. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9209. this.barInfo.powerStartY = this.ui.powerNode.y;
  9210. xGame.common.aiPlayer = new AIPlayer();
  9211. xGame.common.gameMgr = new GameMgr();
  9212. xGame.common.skillMgr = new SkillMgr();
  9213. xGame.common.wordsMgr = new WordsMgr();
  9214. xGame.common.talkMgr = new TalkMgr();
  9215. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9216. console.log("加载经典模式表情文件chenggon !");
  9217. });
  9218. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9219. console.log("挑战模式奖励模式spine加载成功!");
  9220. });
  9221. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9222. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9223. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9224. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9225. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9226. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9227. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9228. }
  9229. returnHome() {
  9230. let tips = "Are you sure to exit the game?";
  9231. let woman = "Boss, why don't you play for a while longer?";
  9232. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9233. }
  9234. addRodMethodClick() {
  9235. if (this.isTurnSelf()) {
  9236. xGame.uiMgr.Show(UIRodMethod);
  9237. }
  9238. }
  9239. clickHelpLineBtn(force = false) {
  9240. if (!this.isTurnSelf())
  9241. return;
  9242. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9243. if (success) {
  9244. xGame.common.longHelpLine = true;
  9245. xGame.common.d2World.getHelpLine();
  9246. Moyu.sendDataEvent("guideNum");
  9247. }
  9248. else {
  9249. }
  9250. });
  9251. }
  9252. renderSelfDisplayBalls(index, target) {
  9253. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9254. target.myImg.url = xGame.common.getGameIconUrl(str);
  9255. }
  9256. renderAIDisplayBalls(index, target) {
  9257. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9258. target.myImg.url = xGame.common.getGameIconUrl(str);
  9259. ;
  9260. }
  9261. updateMode() {
  9262. if (xGame.common.gameMode == GameMode.classic) {
  9263. this.ui.topNode.scoreNode.visible = false;
  9264. }
  9265. else if (xGame.common.gameMode == GameMode.bigMove) {
  9266. this.ui.topNode.scoreNode.visible = true;
  9267. }
  9268. }
  9269. show() {
  9270. super.show();
  9271. console.log("zh:uigame show");
  9272. this.ui.alpha = 0;
  9273. this.updateSelf();
  9274. console.log("zh:uigame bf gamemusic01 start");
  9275. xGame.soundMgr.playMusic("gamemusic01");
  9276. console.log("zh:uigame bf gamemusic01 end");
  9277. xGame.common.gameMgr.gamePause = false;
  9278. xGame.common.gameUI.ui.blackAni.visible = false;
  9279. xGame.common.gameUI.ui.whiteAni.visible = false;
  9280. this.ui.powerEft.visible = false;
  9281. this.ui.colorNode.visible = false;
  9282. this.updateHead();
  9283. }
  9284. updateSelf() {
  9285. if (xGame.common.gameMode == GameMode.classic) {
  9286. this.ui.c1.selectedIndex = 0;
  9287. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9288. this.ui.topNode.middleNode.visible = true;
  9289. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9290. }
  9291. else if (xGame.common.gameMode == GameMode.bigMove) {
  9292. this.ui.c1.selectedIndex = 0;
  9293. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9294. this.ui.topNode.middleNode.visible = false;
  9295. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9296. let rand = xGame.common.randomNum(1, max);
  9297. let guide = DataMgr.getSkillGuide();
  9298. if (guide == 0)
  9299. rand = 1;
  9300. xGame.common.bigMoveLevelIndex = rand;
  9301. }
  9302. else if (xGame.common.gameMode == GameMode.placeBall) {
  9303. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9304. this.ui.c1.selectedIndex = 1 + data.type;
  9305. this.ui.alpha = 1;
  9306. this.startGame();
  9307. }
  9308. this.updateMode();
  9309. this.initD3world();
  9310. this.initD2world();
  9311. }
  9312. startGame() {
  9313. this.ui.snowNode.visible = Math.random() <= 0.1;
  9314. this.ui.d2Node.visible = false;
  9315. xGame.common.d3World.d3Hand.gameObj.active = false;
  9316. xGame.common.d3World.tableSrc.init();
  9317. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9318. this.cameraViewChange(() => {
  9319. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9320. switch (xGame.common.gameMode) {
  9321. case GameMode.classic:
  9322. xGame.common.d3World.d3Hand.gameObj.active = true;
  9323. this.playPutBallD3Ani();
  9324. break;
  9325. case GameMode.bigMove:
  9326. this.enterGame();
  9327. Laya.timer.once(500, this, () => {
  9328. this.ui.topNode.middleNode.visible = true;
  9329. this.ui.topNode.middleNode.t0.play();
  9330. });
  9331. break;
  9332. case GameMode.placeBall:
  9333. this.enterGame();
  9334. break;
  9335. default:
  9336. break;
  9337. }
  9338. });
  9339. PlatMgr.showBanner(false);
  9340. }
  9341. enterGame() {
  9342. this.ui.d2Node.visible = true;
  9343. xGame.common.d3World.d3Hand.gameObj.active = false;
  9344. xGame.common.showOneCamera("mainCamera");
  9345. Moyu.recordGame(30, true);
  9346. if (!this.isPrePlay) {
  9347. this.isPrePlay = true;
  9348. xGame.common.d3World.prePlayEft();
  9349. }
  9350. xGame.common.gameMgr.gameReady();
  9351. this.openAllEvent();
  9352. this.ui.snowNode.visible = false;
  9353. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9354. this.ui.helpBtn.visible = condition;
  9355. }
  9356. showHelpLineGuide() {
  9357. let longGuide = DataMgr.getGuideHelpLine();
  9358. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9359. this.ui.helpBtn.visible = true;
  9360. this.ui.guideNode.visible = true;
  9361. }
  9362. }
  9363. setTurnAlpha(alpha) {
  9364. this.ui.keduNode.alpha = alpha;
  9365. this.ui.ganNode.alpha = alpha;
  9366. this.ui.rodMethodNode.alpha = alpha;
  9367. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9368. }
  9369. cameraViewChange(callback) {
  9370. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9371. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9372. xGame.common.showOneCamera("visitAngle");
  9373. cameraSrc.localRotationEulerY = 180;
  9374. cameraSrc.localRotationEulerZ = 0;
  9375. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9376. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9377. callback && callback();
  9378. }));
  9379. }));
  9380. }
  9381. playPutBallD3Ani() {
  9382. xGame.common.showOneCamera("mainCamera");
  9383. let handSrc = xGame.common.d3World.d3Hand;
  9384. handSrc.gameObj.active = true;
  9385. handSrc.transform.localPositionZ = 3;
  9386. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9387. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9388. handSrc.gameObj.active = false;
  9389. this.enterGame();
  9390. }), 400);
  9391. }));
  9392. }
  9393. updateHead() {
  9394. let user = Moyu.getUserInfo();
  9395. this.ui.topNode.selfNameTxt.text = user.nickName;
  9396. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9397. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9398. if (DataMgr.getSkillGuide() < 1) {
  9399. this.ui.topNode.aiNameTxt.text = 'billiards';
  9400. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9401. }
  9402. else {
  9403. this.ui.topNode.aiNameTxt.text = aiData.name;
  9404. let randNo = Math.floor(Math.random() * 10) + 1;
  9405. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9406. }
  9407. }
  9408. initD2world() {
  9409. let node = this.ui.d2Root.displayObject;
  9410. let src = node.getComponent(D2World);
  9411. if (!src) {
  9412. xGame.common.d2World = node.addComponent(D2World);
  9413. }
  9414. xGame.common.d2World.initSelf();
  9415. }
  9416. initD3world() {
  9417. if (this.isD3Inited)
  9418. return;
  9419. this.isD3Inited = true;
  9420. let scene3D = xGame.common.d3Scene;
  9421. this.ui.d3Root.displayObject.addChild(scene3D);
  9422. scene3D.active = true;
  9423. xGame.common.d3World.tableSrc.setBorderPos();
  9424. }
  9425. onRootMove(e) {
  9426. let rootBall = xGame.common.d2World.rootBall;
  9427. this.ui.moveNode.x = e.x;
  9428. this.ui.moveNode.y = e.y;
  9429. rootBall.gameObj.x = e.x;
  9430. rootBall.gameObj.y = e.y;
  9431. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9432. }
  9433. aiRootMove(move) {
  9434. if (move)
  9435. this.hideBallUI();
  9436. else {
  9437. this.showBallUI();
  9438. xGame.common.d2World.getHelpLine();
  9439. }
  9440. }
  9441. aiForce(type, force = 0) {
  9442. this.pressTarget = PressType.powerNode;
  9443. if (type == 1)
  9444. this.onEventUp({ force: true });
  9445. else if (type == 2)
  9446. this.onEventMove({ stageY: force, force: true });
  9447. }
  9448. onEventPress(e) {
  9449. if (e.stopPropagation)
  9450. e.stopPropagation();
  9451. if (!this.isTurnSelf())
  9452. return;
  9453. let target = e.target;
  9454. switch (target) {
  9455. case this.ui.myPowerNode.displayObject:
  9456. this.pressTarget = PressType.powerNode;
  9457. this.barInfo.curY = e.stageY;
  9458. this.updateBarInfo();
  9459. break;
  9460. case this.ui.moveNode.displayObject:
  9461. this.pressTarget = PressType.moveNode;
  9462. this.hideBallUI();
  9463. this.eventObj.curX = this.ui.moveNode.x;
  9464. this.eventObj.curY = this.ui.moveNode.y;
  9465. this.ui.moveNode.finger.visible = false;
  9466. this.eventObj.lastX = e.stageX;
  9467. this.eventObj.lastY = e.stageY;
  9468. break;
  9469. case this.ui.rulerClickNode.displayObject:
  9470. this.pressTarget = PressType.rulerNode;
  9471. this.eventObj.lastY = e.stageY;
  9472. break;
  9473. case this.ui.d2Root.displayObject:
  9474. this.pressTarget = PressType.d2Root;
  9475. this.eventObj.lastX = e.stageX;
  9476. this.eventObj.lastY = e.stageY;
  9477. this.eventObj.starX = e.stageX;
  9478. this.eventObj.starY = e.stageY;
  9479. this.eventObj.curX = 0;
  9480. this.eventObj.curY = 0;
  9481. xGame.common.d2World.d2Gan.setGanLastInfo();
  9482. this.rulerOffset = 0;
  9483. break;
  9484. default:
  9485. break;
  9486. }
  9487. }
  9488. onEventMove(e) {
  9489. if (e.stopPropagation)
  9490. e.stopPropagation();
  9491. if (e && e.force) {
  9492. }
  9493. else {
  9494. if (!this.isTurnSelf())
  9495. return;
  9496. }
  9497. switch (this.pressTarget) {
  9498. case PressType.powerNode:
  9499. this.barInfo.curY = e.stageY;
  9500. this.updateBarInfo();
  9501. this.isMoveRod = true;
  9502. break;
  9503. case PressType.moveNode:
  9504. let rootBall = xGame.common.d2World.rootBall;
  9505. let radius = rootBall.gameObj.width / 2;
  9506. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9507. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9508. let border = xGame.common.d2World.borderRect;
  9509. if (curX <= border.x + radius)
  9510. curX = border.x + radius;
  9511. else if (curX >= border.x + border.width - radius)
  9512. curX = border.x + border.width - radius;
  9513. if (curY <= border.y + radius)
  9514. curY = border.y + radius;
  9515. else if (curY >= border.y + border.height - radius)
  9516. curY = border.y + border.height - radius;
  9517. if (xGame.common.gameMgr.isOpenBall) {
  9518. if (curX >= border.x + border.openBallW - radius)
  9519. curX = border.x + border.openBallW - radius;
  9520. }
  9521. this.ui.moveNode.x = curX;
  9522. this.ui.moveNode.y = curY;
  9523. rootBall.gameObj.x = curX;
  9524. rootBall.gameObj.y = curY;
  9525. rootBall.d3BallSrc.setTransPos(curX, curY);
  9526. this.isMoveRod = true;
  9527. break;
  9528. case PressType.rulerNode:
  9529. let yy = e.stageY - this.eventObj.lastY;
  9530. this.eventObj.lastY = e.stageY;
  9531. let ruler1 = this.ui.rulerNode.img1;
  9532. let ruler2 = this.ui.rulerNode.img2;
  9533. ruler1.y += yy;
  9534. ruler2.y += yy;
  9535. this.rulerOffset += yy;
  9536. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9537. this.rulerOffset = 0;
  9538. xGame.soundMgr.playSound("inch", 1, 10);
  9539. }
  9540. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9541. let h = ruler1.height;
  9542. this.checkGuide();
  9543. this.isMoveRod = true;
  9544. if (ruler1.y >= h) {
  9545. ruler1.y = -h;
  9546. ruler2.y = 0;
  9547. return;
  9548. }
  9549. else if (ruler1.y <= -h) {
  9550. ruler1.y = h;
  9551. ruler2.y = 0;
  9552. return;
  9553. }
  9554. if (ruler2.y >= h) {
  9555. ruler2.y = -h;
  9556. ruler1.y = 0;
  9557. return;
  9558. }
  9559. else if (ruler2.y <= -h) {
  9560. ruler2.y = h;
  9561. ruler1.y = 0;
  9562. return;
  9563. }
  9564. break;
  9565. case PressType.d2Root:
  9566. this.eventObj.curX = e.stageX;
  9567. this.eventObj.curY = e.stageY;
  9568. let offset = this.checkRodMoveDir();
  9569. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9570. this.eventObj.lastX = e.stageX;
  9571. this.eventObj.lastY = e.stageY;
  9572. break;
  9573. default:
  9574. break;
  9575. }
  9576. }
  9577. onEventUp(e) {
  9578. if (e.stopPropagation)
  9579. e.stopPropagation();
  9580. if (e && e.force) {
  9581. }
  9582. else {
  9583. if (!this.isTurnSelf())
  9584. return;
  9585. }
  9586. switch (this.pressTarget) {
  9587. case PressType.powerNode:
  9588. this.ui.powerNode.value = 0;
  9589. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9590. this.ui.powerTxt.text = "";
  9591. if (this.powerNum > 0) {
  9592. xGame.eventMgr.event(BALL_SHOOT);
  9593. xGame.common.d2World.shoot(this.powerNum);
  9594. xGame.common.d2World.d2Gan.shoot();
  9595. xGame.common.d2World.d2HelpLine.shoot();
  9596. this.finishGuide();
  9597. this.ui.powerEft.visible = false;
  9598. this.ui.colorNode.visible = false;
  9599. let ganStr = "";
  9600. if (this.powerNum <= 30) {
  9601. ganStr = "gan_30";
  9602. }
  9603. else if (this.powerNum <= 60) {
  9604. ganStr = "gan_50";
  9605. }
  9606. else {
  9607. ganStr = "gan_80";
  9608. }
  9609. xGame.soundMgr.playSound(ganStr);
  9610. }
  9611. break;
  9612. case PressType.moveNode:
  9613. let rootBall = xGame.common.d2World.rootBall;
  9614. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9615. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9616. let isIntersect = this.judgeBallIntersect();
  9617. if (isIntersect) {
  9618. this.ui.moveNode.x = lastX;
  9619. this.ui.moveNode.y = lastY;
  9620. rootBall.gameObj.x = lastX;
  9621. rootBall.gameObj.y = lastY;
  9622. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9623. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9624. }
  9625. else {
  9626. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9627. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9628. }
  9629. this.showBallUI();
  9630. this.ui.moveNode.finger.visible = true;
  9631. xGame.common.d2World.getHelpLine();
  9632. break;
  9633. case PressType.rulerNode:
  9634. break;
  9635. case PressType.d2Root:
  9636. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9637. if (dis <= 25) {
  9638. this.moveToClickDot(e);
  9639. }
  9640. break;
  9641. default:
  9642. break;
  9643. }
  9644. this.pressTarget = -1;
  9645. }
  9646. checkGuide() {
  9647. let guide = DataMgr.getSkillGuide();
  9648. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9649. xGame.common.guideStep++;
  9650. xGame.common.gameUI.ui.guide2.visible = false;
  9651. xGame.common.gameUI.ui.guide3.visible = true;
  9652. }
  9653. }
  9654. finishGuide() {
  9655. let guide = DataMgr.getSkillGuide();
  9656. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9657. xGame.common.guideStep = 10;
  9658. this.closeAllGuide();
  9659. }
  9660. }
  9661. closeAllGuide() {
  9662. xGame.common.gameUI.ui.guide1.visible = false;
  9663. xGame.common.gameUI.ui.guide2.visible = false;
  9664. xGame.common.gameUI.ui.guide3.visible = false;
  9665. }
  9666. updateBarInfo() {
  9667. let star = this.ui.powerNode.y;
  9668. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9669. if (rate >= 1)
  9670. rate = 1;
  9671. if (rate <= 0)
  9672. rate = 0;
  9673. this.powerNum = Math.ceil(rate * 100);
  9674. this.ui.powerNode.value = this.powerNum;
  9675. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9676. this.ui.colorNode.value = this.powerNum;
  9677. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9678. this.ui.powerEft.visible = this.powerNum != 0;
  9679. this.ui.colorNode.visible = this.powerNum != 0;
  9680. this.ui.powerTxt.text = this.powerNum + "";
  9681. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9682. }
  9683. forceCancel() {
  9684. this.ui.powerNode.value = 0;
  9685. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9686. this.ui.powerTxt.text = "";
  9687. }
  9688. checkRodMoveDir() {
  9689. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9690. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9691. if (tempX >= 0 && tempY <= 0) {
  9692. return this.checkDir();
  9693. }
  9694. else if (tempX < 0 && tempY < 0) {
  9695. return this.checkDir(1, -1);
  9696. }
  9697. else if (tempX < 0 && tempY > 0) {
  9698. return this.checkDir(-1, -1);
  9699. }
  9700. else {
  9701. return this.checkDir(-1, 1);
  9702. }
  9703. }
  9704. checkDir(flagX = 1, flagY = 1) {
  9705. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9706. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9707. if (offsetY == 0) {
  9708. return offsetX * flagX;
  9709. }
  9710. if (offsetX == 0) {
  9711. return offsetY * flagY;
  9712. }
  9713. let angle = offsetY / offsetX;
  9714. if (Math.abs(angle) >= 1) {
  9715. return offsetY * flagY;
  9716. }
  9717. else {
  9718. return offsetX * flagX;
  9719. }
  9720. }
  9721. judgeBallIntersect() {
  9722. let rootBall = xGame.common.d2World.rootBall;
  9723. let ballArr = xGame.common.d2World.ballArr;
  9724. let radius = rootBall.gameObj.width / 2;
  9725. let temp;
  9726. let isIntersect = false;
  9727. for (let index = 0; index < ballArr.length; index++) {
  9728. temp = ballArr[index];
  9729. if (temp.number == rootBall.number)
  9730. continue;
  9731. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9732. if (isIntersect) {
  9733. break;
  9734. }
  9735. }
  9736. return isIntersect;
  9737. }
  9738. hideBallUI() {
  9739. let d2Gan = xGame.common.d2World.d2Gan;
  9740. if (!d2Gan.ui.isDisposed)
  9741. d2Gan.ui.visible = false;
  9742. let d2Help = xGame.common.d2World.d2HelpLine;
  9743. if (!d2Help.ui.isDisposed)
  9744. d2Help.ui.visible = false;
  9745. let rootBall = xGame.common.d2World.rootBall;
  9746. if (!rootBall.destroyed) {
  9747. rootBall.gameObj.active = false;
  9748. }
  9749. }
  9750. showBallUI() {
  9751. let d2Gan = xGame.common.d2World.d2Gan;
  9752. if (!d2Gan.ui.isDisposed)
  9753. d2Gan.ui.visible = true;
  9754. let d2Help = xGame.common.d2World.d2HelpLine;
  9755. if (!d2Help.ui.isDisposed)
  9756. d2Help.ui.visible = true;
  9757. let rootBall = xGame.common.d2World.rootBall;
  9758. if (!rootBall.destroyed) {
  9759. rootBall.gameObj.active = true;
  9760. }
  9761. }
  9762. moveToClickDot(e) {
  9763. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9764. let root = xGame.common.d2World.rootBall.gameObj;
  9765. let xx = e.stageX - xGame.common.sysOffestNum;
  9766. let yy = e.stageY;
  9767. let x = xx - root.x;
  9768. let y = yy - root.y;
  9769. let angle = xGame.common.getfguiRotation(x, y);
  9770. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9771. xGame.common.d2World.getHelpLine();
  9772. }
  9773. this.isMoveRod = false;
  9774. xGame.common.clickedBall = false;
  9775. }
  9776. openAllEvent() {
  9777. this.closeAllEvent();
  9778. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9779. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9780. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9781. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9782. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9783. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9784. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9785. }
  9786. closeAllEvent() {
  9787. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9788. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9789. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9790. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9791. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9792. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9793. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9794. }
  9795. resetGame() {
  9796. this.closeAllEvent();
  9797. this.hideBallUI();
  9798. xGame.common.gameMgr.gamePause = true;
  9799. }
  9800. }
  9801. UIGame.uiName = "UIGame";
  9802. class UIAddProp extends UIBase {
  9803. constructor() {
  9804. super();
  9805. this.curType = "";
  9806. }
  9807. onConstructor() {
  9808. this.ui = ui_UIAddProp.createInstance();
  9809. this.contentPane = this.ui;
  9810. this.isEject = false;
  9811. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9812. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9813. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9814. this.updateUI();
  9815. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9816. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9817. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9818. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9819. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9820. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9821. }
  9822. show(type) {
  9823. super.show();
  9824. this.curType = type == 0 ? "coin" : "diamond";
  9825. this.switchBtn("");
  9826. this.ui.t0.play();
  9827. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9828. PlatMgr.showInsert(true);
  9829. }
  9830. closeSelf() {
  9831. this.hide();
  9832. }
  9833. updateUI() {
  9834. let data = cfgTable.moneyData;
  9835. let temp;
  9836. let obj;
  9837. for (const key in data) {
  9838. temp = data[key];
  9839. obj = this.ui.myNode["node" + key];
  9840. if (parseInt(key) <= 2) {
  9841. obj.diamondTxt.text = "+" + temp.num;
  9842. }
  9843. else {
  9844. obj.coinTxt.text = temp.num;
  9845. obj.diamondTxt.text = temp.get.split('_')[1];
  9846. }
  9847. }
  9848. this.updateDiamondShare();
  9849. }
  9850. updateDiamondShare() {
  9851. let data = DataMgr.getShareDiamondTimes();
  9852. if (data >= xGame.common.maxShareDiamondTimes) {
  9853. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  9854. this.ui.myNode.node1.touchable = false;
  9855. }
  9856. else {
  9857. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9858. this.ui.myNode.node1.touchable = true;
  9859. }
  9860. }
  9861. switchBtn(type) {
  9862. if (type == "")
  9863. type = this.curType;
  9864. else {
  9865. if (this.curType == type) {
  9866. return;
  9867. }
  9868. else {
  9869. this.curType = type;
  9870. }
  9871. }
  9872. if (type == "coin") {
  9873. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9874. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9875. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9876. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9877. this.ui.myNode.c1.selectedIndex = 0;
  9878. }
  9879. else {
  9880. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9881. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9882. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9883. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9884. this.ui.myNode.c1.selectedIndex = 1;
  9885. }
  9886. }
  9887. convertCoin(index) {
  9888. let data = cfgTable.moneyData[index];
  9889. let coinNum = data.num;
  9890. let str = data.get.split('_')[1];
  9891. let needDiamond = parseInt(str);
  9892. if (DataMgr.diamondEnough(needDiamond)) {
  9893. DataMgr.setDiamond(-needDiamond);
  9894. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9895. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  9896. }
  9897. else {
  9898. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  9899. this.switchBtn("diamond");
  9900. }
  9901. }
  9902. videoGetDiamond() {
  9903. let num = cfgTable.moneyData[2].num;
  9904. Moyu.showVideoAd(() => {
  9905. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9906. this.closeSelf();
  9907. }, EAdType.addDiamond);
  9908. }
  9909. videoGetCoin() {
  9910. Moyu.showVideoAd(() => {
  9911. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9912. this.closeSelf();
  9913. }, EAdType.addCoin);
  9914. }
  9915. shareGetDiamond() {
  9916. let times = DataMgr.getShareDiamondTimes();
  9917. if (times >= xGame.common.maxShareDiamondTimes) {
  9918. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  9919. }
  9920. else {
  9921. if (Moyu.isTT) {
  9922. let num = cfgTable.moneyData[1].num;
  9923. Moyu.shareVideo = '';
  9924. Moyu.shareGame((success) => {
  9925. if (success) {
  9926. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9927. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9928. DataMgr.setShareDiamondTimes(1);
  9929. this.updateDiamondShare();
  9930. }
  9931. else {
  9932. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9933. }
  9934. });
  9935. }
  9936. else {
  9937. Moyu.showVideoAd(() => {
  9938. let diamond = xGame.common.randomNum(50, 100);
  9939. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9940. DataMgr.setShareDiamondTimes(1);
  9941. this.updateDiamondShare();
  9942. }, EAdType.randomDiamond);
  9943. }
  9944. }
  9945. }
  9946. openPutBallView() {
  9947. let end = xGame.uiMgr.getUI(UIGameEnd);
  9948. let skill = xGame.uiMgr.getUI(UISkill);
  9949. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9950. let uigame = xGame.uiMgr.getUI(UIGame);
  9951. if (end && !end.isHide) {
  9952. xGame.uiMgr.Hide(UIGameEnd);
  9953. xGame.uiMgr.Show(UIMain);
  9954. }
  9955. if (skill && !skill.isHide)
  9956. xGame.uiMgr.Hide(UISkill);
  9957. if (uigame && !uigame.isHide)
  9958. xGame.uiMgr.Hide(UIGame);
  9959. if (level && !level.isHide) {
  9960. }
  9961. else {
  9962. xGame.uiMgr.Show(UILevelDisplay);
  9963. }
  9964. this.closeSelf();
  9965. }
  9966. }
  9967. UIAddProp.uiName = "UIAddProp";
  9968. class MoneyNode {
  9969. constructor(ui) {
  9970. this.leftTime = 0;
  9971. this.ui = ui;
  9972. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9973. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9974. this.ui.addPowerBtn.onClick(this, this.addPower);
  9975. this.ui.c1.selectedIndex = 1;
  9976. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9977. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9978. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9979. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  9980. this.coinChange();
  9981. this.diamondChange();
  9982. this.powerChange();
  9983. }
  9984. addPower() {
  9985. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9986. xGame.uiMgr.Show(UIPower);
  9987. }
  9988. powerChange() {
  9989. let powerNum = DataMgr.getPower();
  9990. this.ui.powerTxt.text = powerNum + "";
  9991. }
  9992. checkPowerTime() {
  9993. let cur = new Date().getTime();
  9994. let last = DataMgr.getPowerTime();
  9995. if (last == 0) {
  9996. last = cur;
  9997. DataMgr.setPowerTime(cur);
  9998. }
  9999. let power = DataMgr.getPower();
  10000. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10001. Laya.timer.clearAll(this);
  10002. if (power >= xGame.common.natureMaxPower) {
  10003. this.ui.powerTimeTxt.text = "";
  10004. DataMgr.setPowerTime(cur);
  10005. return;
  10006. }
  10007. if (power + offset >= xGame.common.natureMaxPower) {
  10008. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10009. this.ui.powerTimeTxt.text = "";
  10010. DataMgr.setPowerTime(cur);
  10011. }
  10012. else {
  10013. if (offset > 0) {
  10014. DataMgr.setPower(offset);
  10015. DataMgr.setPowerTime(cur);
  10016. }
  10017. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10018. this.leftTime = xGame.common.powerRecoverNum - time;
  10019. if (this.leftTime <= 0)
  10020. this.leftTime = 0;
  10021. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10022. Laya.timer.loop(1000, this, this.updatePowerTime);
  10023. }
  10024. }
  10025. updatePowerTime() {
  10026. this.leftTime -= 1;
  10027. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10028. if (this.leftTime <= 0) {
  10029. this.checkPowerTime();
  10030. }
  10031. }
  10032. coinChange() {
  10033. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10034. }
  10035. diamondChange() {
  10036. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10037. }
  10038. addCoin() {
  10039. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10040. Moyu.sendDataEvent("AddCoinBtn");
  10041. xGame.uiMgr.Show(UIAddProp, 0);
  10042. }
  10043. addDiamond() {
  10044. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10045. Moyu.sendDataEvent("AddDiamondBtn");
  10046. xGame.uiMgr.Show(UIAddProp, 1);
  10047. }
  10048. }
  10049. class UIDraw extends UIBase {
  10050. constructor() {
  10051. super();
  10052. this.curKey = 0;
  10053. }
  10054. onConstructor() {
  10055. this.ui = ui_UIDraw.createInstance();
  10056. this.contentPane = this.ui;
  10057. this.isEject = false;
  10058. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10059. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10060. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10061. this.initDraw();
  10062. this.initUI();
  10063. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10064. if (Moyu.isKs)
  10065. this.ui.closeNode.closeBtn.x += 100;
  10066. }
  10067. show() {
  10068. super.show();
  10069. this.ui.t0.play();
  10070. this.playSecretaryIdle();
  10071. this.updateDraw();
  10072. this.checkFree();
  10073. if (PlatMgr.bannerDelay > 0) {
  10074. this.ui.closeNode.closeBtn.visible = false;
  10075. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10076. this.ui.closeNode.closeBtn.visible = true;
  10077. });
  10078. }
  10079. PlatMgr.showRateBanner();
  10080. }
  10081. hide() {
  10082. Laya.timer.clearAll(this);
  10083. super.hide();
  10084. }
  10085. checkFree() {
  10086. let isFree = DataMgr.getDailyfreeDrawTimes();
  10087. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10088. }
  10089. initDraw() {
  10090. this.drawObj = [];
  10091. let data = cfgTable.drawData;
  10092. let temp;
  10093. let weight = 0;
  10094. for (const key in data) {
  10095. temp = data[key];
  10096. weight += temp.weight;
  10097. this.drawObj.push(weight);
  10098. }
  10099. this.allWeight = weight;
  10100. }
  10101. initUI() {
  10102. let data = cfgTable.drawData;
  10103. let temp;
  10104. let img;
  10105. let txt;
  10106. for (const key in data) {
  10107. temp = data[key];
  10108. img = this.ui.myNode.rotNode["img" + key];
  10109. txt = this.ui.myNode.rotNode["txt" + key];
  10110. img.url = xGame.common.getGameIconUrl(temp.icon);
  10111. txt.visible = true;
  10112. if (temp.award > 2) {
  10113. img.rotation = 0;
  10114. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10115. }
  10116. else {
  10117. img.rotation = temp.rotation;
  10118. txt.text = temp.num;
  10119. }
  10120. }
  10121. }
  10122. getCurkey() {
  10123. let rand = Math.random() * this.allWeight;
  10124. let temp;
  10125. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10126. temp = this.drawObj[index];
  10127. if (index == 0) {
  10128. if (rand < temp) {
  10129. return index + 1;
  10130. }
  10131. }
  10132. else {
  10133. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10134. return index + 1;
  10135. }
  10136. }
  10137. }
  10138. return 2;
  10139. }
  10140. startDraw() {
  10141. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10142. if (freeTimes > 0) {
  10143. this.beginDraw();
  10144. DataMgr.setDailyfreeDrawTimes(0);
  10145. this.checkFree();
  10146. }
  10147. else {
  10148. Moyu.sendDataEvent("turntable");
  10149. Moyu.showVideoAd(() => {
  10150. this.beginDraw();
  10151. }, EAdType.draw);
  10152. }
  10153. }
  10154. beginDraw() {
  10155. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10156. this.ui.drawBtn.touchable = false;
  10157. this.curKey = this.getCurkey();
  10158. console.log("当前key", this.curKey);
  10159. let cell = 60;
  10160. let lap = 3;
  10161. let angle = cell * (this.curKey - 1) + lap * 360;
  10162. let target = this.ui.myNode.rotNode;
  10163. target.rotation = 0;
  10164. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10165. console.log("旋转完成");
  10166. this.ui.drawBtn.touchable = true;
  10167. this.getAward();
  10168. }));
  10169. }
  10170. getAward() {
  10171. let data = cfgTable.drawData[this.curKey];
  10172. let temp = new AwardType();
  10173. temp.type = data.award;
  10174. temp.num = data.num;
  10175. xGame.common.getAward([temp], () => {
  10176. DataMgr.setDrawTimes(1);
  10177. this.updateDraw();
  10178. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10179. });
  10180. }
  10181. updateDraw() {
  10182. let drawTimes = DataMgr.getDrawTimes();
  10183. let awardTimes = DataMgr.getDrawAwardTimes();
  10184. if (Math.floor(drawTimes / 3) > awardTimes) {
  10185. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10186. this.ui.extraNode.boxBtn.touchable = true;
  10187. this.ui.extraNode.tipsTxt.text = "3/3";
  10188. this.ui.extraNode.barNode.width = 265;
  10189. this.getExtraAward();
  10190. }
  10191. else {
  10192. this.ui.extraNode.boxBtn.t0.stop();
  10193. this.ui.extraNode.boxBtn.touchable = false;
  10194. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10195. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10196. }
  10197. let data = cfgTable.drawData[1];
  10198. if (awardTimes == 0) {
  10199. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10200. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10201. this.ui.myNode.rotNode.img1.rotation = 0;
  10202. }
  10203. else {
  10204. let award = data.nextid;
  10205. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10206. this.ui.myNode.rotNode.txt1.text = award[1];
  10207. this.ui.myNode.rotNode.img1.rotation = 0;
  10208. }
  10209. }
  10210. getExtraAward() {
  10211. let drawTimes = DataMgr.getDrawTimes();
  10212. let awardTimes = DataMgr.getDrawAwardTimes();
  10213. let data = cfgTable.drawData[1];
  10214. let award = new AwardType();
  10215. if (awardTimes == 0) {
  10216. award.num = data.num;
  10217. award.type = data.award;
  10218. xGame.common.getAward([award], () => {
  10219. let all = Math.floor(drawTimes / 3);
  10220. DataMgr.setDrawAwardTimes(all);
  10221. this.updateDraw();
  10222. });
  10223. }
  10224. else {
  10225. award.num = parseInt(data.nextid[1]);
  10226. award.type = parseInt(data.nextid[0]);
  10227. xGame.common.getAward([award], () => {
  10228. let all = Math.floor(drawTimes / 3);
  10229. DataMgr.setDrawAwardTimes(all);
  10230. this.updateDraw();
  10231. });
  10232. }
  10233. }
  10234. closeSelf() {
  10235. this.hide();
  10236. }
  10237. playSecretaryIdle() {
  10238. let parent = this.ui.secretary.displayObject;
  10239. parent.destroyChildren();
  10240. let xx = this.ui.secretary.width / 2;
  10241. let yy = this.ui.secretary.height;
  10242. let scale = xGame.common.getSecretaryScale();
  10243. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10244. xGame.common.secretary.play(data, 0, true, parent);
  10245. }
  10246. }
  10247. UIDraw.uiName = "UIDraw";
  10248. class ui_UIFlyEft extends fgui.GComponent {
  10249. static createInstance() {
  10250. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10251. }
  10252. onConstruct() {
  10253. this.n0 = (this.getChild("n0"));
  10254. this.n1 = (this.getChild("n1"));
  10255. this.n2 = (this.getChild("n2"));
  10256. this.n3 = (this.getChild("n3"));
  10257. this.n4 = (this.getChild("n4"));
  10258. this.n5 = (this.getChild("n5"));
  10259. this.n6 = (this.getChild("n6"));
  10260. this.n7 = (this.getChild("n7"));
  10261. this.iconNode = (this.getChild("iconNode"));
  10262. this.txt = (this.getChild("txt"));
  10263. this.txtNode = (this.getChild("txtNode"));
  10264. }
  10265. }
  10266. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10267. class UIFlyEft extends UIBase {
  10268. constructor() {
  10269. super();
  10270. this.max = 8;
  10271. this.delay = 0;
  10272. }
  10273. onConstructor() {
  10274. this.ui = ui_UIFlyEft.createInstance();
  10275. this.contentPane = this.ui;
  10276. this.isEject = false;
  10277. this.isMuti = true;
  10278. this.ui.x += xGame.common.sysOffestNum;
  10279. }
  10280. getArrPos() {
  10281. if (this.iconPos && this.iconPos.length > 0)
  10282. return;
  10283. this.iconPos = [];
  10284. let temp;
  10285. for (let index = 0; index < this.max; index++) {
  10286. temp = this.ui["n" + index];
  10287. this.iconPos.push([temp.x, temp.y]);
  10288. }
  10289. }
  10290. show(stPos, edPos, num, type, callback) {
  10291. super.show();
  10292. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10293. this.getArrPos();
  10294. this.updateUI(type);
  10295. this.updatePos();
  10296. this.runFly(edPos, callback);
  10297. this.runWorlds(stPos, num);
  10298. }
  10299. updateUI(type) {
  10300. let temp;
  10301. let str;
  10302. for (let index = 0; index < this.max; index++) {
  10303. temp = this.ui["n" + index];
  10304. str = this.getIconStr(type);
  10305. temp.url = xGame.common.getGameIconUrl(str);
  10306. }
  10307. }
  10308. getIconStr(type) {
  10309. switch (type) {
  10310. case Prop.diamond:
  10311. return "ty_zs";
  10312. case Prop.coin:
  10313. return "ty_jb";
  10314. default:
  10315. break;
  10316. }
  10317. }
  10318. updatePos() {
  10319. let temp;
  10320. for (let index = 0; index < this.max; index++) {
  10321. temp = this.ui["n" + index];
  10322. temp.x = this.iconPos[index][0];
  10323. temp.y = this.iconPos[index][1];
  10324. }
  10325. }
  10326. runFly(endPos, callback) {
  10327. let all = 0;
  10328. let temp;
  10329. for (let index = 0; index < this.max; index++) {
  10330. temp = this.ui["n" + index];
  10331. temp.visible = true;
  10332. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10333. temp.visible = false;
  10334. all++;
  10335. if (all >= this.max) {
  10336. callback && callback();
  10337. }
  10338. }), 20 * index);
  10339. }
  10340. }
  10341. runWorlds(stPos, num) {
  10342. let str = "+" + num;
  10343. this.ui.txt.text = str;
  10344. let starX = stPos.x;
  10345. let starY = stPos.y + 50;
  10346. this.ui.txt.x = starX;
  10347. this.ui.txt.y = starY;
  10348. this.ui.txt.visible = true;
  10349. this.ui.txt.alpha = 1;
  10350. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10351. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10352. this.ui.txt.visible = false;
  10353. this.hide();
  10354. }));
  10355. }));
  10356. }
  10357. }
  10358. UIFlyEft.uiName = "UIFlyEft";
  10359. class ui_UIGetAward extends fgui.GComponent {
  10360. static createInstance() {
  10361. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10362. }
  10363. onConstruct() {
  10364. this.n4 = (this.getChild("n4"));
  10365. this.n0 = (this.getChild("n0"));
  10366. this.myList = (this.getChild("myList"));
  10367. this.n1 = (this.getChild("n1"));
  10368. this.eftNode = (this.getChild("eftNode"));
  10369. this.btnNode = (this.getChild("btnNode"));
  10370. this.t0 = this.getTransition("t0");
  10371. }
  10372. }
  10373. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10374. class UIGetAward extends UIBase {
  10375. constructor() {
  10376. super();
  10377. this.showTriple = true;
  10378. }
  10379. onConstructor() {
  10380. this.ui = ui_UIGetAward.createInstance();
  10381. this.contentPane = this.ui;
  10382. this.isEject = false;
  10383. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10384. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10385. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10386. }
  10387. show(arr, showTriple, callback) {
  10388. super.show();
  10389. this.ui.t0.play();
  10390. this.ui.eftNode.visible = true;
  10391. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10392. this.ui.eftNode.visible = false;
  10393. }), 1, 0, 0, 0.9);
  10394. this.awardArr = arr;
  10395. this.showTriple = showTriple;
  10396. this.callback = callback;
  10397. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10398. this.ui.myList.numItems = arr.length;
  10399. xGame.soundMgr.playSound("getaward");
  10400. }
  10401. updateSelf(index, obj) {
  10402. let temp = this.awardArr[index];
  10403. let icon = this.getIcon(temp.type);
  10404. let str = icon;
  10405. if (temp.type > 2) {
  10406. str = "s" + icon;
  10407. }
  10408. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10409. obj.myIcon.rotation = 0;
  10410. obj.numTxt.text = temp.num + "";
  10411. obj.numTxt.visible = temp.type > 2 ? false : true;
  10412. obj.nameTxt.text = this.getNameStr(temp.type);
  10413. }
  10414. renderItem(index, obj) {
  10415. this.updateSelf(index, obj);
  10416. }
  10417. tripleGetAward() {
  10418. Moyu.showVideoAd(() => {
  10419. this.getAward(3);
  10420. }, EAdType.triple);
  10421. }
  10422. normalGetAward() {
  10423. if (PlatMgr.isMisVideo())
  10424. this.tripleGetAward();
  10425. else
  10426. this.getAward();
  10427. }
  10428. getAward(times = 1) {
  10429. this.hide();
  10430. for (let index = 0; index < this.awardArr.length; index++) {
  10431. this.awardArr[index].num *= times;
  10432. }
  10433. this.callback && this.callback(times != 1);
  10434. }
  10435. getIcon(type) {
  10436. switch (type) {
  10437. case Prop.diamond:
  10438. return "ty_zs";
  10439. case Prop.coin:
  10440. return "ty_jb";
  10441. case Prop.gan1:
  10442. return "qg1";
  10443. case Prop.gan2:
  10444. return "qg2";
  10445. case Prop.gan3:
  10446. return "qg3";
  10447. case Prop.gan4:
  10448. return "qg4";
  10449. default:
  10450. break;
  10451. }
  10452. }
  10453. getNameStr(type) {
  10454. switch (type) {
  10455. case Prop.diamond:
  10456. return "Diamond";
  10457. case Prop.coin:
  10458. return "Coins";
  10459. case Prop.gan1:
  10460. case Prop.gan2:
  10461. case Prop.gan3:
  10462. case Prop.gan4:
  10463. return cfgTable.ballrodData[type - 1].name;
  10464. default:
  10465. break;
  10466. }
  10467. }
  10468. }
  10469. UIGetAward.uiName = "UIGetAward";
  10470. class Common {
  10471. constructor() {
  10472. this.convertNum = 0.025;
  10473. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10474. this.scaleV3One = new Laya.Vector3();
  10475. this.scaleV3Two = new Laya.Vector3();
  10476. this.posV4 = new Laya.Vector4();
  10477. this.showDebug = false;
  10478. this.openGuide = true;
  10479. this.rodOffest = new Laya.Vector2(0, 0);
  10480. this.rodAngle = 0;
  10481. this.gameMode = GameMode.classic;
  10482. this.bigMoveLevelIndex = 1;
  10483. this.bigMoveNeedCoin = 1000;
  10484. this.classicNiceNeddCoin = 1000;
  10485. this.passAwardCoin = 2000;
  10486. this.classicRoomType = 1;
  10487. this.maxPower = 20;
  10488. this.natureMaxPower = 5;
  10489. this.videoPower = 2;
  10490. this.powerRecoverNum = 900;
  10491. this.curPlayerSkillType = 0;
  10492. this.isNewDay = false;
  10493. this.clickedBall = false;
  10494. this.placeBallCurLevel = 0;
  10495. this.placeBallStarNum = 0;
  10496. this.longHelpLine = false;
  10497. this.maxShareDiamondTimes = 3;
  10498. this.guideStep = 0;
  10499. this.temSelfLevel = 0;
  10500. this.extraMoveNum = 0;
  10501. this.curRankID = 0;
  10502. this.rankID = {
  10503. normalStar: 12000,
  10504. wxStar: 12001
  10505. };
  10506. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10507. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10508. this.btnClickStr = "buttonclick";
  10509. this.maxSkillLevel = 10;
  10510. this.upSkillLevel = false;
  10511. this.gameStartTime = 0;
  10512. this._sysOffestNum = 0;
  10513. this.angleV2 = new Laya.Vector2();
  10514. this.rootV = new Laya.Vector2(0, 1);
  10515. this.tempDir1 = new Laya.Vector2();
  10516. this.tempDir2 = new Laya.Vector2();
  10517. this.ballSize = 33;
  10518. this.stPos = new Laya.Point();
  10519. this.edPos = new Laya.Point();
  10520. Common._instance = this;
  10521. window["common"] = this;
  10522. }
  10523. static getInstance() {
  10524. if (!this._instance) {
  10525. this._instance = new Common();
  10526. }
  10527. return this._instance;
  10528. }
  10529. get sysOffestNum() {
  10530. if (this._sysOffestNum == 0) {
  10531. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10532. }
  10533. return this._sysOffestNum;
  10534. }
  10535. testShader() {
  10536. let test = new LightShader();
  10537. test.texture = "res/d3Res/ballTexture/ball1.png";
  10538. Laya.stage.addChild(test);
  10539. }
  10540. playScale(node) {
  10541. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10542. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10543. }));
  10544. }));
  10545. }
  10546. setGroup(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.collisionGroup = out;
  10557. }
  10558. setCanGroupWith(colli, ...group) {
  10559. let out = 0;
  10560. for (let index = 0; index < group.length; index++) {
  10561. if (index == 0) {
  10562. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10563. }
  10564. else {
  10565. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10566. }
  10567. }
  10568. colli.canCollideWith = out;
  10569. }
  10570. loadPrefab(name, callback) {
  10571. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10572. let prefab = new Laya.Prefab();
  10573. prefab.json = obj;
  10574. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10575. callback && callback(img);
  10576. }));
  10577. }
  10578. pos2to3Convert(x, y, d3Pos) {
  10579. x = x + this.sysOffestNum;
  10580. d3Pos.setValue(x, y, 0);
  10581. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10582. if (success) {
  10583. }
  10584. else {
  10585. console.error("转换出错了。。。。。。。。");
  10586. }
  10587. }
  10588. scale2to3Convert(num) {
  10589. this.scaleV3One.setValue(0, 0, 0);
  10590. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10591. this.scaleV3Two.setValue(0, num, 0);
  10592. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10593. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10594. return outNum;
  10595. }
  10596. pos3to2Convert(d3Pos) {
  10597. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10598. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10599. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10600. d3Pos.x -= this.sysOffestNum;
  10601. }
  10602. scale3to2Convert(num) {
  10603. let scale = this.scale2to3Convert(1);
  10604. let d2Out = num / scale;
  10605. return d2Out;
  10606. }
  10607. getCollider(type, restitution = 0.9, density = 10) {
  10608. let colli;
  10609. if (type == "box")
  10610. colli = new Laya.BoxCollider();
  10611. else
  10612. colli = new Laya.CircleCollider();
  10613. colli.friction = 0;
  10614. colli.restitution = restitution;
  10615. colli.density = density;
  10616. return colli;
  10617. }
  10618. getRigbody() {
  10619. let rigy = new Laya.RigidBody();
  10620. rigy.bullet = true;
  10621. rigy.allowRotation = false;
  10622. rigy.allowSleep = false;
  10623. rigy.gravityScale = 0;
  10624. return rigy;
  10625. }
  10626. getfguiRotation(x, y) {
  10627. this.angleV2.setValue(x, y);
  10628. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10629. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10630. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10631. angle = -angle;
  10632. }
  10633. return 180 + angle;
  10634. }
  10635. getAngle(x, y) {
  10636. this.angleV2.setValue(x, y);
  10637. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10638. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10639. return angle;
  10640. }
  10641. randomNum(a, b) {
  10642. return a + Math.floor((b - a + 1) * Math.random());
  10643. }
  10644. getRandArrEle(arr) {
  10645. return arr[Math.floor(arr.length * Math.random())];
  10646. }
  10647. getSign(val) {
  10648. return val >= 0 ? 1 : -1;
  10649. }
  10650. botherArr(arr) {
  10651. let times = arr.length + 2;
  10652. let length = arr.length;
  10653. let a;
  10654. let b;
  10655. let temp;
  10656. for (let index = 0; index < times; index++) {
  10657. a = Math.floor(Math.random() * length);
  10658. b = Math.floor(Math.random() * length);
  10659. temp = arr[a];
  10660. arr[a] = arr[b];
  10661. arr[b] = temp;
  10662. }
  10663. }
  10664. getGameIconUrl(id) {
  10665. return "ui://game/" + id;
  10666. }
  10667. getComponentUrl(id) {
  10668. return "ui://game/" + id;
  10669. }
  10670. getAnimation() {
  10671. }
  10672. judgeSkillType(type = SkillType.highSpace) {
  10673. if (this.gameMode == GameMode.classic)
  10674. return;
  10675. let gameMgr = this.gameMgr;
  10676. if (gameMgr.selfTurn) {
  10677. if (gameMgr.selfCurSkill == type) {
  10678. return true;
  10679. }
  10680. }
  10681. else {
  10682. if (gameMgr.aiCurSkill == type) {
  10683. return true;
  10684. }
  10685. }
  10686. }
  10687. ballColliHole(collider) {
  10688. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10689. xGame.common.gameMgr.isFirstInGame = false;
  10690. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10691. }
  10692. collider.owner.mySrc.checkWrongBall();
  10693. }
  10694. getArrMaxEle(arr) {
  10695. let max = -Infinity;
  10696. for (let index = 0; index < arr.length; index++) {
  10697. max = Math.max(arr[index], max);
  10698. }
  10699. return max;
  10700. }
  10701. getArrMinEle(arr) {
  10702. let min = Infinity;
  10703. for (let index = 0; index < arr.length; index++) {
  10704. min = Math.min(arr[index], min);
  10705. }
  10706. return min;
  10707. }
  10708. playRandomMutiBallBigSkillSound() {
  10709. if (Math.random() <= 0.5)
  10710. return;
  10711. let rand = this.randomNum(1, 6);
  10712. let str = "ganfa0" + rand;
  10713. xGame.soundMgr.playSound(str);
  10714. }
  10715. showOneCamera(type) {
  10716. let object = xGame.common.d3World.cameraObj;
  10717. for (const key in object) {
  10718. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10719. object[key].init();
  10720. object[key].owner.active = key == type;
  10721. }
  10722. }
  10723. }
  10724. checkBallOverBorder(x, y) {
  10725. let radius = 17;
  10726. let condition = this._checkBorder(x + radius, y) ||
  10727. this._checkBorder(x - radius, y) ||
  10728. this._checkBorder(x, y + radius) ||
  10729. this._checkBorder(x, y - radius);
  10730. if (condition) {
  10731. return true;
  10732. }
  10733. }
  10734. _checkBorder(x, y) {
  10735. let borderRect = this.d2World.borderRect;
  10736. let xOffest = 20;
  10737. let yOffest = 20;
  10738. if (y <= borderRect.y - yOffest) {
  10739. return true;
  10740. }
  10741. if (y >= borderRect.y + borderRect.height + yOffest) {
  10742. return true;
  10743. }
  10744. if (x <= borderRect.x - xOffest) {
  10745. return true;
  10746. }
  10747. if (x >= borderRect.x + borderRect.width + xOffest) {
  10748. return true;
  10749. }
  10750. }
  10751. initWeight(cfg) {
  10752. let allCfgData = { data: {}, allWeightNum: 0 };
  10753. let weightCfg = allCfgData.data;
  10754. let weight = 0;
  10755. for (const key in cfg) {
  10756. weightCfg[key] = {};
  10757. weightCfg[key].id = cfg[key].id;
  10758. weightCfg[key].minWeight = weight;
  10759. weight += cfg[key].weight;
  10760. weightCfg[key].maxWeight = weight;
  10761. }
  10762. allCfgData.allWeightNum = weight;
  10763. return allCfgData;
  10764. }
  10765. getRandomWeightData(cfg) {
  10766. let weightCfg = cfg.data;
  10767. let allWeightNum = cfg.allWeightNum;
  10768. let rand = Math.floor(Math.random() * allWeightNum);
  10769. for (const key in weightCfg) {
  10770. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10771. return weightCfg[key];
  10772. }
  10773. }
  10774. return weightCfg[1];
  10775. }
  10776. showGirlTalkPop(wordsIndex, node, msgNode) {
  10777. node.visible = true;
  10778. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10779. node.t0.play(Laya.Handler.create(this, () => {
  10780. node.visible = false;
  10781. }));
  10782. }
  10783. stopGirlPop(node) {
  10784. node.t0.stop();
  10785. node.visible = false;
  10786. }
  10787. createHead(loader, url, size = 107) {
  10788. if (Laya.Browser.name == "Browser") {
  10789. loader.url = url;
  10790. return;
  10791. }
  10792. if (Moyu.isTT) {
  10793. let localImage = new Image();
  10794. localImage.src = url;
  10795. localImage.onload = () => {
  10796. let t2d = new Laya.Texture2D();
  10797. t2d.width = size;
  10798. t2d.height = size;
  10799. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10800. t2d.loadImageSource(localImage);
  10801. };
  10802. }
  10803. else {
  10804. console.log('zh:url=', url);
  10805. loader.url = url;
  10806. }
  10807. }
  10808. addTestCoin(num) {
  10809. DataMgr.setCoin(num);
  10810. }
  10811. addTestDiamond(num) {
  10812. DataMgr.setDiamond(num);
  10813. }
  10814. addTestSkill() {
  10815. DataMgr.setBigSkill(0, 99);
  10816. DataMgr.setBigSkill(1, 99);
  10817. DataMgr.setBigSkill(2, 99);
  10818. }
  10819. playClassicEmotion(number, x, y) {
  10820. if (this.gameMode == GameMode.bigMove)
  10821. return;
  10822. let randIndex = this.randomNum(0, 2);
  10823. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10824. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10825. if (this.gameMgr.selfTurn) {
  10826. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10827. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10828. }
  10829. else {
  10830. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10831. }
  10832. else {
  10833. if (number == this.gameMgr.blackNum) {
  10834. if (this.gameMgr.selfBallArr.length == 0) {
  10835. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10836. }
  10837. else {
  10838. }
  10839. }
  10840. else {
  10841. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10842. }
  10843. }
  10844. }
  10845. }
  10846. else {
  10847. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10848. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10849. }
  10850. else {
  10851. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10852. }
  10853. else {
  10854. if (number == this.gameMgr.blackNum) {
  10855. if (this.gameMgr.aiBallArr.length == 0) {
  10856. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10857. }
  10858. else {
  10859. }
  10860. }
  10861. else {
  10862. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10863. }
  10864. }
  10865. }
  10866. }
  10867. }
  10868. playHappySound(number) {
  10869. if (this.gameMode != GameMode.classic)
  10870. return;
  10871. if (number == 8)
  10872. return;
  10873. let play = false;
  10874. if (this.gameMgr.selfTurn) {
  10875. if (this.gameMgr.ensureBallType) {
  10876. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10877. play = true;
  10878. }
  10879. }
  10880. else {
  10881. play = true;
  10882. }
  10883. }
  10884. else {
  10885. if (this.gameMgr.ensureBallType) {
  10886. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10887. play = true;
  10888. }
  10889. }
  10890. else {
  10891. play = true;
  10892. }
  10893. }
  10894. if (play)
  10895. xGame.soundMgr.playSound("applause");
  10896. }
  10897. destroyClassicEmotion() {
  10898. if (this.gameMode == GameMode.bigMove)
  10899. return;
  10900. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10901. parent.destroyChildren();
  10902. }
  10903. playAwardSpine(x, y) {
  10904. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10905. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10906. this.awardSpine.play(data, 0, false, parent);
  10907. }
  10908. destroyAwardSpine() {
  10909. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10910. parent.destroyChildren();
  10911. }
  10912. isBlock(bx, by, hx, hy, except = null) {
  10913. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10914. let balls = xGame.common.d2World.ballArr;
  10915. let outArr = [];
  10916. for (let index = 0; index < balls.length; index++) {
  10917. let obj = balls[index];
  10918. if (obj.number == 0)
  10919. continue;
  10920. if (obj == except)
  10921. continue;
  10922. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10923. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10924. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10925. if (num >= 1)
  10926. num = 1;
  10927. if (num < 0)
  10928. continue;
  10929. let gap = Math.sin(Math.acos(num)) * dis;
  10930. if (gap < this.ballSize) {
  10931. outArr.push({
  10932. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10933. disHon: Math.cos(Math.acos(num)) * dis,
  10934. disVer: Math.sin(Math.acos(num)) * dis,
  10935. src: balls[index],
  10936. dir: this.tempDir1
  10937. });
  10938. }
  10939. }
  10940. if (outArr.length > 0) {
  10941. outArr.sort((a, b) => { return a.dis - b.dis; });
  10942. return outArr[0];
  10943. }
  10944. }
  10945. AngleBetween(vector1, vector2) {
  10946. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10947. return rad * (180 / Math.PI);
  10948. }
  10949. getSecretaryScale() {
  10950. if (this.secretary.spineName == "mishu") {
  10951. return 1.28;
  10952. }
  10953. else {
  10954. return 1.024;
  10955. }
  10956. }
  10957. signAwardContainsRod(arr) {
  10958. let temp;
  10959. for (let index = 0; index < arr.length; index++) {
  10960. temp = arr[index].split('-')[0];
  10961. if (parseInt(temp) > 2) {
  10962. return true;
  10963. }
  10964. }
  10965. }
  10966. judgeSameDay() {
  10967. let lastTime = DataMgr.getSignTime();
  10968. let curTime = new Date().getTime();
  10969. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10970. return true;
  10971. }
  10972. return false;
  10973. }
  10974. getAward(arr, callback) {
  10975. let showTriple = arr[0].type <= 2;
  10976. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10977. let temp;
  10978. for (let index = 0; index < arr.length; index++) {
  10979. temp = arr[index];
  10980. switch (temp.type) {
  10981. case 1:
  10982. this.playObjFlyAnim(temp.num, temp.type);
  10983. break;
  10984. case 2:
  10985. this.playObjFlyAnim(temp.num, temp.type);
  10986. break;
  10987. case 3:
  10988. case 4:
  10989. case 5:
  10990. case 6:
  10991. DataMgr.setBallRod(temp.type - 2, 1);
  10992. DataMgr.setCurBallRod(temp.type - 2);
  10993. break;
  10994. default:
  10995. break;
  10996. }
  10997. }
  10998. callback && callback(watchVideo);
  10999. });
  11000. }
  11001. getMoneyNode() {
  11002. let moneyNode;
  11003. let sign = xGame.uiMgr.getUI(UISign);
  11004. let draw = xGame.uiMgr.getUI(UIDraw);
  11005. let end = xGame.uiMgr.getUI(UIGameEnd);
  11006. let skill = xGame.uiMgr.getUI(UISkill);
  11007. if (sign && !sign.isHide)
  11008. moneyNode = sign.ui.moneyNode;
  11009. if (draw && !draw.isHide)
  11010. moneyNode = draw.ui.moneyNode;
  11011. if (end && !end.isHide)
  11012. moneyNode = end.ui.moneyNode;
  11013. if (skill && !skill.isHide)
  11014. moneyNode = skill.ui.moneyNode;
  11015. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11016. let main = xGame.uiMgr.getUI(UIMain);
  11017. if (condition1 && main && !main.isHide) {
  11018. moneyNode = main.ui.moneyNode;
  11019. }
  11020. return moneyNode;
  11021. }
  11022. playObjFlyAnim(num, type, callback = null) {
  11023. this.stPos.x = Laya.stage.width / 2;
  11024. this.stPos.y = Laya.stage.height / 2;
  11025. let moneyNode = this.getMoneyNode();
  11026. switch (type) {
  11027. case Prop.diamond:
  11028. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11029. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11030. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11031. this.edPos.x /= 2;
  11032. this.edPos.y /= 2;
  11033. break;
  11034. case Prop.coin:
  11035. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11036. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11037. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11038. this.edPos.x /= 2;
  11039. this.edPos.y /= 2;
  11040. break;
  11041. default:
  11042. break;
  11043. }
  11044. xGame.soundMgr.playSound("coinbag");
  11045. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11046. switch (type) {
  11047. case Prop.diamond:
  11048. DataMgr.setDiamond(num);
  11049. break;
  11050. case Prop.coin:
  11051. DataMgr.setCoin(num);
  11052. break;
  11053. default:
  11054. break;
  11055. }
  11056. callback && callback();
  11057. });
  11058. }
  11059. autoPopUIView() {
  11060. let arr = [];
  11061. let sign = this.judgeSameDay() ? false : true;
  11062. if (sign)
  11063. arr.push("sign");
  11064. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11065. if (draw)
  11066. arr.push("draw");
  11067. if (arr.length <= 0)
  11068. return;
  11069. let str = this.getRandArrEle(arr);
  11070. switch (str) {
  11071. case "sign":
  11072. xGame.uiMgr.Show(UISign);
  11073. break;
  11074. case "draw":
  11075. xGame.uiMgr.Show(UIDraw);
  11076. break;
  11077. default:
  11078. break;
  11079. }
  11080. }
  11081. getMSTime(time) {
  11082. let min = Math.floor(time / 60);
  11083. let sec = Math.floor((time - min * 60));
  11084. if (sec < 10)
  11085. sec = "0" + sec;
  11086. if (min < 10)
  11087. min = "0" + min;
  11088. return `${min}:${sec}`;
  11089. }
  11090. testPower() {
  11091. DataMgr.setPower(0, false);
  11092. }
  11093. getAllStarNum() {
  11094. let data = DataMgr.getPlaceBallLevelList();
  11095. let out = 0;
  11096. for (let index = 0; index < data.length; index++) {
  11097. out += data[index].star;
  11098. }
  11099. return out;
  11100. }
  11101. recoverCameraView() {
  11102. Laya.timer.once(900, this, () => {
  11103. xGame.common.showOneCamera("mainCamera");
  11104. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11105. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11106. xGame.common.gameUI.ui.border.alpha = 0;
  11107. if (Laya.physicsTimer.scale < 1) {
  11108. Laya.physicsTimer.scale = 1;
  11109. }
  11110. }
  11111. });
  11112. }
  11113. getClassicLevel() {
  11114. let successTimes = DataMgr.getClassicTimes();
  11115. let needKey = "";
  11116. let lastKey = "";
  11117. let cfg = cfgTable.classictimesData;
  11118. let data;
  11119. for (const key in cfg) {
  11120. data = cfg[key];
  11121. if (successTimes <= data.times) {
  11122. needKey = key;
  11123. }
  11124. lastKey = key;
  11125. }
  11126. if (needKey == "")
  11127. needKey = lastKey;
  11128. return cfg[needKey];
  11129. }
  11130. }
  11131. Common._instance = null;
  11132. class ui_Component92 extends fgui.GComponent {
  11133. static createInstance() {
  11134. return (fgui.UIPackage.createObject("game", "Component92"));
  11135. }
  11136. onConstruct() {
  11137. this.n0 = (this.getChild("n0"));
  11138. }
  11139. }
  11140. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11141. class ui_Component129 extends fgui.GProgressBar {
  11142. static createInstance() {
  11143. return (fgui.UIPackage.createObject("game", "Component129"));
  11144. }
  11145. onConstruct() {
  11146. this.bar_v = (this.getChild("bar_v"));
  11147. this.n84 = (this.getChild("n84"));
  11148. }
  11149. }
  11150. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11151. class ui_Component130 extends fgui.GComponent {
  11152. static createInstance() {
  11153. return (fgui.UIPackage.createObject("game", "Component130"));
  11154. }
  11155. onConstruct() {
  11156. this.ani = (this.getChild("ani"));
  11157. this.t0 = this.getTransition("t0");
  11158. }
  11159. }
  11160. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11161. class ui_powerEft extends fgui.GComponent {
  11162. static createInstance() {
  11163. return (fgui.UIPackage.createObject("game", "powerEft"));
  11164. }
  11165. onConstruct() {
  11166. this.ani = (this.getChild("ani"));
  11167. this.n88 = (this.getChild("n88"));
  11168. this.n89 = (this.getChild("n89"));
  11169. }
  11170. }
  11171. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11172. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11173. static createInstance() {
  11174. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11175. }
  11176. onConstruct() {
  11177. this.c1 = this.getController("c1");
  11178. this.n2 = (this.getChild("n2"));
  11179. this.n22 = (this.getChild("n22"));
  11180. this.n23 = (this.getChild("n23"));
  11181. this.n15 = (this.getChild("n15"));
  11182. this.challenge = (this.getChild("challenge"));
  11183. this.n17 = (this.getChild("n17"));
  11184. this.n3 = (this.getChild("n3"));
  11185. this.starNode = (this.getChild("starNode"));
  11186. this.levelTxt = (this.getChild("levelTxt"));
  11187. this.n14 = (this.getChild("n14"));
  11188. this.n19 = (this.getChild("n19"));
  11189. this.n20 = (this.getChild("n20"));
  11190. this.n21 = (this.getChild("n21"));
  11191. this.special = (this.getChild("special"));
  11192. }
  11193. }
  11194. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11195. class ui_Component79 extends fgui.GComponent {
  11196. static createInstance() {
  11197. return (fgui.UIPackage.createObject("game", "Component79"));
  11198. }
  11199. onConstruct() {
  11200. this.c1 = this.getController("c1");
  11201. this.n7 = (this.getChild("n7"));
  11202. this.n8 = (this.getChild("n8"));
  11203. this.n9 = (this.getChild("n9"));
  11204. this.n10 = (this.getChild("n10"));
  11205. this.n11 = (this.getChild("n11"));
  11206. this.n12 = (this.getChild("n12"));
  11207. }
  11208. }
  11209. ui_Component79.URL = "ui://isxx5ak7avag477";
  11210. class ui_Component80 extends fgui.GComponent {
  11211. static createInstance() {
  11212. return (fgui.UIPackage.createObject("game", "Component80"));
  11213. }
  11214. onConstruct() {
  11215. this.n0 = (this.getChild("n0"));
  11216. this.n1 = (this.getChild("n1"));
  11217. this.myList = (this.getChild("myList"));
  11218. this.t0 = this.getTransition("t0");
  11219. }
  11220. }
  11221. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11222. class ui_SignNormal extends fgui.GComponent {
  11223. static createInstance() {
  11224. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11225. }
  11226. onConstruct() {
  11227. this.c1 = this.getController("c1");
  11228. this.n7 = (this.getChild("n7"));
  11229. this.n15 = (this.getChild("n15"));
  11230. this.titleTxt = (this.getChild("titleTxt"));
  11231. this.n8 = (this.getChild("n8"));
  11232. this.myIcon = (this.getChild("myIcon"));
  11233. this.numTxt = (this.getChild("numTxt"));
  11234. this.n12 = (this.getChild("n12"));
  11235. this.n13 = (this.getChild("n13"));
  11236. this.n17 = (this.getChild("n17"));
  11237. this.n14 = (this.getChild("n14"));
  11238. }
  11239. }
  11240. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11241. class ui_screenNode extends fgui.GComponent {
  11242. static createInstance() {
  11243. return (fgui.UIPackage.createObject("game", "screenNode"));
  11244. }
  11245. onConstruct() {
  11246. this.n9 = (this.getChild("n9"));
  11247. this.screenImg = (this.getChild("screenImg"));
  11248. }
  11249. }
  11250. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11251. class ui_GetAwrad_com1 extends fgui.GComponent {
  11252. static createInstance() {
  11253. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11254. }
  11255. onConstruct() {
  11256. this.n38 = (this.getChild("n38"));
  11257. this.n39 = (this.getChild("n39"));
  11258. this.n40 = (this.getChild("n40"));
  11259. this.t0 = this.getTransition("t0");
  11260. this.t1 = this.getTransition("t1");
  11261. }
  11262. }
  11263. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11264. class ui_GetAwrad_com2 extends fgui.GComponent {
  11265. static createInstance() {
  11266. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11267. }
  11268. onConstruct() {
  11269. this.n39 = (this.getChild("n39"));
  11270. this.n40 = (this.getChild("n40"));
  11271. this.t0 = this.getTransition("t0");
  11272. }
  11273. }
  11274. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11275. class ui_Component128 extends fgui.GComponent {
  11276. static createInstance() {
  11277. return (fgui.UIPackage.createObject("game", "Component128"));
  11278. }
  11279. onConstruct() {
  11280. this.n38 = (this.getChild("n38"));
  11281. this.n40 = (this.getChild("n40"));
  11282. }
  11283. }
  11284. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11285. class ui_Component100_1 extends fgui.GComponent {
  11286. static createInstance() {
  11287. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11288. }
  11289. onConstruct() {
  11290. this.myNode = (this.getChild("myNode"));
  11291. this.t0 = this.getTransition("t0");
  11292. }
  11293. }
  11294. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11295. class ui_Component142 extends fgui.GComponent {
  11296. static createInstance() {
  11297. return (fgui.UIPackage.createObject("game", "Component142"));
  11298. }
  11299. onConstruct() {
  11300. this.n41 = (this.getChild("n41"));
  11301. this.n42 = (this.getChild("n42"));
  11302. }
  11303. }
  11304. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11305. class ui_main_guang extends fgui.GComponent {
  11306. static createInstance() {
  11307. return (fgui.UIPackage.createObject("game", "main_guang"));
  11308. }
  11309. onConstruct() {
  11310. this.n1 = (this.getChild("n1"));
  11311. this.n2 = (this.getChild("n2"));
  11312. this.n3 = (this.getChild("n3"));
  11313. this.n4 = (this.getChild("n4"));
  11314. this.n5 = (this.getChild("n5"));
  11315. this.n6 = (this.getChild("n6"));
  11316. this.n8 = (this.getChild("n8"));
  11317. this.t0 = this.getTransition("t0");
  11318. }
  11319. }
  11320. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11321. class ui_try_com1 extends fgui.GComponent {
  11322. static createInstance() {
  11323. return (fgui.UIPackage.createObject("game", "try_com1"));
  11324. }
  11325. onConstruct() {
  11326. this.c1 = this.getController("c1");
  11327. this.n0 = (this.getChild("n0"));
  11328. this.n2 = (this.getChild("n2"));
  11329. this.cancelBtn = (this.getChild("cancelBtn"));
  11330. this.videoBtn = (this.getChild("videoBtn"));
  11331. this.n9 = (this.getChild("n9"));
  11332. this.n24 = (this.getChild("n24"));
  11333. this.titleTxt = (this.getChild("titleTxt"));
  11334. this.n32 = (this.getChild("n32"));
  11335. this.n29 = (this.getChild("n29"));
  11336. this.n36 = (this.getChild("n36"));
  11337. this.txtTime = (this.getChild("txtTime"));
  11338. this.t0 = this.getTransition("t0");
  11339. }
  11340. }
  11341. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11342. class ui_try_com2 extends fgui.GComponent {
  11343. static createInstance() {
  11344. return (fgui.UIPackage.createObject("game", "try_com2"));
  11345. }
  11346. onConstruct() {
  11347. this.skillicon = (this.getChild("skillicon"));
  11348. this.n35 = (this.getChild("n35"));
  11349. this.n31 = (this.getChild("n31"));
  11350. this.n32 = (this.getChild("n32"));
  11351. this.n33 = (this.getChild("n33"));
  11352. this.n34 = (this.getChild("n34"));
  11353. }
  11354. }
  11355. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11356. class ui_try_com3 extends fgui.GComponent {
  11357. static createInstance() {
  11358. return (fgui.UIPackage.createObject("game", "try_com3"));
  11359. }
  11360. onConstruct() {
  11361. this.n33 = (this.getChild("n33"));
  11362. this.n34 = (this.getChild("n34"));
  11363. this.n35 = (this.getChild("n35"));
  11364. this.t0 = this.getTransition("t0");
  11365. }
  11366. }
  11367. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11368. class ui_huihe1 extends fgui.GComponent {
  11369. static createInstance() {
  11370. return (fgui.UIPackage.createObject("game", "huihe1"));
  11371. }
  11372. onConstruct() {
  11373. this.n0 = (this.getChild("n0"));
  11374. this.n1 = (this.getChild("n1"));
  11375. this.t0 = this.getTransition("t0");
  11376. }
  11377. }
  11378. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11379. class ui_huihe2 extends fgui.GComponent {
  11380. static createInstance() {
  11381. return (fgui.UIPackage.createObject("game", "huihe2"));
  11382. }
  11383. onConstruct() {
  11384. this.n0 = (this.getChild("n0"));
  11385. this.n1 = (this.getChild("n1"));
  11386. this.t0 = this.getTransition("t0");
  11387. }
  11388. }
  11389. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11390. class ui_Component143 extends fgui.GComponent {
  11391. static createInstance() {
  11392. return (fgui.UIPackage.createObject("game", "Component143"));
  11393. }
  11394. onConstruct() {
  11395. this.n3 = (this.getChild("n3"));
  11396. this.n4 = (this.getChild("n4"));
  11397. this.n5 = (this.getChild("n5"));
  11398. this.n6 = (this.getChild("n6"));
  11399. this.n7 = (this.getChild("n7"));
  11400. this.n8 = (this.getChild("n8"));
  11401. this.n9 = (this.getChild("n9"));
  11402. this.n10 = (this.getChild("n10"));
  11403. this.t0 = this.getTransition("t0");
  11404. }
  11405. }
  11406. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11407. class ui_dh_jingbi2 extends fgui.GComponent {
  11408. static createInstance() {
  11409. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11410. }
  11411. onConstruct() {
  11412. this.n0 = (this.getChild("n0"));
  11413. this.n1 = (this.getChild("n1"));
  11414. this.n2 = (this.getChild("n2"));
  11415. this.n3 = (this.getChild("n3"));
  11416. this.n4 = (this.getChild("n4"));
  11417. this.n5 = (this.getChild("n5"));
  11418. this.n6 = (this.getChild("n6"));
  11419. this.n8 = (this.getChild("n8"));
  11420. this.n10 = (this.getChild("n10"));
  11421. this.t0 = this.getTransition("t0");
  11422. }
  11423. }
  11424. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11425. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11426. static createInstance() {
  11427. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11428. }
  11429. onConstruct() {
  11430. this.n1 = (this.getChild("n1"));
  11431. this.n4 = (this.getChild("n4"));
  11432. this.t0 = this.getTransition("t0");
  11433. }
  11434. }
  11435. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11436. class ui_dh_jingbi3 extends fgui.GComponent {
  11437. static createInstance() {
  11438. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11439. }
  11440. onConstruct() {
  11441. this.n0 = (this.getChild("n0"));
  11442. this.n1 = (this.getChild("n1"));
  11443. this.n2 = (this.getChild("n2"));
  11444. this.n3 = (this.getChild("n3"));
  11445. this.n4 = (this.getChild("n4"));
  11446. this.n5 = (this.getChild("n5"));
  11447. this.n6 = (this.getChild("n6"));
  11448. this.n8 = (this.getChild("n8"));
  11449. this.n10 = (this.getChild("n10"));
  11450. this.t0 = this.getTransition("t0");
  11451. }
  11452. }
  11453. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11454. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11455. static createInstance() {
  11456. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11457. }
  11458. onConstruct() {
  11459. this.n3 = (this.getChild("n3"));
  11460. this.n1 = (this.getChild("n1"));
  11461. this.t0 = this.getTransition("t0");
  11462. }
  11463. }
  11464. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11465. class ui_hb_jinbi1 extends fgui.GButton {
  11466. static createInstance() {
  11467. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11468. }
  11469. onConstruct() {
  11470. this.n20 = (this.getChild("n20"));
  11471. this.n25 = (this.getChild("n25"));
  11472. this.coinTxt = (this.getChild("coinTxt"));
  11473. this.n28 = (this.getChild("n28"));
  11474. this.n32 = (this.getChild("n32"));
  11475. this.n38 = (this.getChild("n38"));
  11476. this.n45 = (this.getChild("n45"));
  11477. this.getTips = (this.getChild("getTips"));
  11478. this.n39 = (this.getChild("n39"));
  11479. this.diamondTxt = (this.getChild("diamondTxt"));
  11480. this.n41 = (this.getChild("n41"));
  11481. this.n42 = (this.getChild("n42"));
  11482. this.n46 = (this.getChild("n46"));
  11483. this.n47 = (this.getChild("n47"));
  11484. this.n48 = (this.getChild("n48"));
  11485. this.t0 = this.getTransition("t0");
  11486. }
  11487. }
  11488. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11489. class ui_hb_jinbi2 extends fgui.GButton {
  11490. static createInstance() {
  11491. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11492. }
  11493. onConstruct() {
  11494. this.n20 = (this.getChild("n20"));
  11495. this.n25 = (this.getChild("n25"));
  11496. this.coinTxt = (this.getChild("coinTxt"));
  11497. this.n28 = (this.getChild("n28"));
  11498. this.n32 = (this.getChild("n32"));
  11499. this.n38 = (this.getChild("n38"));
  11500. this.n39 = (this.getChild("n39"));
  11501. this.diamondTxt = (this.getChild("diamondTxt"));
  11502. this.n41 = (this.getChild("n41"));
  11503. this.n42 = (this.getChild("n42"));
  11504. this.n43 = (this.getChild("n43"));
  11505. this.n44 = (this.getChild("n44"));
  11506. this.n45 = (this.getChild("n45"));
  11507. this.t0 = this.getTransition("t0");
  11508. }
  11509. }
  11510. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11511. class ui_hb_jinbi3 extends fgui.GButton {
  11512. static createInstance() {
  11513. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11514. }
  11515. onConstruct() {
  11516. this.n20 = (this.getChild("n20"));
  11517. this.n25 = (this.getChild("n25"));
  11518. this.coinTxt = (this.getChild("coinTxt"));
  11519. this.n28 = (this.getChild("n28"));
  11520. this.n32 = (this.getChild("n32"));
  11521. this.n38 = (this.getChild("n38"));
  11522. this.n39 = (this.getChild("n39"));
  11523. this.diamondTxt = (this.getChild("diamondTxt"));
  11524. this.n41 = (this.getChild("n41"));
  11525. this.n42 = (this.getChild("n42"));
  11526. this.n43 = (this.getChild("n43"));
  11527. this.n44 = (this.getChild("n44"));
  11528. this.n45 = (this.getChild("n45"));
  11529. this.t0 = this.getTransition("t0");
  11530. }
  11531. }
  11532. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11533. class ui_Component104 extends fgui.GComponent {
  11534. static createInstance() {
  11535. return (fgui.UIPackage.createObject("game", "Component104"));
  11536. }
  11537. onConstruct() {
  11538. this.c1 = this.getController("c1");
  11539. this.n12 = (this.getChild("n12"));
  11540. this.coinBtn = (this.getChild("coinBtn"));
  11541. this.diamondBtn = (this.getChild("diamondBtn"));
  11542. this.node3 = (this.getChild("node3"));
  11543. this.node4 = (this.getChild("node4"));
  11544. this.node5 = (this.getChild("node5"));
  11545. this.node1 = (this.getChild("node1"));
  11546. this.node2 = (this.getChild("node2"));
  11547. this.node6 = (this.getChild("node6"));
  11548. this.t0 = this.getTransition("t0");
  11549. }
  11550. }
  11551. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11552. class ui_Component105 extends fgui.GButton {
  11553. static createInstance() {
  11554. return (fgui.UIPackage.createObject("game", "Component105"));
  11555. }
  11556. onConstruct() {
  11557. this.c1 = this.getController("c1");
  11558. this.n49 = (this.getChild("n49"));
  11559. this.n18 = (this.getChild("n18"));
  11560. this.n46 = (this.getChild("n46"));
  11561. this.n48 = (this.getChild("n48"));
  11562. }
  11563. }
  11564. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11565. class ui_Component106 extends fgui.GButton {
  11566. static createInstance() {
  11567. return (fgui.UIPackage.createObject("game", "Component106"));
  11568. }
  11569. onConstruct() {
  11570. this.c1 = this.getController("c1");
  11571. this.n49 = (this.getChild("n49"));
  11572. this.n18 = (this.getChild("n18"));
  11573. this.n46 = (this.getChild("n46"));
  11574. this.n48 = (this.getChild("n48"));
  11575. }
  11576. }
  11577. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11578. class ui_hb_zs1 extends fgui.GButton {
  11579. static createInstance() {
  11580. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11581. }
  11582. onConstruct() {
  11583. this.c1 = this.getController("c1");
  11584. this.n20 = (this.getChild("n20"));
  11585. this.n21 = (this.getChild("n21"));
  11586. this.n26 = (this.getChild("n26"));
  11587. this.n27 = (this.getChild("n27"));
  11588. this.shareTxt = (this.getChild("shareTxt"));
  11589. this.n32 = (this.getChild("n32"));
  11590. this.n38 = (this.getChild("n38"));
  11591. this.n39 = (this.getChild("n39"));
  11592. this.n44 = (this.getChild("n44"));
  11593. this.diamondTxt = (this.getChild("diamondTxt"));
  11594. this.n41 = (this.getChild("n41"));
  11595. this.n45 = (this.getChild("n45"));
  11596. this.n47 = (this.getChild("n47"));
  11597. this.n48 = (this.getChild("n48"));
  11598. this.randTxt = (this.getChild("randTxt"));
  11599. this.n50 = (this.getChild("n50"));
  11600. this.t0 = this.getTransition("t0");
  11601. }
  11602. }
  11603. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11604. class ui_dh_zs1 extends fgui.GComponent {
  11605. static createInstance() {
  11606. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11607. }
  11608. onConstruct() {
  11609. this.n10 = (this.getChild("n10"));
  11610. this.n9 = (this.getChild("n9"));
  11611. this.n1 = (this.getChild("n1"));
  11612. this.n2 = (this.getChild("n2"));
  11613. this.n3 = (this.getChild("n3"));
  11614. this.n4 = (this.getChild("n4"));
  11615. this.n5 = (this.getChild("n5"));
  11616. this.n6 = (this.getChild("n6"));
  11617. this.n8 = (this.getChild("n8"));
  11618. this.n11 = (this.getChild("n11"));
  11619. this.t0 = this.getTransition("t0");
  11620. }
  11621. }
  11622. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11623. class ui_dh_zs1_1 extends fgui.GComponent {
  11624. static createInstance() {
  11625. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11626. }
  11627. onConstruct() {
  11628. this.n3 = (this.getChild("n3"));
  11629. this.n1 = (this.getChild("n1"));
  11630. this.t0 = this.getTransition("t0");
  11631. }
  11632. }
  11633. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11634. class ui_hb_zs2 extends fgui.GButton {
  11635. static createInstance() {
  11636. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11637. }
  11638. onConstruct() {
  11639. this.n20 = (this.getChild("n20"));
  11640. this.n21 = (this.getChild("n21"));
  11641. this.n26 = (this.getChild("n26"));
  11642. this.n27 = (this.getChild("n27"));
  11643. this.n32 = (this.getChild("n32"));
  11644. this.n38 = (this.getChild("n38"));
  11645. this.n39 = (this.getChild("n39"));
  11646. this.n44 = (this.getChild("n44"));
  11647. this.diamondTxt = (this.getChild("diamondTxt"));
  11648. this.n41 = (this.getChild("n41"));
  11649. this.n45 = (this.getChild("n45"));
  11650. this.t0 = this.getTransition("t0");
  11651. }
  11652. }
  11653. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11654. class ui_hb_zs3 extends fgui.GButton {
  11655. static createInstance() {
  11656. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11657. }
  11658. onConstruct() {
  11659. this.n20 = (this.getChild("n20"));
  11660. this.n21 = (this.getChild("n21"));
  11661. this.n26 = (this.getChild("n26"));
  11662. this.n27 = (this.getChild("n27"));
  11663. this.n32 = (this.getChild("n32"));
  11664. this.n38 = (this.getChild("n38"));
  11665. this.n47 = (this.getChild("n47"));
  11666. this.t0 = this.getTransition("t0");
  11667. }
  11668. }
  11669. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11670. class ui_dh_zs2 extends fgui.GComponent {
  11671. static createInstance() {
  11672. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11673. }
  11674. onConstruct() {
  11675. this.n10 = (this.getChild("n10"));
  11676. this.n9 = (this.getChild("n9"));
  11677. this.n1 = (this.getChild("n1"));
  11678. this.n2 = (this.getChild("n2"));
  11679. this.n3 = (this.getChild("n3"));
  11680. this.n4 = (this.getChild("n4"));
  11681. this.n5 = (this.getChild("n5"));
  11682. this.n6 = (this.getChild("n6"));
  11683. this.n8 = (this.getChild("n8"));
  11684. this.n11 = (this.getChild("n11"));
  11685. this.t0 = this.getTransition("t0");
  11686. }
  11687. }
  11688. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11689. class ui_dh_zs2_1 extends fgui.GComponent {
  11690. static createInstance() {
  11691. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11692. }
  11693. onConstruct() {
  11694. this.n3 = (this.getChild("n3"));
  11695. this.n1 = (this.getChild("n1"));
  11696. this.t0 = this.getTransition("t0");
  11697. }
  11698. }
  11699. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11700. class ui_dh_zs3 extends fgui.GComponent {
  11701. static createInstance() {
  11702. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11703. }
  11704. onConstruct() {
  11705. this.n10 = (this.getChild("n10"));
  11706. this.n9 = (this.getChild("n9"));
  11707. this.n1 = (this.getChild("n1"));
  11708. this.n2 = (this.getChild("n2"));
  11709. this.n3 = (this.getChild("n3"));
  11710. this.n4 = (this.getChild("n4"));
  11711. this.n5 = (this.getChild("n5"));
  11712. this.n6 = (this.getChild("n6"));
  11713. this.n8 = (this.getChild("n8"));
  11714. this.n11 = (this.getChild("n11"));
  11715. this.t0 = this.getTransition("t0");
  11716. }
  11717. }
  11718. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11719. class ui_dh_zs3_1 extends fgui.GComponent {
  11720. static createInstance() {
  11721. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11722. }
  11723. onConstruct() {
  11724. this.n3 = (this.getChild("n3"));
  11725. this.n1 = (this.getChild("n1"));
  11726. this.t0 = this.getTransition("t0");
  11727. }
  11728. }
  11729. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11730. class ui_Component107 extends fgui.GComponent {
  11731. static createInstance() {
  11732. return (fgui.UIPackage.createObject("game", "Component107"));
  11733. }
  11734. onConstruct() {
  11735. this.n18 = (this.getChild("n18"));
  11736. this.n19 = (this.getChild("n19"));
  11737. this.n20 = (this.getChild("n20"));
  11738. this.n21 = (this.getChild("n21"));
  11739. this.n22 = (this.getChild("n22"));
  11740. this.levelTxt = (this.getChild("levelTxt"));
  11741. this.t0 = this.getTransition("t0");
  11742. }
  11743. }
  11744. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11745. class ui_box_com1 extends fgui.GComponent {
  11746. static createInstance() {
  11747. return (fgui.UIPackage.createObject("game", "box_com1"));
  11748. }
  11749. onConstruct() {
  11750. this.n14 = (this.getChild("n14"));
  11751. this.n6 = (this.getChild("n6"));
  11752. this.t0 = this.getTransition("t0");
  11753. }
  11754. }
  11755. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11756. class ui_box_com2 extends fgui.GProgressBar {
  11757. static createInstance() {
  11758. return (fgui.UIPackage.createObject("game", "box_com2"));
  11759. }
  11760. onConstruct() {
  11761. this.bg0 = (this.getChild("bg0"));
  11762. this.bg = (this.getChild("bg"));
  11763. this.bar = (this.getChild("bar"));
  11764. this.n7 = (this.getChild("n7"));
  11765. this.n8 = (this.getChild("n8"));
  11766. this.n10 = (this.getChild("n10"));
  11767. this.n11 = (this.getChild("n11"));
  11768. this.n12 = (this.getChild("n12"));
  11769. }
  11770. }
  11771. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11772. class ui_box_com4 extends fgui.GComponent {
  11773. static createInstance() {
  11774. return (fgui.UIPackage.createObject("game", "box_com4"));
  11775. }
  11776. onConstruct() {
  11777. this.n8 = (this.getChild("n8"));
  11778. this.t0 = this.getTransition("t0");
  11779. }
  11780. }
  11781. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11782. class ui_box_com3 extends fgui.GComponent {
  11783. static createInstance() {
  11784. return (fgui.UIPackage.createObject("game", "box_com3"));
  11785. }
  11786. onConstruct() {
  11787. this.n2 = (this.getChild("n2"));
  11788. this.n3 = (this.getChild("n3"));
  11789. this.n4 = (this.getChild("n4"));
  11790. this.n5 = (this.getChild("n5"));
  11791. this.t0 = this.getTransition("t0");
  11792. this.t1 = this.getTransition("t1");
  11793. }
  11794. }
  11795. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11796. class ui_Component97 extends fgui.GComponent {
  11797. static createInstance() {
  11798. return (fgui.UIPackage.createObject("game", "Component97"));
  11799. }
  11800. onConstruct() {
  11801. this.c1 = this.getController("c1");
  11802. this.n46 = (this.getChild("n46"));
  11803. this.diamondNode = (this.getChild("diamondNode"));
  11804. this.coinNode = (this.getChild("coinNode"));
  11805. this.t0 = this.getTransition("t0");
  11806. }
  11807. }
  11808. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11809. class ui_Component98 extends fgui.GButton {
  11810. static createInstance() {
  11811. return (fgui.UIPackage.createObject("game", "Component98"));
  11812. }
  11813. onConstruct() {
  11814. this.n8 = (this.getChild("n8"));
  11815. this.n40 = (this.getChild("n40"));
  11816. }
  11817. }
  11818. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11819. class ui_Component28_11 extends fgui.GButton {
  11820. static createInstance() {
  11821. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11822. }
  11823. onConstruct() {
  11824. this.c1 = this.getController("c1");
  11825. this.n12 = (this.getChild("n12"));
  11826. this.n17 = (this.getChild("n17"));
  11827. this.n13 = (this.getChild("n13"));
  11828. this.diamondTxt = (this.getChild("diamondTxt"));
  11829. this.n15 = (this.getChild("n15"));
  11830. this.n16 = (this.getChild("n16"));
  11831. }
  11832. }
  11833. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11834. class ui_Component58_11 extends fgui.GComponent {
  11835. static createInstance() {
  11836. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11837. }
  11838. onConstruct() {
  11839. this.n23 = (this.getChild("n23"));
  11840. this.n41 = (this.getChild("n41"));
  11841. this.myList = (this.getChild("myList"));
  11842. this.n45 = (this.getChild("n45"));
  11843. this.n44 = (this.getChild("n44"));
  11844. this.t0 = this.getTransition("t0");
  11845. }
  11846. }
  11847. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11848. class ui_Component100 extends fgui.GComponent {
  11849. static createInstance() {
  11850. return (fgui.UIPackage.createObject("game", "Component100"));
  11851. }
  11852. onConstruct() {
  11853. this.c1 = this.getController("c1");
  11854. this.n75 = (this.getChild("n75"));
  11855. this.n76 = (this.getChild("n76"));
  11856. this.n80 = (this.getChild("n80"));
  11857. this.txt = (this.getChild("txt"));
  11858. this.spineRoot = (this.getChild("spineRoot"));
  11859. }
  11860. }
  11861. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11862. class ui_Component101 extends fgui.GComponent {
  11863. static createInstance() {
  11864. return (fgui.UIPackage.createObject("game", "Component101"));
  11865. }
  11866. onConstruct() {
  11867. this.c1 = this.getController("c1");
  11868. this.n36 = (this.getChild("n36"));
  11869. this.n35 = (this.getChild("n35"));
  11870. this.n33 = (this.getChild("n33"));
  11871. this.n34 = (this.getChild("n34"));
  11872. }
  11873. }
  11874. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11875. class ui_Component53 extends fgui.GComponent {
  11876. static createInstance() {
  11877. return (fgui.UIPackage.createObject("game", "Component53"));
  11878. }
  11879. onConstruct() {
  11880. this.n0 = (this.getChild("n0"));
  11881. this.n1 = (this.getChild("n1"));
  11882. this.n2 = (this.getChild("n2"));
  11883. this.n3 = (this.getChild("n3"));
  11884. this.n4 = (this.getChild("n4"));
  11885. this.n5 = (this.getChild("n5"));
  11886. this.n6 = (this.getChild("n6"));
  11887. this.n7 = (this.getChild("n7"));
  11888. this.n8 = (this.getChild("n8"));
  11889. this.n9 = (this.getChild("n9"));
  11890. this.n10 = (this.getChild("n10"));
  11891. this.n11 = (this.getChild("n11"));
  11892. this.n12 = (this.getChild("n12"));
  11893. this.n13 = (this.getChild("n13"));
  11894. this.n14 = (this.getChild("n14"));
  11895. this.n15 = (this.getChild("n15"));
  11896. this.n16 = (this.getChild("n16"));
  11897. this.n19 = (this.getChild("n19"));
  11898. this.n20 = (this.getChild("n20"));
  11899. this.n21 = (this.getChild("n21"));
  11900. this.n22 = (this.getChild("n22"));
  11901. this.n23 = (this.getChild("n23"));
  11902. this.n24 = (this.getChild("n24"));
  11903. this.n25 = (this.getChild("n25"));
  11904. this.n26 = (this.getChild("n26"));
  11905. this.n27 = (this.getChild("n27"));
  11906. this.n28 = (this.getChild("n28"));
  11907. this.n29 = (this.getChild("n29"));
  11908. this.n30 = (this.getChild("n30"));
  11909. this.n31 = (this.getChild("n31"));
  11910. this.n32 = (this.getChild("n32"));
  11911. this.n33 = (this.getChild("n33"));
  11912. this.n34 = (this.getChild("n34"));
  11913. this.n35 = (this.getChild("n35"));
  11914. this.t0 = this.getTransition("t0");
  11915. }
  11916. }
  11917. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11918. class ui_Component58 extends fgui.GComponent {
  11919. static createInstance() {
  11920. return (fgui.UIPackage.createObject("game", "Component58"));
  11921. }
  11922. onConstruct() {
  11923. this.n23 = (this.getChild("n23"));
  11924. this.n41 = (this.getChild("n41"));
  11925. this.n8 = (this.getChild("n8"));
  11926. this.skillList = (this.getChild("skillList"));
  11927. this.t0 = this.getTransition("t0");
  11928. }
  11929. }
  11930. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11931. class ui_Component59 extends fgui.GComponent {
  11932. static createInstance() {
  11933. return (fgui.UIPackage.createObject("game", "Component59"));
  11934. }
  11935. onConstruct() {
  11936. this.n3 = (this.getChild("n3"));
  11937. this.msgTxt = (this.getChild("msgTxt"));
  11938. this.t0 = this.getTransition("t0");
  11939. }
  11940. }
  11941. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11942. class ui_RulerNode extends fgui.GComponent {
  11943. static createInstance() {
  11944. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11945. }
  11946. onConstruct() {
  11947. this.n6 = (this.getChild("n6"));
  11948. this.n4 = (this.getChild("n4"));
  11949. this.img1 = (this.getChild("img1"));
  11950. this.img2 = (this.getChild("img2"));
  11951. }
  11952. }
  11953. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11954. class ui_Component108 extends fgui.GComponent {
  11955. static createInstance() {
  11956. return (fgui.UIPackage.createObject("game", "Component108"));
  11957. }
  11958. onConstruct() {
  11959. this.n19 = (this.getChild("n19"));
  11960. this.t0 = this.getTransition("t0");
  11961. }
  11962. }
  11963. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11964. class ui_Component63 extends fgui.GComponent {
  11965. static createInstance() {
  11966. return (fgui.UIPackage.createObject("game", "Component63"));
  11967. }
  11968. onConstruct() {
  11969. this.n66 = (this.getChild("n66"));
  11970. this.n56 = (this.getChild("n56"));
  11971. this.n63 = (this.getChild("n63"));
  11972. this.n65 = (this.getChild("n65"));
  11973. this.t0 = this.getTransition("t0");
  11974. }
  11975. }
  11976. ui_Component63.URL = "ui://isxx5ak7h657452";
  11977. class ui_topNode extends fgui.GComponent {
  11978. static createInstance() {
  11979. return (fgui.UIPackage.createObject("game", "topNode"));
  11980. }
  11981. onConstruct() {
  11982. this.selfProgress = (this.getChild("selfProgress"));
  11983. this.aiProgress = (this.getChild("aiProgress"));
  11984. this.selfKuang = (this.getChild("selfKuang"));
  11985. this.aiKuang = (this.getChild("aiKuang"));
  11986. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  11987. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  11988. this.n33 = (this.getChild("n33"));
  11989. this.n34 = (this.getChild("n34"));
  11990. this.selfNameTxt = (this.getChild("selfNameTxt"));
  11991. this.aiNameTxt = (this.getChild("aiNameTxt"));
  11992. this.selfBallList = (this.getChild("selfBallList"));
  11993. this.aiBallList = (this.getChild("aiBallList"));
  11994. this.middleNode = (this.getChild("middleNode"));
  11995. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  11996. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  11997. this.scoreNode = (this.getChild("scoreNode"));
  11998. this.selfTips = (this.getChild("selfTips"));
  11999. this.aiTips = (this.getChild("aiTips"));
  12000. }
  12001. }
  12002. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12003. class ui_selfProgress extends fgui.GProgressBar {
  12004. static createInstance() {
  12005. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12006. }
  12007. onConstruct() {
  12008. this.n3 = (this.getChild("n3"));
  12009. this.bar = (this.getChild("bar"));
  12010. }
  12011. }
  12012. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12013. class ui_aiProgress extends fgui.GProgressBar {
  12014. static createInstance() {
  12015. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12016. }
  12017. onConstruct() {
  12018. this.n3 = (this.getChild("n3"));
  12019. this.bar = (this.getChild("bar"));
  12020. }
  12021. }
  12022. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12023. class ui_ballDisplay extends fgui.GComponent {
  12024. static createInstance() {
  12025. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12026. }
  12027. onConstruct() {
  12028. this.myImg = (this.getChild("myImg"));
  12029. }
  12030. }
  12031. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12032. class ui_moveNode extends fgui.GComponent {
  12033. static createInstance() {
  12034. return (fgui.UIPackage.createObject("game", "moveNode"));
  12035. }
  12036. onConstruct() {
  12037. this.n8 = (this.getChild("n8"));
  12038. this.finger = (this.getChild("finger"));
  12039. }
  12040. }
  12041. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12042. class ui_cancelBtn extends fgui.GButton {
  12043. static createInstance() {
  12044. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12045. }
  12046. onConstruct() {
  12047. this.c1 = this.getController("c1");
  12048. this.n0 = (this.getChild("n0"));
  12049. this.n1 = (this.getChild("n1"));
  12050. }
  12051. }
  12052. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12053. class ui_shareBtn extends fgui.GButton {
  12054. static createInstance() {
  12055. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12056. }
  12057. onConstruct() {
  12058. this.c1 = this.getController("c1");
  12059. this.n2 = (this.getChild("n2"));
  12060. this.n1 = (this.getChild("n1"));
  12061. this.n3 = (this.getChild("n3"));
  12062. this.n4 = (this.getChild("n4"));
  12063. this.n5 = (this.getChild("n5"));
  12064. this.n6 = (this.getChild("n6"));
  12065. }
  12066. }
  12067. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12068. class ui_share2Btn extends fgui.GButton {
  12069. static createInstance() {
  12070. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12071. }
  12072. onConstruct() {
  12073. this.n3 = (this.getChild("n3"));
  12074. }
  12075. }
  12076. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12077. class ui_rodMethodNode extends fgui.GComponent {
  12078. static createInstance() {
  12079. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12080. }
  12081. onConstruct() {
  12082. this.bg = (this.getChild("bg"));
  12083. this.dot = (this.getChild("dot"));
  12084. }
  12085. }
  12086. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12087. class ui_sureBtn extends fgui.GButton {
  12088. static createInstance() {
  12089. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12090. }
  12091. onConstruct() {
  12092. this.n2 = (this.getChild("n2"));
  12093. this.n1 = (this.getChild("n1"));
  12094. }
  12095. }
  12096. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12097. class ui_Component18 extends fgui.GComponent {
  12098. static createInstance() {
  12099. return (fgui.UIPackage.createObject("game", "Component18"));
  12100. }
  12101. onConstruct() {
  12102. this.c1 = this.getController("c1");
  12103. this.nameTxt = (this.getChild("nameTxt"));
  12104. this.headImg = (this.getChild("headImg"));
  12105. this.n24 = (this.getChild("n24"));
  12106. this.skillImg = (this.getChild("skillImg"));
  12107. this.skillTxt = (this.getChild("skillTxt"));
  12108. }
  12109. }
  12110. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12111. class ui_Component45 extends fgui.GComponent {
  12112. static createInstance() {
  12113. return (fgui.UIPackage.createObject("game", "Component45"));
  12114. }
  12115. onConstruct() {
  12116. this.c1 = this.getController("c1");
  12117. this.n40 = (this.getChild("n40"));
  12118. this.n41 = (this.getChild("n41"));
  12119. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12120. this.n42 = (this.getChild("n42"));
  12121. this.awardTxt = (this.getChild("awardTxt"));
  12122. this.n44 = (this.getChild("n44"));
  12123. this.t0 = this.getTransition("t0");
  12124. }
  12125. }
  12126. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12127. class ui_emotionDisplay extends fgui.GButton {
  12128. static createInstance() {
  12129. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12130. }
  12131. onConstruct() {
  12132. this.myIcon = (this.getChild("myIcon"));
  12133. }
  12134. }
  12135. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12136. class ui_Component49 extends fgui.GButton {
  12137. static createInstance() {
  12138. return (fgui.UIPackage.createObject("game", "Component49"));
  12139. }
  12140. onConstruct() {
  12141. this.n69 = (this.getChild("n69"));
  12142. this.n56 = (this.getChild("n56"));
  12143. }
  12144. }
  12145. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12146. class ui_Component50 extends fgui.GButton {
  12147. static createInstance() {
  12148. return (fgui.UIPackage.createObject("game", "Component50"));
  12149. }
  12150. onConstruct() {
  12151. this.n54 = (this.getChild("n54"));
  12152. this.n65 = (this.getChild("n65"));
  12153. }
  12154. }
  12155. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12156. class ui_Component51 extends fgui.GButton {
  12157. static createInstance() {
  12158. return (fgui.UIPackage.createObject("game", "Component51"));
  12159. }
  12160. onConstruct() {
  12161. this.c1 = this.getController("c1");
  12162. this.n51 = (this.getChild("n51"));
  12163. this.n54 = (this.getChild("n54"));
  12164. }
  12165. }
  12166. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12167. class ui_Button5 extends fgui.GButton {
  12168. static createInstance() {
  12169. return (fgui.UIPackage.createObject("game", "Button5"));
  12170. }
  12171. onConstruct() {
  12172. this.c1 = this.getController("c1");
  12173. this.n0 = (this.getChild("n0"));
  12174. this.n2 = (this.getChild("n2"));
  12175. }
  12176. }
  12177. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12178. class ui_Component124 extends fgui.GComponent {
  12179. static createInstance() {
  12180. return (fgui.UIPackage.createObject("game", "Component124"));
  12181. }
  12182. onConstruct() {
  12183. this.n22 = (this.getChild("n22"));
  12184. this.shareNode = (this.getChild("shareNode"));
  12185. }
  12186. }
  12187. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12188. class ui_Component125 extends fgui.GComponent {
  12189. static createInstance() {
  12190. return (fgui.UIPackage.createObject("game", "Component125"));
  12191. }
  12192. onConstruct() {
  12193. this.n29 = (this.getChild("n29"));
  12194. this.coinTxt = (this.getChild("coinTxt"));
  12195. }
  12196. }
  12197. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12198. class ui_Component52 extends fgui.GButton {
  12199. static createInstance() {
  12200. return (fgui.UIPackage.createObject("game", "Component52"));
  12201. }
  12202. onConstruct() {
  12203. this.n35 = (this.getChild("n35"));
  12204. this.n36 = (this.getChild("n36"));
  12205. }
  12206. }
  12207. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12208. class ui_drawBtn extends fgui.GButton {
  12209. static createInstance() {
  12210. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12211. }
  12212. onConstruct() {
  12213. this.c1 = this.getController("c1");
  12214. this.n2 = (this.getChild("n2"));
  12215. this.n1 = (this.getChild("n1"));
  12216. }
  12217. }
  12218. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12219. class ui_Component43 extends fgui.GButton {
  12220. static createInstance() {
  12221. return (fgui.UIPackage.createObject("game", "Component43"));
  12222. }
  12223. onConstruct() {
  12224. this.n49 = (this.getChild("n49"));
  12225. }
  12226. }
  12227. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12228. class ui_wordsDisplay extends fgui.GComponent {
  12229. static createInstance() {
  12230. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12231. }
  12232. onConstruct() {
  12233. this.txt = (this.getChild("txt"));
  12234. this.n63 = (this.getChild("n63"));
  12235. }
  12236. }
  12237. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12238. class ui_Component3 extends fgui.GComponent {
  12239. static createInstance() {
  12240. return (fgui.UIPackage.createObject("game", "Component3"));
  12241. }
  12242. onConstruct() {
  12243. this.n26 = (this.getChild("n26"));
  12244. this.n24 = (this.getChild("n24"));
  12245. this.nameTxt = (this.getChild("nameTxt"));
  12246. this.headRoot = (this.getChild("headRoot"));
  12247. }
  12248. }
  12249. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12250. class ui_Component4 extends fgui.GComponent {
  12251. static createInstance() {
  12252. return (fgui.UIPackage.createObject("game", "Component4"));
  12253. }
  12254. onConstruct() {
  12255. this.headImg = (this.getChild("headImg"));
  12256. }
  12257. }
  12258. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12259. class ui_Component7 extends fgui.GButton {
  12260. static createInstance() {
  12261. return (fgui.UIPackage.createObject("game", "Component7"));
  12262. }
  12263. onConstruct() {
  12264. this.n17 = (this.getChild("n17"));
  12265. }
  12266. }
  12267. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12268. class ui_Component8 extends fgui.GButton {
  12269. static createInstance() {
  12270. return (fgui.UIPackage.createObject("game", "Component8"));
  12271. }
  12272. onConstruct() {
  12273. this.n19 = (this.getChild("n19"));
  12274. }
  12275. }
  12276. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12277. class ui_Component9 extends fgui.GButton {
  12278. static createInstance() {
  12279. return (fgui.UIPackage.createObject("game", "Component9"));
  12280. }
  12281. onConstruct() {
  12282. this.n18 = (this.getChild("n18"));
  12283. }
  12284. }
  12285. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12286. class ui_Component10 extends fgui.GButton {
  12287. static createInstance() {
  12288. return (fgui.UIPackage.createObject("game", "Component10"));
  12289. }
  12290. onConstruct() {
  12291. this.c1 = this.getController("c1");
  12292. this.n40 = (this.getChild("n40"));
  12293. }
  12294. }
  12295. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12296. class ui_Component11 extends fgui.GButton {
  12297. static createInstance() {
  12298. return (fgui.UIPackage.createObject("game", "Component11"));
  12299. }
  12300. onConstruct() {
  12301. this.n34 = (this.getChild("n34"));
  12302. }
  12303. }
  12304. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12305. class ui_Component12 extends fgui.GButton {
  12306. static createInstance() {
  12307. return (fgui.UIPackage.createObject("game", "Component12"));
  12308. }
  12309. onConstruct() {
  12310. this.n35 = (this.getChild("n35"));
  12311. }
  12312. }
  12313. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12314. class ui_Component13 extends fgui.GButton {
  12315. static createInstance() {
  12316. return (fgui.UIPackage.createObject("game", "Component13"));
  12317. }
  12318. onConstruct() {
  12319. this.n27 = (this.getChild("n27"));
  12320. this.n36 = (this.getChild("n36"));
  12321. }
  12322. }
  12323. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12324. class ui_dh_js_tuowei extends fgui.GComponent {
  12325. static createInstance() {
  12326. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12327. }
  12328. onConstruct() {
  12329. this.n19 = (this.getChild("n19"));
  12330. this.n18 = (this.getChild("n18"));
  12331. this.n0 = (this.getChild("n0"));
  12332. this.n3 = (this.getChild("n3"));
  12333. this.n4 = (this.getChild("n4"));
  12334. this.n5 = (this.getChild("n5"));
  12335. this.n6 = (this.getChild("n6"));
  12336. this.n8 = (this.getChild("n8"));
  12337. this.n9 = (this.getChild("n9"));
  12338. this.n10 = (this.getChild("n10"));
  12339. this.n11 = (this.getChild("n11"));
  12340. this.n12 = (this.getChild("n12"));
  12341. this.n13 = (this.getChild("n13"));
  12342. this.n14 = (this.getChild("n14"));
  12343. this.n15 = (this.getChild("n15"));
  12344. this.n20 = (this.getChild("n20"));
  12345. this.t0 = this.getTransition("t0");
  12346. this.t1 = this.getTransition("t1");
  12347. }
  12348. }
  12349. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12350. class ui_dh_js_tw_g extends fgui.GComponent {
  12351. static createInstance() {
  12352. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12353. }
  12354. onConstruct() {
  12355. this.n0 = (this.getChild("n0"));
  12356. this.n1 = (this.getChild("n1"));
  12357. this.t0 = this.getTransition("t0");
  12358. }
  12359. }
  12360. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12361. class ui_dh_js_xingxing extends fgui.GComponent {
  12362. static createInstance() {
  12363. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12364. }
  12365. onConstruct() {
  12366. this.n1 = (this.getChild("n1"));
  12367. this.n2 = (this.getChild("n2"));
  12368. this.n3 = (this.getChild("n3"));
  12369. this.n4 = (this.getChild("n4"));
  12370. this.n0 = (this.getChild("n0"));
  12371. this.t2 = this.getTransition("t2");
  12372. this.t1 = this.getTransition("t1");
  12373. }
  12374. }
  12375. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12376. class ui_dh_zy_jiazai extends fgui.GComponent {
  12377. static createInstance() {
  12378. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12379. }
  12380. onConstruct() {
  12381. this.c1 = this.getController("c1");
  12382. this.n0 = (this.getChild("n0"));
  12383. this.n1 = (this.getChild("n1"));
  12384. this.n2 = (this.getChild("n2"));
  12385. this.n4 = (this.getChild("n4"));
  12386. this.n5 = (this.getChild("n5"));
  12387. this.n6 = (this.getChild("n6"));
  12388. this.n8 = (this.getChild("n8"));
  12389. this.n7 = (this.getChild("n7"));
  12390. this.t0 = this.getTransition("t0");
  12391. }
  12392. }
  12393. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12394. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12395. static createInstance() {
  12396. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12397. }
  12398. onConstruct() {
  12399. this.c1 = this.getController("c1");
  12400. this.n3 = (this.getChild("n3"));
  12401. this.n5 = (this.getChild("n5"));
  12402. this.n4 = (this.getChild("n4"));
  12403. this.n0 = (this.getChild("n0"));
  12404. this.n1 = (this.getChild("n1"));
  12405. this.n2 = (this.getChild("n2"));
  12406. }
  12407. }
  12408. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12409. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12410. static createInstance() {
  12411. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12412. }
  12413. onConstruct() {
  12414. this.n19 = (this.getChild("n19"));
  12415. this.n21 = (this.getChild("n21"));
  12416. this.n0 = (this.getChild("n0"));
  12417. this.n3 = (this.getChild("n3"));
  12418. this.n4 = (this.getChild("n4"));
  12419. this.n5 = (this.getChild("n5"));
  12420. this.n6 = (this.getChild("n6"));
  12421. this.n8 = (this.getChild("n8"));
  12422. this.n9 = (this.getChild("n9"));
  12423. this.n10 = (this.getChild("n10"));
  12424. this.n11 = (this.getChild("n11"));
  12425. this.n12 = (this.getChild("n12"));
  12426. this.n13 = (this.getChild("n13"));
  12427. this.n14 = (this.getChild("n14"));
  12428. this.n15 = (this.getChild("n15"));
  12429. this.n23 = (this.getChild("n23"));
  12430. this.t0 = this.getTransition("t0");
  12431. this.t1 = this.getTransition("t1");
  12432. }
  12433. }
  12434. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12435. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12436. static createInstance() {
  12437. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12438. }
  12439. onConstruct() {
  12440. this.n1 = (this.getChild("n1"));
  12441. this.n2 = (this.getChild("n2"));
  12442. this.t0 = this.getTransition("t0");
  12443. }
  12444. }
  12445. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12446. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12447. static createInstance() {
  12448. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12449. }
  12450. onConstruct() {
  12451. this.n4 = (this.getChild("n4"));
  12452. this.n2 = (this.getChild("n2"));
  12453. this.n3 = (this.getChild("n3"));
  12454. this.idle = this.getTransition("idle");
  12455. this.attack = this.getTransition("attack");
  12456. }
  12457. }
  12458. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12459. class ui_special extends fgui.GComponent {
  12460. static createInstance() {
  12461. return (fgui.UIPackage.createObject("game", "special"));
  12462. }
  12463. onConstruct() {
  12464. this.n18 = (this.getChild("n18"));
  12465. this.n19 = (this.getChild("n19"));
  12466. this.n20 = (this.getChild("n20"));
  12467. this.n21 = (this.getChild("n21"));
  12468. this.n22 = (this.getChild("n22"));
  12469. this.levelTxt = (this.getChild("levelTxt"));
  12470. this.n24 = (this.getChild("n24"));
  12471. this.n25 = (this.getChild("n25"));
  12472. this.t0 = this.getTransition("t0");
  12473. }
  12474. }
  12475. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12476. class ui_Component145 extends fgui.GComponent {
  12477. static createInstance() {
  12478. return (fgui.UIPackage.createObject("game", "Component145"));
  12479. }
  12480. onConstruct() {
  12481. this.guanyuNode = (this.getChild("guanyuNode"));
  12482. }
  12483. }
  12484. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12485. class ui_longBtn extends fgui.GButton {
  12486. static createInstance() {
  12487. return (fgui.UIPackage.createObject("game", "longBtn"));
  12488. }
  12489. onConstruct() {
  12490. this.c1 = this.getController("c1");
  12491. this.n2 = (this.getChild("n2"));
  12492. this.n1 = (this.getChild("n1"));
  12493. this.n4 = (this.getChild("n4"));
  12494. }
  12495. }
  12496. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12497. class ui_Component146 extends fgui.GComponent {
  12498. static createInstance() {
  12499. return (fgui.UIPackage.createObject("game", "Component146"));
  12500. }
  12501. onConstruct() {
  12502. this.n89 = (this.getChild("n89"));
  12503. this.n90 = (this.getChild("n90"));
  12504. this.guideBtn = (this.getChild("guideBtn"));
  12505. }
  12506. }
  12507. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12508. class ui_Component146_11 extends fgui.GComponent {
  12509. static createInstance() {
  12510. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12511. }
  12512. onConstruct() {
  12513. this.n89 = (this.getChild("n89"));
  12514. this.n90 = (this.getChild("n90"));
  12515. this.guideBtn = (this.getChild("guideBtn"));
  12516. }
  12517. }
  12518. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12519. class ui_Component111_1 extends fgui.GComponent {
  12520. static createInstance() {
  12521. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12522. }
  12523. onConstruct() {
  12524. this.n68 = (this.getChild("n68"));
  12525. this.myMask = (this.getChild("myMask"));
  12526. }
  12527. }
  12528. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12529. class ui_Component64_1 extends fgui.GComponent {
  12530. static createInstance() {
  12531. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12532. }
  12533. onConstruct() {
  12534. this.n57 = (this.getChild("n57"));
  12535. this.n54 = (this.getChild("n54"));
  12536. this.n55 = (this.getChild("n55"));
  12537. this.n56 = (this.getChild("n56"));
  12538. this.t1 = this.getTransition("t1");
  12539. }
  12540. }
  12541. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12542. class ui_ModeSelection_com123 extends fgui.GComponent {
  12543. static createInstance() {
  12544. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12545. }
  12546. onConstruct() {
  12547. this.type1 = (this.getChild("type1"));
  12548. this.type2 = (this.getChild("type2"));
  12549. this.type3 = (this.getChild("type3"));
  12550. this.n38 = (this.getChild("n38"));
  12551. this.t0 = this.getTransition("t0");
  12552. }
  12553. }
  12554. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12555. class ui_Component132_2 extends fgui.GComponent {
  12556. static createInstance() {
  12557. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12558. }
  12559. onConstruct() {
  12560. this.n25 = (this.getChild("n25"));
  12561. this.n26 = (this.getChild("n26"));
  12562. this.n27 = (this.getChild("n27"));
  12563. this.t0 = this.getTransition("t0");
  12564. }
  12565. }
  12566. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12567. class ui_UIPower$1 extends fgui.GComponent {
  12568. static createInstance() {
  12569. return (fgui.UIPackage.createObject("game", "UIPower"));
  12570. }
  12571. onConstruct() {
  12572. this.n11 = (this.getChild("n11"));
  12573. this.myNode = (this.getChild("myNode"));
  12574. this.t0 = this.getTransition("t0");
  12575. }
  12576. }
  12577. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12578. class ui_Component133 extends fgui.GComponent {
  12579. static createInstance() {
  12580. return (fgui.UIPackage.createObject("game", "Component133"));
  12581. }
  12582. onConstruct() {
  12583. this.n29 = (this.getChild("n29"));
  12584. this.n30 = (this.getChild("n30"));
  12585. }
  12586. }
  12587. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12588. class ui_Component134 extends fgui.GComponent {
  12589. static createInstance() {
  12590. return (fgui.UIPackage.createObject("game", "Component134"));
  12591. }
  12592. onConstruct() {
  12593. this.n30 = (this.getChild("n30"));
  12594. this.n31 = (this.getChild("n31"));
  12595. this.t0 = this.getTransition("t0");
  12596. }
  12597. }
  12598. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12599. class ui_Component135 extends fgui.GComponent {
  12600. static createInstance() {
  12601. return (fgui.UIPackage.createObject("game", "Component135"));
  12602. }
  12603. onConstruct() {
  12604. this.n30 = (this.getChild("n30"));
  12605. this.t0 = this.getTransition("t0");
  12606. }
  12607. }
  12608. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12609. class ui_Component137 extends fgui.GComponent {
  12610. static createInstance() {
  12611. return (fgui.UIPackage.createObject("game", "Component137"));
  12612. }
  12613. onConstruct() {
  12614. this.n28 = (this.getChild("n28"));
  12615. this.n29 = (this.getChild("n29"));
  12616. this.n30 = (this.getChild("n30"));
  12617. this.n32 = (this.getChild("n32"));
  12618. }
  12619. }
  12620. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12621. class ui_dh_zuanshi extends fgui.GButton {
  12622. static createInstance() {
  12623. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12624. }
  12625. onConstruct() {
  12626. this.n1 = (this.getChild("n1"));
  12627. this.n2 = (this.getChild("n2"));
  12628. this.n0 = (this.getChild("n0"));
  12629. this.n3 = (this.getChild("n3"));
  12630. this.n4 = (this.getChild("n4"));
  12631. }
  12632. }
  12633. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12634. class ui_Component138 extends fgui.GComponent {
  12635. static createInstance() {
  12636. return (fgui.UIPackage.createObject("game", "Component138"));
  12637. }
  12638. onConstruct() {
  12639. this.n1 = (this.getChild("n1"));
  12640. this.n2 = (this.getChild("n2"));
  12641. this.t0 = this.getTransition("t0");
  12642. }
  12643. }
  12644. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12645. class ui_Component139 extends fgui.GComponent {
  12646. static createInstance() {
  12647. return (fgui.UIPackage.createObject("game", "Component139"));
  12648. }
  12649. onConstruct() {
  12650. this.n0 = (this.getChild("n0"));
  12651. this.t0 = this.getTransition("t0");
  12652. }
  12653. }
  12654. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12655. class ui_Component140 extends fgui.GComponent {
  12656. static createInstance() {
  12657. return (fgui.UIPackage.createObject("game", "Component140"));
  12658. }
  12659. onConstruct() {
  12660. this.n2 = (this.getChild("n2"));
  12661. this.n3 = (this.getChild("n3"));
  12662. this.t0 = this.getTransition("t0");
  12663. }
  12664. }
  12665. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12666. class ui_Component141 extends fgui.GComponent {
  12667. static createInstance() {
  12668. return (fgui.UIPackage.createObject("game", "Component141"));
  12669. }
  12670. onConstruct() {
  12671. this.n0 = (this.getChild("n0"));
  12672. this.t0 = this.getTransition("t0");
  12673. }
  12674. }
  12675. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12676. class ui_powerNode extends fgui.GProgressBar {
  12677. static createInstance() {
  12678. return (fgui.UIPackage.createObject("game", "powerNode"));
  12679. }
  12680. onConstruct() {
  12681. this.n2 = (this.getChild("n2"));
  12682. this.bar_v = (this.getChild("bar_v"));
  12683. this.showImg = (this.getChild("showImg"));
  12684. this.n12 = (this.getChild("n12"));
  12685. }
  12686. }
  12687. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12688. class ui_dh_jingbi1 extends fgui.GComponent {
  12689. static createInstance() {
  12690. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12691. }
  12692. onConstruct() {
  12693. this.n0 = (this.getChild("n0"));
  12694. this.n1 = (this.getChild("n1"));
  12695. this.n2 = (this.getChild("n2"));
  12696. this.n3 = (this.getChild("n3"));
  12697. this.n4 = (this.getChild("n4"));
  12698. this.n5 = (this.getChild("n5"));
  12699. this.n6 = (this.getChild("n6"));
  12700. this.n8 = (this.getChild("n8"));
  12701. this.t0 = this.getTransition("t0");
  12702. }
  12703. }
  12704. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12705. class ui_Component94 extends fgui.GButton {
  12706. static createInstance() {
  12707. return (fgui.UIPackage.createObject("game", "Component94"));
  12708. }
  12709. onConstruct() {
  12710. this.n77 = (this.getChild("n77"));
  12711. }
  12712. }
  12713. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12714. class ui_Component95 extends fgui.GButton {
  12715. static createInstance() {
  12716. return (fgui.UIPackage.createObject("game", "Component95"));
  12717. }
  12718. onConstruct() {
  12719. this.n77 = (this.getChild("n77"));
  12720. }
  12721. }
  12722. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12723. class ui_Component126 extends fgui.GComponent {
  12724. static createInstance() {
  12725. return (fgui.UIPackage.createObject("game", "Component126"));
  12726. }
  12727. onConstruct() {
  12728. this.c1 = this.getController("c1");
  12729. this.normalBtn = (this.getChild("normalBtn"));
  12730. this.tripleBtn = (this.getChild("tripleBtn"));
  12731. }
  12732. }
  12733. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12734. class ui_Component60 extends fgui.GComponent {
  12735. static createInstance() {
  12736. return (fgui.UIPackage.createObject("game", "Component60"));
  12737. }
  12738. onConstruct() {
  12739. this.c1 = this.getController("c1");
  12740. this.n48 = (this.getChild("n48"));
  12741. this.womanTxt = (this.getChild("womanTxt"));
  12742. this.t0 = this.getTransition("t0");
  12743. }
  12744. }
  12745. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12746. class ui_Component98_3 extends fgui.GButton {
  12747. static createInstance() {
  12748. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12749. }
  12750. onConstruct() {
  12751. this.c1 = this.getController("c1");
  12752. this.n8 = (this.getChild("n8"));
  12753. this.n41 = (this.getChild("n41"));
  12754. this.n40 = (this.getChild("n40"));
  12755. }
  12756. }
  12757. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12758. class ui_ModeSelection_com1 extends fgui.GButton {
  12759. static createInstance() {
  12760. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12761. }
  12762. onConstruct() {
  12763. this.n34 = (this.getChild("n34"));
  12764. this.n36 = (this.getChild("n36"));
  12765. this.n22 = (this.getChild("n22"));
  12766. this.n20 = (this.getChild("n20"));
  12767. this.n23 = (this.getChild("n23"));
  12768. this.n24 = (this.getChild("n24"));
  12769. this.n26 = (this.getChild("n26"));
  12770. this.n33 = (this.getChild("n33"));
  12771. this.coinImg = (this.getChild("coinImg"));
  12772. this.need = (this.getChild("need"));
  12773. this.n35 = (this.getChild("n35"));
  12774. this.n29 = (this.getChild("n29"));
  12775. this.tipsTxt = (this.getChild("tipsTxt"));
  12776. this.n30 = (this.getChild("n30"));
  12777. this.peopleTxt = (this.getChild("peopleTxt"));
  12778. this.t0 = this.getTransition("t0");
  12779. }
  12780. }
  12781. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12782. class ui_ModeSelection_com2 extends fgui.GButton {
  12783. static createInstance() {
  12784. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12785. }
  12786. onConstruct() {
  12787. this.n36 = (this.getChild("n36"));
  12788. this.n34 = (this.getChild("n34"));
  12789. this.n22 = (this.getChild("n22"));
  12790. this.n20 = (this.getChild("n20"));
  12791. this.n23 = (this.getChild("n23"));
  12792. this.n24 = (this.getChild("n24"));
  12793. this.n26 = (this.getChild("n26"));
  12794. this.n33 = (this.getChild("n33"));
  12795. this.coinImg = (this.getChild("coinImg"));
  12796. this.need = (this.getChild("need"));
  12797. this.n35 = (this.getChild("n35"));
  12798. this.n29 = (this.getChild("n29"));
  12799. this.tipsTxt = (this.getChild("tipsTxt"));
  12800. this.n30 = (this.getChild("n30"));
  12801. this.peopleTxt = (this.getChild("peopleTxt"));
  12802. this.t0 = this.getTransition("t0");
  12803. }
  12804. }
  12805. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12806. class ui_ModeSelection_com3 extends fgui.GButton {
  12807. static createInstance() {
  12808. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12809. }
  12810. onConstruct() {
  12811. this.n34 = (this.getChild("n34"));
  12812. this.n36 = (this.getChild("n36"));
  12813. this.n22 = (this.getChild("n22"));
  12814. this.n20 = (this.getChild("n20"));
  12815. this.n23 = (this.getChild("n23"));
  12816. this.n24 = (this.getChild("n24"));
  12817. this.n26 = (this.getChild("n26"));
  12818. this.n33 = (this.getChild("n33"));
  12819. this.coinImg = (this.getChild("coinImg"));
  12820. this.need = (this.getChild("need"));
  12821. this.n35 = (this.getChild("n35"));
  12822. this.n29 = (this.getChild("n29"));
  12823. this.tipsTxt = (this.getChild("tipsTxt"));
  12824. this.n30 = (this.getChild("n30"));
  12825. this.peopleTxt = (this.getChild("peopleTxt"));
  12826. this.t0 = this.getTransition("t0");
  12827. }
  12828. }
  12829. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12830. class ui_Invitation_com1 extends fgui.GComponent {
  12831. static createInstance() {
  12832. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12833. }
  12834. onConstruct() {
  12835. this.n14 = (this.getChild("n14"));
  12836. this.n13 = (this.getChild("n13"));
  12837. this.n3 = (this.getChild("n3"));
  12838. this.n1 = (this.getChild("n1"));
  12839. this.n6 = (this.getChild("n6"));
  12840. this.n7 = (this.getChild("n7"));
  12841. this.enterBtn = (this.getChild("enterBtn"));
  12842. this.n11 = (this.getChild("n11"));
  12843. this.n12 = (this.getChild("n12"));
  12844. this.n15 = (this.getChild("n15"));
  12845. this.t0 = this.getTransition("t0");
  12846. this.t1 = this.getTransition("t1");
  12847. }
  12848. }
  12849. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12850. class ui_Component87_1 extends fgui.GComponent {
  12851. static createInstance() {
  12852. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12853. }
  12854. onConstruct() {
  12855. this.n74 = (this.getChild("n74"));
  12856. this.n73 = (this.getChild("n73"));
  12857. this.ballTxt = (this.getChild("ballTxt"));
  12858. this.n76 = (this.getChild("n76"));
  12859. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12860. this.levelTxt = (this.getChild("levelTxt"));
  12861. this.n87 = (this.getChild("n87"));
  12862. this.n84 = (this.getChild("n84"));
  12863. this.hpTxt = (this.getChild("hpTxt"));
  12864. this.n89 = (this.getChild("n89"));
  12865. this.tipsTxt = (this.getChild("tipsTxt"));
  12866. }
  12867. }
  12868. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12869. class ui_sqg1 extends fgui.GComponent {
  12870. static createInstance() {
  12871. return (fgui.UIPackage.createObject("game", "sqg1"));
  12872. }
  12873. onConstruct() {
  12874. this.n1 = (this.getChild("n1"));
  12875. this.n0 = (this.getChild("n0"));
  12876. }
  12877. }
  12878. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12879. class ui_sqg2 extends fgui.GComponent {
  12880. static createInstance() {
  12881. return (fgui.UIPackage.createObject("game", "sqg2"));
  12882. }
  12883. onConstruct() {
  12884. this.n1 = (this.getChild("n1"));
  12885. this.n0 = (this.getChild("n0"));
  12886. }
  12887. }
  12888. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12889. class ui_sqg3 extends fgui.GComponent {
  12890. static createInstance() {
  12891. return (fgui.UIPackage.createObject("game", "sqg3"));
  12892. }
  12893. onConstruct() {
  12894. this.n1 = (this.getChild("n1"));
  12895. this.n0 = (this.getChild("n0"));
  12896. }
  12897. }
  12898. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12899. class ui_sqg4 extends fgui.GComponent {
  12900. static createInstance() {
  12901. return (fgui.UIPackage.createObject("game", "sqg4"));
  12902. }
  12903. onConstruct() {
  12904. this.n1 = (this.getChild("n1"));
  12905. this.n0 = (this.getChild("n0"));
  12906. }
  12907. }
  12908. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12909. class ui_Component36 extends fgui.GButton {
  12910. static createInstance() {
  12911. return (fgui.UIPackage.createObject("game", "Component36"));
  12912. }
  12913. onConstruct() {
  12914. this.c1 = this.getController("c1");
  12915. this.n53 = (this.getChild("n53"));
  12916. this.n56 = (this.getChild("n56"));
  12917. }
  12918. }
  12919. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12920. class ui_Component37 extends fgui.GButton {
  12921. static createInstance() {
  12922. return (fgui.UIPackage.createObject("game", "Component37"));
  12923. }
  12924. onConstruct() {
  12925. this.c1 = this.getController("c1");
  12926. this.n52 = (this.getChild("n52"));
  12927. this.n54 = (this.getChild("n54"));
  12928. }
  12929. }
  12930. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12931. class ui_UISetting extends fgui.GComponent {
  12932. static createInstance() {
  12933. return (fgui.UIPackage.createObject("game", "UISetting"));
  12934. }
  12935. onConstruct() {
  12936. this.c1 = this.getController("c1");
  12937. this.n4 = (this.getChild("n4"));
  12938. this.soundBtn = (this.getChild("soundBtn"));
  12939. this.shakeBtn = (this.getChild("shakeBtn"));
  12940. this.clickNode = (this.getChild("clickNode"));
  12941. this.xyBtn = (this.getChild("xyBtn"));
  12942. }
  12943. }
  12944. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12945. class ui_Component39 extends fgui.GComponent {
  12946. static createInstance() {
  12947. return (fgui.UIPackage.createObject("game", "Component39"));
  12948. }
  12949. onConstruct() {
  12950. this.n5 = (this.getChild("n5"));
  12951. this.n6 = (this.getChild("n6"));
  12952. this.n7 = (this.getChild("n7"));
  12953. this.t0 = this.getTransition("t0");
  12954. }
  12955. }
  12956. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12957. class ui_Component40 extends fgui.GButton {
  12958. static createInstance() {
  12959. return (fgui.UIPackage.createObject("game", "Component40"));
  12960. }
  12961. onConstruct() {
  12962. this.n46 = (this.getChild("n46"));
  12963. this.n47 = (this.getChild("n47"));
  12964. }
  12965. }
  12966. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  12967. class ui_Component41 extends fgui.GComponent {
  12968. static createInstance() {
  12969. return (fgui.UIPackage.createObject("game", "Component41"));
  12970. }
  12971. onConstruct() {
  12972. this.c1 = this.getController("c1");
  12973. this.n0 = (this.getChild("n0"));
  12974. this.titleTxt = (this.getChild("titleTxt"));
  12975. this.n2 = (this.getChild("n2"));
  12976. this.msgTips = (this.getChild("msgTips"));
  12977. this.numTxt = (this.getChild("numTxt"));
  12978. this.n18 = (this.getChild("n18"));
  12979. this.cancelBtn = (this.getChild("cancelBtn"));
  12980. this.videoBtn = (this.getChild("videoBtn"));
  12981. this.n10 = (this.getChild("n10"));
  12982. }
  12983. }
  12984. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  12985. class ui_Component42 extends fgui.GComponent {
  12986. static createInstance() {
  12987. return (fgui.UIPackage.createObject("game", "Component42"));
  12988. }
  12989. onConstruct() {
  12990. this.c1 = this.getController("c1");
  12991. this.n1 = (this.getChild("n1"));
  12992. this.n2 = (this.getChild("n2"));
  12993. this.n3 = (this.getChild("n3"));
  12994. this.tipsTxt = (this.getChild("tipsTxt"));
  12995. this.cancelBtn = (this.getChild("cancelBtn"));
  12996. this.sureBtn = (this.getChild("sureBtn"));
  12997. this.n11 = (this.getChild("n11"));
  12998. this.n13 = (this.getChild("n13"));
  12999. this.n14 = (this.getChild("n14"));
  13000. this.womanTxt = (this.getChild("womanTxt"));
  13001. this.t0 = this.getTransition("t0");
  13002. }
  13003. }
  13004. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13005. class ui_dh_js_shengli extends fgui.GComponent {
  13006. static createInstance() {
  13007. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13008. }
  13009. onConstruct() {
  13010. this.n3 = (this.getChild("n3"));
  13011. this.n4 = (this.getChild("n4"));
  13012. this.n1 = (this.getChild("n1"));
  13013. this.n2 = (this.getChild("n2"));
  13014. this.n5 = (this.getChild("n5"));
  13015. this.n6 = (this.getChild("n6"));
  13016. this.n7 = (this.getChild("n7"));
  13017. this.n8 = (this.getChild("n8"));
  13018. this.attack = this.getTransition("attack");
  13019. this.idle = this.getTransition("idle");
  13020. }
  13021. }
  13022. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13023. class ui_dh_js_shengli_g extends fgui.GComponent {
  13024. static createInstance() {
  13025. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13026. }
  13027. onConstruct() {
  13028. this.n3 = (this.getChild("n3"));
  13029. this.n1 = (this.getChild("n1"));
  13030. this.t0 = this.getTransition("t0");
  13031. }
  13032. }
  13033. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13034. class ui_dh_js_shibai extends fgui.GComponent {
  13035. static createInstance() {
  13036. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13037. }
  13038. onConstruct() {
  13039. this.n0 = (this.getChild("n0"));
  13040. this.n1 = (this.getChild("n1"));
  13041. this.n2 = (this.getChild("n2"));
  13042. this.n3 = (this.getChild("n3"));
  13043. this.idle = this.getTransition("idle");
  13044. this.attack = this.getTransition("attack");
  13045. }
  13046. }
  13047. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13048. class ui_dh_zy_ganfa extends fgui.GButton {
  13049. static createInstance() {
  13050. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13051. }
  13052. onConstruct() {
  13053. this.n0 = (this.getChild("n0"));
  13054. }
  13055. }
  13056. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13057. class ui_dh_zy_sc_guang extends fgui.GButton {
  13058. static createInstance() {
  13059. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13060. }
  13061. onConstruct() {
  13062. this.n0 = (this.getChild("n0"));
  13063. this.n2 = (this.getChild("n2"));
  13064. }
  13065. }
  13066. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13067. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13068. static createInstance() {
  13069. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13070. }
  13071. onConstruct() {
  13072. this.n0 = (this.getChild("n0"));
  13073. this.n3 = (this.getChild("n3"));
  13074. this.t0 = this.getTransition("t0");
  13075. }
  13076. }
  13077. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13078. class ui_dh_zy_wanfa extends fgui.GButton {
  13079. static createInstance() {
  13080. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13081. }
  13082. onConstruct() {
  13083. this.n0 = (this.getChild("n0"));
  13084. }
  13085. }
  13086. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13087. class ui_Component53_1 extends fgui.GComponent {
  13088. static createInstance() {
  13089. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13090. }
  13091. onConstruct() {
  13092. this.n0 = (this.getChild("n0"));
  13093. this.n1 = (this.getChild("n1"));
  13094. this.n2 = (this.getChild("n2"));
  13095. this.n3 = (this.getChild("n3"));
  13096. this.n4 = (this.getChild("n4"));
  13097. this.n5 = (this.getChild("n5"));
  13098. this.n6 = (this.getChild("n6"));
  13099. this.n7 = (this.getChild("n7"));
  13100. this.n8 = (this.getChild("n8"));
  13101. this.n9 = (this.getChild("n9"));
  13102. this.n10 = (this.getChild("n10"));
  13103. this.n11 = (this.getChild("n11"));
  13104. this.n12 = (this.getChild("n12"));
  13105. this.n13 = (this.getChild("n13"));
  13106. this.n14 = (this.getChild("n14"));
  13107. this.n15 = (this.getChild("n15"));
  13108. this.n16 = (this.getChild("n16"));
  13109. this.n19 = (this.getChild("n19"));
  13110. this.n20 = (this.getChild("n20"));
  13111. this.n21 = (this.getChild("n21"));
  13112. this.n22 = (this.getChild("n22"));
  13113. this.n23 = (this.getChild("n23"));
  13114. this.n24 = (this.getChild("n24"));
  13115. this.n25 = (this.getChild("n25"));
  13116. this.n26 = (this.getChild("n26"));
  13117. this.n27 = (this.getChild("n27"));
  13118. this.n28 = (this.getChild("n28"));
  13119. this.n29 = (this.getChild("n29"));
  13120. this.n30 = (this.getChild("n30"));
  13121. this.n31 = (this.getChild("n31"));
  13122. this.n32 = (this.getChild("n32"));
  13123. this.n33 = (this.getChild("n33"));
  13124. this.n34 = (this.getChild("n34"));
  13125. this.n35 = (this.getChild("n35"));
  13126. this.t0 = this.getTransition("t0");
  13127. }
  13128. }
  13129. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13130. class ui_Component30 extends fgui.GComponent {
  13131. static createInstance() {
  13132. return (fgui.UIPackage.createObject("game", "Component30"));
  13133. }
  13134. onConstruct() {
  13135. this.c1 = this.getController("c1");
  13136. this.n46 = (this.getChild("n46"));
  13137. this.n47 = (this.getChild("n47"));
  13138. this.numTxt = (this.getChild("numTxt"));
  13139. this.n50 = (this.getChild("n50"));
  13140. this.n53 = (this.getChild("n53"));
  13141. this.n54 = (this.getChild("n54"));
  13142. this.n55 = (this.getChild("n55"));
  13143. this.n56 = (this.getChild("n56"));
  13144. }
  13145. }
  13146. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13147. class ui_Component30_1 extends fgui.GComponent {
  13148. static createInstance() {
  13149. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13150. }
  13151. onConstruct() {
  13152. this.c1 = this.getController("c1");
  13153. this.n46 = (this.getChild("n46"));
  13154. this.n47 = (this.getChild("n47"));
  13155. this.numTxt = (this.getChild("numTxt"));
  13156. this.n50 = (this.getChild("n50"));
  13157. this.n51 = (this.getChild("n51"));
  13158. this.n52 = (this.getChild("n52"));
  13159. this.n53 = (this.getChild("n53"));
  13160. this.n54 = (this.getChild("n54"));
  13161. }
  13162. }
  13163. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13164. class ui_Component31 extends fgui.GComponent {
  13165. static createInstance() {
  13166. return (fgui.UIPackage.createObject("game", "Component31"));
  13167. }
  13168. onConstruct() {
  13169. this.n55 = (this.getChild("n55"));
  13170. this.n54 = (this.getChild("n54"));
  13171. this.conditionTxt = (this.getChild("conditionTxt"));
  13172. this.n57 = (this.getChild("n57"));
  13173. this.t0 = this.getTransition("t0");
  13174. }
  13175. }
  13176. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13177. class ui_Component32 extends fgui.GComponent {
  13178. static createInstance() {
  13179. return (fgui.UIPackage.createObject("game", "Component32"));
  13180. }
  13181. onConstruct() {
  13182. this.n5 = (this.getChild("n5"));
  13183. this.n6 = (this.getChild("n6"));
  13184. this.n7 = (this.getChild("n7"));
  13185. this.t0 = this.getTransition("t0");
  13186. }
  13187. }
  13188. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13189. class ui_AwardItem extends fgui.GComponent {
  13190. static createInstance() {
  13191. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13192. }
  13193. onConstruct() {
  13194. this.n9 = (this.getChild("n9"));
  13195. this.myIcon = (this.getChild("myIcon"));
  13196. this.numTxt = (this.getChild("numTxt"));
  13197. this.nameTxt = (this.getChild("nameTxt"));
  13198. this.n16 = (this.getChild("n16"));
  13199. this.n17 = (this.getChild("n17"));
  13200. }
  13201. }
  13202. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13203. class ui_ranking_com1 extends fgui.GButton {
  13204. static createInstance() {
  13205. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13206. }
  13207. onConstruct() {
  13208. this.c1 = this.getController("c1");
  13209. this.n49 = (this.getChild("n49"));
  13210. this.n18 = (this.getChild("n18"));
  13211. this.n46 = (this.getChild("n46"));
  13212. this.n48 = (this.getChild("n48"));
  13213. this.n50 = (this.getChild("n50"));
  13214. }
  13215. }
  13216. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13217. class ui_ranking_com2 extends fgui.GButton {
  13218. static createInstance() {
  13219. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13220. }
  13221. onConstruct() {
  13222. this.c1 = this.getController("c1");
  13223. this.n49 = (this.getChild("n49"));
  13224. this.n18 = (this.getChild("n18"));
  13225. this.n46 = (this.getChild("n46"));
  13226. this.n48 = (this.getChild("n48"));
  13227. this.n50 = (this.getChild("n50"));
  13228. }
  13229. }
  13230. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13231. class ui_ranking_com3 extends fgui.GComponent {
  13232. static createInstance() {
  13233. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13234. }
  13235. onConstruct() {
  13236. this.n17 = (this.getChild("n17"));
  13237. this.myIcon = (this.getChild("myIcon"));
  13238. }
  13239. }
  13240. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13241. class ui_ranking_com4 extends fgui.GComponent {
  13242. static createInstance() {
  13243. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13244. }
  13245. onConstruct() {
  13246. this.n16 = (this.getChild("n16"));
  13247. this.head = (this.getChild("head"));
  13248. }
  13249. }
  13250. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13251. class ui_ranking_com5 extends fgui.GComponent {
  13252. static createInstance() {
  13253. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13254. }
  13255. onConstruct() {
  13256. this.c1 = this.getController("c1");
  13257. this.c2 = this.getController("c2");
  13258. this.n2 = (this.getChild("n2"));
  13259. this.n3 = (this.getChild("n3"));
  13260. this.levelBtn = (this.getChild("levelBtn"));
  13261. this.starBtn = (this.getChild("starBtn"));
  13262. this.n23 = (this.getChild("n23"));
  13263. this.n24 = (this.getChild("n24"));
  13264. this.n25 = (this.getChild("n25"));
  13265. this.myList = (this.getChild("myList"));
  13266. this.selfNode = (this.getChild("selfNode"));
  13267. this.n9 = (this.getChild("n9"));
  13268. this.n12 = (this.getChild("n12"));
  13269. this.n13 = (this.getChild("n13"));
  13270. this.n14 = (this.getChild("n14"));
  13271. this.n39 = (this.getChild("n39"));
  13272. this.n41 = (this.getChild("n41"));
  13273. this.n42 = (this.getChild("n42"));
  13274. this.n45 = (this.getChild("n45"));
  13275. this.changeBtn = (this.getChild("changeBtn"));
  13276. this.closeBtn = (this.getChild("closeBtn"));
  13277. this.t0 = this.getTransition("t0");
  13278. }
  13279. }
  13280. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13281. class ui_RankItem extends fgui.GComponent {
  13282. static createInstance() {
  13283. return (fgui.UIPackage.createObject("game", "RankItem"));
  13284. }
  13285. onConstruct() {
  13286. this.n10 = (this.getChild("n10"));
  13287. this.n11 = (this.getChild("n11"));
  13288. this.rankTxt = (this.getChild("rankTxt"));
  13289. this.headNode = (this.getChild("headNode"));
  13290. this.nameTxt = (this.getChild("nameTxt"));
  13291. this.n19 = (this.getChild("n19"));
  13292. this.valueTxt = (this.getChild("valueTxt"));
  13293. this.img1 = (this.getChild("img1"));
  13294. this.img2 = (this.getChild("img2"));
  13295. this.img3 = (this.getChild("img3"));
  13296. }
  13297. }
  13298. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13299. class ui_ranking_com9 extends fgui.GComponent {
  13300. static createInstance() {
  13301. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13302. }
  13303. onConstruct() {
  13304. this.c1 = this.getController("c1");
  13305. this.n27 = (this.getChild("n27"));
  13306. this.n28 = (this.getChild("n28"));
  13307. this.headNode = (this.getChild("headNode"));
  13308. this.rankTxt = (this.getChild("rankTxt"));
  13309. this.nameTxt = (this.getChild("nameTxt"));
  13310. this.n34 = (this.getChild("n34"));
  13311. this.valueTxt = (this.getChild("valueTxt"));
  13312. this.n36 = (this.getChild("n36"));
  13313. this.n37 = (this.getChild("n37"));
  13314. this.n38 = (this.getChild("n38"));
  13315. this.n39 = (this.getChild("n39"));
  13316. this.n40 = (this.getChild("n40"));
  13317. }
  13318. }
  13319. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13320. class ui_ranking_com10 extends fgui.GComponent {
  13321. static createInstance() {
  13322. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13323. }
  13324. onConstruct() {
  13325. this.n23 = (this.getChild("n23"));
  13326. this.n24 = (this.getChild("n24"));
  13327. }
  13328. }
  13329. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13330. class ui_ranking_com11 extends fgui.GComponent {
  13331. static createInstance() {
  13332. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13333. }
  13334. onConstruct() {
  13335. this.n24 = (this.getChild("n24"));
  13336. this.n25 = (this.getChild("n25"));
  13337. this.t0 = this.getTransition("t0");
  13338. }
  13339. }
  13340. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13341. class ui_ranking_com13 extends fgui.GButton {
  13342. static createInstance() {
  13343. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13344. }
  13345. onConstruct() {
  13346. this.c1 = this.getController("c1");
  13347. this.n44 = (this.getChild("n44"));
  13348. this.n45 = (this.getChild("n45"));
  13349. this.n46 = (this.getChild("n46"));
  13350. }
  13351. }
  13352. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13353. class ui_Component122 extends fgui.GComponent {
  13354. static createInstance() {
  13355. return (fgui.UIPackage.createObject("game", "Component122"));
  13356. }
  13357. onConstruct() {
  13358. this.gameNode3 = (this.getChild("gameNode3"));
  13359. }
  13360. }
  13361. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13362. class ui_skillItem extends fgui.GComponent {
  13363. static createInstance() {
  13364. return (fgui.UIPackage.createObject("game", "skillItem"));
  13365. }
  13366. onConstruct() {
  13367. this.c1 = this.getController("c1");
  13368. this.n31 = (this.getChild("n31"));
  13369. this.n6 = (this.getChild("n6"));
  13370. this.skillImg = (this.getChild("skillImg"));
  13371. this.nameTxt = (this.getChild("nameTxt"));
  13372. this.levelTxt = (this.getChild("levelTxt"));
  13373. this.n28 = (this.getChild("n28"));
  13374. this.describeTxt = (this.getChild("describeTxt"));
  13375. this.n32 = (this.getChild("n32"));
  13376. this.mutiBtn = (this.getChild("mutiBtn"));
  13377. this.tryNode = (this.getChild("tryNode"));
  13378. this.normalBtn = (this.getChild("normalBtn"));
  13379. this.startBtn = (this.getChild("startBtn"));
  13380. this.n42 = (this.getChild("n42"));
  13381. this.n43 = (this.getChild("n43"));
  13382. this.n44 = (this.getChild("n44"));
  13383. }
  13384. }
  13385. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13386. class ui_Component26 extends fgui.GButton {
  13387. static createInstance() {
  13388. return (fgui.UIPackage.createObject("game", "Component26"));
  13389. }
  13390. onConstruct() {
  13391. this.n11 = (this.getChild("n11"));
  13392. this.n30 = (this.getChild("n30"));
  13393. this.n34 = (this.getChild("n34"));
  13394. }
  13395. }
  13396. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13397. class ui_Component28 extends fgui.GButton {
  13398. static createInstance() {
  13399. return (fgui.UIPackage.createObject("game", "Component28"));
  13400. }
  13401. onConstruct() {
  13402. this.n12 = (this.getChild("n12"));
  13403. this.n31 = (this.getChild("n31"));
  13404. this.curTxt = (this.getChild("curTxt"));
  13405. this.n33 = (this.getChild("n33"));
  13406. }
  13407. }
  13408. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13409. class ui_Component1302 extends fgui.GComponent {
  13410. static createInstance() {
  13411. return (fgui.UIPackage.createObject("game", "Component1302"));
  13412. }
  13413. onConstruct() {
  13414. this.n2 = (this.getChild("n2"));
  13415. this.n3 = (this.getChild("n3"));
  13416. }
  13417. }
  13418. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13419. class ui_Component113 extends fgui.GComponent {
  13420. static createInstance() {
  13421. return (fgui.UIPackage.createObject("game", "Component113"));
  13422. }
  13423. onConstruct() {
  13424. this.n85 = (this.getChild("n85"));
  13425. this.n86 = (this.getChild("n86"));
  13426. this.n77 = (this.getChild("n77"));
  13427. this.n79 = (this.getChild("n79"));
  13428. this.n80 = (this.getChild("n80"));
  13429. this.n81 = (this.getChild("n81"));
  13430. this.n82 = (this.getChild("n82"));
  13431. this.n84 = (this.getChild("n84"));
  13432. this.n87 = (this.getChild("n87"));
  13433. this.t0 = this.getTransition("t0");
  13434. }
  13435. }
  13436. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13437. class ui_Component114 extends fgui.GComponent {
  13438. static createInstance() {
  13439. return (fgui.UIPackage.createObject("game", "Component114"));
  13440. }
  13441. onConstruct() {
  13442. this.n77 = (this.getChild("n77"));
  13443. this.t0 = this.getTransition("t0");
  13444. }
  13445. }
  13446. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13447. class ui_Component115 extends fgui.GComponent {
  13448. static createInstance() {
  13449. return (fgui.UIPackage.createObject("game", "Component115"));
  13450. }
  13451. onConstruct() {
  13452. this.n83 = (this.getChild("n83"));
  13453. this.fingerNode = (this.getChild("fingerNode"));
  13454. this.n84 = (this.getChild("n84"));
  13455. }
  13456. }
  13457. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13458. class ui_Component117 extends fgui.GComponent {
  13459. static createInstance() {
  13460. return (fgui.UIPackage.createObject("game", "Component117"));
  13461. }
  13462. onConstruct() {
  13463. this.n87 = (this.getChild("n87"));
  13464. this.n88 = (this.getChild("n88"));
  13465. this.n84 = (this.getChild("n84"));
  13466. this.n85 = (this.getChild("n85"));
  13467. this.n86 = (this.getChild("n86"));
  13468. this.t0 = this.getTransition("t0");
  13469. }
  13470. }
  13471. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13472. class ui_Component98_1 extends fgui.GButton {
  13473. static createInstance() {
  13474. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13475. }
  13476. onConstruct() {
  13477. this.c1 = this.getController("c1");
  13478. this.n8 = (this.getChild("n8"));
  13479. this.n41 = (this.getChild("n41"));
  13480. this.n40 = (this.getChild("n40"));
  13481. }
  13482. }
  13483. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13484. class ui_Component61 extends fgui.GComponent {
  13485. static createInstance() {
  13486. return (fgui.UIPackage.createObject("game", "Component61"));
  13487. }
  13488. onConstruct() {
  13489. this.n14 = (this.getChild("n14"));
  13490. this.n6 = (this.getChild("n6"));
  13491. this.t0 = this.getTransition("t0");
  13492. }
  13493. }
  13494. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13495. class ui_Component62 extends fgui.GComponent {
  13496. static createInstance() {
  13497. return (fgui.UIPackage.createObject("game", "Component62"));
  13498. }
  13499. onConstruct() {
  13500. this.n66 = (this.getChild("n66"));
  13501. this.n56 = (this.getChild("n56"));
  13502. this.n63 = (this.getChild("n63"));
  13503. this.n65 = (this.getChild("n65"));
  13504. this.t0 = this.getTransition("t0");
  13505. }
  13506. }
  13507. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13508. class ui_d3Root extends fgui.GComponent {
  13509. static createInstance() {
  13510. return (fgui.UIPackage.createObject("game", "d3Root"));
  13511. }
  13512. onConstruct() {
  13513. }
  13514. }
  13515. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13516. class ui_d2Root extends fgui.GComponent {
  13517. static createInstance() {
  13518. return (fgui.UIPackage.createObject("game", "d2Root"));
  13519. }
  13520. onConstruct() {
  13521. }
  13522. }
  13523. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13524. class ui_ballNode extends fgui.GComponent {
  13525. static createInstance() {
  13526. return (fgui.UIPackage.createObject("game", "ballNode"));
  13527. }
  13528. onConstruct() {
  13529. }
  13530. }
  13531. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13532. class ui_border extends fgui.GComponent {
  13533. static createInstance() {
  13534. return (fgui.UIPackage.createObject("game", "border"));
  13535. }
  13536. onConstruct() {
  13537. this.bar1 = (this.getChild("bar1"));
  13538. this.bar2 = (this.getChild("bar2"));
  13539. this.bar3 = (this.getChild("bar3"));
  13540. this.bar4 = (this.getChild("bar4"));
  13541. this.bar5 = (this.getChild("bar5"));
  13542. this.bar6 = (this.getChild("bar6"));
  13543. this.circle1 = (this.getChild("circle1"));
  13544. this.circle2 = (this.getChild("circle2"));
  13545. this.circle3 = (this.getChild("circle3"));
  13546. this.circle4 = (this.getChild("circle4"));
  13547. this.circle5 = (this.getChild("circle5"));
  13548. this.circle6 = (this.getChild("circle6"));
  13549. this.n28 = (this.getChild("n28"));
  13550. }
  13551. }
  13552. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13553. class ui_Component41_2 extends fgui.GComponent {
  13554. static createInstance() {
  13555. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13556. }
  13557. onConstruct() {
  13558. this.c1 = this.getController("c1");
  13559. this.n0 = (this.getChild("n0"));
  13560. this.n2 = (this.getChild("n2"));
  13561. this.n19 = (this.getChild("n19"));
  13562. this.cancelBtn = (this.getChild("cancelBtn"));
  13563. this.videoBtn = (this.getChild("videoBtn"));
  13564. this.n9 = (this.getChild("n9"));
  13565. this.n22 = (this.getChild("n22"));
  13566. this.tipsTxt = (this.getChild("tipsTxt"));
  13567. this.n23 = (this.getChild("n23"));
  13568. this.n24 = (this.getChild("n24"));
  13569. this.n26 = (this.getChild("n26"));
  13570. this.n27 = (this.getChild("n27"));
  13571. this.titleTxt = (this.getChild("titleTxt"));
  13572. }
  13573. }
  13574. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13575. class ui_Component41_1 extends fgui.GComponent {
  13576. static createInstance() {
  13577. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13578. }
  13579. onConstruct() {
  13580. this.c1 = this.getController("c1");
  13581. this.n0 = (this.getChild("n0"));
  13582. this.n2 = (this.getChild("n2"));
  13583. this.cancelBtn = (this.getChild("cancelBtn"));
  13584. this.videoBtn = (this.getChild("videoBtn"));
  13585. this.n27 = (this.getChild("n27"));
  13586. this.n30 = (this.getChild("n30"));
  13587. this.n31 = (this.getChild("n31"));
  13588. this.n32 = (this.getChild("n32"));
  13589. this.n33 = (this.getChild("n33"));
  13590. this.n34 = (this.getChild("n34"));
  13591. this.n35 = (this.getChild("n35"));
  13592. this.n36 = (this.getChild("n36"));
  13593. this.n1 = (this.getChild("n1"));
  13594. this.n37 = (this.getChild("n37"));
  13595. this.t0 = this.getTransition("t0");
  13596. this.t1 = this.getTransition("t1");
  13597. this.t2 = this.getTransition("t2");
  13598. this.t3 = this.getTransition("t3");
  13599. }
  13600. }
  13601. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13602. class ui_againBtn extends fgui.GButton {
  13603. static createInstance() {
  13604. return (fgui.UIPackage.createObject("game", "againBtn"));
  13605. }
  13606. onConstruct() {
  13607. this.n2 = (this.getChild("n2"));
  13608. this.n1 = (this.getChild("n1"));
  13609. this.n5 = (this.getChild("n5"));
  13610. }
  13611. }
  13612. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13613. class ui_Component118 extends fgui.GButton {
  13614. static createInstance() {
  13615. return (fgui.UIPackage.createObject("game", "Component118"));
  13616. }
  13617. onConstruct() {
  13618. this.c1 = this.getController("c1");
  13619. this.n14 = (this.getChild("n14"));
  13620. this.n9 = (this.getChild("n9"));
  13621. this.n10 = (this.getChild("n10"));
  13622. this.diamondTxt = (this.getChild("diamondTxt"));
  13623. this.n13 = (this.getChild("n13"));
  13624. this.n15 = (this.getChild("n15"));
  13625. }
  13626. }
  13627. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13628. class ui_Component119 extends fgui.GComponent {
  13629. static createInstance() {
  13630. return (fgui.UIPackage.createObject("game", "Component119"));
  13631. }
  13632. onConstruct() {
  13633. this.n1 = (this.getChild("n1"));
  13634. this.n2 = (this.getChild("n2"));
  13635. this.n13 = (this.getChild("n13"));
  13636. this.n6 = (this.getChild("n6"));
  13637. this.screenNode = (this.getChild("screenNode"));
  13638. this.n15 = (this.getChild("n15"));
  13639. this.closeBtn = (this.getChild("closeBtn"));
  13640. this.share2Btn = (this.getChild("share2Btn"));
  13641. this.shareBtn = (this.getChild("shareBtn"));
  13642. this.tipsNode = (this.getChild("tipsNode"));
  13643. this.awardNode = (this.getChild("awardNode"));
  13644. }
  13645. }
  13646. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13647. class ui_Component132_1 extends fgui.GComponent {
  13648. static createInstance() {
  13649. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13650. }
  13651. onConstruct() {
  13652. this.n25 = (this.getChild("n25"));
  13653. this.n26 = (this.getChild("n26"));
  13654. this.n27 = (this.getChild("n27"));
  13655. this.t0 = this.getTransition("t0");
  13656. }
  13657. }
  13658. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13659. class ui_SecretaryDisplay extends fgui.GComponent {
  13660. static createInstance() {
  13661. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13662. }
  13663. onConstruct() {
  13664. this.n2 = (this.getChild("n2"));
  13665. this.levelTxt = (this.getChild("levelTxt"));
  13666. this.n4 = (this.getChild("n4"));
  13667. this.secretary = (this.getChild("secretary"));
  13668. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13669. this.n16 = (this.getChild("n16"));
  13670. this.n37 = (this.getChild("n37"));
  13671. this.n41 = (this.getChild("n41"));
  13672. this.n14 = (this.getChild("n14"));
  13673. this.n17 = (this.getChild("n17"));
  13674. this.heightTxt = (this.getChild("heightTxt"));
  13675. this.n46 = (this.getChild("n46"));
  13676. this.n36 = (this.getChild("n36"));
  13677. this.n38 = (this.getChild("n38"));
  13678. this.foodTxt = (this.getChild("foodTxt"));
  13679. this.n47 = (this.getChild("n47"));
  13680. this.n40 = (this.getChild("n40"));
  13681. this.n42 = (this.getChild("n42"));
  13682. this.historyTxt = (this.getChild("historyTxt"));
  13683. this.n48 = (this.getChild("n48"));
  13684. this.nameImg = (this.getChild("nameImg"));
  13685. this.n12 = (this.getChild("n12"));
  13686. this.n49 = (this.getChild("n49"));
  13687. this.t0 = this.getTransition("t0");
  13688. }
  13689. }
  13690. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13691. class ui_BallRodDisplay extends fgui.GComponent {
  13692. static createInstance() {
  13693. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13694. }
  13695. onConstruct() {
  13696. this.c1 = this.getController("c1");
  13697. this.n31 = (this.getChild("n31"));
  13698. this.n6 = (this.getChild("n6"));
  13699. this.nameTxt = (this.getChild("nameTxt"));
  13700. this.rodImg = (this.getChild("rodImg"));
  13701. this.levelNode = (this.getChild("levelNode"));
  13702. this.eftRod = (this.getChild("eftRod"));
  13703. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13704. }
  13705. }
  13706. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13707. class ui_Component111_11 extends fgui.GComponent {
  13708. static createInstance() {
  13709. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13710. }
  13711. onConstruct() {
  13712. this.n68 = (this.getChild("n68"));
  13713. this.n69 = (this.getChild("n69"));
  13714. }
  13715. }
  13716. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13717. class ui_Component112 extends fgui.GComponent {
  13718. static createInstance() {
  13719. return (fgui.UIPackage.createObject("game", "Component112"));
  13720. }
  13721. onConstruct() {
  13722. this.n68 = (this.getChild("n68"));
  13723. this.n70 = (this.getChild("n70"));
  13724. this.myMask = (this.getChild("myMask"));
  13725. }
  13726. }
  13727. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13728. class ui_Component111 extends fgui.GComponent {
  13729. static createInstance() {
  13730. return (fgui.UIPackage.createObject("game", "Component111"));
  13731. }
  13732. onConstruct() {
  13733. this.n68 = (this.getChild("n68"));
  13734. this.myMask = (this.getChild("myMask"));
  13735. }
  13736. }
  13737. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13738. class ui_Component144 extends fgui.GButton {
  13739. static createInstance() {
  13740. return (fgui.UIPackage.createObject("game", "Component144"));
  13741. }
  13742. onConstruct() {
  13743. this.n8 = (this.getChild("n8"));
  13744. }
  13745. }
  13746. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13747. class ui_Sign_com2 extends fgui.GComponent {
  13748. static createInstance() {
  13749. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13750. }
  13751. onConstruct() {
  13752. this.n0 = (this.getChild("n0"));
  13753. this.n1 = (this.getChild("n1"));
  13754. this.t0 = this.getTransition("t0");
  13755. }
  13756. }
  13757. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13758. class ui_Sign_guang extends fgui.GComponent {
  13759. static createInstance() {
  13760. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13761. }
  13762. onConstruct() {
  13763. this.n1 = (this.getChild("n1"));
  13764. this.n2 = (this.getChild("n2"));
  13765. this.n3 = (this.getChild("n3"));
  13766. this.n4 = (this.getChild("n4"));
  13767. this.n5 = (this.getChild("n5"));
  13768. this.n6 = (this.getChild("n6"));
  13769. this.n8 = (this.getChild("n8"));
  13770. }
  13771. }
  13772. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13773. class ui_SignMax extends fgui.GComponent {
  13774. static createInstance() {
  13775. return (fgui.UIPackage.createObject("game", "SignMax"));
  13776. }
  13777. onConstruct() {
  13778. this.c1 = this.getController("c1");
  13779. this.n7 = (this.getChild("n7"));
  13780. this.n15 = (this.getChild("n15"));
  13781. this.n8 = (this.getChild("n8"));
  13782. this.titleTxt = (this.getChild("titleTxt"));
  13783. this.myIcon1 = (this.getChild("myIcon1"));
  13784. this.numTxt1 = (this.getChild("numTxt1"));
  13785. this.myIcon2 = (this.getChild("myIcon2"));
  13786. this.n20 = (this.getChild("n20"));
  13787. this.n17 = (this.getChild("n17"));
  13788. this.numTxt2 = (this.getChild("numTxt2"));
  13789. this.n12 = (this.getChild("n12"));
  13790. this.n13 = (this.getChild("n13"));
  13791. this.n21 = (this.getChild("n21"));
  13792. this.n14 = (this.getChild("n14"));
  13793. }
  13794. }
  13795. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13796. class ui_Sign_com2_1 extends fgui.GComponent {
  13797. static createInstance() {
  13798. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13799. }
  13800. onConstruct() {
  13801. this.n0 = (this.getChild("n0"));
  13802. this.n1 = (this.getChild("n1"));
  13803. this.t0 = this.getTransition("t0");
  13804. }
  13805. }
  13806. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13807. class ui_Sign_com5 extends fgui.GComponent {
  13808. static createInstance() {
  13809. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13810. }
  13811. onConstruct() {
  13812. this.n3 = (this.getChild("n3"));
  13813. this.n29 = (this.getChild("n29"));
  13814. this.n4 = (this.getChild("n4"));
  13815. this.day1 = (this.getChild("day1"));
  13816. this.day2 = (this.getChild("day2"));
  13817. this.day3 = (this.getChild("day3"));
  13818. this.day4 = (this.getChild("day4"));
  13819. this.day5 = (this.getChild("day5"));
  13820. this.day6 = (this.getChild("day6"));
  13821. this.day7 = (this.getChild("day7"));
  13822. this.t0 = this.getTransition("t0");
  13823. }
  13824. }
  13825. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13826. class ui_Sign_com8 extends fgui.GComponent {
  13827. static createInstance() {
  13828. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13829. }
  13830. onConstruct() {
  13831. this.n48 = (this.getChild("n48"));
  13832. this.womanTxt = (this.getChild("womanTxt"));
  13833. this.t0 = this.getTransition("t0");
  13834. }
  13835. }
  13836. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13837. class ui_Sign_com6 extends fgui.GComponent {
  13838. static createInstance() {
  13839. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13840. }
  13841. onConstruct() {
  13842. this.n2 = (this.getChild("n2"));
  13843. this.n3 = (this.getChild("n3"));
  13844. this.t0 = this.getTransition("t0");
  13845. }
  13846. }
  13847. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13848. class ui_Sign_com7 extends fgui.GComponent {
  13849. static createInstance() {
  13850. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13851. }
  13852. onConstruct() {
  13853. this.n29 = (this.getChild("n29"));
  13854. this.n2 = (this.getChild("n2"));
  13855. }
  13856. }
  13857. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13858. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13859. static createInstance() {
  13860. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13861. }
  13862. onConstruct() {
  13863. this.n5 = (this.getChild("n5"));
  13864. this.n4 = (this.getChild("n4"));
  13865. this.t0 = this.getTransition("t0");
  13866. }
  13867. }
  13868. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13869. class ui_UITurntable_com2 extends fgui.GComponent {
  13870. static createInstance() {
  13871. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13872. }
  13873. onConstruct() {
  13874. this.c1 = this.getController("c1");
  13875. this.n4 = (this.getChild("n4"));
  13876. this.n6 = (this.getChild("n6"));
  13877. this.n10 = (this.getChild("n10"));
  13878. this.n11 = (this.getChild("n11"));
  13879. this.n12 = (this.getChild("n12"));
  13880. this.n13 = (this.getChild("n13"));
  13881. this.n14 = (this.getChild("n14"));
  13882. this.n15 = (this.getChild("n15"));
  13883. this.n16 = (this.getChild("n16"));
  13884. this.n17 = (this.getChild("n17"));
  13885. this.n18 = (this.getChild("n18"));
  13886. this.n19 = (this.getChild("n19"));
  13887. this.n20 = (this.getChild("n20"));
  13888. this.n21 = (this.getChild("n21"));
  13889. this.n22 = (this.getChild("n22"));
  13890. this.n23 = (this.getChild("n23"));
  13891. this.n24 = (this.getChild("n24"));
  13892. this.n25 = (this.getChild("n25"));
  13893. this.n26 = (this.getChild("n26"));
  13894. this.n27 = (this.getChild("n27"));
  13895. this.n28 = (this.getChild("n28"));
  13896. this.n29 = (this.getChild("n29"));
  13897. this.n30 = (this.getChild("n30"));
  13898. this.n31 = (this.getChild("n31"));
  13899. this.n32 = (this.getChild("n32"));
  13900. this.n33 = (this.getChild("n33"));
  13901. }
  13902. }
  13903. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13904. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13905. static createInstance() {
  13906. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13907. }
  13908. onConstruct() {
  13909. this.n5 = (this.getChild("n5"));
  13910. this.n4 = (this.getChild("n4"));
  13911. this.t0 = this.getTransition("t0");
  13912. }
  13913. }
  13914. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13915. class ui_UITurntable_com5 extends fgui.GComponent {
  13916. static createInstance() {
  13917. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13918. }
  13919. onConstruct() {
  13920. this.flashNode = (this.getChild("flashNode"));
  13921. this.rotNode = (this.getChild("rotNode"));
  13922. this.n3 = (this.getChild("n3"));
  13923. this.n21 = (this.getChild("n21"));
  13924. this.t0 = this.getTransition("t0");
  13925. }
  13926. }
  13927. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  13928. class ui_UITurntable_com7 extends fgui.GComponent {
  13929. static createInstance() {
  13930. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  13931. }
  13932. onConstruct() {
  13933. this.n2 = (this.getChild("n2"));
  13934. this.n35 = (this.getChild("n35"));
  13935. this.img1 = (this.getChild("img1"));
  13936. this.img2 = (this.getChild("img2"));
  13937. this.img3 = (this.getChild("img3"));
  13938. this.img4 = (this.getChild("img4"));
  13939. this.img6 = (this.getChild("img6"));
  13940. this.img5 = (this.getChild("img5"));
  13941. this.txt1 = (this.getChild("txt1"));
  13942. this.txt2 = (this.getChild("txt2"));
  13943. this.txt3 = (this.getChild("txt3"));
  13944. this.txt4 = (this.getChild("txt4"));
  13945. this.txt5 = (this.getChild("txt5"));
  13946. this.txt6 = (this.getChild("txt6"));
  13947. }
  13948. }
  13949. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  13950. class ui_UITurntable_com9 extends fgui.GComponent {
  13951. static createInstance() {
  13952. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  13953. }
  13954. onConstruct() {
  13955. this.n38 = (this.getChild("n38"));
  13956. this.n39 = (this.getChild("n39"));
  13957. }
  13958. }
  13959. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  13960. class ui_UITurntable_com10 extends fgui.GComponent {
  13961. static createInstance() {
  13962. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  13963. }
  13964. onConstruct() {
  13965. this.n39 = (this.getChild("n39"));
  13966. this.n40 = (this.getChild("n40"));
  13967. this.t0 = this.getTransition("t0");
  13968. }
  13969. }
  13970. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  13971. class ui_UITurntable_com11 extends fgui.GComponent {
  13972. static createInstance() {
  13973. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  13974. }
  13975. onConstruct() {
  13976. this.n38 = (this.getChild("n38"));
  13977. this.n39 = (this.getChild("n39"));
  13978. this.n40 = (this.getChild("n40"));
  13979. this.t0 = this.getTransition("t0");
  13980. }
  13981. }
  13982. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  13983. class ui_UITurntable_com12 extends fgui.GComponent {
  13984. static createInstance() {
  13985. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  13986. }
  13987. onConstruct() {
  13988. this.n43 = (this.getChild("n43"));
  13989. this.barNode = (this.getChild("barNode"));
  13990. this.tipsTxt = (this.getChild("tipsTxt"));
  13991. this.n45 = (this.getChild("n45"));
  13992. this.boxBtn = (this.getChild("boxBtn"));
  13993. }
  13994. }
  13995. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  13996. class ui_UITurntable_com1 extends fgui.GButton {
  13997. static createInstance() {
  13998. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  13999. }
  14000. onConstruct() {
  14001. this.n41 = (this.getChild("n41"));
  14002. this.n42 = (this.getChild("n42"));
  14003. this.t0 = this.getTransition("t0");
  14004. }
  14005. }
  14006. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14007. class ui_UITurntable_com3 extends fgui.GComponent {
  14008. static createInstance() {
  14009. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14010. }
  14011. onConstruct() {
  14012. this.n48 = (this.getChild("n48"));
  14013. this.womanTxt = (this.getChild("womanTxt"));
  14014. this.t0 = this.getTransition("t0");
  14015. }
  14016. }
  14017. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14018. class ui_cancelBtn2 extends fgui.GButton {
  14019. static createInstance() {
  14020. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14021. }
  14022. onConstruct() {
  14023. this.c1 = this.getController("c1");
  14024. this.n0 = (this.getChild("n0"));
  14025. this.n1 = (this.getChild("n1"));
  14026. this.n2 = (this.getChild("n2"));
  14027. this.n3 = (this.getChild("n3"));
  14028. this.n4 = (this.getChild("n4"));
  14029. this.n5 = (this.getChild("n5"));
  14030. this.n6 = (this.getChild("n6"));
  14031. this.n7 = (this.getChild("n7"));
  14032. this.n8 = (this.getChild("n8"));
  14033. this.powerEft = (this.getChild("powerEft"));
  14034. }
  14035. }
  14036. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14037. class ui_shareBtn2 extends fgui.GButton {
  14038. static createInstance() {
  14039. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14040. }
  14041. onConstruct() {
  14042. this.c1 = this.getController("c1");
  14043. this.n2 = (this.getChild("n2"));
  14044. this.n24 = (this.getChild("n24"));
  14045. this.n1 = (this.getChild("n1"));
  14046. this.n3 = (this.getChild("n3"));
  14047. this.n23 = (this.getChild("n23"));
  14048. this.n4 = (this.getChild("n4"));
  14049. this.n5 = (this.getChild("n5"));
  14050. this.n6 = (this.getChild("n6"));
  14051. this.n20 = (this.getChild("n20"));
  14052. this.n21 = (this.getChild("n21"));
  14053. this.n22 = (this.getChild("n22"));
  14054. this.powerEft = (this.getChild("powerEft"));
  14055. }
  14056. }
  14057. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14058. class ui_UIMoney extends fgui.GComponent {
  14059. static createInstance() {
  14060. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14061. }
  14062. onConstruct() {
  14063. this.c1 = this.getController("c1");
  14064. this.n4 = (this.getChild("n4"));
  14065. this.coinImg = (this.getChild("coinImg"));
  14066. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14067. this.coinTxt = (this.getChild("coinTxt"));
  14068. this.n7 = (this.getChild("n7"));
  14069. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14070. this.diamondTxt = (this.getChild("diamondTxt"));
  14071. this.diamondImg = (this.getChild("diamondImg"));
  14072. this.n12 = (this.getChild("n12"));
  14073. this.powerImg = (this.getChild("powerImg"));
  14074. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14075. this.powerTxt = (this.getChild("powerTxt"));
  14076. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14077. }
  14078. }
  14079. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14080. class ui_backBtn extends fgui.GButton {
  14081. static createInstance() {
  14082. return (fgui.UIPackage.createObject("game", "backBtn"));
  14083. }
  14084. onConstruct() {
  14085. this.n0 = (this.getChild("n0"));
  14086. this.t0 = this.getTransition("t0");
  14087. this.t1 = this.getTransition("t1");
  14088. }
  14089. }
  14090. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14091. class ui_MoneyBtn extends fgui.GButton {
  14092. static createInstance() {
  14093. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14094. }
  14095. onConstruct() {
  14096. this.button = this.getController("button");
  14097. this.n0 = (this.getChild("n0"));
  14098. }
  14099. }
  14100. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14101. class ui_UIMoneyBtn extends fgui.GComponent {
  14102. static createInstance() {
  14103. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14104. }
  14105. onConstruct() {
  14106. this.n1 = (this.getChild("n1"));
  14107. this.closeBtn = (this.getChild("closeBtn"));
  14108. }
  14109. }
  14110. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14111. class ui_Component64 extends fgui.GComponent {
  14112. static createInstance() {
  14113. return (fgui.UIPackage.createObject("game", "Component64"));
  14114. }
  14115. onConstruct() {
  14116. this.n57 = (this.getChild("n57"));
  14117. this.n54 = (this.getChild("n54"));
  14118. this.n55 = (this.getChild("n55"));
  14119. this.n56 = (this.getChild("n56"));
  14120. this.t1 = this.getTransition("t1");
  14121. }
  14122. }
  14123. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14124. class ui_Component41_3 extends fgui.GComponent {
  14125. static createInstance() {
  14126. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14127. }
  14128. onConstruct() {
  14129. this.c1 = this.getController("c1");
  14130. this.n0 = (this.getChild("n0"));
  14131. this.n2 = (this.getChild("n2"));
  14132. this.cancelBtn = (this.getChild("cancelBtn"));
  14133. this.videoBtn = (this.getChild("videoBtn"));
  14134. this.n9 = (this.getChild("n9"));
  14135. this.n24 = (this.getChild("n24"));
  14136. this.n27 = (this.getChild("n27"));
  14137. this.titleTxt = (this.getChild("titleTxt"));
  14138. this.n28 = (this.getChild("n28"));
  14139. this.t0 = this.getTransition("t0");
  14140. }
  14141. }
  14142. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14143. class ui_dh_zs_4 extends fgui.GComponent {
  14144. static createInstance() {
  14145. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14146. }
  14147. onConstruct() {
  14148. this.n1 = (this.getChild("n1"));
  14149. this.n2 = (this.getChild("n2"));
  14150. this.n3 = (this.getChild("n3"));
  14151. this.n4 = (this.getChild("n4"));
  14152. this.n5 = (this.getChild("n5"));
  14153. this.n6 = (this.getChild("n6"));
  14154. this.n8 = (this.getChild("n8"));
  14155. this.t0 = this.getTransition("t0");
  14156. }
  14157. }
  14158. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14159. class ui_Component71_1 extends fgui.GButton {
  14160. static createInstance() {
  14161. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14162. }
  14163. onConstruct() {
  14164. this.n17 = (this.getChild("n17"));
  14165. this.t0 = this.getTransition("t0");
  14166. }
  14167. }
  14168. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14169. class ui_Component83 extends fgui.GComponent {
  14170. static createInstance() {
  14171. return (fgui.UIPackage.createObject("game", "Component83"));
  14172. }
  14173. onConstruct() {
  14174. this.c1 = this.getController("c1");
  14175. this.n17 = (this.getChild("n17"));
  14176. this.n19 = (this.getChild("n19"));
  14177. this.n20 = (this.getChild("n20"));
  14178. }
  14179. }
  14180. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14181. class ui_Component84 extends fgui.GComponent {
  14182. static createInstance() {
  14183. return (fgui.UIPackage.createObject("game", "Component84"));
  14184. }
  14185. onConstruct() {
  14186. this.c1 = this.getController("c1");
  14187. this.n4 = (this.getChild("n4"));
  14188. this.n22 = (this.getChild("n22"));
  14189. this.n23 = (this.getChild("n23"));
  14190. this.numTxt = (this.getChild("numTxt"));
  14191. this.n25 = (this.getChild("n25"));
  14192. this.n26 = (this.getChild("n26"));
  14193. }
  14194. }
  14195. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14196. class ui_Component84_1 extends fgui.GComponent {
  14197. static createInstance() {
  14198. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14199. }
  14200. onConstruct() {
  14201. this.c1 = this.getController("c1");
  14202. this.n4 = (this.getChild("n4"));
  14203. this.n22 = (this.getChild("n22"));
  14204. this.n23 = (this.getChild("n23"));
  14205. this.numTxt = (this.getChild("numTxt"));
  14206. this.n25 = (this.getChild("n25"));
  14207. this.n26 = (this.getChild("n26"));
  14208. }
  14209. }
  14210. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14211. class ui_Component85 extends fgui.GComponent {
  14212. static createInstance() {
  14213. return (fgui.UIPackage.createObject("game", "Component85"));
  14214. }
  14215. onConstruct() {
  14216. this.n1 = (this.getChild("n1"));
  14217. this.n6 = (this.getChild("n6"));
  14218. this.n2 = (this.getChild("n2"));
  14219. this.n3 = (this.getChild("n3"));
  14220. this.levelTxt = (this.getChild("levelTxt"));
  14221. this.n10 = (this.getChild("n10"));
  14222. this.n11 = (this.getChild("n11"));
  14223. this.n12 = (this.getChild("n12"));
  14224. this.n13 = (this.getChild("n13"));
  14225. this.n14 = (this.getChild("n14"));
  14226. this.modeNode = (this.getChild("modeNode"));
  14227. this.n18 = (this.getChild("n18"));
  14228. this.conditionTxt = (this.getChild("conditionTxt"));
  14229. this.diamondNode = (this.getChild("diamondNode"));
  14230. this.coinNode = (this.getChild("coinNode"));
  14231. this.startBtn = (this.getChild("startBtn"));
  14232. this.n28 = (this.getChild("n28"));
  14233. this.displayRoot = (this.getChild("displayRoot"));
  14234. this.t0 = this.getTransition("t0");
  14235. }
  14236. }
  14237. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14238. class ui_Component86 extends fgui.GButton {
  14239. static createInstance() {
  14240. return (fgui.UIPackage.createObject("game", "Component86"));
  14241. }
  14242. onConstruct() {
  14243. this.n15 = (this.getChild("n15"));
  14244. this.t0 = this.getTransition("t0");
  14245. }
  14246. }
  14247. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14248. class ui_Component87 extends fgui.GComponent {
  14249. static createInstance() {
  14250. return (fgui.UIPackage.createObject("game", "Component87"));
  14251. }
  14252. onConstruct() {
  14253. this.n66 = (this.getChild("n66"));
  14254. this.myProgress = (this.getChild("myProgress"));
  14255. this.starAni = (this.getChild("starAni"));
  14256. this.hpTxt = (this.getChild("hpTxt"));
  14257. this.n74 = (this.getChild("n74"));
  14258. this.n73 = (this.getChild("n73"));
  14259. this.ballTxt = (this.getChild("ballTxt"));
  14260. this.n76 = (this.getChild("n76"));
  14261. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14262. this.levelTxt = (this.getChild("levelTxt"));
  14263. this.star1 = (this.getChild("star1"));
  14264. this.star2 = (this.getChild("star2"));
  14265. this.star3 = (this.getChild("star3"));
  14266. }
  14267. }
  14268. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14269. class ui_Component88 extends fgui.GProgressBar {
  14270. static createInstance() {
  14271. return (fgui.UIPackage.createObject("game", "Component88"));
  14272. }
  14273. onConstruct() {
  14274. this.n68 = (this.getChild("n68"));
  14275. this.bar = (this.getChild("bar"));
  14276. }
  14277. }
  14278. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14279. class ui_Component89 extends fgui.GComponent {
  14280. static createInstance() {
  14281. return (fgui.UIPackage.createObject("game", "Component89"));
  14282. }
  14283. onConstruct() {
  14284. this.c1 = this.getController("c1");
  14285. this.n71 = (this.getChild("n71"));
  14286. this.n72 = (this.getChild("n72"));
  14287. }
  14288. }
  14289. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14290. class ui_Component90 extends fgui.GComponent {
  14291. static createInstance() {
  14292. return (fgui.UIPackage.createObject("game", "Component90"));
  14293. }
  14294. onConstruct() {
  14295. this.c1 = this.getController("c1");
  14296. this.n64 = (this.getChild("n64"));
  14297. this.n65 = (this.getChild("n65"));
  14298. this.n66 = (this.getChild("n66"));
  14299. this.t0 = this.getTransition("t0");
  14300. }
  14301. }
  14302. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14303. class ui_Component127 extends fgui.GButton {
  14304. static createInstance() {
  14305. return (fgui.UIPackage.createObject("game", "Component127"));
  14306. }
  14307. onConstruct() {
  14308. this.n5 = (this.getChild("n5"));
  14309. }
  14310. }
  14311. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14312. class gameBinder {
  14313. static bindAll() {
  14314. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14315. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14316. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14317. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14318. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14319. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14320. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14321. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14322. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14323. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14324. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14325. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14326. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14327. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14328. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14329. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14330. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14331. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14332. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14333. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14334. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14335. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14336. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14337. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14338. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14339. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14340. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14341. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14342. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14343. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14344. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14345. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14346. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14347. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14348. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14349. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14350. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14351. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14352. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14353. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14354. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14355. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14356. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14357. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14358. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14359. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14360. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14361. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14362. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14363. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14364. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14365. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14366. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14367. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14368. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14369. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14370. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14371. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14372. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14373. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14374. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14375. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14376. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14377. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14378. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14379. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14380. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14381. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14382. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14383. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14384. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14385. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14386. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14387. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14388. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14389. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14390. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14391. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14392. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14393. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14394. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14395. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14396. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14397. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14398. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14399. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14400. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14401. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14402. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14403. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14404. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14405. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14406. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14407. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14408. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14409. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14410. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14411. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14412. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14413. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14414. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14415. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14416. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14417. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14418. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14419. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14420. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14421. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14422. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14423. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14424. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14425. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14426. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14427. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14428. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14429. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14430. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14431. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14432. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14433. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14434. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14435. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14436. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14437. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14438. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14439. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14440. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14441. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14442. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14443. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14444. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14445. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14446. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14447. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14448. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14449. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14450. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14451. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14452. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14453. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14454. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14455. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14456. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14457. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14458. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14459. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14460. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14461. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14462. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14463. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14464. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14465. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14466. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14467. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14468. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14469. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14470. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14471. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14472. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14473. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14474. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14475. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14476. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14477. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14478. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14479. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14480. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14481. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14482. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14483. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14484. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14485. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14486. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14487. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14488. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14489. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14490. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14491. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14492. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14493. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14494. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14495. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14496. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14497. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14498. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14499. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14500. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14501. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14502. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14503. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14504. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14505. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14506. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14507. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14508. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14509. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14510. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14511. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14512. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14513. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14514. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14515. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14516. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14517. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14518. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14519. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14520. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14521. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14522. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14523. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14524. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14525. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14526. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14527. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14528. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14529. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14530. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14531. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14532. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14533. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14534. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14535. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14536. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14537. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14538. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14539. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14540. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14541. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14542. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14543. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14544. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14545. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14546. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14547. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14548. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14549. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14550. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14551. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14552. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14553. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14554. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14555. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14556. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14557. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14558. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14559. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14560. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14561. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14562. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14563. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14564. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14565. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14566. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14567. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14568. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14569. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14570. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14571. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14572. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14573. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14574. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14575. }
  14576. }
  14577. class ui_btn6 extends fgui.GButton {
  14578. static createInstance() {
  14579. return (fgui.UIPackage.createObject("loading", "btn6"));
  14580. }
  14581. onConstruct() {
  14582. this.n6 = (this.getChild("n6"));
  14583. this.n1 = (this.getChild("n1"));
  14584. }
  14585. }
  14586. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14587. class ui_xyItem extends fgui.GComponent {
  14588. static createInstance() {
  14589. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14590. }
  14591. onConstruct() {
  14592. this.xyItem = (this.getChild("xyItem"));
  14593. }
  14594. }
  14595. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14596. class ui_loadinfo extends fgui.GProgressBar {
  14597. static createInstance() {
  14598. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14599. }
  14600. onConstruct() {
  14601. this.bg = (this.getChild("bg"));
  14602. this.bar = (this.getChild("bar"));
  14603. this.title = (this.getChild("title"));
  14604. this.ani = (this.getChild("ani"));
  14605. }
  14606. }
  14607. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14608. class ui_xyNode extends fgui.GComponent {
  14609. static createInstance() {
  14610. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14611. }
  14612. onConstruct() {
  14613. this.n0 = (this.getChild("n0"));
  14614. this.btnYes = (this.getChild("btnYes"));
  14615. this.btnNo = (this.getChild("btnNo"));
  14616. this.btnKnown = (this.getChild("btnKnown"));
  14617. this.btnSure = (this.getChild("btnSure"));
  14618. this.txtWelcom = (this.getChild("txtWelcom"));
  14619. this.txtXy = (this.getChild("txtXy"));
  14620. this.n75 = (this.getChild("n75"));
  14621. this.btnXy1 = (this.getChild("btnXy1"));
  14622. this.btnXy3 = (this.getChild("btnXy3"));
  14623. this.btnXy2 = (this.getChild("btnXy2"));
  14624. this.n74 = (this.getChild("n74"));
  14625. this.xy1 = (this.getChild("xy1"));
  14626. this.txtTitle = (this.getChild("txtTitle"));
  14627. this.btnBack = (this.getChild("btnBack"));
  14628. this.xyList = (this.getChild("xyList"));
  14629. this.xy2 = (this.getChild("xy2"));
  14630. this.xyNode = (this.getChild("xyNode"));
  14631. }
  14632. }
  14633. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14634. class ui_ageNode extends fgui.GComponent {
  14635. static createInstance() {
  14636. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14637. }
  14638. onConstruct() {
  14639. this.n3 = (this.getChild("n3"));
  14640. this.n7 = (this.getChild("n7"));
  14641. this.n4 = (this.getChild("n4"));
  14642. this.btnAge = (this.getChild("btnAge"));
  14643. this.ageNode = (this.getChild("ageNode"));
  14644. }
  14645. }
  14646. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14647. class ui_rnNode extends fgui.GComponent {
  14648. static createInstance() {
  14649. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14650. }
  14651. onConstruct() {
  14652. this.n28 = (this.getChild("n28"));
  14653. this.n30 = (this.getChild("n30"));
  14654. this.n33 = (this.getChild("n33"));
  14655. this.rn1 = (this.getChild("rn1"));
  14656. this.n40 = (this.getChild("n40"));
  14657. this.n41 = (this.getChild("n41"));
  14658. this.rn3 = (this.getChild("rn3"));
  14659. this.n37 = (this.getChild("n37"));
  14660. this.n39 = (this.getChild("n39"));
  14661. this.rn2 = (this.getChild("rn2"));
  14662. this.n47 = (this.getChild("n47"));
  14663. this.n49 = (this.getChild("n49"));
  14664. this.n44 = (this.getChild("n44"));
  14665. this.inputCode = (this.getChild("inputCode"));
  14666. this.inputName = (this.getChild("inputName"));
  14667. this.n48 = (this.getChild("n48"));
  14668. this.n50 = (this.getChild("n50"));
  14669. this.rn4 = (this.getChild("rn4"));
  14670. this.btnCheck = (this.getChild("btnCheck"));
  14671. this.btnExit = (this.getChild("btnExit"));
  14672. this.btnDone = (this.getChild("btnDone"));
  14673. this.rnNode = (this.getChild("rnNode"));
  14674. }
  14675. }
  14676. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14677. class ui_tipNode extends fgui.GComponent {
  14678. static createInstance() {
  14679. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14680. }
  14681. onConstruct() {
  14682. this.bg = (this.getChild("bg"));
  14683. this.n55 = (this.getChild("n55"));
  14684. this.n56 = (this.getChild("n56"));
  14685. this.tipNode = (this.getChild("tipNode"));
  14686. }
  14687. }
  14688. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14689. class ui_fcmNode extends fgui.GComponent {
  14690. static createInstance() {
  14691. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14692. }
  14693. onConstruct() {
  14694. this.n63 = (this.getChild("n63"));
  14695. this.n62 = (this.getChild("n62"));
  14696. this.btnRn = (this.getChild("btnRn"));
  14697. this.n61 = (this.getChild("n61"));
  14698. this.n58 = (this.getChild("n58"));
  14699. this.fcmNode = (this.getChild("fcmNode"));
  14700. }
  14701. }
  14702. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14703. class ui_msgNode extends fgui.GComponent {
  14704. static createInstance() {
  14705. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14706. }
  14707. onConstruct() {
  14708. this.n69 = (this.getChild("n69"));
  14709. this.txtMsg = (this.getChild("txtMsg"));
  14710. this.msgNode = (this.getChild("msgNode"));
  14711. }
  14712. }
  14713. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14714. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14715. static createInstance() {
  14716. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14717. }
  14718. onConstruct() {
  14719. this.n1 = (this.getChild("n1"));
  14720. this.n13 = (this.getChild("n13"));
  14721. this.n14 = (this.getChild("n14"));
  14722. this.n15 = (this.getChild("n15"));
  14723. this.n3 = (this.getChild("n3"));
  14724. this.n4 = (this.getChild("n4"));
  14725. this.n5 = (this.getChild("n5"));
  14726. this.n6 = (this.getChild("n6"));
  14727. this.n7 = (this.getChild("n7"));
  14728. this.n8 = (this.getChild("n8"));
  14729. this.n9 = (this.getChild("n9"));
  14730. this.n10 = (this.getChild("n10"));
  14731. this.n12 = (this.getChild("n12"));
  14732. this.n11 = (this.getChild("n11"));
  14733. this.n16 = (this.getChild("n16"));
  14734. this.n17 = (this.getChild("n17"));
  14735. this.n18 = (this.getChild("n18"));
  14736. this.n20 = (this.getChild("n20"));
  14737. this.n21 = (this.getChild("n21"));
  14738. this.t0 = this.getTransition("t0");
  14739. }
  14740. }
  14741. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14742. class ui_btn5 extends fgui.GButton {
  14743. static createInstance() {
  14744. return (fgui.UIPackage.createObject("loading", "btn5"));
  14745. }
  14746. onConstruct() {
  14747. this.n9 = (this.getChild("n9"));
  14748. this.n1 = (this.getChild("n1"));
  14749. }
  14750. }
  14751. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14752. class ui_UILoading extends fgui.GComponent {
  14753. static createInstance() {
  14754. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14755. }
  14756. onConstruct() {
  14757. this.n12 = (this.getChild("n12"));
  14758. this.loadinfo = (this.getChild("loadinfo"));
  14759. this.n13 = (this.getChild("n13"));
  14760. this.txtLoad = (this.getChild("txtLoad"));
  14761. this.n18 = (this.getChild("n18"));
  14762. }
  14763. }
  14764. ui_UILoading.URL = "ui://37nctnhwphc33";
  14765. class ui_AgeItem extends fgui.GComponent {
  14766. static createInstance() {
  14767. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14768. }
  14769. onConstruct() {
  14770. this.txtAge = (this.getChild("txtAge"));
  14771. }
  14772. }
  14773. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14774. class ui_btn1 extends fgui.GButton {
  14775. static createInstance() {
  14776. return (fgui.UIPackage.createObject("loading", "btn1"));
  14777. }
  14778. onConstruct() {
  14779. this.n6 = (this.getChild("n6"));
  14780. this.n1 = (this.getChild("n1"));
  14781. }
  14782. }
  14783. ui_btn1.URL = "ui://37nctnhwxe622p";
  14784. class ui_btn3 extends fgui.GButton {
  14785. static createInstance() {
  14786. return (fgui.UIPackage.createObject("loading", "btn3"));
  14787. }
  14788. onConstruct() {
  14789. this.n9 = (this.getChild("n9"));
  14790. this.n1 = (this.getChild("n1"));
  14791. }
  14792. }
  14793. ui_btn3.URL = "ui://37nctnhwxe622s";
  14794. class ui_btn2 extends fgui.GButton {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("loading", "btn2"));
  14797. }
  14798. onConstruct() {
  14799. this.n6 = (this.getChild("n6"));
  14800. this.n1 = (this.getChild("n1"));
  14801. }
  14802. }
  14803. ui_btn2.URL = "ui://37nctnhwxe622t";
  14804. class ui_btnBack extends fgui.GButton {
  14805. static createInstance() {
  14806. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14807. }
  14808. onConstruct() {
  14809. this.n6 = (this.getChild("n6"));
  14810. this.n7 = (this.getChild("n7"));
  14811. }
  14812. }
  14813. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14814. class ui_btnXy1 extends fgui.GButton {
  14815. static createInstance() {
  14816. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14817. }
  14818. onConstruct() {
  14819. this.n1 = (this.getChild("n1"));
  14820. }
  14821. }
  14822. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14823. class ui_btnXy2 extends fgui.GButton {
  14824. static createInstance() {
  14825. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14826. }
  14827. onConstruct() {
  14828. this.n1 = (this.getChild("n1"));
  14829. }
  14830. }
  14831. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14832. class ui_btnXy3 extends fgui.GButton {
  14833. static createInstance() {
  14834. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14835. }
  14836. onConstruct() {
  14837. this.n1 = (this.getChild("n1"));
  14838. }
  14839. }
  14840. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14841. class ui_btn4 extends fgui.GButton {
  14842. static createInstance() {
  14843. return (fgui.UIPackage.createObject("loading", "btn4"));
  14844. }
  14845. onConstruct() {
  14846. this.n9 = (this.getChild("n9"));
  14847. this.n1 = (this.getChild("n1"));
  14848. }
  14849. }
  14850. ui_btn4.URL = "ui://37nctnhwxe622z";
  14851. class loadingBinder {
  14852. static bindAll() {
  14853. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14854. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14855. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14856. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14857. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14858. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14859. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14860. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14861. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14862. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14863. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14864. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14865. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14866. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14867. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14868. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14869. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14870. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14871. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14872. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14873. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14874. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14875. }
  14876. }
  14877. class UIMgr {
  14878. constructor() {
  14879. this._stage = null;
  14880. this._uiList = [];
  14881. this._showList = [];
  14882. this._bindPkgList = [];
  14883. this.uiIndex = 0;
  14884. }
  14885. static get inst() {
  14886. if (UIMgr._inst == null) {
  14887. UIMgr._inst = new UIMgr();
  14888. }
  14889. return UIMgr._inst;
  14890. }
  14891. setStage(s) {
  14892. if (this._stage) {
  14893. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14894. return;
  14895. }
  14896. this._stage = s;
  14897. }
  14898. init() {
  14899. this.setStage(Laya.stage);
  14900. fairygui.UIConfig.defaultFont = "微软雅黑";
  14901. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14902. fairygui.UIConfig.packageFileExtension = "obj";
  14903. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14904. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14905. fairygui.GRoot.inst.width = Laya.stage.width;
  14906. fairygui.GRoot.inst.height = Laya.stage.height;
  14907. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14908. }
  14909. addAllUpdate() {
  14910. this.uiIndex = 0;
  14911. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14912. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14913. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14914. }
  14915. }
  14916. }
  14917. bindFUI(pkgname) {
  14918. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  14919. return;
  14920. }
  14921. switch (pkgname) {
  14922. case fguiRes.loading:
  14923. fairygui.UIPackage.addPackage(pkgname);
  14924. loadingBinder.bindAll();
  14925. this._bindPkgList.push(pkgname);
  14926. break;
  14927. case fguiRes.game:
  14928. fairygui.UIPackage.addPackage(pkgname);
  14929. gameBinder.bindAll();
  14930. this._bindPkgList.push(pkgname);
  14931. break;
  14932. default:
  14933. break;
  14934. }
  14935. }
  14936. Show(cls, ...param) {
  14937. let nameStr = cls.uiName;
  14938. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14939. let temp = this._uiList[i];
  14940. let str = temp.className;
  14941. if (str == nameStr) {
  14942. if (temp.isMuti) {
  14943. if (temp.isHide) {
  14944. temp.show(...param);
  14945. this._uiList.splice(i, 1);
  14946. this._uiList.push(temp);
  14947. return temp;
  14948. }
  14949. }
  14950. else {
  14951. temp.show(...param);
  14952. this._uiList.splice(i, 1);
  14953. this._uiList.push(temp);
  14954. return temp;
  14955. }
  14956. }
  14957. }
  14958. let ui = new cls();
  14959. ui.className = nameStr;
  14960. this._showUI(ui, param);
  14961. return ui;
  14962. }
  14963. destroyUI(ui) {
  14964. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14965. let temp = this._uiList[i].className;
  14966. if (temp == ui.className) {
  14967. this._uiList.splice(i, 1);
  14968. break;
  14969. }
  14970. }
  14971. this.checkUIState();
  14972. }
  14973. _showUI(ui, param) {
  14974. this._uiList.push(ui);
  14975. ui.show(...param);
  14976. }
  14977. Hide(uiClass) {
  14978. let ui = this.getUI(uiClass);
  14979. if (ui && !ui.isHide) {
  14980. ui.hide();
  14981. }
  14982. }
  14983. getUI(ui) {
  14984. let nameStr = ui.uiName;
  14985. for (let index = 0; index < this._uiList.length; index++) {
  14986. let temp = this._uiList[index];
  14987. if (temp.className == nameStr) {
  14988. return temp;
  14989. }
  14990. }
  14991. return null;
  14992. }
  14993. isShow(cls) {
  14994. for (var i of this._uiList) {
  14995. if (i instanceof cls) {
  14996. return i.isShowing;
  14997. }
  14998. }
  14999. return false;
  15000. }
  15001. showUINum() {
  15002. let num = 0;
  15003. for (var i of this._uiList) {
  15004. if (i.isShowing) {
  15005. num++;
  15006. }
  15007. }
  15008. return num;
  15009. }
  15010. checkUIState() {
  15011. Laya.timer.clear(this, this._uiCheck);
  15012. Laya.timer.once(400, this, this._uiCheck);
  15013. }
  15014. _uiCheck() {
  15015. let showList = [];
  15016. for (var i of this._uiList) {
  15017. if (!i.isHide) {
  15018. showList.push(i);
  15019. }
  15020. }
  15021. for (let index = 0; index < showList.length; index++) {
  15022. if (index == showList.length - 1) {
  15023. showList[index].checkActive(true);
  15024. }
  15025. else {
  15026. showList[index].checkActive(false);
  15027. }
  15028. }
  15029. }
  15030. showTip(msg, time = 600, size = 30) {
  15031. }
  15032. }
  15033. class UIShowList {
  15034. }
  15035. class SoundMgr {
  15036. constructor() {
  15037. this.soundMax = 4;
  15038. this.isLoad = false;
  15039. this.soundMap = {};
  15040. this.isSound = true;
  15041. this.openShake = true;
  15042. SoundMgr._instance = this;
  15043. }
  15044. static getInstance() {
  15045. if (!this._instance) {
  15046. this._instance = new SoundMgr();
  15047. }
  15048. return this._instance;
  15049. }
  15050. init() {
  15051. console.log('zh:sm init 1');
  15052. Laya.SoundManager.autoReleaseSound = true;
  15053. Laya.SoundManager.autoStopMusic = true;
  15054. Laya.SoundManager.musicVolume = 0.3;
  15055. Laya.SoundManager.soundVolume = 0.5;
  15056. this.musicPlayed = false;
  15057. this.audioUrl = "asset/sound/ogg/";
  15058. console.log('zh:sm init 2');
  15059. console.log('zh:dev type ');
  15060. if (Laya.Browser.onAndroid) {
  15061. console.log('zh:dev type android');
  15062. this.audioUrl = "asset/sound/ogg/";
  15063. this.isLoad = true;
  15064. }
  15065. else {
  15066. console.log('zh:dev type not android');
  15067. this.audioUrl = "asset/sound/mp3/";
  15068. this.isLoad = true;
  15069. }
  15070. }
  15071. onSetting(isS) {
  15072. this.isSound = isS;
  15073. this.mute(!this.isSound);
  15074. }
  15075. clearCount() {
  15076. for (var key in this.soundMap) {
  15077. delete this.soundMap[key];
  15078. }
  15079. }
  15080. playMusic(path, loop = 0) {
  15081. console.log('zh:playMusic 1 PATH=' + path);
  15082. this.musicPath = path;
  15083. if (!this.isLoad)
  15084. console.log('zh:playMusic 2');
  15085. return;
  15086. if (!path || path == "")
  15087. console.log('zh:playMusic 3');
  15088. return;
  15089. if (!this.isSound)
  15090. console.log('zh:playMusic 4');
  15091. return;
  15092. this.musicPlayed = true;
  15093. console.log('zh:playMusic 5');
  15094. let url = this.getUrl(path);
  15095. console.log('zh:playMusic 6' + url);
  15096. if (Laya.Browser.onPC) {
  15097. console.log('zh:playMusic 7');
  15098. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15099. console.log('zh:playMusic 8');
  15100. this.play(url, loop);
  15101. }));
  15102. }
  15103. else
  15104. this.play(url, loop);
  15105. }
  15106. play(url, loop) {
  15107. Laya.SoundManager.playMusic(url, loop);
  15108. }
  15109. getUrl(path) {
  15110. let url = this.audioUrl + path;
  15111. if (Laya.Browser.onAndroid) {
  15112. url += ".ogg";
  15113. }
  15114. else {
  15115. url += ".mp3";
  15116. }
  15117. return url;
  15118. }
  15119. pauseMusic(pause) {
  15120. if (pause) {
  15121. this.mute(true);
  15122. }
  15123. else if (this.isSound)
  15124. this.mute(false);
  15125. }
  15126. stopMusic() {
  15127. Laya.SoundManager.stopMusic();
  15128. if (Moyu.isNeedPlatAudio) {
  15129. Moyu.stopMusic();
  15130. }
  15131. }
  15132. mute(mute) {
  15133. if (Moyu.isNeedPlatAudio) {
  15134. Moyu.pauseMusic(mute);
  15135. }
  15136. else {
  15137. Laya.SoundManager.musicMuted = mute;
  15138. if (!mute && !this.musicPlayed && this.musicPath) {
  15139. this.playMusic(this.musicPath);
  15140. }
  15141. }
  15142. }
  15143. stopSound(path) {
  15144. let url = this.getUrl(path);
  15145. Laya.SoundManager.stopSound(url);
  15146. }
  15147. playSound(path, loop = 1, soundMax = this.soundMax) {
  15148. if (!this.isLoad)
  15149. return;
  15150. if (!this.isSound)
  15151. return;
  15152. if (!path || path == "")
  15153. return;
  15154. let url = this.getUrl(path);
  15155. if (Moyu.isNeedPlatAudio) {
  15156. Moyu.playSound(path, loop == 0);
  15157. }
  15158. else {
  15159. let count = 1;
  15160. if (this.soundMap[path])
  15161. count = this.soundMap[path] + 1;
  15162. if (count > soundMax)
  15163. return;
  15164. this.soundMap[path] = count;
  15165. Laya.SoundManager.playSound(url, loop);
  15166. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15167. }
  15168. }
  15169. removePath(path) {
  15170. if (this.soundMap[path]) {
  15171. let count = this.soundMap[path];
  15172. count--;
  15173. if (count < 1)
  15174. delete this.soundMap[path];
  15175. else
  15176. this.soundMap[path] = count;
  15177. }
  15178. }
  15179. playBtnSound() {
  15180. this.playSound("btn");
  15181. }
  15182. playGetSound() {
  15183. }
  15184. playCloseUISound() {
  15185. }
  15186. }
  15187. SoundMgr._instance = null;
  15188. var Handler$1 = Laya.Handler;
  15189. var EResType;
  15190. (function (EResType) {
  15191. EResType[EResType["none"] = 0] = "none";
  15192. EResType[EResType["nromal"] = 1] = "nromal";
  15193. EResType[EResType["td"] = 2] = "td";
  15194. EResType[EResType["sk"] = 3] = "sk";
  15195. })(EResType || (EResType = {}));
  15196. class CResLoader {
  15197. constructor(doneCall, proCall) {
  15198. this.completrCall = doneCall;
  15199. this.progressCall = proCall;
  15200. this.progressHander = new Handler$1(this, this.onProgress);
  15201. this.tdResMap = {};
  15202. }
  15203. load(resList) {
  15204. this.resCount = 0;
  15205. this.loadCount = 0;
  15206. for (let i = 0; i < resList.length; i++) {
  15207. let path = resList[i];
  15208. if (!path)
  15209. continue;
  15210. this.resCount++;
  15211. let type = this.getResType(path);
  15212. if (type == EResType.nromal)
  15213. this.loadNromal(path);
  15214. else if (type == EResType.td)
  15215. this.loadTd(path);
  15216. }
  15217. }
  15218. getRes(path) {
  15219. let type = this.getResType(path);
  15220. if (type == EResType.nromal)
  15221. return Laya.loader.getRes(path);
  15222. else if (type == EResType.td) {
  15223. let res = this.tdResMap[path];
  15224. if (res)
  15225. return res.clone();
  15226. return null;
  15227. }
  15228. }
  15229. destroy() {
  15230. this.progressHander.clear();
  15231. this.progressHander = null;
  15232. }
  15233. clearRes(path) {
  15234. let type = this.getResType(path);
  15235. if (type == EResType.nromal)
  15236. Laya.loader.clearRes(path);
  15237. else if (type == EResType.td) {
  15238. let obj = this.tdResMap[path];
  15239. if (obj)
  15240. obj.destroy();
  15241. delete this.tdResMap[path];
  15242. }
  15243. }
  15244. getResType(path) {
  15245. let exs = this.getExtension(path);
  15246. if (exs == "sk")
  15247. return EResType.sk;
  15248. if (exs == "ls" || exs == "lh" || exs == "lm")
  15249. return EResType.td;
  15250. else
  15251. return EResType.nromal;
  15252. }
  15253. getExtension(res) {
  15254. var index = res.lastIndexOf(".");
  15255. return res.substr(index + 1);
  15256. }
  15257. loadNromal(path) {
  15258. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15259. if (res) {
  15260. this.onLoad();
  15261. }
  15262. else
  15263. console.log("load res fail:" + path);
  15264. }), this.progressHander);
  15265. }
  15266. loadSk() {
  15267. }
  15268. loadTd(path) {
  15269. if (this.tdResMap[path]) {
  15270. this.onLoad();
  15271. return;
  15272. }
  15273. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15274. if (res) {
  15275. this.tdResMap[path] = res;
  15276. this.onLoad();
  15277. }
  15278. else
  15279. console.log("load res fail:" + path);
  15280. }));
  15281. }
  15282. onLoad() {
  15283. this.loadCount++;
  15284. this.onProgress(1);
  15285. if (this.loadCount >= this.resCount) {
  15286. this.completrCall.run();
  15287. }
  15288. }
  15289. onProgress(pro) {
  15290. let progress = (this.loadCount + pro) / this.resCount;
  15291. this.progressCall.runWith(progress);
  15292. }
  15293. }
  15294. var Handler$2 = Laya.Handler;
  15295. class ResInfo {
  15296. constructor() {
  15297. this.index = 0;
  15298. }
  15299. }
  15300. class ResMgr {
  15301. constructor() {
  15302. this.resList = [];
  15303. this.doneList = [];
  15304. this.resMap = {};
  15305. this.currentLoad = null;
  15306. this.completeHandler = new Handler$2(this, this.onComplete);
  15307. this.progressHandler = new Handler$2(this, this.onProgress);
  15308. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15309. }
  15310. static getInstance() {
  15311. if (ResMgr._instance == null) {
  15312. ResMgr._instance = new ResMgr();
  15313. }
  15314. return ResMgr._instance;
  15315. }
  15316. loadList(list, completeHandler, progressHandler) {
  15317. if (list.length < 1) {
  15318. completeHandler.run();
  15319. return;
  15320. }
  15321. let info = this.getResInfo();
  15322. info.resList = list;
  15323. info.completeHandler = completeHandler;
  15324. info.progressHandler = progressHandler;
  15325. this.resList.push(info);
  15326. this.startLoad();
  15327. }
  15328. loadFguiRes(list, completeHandler, progressHandler) {
  15329. Laya.loader.load(list, completeHandler, progressHandler);
  15330. }
  15331. loadAny(list, completeHandler, progressHandler) {
  15332. Laya.loader.load(list, completeHandler, progressHandler);
  15333. }
  15334. load(path, completeHandler, progressHandler) {
  15335. let count = this.resMap[path];
  15336. if (count && count > 0) {
  15337. if (completeHandler)
  15338. completeHandler.run();
  15339. }
  15340. else
  15341. this.loadList([path], completeHandler, progressHandler);
  15342. }
  15343. getRes(path) {
  15344. let res = this.resMap[path];
  15345. if (!res)
  15346. this.showLog("资源不存在:" + path);
  15347. else
  15348. return this.loader.getRes(path);
  15349. }
  15350. clearList(list, force = false) {
  15351. if (!list || list.length < 1)
  15352. return;
  15353. let cr = () => {
  15354. for (const k in list) {
  15355. let v = list[k];
  15356. if (!v)
  15357. continue;
  15358. if (force) {
  15359. this.loader.clearRes(v);
  15360. delete this.resMap[v];
  15361. }
  15362. else {
  15363. let count = this.resMap[v];
  15364. if (count && count > 1) {
  15365. count--;
  15366. this.resMap[v] = count;
  15367. }
  15368. else {
  15369. this.loader.clearRes(v);
  15370. delete this.resMap[v];
  15371. }
  15372. }
  15373. }
  15374. if (!window.hasOwnProperty("ks"))
  15375. Laya.Resource.destroyUnusedResources();
  15376. };
  15377. Laya.timer.clearAll(this);
  15378. Laya.timer.once(2000, this, cr);
  15379. }
  15380. clear3D() {
  15381. for (const k in this.loader.tdResMap) {
  15382. this.loader.clearRes(k);
  15383. if (this.resMap[k])
  15384. delete this.resMap[k];
  15385. }
  15386. if (!window.hasOwnProperty("ks"))
  15387. Laya.Resource.destroyUnusedResources();
  15388. }
  15389. clear(path, force = false) {
  15390. this.clearList([path], force);
  15391. }
  15392. getResInfo() {
  15393. if (this.doneList.length > 0)
  15394. return this.doneList.pop();
  15395. else
  15396. return new ResInfo();
  15397. }
  15398. startLoad() {
  15399. if (this.currentLoad)
  15400. return;
  15401. this.currentLoad = this.resList.pop();
  15402. if (this.currentLoad) {
  15403. this.loader.load(this.currentLoad.resList);
  15404. }
  15405. }
  15406. onComplete() {
  15407. if (!this.currentLoad)
  15408. return;
  15409. for (const k in this.currentLoad.resList) {
  15410. let v = this.currentLoad.resList[k];
  15411. let count = this.resMap[v];
  15412. if (count)
  15413. count++;
  15414. else
  15415. count = 1;
  15416. this.resMap[v] = count;
  15417. }
  15418. if (this.currentLoad.completeHandler)
  15419. this.currentLoad.completeHandler.run();
  15420. this.doneList.push(this.currentLoad);
  15421. this.currentLoad = null;
  15422. this.startLoad();
  15423. }
  15424. onProgress(pro) {
  15425. if (!this.currentLoad)
  15426. return;
  15427. if (this.currentLoad.progressHandler)
  15428. this.currentLoad.progressHandler.runWith(pro);
  15429. }
  15430. showLog(str, ...args) {
  15431. console.log("[ResLoader] " + str);
  15432. }
  15433. }
  15434. ResMgr._instance = null;
  15435. class EventMgr extends Laya.EventDispatcher {
  15436. }
  15437. let eventMgr = new EventMgr();
  15438. class ConfigMgr {
  15439. static getInstance() {
  15440. if (!this._instance) {
  15441. this._instance = new ConfigMgr();
  15442. }
  15443. return this._instance;
  15444. }
  15445. init() {
  15446. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15447. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15448. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15449. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15450. }
  15451. getUserInfoByIndex(index) {
  15452. return this.npcJson[index];
  15453. }
  15454. getRandomUserInfo() {
  15455. let index = xGame.tools.random(0, this.npcJson.length);
  15456. return this.npcJson[index];
  15457. }
  15458. getMaxBigMoveLength() {
  15459. return Object.keys(this.levelCfg).length;
  15460. }
  15461. getBigMoveLevelByIndex(index) {
  15462. let cfg = this.levelCfg;
  15463. cfg = cfg[index];
  15464. return cfg;
  15465. }
  15466. getRandomClassicLevel() {
  15467. let cfg = this.classicCfg;
  15468. let num = Object.keys(cfg).length;
  15469. let rand = xGame.common.randomNum(1, num);
  15470. return cfg[rand];
  15471. }
  15472. getPlaceBallByLevel(level) {
  15473. return this.placeBallCfg[level];
  15474. }
  15475. getMaxPlaceBall() {
  15476. return Object.keys(this.placeBallCfg).length;
  15477. }
  15478. }
  15479. class PoolD3Mgr {
  15480. constructor() {
  15481. this.pool = {};
  15482. }
  15483. static get ins() {
  15484. return this._ins || (this._ins = new PoolD3Mgr);
  15485. }
  15486. createList(key, prefab, parent) {
  15487. if (!this.pool[key]) {
  15488. this.pool[key] = {};
  15489. this.pool[key].prefab = prefab;
  15490. this.pool[key].list = [];
  15491. this.pool[key].parent = parent;
  15492. }
  15493. }
  15494. getItem(key) {
  15495. if (!this.pool[key]) {
  15496. return;
  15497. }
  15498. let temp;
  15499. if (this.pool[key].list.length > 0) {
  15500. temp = this.pool[key].list.pop();
  15501. }
  15502. else {
  15503. temp = this.pool[key].prefab.clone();
  15504. if (this.pool[key].parent) {
  15505. this.pool[key].parent.addChild(temp);
  15506. }
  15507. }
  15508. temp.active = true;
  15509. return temp;
  15510. }
  15511. putItem(key, obj) {
  15512. if (!this.pool[key]) {
  15513. return;
  15514. }
  15515. obj.active = false;
  15516. this.pool[key].list.push(obj);
  15517. }
  15518. }
  15519. let context$1 = context;
  15520. let uiMgr = UIMgr.inst;
  15521. let soundMgr = SoundMgr.getInstance();
  15522. let resMgr = ResMgr.getInstance();
  15523. let httpMgr = HttpMgr.getInstance();
  15524. let common = Common.getInstance();
  15525. let cfgMgr = ConfigMgr.getInstance();
  15526. let poolD3Mgr = PoolD3Mgr.ins;
  15527. let d3TexUrl = "res/d3Res/";
  15528. let d3ModeUrl = "res/unityRes/";
  15529. function setStageSize(view) {
  15530. if (view.width) {
  15531. view.width = Laya.stage.width;
  15532. view.height = Laya.stage.height;
  15533. }
  15534. }
  15535. function filledBg(view) {
  15536. let wh = Laya.stage.height / Laya.stage.width;
  15537. if (wh > 16 / 9) {
  15538. view.height = Laya.stage.height;
  15539. view.width = Laya.stage.height / 1334 * 750;
  15540. }
  15541. else {
  15542. view.width = Laya.stage.width;
  15543. view.height = Laya.stage.width / 750 * 1334;
  15544. }
  15545. }
  15546. function setNotch(view) {
  15547. if (view.height) {
  15548. view.y += context$1.notchHeight;
  15549. }
  15550. }
  15551. function showTip(str) {
  15552. uiMgr.Show(UIMsg, str);
  15553. }
  15554. function log(...args) {
  15555. console.log(args);
  15556. }
  15557. let xGame = {
  15558. context: context$1,
  15559. eventMgr,
  15560. resMgr,
  15561. uiMgr,
  15562. soundMgr,
  15563. define,
  15564. tools,
  15565. httpMgr,
  15566. d3TexUrl,
  15567. d3ModeUrl,
  15568. common,
  15569. cfgMgr,
  15570. poolD3Mgr,
  15571. setStageSize,
  15572. filledBg,
  15573. setNotch,
  15574. showTip,
  15575. log,
  15576. };
  15577. window["xGame"] = xGame;
  15578. let dataName = 'tBall_';
  15579. class UserData {
  15580. constructor() {
  15581. this.userId = "";
  15582. this.isAgree = false;
  15583. this.coinNum = 0;
  15584. this.gemNum = 0;
  15585. this.sound = true;
  15586. this.vibration = true;
  15587. this.currentDate = 0;
  15588. this.createTime = 0;
  15589. this.awardTime = 0;
  15590. this.roleId = 1;
  15591. this.roleList = [];
  15592. this.roleAds = [];
  15593. this.dressId = 101;
  15594. this.itemId = 201;
  15595. this.bigSkills = [1, 1, 1, 1, 1];
  15596. this.coin = 4000;
  15597. this.diamond = 0;
  15598. this.skillSuccessTimes = 0;
  15599. this.skillGuide = 0;
  15600. this.skillAccTimes = 0;
  15601. this.placeBallData = [];
  15602. this.shareDiamondTimes = 0;
  15603. this.dailyVideoShareTimes = 0;
  15604. this.secretary = [1, 0];
  15605. this.curSecretary = 0;
  15606. this.ballRod = [1, 0, 0, 0, 0, 1];
  15607. this.curBallRod = 5;
  15608. this.signData = 0;
  15609. this.signTime = 0;
  15610. this.drawTimes = 0;
  15611. this.drawAwardTimes = 0;
  15612. this.dailyfreeDrawTimes = 1;
  15613. this.power = 5;
  15614. this.powerTime = 0;
  15615. this.challengeTimes = 0;
  15616. this.extraSign = 0;
  15617. this.classicTimes = 0;
  15618. this.guideHelpLine = 0;
  15619. this.newUser = true;
  15620. this.rootBallFoul = 0;
  15621. this.timeoutFoul = 0;
  15622. this.roleList = [1];
  15623. }
  15624. saveData() {
  15625. let data = {};
  15626. for (let k in this) {
  15627. data[k.toString()] = this[k];
  15628. }
  15629. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15630. }
  15631. getData() {
  15632. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15633. if (ld) {
  15634. let localData = JSON.parse(ld);
  15635. if (localData) {
  15636. for (let k in this) {
  15637. let key = k.toString();
  15638. let data = localData[key];
  15639. if (data != undefined) {
  15640. this[k] = data;
  15641. }
  15642. }
  15643. }
  15644. }
  15645. }
  15646. }
  15647. class ItemData {
  15648. constructor() {
  15649. this.itemList = {};
  15650. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15651. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15652. }
  15653. saveData() {
  15654. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15655. }
  15656. getData() {
  15657. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15658. if (ld) {
  15659. let localData = JSON.parse(ld);
  15660. if (localData) {
  15661. this.itemList = localData;
  15662. }
  15663. }
  15664. }
  15665. }
  15666. class GameData {
  15667. constructor() {
  15668. this.curLevel = 0;
  15669. this.gameType = 1;
  15670. this.signIdx = 0;
  15671. this.signMax = 0;
  15672. this.rotaryTime = 0;
  15673. this.rotaryCount = 0;
  15674. this.rotaryList = [];
  15675. this.diyCount = 3;
  15676. this.awardIdx = 0;
  15677. this.shareNum = 2;
  15678. this.rankWeek = 0;
  15679. this.rankScore = 0;
  15680. this.gameCount = 0;
  15681. this.trySkill = -1;
  15682. this.tryTime = 0;
  15683. }
  15684. saveData() {
  15685. let data = {};
  15686. for (let k in this) {
  15687. data[k.toString()] = this[k];
  15688. }
  15689. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15690. }
  15691. getData() {
  15692. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15693. if (ld) {
  15694. let localData = JSON.parse(ld);
  15695. if (localData) {
  15696. for (let k in this) {
  15697. let key = k.toString();
  15698. let data = localData[key];
  15699. if (data != undefined) {
  15700. this[k] = data;
  15701. }
  15702. }
  15703. }
  15704. }
  15705. }
  15706. }
  15707. class DataMgr {
  15708. static Init() {
  15709. this.userData = new UserData();
  15710. this.gameData = new GameData();
  15711. this.itemData = new ItemData();
  15712. this.userData.getData();
  15713. this.gameData.getData();
  15714. this.itemData.getData();
  15715. this.roleId = this.userData.roleId;
  15716. this.resetUse();
  15717. }
  15718. static isNewDay() {
  15719. Moyu.isNewDay(this, (isnew) => {
  15720. xGame.common.isNewDay = isnew;
  15721. if (!isnew)
  15722. return;
  15723. DataMgr.setShareDiamondTimes(0, false);
  15724. DataMgr.setDailyVideoShareTimes(0, false);
  15725. DataMgr.setDailyfreeDrawTimes(1);
  15726. DataMgr.setExtraSign(0);
  15727. });
  15728. }
  15729. static deletData() {
  15730. Laya.LocalStorage.clear();
  15731. }
  15732. static upRankData() {
  15733. let num = xGame.common.getAllStarNum();
  15734. if (num > 0)
  15735. Moyu.upRankData(xGame.common.curRankID, num);
  15736. }
  15737. static addItem(id, count = 1) {
  15738. let v = this.itemData.itemList[id];
  15739. if (!v)
  15740. v = { id: id, count: count, adnum: 0, active: true };
  15741. else {
  15742. if (v.active) {
  15743. v.count += count;
  15744. }
  15745. else {
  15746. v.count = count;
  15747. v.active = true;
  15748. }
  15749. }
  15750. this.itemData.itemList[id] = v;
  15751. xGame.soundMgr.playGetSound();
  15752. this.saveItemData();
  15753. }
  15754. static hasItem(id) {
  15755. let v = this.itemData.itemList[id];
  15756. if (v && v.active)
  15757. return true;
  15758. return false;
  15759. }
  15760. static getItem(id) {
  15761. let v = this.itemData.itemList[id];
  15762. return v;
  15763. }
  15764. static getItemCount(id) {
  15765. let v = this.itemData.itemList[id];
  15766. if (v && v.active)
  15767. return v.count;
  15768. return 0;
  15769. }
  15770. static getItemAd(id) {
  15771. let v = this.itemData.itemList[id];
  15772. if (v) {
  15773. return v.adnum;
  15774. }
  15775. return 0;
  15776. }
  15777. static onItemAd(id, num = 1) {
  15778. let v = this.itemData.itemList[id];
  15779. if (!v)
  15780. v = { id: id, count: 1, adnum: num, active: false };
  15781. else
  15782. v.adnum += num;
  15783. this.itemData.itemList[id] = v;
  15784. this.saveItemData();
  15785. }
  15786. static costItem(id, count) {
  15787. let v = this.itemData.itemList[id];
  15788. if (v && v.active) {
  15789. if (v.count < count)
  15790. return false;
  15791. else {
  15792. v.count -= count;
  15793. this.itemData.itemList[id] = v;
  15794. return true;
  15795. }
  15796. }
  15797. return false;
  15798. }
  15799. static resetUse() {
  15800. this.dressId = this.userData.dressId;
  15801. this.itemId = this.userData.itemId;
  15802. }
  15803. static passLevel() {
  15804. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15805. this.gameData.curLevel++;
  15806. this.curLevel = this.gameData.curLevel;
  15807. this.saveGameData();
  15808. }
  15809. static useRole(id) {
  15810. this.roleId = id;
  15811. if (this.hasRole(id)) {
  15812. this.userData.roleId = id;
  15813. this.saveUserData();
  15814. }
  15815. }
  15816. static addRole(id) {
  15817. if (this.hasRole(id))
  15818. return;
  15819. this.userData.roleList.push(id);
  15820. this.saveUserData();
  15821. }
  15822. static hasRole(id) {
  15823. return this.userData.roleList.indexOf(id) >= 0;
  15824. }
  15825. static gemEnough(num) {
  15826. return this.userData.gemNum >= num;
  15827. }
  15828. static roleHasAd(id) {
  15829. let count = this.userData.roleAds[id];
  15830. if (count != undefined && count >= 0)
  15831. return true;
  15832. else
  15833. return false;
  15834. }
  15835. static saveUserData(time = 1000, event, arg) {
  15836. if (this.userSaving)
  15837. return;
  15838. this.userSaving = true;
  15839. Laya.timer.once(time, this, () => {
  15840. this.userSaving = false;
  15841. this.userData.saveData();
  15842. if (event)
  15843. xGame.eventMgr.event(event, arg);
  15844. });
  15845. }
  15846. static saveGameData() {
  15847. if (this.gameSaving)
  15848. return;
  15849. this.gameSaving = true;
  15850. Laya.timer.once(1000, this, () => {
  15851. this.gameSaving = false;
  15852. this.gameData.saveData();
  15853. });
  15854. }
  15855. static saveItemData() {
  15856. let fun = () => {
  15857. this.itemData.saveData();
  15858. };
  15859. Laya.timer.clear(this, fun);
  15860. Laya.timer.once(500, this, fun);
  15861. }
  15862. static saveData() {
  15863. this.saveUserData();
  15864. this.saveGameData();
  15865. }
  15866. static getBigSkillList() {
  15867. return this.userData.bigSkills;
  15868. }
  15869. static getBigSkillByIndex(index) {
  15870. return this.userData.bigSkills[index];
  15871. }
  15872. static setBigSkill(index, val, addUp = true) {
  15873. if (addUp) {
  15874. this.userData.bigSkills[index] += val;
  15875. }
  15876. else {
  15877. this.userData.bigSkills[index] = val;
  15878. }
  15879. this.saveUserData();
  15880. }
  15881. static coinEnough(need) {
  15882. if (typeof need != "number") {
  15883. console.error("金币格式错误");
  15884. return;
  15885. }
  15886. return this.userData.coin >= need;
  15887. }
  15888. static setCoin(val) {
  15889. if (typeof val != "number") {
  15890. return;
  15891. }
  15892. this.userData.coin += val;
  15893. this.saveUserData();
  15894. xGame.eventMgr.event(COIN_CHANGE);
  15895. }
  15896. static getCoin() {
  15897. return this.userData.coin;
  15898. }
  15899. static diamondEnough(need) {
  15900. if (typeof need != "number") {
  15901. console.error("金币格式错误");
  15902. return;
  15903. }
  15904. return this.userData.diamond >= need;
  15905. }
  15906. static setDiamond(val) {
  15907. if (typeof val != "number") {
  15908. return;
  15909. }
  15910. this.userData.diamond += val;
  15911. this.saveUserData();
  15912. xGame.eventMgr.event(DIAMOND_CHANGE);
  15913. }
  15914. static getDiamond() {
  15915. return this.userData.diamond;
  15916. }
  15917. static getSkillSuccessTimes() {
  15918. return this.userData.skillSuccessTimes;
  15919. }
  15920. static setSkillSuccessTimes(val, addUp = true) {
  15921. if (addUp)
  15922. this.userData.skillSuccessTimes += val;
  15923. else
  15924. this.userData.skillSuccessTimes = val;
  15925. this.saveUserData();
  15926. }
  15927. static getSkillAccTimes() {
  15928. return this.userData.skillAccTimes;
  15929. }
  15930. static setSkillAccTimes(val) {
  15931. this.userData.skillAccTimes += val;
  15932. this.saveUserData();
  15933. }
  15934. static getSkillGuide() {
  15935. if (!xGame.common.openGuide) {
  15936. return 1;
  15937. }
  15938. return this.userData.skillGuide;
  15939. }
  15940. static setSkillGuide(val) {
  15941. this.userData.skillGuide = val;
  15942. this.saveUserData();
  15943. }
  15944. static getPlaceBallLevelList() {
  15945. return this.userData.placeBallData;
  15946. }
  15947. static getPlaceBallLevel(level) {
  15948. let arr = this.userData.placeBallData;
  15949. let index = level - 1;
  15950. let out;
  15951. if (arr[index]) {
  15952. out = arr[index];
  15953. }
  15954. else {
  15955. let max = arr.length;
  15956. if (max == index) {
  15957. out = {
  15958. star: 0,
  15959. play: true,
  15960. isCur: true,
  15961. getAward: false
  15962. };
  15963. }
  15964. else {
  15965. out = {
  15966. star: 0,
  15967. play: false,
  15968. getAward: false
  15969. };
  15970. }
  15971. }
  15972. return out;
  15973. }
  15974. static setPlaceBallLevel(level, star) {
  15975. let arr = this.userData.placeBallData;
  15976. let index = level - 1;
  15977. if (arr[index]) {
  15978. arr[index].star = Math.max(arr[index].star, star);
  15979. }
  15980. else {
  15981. let max = arr.length;
  15982. if (max == index) {
  15983. arr.push({
  15984. star: star,
  15985. play: true,
  15986. getAward: false
  15987. });
  15988. }
  15989. else {
  15990. console.error("关卡存储出错");
  15991. }
  15992. }
  15993. this.saveUserData();
  15994. }
  15995. static setPlaceBallAward(level) {
  15996. let arr = this.userData.placeBallData;
  15997. let index = level - 1;
  15998. if (arr[index]) {
  15999. arr[index].getAward = true;
  16000. }
  16001. this.saveUserData();
  16002. }
  16003. static getShareDiamondTimes() {
  16004. return this.userData.shareDiamondTimes;
  16005. }
  16006. static setShareDiamondTimes(val, addUp = true) {
  16007. if (addUp) {
  16008. this.userData.shareDiamondTimes += val;
  16009. }
  16010. else {
  16011. this.userData.shareDiamondTimes = val;
  16012. }
  16013. this.saveUserData();
  16014. }
  16015. static getDailyVideoShareTimes() {
  16016. return this.userData.dailyVideoShareTimes;
  16017. }
  16018. static setDailyVideoShareTimes(val, addUp = true) {
  16019. if (addUp) {
  16020. this.userData.dailyVideoShareTimes += val;
  16021. }
  16022. else {
  16023. this.userData.dailyVideoShareTimes = val;
  16024. }
  16025. this.saveUserData();
  16026. }
  16027. static getSecretary(index) {
  16028. return this.userData.secretary[index];
  16029. }
  16030. static setSecretary(index, val) {
  16031. this.userData.secretary[index] = val;
  16032. this.saveUserData();
  16033. }
  16034. static getCurSecretary() {
  16035. return this.userData.curSecretary;
  16036. }
  16037. static setCurSecretary(index) {
  16038. this.userData.curSecretary = index;
  16039. this.saveUserData();
  16040. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16041. }
  16042. static getBallRod(index) {
  16043. return this.userData.ballRod[index];
  16044. }
  16045. static setBallRod(index, val) {
  16046. this.userData.ballRod[index] = val;
  16047. this.saveUserData();
  16048. }
  16049. static getCurBallRod() {
  16050. return this.userData.curBallRod;
  16051. }
  16052. static setCurBallRod(index) {
  16053. this.userData.curBallRod = index;
  16054. this.saveUserData();
  16055. }
  16056. static setSignData(val) {
  16057. this.userData.signData = val;
  16058. this.saveUserData();
  16059. }
  16060. static getSignData() {
  16061. return this.userData.signData;
  16062. }
  16063. static setSignTime(val) {
  16064. this.userData.signTime = val;
  16065. this.saveUserData();
  16066. }
  16067. static getSignTime() {
  16068. return this.userData.signTime;
  16069. }
  16070. static getDrawTimes() {
  16071. return this.userData.drawTimes;
  16072. }
  16073. static setDrawTimes(val, addUp = true) {
  16074. if (addUp) {
  16075. this.userData.drawTimes += val;
  16076. }
  16077. else {
  16078. this.userData.drawTimes = val;
  16079. }
  16080. this.saveUserData();
  16081. }
  16082. static getDrawAwardTimes() {
  16083. return this.userData.drawAwardTimes;
  16084. }
  16085. static setDrawAwardTimes(val) {
  16086. this.userData.drawAwardTimes = val;
  16087. this.saveUserData();
  16088. }
  16089. static getDailyfreeDrawTimes() {
  16090. return this.userData.dailyfreeDrawTimes;
  16091. }
  16092. static setDailyfreeDrawTimes(val) {
  16093. this.userData.dailyfreeDrawTimes = val;
  16094. this.saveUserData();
  16095. }
  16096. static setPower(val, addUp = true) {
  16097. if (addUp)
  16098. this.userData.power += val;
  16099. else
  16100. this.userData.power = val;
  16101. if (this.userData.power >= xGame.common.maxPower) {
  16102. this.userData.power = xGame.common.maxPower;
  16103. }
  16104. xGame.eventMgr.event(POWER_CHANGE, val);
  16105. this.saveUserData();
  16106. }
  16107. static getPower() {
  16108. return this.userData.power;
  16109. }
  16110. static setPowerTime(val) {
  16111. this.userData.powerTime = val;
  16112. this.saveUserData();
  16113. }
  16114. static getPowerTime() {
  16115. return this.userData.powerTime;
  16116. }
  16117. static powerEnough() {
  16118. return this.getPower() > 0;
  16119. }
  16120. static getChallengeTimes() {
  16121. return this.userData.challengeTimes;
  16122. }
  16123. static setChallengeTimes(val) {
  16124. this.userData.challengeTimes += val;
  16125. this.saveUserData();
  16126. }
  16127. static getExtraSign() {
  16128. return this.userData.extraSign;
  16129. }
  16130. static setExtraSign(val) {
  16131. this.userData.extraSign = val;
  16132. this.saveUserData();
  16133. }
  16134. static getClassicTimes() {
  16135. return this.userData.classicTimes;
  16136. }
  16137. static setClassicTimes() {
  16138. this.userData.classicTimes += 1;
  16139. this.saveUserData();
  16140. }
  16141. static getGuideHelpLine() {
  16142. return this.userData.guideHelpLine;
  16143. }
  16144. static setGuideHelpLine() {
  16145. this.userData.guideHelpLine = 1;
  16146. this.saveUserData();
  16147. }
  16148. static getNewUser() {
  16149. return this.userData.newUser;
  16150. }
  16151. static setNewUser() {
  16152. this.userData.newUser = false;
  16153. this.saveUserData();
  16154. }
  16155. static getRootBallFoul() {
  16156. return this.userData.rootBallFoul;
  16157. }
  16158. static setRootBallFoul() {
  16159. this.userData.rootBallFoul = 1;
  16160. this.saveUserData();
  16161. }
  16162. static getTimeoutFoul() {
  16163. return this.userData.timeoutFoul;
  16164. }
  16165. static setTimeoutFoul() {
  16166. this.userData.timeoutFoul = 1;
  16167. this.saveUserData();
  16168. }
  16169. }
  16170. DataMgr.isNewUser = false;
  16171. DataMgr.fristEnter = true;
  16172. DataMgr.levelType = 0;
  16173. DataMgr.awardId = 0;
  16174. DataMgr.awardCoin = 0;
  16175. DataMgr.sceneId = -1;
  16176. DataMgr.tryId = 0;
  16177. DataMgr.curLevel = 1;
  16178. DataMgr.vipLevel = 0;
  16179. DataMgr.maxLevel = 0;
  16180. DataMgr.awardRatio = 1;
  16181. DataMgr.gameList = [];
  16182. DataMgr.rankList = [];
  16183. DataMgr.recoverTime = 480000;
  16184. DataMgr.minScore = 0;
  16185. DataMgr.rankDis = 0;
  16186. DataMgr.userSaving = false;
  16187. DataMgr.gameSaving = false;
  16188. class D3Tween extends Laya.Script3D {
  16189. constructor() {
  16190. super();
  16191. this.isInited = false;
  16192. }
  16193. ;
  16194. init() {
  16195. if (this.isInited)
  16196. return;
  16197. this.isInited = true;
  16198. this.gameObj = this.owner;
  16199. this.transform = this.gameObj.transform;
  16200. }
  16201. get rotX() {
  16202. return this.transform.localRotationEulerX;
  16203. }
  16204. set rotX(v) {
  16205. this.transform.localRotationEulerX = v;
  16206. }
  16207. get rotY() {
  16208. return this.transform.localRotationEulerY;
  16209. }
  16210. set rotY(v) {
  16211. this.transform.localRotationEulerY = v;
  16212. }
  16213. get rotZ() {
  16214. return this.transform.localRotationEulerZ;
  16215. }
  16216. set rotZ(v) {
  16217. this.transform.localRotationEulerZ = v;
  16218. }
  16219. get posX() {
  16220. return this.transform.localPositionX;
  16221. }
  16222. set posX(v) {
  16223. this.transform.localPositionX = v;
  16224. }
  16225. get posY() {
  16226. return this.transform.localPositionY;
  16227. }
  16228. set posY(v) {
  16229. this.transform.localPositionY = v;
  16230. }
  16231. get posZ() {
  16232. return this.transform.localPositionZ;
  16233. }
  16234. set posZ(v) {
  16235. this.transform.localPositionZ = v;
  16236. }
  16237. get rotation() {
  16238. return this.transform.localRotation;
  16239. }
  16240. set rotation(v) {
  16241. this.transform.localRotation = v;
  16242. }
  16243. }
  16244. class D2Hole extends Laya.Script {
  16245. constructor() { super(); }
  16246. onTriggerEnter(collider) {
  16247. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16248. return;
  16249. }
  16250. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16251. if (collider.owner["mySrc"].isRunSkillAni) {
  16252. return;
  16253. }
  16254. if (collider.owner["mySrc"].number != 0) {
  16255. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16256. }
  16257. xGame.common.ballColliHole(collider);
  16258. xGame.common.recoverCameraView();
  16259. }
  16260. }
  16261. }
  16262. class Table extends Laya.Script3D {
  16263. constructor() {
  16264. super();
  16265. this.isSetBorder = false;
  16266. this.inited = false;
  16267. }
  16268. ;
  16269. onAwake() {
  16270. this.init();
  16271. }
  16272. init() {
  16273. if (this.inited)
  16274. return;
  16275. this.inited = true;
  16276. this.gameObj = this.owner;
  16277. this.border = this.gameObj.getChildByName("border");
  16278. }
  16279. setBorderPos() {
  16280. if (this.isSetBorder)
  16281. return;
  16282. this.isSetBorder = true;
  16283. let ui = xGame.common.gameUI.ui;
  16284. let bar1 = this.border.getChildByName("bar1");
  16285. let bar2 = this.border.getChildByName("bar2");
  16286. let bar3 = this.border.getChildByName("bar3");
  16287. let bar4 = this.border.getChildByName("bar4");
  16288. let bar5 = this.border.getChildByName("bar5");
  16289. let bar6 = this.border.getChildByName("bar6");
  16290. this.setInfo(bar1, ui.border.bar1, "box");
  16291. this.setInfo(bar2, ui.border.bar2, "box");
  16292. this.setInfo(bar3, ui.border.bar3, "box");
  16293. this.setInfo(bar4, ui.border.bar4, "box");
  16294. this.setInfo(bar5, ui.border.bar5, "box");
  16295. this.setInfo(bar6, ui.border.bar6, "box");
  16296. let circle1 = this.border.getChildByName("circle1");
  16297. let circle2 = this.border.getChildByName("circle2");
  16298. let circle3 = this.border.getChildByName("circle3");
  16299. let circle4 = this.border.getChildByName("circle4");
  16300. let circle5 = this.border.getChildByName("circle5");
  16301. let circle6 = this.border.getChildByName("circle6");
  16302. this.setInfo(circle1, ui.border.circle1, "circle");
  16303. this.setInfo(circle2, ui.border.circle2, "circle");
  16304. this.setInfo(circle3, ui.border.circle3, "circle");
  16305. this.setInfo(circle4, ui.border.circle4, "circle");
  16306. this.setInfo(circle5, ui.border.circle5, "circle");
  16307. this.setInfo(circle6, ui.border.circle6, "circle");
  16308. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16309. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16310. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16311. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16312. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16313. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16314. let arr = xGame.common.gameMgr.holePosList;
  16315. xGame.common.gameMgr.posObj = {
  16316. "1": arr[0],
  16317. "3": arr[2],
  16318. "4": arr[3],
  16319. "6": arr[5]
  16320. };
  16321. }
  16322. initHolePos(x, y) {
  16323. if (x < 300)
  16324. x += 25;
  16325. else if (x > 1000)
  16326. x -= 25;
  16327. else if (y > 200)
  16328. y -= 10;
  16329. else
  16330. y += 10;
  16331. if (y < 200)
  16332. y += 30;
  16333. else if (y > 500)
  16334. y -= 30;
  16335. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16336. }
  16337. setInfo(d3Obj, d2Obj, type) {
  16338. let ui = xGame.common.gameUI.ui;
  16339. let sprite = new Laya.Sprite();
  16340. ui.border.displayObject.addChild(sprite);
  16341. let colli = xGame.common.getCollider(type);
  16342. sprite.addComponentIntance(colli);
  16343. let rigy = xGame.common.getRigbody();
  16344. rigy.type = "static";
  16345. sprite.addComponentIntance(rigy);
  16346. let d3Pos = d3Obj.transform.position;
  16347. xGame.common.pos3to2Convert(d3Pos);
  16348. let scaleX = d3Obj.transform.localScaleX;
  16349. let scaleZ = d3Obj.transform.localScaleZ;
  16350. let width = xGame.common.scale3to2Convert(scaleZ);
  16351. let height = xGame.common.scale3to2Convert(scaleX);
  16352. sprite.pivotX = width / 2;
  16353. sprite.pivotY = height / 2;
  16354. sprite.x = d3Pos.x;
  16355. sprite.y = d3Pos.y;
  16356. sprite.width = width;
  16357. sprite.height = height;
  16358. d2Obj.x = d3Pos.x;
  16359. d2Obj.y = d3Pos.y;
  16360. d2Obj.width = width;
  16361. d2Obj.height = height;
  16362. if (type == "box") {
  16363. colli.width = width;
  16364. colli.height = height;
  16365. colli.isSensor = false;
  16366. colli.label = "border";
  16367. }
  16368. else {
  16369. colli.radius = width / 2;
  16370. colli.isSensor = true;
  16371. colli.label = "hole";
  16372. sprite.addComponent(D2Hole);
  16373. }
  16374. }
  16375. }
  16376. class D3World extends Laya.Script3D {
  16377. constructor() {
  16378. super();
  16379. this.loadNum = 0;
  16380. this.setLoadNum = 7;
  16381. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16382. }
  16383. onAwake() {
  16384. }
  16385. loadScene() {
  16386. this.scene = this.owner;
  16387. let url = `res/unityRes/root.lh`;
  16388. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16389. this.scene.addChild(prefab);
  16390. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16391. this.putCameraInfo();
  16392. this.camera.enableHDR = false;
  16393. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16394. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16395. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16396. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16397. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16398. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16399. this.knife.active = false;
  16400. this.loadD3Obj();
  16401. }));
  16402. }
  16403. putCameraInfo() {
  16404. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16405. this.cameraObj = new cameraType();
  16406. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16407. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16408. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16409. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16410. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16411. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16412. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16413. this.visitAngleChild.init();
  16414. this.visitRootObj.posX = this.visitAngleChild.posX;
  16415. this.visitRootObj.posY = this.visitAngleChild.posY;
  16416. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16417. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16418. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16419. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16420. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16421. xGame.common.showOneCamera("mainCamera");
  16422. }
  16423. loadD3Obj() {
  16424. this.loadTable();
  16425. this.loadRoom();
  16426. this.loadInHoleParticial();
  16427. this.loadIceParticial();
  16428. this.loadHitParticial();
  16429. this.loadFireworksParticial();
  16430. this.loadBall();
  16431. }
  16432. loadInHoleParticial() {
  16433. this.loadD3Res("inHoleEft", "", (prefab) => {
  16434. prefab.addComponent(Partical);
  16435. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16436. });
  16437. }
  16438. loadIceParticial() {
  16439. this.loadD3Res("iceEft", "", (prefab) => {
  16440. prefab.addComponent(Partical);
  16441. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16442. });
  16443. }
  16444. loadHitParticial() {
  16445. this.loadD3Res("hitEft", "", (prefab) => {
  16446. prefab.addComponent(Partical);
  16447. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16448. });
  16449. }
  16450. loadFireworksParticial() {
  16451. this.loadD3Res("fireworksEft", "", (prefab) => {
  16452. prefab.addComponent(Partical);
  16453. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16454. });
  16455. }
  16456. loadBall(index = 1) {
  16457. this.loadD3Res("ball", index, (prefab) => {
  16458. this.ballPrefab = prefab;
  16459. this.ballPrefab.addComponent(Ball);
  16460. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16461. });
  16462. }
  16463. loadTable(index = 1) {
  16464. this.loadD3Res("table", index, (prefab) => {
  16465. this.tableSrc = prefab.addComponent(Table);
  16466. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16467. this.d3Hand.init();
  16468. this.tableRoot.addChild(prefab);
  16469. });
  16470. }
  16471. loadRoom(index = 1) {
  16472. this.loadD3Res("room", index, (prefab) => {
  16473. this.roomRoot.addChild(prefab);
  16474. });
  16475. }
  16476. loadD3Res(type, index, callback) {
  16477. let url = `res/unityRes/${type}${index}.lh`;
  16478. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16479. callback && callback(prefab);
  16480. this.checkResLoad();
  16481. }));
  16482. }
  16483. checkResLoad() {
  16484. this.loadNum++;
  16485. if (this.loadNum >= this.setLoadNum) {
  16486. xGame.eventMgr.event(D3RES_LOADED);
  16487. }
  16488. }
  16489. prePlayEft() {
  16490. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16491. eft.transform.localPositionX = 0;
  16492. eft.transform.localPositionY = -5;
  16493. eft.transform.localPositionZ = 0;
  16494. eft.active = true;
  16495. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16496. ice.transform.localPositionX = 0;
  16497. ice.transform.localPositionY = -5;
  16498. ice.transform.localPositionZ = 0;
  16499. ice.active = true;
  16500. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16501. hit.transform.localPositionX = 0;
  16502. hit.transform.localPositionY = -5;
  16503. hit.transform.localPositionZ = 0;
  16504. hit.active = true;
  16505. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16506. fireworks.transform.localPositionX = 0;
  16507. fireworks.transform.localPositionY = -5;
  16508. fireworks.transform.localPositionZ = 0;
  16509. fireworks.active = true;
  16510. }
  16511. }
  16512. class cameraType {
  16513. }
  16514. class MoyuMgr$1 {
  16515. static initMoyu() {
  16516. this.moyuView = new MoyuView$1();
  16517. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16518. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16519. this.moyuView.ui.displayObject.zOrder = 1000;
  16520. this.moyuView.init();
  16521. this.moyuView.showTip(true);
  16522. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16523. window['XApk'] = this;
  16524. }
  16525. static showAge(show) {
  16526. if (this.moyuView)
  16527. this.moyuView.showAge(show);
  16528. }
  16529. static onPlatMsg(idx) {
  16530. if (!MoyuMgr$1.moyuView)
  16531. return;
  16532. if (idx == '0') {
  16533. MoyuMgr$1.moyuView.showTip(false);
  16534. }
  16535. }
  16536. static showAgree(call) {
  16537. if (this.moyuView)
  16538. this.moyuView.showAgree(call);
  16539. else
  16540. call && call();
  16541. }
  16542. static showXy(type = 1) {
  16543. if (this.moyuView)
  16544. this.moyuView.showXy(type);
  16545. }
  16546. }
  16547. MoyuMgr$1.isAdvise = false;
  16548. class MoyuView$1 {
  16549. constructor() {
  16550. this.ysxyNum = 1;
  16551. this.ysJson = null;
  16552. this.ui = ui_UIMoyu.createInstance();
  16553. }
  16554. init() {
  16555. this.ui.mainBg.visible = false;
  16556. this.ui.xyNode.visible = false;
  16557. this.ui.ageNode.visible = false;
  16558. this.ui.tipNode.visible = false;
  16559. this.ui.rnNode.visible = false;
  16560. this.ui.fcmNode.visible = false;
  16561. this.ui.ageTip.visible = false;
  16562. this.ui.msgNode.visible = false;
  16563. this.ui.visible = false;
  16564. this.ui.xyNode.xyList.setVirtual();
  16565. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16566. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16567. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16568. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16569. this.ui.xyNode.btnKnown.visible = false;
  16570. this.ui.xyNode.xy1.visible = false;
  16571. this.ui.xyNode.xy2.visible = false;
  16572. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16573. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16574. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16575. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16576. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16577. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16578. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16579. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16580. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16581. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16582. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16583. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16584. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16585. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16586. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16587. this.ysxyNum = 2;
  16588. }
  16589. }
  16590. onClick(obj) {
  16591. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16592. switch (obj) {
  16593. case this.ui.ageTip:
  16594. if (Moyu.isTTApk) {
  16595. this.ui.ageNode.visible = true;
  16596. this.ui.mainBg.visible = true;
  16597. }
  16598. break;
  16599. case this.ui.tipNode:
  16600. this.showTip(false);
  16601. break;
  16602. case this.ui.ageNode.btnAge:
  16603. this.ui.ageNode.visible = false;
  16604. this.ui.mainBg.visible = false;
  16605. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16606. this.ui.visible = false;
  16607. break;
  16608. case this.ui.xyNode.btnXy3:
  16609. case this.ui.xyNode.btnXy1:
  16610. this.loadXy(1);
  16611. break;
  16612. case this.ui.xyNode.btnXy2:
  16613. this.loadXy(2);
  16614. break;
  16615. case this.ui.xyNode.btnBack:
  16616. this.ui.xyNode.xy1.visible = true;
  16617. this.ui.xyNode.xy2.visible = false;
  16618. break;
  16619. case this.ui.xyNode.btnKnown:
  16620. this.ui.xyNode.visible = false;
  16621. this.ui.mainBg.visible = false;
  16622. this.ui.visible = false;
  16623. break;
  16624. case this.ui.rnNode.btnCheck:
  16625. this.check();
  16626. break;
  16627. case this.ui.rnNode.btnExit:
  16628. case this.ui.xyNode.btnNo:
  16629. this.ysxyNum--;
  16630. if (this.ysxyNum > 0)
  16631. this.showMsg("Refuse to quit the game once again");
  16632. else {
  16633. Moyu.userAgree(false);
  16634. Moyu.exit();
  16635. }
  16636. break;
  16637. case this.ui.xyNode.btnSure:
  16638. case this.ui.xyNode.btnYes:
  16639. DataMgr.userData.isAgree = true;
  16640. DataMgr.saveUserData();
  16641. this.onAgree();
  16642. break;
  16643. case this.ui.rnNode.btnDone:
  16644. this.ui.rnNode.visible = false;
  16645. this.ui.visible = false;
  16646. break;
  16647. case this.ui.fcmNode.btnRn:
  16648. this.showRn();
  16649. break;
  16650. }
  16651. }
  16652. showTip(show) {
  16653. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16654. return;
  16655. if (show) {
  16656. MoyuMgr$1.isAdvise = true;
  16657. this.ui.visible = true;
  16658. this.ui.tipNode.visible = true;
  16659. this.ui.tipNode.alpha = 1;
  16660. Laya.timer.once(1000, this, this.showTip, [false]);
  16661. }
  16662. else {
  16663. this.ui.tipNode.alpha = 1;
  16664. this.ui.tipNode.visible = true;
  16665. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16666. this.ui.tipNode.visible = false;
  16667. MoyuMgr$1.isAdvise = false;
  16668. }), 1000);
  16669. }
  16670. }
  16671. showAge(show, px = 0, py = 0) {
  16672. if (Moyu.platType > 10 && !Moyu.isIos) {
  16673. this.ui.ageTip.x = px;
  16674. this.ui.ageTip.y = py;
  16675. this.ui.ageTip.visible = show;
  16676. if (show)
  16677. this.ui.visible = true;
  16678. }
  16679. }
  16680. showAgree(call) {
  16681. this.agreeCall = call;
  16682. this.onAgree();
  16683. return;
  16684. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16685. this.showXy(0);
  16686. }
  16687. else
  16688. this.onAgree();
  16689. }
  16690. onAgree() {
  16691. if (!this.ui.ageNode.visible)
  16692. this.ui.visible = false;
  16693. this.ui.xyNode.visible = false;
  16694. Moyu.userAgree(true);
  16695. this.showAge(false);
  16696. this.agreeCall && this.agreeCall();
  16697. this.showRn();
  16698. }
  16699. showMsg(txt) {
  16700. this.ui.msgNode.txtMsg.text = txt;
  16701. this.ui.msgNode.visible = true;
  16702. this.ui.msgNode.alpha = 1;
  16703. this.ui.visible = true;
  16704. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16705. this.ui.msgNode.visible = false;
  16706. }), 2500, true);
  16707. }
  16708. showRn() {
  16709. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16710. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16711. this.ui.rnNode.rn1.visible = true;
  16712. this.ui.rnNode.rn2.visible = false;
  16713. this.ui.rnNode.rn3.visible = false;
  16714. this.ui.rnNode.rn4.visible = false;
  16715. this.ui.rnNode.visible = true;
  16716. this.ui.mainBg.visible = true;
  16717. this.ui.rnNode.btnDone.visible = false;
  16718. this.ui.rnNode.btnExit.visible = true;
  16719. this.ui.rnNode.btnCheck.visible = true;
  16720. this.ui.fcmNode.visible = false;
  16721. this.ui.visible = true;
  16722. return;
  16723. }
  16724. }
  16725. this.showFcm();
  16726. }
  16727. showFcm() {
  16728. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16729. Moyu.initFCM(true);
  16730. if (Moyu.gameTime < 1)
  16731. this.fcmLoop();
  16732. else if (Moyu.gameTime < 999)
  16733. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16734. }
  16735. }
  16736. fcmLoop() {
  16737. if (Moyu.gameTime < 1) {
  16738. this.ui.rnNode.visible = false;
  16739. this.ui.fcmNode.visible = true;
  16740. this.ui.mainBg.visible = true;
  16741. this.ui.visible = true;
  16742. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16743. Laya.timer.clear(this.ui, this.fcmLoop);
  16744. }
  16745. }
  16746. check() {
  16747. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16748. this.ui.rnNode.rn1.visible = false;
  16749. this.ui.rnNode.rn2.visible = false;
  16750. this.ui.rnNode.rn4.visible = true;
  16751. }
  16752. else if (this.ui.rnNode.rn4.visible) {
  16753. let name = this.ui.rnNode.inputName.text;
  16754. let code = this.ui.rnNode.inputCode.text;
  16755. if (code && code.length == 18) {
  16756. this.ui.rnNode.rn1.visible = false;
  16757. this.ui.rnNode.rn4.visible = false;
  16758. Moyu.authenticate(name, code, (res) => {
  16759. this.ui.rnNode.rn2.visible = !res;
  16760. this.ui.rnNode.rn3.visible = res;
  16761. this.ui.rnNode.btnDone.visible = res;
  16762. this.ui.rnNode.btnExit.visible = !res;
  16763. this.ui.rnNode.btnCheck.visible = !res;
  16764. if (res)
  16765. this.showFcm();
  16766. });
  16767. }
  16768. else
  16769. this.showMsg("信息填写不完整");
  16770. }
  16771. }
  16772. loadXy(type = 0) {
  16773. this.ui.xyNode.xy1.visible = false;
  16774. this.ui.xyNode.xy2.visible = true;
  16775. this.ui.xyNode.xyList.scrollToView(0);
  16776. if (type == 1) {
  16777. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16778. }
  16779. else if (type == 2) {
  16780. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16781. }
  16782. }
  16783. showXy(type = 0) {
  16784. this.xyBtn();
  16785. if (type == 0) {
  16786. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16787. this.ui.xyNode.btnSure.visible = true;
  16788. }
  16789. else {
  16790. this.ui.xyNode.btnYes.visible = true;
  16791. this.ui.xyNode.btnNo.visible = true;
  16792. }
  16793. }
  16794. else {
  16795. this.ui.xyNode.btnKnown.visible = true;
  16796. this.ui.mainBg.visible = true;
  16797. }
  16798. this.ui.xyNode.xy1.visible = true;
  16799. this.ui.xyNode.xy2.visible = false;
  16800. this.ui.xyNode.visible = true;
  16801. this.ui.visible = true;
  16802. }
  16803. xyBtn() {
  16804. this.ui.xyNode.btnSure.visible = false;
  16805. this.ui.xyNode.btnYes.visible = false;
  16806. this.ui.xyNode.btnNo.visible = false;
  16807. this.ui.xyNode.btnKnown.visible = false;
  16808. {
  16809. this.ui.xyNode.btnXy3.visible = false;
  16810. this.ui.xyNode.btnXy2.visible = true;
  16811. this.ui.xyNode.btnXy1.visible = true;
  16812. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16813. }
  16814. }
  16815. createXY(json) {
  16816. this.ysJson = json.content;
  16817. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16818. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16819. this.ui.xyNode.xy2.visible = true;
  16820. }
  16821. renderListItem(idx, cell) {
  16822. let xy = this.ysJson[idx];
  16823. cell.height = xy.line * 30;
  16824. cell.xyItem.text = xy.text;
  16825. }
  16826. onDestroy() {
  16827. this.agreeCall = null;
  16828. }
  16829. }
  16830. class UILoading extends UIBase {
  16831. constructor() {
  16832. super();
  16833. this.accTime = 0;
  16834. this.curNum = 0;
  16835. this.rate = 1;
  16836. this.loadSubOk = false;
  16837. this.loadResOK = false;
  16838. this.openLoading = true;
  16839. this.beginLoadRes = false;
  16840. this.finishD2 = false;
  16841. this.finishD3 = false;
  16842. }
  16843. onConstructor() {
  16844. this.ui = ui_UILoading.createInstance();
  16845. this.contentPane = this.ui;
  16846. this.isEject = false;
  16847. this._initUI();
  16848. this._addEvent();
  16849. }
  16850. _initUI() {
  16851. MoyuMgr$1.initMoyu();
  16852. }
  16853. _addEvent() {
  16854. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16855. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16856. }
  16857. show() {
  16858. super.show();
  16859. console.log('zh:加载分包资源');
  16860. loadSubRes(this.subResProgress.bind(this));
  16861. this.ui.txtLoad.text = "Loading...";
  16862. }
  16863. subResProgress(pro, finish) {
  16864. this.curNum = pro;
  16865. if (finish) {
  16866. this.curNum = 1;
  16867. this.loadSubOk = true;
  16868. }
  16869. }
  16870. laodD3Res() {
  16871. let scene3D = new Laya.Scene3D();
  16872. xGame.common.d3Scene = scene3D;
  16873. xGame.common.d3World = scene3D.addComponent(D3World);
  16874. xGame.common.d3World.loadScene();
  16875. }
  16876. loadD2Res() {
  16877. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16878. this.finishD2 = true;
  16879. this.checkLoadAll();
  16880. this.curNum = 1;
  16881. }), Laya.Handler.create(this, (pro) => {
  16882. this.curNum = pro;
  16883. }, null, false));
  16884. }
  16885. d3ResFinish() {
  16886. this.finishD3 = true;
  16887. this.checkLoadAll();
  16888. }
  16889. checkLoadAll() {
  16890. if (this.finishD2 && this.finishD3) {
  16891. this.loadResOK = true;
  16892. }
  16893. }
  16894. loadRes() {
  16895. this.laodD3Res();
  16896. this.loadD2Res();
  16897. }
  16898. myUpdate(dt) {
  16899. if (!this.openLoading)
  16900. return;
  16901. this.accTime += dt * this.rate;
  16902. if (this.accTime >= this.curNum)
  16903. this.accTime = this.curNum;
  16904. this.ui.loadinfo.value = this.accTime * 100;
  16905. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16906. if (!this.beginLoadRes) {
  16907. this.beginLoadRes = true;
  16908. this.ui.txtLoad.text = "Loading...";
  16909. this.curNum = 0;
  16910. this.accTime = 0;
  16911. this.loadRes();
  16912. }
  16913. if (this.loadResOK) {
  16914. this.openLoading = false;
  16915. Laya.timer.once(300, this, () => {
  16916. xGame.common.d3Scene.active = false;
  16917. MoyuMgr$1.showAgree(enterGame);
  16918. });
  16919. }
  16920. }
  16921. }
  16922. release() {
  16923. }
  16924. hide() {
  16925. super.hide();
  16926. this.release();
  16927. }
  16928. onClose() {
  16929. this.hide();
  16930. }
  16931. }
  16932. UILoading.uiName = "UILoading";
  16933. class UIRepentProp$1 extends UIBase {
  16934. constructor() {
  16935. super();
  16936. this.viewType = 0;
  16937. this.regretType = 0;
  16938. }
  16939. onConstructor() {
  16940. this.ui = ui_UIRepentProp.createInstance();
  16941. this.contentPane = this.ui;
  16942. this.isEject = false;
  16943. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  16944. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  16945. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  16946. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  16947. }
  16948. show(viewType, regretType, callback) {
  16949. PlatMgr.showInsert(true);
  16950. this.viewType = viewType;
  16951. this.regretType = regretType;
  16952. this.callback = callback;
  16953. super.show();
  16954. this.ui.t0.play();
  16955. this.ui.c1.selectedIndex = this.viewType;
  16956. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  16957. if (this.viewType == 0) {
  16958. let guide = DataMgr.getGuideHelpLine();
  16959. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  16960. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  16961. }
  16962. xGame.common.gameMgr.gamePause = true;
  16963. }
  16964. hideSelf() {
  16965. xGame.common.gameMgr.gamePause = false;
  16966. this.callback && this.callback(false);
  16967. this.hide();
  16968. }
  16969. videoRegret() {
  16970. Moyu.showVideoAd(() => {
  16971. this.callback && this.callback(true);
  16972. this.hideSelf();
  16973. }, EAdType.regretBall);
  16974. }
  16975. videoAddHelpLine() {
  16976. let guide = DataMgr.getGuideHelpLine();
  16977. if (guide == 0) {
  16978. this.callback && this.callback(true);
  16979. this.hideSelf();
  16980. DataMgr.setGuideHelpLine();
  16981. xGame.common.gameUI.ui.guideNode.visible = false;
  16982. }
  16983. else {
  16984. Moyu.showVideoAd(() => {
  16985. this.callback && this.callback(true);
  16986. this.hideSelf();
  16987. }, EAdType.longHelpLine);
  16988. }
  16989. }
  16990. }
  16991. UIRepentProp$1.uiName = "UIRepentProp";
  16992. class UIRodMethod$1 extends UIBase {
  16993. constructor() {
  16994. super();
  16995. this.isPressd = false;
  16996. }
  16997. onConstructor() {
  16998. this.ui = ui_UIRodMethod.createInstance();
  16999. this.contentPane = this.ui;
  17000. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17001. this.moveDir = new Laya.Vector2();
  17002. this.moveDest = new Laya.Vector2();
  17003. this.centerPos = new Laya.Vector2();
  17004. xGame.common.uiRodMethod = this;
  17005. }
  17006. show() {
  17007. super.show();
  17008. xGame.common.gameMgr.gamePause = true;
  17009. this.openPressDotEvent();
  17010. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17011. this.centerPos.x = this.ui.white.x;
  17012. this.centerPos.y = this.ui.white.y;
  17013. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17014. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17015. this.setDot();
  17016. }
  17017. setDot() {
  17018. this.ui.dot.x = this.moveDest.x;
  17019. this.ui.dot.y = this.moveDest.y;
  17020. }
  17021. closeSelf() {
  17022. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17023. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17024. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17025. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17026. xGame.common.gameMgr.gamePause = false;
  17027. this.hide();
  17028. }
  17029. openPressDotEvent() {
  17030. this.closePressDotEvent();
  17031. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17032. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17033. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17034. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17035. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17036. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17037. }
  17038. closePressDotEvent() {
  17039. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17040. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17041. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17042. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17043. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17044. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17045. }
  17046. onDown(e) {
  17047. if (e.type == Laya.Event.MOUSE_DOWN)
  17048. this.isPressd = true;
  17049. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17050. this.isPressd = false;
  17051. if (!this.isPressd)
  17052. return;
  17053. this.moveDest.x = e.stageX;
  17054. this.moveDest.y = e.stageY;
  17055. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17056. if (dis > 6724) {
  17057. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17058. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17059. }
  17060. this.setDot();
  17061. }
  17062. resetRod() {
  17063. this.ui.dot.x = this.ui.white.x;
  17064. this.ui.dot.y = this.ui.white.y;
  17065. this.gameRod.dot.x = this.gameRod.bg.x;
  17066. this.gameRod.dot.y = this.gameRod.bg.y;
  17067. xGame.common.rodOffest.x = 0;
  17068. xGame.common.rodOffest.y = 0;
  17069. }
  17070. }
  17071. UIRodMethod$1.uiName = "UIRodMethod";
  17072. class UIMsg$1 extends UIBase {
  17073. constructor() {
  17074. super();
  17075. }
  17076. onConstructor() {
  17077. this.ui = ui_UIMsg.createInstance();
  17078. this.contentPane = this.ui;
  17079. this.isEject = false;
  17080. this.isMuti = true;
  17081. }
  17082. show(msg, callback) {
  17083. super.show();
  17084. this.ui.tipsNode.msgTxt.text = msg;
  17085. this.ui.alpha = 1;
  17086. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17087. this.hide();
  17088. callback && callback();
  17089. }), 1000);
  17090. }
  17091. }
  17092. UIMsg$1.uiName = "UIMsg";
  17093. class UITips$1 extends UIBase {
  17094. constructor() {
  17095. super();
  17096. this.type = 0;
  17097. }
  17098. onConstructor() {
  17099. this.ui = ui_UITips.createInstance();
  17100. this.contentPane = this.ui;
  17101. this.isEject = false;
  17102. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17103. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17104. }
  17105. show(tipsTxt, womanTxt, type) {
  17106. super.show();
  17107. this.ui.t0.play();
  17108. this.ui.myNode.tipsTxt.text = tipsTxt;
  17109. this.ui.myNode.womanTxt.text = womanTxt;
  17110. PlatMgr.showInsert(true);
  17111. this.ui.myNode.c1.selectedIndex = type;
  17112. this.type = type;
  17113. switch (this.type) {
  17114. case TipsType.exitGame:
  17115. xGame.common.gameMgr.gamePause = true;
  17116. break;
  17117. case TipsType.foul:
  17118. Laya.timer.once(200, this, () => {
  17119. xGame.common.gameMgr.gamePause = true;
  17120. });
  17121. break;
  17122. default:
  17123. break;
  17124. }
  17125. }
  17126. clickLeftBtn() {
  17127. this.hide();
  17128. xGame.common.gameMgr.gamePause = false;
  17129. switch (this.type) {
  17130. case TipsType.exitGame:
  17131. break;
  17132. case TipsType.foul:
  17133. break;
  17134. default:
  17135. break;
  17136. }
  17137. }
  17138. clickRightBtn() {
  17139. this.hide();
  17140. switch (this.type) {
  17141. case TipsType.exitGame:
  17142. xGame.eventMgr.event(RESET_GAME);
  17143. xGame.uiMgr.Show(UIMain$1);
  17144. Moyu.recordEnd(this, null);
  17145. xGame.common.longHelpLine = false;
  17146. break;
  17147. case TipsType.foul:
  17148. xGame.common.gameMgr.gamePause = false;
  17149. Laya.timer.clearAll(this);
  17150. break;
  17151. default:
  17152. break;
  17153. }
  17154. }
  17155. }
  17156. UITips$1.uiName = "UITips";
  17157. class UIGame$1 extends UIBase {
  17158. constructor() {
  17159. super();
  17160. this.powerNum = 0;
  17161. this.isD3Inited = false;
  17162. this.isPrePlay = false;
  17163. this.isMoveRod = false;
  17164. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17165. this.rulerDis = 20;
  17166. this.rulerOffset = 0;
  17167. }
  17168. onConstructor() {
  17169. this.ui = ui_UIGame.createInstance();
  17170. this.contentPane = this.ui;
  17171. this.ui.x += xGame.common.sysOffestNum;
  17172. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17173. this.isEject = false;
  17174. xGame.common.gameUI = this;
  17175. this.initSelf();
  17176. }
  17177. isTurnSelf() {
  17178. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17179. return true;
  17180. }
  17181. }
  17182. initSelf() {
  17183. let topUI = this.ui.topNode;
  17184. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17185. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17186. this.barInfo = {};
  17187. this.barInfo.curY = 0;
  17188. this.barInfo.height = this.ui.powerNode.height;
  17189. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17190. this.barInfo.powerStartY = this.ui.powerNode.y;
  17191. xGame.common.aiPlayer = new AIPlayer();
  17192. xGame.common.gameMgr = new GameMgr();
  17193. xGame.common.skillMgr = new SkillMgr();
  17194. xGame.common.wordsMgr = new WordsMgr();
  17195. xGame.common.talkMgr = new TalkMgr();
  17196. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17197. console.log("加载经典模式表情文件chenggon !");
  17198. });
  17199. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17200. console.log("挑战模式奖励模式spine加载成功!");
  17201. });
  17202. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17203. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17204. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17205. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17206. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17207. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17208. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17209. }
  17210. returnHome() {
  17211. let tips = "Are you sure to exit the game?";
  17212. let woman = "Boss, why don't you play for a while longer?";
  17213. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17214. }
  17215. addRodMethodClick() {
  17216. if (this.isTurnSelf()) {
  17217. xGame.uiMgr.Show(UIRodMethod$1);
  17218. }
  17219. }
  17220. clickHelpLineBtn(force = false) {
  17221. if (!this.isTurnSelf())
  17222. return;
  17223. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17224. if (success) {
  17225. xGame.common.longHelpLine = true;
  17226. xGame.common.d2World.getHelpLine();
  17227. Moyu.sendDataEvent("guideNum");
  17228. }
  17229. else {
  17230. }
  17231. });
  17232. }
  17233. renderSelfDisplayBalls(index, target) {
  17234. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17235. target.myImg.url = xGame.common.getGameIconUrl(str);
  17236. }
  17237. renderAIDisplayBalls(index, target) {
  17238. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17239. target.myImg.url = xGame.common.getGameIconUrl(str);
  17240. ;
  17241. }
  17242. updateMode() {
  17243. if (xGame.common.gameMode == GameMode.classic) {
  17244. this.ui.topNode.scoreNode.visible = false;
  17245. }
  17246. else if (xGame.common.gameMode == GameMode.bigMove) {
  17247. this.ui.topNode.scoreNode.visible = true;
  17248. }
  17249. }
  17250. show() {
  17251. super.show();
  17252. console.log("zh:uigame show");
  17253. this.ui.alpha = 0;
  17254. this.updateSelf();
  17255. console.log("zh:uigame bf gamemusic01 start");
  17256. xGame.soundMgr.playMusic("gamemusic01");
  17257. console.log("zh:uigame bf gamemusic01 end");
  17258. xGame.common.gameMgr.gamePause = false;
  17259. xGame.common.gameUI.ui.blackAni.visible = false;
  17260. xGame.common.gameUI.ui.whiteAni.visible = false;
  17261. this.ui.powerEft.visible = false;
  17262. this.ui.colorNode.visible = false;
  17263. this.updateHead();
  17264. }
  17265. updateSelf() {
  17266. if (xGame.common.gameMode == GameMode.classic) {
  17267. this.ui.c1.selectedIndex = 0;
  17268. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17269. this.ui.topNode.middleNode.visible = true;
  17270. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17271. }
  17272. else if (xGame.common.gameMode == GameMode.bigMove) {
  17273. this.ui.c1.selectedIndex = 0;
  17274. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17275. this.ui.topNode.middleNode.visible = false;
  17276. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17277. let rand = xGame.common.randomNum(1, max);
  17278. let guide = DataMgr.getSkillGuide();
  17279. if (guide == 0)
  17280. rand = 1;
  17281. xGame.common.bigMoveLevelIndex = rand;
  17282. }
  17283. else if (xGame.common.gameMode == GameMode.placeBall) {
  17284. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17285. this.ui.c1.selectedIndex = 1 + data.type;
  17286. this.ui.alpha = 1;
  17287. this.startGame();
  17288. }
  17289. this.updateMode();
  17290. this.initD3world();
  17291. this.initD2world();
  17292. }
  17293. startGame() {
  17294. this.ui.snowNode.visible = Math.random() <= 0.1;
  17295. this.ui.d2Node.visible = false;
  17296. xGame.common.d3World.d3Hand.gameObj.active = false;
  17297. xGame.common.d3World.tableSrc.init();
  17298. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17299. this.cameraViewChange(() => {
  17300. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17301. switch (xGame.common.gameMode) {
  17302. case GameMode.classic:
  17303. xGame.common.d3World.d3Hand.gameObj.active = true;
  17304. this.playPutBallD3Ani();
  17305. break;
  17306. case GameMode.bigMove:
  17307. this.enterGame();
  17308. Laya.timer.once(500, this, () => {
  17309. this.ui.topNode.middleNode.visible = true;
  17310. this.ui.topNode.middleNode.t0.play();
  17311. });
  17312. break;
  17313. case GameMode.placeBall:
  17314. this.enterGame();
  17315. break;
  17316. default:
  17317. break;
  17318. }
  17319. });
  17320. PlatMgr.showBanner(false);
  17321. }
  17322. enterGame() {
  17323. this.ui.d2Node.visible = true;
  17324. xGame.common.d3World.d3Hand.gameObj.active = false;
  17325. xGame.common.showOneCamera("mainCamera");
  17326. Moyu.recordGame(30, true);
  17327. if (!this.isPrePlay) {
  17328. this.isPrePlay = true;
  17329. xGame.common.d3World.prePlayEft();
  17330. }
  17331. xGame.common.gameMgr.gameReady();
  17332. this.openAllEvent();
  17333. this.ui.snowNode.visible = false;
  17334. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17335. this.ui.helpBtn.visible = condition;
  17336. }
  17337. showHelpLineGuide() {
  17338. let longGuide = DataMgr.getGuideHelpLine();
  17339. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17340. this.ui.helpBtn.visible = true;
  17341. this.ui.guideNode.visible = true;
  17342. }
  17343. }
  17344. setTurnAlpha(alpha) {
  17345. this.ui.keduNode.alpha = alpha;
  17346. this.ui.ganNode.alpha = alpha;
  17347. this.ui.rodMethodNode.alpha = alpha;
  17348. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17349. }
  17350. cameraViewChange(callback) {
  17351. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17352. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17353. xGame.common.showOneCamera("visitAngle");
  17354. cameraSrc.localRotationEulerY = 180;
  17355. cameraSrc.localRotationEulerZ = 0;
  17356. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17357. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17358. callback && callback();
  17359. }));
  17360. }));
  17361. }
  17362. playPutBallD3Ani() {
  17363. xGame.common.showOneCamera("mainCamera");
  17364. let handSrc = xGame.common.d3World.d3Hand;
  17365. handSrc.gameObj.active = true;
  17366. handSrc.transform.localPositionZ = 3;
  17367. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17368. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17369. handSrc.gameObj.active = false;
  17370. this.enterGame();
  17371. }), 400);
  17372. }));
  17373. }
  17374. updateHead() {
  17375. let user = Moyu.getUserInfo();
  17376. this.ui.topNode.selfNameTxt.text = user.nickName;
  17377. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17378. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17379. if (DataMgr.getSkillGuide() < 1) {
  17380. this.ui.topNode.aiNameTxt.text = 'billiards';
  17381. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17382. }
  17383. else {
  17384. this.ui.topNode.aiNameTxt.text = aiData.name;
  17385. let randNo = Math.floor(Math.random() * 10) + 1;
  17386. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17387. }
  17388. }
  17389. initD2world() {
  17390. let node = this.ui.d2Root.displayObject;
  17391. let src = node.getComponent(D2World);
  17392. if (!src) {
  17393. xGame.common.d2World = node.addComponent(D2World);
  17394. }
  17395. xGame.common.d2World.initSelf();
  17396. }
  17397. initD3world() {
  17398. if (this.isD3Inited)
  17399. return;
  17400. this.isD3Inited = true;
  17401. let scene3D = xGame.common.d3Scene;
  17402. this.ui.d3Root.displayObject.addChild(scene3D);
  17403. scene3D.active = true;
  17404. xGame.common.d3World.tableSrc.setBorderPos();
  17405. }
  17406. onRootMove(e) {
  17407. let rootBall = xGame.common.d2World.rootBall;
  17408. this.ui.moveNode.x = e.x;
  17409. this.ui.moveNode.y = e.y;
  17410. rootBall.gameObj.x = e.x;
  17411. rootBall.gameObj.y = e.y;
  17412. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17413. }
  17414. aiRootMove(move) {
  17415. if (move)
  17416. this.hideBallUI();
  17417. else {
  17418. this.showBallUI();
  17419. xGame.common.d2World.getHelpLine();
  17420. }
  17421. }
  17422. aiForce(type, force = 0) {
  17423. this.pressTarget = PressType.powerNode;
  17424. if (type == 1)
  17425. this.onEventUp({ force: true });
  17426. else if (type == 2)
  17427. this.onEventMove({ stageY: force, force: true });
  17428. }
  17429. onEventPress(e) {
  17430. if (e.stopPropagation)
  17431. e.stopPropagation();
  17432. if (!this.isTurnSelf())
  17433. return;
  17434. let target = e.target;
  17435. switch (target) {
  17436. case this.ui.myPowerNode.displayObject:
  17437. this.pressTarget = PressType.powerNode;
  17438. this.barInfo.curY = e.stageY;
  17439. this.updateBarInfo();
  17440. break;
  17441. case this.ui.moveNode.displayObject:
  17442. this.pressTarget = PressType.moveNode;
  17443. this.hideBallUI();
  17444. this.eventObj.curX = this.ui.moveNode.x;
  17445. this.eventObj.curY = this.ui.moveNode.y;
  17446. this.ui.moveNode.finger.visible = false;
  17447. this.eventObj.lastX = e.stageX;
  17448. this.eventObj.lastY = e.stageY;
  17449. break;
  17450. case this.ui.rulerClickNode.displayObject:
  17451. this.pressTarget = PressType.rulerNode;
  17452. this.eventObj.lastY = e.stageY;
  17453. break;
  17454. case this.ui.d2Root.displayObject:
  17455. this.pressTarget = PressType.d2Root;
  17456. this.eventObj.lastX = e.stageX;
  17457. this.eventObj.lastY = e.stageY;
  17458. this.eventObj.starX = e.stageX;
  17459. this.eventObj.starY = e.stageY;
  17460. this.eventObj.curX = 0;
  17461. this.eventObj.curY = 0;
  17462. xGame.common.d2World.d2Gan.setGanLastInfo();
  17463. this.rulerOffset = 0;
  17464. break;
  17465. default:
  17466. break;
  17467. }
  17468. }
  17469. onEventMove(e) {
  17470. if (e.stopPropagation)
  17471. e.stopPropagation();
  17472. if (e && e.force) {
  17473. }
  17474. else {
  17475. if (!this.isTurnSelf())
  17476. return;
  17477. }
  17478. switch (this.pressTarget) {
  17479. case PressType.powerNode:
  17480. this.barInfo.curY = e.stageY;
  17481. this.updateBarInfo();
  17482. this.isMoveRod = true;
  17483. break;
  17484. case PressType.moveNode:
  17485. let rootBall = xGame.common.d2World.rootBall;
  17486. let radius = rootBall.gameObj.width / 2;
  17487. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17488. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17489. let border = xGame.common.d2World.borderRect;
  17490. if (curX <= border.x + radius)
  17491. curX = border.x + radius;
  17492. else if (curX >= border.x + border.width - radius)
  17493. curX = border.x + border.width - radius;
  17494. if (curY <= border.y + radius)
  17495. curY = border.y + radius;
  17496. else if (curY >= border.y + border.height - radius)
  17497. curY = border.y + border.height - radius;
  17498. if (xGame.common.gameMgr.isOpenBall) {
  17499. if (curX >= border.x + border.openBallW - radius)
  17500. curX = border.x + border.openBallW - radius;
  17501. }
  17502. this.ui.moveNode.x = curX;
  17503. this.ui.moveNode.y = curY;
  17504. rootBall.gameObj.x = curX;
  17505. rootBall.gameObj.y = curY;
  17506. rootBall.d3BallSrc.setTransPos(curX, curY);
  17507. this.isMoveRod = true;
  17508. break;
  17509. case PressType.rulerNode:
  17510. let yy = e.stageY - this.eventObj.lastY;
  17511. this.eventObj.lastY = e.stageY;
  17512. let ruler1 = this.ui.rulerNode.img1;
  17513. let ruler2 = this.ui.rulerNode.img2;
  17514. ruler1.y += yy;
  17515. ruler2.y += yy;
  17516. this.rulerOffset += yy;
  17517. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17518. this.rulerOffset = 0;
  17519. xGame.soundMgr.playSound("inch", 1, 10);
  17520. }
  17521. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17522. let h = ruler1.height;
  17523. this.checkGuide();
  17524. this.isMoveRod = true;
  17525. if (ruler1.y >= h) {
  17526. ruler1.y = -h;
  17527. ruler2.y = 0;
  17528. return;
  17529. }
  17530. else if (ruler1.y <= -h) {
  17531. ruler1.y = h;
  17532. ruler2.y = 0;
  17533. return;
  17534. }
  17535. if (ruler2.y >= h) {
  17536. ruler2.y = -h;
  17537. ruler1.y = 0;
  17538. return;
  17539. }
  17540. else if (ruler2.y <= -h) {
  17541. ruler2.y = h;
  17542. ruler1.y = 0;
  17543. return;
  17544. }
  17545. break;
  17546. case PressType.d2Root:
  17547. this.eventObj.curX = e.stageX;
  17548. this.eventObj.curY = e.stageY;
  17549. let offset = this.checkRodMoveDir();
  17550. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17551. this.eventObj.lastX = e.stageX;
  17552. this.eventObj.lastY = e.stageY;
  17553. break;
  17554. default:
  17555. break;
  17556. }
  17557. }
  17558. onEventUp(e) {
  17559. if (e.stopPropagation)
  17560. e.stopPropagation();
  17561. if (e && e.force) {
  17562. }
  17563. else {
  17564. if (!this.isTurnSelf())
  17565. return;
  17566. }
  17567. switch (this.pressTarget) {
  17568. case PressType.powerNode:
  17569. this.ui.powerNode.value = 0;
  17570. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17571. this.ui.powerTxt.text = "";
  17572. if (this.powerNum > 0) {
  17573. xGame.eventMgr.event(BALL_SHOOT);
  17574. xGame.common.d2World.shoot(this.powerNum);
  17575. xGame.common.d2World.d2Gan.shoot();
  17576. xGame.common.d2World.d2HelpLine.shoot();
  17577. this.finishGuide();
  17578. this.ui.powerEft.visible = false;
  17579. this.ui.colorNode.visible = false;
  17580. let ganStr = "";
  17581. if (this.powerNum <= 30) {
  17582. ganStr = "gan_30";
  17583. }
  17584. else if (this.powerNum <= 60) {
  17585. ganStr = "gan_50";
  17586. }
  17587. else {
  17588. ganStr = "gan_80";
  17589. }
  17590. xGame.soundMgr.playSound(ganStr);
  17591. }
  17592. break;
  17593. case PressType.moveNode:
  17594. let rootBall = xGame.common.d2World.rootBall;
  17595. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17596. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17597. let isIntersect = this.judgeBallIntersect();
  17598. if (isIntersect) {
  17599. this.ui.moveNode.x = lastX;
  17600. this.ui.moveNode.y = lastY;
  17601. rootBall.gameObj.x = lastX;
  17602. rootBall.gameObj.y = lastY;
  17603. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17604. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17605. }
  17606. else {
  17607. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17608. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17609. }
  17610. this.showBallUI();
  17611. this.ui.moveNode.finger.visible = true;
  17612. xGame.common.d2World.getHelpLine();
  17613. break;
  17614. case PressType.rulerNode:
  17615. break;
  17616. case PressType.d2Root:
  17617. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17618. if (dis <= 25) {
  17619. this.moveToClickDot(e);
  17620. }
  17621. break;
  17622. default:
  17623. break;
  17624. }
  17625. this.pressTarget = -1;
  17626. }
  17627. checkGuide() {
  17628. let guide = DataMgr.getSkillGuide();
  17629. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17630. xGame.common.guideStep++;
  17631. xGame.common.gameUI.ui.guide2.visible = false;
  17632. xGame.common.gameUI.ui.guide3.visible = true;
  17633. }
  17634. }
  17635. finishGuide() {
  17636. let guide = DataMgr.getSkillGuide();
  17637. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17638. xGame.common.guideStep = 10;
  17639. this.closeAllGuide();
  17640. }
  17641. }
  17642. closeAllGuide() {
  17643. xGame.common.gameUI.ui.guide1.visible = false;
  17644. xGame.common.gameUI.ui.guide2.visible = false;
  17645. xGame.common.gameUI.ui.guide3.visible = false;
  17646. }
  17647. updateBarInfo() {
  17648. let star = this.ui.powerNode.y;
  17649. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17650. if (rate >= 1)
  17651. rate = 1;
  17652. if (rate <= 0)
  17653. rate = 0;
  17654. this.powerNum = Math.ceil(rate * 100);
  17655. this.ui.powerNode.value = this.powerNum;
  17656. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17657. this.ui.colorNode.value = this.powerNum;
  17658. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17659. this.ui.powerEft.visible = this.powerNum != 0;
  17660. this.ui.colorNode.visible = this.powerNum != 0;
  17661. this.ui.powerTxt.text = this.powerNum + "";
  17662. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17663. }
  17664. forceCancel() {
  17665. this.ui.powerNode.value = 0;
  17666. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17667. this.ui.powerTxt.text = "";
  17668. }
  17669. checkRodMoveDir() {
  17670. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17671. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17672. if (tempX >= 0 && tempY <= 0) {
  17673. return this.checkDir();
  17674. }
  17675. else if (tempX < 0 && tempY < 0) {
  17676. return this.checkDir(1, -1);
  17677. }
  17678. else if (tempX < 0 && tempY > 0) {
  17679. return this.checkDir(-1, -1);
  17680. }
  17681. else {
  17682. return this.checkDir(-1, 1);
  17683. }
  17684. }
  17685. checkDir(flagX = 1, flagY = 1) {
  17686. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17687. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17688. if (offsetY == 0) {
  17689. return offsetX * flagX;
  17690. }
  17691. if (offsetX == 0) {
  17692. return offsetY * flagY;
  17693. }
  17694. let angle = offsetY / offsetX;
  17695. if (Math.abs(angle) >= 1) {
  17696. return offsetY * flagY;
  17697. }
  17698. else {
  17699. return offsetX * flagX;
  17700. }
  17701. }
  17702. judgeBallIntersect() {
  17703. let rootBall = xGame.common.d2World.rootBall;
  17704. let ballArr = xGame.common.d2World.ballArr;
  17705. let radius = rootBall.gameObj.width / 2;
  17706. let temp;
  17707. let isIntersect = false;
  17708. for (let index = 0; index < ballArr.length; index++) {
  17709. temp = ballArr[index];
  17710. if (temp.number == rootBall.number)
  17711. continue;
  17712. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17713. if (isIntersect) {
  17714. break;
  17715. }
  17716. }
  17717. return isIntersect;
  17718. }
  17719. hideBallUI() {
  17720. let d2Gan = xGame.common.d2World.d2Gan;
  17721. if (!d2Gan.ui.isDisposed)
  17722. d2Gan.ui.visible = false;
  17723. let d2Help = xGame.common.d2World.d2HelpLine;
  17724. if (!d2Help.ui.isDisposed)
  17725. d2Help.ui.visible = false;
  17726. let rootBall = xGame.common.d2World.rootBall;
  17727. if (!rootBall.destroyed) {
  17728. rootBall.gameObj.active = false;
  17729. }
  17730. }
  17731. showBallUI() {
  17732. let d2Gan = xGame.common.d2World.d2Gan;
  17733. if (!d2Gan.ui.isDisposed)
  17734. d2Gan.ui.visible = true;
  17735. let d2Help = xGame.common.d2World.d2HelpLine;
  17736. if (!d2Help.ui.isDisposed)
  17737. d2Help.ui.visible = true;
  17738. let rootBall = xGame.common.d2World.rootBall;
  17739. if (!rootBall.destroyed) {
  17740. rootBall.gameObj.active = true;
  17741. }
  17742. }
  17743. moveToClickDot(e) {
  17744. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17745. let root = xGame.common.d2World.rootBall.gameObj;
  17746. let xx = e.stageX - xGame.common.sysOffestNum;
  17747. let yy = e.stageY;
  17748. let x = xx - root.x;
  17749. let y = yy - root.y;
  17750. let angle = xGame.common.getfguiRotation(x, y);
  17751. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17752. xGame.common.d2World.getHelpLine();
  17753. }
  17754. this.isMoveRod = false;
  17755. xGame.common.clickedBall = false;
  17756. }
  17757. openAllEvent() {
  17758. this.closeAllEvent();
  17759. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17760. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17761. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17762. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17763. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17764. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17765. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17766. }
  17767. closeAllEvent() {
  17768. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17769. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17770. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17771. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17772. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17773. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17774. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17775. }
  17776. resetGame() {
  17777. this.closeAllEvent();
  17778. this.hideBallUI();
  17779. xGame.common.gameMgr.gamePause = true;
  17780. }
  17781. }
  17782. UIGame$1.uiName = "UIGame";
  17783. class UIAddCoin$1 extends UIBase {
  17784. constructor() {
  17785. super();
  17786. this.coinNum = 2000;
  17787. }
  17788. onConstructor() {
  17789. this.ui = ui_UIAddCoin.createInstance();
  17790. this.contentPane = this.ui;
  17791. this.isEject = false;
  17792. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17793. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17794. }
  17795. show() {
  17796. super.show();
  17797. this.ui.t0.play();
  17798. }
  17799. videoAddCoin() {
  17800. Moyu.showVideoAd(() => {
  17801. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17802. this.hide();
  17803. }, EAdType.addFailCoin);
  17804. }
  17805. }
  17806. UIAddCoin$1.uiName = "UIAddCoin";
  17807. class UIInvitation$1 extends UIBase {
  17808. constructor() {
  17809. super();
  17810. }
  17811. onConstructor() {
  17812. this.ui = ui_UIInvitation.createInstance();
  17813. this.contentPane = this.ui;
  17814. this.isEject = false;
  17815. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17816. }
  17817. show() {
  17818. super.show();
  17819. }
  17820. enterGame() {
  17821. xGame.common.gameMode = GameMode.classic;
  17822. DataMgr.setChallengeTimes(1);
  17823. xGame.common.passAwardCoin = 2000;
  17824. let need = xGame.common.classicNiceNeddCoin;
  17825. if (DataMgr.coinEnough(need)) {
  17826. DataMgr.setCoin(-need);
  17827. xGame.eventMgr.event(RESTART_GAME, true);
  17828. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17829. }
  17830. else {
  17831. xGame.eventMgr.event(RESTART_GAME, true);
  17832. }
  17833. this.hide();
  17834. }
  17835. hide() {
  17836. super.hide();
  17837. }
  17838. }
  17839. UIInvitation$1.uiName = "UIInvitation";
  17840. class UIPower$1 extends UIBase {
  17841. constructor() {
  17842. super();
  17843. }
  17844. onConstructor() {
  17845. this.ui = ui_UIPower.createInstance();
  17846. this.contentPane = this.ui;
  17847. this.isEject = false;
  17848. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17849. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17850. }
  17851. show() {
  17852. super.show();
  17853. this.ui.t0.play();
  17854. }
  17855. videoGetPower() {
  17856. Moyu.showVideoAd(() => {
  17857. DataMgr.setPower(xGame.common.videoPower, true);
  17858. xGame.eventMgr.event(POWER_TIME);
  17859. this.hide();
  17860. }, EAdType.getPower);
  17861. }
  17862. }
  17863. UIPower$1.uiName = "UIPower";
  17864. class UIGameEnd$1 extends UIBase {
  17865. constructor() {
  17866. super();
  17867. this.success = false;
  17868. this.awardCoinNum = 1000;
  17869. this.awardDiamondNum = 10;
  17870. }
  17871. onConstructor() {
  17872. this.ui = ui_UIGameEnd.createInstance();
  17873. this.contentPane = this.ui;
  17874. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17875. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17876. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17877. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17878. this.ui.talkNode.visible = false;
  17879. if (Moyu.isKs)
  17880. this.ui.closeNode.closeBtn.x += 100;
  17881. }
  17882. updateType() {
  17883. switch (xGame.common.gameMode) {
  17884. case GameMode.classic:
  17885. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17886. this.ui.coinNode.visible = this.success;
  17887. if (!this.success) {
  17888. Laya.timer.once(500, this, () => {
  17889. xGame.uiMgr.Show(UIAddCoin$1);
  17890. });
  17891. }
  17892. this.ui.isGetAward.visible = false;
  17893. this.ui.leftBtn.c1.selectedIndex = 3;
  17894. this.ui.rightBtn.c1.selectedIndex = 0;
  17895. this.moneyNode.ui.c1.selectedIndex = 1;
  17896. break;
  17897. case GameMode.bigMove:
  17898. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17899. this.ui.coinNode.visible = this.success;
  17900. if (xGame.common.gameMode == GameMode.bigMove) {
  17901. if (this.success) {
  17902. DataMgr.setSkillSuccessTimes(1, true);
  17903. DataMgr.setSkillAccTimes(1);
  17904. }
  17905. else {
  17906. DataMgr.setSkillSuccessTimes(0, false);
  17907. }
  17908. }
  17909. if (!this.success) {
  17910. Laya.timer.once(500, this, () => {
  17911. xGame.uiMgr.Show(UIAddCoin$1);
  17912. });
  17913. }
  17914. this.ui.isGetAward.visible = false;
  17915. this.ui.leftBtn.c1.selectedIndex = 3;
  17916. this.ui.rightBtn.c1.selectedIndex = 0;
  17917. this.moneyNode.ui.c1.selectedIndex = 1;
  17918. break;
  17919. case GameMode.placeBall:
  17920. this.ui.coinNode.visible = false;
  17921. if (this.success) {
  17922. if (xGame.common.placeBallStarNum == 3) {
  17923. this.ui.c1.selectedIndex = 2;
  17924. }
  17925. else {
  17926. this.ui.c1.selectedIndex = 3;
  17927. }
  17928. }
  17929. else {
  17930. this.ui.c1.selectedIndex = 4;
  17931. }
  17932. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17933. if (cfg.type == PlaceBallType.challenge) {
  17934. this.ui.c1.selectedIndex = 2;
  17935. }
  17936. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  17937. this.updatePlaceBallBtn();
  17938. this.updatePlaceBallStarNum();
  17939. this.updatePlaceBallAwardState();
  17940. this.moneyNode.ui.c1.selectedIndex = 2;
  17941. this.moneyNode.checkPowerTime();
  17942. this.moneyNode.powerChange();
  17943. DataMgr.upRankData();
  17944. break;
  17945. default:
  17946. break;
  17947. }
  17948. }
  17949. updatePlaceBallBtn() {
  17950. this.ui.leftBtn.c1.selectedIndex = 5;
  17951. if (this.success) {
  17952. this.ui.rightBtn.c1.selectedIndex = 14;
  17953. }
  17954. else {
  17955. if (xGame.common.placeBallStarNum == 3) {
  17956. this.ui.rightBtn.c1.selectedIndex = 14;
  17957. }
  17958. else {
  17959. this.ui.rightBtn.c1.selectedIndex = 1;
  17960. }
  17961. }
  17962. }
  17963. updatePlaceBallStarNum() {
  17964. let starNum = xGame.common.placeBallStarNum;
  17965. if (starNum == 0)
  17966. this.ui.starNumNode.c1.selectedIndex = 3;
  17967. else {
  17968. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  17969. }
  17970. }
  17971. updatePlaceBallAwardState() {
  17972. let level = xGame.common.placeBallCurLevel;
  17973. let starNum = xGame.common.placeBallStarNum;
  17974. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  17975. let data = cfgTable.placeballData[level].award;
  17976. let cfg = cfgTable.placeballData[level];
  17977. this.awardDiamondNum = data[1];
  17978. this.awardCoinNum = data[0];
  17979. if (cfg.type == PlaceBallType.challenge) {
  17980. this.awardDiamondNum = 0;
  17981. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  17982. }
  17983. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  17984. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  17985. if (cfg.type == PlaceBallType.challenge) {
  17986. this.ui.awardNode.coinNode.visible = true;
  17987. }
  17988. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  17989. this.ui.awardNode.diamondNode.x = 265;
  17990. this.ui.awardNode.coinNode.x = 354;
  17991. }
  17992. else {
  17993. this.ui.awardNode.diamondNode.x = 291;
  17994. this.ui.awardNode.coinNode.x = 291;
  17995. }
  17996. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  17997. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  17998. if (this.awardCoinNum == 0) {
  17999. this.ui.awardNode.coinNode.numTxt.text = "";
  18000. }
  18001. if (getAward) {
  18002. this.ui.isGetAward.visible = true;
  18003. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18004. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18005. }
  18006. else {
  18007. this.ui.isGetAward.visible = false;
  18008. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18009. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18010. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18011. }
  18012. else {
  18013. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18014. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18015. }
  18016. }
  18017. }
  18018. show(success) {
  18019. super.show();
  18020. xGame.eventMgr.event(RESET_GAME);
  18021. this.success = success;
  18022. Laya.timer.clearAll(this);
  18023. this.playSecretaryAni();
  18024. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18025. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18026. offsetTime = Math.floor(offsetTime / 1000);
  18027. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18028. this.updateType();
  18029. Laya.timer.once(200, this, () => {
  18030. this.addAward(() => {
  18031. this.updateType();
  18032. Laya.timer.once(500, this, () => {
  18033. this.showChallengeLevel();
  18034. });
  18035. });
  18036. });
  18037. if (this.success) {
  18038. xGame.soundMgr.playSound('slots_roll01');
  18039. xGame.soundMgr.playSound("s_win");
  18040. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18041. }
  18042. else {
  18043. xGame.soundMgr.playSound('matchwin01');
  18044. xGame.soundMgr.playSound("s_lose");
  18045. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18046. }
  18047. if (!Moyu.isLegal)
  18048. PlatMgr.showBanner(true);
  18049. let challengeNum = DataMgr.getChallengeTimes();
  18050. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18051. DataMgr.setChallengeTimes(1);
  18052. }
  18053. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18054. DataMgr.setClassicTimes();
  18055. }
  18056. }
  18057. showChallengeLevel() {
  18058. if (DataMgr.getChallengeTimes() != 0)
  18059. return;
  18060. let skill = DataMgr.getSkillAccTimes();
  18061. let put = DataMgr.getPlaceBallLevelList().length;
  18062. if (skill >= 3 || put >= 5) {
  18063. xGame.uiMgr.Show(UIInvitation$1);
  18064. this.hide();
  18065. }
  18066. }
  18067. addAward(callback) {
  18068. if (!this.success) {
  18069. callback && callback();
  18070. return;
  18071. }
  18072. switch (xGame.common.gameMode) {
  18073. case GameMode.classic:
  18074. this.awardCoinNum = xGame.common.passAwardCoin;
  18075. this.awardDiamondNum = 0;
  18076. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18077. break;
  18078. case GameMode.bigMove:
  18079. this.awardCoinNum = xGame.common.passAwardCoin;
  18080. this.awardDiamondNum = 0;
  18081. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18082. callback && callback();
  18083. break;
  18084. case GameMode.placeBall:
  18085. let level = xGame.common.placeBallCurLevel;
  18086. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18087. if (xGame.common.placeBallStarNum != 3) {
  18088. callback && callback();
  18089. return;
  18090. }
  18091. else {
  18092. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18093. if (getAward) {
  18094. callback && callback();
  18095. return;
  18096. }
  18097. }
  18098. let cfg = cfgTable.placeballData[level];
  18099. let data = cfgTable.placeballData[level].award;
  18100. this.awardCoinNum = data[0];
  18101. this.awardDiamondNum = data[1];
  18102. if (cfg.type == PlaceBallType.challenge) {
  18103. this.awardDiamondNum = 0;
  18104. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18105. }
  18106. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18107. let diamondAward;
  18108. if (this.awardDiamondNum > 0) {
  18109. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18110. xGame.common.getAward([diamondAward, coinAward], callback);
  18111. }
  18112. else {
  18113. xGame.common.getAward([coinAward], callback);
  18114. }
  18115. if (cfg.type == PlaceBallType.normal) {
  18116. DataMgr.setPlaceBallAward(level);
  18117. }
  18118. break;
  18119. default:
  18120. break;
  18121. }
  18122. }
  18123. playSecretaryAni_old() {
  18124. let parent = this.ui.secretary.displayObject;
  18125. parent.destroyChildren();
  18126. let xx = this.ui.secretary.width / 2;
  18127. let yy = this.ui.secretary.height;
  18128. let scale = xGame.common.getSecretaryScale();
  18129. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18130. if (this.success) {
  18131. let rand = Math.random() <= 0.5 ? 2 : 3;
  18132. xGame.common.secretary.play(data, rand, false, parent, () => {
  18133. xGame.common.secretary.play(data, 1, true, parent);
  18134. });
  18135. }
  18136. else {
  18137. xGame.common.secretary.play(data, 0, true, parent);
  18138. }
  18139. }
  18140. playSecretaryAni() {
  18141. let parent = this.ui.secretary.displayObject;
  18142. parent.destroyChildren();
  18143. let xx = this.ui.secretary.width / 2;
  18144. let yy = this.ui.secretary.height;
  18145. let scale = xGame.common.getSecretaryScale();
  18146. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18147. if (this.success) {
  18148. let rand = 0;
  18149. xGame.common.secretary.play(data, 0, true, parent);
  18150. }
  18151. else {
  18152. xGame.common.secretary.play(data, 0, true, parent);
  18153. }
  18154. }
  18155. restartGame() {
  18156. switch (xGame.common.gameMode) {
  18157. case GameMode.classic:
  18158. xGame.eventMgr.event(RESTART_GAME);
  18159. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18160. break;
  18161. case GameMode.bigMove:
  18162. this.hide();
  18163. xGame.eventMgr.event(RESTART_GAME);
  18164. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18165. break;
  18166. default:
  18167. break;
  18168. }
  18169. }
  18170. hide() {
  18171. super.hide();
  18172. xGame.common.stopGirlPop(this.ui.talkNode);
  18173. PlatMgr.showBanner(false);
  18174. }
  18175. returnHome() {
  18176. this.hide();
  18177. let showFailWords = !this.success;
  18178. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18179. }
  18180. clickLeftBtn() {
  18181. switch (xGame.common.gameMode) {
  18182. case GameMode.classic:
  18183. case GameMode.bigMove:
  18184. this.returnHome();
  18185. break;
  18186. case GameMode.placeBall:
  18187. let level = xGame.common.placeBallCurLevel;
  18188. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18189. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18190. break;
  18191. default:
  18192. break;
  18193. }
  18194. }
  18195. powerStartPlaceBallLevel(level, btn) {
  18196. if (DataMgr.powerEnough()) {
  18197. btn.touchable = false;
  18198. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18199. btn.touchable = true;
  18200. DataMgr.setPower(-1);
  18201. xGame.eventMgr.event(POWER_TIME);
  18202. this.startPlaceBallLevel(level);
  18203. }));
  18204. }
  18205. else {
  18206. xGame.uiMgr.Show(UIPower$1, 0);
  18207. }
  18208. }
  18209. clickRightBtn() {
  18210. switch (xGame.common.gameMode) {
  18211. case GameMode.classic:
  18212. console.log('zh:clickRightBtn 111');
  18213. case GameMode.bigMove:
  18214. console.log('zh:clickRightBtn 222');
  18215. this.restartGame();
  18216. break;
  18217. case GameMode.placeBall:
  18218. console.log('zh:clickRightBtn 333');
  18219. let level = xGame.common.placeBallCurLevel;
  18220. let data = DataMgr.getPlaceBallLevel(level);
  18221. let curPss = data.play && !data.isCur;
  18222. if (curPss) {
  18223. console.log('zh:clickRightBtn 333-111');
  18224. console.log('zh:当前LV=' + level);
  18225. if (level == 60) {
  18226. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18227. Laya.timer.once(3000, this, () => {
  18228. this.returnHome();
  18229. });
  18230. }
  18231. else {
  18232. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18233. }
  18234. }
  18235. else {
  18236. console.log('zh:clickRightBtn 333-000');
  18237. Moyu.sendDataEvent("placeBallNextLevel");
  18238. Moyu.showVideoAd(() => {
  18239. DataMgr.setPlaceBallLevel(level, 1);
  18240. this.startPlaceBallLevel(level + 1);
  18241. }, xGame.define.EAdType.placeBallNextLevel);
  18242. }
  18243. break;
  18244. default:
  18245. console.log('zh:clickRightBtn 444');
  18246. break;
  18247. }
  18248. }
  18249. startPlaceBallLevel(level) {
  18250. xGame.common.gameMode = GameMode.placeBall;
  18251. xGame.common.placeBallCurLevel = level;
  18252. xGame.uiMgr.Show(UIGame$1);
  18253. this.hide();
  18254. }
  18255. }
  18256. UIGameEnd$1.uiName = "UIGameEnd";
  18257. class ShowItem$1 {
  18258. constructor() {
  18259. this.ui = ui_ShowItem.createInstance();
  18260. }
  18261. destroySelf() {
  18262. if (!this.ui.isDisposed) {
  18263. this.ui.removeFromParent();
  18264. this.ui.dispose();
  18265. }
  18266. }
  18267. setParent(parent) {
  18268. parent.addChild(this.ui);
  18269. }
  18270. setPos(x, y) {
  18271. this.ui.x = x;
  18272. this.ui.y = y;
  18273. }
  18274. setUrl(index) {
  18275. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18276. }
  18277. }
  18278. class UILevelProp$1 extends UIBase {
  18279. constructor() {
  18280. super();
  18281. this.firstPos = 385;
  18282. this.secondPos = 467;
  18283. this.showItemArr = [];
  18284. }
  18285. onConstructor() {
  18286. this.ui = ui_UILevelProp.createInstance();
  18287. this.contentPane = this.ui;
  18288. this.isEject = false;
  18289. this.addUIClick(this.ui.closeBtn, this.hide);
  18290. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18291. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18292. }
  18293. show(level) {
  18294. super.show();
  18295. this.ui.t1.play();
  18296. this.level = level;
  18297. this.data = cfgTable.placeballData[this.level];
  18298. this.updateSelf();
  18299. this.showPreView();
  18300. this.moneyNode.ui.c1.selectedIndex = 2;
  18301. this.moneyNode.checkPowerTime();
  18302. this.moneyNode.powerChange();
  18303. }
  18304. showPreView() {
  18305. let item;
  18306. let data;
  18307. for (let index = 0; index < this.showItemArr.length; index++) {
  18308. item = this.showItemArr[index];
  18309. item.destroySelf();
  18310. }
  18311. this.showItemArr = [];
  18312. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18313. for (const key in cfgData) {
  18314. data = cfgData[key];
  18315. item = new ShowItem$1();
  18316. item.setParent(this.ui.myNode.displayRoot);
  18317. item.setPos(data.x, data.y);
  18318. item.setUrl(data.value);
  18319. this.showItemArr.push(item);
  18320. }
  18321. }
  18322. updateSelf() {
  18323. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18324. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18325. if (this.data.ball == -1) {
  18326. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18327. }
  18328. else {
  18329. this.ui.myNode.conditionTxt.text = "Reward";
  18330. }
  18331. let localData = DataMgr.getPlaceBallLevel(this.level);
  18332. let getAward = localData.getAward;
  18333. let cfg = cfgTable.placeballData[this.level];
  18334. let coin = this.data.award[0];
  18335. let diamond = this.data.award[1];
  18336. if (cfg.type == PlaceBallType.challenge) {
  18337. diamond = 0;
  18338. coin = 100;
  18339. }
  18340. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18341. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18342. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18343. if (cfg.type == PlaceBallType.challenge) {
  18344. this.ui.myNode.coinNode.numTxt.text = "";
  18345. }
  18346. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18347. if (coin > 0 && diamond > 0) {
  18348. this.ui.myNode.diamondNode.x = 385;
  18349. this.ui.myNode.coinNode.x = 467;
  18350. }
  18351. else {
  18352. this.ui.myNode.diamondNode.x = 385;
  18353. this.ui.myNode.coinNode.x = 385;
  18354. }
  18355. if (!getAward) {
  18356. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18357. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18358. }
  18359. else {
  18360. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18361. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18362. }
  18363. }
  18364. startGame() {
  18365. if (DataMgr.powerEnough()) {
  18366. this.ui.myNode.startBtn.touchable = false;
  18367. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18368. console.log('zh:startGame ');
  18369. this.ui.myNode.startBtn.touchable = true;
  18370. DataMgr.setPower(-1);
  18371. xGame.eventMgr.event(POWER_TIME);
  18372. xGame.common.gameMode = GameMode.placeBall;
  18373. xGame.common.placeBallCurLevel = this.level;
  18374. xGame.uiMgr.Show(UIGame$1);
  18375. xGame.uiMgr.Hide(UILevelDisplay$1);
  18376. xGame.uiMgr.Hide(UIMain$1);
  18377. this.hide();
  18378. }));
  18379. }
  18380. else {
  18381. console.log('zh:startGame no power');
  18382. xGame.uiMgr.Show(UIPower$1);
  18383. }
  18384. }
  18385. hide() {
  18386. super.hide();
  18387. }
  18388. }
  18389. UILevelProp$1.uiName = "UILevelProp";
  18390. class PutBallLevelDisplay$1 {
  18391. constructor(ui, index) {
  18392. this.index = 0;
  18393. this.ui = ui;
  18394. this.index = index;
  18395. this.ui.onClick(this, this.clickSelf);
  18396. this.updateSelf();
  18397. this.ui.levelTxt.text = (this.index + 1) + "";
  18398. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18399. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18400. }
  18401. updateSelf() {
  18402. let level = this.index + 1;
  18403. this.data = DataMgr.getPlaceBallLevel(level);
  18404. this.ui.starNode.c1.selectedIndex = this.data.star;
  18405. let isChallenge = cfgTable.placeballData[level].type;
  18406. if (this.data.isCur) {
  18407. if (isChallenge) {
  18408. this.ui.c1.selectedIndex = 5;
  18409. }
  18410. else {
  18411. this.ui.c1.selectedIndex = 2;
  18412. }
  18413. }
  18414. else {
  18415. if (this.data.play) {
  18416. if (this.data.star == 3) {
  18417. this.ui.c1.selectedIndex = 0;
  18418. }
  18419. else {
  18420. this.ui.c1.selectedIndex = 1;
  18421. }
  18422. }
  18423. else {
  18424. if (isChallenge) {
  18425. this.ui.c1.selectedIndex = 4;
  18426. }
  18427. else {
  18428. this.ui.c1.selectedIndex = 3;
  18429. }
  18430. }
  18431. }
  18432. }
  18433. clickSelf() {
  18434. if (!this.data.play)
  18435. return;
  18436. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18437. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18438. }
  18439. }
  18440. class UILevelDisplay$1 extends UIBase {
  18441. constructor() {
  18442. super();
  18443. }
  18444. onConstructor() {
  18445. this.ui = ui_UILevelDisplay.createInstance();
  18446. this.contentPane = this.ui;
  18447. this.isEject = false;
  18448. this.myList = this.ui.myNode.myList;
  18449. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18450. this.levelItemArr = [];
  18451. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18452. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18453. this.myList.numItems = levelNum;
  18454. if (Moyu.isKs)
  18455. this.ui.closeNode.closeBtn.x += 100;
  18456. }
  18457. levelItemRender(index, target) {
  18458. let item = new PutBallLevelDisplay$1(target, index);
  18459. this.levelItemArr.push(item);
  18460. }
  18461. show() {
  18462. super.show();
  18463. this.updateLevel();
  18464. this.scrollToPlace();
  18465. }
  18466. updateLevel() {
  18467. let temp;
  18468. for (let index = 0; index < this.levelItemArr.length; index++) {
  18469. temp = this.levelItemArr[index];
  18470. temp.updateSelf();
  18471. }
  18472. }
  18473. scrollToPlace() {
  18474. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18475. let passArr = DataMgr.getPlaceBallLevelList();
  18476. let offest = passArr.length;
  18477. if (offest >= maxNum - 1)
  18478. offest = maxNum - 1;
  18479. this.myList.scrollToView(offest, true, true);
  18480. }
  18481. hide() {
  18482. super.hide();
  18483. }
  18484. }
  18485. UILevelDisplay$1.uiName = "UILevelDisplay";
  18486. class UIMatching$1 extends UIBase {
  18487. constructor() {
  18488. super();
  18489. }
  18490. onConstructor() {
  18491. this.ui = ui_UIMatching.createInstance();
  18492. this.contentPane = this.ui;
  18493. this.isEject = false;
  18494. }
  18495. show(callback) {
  18496. super.show();
  18497. PlatMgr.showBanner(true);
  18498. this.callback = callback;
  18499. let user = Moyu.getUserInfo();
  18500. if (!this.selfPot) {
  18501. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18502. }
  18503. if (!this.aiPot) {
  18504. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18505. }
  18506. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18507. this.ui.selfHead.nameTxt.text = user.nickName;
  18508. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18509. this.ui.aiHead.nameTxt.text = "???";
  18510. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18511. this.ui.selfHead.c1.selectedIndex = 0;
  18512. this.ui.aiHead.c1.selectedIndex = 0;
  18513. this.ui.selfHead.x = this.selfPot.x;
  18514. this.ui.selfHead.y = this.selfPot.y;
  18515. this.ui.aiHead.x = this.aiPot.x;
  18516. this.ui.aiHead.y = this.aiPot.y;
  18517. switch (xGame.common.gameMode) {
  18518. case GameMode.classic:
  18519. break;
  18520. case GameMode.bigMove:
  18521. this.initSkillData();
  18522. break;
  18523. default:
  18524. break;
  18525. }
  18526. this.ui.t1.play(Laya.Handler.create(this, () => {
  18527. this.ui.t2.play(Laya.Handler.create(this, () => {
  18528. switch (xGame.common.gameMode) {
  18529. case GameMode.classic:
  18530. this.waitingPeople();
  18531. break;
  18532. case GameMode.bigMove:
  18533. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18534. break;
  18535. default:
  18536. break;
  18537. }
  18538. }));
  18539. }));
  18540. }
  18541. initSkillData() {
  18542. this.skillSelectData = [];
  18543. let skillUrl = xGame.common.skillIconList;
  18544. let skillName = xGame.common.skillNameList;
  18545. let skillLevel = DataMgr.getBigSkillList();
  18546. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18547. for (let index = 0; index < 5; index++) {
  18548. let obj = {};
  18549. obj.skillImg = skillUrl[index];
  18550. obj.skillName = skillName[index];
  18551. obj.skillType = skillType[index];
  18552. obj.skillLevel = skillLevel[index];
  18553. this.skillSelectData.push(obj);
  18554. }
  18555. }
  18556. getAISkillLevel(myLevel) {
  18557. let video = xGame.common.upSkillLevel;
  18558. let aiLevel;
  18559. let temp;
  18560. if (video) {
  18561. temp = xGame.common.randomNum(-2, -1);
  18562. }
  18563. else {
  18564. if (myLevel <= 5) {
  18565. temp = xGame.common.randomNum(1, 3);
  18566. }
  18567. else if (myLevel <= 9) {
  18568. temp = xGame.common.randomNum(-2, 1);
  18569. }
  18570. else {
  18571. temp = xGame.common.randomNum(-4, 0);
  18572. }
  18573. }
  18574. aiLevel = temp + myLevel;
  18575. if (aiLevel <= 1)
  18576. aiLevel = 1;
  18577. if (aiLevel >= 10)
  18578. aiLevel = 10;
  18579. return aiLevel;
  18580. }
  18581. getAISkillType() {
  18582. return xGame.common.randomNum(1, 4);
  18583. let successTimes = DataMgr.getSkillSuccessTimes();
  18584. let info = cfgTable.aiskillData[successTimes];
  18585. if (!info) {
  18586. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18587. info = cfgTable.aiskillData[max];
  18588. }
  18589. let dataArr = info.skillselect;
  18590. let myCfg = {};
  18591. for (let index = 0; index < dataArr.length; index++) {
  18592. let temp = dataArr[index].split('-');
  18593. myCfg[temp[0]] = {};
  18594. myCfg[temp[0]].id = parseInt(temp[0]);
  18595. myCfg[temp[0]].weight = parseInt(temp[1]);
  18596. }
  18597. let aiCfg = xGame.common.initWeight(myCfg);
  18598. let curData = xGame.common.getRandomWeightData(aiCfg);
  18599. return parseInt(curData.id);
  18600. }
  18601. getAISkillData(index) {
  18602. let myLevel = this.skillSelectData[index].skillLevel;
  18603. let aiLevel = this.getAISkillLevel(myLevel);
  18604. let aiType = this.getAISkillType() - 1;
  18605. return { aiLevel, aiType } = { aiLevel, aiType };
  18606. }
  18607. skillSelectFinish(index) {
  18608. let aiInfo = this.getAISkillData(index);
  18609. xGame.common.gameMgr.selfCurSkill = index;
  18610. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18611. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18612. this.ui.selfHead.c1.selectedIndex = 1;
  18613. this.ui.aiHead.c1.selectedIndex = 1;
  18614. let myData = this.skillSelectData[index];
  18615. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18616. let guide = DataMgr.getSkillGuide();
  18617. if (guide == 0) {
  18618. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18619. }
  18620. else {
  18621. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18622. }
  18623. let aiData = this.skillSelectData[aiInfo.aiType];
  18624. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18625. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18626. this.waitingPeople();
  18627. }
  18628. waitingPeople() {
  18629. let time = xGame.common.randomNum(1000, 3000);
  18630. time += 1000;
  18631. Laya.timer.once(time, this, () => {
  18632. this.matchingSuccess();
  18633. });
  18634. }
  18635. matchingSuccess() {
  18636. let gameUI = xGame.common.gameUI;
  18637. let name = gameUI.ui.topNode.aiNameTxt.text;
  18638. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18639. this.ui.aiHead.nameTxt.text = name;
  18640. this.ui.aiHead.headImg.url = url;
  18641. name = gameUI.ui.topNode.selfNameTxt.text;
  18642. url = gameUI.ui.topNode.selfHeadLoader.url;
  18643. this.ui.selfHead.nameTxt.text = name;
  18644. this.ui.selfHead.headImg.url = url;
  18645. this.ui.t3.play(Laya.Handler.create(this, () => {
  18646. this.callback && this.callback();
  18647. this.ui.t4.play(Laya.Handler.create(this, () => {
  18648. this.destroySelf();
  18649. }));
  18650. }));
  18651. }
  18652. destroySelf() {
  18653. this.callback = null;
  18654. this.skillSelectData = null;
  18655. this.selfPot = null;
  18656. this.aiPot = null;
  18657. if (!this.ui.isDisposed) {
  18658. this.ui.removeFromParent();
  18659. this.ui.dispose();
  18660. }
  18661. xGame.uiMgr.destroyUI(this);
  18662. }
  18663. }
  18664. UIMatching$1.uiName = "UIMatching";
  18665. class SkillDisplay$1 {
  18666. constructor(ui, data, uiIndex) {
  18667. this.starX = 0;
  18668. this.starY = 0;
  18669. this.index = 0;
  18670. this.ui = ui;
  18671. this.data = data;
  18672. this.index = uiIndex;
  18673. this.initSelf();
  18674. console.log('zh:SkillDisplay constructor this.skillData=', data);
  18675. }
  18676. initSelf() {
  18677. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18678. this.ui.nameTxt.text = this.data.name;
  18679. this.ui.describeTxt.text = this.data.describe;
  18680. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18681. this.ui.startBtn.onClick(this, this.startGame);
  18682. this.updateSelf();
  18683. }
  18684. updateSelf() {
  18685. this.checkTry();
  18686. let level = DataMgr.getBigSkillByIndex(this.index);
  18687. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18688. }
  18689. checkTry() {
  18690. let index = this.index;
  18691. let level = DataMgr.getBigSkillByIndex(index);
  18692. if (level == null) {
  18693. DataMgr.setBigSkill(index, 1, false);
  18694. level = 1;
  18695. }
  18696. this.ui.levelTxt.text = "LV." + level;
  18697. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18698. this.ui.tryNode.visible = true;
  18699. else
  18700. this.ui.tryNode.visible = false;
  18701. }
  18702. clickAddLevel() {
  18703. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18704. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18705. Moyu.showVideoAd(() => {
  18706. DataMgr.setBigSkill(this.data.index, 1);
  18707. this.updateSelf();
  18708. xGame.common.upSkillLevel = true;
  18709. }, EAdType.upSkill);
  18710. }
  18711. startGame() {
  18712. if (this.data.index == 3) {
  18713. alert('Coming soon!');
  18714. return;
  18715. }
  18716. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18717. let needCoin = xGame.common.bigMoveNeedCoin;
  18718. xGame.common.passAwardCoin = 2000;
  18719. let guide = DataMgr.getSkillGuide();
  18720. console.log('zh:startGame guide=' + guide);
  18721. xGame.common.temSelfLevel = 0;
  18722. if (guide == 0) {
  18723. needCoin = 0;
  18724. xGame.common.temSelfLevel = 100;
  18725. }
  18726. if (DataMgr.coinEnough(needCoin)) {
  18727. DataMgr.setCoin(-needCoin);
  18728. xGame.common.curPlayerSkillType = this.index;
  18729. if (guide == 0)
  18730. xGame.common.curPlayerSkillType = 0;
  18731. xGame.uiMgr.Show(UIGame$1);
  18732. xGame.uiMgr.Hide(UIMain$1);
  18733. xGame.uiMgr.Show(UIMatching$1, () => {
  18734. xGame.common.gameUI.ui.alpha = 1;
  18735. xGame.common.gameUI.startGame();
  18736. xGame.uiMgr.Hide(UISkill$1);
  18737. });
  18738. }
  18739. else {
  18740. xGame.uiMgr.Show(UIAddProp$1, 0);
  18741. Moyu.sendDataEvent("AddCoinVideo");
  18742. }
  18743. }
  18744. }
  18745. class UISkill$1 extends UIBase {
  18746. constructor() {
  18747. super();
  18748. this.skillData = [];
  18749. }
  18750. onConstructor() {
  18751. this.ui = ui_UISkill.createInstance();
  18752. this.contentPane = this.ui;
  18753. this.isEject = false;
  18754. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18755. this.initSkillData();
  18756. console.log('zh:aaaaaa1111111111');
  18757. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18758. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18759. console.log('zh:aaaaaa22222222');
  18760. this.displayList = [];
  18761. this.ui.skillNode.skillList.numItems = 3;
  18762. this.addUIClick(this.ui, this.interuptSecretary);
  18763. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18764. this.ui.talkNode.visible = false;
  18765. if (Moyu.isKs)
  18766. this.ui.closeNode.closeBtn.x += 100;
  18767. }
  18768. show() {
  18769. super.show();
  18770. this.playSecretaryIdle();
  18771. this.moneyNode.ui.c1.selectedIndex = 1;
  18772. Laya.timer.clearAll(this);
  18773. xGame.soundMgr.playSound("s_start");
  18774. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18775. let guide = DataMgr.getSkillGuide();
  18776. this.ui.guideNode.visible = guide == 0;
  18777. let item = this.getSkillItemByUIIndex(0);
  18778. if (guide == 0) {
  18779. item.ui.c1.selectedIndex = 1;
  18780. }
  18781. else {
  18782. item.ui.c1.selectedIndex = 0;
  18783. }
  18784. this.ui.guideNode.guideBtn.visible = guide == 0;
  18785. for (let index = 0; index < this.displayList.length; index++) {
  18786. this.displayList[index].checkTry();
  18787. }
  18788. }
  18789. getSkillItemByUIIndex(cur) {
  18790. for (let index = 0; index < this.displayList.length; index++) {
  18791. if (this.displayList[index].index == cur) {
  18792. return this.displayList[index];
  18793. }
  18794. }
  18795. }
  18796. enterGuideLevel() {
  18797. let item = this.getSkillItemByUIIndex(0);
  18798. item.startGame();
  18799. if (DataMgr.getNewUser())
  18800. Moyu.sendDataEvent("gameStart1");
  18801. }
  18802. initSkillData() {
  18803. this.skillData = [];
  18804. let nameList = xGame.common.skillNameList;
  18805. let iconList = xGame.common.skillIconList;
  18806. let describeList = [
  18807. "Jump shot executed — ball bounced and pocketed an extra one!",
  18808. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  18809. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  18810. ];
  18811. console.log('zh:initSkillData 111111111');
  18812. let data;
  18813. for (let index = 0; index < nameList.length; index++) {
  18814. data = {};
  18815. data.name = nameList[index];
  18816. data.icon = iconList[index];
  18817. data.describe = describeList[index];
  18818. data.index = index;
  18819. this.skillData.push(data);
  18820. }
  18821. }
  18822. updateSkillItem(index, target) {
  18823. if (this.displayList[index] == null) {
  18824. let uiIndex;
  18825. switch (index) {
  18826. case 0:
  18827. uiIndex = 1;
  18828. break;
  18829. case 1:
  18830. uiIndex = 0;
  18831. break;
  18832. case 2:
  18833. uiIndex = 2;
  18834. break;
  18835. case 3:
  18836. uiIndex = 3;
  18837. break;
  18838. default:
  18839. break;
  18840. }
  18841. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18842. this.displayList.push(temp);
  18843. }
  18844. }
  18845. playSecretaryIdle() {
  18846. let parent = this.ui.secretary.displayObject;
  18847. parent.destroyChildren();
  18848. let xx = this.ui.secretary.width / 2;
  18849. let yy = this.ui.secretary.height;
  18850. let scale = xGame.common.getSecretaryScale();
  18851. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18852. xGame.common.secretary.play(data, 0, true, parent);
  18853. }
  18854. returnUIMain() {
  18855. this.hide();
  18856. xGame.common.stopGirlPop(this.ui.talkNode);
  18857. xGame.uiMgr.Show(UIMain$1);
  18858. }
  18859. interuptSecretary() {
  18860. Laya.timer.clearAll(this);
  18861. this.playSecretaryRandomSound();
  18862. }
  18863. playSecretaryRandomSound() {
  18864. if (this.isHide)
  18865. return;
  18866. let time = xGame.common.randomNum(45000, 60000);
  18867. Laya.timer.once(time, this, () => {
  18868. if (this.isHide)
  18869. return;
  18870. let index = xGame.common.randomNum(4, 7);
  18871. xGame.soundMgr.playSound("s_main0" + index);
  18872. let words = 1;
  18873. switch (index) {
  18874. case 4:
  18875. words = 5;
  18876. break;
  18877. case 5:
  18878. words = 3;
  18879. break;
  18880. case 6:
  18881. words = 6;
  18882. break;
  18883. case 7:
  18884. words = 7;
  18885. break;
  18886. default:
  18887. break;
  18888. }
  18889. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18890. this.playSecretaryRandomSound();
  18891. });
  18892. }
  18893. }
  18894. UISkill$1.uiName = "UISkill";
  18895. class UIAddProp$1 extends UIBase {
  18896. constructor() {
  18897. super();
  18898. this.curType = "";
  18899. }
  18900. onConstructor() {
  18901. this.ui = ui_UIAddProp.createInstance();
  18902. this.contentPane = this.ui;
  18903. this.isEject = false;
  18904. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18905. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18906. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18907. this.updateUI();
  18908. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18909. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18910. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18911. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18912. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18913. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18914. }
  18915. show(type) {
  18916. super.show();
  18917. this.curType = type == 0 ? "coin" : "diamond";
  18918. this.switchBtn("");
  18919. this.ui.t0.play();
  18920. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18921. PlatMgr.showInsert(true);
  18922. }
  18923. closeSelf() {
  18924. this.hide();
  18925. }
  18926. updateUI() {
  18927. let data = cfgTable.moneyData;
  18928. let temp;
  18929. let obj;
  18930. for (const key in data) {
  18931. temp = data[key];
  18932. obj = this.ui.myNode["node" + key];
  18933. if (parseInt(key) <= 2) {
  18934. obj.diamondTxt.text = "+" + temp.num;
  18935. }
  18936. else {
  18937. obj.coinTxt.text = temp.num;
  18938. obj.diamondTxt.text = temp.get.split('_')[1];
  18939. }
  18940. }
  18941. this.updateDiamondShare();
  18942. }
  18943. updateDiamondShare() {
  18944. let data = DataMgr.getShareDiamondTimes();
  18945. if (data >= xGame.common.maxShareDiamondTimes) {
  18946. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  18947. this.ui.myNode.node1.touchable = false;
  18948. }
  18949. else {
  18950. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  18951. this.ui.myNode.node1.touchable = true;
  18952. }
  18953. }
  18954. switchBtn(type) {
  18955. if (type == "")
  18956. type = this.curType;
  18957. else {
  18958. if (this.curType == type) {
  18959. return;
  18960. }
  18961. else {
  18962. this.curType = type;
  18963. }
  18964. }
  18965. if (type == "coin") {
  18966. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  18967. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  18968. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  18969. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  18970. this.ui.myNode.c1.selectedIndex = 0;
  18971. }
  18972. else {
  18973. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  18974. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  18975. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  18976. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  18977. this.ui.myNode.c1.selectedIndex = 1;
  18978. }
  18979. }
  18980. convertCoin(index) {
  18981. let data = cfgTable.moneyData[index];
  18982. let coinNum = data.num;
  18983. let str = data.get.split('_')[1];
  18984. let needDiamond = parseInt(str);
  18985. if (DataMgr.diamondEnough(needDiamond)) {
  18986. DataMgr.setDiamond(-needDiamond);
  18987. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  18988. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  18989. }
  18990. else {
  18991. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  18992. this.switchBtn("diamond");
  18993. }
  18994. }
  18995. videoGetDiamond() {
  18996. let num = cfgTable.moneyData[2].num;
  18997. Moyu.showVideoAd(() => {
  18998. xGame.common.playObjFlyAnim(num, Prop.diamond);
  18999. this.closeSelf();
  19000. }, EAdType.addDiamond);
  19001. }
  19002. videoGetCoin() {
  19003. Moyu.showVideoAd(() => {
  19004. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19005. this.closeSelf();
  19006. }, EAdType.addCoin);
  19007. }
  19008. shareGetDiamond() {
  19009. let times = DataMgr.getShareDiamondTimes();
  19010. if (times >= xGame.common.maxShareDiamondTimes) {
  19011. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19012. }
  19013. else {
  19014. if (Moyu.isTT) {
  19015. let num = cfgTable.moneyData[1].num;
  19016. Moyu.shareVideo = '';
  19017. Moyu.shareGame((success) => {
  19018. if (success) {
  19019. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19020. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19021. DataMgr.setShareDiamondTimes(1);
  19022. this.updateDiamondShare();
  19023. }
  19024. else {
  19025. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19026. }
  19027. });
  19028. }
  19029. else {
  19030. Moyu.showVideoAd(() => {
  19031. let diamond = xGame.common.randomNum(50, 100);
  19032. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19033. DataMgr.setShareDiamondTimes(1);
  19034. this.updateDiamondShare();
  19035. }, EAdType.randomDiamond);
  19036. }
  19037. }
  19038. }
  19039. openPutBallView() {
  19040. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19041. let skill = xGame.uiMgr.getUI(UISkill$1);
  19042. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19043. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19044. if (end && !end.isHide) {
  19045. xGame.uiMgr.Hide(UIGameEnd$1);
  19046. xGame.uiMgr.Show(UIMain$1);
  19047. }
  19048. if (skill && !skill.isHide)
  19049. xGame.uiMgr.Hide(UISkill$1);
  19050. if (uigame && !uigame.isHide)
  19051. xGame.uiMgr.Hide(UIGame$1);
  19052. if (level && !level.isHide) {
  19053. }
  19054. else {
  19055. xGame.uiMgr.Show(UILevelDisplay$1);
  19056. }
  19057. this.closeSelf();
  19058. }
  19059. }
  19060. UIAddProp$1.uiName = "UIAddProp";
  19061. class MoneyNode$1 {
  19062. constructor(ui) {
  19063. this.leftTime = 0;
  19064. this.ui = ui;
  19065. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19066. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19067. this.ui.addPowerBtn.onClick(this, this.addPower);
  19068. this.ui.c1.selectedIndex = 1;
  19069. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19070. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19071. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19072. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19073. this.coinChange();
  19074. this.diamondChange();
  19075. this.powerChange();
  19076. }
  19077. addPower() {
  19078. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19079. xGame.uiMgr.Show(UIPower$1);
  19080. }
  19081. powerChange() {
  19082. let powerNum = DataMgr.getPower();
  19083. this.ui.powerTxt.text = powerNum + "";
  19084. }
  19085. checkPowerTime() {
  19086. let cur = new Date().getTime();
  19087. let last = DataMgr.getPowerTime();
  19088. if (last == 0) {
  19089. last = cur;
  19090. DataMgr.setPowerTime(cur);
  19091. }
  19092. let power = DataMgr.getPower();
  19093. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19094. Laya.timer.clearAll(this);
  19095. if (power >= xGame.common.natureMaxPower) {
  19096. this.ui.powerTimeTxt.text = "";
  19097. DataMgr.setPowerTime(cur);
  19098. return;
  19099. }
  19100. if (power + offset >= xGame.common.natureMaxPower) {
  19101. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19102. this.ui.powerTimeTxt.text = "";
  19103. DataMgr.setPowerTime(cur);
  19104. }
  19105. else {
  19106. if (offset > 0) {
  19107. DataMgr.setPower(offset);
  19108. DataMgr.setPowerTime(cur);
  19109. }
  19110. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19111. this.leftTime = xGame.common.powerRecoverNum - time;
  19112. if (this.leftTime <= 0)
  19113. this.leftTime = 0;
  19114. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19115. Laya.timer.loop(1000, this, this.updatePowerTime);
  19116. }
  19117. }
  19118. updatePowerTime() {
  19119. this.leftTime -= 1;
  19120. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19121. if (this.leftTime <= 0) {
  19122. this.checkPowerTime();
  19123. }
  19124. }
  19125. coinChange() {
  19126. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19127. }
  19128. diamondChange() {
  19129. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19130. }
  19131. addCoin() {
  19132. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19133. Moyu.sendDataEvent("AddCoinBtn");
  19134. xGame.uiMgr.Show(UIAddProp$1, 0);
  19135. }
  19136. addDiamond() {
  19137. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19138. Moyu.sendDataEvent("AddDiamondBtn");
  19139. xGame.uiMgr.Show(UIAddProp$1, 1);
  19140. }
  19141. }
  19142. class SettingNode$1 {
  19143. constructor(ui) {
  19144. this.showSetting = false;
  19145. this.openSound = true;
  19146. this.openShake = true;
  19147. this.ui = ui;
  19148. this.ui.soundBtn.onClick(this, this.switchSound);
  19149. this.ui.shakeBtn.onClick(this, this.switchShake);
  19150. this.ui.xyBtn.onClick(this, this.onXy);
  19151. this.ui.clickNode.onClick(this, this.changeSetting);
  19152. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19153. }
  19154. changeSetting() {
  19155. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19156. this.showSetting = !this.showSetting;
  19157. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19158. }
  19159. switchSound() {
  19160. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19161. this.openSound = !this.openSound;
  19162. Moyu.onSetting(this.openSound, this.openShake);
  19163. xGame.soundMgr.onSetting(this.openSound);
  19164. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19165. }
  19166. switchShake() {
  19167. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19168. this.openShake = !this.openShake;
  19169. Moyu.onSetting(this.openSound, this.openShake);
  19170. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19171. }
  19172. onXy() {
  19173. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19174. MoyuMgr$1.showXy(1);
  19175. }
  19176. }
  19177. class UIDraw$1 extends UIBase {
  19178. constructor() {
  19179. super();
  19180. this.curKey = 0;
  19181. }
  19182. onConstructor() {
  19183. this.ui = ui_UIDraw.createInstance();
  19184. this.contentPane = this.ui;
  19185. this.isEject = false;
  19186. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19187. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19188. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19189. this.initDraw();
  19190. this.initUI();
  19191. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19192. if (Moyu.isKs)
  19193. this.ui.closeNode.closeBtn.x += 100;
  19194. }
  19195. show() {
  19196. super.show();
  19197. this.ui.t0.play();
  19198. this.playSecretaryIdle();
  19199. this.updateDraw();
  19200. this.checkFree();
  19201. if (PlatMgr.bannerDelay > 0) {
  19202. this.ui.closeNode.closeBtn.visible = false;
  19203. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19204. this.ui.closeNode.closeBtn.visible = true;
  19205. });
  19206. }
  19207. PlatMgr.showRateBanner();
  19208. }
  19209. hide() {
  19210. Laya.timer.clearAll(this);
  19211. super.hide();
  19212. }
  19213. checkFree() {
  19214. let isFree = DataMgr.getDailyfreeDrawTimes();
  19215. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19216. }
  19217. initDraw() {
  19218. this.drawObj = [];
  19219. let data = cfgTable.drawData;
  19220. let temp;
  19221. let weight = 0;
  19222. for (const key in data) {
  19223. temp = data[key];
  19224. weight += temp.weight;
  19225. this.drawObj.push(weight);
  19226. }
  19227. this.allWeight = weight;
  19228. }
  19229. initUI() {
  19230. let data = cfgTable.drawData;
  19231. let temp;
  19232. let img;
  19233. let txt;
  19234. for (const key in data) {
  19235. temp = data[key];
  19236. img = this.ui.myNode.rotNode["img" + key];
  19237. txt = this.ui.myNode.rotNode["txt" + key];
  19238. img.url = xGame.common.getGameIconUrl(temp.icon);
  19239. txt.visible = true;
  19240. if (temp.award > 2) {
  19241. img.rotation = 0;
  19242. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19243. }
  19244. else {
  19245. img.rotation = temp.rotation;
  19246. txt.text = temp.num;
  19247. }
  19248. }
  19249. }
  19250. getCurkey() {
  19251. let rand = Math.random() * this.allWeight;
  19252. let temp;
  19253. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19254. temp = this.drawObj[index];
  19255. if (index == 0) {
  19256. if (rand < temp) {
  19257. return index + 1;
  19258. }
  19259. }
  19260. else {
  19261. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19262. return index + 1;
  19263. }
  19264. }
  19265. }
  19266. return 2;
  19267. }
  19268. startDraw() {
  19269. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19270. if (freeTimes > 0) {
  19271. this.beginDraw();
  19272. DataMgr.setDailyfreeDrawTimes(0);
  19273. this.checkFree();
  19274. }
  19275. else {
  19276. Moyu.sendDataEvent("turntable");
  19277. Moyu.showVideoAd(() => {
  19278. this.beginDraw();
  19279. }, EAdType.draw);
  19280. }
  19281. }
  19282. beginDraw() {
  19283. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19284. this.ui.drawBtn.touchable = false;
  19285. this.curKey = this.getCurkey();
  19286. console.log("当前key", this.curKey);
  19287. let cell = 60;
  19288. let lap = 3;
  19289. let angle = cell * (this.curKey - 1) + lap * 360;
  19290. let target = this.ui.myNode.rotNode;
  19291. target.rotation = 0;
  19292. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19293. console.log("旋转完成");
  19294. this.ui.drawBtn.touchable = true;
  19295. this.getAward();
  19296. }));
  19297. }
  19298. getAward() {
  19299. let data = cfgTable.drawData[this.curKey];
  19300. let temp = new AwardType();
  19301. temp.type = data.award;
  19302. temp.num = data.num;
  19303. xGame.common.getAward([temp], () => {
  19304. DataMgr.setDrawTimes(1);
  19305. this.updateDraw();
  19306. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19307. });
  19308. }
  19309. updateDraw() {
  19310. let drawTimes = DataMgr.getDrawTimes();
  19311. let awardTimes = DataMgr.getDrawAwardTimes();
  19312. if (Math.floor(drawTimes / 3) > awardTimes) {
  19313. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19314. this.ui.extraNode.boxBtn.touchable = true;
  19315. this.ui.extraNode.tipsTxt.text = "3/3";
  19316. this.ui.extraNode.barNode.width = 265;
  19317. this.getExtraAward();
  19318. }
  19319. else {
  19320. this.ui.extraNode.boxBtn.t0.stop();
  19321. this.ui.extraNode.boxBtn.touchable = false;
  19322. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19323. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19324. }
  19325. let data = cfgTable.drawData[1];
  19326. if (awardTimes == 0) {
  19327. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19328. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19329. this.ui.myNode.rotNode.img1.rotation = 0;
  19330. }
  19331. else {
  19332. let award = data.nextid;
  19333. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19334. this.ui.myNode.rotNode.txt1.text = award[1];
  19335. this.ui.myNode.rotNode.img1.rotation = 0;
  19336. }
  19337. }
  19338. getExtraAward() {
  19339. let drawTimes = DataMgr.getDrawTimes();
  19340. let awardTimes = DataMgr.getDrawAwardTimes();
  19341. let data = cfgTable.drawData[1];
  19342. let award = new AwardType();
  19343. if (awardTimes == 0) {
  19344. award.num = data.num;
  19345. award.type = data.award;
  19346. xGame.common.getAward([award], () => {
  19347. let all = Math.floor(drawTimes / 3);
  19348. DataMgr.setDrawAwardTimes(all);
  19349. this.updateDraw();
  19350. });
  19351. }
  19352. else {
  19353. award.num = parseInt(data.nextid[1]);
  19354. award.type = parseInt(data.nextid[0]);
  19355. xGame.common.getAward([award], () => {
  19356. let all = Math.floor(drawTimes / 3);
  19357. DataMgr.setDrawAwardTimes(all);
  19358. this.updateDraw();
  19359. });
  19360. }
  19361. }
  19362. closeSelf() {
  19363. this.hide();
  19364. }
  19365. playSecretaryIdle() {
  19366. let parent = this.ui.secretary.displayObject;
  19367. parent.destroyChildren();
  19368. let xx = this.ui.secretary.width / 2;
  19369. let yy = this.ui.secretary.height;
  19370. let scale = xGame.common.getSecretaryScale();
  19371. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19372. xGame.common.secretary.play(data, 0, true, parent);
  19373. }
  19374. }
  19375. UIDraw$1.uiName = "UIDraw";
  19376. class UIRanking$1 extends UIBase {
  19377. constructor() {
  19378. super();
  19379. this.showSelf = true;
  19380. this.rankType = 1;
  19381. this.rankList = [];
  19382. this.myIndex = 0;
  19383. this.myStar = 0;
  19384. }
  19385. onConstructor() {
  19386. this.ui = ui_UIRanking.createInstance();
  19387. this.contentPane = this.ui;
  19388. this.isEject = false;
  19389. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19390. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19391. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19392. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19393. this.ui.myNode.myList.setVirtual();
  19394. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19395. }
  19396. show() {
  19397. super.show();
  19398. this.myIndex = 51;
  19399. Moyu.getRankList({
  19400. rankId: xGame.common.curRankID,
  19401. type: MoyuRankType.total,
  19402. page: 1,
  19403. pageSize: 50,
  19404. }, this, this.updateItemData);
  19405. this.updateSelf();
  19406. let self = Moyu.getUserInfo();
  19407. if (!self.isAuth) {
  19408. Moyu.initUser(this, () => {
  19409. DataMgr.upRankData();
  19410. });
  19411. }
  19412. }
  19413. updateSelfItem() {
  19414. let self = Moyu.getUserInfo();
  19415. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19416. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19417. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19418. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19419. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19420. }
  19421. updateItemData(data) {
  19422. this.myStar = xGame.common.getAllStarNum();
  19423. if (this.rankList.length < 2) {
  19424. this.rankList = data;
  19425. let self = Moyu.getUserInfo();
  19426. for (let i = 0; i < data.length; i++) {
  19427. let data = this.rankList[i];
  19428. if (data.userId == self.userId) {
  19429. this.rankList.splice(i, 1);
  19430. break;
  19431. }
  19432. }
  19433. for (let i = 0; i < data.length; i++) {
  19434. let data = this.rankList[i];
  19435. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19436. this.myIndex = i + 1;
  19437. let user = { headIcon: self.headIcon, nickName: "myself" };
  19438. let ud = { user: user, data: {} };
  19439. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19440. if (Moyu.platType < 11) {
  19441. user.headIcon = self.headIcon;
  19442. user.nickName = self.nickName;
  19443. }
  19444. this.rankList.splice(i, 0, md);
  19445. break;
  19446. }
  19447. }
  19448. }
  19449. this.updateSelfItem();
  19450. this.ui.myNode.myList.numItems = this.rankList.length;
  19451. }
  19452. updateItemUI(index, obj) {
  19453. let data = this.rankList[index];
  19454. let userData = JSON.parse(data.userData).user;
  19455. obj.nameTxt.text = userData.nickName.toString();
  19456. obj.valueTxt.text = data.rankScore;
  19457. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19458. obj.rankTxt.text = index + 1;
  19459. switch (index) {
  19460. case 0:
  19461. this.setImg(obj, 1, 0, 0);
  19462. obj.rankTxt.color = "#FFC047";
  19463. break;
  19464. case 1:
  19465. this.setImg(obj, 0, 1, 0);
  19466. obj.rankTxt.color = "#ACACAC";
  19467. break;
  19468. case 2:
  19469. this.setImg(obj, 0, 0, 1);
  19470. obj.rankTxt.color = "#D09672";
  19471. break;
  19472. default:
  19473. this.setImg(obj, 0, 0, 0);
  19474. obj.rankTxt.color = "#496FAB";
  19475. break;
  19476. }
  19477. }
  19478. setImg(obj, a, b, c) {
  19479. obj.img1.visible = a ? true : false;
  19480. obj.img2.visible = b ? true : false;
  19481. obj.img3.visible = c ? true : false;
  19482. }
  19483. changeList(type) {
  19484. this.rankType = type;
  19485. this.updateSelf();
  19486. }
  19487. changeSelfNode() {
  19488. this.showSelf = !this.showSelf;
  19489. this.updateSelf();
  19490. }
  19491. updateSelf() {
  19492. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19493. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19494. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19495. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19496. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19497. }
  19498. }
  19499. UIRanking$1.uiName = "UIRanking";
  19500. class UISecretary$1 extends UIBase {
  19501. constructor() {
  19502. super();
  19503. this.curIndex = 1;
  19504. }
  19505. onConstructor() {
  19506. this.ui = ui_UISecretary.createInstance();
  19507. this.contentPane = this.ui;
  19508. this.isEject = false;
  19509. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19510. this.nodeObj = { left: null, right: null, cur: null };
  19511. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19512. }
  19513. show() {
  19514. super.show();
  19515. this.ui.t0.play();
  19516. this.updateData();
  19517. }
  19518. addSecretarySpine(node, spineName) {
  19519. if (spineName == "mishu") {
  19520. if (this.secretarySpine1) {
  19521. node.displayObject.destroyChildren();
  19522. this.playWoman(this.secretarySpine1, node.displayObject);
  19523. }
  19524. else {
  19525. let spine1 = new SpineMgr("mishu", () => {
  19526. this.secretarySpine1 = spine1;
  19527. this.playWoman(this.secretarySpine1, node.displayObject);
  19528. });
  19529. }
  19530. }
  19531. else {
  19532. if (this.secretarySpine2) {
  19533. node.displayObject.destroyChildren();
  19534. this.playWoman(this.secretarySpine2, node.displayObject);
  19535. }
  19536. else {
  19537. let spine2 = new SpineMgr("xiaomishu2", () => {
  19538. this.secretarySpine2 = spine2;
  19539. this.playWoman(this.secretarySpine2, node.displayObject);
  19540. });
  19541. }
  19542. }
  19543. }
  19544. playWoman(node, parent) {
  19545. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19546. let yy = this.ui.myNode.gameNode3.secretary.height;
  19547. let scale = 1.5;
  19548. if (node == this.secretarySpine2) {
  19549. scale = 1.2;
  19550. }
  19551. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19552. node.play(data, 0, true, parent);
  19553. }
  19554. turnLeft() {
  19555. this.curIndex--;
  19556. if (this.curIndex < 1) {
  19557. this.curIndex = 2;
  19558. }
  19559. let left = this.nodeObj.left;
  19560. let right = this.nodeObj.right;
  19561. let cur = this.nodeObj.cur;
  19562. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19563. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19564. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19565. this.updateData();
  19566. }));
  19567. this.ui.myNode.setChildIndex(right, 2);
  19568. this.nodeObj.left = cur;
  19569. this.nodeObj.right = left;
  19570. this.nodeObj.cur = right;
  19571. }
  19572. turnRight() {
  19573. this.curIndex++;
  19574. if (this.curIndex > 2) {
  19575. this.curIndex = 1;
  19576. }
  19577. let left = this.nodeObj.left;
  19578. let right = this.nodeObj.right;
  19579. let cur = this.nodeObj.cur;
  19580. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19581. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19582. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19583. this.updateData();
  19584. }));
  19585. this.ui.myNode.setChildIndex(left, 2);
  19586. this.nodeObj.left = right;
  19587. this.nodeObj.right = cur;
  19588. this.nodeObj.cur = left;
  19589. }
  19590. updateData() {
  19591. let data = cfgTable.secretaryshopData;
  19592. let children = this.ui.myNode._children;
  19593. let temp;
  19594. let curData;
  19595. for (let index = 0; index < children.length; index++) {
  19596. temp = children[index];
  19597. curData = data[1];
  19598. temp.heightTxt.text = curData.height;
  19599. temp.foodTxt.text = curData.food;
  19600. temp.historyTxt.text = curData.history;
  19601. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19602. this.addSecretarySpine(temp.secretary, curData.spine);
  19603. let womanIndex = curData.id - 1;
  19604. let getWoman = DataMgr.getSecretary(womanIndex);
  19605. let curUse = DataMgr.getCurSecretary();
  19606. if (getWoman) {
  19607. if (curUse == womanIndex) {
  19608. temp.purchaseBtn.c1.selectedIndex = 1;
  19609. }
  19610. else {
  19611. temp.purchaseBtn.c1.selectedIndex = 2;
  19612. }
  19613. }
  19614. else {
  19615. temp.purchaseBtn.c1.selectedIndex = 0;
  19616. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19617. }
  19618. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19619. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19620. }
  19621. }
  19622. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19623. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19624. if (getWoman) {
  19625. if (curUse != womanIndex) {
  19626. console.log();
  19627. DataMgr.setCurSecretary(womanIndex);
  19628. this.updateData();
  19629. }
  19630. }
  19631. else {
  19632. let need = needDiamond;
  19633. if (DataMgr.diamondEnough(need)) {
  19634. DataMgr.setDiamond(-need);
  19635. DataMgr.setSecretary(womanIndex, 1);
  19636. DataMgr.setCurSecretary(womanIndex);
  19637. this.updateData();
  19638. }
  19639. else {
  19640. xGame.uiMgr.Show(UIAddProp$1, 1);
  19641. }
  19642. }
  19643. }
  19644. closeSelf() {
  19645. this.hide();
  19646. }
  19647. }
  19648. UISecretary$1.uiName = "UISecretary";
  19649. class BallRodDisplay$1 {
  19650. constructor(ui, index) {
  19651. this.index = 0;
  19652. this.uiIndex = 0;
  19653. this.ui = ui;
  19654. this.index = index;
  19655. this.initData();
  19656. }
  19657. initData() {
  19658. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19659. let data = cfgTable.ballrodData[this.index + 1];
  19660. this.ui.nameTxt.text = data.name;
  19661. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19662. this.ui.levelNode.c1.selectedIndex = data.quality;
  19663. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19664. if (data.spine) {
  19665. this.mySpine = new SpineMgr(data.spine, () => {
  19666. let xx = 150;
  19667. let yy = 70;
  19668. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19669. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19670. });
  19671. }
  19672. }
  19673. updateSelf() {
  19674. let get = DataMgr.getBallRod(this.index);
  19675. if (get == null)
  19676. get = 1;
  19677. let curUse = DataMgr.getCurBallRod();
  19678. if (get) {
  19679. if (curUse == this.index) {
  19680. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19681. }
  19682. else {
  19683. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19684. }
  19685. }
  19686. else {
  19687. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19688. }
  19689. }
  19690. buyBallRod() {
  19691. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19692. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19693. switch (selectedIndex) {
  19694. case 0:
  19695. break;
  19696. case 1:
  19697. DataMgr.setCurBallRod(this.index);
  19698. let ui = xGame.uiMgr.getUI(UIShop$1);
  19699. ui.updateBallRod();
  19700. break;
  19701. case 2:
  19702. let data = cfgTable.ballrodData[this.index + 1];
  19703. let need = data.price;
  19704. if (DataMgr.diamondEnough(need)) {
  19705. DataMgr.setDiamond(-need);
  19706. DataMgr.setBallRod(this.index, 1);
  19707. DataMgr.setCurBallRod(this.index);
  19708. let ui = xGame.uiMgr.getUI(UIShop$1);
  19709. ui.updateBallRod();
  19710. }
  19711. else {
  19712. xGame.uiMgr.Show(UIAddProp$1, 1);
  19713. }
  19714. break;
  19715. default:
  19716. break;
  19717. }
  19718. }
  19719. }
  19720. class UIShop$1 extends UIBase {
  19721. constructor() {
  19722. super();
  19723. this.itemNums = 0;
  19724. }
  19725. onConstructor() {
  19726. this.ui = ui_UIShop.createInstance();
  19727. this.contentPane = this.ui;
  19728. this.isEject = false;
  19729. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19730. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19731. this.addUIClick(this.ui, this.interuptSecretary);
  19732. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19733. this.ballRodArr = [];
  19734. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19735. this.ui.myNode.myList.numItems = this.itemNums;
  19736. if (Moyu.isKs)
  19737. this.ui.closeNode.closeBtn.x += 100;
  19738. }
  19739. show() {
  19740. super.show();
  19741. this.playSecretaryIdle();
  19742. this.updateBallRod();
  19743. }
  19744. updateBallRod() {
  19745. for (let index = 0; index < this.ballRodArr.length; index++) {
  19746. this.ballRodArr[index].updateSelf();
  19747. }
  19748. }
  19749. renderBallRod(sort, obj) {
  19750. let index = this.getIndexBySort(sort + 1) - 1;
  19751. let ballRod = new BallRodDisplay$1(obj, index);
  19752. this.ballRodArr.push(ballRod);
  19753. }
  19754. getIndexBySort(sort) {
  19755. let object = cfgTable.ballrodData;
  19756. for (const key in object) {
  19757. if (object[key].sort == sort) {
  19758. return parseInt(key);
  19759. }
  19760. }
  19761. }
  19762. playSecretaryIdle() {
  19763. let parent = this.ui.secretary.displayObject;
  19764. parent.destroyChildren();
  19765. let xx = this.ui.secretary.width / 2;
  19766. let yy = this.ui.secretary.height;
  19767. let scale = xGame.common.getSecretaryScale();
  19768. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19769. xGame.common.secretary.play(data, 0, true, parent);
  19770. }
  19771. interuptSecretary() {
  19772. Laya.timer.clearAll(this);
  19773. this.playSecretaryRandomSound();
  19774. }
  19775. playSecretaryRandomSound() {
  19776. if (this.isHide)
  19777. return;
  19778. let time = xGame.common.randomNum(45000, 60000);
  19779. Laya.timer.once(time, this, () => {
  19780. if (this.isHide)
  19781. return;
  19782. let index = xGame.common.randomNum(4, 7);
  19783. xGame.soundMgr.playSound("s_main0" + index);
  19784. let words = 1;
  19785. switch (index) {
  19786. case 4:
  19787. words = 5;
  19788. break;
  19789. case 5:
  19790. words = 3;
  19791. break;
  19792. case 6:
  19793. words = 6;
  19794. break;
  19795. case 7:
  19796. words = 7;
  19797. break;
  19798. default:
  19799. break;
  19800. }
  19801. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19802. this.playSecretaryRandomSound();
  19803. });
  19804. }
  19805. closeSelf() {
  19806. this.hide();
  19807. }
  19808. }
  19809. UIShop$1.uiName = "UIShop";
  19810. class SignMax$1 {
  19811. constructor(ui) {
  19812. this.ui = ui;
  19813. }
  19814. updateSelf(index, sameDay, curDayIndex) {
  19815. let data = cfgTable.signData[index + 1];
  19816. this.ui.titleTxt.text = data.title;
  19817. let arr1 = data.award[0].split('-');
  19818. let arr2 = data.award[1].split('-');
  19819. let num1 = parseInt(arr1[1]);
  19820. let num2 = parseInt(arr2[1]);
  19821. this.ui.numTxt1.text = num1 + "";
  19822. this.ui.numTxt2.text = num2 + "";
  19823. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19824. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19825. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19826. this.ui.numTxt1.visible = false;
  19827. }
  19828. else {
  19829. this.ui.numTxt1.visible = true;
  19830. }
  19831. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19832. this.ui.numTxt2.visible = false;
  19833. }
  19834. else {
  19835. this.ui.numTxt2.visible = true;
  19836. }
  19837. if (index < curDayIndex) {
  19838. this.ui.c1.selectedIndex = 1;
  19839. }
  19840. else if (index == curDayIndex) {
  19841. if (sameDay) {
  19842. this.ui.c1.selectedIndex = 2;
  19843. }
  19844. else {
  19845. this.ui.c1.selectedIndex = 2;
  19846. }
  19847. }
  19848. else {
  19849. this.ui.c1.selectedIndex = 0;
  19850. }
  19851. }
  19852. }
  19853. class SignNormal$1 {
  19854. constructor(ui) {
  19855. this.ui = ui;
  19856. }
  19857. updateSelf(index, sameDay, curDayIndex) {
  19858. let data = cfgTable.signData[index + 1];
  19859. this.ui.titleTxt.text = data.title;
  19860. let arr = data.award[0].split('-');
  19861. let type = parseInt(arr[0]);
  19862. let num = parseInt(arr[1]);
  19863. this.ui.numTxt.text = num + "";
  19864. if (type > 2) {
  19865. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19866. this.ui.myIcon.rotation = 0;
  19867. }
  19868. else {
  19869. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19870. this.ui.myIcon.rotation = 0;
  19871. }
  19872. if (xGame.common.signAwardContainsRod(data.award)) {
  19873. this.ui.numTxt.visible = false;
  19874. }
  19875. else {
  19876. this.ui.numTxt.visible = true;
  19877. }
  19878. if (index < curDayIndex) {
  19879. this.ui.c1.selectedIndex = 1;
  19880. }
  19881. else if (index == curDayIndex) {
  19882. if (sameDay) {
  19883. this.ui.c1.selectedIndex = 2;
  19884. }
  19885. else {
  19886. this.ui.c1.selectedIndex = 2;
  19887. }
  19888. }
  19889. else {
  19890. this.ui.c1.selectedIndex = 0;
  19891. }
  19892. }
  19893. }
  19894. class UISign$1 extends UIBase {
  19895. constructor() {
  19896. super();
  19897. this.curDayIndex = 0;
  19898. this.starX = 0;
  19899. }
  19900. onConstructor() {
  19901. this.ui = ui_UISign.createInstance();
  19902. this.contentPane = this.ui;
  19903. this.isEject = false;
  19904. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19905. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19906. this.initSignItem();
  19907. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19908. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19909. }
  19910. show() {
  19911. super.show();
  19912. this.ui.t0.play();
  19913. this.playSecretaryIdle();
  19914. this.updateSign();
  19915. }
  19916. initSignItem() {
  19917. this.signArr = [];
  19918. for (let index = 0; index < 6; index++) {
  19919. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19920. this.signArr.push(temp);
  19921. }
  19922. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19923. if (Moyu.isKs)
  19924. this.ui.closeNode.closeBtn.x += 100;
  19925. }
  19926. updateSign() {
  19927. let sameDay = xGame.common.judgeSameDay();
  19928. let max = 7;
  19929. this.curDayIndex = DataMgr.getSignData();
  19930. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19931. this.curDayIndex = 0;
  19932. if (!sameDay) {
  19933. this.ui.normalBtn.visible = true;
  19934. this.ui.tipsNode.visible = false;
  19935. this.ui.againBtn.visible = false;
  19936. }
  19937. else {
  19938. this.ui.normalBtn.visible = false;
  19939. let again = DataMgr.getExtraSign();
  19940. let isCurrency = false;
  19941. let index = this.curDayIndex;
  19942. if (index == 0)
  19943. index = 7;
  19944. let award = cfgTable.signData[index].award;
  19945. let num = award[0].split("-")[0];
  19946. if (num == "1" || num == "2")
  19947. isCurrency = true;
  19948. let showAgain = again == 0 && isCurrency;
  19949. this.ui.againBtn.visible = showAgain;
  19950. this.ui.tipsNode.visible = !showAgain;
  19951. }
  19952. for (let index = 0; index < this.signArr.length; index++) {
  19953. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  19954. }
  19955. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  19956. }
  19957. playSecretaryIdle() {
  19958. let parent = this.ui.secretary.displayObject;
  19959. parent.destroyChildren();
  19960. let xx = this.ui.secretary.width / 2;
  19961. let yy = this.ui.secretary.height;
  19962. let scale = xGame.common.getSecretaryScale();
  19963. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19964. xGame.common.secretary.play(data, 0, true, parent);
  19965. }
  19966. closeSelf() {
  19967. this.hide();
  19968. }
  19969. normalGetAward() {
  19970. let sameDay = xGame.common.judgeSameDay();
  19971. if (!sameDay) {
  19972. let award = cfgTable.signData[this.curDayIndex + 1].award;
  19973. let temp;
  19974. let type;
  19975. let num;
  19976. let arr = [];
  19977. for (let index = 0; index < award.length; index++) {
  19978. temp = award[index].split("-");
  19979. type = parseInt(temp[0]);
  19980. num = parseInt(temp[1]);
  19981. let awardType = new AwardType();
  19982. awardType.num = num;
  19983. awardType.type = type;
  19984. arr.push(awardType);
  19985. }
  19986. xGame.common.getAward(arr, (watchVideo) => {
  19987. this.curDayIndex++;
  19988. if (this.curDayIndex > 7)
  19989. this.curDayIndex = 0;
  19990. DataMgr.setSignData(this.curDayIndex);
  19991. DataMgr.setSignTime(new Date().getTime());
  19992. if (watchVideo) {
  19993. DataMgr.setExtraSign(1);
  19994. Moyu.sendDataEvent("signIn1");
  19995. }
  19996. this.updateSign();
  19997. });
  19998. }
  19999. }
  20000. againGetAward() {
  20001. Moyu.sendDataEvent("signIn2");
  20002. Moyu.showVideoAd(() => {
  20003. let index = this.curDayIndex;
  20004. if (index == 0)
  20005. index = 7;
  20006. let award = cfgTable.signData[index].award;
  20007. let temp;
  20008. let type;
  20009. let num;
  20010. for (let index = 0; index < award.length; index++) {
  20011. temp = award[index].split("-");
  20012. type = parseInt(temp[0]);
  20013. num = parseInt(temp[1]) * 3;
  20014. xGame.common.playObjFlyAnim(num, type);
  20015. }
  20016. DataMgr.setExtraSign(1);
  20017. this.updateSign();
  20018. }, EAdType.againSign);
  20019. }
  20020. }
  20021. UISign$1.uiName = "UISign";
  20022. class UIModeSelection$1 extends UIBase {
  20023. constructor() {
  20024. super();
  20025. }
  20026. onConstructor() {
  20027. this.ui = ui_UIModeSelection.createInstance();
  20028. this.contentPane = this.ui;
  20029. this.isEject = false;
  20030. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20031. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20032. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20033. this.addUIClick(this.ui.closeBtn, this.hide);
  20034. this.peopleArr = [650, 6900, 3800];
  20035. this.peopleOffest = [50, 500, 200];
  20036. this.updateSelf();
  20037. }
  20038. show(callback) {
  20039. super.show();
  20040. this.ui.t0.play();
  20041. this.callback = callback;
  20042. }
  20043. updateSelf() {
  20044. let cfg = cfgTable.modeselectData;
  20045. for (let index = 1; index <= 3; index++) {
  20046. let node = this.ui.myNode["type" + index];
  20047. node.need.text = cfg[index].need;
  20048. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20049. node.peopleTxt.text = this.getRandPeople(index - 1);
  20050. }
  20051. }
  20052. enterGame(type) {
  20053. xGame.common.classicRoomType = type;
  20054. let cfg = cfgTable.modeselectData[type];
  20055. let need = cfg.need;
  20056. xGame.common.passAwardCoin = cfg.award;
  20057. if (DataMgr.coinEnough(need)) {
  20058. DataMgr.setCoin(-need);
  20059. this.ui.myNode["type" + type].t0.play();
  20060. Laya.timer.once(200, this, () => {
  20061. this.callback && this.callback();
  20062. });
  20063. }
  20064. else {
  20065. Moyu.sendDataEvent("AddCoinVideo");
  20066. xGame.uiMgr.Show(UIAddProp$1, 0);
  20067. }
  20068. }
  20069. getRandPeople(index) {
  20070. let rand = this.peopleOffest[index];
  20071. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20072. }
  20073. }
  20074. UIModeSelection$1.uiName = "UIModeSelection";
  20075. class UIMain$1 extends UIBase {
  20076. constructor() {
  20077. super();
  20078. this.firstEnter = true;
  20079. }
  20080. onConstructor() {
  20081. this.ui = ui_UIMain.createInstance();
  20082. this.contentPane = this.ui;
  20083. this.isEject = false;
  20084. this.addEvent();
  20085. this.addClickSpine();
  20086. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20087. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20088. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20089. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20090. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20091. let curUse = DataMgr.getCurSecretary();
  20092. this.changeSecretary(curUse);
  20093. this.ui.talkNode.visible = false;
  20094. let guide = DataMgr.getSkillGuide();
  20095. if (xGame.common.isNewDay && guide == 1) {
  20096. xGame.common.isNewDay = false;
  20097. xGame.soundMgr.playSound("s_main01");
  20098. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20099. console.log("播放小秘书每天语音");
  20100. }
  20101. this.onGetUserInfo();
  20102. this.ui.n83.visible = false;
  20103. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20104. }
  20105. changeSecretary(curUse) {
  20106. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20107. xGame.common.secretary && xGame.common.secretary.dispose();
  20108. this.addSecretarySpine(name);
  20109. }
  20110. addSecretarySpine(name) {
  20111. let spine = new SpineMgr(name, () => {
  20112. this.playSecretaryIdle();
  20113. });
  20114. xGame.common.secretary = spine;
  20115. }
  20116. addClickSpine() {
  20117. let clickSpine = new SpineMgr("dianji", () => {
  20118. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20119. let parent = Laya.stage;
  20120. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20121. clickSpine.play(data, 0, false, parent, (spine) => {
  20122. spine.destroy(true);
  20123. });
  20124. });
  20125. });
  20126. }
  20127. addEvent() {
  20128. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20129. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20130. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20131. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20132. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20133. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20134. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20135. this.addUIClick(this.ui, this.interuptSecretary);
  20136. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20137. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20138. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20139. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20140. this.addUIClick(this.ui.signBtn, this.openSignView);
  20141. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20142. }
  20143. show(showFailWords) {
  20144. super.show();
  20145. this.moneyNode.ui.c1.selectedIndex = 1;
  20146. this.playSecretaryIdle();
  20147. xGame.soundMgr.playMusic("caromhall01");
  20148. Laya.timer.clearAll(this);
  20149. this.playSecretaryRandomSound();
  20150. if (showFailWords) {
  20151. setTimeout(() => {
  20152. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20153. let words = -1;
  20154. if (str == "s_main02") {
  20155. words = 2;
  20156. }
  20157. else {
  20158. words = 3;
  20159. }
  20160. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20161. xGame.soundMgr.playSound(str);
  20162. }, 300);
  20163. }
  20164. this.showGuide();
  20165. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20166. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20167. let guide = DataMgr.getSkillGuide();
  20168. if (guide == 1) {
  20169. let randTime = xGame.common.randomNum(300, 800);
  20170. if (this.firstEnter) {
  20171. this.firstEnter = false;
  20172. randTime += 900;
  20173. }
  20174. Laya.timer.once(randTime, this, () => {
  20175. xGame.common.autoPopUIView();
  20176. });
  20177. }
  20178. }
  20179. checkActive(show) {
  20180. }
  20181. showGuide() {
  20182. let guide = DataMgr.getSkillGuide();
  20183. this.ui.guideBtn.visible = guide == 0;
  20184. this.ui.enterGuide.visible = false;
  20185. this.ui.secretaryGuide.visible = guide == 0;
  20186. if (guide == 0) {
  20187. xGame.soundMgr.playSound("s_guide");
  20188. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20189. }
  20190. }
  20191. ensureSecretary() {
  20192. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20193. this.ui.secretaryGuide.visible = false;
  20194. this.ui.enterGuide.visible = true;
  20195. this.ui.wordsNode.t0.play();
  20196. if (DataMgr.getNewUser())
  20197. Moyu.sendDataEvent("gameReady");
  20198. }
  20199. playSecretaryIdle() {
  20200. let parent = this.ui.secretary.displayObject;
  20201. parent.destroyChildren();
  20202. let xx = this.ui.secretary.width / 2;
  20203. let yy = this.ui.secretary.height;
  20204. let scale = xGame.common.getSecretaryScale();
  20205. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20206. console.log("zh:playSecretaryIdle", data);
  20207. xGame.common.secretary.play(data, 0, true, parent);
  20208. }
  20209. startGame(type) {
  20210. xGame.common.gameMode = type;
  20211. Moyu.sendDataEvent("PlayGame", { type: type });
  20212. switch (xGame.common.gameMode) {
  20213. case GameMode.classic:
  20214. let challengeTimes = DataMgr.getChallengeTimes();
  20215. if (challengeTimes == 0) {
  20216. xGame.uiMgr.Show(UIInvitation$1);
  20217. }
  20218. else {
  20219. this.beginGame();
  20220. }
  20221. break;
  20222. case GameMode.bigMove:
  20223. this.beginGame();
  20224. if (DataMgr.getNewUser())
  20225. Moyu.sendDataEvent("gameStart0");
  20226. break;
  20227. default:
  20228. break;
  20229. }
  20230. }
  20231. beginGame(isNice = false) {
  20232. if (xGame.common.gameMode == GameMode.classic) {
  20233. if (isNice) {
  20234. this.enterClassic();
  20235. }
  20236. else {
  20237. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20238. this.enterClassic();
  20239. });
  20240. }
  20241. }
  20242. else if (xGame.common.gameMode == GameMode.bigMove) {
  20243. this.ui.enterGuide.visible = false;
  20244. xGame.uiMgr.Show(UISkill$1);
  20245. }
  20246. }
  20247. enterClassic() {
  20248. xGame.uiMgr.Show(UIGame$1);
  20249. xGame.uiMgr.Show(UIMatching$1, () => {
  20250. if (!this.isHide)
  20251. this.hide();
  20252. xGame.common.gameUI.ui.alpha = 1;
  20253. xGame.common.gameUI.startGame();
  20254. xGame.uiMgr.Hide(UIGameEnd$1);
  20255. });
  20256. }
  20257. startGlobal() {
  20258. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20259. }
  20260. startWeekly() {
  20261. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20262. }
  20263. startPlaceBall() {
  20264. xGame.uiMgr.Show(UILevelDisplay$1);
  20265. }
  20266. hide() {
  20267. super.hide();
  20268. xGame.common.stopGirlPop(this.ui.talkNode);
  20269. }
  20270. onGetUserInfo(force = false) {
  20271. if (Moyu.isWx) {
  20272. let info = Moyu.getSystemInfo();
  20273. if (info)
  20274. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20275. }
  20276. else {
  20277. Moyu.initUser(this, this.freshUser, force);
  20278. }
  20279. if (!Moyu.hasUserInfo) {
  20280. let user = Moyu.getUserInfo();
  20281. user.headIcon = 'res/ty_touxiang.png';
  20282. }
  20283. this.freshUser();
  20284. }
  20285. freshUser() {
  20286. let user = Moyu.getUserInfo();
  20287. if (!user.isAuth) {
  20288. user.headIcon = 'res/ty_touxiang.png';
  20289. }
  20290. else
  20291. DataMgr.upRankData();
  20292. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20293. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20294. }
  20295. interuptSecretary() {
  20296. Laya.timer.clearAll(this);
  20297. this.playSecretaryRandomSound();
  20298. }
  20299. playSecretaryRandomSound() {
  20300. if (this.isHide)
  20301. return;
  20302. let time = xGame.common.randomNum(45000, 60000);
  20303. Laya.timer.once(time, this, () => {
  20304. if (this.isHide)
  20305. return;
  20306. let index = xGame.common.randomNum(4, 7);
  20307. xGame.soundMgr.playSound("s_main0" + index);
  20308. let words = 1;
  20309. switch (index) {
  20310. case 4:
  20311. words = 5;
  20312. break;
  20313. case 5:
  20314. words = 3;
  20315. break;
  20316. case 6:
  20317. words = 6;
  20318. break;
  20319. case 7:
  20320. words = 7;
  20321. break;
  20322. default:
  20323. break;
  20324. }
  20325. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20326. this.playSecretaryRandomSound();
  20327. });
  20328. }
  20329. openSecretaryView() {
  20330. xGame.uiMgr.Show(UISecretary$1);
  20331. Moyu.sendDataEvent("secretary");
  20332. }
  20333. openShopView() {
  20334. xGame.uiMgr.Show(UIShop$1);
  20335. }
  20336. openSignView() {
  20337. xGame.uiMgr.Show(UISign$1);
  20338. }
  20339. openDrawView() {
  20340. xGame.uiMgr.Show(UIDraw$1);
  20341. }
  20342. openRanking() {
  20343. xGame.uiMgr.Show(UIRanking$1);
  20344. Moyu.sendDataEvent("rankingList");
  20345. }
  20346. }
  20347. UIMain$1.uiName = "UIMain";
  20348. function InitShader() {
  20349. }
  20350. function appInit() {
  20351. xGame.context.init(getLoadingResList(), initCallback);
  20352. }
  20353. function getLoadingResList() {
  20354. return [
  20355. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20356. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20357. ];
  20358. }
  20359. function getGameResList() {
  20360. return [
  20361. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20362. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20363. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20364. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20365. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20366. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20367. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20368. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20369. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20370. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20371. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20372. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20373. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20374. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20375. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20376. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20377. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20378. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20379. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20380. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20381. ];
  20382. }
  20383. function initCallback() {
  20384. window["DataMgr"] = DataMgr;
  20385. DataMgr.Init();
  20386. Moyu.init(getPlat(), this, () => {
  20387. DataMgr.isNewDay();
  20388. PlatMgr.initConfig();
  20389. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20390. }, true);
  20391. console.log('zh:开始sm init1 start');
  20392. xGame.soundMgr.init();
  20393. console.log('zh:开始sm init1 end');
  20394. xGame.uiMgr.init();
  20395. xGame.uiMgr.bindFUI(fguiRes.loading);
  20396. xGame.uiMgr.Show(UILoading);
  20397. }
  20398. function loadSubRes(callback) {
  20399. var tab = ["asset", "res", "spine"];
  20400. let subDone = 0;
  20401. for (var i = 0; i < tab.length; i++) {
  20402. let sub = tab[i];
  20403. Moyu.loadSubRes(sub, (pro) => {
  20404. callback && callback(pro, false);
  20405. }).then(() => {
  20406. subDone++;
  20407. if (subDone >= tab.length)
  20408. callback && callback(1, true);
  20409. });
  20410. }
  20411. }
  20412. function enterGame() {
  20413. xGame.cfgMgr.init();
  20414. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20415. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20416. xGame.uiMgr.Hide(UILoading);
  20417. fgui.UIPackage.removePackage(fguiRes.loading);
  20418. xGame.uiMgr.bindFUI(fguiRes.game);
  20419. xGame.uiMgr.Show(UIMain$1);
  20420. if (DataMgr.getNewUser())
  20421. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20422. }
  20423. function getPlat() {
  20424. let cfg = new MoyuCfg();
  20425. cfg.plat = MoyuPlat.web;
  20426. cfg.myId = 120;
  20427. cfg.myKey = '8848a885774230a4';
  20428. cfg.version = 0;
  20429. if (window.hasOwnProperty("gamebox")) {
  20430. cfg.plat = MoyuPlat.f399;
  20431. cfg.version = 0;
  20432. }
  20433. else if (window.hasOwnProperty("ks")) {
  20434. cfg.plat = MoyuPlat.ks;
  20435. cfg.version = 0;
  20436. cfg.ads.ksVideoId = '2300002254_01';
  20437. cfg.ads.ksInsertId = '2300002254_02';
  20438. }
  20439. else if (Laya.Browser.onTTMiniGame) {
  20440. cfg.plat = MoyuPlat.tt;
  20441. cfg.version = 0;
  20442. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20443. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20444. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20445. }
  20446. else if (Laya.Browser.onMiniGame) {
  20447. cfg.plat = MoyuPlat.wx;
  20448. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20449. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20450. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20451. }
  20452. else if (Laya.Browser.onQQMiniGame) {
  20453. cfg.plat = MoyuPlat.qq;
  20454. }
  20455. else if (Laya.Browser.onQGMiniGame) {
  20456. cfg.plat = MoyuPlat.op;
  20457. cfg.ads.opVideoId = '455502';
  20458. cfg.ads.opBannerId = '455507';
  20459. }
  20460. else if (Laya.Browser.onVVMiniGame) {
  20461. cfg.plat = MoyuPlat.vv;
  20462. cfg.version = 0;
  20463. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20464. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20465. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20466. }
  20467. else if (Laya.Browser.onHWMiniGame) {
  20468. cfg.plat = MoyuPlat.hw;
  20469. }
  20470. else if (window["mz"]) {
  20471. cfg.plat = MoyuPlat.mz;
  20472. }
  20473. else {
  20474. let cfg = window['conchConfig'];
  20475. if (cfg) {
  20476. var os = cfg.getOS();
  20477. if (os == "Conch-ios") {
  20478. cfg.plat = MoyuPlat.ios;
  20479. }
  20480. else if (os == "Conch-android") {
  20481. }
  20482. }
  20483. }
  20484. return cfg;
  20485. }
  20486. class Main {
  20487. constructor() {
  20488. if (window["Laya3D"])
  20489. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20490. else {
  20491. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20492. this.initMain();
  20493. }
  20494. }
  20495. initMain() {
  20496. Laya["Physics"] && Laya["Physics"].enable();
  20497. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20498. Laya.stage.scaleMode = GameConfig.scaleMode;
  20499. Laya.stage.screenMode = GameConfig.screenMode;
  20500. Laya.stage.alignV = GameConfig.alignV;
  20501. Laya.stage.alignH = GameConfig.alignH;
  20502. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20503. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20504. Laya.enableDebugPanel();
  20505. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20506. Laya["PhysicsDebugDraw"].enable();
  20507. if (GameConfig.stat)
  20508. Laya.Stat.show();
  20509. Laya.alertGlobalError(true);
  20510. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20511. }
  20512. onVersionLoaded() {
  20513. appInit();
  20514. }
  20515. }
  20516. new Main();
  20517. }());
  20518. //# sourceMappingURL=bundle.js.map