bundle.js 799 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945
  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. this.templet.loadAni(`spine/${name}.sk`);
  1359. this.templet.lock = true;
  1360. this.spineName = name;
  1361. }
  1362. onError() {
  1363. console.log("spine加载出错");
  1364. }
  1365. parseComplete() {
  1366. this.loaded = true;
  1367. this.loadedCallback && this.loadedCallback();
  1368. }
  1369. dispose() {
  1370. if (this.templet && !this.templet.destroyed) {
  1371. this.templet.destroy();
  1372. }
  1373. this.templet = null;
  1374. }
  1375. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1376. if (!this.loaded) {
  1377. return;
  1378. }
  1379. let spine;
  1380. if (mySpine) {
  1381. spine = mySpine;
  1382. }
  1383. else {
  1384. spine = this.createSpine(data, parent);
  1385. }
  1386. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1387. if (!isLoop) {
  1388. spine.on(Laya.Event.STOPPED, this, () => {
  1389. spine.offAll(Laya.Event.STOPPED);
  1390. callback && callback(spine);
  1391. });
  1392. }
  1393. return spine;
  1394. }
  1395. createSpine(data, parent, type = 1) {
  1396. let spine;
  1397. spine = this.templet.buildArmature(type);
  1398. spine.showSkinByIndex(0);
  1399. parent.addChild(spine);
  1400. spine.pos(data.x, data.y);
  1401. spine.scale(data.scaleX, data.scaleY, true);
  1402. return spine;
  1403. }
  1404. }
  1405. var AIState;
  1406. (function (AIState) {
  1407. AIState[AIState["none"] = 0] = "none";
  1408. AIState[AIState["idle"] = 1] = "idle";
  1409. AIState[AIState["reset"] = 2] = "reset";
  1410. AIState[AIState["move"] = 3] = "move";
  1411. AIState[AIState["wait"] = 4] = "wait";
  1412. AIState[AIState["select"] = 5] = "select";
  1413. AIState[AIState["turn"] = 6] = "turn";
  1414. AIState[AIState["shoot"] = 7] = "shoot";
  1415. AIState[AIState["leave"] = 8] = "leave";
  1416. })(AIState || (AIState = {}));
  1417. class AIPlayer {
  1418. constructor() {
  1419. this.dtime = 30;
  1420. this.awayTime = 0;
  1421. this.awayNum = 0;
  1422. this.hideTime = 0;
  1423. this.rootMoveTime = 0;
  1424. this.isGuide = false;
  1425. this.state = AIState.none;
  1426. this.waitTime = 0;
  1427. this.forceNum = 0;
  1428. this.forceMax = 0;
  1429. this.ballSize = 33;
  1430. this.selectNum = 0;
  1431. this.destRot = 0;
  1432. this.aiLv = 10;
  1433. this.kickBall = [];
  1434. this.lineBall = [];
  1435. this.scoreBall = [];
  1436. this.holeBall = [];
  1437. this.turnNum = 0;
  1438. this.setNum = 0;
  1439. this.setMax = 0;
  1440. this.setRate = 0;
  1441. this.rectL = 0;
  1442. this.rectR = 0;
  1443. this.rectT = 0;
  1444. this.rectB = 0;
  1445. this.rootPos = { x: 0, y: 0 };
  1446. this.bestForce = 0;
  1447. this.bestAngle = 180;
  1448. this.bestPos = { x: 0, y: 0 };
  1449. this.bestKick = { x: 0, y: 0 };
  1450. this.posList = [];
  1451. this.posIdx = 0;
  1452. this.chatTime = 3000;
  1453. this.tempDir1 = new Laya.Vector2();
  1454. this.tempDir2 = new Laya.Vector2();
  1455. this.tempDir3 = new Laya.Vector2();
  1456. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1457. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1458. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1459. this.gameSrc = xGame.common.gameUI;
  1460. this.hideTime = Laya.timer.currTimer;
  1461. Moyu.setOnTipCall((id) => {
  1462. if (id == 20012)
  1463. this.hideTime = Laya.timer.currTimer;
  1464. else
  1465. (id == 20011);
  1466. {
  1467. let dt = Laya.timer.currTimer - this.hideTime;
  1468. console.log("onshow" + dt);
  1469. if (dt > 30000 && this.state > AIState.none)
  1470. xGame.common.gameMgr.aiGameEnd(false);
  1471. }
  1472. }, this);
  1473. }
  1474. init() {
  1475. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1476. this.awayTime = xGame.tools.random(5000, 10000);
  1477. this.awayNum = 0;
  1478. this.hideTime = Laya.timer.currTimer;
  1479. let rect = xGame.common.d2World.borderRect;
  1480. this.rectL = Math.ceil(rect.x) + 17;
  1481. this.rectT = Math.ceil(rect.y) + 17;
  1482. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1483. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1484. this.wBall = xGame.common.d2World.rootBall;
  1485. this.ballSize = this.wBall.gameObj.width - 1;
  1486. if (this.posList.length < 1) {
  1487. let dp = 40;
  1488. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1489. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1490. let dx = i < this.rectR ? i : this.rectR;
  1491. let dy = j < this.rectB ? j : this.rectB;
  1492. let order = xGame.tools.random(0, 1000);
  1493. this.posList.push({ x: dx, y: dy, order: order });
  1494. }
  1495. }
  1496. this.posList.sort(function (a, b) {
  1497. return a.order - b.order;
  1498. });
  1499. this.setMax = this.posList.length;
  1500. }
  1501. this.state = AIState.idle;
  1502. }
  1503. setAiLevel(num) {
  1504. this.aiLv = num;
  1505. }
  1506. initBall() {
  1507. this.rootPos.x = this.wBall.gameObj.x;
  1508. this.rootPos.y = this.wBall.gameObj.y;
  1509. this.initHoleBall();
  1510. }
  1511. initHoleBall() {
  1512. this.kickBall = [];
  1513. this.lineBall = [];
  1514. this.scoreBall = [];
  1515. this.holeBall = [];
  1516. this.selectNum = 0;
  1517. this.forceNum = 0;
  1518. this.forceMax = 0;
  1519. this.turnNum = 0;
  1520. let list = xGame.common.d2World.ballArr;
  1521. if (list.length < 20 && !this.isGuide) {
  1522. let holes = xGame.common.gameMgr.holePosList;
  1523. for (let i = 0; i < list.length; i++) {
  1524. let obj = list[i];
  1525. if (!obj)
  1526. continue;
  1527. obj.kickPos.x = 0;
  1528. obj.kickPos.y = 0;
  1529. obj.poleAngle = 0;
  1530. obj.hard = 0;
  1531. obj.borderDis = 0;
  1532. obj.kickAngle = 180;
  1533. if (obj.number == 0)
  1534. continue;
  1535. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1536. continue;
  1537. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1538. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1539. continue;
  1540. }
  1541. let b = obj.gameObj;
  1542. let wbp = this.rootPos;
  1543. let bx = wbp.x - b.x;
  1544. let by = wbp.y - b.y;
  1545. obj.borderDis = xGame.tools.random(0, 100);
  1546. this.kickBall.push(obj);
  1547. if (!this.isLine(wbp, obj))
  1548. continue;
  1549. obj.kickAngle = xGame.tools.random(90, 180);
  1550. obj.kickPos.x = b.x;
  1551. obj.kickPos.y = b.y;
  1552. this.lineBall.push(obj);
  1553. let minDis = 999999;
  1554. let hole = false;
  1555. for (let j = 0; j < holes.length; j++) {
  1556. let hp = holes[j];
  1557. if (bx >= 0 && hp.x > b.x + 100)
  1558. continue;
  1559. if (bx <= 0 && hp.x < b.x - 100)
  1560. continue;
  1561. if (by < -10 && hp.y < wbp.y)
  1562. continue;
  1563. if (by > 10 && hp.y > wbp.y)
  1564. continue;
  1565. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1566. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1567. if (dis < minDis) {
  1568. let dx = b.x - this.tempDir1.x * this.ballSize;
  1569. let dy = b.y - this.tempDir1.y * this.ballSize;
  1570. this.tempDir3.x = this.tempDir1.x;
  1571. this.tempDir3.y = this.tempDir1.y;
  1572. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1573. obj.kickPos.x = dx;
  1574. obj.kickPos.y = dy;
  1575. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1576. if (num > 1)
  1577. num = 1;
  1578. obj.kickAngle = Math.acos(num) * 57.3;
  1579. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1580. dis = dis * 2;
  1581. if (Math.abs(hp.x - 600) < 100)
  1582. dis += 50;
  1583. obj.hard = dis + obj.kickAngle * 3;
  1584. hole = true;
  1585. }
  1586. }
  1587. }
  1588. }
  1589. if (hole) {
  1590. this.scoreBall.push(obj);
  1591. this.holeBall.push(obj);
  1592. }
  1593. }
  1594. this.scoreBall.sort(function (a, b) {
  1595. return a.hard - b.hard;
  1596. });
  1597. this.holeBall.sort(function (a, b) {
  1598. return a.kickAngle - b.kickAngle;
  1599. });
  1600. this.kickBall.sort(function (a, b) {
  1601. return a.borderDis - b.borderDis;
  1602. });
  1603. }
  1604. else {
  1605. let max = list.length - 1;
  1606. let i = xGame.tools.random(0, max);
  1607. for (i; i <= max; i++) {
  1608. let idx = i >= max ? i -= max : i;
  1609. let obj = list[idx];
  1610. if (obj && obj.number != 0) {
  1611. obj.kickAngle = xGame.tools.random(90, 180);
  1612. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1613. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1614. this.lineBall.push(obj);
  1615. break;
  1616. }
  1617. }
  1618. }
  1619. }
  1620. selectBall() {
  1621. let ball = null;
  1622. this.destRot = 0;
  1623. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1624. let ai = 110 - this.aiLv * 10;
  1625. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1626. let score = false;
  1627. if (this.scoreBall.length < 1) {
  1628. if (this.lineBall.length < 1) {
  1629. for (let i = 0; i < this.kickBall.length; i++) {
  1630. let list = [];
  1631. let bo = this.kickBall[i];
  1632. let bobj = bo.gameObj;
  1633. let rect = xGame.common.d2World.borderRect;
  1634. let mobj = this.wBall.gameObj;
  1635. let minb = bobj.y - rect.y - 20;
  1636. let minw = mobj.y - rect.y - 50;
  1637. if (minb > 0 && minw > 0) {
  1638. let dlenx = 0;
  1639. let dleny = mobj.y - rect.y;
  1640. let spx = mobj.x;
  1641. let spy = rect.y - dleny;
  1642. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1643. }
  1644. minb = rect.y + rect.height - bobj.y - 20;
  1645. minw = rect.y + rect.height - mobj.y - 50;
  1646. if (minb > 0 && minw > 0) {
  1647. let dlenx = 0;
  1648. let dleny = rect.y + rect.height - mobj.y;
  1649. let spx = mobj.x;
  1650. let spy = rect.y + rect.height + dleny;
  1651. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1652. }
  1653. minb = bobj.x - rect.x - 20;
  1654. minw = mobj.x - rect.x - 50;
  1655. if (minb > 0 && minw > 0) {
  1656. let dlenx = mobj.x - rect.x;
  1657. let dleny = 0;
  1658. let spx = rect.x - dlenx;
  1659. let spy = mobj.y;
  1660. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1661. }
  1662. minb = rect.x + rect.width - bobj.x - 20;
  1663. minw = rect.x + rect.width - mobj.x - 50;
  1664. if (minb > 0 && minw > 0) {
  1665. let dlenx = rect.x + rect.width - mobj.x;
  1666. let dleny = 0;
  1667. let spx = rect.x + rect.width + dlenx;
  1668. let spy = mobj.y;
  1669. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1670. }
  1671. list.sort(function (a, b) {
  1672. return a.order - b.order;
  1673. });
  1674. for (let i = 0; i < list.length; i++) {
  1675. let data = list[i];
  1676. let mx = mobj.x - bobj.x;
  1677. let my = mobj.y - bobj.y;
  1678. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1679. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1680. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1681. if (num > 1)
  1682. num = 1;
  1683. let cos = Math.acos(num);
  1684. if (cos > 1.57)
  1685. cos = 1.57;
  1686. else if (cos < 0.01)
  1687. cos = 0.01;
  1688. let tan = Math.tan(cos);
  1689. let dx = tan * data.dleny;
  1690. let dy = tan * data.dlenx;
  1691. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1692. if (Math.abs(bx - 667) < 40)
  1693. continue;
  1694. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1695. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1696. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1697. this.forceMax = dis * 0.08;
  1698. this.destRot += mis * 0.1;
  1699. this.setKick(bx, by);
  1700. return true;
  1701. }
  1702. }
  1703. }
  1704. }
  1705. else {
  1706. ball = xGame.common.getRandArrEle(this.lineBall);
  1707. }
  1708. }
  1709. else {
  1710. for (let i = 0; i < this.scoreBall.length; i++) {
  1711. if (i < this.scoreBall.length - 1) {
  1712. let rand = 70 + this.aiLv * 10 + i * 10;
  1713. if (xGame.tools.random(0, 100) < rand) {
  1714. ball = this.scoreBall[i];
  1715. break;
  1716. }
  1717. }
  1718. else {
  1719. ball = this.scoreBall[i];
  1720. break;
  1721. }
  1722. }
  1723. score = true;
  1724. this.selectNum++;
  1725. }
  1726. if (!ball)
  1727. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1728. if (this.selectNum >= max) {
  1729. let dx = ball.gameObj.x;
  1730. let dy = ball.gameObj.y;
  1731. let kickAngle = 0;
  1732. if (score) {
  1733. dx = ball.kickPos.x;
  1734. dy = ball.kickPos.y;
  1735. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1736. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1737. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1738. if (adot > 1)
  1739. adot = 1;
  1740. kickAngle = Math.acos(adot) * 57.3;
  1741. if (kickAngle > 45) {
  1742. let kdx = ball.kickPos.x - ball.gameObj.x;
  1743. let kdy = ball.kickPos.y - ball.gameObj.y;
  1744. dx = ball.kickPos.x - kdx * mis * 0.3;
  1745. dy = ball.kickPos.y - kdy * mis * 0.3;
  1746. }
  1747. else
  1748. this.destRot += mis;
  1749. }
  1750. else if (ball.poleAngle != 0) {
  1751. this.destRot += ball.poleAngle;
  1752. }
  1753. if (xGame.common.gameMode == 0) {
  1754. let af = kickAngle * 0.08;
  1755. this.forceMax = ball.hard * 0.1 + af * af;
  1756. }
  1757. this.setKick(dx, dy);
  1758. }
  1759. else {
  1760. let rand = this.aiLv * 5 + 40;
  1761. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1762. ball = xGame.common.getRandArrEle(this.scoreBall);
  1763. else
  1764. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1765. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1766. if (xGame.tools.random(0, 100) > rand) {
  1767. this.selectNum = max;
  1768. }
  1769. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1770. this.selectNum++;
  1771. }
  1772. ball.onClick(0, true);
  1773. }
  1774. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1775. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1776. let balls = xGame.common.d2World.ballArr;
  1777. let max = xGame.tools.getDis(hx, hy, bx, by);
  1778. for (let index = 0; index < balls.length; index++) {
  1779. let obj = balls[index];
  1780. if (obj.number == 0)
  1781. continue;
  1782. if (obj.number == bn || obj.number == dn)
  1783. continue;
  1784. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1785. if (dis * dis > max)
  1786. continue;
  1787. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1788. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1789. if (num > 1)
  1790. num = 1;
  1791. if (num < 0)
  1792. continue;
  1793. let gap = Math.sin(Math.acos(num)) * dis;
  1794. if (gap < this.ballSize)
  1795. return true;
  1796. }
  1797. return false;
  1798. }
  1799. isLine(xy, ball) {
  1800. let bx = xy.x;
  1801. let by = xy.y;
  1802. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1803. let dis = ball.getDestDis(xy);
  1804. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1805. let sin = Math.sin(angle);
  1806. let cos = Math.cos(angle);
  1807. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1808. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1809. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1810. let dx = bx + this.tempDir2.x * dis;
  1811. let dy = by + this.tempDir2.y * dis;
  1812. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1813. sin = Math.sin(-angle);
  1814. cos = Math.cos(-angle);
  1815. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1816. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1817. dx = bx + this.tempDir2.x * dis;
  1818. dy = by + this.tempDir2.y * dis;
  1819. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1820. if (isr && isl)
  1821. return false;
  1822. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1823. }
  1824. return true;
  1825. }
  1826. turnPole() {
  1827. this.turnNum++;
  1828. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1829. let dr = rot - this.destRot;
  1830. let abs = Math.abs(dr) % 360;
  1831. if (abs > 180) {
  1832. if (rot > 180)
  1833. rot -= 360;
  1834. if (this.destRot > 180)
  1835. this.destRot -= 360;
  1836. }
  1837. let max = this.turnNum * 5 + this.aiLv * 5;
  1838. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  1839. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  1840. let at = xGame.tools.random(1000, 2000);
  1841. if (!this.onAway(3))
  1842. at += xGame.tools.random(10000, 15000);
  1843. this.setState(AIState.shoot, at);
  1844. }
  1845. else {
  1846. let mr = 0;
  1847. if (abs > 3)
  1848. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  1849. else if (Math.random() > 0.6)
  1850. mr = xGame.tools.random(1, 10) * 0.1;
  1851. mr = dr > 0 ? -mr : mr;
  1852. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  1853. }
  1854. }
  1855. setKick(dx, dy) {
  1856. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  1857. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1858. this.tempDir1.x = 0;
  1859. this.tempDir1.y = 1;
  1860. this.tempDir2.y = -this.tempDir2.y;
  1861. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1862. if (num > 1)
  1863. num = 1;
  1864. let rot = Math.acos(num) * 57.3;
  1865. if (this.tempDir2.x < 0)
  1866. rot = 360 - rot;
  1867. this.destRot += rot;
  1868. if (!xGame.common.gameMgr.finishOneShoot) {
  1869. this.forceMax += xGame.tools.random(10, 50);
  1870. this.forceMax -= this.aiLv * 2;
  1871. if (this.forceMax < 20)
  1872. this.forceMax = 20;
  1873. }
  1874. if (this.forceMax > 100)
  1875. this.forceMax = 101;
  1876. else if (this.forceMax < 10)
  1877. this.forceMax += xGame.tools.random(0, 10);
  1878. if (xGame.common.gameMode == 1)
  1879. this.forceMax = xGame.tools.random(80, 100);
  1880. else
  1881. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  1882. let max = 2000 - this.aiLv * 100;
  1883. if (Math.random() > 0.8)
  1884. max += xGame.tools.random(100, 2000);
  1885. this.setState(AIState.turn, xGame.tools.random(500, max));
  1886. }
  1887. shoot() {
  1888. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  1889. if (Math.random() > 0.8) {
  1890. this.gameSrc.aiForce(1);
  1891. this.setState(AIState.wait);
  1892. }
  1893. }
  1894. else {
  1895. let df = xGame.tools.random(3, 8);
  1896. if (this.forceNum < this.forceMax)
  1897. this.forceNum += df;
  1898. else
  1899. this.forceNum -= df;
  1900. let startY = this.gameSrc.ui.powerNode.y;
  1901. let height = this.gameSrc.ui.powerNode.height;
  1902. let force = startY + height * this.forceNum * 0.01;
  1903. this.gameSrc.aiForce(2, force);
  1904. }
  1905. }
  1906. reset() {
  1907. for (let i = 0; i < 4; i++) {
  1908. this.setRate--;
  1909. this.setNum++;
  1910. let pos = this.posList[this.posIdx];
  1911. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  1912. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  1913. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  1914. this.rootPos.x = 387;
  1915. if (this.rootPos.x < this.rectL)
  1916. this.rootPos.x = this.rectL;
  1917. else if (this.rootPos.x > this.rectR)
  1918. this.rootPos.x = this.rectR;
  1919. if (this.rootPos.y < this.rectT)
  1920. this.rootPos.y = this.rectT;
  1921. else if (this.rootPos.y > this.rectB)
  1922. this.rootPos.y = this.rectB;
  1923. this.posIdx++;
  1924. let max = this.posList.length;
  1925. if (this.posIdx >= max)
  1926. this.posIdx -= max;
  1927. this.initHoleBall();
  1928. let ball = null;
  1929. if (this.scoreBall.length > 0)
  1930. ball = this.scoreBall[0];
  1931. else if (this.lineBall.length > 0)
  1932. ball = xGame.common.getRandArrEle(this.lineBall);
  1933. if (ball && ball.kickAngle < this.bestAngle) {
  1934. this.bestAngle = ball.kickAngle;
  1935. this.bestKick.x = ball.kickPos.x;
  1936. this.bestKick.y = ball.kickPos.y;
  1937. this.bestPos.x = this.rootPos.x;
  1938. this.bestPos.y = this.rootPos.y;
  1939. this.bestForce = ball.hard * 0.08;
  1940. }
  1941. }
  1942. if (this.setNum >= this.setMax)
  1943. this.setMax = 0;
  1944. if (this.setRate < 1) {
  1945. this.setState(AIState.move, 0);
  1946. this.rootMoveTime = Laya.timer.currTimer;
  1947. this.gameSrc.aiRootMove(true);
  1948. }
  1949. }
  1950. delayLine() {
  1951. this.gameSrc.aiRootMove(false);
  1952. }
  1953. move() {
  1954. if (this.bestPos.x < 1)
  1955. this.bestPos = this.rootPos;
  1956. let wObj = this.wBall.gameObj;
  1957. let destx = wObj.x;
  1958. let desty = wObj.y;
  1959. let dx = Math.abs(destx - this.bestPos.x);
  1960. let dy = Math.abs(desty - this.bestPos.y);
  1961. let mx = 3 + dx * 0.03;
  1962. let my = 3 + dy * 0.03;
  1963. if (dx < 4 && dy < 4) {
  1964. let dt = Laya.timer.currTimer - this.rootMoveTime;
  1965. dt = dt < 1000 ? 1000 - dt : 0;
  1966. if (this.setMax > 0) {
  1967. let min = this.setMax * 0.3 + this.aiLv * 5;
  1968. this.setRate = xGame.tools.random(min, this.setMax);
  1969. this.setState(AIState.reset, 0);
  1970. }
  1971. else {
  1972. this.destRot = 0;
  1973. this.forceMax = this.bestForce;
  1974. this.setKick(this.bestKick.x, this.bestKick.y);
  1975. }
  1976. if (dt > 100) {
  1977. Laya.timer.clear(this, this.delayLine);
  1978. Laya.timer.once(dt, this, this.delayLine);
  1979. }
  1980. else
  1981. this.gameSrc.aiRootMove(false);
  1982. }
  1983. else {
  1984. if (dx > 4)
  1985. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  1986. if (dy > 4)
  1987. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  1988. this.gameSrc.onRootMove({ x: destx, y: desty });
  1989. }
  1990. }
  1991. resetRoot() {
  1992. this.bestAngle = 180;
  1993. this.bestForce = 0;
  1994. this.setMax = this.posList.length;
  1995. this.posIdx = xGame.tools.random(0, this.setMax);
  1996. let min = this.setMax * 0.3 + this.aiLv * 5;
  1997. this.setRate = xGame.tools.random(min, this.setMax);
  1998. let max = 2000 - this.aiLv * 100;
  1999. if (Math.random() > 0.8)
  2000. max += xGame.tools.random(100, 1000);
  2001. if (this.isGuide)
  2002. this.setState(AIState.select, 500);
  2003. else if (this.onAway(2))
  2004. this.setState(AIState.reset, xGame.tools.random(400, max));
  2005. else
  2006. this.setState(AIState.none);
  2007. if (xGame.common.gameMgr.finishOneShoot)
  2008. this.chat();
  2009. }
  2010. runAI() {
  2011. if (this.state > AIState.idle)
  2012. return;
  2013. this.initBall();
  2014. this.onGame(2500);
  2015. if (Math.random() > 0.6)
  2016. this.chat();
  2017. }
  2018. stopRun() {
  2019. this.setState(AIState.idle);
  2020. }
  2021. onGame(base) {
  2022. let max = base - this.aiLv * 100;
  2023. if (Math.random() > 0.8)
  2024. max += xGame.tools.random(100, 1000);
  2025. if (this.onAway(2))
  2026. this.setState(AIState.select, xGame.tools.random(500, max));
  2027. else
  2028. this.setState(AIState.none);
  2029. }
  2030. setState(sta, wt = 0) {
  2031. if (this.state == AIState.none)
  2032. return;
  2033. this.state = sta;
  2034. this.waitTime = wt;
  2035. }
  2036. onUpdate() {
  2037. if (this.state == AIState.none)
  2038. return;
  2039. this.awayTime -= this.dtime;
  2040. if (this.awayTime < 1) {
  2041. this.awayTime = xGame.tools.random(6000, 10000);
  2042. this.awayNum += (11 - this.aiLv);
  2043. this.onAway(1);
  2044. }
  2045. if (this.waitTime >= 0) {
  2046. this.waitTime -= this.dtime;
  2047. return;
  2048. }
  2049. switch (this.state) {
  2050. case AIState.idle:
  2051. this.chat();
  2052. break;
  2053. case AIState.reset:
  2054. this.reset();
  2055. break;
  2056. case AIState.move:
  2057. this.move();
  2058. break;
  2059. case AIState.leave:
  2060. this.state = AIState.none;
  2061. xGame.common.gameMgr.aiGameEnd(true);
  2062. break;
  2063. case AIState.select:
  2064. this.selectBall();
  2065. break;
  2066. case AIState.turn:
  2067. this.turnPole();
  2068. break;
  2069. case AIState.shoot:
  2070. this.shoot();
  2071. break;
  2072. }
  2073. }
  2074. onAway(type) {
  2075. if (type == 1) {
  2076. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2077. let num = this.awayNum + db * 20;
  2078. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2079. xGame.common.gameMgr.aiLeave();
  2080. this.setState(AIState.leave, 6666);
  2081. }
  2082. }
  2083. else if (type == 2) {
  2084. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2085. let num = this.awayNum + db * 30;
  2086. if (xGame.tools.random(0, 10000) < num)
  2087. return false;
  2088. }
  2089. else if (type == 3) {
  2090. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2091. let num = this.awayNum + db * 10;
  2092. if (xGame.tools.random(0, 4000) < num)
  2093. return false;
  2094. }
  2095. return true;
  2096. }
  2097. chat() {
  2098. if (this.chatTime > 0) {
  2099. this.chatTime -= this.dtime;
  2100. return;
  2101. }
  2102. this.chatTime = xGame.tools.random(2000, 10000);
  2103. let rand = xGame.tools.random(0, 100);
  2104. if (rand < 15)
  2105. this.talk();
  2106. else if (rand < 35)
  2107. this.emotion();
  2108. }
  2109. talk() {
  2110. xGame.common.talkMgr.showAITalk(0);
  2111. }
  2112. emotion() {
  2113. xGame.common.talkMgr.showAIEmotion(0);
  2114. }
  2115. resetAI() {
  2116. this.stopRun();
  2117. this.state = AIState.none;
  2118. }
  2119. }
  2120. class Partical extends Laya.Script3D {
  2121. constructor() {
  2122. super();
  2123. this.duration = 2000;
  2124. }
  2125. ;
  2126. onAwake() {
  2127. this.gameObj = this.owner;
  2128. }
  2129. onEnable() {
  2130. this.openTimer();
  2131. }
  2132. openTimer() {
  2133. Laya.timer.once(this.duration, this, this.disappear);
  2134. }
  2135. setCallback(obj, callback) {
  2136. this.obj = obj;
  2137. this.callback = callback;
  2138. Laya.timer.clearAll(this);
  2139. Laya.timer.once(this.duration, this, this.disappear);
  2140. }
  2141. disappear() {
  2142. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2143. this.callback && this.callback(this.obj);
  2144. }
  2145. }
  2146. class Ball extends Laya.Script3D {
  2147. constructor() {
  2148. super();
  2149. this.posV3 = new Laya.Vector3();
  2150. this.rotRate = 2.1;
  2151. this.rotSpeed = new Laya.Vector3();
  2152. this.myIndex = 0;
  2153. }
  2154. onAwake() {
  2155. this.gameObj = this.owner;
  2156. this.transform = this.gameObj.transform;
  2157. this.ballNode = this.gameObj.getChildByName("Ball");
  2158. this.shadowNode = this.gameObj.getChildByName("shadow");
  2159. }
  2160. initSelf(index, x, y, owner) {
  2161. this.d2BallSrc = owner;
  2162. this.myIndex = index;
  2163. this.setAlbedoTexture();
  2164. this.setTransPos(x, y);
  2165. this.setScale();
  2166. this.ballNode.transform.localRotationEulerX = 90;
  2167. if (index == 0) {
  2168. }
  2169. }
  2170. setAlbedoTexture(isIce = false) {
  2171. let url;
  2172. if (isIce) {
  2173. url = `res/d3Res/ballTexture/ice.jpg`;
  2174. }
  2175. else {
  2176. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2177. }
  2178. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2179. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2180. }));
  2181. }
  2182. runFireworks(obj, delay, callback) {
  2183. Laya.timer.clearAll(this);
  2184. Laya.timer.once(delay + 1, this, () => {
  2185. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2186. fire.transform.localPositionX = this.transform.localPositionX;
  2187. fire.transform.localPositionY = this.transform.localPositionY;
  2188. fire.transform.localPositionZ = this.transform.localPositionZ;
  2189. let src = fire.getComponent(Partical);
  2190. src.duration = 1000;
  2191. src.setCallback(obj, callback);
  2192. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2193. eft.transform.localPositionX = this.transform.localPositionX;
  2194. eft.transform.localPositionY = this.transform.localPositionY;
  2195. eft.transform.localPositionZ = this.transform.localPositionZ;
  2196. });
  2197. }
  2198. setTransPos(x, y) {
  2199. this.setRotation();
  2200. xGame.common.pos2to3Convert(x, y, this.posV3);
  2201. this.transform.localPositionX = this.posV3.x;
  2202. this.transform.localPositionY = 0;
  2203. this.transform.localPositionZ = this.posV3.z;
  2204. this.transform.localRotationEulerX = 0;
  2205. this.transform.localRotationEulerY = 0;
  2206. this.transform.localRotationEulerZ = 0;
  2207. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2208. this.shadowNode.transform.localPositionY = 0.1;
  2209. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2210. }
  2211. setRotation() {
  2212. if (this.d2BallSrc.canRot) {
  2213. let speed = this.d2BallSrc.rigy.linearVelocity;
  2214. this.rotSpeed.x = speed.x * this.rotRate;
  2215. this.rotSpeed.z = speed.y * this.rotRate;
  2216. this.rotSpeed.y = this.d2BallSrc.rotY;
  2217. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2218. }
  2219. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2220. this.rotSpeed.x = this.rotSpeed.y = 0;
  2221. this.rotSpeed.y = this.d2BallSrc.rotY;
  2222. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2223. }
  2224. }
  2225. setScale() {
  2226. let radius = xGame.common.d2World.rootBall.ui.width;
  2227. let scale = xGame.common.scale2to3Convert(radius);
  2228. this.transform.localScaleX = scale;
  2229. this.transform.localScaleY = scale;
  2230. this.transform.localScaleZ = scale;
  2231. }
  2232. playInHoleEft() {
  2233. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2234. eft.transform.position = this.transform.position;
  2235. }
  2236. playIceEft() {
  2237. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2238. eft.transform.position = this.transform.position;
  2239. }
  2240. get scaleXYZ() {
  2241. return this.transform.localScaleX;
  2242. }
  2243. set scaleXYZ(val) {
  2244. this.transform.localScaleX = val;
  2245. this.transform.localScaleY = val;
  2246. this.transform.localScaleZ = val;
  2247. }
  2248. get posX() {
  2249. return this.transform.localPositionX;
  2250. }
  2251. set posX(val) {
  2252. this.transform.localPositionX = val;
  2253. }
  2254. get posY() {
  2255. return this.transform.localPositionY;
  2256. }
  2257. set posY(val) {
  2258. this.transform.localPositionY = val;
  2259. }
  2260. get posZ() {
  2261. return this.transform.localPositionZ;
  2262. }
  2263. set posZ(val) {
  2264. this.transform.localPositionZ = val;
  2265. }
  2266. destroySelf() {
  2267. this.posV3 = null;
  2268. this.rotSpeed = null;
  2269. this.d2BallSrc = null;
  2270. this.ballNode = null;
  2271. this.gameObj.destroy(true);
  2272. this.transform = null;
  2273. this.destroy();
  2274. }
  2275. }
  2276. class ui_D2Ball extends fgui.GComponent {
  2277. static createInstance() {
  2278. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2279. }
  2280. onConstruct() {
  2281. this.myIcon = (this.getChild("myIcon"));
  2282. this.inner = (this.getChild("inner"));
  2283. this.n8 = (this.getChild("n8"));
  2284. this.n4 = (this.getChild("n4"));
  2285. this.wrongTips = (this.getChild("wrongTips"));
  2286. this.rightTips = (this.getChild("rightTips"));
  2287. this.breathAni = this.getTransition("breathAni");
  2288. }
  2289. }
  2290. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2291. class D2BallSrc extends Laya.Script {
  2292. constructor() {
  2293. super();
  2294. this.number = 0;
  2295. this.startX = 0;
  2296. this.startY = 0;
  2297. this.angleV2 = new Laya.Vector2();
  2298. this.isRootBall = false;
  2299. this.isBlackBall = false;
  2300. this.ballType = "";
  2301. this.canRot = true;
  2302. this.rotY = 0;
  2303. this.poleAngle = 0;
  2304. this.kickPos = { x: 0, y: 0 };
  2305. this.hard = 0;
  2306. this.kickAngle = 0;
  2307. this.borderDis = 0;
  2308. this.speedP10 = 5.6;
  2309. this.lastSpeed = { x: 0, y: 0 };
  2310. this.stillSpeed = 0.12;
  2311. this.ballFunc = "normal";
  2312. this.isRunSkillAni = false;
  2313. this.isInHole = false;
  2314. this.iceOwner = "";
  2315. this.forceRun = false;
  2316. this.myUNID = "";
  2317. this.rectL = 0;
  2318. this.rectR = 0;
  2319. this.rectT = 0;
  2320. this.rectB = 0;
  2321. this.forceVec = new Laya.Vector2();
  2322. this.lastDis = 0;
  2323. this.helpOut = { type: "", x: 0, y: 0 };
  2324. }
  2325. initSelf(number, x, y, d3Ball) {
  2326. if (!this.gameObj)
  2327. this.gameObj = this.owner;
  2328. this.number = number;
  2329. this.startX = x;
  2330. this.startY = y;
  2331. this.d3Ball = d3Ball;
  2332. this.isRootBall = false;
  2333. this.isBlackBall = false;
  2334. this.ballType = "";
  2335. if (number == 0) {
  2336. this.isRootBall = true;
  2337. }
  2338. else if (number == 8) {
  2339. this.isBlackBall = true;
  2340. }
  2341. else {
  2342. if (number <= 7) {
  2343. this.ballType = ballCamp.full;
  2344. }
  2345. else {
  2346. this.ballType = ballCamp.flower;
  2347. }
  2348. }
  2349. this.setInfo();
  2350. this.setD3Ball();
  2351. this.owner["mySrc"] = this;
  2352. this.rigy.linearDamping = 1;
  2353. D2BallSrc._unid++;
  2354. this.myUNID = "d2ball" + D2BallSrc._unid;
  2355. let rect = xGame.common.d2World.borderRect;
  2356. this.rectL = Math.ceil(rect.x) + 20;
  2357. this.rectT = Math.ceil(rect.y) + 20;
  2358. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2359. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2360. }
  2361. setInfo() {
  2362. this.gameObj.x = this.startX;
  2363. this.gameObj.y = this.startY;
  2364. let radius = this.ui.width / 2;
  2365. this.gameObj.width = radius * 2;
  2366. this.gameObj.height = radius * 2;
  2367. if (xGame.common.showDebug) {
  2368. this.ui.myIcon.alpha = 1;
  2369. this.ui.inner.alpha = 1;
  2370. }
  2371. else {
  2372. this.ui.myIcon.alpha = 0;
  2373. this.ui.inner.alpha = 0;
  2374. }
  2375. }
  2376. setD3Ball() {
  2377. this.d3Ball = this.d3Ball;
  2378. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2379. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2380. }
  2381. onUpdate() {
  2382. if (xGame.common.gameMgr.gamePause)
  2383. return;
  2384. if (this.isInHole)
  2385. return;
  2386. if (!xGame.common.d2World.openCheckStill)
  2387. return;
  2388. this.runBall();
  2389. }
  2390. runBall() {
  2391. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2392. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2393. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2394. this.judgeBorder();
  2395. }
  2396. getDestDis(dest) {
  2397. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2398. }
  2399. setmyXY(x, y) {
  2400. this.d3BallSrc.setTransPos(x, y);
  2401. }
  2402. getSpeed() {
  2403. let speed = this.rigy.linearVelocity;
  2404. return speed.x * speed.x + speed.y * speed.y;
  2405. }
  2406. onTriggerEnter(collider) {
  2407. if (!collider || !collider.owner)
  2408. return;
  2409. let coll = "collide";
  2410. let speed = this.getSpeed();
  2411. let sv2 = this.speedP10 * this.speedP10;
  2412. if (collider.label == "ball") {
  2413. if (speed < 9 && this.number != 0)
  2414. coll = "";
  2415. else if (speed < sv2)
  2416. coll = "collide_4";
  2417. else if (speed < sv2 * 6.2)
  2418. coll = "collide_3";
  2419. else if (speed < sv2 * 25)
  2420. coll = "collide_2";
  2421. else if (speed < sv2 * 56)
  2422. coll = "collide_1";
  2423. xGame.soundMgr.playSound(coll);
  2424. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2425. if (collider.owner) {
  2426. let rig = collider.owner.getComponent(D2BallSrc);
  2427. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2428. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2429. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2430. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2431. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2432. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2433. let rx = 0;
  2434. let ry = 0;
  2435. if (this.gameObj.x < this.rectL)
  2436. rx = vx;
  2437. else if (this.gameObj.x > this.rectR)
  2438. rx = -vx;
  2439. else if (this.gameObj.y < this.rectT)
  2440. ry = vy;
  2441. else if (this.gameObj.y > this.rectB)
  2442. ry = -vy;
  2443. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2444. }
  2445. }
  2446. if (this.number != 0) {
  2447. return;
  2448. }
  2449. else {
  2450. if (this.forceRun) {
  2451. console.log("randon force");
  2452. this.applyForce(collider);
  2453. }
  2454. }
  2455. if (xGame.common.d2World.isOnSameLine) {
  2456. xGame.common.d2World.isOnSameLine = false;
  2457. this.rigy.linearVelocity = { x: 0, y: 0 };
  2458. }
  2459. if (xGame.common.gameMgr.firstColliObj == null) {
  2460. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2461. xGame.common.gameMgr.isTouchedBall = true;
  2462. }
  2463. }
  2464. else {
  2465. xGame.common.recoverCameraView();
  2466. let wallStr = "";
  2467. if (speed < 9) { }
  2468. else if (speed < sv2) { }
  2469. else if (speed < sv2 * 6.2)
  2470. wallStr = "wall_30";
  2471. else if (speed < sv2 * 25)
  2472. wallStr = "wall_50";
  2473. else if (speed < sv2 * 56)
  2474. wallStr = "wall_80";
  2475. xGame.soundMgr.playSound(wallStr);
  2476. }
  2477. }
  2478. applyForce(collider) {
  2479. let src = collider.owner.mySrc;
  2480. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2481. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2482. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2483. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2484. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2485. }
  2486. checkWrongBall(playEft = true) {
  2487. if (this.isInHole)
  2488. return;
  2489. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2490. if (this.number != 0 && playEft)
  2491. this.d3BallSrc.playInHoleEft();
  2492. let coll = "inpocket_1";
  2493. let speed = this.getSpeed();
  2494. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2495. if (speed < 9 && this.number != 0)
  2496. coll = "";
  2497. else if (speed < sv2 * 6.2)
  2498. coll = "inpocket_4";
  2499. else if (speed < sv2 * 25)
  2500. coll = "collide_3";
  2501. else if (speed < sv2 * 56)
  2502. coll = "collide_2";
  2503. xGame.soundMgr.playSound(coll);
  2504. this.isInHole = true;
  2505. if (this.number == 0) {
  2506. console.log("白球进了。。");
  2507. this.reset();
  2508. this.rigy.linearVelocity = { x: 0, y: 0 };
  2509. this.hideSelf();
  2510. xGame.common.gameUI.ui.whiteAni.visible = true;
  2511. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2512. xGame.common.gameUI.ui.whiteAni.visible = false;
  2513. }));
  2514. }
  2515. else {
  2516. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2517. xGame.common.d2World.removeOneBall(this);
  2518. this.destroySelf();
  2519. xGame.common.playHappySound(this.number);
  2520. this.runFlyEft();
  2521. }
  2522. }
  2523. runFlyEft() {
  2524. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2525. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2526. }
  2527. }
  2528. hideSelf() {
  2529. if (this.d3Ball)
  2530. this.d3Ball.active = false;
  2531. }
  2532. showSelf() {
  2533. this.isInHole = false;
  2534. if (this.d3Ball && !this.d3Ball.active)
  2535. this.d3Ball.active = true;
  2536. }
  2537. isStill() {
  2538. let speed = this.rigy.linearVelocity;
  2539. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2540. this.rigy.linearVelocity = { x: 0, y: 0 };
  2541. return true;
  2542. }
  2543. return false;
  2544. }
  2545. reset() {
  2546. }
  2547. destroySelf() {
  2548. this.d3BallSrc.destroySelf();
  2549. if (!this.ui.isDisposed) {
  2550. this.ui.removeFromParent();
  2551. this.ui.dispose();
  2552. this.ui = null;
  2553. }
  2554. this.outColli = null;
  2555. this.innerColli = null;
  2556. this.rigy = null;
  2557. this.d3Ball = null;
  2558. this.d3BallSrc = null;
  2559. this.angleV2 = null;
  2560. this.gameObj.destroy(true);
  2561. this.destroy();
  2562. }
  2563. judgeBorder() {
  2564. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2565. return;
  2566. }
  2567. if (this.destroyed)
  2568. return;
  2569. if (xGame.common.gameMode == GameMode.classic)
  2570. return;
  2571. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2572. if (isOver) {
  2573. this.checkWrongBall();
  2574. }
  2575. }
  2576. onClick(e, force = false) {
  2577. if (this.number == 0)
  2578. return;
  2579. if (force) {
  2580. }
  2581. else {
  2582. if (xGame.common.d2World.openCheckStill)
  2583. return;
  2584. if (!xGame.common.gameMgr.selfTurn) {
  2585. return;
  2586. }
  2587. }
  2588. if (!xGame.common.gameMgr.finishOneShoot)
  2589. return;
  2590. let root = xGame.common.d2World.rootBall.gameObj;
  2591. let x = this.gameObj.x - root.x;
  2592. let y = this.gameObj.y - root.y;
  2593. let angle = xGame.common.getfguiRotation(x, y);
  2594. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2595. xGame.common.d2World.getHelpLine();
  2596. xGame.common.clickedBall = true;
  2597. this.checkGuide();
  2598. }
  2599. checkGuide() {
  2600. let guide = DataMgr.getSkillGuide();
  2601. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2602. xGame.common.guideStep++;
  2603. xGame.common.gameUI.ui.guide1.visible = false;
  2604. xGame.common.gameUI.ui.guide2.visible = true;
  2605. }
  2606. }
  2607. checkDistance(disX, disY, angle) {
  2608. let diameter = this.gameObj.width - 1;
  2609. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2610. if (!this.lastDis)
  2611. this.lastDis = dis;
  2612. else {
  2613. if (dis > this.lastDis) {
  2614. this.helpOut.type = "remove";
  2615. return this.helpOut;
  2616. }
  2617. }
  2618. if (dis <= Math.pow(diameter, 2)) {
  2619. let del = 0.01;
  2620. let offest = 0;
  2621. let realX = disX - this.gameObj.x;
  2622. let realY = disY - this.gameObj.y;
  2623. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2624. offest += del;
  2625. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2626. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2627. }
  2628. this.helpOut.type = "ok";
  2629. this.helpOut.x = realX + this.gameObj.x;
  2630. this.helpOut.y = realY + this.gameObj.y;
  2631. return this.helpOut;
  2632. }
  2633. else {
  2634. this.helpOut.type = "no";
  2635. return this.helpOut;
  2636. }
  2637. }
  2638. clearBallEft() {
  2639. this.clearBallRightEft();
  2640. this.clearBallWrongEft();
  2641. }
  2642. clearBallRightEft() {
  2643. this.ui.breathAni.stop();
  2644. this.ui.rightTips.visible = false;
  2645. }
  2646. clearBallWrongEft() {
  2647. this.ui.wrongTips.visible = false;
  2648. }
  2649. showWrongEft() {
  2650. if (!xGame.common.gameMgr.selfTurn)
  2651. return;
  2652. this.ui.wrongTips.visible = true;
  2653. }
  2654. showRightEft() {
  2655. if (!xGame.common.gameMgr.selfTurn)
  2656. return;
  2657. this.ui.rightTips.visible = true;
  2658. this.ui.rightTips.scaleX = 1;
  2659. this.ui.rightTips.scaleY = 1;
  2660. this.ui.breathAni.play();
  2661. }
  2662. setBallFunc(type, owner) {
  2663. if (type == "ice") {
  2664. this.ballFunc = type;
  2665. this.d3BallSrc.setAlbedoTexture(true);
  2666. this.rigy.type = "static";
  2667. this.iceOwner = owner;
  2668. }
  2669. else {
  2670. if (owner == this.iceOwner) {
  2671. this.ballFunc = type;
  2672. this.d3BallSrc.setAlbedoTexture(false);
  2673. this.rigy.type = "dynamic";
  2674. }
  2675. }
  2676. }
  2677. }
  2678. D2BallSrc._unid = 0;
  2679. class D2RootBallSrc extends D2BallSrc {
  2680. constructor() {
  2681. super();
  2682. this.maxSpeed = 0;
  2683. this.classicMaxSpeed = 2.2;
  2684. this.bigSkillMaxSpeed = 4;
  2685. this.angle = 0;
  2686. this.allPercent = 0;
  2687. this.linearPercent = 0;
  2688. this.anglePercent = 0;
  2689. this.maxAngleRate = 0.6;
  2690. this.baseRot = 7;
  2691. this.angleMax = 0;
  2692. this.speed = new Laya.Vector2();
  2693. this.rotSpeed = new Laya.Vector2();
  2694. }
  2695. isStill() {
  2696. let speed = this.rigy.linearVelocity;
  2697. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2698. if (this.anglePercent <= 0.1) {
  2699. this.rigy.linearVelocity = { x: 0, y: 0 };
  2700. return true;
  2701. }
  2702. }
  2703. return false;
  2704. }
  2705. reset() {
  2706. this.linearPercent = 0;
  2707. this.anglePercent = 0;
  2708. }
  2709. setSpeed(percent, angle) {
  2710. this.allPercent = percent;
  2711. this.angle = angle;
  2712. this.setAngleSpeed();
  2713. this.setLinearSpeed();
  2714. let hit = "hit";
  2715. if (percent < 25)
  2716. hit = "hit03";
  2717. else if (percent < 50)
  2718. hit = "hit02";
  2719. else if (percent < 75)
  2720. hit = "hit01";
  2721. xGame.soundMgr.playSound(hit);
  2722. }
  2723. setAngleSpeed() {
  2724. let offest = xGame.common.rodOffest;
  2725. let radius = 82;
  2726. let rate = Math.abs(offest.y / radius) * 0.5;
  2727. if (offest.y > 0)
  2728. this.angleMax = -this.baseRot * 2;
  2729. else
  2730. this.angleMax = this.baseRot;
  2731. this.rotY = -offest.x / radius * 100;
  2732. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2733. this.linearPercent = this.allPercent - this.anglePercent;
  2734. }
  2735. setLinearSpeed() {
  2736. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2737. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2738. if (!xGame.common.longHelpLine) {
  2739. let offset = -150 + xGame.common.randomNum(0, 300);
  2740. offset /= 100;
  2741. this.angle += offset;
  2742. }
  2743. }
  2744. }
  2745. let sin = Math.sin(this.angle * Math.PI / 180);
  2746. let cos = Math.cos(this.angle * Math.PI / 180);
  2747. switch (xGame.common.gameMode) {
  2748. case GameMode.classic:
  2749. this.maxSpeed = this.classicMaxSpeed;
  2750. break;
  2751. case GameMode.bigMove:
  2752. this.maxSpeed = this.bigSkillMaxSpeed;
  2753. break;
  2754. case GameMode.placeBall:
  2755. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2756. if (data.type == 1) {
  2757. this.maxSpeed = this.bigSkillMaxSpeed;
  2758. }
  2759. else {
  2760. this.maxSpeed = this.classicMaxSpeed;
  2761. }
  2762. break;
  2763. default:
  2764. break;
  2765. }
  2766. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2767. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2768. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2769. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2770. this.rigy.applyLinearImpulseToCenter(this.speed);
  2771. }
  2772. onUpdate() {
  2773. if (this.anglePercent > 0.1) {
  2774. this.anglePercent *= 0.97;
  2775. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2776. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2777. this.rigy.applyForceToCenter(this.rotSpeed);
  2778. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2779. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2780. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2781. if (num > 0.9)
  2782. this.canRot = true;
  2783. }
  2784. else
  2785. this.canRot = true;
  2786. if (Math.abs(this.rotY) > 0.1)
  2787. this.rotY *= 0.98;
  2788. super.onUpdate();
  2789. }
  2790. destroySelf() {
  2791. super.destroySelf();
  2792. this.speed = null;
  2793. }
  2794. }
  2795. class D2Ball extends Laya.Sprite {
  2796. constructor(isRootBall = false) {
  2797. super();
  2798. this.ui = ui_D2Ball.createInstance();
  2799. this.pivotX = this.ui.width / 2;
  2800. this.pivotY = this.ui.width / 2;
  2801. this.x = 0;
  2802. this.y = 0;
  2803. this.addChild(this.ui.displayObject);
  2804. this.ui.displayObject.x += this.ui.width / 2;
  2805. this.ui.displayObject.y += this.ui.width / 2;
  2806. if (isRootBall) {
  2807. this.d2Src = this.addComponent(D2RootBallSrc);
  2808. }
  2809. else {
  2810. this.d2Src = this.addComponent(D2BallSrc);
  2811. }
  2812. this.d2Src.ui = this.ui;
  2813. this.addCircleCollider();
  2814. this.addInnerCircleCollider();
  2815. this.addRigyBody();
  2816. }
  2817. addCircleCollider() {
  2818. let colli = xGame.common.getCollider("circle");
  2819. colli.radius = this.ui.width / 2;
  2820. this.addComponentIntance(colli);
  2821. this.d2Src.outColli = colli;
  2822. colli.label = "ball";
  2823. }
  2824. addInnerCircleCollider() {
  2825. let colli = xGame.common.getCollider("circle");
  2826. colli.radius = this.ui.inner.width / 2;
  2827. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2828. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2829. this.addComponentIntance(colli);
  2830. this.d2Src.innerColli = colli;
  2831. colli.label = "inner";
  2832. }
  2833. addRigyBody() {
  2834. let rigy = xGame.common.getRigbody();
  2835. rigy.type = "dynamic";
  2836. this.addComponentIntance(rigy);
  2837. this.d2Src.rigy = rigy;
  2838. }
  2839. disposeSelf() {
  2840. if (!this.ui.isDisposed) {
  2841. this.ui.dispose();
  2842. this.ui.removeFromParent();
  2843. this.ui = null;
  2844. }
  2845. }
  2846. }
  2847. class ui_D2Gan extends fgui.GComponent {
  2848. static createInstance() {
  2849. return (fgui.UIPackage.createObject("game", "D2Gan"));
  2850. }
  2851. onConstruct() {
  2852. this.myIcon = (this.getChild("myIcon"));
  2853. this.selfRodIcon = (this.getChild("selfRodIcon"));
  2854. this.selfEftRoot = (this.getChild("selfEftRoot"));
  2855. this.self = (this.getChild("self"));
  2856. this.aiRodIcon = (this.getChild("aiRodIcon"));
  2857. this.aiEftRoot = (this.getChild("aiEftRoot"));
  2858. this.ai = (this.getChild("ai"));
  2859. }
  2860. }
  2861. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  2862. class D2Gan {
  2863. constructor() {
  2864. this.offset = 0.15;
  2865. this.cell = 1.5;
  2866. this.onBallCell = 0.4;
  2867. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  2868. this.moveNum = 70;
  2869. this.rulerRate = 0.1;
  2870. this.ui = ui_D2Gan.createInstance();
  2871. this.changeSelfRod();
  2872. this.changeAIRod();
  2873. }
  2874. changeSelfRod() {
  2875. let index = DataMgr.getCurBallRod();
  2876. let data = cfgTable.ballrodData[index + 1];
  2877. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2878. this.selfMySpine && this.selfMySpine.dispose();
  2879. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2880. if (data.spine) {
  2881. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2882. this.selfMySpine = new SpineMgr(data.spine, () => {
  2883. let xx = this.ui.selfEftRoot.width / 2;
  2884. let yy = this.ui.selfEftRoot.height / 2;
  2885. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2886. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  2887. outSpine.rotation = -90;
  2888. });
  2889. }
  2890. }
  2891. changeAIRod() {
  2892. let length = Object.keys(cfgTable.ballrodData).length;
  2893. let rand = Math.floor(length * Math.random()) + 1;
  2894. let data = cfgTable.ballrodData[rand];
  2895. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2896. this.aiMySpine && this.aiMySpine.dispose();
  2897. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2898. if (data.spine) {
  2899. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2900. this.aiMySpine = new SpineMgr(data.spine, () => {
  2901. let xx = this.ui.aiEftRoot.width / 2;
  2902. let yy = this.ui.aiEftRoot.height / 2;
  2903. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2904. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  2905. outSpine.rotation = -90;
  2906. });
  2907. }
  2908. }
  2909. setGanLastInfo() {
  2910. this.lastInfo.rotation = this.ui.rotation;
  2911. this.lastInfo.x = this.ui.x;
  2912. this.lastInfo.y = this.ui.y;
  2913. }
  2914. rotateSelf(flag, isRuler = false) {
  2915. let angle;
  2916. flag = flag * this.offset;
  2917. if (xGame.common.d2World.isHelpLineOnBall) {
  2918. angle = flag * this.onBallCell;
  2919. }
  2920. else {
  2921. angle = flag * this.cell;
  2922. }
  2923. if (isRuler) {
  2924. angle *= this.rulerRate;
  2925. }
  2926. this.ui.rotation += angle;
  2927. xGame.common.d2World.getHelpLine();
  2928. }
  2929. checkDistance() {
  2930. let target = xGame.common.d2World.targetBall;
  2931. let root = xGame.common.d2World.rootBall;
  2932. if (target == null) {
  2933. return 1;
  2934. }
  2935. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  2936. if (dis <= 2500) {
  2937. return 5;
  2938. }
  2939. return 1;
  2940. }
  2941. rotDest(rot) {
  2942. this.ui.rotation = rot;
  2943. xGame.common.d2World.getHelpLine();
  2944. }
  2945. storagePower(powerNum) {
  2946. let pos = (powerNum / 100) * this.moveNum;
  2947. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  2948. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  2949. this.ui.x = this.lastInfo.x + xx;
  2950. this.ui.y = this.lastInfo.y + yy;
  2951. }
  2952. shoot() {
  2953. this.storagePower(0);
  2954. this.ui.visible = false;
  2955. }
  2956. destroySelf() {
  2957. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2958. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2959. this.selfMySpine && this.selfMySpine.dispose();
  2960. this.aiMySpine && this.aiMySpine.dispose();
  2961. this.lastInfo = null;
  2962. if (!this.ui.isDisposed) {
  2963. this.ui.removeFromParent();
  2964. this.ui.dispose();
  2965. }
  2966. }
  2967. }
  2968. class ui_HelpLine extends fgui.GComponent {
  2969. static createInstance() {
  2970. return (fgui.UIPackage.createObject("game", "HelpLine"));
  2971. }
  2972. onConstruct() {
  2973. this.n10 = (this.getChild("n10"));
  2974. this.rect = (this.getChild("rect"));
  2975. this.dir11 = (this.getChild("dir11"));
  2976. this.dir = (this.getChild("dir"));
  2977. this.rootDir = (this.getChild("rootDir"));
  2978. this.dirDot = (this.getChild("dirDot"));
  2979. }
  2980. }
  2981. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  2982. class D2HelpLine {
  2983. constructor() {
  2984. this.starX = 0;
  2985. this.starY = 0;
  2986. this.ui = ui_HelpLine.createInstance();
  2987. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  2988. this.starX = this.ui.rect.x;
  2989. this.starY = this.ui.rect.y;
  2990. }
  2991. shoot() {
  2992. this.ui.visible = false;
  2993. }
  2994. destroySelf() {
  2995. if (this.ui.isDisposed) {
  2996. this.ui.removeFromParent();
  2997. this.ui.dispose();
  2998. }
  2999. }
  3000. }
  3001. class D2World extends Laya.Script {
  3002. constructor() {
  3003. super();
  3004. this.ballArr = [];
  3005. this.openCheckStill = false;
  3006. this.checkArr = [];
  3007. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3008. this.isHelpLineOnBall = false;
  3009. this.isOnSameLine = false;
  3010. this.reflectAngle = 0;
  3011. this.powerPercent = 0;
  3012. this.inHolesSpeed = [];
  3013. this.outDir = new Laya.Vector2();
  3014. this.rootDir = new Laya.Vector2();
  3015. this.aiLv = 0;
  3016. this.rootPos = new Laya.Vector2();
  3017. this.tempDir1 = new Laya.Vector2();
  3018. this.tempDir2 = new Laya.Vector2();
  3019. this.tempDir3 = new Laya.Vector2();
  3020. this.ballSize = 33;
  3021. this.destRot = 0;
  3022. }
  3023. initSelf() {
  3024. this.createBalls();
  3025. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3026. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3027. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3028. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3029. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3030. }
  3031. setBorderRect() {
  3032. let ui = xGame.common.gameUI.ui;
  3033. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3034. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3035. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3036. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3037. this.borderRect.x = starX;
  3038. this.borderRect.y = starY;
  3039. this.borderRect.width = width;
  3040. this.borderRect.height = height;
  3041. }
  3042. resetGame() {
  3043. this.openCheckStill = false;
  3044. let temp;
  3045. for (let index = 0; index < this.ballArr.length; index++) {
  3046. temp = this.ballArr[index];
  3047. temp.destroySelf();
  3048. }
  3049. xGame.common.d3World.ballRoot.destroyChildren();
  3050. xGame.common.gameUI.ui.ballNode.removeChildren();
  3051. console.log("进入摧毁逻辑");
  3052. this.d2Gan.destroySelf();
  3053. this.d2HelpLine.destroySelf();
  3054. this.ballArr = [];
  3055. }
  3056. setD2Gan() {
  3057. let ballNode = this.rootBall.ui;
  3058. let d2Gan = new D2Gan();
  3059. this.d2Gan = d2Gan;
  3060. let ganNode = d2Gan.ui;
  3061. ballNode.addChild(ganNode);
  3062. ganNode.pivotX = ganNode.pivotX;
  3063. ganNode.pivotY = ganNode.pivotY;
  3064. ganNode.x = ganNode.myIcon.width / 2;
  3065. ganNode.y = this.rootBall.gameObj.width;
  3066. d2Gan.setGanLastInfo();
  3067. }
  3068. setHelpLine() {
  3069. let d2Help = new D2HelpLine();
  3070. this.d2HelpLine = d2Help;
  3071. }
  3072. createBalls() {
  3073. let cfg;
  3074. switch (xGame.common.gameMode) {
  3075. case GameMode.classic:
  3076. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3077. break;
  3078. case GameMode.bigMove:
  3079. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3080. break;
  3081. case GameMode.placeBall:
  3082. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3083. break;
  3084. default:
  3085. break;
  3086. }
  3087. cfg = JSON.parse(JSON.stringify(cfg));
  3088. for (const key in cfg) {
  3089. if (cfg[key].value == 0) {
  3090. this.createRootBall(cfg[key]);
  3091. delete cfg[key];
  3092. break;
  3093. }
  3094. }
  3095. this.createOtherBalls(cfg);
  3096. }
  3097. createRootBall(data) {
  3098. let root = new D2Ball(true);
  3099. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3100. this.rootBall = root.d2Src;
  3101. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3102. let d3BallSrc = d3Ball.getComponent(Ball);
  3103. xGame.common.d3World.rootBall = d3Ball;
  3104. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3105. let xx = data.x;
  3106. let yy = data.y;
  3107. let numer = data.value;
  3108. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3109. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3110. this.ballArr.push(this.rootBall);
  3111. this.setD2Gan();
  3112. this.setHelpLine();
  3113. }
  3114. createOtherBalls(cfg) {
  3115. let temp;
  3116. let src;
  3117. let data;
  3118. for (const key in cfg) {
  3119. data = cfg[key];
  3120. temp = new D2Ball();
  3121. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3122. src = temp.d2Src;
  3123. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3124. src.initSelf(data.value, data.x, data.y, d3Ball);
  3125. this.ballArr.push(src);
  3126. }
  3127. }
  3128. shoot(percent) {
  3129. this.powerPercent = percent;
  3130. this.openCheckStill = true;
  3131. let d2Angle = this.d2Gan.ui.rotation;
  3132. this.rootBall.setSpeed(percent, d2Angle);
  3133. this.clearBallAllEft();
  3134. this.changePlayerView();
  3135. }
  3136. onUpdate() {
  3137. if (!this.openCheckStill)
  3138. return;
  3139. this.checkStill();
  3140. }
  3141. checkStill() {
  3142. for (let index = 0; index < this.ballArr.length; index++) {
  3143. if (!this.ballArr[index].isStill()) {
  3144. return;
  3145. }
  3146. }
  3147. xGame.eventMgr.event(ALL_BALL_STOP);
  3148. }
  3149. allBallStop() {
  3150. this.openCheckStill = false;
  3151. xGame.common.recoverCameraView();
  3152. }
  3153. waitShoot() {
  3154. if (!this.d2Gan.ui.isDisposed) {
  3155. this.d2Gan.ui.visible = true;
  3156. }
  3157. if (!this.d2HelpLine.ui.isDisposed) {
  3158. this.d2HelpLine.ui.visible = true;
  3159. }
  3160. this.clearBallAllEft();
  3161. this.showBallRightEft();
  3162. this.getHelpLine();
  3163. this.inHolesSpeed = [];
  3164. this.selectOneBall();
  3165. }
  3166. _getAllBallArr() {
  3167. let arr = this.ballArr;
  3168. let outArr = [];
  3169. for (let index = 0; index < arr.length; index++) {
  3170. if (arr[index] instanceof D2RootBallSrc)
  3171. continue;
  3172. if (arr[index].ballFunc == "ice")
  3173. continue;
  3174. if (arr[index].destroyed)
  3175. continue;
  3176. outArr.push(arr[index]);
  3177. }
  3178. return outArr;
  3179. }
  3180. _getBlackObj() {
  3181. let arr = this.ballArr;
  3182. for (let index = 0; index < arr.length; index++) {
  3183. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3184. return arr[index];
  3185. }
  3186. }
  3187. }
  3188. selectOneBall() {
  3189. let all = this._getAllBallArr();
  3190. let target;
  3191. switch (xGame.common.gameMode) {
  3192. case GameMode.classic:
  3193. if (xGame.common.gameMgr.selfTurn) {
  3194. let self = xGame.common.gameMgr.selfBallArr;
  3195. let black = this._getBlackObj();
  3196. if (xGame.common.gameMgr.ensureBallType) {
  3197. if (self.length > 0) {
  3198. let out = [];
  3199. for (let j = 0; j < all.length; j++) {
  3200. if (self.indexOf(all[j].number) > -1) {
  3201. out.push(all[j]);
  3202. }
  3203. }
  3204. target = this.selectBestEnterOne(out);
  3205. }
  3206. else {
  3207. target = this.selectBestEnterOne([black]);
  3208. }
  3209. }
  3210. else {
  3211. target = this.selectBestEnterOne(all);
  3212. }
  3213. }
  3214. else {
  3215. target = this.selectBestEnterOne(all);
  3216. }
  3217. break;
  3218. case GameMode.bigMove:
  3219. target = this.selectBestEnterOne(all);
  3220. break;
  3221. case GameMode.placeBall:
  3222. if (all.length > 0) {
  3223. target = this.selectBestEnterOne(all);
  3224. }
  3225. break;
  3226. default:
  3227. break;
  3228. }
  3229. if (target && !target.destroyed && target.onClick) {
  3230. target.onClick(0, true);
  3231. let num = -200 + xGame.common.randomNum(0, 400);
  3232. num /= 150;
  3233. if (xGame.common.longHelpLine) {
  3234. num = 0;
  3235. }
  3236. this.destRot += num;
  3237. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3238. }
  3239. }
  3240. removeOneBall(ball) {
  3241. for (let index = 0; index < this.ballArr.length; index++) {
  3242. if (this.ballArr[index].id == ball.id) {
  3243. this.ballArr.splice(index, 1);
  3244. break;
  3245. }
  3246. }
  3247. }
  3248. getHelpLine() {
  3249. this.d2HelpLine.ui.dirDot.visible = false;
  3250. this.isOnSameLine = false;
  3251. let startX = this.rootBall.gameObj.x;
  3252. let startY = this.rootBall.gameObj.y;
  3253. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3254. if (dis == null) {
  3255. this.d2HelpLine.ui.visible = false;
  3256. console.error("辅助线异常");
  3257. return;
  3258. }
  3259. this.d2HelpLine.ui.visible = true;
  3260. let angle = this.d2Gan.ui.rotation;
  3261. let radius = 16.5;
  3262. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3263. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3264. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3265. if (colliObj == null) {
  3266. this.getColliPos(disX, disY, radius, angle);
  3267. xGame.common.d2World.isHelpLineOnBall = false;
  3268. this.targetBall = null;
  3269. this.reflectAngle = 0;
  3270. this.showBallWrongEft();
  3271. }
  3272. else {
  3273. let target = colliObj.src;
  3274. let radius = 16.5;
  3275. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3276. dis1 = Math.sqrt(dis1);
  3277. let realDis = colliObj.disHon - dis1;
  3278. let dir = colliObj.dir;
  3279. let xx = startX + dir.x * realDis;
  3280. let yy = startY + dir.y * realDis;
  3281. this.getColliPos(xx, yy, radius, angle);
  3282. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3283. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3284. let offset = xGame.common.rodOffest;
  3285. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3286. this.isOnSameLine = true;
  3287. }
  3288. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3289. xGame.common.d2World.isHelpLineOnBall = true;
  3290. this.targetBall = target;
  3291. this.reflectAngle = reflectAngle;
  3292. this.showBallWrongEft();
  3293. if (xGame.common.longHelpLine) {
  3294. this.delayReflectLine(target, reflectAngle);
  3295. }
  3296. }
  3297. }
  3298. getBorderDot(startX, startY, angle) {
  3299. let radius = 17;
  3300. let distance;
  3301. let isDone;
  3302. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3303. isDone = this.judgeUpDown(distance, angle, startX);
  3304. if (isDone != null) {
  3305. return isDone;
  3306. }
  3307. distance = -(this.borderRect.y + this.borderRect.height - 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.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3313. isDone = this.judgeLeftRight(distance, angle, startY);
  3314. if (isDone != null) {
  3315. return isDone;
  3316. }
  3317. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3318. isDone = this.judgeLeftRight(distance, angle, startY);
  3319. if (isDone != null) {
  3320. return isDone;
  3321. }
  3322. }
  3323. judgeUpDown(distance, angle, startX) {
  3324. let flag = Math.sin(angle * Math.PI / 180);
  3325. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3326. if (distance >= 0) {
  3327. if (flag > 0) {
  3328. if (temp < this.borderRect.x + this.borderRect.width) {
  3329. return distance;
  3330. }
  3331. }
  3332. else {
  3333. if (temp > this.borderRect.x) {
  3334. return distance;
  3335. }
  3336. }
  3337. }
  3338. }
  3339. judgeLeftRight(distance, angle, starY) {
  3340. let flag = -Math.cos(angle * Math.PI / 180);
  3341. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3342. if (distance >= 0) {
  3343. if (flag > 0) {
  3344. if (temp < this.borderRect.y + this.borderRect.height) {
  3345. return distance;
  3346. }
  3347. }
  3348. else {
  3349. if (temp > this.borderRect.y) {
  3350. return distance;
  3351. }
  3352. }
  3353. }
  3354. }
  3355. clearBallAllEft() {
  3356. let temp;
  3357. for (let index = 0; index < this.ballArr.length; index++) {
  3358. temp = this.ballArr[index];
  3359. temp.clearBallEft();
  3360. }
  3361. }
  3362. showBallRightEft() {
  3363. let gameMgr = xGame.common.gameMgr;
  3364. let temp;
  3365. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3366. if (targetArr.length <= 0)
  3367. return;
  3368. for (let index = 0; index < this.ballArr.length; index++) {
  3369. temp = this.ballArr[index];
  3370. if (targetArr.indexOf(temp.number) > -1) {
  3371. temp.showRightEft();
  3372. }
  3373. }
  3374. }
  3375. showBallWrongEft() {
  3376. let gameMgr = xGame.common.gameMgr;
  3377. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3378. if (targetArr.length <= 0)
  3379. return;
  3380. let temp;
  3381. for (let index = 0; index < this.ballArr.length; index++) {
  3382. temp = this.ballArr[index];
  3383. if (this.targetBall && this.targetBall.number == temp.number) {
  3384. if (targetArr.indexOf(temp.number) <= -1) {
  3385. temp.showWrongEft();
  3386. }
  3387. else {
  3388. temp.clearBallWrongEft();
  3389. }
  3390. }
  3391. else {
  3392. temp.clearBallWrongEft();
  3393. }
  3394. }
  3395. }
  3396. getColliPos(x, y, radius, angle) {
  3397. this.d2HelpLine.ui.x = x;
  3398. this.d2HelpLine.ui.y = y;
  3399. let dirX = x - this.rootBall.gameObj.x;
  3400. let dirY = y - this.rootBall.gameObj.y;
  3401. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3402. if (rectH <= 0)
  3403. rectH = 0;
  3404. this.d2HelpLine.ui.rect.height = 0;
  3405. this.d2HelpLine.ui.rect.height = rectH;
  3406. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3407. if (rectH < this.rootBall.gameObj.width) {
  3408. this.d2HelpLine.ui.rect.visible = false;
  3409. }
  3410. else {
  3411. this.d2HelpLine.ui.rect.visible = true;
  3412. }
  3413. this.d2HelpLine.ui.dir.visible = false;
  3414. this.d2HelpLine.ui.rootDir.visible = false;
  3415. }
  3416. getReflectLine(x, y, radius, target) {
  3417. this.d2HelpLine.ui.dir.visible = true;
  3418. let dirX = target.x - x;
  3419. let dirY = target.y - y;
  3420. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3421. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3422. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3423. this.d2HelpLine.ui.dir.height = 48;
  3424. this.d2HelpLine.ui.dir.rotation = angle;
  3425. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3426. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3427. return angle;
  3428. }
  3429. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3430. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3431. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3432. let targetX = target.gameObj.x;
  3433. let targetY = target.gameObj.y;
  3434. this.outDir.setValue(targetX - xx, targetY - yy);
  3435. this.rootDir.setValue(rtX - xx, rtY - yy);
  3436. let ver = Math.PI / 2;
  3437. let sin = Math.sin(ver);
  3438. let cos = Math.cos(ver);
  3439. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3440. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3441. this.outDir.setValue(outX, outY);
  3442. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3443. Laya.Vector2.normalize(this.outDir, this.outDir);
  3444. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3445. if (Math.abs(result) <= 0.08) {
  3446. this.d2HelpLine.ui.rootDir.visible = false;
  3447. return;
  3448. }
  3449. if (result > 0) {
  3450. angle += 90;
  3451. }
  3452. else if (result < 0) {
  3453. angle -= 90;
  3454. }
  3455. this.d2HelpLine.ui.rootDir.visible = true;
  3456. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3457. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3458. this.d2HelpLine.ui.rootDir.rotation = angle;
  3459. }
  3460. delayReflectLine(obj, angle) {
  3461. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3462. return;
  3463. }
  3464. this.isOnSameLine = false;
  3465. let startX = obj.gameObj.x;
  3466. let startY = obj.gameObj.y;
  3467. let dis = this.getBorderDot(startX, startY, angle);
  3468. if (dis == null) {
  3469. this.d2HelpLine.ui.dirDot.visible = false;
  3470. return;
  3471. }
  3472. this.d2HelpLine.ui.visible = true;
  3473. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3474. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3475. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3476. if (colliObj == null) {
  3477. this.setDelayLine(disX, disY, obj, angle);
  3478. }
  3479. else {
  3480. let radius = 16;
  3481. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3482. dis1 = Math.sqrt(dis1);
  3483. let realDis = colliObj.disHon - dis1;
  3484. let dir = colliObj.dir;
  3485. let xx = startX + dir.x * realDis;
  3486. let yy = startY + dir.y * realDis;
  3487. this.setDelayLine(xx, yy, obj, angle);
  3488. }
  3489. }
  3490. setDelayLine(x, y, obj, angle) {
  3491. let dirX = x - obj.gameObj.x;
  3492. let dirY = y - obj.gameObj.y;
  3493. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3494. if (rectH <= 0)
  3495. rectH = 0;
  3496. this.d2HelpLine.ui.dir.height = rectH;
  3497. this.d2HelpLine.ui.dirDot.visible = true;
  3498. this.d2HelpLine.ui.dirDot.x = 17;
  3499. this.d2HelpLine.ui.dirDot.y = 17;
  3500. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3501. ;
  3502. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3503. }
  3504. changePlayerView() {
  3505. if (Math.random() >= 0.7)
  3506. return;
  3507. if (!this.targetBall) {
  3508. return;
  3509. }
  3510. if (!xGame.common.gameMgr.selfTurn)
  3511. return;
  3512. switch (xGame.common.gameMode) {
  3513. case GameMode.classic:
  3514. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3515. if (this.targetBall.number != 8) {
  3516. return;
  3517. }
  3518. }
  3519. break;
  3520. case GameMode.bigMove:
  3521. return;
  3522. case GameMode.placeBall:
  3523. break;
  3524. default:
  3525. break;
  3526. }
  3527. let startX = this.targetBall.gameObj.x;
  3528. let startY = this.targetBall.gameObj.y;
  3529. let angle = this.reflectAngle;
  3530. let dis = this.getBorderDot(startX, startY, angle);
  3531. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3532. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3533. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3534. if (colliObj) {
  3535. return;
  3536. }
  3537. let offset = 40;
  3538. let posObj = xGame.common.gameMgr.posObj;
  3539. let temp;
  3540. let radius;
  3541. let tarX, tarY;
  3542. for (const key in posObj) {
  3543. temp = posObj[key];
  3544. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3545. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3546. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3547. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3548. xGame.common.showOneCamera("angle" + key);
  3549. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3550. Laya.physicsTimer.scale = 0.7;
  3551. break;
  3552. }
  3553. }
  3554. }
  3555. selectBestEnterOne(arr) {
  3556. this.aiLv = xGame.tools.random(1, 11);
  3557. this.aiLv = 10;
  3558. this.wBall = xGame.common.d2World.rootBall;
  3559. this.rootPos.x = this.wBall.gameObj.x;
  3560. this.rootPos.y = this.wBall.gameObj.y;
  3561. this.initHoleBall(arr);
  3562. return this.selectBall();
  3563. }
  3564. selectBall() {
  3565. let ball = null;
  3566. this.destRot = 0;
  3567. let ai = 110 - this.aiLv * 10;
  3568. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3569. let score = false;
  3570. if (this.scoreBall.length < 1) {
  3571. if (this.lineBall.length < 1) {
  3572. for (let i = 0; i < this.kickBall.length; i++) {
  3573. let list = [];
  3574. let bo = this.kickBall[i];
  3575. let bobj = bo.gameObj;
  3576. let rect = xGame.common.d2World.borderRect;
  3577. let mobj = this.wBall.gameObj;
  3578. let minb = bobj.y - rect.y - 20;
  3579. let minw = mobj.y - rect.y - 50;
  3580. if (minb > 0 && minw > 0) {
  3581. let dlenx = 0;
  3582. let dleny = mobj.y - rect.y;
  3583. let spx = mobj.x;
  3584. let spy = rect.y - dleny;
  3585. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3586. }
  3587. minb = rect.y + rect.height - bobj.y - 20;
  3588. minw = rect.y + rect.height - mobj.y - 50;
  3589. if (minb > 0 && minw > 0) {
  3590. let dlenx = 0;
  3591. let dleny = rect.y + rect.height - mobj.y;
  3592. let spx = mobj.x;
  3593. let spy = rect.y + rect.height + dleny;
  3594. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3595. }
  3596. minb = bobj.x - rect.x - 20;
  3597. minw = mobj.x - rect.x - 50;
  3598. if (minb > 0 && minw > 0) {
  3599. let dlenx = mobj.x - rect.x;
  3600. let dleny = 0;
  3601. let spx = rect.x - dlenx;
  3602. let spy = mobj.y;
  3603. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3604. }
  3605. minb = rect.x + rect.width - bobj.x - 20;
  3606. minw = rect.x + rect.width - mobj.x - 50;
  3607. if (minb > 0 && minw > 0) {
  3608. let dlenx = rect.x + rect.width - mobj.x;
  3609. let dleny = 0;
  3610. let spx = rect.x + rect.width + dlenx;
  3611. let spy = mobj.y;
  3612. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3613. }
  3614. list.sort(function (a, b) {
  3615. return a.order - b.order;
  3616. });
  3617. for (let i = 0; i < list.length; i++) {
  3618. let data = list[i];
  3619. let mx = mobj.x - bobj.x;
  3620. let my = mobj.y - bobj.y;
  3621. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3622. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3623. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3624. if (num > 1)
  3625. num = 1;
  3626. let cos = Math.acos(num);
  3627. if (cos > 1.57)
  3628. cos = 1.57;
  3629. else if (cos < 0.01)
  3630. cos = 0.01;
  3631. let tan = Math.tan(cos);
  3632. let dx = tan * data.dleny;
  3633. let dy = tan * data.dlenx;
  3634. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3635. if (Math.abs(bx - 667) < 40)
  3636. continue;
  3637. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3638. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3639. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3640. this.forceMax = dis * 0.08;
  3641. this.destRot += mis * 0.1;
  3642. this.setKick(bx, by);
  3643. return true;
  3644. }
  3645. }
  3646. }
  3647. }
  3648. else {
  3649. ball = xGame.common.getRandArrEle(this.lineBall);
  3650. }
  3651. }
  3652. else {
  3653. for (let i = 0; i < this.scoreBall.length; i++) {
  3654. if (i < this.scoreBall.length - 1) {
  3655. let rand = 70 + this.aiLv * 10 + i * 10;
  3656. if (xGame.tools.random(0, 100) < rand) {
  3657. ball = this.scoreBall[i];
  3658. break;
  3659. }
  3660. }
  3661. else {
  3662. ball = this.scoreBall[i];
  3663. break;
  3664. }
  3665. }
  3666. score = true;
  3667. this.selectNum++;
  3668. }
  3669. if (!ball)
  3670. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3671. let dx = ball.gameObj.x;
  3672. let dy = ball.gameObj.y;
  3673. let kickAngle = 0;
  3674. if (score) {
  3675. dx = ball.kickPos.x;
  3676. dy = ball.kickPos.y;
  3677. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3678. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3679. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3680. if (adot > 1)
  3681. adot = 1;
  3682. kickAngle = Math.acos(adot) * 57.3;
  3683. if (kickAngle > 45) {
  3684. let kdx = ball.kickPos.x - ball.gameObj.x;
  3685. let kdy = ball.kickPos.y - ball.gameObj.y;
  3686. dx = ball.kickPos.x - kdx * mis * 0.3;
  3687. dy = ball.kickPos.y - kdy * mis * 0.3;
  3688. }
  3689. else
  3690. this.destRot += mis;
  3691. }
  3692. else if (ball.poleAngle != 0) {
  3693. this.destRot += ball.poleAngle;
  3694. }
  3695. if (xGame.common.gameMode == 0) {
  3696. let af = kickAngle * 0.08;
  3697. this.forceMax = ball.hard * 0.1 + af * af;
  3698. }
  3699. this.setKick(dx, dy);
  3700. return ball;
  3701. }
  3702. initHoleBall(arr) {
  3703. this.kickBall = [];
  3704. this.lineBall = [];
  3705. this.scoreBall = [];
  3706. this.holeBall = [];
  3707. this.selectNum = 0;
  3708. this.forceNum = 0;
  3709. this.forceMax = 0;
  3710. this.turnNum = 0;
  3711. let list = arr;
  3712. let holes = xGame.common.gameMgr.holePosList;
  3713. let self = xGame.common.aiPlayer;
  3714. for (let i = 0; i < list.length; i++) {
  3715. let obj = list[i];
  3716. if (!obj)
  3717. continue;
  3718. obj.kickPos.x = 0;
  3719. obj.kickPos.y = 0;
  3720. obj.poleAngle = 0;
  3721. obj.hard = 0;
  3722. obj.borderDis = 0;
  3723. obj.kickAngle = 180;
  3724. let b = obj.gameObj;
  3725. let wbp = this.rootPos;
  3726. let bx = wbp.x - b.x;
  3727. let by = wbp.y - b.y;
  3728. obj.borderDis = xGame.tools.random(0, 100);
  3729. this.kickBall.push(obj);
  3730. if (!this.isLine(wbp, obj))
  3731. continue;
  3732. obj.kickAngle = xGame.tools.random(90, 180);
  3733. obj.kickPos.x = b.x;
  3734. obj.kickPos.y = b.y;
  3735. this.lineBall.push(obj);
  3736. let minDis = 999999;
  3737. let hole = false;
  3738. for (let j = 0; j < holes.length; j++) {
  3739. let hp = holes[j];
  3740. if (bx >= 0 && hp.x > b.x + 100)
  3741. continue;
  3742. if (bx <= 0 && hp.x < b.x - 100)
  3743. continue;
  3744. if (by < -10 && hp.y < wbp.y)
  3745. continue;
  3746. if (by > 10 && hp.y > wbp.y)
  3747. continue;
  3748. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3749. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3750. if (dis < minDis) {
  3751. let dx = b.x - this.tempDir1.x * this.ballSize;
  3752. let dy = b.y - this.tempDir1.y * this.ballSize;
  3753. this.tempDir3.x = this.tempDir1.x;
  3754. this.tempDir3.y = this.tempDir1.y;
  3755. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3756. obj.kickPos.x = dx;
  3757. obj.kickPos.y = dy;
  3758. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3759. if (num > 1)
  3760. num = 1;
  3761. obj.kickAngle = Math.acos(num) * 57.3;
  3762. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3763. dis = dis * 2;
  3764. if (Math.abs(hp.x - 600) < 100)
  3765. dis += 50;
  3766. obj.hard = dis + obj.kickAngle * 3;
  3767. hole = true;
  3768. }
  3769. }
  3770. }
  3771. }
  3772. if (hole) {
  3773. this.scoreBall.push(obj);
  3774. this.holeBall.push(obj);
  3775. }
  3776. }
  3777. this.scoreBall.sort(function (a, b) {
  3778. return a.hard - b.hard;
  3779. });
  3780. this.holeBall.sort(function (a, b) {
  3781. return a.kickAngle - b.kickAngle;
  3782. });
  3783. this.kickBall.sort(function (a, b) {
  3784. return a.borderDis - b.borderDis;
  3785. });
  3786. }
  3787. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3788. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3789. let balls = xGame.common.d2World.ballArr;
  3790. let max = xGame.tools.getDis(hx, hy, bx, by);
  3791. for (let index = 0; index < balls.length; index++) {
  3792. let obj = balls[index];
  3793. if (obj.number == 0)
  3794. continue;
  3795. if (obj.number == bn || obj.number == dn)
  3796. continue;
  3797. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3798. if (dis * dis > max)
  3799. continue;
  3800. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3801. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3802. if (num > 1)
  3803. num = 1;
  3804. if (num < 0)
  3805. continue;
  3806. let gap = Math.sin(Math.acos(num)) * dis;
  3807. if (gap < this.ballSize)
  3808. return true;
  3809. }
  3810. return false;
  3811. }
  3812. isLine(xy, ball) {
  3813. let bx = xy.x;
  3814. let by = xy.y;
  3815. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3816. let dis = ball.getDestDis(xy);
  3817. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3818. let sin = Math.sin(angle);
  3819. let cos = Math.cos(angle);
  3820. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3821. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3822. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3823. let dx = bx + this.tempDir2.x * dis;
  3824. let dy = by + this.tempDir2.y * dis;
  3825. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3826. sin = Math.sin(-angle);
  3827. cos = Math.cos(-angle);
  3828. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3829. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3830. dx = bx + this.tempDir2.x * dis;
  3831. dy = by + this.tempDir2.y * dis;
  3832. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  3833. if (isr && isl)
  3834. return false;
  3835. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  3836. }
  3837. return true;
  3838. }
  3839. setKick(dx, dy) {
  3840. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  3841. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3842. this.tempDir1.x = 0;
  3843. this.tempDir1.y = 1;
  3844. this.tempDir2.y = -this.tempDir2.y;
  3845. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3846. if (num > 1)
  3847. num = 1;
  3848. let rot = Math.acos(num) * 57.3;
  3849. if (this.tempDir2.x < 0)
  3850. rot = 360 - rot;
  3851. this.destRot += rot;
  3852. }
  3853. }
  3854. class ui_UIGame extends fgui.GComponent {
  3855. static createInstance() {
  3856. return (fgui.UIPackage.createObject("game", "UIGame"));
  3857. }
  3858. onConstruct() {
  3859. this.c1 = this.getController("c1");
  3860. this.d3Root = (this.getChild("d3Root"));
  3861. this.clickNode = (this.getChild("clickNode"));
  3862. this.d2Root = (this.getChild("d2Root"));
  3863. this.topNode = (this.getChild("topNode"));
  3864. this.n72 = (this.getChild("n72"));
  3865. this.n40 = (this.getChild("n40"));
  3866. this.rulerNode = (this.getChild("rulerNode"));
  3867. this.rulerClickNode = (this.getChild("rulerClickNode"));
  3868. this.n50 = (this.getChild("n50"));
  3869. this.keduNode = (this.getChild("keduNode"));
  3870. this.powerTxt = (this.getChild("powerTxt"));
  3871. this.powerNode = (this.getChild("powerNode"));
  3872. this.colorNode = (this.getChild("colorNode"));
  3873. this.powerEft = (this.getChild("powerEft"));
  3874. this.myPowerNode = (this.getChild("myPowerNode"));
  3875. this.ganNode = (this.getChild("ganNode"));
  3876. this.rodMethodNode = (this.getChild("rodMethodNode"));
  3877. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  3878. this.placeNormalNode = (this.getChild("placeNormalNode"));
  3879. this.skillRod = (this.getChild("skillRod"));
  3880. this.border = (this.getChild("border"));
  3881. this.bigSkillNode = (this.getChild("bigSkillNode"));
  3882. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  3883. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  3884. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  3885. this.awardSpineNode = (this.getChild("awardSpineNode"));
  3886. this.guanyuNode = (this.getChild("guanyuNode"));
  3887. this.helpBtn = (this.getChild("helpBtn"));
  3888. this.wordsBtn = (this.getChild("wordsBtn"));
  3889. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  3890. this.returnBtn = (this.getChild("returnBtn"));
  3891. this.ballNode = (this.getChild("ballNode"));
  3892. this.whiteAni = (this.getChild("whiteAni"));
  3893. this.blackAni = (this.getChild("blackAni"));
  3894. this.selfTurn = (this.getChild("selfTurn"));
  3895. this.aiTurn = (this.getChild("aiTurn"));
  3896. this.deskNode = (this.getChild("deskNode"));
  3897. this.moveNode = (this.getChild("moveNode"));
  3898. this.selfTalk = (this.getChild("selfTalk"));
  3899. this.aiTalk = (this.getChild("aiTalk"));
  3900. this.d2Node = (this.getChild("d2Node"));
  3901. this.snowNode = (this.getChild("snowNode"));
  3902. this.guide2 = (this.getChild("guide2"));
  3903. this.guide1 = (this.getChild("guide1"));
  3904. this.guide3 = (this.getChild("guide3"));
  3905. this.guideNode = (this.getChild("guideNode"));
  3906. }
  3907. }
  3908. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  3909. class ui_UIGameEnd extends fgui.GComponent {
  3910. static createInstance() {
  3911. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  3912. }
  3913. onConstruct() {
  3914. this.c1 = this.getController("c1");
  3915. this.n22 = (this.getChild("n22"));
  3916. this.n2 = (this.getChild("n2"));
  3917. this.n52 = (this.getChild("n52"));
  3918. this.n53 = (this.getChild("n53"));
  3919. this.coinNode = (this.getChild("coinNode"));
  3920. this.closeNode = (this.getChild("closeNode"));
  3921. this.moneyNode = (this.getChild("moneyNode"));
  3922. this.secretary = (this.getChild("secretary"));
  3923. this.n27 = (this.getChild("n27"));
  3924. this.n29 = (this.getChild("n29"));
  3925. this.talkNode = (this.getChild("talkNode"));
  3926. this.n38 = (this.getChild("n38"));
  3927. this.n39 = (this.getChild("n39"));
  3928. this.n40 = (this.getChild("n40"));
  3929. this.awardNode = (this.getChild("awardNode"));
  3930. this.starNumNode = (this.getChild("starNumNode"));
  3931. this.n47 = (this.getChild("n47"));
  3932. this.conditionNode = (this.getChild("conditionNode"));
  3933. this.isGetAward = (this.getChild("isGetAward"));
  3934. this.leftBtn = (this.getChild("leftBtn"));
  3935. this.rightBtn = (this.getChild("rightBtn"));
  3936. this.btnNode = (this.getChild("btnNode"));
  3937. }
  3938. }
  3939. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  3940. class ui_UIAddCoin extends fgui.GComponent {
  3941. static createInstance() {
  3942. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  3943. }
  3944. onConstruct() {
  3945. this.n11 = (this.getChild("n11"));
  3946. this.myNode = (this.getChild("myNode"));
  3947. this.t0 = this.getTransition("t0");
  3948. }
  3949. }
  3950. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  3951. class UIAddCoin extends UIBase {
  3952. constructor() {
  3953. super();
  3954. this.coinNum = 2000;
  3955. }
  3956. onConstructor() {
  3957. this.ui = ui_UIAddCoin.createInstance();
  3958. this.contentPane = this.ui;
  3959. this.isEject = false;
  3960. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  3961. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  3962. }
  3963. show() {
  3964. super.show();
  3965. this.ui.t0.play();
  3966. }
  3967. videoAddCoin() {
  3968. Moyu.showVideoAd(() => {
  3969. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  3970. this.hide();
  3971. }, EAdType.addFailCoin);
  3972. }
  3973. }
  3974. UIAddCoin.uiName = "UIAddCoin";
  3975. class ui_UIInvitation extends fgui.GComponent {
  3976. static createInstance() {
  3977. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  3978. }
  3979. onConstruct() {
  3980. this.n14 = (this.getChild("n14"));
  3981. this.myNode = (this.getChild("myNode"));
  3982. this.t0 = this.getTransition("t0");
  3983. }
  3984. }
  3985. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  3986. class UIInvitation extends UIBase {
  3987. constructor() {
  3988. super();
  3989. }
  3990. onConstructor() {
  3991. this.ui = ui_UIInvitation.createInstance();
  3992. this.contentPane = this.ui;
  3993. this.isEject = false;
  3994. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  3995. }
  3996. show() {
  3997. super.show();
  3998. }
  3999. enterGame() {
  4000. xGame.common.gameMode = GameMode.classic;
  4001. DataMgr.setChallengeTimes(1);
  4002. xGame.common.passAwardCoin = 2000;
  4003. let need = xGame.common.classicNiceNeddCoin;
  4004. if (DataMgr.coinEnough(need)) {
  4005. DataMgr.setCoin(-need);
  4006. xGame.eventMgr.event(RESTART_GAME, true);
  4007. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4008. }
  4009. else {
  4010. xGame.eventMgr.event(RESTART_GAME, true);
  4011. }
  4012. this.hide();
  4013. }
  4014. hide() {
  4015. super.hide();
  4016. }
  4017. }
  4018. UIInvitation.uiName = "UIInvitation";
  4019. class ui_UIMain extends fgui.GComponent {
  4020. static createInstance() {
  4021. return (fgui.UIPackage.createObject("game", "UIMain"));
  4022. }
  4023. onConstruct() {
  4024. this.n47 = (this.getChild("n47"));
  4025. this.n10 = (this.getChild("n10"));
  4026. this.secretary = (this.getChild("secretary"));
  4027. this.n33 = (this.getChild("n33"));
  4028. this.shopBtn = (this.getChild("shopBtn"));
  4029. this.moneyNode = (this.getChild("moneyNode"));
  4030. this.headNode = (this.getChild("headNode"));
  4031. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4032. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4033. this.classicBtn = (this.getChild("classicBtn"));
  4034. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4035. this.globalBtn = (this.getChild("globalBtn"));
  4036. this.n44 = (this.getChild("n44"));
  4037. this.signBtn = (this.getChild("signBtn"));
  4038. this.drawBtn = (this.getChild("drawBtn"));
  4039. this.settingNode = (this.getChild("settingNode"));
  4040. this.n45 = (this.getChild("n45"));
  4041. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4042. this.rankBtn = (this.getChild("rankBtn"));
  4043. this.n46 = (this.getChild("n46"));
  4044. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4045. this.liucheng1 = (this.getChild("liucheng1"));
  4046. this.rightBtn = (this.getChild("rightBtn"));
  4047. this.n75 = (this.getChild("n75"));
  4048. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4049. this.liucheng2 = (this.getChild("liucheng2"));
  4050. this.guideBtn = (this.getChild("guideBtn"));
  4051. this.n73 = (this.getChild("n73"));
  4052. this.wordsNode = (this.getChild("wordsNode"));
  4053. this.enterGuide = (this.getChild("enterGuide"));
  4054. this.talkNode = (this.getChild("talkNode"));
  4055. this.n83 = (this.getChild("n83"));
  4056. this.n84 = (this.getChild("n84"));
  4057. }
  4058. }
  4059. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4060. class ui_UIMoyu extends fgui.GComponent {
  4061. static createInstance() {
  4062. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4063. }
  4064. onConstruct() {
  4065. this.ageTip = (this.getChild("ageTip"));
  4066. this.mainBg = (this.getChild("mainBg"));
  4067. this.xyNode = (this.getChild("xyNode"));
  4068. this.rnNode = (this.getChild("rnNode"));
  4069. this.fcmNode = (this.getChild("fcmNode"));
  4070. this.ageNode = (this.getChild("ageNode"));
  4071. this.tipNode = (this.getChild("tipNode"));
  4072. this.msgNode = (this.getChild("msgNode"));
  4073. }
  4074. }
  4075. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4076. class MoyuMgr {
  4077. static initMoyu() {
  4078. this.moyuView = new MoyuView();
  4079. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4080. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4081. this.moyuView.ui.displayObject.zOrder = 1000;
  4082. this.moyuView.init();
  4083. this.moyuView.showTip(true);
  4084. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4085. window['XApk'] = this;
  4086. }
  4087. static showAge(show) {
  4088. if (this.moyuView)
  4089. this.moyuView.showAge(show);
  4090. }
  4091. static onPlatMsg(idx) {
  4092. if (!MoyuMgr.moyuView)
  4093. return;
  4094. if (idx == '0') {
  4095. MoyuMgr.moyuView.showTip(false);
  4096. }
  4097. }
  4098. static showAgree(call) {
  4099. if (this.moyuView)
  4100. this.moyuView.showAgree(call);
  4101. else
  4102. call && call();
  4103. }
  4104. static showXy(type = 1) {
  4105. if (this.moyuView)
  4106. this.moyuView.showXy(type);
  4107. }
  4108. }
  4109. MoyuMgr.isAdvise = false;
  4110. class MoyuView {
  4111. constructor() {
  4112. this.ysxyNum = 1;
  4113. this.ysJson = null;
  4114. this.ui = ui_UIMoyu.createInstance();
  4115. }
  4116. init() {
  4117. this.ui.mainBg.visible = false;
  4118. this.ui.xyNode.visible = false;
  4119. this.ui.ageNode.visible = false;
  4120. this.ui.tipNode.visible = false;
  4121. this.ui.rnNode.visible = false;
  4122. this.ui.fcmNode.visible = false;
  4123. this.ui.ageTip.visible = false;
  4124. this.ui.msgNode.visible = false;
  4125. this.ui.visible = false;
  4126. this.ui.xyNode.xyList.setVirtual();
  4127. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4128. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4129. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4130. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4131. this.ui.xyNode.btnKnown.visible = false;
  4132. this.ui.xyNode.xy1.visible = false;
  4133. this.ui.xyNode.xy2.visible = false;
  4134. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4135. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4136. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4137. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4138. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4139. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4140. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4141. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4142. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4143. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4144. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4145. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4146. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4147. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4148. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4149. this.ysxyNum = 2;
  4150. }
  4151. }
  4152. onClick(obj) {
  4153. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4154. switch (obj) {
  4155. case this.ui.ageTip:
  4156. if (Moyu.isTTApk) {
  4157. this.ui.ageNode.visible = true;
  4158. this.ui.mainBg.visible = true;
  4159. }
  4160. break;
  4161. case this.ui.tipNode:
  4162. this.showTip(false);
  4163. break;
  4164. case this.ui.ageNode.btnAge:
  4165. this.ui.ageNode.visible = false;
  4166. this.ui.mainBg.visible = false;
  4167. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4168. this.ui.visible = false;
  4169. break;
  4170. case this.ui.xyNode.btnXy3:
  4171. case this.ui.xyNode.btnXy1:
  4172. this.loadXy(1);
  4173. break;
  4174. case this.ui.xyNode.btnXy2:
  4175. this.loadXy(2);
  4176. break;
  4177. case this.ui.xyNode.btnBack:
  4178. this.ui.xyNode.xy1.visible = true;
  4179. this.ui.xyNode.xy2.visible = false;
  4180. break;
  4181. case this.ui.xyNode.btnKnown:
  4182. this.ui.xyNode.visible = false;
  4183. this.ui.mainBg.visible = false;
  4184. this.ui.visible = false;
  4185. break;
  4186. case this.ui.rnNode.btnCheck:
  4187. this.check();
  4188. break;
  4189. case this.ui.rnNode.btnExit:
  4190. case this.ui.xyNode.btnNo:
  4191. this.ysxyNum--;
  4192. if (this.ysxyNum > 0)
  4193. this.showMsg("Refuse to quit the game once again");
  4194. else {
  4195. Moyu.userAgree(false);
  4196. Moyu.exit();
  4197. }
  4198. break;
  4199. case this.ui.xyNode.btnSure:
  4200. case this.ui.xyNode.btnYes:
  4201. DataMgr.userData.isAgree = true;
  4202. DataMgr.saveUserData();
  4203. this.onAgree();
  4204. break;
  4205. case this.ui.rnNode.btnDone:
  4206. this.ui.rnNode.visible = false;
  4207. this.ui.visible = false;
  4208. break;
  4209. case this.ui.fcmNode.btnRn:
  4210. this.showRn();
  4211. break;
  4212. }
  4213. }
  4214. showTip(show) {
  4215. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4216. return;
  4217. if (show) {
  4218. MoyuMgr.isAdvise = true;
  4219. this.ui.visible = true;
  4220. this.ui.tipNode.visible = true;
  4221. this.ui.tipNode.alpha = 1;
  4222. Laya.timer.once(1000, this, this.showTip, [false]);
  4223. }
  4224. else {
  4225. this.ui.tipNode.alpha = 1;
  4226. this.ui.tipNode.visible = true;
  4227. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4228. this.ui.tipNode.visible = false;
  4229. MoyuMgr.isAdvise = false;
  4230. }), 1000);
  4231. }
  4232. }
  4233. showAge(show, px = 0, py = 0) {
  4234. if (Moyu.platType > 10 && !Moyu.isIos) {
  4235. this.ui.ageTip.x = px;
  4236. this.ui.ageTip.y = py;
  4237. this.ui.ageTip.visible = show;
  4238. if (show)
  4239. this.ui.visible = true;
  4240. }
  4241. }
  4242. showAgree(call) {
  4243. this.agreeCall = call;
  4244. this.onAgree();
  4245. return;
  4246. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4247. this.showXy(0);
  4248. }
  4249. else
  4250. this.onAgree();
  4251. }
  4252. onAgree() {
  4253. if (!this.ui.ageNode.visible)
  4254. this.ui.visible = false;
  4255. this.ui.xyNode.visible = false;
  4256. Moyu.userAgree(true);
  4257. this.showAge(false);
  4258. this.agreeCall && this.agreeCall();
  4259. this.showRn();
  4260. }
  4261. showMsg(txt) {
  4262. this.ui.msgNode.txtMsg.text = txt;
  4263. this.ui.msgNode.visible = true;
  4264. this.ui.msgNode.alpha = 1;
  4265. this.ui.visible = true;
  4266. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4267. this.ui.msgNode.visible = false;
  4268. }), 2500, true);
  4269. }
  4270. showRn() {
  4271. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4272. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4273. this.ui.rnNode.rn1.visible = true;
  4274. this.ui.rnNode.rn2.visible = false;
  4275. this.ui.rnNode.rn3.visible = false;
  4276. this.ui.rnNode.rn4.visible = false;
  4277. this.ui.rnNode.visible = true;
  4278. this.ui.mainBg.visible = true;
  4279. this.ui.rnNode.btnDone.visible = false;
  4280. this.ui.rnNode.btnExit.visible = true;
  4281. this.ui.rnNode.btnCheck.visible = true;
  4282. this.ui.fcmNode.visible = false;
  4283. this.ui.visible = true;
  4284. return;
  4285. }
  4286. }
  4287. this.showFcm();
  4288. }
  4289. showFcm() {
  4290. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4291. Moyu.initFCM(true);
  4292. if (Moyu.gameTime < 1)
  4293. this.fcmLoop();
  4294. else if (Moyu.gameTime < 999)
  4295. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4296. }
  4297. }
  4298. fcmLoop() {
  4299. if (Moyu.gameTime < 1) {
  4300. this.ui.rnNode.visible = false;
  4301. this.ui.fcmNode.visible = true;
  4302. this.ui.mainBg.visible = true;
  4303. this.ui.visible = true;
  4304. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4305. Laya.timer.clear(this.ui, this.fcmLoop);
  4306. }
  4307. }
  4308. check() {
  4309. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4310. this.ui.rnNode.rn1.visible = false;
  4311. this.ui.rnNode.rn2.visible = false;
  4312. this.ui.rnNode.rn4.visible = true;
  4313. }
  4314. else if (this.ui.rnNode.rn4.visible) {
  4315. let name = this.ui.rnNode.inputName.text;
  4316. let code = this.ui.rnNode.inputCode.text;
  4317. if (code && code.length == 18) {
  4318. this.ui.rnNode.rn1.visible = false;
  4319. this.ui.rnNode.rn4.visible = false;
  4320. Moyu.authenticate(name, code, (res) => {
  4321. this.ui.rnNode.rn2.visible = !res;
  4322. this.ui.rnNode.rn3.visible = res;
  4323. this.ui.rnNode.btnDone.visible = res;
  4324. this.ui.rnNode.btnExit.visible = !res;
  4325. this.ui.rnNode.btnCheck.visible = !res;
  4326. if (res)
  4327. this.showFcm();
  4328. });
  4329. }
  4330. else
  4331. this.showMsg("信息填写不完整");
  4332. }
  4333. }
  4334. loadXy(type = 0) {
  4335. this.ui.xyNode.xy1.visible = false;
  4336. this.ui.xyNode.xy2.visible = true;
  4337. this.ui.xyNode.xyList.scrollToView(0);
  4338. if (type == 1) {
  4339. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4340. }
  4341. else if (type == 2) {
  4342. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4343. }
  4344. }
  4345. showXy(type = 0) {
  4346. this.xyBtn();
  4347. if (type == 0) {
  4348. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4349. this.ui.xyNode.btnSure.visible = true;
  4350. }
  4351. else {
  4352. this.ui.xyNode.btnYes.visible = true;
  4353. this.ui.xyNode.btnNo.visible = true;
  4354. }
  4355. }
  4356. else {
  4357. this.ui.xyNode.btnKnown.visible = true;
  4358. this.ui.mainBg.visible = true;
  4359. }
  4360. this.ui.xyNode.xy1.visible = true;
  4361. this.ui.xyNode.xy2.visible = false;
  4362. this.ui.xyNode.visible = true;
  4363. this.ui.visible = true;
  4364. }
  4365. xyBtn() {
  4366. this.ui.xyNode.btnSure.visible = false;
  4367. this.ui.xyNode.btnYes.visible = false;
  4368. this.ui.xyNode.btnNo.visible = false;
  4369. this.ui.xyNode.btnKnown.visible = false;
  4370. {
  4371. this.ui.xyNode.btnXy3.visible = false;
  4372. this.ui.xyNode.btnXy2.visible = true;
  4373. this.ui.xyNode.btnXy1.visible = true;
  4374. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4375. }
  4376. }
  4377. createXY(json) {
  4378. this.ysJson = json.content;
  4379. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4380. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4381. this.ui.xyNode.xy2.visible = true;
  4382. }
  4383. renderListItem(idx, cell) {
  4384. let xy = this.ysJson[idx];
  4385. cell.height = xy.line * 30;
  4386. cell.xyItem.text = xy.text;
  4387. }
  4388. onDestroy() {
  4389. this.agreeCall = null;
  4390. }
  4391. }
  4392. class SettingNode {
  4393. constructor(ui) {
  4394. this.showSetting = false;
  4395. this.openSound = true;
  4396. this.openShake = true;
  4397. this.ui = ui;
  4398. this.ui.soundBtn.onClick(this, this.switchSound);
  4399. this.ui.shakeBtn.onClick(this, this.switchShake);
  4400. this.ui.xyBtn.onClick(this, this.onXy);
  4401. this.ui.clickNode.onClick(this, this.changeSetting);
  4402. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4403. }
  4404. changeSetting() {
  4405. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4406. this.showSetting = !this.showSetting;
  4407. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4408. }
  4409. switchSound() {
  4410. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4411. this.openSound = !this.openSound;
  4412. Moyu.onSetting(this.openSound, this.openShake);
  4413. xGame.soundMgr.onSetting(this.openSound);
  4414. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4415. }
  4416. switchShake() {
  4417. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4418. this.openShake = !this.openShake;
  4419. Moyu.onSetting(this.openSound, this.openShake);
  4420. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4421. }
  4422. onXy() {
  4423. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4424. MoyuMgr.showXy(1);
  4425. }
  4426. }
  4427. class ui_UILevelDisplay extends fgui.GComponent {
  4428. static createInstance() {
  4429. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4430. }
  4431. onConstruct() {
  4432. this.n9 = (this.getChild("n9"));
  4433. this.myNode = (this.getChild("myNode"));
  4434. this.closeNode = (this.getChild("closeNode"));
  4435. }
  4436. }
  4437. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4438. class ui_UILevelProp extends fgui.GComponent {
  4439. static createInstance() {
  4440. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4441. }
  4442. onConstruct() {
  4443. this.n16 = (this.getChild("n16"));
  4444. this.myNode = (this.getChild("myNode"));
  4445. this.closeBtn = (this.getChild("closeBtn"));
  4446. this.moneyNode = (this.getChild("moneyNode"));
  4447. this.t1 = this.getTransition("t1");
  4448. }
  4449. }
  4450. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4451. class ui_ShowItem extends fgui.GComponent {
  4452. static createInstance() {
  4453. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4454. }
  4455. onConstruct() {
  4456. this.myImg = (this.getChild("myImg"));
  4457. }
  4458. }
  4459. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4460. class ShowItem {
  4461. constructor() {
  4462. this.ui = ui_ShowItem.createInstance();
  4463. }
  4464. destroySelf() {
  4465. if (!this.ui.isDisposed) {
  4466. this.ui.removeFromParent();
  4467. this.ui.dispose();
  4468. }
  4469. }
  4470. setParent(parent) {
  4471. parent.addChild(this.ui);
  4472. }
  4473. setPos(x, y) {
  4474. this.ui.x = x;
  4475. this.ui.y = y;
  4476. }
  4477. setUrl(index) {
  4478. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4479. }
  4480. }
  4481. class ui_UIPower extends fgui.GComponent {
  4482. static createInstance() {
  4483. return (fgui.UIPackage.createObject("game", "UIPower"));
  4484. }
  4485. onConstruct() {
  4486. this.n11 = (this.getChild("n11"));
  4487. this.myNode = (this.getChild("myNode"));
  4488. this.t0 = this.getTransition("t0");
  4489. }
  4490. }
  4491. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4492. class UIPower extends UIBase {
  4493. constructor() {
  4494. super();
  4495. }
  4496. onConstructor() {
  4497. this.ui = ui_UIPower.createInstance();
  4498. this.contentPane = this.ui;
  4499. this.isEject = false;
  4500. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4501. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4502. }
  4503. show() {
  4504. super.show();
  4505. this.ui.t0.play();
  4506. }
  4507. videoGetPower() {
  4508. Moyu.showVideoAd(() => {
  4509. DataMgr.setPower(xGame.common.videoPower, true);
  4510. xGame.eventMgr.event(POWER_TIME);
  4511. this.hide();
  4512. }, EAdType.getPower);
  4513. }
  4514. }
  4515. UIPower.uiName = "UIPower";
  4516. class UILevelProp extends UIBase {
  4517. constructor() {
  4518. super();
  4519. this.firstPos = 385;
  4520. this.secondPos = 467;
  4521. this.showItemArr = [];
  4522. }
  4523. onConstructor() {
  4524. this.ui = ui_UILevelProp.createInstance();
  4525. this.contentPane = this.ui;
  4526. this.isEject = false;
  4527. this.addUIClick(this.ui.closeBtn, this.hide);
  4528. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4529. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4530. }
  4531. show(level) {
  4532. super.show();
  4533. this.ui.t1.play();
  4534. this.level = level;
  4535. this.data = cfgTable.placeballData[this.level];
  4536. this.updateSelf();
  4537. this.showPreView();
  4538. this.moneyNode.ui.c1.selectedIndex = 2;
  4539. this.moneyNode.checkPowerTime();
  4540. this.moneyNode.powerChange();
  4541. }
  4542. showPreView() {
  4543. let item;
  4544. let data;
  4545. for (let index = 0; index < this.showItemArr.length; index++) {
  4546. item = this.showItemArr[index];
  4547. item.destroySelf();
  4548. }
  4549. this.showItemArr = [];
  4550. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4551. for (const key in cfgData) {
  4552. data = cfgData[key];
  4553. item = new ShowItem();
  4554. item.setParent(this.ui.myNode.displayRoot);
  4555. item.setPos(data.x, data.y);
  4556. item.setUrl(data.value);
  4557. this.showItemArr.push(item);
  4558. }
  4559. }
  4560. updateSelf() {
  4561. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4562. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4563. if (this.data.ball == -1) {
  4564. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4565. }
  4566. else {
  4567. this.ui.myNode.conditionTxt.text = "Reward";
  4568. }
  4569. let localData = DataMgr.getPlaceBallLevel(this.level);
  4570. let getAward = localData.getAward;
  4571. let cfg = cfgTable.placeballData[this.level];
  4572. let coin = this.data.award[0];
  4573. let diamond = this.data.award[1];
  4574. if (cfg.type == PlaceBallType.challenge) {
  4575. diamond = 0;
  4576. coin = 100;
  4577. }
  4578. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4579. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4580. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4581. if (cfg.type == PlaceBallType.challenge) {
  4582. this.ui.myNode.coinNode.numTxt.text = "";
  4583. }
  4584. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4585. if (coin > 0 && diamond > 0) {
  4586. this.ui.myNode.diamondNode.x = 385;
  4587. this.ui.myNode.coinNode.x = 467;
  4588. }
  4589. else {
  4590. this.ui.myNode.diamondNode.x = 385;
  4591. this.ui.myNode.coinNode.x = 385;
  4592. }
  4593. if (!getAward) {
  4594. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4595. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4596. }
  4597. else {
  4598. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4599. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4600. }
  4601. }
  4602. startGame() {
  4603. if (DataMgr.powerEnough()) {
  4604. this.ui.myNode.startBtn.touchable = false;
  4605. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4606. console.log('zh:startGame ');
  4607. this.ui.myNode.startBtn.touchable = true;
  4608. DataMgr.setPower(-1);
  4609. xGame.eventMgr.event(POWER_TIME);
  4610. xGame.common.gameMode = GameMode.placeBall;
  4611. xGame.common.placeBallCurLevel = this.level;
  4612. xGame.uiMgr.Show(UIGame);
  4613. xGame.uiMgr.Hide(UILevelDisplay);
  4614. xGame.uiMgr.Hide(UIMain);
  4615. this.hide();
  4616. }));
  4617. }
  4618. else {
  4619. console.log('zh:startGame no power');
  4620. xGame.uiMgr.Show(UIPower);
  4621. }
  4622. }
  4623. hide() {
  4624. super.hide();
  4625. }
  4626. }
  4627. UILevelProp.uiName = "UILevelProp";
  4628. class PutBallLevelDisplay {
  4629. constructor(ui, index) {
  4630. this.index = 0;
  4631. this.ui = ui;
  4632. this.index = index;
  4633. this.ui.onClick(this, this.clickSelf);
  4634. this.updateSelf();
  4635. this.ui.levelTxt.text = (this.index + 1) + "";
  4636. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4637. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4638. }
  4639. updateSelf() {
  4640. let level = this.index + 1;
  4641. this.data = DataMgr.getPlaceBallLevel(level);
  4642. this.ui.starNode.c1.selectedIndex = this.data.star;
  4643. let isChallenge = cfgTable.placeballData[level].type;
  4644. if (this.data.isCur) {
  4645. if (isChallenge) {
  4646. this.ui.c1.selectedIndex = 5;
  4647. }
  4648. else {
  4649. this.ui.c1.selectedIndex = 2;
  4650. }
  4651. }
  4652. else {
  4653. if (this.data.play) {
  4654. if (this.data.star == 3) {
  4655. this.ui.c1.selectedIndex = 0;
  4656. }
  4657. else {
  4658. this.ui.c1.selectedIndex = 1;
  4659. }
  4660. }
  4661. else {
  4662. if (isChallenge) {
  4663. this.ui.c1.selectedIndex = 4;
  4664. }
  4665. else {
  4666. this.ui.c1.selectedIndex = 3;
  4667. }
  4668. }
  4669. }
  4670. }
  4671. clickSelf() {
  4672. if (!this.data.play)
  4673. return;
  4674. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4675. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4676. }
  4677. }
  4678. class UILevelDisplay extends UIBase {
  4679. constructor() {
  4680. super();
  4681. }
  4682. onConstructor() {
  4683. this.ui = ui_UILevelDisplay.createInstance();
  4684. this.contentPane = this.ui;
  4685. this.isEject = false;
  4686. this.myList = this.ui.myNode.myList;
  4687. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4688. this.levelItemArr = [];
  4689. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4690. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4691. this.myList.numItems = levelNum;
  4692. if (Moyu.isKs)
  4693. this.ui.closeNode.closeBtn.x += 100;
  4694. }
  4695. levelItemRender(index, target) {
  4696. let item = new PutBallLevelDisplay(target, index);
  4697. this.levelItemArr.push(item);
  4698. }
  4699. show() {
  4700. super.show();
  4701. this.updateLevel();
  4702. this.scrollToPlace();
  4703. }
  4704. updateLevel() {
  4705. let temp;
  4706. for (let index = 0; index < this.levelItemArr.length; index++) {
  4707. temp = this.levelItemArr[index];
  4708. temp.updateSelf();
  4709. }
  4710. }
  4711. scrollToPlace() {
  4712. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4713. let passArr = DataMgr.getPlaceBallLevelList();
  4714. let offest = passArr.length;
  4715. if (offest >= maxNum - 1)
  4716. offest = maxNum - 1;
  4717. this.myList.scrollToView(offest, true, true);
  4718. }
  4719. hide() {
  4720. super.hide();
  4721. }
  4722. }
  4723. UILevelDisplay.uiName = "UILevelDisplay";
  4724. class ui_UIMatching extends fgui.GComponent {
  4725. static createInstance() {
  4726. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4727. }
  4728. onConstruct() {
  4729. this.n5 = (this.getChild("n5"));
  4730. this.n49 = (this.getChild("n49"));
  4731. this.n51 = (this.getChild("n51"));
  4732. this.n64 = (this.getChild("n64"));
  4733. this.n2 = (this.getChild("n2"));
  4734. this.n53 = (this.getChild("n53"));
  4735. this.n54 = (this.getChild("n54"));
  4736. this.n56 = (this.getChild("n56"));
  4737. this.n58 = (this.getChild("n58"));
  4738. this.n59 = (this.getChild("n59"));
  4739. this.n57 = (this.getChild("n57"));
  4740. this.n60 = (this.getChild("n60"));
  4741. this.n62 = (this.getChild("n62"));
  4742. this.awardTxt = (this.getChild("awardTxt"));
  4743. this.n61 = (this.getChild("n61"));
  4744. this.selfHead = (this.getChild("selfHead"));
  4745. this.aiHead = (this.getChild("aiHead"));
  4746. this.n82 = (this.getChild("n82"));
  4747. this.n84 = (this.getChild("n84"));
  4748. this.n83 = (this.getChild("n83"));
  4749. this.t1 = this.getTransition("t1");
  4750. this.t2 = this.getTransition("t2");
  4751. this.t3 = this.getTransition("t3");
  4752. this.t4 = this.getTransition("t4");
  4753. }
  4754. }
  4755. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4756. class UIMatching extends UIBase {
  4757. constructor() {
  4758. super();
  4759. }
  4760. onConstructor() {
  4761. this.ui = ui_UIMatching.createInstance();
  4762. this.contentPane = this.ui;
  4763. this.isEject = false;
  4764. }
  4765. show(callback) {
  4766. super.show();
  4767. PlatMgr.showBanner(true);
  4768. this.callback = callback;
  4769. let user = Moyu.getUserInfo();
  4770. if (!this.selfPot) {
  4771. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4772. }
  4773. if (!this.aiPot) {
  4774. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4775. }
  4776. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4777. this.ui.selfHead.nameTxt.text = user.nickName;
  4778. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4779. this.ui.aiHead.nameTxt.text = "???";
  4780. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4781. this.ui.selfHead.c1.selectedIndex = 0;
  4782. this.ui.aiHead.c1.selectedIndex = 0;
  4783. this.ui.selfHead.x = this.selfPot.x;
  4784. this.ui.selfHead.y = this.selfPot.y;
  4785. this.ui.aiHead.x = this.aiPot.x;
  4786. this.ui.aiHead.y = this.aiPot.y;
  4787. switch (xGame.common.gameMode) {
  4788. case GameMode.classic:
  4789. break;
  4790. case GameMode.bigMove:
  4791. this.initSkillData();
  4792. break;
  4793. default:
  4794. break;
  4795. }
  4796. this.ui.t1.play(Laya.Handler.create(this, () => {
  4797. this.ui.t2.play(Laya.Handler.create(this, () => {
  4798. switch (xGame.common.gameMode) {
  4799. case GameMode.classic:
  4800. this.waitingPeople();
  4801. break;
  4802. case GameMode.bigMove:
  4803. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4804. break;
  4805. default:
  4806. break;
  4807. }
  4808. }));
  4809. }));
  4810. }
  4811. initSkillData() {
  4812. this.skillSelectData = [];
  4813. let skillUrl = xGame.common.skillIconList;
  4814. let skillName = xGame.common.skillNameList;
  4815. let skillLevel = DataMgr.getBigSkillList();
  4816. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4817. for (let index = 0; index < 5; index++) {
  4818. let obj = {};
  4819. obj.skillImg = skillUrl[index];
  4820. obj.skillName = skillName[index];
  4821. obj.skillType = skillType[index];
  4822. obj.skillLevel = skillLevel[index];
  4823. this.skillSelectData.push(obj);
  4824. }
  4825. }
  4826. getAISkillLevel(myLevel) {
  4827. let video = xGame.common.upSkillLevel;
  4828. let aiLevel;
  4829. let temp;
  4830. if (video) {
  4831. temp = xGame.common.randomNum(-2, -1);
  4832. }
  4833. else {
  4834. if (myLevel <= 5) {
  4835. temp = xGame.common.randomNum(1, 3);
  4836. }
  4837. else if (myLevel <= 9) {
  4838. temp = xGame.common.randomNum(-2, 1);
  4839. }
  4840. else {
  4841. temp = xGame.common.randomNum(-4, 0);
  4842. }
  4843. }
  4844. aiLevel = temp + myLevel;
  4845. if (aiLevel <= 1)
  4846. aiLevel = 1;
  4847. if (aiLevel >= 10)
  4848. aiLevel = 10;
  4849. return aiLevel;
  4850. }
  4851. getAISkillType() {
  4852. return xGame.common.randomNum(1, 4);
  4853. let successTimes = DataMgr.getSkillSuccessTimes();
  4854. let info = cfgTable.aiskillData[successTimes];
  4855. if (!info) {
  4856. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4857. info = cfgTable.aiskillData[max];
  4858. }
  4859. let dataArr = info.skillselect;
  4860. let myCfg = {};
  4861. for (let index = 0; index < dataArr.length; index++) {
  4862. let temp = dataArr[index].split('-');
  4863. myCfg[temp[0]] = {};
  4864. myCfg[temp[0]].id = parseInt(temp[0]);
  4865. myCfg[temp[0]].weight = parseInt(temp[1]);
  4866. }
  4867. let aiCfg = xGame.common.initWeight(myCfg);
  4868. let curData = xGame.common.getRandomWeightData(aiCfg);
  4869. return parseInt(curData.id);
  4870. }
  4871. getAISkillData(index) {
  4872. let myLevel = this.skillSelectData[index].skillLevel;
  4873. let aiLevel = this.getAISkillLevel(myLevel);
  4874. let aiType = this.getAISkillType() - 1;
  4875. return { aiLevel, aiType } = { aiLevel, aiType };
  4876. }
  4877. skillSelectFinish(index) {
  4878. let aiInfo = this.getAISkillData(index);
  4879. xGame.common.gameMgr.selfCurSkill = index;
  4880. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4881. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4882. this.ui.selfHead.c1.selectedIndex = 1;
  4883. this.ui.aiHead.c1.selectedIndex = 1;
  4884. let myData = this.skillSelectData[index];
  4885. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4886. let guide = DataMgr.getSkillGuide();
  4887. if (guide == 0) {
  4888. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  4889. }
  4890. else {
  4891. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4892. }
  4893. let aiData = this.skillSelectData[aiInfo.aiType];
  4894. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4895. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4896. this.waitingPeople();
  4897. }
  4898. waitingPeople() {
  4899. let time = xGame.common.randomNum(1000, 3000);
  4900. time += 1000;
  4901. Laya.timer.once(time, this, () => {
  4902. this.matchingSuccess();
  4903. });
  4904. }
  4905. matchingSuccess() {
  4906. let gameUI = xGame.common.gameUI;
  4907. let name = gameUI.ui.topNode.aiNameTxt.text;
  4908. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4909. this.ui.aiHead.nameTxt.text = name;
  4910. this.ui.aiHead.headImg.url = url;
  4911. name = gameUI.ui.topNode.selfNameTxt.text;
  4912. url = gameUI.ui.topNode.selfHeadLoader.url;
  4913. this.ui.selfHead.nameTxt.text = name;
  4914. this.ui.selfHead.headImg.url = url;
  4915. this.ui.t3.play(Laya.Handler.create(this, () => {
  4916. this.callback && this.callback();
  4917. this.ui.t4.play(Laya.Handler.create(this, () => {
  4918. this.destroySelf();
  4919. }));
  4920. }));
  4921. }
  4922. destroySelf() {
  4923. this.callback = null;
  4924. this.skillSelectData = null;
  4925. this.selfPot = null;
  4926. this.aiPot = null;
  4927. if (!this.ui.isDisposed) {
  4928. this.ui.removeFromParent();
  4929. this.ui.dispose();
  4930. }
  4931. xGame.uiMgr.destroyUI(this);
  4932. }
  4933. }
  4934. UIMatching.uiName = "UIMatching";
  4935. class ui_UIRanking extends fgui.GComponent {
  4936. static createInstance() {
  4937. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4938. }
  4939. onConstruct() {
  4940. this.n26 = (this.getChild("n26"));
  4941. this.myNode = (this.getChild("myNode"));
  4942. }
  4943. }
  4944. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4945. class UIRanking extends UIBase {
  4946. constructor() {
  4947. super();
  4948. this.showSelf = true;
  4949. this.rankType = 1;
  4950. this.rankList = [];
  4951. this.myIndex = 0;
  4952. this.myStar = 0;
  4953. }
  4954. onConstructor() {
  4955. this.ui = ui_UIRanking.createInstance();
  4956. this.contentPane = this.ui;
  4957. this.isEject = false;
  4958. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4959. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4960. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4961. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4962. this.ui.myNode.myList.setVirtual();
  4963. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4964. }
  4965. show() {
  4966. super.show();
  4967. this.myIndex = 51;
  4968. Moyu.getRankList({
  4969. rankId: xGame.common.curRankID,
  4970. type: MoyuRankType.total,
  4971. page: 1,
  4972. pageSize: 50,
  4973. }, this, this.updateItemData);
  4974. this.updateSelf();
  4975. let self = Moyu.getUserInfo();
  4976. if (!self.isAuth) {
  4977. Moyu.initUser(this, () => {
  4978. DataMgr.upRankData();
  4979. });
  4980. }
  4981. }
  4982. updateSelfItem() {
  4983. let self = Moyu.getUserInfo();
  4984. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4985. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4986. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4987. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  4988. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4989. }
  4990. updateItemData(data) {
  4991. this.myStar = xGame.common.getAllStarNum();
  4992. if (this.rankList.length < 2) {
  4993. this.rankList = data;
  4994. let self = Moyu.getUserInfo();
  4995. for (let i = 0; i < data.length; i++) {
  4996. let data = this.rankList[i];
  4997. if (data.userId == self.userId) {
  4998. this.rankList.splice(i, 1);
  4999. break;
  5000. }
  5001. }
  5002. for (let i = 0; i < data.length; i++) {
  5003. let data = this.rankList[i];
  5004. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5005. this.myIndex = i + 1;
  5006. let user = { headIcon: self.headIcon, nickName: "myself" };
  5007. let ud = { user: user, data: {} };
  5008. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5009. if (Moyu.platType < 11) {
  5010. user.headIcon = self.headIcon;
  5011. user.nickName = self.nickName;
  5012. }
  5013. this.rankList.splice(i, 0, md);
  5014. break;
  5015. }
  5016. }
  5017. }
  5018. this.updateSelfItem();
  5019. this.ui.myNode.myList.numItems = this.rankList.length;
  5020. }
  5021. updateItemUI(index, obj) {
  5022. let data = this.rankList[index];
  5023. let userData = JSON.parse(data.userData).user;
  5024. obj.nameTxt.text = userData.nickName.toString();
  5025. obj.valueTxt.text = data.rankScore;
  5026. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5027. obj.rankTxt.text = index + 1;
  5028. switch (index) {
  5029. case 0:
  5030. this.setImg(obj, 1, 0, 0);
  5031. obj.rankTxt.color = "#FFC047";
  5032. break;
  5033. case 1:
  5034. this.setImg(obj, 0, 1, 0);
  5035. obj.rankTxt.color = "#ACACAC";
  5036. break;
  5037. case 2:
  5038. this.setImg(obj, 0, 0, 1);
  5039. obj.rankTxt.color = "#D09672";
  5040. break;
  5041. default:
  5042. this.setImg(obj, 0, 0, 0);
  5043. obj.rankTxt.color = "#496FAB";
  5044. break;
  5045. }
  5046. }
  5047. setImg(obj, a, b, c) {
  5048. obj.img1.visible = a ? true : false;
  5049. obj.img2.visible = b ? true : false;
  5050. obj.img3.visible = c ? true : false;
  5051. }
  5052. changeList(type) {
  5053. this.rankType = type;
  5054. this.updateSelf();
  5055. }
  5056. changeSelfNode() {
  5057. this.showSelf = !this.showSelf;
  5058. this.updateSelf();
  5059. }
  5060. updateSelf() {
  5061. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5062. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5063. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5064. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5065. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5066. }
  5067. }
  5068. UIRanking.uiName = "UIRanking";
  5069. class ui_UISecretary extends fgui.GComponent {
  5070. static createInstance() {
  5071. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5072. }
  5073. onConstruct() {
  5074. this.n0 = (this.getChild("n0"));
  5075. this.myNode = (this.getChild("myNode"));
  5076. this.rightBtn = (this.getChild("rightBtn"));
  5077. this.leftBtn = (this.getChild("leftBtn"));
  5078. this.closeBtn = (this.getChild("closeBtn"));
  5079. this.t0 = this.getTransition("t0");
  5080. }
  5081. }
  5082. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5083. class UISecretary extends UIBase {
  5084. constructor() {
  5085. super();
  5086. this.curIndex = 1;
  5087. }
  5088. onConstructor() {
  5089. this.ui = ui_UISecretary.createInstance();
  5090. this.contentPane = this.ui;
  5091. this.isEject = false;
  5092. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5093. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  5094. this.addUIClick(this.ui.rightBtn, this.turnRight);
  5095. this.nodeObj = { left: null, right: null, cur: null };
  5096. this.nodeObj.left = this.ui.myNode.gameNode1;
  5097. this.nodeObj.right = this.ui.myNode.gameNode2;
  5098. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5099. }
  5100. show() {
  5101. super.show();
  5102. this.ui.t0.play();
  5103. this.updateData();
  5104. }
  5105. addSecretarySpine(node, spineName) {
  5106. if (spineName == "mishu") {
  5107. if (this.secretarySpine1) {
  5108. node.displayObject.destroyChildren();
  5109. this.playWoman(this.secretarySpine1, node.displayObject);
  5110. }
  5111. else {
  5112. let spine1 = new SpineMgr("mishu", () => {
  5113. this.secretarySpine1 = spine1;
  5114. this.playWoman(this.secretarySpine1, node.displayObject);
  5115. });
  5116. }
  5117. }
  5118. else {
  5119. if (this.secretarySpine2) {
  5120. node.displayObject.destroyChildren();
  5121. this.playWoman(this.secretarySpine2, node.displayObject);
  5122. }
  5123. else {
  5124. let spine2 = new SpineMgr("xiaomishu2", () => {
  5125. this.secretarySpine2 = spine2;
  5126. this.playWoman(this.secretarySpine2, node.displayObject);
  5127. });
  5128. }
  5129. }
  5130. }
  5131. playWoman(node, parent) {
  5132. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  5133. let yy = this.ui.myNode.gameNode1.secretary.height;
  5134. let scale = 1.5;
  5135. if (node == this.secretarySpine2) {
  5136. scale = 1.2;
  5137. }
  5138. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5139. node.play(data, 1, true, parent);
  5140. }
  5141. turnLeft() {
  5142. this.curIndex--;
  5143. if (this.curIndex < 1) {
  5144. this.curIndex = 2;
  5145. }
  5146. let left = this.nodeObj.left;
  5147. let right = this.nodeObj.right;
  5148. let cur = this.nodeObj.cur;
  5149. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5150. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5151. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5152. this.updateData();
  5153. }));
  5154. this.ui.myNode.setChildIndex(right, 2);
  5155. this.nodeObj.left = cur;
  5156. this.nodeObj.right = left;
  5157. this.nodeObj.cur = right;
  5158. }
  5159. turnRight() {
  5160. this.curIndex++;
  5161. if (this.curIndex > 2) {
  5162. this.curIndex = 1;
  5163. }
  5164. let left = this.nodeObj.left;
  5165. let right = this.nodeObj.right;
  5166. let cur = this.nodeObj.cur;
  5167. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5168. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5169. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5170. this.updateData();
  5171. }));
  5172. this.ui.myNode.setChildIndex(left, 2);
  5173. this.nodeObj.left = right;
  5174. this.nodeObj.right = cur;
  5175. this.nodeObj.cur = left;
  5176. }
  5177. updateData() {
  5178. let data = cfgTable.secretaryshopData;
  5179. let children = this.ui.myNode._children;
  5180. let temp;
  5181. let curData;
  5182. for (let index = 0; index < children.length; index++) {
  5183. temp = children[index];
  5184. if (index == 2) {
  5185. curData = data[this.curIndex];
  5186. temp.purchaseBtn.touchable = true;
  5187. }
  5188. else {
  5189. temp.purchaseBtn.touchable = false;
  5190. if (this.curIndex == 1) {
  5191. curData = data[2];
  5192. }
  5193. else {
  5194. curData = data[1];
  5195. }
  5196. }
  5197. temp.heightTxt.text = curData.height;
  5198. temp.foodTxt.text = curData.food;
  5199. temp.historyTxt.text = curData.history;
  5200. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5201. this.addSecretarySpine(temp.secretary, curData.spine);
  5202. let womanIndex = curData.id - 1;
  5203. let getWoman = DataMgr.getSecretary(womanIndex);
  5204. let curUse = DataMgr.getCurSecretary();
  5205. if (getWoman) {
  5206. if (curUse == womanIndex) {
  5207. temp.purchaseBtn.c1.selectedIndex = 1;
  5208. }
  5209. else {
  5210. temp.purchaseBtn.c1.selectedIndex = 2;
  5211. }
  5212. }
  5213. else {
  5214. temp.purchaseBtn.c1.selectedIndex = 0;
  5215. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5216. }
  5217. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5218. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5219. }
  5220. }
  5221. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5222. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5223. if (getWoman) {
  5224. if (curUse != womanIndex) {
  5225. console.log();
  5226. DataMgr.setCurSecretary(womanIndex);
  5227. this.updateData();
  5228. }
  5229. }
  5230. else {
  5231. let need = needDiamond;
  5232. if (DataMgr.diamondEnough(need)) {
  5233. DataMgr.setDiamond(-need);
  5234. DataMgr.setSecretary(womanIndex, 1);
  5235. DataMgr.setCurSecretary(womanIndex);
  5236. this.updateData();
  5237. }
  5238. else {
  5239. xGame.uiMgr.Show(UIAddProp, 1);
  5240. }
  5241. }
  5242. }
  5243. closeSelf() {
  5244. this.hide();
  5245. }
  5246. }
  5247. UISecretary.uiName = "UISecretary";
  5248. class ui_UIShop extends fgui.GComponent {
  5249. static createInstance() {
  5250. return (fgui.UIPackage.createObject("game", "UIShop"));
  5251. }
  5252. onConstruct() {
  5253. this.n48 = (this.getChild("n48"));
  5254. this.n0 = (this.getChild("n0"));
  5255. this.secretary = (this.getChild("secretary"));
  5256. this.talkNode = (this.getChild("talkNode"));
  5257. this.closeNode = (this.getChild("closeNode"));
  5258. this.moneyNode = (this.getChild("moneyNode"));
  5259. this.myNode = (this.getChild("myNode"));
  5260. }
  5261. }
  5262. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5263. class BallRodDisplay {
  5264. constructor(ui, index) {
  5265. this.index = 0;
  5266. this.uiIndex = 0;
  5267. this.ui = ui;
  5268. this.index = index;
  5269. this.initData();
  5270. }
  5271. initData() {
  5272. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5273. let data = cfgTable.ballrodData[this.index + 1];
  5274. this.ui.nameTxt.text = data.name;
  5275. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5276. this.ui.levelNode.c1.selectedIndex = data.quality;
  5277. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5278. if (data.spine) {
  5279. this.mySpine = new SpineMgr(data.spine, () => {
  5280. let xx = 150;
  5281. let yy = 70;
  5282. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5283. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5284. });
  5285. }
  5286. }
  5287. updateSelf() {
  5288. let get = DataMgr.getBallRod(this.index);
  5289. if (get == null)
  5290. get = 1;
  5291. let curUse = DataMgr.getCurBallRod();
  5292. if (get) {
  5293. if (curUse == this.index) {
  5294. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5295. }
  5296. else {
  5297. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5298. }
  5299. }
  5300. else {
  5301. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5302. }
  5303. }
  5304. buyBallRod() {
  5305. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5306. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5307. switch (selectedIndex) {
  5308. case 0:
  5309. break;
  5310. case 1:
  5311. DataMgr.setCurBallRod(this.index);
  5312. let ui = xGame.uiMgr.getUI(UIShop);
  5313. ui.updateBallRod();
  5314. break;
  5315. case 2:
  5316. let data = cfgTable.ballrodData[this.index + 1];
  5317. let need = data.price;
  5318. if (DataMgr.diamondEnough(need)) {
  5319. DataMgr.setDiamond(-need);
  5320. DataMgr.setBallRod(this.index, 1);
  5321. DataMgr.setCurBallRod(this.index);
  5322. let ui = xGame.uiMgr.getUI(UIShop);
  5323. ui.updateBallRod();
  5324. }
  5325. else {
  5326. xGame.uiMgr.Show(UIAddProp, 1);
  5327. }
  5328. break;
  5329. default:
  5330. break;
  5331. }
  5332. }
  5333. }
  5334. class UIShop extends UIBase {
  5335. constructor() {
  5336. super();
  5337. this.itemNums = 0;
  5338. }
  5339. onConstructor() {
  5340. this.ui = ui_UIShop.createInstance();
  5341. this.contentPane = this.ui;
  5342. this.isEject = false;
  5343. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5344. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5345. this.addUIClick(this.ui, this.interuptSecretary);
  5346. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5347. this.ballRodArr = [];
  5348. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5349. this.ui.myNode.myList.numItems = this.itemNums;
  5350. if (Moyu.isKs)
  5351. this.ui.closeNode.closeBtn.x += 100;
  5352. }
  5353. show() {
  5354. super.show();
  5355. this.playSecretaryIdle();
  5356. this.updateBallRod();
  5357. }
  5358. updateBallRod() {
  5359. for (let index = 0; index < this.ballRodArr.length; index++) {
  5360. this.ballRodArr[index].updateSelf();
  5361. }
  5362. }
  5363. renderBallRod(sort, obj) {
  5364. let index = this.getIndexBySort(sort + 1) - 1;
  5365. let ballRod = new BallRodDisplay(obj, index);
  5366. this.ballRodArr.push(ballRod);
  5367. }
  5368. getIndexBySort(sort) {
  5369. let object = cfgTable.ballrodData;
  5370. for (const key in object) {
  5371. if (object[key].sort == sort) {
  5372. return parseInt(key);
  5373. }
  5374. }
  5375. }
  5376. playSecretaryIdle() {
  5377. let parent = this.ui.secretary.displayObject;
  5378. parent.destroyChildren();
  5379. let xx = this.ui.secretary.width / 2;
  5380. let yy = this.ui.secretary.height;
  5381. let scale = xGame.common.getSecretaryScale();
  5382. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5383. xGame.common.secretary.play(data, 1, true, parent);
  5384. }
  5385. interuptSecretary() {
  5386. Laya.timer.clearAll(this);
  5387. this.playSecretaryRandomSound();
  5388. }
  5389. playSecretaryRandomSound() {
  5390. if (this.isHide)
  5391. return;
  5392. let time = xGame.common.randomNum(45000, 60000);
  5393. Laya.timer.once(time, this, () => {
  5394. if (this.isHide)
  5395. return;
  5396. let index = xGame.common.randomNum(4, 7);
  5397. xGame.soundMgr.playSound("s_main0" + index);
  5398. let words = 1;
  5399. switch (index) {
  5400. case 4:
  5401. words = 5;
  5402. break;
  5403. case 5:
  5404. words = 3;
  5405. break;
  5406. case 6:
  5407. words = 6;
  5408. break;
  5409. case 7:
  5410. words = 7;
  5411. break;
  5412. default:
  5413. break;
  5414. }
  5415. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5416. this.playSecretaryRandomSound();
  5417. });
  5418. }
  5419. closeSelf() {
  5420. this.hide();
  5421. }
  5422. }
  5423. UIShop.uiName = "UIShop";
  5424. class ui_UISign extends fgui.GComponent {
  5425. static createInstance() {
  5426. return (fgui.UIPackage.createObject("game", "UISign"));
  5427. }
  5428. onConstruct() {
  5429. this.n6 = (this.getChild("n6"));
  5430. this.closeNode = (this.getChild("closeNode"));
  5431. this.myNode = (this.getChild("myNode"));
  5432. this.moneyNode = (this.getChild("moneyNode"));
  5433. this.secretary = (this.getChild("secretary"));
  5434. this.talkNode = (this.getChild("talkNode"));
  5435. this.tripleBtn = (this.getChild("tripleBtn"));
  5436. this.normalBtn = (this.getChild("normalBtn"));
  5437. this.tipsNode = (this.getChild("tipsNode"));
  5438. this.againBtn = (this.getChild("againBtn"));
  5439. this.t0 = this.getTransition("t0");
  5440. }
  5441. }
  5442. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5443. class SignMax {
  5444. constructor(ui) {
  5445. this.ui = ui;
  5446. }
  5447. updateSelf(index, sameDay, curDayIndex) {
  5448. let data = cfgTable.signData[index + 1];
  5449. this.ui.titleTxt.text = data.title;
  5450. let arr1 = data.award[0].split('-');
  5451. let arr2 = data.award[1].split('-');
  5452. let num1 = parseInt(arr1[1]);
  5453. let num2 = parseInt(arr2[1]);
  5454. this.ui.numTxt1.text = num1 + "";
  5455. this.ui.numTxt2.text = num2 + "";
  5456. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5457. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5458. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5459. this.ui.numTxt1.visible = false;
  5460. }
  5461. else {
  5462. this.ui.numTxt1.visible = true;
  5463. }
  5464. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5465. this.ui.numTxt2.visible = false;
  5466. }
  5467. else {
  5468. this.ui.numTxt2.visible = true;
  5469. }
  5470. if (index < curDayIndex) {
  5471. this.ui.c1.selectedIndex = 1;
  5472. }
  5473. else if (index == curDayIndex) {
  5474. if (sameDay) {
  5475. this.ui.c1.selectedIndex = 2;
  5476. }
  5477. else {
  5478. this.ui.c1.selectedIndex = 2;
  5479. }
  5480. }
  5481. else {
  5482. this.ui.c1.selectedIndex = 0;
  5483. }
  5484. }
  5485. }
  5486. class SignNormal {
  5487. constructor(ui) {
  5488. this.ui = ui;
  5489. }
  5490. updateSelf(index, sameDay, curDayIndex) {
  5491. let data = cfgTable.signData[index + 1];
  5492. this.ui.titleTxt.text = data.title;
  5493. let arr = data.award[0].split('-');
  5494. let type = parseInt(arr[0]);
  5495. let num = parseInt(arr[1]);
  5496. this.ui.numTxt.text = num + "";
  5497. if (type > 2) {
  5498. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5499. this.ui.myIcon.rotation = 0;
  5500. }
  5501. else {
  5502. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5503. this.ui.myIcon.rotation = 0;
  5504. }
  5505. if (xGame.common.signAwardContainsRod(data.award)) {
  5506. this.ui.numTxt.visible = false;
  5507. }
  5508. else {
  5509. this.ui.numTxt.visible = true;
  5510. }
  5511. if (index < curDayIndex) {
  5512. this.ui.c1.selectedIndex = 1;
  5513. }
  5514. else if (index == curDayIndex) {
  5515. if (sameDay) {
  5516. this.ui.c1.selectedIndex = 2;
  5517. }
  5518. else {
  5519. this.ui.c1.selectedIndex = 2;
  5520. }
  5521. }
  5522. else {
  5523. this.ui.c1.selectedIndex = 0;
  5524. }
  5525. }
  5526. }
  5527. class UISign extends UIBase {
  5528. constructor() {
  5529. super();
  5530. this.curDayIndex = 0;
  5531. this.starX = 0;
  5532. }
  5533. onConstructor() {
  5534. this.ui = ui_UISign.createInstance();
  5535. this.contentPane = this.ui;
  5536. this.isEject = false;
  5537. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5538. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5539. this.initSignItem();
  5540. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5541. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5542. }
  5543. show() {
  5544. super.show();
  5545. this.ui.t0.play();
  5546. this.playSecretaryIdle();
  5547. this.updateSign();
  5548. }
  5549. initSignItem() {
  5550. this.signArr = [];
  5551. for (let index = 0; index < 6; index++) {
  5552. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5553. this.signArr.push(temp);
  5554. }
  5555. this.signMax = new SignMax(this.ui.myNode.day7);
  5556. if (Moyu.isKs)
  5557. this.ui.closeNode.closeBtn.x += 100;
  5558. }
  5559. updateSign() {
  5560. let sameDay = xGame.common.judgeSameDay();
  5561. let max = 7;
  5562. this.curDayIndex = DataMgr.getSignData();
  5563. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5564. this.curDayIndex = 0;
  5565. if (!sameDay) {
  5566. this.ui.normalBtn.visible = true;
  5567. this.ui.tipsNode.visible = false;
  5568. this.ui.againBtn.visible = false;
  5569. }
  5570. else {
  5571. this.ui.normalBtn.visible = false;
  5572. let again = DataMgr.getExtraSign();
  5573. let isCurrency = false;
  5574. let index = this.curDayIndex;
  5575. if (index == 0)
  5576. index = 7;
  5577. let award = cfgTable.signData[index].award;
  5578. let num = award[0].split("-")[0];
  5579. if (num == "1" || num == "2")
  5580. isCurrency = true;
  5581. let showAgain = again == 0 && isCurrency;
  5582. this.ui.againBtn.visible = showAgain;
  5583. this.ui.tipsNode.visible = !showAgain;
  5584. }
  5585. for (let index = 0; index < this.signArr.length; index++) {
  5586. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5587. }
  5588. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5589. }
  5590. playSecretaryIdle() {
  5591. let parent = this.ui.secretary.displayObject;
  5592. parent.destroyChildren();
  5593. let xx = this.ui.secretary.width / 2;
  5594. let yy = this.ui.secretary.height;
  5595. let scale = xGame.common.getSecretaryScale();
  5596. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5597. xGame.common.secretary.play(data, 1, true, parent);
  5598. }
  5599. closeSelf() {
  5600. this.hide();
  5601. }
  5602. normalGetAward() {
  5603. let sameDay = xGame.common.judgeSameDay();
  5604. if (!sameDay) {
  5605. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5606. let temp;
  5607. let type;
  5608. let num;
  5609. let arr = [];
  5610. for (let index = 0; index < award.length; index++) {
  5611. temp = award[index].split("-");
  5612. type = parseInt(temp[0]);
  5613. num = parseInt(temp[1]);
  5614. let awardType = new AwardType();
  5615. awardType.num = num;
  5616. awardType.type = type;
  5617. arr.push(awardType);
  5618. }
  5619. xGame.common.getAward(arr, (watchVideo) => {
  5620. this.curDayIndex++;
  5621. if (this.curDayIndex > 7)
  5622. this.curDayIndex = 0;
  5623. DataMgr.setSignData(this.curDayIndex);
  5624. DataMgr.setSignTime(new Date().getTime());
  5625. if (watchVideo) {
  5626. DataMgr.setExtraSign(1);
  5627. Moyu.sendDataEvent("signIn1");
  5628. }
  5629. this.updateSign();
  5630. });
  5631. }
  5632. }
  5633. againGetAward() {
  5634. Moyu.sendDataEvent("signIn2");
  5635. Moyu.showVideoAd(() => {
  5636. let index = this.curDayIndex;
  5637. if (index == 0)
  5638. index = 7;
  5639. let award = cfgTable.signData[index].award;
  5640. let temp;
  5641. let type;
  5642. let num;
  5643. for (let index = 0; index < award.length; index++) {
  5644. temp = award[index].split("-");
  5645. type = parseInt(temp[0]);
  5646. num = parseInt(temp[1]) * 3;
  5647. xGame.common.playObjFlyAnim(num, type);
  5648. }
  5649. DataMgr.setExtraSign(1);
  5650. this.updateSign();
  5651. }, EAdType.againSign);
  5652. }
  5653. }
  5654. UISign.uiName = "UISign";
  5655. class ui_UISkill extends fgui.GComponent {
  5656. static createInstance() {
  5657. return (fgui.UIPackage.createObject("game", "UISkill"));
  5658. }
  5659. onConstruct() {
  5660. this.n48 = (this.getChild("n48"));
  5661. this.n0 = (this.getChild("n0"));
  5662. this.secretary = (this.getChild("secretary"));
  5663. this.talkNode = (this.getChild("talkNode"));
  5664. this.closeNode = (this.getChild("closeNode"));
  5665. this.moneyNode = (this.getChild("moneyNode"));
  5666. this.skillNode = (this.getChild("skillNode"));
  5667. this.guideNode = (this.getChild("guideNode"));
  5668. }
  5669. }
  5670. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5671. class SkillDisplay {
  5672. constructor(ui, data, uiIndex) {
  5673. this.starX = 0;
  5674. this.starY = 0;
  5675. this.index = 0;
  5676. this.ui = ui;
  5677. this.data = data;
  5678. this.index = uiIndex;
  5679. this.initSelf();
  5680. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5681. }
  5682. initSelf() {
  5683. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5684. this.ui.nameTxt.text = this.data.name;
  5685. this.ui.describeTxt.text = this.data.describe;
  5686. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5687. this.ui.startBtn.onClick(this, this.startGame);
  5688. this.updateSelf();
  5689. }
  5690. updateSelf() {
  5691. this.checkTry();
  5692. let level = DataMgr.getBigSkillByIndex(this.index);
  5693. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5694. }
  5695. checkTry() {
  5696. let index = this.index;
  5697. let level = DataMgr.getBigSkillByIndex(index);
  5698. if (level == null) {
  5699. DataMgr.setBigSkill(index, 1, false);
  5700. level = 1;
  5701. }
  5702. this.ui.levelTxt.text = "LV." + level;
  5703. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5704. this.ui.tryNode.visible = true;
  5705. else
  5706. this.ui.tryNode.visible = false;
  5707. }
  5708. clickAddLevel() {
  5709. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5710. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5711. Moyu.showVideoAd(() => {
  5712. DataMgr.setBigSkill(this.data.index, 1);
  5713. this.updateSelf();
  5714. xGame.common.upSkillLevel = true;
  5715. }, EAdType.upSkill);
  5716. }
  5717. startGame() {
  5718. if (this.data.index == 3) {
  5719. alert('Coming soon!');
  5720. return;
  5721. }
  5722. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5723. let needCoin = xGame.common.bigMoveNeedCoin;
  5724. xGame.common.passAwardCoin = 2000;
  5725. let guide = DataMgr.getSkillGuide();
  5726. console.log('zh:startGame guide=' + guide);
  5727. xGame.common.temSelfLevel = 0;
  5728. if (guide == 0) {
  5729. needCoin = 0;
  5730. xGame.common.temSelfLevel = 100;
  5731. }
  5732. if (DataMgr.coinEnough(needCoin)) {
  5733. DataMgr.setCoin(-needCoin);
  5734. xGame.common.curPlayerSkillType = this.index;
  5735. if (guide == 0)
  5736. xGame.common.curPlayerSkillType = 0;
  5737. xGame.uiMgr.Show(UIGame);
  5738. xGame.uiMgr.Hide(UIMain);
  5739. xGame.uiMgr.Show(UIMatching, () => {
  5740. xGame.common.gameUI.ui.alpha = 1;
  5741. xGame.common.gameUI.startGame();
  5742. xGame.uiMgr.Hide(UISkill);
  5743. });
  5744. }
  5745. else {
  5746. xGame.uiMgr.Show(UIAddProp, 0);
  5747. Moyu.sendDataEvent("AddCoinVideo");
  5748. }
  5749. }
  5750. }
  5751. class UISkill extends UIBase {
  5752. constructor() {
  5753. super();
  5754. this.skillData = [];
  5755. }
  5756. onConstructor() {
  5757. this.ui = ui_UISkill.createInstance();
  5758. this.contentPane = this.ui;
  5759. this.isEject = false;
  5760. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5761. this.initSkillData();
  5762. console.log('zh:aaaaaa1111111111');
  5763. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5764. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5765. console.log('zh:aaaaaa22222222');
  5766. this.displayList = [];
  5767. this.ui.skillNode.skillList.numItems = 3;
  5768. this.addUIClick(this.ui, this.interuptSecretary);
  5769. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5770. this.ui.talkNode.visible = false;
  5771. if (Moyu.isKs)
  5772. this.ui.closeNode.closeBtn.x += 100;
  5773. }
  5774. show() {
  5775. super.show();
  5776. this.playSecretaryIdle();
  5777. this.moneyNode.ui.c1.selectedIndex = 1;
  5778. Laya.timer.clearAll(this);
  5779. xGame.soundMgr.playSound("s_start");
  5780. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5781. let guide = DataMgr.getSkillGuide();
  5782. this.ui.guideNode.visible = guide == 0;
  5783. let item = this.getSkillItemByUIIndex(0);
  5784. if (guide == 0) {
  5785. item.ui.c1.selectedIndex = 1;
  5786. }
  5787. else {
  5788. item.ui.c1.selectedIndex = 0;
  5789. }
  5790. this.ui.guideNode.guideBtn.visible = guide == 0;
  5791. for (let index = 0; index < this.displayList.length; index++) {
  5792. this.displayList[index].checkTry();
  5793. }
  5794. }
  5795. getSkillItemByUIIndex(cur) {
  5796. for (let index = 0; index < this.displayList.length; index++) {
  5797. if (this.displayList[index].index == cur) {
  5798. return this.displayList[index];
  5799. }
  5800. }
  5801. }
  5802. enterGuideLevel() {
  5803. let item = this.getSkillItemByUIIndex(0);
  5804. item.startGame();
  5805. if (DataMgr.getNewUser())
  5806. Moyu.sendDataEvent("gameStart1");
  5807. }
  5808. initSkillData() {
  5809. this.skillData = [];
  5810. let nameList = xGame.common.skillNameList;
  5811. let iconList = xGame.common.skillIconList;
  5812. let describeList = [
  5813. "Jump shot executed — ball bounced and pocketed an extra one!",
  5814. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5815. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5816. ];
  5817. console.log('zh:initSkillData 111111111');
  5818. let data;
  5819. for (let index = 0; index < nameList.length; index++) {
  5820. data = {};
  5821. data.name = nameList[index];
  5822. data.icon = iconList[index];
  5823. data.describe = describeList[index];
  5824. data.index = index;
  5825. this.skillData.push(data);
  5826. }
  5827. }
  5828. updateSkillItem(index, target) {
  5829. if (this.displayList[index] == null) {
  5830. let uiIndex;
  5831. switch (index) {
  5832. case 0:
  5833. uiIndex = 1;
  5834. break;
  5835. case 1:
  5836. uiIndex = 0;
  5837. break;
  5838. case 2:
  5839. uiIndex = 2;
  5840. break;
  5841. case 3:
  5842. uiIndex = 3;
  5843. break;
  5844. default:
  5845. break;
  5846. }
  5847. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5848. this.displayList.push(temp);
  5849. }
  5850. }
  5851. playSecretaryIdle() {
  5852. let parent = this.ui.secretary.displayObject;
  5853. parent.destroyChildren();
  5854. let xx = this.ui.secretary.width / 2;
  5855. let yy = this.ui.secretary.height;
  5856. let scale = xGame.common.getSecretaryScale();
  5857. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5858. xGame.common.secretary.play(data, 1, true, parent);
  5859. }
  5860. returnUIMain() {
  5861. this.hide();
  5862. xGame.common.stopGirlPop(this.ui.talkNode);
  5863. xGame.uiMgr.Show(UIMain);
  5864. }
  5865. interuptSecretary() {
  5866. Laya.timer.clearAll(this);
  5867. this.playSecretaryRandomSound();
  5868. }
  5869. playSecretaryRandomSound() {
  5870. if (this.isHide)
  5871. return;
  5872. let time = xGame.common.randomNum(45000, 60000);
  5873. Laya.timer.once(time, this, () => {
  5874. if (this.isHide)
  5875. return;
  5876. let index = xGame.common.randomNum(4, 7);
  5877. xGame.soundMgr.playSound("s_main0" + index);
  5878. let words = 1;
  5879. switch (index) {
  5880. case 4:
  5881. words = 5;
  5882. break;
  5883. case 5:
  5884. words = 3;
  5885. break;
  5886. case 6:
  5887. words = 6;
  5888. break;
  5889. case 7:
  5890. words = 7;
  5891. break;
  5892. default:
  5893. break;
  5894. }
  5895. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5896. this.playSecretaryRandomSound();
  5897. });
  5898. }
  5899. }
  5900. UISkill.uiName = "UISkill";
  5901. class ui_UIMsg extends fgui.GComponent {
  5902. static createInstance() {
  5903. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5904. }
  5905. onConstruct() {
  5906. this.tipsNode = (this.getChild("tipsNode"));
  5907. }
  5908. }
  5909. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5910. class UIMsg extends UIBase {
  5911. constructor() {
  5912. super();
  5913. }
  5914. onConstructor() {
  5915. this.ui = ui_UIMsg.createInstance();
  5916. this.contentPane = this.ui;
  5917. this.isEject = false;
  5918. this.isMuti = true;
  5919. }
  5920. show(msg, callback) {
  5921. super.show();
  5922. this.ui.tipsNode.msgTxt.text = msg;
  5923. this.ui.alpha = 1;
  5924. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5925. this.hide();
  5926. callback && callback();
  5927. }), 1000);
  5928. }
  5929. }
  5930. UIMsg.uiName = "UIMsg";
  5931. class ui_UIModeSelection extends fgui.GComponent {
  5932. static createInstance() {
  5933. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5934. }
  5935. onConstruct() {
  5936. this.n19 = (this.getChild("n19"));
  5937. this.closeBtn = (this.getChild("closeBtn"));
  5938. this.myNode = (this.getChild("myNode"));
  5939. this.t0 = this.getTransition("t0");
  5940. }
  5941. }
  5942. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5943. class UIModeSelection extends UIBase {
  5944. constructor() {
  5945. super();
  5946. }
  5947. onConstructor() {
  5948. this.ui = ui_UIModeSelection.createInstance();
  5949. this.contentPane = this.ui;
  5950. this.isEject = false;
  5951. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5952. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5953. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5954. this.addUIClick(this.ui.closeBtn, this.hide);
  5955. this.peopleArr = [650, 6900, 3800];
  5956. this.peopleOffest = [50, 500, 200];
  5957. this.updateSelf();
  5958. }
  5959. show(callback) {
  5960. super.show();
  5961. this.ui.t0.play();
  5962. this.callback = callback;
  5963. }
  5964. updateSelf() {
  5965. let cfg = cfgTable.modeselectData;
  5966. for (let index = 1; index <= 3; index++) {
  5967. let node = this.ui.myNode["type" + index];
  5968. node.need.text = cfg[index].need;
  5969. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  5970. node.peopleTxt.text = this.getRandPeople(index - 1);
  5971. }
  5972. }
  5973. enterGame(type) {
  5974. xGame.common.classicRoomType = type;
  5975. let cfg = cfgTable.modeselectData[type];
  5976. let need = cfg.need;
  5977. xGame.common.passAwardCoin = cfg.award;
  5978. if (DataMgr.coinEnough(need)) {
  5979. DataMgr.setCoin(-need);
  5980. this.ui.myNode["type" + type].t0.play();
  5981. Laya.timer.once(200, this, () => {
  5982. this.callback && this.callback();
  5983. });
  5984. }
  5985. else {
  5986. Moyu.sendDataEvent("AddCoinVideo");
  5987. xGame.uiMgr.Show(UIAddProp, 0);
  5988. }
  5989. }
  5990. getRandPeople(index) {
  5991. let rand = this.peopleOffest[index];
  5992. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5993. }
  5994. }
  5995. UIModeSelection.uiName = "UIModeSelection";
  5996. class UIMain extends UIBase {
  5997. constructor() {
  5998. super();
  5999. this.firstEnter = true;
  6000. }
  6001. onConstructor() {
  6002. this.ui = ui_UIMain.createInstance();
  6003. this.contentPane = this.ui;
  6004. this.isEject = false;
  6005. this.addEvent();
  6006. this.addClickSpine();
  6007. this.settingNode = new SettingNode(this.ui.settingNode);
  6008. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6009. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6010. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6011. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6012. let curUse = DataMgr.getCurSecretary();
  6013. this.changeSecretary(curUse);
  6014. this.ui.talkNode.visible = false;
  6015. let guide = DataMgr.getSkillGuide();
  6016. if (xGame.common.isNewDay && guide == 1) {
  6017. xGame.common.isNewDay = false;
  6018. xGame.soundMgr.playSound("s_main01");
  6019. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6020. console.log("播放小秘书每天语音");
  6021. }
  6022. this.onGetUserInfo();
  6023. this.ui.n83.visible = false;
  6024. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6025. }
  6026. changeSecretary(curUse) {
  6027. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6028. xGame.common.secretary && xGame.common.secretary.dispose();
  6029. this.addSecretarySpine(name);
  6030. }
  6031. addSecretarySpine(name) {
  6032. let spine = new SpineMgr(name, () => {
  6033. this.playSecretaryIdle();
  6034. });
  6035. xGame.common.secretary = spine;
  6036. }
  6037. addClickSpine() {
  6038. let clickSpine = new SpineMgr("dianji", () => {
  6039. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6040. let parent = Laya.stage;
  6041. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6042. clickSpine.play(data, 0, false, parent, (spine) => {
  6043. spine.destroy(true);
  6044. });
  6045. });
  6046. });
  6047. }
  6048. addEvent() {
  6049. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6050. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6051. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6052. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6053. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6054. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6055. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6056. this.addUIClick(this.ui, this.interuptSecretary);
  6057. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6058. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6059. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6060. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6061. this.addUIClick(this.ui.signBtn, this.openSignView);
  6062. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6063. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6064. }
  6065. show(showFailWords) {
  6066. super.show();
  6067. this.moneyNode.ui.c1.selectedIndex = 1;
  6068. this.playSecretaryIdle();
  6069. xGame.soundMgr.playMusic("caromhall01");
  6070. Laya.timer.clearAll(this);
  6071. this.playSecretaryRandomSound();
  6072. if (showFailWords) {
  6073. setTimeout(() => {
  6074. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6075. let words = -1;
  6076. if (str == "s_main02") {
  6077. words = 2;
  6078. }
  6079. else {
  6080. words = 3;
  6081. }
  6082. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6083. xGame.soundMgr.playSound(str);
  6084. }, 300);
  6085. }
  6086. this.showGuide();
  6087. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6088. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6089. let guide = DataMgr.getSkillGuide();
  6090. if (guide == 1) {
  6091. let randTime = xGame.common.randomNum(300, 800);
  6092. if (this.firstEnter) {
  6093. this.firstEnter = false;
  6094. randTime += 900;
  6095. }
  6096. Laya.timer.once(randTime, this, () => {
  6097. xGame.common.autoPopUIView();
  6098. });
  6099. }
  6100. }
  6101. checkActive(show) {
  6102. }
  6103. showGuide() {
  6104. let guide = DataMgr.getSkillGuide();
  6105. this.ui.guideBtn.visible = guide == 0;
  6106. this.ui.enterGuide.visible = false;
  6107. this.ui.secretaryGuide.visible = guide == 0;
  6108. if (guide == 0) {
  6109. xGame.soundMgr.playSound("s_guide");
  6110. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6111. }
  6112. }
  6113. ensureSecretary() {
  6114. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6115. this.ui.secretaryGuide.visible = false;
  6116. this.ui.enterGuide.visible = true;
  6117. this.ui.wordsNode.t0.play();
  6118. if (DataMgr.getNewUser())
  6119. Moyu.sendDataEvent("gameReady");
  6120. }
  6121. playSecretaryIdle() {
  6122. let parent = this.ui.secretary.displayObject;
  6123. parent.destroyChildren();
  6124. let xx = this.ui.secretary.width / 2;
  6125. let yy = this.ui.secretary.height;
  6126. let scale = xGame.common.getSecretaryScale();
  6127. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6128. xGame.common.secretary.play(data, 1, true, parent);
  6129. }
  6130. startGame(type) {
  6131. xGame.common.gameMode = type;
  6132. Moyu.sendDataEvent("PlayGame", { type: type });
  6133. switch (xGame.common.gameMode) {
  6134. case GameMode.classic:
  6135. let challengeTimes = DataMgr.getChallengeTimes();
  6136. if (challengeTimes == 0) {
  6137. xGame.uiMgr.Show(UIInvitation);
  6138. }
  6139. else {
  6140. this.beginGame();
  6141. }
  6142. break;
  6143. case GameMode.bigMove:
  6144. this.beginGame();
  6145. if (DataMgr.getNewUser())
  6146. Moyu.sendDataEvent("gameStart0");
  6147. break;
  6148. default:
  6149. break;
  6150. }
  6151. }
  6152. beginGame(isNice = false) {
  6153. if (xGame.common.gameMode == GameMode.classic) {
  6154. if (isNice) {
  6155. this.enterClassic();
  6156. }
  6157. else {
  6158. xGame.uiMgr.Show(UIModeSelection, () => {
  6159. this.enterClassic();
  6160. });
  6161. }
  6162. }
  6163. else if (xGame.common.gameMode == GameMode.bigMove) {
  6164. this.ui.enterGuide.visible = false;
  6165. xGame.uiMgr.Show(UISkill);
  6166. }
  6167. }
  6168. enterClassic() {
  6169. xGame.uiMgr.Show(UIGame);
  6170. xGame.uiMgr.Show(UIMatching, () => {
  6171. if (!this.isHide)
  6172. this.hide();
  6173. xGame.common.gameUI.ui.alpha = 1;
  6174. xGame.common.gameUI.startGame();
  6175. xGame.uiMgr.Hide(UIGameEnd);
  6176. });
  6177. }
  6178. startGlobal() {
  6179. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6180. }
  6181. startWeekly() {
  6182. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6183. }
  6184. startPlaceBall() {
  6185. xGame.uiMgr.Show(UILevelDisplay);
  6186. }
  6187. hide() {
  6188. super.hide();
  6189. xGame.common.stopGirlPop(this.ui.talkNode);
  6190. }
  6191. onGetUserInfo(force = false) {
  6192. if (Moyu.isWx) {
  6193. let info = Moyu.getSystemInfo();
  6194. if (info)
  6195. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6196. }
  6197. else {
  6198. Moyu.initUser(this, this.freshUser, force);
  6199. }
  6200. if (!Moyu.hasUserInfo) {
  6201. let user = Moyu.getUserInfo();
  6202. user.headIcon = 'res/ty_touxiang.png';
  6203. }
  6204. this.freshUser();
  6205. }
  6206. freshUser() {
  6207. let user = Moyu.getUserInfo();
  6208. if (!user.isAuth) {
  6209. user.headIcon = 'res/ty_touxiang.png';
  6210. }
  6211. else
  6212. DataMgr.upRankData();
  6213. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6214. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6215. }
  6216. interuptSecretary() {
  6217. Laya.timer.clearAll(this);
  6218. this.playSecretaryRandomSound();
  6219. }
  6220. playSecretaryRandomSound() {
  6221. if (this.isHide)
  6222. return;
  6223. let time = xGame.common.randomNum(45000, 60000);
  6224. Laya.timer.once(time, this, () => {
  6225. if (this.isHide)
  6226. return;
  6227. let index = xGame.common.randomNum(4, 7);
  6228. xGame.soundMgr.playSound("s_main0" + index);
  6229. let words = 1;
  6230. switch (index) {
  6231. case 4:
  6232. words = 5;
  6233. break;
  6234. case 5:
  6235. words = 3;
  6236. break;
  6237. case 6:
  6238. words = 6;
  6239. break;
  6240. case 7:
  6241. words = 7;
  6242. break;
  6243. default:
  6244. break;
  6245. }
  6246. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6247. this.playSecretaryRandomSound();
  6248. });
  6249. }
  6250. openSecretaryView() {
  6251. xGame.uiMgr.Show(UISecretary);
  6252. Moyu.sendDataEvent("secretary");
  6253. }
  6254. openShopView() {
  6255. xGame.uiMgr.Show(UIShop);
  6256. }
  6257. openSignView() {
  6258. xGame.uiMgr.Show(UISign);
  6259. }
  6260. openDrawView() {
  6261. xGame.uiMgr.Show(UIDraw);
  6262. }
  6263. openRanking() {
  6264. xGame.uiMgr.Show(UIRanking);
  6265. Moyu.sendDataEvent("rankingList");
  6266. }
  6267. }
  6268. UIMain.uiName = "UIMain";
  6269. class UIGameEnd extends UIBase {
  6270. constructor() {
  6271. super();
  6272. this.success = false;
  6273. this.awardCoinNum = 1000;
  6274. this.awardDiamondNum = 10;
  6275. }
  6276. onConstructor() {
  6277. this.ui = ui_UIGameEnd.createInstance();
  6278. this.contentPane = this.ui;
  6279. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6280. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6281. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6282. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6283. this.ui.talkNode.visible = false;
  6284. if (Moyu.isKs)
  6285. this.ui.closeNode.closeBtn.x += 100;
  6286. }
  6287. updateType() {
  6288. switch (xGame.common.gameMode) {
  6289. case GameMode.classic:
  6290. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6291. this.ui.coinNode.visible = this.success;
  6292. if (!this.success) {
  6293. Laya.timer.once(500, this, () => {
  6294. xGame.uiMgr.Show(UIAddCoin);
  6295. });
  6296. }
  6297. this.ui.isGetAward.visible = false;
  6298. this.ui.leftBtn.c1.selectedIndex = 3;
  6299. this.ui.rightBtn.c1.selectedIndex = 0;
  6300. this.moneyNode.ui.c1.selectedIndex = 1;
  6301. break;
  6302. case GameMode.bigMove:
  6303. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6304. this.ui.coinNode.visible = this.success;
  6305. if (xGame.common.gameMode == GameMode.bigMove) {
  6306. if (this.success) {
  6307. DataMgr.setSkillSuccessTimes(1, true);
  6308. DataMgr.setSkillAccTimes(1);
  6309. }
  6310. else {
  6311. DataMgr.setSkillSuccessTimes(0, false);
  6312. }
  6313. }
  6314. if (!this.success) {
  6315. Laya.timer.once(500, this, () => {
  6316. xGame.uiMgr.Show(UIAddCoin);
  6317. });
  6318. }
  6319. this.ui.isGetAward.visible = false;
  6320. this.ui.leftBtn.c1.selectedIndex = 3;
  6321. this.ui.rightBtn.c1.selectedIndex = 0;
  6322. this.moneyNode.ui.c1.selectedIndex = 1;
  6323. break;
  6324. case GameMode.placeBall:
  6325. this.ui.coinNode.visible = false;
  6326. if (this.success) {
  6327. if (xGame.common.placeBallStarNum == 3) {
  6328. this.ui.c1.selectedIndex = 2;
  6329. }
  6330. else {
  6331. this.ui.c1.selectedIndex = 3;
  6332. }
  6333. }
  6334. else {
  6335. this.ui.c1.selectedIndex = 4;
  6336. }
  6337. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6338. if (cfg.type == PlaceBallType.challenge) {
  6339. this.ui.c1.selectedIndex = 2;
  6340. }
  6341. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6342. this.updatePlaceBallBtn();
  6343. this.updatePlaceBallStarNum();
  6344. this.updatePlaceBallAwardState();
  6345. this.moneyNode.ui.c1.selectedIndex = 2;
  6346. this.moneyNode.checkPowerTime();
  6347. this.moneyNode.powerChange();
  6348. DataMgr.upRankData();
  6349. break;
  6350. default:
  6351. break;
  6352. }
  6353. }
  6354. updatePlaceBallBtn() {
  6355. this.ui.leftBtn.c1.selectedIndex = 5;
  6356. if (this.success) {
  6357. this.ui.rightBtn.c1.selectedIndex = 14;
  6358. }
  6359. else {
  6360. if (xGame.common.placeBallStarNum == 3) {
  6361. this.ui.rightBtn.c1.selectedIndex = 14;
  6362. }
  6363. else {
  6364. this.ui.rightBtn.c1.selectedIndex = 1;
  6365. }
  6366. }
  6367. }
  6368. updatePlaceBallStarNum() {
  6369. let starNum = xGame.common.placeBallStarNum;
  6370. if (starNum == 0)
  6371. this.ui.starNumNode.c1.selectedIndex = 3;
  6372. else {
  6373. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6374. }
  6375. }
  6376. updatePlaceBallAwardState() {
  6377. let level = xGame.common.placeBallCurLevel;
  6378. let starNum = xGame.common.placeBallStarNum;
  6379. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6380. let data = cfgTable.placeballData[level].award;
  6381. let cfg = cfgTable.placeballData[level];
  6382. this.awardDiamondNum = data[1];
  6383. this.awardCoinNum = data[0];
  6384. if (cfg.type == PlaceBallType.challenge) {
  6385. this.awardDiamondNum = 0;
  6386. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6387. }
  6388. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6389. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6390. if (cfg.type == PlaceBallType.challenge) {
  6391. this.ui.awardNode.coinNode.visible = true;
  6392. }
  6393. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6394. this.ui.awardNode.diamondNode.x = 265;
  6395. this.ui.awardNode.coinNode.x = 354;
  6396. }
  6397. else {
  6398. this.ui.awardNode.diamondNode.x = 291;
  6399. this.ui.awardNode.coinNode.x = 291;
  6400. }
  6401. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6402. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6403. if (this.awardCoinNum == 0) {
  6404. this.ui.awardNode.coinNode.numTxt.text = "";
  6405. }
  6406. if (getAward) {
  6407. this.ui.isGetAward.visible = true;
  6408. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6409. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6410. }
  6411. else {
  6412. this.ui.isGetAward.visible = false;
  6413. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6414. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6415. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6416. }
  6417. else {
  6418. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6419. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6420. }
  6421. }
  6422. }
  6423. show(success) {
  6424. super.show();
  6425. xGame.eventMgr.event(RESET_GAME);
  6426. this.success = success;
  6427. Laya.timer.clearAll(this);
  6428. this.playSecretaryAni();
  6429. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6430. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6431. offsetTime = Math.floor(offsetTime / 1000);
  6432. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6433. this.updateType();
  6434. Laya.timer.once(200, this, () => {
  6435. this.addAward(() => {
  6436. this.updateType();
  6437. Laya.timer.once(500, this, () => {
  6438. this.showChallengeLevel();
  6439. });
  6440. });
  6441. });
  6442. if (this.success) {
  6443. xGame.soundMgr.playSound('slots_roll01');
  6444. xGame.soundMgr.playSound("s_win");
  6445. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6446. }
  6447. else {
  6448. xGame.soundMgr.playSound('matchwin01');
  6449. xGame.soundMgr.playSound("s_lose");
  6450. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6451. }
  6452. if (!Moyu.isLegal)
  6453. PlatMgr.showBanner(true);
  6454. let challengeNum = DataMgr.getChallengeTimes();
  6455. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6456. DataMgr.setChallengeTimes(1);
  6457. }
  6458. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6459. DataMgr.setClassicTimes();
  6460. }
  6461. }
  6462. showChallengeLevel() {
  6463. if (DataMgr.getChallengeTimes() != 0)
  6464. return;
  6465. let skill = DataMgr.getSkillAccTimes();
  6466. let put = DataMgr.getPlaceBallLevelList().length;
  6467. if (skill >= 3 || put >= 5) {
  6468. xGame.uiMgr.Show(UIInvitation);
  6469. this.hide();
  6470. }
  6471. }
  6472. addAward(callback) {
  6473. if (!this.success) {
  6474. callback && callback();
  6475. return;
  6476. }
  6477. switch (xGame.common.gameMode) {
  6478. case GameMode.classic:
  6479. this.awardCoinNum = xGame.common.passAwardCoin;
  6480. this.awardDiamondNum = 0;
  6481. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6482. break;
  6483. case GameMode.bigMove:
  6484. this.awardCoinNum = xGame.common.passAwardCoin;
  6485. this.awardDiamondNum = 0;
  6486. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6487. callback && callback();
  6488. break;
  6489. case GameMode.placeBall:
  6490. let level = xGame.common.placeBallCurLevel;
  6491. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6492. if (xGame.common.placeBallStarNum != 3) {
  6493. callback && callback();
  6494. return;
  6495. }
  6496. else {
  6497. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6498. if (getAward) {
  6499. callback && callback();
  6500. return;
  6501. }
  6502. }
  6503. let cfg = cfgTable.placeballData[level];
  6504. let data = cfgTable.placeballData[level].award;
  6505. this.awardCoinNum = data[0];
  6506. this.awardDiamondNum = data[1];
  6507. if (cfg.type == PlaceBallType.challenge) {
  6508. this.awardDiamondNum = 0;
  6509. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6510. }
  6511. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6512. let diamondAward;
  6513. if (this.awardDiamondNum > 0) {
  6514. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6515. xGame.common.getAward([diamondAward, coinAward], callback);
  6516. }
  6517. else {
  6518. xGame.common.getAward([coinAward], callback);
  6519. }
  6520. if (cfg.type == PlaceBallType.normal) {
  6521. DataMgr.setPlaceBallAward(level);
  6522. }
  6523. break;
  6524. default:
  6525. break;
  6526. }
  6527. }
  6528. playSecretaryAni() {
  6529. let parent = this.ui.secretary.displayObject;
  6530. parent.destroyChildren();
  6531. let xx = this.ui.secretary.width / 2;
  6532. let yy = this.ui.secretary.height;
  6533. let scale = xGame.common.getSecretaryScale();
  6534. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6535. if (this.success) {
  6536. let rand = Math.random() <= 0.5 ? 2 : 3;
  6537. xGame.common.secretary.play(data, rand, false, parent, () => {
  6538. xGame.common.secretary.play(data, 1, true, parent);
  6539. });
  6540. }
  6541. else {
  6542. xGame.common.secretary.play(data, 0, true, parent);
  6543. }
  6544. }
  6545. restartGame() {
  6546. switch (xGame.common.gameMode) {
  6547. case GameMode.classic:
  6548. xGame.eventMgr.event(RESTART_GAME);
  6549. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6550. break;
  6551. case GameMode.bigMove:
  6552. this.hide();
  6553. xGame.eventMgr.event(RESTART_GAME);
  6554. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6555. break;
  6556. default:
  6557. break;
  6558. }
  6559. }
  6560. hide() {
  6561. super.hide();
  6562. xGame.common.stopGirlPop(this.ui.talkNode);
  6563. PlatMgr.showBanner(false);
  6564. }
  6565. returnHome() {
  6566. this.hide();
  6567. let showFailWords = !this.success;
  6568. xGame.uiMgr.Show(UIMain, showFailWords);
  6569. }
  6570. clickLeftBtn() {
  6571. switch (xGame.common.gameMode) {
  6572. case GameMode.classic:
  6573. case GameMode.bigMove:
  6574. this.returnHome();
  6575. break;
  6576. case GameMode.placeBall:
  6577. let level = xGame.common.placeBallCurLevel;
  6578. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6579. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6580. break;
  6581. default:
  6582. break;
  6583. }
  6584. }
  6585. powerStartPlaceBallLevel(level, btn) {
  6586. if (DataMgr.powerEnough()) {
  6587. btn.touchable = false;
  6588. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6589. btn.touchable = true;
  6590. DataMgr.setPower(-1);
  6591. xGame.eventMgr.event(POWER_TIME);
  6592. this.startPlaceBallLevel(level);
  6593. }));
  6594. }
  6595. else {
  6596. xGame.uiMgr.Show(UIPower, 0);
  6597. }
  6598. }
  6599. clickRightBtn() {
  6600. switch (xGame.common.gameMode) {
  6601. case GameMode.classic:
  6602. console.log('zh:clickRightBtn 111');
  6603. case GameMode.bigMove:
  6604. console.log('zh:clickRightBtn 222');
  6605. this.restartGame();
  6606. break;
  6607. case GameMode.placeBall:
  6608. console.log('zh:clickRightBtn 333');
  6609. let level = xGame.common.placeBallCurLevel;
  6610. let data = DataMgr.getPlaceBallLevel(level);
  6611. let curPss = data.play && !data.isCur;
  6612. if (curPss) {
  6613. console.log('zh:clickRightBtn 333-111');
  6614. console.log('zh:当前LV=' + level);
  6615. if (level == 60) {
  6616. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  6617. Laya.timer.once(3000, this, () => {
  6618. this.returnHome();
  6619. });
  6620. }
  6621. else {
  6622. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6623. }
  6624. }
  6625. else {
  6626. console.log('zh:clickRightBtn 333-000');
  6627. Moyu.sendDataEvent("placeBallNextLevel");
  6628. Moyu.showVideoAd(() => {
  6629. DataMgr.setPlaceBallLevel(level, 1);
  6630. this.startPlaceBallLevel(level + 1);
  6631. }, xGame.define.EAdType.placeBallNextLevel);
  6632. }
  6633. break;
  6634. default:
  6635. console.log('zh:clickRightBtn 444');
  6636. break;
  6637. }
  6638. }
  6639. startPlaceBallLevel(level) {
  6640. xGame.common.gameMode = GameMode.placeBall;
  6641. xGame.common.placeBallCurLevel = level;
  6642. xGame.uiMgr.Show(UIGame);
  6643. this.hide();
  6644. }
  6645. }
  6646. UIGameEnd.uiName = "UIGameEnd";
  6647. class ui_UIRepentProp extends fgui.GComponent {
  6648. static createInstance() {
  6649. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6650. }
  6651. onConstruct() {
  6652. this.c1 = this.getController("c1");
  6653. this.n11 = (this.getChild("n11"));
  6654. this.regretNode = (this.getChild("regretNode"));
  6655. this.helpLineNode = (this.getChild("helpLineNode"));
  6656. this.t0 = this.getTransition("t0");
  6657. }
  6658. }
  6659. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6660. class UIRepentProp extends UIBase {
  6661. constructor() {
  6662. super();
  6663. this.viewType = 0;
  6664. this.regretType = 0;
  6665. }
  6666. onConstructor() {
  6667. this.ui = ui_UIRepentProp.createInstance();
  6668. this.contentPane = this.ui;
  6669. this.isEject = false;
  6670. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6671. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6672. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6673. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6674. }
  6675. show(viewType, regretType, callback) {
  6676. PlatMgr.showInsert(true);
  6677. this.viewType = viewType;
  6678. this.regretType = regretType;
  6679. this.callback = callback;
  6680. super.show();
  6681. this.ui.t0.play();
  6682. this.ui.c1.selectedIndex = this.viewType;
  6683. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6684. if (this.viewType == 0) {
  6685. let guide = DataMgr.getGuideHelpLine();
  6686. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6687. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6688. }
  6689. xGame.common.gameMgr.gamePause = true;
  6690. }
  6691. hideSelf() {
  6692. xGame.common.gameMgr.gamePause = false;
  6693. this.callback && this.callback(false);
  6694. this.hide();
  6695. }
  6696. videoRegret() {
  6697. Moyu.showVideoAd(() => {
  6698. this.callback && this.callback(true);
  6699. this.hideSelf();
  6700. }, EAdType.regretBall);
  6701. }
  6702. videoAddHelpLine() {
  6703. let guide = DataMgr.getGuideHelpLine();
  6704. if (guide == 0) {
  6705. this.callback && this.callback(true);
  6706. this.hideSelf();
  6707. DataMgr.setGuideHelpLine();
  6708. xGame.common.gameUI.ui.guideNode.visible = false;
  6709. }
  6710. else {
  6711. Moyu.showVideoAd(() => {
  6712. this.callback && this.callback(true);
  6713. this.hideSelf();
  6714. }, EAdType.longHelpLine);
  6715. }
  6716. }
  6717. }
  6718. UIRepentProp.uiName = "UIRepentProp";
  6719. class ui_UIVideoShare extends fgui.GComponent {
  6720. static createInstance() {
  6721. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6722. }
  6723. onConstruct() {
  6724. this.n10 = (this.getChild("n10"));
  6725. this.myNode = (this.getChild("myNode"));
  6726. this.t0 = this.getTransition("t0");
  6727. }
  6728. }
  6729. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6730. class UIVideoShare extends UIBase {
  6731. constructor() {
  6732. super();
  6733. this.success = false;
  6734. this.awardNum = 0;
  6735. this.isShared = true;
  6736. }
  6737. onConstructor() {
  6738. this.ui = ui_UIVideoShare.createInstance();
  6739. this.contentPane = this.ui;
  6740. this.isEject = false;
  6741. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6742. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6743. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6744. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6745. }
  6746. show(success) {
  6747. super.show();
  6748. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6749. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6750. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6751. this.success = success;
  6752. let time = xGame.common.randomNum(600, 1500);
  6753. Moyu.showInsertAd(time, 60000);
  6754. if (success)
  6755. xGame.soundMgr.playSound("applause");
  6756. this.ui.t0.play();
  6757. this.checkShareState();
  6758. let times = DataMgr.getDailyVideoShareTimes();
  6759. this.awardNum = times == 0 ? 2000 : 200;
  6760. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6761. }
  6762. checkShareState() {
  6763. if (PlatMgr.forceShare == 0) {
  6764. this.ui.myNode.closeBtn.visible = true;
  6765. this.ui.myNode.tipsNode.visible = false;
  6766. this.ui.myNode.closeBtn.x = 90;
  6767. this.ui.myNode.shareBtn.x = 342;
  6768. }
  6769. else if (PlatMgr.forceShare == 1) {
  6770. this.ui.myNode.closeBtn.visible = false;
  6771. this.ui.myNode.tipsNode.visible = true;
  6772. this.ui.myNode.shareBtn.x = 218;
  6773. this.isShared = true;
  6774. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6775. }
  6776. }
  6777. checkForceShare() {
  6778. this.isShared = !this.isShared;
  6779. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6780. }
  6781. videoShare() {
  6782. if (PlatMgr.forceShare == 1) {
  6783. if (this.isShared) {
  6784. this.shareGame();
  6785. }
  6786. else {
  6787. this.hideSelf();
  6788. }
  6789. }
  6790. else {
  6791. this.shareGame();
  6792. }
  6793. }
  6794. shareGame() {
  6795. Moyu.sendDataEvent("VideoShare");
  6796. if (Moyu.canShare() > 100) {
  6797. Moyu.shareGame((success) => {
  6798. if (success) {
  6799. DataMgr.setDailyVideoShareTimes(1);
  6800. DataMgr.setCoin(this.awardNum);
  6801. }
  6802. this.hideSelf();
  6803. }, this);
  6804. }
  6805. else {
  6806. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6807. this.hideSelf();
  6808. }
  6809. }
  6810. hideSelf() {
  6811. this.hide();
  6812. xGame.uiMgr.Show(UIGameEnd, this.success);
  6813. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6814. xGame.common.screenImg.destroy();
  6815. xGame.common.screenImg = null;
  6816. }
  6817. }
  6818. }
  6819. UIVideoShare.uiName = "UIVideoShare";
  6820. class ui_UITips extends fgui.GComponent {
  6821. static createInstance() {
  6822. return (fgui.UIPackage.createObject("game", "UITips"));
  6823. }
  6824. onConstruct() {
  6825. this.n0 = (this.getChild("n0"));
  6826. this.myNode = (this.getChild("myNode"));
  6827. this.t0 = this.getTransition("t0");
  6828. }
  6829. }
  6830. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6831. class UITips extends UIBase {
  6832. constructor() {
  6833. super();
  6834. this.type = 0;
  6835. }
  6836. onConstructor() {
  6837. this.ui = ui_UITips.createInstance();
  6838. this.contentPane = this.ui;
  6839. this.isEject = false;
  6840. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  6841. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  6842. }
  6843. show(tipsTxt, womanTxt, type) {
  6844. super.show();
  6845. this.ui.t0.play();
  6846. this.ui.myNode.tipsTxt.text = tipsTxt;
  6847. this.ui.myNode.womanTxt.text = womanTxt;
  6848. PlatMgr.showInsert(true);
  6849. this.ui.myNode.c1.selectedIndex = type;
  6850. this.type = type;
  6851. switch (this.type) {
  6852. case TipsType.exitGame:
  6853. xGame.common.gameMgr.gamePause = true;
  6854. break;
  6855. case TipsType.foul:
  6856. Laya.timer.once(200, this, () => {
  6857. xGame.common.gameMgr.gamePause = true;
  6858. });
  6859. break;
  6860. default:
  6861. break;
  6862. }
  6863. }
  6864. clickLeftBtn() {
  6865. this.hide();
  6866. xGame.common.gameMgr.gamePause = false;
  6867. switch (this.type) {
  6868. case TipsType.exitGame:
  6869. break;
  6870. case TipsType.foul:
  6871. break;
  6872. default:
  6873. break;
  6874. }
  6875. }
  6876. clickRightBtn() {
  6877. this.hide();
  6878. switch (this.type) {
  6879. case TipsType.exitGame:
  6880. xGame.eventMgr.event(RESET_GAME);
  6881. xGame.uiMgr.Show(UIMain);
  6882. Moyu.recordEnd(this, null);
  6883. xGame.common.longHelpLine = false;
  6884. break;
  6885. case TipsType.foul:
  6886. xGame.common.gameMgr.gamePause = false;
  6887. Laya.timer.clearAll(this);
  6888. break;
  6889. default:
  6890. break;
  6891. }
  6892. }
  6893. }
  6894. UITips.uiName = "UITips";
  6895. class GameMgr {
  6896. constructor() {
  6897. this.selfCamp = "";
  6898. this.selfFoulNum = 0;
  6899. this.selfBallArr = [];
  6900. this.selfTimer = 0;
  6901. this.selfScore = 0;
  6902. this.aiCamp = "";
  6903. this.aiFoulNum = 0;
  6904. this.aiBallArr = [];
  6905. this.aiTimer = 0;
  6906. this.aiScore = 0;
  6907. this.aiSkillLevelNum = 1;
  6908. this.targertScore = 0;
  6909. this.setTime = 30;
  6910. this.selfTurnRate = 0.5;
  6911. this.accTime = 0;
  6912. this.curFoul = "";
  6913. this.maxFoulTimes = 3;
  6914. this.isFirstInGame = true;
  6915. this.firstColliObj = null;
  6916. this.inHoleBalls = [];
  6917. this.blackNum = 8;
  6918. this.success = false;
  6919. this.holePosList = [];
  6920. this.posObj = {};
  6921. this._selfTurn = false;
  6922. this.lastRootBallPos = new Laya.Vector2(311, 430);
  6923. this.ensureBallType = false;
  6924. this.isOpenBall = true;
  6925. this.finishOneShoot = true;
  6926. this.isEnd = false;
  6927. this.isChangeTurn = false;
  6928. this.isInterrupt = false;
  6929. this.aiPlayedBreakArmy = false;
  6930. this.isTouchedBall = false;
  6931. this.finishBalls = 0;
  6932. this.needBalls = 0;
  6933. this.allBallNum = 0;
  6934. this.placeBallPosData = {};
  6935. this.curHP = 0;
  6936. this.showLongView = false;
  6937. this.firstShoot = true;
  6938. this._gamePause = false;
  6939. this.trunCount = 0;
  6940. this.isBlackInHole = false;
  6941. this.isEnter = true;
  6942. xGame.eventMgr.offAll(ALL_BALL_STOP);
  6943. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  6944. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  6945. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  6946. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  6947. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  6948. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  6949. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  6950. }
  6951. get gamePause() {
  6952. return this._gamePause;
  6953. }
  6954. set gamePause(v) {
  6955. if (v) {
  6956. Laya.physicsTimer.pause();
  6957. }
  6958. else {
  6959. Laya.physicsTimer.resume();
  6960. }
  6961. this._gamePause = v;
  6962. }
  6963. get selfTurn() {
  6964. return this._selfTurn;
  6965. }
  6966. set selfTurn(val) {
  6967. this.trunCount++;
  6968. this._selfTurn = val;
  6969. if (val) {
  6970. xGame.common.d2World.d2Gan.ui.self.visible = true;
  6971. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  6972. }
  6973. else {
  6974. xGame.common.d2World.d2Gan.ui.self.visible = false;
  6975. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  6976. if (this.trunCount > 1)
  6977. PlatMgr.openBox();
  6978. }
  6979. }
  6980. resetGame() {
  6981. this.inHoleBalls = [];
  6982. this.isFirstInGame = true;
  6983. this.firstColliObj = null;
  6984. this.aiCamp = "";
  6985. this.selfCamp = "";
  6986. this.aiFoulNum = 0;
  6987. this.selfFoulNum = 0;
  6988. this.selfBallArr = [];
  6989. this.aiBallArr = [];
  6990. this.gamePause = false;
  6991. this.ensureBallType = false;
  6992. this.isInterrupt = false;
  6993. this.updateLeftBall();
  6994. this.clearTime();
  6995. this.aiPlayedBreakArmy = false;
  6996. this.isBlackInHole = false;
  6997. this.placeBallPosData = {};
  6998. if (xGame.common.d3World.knifeRoot) {
  6999. xGame.common.d3World.knifeRoot.destroyChildren();
  7000. }
  7001. }
  7002. gameReady() {
  7003. this.trunCount = 0;
  7004. this.firstColliObj = null;
  7005. this.isFirstInGame = true;
  7006. this.selfTurn = Math.random() <= this.selfTurnRate;
  7007. let challengeNum = DataMgr.getChallengeTimes();
  7008. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7009. this.selfTurn = true;
  7010. }
  7011. if (xGame.common.gameMode == GameMode.placeBall)
  7012. this.selfTurn = true;
  7013. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7014. this.selfTurn = true;
  7015. }
  7016. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7017. this.checkGuide();
  7018. if (xGame.common.uiRodMethod)
  7019. xGame.common.uiRodMethod.resetRod();
  7020. xGame.common.d2World.getHelpLine();
  7021. this.isOpenBall = true;
  7022. this.isTouchedBall = false;
  7023. xGame.common.aiPlayer.stopRun();
  7024. this.setTime = 30;
  7025. let ui = xGame.common.gameUI.ui;
  7026. switch (xGame.common.gameMode) {
  7027. case GameMode.classic:
  7028. xGame.common.aiPlayer.init();
  7029. this.blackNum = 8;
  7030. this.placeRootBall();
  7031. this.peoplePlay(9, 10);
  7032. ui.wordsBtn.visible = true;
  7033. ui.aiWordsBtn.visible = true;
  7034. xGame.common.talkMgr.changeAIState(true);
  7035. DataMgr.gameData.gameCount++;
  7036. DataMgr.saveGameData();
  7037. break;
  7038. case GameMode.bigMove:
  7039. this.blackNum = -1;
  7040. this.selfScore = 0;
  7041. this.aiScore = 0;
  7042. xGame.common.aiPlayer.init();
  7043. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7044. this.updateSelfScore();
  7045. this.updateAIScore();
  7046. this.updateTargetSroce();
  7047. this.placeRootBall();
  7048. this.peoplePlay(9, 10);
  7049. ui.wordsBtn.visible = true;
  7050. ui.aiWordsBtn.visible = true;
  7051. xGame.common.talkMgr.changeAIState(true);
  7052. if (DataMgr.getSkillGuide() < 1)
  7053. DataMgr.gameData.gameCount = 0;
  7054. else {
  7055. DataMgr.gameData.gameCount++;
  7056. DataMgr.saveGameData();
  7057. PlatMgr.openTry();
  7058. }
  7059. if (xGame.common.d3World.knifeRoot) {
  7060. xGame.common.d3World.knifeRoot.destroyChildren();
  7061. }
  7062. break;
  7063. case GameMode.placeBall:
  7064. this.blackNum = -1;
  7065. this.selfTurn = true;
  7066. this.setTime = 10000;
  7067. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7068. this.curHP = this.placeBallData.hp;
  7069. if (this.placeBallData.ball == -1)
  7070. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7071. else
  7072. this.needBalls = this.placeBallData.ball;
  7073. console.log("需要的进球数目", this.needBalls);
  7074. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7075. this.finishBalls = 0;
  7076. this.placeBallPosData = {};
  7077. this.updatePlaceBallPos();
  7078. this.updatePlaceBallState();
  7079. this.finishOneShoot = true;
  7080. xGame.common.gameUI.ui.moveNode.visible = false;
  7081. this.isOpenBall = false;
  7082. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7083. ui.wordsBtn.visible = false;
  7084. ui.aiWordsBtn.visible = false;
  7085. xGame.common.talkMgr.changeAIState(false);
  7086. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7087. PlatMgr.openBox();
  7088. });
  7089. break;
  7090. default:
  7091. break;
  7092. }
  7093. this.showLongView = false;
  7094. xGame.common.wordsMgr.comboTimes = 1;
  7095. let guide = DataMgr.getSkillGuide();
  7096. if (guide)
  7097. xGame.eventMgr.event(WAIT_SHOOT);
  7098. xGame.common.upSkillLevel = false;
  7099. xGame.common.gameStartTime = new Date().getTime();
  7100. this.firstShoot = true;
  7101. }
  7102. checkGuide() {
  7103. let guide = DataMgr.getSkillGuide();
  7104. let gameUI = xGame.common.gameUI.ui;
  7105. gameUI.guide1.visible = false;
  7106. gameUI.guide2.visible = false;
  7107. gameUI.guide3.visible = false;
  7108. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7109. this.selfTurn = true;
  7110. }
  7111. else {
  7112. return;
  7113. }
  7114. let oneBall = this.getOneBall();
  7115. gameUI.guide1.visible = true;
  7116. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7117. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7118. }
  7119. getOneBall() {
  7120. let arr = xGame.common.d2World.ballArr;
  7121. for (let index = 0; index < arr.length; index++) {
  7122. if (arr[index].number == 0)
  7123. continue;
  7124. return arr[index];
  7125. }
  7126. }
  7127. updateSelfScore() {
  7128. let ui = xGame.common.gameUI.ui.topNode;
  7129. ui.selfScoreTxt.text = this.selfScore + "";
  7130. }
  7131. updateAIScore() {
  7132. let ui = xGame.common.gameUI.ui.topNode;
  7133. ui.aiScoreTxt.text = this.aiScore + "";
  7134. }
  7135. updateTargetSroce() {
  7136. let ui = xGame.common.gameUI.ui.topNode;
  7137. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7138. }
  7139. updateLeftBall() {
  7140. let topUI = xGame.common.gameUI.ui.topNode;
  7141. topUI.selfBallList.numItems = this.selfBallArr.length;
  7142. topUI.aiBallList.numItems = this.aiBallArr.length;
  7143. }
  7144. ballShoot() {
  7145. this.clearTime();
  7146. this.finishOneShoot = false;
  7147. xGame.common.gameUI.ui.moveNode.visible = false;
  7148. if (xGame.common.gameUI.ui.guideNode.visible) {
  7149. xGame.common.gameUI.ui.guideNode.visible = false;
  7150. }
  7151. if (this.firstShoot) {
  7152. this.firstShoot = false;
  7153. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7154. }
  7155. }
  7156. ensureCamp(number) {
  7157. this.ensureBallType = true;
  7158. this.isOpenBall = false;
  7159. if (xGame.common.gameMode != GameMode.classic)
  7160. return;
  7161. let full = [1, 2, 3, 4, 5, 6, 7];
  7162. let flower = [9, 10, 11, 12, 13, 14, 15];
  7163. let sayWords = "";
  7164. if (this.selfTurn) {
  7165. if (number <= 7) {
  7166. this.selfCamp = ballCamp.full;
  7167. this.selfBallArr = full;
  7168. this.aiCamp = ballCamp.flower;
  7169. this.aiBallArr = flower;
  7170. sayWords = cfgTable.wordsData[3].msg;
  7171. }
  7172. else {
  7173. this.selfCamp = ballCamp.flower;
  7174. this.selfBallArr = flower;
  7175. this.aiCamp = ballCamp.full;
  7176. this.aiBallArr = full;
  7177. sayWords = cfgTable.wordsData[4].msg;
  7178. }
  7179. }
  7180. else {
  7181. if (number <= 7) {
  7182. this.selfCamp = ballCamp.flower;
  7183. this.selfBallArr = flower;
  7184. this.aiCamp = ballCamp.full;
  7185. this.aiBallArr = full;
  7186. sayWords = cfgTable.wordsData[2].msg;
  7187. }
  7188. else {
  7189. this.selfCamp = ballCamp.full;
  7190. this.selfBallArr = full;
  7191. this.aiCamp = ballCamp.flower;
  7192. this.aiBallArr = flower;
  7193. sayWords = cfgTable.wordsData[1].msg;
  7194. }
  7195. }
  7196. this.updateLeftBall();
  7197. xGame.uiMgr.Show(UIMsg, sayWords);
  7198. }
  7199. updatePlaceBallState() {
  7200. let ui = xGame.common.gameUI.ui;
  7201. switch (this.placeBallData.type) {
  7202. case PlaceBallType.normal:
  7203. let normal = ui.placeNormalNode;
  7204. normal.hpTxt.text = this.curHP + "";
  7205. this.updatePlaceBallStar(normal);
  7206. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7207. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7208. break;
  7209. case PlaceBallType.challenge:
  7210. let challenge = ui.placeChallengeNode;
  7211. challenge.hpTxt.text = "Shots:" + this.curHP;
  7212. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7213. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7214. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7215. break;
  7216. default:
  7217. break;
  7218. }
  7219. }
  7220. playSubHpAni() {
  7221. let ui = xGame.common.gameUI.ui;
  7222. switch (this.placeBallData.type) {
  7223. case PlaceBallType.normal:
  7224. let normal = ui.placeNormalNode;
  7225. normal.hpTxt.visible = false;
  7226. normal.starAni.c1.selectedIndex = 1;
  7227. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7228. normal.hpTxt.visible = true;
  7229. normal.starAni.c1.selectedIndex = 0;
  7230. }));
  7231. break;
  7232. default:
  7233. break;
  7234. }
  7235. }
  7236. getEndStarNum() {
  7237. let num;
  7238. let level = xGame.common.placeBallCurLevel;
  7239. if (this.curHP == this.placeBallData.hp) {
  7240. num = 3;
  7241. }
  7242. else if (this.curHP <= 1) {
  7243. num = 1;
  7244. }
  7245. else {
  7246. num = 2;
  7247. }
  7248. if (!this.success) {
  7249. num = 0;
  7250. }
  7251. else {
  7252. DataMgr.setPlaceBallLevel(level, num);
  7253. }
  7254. let myType = cfgTable.placeballData[level].type;
  7255. if (this.success && myType == 1) {
  7256. num = 3;
  7257. }
  7258. xGame.common.placeBallStarNum = num;
  7259. }
  7260. updatePlaceBallStar(node) {
  7261. let star = 0;
  7262. if (this.curHP == this.placeBallData.hp) {
  7263. star = 3;
  7264. }
  7265. else if (this.curHP >= 2) {
  7266. star = 2;
  7267. }
  7268. else if (this.curHP == 1) {
  7269. star = 1;
  7270. }
  7271. else {
  7272. star = 0;
  7273. }
  7274. let temp;
  7275. for (let index = 1; index <= 3; index++) {
  7276. temp = node["star" + index];
  7277. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7278. }
  7279. node.myProgress.value = (star / 3) * 100;
  7280. }
  7281. openRegretView(isFoul, GoalNum, challenge = false) {
  7282. let regretType = -1;
  7283. if (isFoul) {
  7284. regretType = 1;
  7285. }
  7286. else {
  7287. if (GoalNum <= 0) {
  7288. regretType = 0;
  7289. }
  7290. }
  7291. if (challenge) {
  7292. regretType = 1;
  7293. }
  7294. if (regretType != -1) {
  7295. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7296. if (success) {
  7297. this.curHP++;
  7298. this.updatePlaceBallState();
  7299. this.setPlaceBallAllPos();
  7300. xGame.common.gameUI.ui.moveNode.visible = false;
  7301. }
  7302. else {
  7303. if (this.curHP <= 0) {
  7304. this.success = false;
  7305. this.gameEnd();
  7306. }
  7307. this.playSubHpAni();
  7308. }
  7309. this.updatePlaceBallState();
  7310. this.updatePlaceBallPos();
  7311. });
  7312. }
  7313. }
  7314. setPlaceBallAllPos() {
  7315. let allBall = xGame.common.d2World.ballArr;
  7316. let cfgArr = this.placeBallPosData;
  7317. let temp;
  7318. let obj;
  7319. for (let index = 0; index < allBall.length; index++) {
  7320. temp = allBall[index];
  7321. if (temp.destroyed)
  7322. continue;
  7323. obj = cfgArr[temp.myUNID];
  7324. if (obj && obj.src && !obj.src.destroyed) {
  7325. temp.gameObj.x = obj.posX;
  7326. temp.gameObj.y = obj.posY;
  7327. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7328. }
  7329. }
  7330. xGame.common.d2World.getHelpLine();
  7331. }
  7332. updatePlaceBallPos() {
  7333. let arr = xGame.common.d2World.ballArr;
  7334. let temp;
  7335. for (let index = 0; index < arr.length; index++) {
  7336. temp = arr[index];
  7337. if (!this.placeBallPosData[temp.myUNID]) {
  7338. this.placeBallPosData[temp.myUNID] = {
  7339. src: temp,
  7340. posX: temp.gameObj.x,
  7341. posY: temp.gameObj.y
  7342. };
  7343. }
  7344. else {
  7345. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7346. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7347. }
  7348. }
  7349. let check;
  7350. for (const key in this.placeBallPosData) {
  7351. check = this.placeBallPosData[key];
  7352. if (check.src.destroyed) {
  7353. delete this.placeBallPosData[key];
  7354. }
  7355. }
  7356. }
  7357. gameRun(type) {
  7358. if (this.gamePause)
  7359. return;
  7360. this.curFoul = this.getFoulType();
  7361. if (type) {
  7362. xGame.common.d2World.d2Gan.shoot();
  7363. xGame.common.gameUI.forceCancel();
  7364. this.curFoul = type;
  7365. }
  7366. this.isEnd = false;
  7367. this.isChangeTurn = true;
  7368. if (xGame.common.gameMode == GameMode.classic) {
  7369. this.judgeClassic(this.curFoul);
  7370. this.checkClassicWords(() => {
  7371. xGame.common.destroyClassicEmotion();
  7372. if (this.isEnd) {
  7373. if (this.isBlackInHole) {
  7374. xGame.common.gameUI.ui.blackAni.visible = true;
  7375. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7376. xGame.common.gameUI.ui.blackAni.visible = false;
  7377. this.gameEnd();
  7378. }));
  7379. }
  7380. else {
  7381. this.gameEnd();
  7382. }
  7383. }
  7384. else {
  7385. this.waitShoot();
  7386. xGame.eventMgr.event(WAIT_SHOOT);
  7387. }
  7388. });
  7389. }
  7390. else if (xGame.common.gameMode == GameMode.bigMove) {
  7391. xGame.common.aiPlayer.stopRun();
  7392. let scoreArr = this.getScore(this.curFoul);
  7393. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7394. this.isEnd = true;
  7395. }
  7396. this.checkBigSkillWords(() => {
  7397. if (this.isEnd) {
  7398. this.gameEnd();
  7399. }
  7400. else {
  7401. this.waitShoot();
  7402. xGame.eventMgr.event(WAIT_SHOOT);
  7403. }
  7404. });
  7405. }
  7406. else if (xGame.common.gameMode == GameMode.placeBall) {
  7407. xGame.common.destroyAwardSpine();
  7408. let isFoul = this.curFoul == FoulType.rootHole;
  7409. let GoalNum = this.inHoleBalls.length;
  7410. if (this.inHoleBalls.indexOf(0) > -1)
  7411. GoalNum -= 1;
  7412. if (isFoul) {
  7413. this.placeRootBall();
  7414. }
  7415. console.log("neeballs", this.needBalls);
  7416. console.log("当前完成的goalNum", GoalNum);
  7417. this.finishBalls += GoalNum;
  7418. console.log("当前完成的finishballs", this.finishBalls);
  7419. let need = this.needBalls;
  7420. if (this.placeBallData.type == PlaceBallType.challenge) {
  7421. need += 100;
  7422. }
  7423. if (this.finishBalls >= need) {
  7424. this.success = true;
  7425. this.gameEnd();
  7426. }
  7427. else {
  7428. switch (this.placeBallData.type) {
  7429. case PlaceBallType.normal:
  7430. if (!isFoul && GoalNum > 0) {
  7431. this.updatePlaceBallPos();
  7432. this.updatePlaceBallState();
  7433. }
  7434. else {
  7435. this.curHP--;
  7436. this.openRegretView(isFoul, GoalNum);
  7437. }
  7438. this.waitShoot();
  7439. xGame.eventMgr.event(WAIT_SHOOT);
  7440. break;
  7441. case PlaceBallType.challenge:
  7442. this.curHP--;
  7443. this.updatePlaceBallState();
  7444. if (isFoul) {
  7445. this.openRegretView(isFoul, GoalNum, true);
  7446. }
  7447. else {
  7448. this.updatePlaceBallPos();
  7449. if (this.curHP <= 0) {
  7450. this.success = true;
  7451. this.gameEnd();
  7452. }
  7453. }
  7454. this.waitShoot();
  7455. xGame.eventMgr.event(WAIT_SHOOT);
  7456. break;
  7457. default:
  7458. break;
  7459. }
  7460. }
  7461. }
  7462. }
  7463. checkClassicWords(callback) {
  7464. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7465. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7466. let type = this.getClassicWordsType();
  7467. if (condition && type != -1) {
  7468. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7469. xGame.soundMgr.playSound(str);
  7470. xGame.common.wordsMgr.playClassicWords(type, callback);
  7471. }
  7472. else {
  7473. Laya.timer.once(300, this, () => {
  7474. callback && callback();
  7475. });
  7476. }
  7477. }
  7478. getClassicWordsType() {
  7479. let d2world = xGame.common.d2World;
  7480. let type = -1;
  7481. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7482. type = ClassicWordsType.perfectShow;
  7483. return type;
  7484. }
  7485. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7486. type = ClassicWordsType.directShoot;
  7487. return type;
  7488. }
  7489. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7490. type = ClassicWordsType.anotherShoot;
  7491. return type;
  7492. }
  7493. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7494. type = ClassicWordsType.bigPower;
  7495. return type;
  7496. }
  7497. let minSpeed = 1;
  7498. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7499. type = ClassicWordsType.hardShoot;
  7500. return type;
  7501. }
  7502. if (this.inHoleBalls.length > 0) {
  7503. type = ClassicWordsType.directShoot;
  7504. return type;
  7505. }
  7506. return type;
  7507. }
  7508. checkBigSkillWords(callback) {
  7509. if (this.curFoul == FoulType.timeOut) {
  7510. callback && callback();
  7511. }
  7512. else {
  7513. let playSkill = false;
  7514. if (this.selfTurn) {
  7515. playSkill = true;
  7516. }
  7517. else {
  7518. if (!this.aiPlayedBreakArmy) {
  7519. this.aiPlayedBreakArmy = true;
  7520. playSkill = true;
  7521. }
  7522. if (this.aiCurSkill != SkillType.breakArmy) {
  7523. playSkill = true;
  7524. }
  7525. }
  7526. if (xGame.common.skillMgr.playedLastSkill) {
  7527. xGame.common.skillMgr.playedLastSkill = false;
  7528. playSkill = false;
  7529. }
  7530. if (playSkill) {
  7531. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7532. let selfExtra = 0;
  7533. let aiExtra = 0;
  7534. if (this.selfTurn)
  7535. selfExtra += extraScore;
  7536. else
  7537. aiExtra += extraScore;
  7538. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7539. this.isEnd = true;
  7540. }
  7541. this.playBigSkillTimes(callback);
  7542. });
  7543. }
  7544. else {
  7545. this.playBigSkillTimes(callback);
  7546. }
  7547. }
  7548. }
  7549. playBigSkillTimes(callback) {
  7550. let length = this.inHoleBalls.length;
  7551. if (this.inHoleBalls.indexOf(0) > -1) {
  7552. length = this.inHoleBalls.length - 1;
  7553. }
  7554. if (length <= 0) {
  7555. callback && callback();
  7556. return;
  7557. }
  7558. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7559. callback && callback();
  7560. });
  7561. }
  7562. playSkillTips() {
  7563. let levelNum = 0;
  7564. let curType;
  7565. if (this.selfTurn) {
  7566. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7567. curType = this.selfCurSkill;
  7568. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7569. levelNum += 5;
  7570. }
  7571. }
  7572. else {
  7573. levelNum = this.aiSkillLevelNum;
  7574. curType = this.aiCurSkill;
  7575. }
  7576. let str = ``;
  7577. switch (curType) {
  7578. case SkillType.highSpace:
  7579. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7580. break;
  7581. case SkillType.breakArmy:
  7582. str = `You pocketed ${levelNum} extra balls`;
  7583. break;
  7584. case SkillType.ice:
  7585. str = `${levelNum * 2} extra balls were frozen`;
  7586. break;
  7587. case SkillType.fireworks:
  7588. str = `${levelNum} extra balls exploded `;
  7589. break;
  7590. case SkillType.GuanYu:
  7591. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  7592. break;
  7593. default:
  7594. break;
  7595. }
  7596. xGame.uiMgr.Show(UIMsg, str);
  7597. }
  7598. getFoulType() {
  7599. let foulType = "";
  7600. if (this.firstColliObj == null) {
  7601. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7602. return FoulType.rootHole;
  7603. }
  7604. return FoulType.notTouch;
  7605. }
  7606. else {
  7607. if (this.selfTurn) {
  7608. if (this.selfBallArr.length > 0) {
  7609. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7610. foulType = FoulType.wrongTouch;
  7611. }
  7612. }
  7613. else {
  7614. if (this.ensureBallType) {
  7615. }
  7616. else {
  7617. if (this.firstColliObj == this.blackNum) {
  7618. foulType = FoulType.wrongTouch;
  7619. }
  7620. }
  7621. }
  7622. }
  7623. else {
  7624. if (this.aiBallArr.length > 0) {
  7625. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7626. foulType = FoulType.wrongTouch;
  7627. }
  7628. }
  7629. else {
  7630. if (this.ensureBallType) {
  7631. }
  7632. else {
  7633. if (this.firstColliObj == this.blackNum) {
  7634. foulType = FoulType.wrongTouch;
  7635. }
  7636. }
  7637. }
  7638. }
  7639. if (this.inHoleBalls.length <= 0) {
  7640. return foulType;
  7641. }
  7642. let temp;
  7643. if (this.inHoleBalls.indexOf(0) > -1) {
  7644. foulType = FoulType.rootHole;
  7645. }
  7646. else {
  7647. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7648. temp = this.inHoleBalls[index];
  7649. if (this.selfTurn) {
  7650. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7651. foulType = FoulType.wrongHole;
  7652. break;
  7653. }
  7654. }
  7655. else {
  7656. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7657. foulType = FoulType.wrongHole;
  7658. break;
  7659. }
  7660. }
  7661. }
  7662. }
  7663. let foo;
  7664. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7665. temp = this.inHoleBalls[index];
  7666. foo = this.selfBallArr.indexOf(temp);
  7667. if (foo > -1) {
  7668. this.selfBallArr.splice(foo, 1);
  7669. }
  7670. foo = this.aiBallArr.indexOf(temp);
  7671. if (foo > -1) {
  7672. this.aiBallArr.splice(foo, 1);
  7673. }
  7674. }
  7675. this.updateLeftBall();
  7676. }
  7677. return foulType;
  7678. }
  7679. judgeGameEndByBlack(arr) {
  7680. if (this.selfTurn) {
  7681. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7682. this.selfFoulNum = this.maxFoulTimes;
  7683. return true;
  7684. }
  7685. }
  7686. else {
  7687. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7688. this.aiFoulNum = this.maxFoulTimes;
  7689. return true;
  7690. }
  7691. }
  7692. }
  7693. judgeClassic(type) {
  7694. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7695. xGame.common.aiPlayer.stopRun();
  7696. if (this.judgeNormalSuccess()) {
  7697. this.isEnd = true;
  7698. return;
  7699. }
  7700. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7701. if (this.selfTurn) {
  7702. if (isFoul) {
  7703. this.selfFoulNum++;
  7704. }
  7705. if (this.selfFoulNum >= this.maxFoulTimes) {
  7706. this.success = false;
  7707. this.isEnd = true;
  7708. return;
  7709. }
  7710. }
  7711. else {
  7712. if (isFoul)
  7713. this.aiFoulNum++;
  7714. if (this.aiFoulNum >= this.maxFoulTimes) {
  7715. this.success = true;
  7716. this.isEnd = true;
  7717. return;
  7718. }
  7719. }
  7720. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7721. this.isChangeTurn = false;
  7722. }
  7723. else {
  7724. this.isInterrupt = true;
  7725. }
  7726. }
  7727. waitShoot() {
  7728. if (xGame.common.gameMode == GameMode.classic) {
  7729. switch (this.curFoul) {
  7730. case FoulType.timeOut:
  7731. case FoulType.rootHole:
  7732. this.selfTurn = !this.selfTurn;
  7733. this.peoplePlay(5, 6, true);
  7734. break;
  7735. case FoulType.notTouch:
  7736. this.selfTurn = !this.selfTurn;
  7737. this.peoplePlay(7, 7);
  7738. break;
  7739. case FoulType.wrongHole:
  7740. this.selfTurn = !this.selfTurn;
  7741. this.peoplePlay(11, 11);
  7742. break;
  7743. default:
  7744. if (this.inHoleBalls.length > 0) {
  7745. this.peoplePlay(0, 0, false, false);
  7746. }
  7747. else {
  7748. this.selfTurn = !this.selfTurn;
  7749. this.peoplePlay(7, 7);
  7750. }
  7751. break;
  7752. }
  7753. }
  7754. else if (xGame.common.gameMode == GameMode.bigMove) {
  7755. if (this.curFoul == FoulType.timeOut) {
  7756. this.selfTurn = !this.selfTurn;
  7757. this.peoplePlay(14, 15);
  7758. this.placeRootBall();
  7759. }
  7760. else {
  7761. this.selfTurn = !this.selfTurn;
  7762. if (this.curFoul == FoulType.rootHole) {
  7763. this.peoplePlay(12, 13);
  7764. this.placeRootBall();
  7765. }
  7766. else {
  7767. this.peoplePlay(0, 0, false, false);
  7768. }
  7769. }
  7770. }
  7771. else if (xGame.common.gameMode == GameMode.placeBall) {
  7772. this.finishOneShoot = true;
  7773. }
  7774. this.gameResult();
  7775. }
  7776. gameResult() {
  7777. this.firstColliObj = null;
  7778. this.inHoleBalls = [];
  7779. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7780. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7781. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7782. if (xGame.common.uiRodMethod)
  7783. xGame.common.uiRodMethod.resetRod();
  7784. xGame.common.d2World.rootBall.showSelf();
  7785. this.clearIceSkill();
  7786. if (this.selfTurn) {
  7787. console.log("gameResult");
  7788. PlatMgr.gameInsert();
  7789. }
  7790. xGame.common.d3World.knifeRoot.destroyChildren();
  7791. if (this.selfTurn) {
  7792. xGame.common.gameUI.showHelpLineGuide();
  7793. xGame.common.gameUI.setTurnAlpha(true);
  7794. }
  7795. else {
  7796. xGame.common.gameUI.setTurnAlpha(false);
  7797. }
  7798. }
  7799. getScore(type) {
  7800. let selfAdd = 0;
  7801. let aiAdd = 0;
  7802. if (type == FoulType.timeOut) {
  7803. if (this.selfTurn)
  7804. aiAdd += 3;
  7805. else
  7806. selfAdd += 3;
  7807. }
  7808. else {
  7809. if (this.inHoleBalls.length > 0) {
  7810. if (this.selfTurn) {
  7811. if (type == FoulType.rootHole) {
  7812. aiAdd += 3;
  7813. if (this.inHoleBalls.length - 1 > 0) {
  7814. selfAdd += this.inHoleBalls.length - 1;
  7815. }
  7816. }
  7817. else {
  7818. selfAdd += this.inHoleBalls.length;
  7819. }
  7820. }
  7821. else {
  7822. if (type == FoulType.rootHole) {
  7823. selfAdd += 3;
  7824. if (this.inHoleBalls.length - 1 > 0) {
  7825. aiAdd += this.inHoleBalls.length - 1;
  7826. }
  7827. }
  7828. else {
  7829. aiAdd += this.inHoleBalls.length;
  7830. }
  7831. }
  7832. }
  7833. }
  7834. return [selfAdd, aiAdd];
  7835. }
  7836. judgeScoreEnd(selfAdd, aiAdd) {
  7837. this.selfScore += selfAdd;
  7838. this.aiScore += aiAdd;
  7839. this.updateAIScore();
  7840. this.updateSelfScore();
  7841. if (this.selfScore >= this.targertScore) {
  7842. this.success = true;
  7843. return true;
  7844. }
  7845. if (this.aiScore >= this.targertScore) {
  7846. this.success = false;
  7847. return true;
  7848. }
  7849. let ballArr = xGame.common.d2World.ballArr;
  7850. if (ballArr.length == 1 && ballArr[0].number == 0) {
  7851. if (this.selfScore > this.aiScore) {
  7852. this.success = true;
  7853. return true;
  7854. }
  7855. else if (this.selfScore < this.aiScore) {
  7856. this.success = false;
  7857. return true;
  7858. }
  7859. else {
  7860. if (this.selfTurn) {
  7861. this.success = false;
  7862. }
  7863. else {
  7864. this.success = true;
  7865. }
  7866. return true;
  7867. }
  7868. }
  7869. }
  7870. clearIceSkill() {
  7871. let arr = xGame.common.d2World.ballArr;
  7872. let temp;
  7873. if (this.selfTurn) {
  7874. if (this.selfCurSkill == SkillType.ice) {
  7875. for (let index = 0; index < arr.length; index++) {
  7876. temp = arr[index];
  7877. if (temp.ballFunc == "ice") {
  7878. temp.setBallFunc("normal", "self");
  7879. }
  7880. }
  7881. }
  7882. }
  7883. else {
  7884. if (this.aiCurSkill == SkillType.ice) {
  7885. for (let index = 0; index < arr.length; index++) {
  7886. temp = arr[index];
  7887. if (temp.ballFunc == "ice") {
  7888. temp.setBallFunc("normal", "ai");
  7889. }
  7890. }
  7891. }
  7892. }
  7893. }
  7894. judgeNormalSuccess() {
  7895. if (this.selfTurn) {
  7896. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7897. this.success = true;
  7898. return true;
  7899. }
  7900. }
  7901. else {
  7902. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7903. this.success = false;
  7904. return true;
  7905. }
  7906. }
  7907. }
  7908. gameEnd() {
  7909. if (Moyu.isTT) {
  7910. xGame.common.screenImg = getScreenImg();
  7911. }
  7912. console.log("游戏结束", this.success);
  7913. xGame.common.aiPlayer.stopRun();
  7914. if (xGame.common.gameMode == GameMode.placeBall) {
  7915. this.getEndStarNum();
  7916. this.updatePlaceBallState();
  7917. }
  7918. this.isEnter = false;
  7919. Moyu.recordEnd(this, () => {
  7920. if (this.isEnter)
  7921. return;
  7922. this.isEnter = true;
  7923. console.log("进入录结束回调");
  7924. this.enterNext();
  7925. });
  7926. Laya.timer.once(1000, this, () => {
  7927. if (this.isEnter)
  7928. return;
  7929. this.isEnter = true;
  7930. this.enterNext();
  7931. });
  7932. xGame.common.longHelpLine = false;
  7933. }
  7934. enterNext() {
  7935. Laya.timer.clearAll(this);
  7936. if (Moyu.canShare() > 100 || Moyu.isKs) {
  7937. xGame.uiMgr.Show(UIVideoShare, this.success);
  7938. }
  7939. else {
  7940. xGame.uiMgr.Show(UIGameEnd, this.success);
  7941. }
  7942. }
  7943. aiLeave() {
  7944. let ui = xGame.common.gameUI.ui;
  7945. ui.topNode.aiNameTxt.text = "offline";
  7946. }
  7947. aiGameEnd(suc) {
  7948. this.success = suc;
  7949. xGame.common.aiPlayer.stopRun();
  7950. if (this.success) {
  7951. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  7952. Laya.timer.once(1000, this, () => {
  7953. this.clearTime();
  7954. this.gameEnd();
  7955. });
  7956. }
  7957. }
  7958. openTimer() {
  7959. let src = xGame.common.gameUI;
  7960. if (this.selfTurn) {
  7961. src.ui.topNode.selfProgress.visible = true;
  7962. src.ui.topNode.aiProgress.visible = false;
  7963. this.curTimer = src.ui.topNode.selfProgress;
  7964. }
  7965. else {
  7966. src.ui.topNode.selfProgress.visible = false;
  7967. src.ui.topNode.aiProgress.visible = true;
  7968. this.curTimer = src.ui.topNode.aiProgress;
  7969. }
  7970. this.accTime = 0;
  7971. Laya.timer.clearAll(this);
  7972. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  7973. this.curTimer.value = 100;
  7974. }
  7975. updateTime(dt) {
  7976. if (this.gamePause)
  7977. return;
  7978. this.accTime += dt;
  7979. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  7980. if (this.accTime >= this.setTime) {
  7981. this.clearTime();
  7982. console.log("时钟进入了gameRun");
  7983. this.gameRun(FoulType.timeOut);
  7984. }
  7985. }
  7986. clearTime() {
  7987. let src = xGame.common.gameUI;
  7988. src.ui.topNode.selfProgress.visible = false;
  7989. src.ui.topNode.aiProgress.visible = false;
  7990. Laya.timer.clearAll(this);
  7991. }
  7992. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  7993. let ui = xGame.common.gameUI.ui;
  7994. let selfMsg, aiMsg;
  7995. if (sayWords) {
  7996. selfMsg = cfgTable.wordsData[selfIndex].msg;
  7997. aiMsg = cfgTable.wordsData[aiIndex].msg;
  7998. if (Foul) {
  7999. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8000. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8001. this.placeRootBall();
  8002. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8003. if (this.curFoul == FoulType.rootHole) {
  8004. if (!DataMgr.getRootBallFoul()) {
  8005. DataMgr.setRootBallFoul();
  8006. aiMsg = "";
  8007. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8008. let woman = "Boss, pay attention next time~";
  8009. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8010. }
  8011. }
  8012. else if (this.curFoul == FoulType.timeOut) {
  8013. if (!DataMgr.getTimeoutFoul()) {
  8014. DataMgr.setTimeoutFoul();
  8015. aiMsg = "";
  8016. let tips = "Game timeout, 3 fouls, this game failed.";
  8017. let woman = "Boss, pay attention to the timeline~";
  8018. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8019. }
  8020. }
  8021. }
  8022. }
  8023. }
  8024. if (this.selfTurn) {
  8025. if (sayWords) {
  8026. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8027. ui.selfTurn.visible = true;
  8028. ui.aiTurn.visible = false;
  8029. ui.selfTurn.t0.play();
  8030. Moyu.vibration();
  8031. });
  8032. }
  8033. }
  8034. else {
  8035. let aiNum = xGame.tools.random(1, 11);
  8036. let challengeNum = DataMgr.getChallengeTimes();
  8037. let delay = false;
  8038. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8039. aiNum = 9;
  8040. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8041. aiNum = 3;
  8042. if (challengeNum == 3) {
  8043. if (!this.showLongView) {
  8044. this.showLongView = true;
  8045. delay = true;
  8046. }
  8047. }
  8048. }
  8049. }
  8050. if (delay) {
  8051. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8052. if (success) {
  8053. xGame.common.longHelpLine = true;
  8054. xGame.common.d2World.getHelpLine();
  8055. }
  8056. else {
  8057. aiNum = 10;
  8058. }
  8059. xGame.common.aiPlayer.setAiLevel(aiNum);
  8060. if (sayWords) {
  8061. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8062. xGame.common.aiPlayer.runAI();
  8063. ui.selfTurn.visible = false;
  8064. ui.aiTurn.visible = true;
  8065. ui.aiTurn.t0.play();
  8066. });
  8067. }
  8068. else {
  8069. xGame.common.aiPlayer.runAI();
  8070. }
  8071. this.openTimer();
  8072. this.finishOneShoot = true;
  8073. if (this.selfTurn) {
  8074. ui.topNode.selfKuang.visible = true;
  8075. ui.topNode.aiKuang.visible = false;
  8076. ui.topNode.selfTips.visible = true;
  8077. ui.topNode.aiTips.visible = false;
  8078. }
  8079. else {
  8080. ui.topNode.selfKuang.visible = false;
  8081. ui.topNode.aiKuang.visible = true;
  8082. ui.topNode.selfTips.visible = false;
  8083. ui.topNode.aiTips.visible = true;
  8084. }
  8085. });
  8086. return;
  8087. }
  8088. if (xGame.common.gameMode == GameMode.classic) {
  8089. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8090. if (cfg) {
  8091. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8092. aiNum = aiLevel;
  8093. }
  8094. }
  8095. xGame.common.aiPlayer.setAiLevel(aiNum);
  8096. if (sayWords) {
  8097. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8098. xGame.common.aiPlayer.runAI();
  8099. ui.selfTurn.visible = false;
  8100. ui.aiTurn.visible = true;
  8101. ui.aiTurn.t0.play();
  8102. });
  8103. }
  8104. else {
  8105. xGame.common.aiPlayer.runAI();
  8106. }
  8107. }
  8108. this.openTimer();
  8109. this.finishOneShoot = true;
  8110. if (this.selfTurn) {
  8111. ui.topNode.selfKuang.visible = true;
  8112. ui.topNode.aiKuang.visible = false;
  8113. ui.topNode.selfTips.visible = true;
  8114. ui.topNode.aiTips.visible = false;
  8115. }
  8116. else {
  8117. ui.topNode.selfKuang.visible = false;
  8118. ui.topNode.aiKuang.visible = true;
  8119. ui.topNode.selfTips.visible = false;
  8120. ui.topNode.aiTips.visible = true;
  8121. }
  8122. }
  8123. placeRootBall() {
  8124. let rootBall = xGame.common.d2World.rootBall;
  8125. if (!rootBall)
  8126. return;
  8127. rootBall.gameObj.x = this.lastRootBallPos.x;
  8128. rootBall.gameObj.y = this.lastRootBallPos.y;
  8129. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8130. let moveNode = xGame.common.gameUI.ui.moveNode;
  8131. moveNode.visible = true;
  8132. moveNode.x = this.lastRootBallPos.x;
  8133. moveNode.y = this.lastRootBallPos.y;
  8134. if (!this.selfTurn) {
  8135. xGame.common.aiPlayer.resetRoot();
  8136. }
  8137. }
  8138. }
  8139. class ui_guanyuAni extends fgui.GComponent {
  8140. static createInstance() {
  8141. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8142. }
  8143. onConstruct() {
  8144. this.n0 = (this.getChild("n0"));
  8145. }
  8146. }
  8147. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8148. class UIFireworks extends UIBase {
  8149. constructor() {
  8150. super();
  8151. }
  8152. onConstructor() {
  8153. this.isEject = false;
  8154. }
  8155. show(callback) {
  8156. super.show();
  8157. }
  8158. }
  8159. UIFireworks.uiName = "UIFireworks";
  8160. class ui_UIGuanYu extends fgui.GComponent {
  8161. static createInstance() {
  8162. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8163. }
  8164. onConstruct() {
  8165. this.n2 = (this.getChild("n2"));
  8166. this.n1 = (this.getChild("n1"));
  8167. this.n3 = (this.getChild("n3"));
  8168. this.n4 = (this.getChild("n4"));
  8169. this.n5 = (this.getChild("n5"));
  8170. this.n6 = (this.getChild("n6"));
  8171. this.n8 = (this.getChild("n8"));
  8172. this.n7 = (this.getChild("n7"));
  8173. this.t0 = this.getTransition("t0");
  8174. }
  8175. }
  8176. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8177. class UIGuanYu extends UIBase {
  8178. constructor() {
  8179. super();
  8180. }
  8181. onConstructor() {
  8182. this.ui = ui_UIGuanYu.createInstance();
  8183. this.contentPane = this.ui;
  8184. this.isEject = false;
  8185. }
  8186. show(callback) {
  8187. super.show();
  8188. this.ui.t0.play(Laya.Handler.create(this, () => {
  8189. callback && callback();
  8190. this.hide();
  8191. }));
  8192. }
  8193. }
  8194. UIGuanYu.uiName = "UIGuanYu";
  8195. class SkillMgr {
  8196. constructor() {
  8197. this.leveNum = 0;
  8198. this.extraScore = 0;
  8199. this.selfTurn = false;
  8200. this.playedLastSkill = false;
  8201. this.tweenArr = [];
  8202. this._finishNum = 0;
  8203. this._curFinish = 0;
  8204. this._rootX = 0;
  8205. this._rootY = 0;
  8206. this.knifeTimes = 0;
  8207. this.knifeV2 = new Laya.Vector2();
  8208. this.knifeV3 = new Laya.Vector3();
  8209. this.rtStarX = 0;
  8210. this.rtStarY = 0;
  8211. this.addBigSkillSpine();
  8212. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8213. }
  8214. addBigSkillSpine() {
  8215. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8216. console.log("extra2 success");
  8217. });
  8218. }
  8219. runBigSkill(callback) {
  8220. this.tweenArr = [];
  8221. this.callback = callback;
  8222. this.judgeSkill();
  8223. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8224. let guide = DataMgr.getSkillGuide();
  8225. if (!xGame.common.gameMgr.selfTurn) {
  8226. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8227. }
  8228. else {
  8229. if (xGame.common.temSelfLevel != 0) {
  8230. this.leveNum = xGame.common.temSelfLevel;
  8231. }
  8232. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8233. this.leveNum += 5;
  8234. }
  8235. }
  8236. if (guide == 0) {
  8237. DataMgr.setSkillGuide(1);
  8238. if (DataMgr.getNewUser()) {
  8239. Moyu.sendDataEvent("gameFirstPlay");
  8240. DataMgr.setNewUser();
  8241. }
  8242. }
  8243. this.playSpineAni(() => {
  8244. switch (this.curSkill) {
  8245. case SkillType.highSpace:
  8246. this.runHighSpace();
  8247. break;
  8248. case SkillType.breakArmy:
  8249. this.runBreakArmy();
  8250. break;
  8251. case SkillType.ice:
  8252. this.runIce();
  8253. break;
  8254. case SkillType.fireworks:
  8255. this.runFireworks();
  8256. break;
  8257. case SkillType.GuanYu:
  8258. this.runGuanYu();
  8259. break;
  8260. default:
  8261. break;
  8262. }
  8263. });
  8264. }
  8265. judgeSkill() {
  8266. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8267. let gameMgr = xGame.common.gameMgr;
  8268. let type;
  8269. for (let index = 0; index < typeArr.length; index++) {
  8270. type = typeArr[index];
  8271. if (gameMgr.selfTurn) {
  8272. if (gameMgr.selfCurSkill == type) {
  8273. this.selfTurn = true;
  8274. this.curSkill = type;
  8275. return;
  8276. }
  8277. }
  8278. else {
  8279. if (gameMgr.aiCurSkill == type) {
  8280. this.selfTurn = false;
  8281. this.curSkill = type;
  8282. return;
  8283. }
  8284. }
  8285. }
  8286. }
  8287. playSpineAni(callback) {
  8288. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8289. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8290. parent.destroyChildren();
  8291. let aniIndex = 0;
  8292. let skillSpine;
  8293. switch (this.curSkill) {
  8294. case SkillType.highSpace:
  8295. aniIndex = 1;
  8296. xGame.soundMgr.playSound("skill01");
  8297. skillSpine = this.skillSpine2;
  8298. data.scaleX = 0.5;
  8299. data.scaleY = 0.5;
  8300. skillSpine.play(data, 1, false, parent, () => {
  8301. callback && callback();
  8302. });
  8303. break;
  8304. case SkillType.breakArmy:
  8305. aniIndex = 2;
  8306. xGame.soundMgr.playSound("skill02");
  8307. skillSpine = this.skillSpine2;
  8308. data.scaleX = 0.5;
  8309. data.scaleY = 0.5;
  8310. skillSpine.play(data, 2, false, parent, () => {
  8311. callback && callback();
  8312. });
  8313. break;
  8314. case SkillType.ice:
  8315. aniIndex = 0;
  8316. xGame.soundMgr.playSound("skill03");
  8317. skillSpine = this.skillSpine2;
  8318. data.scaleX = 0.5;
  8319. data.scaleY = 0.5;
  8320. skillSpine.play(data, 0, false, parent, () => {
  8321. callback && callback();
  8322. });
  8323. break;
  8324. case SkillType.fireworks:
  8325. xGame.soundMgr.playSound("skill_04_01");
  8326. xGame.soundMgr.playSound("skill04");
  8327. xGame.uiMgr.Show(UIFireworks, callback);
  8328. break;
  8329. case SkillType.GuanYu:
  8330. xGame.soundMgr.playSound("skill05_1");
  8331. xGame.soundMgr.playSound("skill05");
  8332. xGame.uiMgr.Show(UIGuanYu, callback);
  8333. break;
  8334. default:
  8335. break;
  8336. }
  8337. }
  8338. getAllBallArr() {
  8339. let arr = xGame.common.d2World.ballArr;
  8340. let outArr = [];
  8341. for (let index = 0; index < arr.length; index++) {
  8342. if (arr[index] instanceof D2RootBallSrc)
  8343. continue;
  8344. if (arr[index].ballFunc == "ice")
  8345. continue;
  8346. if (arr[index].destroyed)
  8347. continue;
  8348. outArr.push(arr[index]);
  8349. }
  8350. return outArr;
  8351. }
  8352. getOneArr(deletObj) {
  8353. let allArr = this.getAllBallArr();
  8354. let temp;
  8355. for (let index = 0; index < allArr.length; index++) {
  8356. temp = allArr[index];
  8357. if (temp.id == deletObj.id) {
  8358. allArr.splice(index, 1);
  8359. break;
  8360. }
  8361. }
  8362. return allArr;
  8363. }
  8364. getNearBallBag(ball) {
  8365. let ui = xGame.common.gameUI.ui;
  8366. let circleArr = [];
  8367. for (let index = 1; index <= 6; index++) {
  8368. circleArr.push(ui.border["circle" + index]);
  8369. }
  8370. let outIndex = 0;
  8371. let temp;
  8372. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8373. ;
  8374. let dis = 0;
  8375. for (let index = 1; index < circleArr.length; index++) {
  8376. temp = circleArr[index];
  8377. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8378. if (dis < min) {
  8379. min = dis;
  8380. outIndex = index;
  8381. }
  8382. }
  8383. return [circleArr[outIndex], outIndex];
  8384. }
  8385. ballFlyToBag(ballArr, time = 300) {
  8386. let temp;
  8387. let hole;
  8388. this._finishNum = ballArr.length;
  8389. this._curFinish = 0;
  8390. let holeObj = {};
  8391. let holeCfg = {
  8392. "1": 0,
  8393. "2": 0,
  8394. "3": 0,
  8395. "4": 0,
  8396. "5": 0,
  8397. "6": 0
  8398. };
  8399. for (let index = 0; index < ballArr.length; index++) {
  8400. temp = ballArr[index];
  8401. temp.outColli.isSensor = true;
  8402. temp.innerColli.isSensor = true;
  8403. temp.isRunSkillAni = true;
  8404. let holeArr = this.getNearBallBag(temp);
  8405. hole = holeArr[0];
  8406. holeObj[index] = holeArr[1];
  8407. temp.d3BallSrc.scaleXYZ = 0.5;
  8408. this.tweenArr.push(temp.d3BallSrc, temp);
  8409. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8410. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8411. }));
  8412. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8413. let mIndex = holeObj[this._curFinish];
  8414. let isDone = holeCfg[mIndex];
  8415. if (isDone) {
  8416. ballArr[this._curFinish].checkWrongBall(false);
  8417. }
  8418. else {
  8419. holeCfg[mIndex] = 1;
  8420. ballArr[this._curFinish].checkWrongBall();
  8421. }
  8422. this._curFinish++;
  8423. if (this._curFinish >= this._finishNum) {
  8424. if (this.curSkill == SkillType.highSpace) {
  8425. }
  8426. else if (this.curSkill == SkillType.breakArmy) {
  8427. let rootBall = xGame.common.d2World.rootBall;
  8428. rootBall.gameObj.x = this._rootX;
  8429. rootBall.gameObj.y = this._rootY;
  8430. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8431. xGame.common.d2World.d2Gan.ui.visible = true;
  8432. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8433. xGame.common.d2World.getHelpLine();
  8434. this.callback && this.callback(this.extraScore);
  8435. }
  8436. }
  8437. }));
  8438. }
  8439. }
  8440. runHighSpace() {
  8441. let rootBall = xGame.common.d2World.rootBall;
  8442. rootBall.showSelf();
  8443. let d3Src = rootBall.d3BallSrc;
  8444. let allArr = this.getAllBallArr();
  8445. if (allArr.length <= 0) {
  8446. this.callback && this.callback(0);
  8447. return;
  8448. }
  8449. let selectBall = xGame.common.d2World.targetBall;
  8450. let wrong = selectBall && selectBall.destroyed;
  8451. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8452. selectBall = xGame.common.getRandArrEle(allArr);
  8453. }
  8454. let targetD3Src = selectBall.d3BallSrc;
  8455. xGame.common.d2World.d2Gan.ui.visible = false;
  8456. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8457. d3Src.scaleXYZ = 0.5;
  8458. this.tweenArr.push(d3Src);
  8459. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8460. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8461. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8462. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8463. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8464. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8465. let outArr = [selectBall];
  8466. let other = this.leveNum - 1;
  8467. if (other > 0) {
  8468. let nearArr = this.getOneArr(selectBall);
  8469. if (nearArr.length > 0) {
  8470. xGame.common.botherArr(nearArr);
  8471. if (other >= nearArr.length)
  8472. other = nearArr.length;
  8473. for (let index = 0; index < other; index++) {
  8474. outArr.push(nearArr[index]);
  8475. }
  8476. }
  8477. }
  8478. xGame.common.extraMoveNum = other + 1;
  8479. this.extraScore = other + 1;
  8480. this._rootX = selectBall.gameObj.x;
  8481. this._rootY = selectBall.gameObj.y;
  8482. rootBall.gameObj.x = this._rootX;
  8483. rootBall.gameObj.y = this._rootY;
  8484. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8485. Laya.Tween.clearAll(d3Src);
  8486. this.addRandomForce(outArr);
  8487. }));
  8488. }));
  8489. }
  8490. addRandomForce(outArr) {
  8491. if (outArr.length > 0) {
  8492. xGame.common.d2World.openCheckStill = true;
  8493. this.playedLastSkill = true;
  8494. }
  8495. let temp;
  8496. for (let index = 0; index < outArr.length; index++) {
  8497. let angle = xGame.common.randomNum(0, 360);
  8498. let linearPercent = xGame.common.randomNum(65, 100);
  8499. temp = outArr[index];
  8500. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8501. }
  8502. }
  8503. setLinearSpeed(angle, rigy, linearPercent) {
  8504. let sin = Math.sin(angle * Math.PI / 180);
  8505. let cos = Math.cos(angle * Math.PI / 180);
  8506. let maxSpeed = 4;
  8507. let speed = new Laya.Vector2();
  8508. speed.x = maxSpeed * linearPercent * sin;
  8509. speed.y = -maxSpeed * linearPercent * cos;
  8510. rigy.applyLinearImpulseToCenter(speed);
  8511. }
  8512. runBreakArmy() {
  8513. xGame.common.d2World.d2Gan.ui.visible = false;
  8514. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8515. let gameUI = xGame.common.gameUI.ui;
  8516. gameUI.skillRod.visible = true;
  8517. gameUI.skillRod.rotation = 110;
  8518. let outArr = this.getAllBallArr();
  8519. if (outArr.length <= 0) {
  8520. gameUI.skillRod.visible = false;
  8521. this.callback && this.callback(0);
  8522. return;
  8523. }
  8524. xGame.common.botherArr(outArr);
  8525. if (this.leveNum >= outArr.length)
  8526. this.leveNum = outArr.length;
  8527. let deleteNum = outArr.length - this.leveNum;
  8528. outArr.splice(0, deleteNum);
  8529. this.extraScore = this.leveNum;
  8530. let potX = gameUI.skillRod.x;
  8531. let potY = gameUI.skillRod.y;
  8532. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8533. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8534. let disArr = [];
  8535. for (let index = 0; index < outArr.length; index++) {
  8536. let obj = outArr[index];
  8537. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8538. dis = Math.pow(dis, 0.5);
  8539. disArr.push(dis);
  8540. }
  8541. this.tweenArr.push(gameUI.skillRod);
  8542. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8543. })).update = Laya.Handler.create(this, (e, t, c) => {
  8544. let angle = gameUI.skillRod.rotation;
  8545. let xx;
  8546. let yy;
  8547. let temp;
  8548. for (let index = 0; index < outArr.length; index++) {
  8549. temp = outArr[index];
  8550. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8551. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8552. yy -= 20;
  8553. temp.gameObj.x = xx;
  8554. temp.gameObj.y = yy;
  8555. temp.d3BallSrc.setTransPos(xx, yy);
  8556. }
  8557. if (angle <= 60) {
  8558. Laya.Tween.clearAll(gameUI.skillRod);
  8559. this.ballFlyToBag(outArr, 150);
  8560. gameUI.skillRod.visible = false;
  8561. }
  8562. }, null, false);
  8563. }
  8564. runIce() {
  8565. let ballArr = xGame.common.d2World.ballArr;
  8566. this.leveNum *= 2;
  8567. if (this.leveNum >= ballArr.length - 1)
  8568. this.leveNum = ballArr.length - 1;
  8569. let tempArr = [];
  8570. let outArr = [];
  8571. for (let index = 0; index < ballArr.length; index++) {
  8572. if (ballArr[index] instanceof D2RootBallSrc)
  8573. continue;
  8574. tempArr.push(ballArr[index]);
  8575. }
  8576. if (tempArr.length <= 0) {
  8577. this.callback && this.callback(0);
  8578. return;
  8579. }
  8580. xGame.common.botherArr(tempArr);
  8581. for (let index = 0; index < this.leveNum; index++) {
  8582. outArr.push(tempArr[index]);
  8583. }
  8584. this.extraScore = this.leveNum;
  8585. let temp;
  8586. for (let index = 0; index < outArr.length; index++) {
  8587. temp = outArr[index];
  8588. temp.d3BallSrc.playIceEft();
  8589. }
  8590. Laya.timer.once(2000, this, () => {
  8591. for (let index = 0; index < outArr.length; index++) {
  8592. temp = outArr[index];
  8593. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8594. temp.setBallFunc("ice", str);
  8595. }
  8596. this.callback && this.callback(0);
  8597. });
  8598. }
  8599. runFireworks() {
  8600. let allArr = this.getAllBallArr();
  8601. if (allArr.length <= 0) {
  8602. this.callback && this.callback(0);
  8603. return;
  8604. }
  8605. xGame.common.d2World.d2Gan.ui.visible = false;
  8606. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8607. let outArr = [];
  8608. let other = this.leveNum;
  8609. if (other > 0) {
  8610. if (allArr.length > 0) {
  8611. xGame.common.botherArr(allArr);
  8612. if (other >= allArr.length)
  8613. other = allArr.length;
  8614. for (let index = 0; index < other; index++) {
  8615. outArr.push(allArr[index]);
  8616. }
  8617. }
  8618. }
  8619. xGame.common.extraMoveNum = other;
  8620. this.extraScore = other;
  8621. this.addRandmomFireworks(outArr);
  8622. }
  8623. addRandmomFireworks(outArr) {
  8624. Laya.timer.once(1100, this, () => {
  8625. if (outArr.length > 0) {
  8626. xGame.common.d2World.openCheckStill = true;
  8627. this.playedLastSkill = true;
  8628. }
  8629. });
  8630. xGame.soundMgr.playSound("skill_04_02");
  8631. let temp;
  8632. let delay = -200;
  8633. for (let index = 0; index < outArr.length; index++) {
  8634. temp = outArr[index];
  8635. delay += 200;
  8636. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8637. let angle = xGame.common.randomNum(0, 360);
  8638. angle = this.getFireworksAngle(obj);
  8639. let linearPercent = xGame.common.randomNum(45, 80);
  8640. if (!obj.destroyed)
  8641. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8642. });
  8643. }
  8644. }
  8645. getFireworksAngle(obj) {
  8646. let rootBall = xGame.common.d2World.rootBall;
  8647. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8648. }
  8649. resetGame() {
  8650. Laya.timer.clearAll(this);
  8651. if (this.tweenArr) {
  8652. for (let index = 0; index < this.tweenArr.length; index++) {
  8653. Laya.Tween.clearAll(this.tweenArr[index]);
  8654. }
  8655. }
  8656. this.tweenArr = null;
  8657. }
  8658. runGuanYu() {
  8659. xGame.common.d2World.d2Gan.ui.visible = false;
  8660. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8661. let rootBall = xGame.common.d2World.rootBall;
  8662. if (rootBall.isInHole) {
  8663. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8664. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8665. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8666. rootBall.showSelf();
  8667. }
  8668. this.rtStarX = rootBall.gameObj.x;
  8669. this.rtStarY = rootBall.gameObj.y;
  8670. this.knifeTimes = 0;
  8671. this.playedLastSkill = true;
  8672. rootBall.forceRun = true;
  8673. rootBall.rigy.type = "static";
  8674. xGame.common.d2World.openCheckStill = true;
  8675. this.guanyuRandomKnife();
  8676. }
  8677. guanyuRandomKnife() {
  8678. let rootBall = xGame.common.d2World.rootBall;
  8679. let dir = this.getRandDir();
  8680. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8681. console.log("当前angle", angle);
  8682. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8683. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8684. let dis = 324;
  8685. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8686. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8687. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8688. this.rtStarX = rootBall.gameObj.x;
  8689. this.rtStarY = rootBall.gameObj.y;
  8690. this.knifeTimes++;
  8691. let skillLevel;
  8692. if (xGame.common.gameMgr.selfTurn) {
  8693. skillLevel = DataMgr.getBigSkillByIndex(4);
  8694. }
  8695. else {
  8696. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8697. }
  8698. if (!skillLevel)
  8699. skillLevel = 1;
  8700. skillLevel += 2;
  8701. if (this.knifeTimes < skillLevel) {
  8702. Laya.timer.once(400, this, () => {
  8703. this.guanyuRandomKnife();
  8704. });
  8705. }
  8706. else {
  8707. rootBall.forceRun = false;
  8708. rootBall.rigy.type = "dynamic";
  8709. xGame.common.extraMoveNum = skillLevel;
  8710. }
  8711. }));
  8712. }
  8713. getRandDir() {
  8714. let rootBall = xGame.common.d2World.rootBall;
  8715. let allBall = this.getAllBallArr();
  8716. let target = xGame.common.getRandArrEle(allBall);
  8717. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8718. return this.knifeV2;
  8719. }
  8720. cloneKnife(x, y, rotation) {
  8721. let parent = xGame.common.d3World.knifeRoot;
  8722. let prefab = xGame.common.d3World.knife;
  8723. let clone = prefab.clone();
  8724. parent.addChild(clone);
  8725. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8726. clone.transform.localPositionX = this.knifeV3.x;
  8727. clone.transform.localPositionY = 0;
  8728. clone.transform.localPositionZ = this.knifeV3.z;
  8729. clone.transform.localRotationEulerX = 0;
  8730. clone.transform.localRotationEulerY = rotation;
  8731. clone.transform.localRotationEulerZ = 0;
  8732. clone.active = true;
  8733. return clone;
  8734. }
  8735. cloneGuanYuEft(x, y, angle) {
  8736. return;
  8737. let parent = xGame.common.gameUI.ui.guanyuNode;
  8738. let eft = new ui_guanyuAni();
  8739. eft.parent = parent;
  8740. eft.x = x;
  8741. eft.y = y;
  8742. eft.rotation = angle;
  8743. }
  8744. }
  8745. class ui_UIWordsList extends fgui.GComponent {
  8746. static createInstance() {
  8747. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8748. }
  8749. onConstruct() {
  8750. this.c1 = this.getController("c1");
  8751. this.n74 = (this.getChild("n74"));
  8752. this.clickNode = (this.getChild("clickNode"));
  8753. this.myNode = (this.getChild("myNode"));
  8754. this.n68 = (this.getChild("n68"));
  8755. this.n66 = (this.getChild("n66"));
  8756. this.n55 = (this.getChild("n55"));
  8757. this.wordsBtn = (this.getChild("wordsBtn"));
  8758. this.emotionBtn = (this.getChild("emotionBtn"));
  8759. this.mybggg = (this.getChild("mybggg"));
  8760. this.wordsList = (this.getChild("wordsList"));
  8761. this.emotionList = (this.getChild("emotionList"));
  8762. this.myRoot = (this.getChild("myRoot"));
  8763. }
  8764. }
  8765. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8766. class EmotionDisplay {
  8767. constructor(index, ui) {
  8768. this.ui = ui;
  8769. this.index = index;
  8770. this.ui.onClick(this, this.clickSelf);
  8771. this.updateSelf();
  8772. }
  8773. updateSelf() {
  8774. let data = cfgTable.emotionData[this.index + 1];
  8775. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8776. }
  8777. clickSelf() {
  8778. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8779. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8780. xGame.common.talkMgr.closeTalkView();
  8781. }
  8782. }
  8783. class WordsDisplay {
  8784. constructor(index, ui) {
  8785. this.ui = ui;
  8786. this.index = index;
  8787. this.ui.onClick(this, this.clickSelf);
  8788. this.updateSelf();
  8789. }
  8790. updateSelf() {
  8791. let data = cfgTable.talkwordsData[this.index + 1];
  8792. this.ui.txt.text = data.msg;
  8793. }
  8794. clickSelf() {
  8795. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8796. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8797. xGame.common.talkMgr.closeTalkView();
  8798. }
  8799. }
  8800. class UIWordsList extends UIBase {
  8801. constructor() {
  8802. super();
  8803. }
  8804. onConstructor() {
  8805. this.ui = ui_UIWordsList.createInstance();
  8806. this.contentPane = this.ui;
  8807. this.isEject = false;
  8808. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8809. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8810. this.addUIClick(this.ui.clickNode, this.hide);
  8811. this.initTalkList();
  8812. this.initEmotionList();
  8813. }
  8814. show() {
  8815. super.show();
  8816. }
  8817. initTalkList() {
  8818. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8819. let data = cfgTable.talkwordsData;
  8820. let length = Object.keys(data).length;
  8821. this.ui.wordsList.numItems = length;
  8822. }
  8823. initEmotionList() {
  8824. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8825. let data = cfgTable.emotionData;
  8826. let length = Object.keys(data).length;
  8827. this.ui.emotionList.numItems = length;
  8828. }
  8829. renderTalkItem(index, obj) {
  8830. let temp = new WordsDisplay(index, obj);
  8831. }
  8832. renderEmotionItem(index, obj) {
  8833. let temp = new EmotionDisplay(index, obj);
  8834. }
  8835. openTalkList() {
  8836. this.ui.c1.selectedIndex = 0;
  8837. }
  8838. openEmotionList() {
  8839. this.ui.c1.selectedIndex = 1;
  8840. }
  8841. }
  8842. UIWordsList.uiName = "UIWordsList";
  8843. class TalkMgr {
  8844. constructor() {
  8845. this.aiSpeak = true;
  8846. this.emotionList = [];
  8847. this.talkList = [];
  8848. this.addEvent();
  8849. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8850. this.emotionList = [];
  8851. this.talkList = [];
  8852. for (let k in cfgTable.emotionData) {
  8853. this.emotionList.push(cfgTable.emotionData[k].id);
  8854. }
  8855. for (let k in cfgTable.talkwordsData) {
  8856. this.talkList.push(cfgTable.talkwordsData[k].id);
  8857. }
  8858. }
  8859. addEvent() {
  8860. let ui = xGame.common.gameUI.ui;
  8861. ui.wordsBtn.visible = true;
  8862. ui.wordsBtn.onClick(this, this.openTalkView);
  8863. ui.aiWordsBtn.visible = true;
  8864. ui.aiWordsBtn.onClick(this, this.clickAIState);
  8865. }
  8866. openTalkView() {
  8867. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8868. xGame.uiMgr.Show(UIWordsList);
  8869. }
  8870. closeTalkView() {
  8871. xGame.uiMgr.Hide(UIWordsList);
  8872. }
  8873. clickAIState() {
  8874. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8875. this.aiSpeak = !this.aiSpeak;
  8876. this.changeAIState(this.aiSpeak);
  8877. }
  8878. changeAIState(speak) {
  8879. this.aiSpeak = speak;
  8880. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  8881. if (speak) {
  8882. btn.c1.selectedIndex = 0;
  8883. }
  8884. else {
  8885. btn.c1.selectedIndex = 1;
  8886. }
  8887. }
  8888. showSelfTalk(wordsId) {
  8889. let ui = xGame.common.gameUI.ui;
  8890. ui.selfTalk.visible = true;
  8891. ui.selfTalk.myNode.c1.selectedIndex = 1;
  8892. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8893. ui.selfTalk.t0.play();
  8894. }
  8895. showSelfEmotion(emotionId) {
  8896. let ui = xGame.common.gameUI.ui;
  8897. ui.selfTalk.visible = true;
  8898. ui.selfTalk.myNode.c1.selectedIndex = 0;
  8899. this.selfSpine && this.selfSpine.dispose();
  8900. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8901. let spineData = cfgTable.emotionData[emotionId].spine;
  8902. this.selfSpine = new SpineMgr(spineData, () => {
  8903. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  8904. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  8905. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8906. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  8907. });
  8908. ui.selfTalk.t0.play();
  8909. }
  8910. showAITalk(wordsId) {
  8911. if (!this.aiSpeak)
  8912. return;
  8913. if (DataMgr.gameData.gameCount < 2)
  8914. return;
  8915. if (wordsId < 1)
  8916. wordsId = this.getRandTalk();
  8917. let ui = xGame.common.gameUI.ui;
  8918. ui.aiTalk.visible = true;
  8919. ui.aiTalk.myNode.c1.selectedIndex = 1;
  8920. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8921. ui.aiTalk.t0.play();
  8922. }
  8923. getRandTalk() {
  8924. let rand = xGame.tools.random(0, this.talkList.length);
  8925. return this.emotionList[rand];
  8926. }
  8927. getRandEmotion() {
  8928. let rand = xGame.tools.random(0, this.emotionList.length);
  8929. return this.emotionList[rand];
  8930. }
  8931. showAIEmotion(emotionId) {
  8932. if (!this.aiSpeak)
  8933. return;
  8934. if (DataMgr.gameData.gameCount < 2)
  8935. return;
  8936. if (emotionId < 1)
  8937. emotionId = this.getRandEmotion();
  8938. let ui = xGame.common.gameUI.ui;
  8939. ui.aiTalk.visible = true;
  8940. ui.aiTalk.myNode.c1.selectedIndex = 0;
  8941. this.aiSpine && this.aiSpine.dispose();
  8942. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8943. let spineData = cfgTable.emotionData[emotionId].spine;
  8944. this.aiSpine = new SpineMgr(spineData, () => {
  8945. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  8946. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  8947. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8948. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  8949. });
  8950. ui.aiTalk.t0.play();
  8951. }
  8952. resetGame() {
  8953. let ui = xGame.common.gameUI.ui;
  8954. ui.aiTalk.visible = false;
  8955. ui.selfTalk.visible = false;
  8956. this.aiSpine && this.aiSpine.dispose();
  8957. this.selfSpine && this.selfSpine.dispose();
  8958. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8959. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8960. this.closeTalkView();
  8961. }
  8962. }
  8963. class WordsMgr {
  8964. constructor() {
  8965. this.comboTimes = 1;
  8966. this.skillTimes = 0;
  8967. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  8968. this.comboSpine = new SpineMgr("yxz_liangan");
  8969. this.skillSpine = new SpineMgr("yiganxqiu");
  8970. this.scoreSpine = new SpineMgr("defen");
  8971. }
  8972. setClassicCombo(isInterrupt) {
  8973. if (isInterrupt) {
  8974. this.comboTimes = 0;
  8975. }
  8976. }
  8977. playClassicWords(type, callback) {
  8978. this.callback = callback;
  8979. let aniIndex = type;
  8980. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8981. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8982. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  8983. mySpine.destroy(true);
  8984. this.playClassicTimes();
  8985. });
  8986. }
  8987. playClassicTimes() {
  8988. this.comboTimes++;
  8989. if (this.comboTimes <= 1) {
  8990. this.callback && this.callback();
  8991. }
  8992. else {
  8993. let aniIndex = this.comboTimes - 1;
  8994. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8995. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8996. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  8997. mySpine.destroy(true);
  8998. this.callback && this.callback();
  8999. });
  9000. }
  9001. }
  9002. playBigSkillTimes(times, callback) {
  9003. if (times <= 0) {
  9004. callback && callback();
  9005. return;
  9006. }
  9007. this.callback = callback;
  9008. let pre = "sz_0";
  9009. let aniIndex = 0;
  9010. this.getWordsImg(times, pre, () => {
  9011. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9012. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9013. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9014. let r1 = ``;
  9015. let r2 = ``;
  9016. if (times <= 9) {
  9017. r1 = `res/d2Res/${pre}${times}.png`;
  9018. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9019. aniIndex = 0;
  9020. }
  9021. else {
  9022. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9023. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9024. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9025. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9026. aniIndex = 1;
  9027. }
  9028. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9029. mySpine.destroy(true);
  9030. xGame.common.gameMgr.playSkillTips();
  9031. this.playScore(times);
  9032. xGame.common.playRandomMutiBallBigSkillSound();
  9033. }, mySpine);
  9034. });
  9035. }
  9036. playScore(score) {
  9037. let pre = "sz_";
  9038. let aniIndex = 0;
  9039. this.getWordsImg(score, pre, () => {
  9040. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9041. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9042. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9043. let r1 = ``;
  9044. let r2 = ``;
  9045. if (score <= 9) {
  9046. r1 = `res/d2Res/${pre}${score}.png`;
  9047. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9048. aniIndex = 0;
  9049. }
  9050. else {
  9051. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9052. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9053. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9054. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9055. aniIndex = 1;
  9056. }
  9057. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9058. mySpine.destroy(true);
  9059. this.callback && this.callback();
  9060. }, mySpine);
  9061. });
  9062. }
  9063. getWordsImg(number, pre = "", callback) {
  9064. let arr = [];
  9065. if (number <= 9) {
  9066. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9067. }
  9068. else {
  9069. 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 });
  9070. }
  9071. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9072. callback && callback();
  9073. }));
  9074. }
  9075. }
  9076. class ui_UIRodMethod extends fgui.GComponent {
  9077. static createInstance() {
  9078. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9079. }
  9080. onConstruct() {
  9081. this.n24 = (this.getChild("n24"));
  9082. this.white = (this.getChild("white"));
  9083. this.dot = (this.getChild("dot"));
  9084. this.sureBtn = (this.getChild("sureBtn"));
  9085. this.n20 = (this.getChild("n20"));
  9086. this.n21 = (this.getChild("n21"));
  9087. this.n22 = (this.getChild("n22"));
  9088. this.n23 = (this.getChild("n23"));
  9089. this.n5 = (this.getChild("n5"));
  9090. this.n14 = (this.getChild("n14"));
  9091. this.t0 = this.getTransition("t0");
  9092. }
  9093. }
  9094. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9095. class UIRodMethod extends UIBase {
  9096. constructor() {
  9097. super();
  9098. this.isPressd = false;
  9099. }
  9100. onConstructor() {
  9101. this.ui = ui_UIRodMethod.createInstance();
  9102. this.contentPane = this.ui;
  9103. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9104. this.moveDir = new Laya.Vector2();
  9105. this.moveDest = new Laya.Vector2();
  9106. this.centerPos = new Laya.Vector2();
  9107. xGame.common.uiRodMethod = this;
  9108. }
  9109. show() {
  9110. super.show();
  9111. xGame.common.gameMgr.gamePause = true;
  9112. this.openPressDotEvent();
  9113. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9114. this.centerPos.x = this.ui.white.x;
  9115. this.centerPos.y = this.ui.white.y;
  9116. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9117. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9118. this.setDot();
  9119. }
  9120. setDot() {
  9121. this.ui.dot.x = this.moveDest.x;
  9122. this.ui.dot.y = this.moveDest.y;
  9123. }
  9124. closeSelf() {
  9125. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9126. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9127. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9128. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9129. xGame.common.gameMgr.gamePause = false;
  9130. this.hide();
  9131. }
  9132. openPressDotEvent() {
  9133. this.closePressDotEvent();
  9134. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9135. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9136. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9137. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9138. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9139. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9140. }
  9141. closePressDotEvent() {
  9142. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9143. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9144. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9145. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9146. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9147. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9148. }
  9149. onDown(e) {
  9150. if (e.type == Laya.Event.MOUSE_DOWN)
  9151. this.isPressd = true;
  9152. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9153. this.isPressd = false;
  9154. if (!this.isPressd)
  9155. return;
  9156. this.moveDest.x = e.stageX;
  9157. this.moveDest.y = e.stageY;
  9158. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9159. if (dis > 6724) {
  9160. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9161. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9162. }
  9163. this.setDot();
  9164. }
  9165. resetRod() {
  9166. this.ui.dot.x = this.ui.white.x;
  9167. this.ui.dot.y = this.ui.white.y;
  9168. this.gameRod.dot.x = this.gameRod.bg.x;
  9169. this.gameRod.dot.y = this.gameRod.bg.y;
  9170. xGame.common.rodOffest.x = 0;
  9171. xGame.common.rodOffest.y = 0;
  9172. }
  9173. }
  9174. UIRodMethod.uiName = "UIRodMethod";
  9175. class UIGame extends UIBase {
  9176. constructor() {
  9177. super();
  9178. this.powerNum = 0;
  9179. this.isD3Inited = false;
  9180. this.isPrePlay = false;
  9181. this.isMoveRod = false;
  9182. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9183. this.rulerDis = 20;
  9184. this.rulerOffset = 0;
  9185. }
  9186. onConstructor() {
  9187. this.ui = ui_UIGame.createInstance();
  9188. this.contentPane = this.ui;
  9189. this.ui.x += xGame.common.sysOffestNum;
  9190. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9191. this.isEject = false;
  9192. xGame.common.gameUI = this;
  9193. this.initSelf();
  9194. }
  9195. isTurnSelf() {
  9196. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9197. return true;
  9198. }
  9199. }
  9200. initSelf() {
  9201. let topUI = this.ui.topNode;
  9202. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9203. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9204. this.barInfo = {};
  9205. this.barInfo.curY = 0;
  9206. this.barInfo.height = this.ui.powerNode.height;
  9207. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9208. this.barInfo.powerStartY = this.ui.powerNode.y;
  9209. xGame.common.aiPlayer = new AIPlayer();
  9210. xGame.common.gameMgr = new GameMgr();
  9211. xGame.common.skillMgr = new SkillMgr();
  9212. xGame.common.wordsMgr = new WordsMgr();
  9213. xGame.common.talkMgr = new TalkMgr();
  9214. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9215. console.log("加载经典模式表情文件chenggon !");
  9216. });
  9217. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9218. console.log("挑战模式奖励模式spine加载成功!");
  9219. });
  9220. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9221. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9222. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9223. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9224. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9225. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9226. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9227. }
  9228. returnHome() {
  9229. let tips = "Are you sure to exit the game?";
  9230. let woman = "Boss, why don't you play for a while longer?";
  9231. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9232. }
  9233. addRodMethodClick() {
  9234. if (this.isTurnSelf()) {
  9235. xGame.uiMgr.Show(UIRodMethod);
  9236. }
  9237. }
  9238. clickHelpLineBtn(force = false) {
  9239. if (!this.isTurnSelf())
  9240. return;
  9241. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9242. if (success) {
  9243. xGame.common.longHelpLine = true;
  9244. xGame.common.d2World.getHelpLine();
  9245. Moyu.sendDataEvent("guideNum");
  9246. }
  9247. else {
  9248. }
  9249. });
  9250. }
  9251. renderSelfDisplayBalls(index, target) {
  9252. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9253. target.myImg.url = xGame.common.getGameIconUrl(str);
  9254. }
  9255. renderAIDisplayBalls(index, target) {
  9256. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9257. target.myImg.url = xGame.common.getGameIconUrl(str);
  9258. ;
  9259. }
  9260. updateMode() {
  9261. if (xGame.common.gameMode == GameMode.classic) {
  9262. this.ui.topNode.scoreNode.visible = false;
  9263. }
  9264. else if (xGame.common.gameMode == GameMode.bigMove) {
  9265. this.ui.topNode.scoreNode.visible = true;
  9266. }
  9267. }
  9268. show() {
  9269. super.show();
  9270. console.log("zh:uigame show");
  9271. this.ui.alpha = 0;
  9272. this.updateSelf();
  9273. console.log("zh:uigame bf gamemusic01 start");
  9274. xGame.soundMgr.playMusic("gamemusic01");
  9275. console.log("zh:uigame bf gamemusic01 end");
  9276. xGame.common.gameMgr.gamePause = false;
  9277. xGame.common.gameUI.ui.blackAni.visible = false;
  9278. xGame.common.gameUI.ui.whiteAni.visible = false;
  9279. this.ui.powerEft.visible = false;
  9280. this.ui.colorNode.visible = false;
  9281. this.updateHead();
  9282. }
  9283. updateSelf() {
  9284. if (xGame.common.gameMode == GameMode.classic) {
  9285. this.ui.c1.selectedIndex = 0;
  9286. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9287. this.ui.topNode.middleNode.visible = true;
  9288. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9289. }
  9290. else if (xGame.common.gameMode == GameMode.bigMove) {
  9291. this.ui.c1.selectedIndex = 0;
  9292. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9293. this.ui.topNode.middleNode.visible = false;
  9294. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9295. let rand = xGame.common.randomNum(1, max);
  9296. let guide = DataMgr.getSkillGuide();
  9297. if (guide == 0)
  9298. rand = 1;
  9299. xGame.common.bigMoveLevelIndex = rand;
  9300. }
  9301. else if (xGame.common.gameMode == GameMode.placeBall) {
  9302. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9303. this.ui.c1.selectedIndex = 1 + data.type;
  9304. this.ui.alpha = 1;
  9305. this.startGame();
  9306. }
  9307. this.updateMode();
  9308. this.initD3world();
  9309. this.initD2world();
  9310. }
  9311. startGame() {
  9312. this.ui.snowNode.visible = Math.random() <= 0.1;
  9313. this.ui.d2Node.visible = false;
  9314. xGame.common.d3World.d3Hand.gameObj.active = false;
  9315. xGame.common.d3World.tableSrc.init();
  9316. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9317. this.cameraViewChange(() => {
  9318. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9319. switch (xGame.common.gameMode) {
  9320. case GameMode.classic:
  9321. xGame.common.d3World.d3Hand.gameObj.active = true;
  9322. this.playPutBallD3Ani();
  9323. break;
  9324. case GameMode.bigMove:
  9325. this.enterGame();
  9326. Laya.timer.once(500, this, () => {
  9327. this.ui.topNode.middleNode.visible = true;
  9328. this.ui.topNode.middleNode.t0.play();
  9329. });
  9330. break;
  9331. case GameMode.placeBall:
  9332. this.enterGame();
  9333. break;
  9334. default:
  9335. break;
  9336. }
  9337. });
  9338. PlatMgr.showBanner(false);
  9339. }
  9340. enterGame() {
  9341. this.ui.d2Node.visible = true;
  9342. xGame.common.d3World.d3Hand.gameObj.active = false;
  9343. xGame.common.showOneCamera("mainCamera");
  9344. Moyu.recordGame(30, true);
  9345. if (!this.isPrePlay) {
  9346. this.isPrePlay = true;
  9347. xGame.common.d3World.prePlayEft();
  9348. }
  9349. xGame.common.gameMgr.gameReady();
  9350. this.openAllEvent();
  9351. this.ui.snowNode.visible = false;
  9352. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9353. this.ui.helpBtn.visible = condition;
  9354. }
  9355. showHelpLineGuide() {
  9356. let longGuide = DataMgr.getGuideHelpLine();
  9357. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9358. this.ui.helpBtn.visible = true;
  9359. this.ui.guideNode.visible = true;
  9360. }
  9361. }
  9362. setTurnAlpha(alpha) {
  9363. this.ui.keduNode.alpha = alpha;
  9364. this.ui.ganNode.alpha = alpha;
  9365. this.ui.rodMethodNode.alpha = alpha;
  9366. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9367. }
  9368. cameraViewChange(callback) {
  9369. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9370. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9371. xGame.common.showOneCamera("visitAngle");
  9372. cameraSrc.localRotationEulerY = 180;
  9373. cameraSrc.localRotationEulerZ = 0;
  9374. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9375. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9376. callback && callback();
  9377. }));
  9378. }));
  9379. }
  9380. playPutBallD3Ani() {
  9381. xGame.common.showOneCamera("mainCamera");
  9382. let handSrc = xGame.common.d3World.d3Hand;
  9383. handSrc.gameObj.active = true;
  9384. handSrc.transform.localPositionZ = 3;
  9385. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9386. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9387. handSrc.gameObj.active = false;
  9388. this.enterGame();
  9389. }), 400);
  9390. }));
  9391. }
  9392. updateHead() {
  9393. let user = Moyu.getUserInfo();
  9394. this.ui.topNode.selfNameTxt.text = user.nickName;
  9395. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9396. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9397. if (DataMgr.getSkillGuide() < 1) {
  9398. this.ui.topNode.aiNameTxt.text = 'billiards';
  9399. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9400. }
  9401. else {
  9402. this.ui.topNode.aiNameTxt.text = aiData.name;
  9403. let randNo = Math.floor(Math.random() * 10) + 1;
  9404. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9405. }
  9406. }
  9407. initD2world() {
  9408. let node = this.ui.d2Root.displayObject;
  9409. let src = node.getComponent(D2World);
  9410. if (!src) {
  9411. xGame.common.d2World = node.addComponent(D2World);
  9412. }
  9413. xGame.common.d2World.initSelf();
  9414. }
  9415. initD3world() {
  9416. if (this.isD3Inited)
  9417. return;
  9418. this.isD3Inited = true;
  9419. let scene3D = xGame.common.d3Scene;
  9420. this.ui.d3Root.displayObject.addChild(scene3D);
  9421. scene3D.active = true;
  9422. xGame.common.d3World.tableSrc.setBorderPos();
  9423. }
  9424. onRootMove(e) {
  9425. let rootBall = xGame.common.d2World.rootBall;
  9426. this.ui.moveNode.x = e.x;
  9427. this.ui.moveNode.y = e.y;
  9428. rootBall.gameObj.x = e.x;
  9429. rootBall.gameObj.y = e.y;
  9430. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9431. }
  9432. aiRootMove(move) {
  9433. if (move)
  9434. this.hideBallUI();
  9435. else {
  9436. this.showBallUI();
  9437. xGame.common.d2World.getHelpLine();
  9438. }
  9439. }
  9440. aiForce(type, force = 0) {
  9441. this.pressTarget = PressType.powerNode;
  9442. if (type == 1)
  9443. this.onEventUp({ force: true });
  9444. else if (type == 2)
  9445. this.onEventMove({ stageY: force, force: true });
  9446. }
  9447. onEventPress(e) {
  9448. if (e.stopPropagation)
  9449. e.stopPropagation();
  9450. if (!this.isTurnSelf())
  9451. return;
  9452. let target = e.target;
  9453. switch (target) {
  9454. case this.ui.myPowerNode.displayObject:
  9455. this.pressTarget = PressType.powerNode;
  9456. this.barInfo.curY = e.stageY;
  9457. this.updateBarInfo();
  9458. break;
  9459. case this.ui.moveNode.displayObject:
  9460. this.pressTarget = PressType.moveNode;
  9461. this.hideBallUI();
  9462. this.eventObj.curX = this.ui.moveNode.x;
  9463. this.eventObj.curY = this.ui.moveNode.y;
  9464. this.ui.moveNode.finger.visible = false;
  9465. this.eventObj.lastX = e.stageX;
  9466. this.eventObj.lastY = e.stageY;
  9467. break;
  9468. case this.ui.rulerClickNode.displayObject:
  9469. this.pressTarget = PressType.rulerNode;
  9470. this.eventObj.lastY = e.stageY;
  9471. break;
  9472. case this.ui.d2Root.displayObject:
  9473. this.pressTarget = PressType.d2Root;
  9474. this.eventObj.lastX = e.stageX;
  9475. this.eventObj.lastY = e.stageY;
  9476. this.eventObj.starX = e.stageX;
  9477. this.eventObj.starY = e.stageY;
  9478. this.eventObj.curX = 0;
  9479. this.eventObj.curY = 0;
  9480. xGame.common.d2World.d2Gan.setGanLastInfo();
  9481. this.rulerOffset = 0;
  9482. break;
  9483. default:
  9484. break;
  9485. }
  9486. }
  9487. onEventMove(e) {
  9488. if (e.stopPropagation)
  9489. e.stopPropagation();
  9490. if (e && e.force) {
  9491. }
  9492. else {
  9493. if (!this.isTurnSelf())
  9494. return;
  9495. }
  9496. switch (this.pressTarget) {
  9497. case PressType.powerNode:
  9498. this.barInfo.curY = e.stageY;
  9499. this.updateBarInfo();
  9500. this.isMoveRod = true;
  9501. break;
  9502. case PressType.moveNode:
  9503. let rootBall = xGame.common.d2World.rootBall;
  9504. let radius = rootBall.gameObj.width / 2;
  9505. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9506. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9507. let border = xGame.common.d2World.borderRect;
  9508. if (curX <= border.x + radius)
  9509. curX = border.x + radius;
  9510. else if (curX >= border.x + border.width - radius)
  9511. curX = border.x + border.width - radius;
  9512. if (curY <= border.y + radius)
  9513. curY = border.y + radius;
  9514. else if (curY >= border.y + border.height - radius)
  9515. curY = border.y + border.height - radius;
  9516. if (xGame.common.gameMgr.isOpenBall) {
  9517. if (curX >= border.x + border.openBallW - radius)
  9518. curX = border.x + border.openBallW - radius;
  9519. }
  9520. this.ui.moveNode.x = curX;
  9521. this.ui.moveNode.y = curY;
  9522. rootBall.gameObj.x = curX;
  9523. rootBall.gameObj.y = curY;
  9524. rootBall.d3BallSrc.setTransPos(curX, curY);
  9525. this.isMoveRod = true;
  9526. break;
  9527. case PressType.rulerNode:
  9528. let yy = e.stageY - this.eventObj.lastY;
  9529. this.eventObj.lastY = e.stageY;
  9530. let ruler1 = this.ui.rulerNode.img1;
  9531. let ruler2 = this.ui.rulerNode.img2;
  9532. ruler1.y += yy;
  9533. ruler2.y += yy;
  9534. this.rulerOffset += yy;
  9535. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9536. this.rulerOffset = 0;
  9537. xGame.soundMgr.playSound("inch", 1, 10);
  9538. }
  9539. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9540. let h = ruler1.height;
  9541. this.checkGuide();
  9542. this.isMoveRod = true;
  9543. if (ruler1.y >= h) {
  9544. ruler1.y = -h;
  9545. ruler2.y = 0;
  9546. return;
  9547. }
  9548. else if (ruler1.y <= -h) {
  9549. ruler1.y = h;
  9550. ruler2.y = 0;
  9551. return;
  9552. }
  9553. if (ruler2.y >= h) {
  9554. ruler2.y = -h;
  9555. ruler1.y = 0;
  9556. return;
  9557. }
  9558. else if (ruler2.y <= -h) {
  9559. ruler2.y = h;
  9560. ruler1.y = 0;
  9561. return;
  9562. }
  9563. break;
  9564. case PressType.d2Root:
  9565. this.eventObj.curX = e.stageX;
  9566. this.eventObj.curY = e.stageY;
  9567. let offset = this.checkRodMoveDir();
  9568. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9569. this.eventObj.lastX = e.stageX;
  9570. this.eventObj.lastY = e.stageY;
  9571. break;
  9572. default:
  9573. break;
  9574. }
  9575. }
  9576. onEventUp(e) {
  9577. if (e.stopPropagation)
  9578. e.stopPropagation();
  9579. if (e && e.force) {
  9580. }
  9581. else {
  9582. if (!this.isTurnSelf())
  9583. return;
  9584. }
  9585. switch (this.pressTarget) {
  9586. case PressType.powerNode:
  9587. this.ui.powerNode.value = 0;
  9588. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9589. this.ui.powerTxt.text = "";
  9590. if (this.powerNum > 0) {
  9591. xGame.eventMgr.event(BALL_SHOOT);
  9592. xGame.common.d2World.shoot(this.powerNum);
  9593. xGame.common.d2World.d2Gan.shoot();
  9594. xGame.common.d2World.d2HelpLine.shoot();
  9595. this.finishGuide();
  9596. this.ui.powerEft.visible = false;
  9597. this.ui.colorNode.visible = false;
  9598. let ganStr = "";
  9599. if (this.powerNum <= 30) {
  9600. ganStr = "gan_30";
  9601. }
  9602. else if (this.powerNum <= 60) {
  9603. ganStr = "gan_50";
  9604. }
  9605. else {
  9606. ganStr = "gan_80";
  9607. }
  9608. xGame.soundMgr.playSound(ganStr);
  9609. }
  9610. break;
  9611. case PressType.moveNode:
  9612. let rootBall = xGame.common.d2World.rootBall;
  9613. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9614. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9615. let isIntersect = this.judgeBallIntersect();
  9616. if (isIntersect) {
  9617. this.ui.moveNode.x = lastX;
  9618. this.ui.moveNode.y = lastY;
  9619. rootBall.gameObj.x = lastX;
  9620. rootBall.gameObj.y = lastY;
  9621. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9622. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9623. }
  9624. else {
  9625. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9626. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9627. }
  9628. this.showBallUI();
  9629. this.ui.moveNode.finger.visible = true;
  9630. xGame.common.d2World.getHelpLine();
  9631. break;
  9632. case PressType.rulerNode:
  9633. break;
  9634. case PressType.d2Root:
  9635. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9636. if (dis <= 25) {
  9637. this.moveToClickDot(e);
  9638. }
  9639. break;
  9640. default:
  9641. break;
  9642. }
  9643. this.pressTarget = -1;
  9644. }
  9645. checkGuide() {
  9646. let guide = DataMgr.getSkillGuide();
  9647. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9648. xGame.common.guideStep++;
  9649. xGame.common.gameUI.ui.guide2.visible = false;
  9650. xGame.common.gameUI.ui.guide3.visible = true;
  9651. }
  9652. }
  9653. finishGuide() {
  9654. let guide = DataMgr.getSkillGuide();
  9655. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9656. xGame.common.guideStep = 10;
  9657. this.closeAllGuide();
  9658. }
  9659. }
  9660. closeAllGuide() {
  9661. xGame.common.gameUI.ui.guide1.visible = false;
  9662. xGame.common.gameUI.ui.guide2.visible = false;
  9663. xGame.common.gameUI.ui.guide3.visible = false;
  9664. }
  9665. updateBarInfo() {
  9666. let star = this.ui.powerNode.y;
  9667. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9668. if (rate >= 1)
  9669. rate = 1;
  9670. if (rate <= 0)
  9671. rate = 0;
  9672. this.powerNum = Math.ceil(rate * 100);
  9673. this.ui.powerNode.value = this.powerNum;
  9674. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9675. this.ui.colorNode.value = this.powerNum;
  9676. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9677. this.ui.powerEft.visible = this.powerNum != 0;
  9678. this.ui.colorNode.visible = this.powerNum != 0;
  9679. this.ui.powerTxt.text = this.powerNum + "";
  9680. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9681. }
  9682. forceCancel() {
  9683. this.ui.powerNode.value = 0;
  9684. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9685. this.ui.powerTxt.text = "";
  9686. }
  9687. checkRodMoveDir() {
  9688. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9689. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9690. if (tempX >= 0 && tempY <= 0) {
  9691. return this.checkDir();
  9692. }
  9693. else if (tempX < 0 && tempY < 0) {
  9694. return this.checkDir(1, -1);
  9695. }
  9696. else if (tempX < 0 && tempY > 0) {
  9697. return this.checkDir(-1, -1);
  9698. }
  9699. else {
  9700. return this.checkDir(-1, 1);
  9701. }
  9702. }
  9703. checkDir(flagX = 1, flagY = 1) {
  9704. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9705. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9706. if (offsetY == 0) {
  9707. return offsetX * flagX;
  9708. }
  9709. if (offsetX == 0) {
  9710. return offsetY * flagY;
  9711. }
  9712. let angle = offsetY / offsetX;
  9713. if (Math.abs(angle) >= 1) {
  9714. return offsetY * flagY;
  9715. }
  9716. else {
  9717. return offsetX * flagX;
  9718. }
  9719. }
  9720. judgeBallIntersect() {
  9721. let rootBall = xGame.common.d2World.rootBall;
  9722. let ballArr = xGame.common.d2World.ballArr;
  9723. let radius = rootBall.gameObj.width / 2;
  9724. let temp;
  9725. let isIntersect = false;
  9726. for (let index = 0; index < ballArr.length; index++) {
  9727. temp = ballArr[index];
  9728. if (temp.number == rootBall.number)
  9729. continue;
  9730. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9731. if (isIntersect) {
  9732. break;
  9733. }
  9734. }
  9735. return isIntersect;
  9736. }
  9737. hideBallUI() {
  9738. let d2Gan = xGame.common.d2World.d2Gan;
  9739. if (!d2Gan.ui.isDisposed)
  9740. d2Gan.ui.visible = false;
  9741. let d2Help = xGame.common.d2World.d2HelpLine;
  9742. if (!d2Help.ui.isDisposed)
  9743. d2Help.ui.visible = false;
  9744. let rootBall = xGame.common.d2World.rootBall;
  9745. if (!rootBall.destroyed) {
  9746. rootBall.gameObj.active = false;
  9747. }
  9748. }
  9749. showBallUI() {
  9750. let d2Gan = xGame.common.d2World.d2Gan;
  9751. if (!d2Gan.ui.isDisposed)
  9752. d2Gan.ui.visible = true;
  9753. let d2Help = xGame.common.d2World.d2HelpLine;
  9754. if (!d2Help.ui.isDisposed)
  9755. d2Help.ui.visible = true;
  9756. let rootBall = xGame.common.d2World.rootBall;
  9757. if (!rootBall.destroyed) {
  9758. rootBall.gameObj.active = true;
  9759. }
  9760. }
  9761. moveToClickDot(e) {
  9762. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9763. let root = xGame.common.d2World.rootBall.gameObj;
  9764. let xx = e.stageX - xGame.common.sysOffestNum;
  9765. let yy = e.stageY;
  9766. let x = xx - root.x;
  9767. let y = yy - root.y;
  9768. let angle = xGame.common.getfguiRotation(x, y);
  9769. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9770. xGame.common.d2World.getHelpLine();
  9771. }
  9772. this.isMoveRod = false;
  9773. xGame.common.clickedBall = false;
  9774. }
  9775. openAllEvent() {
  9776. this.closeAllEvent();
  9777. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9778. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9779. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9780. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9781. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9782. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9783. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9784. }
  9785. closeAllEvent() {
  9786. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9787. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9788. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9789. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9790. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9791. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9792. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9793. }
  9794. resetGame() {
  9795. this.closeAllEvent();
  9796. this.hideBallUI();
  9797. xGame.common.gameMgr.gamePause = true;
  9798. }
  9799. }
  9800. UIGame.uiName = "UIGame";
  9801. class UIAddProp extends UIBase {
  9802. constructor() {
  9803. super();
  9804. this.curType = "";
  9805. }
  9806. onConstructor() {
  9807. this.ui = ui_UIAddProp.createInstance();
  9808. this.contentPane = this.ui;
  9809. this.isEject = false;
  9810. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9811. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9812. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9813. this.updateUI();
  9814. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9815. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9816. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9817. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9818. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9819. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9820. }
  9821. show(type) {
  9822. super.show();
  9823. this.curType = type == 0 ? "coin" : "diamond";
  9824. this.switchBtn("");
  9825. this.ui.t0.play();
  9826. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9827. PlatMgr.showInsert(true);
  9828. }
  9829. closeSelf() {
  9830. this.hide();
  9831. }
  9832. updateUI() {
  9833. let data = cfgTable.moneyData;
  9834. let temp;
  9835. let obj;
  9836. for (const key in data) {
  9837. temp = data[key];
  9838. obj = this.ui.myNode["node" + key];
  9839. if (parseInt(key) <= 2) {
  9840. obj.diamondTxt.text = "+" + temp.num;
  9841. }
  9842. else {
  9843. obj.coinTxt.text = temp.num;
  9844. obj.diamondTxt.text = temp.get.split('_')[1];
  9845. }
  9846. }
  9847. this.updateDiamondShare();
  9848. }
  9849. updateDiamondShare() {
  9850. let data = DataMgr.getShareDiamondTimes();
  9851. if (data >= xGame.common.maxShareDiamondTimes) {
  9852. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  9853. this.ui.myNode.node1.touchable = false;
  9854. }
  9855. else {
  9856. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9857. this.ui.myNode.node1.touchable = true;
  9858. }
  9859. }
  9860. switchBtn(type) {
  9861. if (type == "")
  9862. type = this.curType;
  9863. else {
  9864. if (this.curType == type) {
  9865. return;
  9866. }
  9867. else {
  9868. this.curType = type;
  9869. }
  9870. }
  9871. if (type == "coin") {
  9872. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9873. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9874. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9875. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9876. this.ui.myNode.c1.selectedIndex = 0;
  9877. }
  9878. else {
  9879. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9880. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9881. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9882. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9883. this.ui.myNode.c1.selectedIndex = 1;
  9884. }
  9885. }
  9886. convertCoin(index) {
  9887. let data = cfgTable.moneyData[index];
  9888. let coinNum = data.num;
  9889. let str = data.get.split('_')[1];
  9890. let needDiamond = parseInt(str);
  9891. if (DataMgr.diamondEnough(needDiamond)) {
  9892. DataMgr.setDiamond(-needDiamond);
  9893. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9894. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  9895. }
  9896. else {
  9897. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  9898. this.switchBtn("diamond");
  9899. }
  9900. }
  9901. videoGetDiamond() {
  9902. let num = cfgTable.moneyData[2].num;
  9903. Moyu.showVideoAd(() => {
  9904. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9905. this.closeSelf();
  9906. }, EAdType.addDiamond);
  9907. }
  9908. videoGetCoin() {
  9909. Moyu.showVideoAd(() => {
  9910. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9911. this.closeSelf();
  9912. }, EAdType.addCoin);
  9913. }
  9914. shareGetDiamond() {
  9915. let times = DataMgr.getShareDiamondTimes();
  9916. if (times >= xGame.common.maxShareDiamondTimes) {
  9917. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  9918. }
  9919. else {
  9920. if (Moyu.isTT) {
  9921. let num = cfgTable.moneyData[1].num;
  9922. Moyu.shareVideo = '';
  9923. Moyu.shareGame((success) => {
  9924. if (success) {
  9925. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9926. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9927. DataMgr.setShareDiamondTimes(1);
  9928. this.updateDiamondShare();
  9929. }
  9930. else {
  9931. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9932. }
  9933. });
  9934. }
  9935. else {
  9936. Moyu.showVideoAd(() => {
  9937. let diamond = xGame.common.randomNum(50, 100);
  9938. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9939. DataMgr.setShareDiamondTimes(1);
  9940. this.updateDiamondShare();
  9941. }, EAdType.randomDiamond);
  9942. }
  9943. }
  9944. }
  9945. openPutBallView() {
  9946. let end = xGame.uiMgr.getUI(UIGameEnd);
  9947. let skill = xGame.uiMgr.getUI(UISkill);
  9948. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9949. let uigame = xGame.uiMgr.getUI(UIGame);
  9950. if (end && !end.isHide) {
  9951. xGame.uiMgr.Hide(UIGameEnd);
  9952. xGame.uiMgr.Show(UIMain);
  9953. }
  9954. if (skill && !skill.isHide)
  9955. xGame.uiMgr.Hide(UISkill);
  9956. if (uigame && !uigame.isHide)
  9957. xGame.uiMgr.Hide(UIGame);
  9958. if (level && !level.isHide) {
  9959. }
  9960. else {
  9961. xGame.uiMgr.Show(UILevelDisplay);
  9962. }
  9963. this.closeSelf();
  9964. }
  9965. }
  9966. UIAddProp.uiName = "UIAddProp";
  9967. class MoneyNode {
  9968. constructor(ui) {
  9969. this.leftTime = 0;
  9970. this.ui = ui;
  9971. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9972. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9973. this.ui.addPowerBtn.onClick(this, this.addPower);
  9974. this.ui.c1.selectedIndex = 1;
  9975. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9976. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9977. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9978. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  9979. this.coinChange();
  9980. this.diamondChange();
  9981. this.powerChange();
  9982. }
  9983. addPower() {
  9984. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9985. xGame.uiMgr.Show(UIPower);
  9986. }
  9987. powerChange() {
  9988. let powerNum = DataMgr.getPower();
  9989. this.ui.powerTxt.text = powerNum + "";
  9990. }
  9991. checkPowerTime() {
  9992. let cur = new Date().getTime();
  9993. let last = DataMgr.getPowerTime();
  9994. if (last == 0) {
  9995. last = cur;
  9996. DataMgr.setPowerTime(cur);
  9997. }
  9998. let power = DataMgr.getPower();
  9999. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10000. Laya.timer.clearAll(this);
  10001. if (power >= xGame.common.natureMaxPower) {
  10002. this.ui.powerTimeTxt.text = "";
  10003. DataMgr.setPowerTime(cur);
  10004. return;
  10005. }
  10006. if (power + offset >= xGame.common.natureMaxPower) {
  10007. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10008. this.ui.powerTimeTxt.text = "";
  10009. DataMgr.setPowerTime(cur);
  10010. }
  10011. else {
  10012. if (offset > 0) {
  10013. DataMgr.setPower(offset);
  10014. DataMgr.setPowerTime(cur);
  10015. }
  10016. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10017. this.leftTime = xGame.common.powerRecoverNum - time;
  10018. if (this.leftTime <= 0)
  10019. this.leftTime = 0;
  10020. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10021. Laya.timer.loop(1000, this, this.updatePowerTime);
  10022. }
  10023. }
  10024. updatePowerTime() {
  10025. this.leftTime -= 1;
  10026. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10027. if (this.leftTime <= 0) {
  10028. this.checkPowerTime();
  10029. }
  10030. }
  10031. coinChange() {
  10032. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10033. }
  10034. diamondChange() {
  10035. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10036. }
  10037. addCoin() {
  10038. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10039. Moyu.sendDataEvent("AddCoinBtn");
  10040. xGame.uiMgr.Show(UIAddProp, 0);
  10041. }
  10042. addDiamond() {
  10043. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10044. Moyu.sendDataEvent("AddDiamondBtn");
  10045. xGame.uiMgr.Show(UIAddProp, 1);
  10046. }
  10047. }
  10048. class UIDraw extends UIBase {
  10049. constructor() {
  10050. super();
  10051. this.curKey = 0;
  10052. }
  10053. onConstructor() {
  10054. this.ui = ui_UIDraw.createInstance();
  10055. this.contentPane = this.ui;
  10056. this.isEject = false;
  10057. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10058. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10059. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10060. this.initDraw();
  10061. this.initUI();
  10062. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10063. if (Moyu.isKs)
  10064. this.ui.closeNode.closeBtn.x += 100;
  10065. }
  10066. show() {
  10067. super.show();
  10068. this.ui.t0.play();
  10069. this.playSecretaryIdle();
  10070. this.updateDraw();
  10071. this.checkFree();
  10072. if (PlatMgr.bannerDelay > 0) {
  10073. this.ui.closeNode.closeBtn.visible = false;
  10074. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10075. this.ui.closeNode.closeBtn.visible = true;
  10076. });
  10077. }
  10078. PlatMgr.showRateBanner();
  10079. }
  10080. hide() {
  10081. Laya.timer.clearAll(this);
  10082. super.hide();
  10083. }
  10084. checkFree() {
  10085. let isFree = DataMgr.getDailyfreeDrawTimes();
  10086. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10087. }
  10088. initDraw() {
  10089. this.drawObj = [];
  10090. let data = cfgTable.drawData;
  10091. let temp;
  10092. let weight = 0;
  10093. for (const key in data) {
  10094. temp = data[key];
  10095. weight += temp.weight;
  10096. this.drawObj.push(weight);
  10097. }
  10098. this.allWeight = weight;
  10099. }
  10100. initUI() {
  10101. let data = cfgTable.drawData;
  10102. let temp;
  10103. let img;
  10104. let txt;
  10105. for (const key in data) {
  10106. temp = data[key];
  10107. img = this.ui.myNode.rotNode["img" + key];
  10108. txt = this.ui.myNode.rotNode["txt" + key];
  10109. img.url = xGame.common.getGameIconUrl(temp.icon);
  10110. txt.visible = true;
  10111. if (temp.award > 2) {
  10112. img.rotation = 0;
  10113. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10114. }
  10115. else {
  10116. img.rotation = temp.rotation;
  10117. txt.text = temp.num;
  10118. }
  10119. }
  10120. }
  10121. getCurkey() {
  10122. let rand = Math.random() * this.allWeight;
  10123. let temp;
  10124. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10125. temp = this.drawObj[index];
  10126. if (index == 0) {
  10127. if (rand < temp) {
  10128. return index + 1;
  10129. }
  10130. }
  10131. else {
  10132. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10133. return index + 1;
  10134. }
  10135. }
  10136. }
  10137. return 2;
  10138. }
  10139. startDraw() {
  10140. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10141. if (freeTimes > 0) {
  10142. this.beginDraw();
  10143. DataMgr.setDailyfreeDrawTimes(0);
  10144. this.checkFree();
  10145. }
  10146. else {
  10147. Moyu.sendDataEvent("turntable");
  10148. Moyu.showVideoAd(() => {
  10149. this.beginDraw();
  10150. }, EAdType.draw);
  10151. }
  10152. }
  10153. beginDraw() {
  10154. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10155. this.ui.drawBtn.touchable = false;
  10156. this.curKey = this.getCurkey();
  10157. console.log("当前key", this.curKey);
  10158. let cell = 60;
  10159. let lap = 3;
  10160. let angle = cell * (this.curKey - 1) + lap * 360;
  10161. let target = this.ui.myNode.rotNode;
  10162. target.rotation = 0;
  10163. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10164. console.log("旋转完成");
  10165. this.ui.drawBtn.touchable = true;
  10166. this.getAward();
  10167. }));
  10168. }
  10169. getAward() {
  10170. let data = cfgTable.drawData[this.curKey];
  10171. let temp = new AwardType();
  10172. temp.type = data.award;
  10173. temp.num = data.num;
  10174. xGame.common.getAward([temp], () => {
  10175. DataMgr.setDrawTimes(1);
  10176. this.updateDraw();
  10177. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10178. });
  10179. }
  10180. updateDraw() {
  10181. let drawTimes = DataMgr.getDrawTimes();
  10182. let awardTimes = DataMgr.getDrawAwardTimes();
  10183. if (Math.floor(drawTimes / 3) > awardTimes) {
  10184. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10185. this.ui.extraNode.boxBtn.touchable = true;
  10186. this.ui.extraNode.tipsTxt.text = "3/3";
  10187. this.ui.extraNode.barNode.width = 265;
  10188. this.getExtraAward();
  10189. }
  10190. else {
  10191. this.ui.extraNode.boxBtn.t0.stop();
  10192. this.ui.extraNode.boxBtn.touchable = false;
  10193. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10194. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10195. }
  10196. let data = cfgTable.drawData[1];
  10197. if (awardTimes == 0) {
  10198. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10199. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10200. this.ui.myNode.rotNode.img1.rotation = 0;
  10201. }
  10202. else {
  10203. let award = data.nextid;
  10204. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10205. this.ui.myNode.rotNode.txt1.text = award[1];
  10206. this.ui.myNode.rotNode.img1.rotation = 0;
  10207. }
  10208. }
  10209. getExtraAward() {
  10210. let drawTimes = DataMgr.getDrawTimes();
  10211. let awardTimes = DataMgr.getDrawAwardTimes();
  10212. let data = cfgTable.drawData[1];
  10213. let award = new AwardType();
  10214. if (awardTimes == 0) {
  10215. award.num = data.num;
  10216. award.type = data.award;
  10217. xGame.common.getAward([award], () => {
  10218. let all = Math.floor(drawTimes / 3);
  10219. DataMgr.setDrawAwardTimes(all);
  10220. this.updateDraw();
  10221. });
  10222. }
  10223. else {
  10224. award.num = parseInt(data.nextid[1]);
  10225. award.type = parseInt(data.nextid[0]);
  10226. xGame.common.getAward([award], () => {
  10227. let all = Math.floor(drawTimes / 3);
  10228. DataMgr.setDrawAwardTimes(all);
  10229. this.updateDraw();
  10230. });
  10231. }
  10232. }
  10233. closeSelf() {
  10234. this.hide();
  10235. }
  10236. playSecretaryIdle() {
  10237. let parent = this.ui.secretary.displayObject;
  10238. parent.destroyChildren();
  10239. let xx = this.ui.secretary.width / 2;
  10240. let yy = this.ui.secretary.height;
  10241. let scale = xGame.common.getSecretaryScale();
  10242. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10243. xGame.common.secretary.play(data, 1, true, parent);
  10244. }
  10245. }
  10246. UIDraw.uiName = "UIDraw";
  10247. class ui_UIFlyEft extends fgui.GComponent {
  10248. static createInstance() {
  10249. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10250. }
  10251. onConstruct() {
  10252. this.n0 = (this.getChild("n0"));
  10253. this.n1 = (this.getChild("n1"));
  10254. this.n2 = (this.getChild("n2"));
  10255. this.n3 = (this.getChild("n3"));
  10256. this.n4 = (this.getChild("n4"));
  10257. this.n5 = (this.getChild("n5"));
  10258. this.n6 = (this.getChild("n6"));
  10259. this.n7 = (this.getChild("n7"));
  10260. this.iconNode = (this.getChild("iconNode"));
  10261. this.txt = (this.getChild("txt"));
  10262. this.txtNode = (this.getChild("txtNode"));
  10263. }
  10264. }
  10265. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10266. class UIFlyEft extends UIBase {
  10267. constructor() {
  10268. super();
  10269. this.max = 8;
  10270. this.delay = 0;
  10271. }
  10272. onConstructor() {
  10273. this.ui = ui_UIFlyEft.createInstance();
  10274. this.contentPane = this.ui;
  10275. this.isEject = false;
  10276. this.isMuti = true;
  10277. this.ui.x += xGame.common.sysOffestNum;
  10278. }
  10279. getArrPos() {
  10280. if (this.iconPos && this.iconPos.length > 0)
  10281. return;
  10282. this.iconPos = [];
  10283. let temp;
  10284. for (let index = 0; index < this.max; index++) {
  10285. temp = this.ui["n" + index];
  10286. this.iconPos.push([temp.x, temp.y]);
  10287. }
  10288. }
  10289. show(stPos, edPos, num, type, callback) {
  10290. super.show();
  10291. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10292. this.getArrPos();
  10293. this.updateUI(type);
  10294. this.updatePos();
  10295. this.runFly(edPos, callback);
  10296. this.runWorlds(stPos, num);
  10297. }
  10298. updateUI(type) {
  10299. let temp;
  10300. let str;
  10301. for (let index = 0; index < this.max; index++) {
  10302. temp = this.ui["n" + index];
  10303. str = this.getIconStr(type);
  10304. temp.url = xGame.common.getGameIconUrl(str);
  10305. }
  10306. }
  10307. getIconStr(type) {
  10308. switch (type) {
  10309. case Prop.diamond:
  10310. return "ty_zs";
  10311. case Prop.coin:
  10312. return "ty_jb";
  10313. default:
  10314. break;
  10315. }
  10316. }
  10317. updatePos() {
  10318. let temp;
  10319. for (let index = 0; index < this.max; index++) {
  10320. temp = this.ui["n" + index];
  10321. temp.x = this.iconPos[index][0];
  10322. temp.y = this.iconPos[index][1];
  10323. }
  10324. }
  10325. runFly(endPos, callback) {
  10326. let all = 0;
  10327. let temp;
  10328. for (let index = 0; index < this.max; index++) {
  10329. temp = this.ui["n" + index];
  10330. temp.visible = true;
  10331. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10332. temp.visible = false;
  10333. all++;
  10334. if (all >= this.max) {
  10335. callback && callback();
  10336. }
  10337. }), 20 * index);
  10338. }
  10339. }
  10340. runWorlds(stPos, num) {
  10341. let str = "+" + num;
  10342. this.ui.txt.text = str;
  10343. let starX = stPos.x;
  10344. let starY = stPos.y + 50;
  10345. this.ui.txt.x = starX;
  10346. this.ui.txt.y = starY;
  10347. this.ui.txt.visible = true;
  10348. this.ui.txt.alpha = 1;
  10349. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10350. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10351. this.ui.txt.visible = false;
  10352. this.hide();
  10353. }));
  10354. }));
  10355. }
  10356. }
  10357. UIFlyEft.uiName = "UIFlyEft";
  10358. class ui_UIGetAward extends fgui.GComponent {
  10359. static createInstance() {
  10360. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10361. }
  10362. onConstruct() {
  10363. this.n4 = (this.getChild("n4"));
  10364. this.n0 = (this.getChild("n0"));
  10365. this.myList = (this.getChild("myList"));
  10366. this.n1 = (this.getChild("n1"));
  10367. this.eftNode = (this.getChild("eftNode"));
  10368. this.btnNode = (this.getChild("btnNode"));
  10369. this.t0 = this.getTransition("t0");
  10370. }
  10371. }
  10372. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10373. class UIGetAward extends UIBase {
  10374. constructor() {
  10375. super();
  10376. this.showTriple = true;
  10377. }
  10378. onConstructor() {
  10379. this.ui = ui_UIGetAward.createInstance();
  10380. this.contentPane = this.ui;
  10381. this.isEject = false;
  10382. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10383. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10384. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10385. }
  10386. show(arr, showTriple, callback) {
  10387. super.show();
  10388. this.ui.t0.play();
  10389. this.ui.eftNode.visible = true;
  10390. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10391. this.ui.eftNode.visible = false;
  10392. }), 1, 0, 0, 0.9);
  10393. this.awardArr = arr;
  10394. this.showTriple = showTriple;
  10395. this.callback = callback;
  10396. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10397. this.ui.myList.numItems = arr.length;
  10398. xGame.soundMgr.playSound("getaward");
  10399. }
  10400. updateSelf(index, obj) {
  10401. let temp = this.awardArr[index];
  10402. let icon = this.getIcon(temp.type);
  10403. let str = icon;
  10404. if (temp.type > 2) {
  10405. str = "s" + icon;
  10406. }
  10407. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10408. obj.myIcon.rotation = 0;
  10409. obj.numTxt.text = temp.num + "";
  10410. obj.numTxt.visible = temp.type > 2 ? false : true;
  10411. obj.nameTxt.text = this.getNameStr(temp.type);
  10412. }
  10413. renderItem(index, obj) {
  10414. this.updateSelf(index, obj);
  10415. }
  10416. tripleGetAward() {
  10417. Moyu.showVideoAd(() => {
  10418. this.getAward(3);
  10419. }, EAdType.triple);
  10420. }
  10421. normalGetAward() {
  10422. if (PlatMgr.isMisVideo())
  10423. this.tripleGetAward();
  10424. else
  10425. this.getAward();
  10426. }
  10427. getAward(times = 1) {
  10428. this.hide();
  10429. for (let index = 0; index < this.awardArr.length; index++) {
  10430. this.awardArr[index].num *= times;
  10431. }
  10432. this.callback && this.callback(times != 1);
  10433. }
  10434. getIcon(type) {
  10435. switch (type) {
  10436. case Prop.diamond:
  10437. return "ty_zs";
  10438. case Prop.coin:
  10439. return "ty_jb";
  10440. case Prop.gan1:
  10441. return "qg1";
  10442. case Prop.gan2:
  10443. return "qg2";
  10444. case Prop.gan3:
  10445. return "qg3";
  10446. case Prop.gan4:
  10447. return "qg4";
  10448. default:
  10449. break;
  10450. }
  10451. }
  10452. getNameStr(type) {
  10453. switch (type) {
  10454. case Prop.diamond:
  10455. return "Diamond";
  10456. case Prop.coin:
  10457. return "Coins";
  10458. case Prop.gan1:
  10459. case Prop.gan2:
  10460. case Prop.gan3:
  10461. case Prop.gan4:
  10462. return cfgTable.ballrodData[type - 1].name;
  10463. default:
  10464. break;
  10465. }
  10466. }
  10467. }
  10468. UIGetAward.uiName = "UIGetAward";
  10469. class Common {
  10470. constructor() {
  10471. this.convertNum = 0.025;
  10472. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10473. this.scaleV3One = new Laya.Vector3();
  10474. this.scaleV3Two = new Laya.Vector3();
  10475. this.posV4 = new Laya.Vector4();
  10476. this.showDebug = false;
  10477. this.openGuide = true;
  10478. this.rodOffest = new Laya.Vector2(0, 0);
  10479. this.rodAngle = 0;
  10480. this.gameMode = GameMode.classic;
  10481. this.bigMoveLevelIndex = 1;
  10482. this.bigMoveNeedCoin = 1000;
  10483. this.classicNiceNeddCoin = 1000;
  10484. this.passAwardCoin = 2000;
  10485. this.classicRoomType = 1;
  10486. this.maxPower = 20;
  10487. this.natureMaxPower = 5;
  10488. this.videoPower = 2;
  10489. this.powerRecoverNum = 900;
  10490. this.curPlayerSkillType = 0;
  10491. this.isNewDay = false;
  10492. this.clickedBall = false;
  10493. this.placeBallCurLevel = 0;
  10494. this.placeBallStarNum = 0;
  10495. this.longHelpLine = false;
  10496. this.maxShareDiamondTimes = 3;
  10497. this.guideStep = 0;
  10498. this.temSelfLevel = 0;
  10499. this.extraMoveNum = 0;
  10500. this.curRankID = 0;
  10501. this.rankID = {
  10502. normalStar: 12000,
  10503. wxStar: 12001
  10504. };
  10505. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10506. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10507. this.btnClickStr = "buttonclick";
  10508. this.maxSkillLevel = 10;
  10509. this.upSkillLevel = false;
  10510. this.gameStartTime = 0;
  10511. this._sysOffestNum = 0;
  10512. this.angleV2 = new Laya.Vector2();
  10513. this.rootV = new Laya.Vector2(0, 1);
  10514. this.tempDir1 = new Laya.Vector2();
  10515. this.tempDir2 = new Laya.Vector2();
  10516. this.ballSize = 33;
  10517. this.stPos = new Laya.Point();
  10518. this.edPos = new Laya.Point();
  10519. Common._instance = this;
  10520. window["common"] = this;
  10521. }
  10522. static getInstance() {
  10523. if (!this._instance) {
  10524. this._instance = new Common();
  10525. }
  10526. return this._instance;
  10527. }
  10528. get sysOffestNum() {
  10529. if (this._sysOffestNum == 0) {
  10530. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10531. }
  10532. return this._sysOffestNum;
  10533. }
  10534. testShader() {
  10535. let test = new LightShader();
  10536. test.texture = "res/d3Res/ballTexture/ball1.png";
  10537. Laya.stage.addChild(test);
  10538. }
  10539. playScale(node) {
  10540. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10541. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10542. }));
  10543. }));
  10544. }
  10545. setGroup(colli, ...group) {
  10546. let out = 0;
  10547. for (let index = 0; index < group.length; index++) {
  10548. if (index == 0) {
  10549. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10550. }
  10551. else {
  10552. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10553. }
  10554. }
  10555. colli.collisionGroup = out;
  10556. }
  10557. setCanGroupWith(colli, ...group) {
  10558. let out = 0;
  10559. for (let index = 0; index < group.length; index++) {
  10560. if (index == 0) {
  10561. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10562. }
  10563. else {
  10564. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10565. }
  10566. }
  10567. colli.canCollideWith = out;
  10568. }
  10569. loadPrefab(name, callback) {
  10570. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10571. let prefab = new Laya.Prefab();
  10572. prefab.json = obj;
  10573. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10574. callback && callback(img);
  10575. }));
  10576. }
  10577. pos2to3Convert(x, y, d3Pos) {
  10578. x = x + this.sysOffestNum;
  10579. d3Pos.setValue(x, y, 0);
  10580. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10581. if (success) {
  10582. }
  10583. else {
  10584. console.error("转换出错了。。。。。。。。");
  10585. }
  10586. }
  10587. scale2to3Convert(num) {
  10588. this.scaleV3One.setValue(0, 0, 0);
  10589. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10590. this.scaleV3Two.setValue(0, num, 0);
  10591. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10592. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10593. return outNum;
  10594. }
  10595. pos3to2Convert(d3Pos) {
  10596. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10597. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10598. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10599. d3Pos.x -= this.sysOffestNum;
  10600. }
  10601. scale3to2Convert(num) {
  10602. let scale = this.scale2to3Convert(1);
  10603. let d2Out = num / scale;
  10604. return d2Out;
  10605. }
  10606. getCollider(type, restitution = 0.9, density = 10) {
  10607. let colli;
  10608. if (type == "box")
  10609. colli = new Laya.BoxCollider();
  10610. else
  10611. colli = new Laya.CircleCollider();
  10612. colli.friction = 0;
  10613. colli.restitution = restitution;
  10614. colli.density = density;
  10615. return colli;
  10616. }
  10617. getRigbody() {
  10618. let rigy = new Laya.RigidBody();
  10619. rigy.bullet = true;
  10620. rigy.allowRotation = false;
  10621. rigy.allowSleep = false;
  10622. rigy.gravityScale = 0;
  10623. return rigy;
  10624. }
  10625. getfguiRotation(x, y) {
  10626. this.angleV2.setValue(x, y);
  10627. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10628. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10629. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10630. angle = -angle;
  10631. }
  10632. return 180 + angle;
  10633. }
  10634. getAngle(x, y) {
  10635. this.angleV2.setValue(x, y);
  10636. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10637. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10638. return angle;
  10639. }
  10640. randomNum(a, b) {
  10641. return a + Math.floor((b - a + 1) * Math.random());
  10642. }
  10643. getRandArrEle(arr) {
  10644. return arr[Math.floor(arr.length * Math.random())];
  10645. }
  10646. getSign(val) {
  10647. return val >= 0 ? 1 : -1;
  10648. }
  10649. botherArr(arr) {
  10650. let times = arr.length + 2;
  10651. let length = arr.length;
  10652. let a;
  10653. let b;
  10654. let temp;
  10655. for (let index = 0; index < times; index++) {
  10656. a = Math.floor(Math.random() * length);
  10657. b = Math.floor(Math.random() * length);
  10658. temp = arr[a];
  10659. arr[a] = arr[b];
  10660. arr[b] = temp;
  10661. }
  10662. }
  10663. getGameIconUrl(id) {
  10664. return "ui://game/" + id;
  10665. }
  10666. getComponentUrl(id) {
  10667. return "ui://game/" + id;
  10668. }
  10669. getAnimation() {
  10670. }
  10671. judgeSkillType(type = SkillType.highSpace) {
  10672. if (this.gameMode == GameMode.classic)
  10673. return;
  10674. let gameMgr = this.gameMgr;
  10675. if (gameMgr.selfTurn) {
  10676. if (gameMgr.selfCurSkill == type) {
  10677. return true;
  10678. }
  10679. }
  10680. else {
  10681. if (gameMgr.aiCurSkill == type) {
  10682. return true;
  10683. }
  10684. }
  10685. }
  10686. ballColliHole(collider) {
  10687. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10688. xGame.common.gameMgr.isFirstInGame = false;
  10689. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10690. }
  10691. collider.owner.mySrc.checkWrongBall();
  10692. }
  10693. getArrMaxEle(arr) {
  10694. let max = -Infinity;
  10695. for (let index = 0; index < arr.length; index++) {
  10696. max = Math.max(arr[index], max);
  10697. }
  10698. return max;
  10699. }
  10700. getArrMinEle(arr) {
  10701. let min = Infinity;
  10702. for (let index = 0; index < arr.length; index++) {
  10703. min = Math.min(arr[index], min);
  10704. }
  10705. return min;
  10706. }
  10707. playRandomMutiBallBigSkillSound() {
  10708. if (Math.random() <= 0.5)
  10709. return;
  10710. let rand = this.randomNum(1, 6);
  10711. let str = "ganfa0" + rand;
  10712. xGame.soundMgr.playSound(str);
  10713. }
  10714. showOneCamera(type) {
  10715. let object = xGame.common.d3World.cameraObj;
  10716. for (const key in object) {
  10717. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10718. object[key].init();
  10719. object[key].owner.active = key == type;
  10720. }
  10721. }
  10722. }
  10723. checkBallOverBorder(x, y) {
  10724. let radius = 17;
  10725. let condition = this._checkBorder(x + radius, y) ||
  10726. this._checkBorder(x - radius, y) ||
  10727. this._checkBorder(x, y + radius) ||
  10728. this._checkBorder(x, y - radius);
  10729. if (condition) {
  10730. return true;
  10731. }
  10732. }
  10733. _checkBorder(x, y) {
  10734. let borderRect = this.d2World.borderRect;
  10735. let xOffest = 20;
  10736. let yOffest = 20;
  10737. if (y <= borderRect.y - yOffest) {
  10738. return true;
  10739. }
  10740. if (y >= borderRect.y + borderRect.height + yOffest) {
  10741. return true;
  10742. }
  10743. if (x <= borderRect.x - xOffest) {
  10744. return true;
  10745. }
  10746. if (x >= borderRect.x + borderRect.width + xOffest) {
  10747. return true;
  10748. }
  10749. }
  10750. initWeight(cfg) {
  10751. let allCfgData = { data: {}, allWeightNum: 0 };
  10752. let weightCfg = allCfgData.data;
  10753. let weight = 0;
  10754. for (const key in cfg) {
  10755. weightCfg[key] = {};
  10756. weightCfg[key].id = cfg[key].id;
  10757. weightCfg[key].minWeight = weight;
  10758. weight += cfg[key].weight;
  10759. weightCfg[key].maxWeight = weight;
  10760. }
  10761. allCfgData.allWeightNum = weight;
  10762. return allCfgData;
  10763. }
  10764. getRandomWeightData(cfg) {
  10765. let weightCfg = cfg.data;
  10766. let allWeightNum = cfg.allWeightNum;
  10767. let rand = Math.floor(Math.random() * allWeightNum);
  10768. for (const key in weightCfg) {
  10769. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10770. return weightCfg[key];
  10771. }
  10772. }
  10773. return weightCfg[1];
  10774. }
  10775. showGirlTalkPop(wordsIndex, node, msgNode) {
  10776. node.visible = true;
  10777. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10778. node.t0.play(Laya.Handler.create(this, () => {
  10779. node.visible = false;
  10780. }));
  10781. }
  10782. stopGirlPop(node) {
  10783. node.t0.stop();
  10784. node.visible = false;
  10785. }
  10786. createHead(loader, url, size = 107) {
  10787. if (Laya.Browser.name == "Browser") {
  10788. loader.url = url;
  10789. return;
  10790. }
  10791. if (Moyu.isTT) {
  10792. let localImage = new Image();
  10793. localImage.src = url;
  10794. localImage.onload = () => {
  10795. let t2d = new Laya.Texture2D();
  10796. t2d.width = size;
  10797. t2d.height = size;
  10798. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10799. t2d.loadImageSource(localImage);
  10800. };
  10801. }
  10802. else {
  10803. console.log('zh:url=', url);
  10804. loader.url = url;
  10805. }
  10806. }
  10807. addTestCoin(num) {
  10808. DataMgr.setCoin(num);
  10809. }
  10810. addTestDiamond(num) {
  10811. DataMgr.setDiamond(num);
  10812. }
  10813. addTestSkill() {
  10814. DataMgr.setBigSkill(0, 99);
  10815. DataMgr.setBigSkill(1, 99);
  10816. DataMgr.setBigSkill(2, 99);
  10817. }
  10818. playClassicEmotion(number, x, y) {
  10819. if (this.gameMode == GameMode.bigMove)
  10820. return;
  10821. let randIndex = this.randomNum(0, 2);
  10822. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10823. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10824. if (this.gameMgr.selfTurn) {
  10825. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10826. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10827. }
  10828. else {
  10829. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10830. }
  10831. else {
  10832. if (number == this.gameMgr.blackNum) {
  10833. if (this.gameMgr.selfBallArr.length == 0) {
  10834. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10835. }
  10836. else {
  10837. }
  10838. }
  10839. else {
  10840. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10841. }
  10842. }
  10843. }
  10844. }
  10845. else {
  10846. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10847. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10848. }
  10849. else {
  10850. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10851. }
  10852. else {
  10853. if (number == this.gameMgr.blackNum) {
  10854. if (this.gameMgr.aiBallArr.length == 0) {
  10855. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10856. }
  10857. else {
  10858. }
  10859. }
  10860. else {
  10861. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10862. }
  10863. }
  10864. }
  10865. }
  10866. }
  10867. playHappySound(number) {
  10868. if (this.gameMode != GameMode.classic)
  10869. return;
  10870. if (number == 8)
  10871. return;
  10872. let play = false;
  10873. if (this.gameMgr.selfTurn) {
  10874. if (this.gameMgr.ensureBallType) {
  10875. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10876. play = true;
  10877. }
  10878. }
  10879. else {
  10880. play = true;
  10881. }
  10882. }
  10883. else {
  10884. if (this.gameMgr.ensureBallType) {
  10885. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10886. play = true;
  10887. }
  10888. }
  10889. else {
  10890. play = true;
  10891. }
  10892. }
  10893. if (play)
  10894. xGame.soundMgr.playSound("applause");
  10895. }
  10896. destroyClassicEmotion() {
  10897. if (this.gameMode == GameMode.bigMove)
  10898. return;
  10899. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10900. parent.destroyChildren();
  10901. }
  10902. playAwardSpine(x, y) {
  10903. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10904. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10905. this.awardSpine.play(data, 0, false, parent);
  10906. }
  10907. destroyAwardSpine() {
  10908. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10909. parent.destroyChildren();
  10910. }
  10911. isBlock(bx, by, hx, hy, except = null) {
  10912. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10913. let balls = xGame.common.d2World.ballArr;
  10914. let outArr = [];
  10915. for (let index = 0; index < balls.length; index++) {
  10916. let obj = balls[index];
  10917. if (obj.number == 0)
  10918. continue;
  10919. if (obj == except)
  10920. continue;
  10921. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10922. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10923. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10924. if (num >= 1)
  10925. num = 1;
  10926. if (num < 0)
  10927. continue;
  10928. let gap = Math.sin(Math.acos(num)) * dis;
  10929. if (gap < this.ballSize) {
  10930. outArr.push({
  10931. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10932. disHon: Math.cos(Math.acos(num)) * dis,
  10933. disVer: Math.sin(Math.acos(num)) * dis,
  10934. src: balls[index],
  10935. dir: this.tempDir1
  10936. });
  10937. }
  10938. }
  10939. if (outArr.length > 0) {
  10940. outArr.sort((a, b) => { return a.dis - b.dis; });
  10941. return outArr[0];
  10942. }
  10943. }
  10944. AngleBetween(vector1, vector2) {
  10945. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10946. return rad * (180 / Math.PI);
  10947. }
  10948. getSecretaryScale() {
  10949. if (this.secretary.spineName == "mishu") {
  10950. return 1.28;
  10951. }
  10952. else {
  10953. return 1.024;
  10954. }
  10955. }
  10956. signAwardContainsRod(arr) {
  10957. let temp;
  10958. for (let index = 0; index < arr.length; index++) {
  10959. temp = arr[index].split('-')[0];
  10960. if (parseInt(temp) > 2) {
  10961. return true;
  10962. }
  10963. }
  10964. }
  10965. judgeSameDay() {
  10966. let lastTime = DataMgr.getSignTime();
  10967. let curTime = new Date().getTime();
  10968. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10969. return true;
  10970. }
  10971. return false;
  10972. }
  10973. getAward(arr, callback) {
  10974. let showTriple = arr[0].type <= 2;
  10975. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10976. let temp;
  10977. for (let index = 0; index < arr.length; index++) {
  10978. temp = arr[index];
  10979. switch (temp.type) {
  10980. case 1:
  10981. this.playObjFlyAnim(temp.num, temp.type);
  10982. break;
  10983. case 2:
  10984. this.playObjFlyAnim(temp.num, temp.type);
  10985. break;
  10986. case 3:
  10987. case 4:
  10988. case 5:
  10989. case 6:
  10990. DataMgr.setBallRod(temp.type - 2, 1);
  10991. DataMgr.setCurBallRod(temp.type - 2);
  10992. break;
  10993. default:
  10994. break;
  10995. }
  10996. }
  10997. callback && callback(watchVideo);
  10998. });
  10999. }
  11000. getMoneyNode() {
  11001. let moneyNode;
  11002. let sign = xGame.uiMgr.getUI(UISign);
  11003. let draw = xGame.uiMgr.getUI(UIDraw);
  11004. let end = xGame.uiMgr.getUI(UIGameEnd);
  11005. let skill = xGame.uiMgr.getUI(UISkill);
  11006. if (sign && !sign.isHide)
  11007. moneyNode = sign.ui.moneyNode;
  11008. if (draw && !draw.isHide)
  11009. moneyNode = draw.ui.moneyNode;
  11010. if (end && !end.isHide)
  11011. moneyNode = end.ui.moneyNode;
  11012. if (skill && !skill.isHide)
  11013. moneyNode = skill.ui.moneyNode;
  11014. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11015. let main = xGame.uiMgr.getUI(UIMain);
  11016. if (condition1 && main && !main.isHide) {
  11017. moneyNode = main.ui.moneyNode;
  11018. }
  11019. return moneyNode;
  11020. }
  11021. playObjFlyAnim(num, type, callback = null) {
  11022. this.stPos.x = Laya.stage.width / 2;
  11023. this.stPos.y = Laya.stage.height / 2;
  11024. let moneyNode = this.getMoneyNode();
  11025. switch (type) {
  11026. case Prop.diamond:
  11027. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11028. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11029. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11030. this.edPos.x /= 2;
  11031. this.edPos.y /= 2;
  11032. break;
  11033. case Prop.coin:
  11034. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11035. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11036. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11037. this.edPos.x /= 2;
  11038. this.edPos.y /= 2;
  11039. break;
  11040. default:
  11041. break;
  11042. }
  11043. xGame.soundMgr.playSound("coinbag");
  11044. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11045. switch (type) {
  11046. case Prop.diamond:
  11047. DataMgr.setDiamond(num);
  11048. break;
  11049. case Prop.coin:
  11050. DataMgr.setCoin(num);
  11051. break;
  11052. default:
  11053. break;
  11054. }
  11055. callback && callback();
  11056. });
  11057. }
  11058. autoPopUIView() {
  11059. let arr = [];
  11060. let sign = this.judgeSameDay() ? false : true;
  11061. if (sign)
  11062. arr.push("sign");
  11063. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11064. if (draw)
  11065. arr.push("draw");
  11066. if (arr.length <= 0)
  11067. return;
  11068. let str = this.getRandArrEle(arr);
  11069. switch (str) {
  11070. case "sign":
  11071. xGame.uiMgr.Show(UISign);
  11072. break;
  11073. case "draw":
  11074. xGame.uiMgr.Show(UIDraw);
  11075. break;
  11076. default:
  11077. break;
  11078. }
  11079. }
  11080. getMSTime(time) {
  11081. let min = Math.floor(time / 60);
  11082. let sec = Math.floor((time - min * 60));
  11083. if (sec < 10)
  11084. sec = "0" + sec;
  11085. if (min < 10)
  11086. min = "0" + min;
  11087. return `${min}:${sec}`;
  11088. }
  11089. testPower() {
  11090. DataMgr.setPower(0, false);
  11091. }
  11092. getAllStarNum() {
  11093. let data = DataMgr.getPlaceBallLevelList();
  11094. let out = 0;
  11095. for (let index = 0; index < data.length; index++) {
  11096. out += data[index].star;
  11097. }
  11098. return out;
  11099. }
  11100. recoverCameraView() {
  11101. Laya.timer.once(900, this, () => {
  11102. xGame.common.showOneCamera("mainCamera");
  11103. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11104. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11105. xGame.common.gameUI.ui.border.alpha = 0;
  11106. if (Laya.physicsTimer.scale < 1) {
  11107. Laya.physicsTimer.scale = 1;
  11108. }
  11109. }
  11110. });
  11111. }
  11112. getClassicLevel() {
  11113. let successTimes = DataMgr.getClassicTimes();
  11114. let needKey = "";
  11115. let lastKey = "";
  11116. let cfg = cfgTable.classictimesData;
  11117. let data;
  11118. for (const key in cfg) {
  11119. data = cfg[key];
  11120. if (successTimes <= data.times) {
  11121. needKey = key;
  11122. }
  11123. lastKey = key;
  11124. }
  11125. if (needKey == "")
  11126. needKey = lastKey;
  11127. return cfg[needKey];
  11128. }
  11129. }
  11130. Common._instance = null;
  11131. class ui_Component92 extends fgui.GComponent {
  11132. static createInstance() {
  11133. return (fgui.UIPackage.createObject("game", "Component92"));
  11134. }
  11135. onConstruct() {
  11136. this.n0 = (this.getChild("n0"));
  11137. }
  11138. }
  11139. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11140. class ui_Component129 extends fgui.GProgressBar {
  11141. static createInstance() {
  11142. return (fgui.UIPackage.createObject("game", "Component129"));
  11143. }
  11144. onConstruct() {
  11145. this.bar_v = (this.getChild("bar_v"));
  11146. this.n84 = (this.getChild("n84"));
  11147. }
  11148. }
  11149. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11150. class ui_Component130 extends fgui.GComponent {
  11151. static createInstance() {
  11152. return (fgui.UIPackage.createObject("game", "Component130"));
  11153. }
  11154. onConstruct() {
  11155. this.ani = (this.getChild("ani"));
  11156. this.t0 = this.getTransition("t0");
  11157. }
  11158. }
  11159. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11160. class ui_powerEft extends fgui.GComponent {
  11161. static createInstance() {
  11162. return (fgui.UIPackage.createObject("game", "powerEft"));
  11163. }
  11164. onConstruct() {
  11165. this.ani = (this.getChild("ani"));
  11166. this.n88 = (this.getChild("n88"));
  11167. this.n89 = (this.getChild("n89"));
  11168. }
  11169. }
  11170. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11171. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11172. static createInstance() {
  11173. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11174. }
  11175. onConstruct() {
  11176. this.c1 = this.getController("c1");
  11177. this.n2 = (this.getChild("n2"));
  11178. this.n22 = (this.getChild("n22"));
  11179. this.n23 = (this.getChild("n23"));
  11180. this.n15 = (this.getChild("n15"));
  11181. this.challenge = (this.getChild("challenge"));
  11182. this.n17 = (this.getChild("n17"));
  11183. this.n3 = (this.getChild("n3"));
  11184. this.starNode = (this.getChild("starNode"));
  11185. this.levelTxt = (this.getChild("levelTxt"));
  11186. this.n14 = (this.getChild("n14"));
  11187. this.n19 = (this.getChild("n19"));
  11188. this.n20 = (this.getChild("n20"));
  11189. this.n21 = (this.getChild("n21"));
  11190. this.special = (this.getChild("special"));
  11191. }
  11192. }
  11193. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11194. class ui_Component79 extends fgui.GComponent {
  11195. static createInstance() {
  11196. return (fgui.UIPackage.createObject("game", "Component79"));
  11197. }
  11198. onConstruct() {
  11199. this.c1 = this.getController("c1");
  11200. this.n7 = (this.getChild("n7"));
  11201. this.n8 = (this.getChild("n8"));
  11202. this.n9 = (this.getChild("n9"));
  11203. this.n10 = (this.getChild("n10"));
  11204. this.n11 = (this.getChild("n11"));
  11205. this.n12 = (this.getChild("n12"));
  11206. }
  11207. }
  11208. ui_Component79.URL = "ui://isxx5ak7avag477";
  11209. class ui_Component80 extends fgui.GComponent {
  11210. static createInstance() {
  11211. return (fgui.UIPackage.createObject("game", "Component80"));
  11212. }
  11213. onConstruct() {
  11214. this.n0 = (this.getChild("n0"));
  11215. this.n1 = (this.getChild("n1"));
  11216. this.myList = (this.getChild("myList"));
  11217. this.t0 = this.getTransition("t0");
  11218. }
  11219. }
  11220. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11221. class ui_SignNormal extends fgui.GComponent {
  11222. static createInstance() {
  11223. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11224. }
  11225. onConstruct() {
  11226. this.c1 = this.getController("c1");
  11227. this.n7 = (this.getChild("n7"));
  11228. this.n15 = (this.getChild("n15"));
  11229. this.titleTxt = (this.getChild("titleTxt"));
  11230. this.n8 = (this.getChild("n8"));
  11231. this.myIcon = (this.getChild("myIcon"));
  11232. this.numTxt = (this.getChild("numTxt"));
  11233. this.n12 = (this.getChild("n12"));
  11234. this.n13 = (this.getChild("n13"));
  11235. this.n17 = (this.getChild("n17"));
  11236. this.n14 = (this.getChild("n14"));
  11237. }
  11238. }
  11239. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11240. class ui_screenNode extends fgui.GComponent {
  11241. static createInstance() {
  11242. return (fgui.UIPackage.createObject("game", "screenNode"));
  11243. }
  11244. onConstruct() {
  11245. this.n9 = (this.getChild("n9"));
  11246. this.screenImg = (this.getChild("screenImg"));
  11247. }
  11248. }
  11249. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11250. class ui_GetAwrad_com1 extends fgui.GComponent {
  11251. static createInstance() {
  11252. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11253. }
  11254. onConstruct() {
  11255. this.n38 = (this.getChild("n38"));
  11256. this.n39 = (this.getChild("n39"));
  11257. this.n40 = (this.getChild("n40"));
  11258. this.t0 = this.getTransition("t0");
  11259. this.t1 = this.getTransition("t1");
  11260. }
  11261. }
  11262. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11263. class ui_GetAwrad_com2 extends fgui.GComponent {
  11264. static createInstance() {
  11265. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11266. }
  11267. onConstruct() {
  11268. this.n39 = (this.getChild("n39"));
  11269. this.n40 = (this.getChild("n40"));
  11270. this.t0 = this.getTransition("t0");
  11271. }
  11272. }
  11273. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11274. class ui_Component128 extends fgui.GComponent {
  11275. static createInstance() {
  11276. return (fgui.UIPackage.createObject("game", "Component128"));
  11277. }
  11278. onConstruct() {
  11279. this.n38 = (this.getChild("n38"));
  11280. this.n40 = (this.getChild("n40"));
  11281. }
  11282. }
  11283. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11284. class ui_Component100_1 extends fgui.GComponent {
  11285. static createInstance() {
  11286. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11287. }
  11288. onConstruct() {
  11289. this.myNode = (this.getChild("myNode"));
  11290. this.t0 = this.getTransition("t0");
  11291. }
  11292. }
  11293. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11294. class ui_Component142 extends fgui.GComponent {
  11295. static createInstance() {
  11296. return (fgui.UIPackage.createObject("game", "Component142"));
  11297. }
  11298. onConstruct() {
  11299. this.n41 = (this.getChild("n41"));
  11300. this.n42 = (this.getChild("n42"));
  11301. }
  11302. }
  11303. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11304. class ui_main_guang extends fgui.GComponent {
  11305. static createInstance() {
  11306. return (fgui.UIPackage.createObject("game", "main_guang"));
  11307. }
  11308. onConstruct() {
  11309. this.n1 = (this.getChild("n1"));
  11310. this.n2 = (this.getChild("n2"));
  11311. this.n3 = (this.getChild("n3"));
  11312. this.n4 = (this.getChild("n4"));
  11313. this.n5 = (this.getChild("n5"));
  11314. this.n6 = (this.getChild("n6"));
  11315. this.n8 = (this.getChild("n8"));
  11316. this.t0 = this.getTransition("t0");
  11317. }
  11318. }
  11319. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11320. class ui_try_com1 extends fgui.GComponent {
  11321. static createInstance() {
  11322. return (fgui.UIPackage.createObject("game", "try_com1"));
  11323. }
  11324. onConstruct() {
  11325. this.c1 = this.getController("c1");
  11326. this.n0 = (this.getChild("n0"));
  11327. this.n2 = (this.getChild("n2"));
  11328. this.cancelBtn = (this.getChild("cancelBtn"));
  11329. this.videoBtn = (this.getChild("videoBtn"));
  11330. this.n9 = (this.getChild("n9"));
  11331. this.n24 = (this.getChild("n24"));
  11332. this.titleTxt = (this.getChild("titleTxt"));
  11333. this.n32 = (this.getChild("n32"));
  11334. this.n29 = (this.getChild("n29"));
  11335. this.n36 = (this.getChild("n36"));
  11336. this.txtTime = (this.getChild("txtTime"));
  11337. this.t0 = this.getTransition("t0");
  11338. }
  11339. }
  11340. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11341. class ui_try_com2 extends fgui.GComponent {
  11342. static createInstance() {
  11343. return (fgui.UIPackage.createObject("game", "try_com2"));
  11344. }
  11345. onConstruct() {
  11346. this.skillicon = (this.getChild("skillicon"));
  11347. this.n35 = (this.getChild("n35"));
  11348. this.n31 = (this.getChild("n31"));
  11349. this.n32 = (this.getChild("n32"));
  11350. this.n33 = (this.getChild("n33"));
  11351. this.n34 = (this.getChild("n34"));
  11352. }
  11353. }
  11354. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11355. class ui_try_com3 extends fgui.GComponent {
  11356. static createInstance() {
  11357. return (fgui.UIPackage.createObject("game", "try_com3"));
  11358. }
  11359. onConstruct() {
  11360. this.n33 = (this.getChild("n33"));
  11361. this.n34 = (this.getChild("n34"));
  11362. this.n35 = (this.getChild("n35"));
  11363. this.t0 = this.getTransition("t0");
  11364. }
  11365. }
  11366. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11367. class ui_Component121 extends fgui.GButton {
  11368. static createInstance() {
  11369. return (fgui.UIPackage.createObject("game", "Component121"));
  11370. }
  11371. onConstruct() {
  11372. this.n3 = (this.getChild("n3"));
  11373. this.t0 = this.getTransition("t0");
  11374. }
  11375. }
  11376. ui_Component121.URL = "ui://isxx5ak7cy72v4ib";
  11377. class ui_huihe1 extends fgui.GComponent {
  11378. static createInstance() {
  11379. return (fgui.UIPackage.createObject("game", "huihe1"));
  11380. }
  11381. onConstruct() {
  11382. this.n0 = (this.getChild("n0"));
  11383. this.n1 = (this.getChild("n1"));
  11384. this.t0 = this.getTransition("t0");
  11385. }
  11386. }
  11387. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11388. class ui_huihe2 extends fgui.GComponent {
  11389. static createInstance() {
  11390. return (fgui.UIPackage.createObject("game", "huihe2"));
  11391. }
  11392. onConstruct() {
  11393. this.n0 = (this.getChild("n0"));
  11394. this.n1 = (this.getChild("n1"));
  11395. this.t0 = this.getTransition("t0");
  11396. }
  11397. }
  11398. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11399. class ui_Component143 extends fgui.GComponent {
  11400. static createInstance() {
  11401. return (fgui.UIPackage.createObject("game", "Component143"));
  11402. }
  11403. onConstruct() {
  11404. this.n3 = (this.getChild("n3"));
  11405. this.n4 = (this.getChild("n4"));
  11406. this.n5 = (this.getChild("n5"));
  11407. this.n6 = (this.getChild("n6"));
  11408. this.n7 = (this.getChild("n7"));
  11409. this.n8 = (this.getChild("n8"));
  11410. this.n9 = (this.getChild("n9"));
  11411. this.n10 = (this.getChild("n10"));
  11412. this.t0 = this.getTransition("t0");
  11413. }
  11414. }
  11415. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11416. class ui_dh_jingbi2 extends fgui.GComponent {
  11417. static createInstance() {
  11418. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11419. }
  11420. onConstruct() {
  11421. this.n0 = (this.getChild("n0"));
  11422. this.n1 = (this.getChild("n1"));
  11423. this.n2 = (this.getChild("n2"));
  11424. this.n3 = (this.getChild("n3"));
  11425. this.n4 = (this.getChild("n4"));
  11426. this.n5 = (this.getChild("n5"));
  11427. this.n6 = (this.getChild("n6"));
  11428. this.n8 = (this.getChild("n8"));
  11429. this.n10 = (this.getChild("n10"));
  11430. this.t0 = this.getTransition("t0");
  11431. }
  11432. }
  11433. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11434. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11435. static createInstance() {
  11436. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11437. }
  11438. onConstruct() {
  11439. this.n1 = (this.getChild("n1"));
  11440. this.n4 = (this.getChild("n4"));
  11441. this.t0 = this.getTransition("t0");
  11442. }
  11443. }
  11444. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11445. class ui_dh_jingbi3 extends fgui.GComponent {
  11446. static createInstance() {
  11447. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11448. }
  11449. onConstruct() {
  11450. this.n0 = (this.getChild("n0"));
  11451. this.n1 = (this.getChild("n1"));
  11452. this.n2 = (this.getChild("n2"));
  11453. this.n3 = (this.getChild("n3"));
  11454. this.n4 = (this.getChild("n4"));
  11455. this.n5 = (this.getChild("n5"));
  11456. this.n6 = (this.getChild("n6"));
  11457. this.n8 = (this.getChild("n8"));
  11458. this.n10 = (this.getChild("n10"));
  11459. this.t0 = this.getTransition("t0");
  11460. }
  11461. }
  11462. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11463. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11464. static createInstance() {
  11465. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11466. }
  11467. onConstruct() {
  11468. this.n3 = (this.getChild("n3"));
  11469. this.n1 = (this.getChild("n1"));
  11470. this.t0 = this.getTransition("t0");
  11471. }
  11472. }
  11473. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11474. class ui_hb_jinbi1 extends fgui.GButton {
  11475. static createInstance() {
  11476. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11477. }
  11478. onConstruct() {
  11479. this.n20 = (this.getChild("n20"));
  11480. this.n25 = (this.getChild("n25"));
  11481. this.coinTxt = (this.getChild("coinTxt"));
  11482. this.n28 = (this.getChild("n28"));
  11483. this.n32 = (this.getChild("n32"));
  11484. this.n38 = (this.getChild("n38"));
  11485. this.n45 = (this.getChild("n45"));
  11486. this.getTips = (this.getChild("getTips"));
  11487. this.n39 = (this.getChild("n39"));
  11488. this.diamondTxt = (this.getChild("diamondTxt"));
  11489. this.n41 = (this.getChild("n41"));
  11490. this.n42 = (this.getChild("n42"));
  11491. this.n46 = (this.getChild("n46"));
  11492. this.n47 = (this.getChild("n47"));
  11493. this.n48 = (this.getChild("n48"));
  11494. this.t0 = this.getTransition("t0");
  11495. }
  11496. }
  11497. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11498. class ui_hb_jinbi2 extends fgui.GButton {
  11499. static createInstance() {
  11500. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11501. }
  11502. onConstruct() {
  11503. this.n20 = (this.getChild("n20"));
  11504. this.n25 = (this.getChild("n25"));
  11505. this.coinTxt = (this.getChild("coinTxt"));
  11506. this.n28 = (this.getChild("n28"));
  11507. this.n32 = (this.getChild("n32"));
  11508. this.n38 = (this.getChild("n38"));
  11509. this.n39 = (this.getChild("n39"));
  11510. this.diamondTxt = (this.getChild("diamondTxt"));
  11511. this.n41 = (this.getChild("n41"));
  11512. this.n42 = (this.getChild("n42"));
  11513. this.n43 = (this.getChild("n43"));
  11514. this.n44 = (this.getChild("n44"));
  11515. this.n45 = (this.getChild("n45"));
  11516. this.t0 = this.getTransition("t0");
  11517. }
  11518. }
  11519. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11520. class ui_hb_jinbi3 extends fgui.GButton {
  11521. static createInstance() {
  11522. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11523. }
  11524. onConstruct() {
  11525. this.n20 = (this.getChild("n20"));
  11526. this.n25 = (this.getChild("n25"));
  11527. this.coinTxt = (this.getChild("coinTxt"));
  11528. this.n28 = (this.getChild("n28"));
  11529. this.n32 = (this.getChild("n32"));
  11530. this.n38 = (this.getChild("n38"));
  11531. this.n39 = (this.getChild("n39"));
  11532. this.diamondTxt = (this.getChild("diamondTxt"));
  11533. this.n41 = (this.getChild("n41"));
  11534. this.n42 = (this.getChild("n42"));
  11535. this.n43 = (this.getChild("n43"));
  11536. this.n44 = (this.getChild("n44"));
  11537. this.n45 = (this.getChild("n45"));
  11538. this.t0 = this.getTransition("t0");
  11539. }
  11540. }
  11541. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11542. class ui_Component104 extends fgui.GComponent {
  11543. static createInstance() {
  11544. return (fgui.UIPackage.createObject("game", "Component104"));
  11545. }
  11546. onConstruct() {
  11547. this.c1 = this.getController("c1");
  11548. this.n12 = (this.getChild("n12"));
  11549. this.coinBtn = (this.getChild("coinBtn"));
  11550. this.diamondBtn = (this.getChild("diamondBtn"));
  11551. this.node3 = (this.getChild("node3"));
  11552. this.node4 = (this.getChild("node4"));
  11553. this.node5 = (this.getChild("node5"));
  11554. this.node1 = (this.getChild("node1"));
  11555. this.node2 = (this.getChild("node2"));
  11556. this.node6 = (this.getChild("node6"));
  11557. this.t0 = this.getTransition("t0");
  11558. }
  11559. }
  11560. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11561. class ui_Component105 extends fgui.GButton {
  11562. static createInstance() {
  11563. return (fgui.UIPackage.createObject("game", "Component105"));
  11564. }
  11565. onConstruct() {
  11566. this.c1 = this.getController("c1");
  11567. this.n49 = (this.getChild("n49"));
  11568. this.n18 = (this.getChild("n18"));
  11569. this.n46 = (this.getChild("n46"));
  11570. this.n48 = (this.getChild("n48"));
  11571. }
  11572. }
  11573. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11574. class ui_Component106 extends fgui.GButton {
  11575. static createInstance() {
  11576. return (fgui.UIPackage.createObject("game", "Component106"));
  11577. }
  11578. onConstruct() {
  11579. this.c1 = this.getController("c1");
  11580. this.n49 = (this.getChild("n49"));
  11581. this.n18 = (this.getChild("n18"));
  11582. this.n46 = (this.getChild("n46"));
  11583. this.n48 = (this.getChild("n48"));
  11584. }
  11585. }
  11586. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11587. class ui_hb_zs1 extends fgui.GButton {
  11588. static createInstance() {
  11589. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11590. }
  11591. onConstruct() {
  11592. this.c1 = this.getController("c1");
  11593. this.n20 = (this.getChild("n20"));
  11594. this.n21 = (this.getChild("n21"));
  11595. this.n26 = (this.getChild("n26"));
  11596. this.n27 = (this.getChild("n27"));
  11597. this.shareTxt = (this.getChild("shareTxt"));
  11598. this.n32 = (this.getChild("n32"));
  11599. this.n38 = (this.getChild("n38"));
  11600. this.n39 = (this.getChild("n39"));
  11601. this.n44 = (this.getChild("n44"));
  11602. this.diamondTxt = (this.getChild("diamondTxt"));
  11603. this.n41 = (this.getChild("n41"));
  11604. this.n45 = (this.getChild("n45"));
  11605. this.n47 = (this.getChild("n47"));
  11606. this.n48 = (this.getChild("n48"));
  11607. this.randTxt = (this.getChild("randTxt"));
  11608. this.n50 = (this.getChild("n50"));
  11609. this.t0 = this.getTransition("t0");
  11610. }
  11611. }
  11612. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11613. class ui_dh_zs1 extends fgui.GComponent {
  11614. static createInstance() {
  11615. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11616. }
  11617. onConstruct() {
  11618. this.n10 = (this.getChild("n10"));
  11619. this.n9 = (this.getChild("n9"));
  11620. this.n1 = (this.getChild("n1"));
  11621. this.n2 = (this.getChild("n2"));
  11622. this.n3 = (this.getChild("n3"));
  11623. this.n4 = (this.getChild("n4"));
  11624. this.n5 = (this.getChild("n5"));
  11625. this.n6 = (this.getChild("n6"));
  11626. this.n8 = (this.getChild("n8"));
  11627. this.n11 = (this.getChild("n11"));
  11628. this.t0 = this.getTransition("t0");
  11629. }
  11630. }
  11631. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11632. class ui_dh_zs1_1 extends fgui.GComponent {
  11633. static createInstance() {
  11634. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11635. }
  11636. onConstruct() {
  11637. this.n3 = (this.getChild("n3"));
  11638. this.n1 = (this.getChild("n1"));
  11639. this.t0 = this.getTransition("t0");
  11640. }
  11641. }
  11642. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11643. class ui_hb_zs2 extends fgui.GButton {
  11644. static createInstance() {
  11645. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11646. }
  11647. onConstruct() {
  11648. this.n20 = (this.getChild("n20"));
  11649. this.n21 = (this.getChild("n21"));
  11650. this.n26 = (this.getChild("n26"));
  11651. this.n27 = (this.getChild("n27"));
  11652. this.n32 = (this.getChild("n32"));
  11653. this.n38 = (this.getChild("n38"));
  11654. this.n39 = (this.getChild("n39"));
  11655. this.n44 = (this.getChild("n44"));
  11656. this.diamondTxt = (this.getChild("diamondTxt"));
  11657. this.n41 = (this.getChild("n41"));
  11658. this.n45 = (this.getChild("n45"));
  11659. this.t0 = this.getTransition("t0");
  11660. }
  11661. }
  11662. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11663. class ui_hb_zs3 extends fgui.GButton {
  11664. static createInstance() {
  11665. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11666. }
  11667. onConstruct() {
  11668. this.n20 = (this.getChild("n20"));
  11669. this.n21 = (this.getChild("n21"));
  11670. this.n26 = (this.getChild("n26"));
  11671. this.n27 = (this.getChild("n27"));
  11672. this.n32 = (this.getChild("n32"));
  11673. this.n38 = (this.getChild("n38"));
  11674. this.n47 = (this.getChild("n47"));
  11675. this.t0 = this.getTransition("t0");
  11676. }
  11677. }
  11678. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11679. class ui_dh_zs2 extends fgui.GComponent {
  11680. static createInstance() {
  11681. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11682. }
  11683. onConstruct() {
  11684. this.n10 = (this.getChild("n10"));
  11685. this.n9 = (this.getChild("n9"));
  11686. this.n1 = (this.getChild("n1"));
  11687. this.n2 = (this.getChild("n2"));
  11688. this.n3 = (this.getChild("n3"));
  11689. this.n4 = (this.getChild("n4"));
  11690. this.n5 = (this.getChild("n5"));
  11691. this.n6 = (this.getChild("n6"));
  11692. this.n8 = (this.getChild("n8"));
  11693. this.n11 = (this.getChild("n11"));
  11694. this.t0 = this.getTransition("t0");
  11695. }
  11696. }
  11697. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11698. class ui_dh_zs2_1 extends fgui.GComponent {
  11699. static createInstance() {
  11700. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11701. }
  11702. onConstruct() {
  11703. this.n3 = (this.getChild("n3"));
  11704. this.n1 = (this.getChild("n1"));
  11705. this.t0 = this.getTransition("t0");
  11706. }
  11707. }
  11708. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11709. class ui_dh_zs3 extends fgui.GComponent {
  11710. static createInstance() {
  11711. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11712. }
  11713. onConstruct() {
  11714. this.n10 = (this.getChild("n10"));
  11715. this.n9 = (this.getChild("n9"));
  11716. this.n1 = (this.getChild("n1"));
  11717. this.n2 = (this.getChild("n2"));
  11718. this.n3 = (this.getChild("n3"));
  11719. this.n4 = (this.getChild("n4"));
  11720. this.n5 = (this.getChild("n5"));
  11721. this.n6 = (this.getChild("n6"));
  11722. this.n8 = (this.getChild("n8"));
  11723. this.n11 = (this.getChild("n11"));
  11724. this.t0 = this.getTransition("t0");
  11725. }
  11726. }
  11727. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11728. class ui_dh_zs3_1 extends fgui.GComponent {
  11729. static createInstance() {
  11730. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11731. }
  11732. onConstruct() {
  11733. this.n3 = (this.getChild("n3"));
  11734. this.n1 = (this.getChild("n1"));
  11735. this.t0 = this.getTransition("t0");
  11736. }
  11737. }
  11738. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11739. class ui_Component107 extends fgui.GComponent {
  11740. static createInstance() {
  11741. return (fgui.UIPackage.createObject("game", "Component107"));
  11742. }
  11743. onConstruct() {
  11744. this.n18 = (this.getChild("n18"));
  11745. this.n19 = (this.getChild("n19"));
  11746. this.n20 = (this.getChild("n20"));
  11747. this.n21 = (this.getChild("n21"));
  11748. this.n22 = (this.getChild("n22"));
  11749. this.levelTxt = (this.getChild("levelTxt"));
  11750. this.t0 = this.getTransition("t0");
  11751. }
  11752. }
  11753. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11754. class ui_box_com1 extends fgui.GComponent {
  11755. static createInstance() {
  11756. return (fgui.UIPackage.createObject("game", "box_com1"));
  11757. }
  11758. onConstruct() {
  11759. this.n14 = (this.getChild("n14"));
  11760. this.n6 = (this.getChild("n6"));
  11761. this.t0 = this.getTransition("t0");
  11762. }
  11763. }
  11764. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11765. class ui_box_com2 extends fgui.GProgressBar {
  11766. static createInstance() {
  11767. return (fgui.UIPackage.createObject("game", "box_com2"));
  11768. }
  11769. onConstruct() {
  11770. this.bg0 = (this.getChild("bg0"));
  11771. this.bg = (this.getChild("bg"));
  11772. this.bar = (this.getChild("bar"));
  11773. this.n7 = (this.getChild("n7"));
  11774. this.n8 = (this.getChild("n8"));
  11775. this.n10 = (this.getChild("n10"));
  11776. this.n11 = (this.getChild("n11"));
  11777. this.n12 = (this.getChild("n12"));
  11778. }
  11779. }
  11780. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11781. class ui_box_com4 extends fgui.GComponent {
  11782. static createInstance() {
  11783. return (fgui.UIPackage.createObject("game", "box_com4"));
  11784. }
  11785. onConstruct() {
  11786. this.n8 = (this.getChild("n8"));
  11787. this.t0 = this.getTransition("t0");
  11788. }
  11789. }
  11790. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11791. class ui_box_com3 extends fgui.GComponent {
  11792. static createInstance() {
  11793. return (fgui.UIPackage.createObject("game", "box_com3"));
  11794. }
  11795. onConstruct() {
  11796. this.n2 = (this.getChild("n2"));
  11797. this.n3 = (this.getChild("n3"));
  11798. this.n4 = (this.getChild("n4"));
  11799. this.n5 = (this.getChild("n5"));
  11800. this.t0 = this.getTransition("t0");
  11801. this.t1 = this.getTransition("t1");
  11802. }
  11803. }
  11804. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11805. class ui_Component97 extends fgui.GComponent {
  11806. static createInstance() {
  11807. return (fgui.UIPackage.createObject("game", "Component97"));
  11808. }
  11809. onConstruct() {
  11810. this.c1 = this.getController("c1");
  11811. this.n46 = (this.getChild("n46"));
  11812. this.diamondNode = (this.getChild("diamondNode"));
  11813. this.coinNode = (this.getChild("coinNode"));
  11814. this.t0 = this.getTransition("t0");
  11815. }
  11816. }
  11817. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11818. class ui_Component98 extends fgui.GButton {
  11819. static createInstance() {
  11820. return (fgui.UIPackage.createObject("game", "Component98"));
  11821. }
  11822. onConstruct() {
  11823. this.n8 = (this.getChild("n8"));
  11824. this.n40 = (this.getChild("n40"));
  11825. }
  11826. }
  11827. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11828. class ui_Component28_11 extends fgui.GButton {
  11829. static createInstance() {
  11830. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11831. }
  11832. onConstruct() {
  11833. this.c1 = this.getController("c1");
  11834. this.n12 = (this.getChild("n12"));
  11835. this.n17 = (this.getChild("n17"));
  11836. this.n13 = (this.getChild("n13"));
  11837. this.diamondTxt = (this.getChild("diamondTxt"));
  11838. this.n15 = (this.getChild("n15"));
  11839. this.n16 = (this.getChild("n16"));
  11840. }
  11841. }
  11842. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11843. class ui_Component58_11 extends fgui.GComponent {
  11844. static createInstance() {
  11845. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11846. }
  11847. onConstruct() {
  11848. this.n23 = (this.getChild("n23"));
  11849. this.n41 = (this.getChild("n41"));
  11850. this.myList = (this.getChild("myList"));
  11851. this.n45 = (this.getChild("n45"));
  11852. this.n44 = (this.getChild("n44"));
  11853. this.t0 = this.getTransition("t0");
  11854. }
  11855. }
  11856. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11857. class ui_Component100 extends fgui.GComponent {
  11858. static createInstance() {
  11859. return (fgui.UIPackage.createObject("game", "Component100"));
  11860. }
  11861. onConstruct() {
  11862. this.c1 = this.getController("c1");
  11863. this.n75 = (this.getChild("n75"));
  11864. this.n76 = (this.getChild("n76"));
  11865. this.n80 = (this.getChild("n80"));
  11866. this.txt = (this.getChild("txt"));
  11867. this.spineRoot = (this.getChild("spineRoot"));
  11868. }
  11869. }
  11870. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11871. class ui_Component101 extends fgui.GComponent {
  11872. static createInstance() {
  11873. return (fgui.UIPackage.createObject("game", "Component101"));
  11874. }
  11875. onConstruct() {
  11876. this.c1 = this.getController("c1");
  11877. this.n36 = (this.getChild("n36"));
  11878. this.n35 = (this.getChild("n35"));
  11879. this.n33 = (this.getChild("n33"));
  11880. this.n34 = (this.getChild("n34"));
  11881. }
  11882. }
  11883. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11884. class ui_Component53 extends fgui.GComponent {
  11885. static createInstance() {
  11886. return (fgui.UIPackage.createObject("game", "Component53"));
  11887. }
  11888. onConstruct() {
  11889. this.n0 = (this.getChild("n0"));
  11890. this.n1 = (this.getChild("n1"));
  11891. this.n2 = (this.getChild("n2"));
  11892. this.n3 = (this.getChild("n3"));
  11893. this.n4 = (this.getChild("n4"));
  11894. this.n5 = (this.getChild("n5"));
  11895. this.n6 = (this.getChild("n6"));
  11896. this.n7 = (this.getChild("n7"));
  11897. this.n8 = (this.getChild("n8"));
  11898. this.n9 = (this.getChild("n9"));
  11899. this.n10 = (this.getChild("n10"));
  11900. this.n11 = (this.getChild("n11"));
  11901. this.n12 = (this.getChild("n12"));
  11902. this.n13 = (this.getChild("n13"));
  11903. this.n14 = (this.getChild("n14"));
  11904. this.n15 = (this.getChild("n15"));
  11905. this.n16 = (this.getChild("n16"));
  11906. this.n19 = (this.getChild("n19"));
  11907. this.n20 = (this.getChild("n20"));
  11908. this.n21 = (this.getChild("n21"));
  11909. this.n22 = (this.getChild("n22"));
  11910. this.n23 = (this.getChild("n23"));
  11911. this.n24 = (this.getChild("n24"));
  11912. this.n25 = (this.getChild("n25"));
  11913. this.n26 = (this.getChild("n26"));
  11914. this.n27 = (this.getChild("n27"));
  11915. this.n28 = (this.getChild("n28"));
  11916. this.n29 = (this.getChild("n29"));
  11917. this.n30 = (this.getChild("n30"));
  11918. this.n31 = (this.getChild("n31"));
  11919. this.n32 = (this.getChild("n32"));
  11920. this.n33 = (this.getChild("n33"));
  11921. this.n34 = (this.getChild("n34"));
  11922. this.n35 = (this.getChild("n35"));
  11923. this.t0 = this.getTransition("t0");
  11924. }
  11925. }
  11926. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11927. class ui_Component58 extends fgui.GComponent {
  11928. static createInstance() {
  11929. return (fgui.UIPackage.createObject("game", "Component58"));
  11930. }
  11931. onConstruct() {
  11932. this.n23 = (this.getChild("n23"));
  11933. this.n41 = (this.getChild("n41"));
  11934. this.n8 = (this.getChild("n8"));
  11935. this.skillList = (this.getChild("skillList"));
  11936. this.t0 = this.getTransition("t0");
  11937. }
  11938. }
  11939. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11940. class ui_Component59 extends fgui.GComponent {
  11941. static createInstance() {
  11942. return (fgui.UIPackage.createObject("game", "Component59"));
  11943. }
  11944. onConstruct() {
  11945. this.n3 = (this.getChild("n3"));
  11946. this.msgTxt = (this.getChild("msgTxt"));
  11947. this.t0 = this.getTransition("t0");
  11948. }
  11949. }
  11950. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11951. class ui_RulerNode extends fgui.GComponent {
  11952. static createInstance() {
  11953. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11954. }
  11955. onConstruct() {
  11956. this.n6 = (this.getChild("n6"));
  11957. this.n4 = (this.getChild("n4"));
  11958. this.img1 = (this.getChild("img1"));
  11959. this.img2 = (this.getChild("img2"));
  11960. }
  11961. }
  11962. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11963. class ui_Component108 extends fgui.GComponent {
  11964. static createInstance() {
  11965. return (fgui.UIPackage.createObject("game", "Component108"));
  11966. }
  11967. onConstruct() {
  11968. this.n19 = (this.getChild("n19"));
  11969. this.t0 = this.getTransition("t0");
  11970. }
  11971. }
  11972. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11973. class ui_Component63 extends fgui.GComponent {
  11974. static createInstance() {
  11975. return (fgui.UIPackage.createObject("game", "Component63"));
  11976. }
  11977. onConstruct() {
  11978. this.n66 = (this.getChild("n66"));
  11979. this.n56 = (this.getChild("n56"));
  11980. this.n63 = (this.getChild("n63"));
  11981. this.n65 = (this.getChild("n65"));
  11982. this.t0 = this.getTransition("t0");
  11983. }
  11984. }
  11985. ui_Component63.URL = "ui://isxx5ak7h657452";
  11986. class ui_topNode extends fgui.GComponent {
  11987. static createInstance() {
  11988. return (fgui.UIPackage.createObject("game", "topNode"));
  11989. }
  11990. onConstruct() {
  11991. this.selfProgress = (this.getChild("selfProgress"));
  11992. this.aiProgress = (this.getChild("aiProgress"));
  11993. this.selfKuang = (this.getChild("selfKuang"));
  11994. this.aiKuang = (this.getChild("aiKuang"));
  11995. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  11996. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  11997. this.n33 = (this.getChild("n33"));
  11998. this.n34 = (this.getChild("n34"));
  11999. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12000. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12001. this.selfBallList = (this.getChild("selfBallList"));
  12002. this.aiBallList = (this.getChild("aiBallList"));
  12003. this.middleNode = (this.getChild("middleNode"));
  12004. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12005. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12006. this.scoreNode = (this.getChild("scoreNode"));
  12007. this.selfTips = (this.getChild("selfTips"));
  12008. this.aiTips = (this.getChild("aiTips"));
  12009. }
  12010. }
  12011. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12012. class ui_selfProgress extends fgui.GProgressBar {
  12013. static createInstance() {
  12014. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12015. }
  12016. onConstruct() {
  12017. this.n3 = (this.getChild("n3"));
  12018. this.bar = (this.getChild("bar"));
  12019. }
  12020. }
  12021. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12022. class ui_aiProgress extends fgui.GProgressBar {
  12023. static createInstance() {
  12024. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12025. }
  12026. onConstruct() {
  12027. this.n3 = (this.getChild("n3"));
  12028. this.bar = (this.getChild("bar"));
  12029. }
  12030. }
  12031. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12032. class ui_ballDisplay extends fgui.GComponent {
  12033. static createInstance() {
  12034. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12035. }
  12036. onConstruct() {
  12037. this.myImg = (this.getChild("myImg"));
  12038. }
  12039. }
  12040. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12041. class ui_moveNode extends fgui.GComponent {
  12042. static createInstance() {
  12043. return (fgui.UIPackage.createObject("game", "moveNode"));
  12044. }
  12045. onConstruct() {
  12046. this.n8 = (this.getChild("n8"));
  12047. this.finger = (this.getChild("finger"));
  12048. }
  12049. }
  12050. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12051. class ui_cancelBtn extends fgui.GButton {
  12052. static createInstance() {
  12053. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12054. }
  12055. onConstruct() {
  12056. this.c1 = this.getController("c1");
  12057. this.n0 = (this.getChild("n0"));
  12058. this.n1 = (this.getChild("n1"));
  12059. }
  12060. }
  12061. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12062. class ui_shareBtn extends fgui.GButton {
  12063. static createInstance() {
  12064. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12065. }
  12066. onConstruct() {
  12067. this.c1 = this.getController("c1");
  12068. this.n2 = (this.getChild("n2"));
  12069. this.n1 = (this.getChild("n1"));
  12070. this.n3 = (this.getChild("n3"));
  12071. this.n4 = (this.getChild("n4"));
  12072. this.n5 = (this.getChild("n5"));
  12073. this.n6 = (this.getChild("n6"));
  12074. }
  12075. }
  12076. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12077. class ui_share2Btn extends fgui.GButton {
  12078. static createInstance() {
  12079. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12080. }
  12081. onConstruct() {
  12082. this.n3 = (this.getChild("n3"));
  12083. }
  12084. }
  12085. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12086. class ui_rodMethodNode extends fgui.GComponent {
  12087. static createInstance() {
  12088. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12089. }
  12090. onConstruct() {
  12091. this.bg = (this.getChild("bg"));
  12092. this.dot = (this.getChild("dot"));
  12093. }
  12094. }
  12095. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12096. class ui_sureBtn extends fgui.GButton {
  12097. static createInstance() {
  12098. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12099. }
  12100. onConstruct() {
  12101. this.n2 = (this.getChild("n2"));
  12102. this.n1 = (this.getChild("n1"));
  12103. }
  12104. }
  12105. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12106. class ui_Component18 extends fgui.GComponent {
  12107. static createInstance() {
  12108. return (fgui.UIPackage.createObject("game", "Component18"));
  12109. }
  12110. onConstruct() {
  12111. this.c1 = this.getController("c1");
  12112. this.nameTxt = (this.getChild("nameTxt"));
  12113. this.headImg = (this.getChild("headImg"));
  12114. this.n24 = (this.getChild("n24"));
  12115. this.skillImg = (this.getChild("skillImg"));
  12116. this.skillTxt = (this.getChild("skillTxt"));
  12117. }
  12118. }
  12119. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12120. class ui_Component45 extends fgui.GComponent {
  12121. static createInstance() {
  12122. return (fgui.UIPackage.createObject("game", "Component45"));
  12123. }
  12124. onConstruct() {
  12125. this.c1 = this.getController("c1");
  12126. this.n40 = (this.getChild("n40"));
  12127. this.n41 = (this.getChild("n41"));
  12128. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12129. this.n42 = (this.getChild("n42"));
  12130. this.awardTxt = (this.getChild("awardTxt"));
  12131. this.n44 = (this.getChild("n44"));
  12132. this.t0 = this.getTransition("t0");
  12133. }
  12134. }
  12135. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12136. class ui_emotionDisplay extends fgui.GButton {
  12137. static createInstance() {
  12138. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12139. }
  12140. onConstruct() {
  12141. this.myIcon = (this.getChild("myIcon"));
  12142. }
  12143. }
  12144. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12145. class ui_Component49 extends fgui.GButton {
  12146. static createInstance() {
  12147. return (fgui.UIPackage.createObject("game", "Component49"));
  12148. }
  12149. onConstruct() {
  12150. this.n69 = (this.getChild("n69"));
  12151. this.n56 = (this.getChild("n56"));
  12152. }
  12153. }
  12154. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12155. class ui_Component50 extends fgui.GButton {
  12156. static createInstance() {
  12157. return (fgui.UIPackage.createObject("game", "Component50"));
  12158. }
  12159. onConstruct() {
  12160. this.n54 = (this.getChild("n54"));
  12161. this.n65 = (this.getChild("n65"));
  12162. }
  12163. }
  12164. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12165. class ui_Component51 extends fgui.GButton {
  12166. static createInstance() {
  12167. return (fgui.UIPackage.createObject("game", "Component51"));
  12168. }
  12169. onConstruct() {
  12170. this.c1 = this.getController("c1");
  12171. this.n51 = (this.getChild("n51"));
  12172. this.n54 = (this.getChild("n54"));
  12173. }
  12174. }
  12175. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12176. class ui_Button5 extends fgui.GButton {
  12177. static createInstance() {
  12178. return (fgui.UIPackage.createObject("game", "Button5"));
  12179. }
  12180. onConstruct() {
  12181. this.c1 = this.getController("c1");
  12182. this.n0 = (this.getChild("n0"));
  12183. this.n2 = (this.getChild("n2"));
  12184. }
  12185. }
  12186. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12187. class ui_Component124 extends fgui.GComponent {
  12188. static createInstance() {
  12189. return (fgui.UIPackage.createObject("game", "Component124"));
  12190. }
  12191. onConstruct() {
  12192. this.n22 = (this.getChild("n22"));
  12193. this.shareNode = (this.getChild("shareNode"));
  12194. }
  12195. }
  12196. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12197. class ui_Component125 extends fgui.GComponent {
  12198. static createInstance() {
  12199. return (fgui.UIPackage.createObject("game", "Component125"));
  12200. }
  12201. onConstruct() {
  12202. this.n29 = (this.getChild("n29"));
  12203. this.coinTxt = (this.getChild("coinTxt"));
  12204. }
  12205. }
  12206. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12207. class ui_Component52 extends fgui.GButton {
  12208. static createInstance() {
  12209. return (fgui.UIPackage.createObject("game", "Component52"));
  12210. }
  12211. onConstruct() {
  12212. this.n35 = (this.getChild("n35"));
  12213. this.n36 = (this.getChild("n36"));
  12214. }
  12215. }
  12216. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12217. class ui_drawBtn extends fgui.GButton {
  12218. static createInstance() {
  12219. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12220. }
  12221. onConstruct() {
  12222. this.c1 = this.getController("c1");
  12223. this.n2 = (this.getChild("n2"));
  12224. this.n1 = (this.getChild("n1"));
  12225. }
  12226. }
  12227. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12228. class ui_Component43 extends fgui.GButton {
  12229. static createInstance() {
  12230. return (fgui.UIPackage.createObject("game", "Component43"));
  12231. }
  12232. onConstruct() {
  12233. this.n49 = (this.getChild("n49"));
  12234. }
  12235. }
  12236. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12237. class ui_wordsDisplay extends fgui.GComponent {
  12238. static createInstance() {
  12239. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12240. }
  12241. onConstruct() {
  12242. this.txt = (this.getChild("txt"));
  12243. this.n63 = (this.getChild("n63"));
  12244. }
  12245. }
  12246. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12247. class ui_Component3 extends fgui.GComponent {
  12248. static createInstance() {
  12249. return (fgui.UIPackage.createObject("game", "Component3"));
  12250. }
  12251. onConstruct() {
  12252. this.n26 = (this.getChild("n26"));
  12253. this.n24 = (this.getChild("n24"));
  12254. this.nameTxt = (this.getChild("nameTxt"));
  12255. this.headRoot = (this.getChild("headRoot"));
  12256. }
  12257. }
  12258. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12259. class ui_Component4 extends fgui.GComponent {
  12260. static createInstance() {
  12261. return (fgui.UIPackage.createObject("game", "Component4"));
  12262. }
  12263. onConstruct() {
  12264. this.headImg = (this.getChild("headImg"));
  12265. }
  12266. }
  12267. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12268. class ui_Component7 extends fgui.GButton {
  12269. static createInstance() {
  12270. return (fgui.UIPackage.createObject("game", "Component7"));
  12271. }
  12272. onConstruct() {
  12273. this.n17 = (this.getChild("n17"));
  12274. }
  12275. }
  12276. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12277. class ui_Component8 extends fgui.GButton {
  12278. static createInstance() {
  12279. return (fgui.UIPackage.createObject("game", "Component8"));
  12280. }
  12281. onConstruct() {
  12282. this.n19 = (this.getChild("n19"));
  12283. }
  12284. }
  12285. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12286. class ui_Component9 extends fgui.GButton {
  12287. static createInstance() {
  12288. return (fgui.UIPackage.createObject("game", "Component9"));
  12289. }
  12290. onConstruct() {
  12291. this.n18 = (this.getChild("n18"));
  12292. }
  12293. }
  12294. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12295. class ui_Component10 extends fgui.GButton {
  12296. static createInstance() {
  12297. return (fgui.UIPackage.createObject("game", "Component10"));
  12298. }
  12299. onConstruct() {
  12300. this.c1 = this.getController("c1");
  12301. this.n40 = (this.getChild("n40"));
  12302. }
  12303. }
  12304. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12305. class ui_Component11 extends fgui.GButton {
  12306. static createInstance() {
  12307. return (fgui.UIPackage.createObject("game", "Component11"));
  12308. }
  12309. onConstruct() {
  12310. this.n34 = (this.getChild("n34"));
  12311. }
  12312. }
  12313. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12314. class ui_Component12 extends fgui.GButton {
  12315. static createInstance() {
  12316. return (fgui.UIPackage.createObject("game", "Component12"));
  12317. }
  12318. onConstruct() {
  12319. this.n35 = (this.getChild("n35"));
  12320. }
  12321. }
  12322. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12323. class ui_Component13 extends fgui.GButton {
  12324. static createInstance() {
  12325. return (fgui.UIPackage.createObject("game", "Component13"));
  12326. }
  12327. onConstruct() {
  12328. this.n27 = (this.getChild("n27"));
  12329. this.n36 = (this.getChild("n36"));
  12330. }
  12331. }
  12332. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12333. class ui_Component16 extends fgui.GButton {
  12334. static createInstance() {
  12335. return (fgui.UIPackage.createObject("game", "Component16"));
  12336. }
  12337. onConstruct() {
  12338. }
  12339. }
  12340. ui_Component16.URL = "ui://isxx5ak7ixm43xz";
  12341. class ui_dh_js_tuowei extends fgui.GComponent {
  12342. static createInstance() {
  12343. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12344. }
  12345. onConstruct() {
  12346. this.n19 = (this.getChild("n19"));
  12347. this.n18 = (this.getChild("n18"));
  12348. this.n0 = (this.getChild("n0"));
  12349. this.n3 = (this.getChild("n3"));
  12350. this.n4 = (this.getChild("n4"));
  12351. this.n5 = (this.getChild("n5"));
  12352. this.n6 = (this.getChild("n6"));
  12353. this.n8 = (this.getChild("n8"));
  12354. this.n9 = (this.getChild("n9"));
  12355. this.n10 = (this.getChild("n10"));
  12356. this.n11 = (this.getChild("n11"));
  12357. this.n12 = (this.getChild("n12"));
  12358. this.n13 = (this.getChild("n13"));
  12359. this.n14 = (this.getChild("n14"));
  12360. this.n15 = (this.getChild("n15"));
  12361. this.n20 = (this.getChild("n20"));
  12362. this.t0 = this.getTransition("t0");
  12363. this.t1 = this.getTransition("t1");
  12364. }
  12365. }
  12366. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12367. class ui_dh_js_tw_g extends fgui.GComponent {
  12368. static createInstance() {
  12369. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12370. }
  12371. onConstruct() {
  12372. this.n0 = (this.getChild("n0"));
  12373. this.n1 = (this.getChild("n1"));
  12374. this.t0 = this.getTransition("t0");
  12375. }
  12376. }
  12377. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12378. class ui_dh_js_xingxing extends fgui.GComponent {
  12379. static createInstance() {
  12380. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12381. }
  12382. onConstruct() {
  12383. this.n1 = (this.getChild("n1"));
  12384. this.n2 = (this.getChild("n2"));
  12385. this.n3 = (this.getChild("n3"));
  12386. this.n4 = (this.getChild("n4"));
  12387. this.n0 = (this.getChild("n0"));
  12388. this.t2 = this.getTransition("t2");
  12389. this.t1 = this.getTransition("t1");
  12390. }
  12391. }
  12392. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12393. class ui_dh_zy_jiazai extends fgui.GComponent {
  12394. static createInstance() {
  12395. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12396. }
  12397. onConstruct() {
  12398. this.c1 = this.getController("c1");
  12399. this.n0 = (this.getChild("n0"));
  12400. this.n1 = (this.getChild("n1"));
  12401. this.n2 = (this.getChild("n2"));
  12402. this.n4 = (this.getChild("n4"));
  12403. this.n5 = (this.getChild("n5"));
  12404. this.n6 = (this.getChild("n6"));
  12405. this.n8 = (this.getChild("n8"));
  12406. this.n7 = (this.getChild("n7"));
  12407. this.t0 = this.getTransition("t0");
  12408. }
  12409. }
  12410. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12411. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12412. static createInstance() {
  12413. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12414. }
  12415. onConstruct() {
  12416. this.c1 = this.getController("c1");
  12417. this.n3 = (this.getChild("n3"));
  12418. this.n5 = (this.getChild("n5"));
  12419. this.n4 = (this.getChild("n4"));
  12420. this.n0 = (this.getChild("n0"));
  12421. this.n1 = (this.getChild("n1"));
  12422. this.n2 = (this.getChild("n2"));
  12423. }
  12424. }
  12425. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12426. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12427. static createInstance() {
  12428. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12429. }
  12430. onConstruct() {
  12431. this.n19 = (this.getChild("n19"));
  12432. this.n21 = (this.getChild("n21"));
  12433. this.n0 = (this.getChild("n0"));
  12434. this.n3 = (this.getChild("n3"));
  12435. this.n4 = (this.getChild("n4"));
  12436. this.n5 = (this.getChild("n5"));
  12437. this.n6 = (this.getChild("n6"));
  12438. this.n8 = (this.getChild("n8"));
  12439. this.n9 = (this.getChild("n9"));
  12440. this.n10 = (this.getChild("n10"));
  12441. this.n11 = (this.getChild("n11"));
  12442. this.n12 = (this.getChild("n12"));
  12443. this.n13 = (this.getChild("n13"));
  12444. this.n14 = (this.getChild("n14"));
  12445. this.n15 = (this.getChild("n15"));
  12446. this.n23 = (this.getChild("n23"));
  12447. this.t0 = this.getTransition("t0");
  12448. this.t1 = this.getTransition("t1");
  12449. }
  12450. }
  12451. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12452. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12453. static createInstance() {
  12454. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12455. }
  12456. onConstruct() {
  12457. this.n1 = (this.getChild("n1"));
  12458. this.n2 = (this.getChild("n2"));
  12459. this.t0 = this.getTransition("t0");
  12460. }
  12461. }
  12462. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12463. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12464. static createInstance() {
  12465. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12466. }
  12467. onConstruct() {
  12468. this.n4 = (this.getChild("n4"));
  12469. this.n2 = (this.getChild("n2"));
  12470. this.n3 = (this.getChild("n3"));
  12471. this.idle = this.getTransition("idle");
  12472. this.attack = this.getTransition("attack");
  12473. }
  12474. }
  12475. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12476. class ui_special extends fgui.GComponent {
  12477. static createInstance() {
  12478. return (fgui.UIPackage.createObject("game", "special"));
  12479. }
  12480. onConstruct() {
  12481. this.n18 = (this.getChild("n18"));
  12482. this.n19 = (this.getChild("n19"));
  12483. this.n20 = (this.getChild("n20"));
  12484. this.n21 = (this.getChild("n21"));
  12485. this.n22 = (this.getChild("n22"));
  12486. this.levelTxt = (this.getChild("levelTxt"));
  12487. this.n24 = (this.getChild("n24"));
  12488. this.n25 = (this.getChild("n25"));
  12489. this.t0 = this.getTransition("t0");
  12490. }
  12491. }
  12492. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12493. class ui_Component145 extends fgui.GComponent {
  12494. static createInstance() {
  12495. return (fgui.UIPackage.createObject("game", "Component145"));
  12496. }
  12497. onConstruct() {
  12498. this.guanyuNode = (this.getChild("guanyuNode"));
  12499. }
  12500. }
  12501. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12502. class ui_longBtn extends fgui.GButton {
  12503. static createInstance() {
  12504. return (fgui.UIPackage.createObject("game", "longBtn"));
  12505. }
  12506. onConstruct() {
  12507. this.c1 = this.getController("c1");
  12508. this.n2 = (this.getChild("n2"));
  12509. this.n1 = (this.getChild("n1"));
  12510. this.n4 = (this.getChild("n4"));
  12511. }
  12512. }
  12513. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12514. class ui_Component146 extends fgui.GComponent {
  12515. static createInstance() {
  12516. return (fgui.UIPackage.createObject("game", "Component146"));
  12517. }
  12518. onConstruct() {
  12519. this.n89 = (this.getChild("n89"));
  12520. this.n90 = (this.getChild("n90"));
  12521. this.guideBtn = (this.getChild("guideBtn"));
  12522. }
  12523. }
  12524. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12525. class ui_Component146_11 extends fgui.GComponent {
  12526. static createInstance() {
  12527. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12528. }
  12529. onConstruct() {
  12530. this.n89 = (this.getChild("n89"));
  12531. this.n90 = (this.getChild("n90"));
  12532. this.guideBtn = (this.getChild("guideBtn"));
  12533. }
  12534. }
  12535. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12536. class ui_Component111_1 extends fgui.GComponent {
  12537. static createInstance() {
  12538. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12539. }
  12540. onConstruct() {
  12541. this.n68 = (this.getChild("n68"));
  12542. this.myMask = (this.getChild("myMask"));
  12543. }
  12544. }
  12545. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12546. class ui_Component64_1 extends fgui.GComponent {
  12547. static createInstance() {
  12548. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12549. }
  12550. onConstruct() {
  12551. this.n57 = (this.getChild("n57"));
  12552. this.n54 = (this.getChild("n54"));
  12553. this.n55 = (this.getChild("n55"));
  12554. this.n56 = (this.getChild("n56"));
  12555. this.t1 = this.getTransition("t1");
  12556. }
  12557. }
  12558. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12559. class ui_ModeSelection_com123 extends fgui.GComponent {
  12560. static createInstance() {
  12561. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12562. }
  12563. onConstruct() {
  12564. this.type1 = (this.getChild("type1"));
  12565. this.type2 = (this.getChild("type2"));
  12566. this.type3 = (this.getChild("type3"));
  12567. this.n38 = (this.getChild("n38"));
  12568. this.t0 = this.getTransition("t0");
  12569. }
  12570. }
  12571. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12572. class ui_Component132_2 extends fgui.GComponent {
  12573. static createInstance() {
  12574. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12575. }
  12576. onConstruct() {
  12577. this.n25 = (this.getChild("n25"));
  12578. this.n26 = (this.getChild("n26"));
  12579. this.n27 = (this.getChild("n27"));
  12580. this.t0 = this.getTransition("t0");
  12581. }
  12582. }
  12583. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12584. class ui_UIPower$1 extends fgui.GComponent {
  12585. static createInstance() {
  12586. return (fgui.UIPackage.createObject("game", "UIPower"));
  12587. }
  12588. onConstruct() {
  12589. this.n11 = (this.getChild("n11"));
  12590. this.myNode = (this.getChild("myNode"));
  12591. this.t0 = this.getTransition("t0");
  12592. }
  12593. }
  12594. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12595. class ui_Component133 extends fgui.GComponent {
  12596. static createInstance() {
  12597. return (fgui.UIPackage.createObject("game", "Component133"));
  12598. }
  12599. onConstruct() {
  12600. this.n29 = (this.getChild("n29"));
  12601. this.n30 = (this.getChild("n30"));
  12602. }
  12603. }
  12604. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12605. class ui_Component134 extends fgui.GComponent {
  12606. static createInstance() {
  12607. return (fgui.UIPackage.createObject("game", "Component134"));
  12608. }
  12609. onConstruct() {
  12610. this.n30 = (this.getChild("n30"));
  12611. this.n31 = (this.getChild("n31"));
  12612. this.t0 = this.getTransition("t0");
  12613. }
  12614. }
  12615. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12616. class ui_Component135 extends fgui.GComponent {
  12617. static createInstance() {
  12618. return (fgui.UIPackage.createObject("game", "Component135"));
  12619. }
  12620. onConstruct() {
  12621. this.n30 = (this.getChild("n30"));
  12622. this.t0 = this.getTransition("t0");
  12623. }
  12624. }
  12625. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12626. class ui_Component137 extends fgui.GComponent {
  12627. static createInstance() {
  12628. return (fgui.UIPackage.createObject("game", "Component137"));
  12629. }
  12630. onConstruct() {
  12631. this.n28 = (this.getChild("n28"));
  12632. this.n29 = (this.getChild("n29"));
  12633. this.n30 = (this.getChild("n30"));
  12634. this.n32 = (this.getChild("n32"));
  12635. }
  12636. }
  12637. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12638. class ui_dh_zuanshi extends fgui.GButton {
  12639. static createInstance() {
  12640. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12641. }
  12642. onConstruct() {
  12643. this.n1 = (this.getChild("n1"));
  12644. this.n2 = (this.getChild("n2"));
  12645. this.n0 = (this.getChild("n0"));
  12646. this.n3 = (this.getChild("n3"));
  12647. this.n4 = (this.getChild("n4"));
  12648. }
  12649. }
  12650. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12651. class ui_Component138 extends fgui.GComponent {
  12652. static createInstance() {
  12653. return (fgui.UIPackage.createObject("game", "Component138"));
  12654. }
  12655. onConstruct() {
  12656. this.n1 = (this.getChild("n1"));
  12657. this.n2 = (this.getChild("n2"));
  12658. this.t0 = this.getTransition("t0");
  12659. }
  12660. }
  12661. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12662. class ui_Component139 extends fgui.GComponent {
  12663. static createInstance() {
  12664. return (fgui.UIPackage.createObject("game", "Component139"));
  12665. }
  12666. onConstruct() {
  12667. this.n0 = (this.getChild("n0"));
  12668. this.t0 = this.getTransition("t0");
  12669. }
  12670. }
  12671. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12672. class ui_Component140 extends fgui.GComponent {
  12673. static createInstance() {
  12674. return (fgui.UIPackage.createObject("game", "Component140"));
  12675. }
  12676. onConstruct() {
  12677. this.n2 = (this.getChild("n2"));
  12678. this.n3 = (this.getChild("n3"));
  12679. this.t0 = this.getTransition("t0");
  12680. }
  12681. }
  12682. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12683. class ui_Component141 extends fgui.GComponent {
  12684. static createInstance() {
  12685. return (fgui.UIPackage.createObject("game", "Component141"));
  12686. }
  12687. onConstruct() {
  12688. this.n0 = (this.getChild("n0"));
  12689. this.t0 = this.getTransition("t0");
  12690. }
  12691. }
  12692. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12693. class ui_powerNode extends fgui.GProgressBar {
  12694. static createInstance() {
  12695. return (fgui.UIPackage.createObject("game", "powerNode"));
  12696. }
  12697. onConstruct() {
  12698. this.n2 = (this.getChild("n2"));
  12699. this.bar_v = (this.getChild("bar_v"));
  12700. this.showImg = (this.getChild("showImg"));
  12701. this.n12 = (this.getChild("n12"));
  12702. }
  12703. }
  12704. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12705. class ui_dh_jingbi1 extends fgui.GComponent {
  12706. static createInstance() {
  12707. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12708. }
  12709. onConstruct() {
  12710. this.n0 = (this.getChild("n0"));
  12711. this.n1 = (this.getChild("n1"));
  12712. this.n2 = (this.getChild("n2"));
  12713. this.n3 = (this.getChild("n3"));
  12714. this.n4 = (this.getChild("n4"));
  12715. this.n5 = (this.getChild("n5"));
  12716. this.n6 = (this.getChild("n6"));
  12717. this.n8 = (this.getChild("n8"));
  12718. this.t0 = this.getTransition("t0");
  12719. }
  12720. }
  12721. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12722. class ui_Component94 extends fgui.GButton {
  12723. static createInstance() {
  12724. return (fgui.UIPackage.createObject("game", "Component94"));
  12725. }
  12726. onConstruct() {
  12727. this.n77 = (this.getChild("n77"));
  12728. }
  12729. }
  12730. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12731. class ui_Component95 extends fgui.GButton {
  12732. static createInstance() {
  12733. return (fgui.UIPackage.createObject("game", "Component95"));
  12734. }
  12735. onConstruct() {
  12736. this.n77 = (this.getChild("n77"));
  12737. }
  12738. }
  12739. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12740. class ui_Component126 extends fgui.GComponent {
  12741. static createInstance() {
  12742. return (fgui.UIPackage.createObject("game", "Component126"));
  12743. }
  12744. onConstruct() {
  12745. this.c1 = this.getController("c1");
  12746. this.normalBtn = (this.getChild("normalBtn"));
  12747. this.tripleBtn = (this.getChild("tripleBtn"));
  12748. }
  12749. }
  12750. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12751. class ui_Component60 extends fgui.GComponent {
  12752. static createInstance() {
  12753. return (fgui.UIPackage.createObject("game", "Component60"));
  12754. }
  12755. onConstruct() {
  12756. this.c1 = this.getController("c1");
  12757. this.n48 = (this.getChild("n48"));
  12758. this.womanTxt = (this.getChild("womanTxt"));
  12759. this.t0 = this.getTransition("t0");
  12760. }
  12761. }
  12762. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12763. class ui_Component98_3 extends fgui.GButton {
  12764. static createInstance() {
  12765. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12766. }
  12767. onConstruct() {
  12768. this.c1 = this.getController("c1");
  12769. this.n8 = (this.getChild("n8"));
  12770. this.n41 = (this.getChild("n41"));
  12771. this.n40 = (this.getChild("n40"));
  12772. }
  12773. }
  12774. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12775. class ui_ModeSelection_com1 extends fgui.GButton {
  12776. static createInstance() {
  12777. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12778. }
  12779. onConstruct() {
  12780. this.n34 = (this.getChild("n34"));
  12781. this.n36 = (this.getChild("n36"));
  12782. this.n22 = (this.getChild("n22"));
  12783. this.n20 = (this.getChild("n20"));
  12784. this.n23 = (this.getChild("n23"));
  12785. this.n24 = (this.getChild("n24"));
  12786. this.n26 = (this.getChild("n26"));
  12787. this.n33 = (this.getChild("n33"));
  12788. this.coinImg = (this.getChild("coinImg"));
  12789. this.need = (this.getChild("need"));
  12790. this.n35 = (this.getChild("n35"));
  12791. this.n29 = (this.getChild("n29"));
  12792. this.tipsTxt = (this.getChild("tipsTxt"));
  12793. this.n30 = (this.getChild("n30"));
  12794. this.peopleTxt = (this.getChild("peopleTxt"));
  12795. this.t0 = this.getTransition("t0");
  12796. }
  12797. }
  12798. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12799. class ui_ModeSelection_com2 extends fgui.GButton {
  12800. static createInstance() {
  12801. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12802. }
  12803. onConstruct() {
  12804. this.n36 = (this.getChild("n36"));
  12805. this.n34 = (this.getChild("n34"));
  12806. this.n22 = (this.getChild("n22"));
  12807. this.n20 = (this.getChild("n20"));
  12808. this.n23 = (this.getChild("n23"));
  12809. this.n24 = (this.getChild("n24"));
  12810. this.n26 = (this.getChild("n26"));
  12811. this.n33 = (this.getChild("n33"));
  12812. this.coinImg = (this.getChild("coinImg"));
  12813. this.need = (this.getChild("need"));
  12814. this.n35 = (this.getChild("n35"));
  12815. this.n29 = (this.getChild("n29"));
  12816. this.tipsTxt = (this.getChild("tipsTxt"));
  12817. this.n30 = (this.getChild("n30"));
  12818. this.peopleTxt = (this.getChild("peopleTxt"));
  12819. this.t0 = this.getTransition("t0");
  12820. }
  12821. }
  12822. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12823. class ui_ModeSelection_com3 extends fgui.GButton {
  12824. static createInstance() {
  12825. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12826. }
  12827. onConstruct() {
  12828. this.n34 = (this.getChild("n34"));
  12829. this.n36 = (this.getChild("n36"));
  12830. this.n22 = (this.getChild("n22"));
  12831. this.n20 = (this.getChild("n20"));
  12832. this.n23 = (this.getChild("n23"));
  12833. this.n24 = (this.getChild("n24"));
  12834. this.n26 = (this.getChild("n26"));
  12835. this.n33 = (this.getChild("n33"));
  12836. this.coinImg = (this.getChild("coinImg"));
  12837. this.need = (this.getChild("need"));
  12838. this.n35 = (this.getChild("n35"));
  12839. this.n29 = (this.getChild("n29"));
  12840. this.tipsTxt = (this.getChild("tipsTxt"));
  12841. this.n30 = (this.getChild("n30"));
  12842. this.peopleTxt = (this.getChild("peopleTxt"));
  12843. this.t0 = this.getTransition("t0");
  12844. }
  12845. }
  12846. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12847. class ui_Invitation_com1 extends fgui.GComponent {
  12848. static createInstance() {
  12849. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12850. }
  12851. onConstruct() {
  12852. this.n14 = (this.getChild("n14"));
  12853. this.n13 = (this.getChild("n13"));
  12854. this.n3 = (this.getChild("n3"));
  12855. this.n1 = (this.getChild("n1"));
  12856. this.n6 = (this.getChild("n6"));
  12857. this.n7 = (this.getChild("n7"));
  12858. this.enterBtn = (this.getChild("enterBtn"));
  12859. this.n11 = (this.getChild("n11"));
  12860. this.n12 = (this.getChild("n12"));
  12861. this.n15 = (this.getChild("n15"));
  12862. this.t0 = this.getTransition("t0");
  12863. this.t1 = this.getTransition("t1");
  12864. }
  12865. }
  12866. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12867. class ui_Component87_1 extends fgui.GComponent {
  12868. static createInstance() {
  12869. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12870. }
  12871. onConstruct() {
  12872. this.n74 = (this.getChild("n74"));
  12873. this.n73 = (this.getChild("n73"));
  12874. this.ballTxt = (this.getChild("ballTxt"));
  12875. this.n76 = (this.getChild("n76"));
  12876. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12877. this.levelTxt = (this.getChild("levelTxt"));
  12878. this.n87 = (this.getChild("n87"));
  12879. this.n84 = (this.getChild("n84"));
  12880. this.hpTxt = (this.getChild("hpTxt"));
  12881. this.n89 = (this.getChild("n89"));
  12882. this.tipsTxt = (this.getChild("tipsTxt"));
  12883. }
  12884. }
  12885. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12886. class ui_sqg1 extends fgui.GComponent {
  12887. static createInstance() {
  12888. return (fgui.UIPackage.createObject("game", "sqg1"));
  12889. }
  12890. onConstruct() {
  12891. this.n1 = (this.getChild("n1"));
  12892. this.n0 = (this.getChild("n0"));
  12893. }
  12894. }
  12895. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12896. class ui_sqg2 extends fgui.GComponent {
  12897. static createInstance() {
  12898. return (fgui.UIPackage.createObject("game", "sqg2"));
  12899. }
  12900. onConstruct() {
  12901. this.n1 = (this.getChild("n1"));
  12902. this.n0 = (this.getChild("n0"));
  12903. }
  12904. }
  12905. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12906. class ui_sqg3 extends fgui.GComponent {
  12907. static createInstance() {
  12908. return (fgui.UIPackage.createObject("game", "sqg3"));
  12909. }
  12910. onConstruct() {
  12911. this.n1 = (this.getChild("n1"));
  12912. this.n0 = (this.getChild("n0"));
  12913. }
  12914. }
  12915. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12916. class ui_sqg4 extends fgui.GComponent {
  12917. static createInstance() {
  12918. return (fgui.UIPackage.createObject("game", "sqg4"));
  12919. }
  12920. onConstruct() {
  12921. this.n1 = (this.getChild("n1"));
  12922. this.n0 = (this.getChild("n0"));
  12923. }
  12924. }
  12925. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12926. class ui_Component36 extends fgui.GButton {
  12927. static createInstance() {
  12928. return (fgui.UIPackage.createObject("game", "Component36"));
  12929. }
  12930. onConstruct() {
  12931. this.c1 = this.getController("c1");
  12932. this.n53 = (this.getChild("n53"));
  12933. this.n56 = (this.getChild("n56"));
  12934. }
  12935. }
  12936. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12937. class ui_Component37 extends fgui.GButton {
  12938. static createInstance() {
  12939. return (fgui.UIPackage.createObject("game", "Component37"));
  12940. }
  12941. onConstruct() {
  12942. this.c1 = this.getController("c1");
  12943. this.n52 = (this.getChild("n52"));
  12944. this.n54 = (this.getChild("n54"));
  12945. }
  12946. }
  12947. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12948. class ui_UISetting extends fgui.GComponent {
  12949. static createInstance() {
  12950. return (fgui.UIPackage.createObject("game", "UISetting"));
  12951. }
  12952. onConstruct() {
  12953. this.c1 = this.getController("c1");
  12954. this.n4 = (this.getChild("n4"));
  12955. this.soundBtn = (this.getChild("soundBtn"));
  12956. this.shakeBtn = (this.getChild("shakeBtn"));
  12957. this.clickNode = (this.getChild("clickNode"));
  12958. this.xyBtn = (this.getChild("xyBtn"));
  12959. }
  12960. }
  12961. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12962. class ui_Component39 extends fgui.GComponent {
  12963. static createInstance() {
  12964. return (fgui.UIPackage.createObject("game", "Component39"));
  12965. }
  12966. onConstruct() {
  12967. this.n5 = (this.getChild("n5"));
  12968. this.n6 = (this.getChild("n6"));
  12969. this.n7 = (this.getChild("n7"));
  12970. this.t0 = this.getTransition("t0");
  12971. }
  12972. }
  12973. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12974. class ui_Component40 extends fgui.GButton {
  12975. static createInstance() {
  12976. return (fgui.UIPackage.createObject("game", "Component40"));
  12977. }
  12978. onConstruct() {
  12979. this.n46 = (this.getChild("n46"));
  12980. this.n47 = (this.getChild("n47"));
  12981. }
  12982. }
  12983. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  12984. class ui_Component41 extends fgui.GComponent {
  12985. static createInstance() {
  12986. return (fgui.UIPackage.createObject("game", "Component41"));
  12987. }
  12988. onConstruct() {
  12989. this.c1 = this.getController("c1");
  12990. this.n0 = (this.getChild("n0"));
  12991. this.titleTxt = (this.getChild("titleTxt"));
  12992. this.n2 = (this.getChild("n2"));
  12993. this.msgTips = (this.getChild("msgTips"));
  12994. this.numTxt = (this.getChild("numTxt"));
  12995. this.n18 = (this.getChild("n18"));
  12996. this.cancelBtn = (this.getChild("cancelBtn"));
  12997. this.videoBtn = (this.getChild("videoBtn"));
  12998. this.n10 = (this.getChild("n10"));
  12999. }
  13000. }
  13001. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13002. class ui_Component42 extends fgui.GComponent {
  13003. static createInstance() {
  13004. return (fgui.UIPackage.createObject("game", "Component42"));
  13005. }
  13006. onConstruct() {
  13007. this.c1 = this.getController("c1");
  13008. this.n1 = (this.getChild("n1"));
  13009. this.n2 = (this.getChild("n2"));
  13010. this.n3 = (this.getChild("n3"));
  13011. this.tipsTxt = (this.getChild("tipsTxt"));
  13012. this.cancelBtn = (this.getChild("cancelBtn"));
  13013. this.sureBtn = (this.getChild("sureBtn"));
  13014. this.n11 = (this.getChild("n11"));
  13015. this.n13 = (this.getChild("n13"));
  13016. this.n14 = (this.getChild("n14"));
  13017. this.womanTxt = (this.getChild("womanTxt"));
  13018. this.t0 = this.getTransition("t0");
  13019. }
  13020. }
  13021. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13022. class ui_dh_js_shengli extends fgui.GComponent {
  13023. static createInstance() {
  13024. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13025. }
  13026. onConstruct() {
  13027. this.n3 = (this.getChild("n3"));
  13028. this.n4 = (this.getChild("n4"));
  13029. this.n1 = (this.getChild("n1"));
  13030. this.n2 = (this.getChild("n2"));
  13031. this.n5 = (this.getChild("n5"));
  13032. this.n6 = (this.getChild("n6"));
  13033. this.n7 = (this.getChild("n7"));
  13034. this.n8 = (this.getChild("n8"));
  13035. this.attack = this.getTransition("attack");
  13036. this.idle = this.getTransition("idle");
  13037. }
  13038. }
  13039. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13040. class ui_dh_js_shengli_g extends fgui.GComponent {
  13041. static createInstance() {
  13042. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13043. }
  13044. onConstruct() {
  13045. this.n3 = (this.getChild("n3"));
  13046. this.n1 = (this.getChild("n1"));
  13047. this.t0 = this.getTransition("t0");
  13048. }
  13049. }
  13050. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13051. class ui_dh_js_shibai extends fgui.GComponent {
  13052. static createInstance() {
  13053. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13054. }
  13055. onConstruct() {
  13056. this.n0 = (this.getChild("n0"));
  13057. this.n1 = (this.getChild("n1"));
  13058. this.n2 = (this.getChild("n2"));
  13059. this.n3 = (this.getChild("n3"));
  13060. this.idle = this.getTransition("idle");
  13061. this.attack = this.getTransition("attack");
  13062. }
  13063. }
  13064. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13065. class ui_dh_zy_ganfa extends fgui.GButton {
  13066. static createInstance() {
  13067. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13068. }
  13069. onConstruct() {
  13070. this.n0 = (this.getChild("n0"));
  13071. }
  13072. }
  13073. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13074. class ui_dh_zy_sc_guang extends fgui.GButton {
  13075. static createInstance() {
  13076. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13077. }
  13078. onConstruct() {
  13079. this.n0 = (this.getChild("n0"));
  13080. this.n2 = (this.getChild("n2"));
  13081. }
  13082. }
  13083. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13084. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13085. static createInstance() {
  13086. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13087. }
  13088. onConstruct() {
  13089. this.n0 = (this.getChild("n0"));
  13090. this.n3 = (this.getChild("n3"));
  13091. this.t0 = this.getTransition("t0");
  13092. }
  13093. }
  13094. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13095. class ui_dh_zy_wanfa extends fgui.GButton {
  13096. static createInstance() {
  13097. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13098. }
  13099. onConstruct() {
  13100. this.n0 = (this.getChild("n0"));
  13101. }
  13102. }
  13103. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13104. class ui_Component53_1 extends fgui.GComponent {
  13105. static createInstance() {
  13106. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13107. }
  13108. onConstruct() {
  13109. this.n0 = (this.getChild("n0"));
  13110. this.n1 = (this.getChild("n1"));
  13111. this.n2 = (this.getChild("n2"));
  13112. this.n3 = (this.getChild("n3"));
  13113. this.n4 = (this.getChild("n4"));
  13114. this.n5 = (this.getChild("n5"));
  13115. this.n6 = (this.getChild("n6"));
  13116. this.n7 = (this.getChild("n7"));
  13117. this.n8 = (this.getChild("n8"));
  13118. this.n9 = (this.getChild("n9"));
  13119. this.n10 = (this.getChild("n10"));
  13120. this.n11 = (this.getChild("n11"));
  13121. this.n12 = (this.getChild("n12"));
  13122. this.n13 = (this.getChild("n13"));
  13123. this.n14 = (this.getChild("n14"));
  13124. this.n15 = (this.getChild("n15"));
  13125. this.n16 = (this.getChild("n16"));
  13126. this.n19 = (this.getChild("n19"));
  13127. this.n20 = (this.getChild("n20"));
  13128. this.n21 = (this.getChild("n21"));
  13129. this.n22 = (this.getChild("n22"));
  13130. this.n23 = (this.getChild("n23"));
  13131. this.n24 = (this.getChild("n24"));
  13132. this.n25 = (this.getChild("n25"));
  13133. this.n26 = (this.getChild("n26"));
  13134. this.n27 = (this.getChild("n27"));
  13135. this.n28 = (this.getChild("n28"));
  13136. this.n29 = (this.getChild("n29"));
  13137. this.n30 = (this.getChild("n30"));
  13138. this.n31 = (this.getChild("n31"));
  13139. this.n32 = (this.getChild("n32"));
  13140. this.n33 = (this.getChild("n33"));
  13141. this.n34 = (this.getChild("n34"));
  13142. this.n35 = (this.getChild("n35"));
  13143. this.t0 = this.getTransition("t0");
  13144. }
  13145. }
  13146. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13147. class ui_Component30 extends fgui.GComponent {
  13148. static createInstance() {
  13149. return (fgui.UIPackage.createObject("game", "Component30"));
  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.n53 = (this.getChild("n53"));
  13158. this.n54 = (this.getChild("n54"));
  13159. this.n55 = (this.getChild("n55"));
  13160. this.n56 = (this.getChild("n56"));
  13161. }
  13162. }
  13163. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13164. class ui_Component30_1 extends fgui.GComponent {
  13165. static createInstance() {
  13166. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13167. }
  13168. onConstruct() {
  13169. this.c1 = this.getController("c1");
  13170. this.n46 = (this.getChild("n46"));
  13171. this.n47 = (this.getChild("n47"));
  13172. this.numTxt = (this.getChild("numTxt"));
  13173. this.n50 = (this.getChild("n50"));
  13174. this.n51 = (this.getChild("n51"));
  13175. this.n52 = (this.getChild("n52"));
  13176. this.n53 = (this.getChild("n53"));
  13177. this.n54 = (this.getChild("n54"));
  13178. }
  13179. }
  13180. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13181. class ui_Component31 extends fgui.GComponent {
  13182. static createInstance() {
  13183. return (fgui.UIPackage.createObject("game", "Component31"));
  13184. }
  13185. onConstruct() {
  13186. this.n55 = (this.getChild("n55"));
  13187. this.n54 = (this.getChild("n54"));
  13188. this.conditionTxt = (this.getChild("conditionTxt"));
  13189. this.n57 = (this.getChild("n57"));
  13190. this.t0 = this.getTransition("t0");
  13191. }
  13192. }
  13193. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13194. class ui_Component32 extends fgui.GComponent {
  13195. static createInstance() {
  13196. return (fgui.UIPackage.createObject("game", "Component32"));
  13197. }
  13198. onConstruct() {
  13199. this.n5 = (this.getChild("n5"));
  13200. this.n6 = (this.getChild("n6"));
  13201. this.n7 = (this.getChild("n7"));
  13202. this.t0 = this.getTransition("t0");
  13203. }
  13204. }
  13205. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13206. class ui_AwardItem extends fgui.GComponent {
  13207. static createInstance() {
  13208. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13209. }
  13210. onConstruct() {
  13211. this.n9 = (this.getChild("n9"));
  13212. this.myIcon = (this.getChild("myIcon"));
  13213. this.numTxt = (this.getChild("numTxt"));
  13214. this.nameTxt = (this.getChild("nameTxt"));
  13215. this.n16 = (this.getChild("n16"));
  13216. this.n17 = (this.getChild("n17"));
  13217. }
  13218. }
  13219. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13220. class ui_ranking_com1 extends fgui.GButton {
  13221. static createInstance() {
  13222. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13223. }
  13224. onConstruct() {
  13225. this.c1 = this.getController("c1");
  13226. this.n49 = (this.getChild("n49"));
  13227. this.n18 = (this.getChild("n18"));
  13228. this.n46 = (this.getChild("n46"));
  13229. this.n48 = (this.getChild("n48"));
  13230. this.n50 = (this.getChild("n50"));
  13231. }
  13232. }
  13233. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13234. class ui_ranking_com2 extends fgui.GButton {
  13235. static createInstance() {
  13236. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13237. }
  13238. onConstruct() {
  13239. this.c1 = this.getController("c1");
  13240. this.n49 = (this.getChild("n49"));
  13241. this.n18 = (this.getChild("n18"));
  13242. this.n46 = (this.getChild("n46"));
  13243. this.n48 = (this.getChild("n48"));
  13244. this.n50 = (this.getChild("n50"));
  13245. }
  13246. }
  13247. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13248. class ui_ranking_com3 extends fgui.GComponent {
  13249. static createInstance() {
  13250. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13251. }
  13252. onConstruct() {
  13253. this.n17 = (this.getChild("n17"));
  13254. this.myIcon = (this.getChild("myIcon"));
  13255. }
  13256. }
  13257. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13258. class ui_ranking_com4 extends fgui.GComponent {
  13259. static createInstance() {
  13260. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13261. }
  13262. onConstruct() {
  13263. this.n16 = (this.getChild("n16"));
  13264. this.head = (this.getChild("head"));
  13265. }
  13266. }
  13267. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13268. class ui_ranking_com5 extends fgui.GComponent {
  13269. static createInstance() {
  13270. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13271. }
  13272. onConstruct() {
  13273. this.c1 = this.getController("c1");
  13274. this.c2 = this.getController("c2");
  13275. this.n2 = (this.getChild("n2"));
  13276. this.n3 = (this.getChild("n3"));
  13277. this.levelBtn = (this.getChild("levelBtn"));
  13278. this.starBtn = (this.getChild("starBtn"));
  13279. this.n23 = (this.getChild("n23"));
  13280. this.n24 = (this.getChild("n24"));
  13281. this.n25 = (this.getChild("n25"));
  13282. this.myList = (this.getChild("myList"));
  13283. this.selfNode = (this.getChild("selfNode"));
  13284. this.n9 = (this.getChild("n9"));
  13285. this.n12 = (this.getChild("n12"));
  13286. this.n13 = (this.getChild("n13"));
  13287. this.n14 = (this.getChild("n14"));
  13288. this.n39 = (this.getChild("n39"));
  13289. this.n41 = (this.getChild("n41"));
  13290. this.n42 = (this.getChild("n42"));
  13291. this.n45 = (this.getChild("n45"));
  13292. this.changeBtn = (this.getChild("changeBtn"));
  13293. this.closeBtn = (this.getChild("closeBtn"));
  13294. this.t0 = this.getTransition("t0");
  13295. }
  13296. }
  13297. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13298. class ui_RankItem extends fgui.GComponent {
  13299. static createInstance() {
  13300. return (fgui.UIPackage.createObject("game", "RankItem"));
  13301. }
  13302. onConstruct() {
  13303. this.n10 = (this.getChild("n10"));
  13304. this.n11 = (this.getChild("n11"));
  13305. this.rankTxt = (this.getChild("rankTxt"));
  13306. this.headNode = (this.getChild("headNode"));
  13307. this.nameTxt = (this.getChild("nameTxt"));
  13308. this.n19 = (this.getChild("n19"));
  13309. this.valueTxt = (this.getChild("valueTxt"));
  13310. this.img1 = (this.getChild("img1"));
  13311. this.img2 = (this.getChild("img2"));
  13312. this.img3 = (this.getChild("img3"));
  13313. }
  13314. }
  13315. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13316. class ui_ranking_com9 extends fgui.GComponent {
  13317. static createInstance() {
  13318. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13319. }
  13320. onConstruct() {
  13321. this.c1 = this.getController("c1");
  13322. this.n27 = (this.getChild("n27"));
  13323. this.n28 = (this.getChild("n28"));
  13324. this.headNode = (this.getChild("headNode"));
  13325. this.rankTxt = (this.getChild("rankTxt"));
  13326. this.nameTxt = (this.getChild("nameTxt"));
  13327. this.n34 = (this.getChild("n34"));
  13328. this.valueTxt = (this.getChild("valueTxt"));
  13329. this.n36 = (this.getChild("n36"));
  13330. this.n37 = (this.getChild("n37"));
  13331. this.n38 = (this.getChild("n38"));
  13332. this.n39 = (this.getChild("n39"));
  13333. this.n40 = (this.getChild("n40"));
  13334. }
  13335. }
  13336. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13337. class ui_ranking_com10 extends fgui.GComponent {
  13338. static createInstance() {
  13339. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13340. }
  13341. onConstruct() {
  13342. this.n23 = (this.getChild("n23"));
  13343. this.n24 = (this.getChild("n24"));
  13344. }
  13345. }
  13346. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13347. class ui_ranking_com11 extends fgui.GComponent {
  13348. static createInstance() {
  13349. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13350. }
  13351. onConstruct() {
  13352. this.n24 = (this.getChild("n24"));
  13353. this.n25 = (this.getChild("n25"));
  13354. this.t0 = this.getTransition("t0");
  13355. }
  13356. }
  13357. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13358. class ui_ranking_com13 extends fgui.GButton {
  13359. static createInstance() {
  13360. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13361. }
  13362. onConstruct() {
  13363. this.c1 = this.getController("c1");
  13364. this.n44 = (this.getChild("n44"));
  13365. this.n45 = (this.getChild("n45"));
  13366. this.n46 = (this.getChild("n46"));
  13367. }
  13368. }
  13369. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13370. class ui_Component122 extends fgui.GComponent {
  13371. static createInstance() {
  13372. return (fgui.UIPackage.createObject("game", "Component122"));
  13373. }
  13374. onConstruct() {
  13375. this.gameNode1 = (this.getChild("gameNode1"));
  13376. this.gameNode2 = (this.getChild("gameNode2"));
  13377. this.gameNode3 = (this.getChild("gameNode3"));
  13378. }
  13379. }
  13380. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13381. class ui_skillItem extends fgui.GComponent {
  13382. static createInstance() {
  13383. return (fgui.UIPackage.createObject("game", "skillItem"));
  13384. }
  13385. onConstruct() {
  13386. this.c1 = this.getController("c1");
  13387. this.n31 = (this.getChild("n31"));
  13388. this.n6 = (this.getChild("n6"));
  13389. this.skillImg = (this.getChild("skillImg"));
  13390. this.nameTxt = (this.getChild("nameTxt"));
  13391. this.levelTxt = (this.getChild("levelTxt"));
  13392. this.n28 = (this.getChild("n28"));
  13393. this.describeTxt = (this.getChild("describeTxt"));
  13394. this.n32 = (this.getChild("n32"));
  13395. this.mutiBtn = (this.getChild("mutiBtn"));
  13396. this.tryNode = (this.getChild("tryNode"));
  13397. this.normalBtn = (this.getChild("normalBtn"));
  13398. this.startBtn = (this.getChild("startBtn"));
  13399. this.n42 = (this.getChild("n42"));
  13400. this.n43 = (this.getChild("n43"));
  13401. this.n44 = (this.getChild("n44"));
  13402. }
  13403. }
  13404. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13405. class ui_Component26 extends fgui.GButton {
  13406. static createInstance() {
  13407. return (fgui.UIPackage.createObject("game", "Component26"));
  13408. }
  13409. onConstruct() {
  13410. this.n11 = (this.getChild("n11"));
  13411. this.n30 = (this.getChild("n30"));
  13412. this.n34 = (this.getChild("n34"));
  13413. }
  13414. }
  13415. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13416. class ui_Component28 extends fgui.GButton {
  13417. static createInstance() {
  13418. return (fgui.UIPackage.createObject("game", "Component28"));
  13419. }
  13420. onConstruct() {
  13421. this.n12 = (this.getChild("n12"));
  13422. this.n31 = (this.getChild("n31"));
  13423. this.curTxt = (this.getChild("curTxt"));
  13424. this.n33 = (this.getChild("n33"));
  13425. }
  13426. }
  13427. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13428. class ui_Component1302 extends fgui.GComponent {
  13429. static createInstance() {
  13430. return (fgui.UIPackage.createObject("game", "Component1302"));
  13431. }
  13432. onConstruct() {
  13433. this.n2 = (this.getChild("n2"));
  13434. this.n3 = (this.getChild("n3"));
  13435. }
  13436. }
  13437. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13438. class ui_Component113 extends fgui.GComponent {
  13439. static createInstance() {
  13440. return (fgui.UIPackage.createObject("game", "Component113"));
  13441. }
  13442. onConstruct() {
  13443. this.n85 = (this.getChild("n85"));
  13444. this.n86 = (this.getChild("n86"));
  13445. this.n77 = (this.getChild("n77"));
  13446. this.n79 = (this.getChild("n79"));
  13447. this.n80 = (this.getChild("n80"));
  13448. this.n81 = (this.getChild("n81"));
  13449. this.n82 = (this.getChild("n82"));
  13450. this.n84 = (this.getChild("n84"));
  13451. this.n87 = (this.getChild("n87"));
  13452. this.t0 = this.getTransition("t0");
  13453. }
  13454. }
  13455. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13456. class ui_Component114 extends fgui.GComponent {
  13457. static createInstance() {
  13458. return (fgui.UIPackage.createObject("game", "Component114"));
  13459. }
  13460. onConstruct() {
  13461. this.n77 = (this.getChild("n77"));
  13462. this.t0 = this.getTransition("t0");
  13463. }
  13464. }
  13465. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13466. class ui_Component115 extends fgui.GComponent {
  13467. static createInstance() {
  13468. return (fgui.UIPackage.createObject("game", "Component115"));
  13469. }
  13470. onConstruct() {
  13471. this.n83 = (this.getChild("n83"));
  13472. this.fingerNode = (this.getChild("fingerNode"));
  13473. this.n84 = (this.getChild("n84"));
  13474. }
  13475. }
  13476. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13477. class ui_Component117 extends fgui.GComponent {
  13478. static createInstance() {
  13479. return (fgui.UIPackage.createObject("game", "Component117"));
  13480. }
  13481. onConstruct() {
  13482. this.n87 = (this.getChild("n87"));
  13483. this.n88 = (this.getChild("n88"));
  13484. this.n84 = (this.getChild("n84"));
  13485. this.n85 = (this.getChild("n85"));
  13486. this.n86 = (this.getChild("n86"));
  13487. this.t0 = this.getTransition("t0");
  13488. }
  13489. }
  13490. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13491. class ui_Component98_1 extends fgui.GButton {
  13492. static createInstance() {
  13493. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13494. }
  13495. onConstruct() {
  13496. this.c1 = this.getController("c1");
  13497. this.n8 = (this.getChild("n8"));
  13498. this.n41 = (this.getChild("n41"));
  13499. this.n40 = (this.getChild("n40"));
  13500. }
  13501. }
  13502. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13503. class ui_Component61 extends fgui.GComponent {
  13504. static createInstance() {
  13505. return (fgui.UIPackage.createObject("game", "Component61"));
  13506. }
  13507. onConstruct() {
  13508. this.n14 = (this.getChild("n14"));
  13509. this.n6 = (this.getChild("n6"));
  13510. this.t0 = this.getTransition("t0");
  13511. }
  13512. }
  13513. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13514. class ui_Component62 extends fgui.GComponent {
  13515. static createInstance() {
  13516. return (fgui.UIPackage.createObject("game", "Component62"));
  13517. }
  13518. onConstruct() {
  13519. this.n66 = (this.getChild("n66"));
  13520. this.n56 = (this.getChild("n56"));
  13521. this.n63 = (this.getChild("n63"));
  13522. this.n65 = (this.getChild("n65"));
  13523. this.t0 = this.getTransition("t0");
  13524. }
  13525. }
  13526. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13527. class ui_d3Root extends fgui.GComponent {
  13528. static createInstance() {
  13529. return (fgui.UIPackage.createObject("game", "d3Root"));
  13530. }
  13531. onConstruct() {
  13532. }
  13533. }
  13534. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13535. class ui_d2Root extends fgui.GComponent {
  13536. static createInstance() {
  13537. return (fgui.UIPackage.createObject("game", "d2Root"));
  13538. }
  13539. onConstruct() {
  13540. }
  13541. }
  13542. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13543. class ui_ballNode extends fgui.GComponent {
  13544. static createInstance() {
  13545. return (fgui.UIPackage.createObject("game", "ballNode"));
  13546. }
  13547. onConstruct() {
  13548. }
  13549. }
  13550. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13551. class ui_border extends fgui.GComponent {
  13552. static createInstance() {
  13553. return (fgui.UIPackage.createObject("game", "border"));
  13554. }
  13555. onConstruct() {
  13556. this.bar1 = (this.getChild("bar1"));
  13557. this.bar2 = (this.getChild("bar2"));
  13558. this.bar3 = (this.getChild("bar3"));
  13559. this.bar4 = (this.getChild("bar4"));
  13560. this.bar5 = (this.getChild("bar5"));
  13561. this.bar6 = (this.getChild("bar6"));
  13562. this.circle1 = (this.getChild("circle1"));
  13563. this.circle2 = (this.getChild("circle2"));
  13564. this.circle3 = (this.getChild("circle3"));
  13565. this.circle4 = (this.getChild("circle4"));
  13566. this.circle5 = (this.getChild("circle5"));
  13567. this.circle6 = (this.getChild("circle6"));
  13568. this.n28 = (this.getChild("n28"));
  13569. }
  13570. }
  13571. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13572. class ui_Component41_2 extends fgui.GComponent {
  13573. static createInstance() {
  13574. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13575. }
  13576. onConstruct() {
  13577. this.c1 = this.getController("c1");
  13578. this.n0 = (this.getChild("n0"));
  13579. this.n2 = (this.getChild("n2"));
  13580. this.n19 = (this.getChild("n19"));
  13581. this.cancelBtn = (this.getChild("cancelBtn"));
  13582. this.videoBtn = (this.getChild("videoBtn"));
  13583. this.n9 = (this.getChild("n9"));
  13584. this.n22 = (this.getChild("n22"));
  13585. this.tipsTxt = (this.getChild("tipsTxt"));
  13586. this.n23 = (this.getChild("n23"));
  13587. this.n24 = (this.getChild("n24"));
  13588. this.n26 = (this.getChild("n26"));
  13589. this.n27 = (this.getChild("n27"));
  13590. this.titleTxt = (this.getChild("titleTxt"));
  13591. }
  13592. }
  13593. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13594. class ui_Component41_1 extends fgui.GComponent {
  13595. static createInstance() {
  13596. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13597. }
  13598. onConstruct() {
  13599. this.c1 = this.getController("c1");
  13600. this.n0 = (this.getChild("n0"));
  13601. this.n2 = (this.getChild("n2"));
  13602. this.cancelBtn = (this.getChild("cancelBtn"));
  13603. this.videoBtn = (this.getChild("videoBtn"));
  13604. this.n27 = (this.getChild("n27"));
  13605. this.n30 = (this.getChild("n30"));
  13606. this.n31 = (this.getChild("n31"));
  13607. this.n32 = (this.getChild("n32"));
  13608. this.n33 = (this.getChild("n33"));
  13609. this.n34 = (this.getChild("n34"));
  13610. this.n35 = (this.getChild("n35"));
  13611. this.n36 = (this.getChild("n36"));
  13612. this.n1 = (this.getChild("n1"));
  13613. this.n37 = (this.getChild("n37"));
  13614. this.t0 = this.getTransition("t0");
  13615. this.t1 = this.getTransition("t1");
  13616. this.t2 = this.getTransition("t2");
  13617. this.t3 = this.getTransition("t3");
  13618. }
  13619. }
  13620. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13621. class ui_againBtn extends fgui.GButton {
  13622. static createInstance() {
  13623. return (fgui.UIPackage.createObject("game", "againBtn"));
  13624. }
  13625. onConstruct() {
  13626. this.n2 = (this.getChild("n2"));
  13627. this.n1 = (this.getChild("n1"));
  13628. this.n5 = (this.getChild("n5"));
  13629. }
  13630. }
  13631. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13632. class ui_Component118 extends fgui.GButton {
  13633. static createInstance() {
  13634. return (fgui.UIPackage.createObject("game", "Component118"));
  13635. }
  13636. onConstruct() {
  13637. this.c1 = this.getController("c1");
  13638. this.n14 = (this.getChild("n14"));
  13639. this.n9 = (this.getChild("n9"));
  13640. this.n10 = (this.getChild("n10"));
  13641. this.diamondTxt = (this.getChild("diamondTxt"));
  13642. this.n13 = (this.getChild("n13"));
  13643. this.n15 = (this.getChild("n15"));
  13644. }
  13645. }
  13646. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13647. class ui_Component119 extends fgui.GComponent {
  13648. static createInstance() {
  13649. return (fgui.UIPackage.createObject("game", "Component119"));
  13650. }
  13651. onConstruct() {
  13652. this.n1 = (this.getChild("n1"));
  13653. this.n2 = (this.getChild("n2"));
  13654. this.n13 = (this.getChild("n13"));
  13655. this.n6 = (this.getChild("n6"));
  13656. this.screenNode = (this.getChild("screenNode"));
  13657. this.n15 = (this.getChild("n15"));
  13658. this.closeBtn = (this.getChild("closeBtn"));
  13659. this.share2Btn = (this.getChild("share2Btn"));
  13660. this.shareBtn = (this.getChild("shareBtn"));
  13661. this.tipsNode = (this.getChild("tipsNode"));
  13662. this.awardNode = (this.getChild("awardNode"));
  13663. }
  13664. }
  13665. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13666. class ui_Component132_1 extends fgui.GComponent {
  13667. static createInstance() {
  13668. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13669. }
  13670. onConstruct() {
  13671. this.n25 = (this.getChild("n25"));
  13672. this.n26 = (this.getChild("n26"));
  13673. this.n27 = (this.getChild("n27"));
  13674. this.t0 = this.getTransition("t0");
  13675. }
  13676. }
  13677. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13678. class ui_SecretaryDisplay extends fgui.GComponent {
  13679. static createInstance() {
  13680. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13681. }
  13682. onConstruct() {
  13683. this.n2 = (this.getChild("n2"));
  13684. this.levelTxt = (this.getChild("levelTxt"));
  13685. this.n4 = (this.getChild("n4"));
  13686. this.secretary = (this.getChild("secretary"));
  13687. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13688. this.n16 = (this.getChild("n16"));
  13689. this.n37 = (this.getChild("n37"));
  13690. this.n41 = (this.getChild("n41"));
  13691. this.n14 = (this.getChild("n14"));
  13692. this.n17 = (this.getChild("n17"));
  13693. this.heightTxt = (this.getChild("heightTxt"));
  13694. this.n46 = (this.getChild("n46"));
  13695. this.n36 = (this.getChild("n36"));
  13696. this.n38 = (this.getChild("n38"));
  13697. this.foodTxt = (this.getChild("foodTxt"));
  13698. this.n47 = (this.getChild("n47"));
  13699. this.n40 = (this.getChild("n40"));
  13700. this.n42 = (this.getChild("n42"));
  13701. this.historyTxt = (this.getChild("historyTxt"));
  13702. this.n48 = (this.getChild("n48"));
  13703. this.nameImg = (this.getChild("nameImg"));
  13704. this.n12 = (this.getChild("n12"));
  13705. this.n49 = (this.getChild("n49"));
  13706. this.t0 = this.getTransition("t0");
  13707. }
  13708. }
  13709. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13710. class ui_BallRodDisplay extends fgui.GComponent {
  13711. static createInstance() {
  13712. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13713. }
  13714. onConstruct() {
  13715. this.c1 = this.getController("c1");
  13716. this.n31 = (this.getChild("n31"));
  13717. this.n6 = (this.getChild("n6"));
  13718. this.nameTxt = (this.getChild("nameTxt"));
  13719. this.rodImg = (this.getChild("rodImg"));
  13720. this.levelNode = (this.getChild("levelNode"));
  13721. this.eftRod = (this.getChild("eftRod"));
  13722. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13723. }
  13724. }
  13725. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13726. class ui_Component111_11 extends fgui.GComponent {
  13727. static createInstance() {
  13728. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13729. }
  13730. onConstruct() {
  13731. this.n68 = (this.getChild("n68"));
  13732. this.n69 = (this.getChild("n69"));
  13733. }
  13734. }
  13735. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13736. class ui_Component112 extends fgui.GComponent {
  13737. static createInstance() {
  13738. return (fgui.UIPackage.createObject("game", "Component112"));
  13739. }
  13740. onConstruct() {
  13741. this.n68 = (this.getChild("n68"));
  13742. this.n70 = (this.getChild("n70"));
  13743. this.myMask = (this.getChild("myMask"));
  13744. }
  13745. }
  13746. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13747. class ui_Component111 extends fgui.GComponent {
  13748. static createInstance() {
  13749. return (fgui.UIPackage.createObject("game", "Component111"));
  13750. }
  13751. onConstruct() {
  13752. this.n68 = (this.getChild("n68"));
  13753. this.myMask = (this.getChild("myMask"));
  13754. }
  13755. }
  13756. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13757. class ui_Component144 extends fgui.GButton {
  13758. static createInstance() {
  13759. return (fgui.UIPackage.createObject("game", "Component144"));
  13760. }
  13761. onConstruct() {
  13762. this.n8 = (this.getChild("n8"));
  13763. }
  13764. }
  13765. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13766. class ui_Sign_com2 extends fgui.GComponent {
  13767. static createInstance() {
  13768. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13769. }
  13770. onConstruct() {
  13771. this.n0 = (this.getChild("n0"));
  13772. this.n1 = (this.getChild("n1"));
  13773. this.t0 = this.getTransition("t0");
  13774. }
  13775. }
  13776. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13777. class ui_Sign_guang extends fgui.GComponent {
  13778. static createInstance() {
  13779. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13780. }
  13781. onConstruct() {
  13782. this.n1 = (this.getChild("n1"));
  13783. this.n2 = (this.getChild("n2"));
  13784. this.n3 = (this.getChild("n3"));
  13785. this.n4 = (this.getChild("n4"));
  13786. this.n5 = (this.getChild("n5"));
  13787. this.n6 = (this.getChild("n6"));
  13788. this.n8 = (this.getChild("n8"));
  13789. }
  13790. }
  13791. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13792. class ui_SignMax extends fgui.GComponent {
  13793. static createInstance() {
  13794. return (fgui.UIPackage.createObject("game", "SignMax"));
  13795. }
  13796. onConstruct() {
  13797. this.c1 = this.getController("c1");
  13798. this.n7 = (this.getChild("n7"));
  13799. this.n15 = (this.getChild("n15"));
  13800. this.n8 = (this.getChild("n8"));
  13801. this.titleTxt = (this.getChild("titleTxt"));
  13802. this.myIcon1 = (this.getChild("myIcon1"));
  13803. this.numTxt1 = (this.getChild("numTxt1"));
  13804. this.myIcon2 = (this.getChild("myIcon2"));
  13805. this.n20 = (this.getChild("n20"));
  13806. this.n17 = (this.getChild("n17"));
  13807. this.numTxt2 = (this.getChild("numTxt2"));
  13808. this.n12 = (this.getChild("n12"));
  13809. this.n13 = (this.getChild("n13"));
  13810. this.n21 = (this.getChild("n21"));
  13811. this.n14 = (this.getChild("n14"));
  13812. }
  13813. }
  13814. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13815. class ui_Sign_com2_1 extends fgui.GComponent {
  13816. static createInstance() {
  13817. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13818. }
  13819. onConstruct() {
  13820. this.n0 = (this.getChild("n0"));
  13821. this.n1 = (this.getChild("n1"));
  13822. this.t0 = this.getTransition("t0");
  13823. }
  13824. }
  13825. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13826. class ui_Sign_com5 extends fgui.GComponent {
  13827. static createInstance() {
  13828. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13829. }
  13830. onConstruct() {
  13831. this.n3 = (this.getChild("n3"));
  13832. this.n29 = (this.getChild("n29"));
  13833. this.n4 = (this.getChild("n4"));
  13834. this.day1 = (this.getChild("day1"));
  13835. this.day2 = (this.getChild("day2"));
  13836. this.day3 = (this.getChild("day3"));
  13837. this.day4 = (this.getChild("day4"));
  13838. this.day5 = (this.getChild("day5"));
  13839. this.day6 = (this.getChild("day6"));
  13840. this.day7 = (this.getChild("day7"));
  13841. this.t0 = this.getTransition("t0");
  13842. }
  13843. }
  13844. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13845. class ui_Sign_com8 extends fgui.GComponent {
  13846. static createInstance() {
  13847. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13848. }
  13849. onConstruct() {
  13850. this.n48 = (this.getChild("n48"));
  13851. this.womanTxt = (this.getChild("womanTxt"));
  13852. this.t0 = this.getTransition("t0");
  13853. }
  13854. }
  13855. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13856. class ui_Sign_com6 extends fgui.GComponent {
  13857. static createInstance() {
  13858. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13859. }
  13860. onConstruct() {
  13861. this.n2 = (this.getChild("n2"));
  13862. this.n3 = (this.getChild("n3"));
  13863. this.t0 = this.getTransition("t0");
  13864. }
  13865. }
  13866. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13867. class ui_Sign_com7 extends fgui.GComponent {
  13868. static createInstance() {
  13869. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13870. }
  13871. onConstruct() {
  13872. this.n29 = (this.getChild("n29"));
  13873. this.n2 = (this.getChild("n2"));
  13874. }
  13875. }
  13876. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13877. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13878. static createInstance() {
  13879. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13880. }
  13881. onConstruct() {
  13882. this.n5 = (this.getChild("n5"));
  13883. this.n4 = (this.getChild("n4"));
  13884. this.t0 = this.getTransition("t0");
  13885. }
  13886. }
  13887. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13888. class ui_UITurntable_com2 extends fgui.GComponent {
  13889. static createInstance() {
  13890. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13891. }
  13892. onConstruct() {
  13893. this.c1 = this.getController("c1");
  13894. this.n4 = (this.getChild("n4"));
  13895. this.n6 = (this.getChild("n6"));
  13896. this.n10 = (this.getChild("n10"));
  13897. this.n11 = (this.getChild("n11"));
  13898. this.n12 = (this.getChild("n12"));
  13899. this.n13 = (this.getChild("n13"));
  13900. this.n14 = (this.getChild("n14"));
  13901. this.n15 = (this.getChild("n15"));
  13902. this.n16 = (this.getChild("n16"));
  13903. this.n17 = (this.getChild("n17"));
  13904. this.n18 = (this.getChild("n18"));
  13905. this.n19 = (this.getChild("n19"));
  13906. this.n20 = (this.getChild("n20"));
  13907. this.n21 = (this.getChild("n21"));
  13908. this.n22 = (this.getChild("n22"));
  13909. this.n23 = (this.getChild("n23"));
  13910. this.n24 = (this.getChild("n24"));
  13911. this.n25 = (this.getChild("n25"));
  13912. this.n26 = (this.getChild("n26"));
  13913. this.n27 = (this.getChild("n27"));
  13914. this.n28 = (this.getChild("n28"));
  13915. this.n29 = (this.getChild("n29"));
  13916. this.n30 = (this.getChild("n30"));
  13917. this.n31 = (this.getChild("n31"));
  13918. this.n32 = (this.getChild("n32"));
  13919. this.n33 = (this.getChild("n33"));
  13920. }
  13921. }
  13922. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13923. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13924. static createInstance() {
  13925. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13926. }
  13927. onConstruct() {
  13928. this.n5 = (this.getChild("n5"));
  13929. this.n4 = (this.getChild("n4"));
  13930. this.t0 = this.getTransition("t0");
  13931. }
  13932. }
  13933. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13934. class ui_UITurntable_com5 extends fgui.GComponent {
  13935. static createInstance() {
  13936. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13937. }
  13938. onConstruct() {
  13939. this.flashNode = (this.getChild("flashNode"));
  13940. this.rotNode = (this.getChild("rotNode"));
  13941. this.n3 = (this.getChild("n3"));
  13942. this.n21 = (this.getChild("n21"));
  13943. this.t0 = this.getTransition("t0");
  13944. }
  13945. }
  13946. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  13947. class ui_UITurntable_com7 extends fgui.GComponent {
  13948. static createInstance() {
  13949. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  13950. }
  13951. onConstruct() {
  13952. this.n2 = (this.getChild("n2"));
  13953. this.n35 = (this.getChild("n35"));
  13954. this.img1 = (this.getChild("img1"));
  13955. this.img2 = (this.getChild("img2"));
  13956. this.img3 = (this.getChild("img3"));
  13957. this.img4 = (this.getChild("img4"));
  13958. this.img6 = (this.getChild("img6"));
  13959. this.img5 = (this.getChild("img5"));
  13960. this.txt1 = (this.getChild("txt1"));
  13961. this.txt2 = (this.getChild("txt2"));
  13962. this.txt3 = (this.getChild("txt3"));
  13963. this.txt4 = (this.getChild("txt4"));
  13964. this.txt5 = (this.getChild("txt5"));
  13965. this.txt6 = (this.getChild("txt6"));
  13966. }
  13967. }
  13968. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  13969. class ui_UITurntable_com9 extends fgui.GComponent {
  13970. static createInstance() {
  13971. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  13972. }
  13973. onConstruct() {
  13974. this.n38 = (this.getChild("n38"));
  13975. this.n39 = (this.getChild("n39"));
  13976. }
  13977. }
  13978. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  13979. class ui_UITurntable_com10 extends fgui.GComponent {
  13980. static createInstance() {
  13981. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  13982. }
  13983. onConstruct() {
  13984. this.n39 = (this.getChild("n39"));
  13985. this.n40 = (this.getChild("n40"));
  13986. this.t0 = this.getTransition("t0");
  13987. }
  13988. }
  13989. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  13990. class ui_UITurntable_com11 extends fgui.GComponent {
  13991. static createInstance() {
  13992. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  13993. }
  13994. onConstruct() {
  13995. this.n38 = (this.getChild("n38"));
  13996. this.n39 = (this.getChild("n39"));
  13997. this.n40 = (this.getChild("n40"));
  13998. this.t0 = this.getTransition("t0");
  13999. }
  14000. }
  14001. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14002. class ui_UITurntable_com12 extends fgui.GComponent {
  14003. static createInstance() {
  14004. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14005. }
  14006. onConstruct() {
  14007. this.n43 = (this.getChild("n43"));
  14008. this.barNode = (this.getChild("barNode"));
  14009. this.tipsTxt = (this.getChild("tipsTxt"));
  14010. this.n45 = (this.getChild("n45"));
  14011. this.boxBtn = (this.getChild("boxBtn"));
  14012. }
  14013. }
  14014. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14015. class ui_UITurntable_com1 extends fgui.GButton {
  14016. static createInstance() {
  14017. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14018. }
  14019. onConstruct() {
  14020. this.n41 = (this.getChild("n41"));
  14021. this.n42 = (this.getChild("n42"));
  14022. this.t0 = this.getTransition("t0");
  14023. }
  14024. }
  14025. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14026. class ui_UITurntable_com3 extends fgui.GComponent {
  14027. static createInstance() {
  14028. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14029. }
  14030. onConstruct() {
  14031. this.n48 = (this.getChild("n48"));
  14032. this.womanTxt = (this.getChild("womanTxt"));
  14033. this.t0 = this.getTransition("t0");
  14034. }
  14035. }
  14036. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14037. class ui_cancelBtn2 extends fgui.GButton {
  14038. static createInstance() {
  14039. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14040. }
  14041. onConstruct() {
  14042. this.c1 = this.getController("c1");
  14043. this.n0 = (this.getChild("n0"));
  14044. this.n1 = (this.getChild("n1"));
  14045. this.n2 = (this.getChild("n2"));
  14046. this.n3 = (this.getChild("n3"));
  14047. this.n4 = (this.getChild("n4"));
  14048. this.n5 = (this.getChild("n5"));
  14049. this.n6 = (this.getChild("n6"));
  14050. this.n7 = (this.getChild("n7"));
  14051. this.n8 = (this.getChild("n8"));
  14052. this.powerEft = (this.getChild("powerEft"));
  14053. }
  14054. }
  14055. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14056. class ui_shareBtn2 extends fgui.GButton {
  14057. static createInstance() {
  14058. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14059. }
  14060. onConstruct() {
  14061. this.c1 = this.getController("c1");
  14062. this.n2 = (this.getChild("n2"));
  14063. this.n24 = (this.getChild("n24"));
  14064. this.n1 = (this.getChild("n1"));
  14065. this.n3 = (this.getChild("n3"));
  14066. this.n23 = (this.getChild("n23"));
  14067. this.n4 = (this.getChild("n4"));
  14068. this.n5 = (this.getChild("n5"));
  14069. this.n6 = (this.getChild("n6"));
  14070. this.n20 = (this.getChild("n20"));
  14071. this.n21 = (this.getChild("n21"));
  14072. this.n22 = (this.getChild("n22"));
  14073. this.powerEft = (this.getChild("powerEft"));
  14074. }
  14075. }
  14076. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14077. class ui_UIMoney extends fgui.GComponent {
  14078. static createInstance() {
  14079. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14080. }
  14081. onConstruct() {
  14082. this.c1 = this.getController("c1");
  14083. this.n4 = (this.getChild("n4"));
  14084. this.coinImg = (this.getChild("coinImg"));
  14085. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14086. this.coinTxt = (this.getChild("coinTxt"));
  14087. this.n7 = (this.getChild("n7"));
  14088. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14089. this.diamondTxt = (this.getChild("diamondTxt"));
  14090. this.diamondImg = (this.getChild("diamondImg"));
  14091. this.n12 = (this.getChild("n12"));
  14092. this.powerImg = (this.getChild("powerImg"));
  14093. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14094. this.powerTxt = (this.getChild("powerTxt"));
  14095. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14096. }
  14097. }
  14098. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14099. class ui_backBtn extends fgui.GButton {
  14100. static createInstance() {
  14101. return (fgui.UIPackage.createObject("game", "backBtn"));
  14102. }
  14103. onConstruct() {
  14104. this.n0 = (this.getChild("n0"));
  14105. this.t0 = this.getTransition("t0");
  14106. this.t1 = this.getTransition("t1");
  14107. }
  14108. }
  14109. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14110. class ui_MoneyBtn extends fgui.GButton {
  14111. static createInstance() {
  14112. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14113. }
  14114. onConstruct() {
  14115. this.button = this.getController("button");
  14116. this.n0 = (this.getChild("n0"));
  14117. }
  14118. }
  14119. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14120. class ui_UIMoneyBtn extends fgui.GComponent {
  14121. static createInstance() {
  14122. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14123. }
  14124. onConstruct() {
  14125. this.n1 = (this.getChild("n1"));
  14126. this.closeBtn = (this.getChild("closeBtn"));
  14127. }
  14128. }
  14129. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14130. class ui_Component64 extends fgui.GComponent {
  14131. static createInstance() {
  14132. return (fgui.UIPackage.createObject("game", "Component64"));
  14133. }
  14134. onConstruct() {
  14135. this.n57 = (this.getChild("n57"));
  14136. this.n54 = (this.getChild("n54"));
  14137. this.n55 = (this.getChild("n55"));
  14138. this.n56 = (this.getChild("n56"));
  14139. this.t1 = this.getTransition("t1");
  14140. }
  14141. }
  14142. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14143. class ui_Component41_3 extends fgui.GComponent {
  14144. static createInstance() {
  14145. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14146. }
  14147. onConstruct() {
  14148. this.c1 = this.getController("c1");
  14149. this.n0 = (this.getChild("n0"));
  14150. this.n2 = (this.getChild("n2"));
  14151. this.cancelBtn = (this.getChild("cancelBtn"));
  14152. this.videoBtn = (this.getChild("videoBtn"));
  14153. this.n9 = (this.getChild("n9"));
  14154. this.n24 = (this.getChild("n24"));
  14155. this.n27 = (this.getChild("n27"));
  14156. this.titleTxt = (this.getChild("titleTxt"));
  14157. this.n28 = (this.getChild("n28"));
  14158. this.t0 = this.getTransition("t0");
  14159. }
  14160. }
  14161. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14162. class ui_dh_zs_4 extends fgui.GComponent {
  14163. static createInstance() {
  14164. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14165. }
  14166. onConstruct() {
  14167. this.n1 = (this.getChild("n1"));
  14168. this.n2 = (this.getChild("n2"));
  14169. this.n3 = (this.getChild("n3"));
  14170. this.n4 = (this.getChild("n4"));
  14171. this.n5 = (this.getChild("n5"));
  14172. this.n6 = (this.getChild("n6"));
  14173. this.n8 = (this.getChild("n8"));
  14174. this.t0 = this.getTransition("t0");
  14175. }
  14176. }
  14177. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14178. class ui_Component71_1 extends fgui.GButton {
  14179. static createInstance() {
  14180. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14181. }
  14182. onConstruct() {
  14183. this.n17 = (this.getChild("n17"));
  14184. this.t0 = this.getTransition("t0");
  14185. }
  14186. }
  14187. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14188. class ui_Component83 extends fgui.GComponent {
  14189. static createInstance() {
  14190. return (fgui.UIPackage.createObject("game", "Component83"));
  14191. }
  14192. onConstruct() {
  14193. this.c1 = this.getController("c1");
  14194. this.n17 = (this.getChild("n17"));
  14195. this.n19 = (this.getChild("n19"));
  14196. this.n20 = (this.getChild("n20"));
  14197. }
  14198. }
  14199. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14200. class ui_Component84 extends fgui.GComponent {
  14201. static createInstance() {
  14202. return (fgui.UIPackage.createObject("game", "Component84"));
  14203. }
  14204. onConstruct() {
  14205. this.c1 = this.getController("c1");
  14206. this.n4 = (this.getChild("n4"));
  14207. this.n22 = (this.getChild("n22"));
  14208. this.n23 = (this.getChild("n23"));
  14209. this.numTxt = (this.getChild("numTxt"));
  14210. this.n25 = (this.getChild("n25"));
  14211. this.n26 = (this.getChild("n26"));
  14212. }
  14213. }
  14214. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14215. class ui_Component84_1 extends fgui.GComponent {
  14216. static createInstance() {
  14217. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14218. }
  14219. onConstruct() {
  14220. this.c1 = this.getController("c1");
  14221. this.n4 = (this.getChild("n4"));
  14222. this.n22 = (this.getChild("n22"));
  14223. this.n23 = (this.getChild("n23"));
  14224. this.numTxt = (this.getChild("numTxt"));
  14225. this.n25 = (this.getChild("n25"));
  14226. this.n26 = (this.getChild("n26"));
  14227. }
  14228. }
  14229. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14230. class ui_Component85 extends fgui.GComponent {
  14231. static createInstance() {
  14232. return (fgui.UIPackage.createObject("game", "Component85"));
  14233. }
  14234. onConstruct() {
  14235. this.n1 = (this.getChild("n1"));
  14236. this.n6 = (this.getChild("n6"));
  14237. this.n2 = (this.getChild("n2"));
  14238. this.n3 = (this.getChild("n3"));
  14239. this.levelTxt = (this.getChild("levelTxt"));
  14240. this.n10 = (this.getChild("n10"));
  14241. this.n11 = (this.getChild("n11"));
  14242. this.n12 = (this.getChild("n12"));
  14243. this.n13 = (this.getChild("n13"));
  14244. this.n14 = (this.getChild("n14"));
  14245. this.modeNode = (this.getChild("modeNode"));
  14246. this.n18 = (this.getChild("n18"));
  14247. this.conditionTxt = (this.getChild("conditionTxt"));
  14248. this.diamondNode = (this.getChild("diamondNode"));
  14249. this.coinNode = (this.getChild("coinNode"));
  14250. this.startBtn = (this.getChild("startBtn"));
  14251. this.n28 = (this.getChild("n28"));
  14252. this.displayRoot = (this.getChild("displayRoot"));
  14253. this.t0 = this.getTransition("t0");
  14254. }
  14255. }
  14256. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14257. class ui_Component86 extends fgui.GButton {
  14258. static createInstance() {
  14259. return (fgui.UIPackage.createObject("game", "Component86"));
  14260. }
  14261. onConstruct() {
  14262. this.n15 = (this.getChild("n15"));
  14263. this.t0 = this.getTransition("t0");
  14264. }
  14265. }
  14266. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14267. class ui_Component87 extends fgui.GComponent {
  14268. static createInstance() {
  14269. return (fgui.UIPackage.createObject("game", "Component87"));
  14270. }
  14271. onConstruct() {
  14272. this.n66 = (this.getChild("n66"));
  14273. this.myProgress = (this.getChild("myProgress"));
  14274. this.starAni = (this.getChild("starAni"));
  14275. this.hpTxt = (this.getChild("hpTxt"));
  14276. this.n74 = (this.getChild("n74"));
  14277. this.n73 = (this.getChild("n73"));
  14278. this.ballTxt = (this.getChild("ballTxt"));
  14279. this.n76 = (this.getChild("n76"));
  14280. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14281. this.levelTxt = (this.getChild("levelTxt"));
  14282. this.star1 = (this.getChild("star1"));
  14283. this.star2 = (this.getChild("star2"));
  14284. this.star3 = (this.getChild("star3"));
  14285. }
  14286. }
  14287. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14288. class ui_Component88 extends fgui.GProgressBar {
  14289. static createInstance() {
  14290. return (fgui.UIPackage.createObject("game", "Component88"));
  14291. }
  14292. onConstruct() {
  14293. this.n68 = (this.getChild("n68"));
  14294. this.bar = (this.getChild("bar"));
  14295. }
  14296. }
  14297. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14298. class ui_Component89 extends fgui.GComponent {
  14299. static createInstance() {
  14300. return (fgui.UIPackage.createObject("game", "Component89"));
  14301. }
  14302. onConstruct() {
  14303. this.c1 = this.getController("c1");
  14304. this.n71 = (this.getChild("n71"));
  14305. this.n72 = (this.getChild("n72"));
  14306. }
  14307. }
  14308. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14309. class ui_Component90 extends fgui.GComponent {
  14310. static createInstance() {
  14311. return (fgui.UIPackage.createObject("game", "Component90"));
  14312. }
  14313. onConstruct() {
  14314. this.c1 = this.getController("c1");
  14315. this.n64 = (this.getChild("n64"));
  14316. this.n65 = (this.getChild("n65"));
  14317. this.n66 = (this.getChild("n66"));
  14318. this.t0 = this.getTransition("t0");
  14319. }
  14320. }
  14321. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14322. class ui_Component127 extends fgui.GButton {
  14323. static createInstance() {
  14324. return (fgui.UIPackage.createObject("game", "Component127"));
  14325. }
  14326. onConstruct() {
  14327. this.n5 = (this.getChild("n5"));
  14328. }
  14329. }
  14330. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14331. class gameBinder {
  14332. static bindAll() {
  14333. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14334. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14335. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14336. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14337. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14338. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14339. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14340. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14341. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14342. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14343. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14344. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14345. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14346. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14347. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14348. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14349. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14350. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14351. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14352. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14353. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14354. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14355. fgui.UIObjectFactory.setExtension(ui_Component121.URL, ui_Component121);
  14356. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14357. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14358. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14359. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14360. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14361. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14362. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14363. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14364. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14365. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14366. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14367. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14368. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14369. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14370. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14371. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14372. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14373. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14374. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14375. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14376. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14377. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14378. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14379. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14380. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14381. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14382. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14383. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14384. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14385. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14386. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14387. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14388. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14389. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14390. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14391. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14392. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14393. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14394. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14395. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14396. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14397. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14398. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14399. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14400. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14401. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14402. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14403. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14404. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14405. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14406. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14407. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14408. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14409. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14410. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14411. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14412. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14413. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14414. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14415. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14416. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14417. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14418. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14419. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14420. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14421. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14422. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14423. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14424. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14425. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14426. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14427. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14428. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14429. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14430. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14431. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14432. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14433. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14434. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14435. fgui.UIObjectFactory.setExtension(ui_Component16.URL, ui_Component16);
  14436. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14437. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14438. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14439. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14440. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14441. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14442. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14443. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14444. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14445. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14446. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14447. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14448. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14449. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14450. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14451. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14452. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14453. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14454. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14455. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14456. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14457. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14458. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14459. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14460. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14461. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14462. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14463. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14464. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14465. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14466. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14467. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14468. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14469. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14470. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14471. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14472. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14473. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14474. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14475. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14476. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14477. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14478. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14479. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14480. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14481. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14482. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14483. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14484. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14485. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14486. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14487. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14488. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14489. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14490. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14491. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14492. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14493. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14494. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14495. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14496. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14497. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14498. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14499. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14500. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14501. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14502. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14503. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14504. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14505. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14506. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14507. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14508. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14509. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14510. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14511. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14512. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14513. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14514. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14515. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14516. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14517. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14518. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14519. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14520. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14521. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14522. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14523. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14524. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14525. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14526. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14527. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14528. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14529. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14530. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14531. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14532. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14533. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14534. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14535. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14536. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14537. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14538. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14539. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14540. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14541. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14542. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14543. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14544. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14545. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14546. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14547. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14548. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14549. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14550. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14551. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14552. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14553. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14554. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14555. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14556. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14557. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14558. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14559. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14560. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14561. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14562. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14563. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14564. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14565. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14566. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14567. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14568. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14569. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14570. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14571. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14572. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14573. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14574. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14575. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14576. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14577. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14578. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14579. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14580. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14581. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14582. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14583. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14584. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14585. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14586. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14587. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14588. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14589. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14590. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14591. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14592. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14593. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14594. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14595. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14596. }
  14597. }
  14598. class ui_btn6 extends fgui.GButton {
  14599. static createInstance() {
  14600. return (fgui.UIPackage.createObject("loading", "btn6"));
  14601. }
  14602. onConstruct() {
  14603. this.n6 = (this.getChild("n6"));
  14604. this.n1 = (this.getChild("n1"));
  14605. }
  14606. }
  14607. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14608. class ui_xyItem extends fgui.GComponent {
  14609. static createInstance() {
  14610. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14611. }
  14612. onConstruct() {
  14613. this.xyItem = (this.getChild("xyItem"));
  14614. }
  14615. }
  14616. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14617. class ui_loadinfo extends fgui.GProgressBar {
  14618. static createInstance() {
  14619. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14620. }
  14621. onConstruct() {
  14622. this.bg = (this.getChild("bg"));
  14623. this.bar = (this.getChild("bar"));
  14624. this.title = (this.getChild("title"));
  14625. this.ani = (this.getChild("ani"));
  14626. }
  14627. }
  14628. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14629. class ui_xyNode extends fgui.GComponent {
  14630. static createInstance() {
  14631. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14632. }
  14633. onConstruct() {
  14634. this.n0 = (this.getChild("n0"));
  14635. this.btnYes = (this.getChild("btnYes"));
  14636. this.btnNo = (this.getChild("btnNo"));
  14637. this.btnKnown = (this.getChild("btnKnown"));
  14638. this.btnSure = (this.getChild("btnSure"));
  14639. this.txtWelcom = (this.getChild("txtWelcom"));
  14640. this.txtXy = (this.getChild("txtXy"));
  14641. this.n75 = (this.getChild("n75"));
  14642. this.btnXy1 = (this.getChild("btnXy1"));
  14643. this.btnXy3 = (this.getChild("btnXy3"));
  14644. this.btnXy2 = (this.getChild("btnXy2"));
  14645. this.n74 = (this.getChild("n74"));
  14646. this.xy1 = (this.getChild("xy1"));
  14647. this.txtTitle = (this.getChild("txtTitle"));
  14648. this.btnBack = (this.getChild("btnBack"));
  14649. this.xyList = (this.getChild("xyList"));
  14650. this.xy2 = (this.getChild("xy2"));
  14651. this.xyNode = (this.getChild("xyNode"));
  14652. }
  14653. }
  14654. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14655. class ui_ageNode extends fgui.GComponent {
  14656. static createInstance() {
  14657. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14658. }
  14659. onConstruct() {
  14660. this.n3 = (this.getChild("n3"));
  14661. this.n7 = (this.getChild("n7"));
  14662. this.n4 = (this.getChild("n4"));
  14663. this.btnAge = (this.getChild("btnAge"));
  14664. this.ageNode = (this.getChild("ageNode"));
  14665. }
  14666. }
  14667. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14668. class ui_rnNode extends fgui.GComponent {
  14669. static createInstance() {
  14670. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14671. }
  14672. onConstruct() {
  14673. this.n28 = (this.getChild("n28"));
  14674. this.n30 = (this.getChild("n30"));
  14675. this.n33 = (this.getChild("n33"));
  14676. this.rn1 = (this.getChild("rn1"));
  14677. this.n40 = (this.getChild("n40"));
  14678. this.n41 = (this.getChild("n41"));
  14679. this.rn3 = (this.getChild("rn3"));
  14680. this.n37 = (this.getChild("n37"));
  14681. this.n39 = (this.getChild("n39"));
  14682. this.rn2 = (this.getChild("rn2"));
  14683. this.n47 = (this.getChild("n47"));
  14684. this.n49 = (this.getChild("n49"));
  14685. this.n44 = (this.getChild("n44"));
  14686. this.inputCode = (this.getChild("inputCode"));
  14687. this.inputName = (this.getChild("inputName"));
  14688. this.n48 = (this.getChild("n48"));
  14689. this.n50 = (this.getChild("n50"));
  14690. this.rn4 = (this.getChild("rn4"));
  14691. this.btnCheck = (this.getChild("btnCheck"));
  14692. this.btnExit = (this.getChild("btnExit"));
  14693. this.btnDone = (this.getChild("btnDone"));
  14694. this.rnNode = (this.getChild("rnNode"));
  14695. }
  14696. }
  14697. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14698. class ui_tipNode extends fgui.GComponent {
  14699. static createInstance() {
  14700. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14701. }
  14702. onConstruct() {
  14703. this.bg = (this.getChild("bg"));
  14704. this.n55 = (this.getChild("n55"));
  14705. this.n56 = (this.getChild("n56"));
  14706. this.tipNode = (this.getChild("tipNode"));
  14707. }
  14708. }
  14709. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14710. class ui_fcmNode extends fgui.GComponent {
  14711. static createInstance() {
  14712. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14713. }
  14714. onConstruct() {
  14715. this.n63 = (this.getChild("n63"));
  14716. this.n62 = (this.getChild("n62"));
  14717. this.btnRn = (this.getChild("btnRn"));
  14718. this.n61 = (this.getChild("n61"));
  14719. this.n58 = (this.getChild("n58"));
  14720. this.fcmNode = (this.getChild("fcmNode"));
  14721. }
  14722. }
  14723. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14724. class ui_msgNode extends fgui.GComponent {
  14725. static createInstance() {
  14726. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14727. }
  14728. onConstruct() {
  14729. this.n69 = (this.getChild("n69"));
  14730. this.txtMsg = (this.getChild("txtMsg"));
  14731. this.msgNode = (this.getChild("msgNode"));
  14732. }
  14733. }
  14734. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14735. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14736. static createInstance() {
  14737. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14738. }
  14739. onConstruct() {
  14740. this.n1 = (this.getChild("n1"));
  14741. this.n13 = (this.getChild("n13"));
  14742. this.n14 = (this.getChild("n14"));
  14743. this.n15 = (this.getChild("n15"));
  14744. this.n3 = (this.getChild("n3"));
  14745. this.n4 = (this.getChild("n4"));
  14746. this.n5 = (this.getChild("n5"));
  14747. this.n6 = (this.getChild("n6"));
  14748. this.n7 = (this.getChild("n7"));
  14749. this.n8 = (this.getChild("n8"));
  14750. this.n9 = (this.getChild("n9"));
  14751. this.n10 = (this.getChild("n10"));
  14752. this.n12 = (this.getChild("n12"));
  14753. this.n11 = (this.getChild("n11"));
  14754. this.n16 = (this.getChild("n16"));
  14755. this.n17 = (this.getChild("n17"));
  14756. this.n18 = (this.getChild("n18"));
  14757. this.n20 = (this.getChild("n20"));
  14758. this.n21 = (this.getChild("n21"));
  14759. this.t0 = this.getTransition("t0");
  14760. }
  14761. }
  14762. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14763. class ui_btn5 extends fgui.GButton {
  14764. static createInstance() {
  14765. return (fgui.UIPackage.createObject("loading", "btn5"));
  14766. }
  14767. onConstruct() {
  14768. this.n9 = (this.getChild("n9"));
  14769. this.n1 = (this.getChild("n1"));
  14770. }
  14771. }
  14772. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14773. class ui_UILoading extends fgui.GComponent {
  14774. static createInstance() {
  14775. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14776. }
  14777. onConstruct() {
  14778. this.n12 = (this.getChild("n12"));
  14779. this.loadinfo = (this.getChild("loadinfo"));
  14780. this.n13 = (this.getChild("n13"));
  14781. this.txtLoad = (this.getChild("txtLoad"));
  14782. this.n18 = (this.getChild("n18"));
  14783. }
  14784. }
  14785. ui_UILoading.URL = "ui://37nctnhwphc33";
  14786. class ui_AgeItem extends fgui.GComponent {
  14787. static createInstance() {
  14788. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14789. }
  14790. onConstruct() {
  14791. this.txtAge = (this.getChild("txtAge"));
  14792. }
  14793. }
  14794. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14795. class ui_btn1 extends fgui.GButton {
  14796. static createInstance() {
  14797. return (fgui.UIPackage.createObject("loading", "btn1"));
  14798. }
  14799. onConstruct() {
  14800. this.n6 = (this.getChild("n6"));
  14801. this.n1 = (this.getChild("n1"));
  14802. }
  14803. }
  14804. ui_btn1.URL = "ui://37nctnhwxe622p";
  14805. class ui_btn3 extends fgui.GButton {
  14806. static createInstance() {
  14807. return (fgui.UIPackage.createObject("loading", "btn3"));
  14808. }
  14809. onConstruct() {
  14810. this.n9 = (this.getChild("n9"));
  14811. this.n1 = (this.getChild("n1"));
  14812. }
  14813. }
  14814. ui_btn3.URL = "ui://37nctnhwxe622s";
  14815. class ui_btn2 extends fgui.GButton {
  14816. static createInstance() {
  14817. return (fgui.UIPackage.createObject("loading", "btn2"));
  14818. }
  14819. onConstruct() {
  14820. this.n6 = (this.getChild("n6"));
  14821. this.n1 = (this.getChild("n1"));
  14822. }
  14823. }
  14824. ui_btn2.URL = "ui://37nctnhwxe622t";
  14825. class ui_btnBack extends fgui.GButton {
  14826. static createInstance() {
  14827. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14828. }
  14829. onConstruct() {
  14830. this.n6 = (this.getChild("n6"));
  14831. this.n7 = (this.getChild("n7"));
  14832. }
  14833. }
  14834. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14835. class ui_btnXy1 extends fgui.GButton {
  14836. static createInstance() {
  14837. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14838. }
  14839. onConstruct() {
  14840. this.n1 = (this.getChild("n1"));
  14841. }
  14842. }
  14843. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14844. class ui_btnXy2 extends fgui.GButton {
  14845. static createInstance() {
  14846. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14847. }
  14848. onConstruct() {
  14849. this.n1 = (this.getChild("n1"));
  14850. }
  14851. }
  14852. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14853. class ui_btnXy3 extends fgui.GButton {
  14854. static createInstance() {
  14855. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14856. }
  14857. onConstruct() {
  14858. this.n1 = (this.getChild("n1"));
  14859. }
  14860. }
  14861. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14862. class ui_btn4 extends fgui.GButton {
  14863. static createInstance() {
  14864. return (fgui.UIPackage.createObject("loading", "btn4"));
  14865. }
  14866. onConstruct() {
  14867. this.n9 = (this.getChild("n9"));
  14868. this.n1 = (this.getChild("n1"));
  14869. }
  14870. }
  14871. ui_btn4.URL = "ui://37nctnhwxe622z";
  14872. class loadingBinder {
  14873. static bindAll() {
  14874. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14875. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14876. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14877. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14878. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14879. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14880. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14881. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14882. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14883. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14884. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14885. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14886. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14887. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14888. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14889. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14890. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14891. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14892. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14893. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14894. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14895. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14896. }
  14897. }
  14898. class UIMgr {
  14899. constructor() {
  14900. this._stage = null;
  14901. this._uiList = [];
  14902. this._showList = [];
  14903. this._bindPkgList = [];
  14904. this.uiIndex = 0;
  14905. }
  14906. static get inst() {
  14907. if (UIMgr._inst == null) {
  14908. UIMgr._inst = new UIMgr();
  14909. }
  14910. return UIMgr._inst;
  14911. }
  14912. setStage(s) {
  14913. if (this._stage) {
  14914. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14915. return;
  14916. }
  14917. this._stage = s;
  14918. }
  14919. init() {
  14920. this.setStage(Laya.stage);
  14921. fairygui.UIConfig.defaultFont = "微软雅黑";
  14922. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14923. fairygui.UIConfig.packageFileExtension = "obj";
  14924. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14925. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14926. fairygui.GRoot.inst.width = Laya.stage.width;
  14927. fairygui.GRoot.inst.height = Laya.stage.height;
  14928. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14929. }
  14930. addAllUpdate() {
  14931. this.uiIndex = 0;
  14932. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14933. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14934. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14935. }
  14936. }
  14937. }
  14938. bindFUI(pkgname) {
  14939. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  14940. return;
  14941. }
  14942. switch (pkgname) {
  14943. case fguiRes.loading:
  14944. fairygui.UIPackage.addPackage(pkgname);
  14945. loadingBinder.bindAll();
  14946. this._bindPkgList.push(pkgname);
  14947. break;
  14948. case fguiRes.game:
  14949. fairygui.UIPackage.addPackage(pkgname);
  14950. gameBinder.bindAll();
  14951. this._bindPkgList.push(pkgname);
  14952. break;
  14953. default:
  14954. break;
  14955. }
  14956. }
  14957. Show(cls, ...param) {
  14958. let nameStr = cls.uiName;
  14959. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14960. let temp = this._uiList[i];
  14961. let str = temp.className;
  14962. if (str == nameStr) {
  14963. if (temp.isMuti) {
  14964. if (temp.isHide) {
  14965. temp.show(...param);
  14966. this._uiList.splice(i, 1);
  14967. this._uiList.push(temp);
  14968. return temp;
  14969. }
  14970. }
  14971. else {
  14972. temp.show(...param);
  14973. this._uiList.splice(i, 1);
  14974. this._uiList.push(temp);
  14975. return temp;
  14976. }
  14977. }
  14978. }
  14979. let ui = new cls();
  14980. ui.className = nameStr;
  14981. this._showUI(ui, param);
  14982. return ui;
  14983. }
  14984. destroyUI(ui) {
  14985. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14986. let temp = this._uiList[i].className;
  14987. if (temp == ui.className) {
  14988. this._uiList.splice(i, 1);
  14989. break;
  14990. }
  14991. }
  14992. this.checkUIState();
  14993. }
  14994. _showUI(ui, param) {
  14995. this._uiList.push(ui);
  14996. ui.show(...param);
  14997. }
  14998. Hide(uiClass) {
  14999. let ui = this.getUI(uiClass);
  15000. if (ui && !ui.isHide) {
  15001. ui.hide();
  15002. }
  15003. }
  15004. getUI(ui) {
  15005. let nameStr = ui.uiName;
  15006. for (let index = 0; index < this._uiList.length; index++) {
  15007. let temp = this._uiList[index];
  15008. if (temp.className == nameStr) {
  15009. return temp;
  15010. }
  15011. }
  15012. return null;
  15013. }
  15014. isShow(cls) {
  15015. for (var i of this._uiList) {
  15016. if (i instanceof cls) {
  15017. return i.isShowing;
  15018. }
  15019. }
  15020. return false;
  15021. }
  15022. showUINum() {
  15023. let num = 0;
  15024. for (var i of this._uiList) {
  15025. if (i.isShowing) {
  15026. num++;
  15027. }
  15028. }
  15029. return num;
  15030. }
  15031. checkUIState() {
  15032. Laya.timer.clear(this, this._uiCheck);
  15033. Laya.timer.once(400, this, this._uiCheck);
  15034. }
  15035. _uiCheck() {
  15036. let showList = [];
  15037. for (var i of this._uiList) {
  15038. if (!i.isHide) {
  15039. showList.push(i);
  15040. }
  15041. }
  15042. for (let index = 0; index < showList.length; index++) {
  15043. if (index == showList.length - 1) {
  15044. showList[index].checkActive(true);
  15045. }
  15046. else {
  15047. showList[index].checkActive(false);
  15048. }
  15049. }
  15050. }
  15051. showTip(msg, time = 600, size = 30) {
  15052. }
  15053. }
  15054. class UIShowList {
  15055. }
  15056. class SoundMgr {
  15057. constructor() {
  15058. this.soundMax = 4;
  15059. this.isLoad = false;
  15060. this.soundMap = {};
  15061. this.isSound = true;
  15062. this.openShake = true;
  15063. SoundMgr._instance = this;
  15064. }
  15065. static getInstance() {
  15066. if (!this._instance) {
  15067. this._instance = new SoundMgr();
  15068. }
  15069. return this._instance;
  15070. }
  15071. init() {
  15072. console.log('zh:sm init 1');
  15073. Laya.SoundManager.autoReleaseSound = true;
  15074. Laya.SoundManager.autoStopMusic = true;
  15075. Laya.SoundManager.musicVolume = 0.3;
  15076. Laya.SoundManager.soundVolume = 0.5;
  15077. this.musicPlayed = false;
  15078. this.audioUrl = "asset/sound/ogg/";
  15079. console.log('zh:sm init 2');
  15080. console.log('zh:dev type ');
  15081. if (Laya.Browser.onAndroid) {
  15082. console.log('zh:dev type android');
  15083. this.audioUrl = "asset/sound/ogg/";
  15084. this.isLoad = true;
  15085. }
  15086. else {
  15087. console.log('zh:dev type not android');
  15088. this.audioUrl = "asset/sound/mp3/";
  15089. this.isLoad = true;
  15090. }
  15091. }
  15092. onSetting(isS) {
  15093. this.isSound = isS;
  15094. this.mute(!this.isSound);
  15095. }
  15096. clearCount() {
  15097. for (var key in this.soundMap) {
  15098. delete this.soundMap[key];
  15099. }
  15100. }
  15101. playMusic(path, loop = 0) {
  15102. console.log('zh:playMusic 1 PATH=' + path);
  15103. this.musicPath = path;
  15104. if (!this.isLoad)
  15105. console.log('zh:playMusic 2');
  15106. return;
  15107. if (!path || path == "")
  15108. console.log('zh:playMusic 3');
  15109. return;
  15110. if (!this.isSound)
  15111. console.log('zh:playMusic 4');
  15112. return;
  15113. this.musicPlayed = true;
  15114. console.log('zh:playMusic 5');
  15115. let url = this.getUrl(path);
  15116. console.log('zh:playMusic 6' + url);
  15117. if (Laya.Browser.onPC) {
  15118. console.log('zh:playMusic 7');
  15119. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15120. console.log('zh:playMusic 8');
  15121. this.play(url, loop);
  15122. }));
  15123. }
  15124. else
  15125. this.play(url, loop);
  15126. }
  15127. play(url, loop) {
  15128. Laya.SoundManager.playMusic(url, loop);
  15129. }
  15130. getUrl(path) {
  15131. let url = this.audioUrl + path;
  15132. if (Laya.Browser.onAndroid) {
  15133. url += ".ogg";
  15134. }
  15135. else {
  15136. url += ".mp3";
  15137. }
  15138. return url;
  15139. }
  15140. pauseMusic(pause) {
  15141. if (pause) {
  15142. this.mute(true);
  15143. }
  15144. else if (this.isSound)
  15145. this.mute(false);
  15146. }
  15147. stopMusic() {
  15148. Laya.SoundManager.stopMusic();
  15149. if (Moyu.isNeedPlatAudio) {
  15150. Moyu.stopMusic();
  15151. }
  15152. }
  15153. mute(mute) {
  15154. if (Moyu.isNeedPlatAudio) {
  15155. Moyu.pauseMusic(mute);
  15156. }
  15157. else {
  15158. Laya.SoundManager.musicMuted = mute;
  15159. if (!mute && !this.musicPlayed && this.musicPath) {
  15160. this.playMusic(this.musicPath);
  15161. }
  15162. }
  15163. }
  15164. stopSound(path) {
  15165. let url = this.getUrl(path);
  15166. Laya.SoundManager.stopSound(url);
  15167. }
  15168. playSound(path, loop = 1, soundMax = this.soundMax) {
  15169. if (!this.isLoad)
  15170. return;
  15171. if (!this.isSound)
  15172. return;
  15173. if (!path || path == "")
  15174. return;
  15175. let url = this.getUrl(path);
  15176. if (Moyu.isNeedPlatAudio) {
  15177. Moyu.playSound(path, loop == 0);
  15178. }
  15179. else {
  15180. let count = 1;
  15181. if (this.soundMap[path])
  15182. count = this.soundMap[path] + 1;
  15183. if (count > soundMax)
  15184. return;
  15185. this.soundMap[path] = count;
  15186. Laya.SoundManager.playSound(url, loop);
  15187. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15188. }
  15189. }
  15190. removePath(path) {
  15191. if (this.soundMap[path]) {
  15192. let count = this.soundMap[path];
  15193. count--;
  15194. if (count < 1)
  15195. delete this.soundMap[path];
  15196. else
  15197. this.soundMap[path] = count;
  15198. }
  15199. }
  15200. playBtnSound() {
  15201. this.playSound("btn");
  15202. }
  15203. playGetSound() {
  15204. }
  15205. playCloseUISound() {
  15206. }
  15207. }
  15208. SoundMgr._instance = null;
  15209. var Handler$1 = Laya.Handler;
  15210. var EResType;
  15211. (function (EResType) {
  15212. EResType[EResType["none"] = 0] = "none";
  15213. EResType[EResType["nromal"] = 1] = "nromal";
  15214. EResType[EResType["td"] = 2] = "td";
  15215. EResType[EResType["sk"] = 3] = "sk";
  15216. })(EResType || (EResType = {}));
  15217. class CResLoader {
  15218. constructor(doneCall, proCall) {
  15219. this.completrCall = doneCall;
  15220. this.progressCall = proCall;
  15221. this.progressHander = new Handler$1(this, this.onProgress);
  15222. this.tdResMap = {};
  15223. }
  15224. load(resList) {
  15225. this.resCount = 0;
  15226. this.loadCount = 0;
  15227. for (let i = 0; i < resList.length; i++) {
  15228. let path = resList[i];
  15229. if (!path)
  15230. continue;
  15231. this.resCount++;
  15232. let type = this.getResType(path);
  15233. if (type == EResType.nromal)
  15234. this.loadNromal(path);
  15235. else if (type == EResType.td)
  15236. this.loadTd(path);
  15237. }
  15238. }
  15239. getRes(path) {
  15240. let type = this.getResType(path);
  15241. if (type == EResType.nromal)
  15242. return Laya.loader.getRes(path);
  15243. else if (type == EResType.td) {
  15244. let res = this.tdResMap[path];
  15245. if (res)
  15246. return res.clone();
  15247. return null;
  15248. }
  15249. }
  15250. destroy() {
  15251. this.progressHander.clear();
  15252. this.progressHander = null;
  15253. }
  15254. clearRes(path) {
  15255. let type = this.getResType(path);
  15256. if (type == EResType.nromal)
  15257. Laya.loader.clearRes(path);
  15258. else if (type == EResType.td) {
  15259. let obj = this.tdResMap[path];
  15260. if (obj)
  15261. obj.destroy();
  15262. delete this.tdResMap[path];
  15263. }
  15264. }
  15265. getResType(path) {
  15266. let exs = this.getExtension(path);
  15267. if (exs == "sk")
  15268. return EResType.sk;
  15269. if (exs == "ls" || exs == "lh" || exs == "lm")
  15270. return EResType.td;
  15271. else
  15272. return EResType.nromal;
  15273. }
  15274. getExtension(res) {
  15275. var index = res.lastIndexOf(".");
  15276. return res.substr(index + 1);
  15277. }
  15278. loadNromal(path) {
  15279. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15280. if (res) {
  15281. this.onLoad();
  15282. }
  15283. else
  15284. console.log("load res fail:" + path);
  15285. }), this.progressHander);
  15286. }
  15287. loadSk() {
  15288. }
  15289. loadTd(path) {
  15290. if (this.tdResMap[path]) {
  15291. this.onLoad();
  15292. return;
  15293. }
  15294. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15295. if (res) {
  15296. this.tdResMap[path] = res;
  15297. this.onLoad();
  15298. }
  15299. else
  15300. console.log("load res fail:" + path);
  15301. }));
  15302. }
  15303. onLoad() {
  15304. this.loadCount++;
  15305. this.onProgress(1);
  15306. if (this.loadCount >= this.resCount) {
  15307. this.completrCall.run();
  15308. }
  15309. }
  15310. onProgress(pro) {
  15311. let progress = (this.loadCount + pro) / this.resCount;
  15312. this.progressCall.runWith(progress);
  15313. }
  15314. }
  15315. var Handler$2 = Laya.Handler;
  15316. class ResInfo {
  15317. constructor() {
  15318. this.index = 0;
  15319. }
  15320. }
  15321. class ResMgr {
  15322. constructor() {
  15323. this.resList = [];
  15324. this.doneList = [];
  15325. this.resMap = {};
  15326. this.currentLoad = null;
  15327. this.completeHandler = new Handler$2(this, this.onComplete);
  15328. this.progressHandler = new Handler$2(this, this.onProgress);
  15329. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15330. }
  15331. static getInstance() {
  15332. if (ResMgr._instance == null) {
  15333. ResMgr._instance = new ResMgr();
  15334. }
  15335. return ResMgr._instance;
  15336. }
  15337. loadList(list, completeHandler, progressHandler) {
  15338. if (list.length < 1) {
  15339. completeHandler.run();
  15340. return;
  15341. }
  15342. let info = this.getResInfo();
  15343. info.resList = list;
  15344. info.completeHandler = completeHandler;
  15345. info.progressHandler = progressHandler;
  15346. this.resList.push(info);
  15347. this.startLoad();
  15348. }
  15349. loadFguiRes(list, completeHandler, progressHandler) {
  15350. Laya.loader.load(list, completeHandler, progressHandler);
  15351. }
  15352. loadAny(list, completeHandler, progressHandler) {
  15353. Laya.loader.load(list, completeHandler, progressHandler);
  15354. }
  15355. load(path, completeHandler, progressHandler) {
  15356. let count = this.resMap[path];
  15357. if (count && count > 0) {
  15358. if (completeHandler)
  15359. completeHandler.run();
  15360. }
  15361. else
  15362. this.loadList([path], completeHandler, progressHandler);
  15363. }
  15364. getRes(path) {
  15365. let res = this.resMap[path];
  15366. if (!res)
  15367. this.showLog("资源不存在:" + path);
  15368. else
  15369. return this.loader.getRes(path);
  15370. }
  15371. clearList(list, force = false) {
  15372. if (!list || list.length < 1)
  15373. return;
  15374. let cr = () => {
  15375. for (const k in list) {
  15376. let v = list[k];
  15377. if (!v)
  15378. continue;
  15379. if (force) {
  15380. this.loader.clearRes(v);
  15381. delete this.resMap[v];
  15382. }
  15383. else {
  15384. let count = this.resMap[v];
  15385. if (count && count > 1) {
  15386. count--;
  15387. this.resMap[v] = count;
  15388. }
  15389. else {
  15390. this.loader.clearRes(v);
  15391. delete this.resMap[v];
  15392. }
  15393. }
  15394. }
  15395. if (!window.hasOwnProperty("ks"))
  15396. Laya.Resource.destroyUnusedResources();
  15397. };
  15398. Laya.timer.clearAll(this);
  15399. Laya.timer.once(2000, this, cr);
  15400. }
  15401. clear3D() {
  15402. for (const k in this.loader.tdResMap) {
  15403. this.loader.clearRes(k);
  15404. if (this.resMap[k])
  15405. delete this.resMap[k];
  15406. }
  15407. if (!window.hasOwnProperty("ks"))
  15408. Laya.Resource.destroyUnusedResources();
  15409. }
  15410. clear(path, force = false) {
  15411. this.clearList([path], force);
  15412. }
  15413. getResInfo() {
  15414. if (this.doneList.length > 0)
  15415. return this.doneList.pop();
  15416. else
  15417. return new ResInfo();
  15418. }
  15419. startLoad() {
  15420. if (this.currentLoad)
  15421. return;
  15422. this.currentLoad = this.resList.pop();
  15423. if (this.currentLoad) {
  15424. this.loader.load(this.currentLoad.resList);
  15425. }
  15426. }
  15427. onComplete() {
  15428. if (!this.currentLoad)
  15429. return;
  15430. for (const k in this.currentLoad.resList) {
  15431. let v = this.currentLoad.resList[k];
  15432. let count = this.resMap[v];
  15433. if (count)
  15434. count++;
  15435. else
  15436. count = 1;
  15437. this.resMap[v] = count;
  15438. }
  15439. if (this.currentLoad.completeHandler)
  15440. this.currentLoad.completeHandler.run();
  15441. this.doneList.push(this.currentLoad);
  15442. this.currentLoad = null;
  15443. this.startLoad();
  15444. }
  15445. onProgress(pro) {
  15446. if (!this.currentLoad)
  15447. return;
  15448. if (this.currentLoad.progressHandler)
  15449. this.currentLoad.progressHandler.runWith(pro);
  15450. }
  15451. showLog(str, ...args) {
  15452. console.log("[ResLoader] " + str);
  15453. }
  15454. }
  15455. ResMgr._instance = null;
  15456. class EventMgr extends Laya.EventDispatcher {
  15457. }
  15458. let eventMgr = new EventMgr();
  15459. class ConfigMgr {
  15460. static getInstance() {
  15461. if (!this._instance) {
  15462. this._instance = new ConfigMgr();
  15463. }
  15464. return this._instance;
  15465. }
  15466. init() {
  15467. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15468. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15469. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15470. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15471. }
  15472. getUserInfoByIndex(index) {
  15473. return this.npcJson[index];
  15474. }
  15475. getRandomUserInfo() {
  15476. let index = xGame.tools.random(0, this.npcJson.length);
  15477. return this.npcJson[index];
  15478. }
  15479. getMaxBigMoveLength() {
  15480. return Object.keys(this.levelCfg).length;
  15481. }
  15482. getBigMoveLevelByIndex(index) {
  15483. let cfg = this.levelCfg;
  15484. cfg = cfg[index];
  15485. return cfg;
  15486. }
  15487. getRandomClassicLevel() {
  15488. let cfg = this.classicCfg;
  15489. let num = Object.keys(cfg).length;
  15490. let rand = xGame.common.randomNum(1, num);
  15491. return cfg[rand];
  15492. }
  15493. getPlaceBallByLevel(level) {
  15494. return this.placeBallCfg[level];
  15495. }
  15496. getMaxPlaceBall() {
  15497. return Object.keys(this.placeBallCfg).length;
  15498. }
  15499. }
  15500. class PoolD3Mgr {
  15501. constructor() {
  15502. this.pool = {};
  15503. }
  15504. static get ins() {
  15505. return this._ins || (this._ins = new PoolD3Mgr);
  15506. }
  15507. createList(key, prefab, parent) {
  15508. if (!this.pool[key]) {
  15509. this.pool[key] = {};
  15510. this.pool[key].prefab = prefab;
  15511. this.pool[key].list = [];
  15512. this.pool[key].parent = parent;
  15513. }
  15514. }
  15515. getItem(key) {
  15516. if (!this.pool[key]) {
  15517. return;
  15518. }
  15519. let temp;
  15520. if (this.pool[key].list.length > 0) {
  15521. temp = this.pool[key].list.pop();
  15522. }
  15523. else {
  15524. temp = this.pool[key].prefab.clone();
  15525. if (this.pool[key].parent) {
  15526. this.pool[key].parent.addChild(temp);
  15527. }
  15528. }
  15529. temp.active = true;
  15530. return temp;
  15531. }
  15532. putItem(key, obj) {
  15533. if (!this.pool[key]) {
  15534. return;
  15535. }
  15536. obj.active = false;
  15537. this.pool[key].list.push(obj);
  15538. }
  15539. }
  15540. let context$1 = context;
  15541. let uiMgr = UIMgr.inst;
  15542. let soundMgr = SoundMgr.getInstance();
  15543. let resMgr = ResMgr.getInstance();
  15544. let httpMgr = HttpMgr.getInstance();
  15545. let common = Common.getInstance();
  15546. let cfgMgr = ConfigMgr.getInstance();
  15547. let poolD3Mgr = PoolD3Mgr.ins;
  15548. let d3TexUrl = "res/d3Res/";
  15549. let d3ModeUrl = "res/unityRes/";
  15550. function setStageSize(view) {
  15551. if (view.width) {
  15552. view.width = Laya.stage.width;
  15553. view.height = Laya.stage.height;
  15554. }
  15555. }
  15556. function filledBg(view) {
  15557. let wh = Laya.stage.height / Laya.stage.width;
  15558. if (wh > 16 / 9) {
  15559. view.height = Laya.stage.height;
  15560. view.width = Laya.stage.height / 1334 * 750;
  15561. }
  15562. else {
  15563. view.width = Laya.stage.width;
  15564. view.height = Laya.stage.width / 750 * 1334;
  15565. }
  15566. }
  15567. function setNotch(view) {
  15568. if (view.height) {
  15569. view.y += context$1.notchHeight;
  15570. }
  15571. }
  15572. function showTip(str) {
  15573. uiMgr.Show(UIMsg, str);
  15574. }
  15575. function log(...args) {
  15576. console.log(args);
  15577. }
  15578. let xGame = {
  15579. context: context$1,
  15580. eventMgr,
  15581. resMgr,
  15582. uiMgr,
  15583. soundMgr,
  15584. define,
  15585. tools,
  15586. httpMgr,
  15587. d3TexUrl,
  15588. d3ModeUrl,
  15589. common,
  15590. cfgMgr,
  15591. poolD3Mgr,
  15592. setStageSize,
  15593. filledBg,
  15594. setNotch,
  15595. showTip,
  15596. log,
  15597. };
  15598. window["xGame"] = xGame;
  15599. let dataName = 'tBall_';
  15600. class UserData {
  15601. constructor() {
  15602. this.userId = "";
  15603. this.isAgree = false;
  15604. this.coinNum = 0;
  15605. this.gemNum = 0;
  15606. this.sound = true;
  15607. this.vibration = true;
  15608. this.currentDate = 0;
  15609. this.createTime = 0;
  15610. this.awardTime = 0;
  15611. this.roleId = 1;
  15612. this.roleList = [];
  15613. this.roleAds = [];
  15614. this.dressId = 101;
  15615. this.itemId = 201;
  15616. this.bigSkills = [1, 1, 1, 1, 1];
  15617. this.coin = 4000;
  15618. this.diamond = 0;
  15619. this.skillSuccessTimes = 0;
  15620. this.skillGuide = 0;
  15621. this.skillAccTimes = 0;
  15622. this.placeBallData = [];
  15623. this.shareDiamondTimes = 0;
  15624. this.dailyVideoShareTimes = 0;
  15625. this.secretary = [1, 0];
  15626. this.curSecretary = 0;
  15627. this.ballRod = [1, 0, 0, 0, 0, 1];
  15628. this.curBallRod = 5;
  15629. this.signData = 0;
  15630. this.signTime = 0;
  15631. this.drawTimes = 0;
  15632. this.drawAwardTimes = 0;
  15633. this.dailyfreeDrawTimes = 1;
  15634. this.power = 5;
  15635. this.powerTime = 0;
  15636. this.challengeTimes = 0;
  15637. this.extraSign = 0;
  15638. this.classicTimes = 0;
  15639. this.guideHelpLine = 0;
  15640. this.newUser = true;
  15641. this.rootBallFoul = 0;
  15642. this.timeoutFoul = 0;
  15643. this.roleList = [1];
  15644. }
  15645. saveData() {
  15646. let data = {};
  15647. for (let k in this) {
  15648. data[k.toString()] = this[k];
  15649. }
  15650. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15651. }
  15652. getData() {
  15653. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15654. if (ld) {
  15655. let localData = JSON.parse(ld);
  15656. if (localData) {
  15657. for (let k in this) {
  15658. let key = k.toString();
  15659. let data = localData[key];
  15660. if (data != undefined) {
  15661. this[k] = data;
  15662. }
  15663. }
  15664. }
  15665. }
  15666. }
  15667. }
  15668. class ItemData {
  15669. constructor() {
  15670. this.itemList = {};
  15671. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15672. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15673. }
  15674. saveData() {
  15675. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15676. }
  15677. getData() {
  15678. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15679. if (ld) {
  15680. let localData = JSON.parse(ld);
  15681. if (localData) {
  15682. this.itemList = localData;
  15683. }
  15684. }
  15685. }
  15686. }
  15687. class GameData {
  15688. constructor() {
  15689. this.curLevel = 0;
  15690. this.gameType = 1;
  15691. this.signIdx = 0;
  15692. this.signMax = 0;
  15693. this.rotaryTime = 0;
  15694. this.rotaryCount = 0;
  15695. this.rotaryList = [];
  15696. this.diyCount = 3;
  15697. this.awardIdx = 0;
  15698. this.shareNum = 2;
  15699. this.rankWeek = 0;
  15700. this.rankScore = 0;
  15701. this.gameCount = 0;
  15702. this.trySkill = -1;
  15703. this.tryTime = 0;
  15704. }
  15705. saveData() {
  15706. let data = {};
  15707. for (let k in this) {
  15708. data[k.toString()] = this[k];
  15709. }
  15710. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15711. }
  15712. getData() {
  15713. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15714. if (ld) {
  15715. let localData = JSON.parse(ld);
  15716. if (localData) {
  15717. for (let k in this) {
  15718. let key = k.toString();
  15719. let data = localData[key];
  15720. if (data != undefined) {
  15721. this[k] = data;
  15722. }
  15723. }
  15724. }
  15725. }
  15726. }
  15727. }
  15728. class DataMgr {
  15729. static Init() {
  15730. this.userData = new UserData();
  15731. this.gameData = new GameData();
  15732. this.itemData = new ItemData();
  15733. this.userData.getData();
  15734. this.gameData.getData();
  15735. this.itemData.getData();
  15736. this.roleId = this.userData.roleId;
  15737. this.resetUse();
  15738. }
  15739. static isNewDay() {
  15740. Moyu.isNewDay(this, (isnew) => {
  15741. xGame.common.isNewDay = isnew;
  15742. if (!isnew)
  15743. return;
  15744. DataMgr.setShareDiamondTimes(0, false);
  15745. DataMgr.setDailyVideoShareTimes(0, false);
  15746. DataMgr.setDailyfreeDrawTimes(1);
  15747. DataMgr.setExtraSign(0);
  15748. });
  15749. }
  15750. static deletData() {
  15751. Laya.LocalStorage.clear();
  15752. }
  15753. static upRankData() {
  15754. let num = xGame.common.getAllStarNum();
  15755. if (num > 0)
  15756. Moyu.upRankData(xGame.common.curRankID, num);
  15757. }
  15758. static addItem(id, count = 1) {
  15759. let v = this.itemData.itemList[id];
  15760. if (!v)
  15761. v = { id: id, count: count, adnum: 0, active: true };
  15762. else {
  15763. if (v.active) {
  15764. v.count += count;
  15765. }
  15766. else {
  15767. v.count = count;
  15768. v.active = true;
  15769. }
  15770. }
  15771. this.itemData.itemList[id] = v;
  15772. xGame.soundMgr.playGetSound();
  15773. this.saveItemData();
  15774. }
  15775. static hasItem(id) {
  15776. let v = this.itemData.itemList[id];
  15777. if (v && v.active)
  15778. return true;
  15779. return false;
  15780. }
  15781. static getItem(id) {
  15782. let v = this.itemData.itemList[id];
  15783. return v;
  15784. }
  15785. static getItemCount(id) {
  15786. let v = this.itemData.itemList[id];
  15787. if (v && v.active)
  15788. return v.count;
  15789. return 0;
  15790. }
  15791. static getItemAd(id) {
  15792. let v = this.itemData.itemList[id];
  15793. if (v) {
  15794. return v.adnum;
  15795. }
  15796. return 0;
  15797. }
  15798. static onItemAd(id, num = 1) {
  15799. let v = this.itemData.itemList[id];
  15800. if (!v)
  15801. v = { id: id, count: 1, adnum: num, active: false };
  15802. else
  15803. v.adnum += num;
  15804. this.itemData.itemList[id] = v;
  15805. this.saveItemData();
  15806. }
  15807. static costItem(id, count) {
  15808. let v = this.itemData.itemList[id];
  15809. if (v && v.active) {
  15810. if (v.count < count)
  15811. return false;
  15812. else {
  15813. v.count -= count;
  15814. this.itemData.itemList[id] = v;
  15815. return true;
  15816. }
  15817. }
  15818. return false;
  15819. }
  15820. static resetUse() {
  15821. this.dressId = this.userData.dressId;
  15822. this.itemId = this.userData.itemId;
  15823. }
  15824. static passLevel() {
  15825. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15826. this.gameData.curLevel++;
  15827. this.curLevel = this.gameData.curLevel;
  15828. this.saveGameData();
  15829. }
  15830. static useRole(id) {
  15831. this.roleId = id;
  15832. if (this.hasRole(id)) {
  15833. this.userData.roleId = id;
  15834. this.saveUserData();
  15835. }
  15836. }
  15837. static addRole(id) {
  15838. if (this.hasRole(id))
  15839. return;
  15840. this.userData.roleList.push(id);
  15841. this.saveUserData();
  15842. }
  15843. static hasRole(id) {
  15844. return this.userData.roleList.indexOf(id) >= 0;
  15845. }
  15846. static gemEnough(num) {
  15847. return this.userData.gemNum >= num;
  15848. }
  15849. static roleHasAd(id) {
  15850. let count = this.userData.roleAds[id];
  15851. if (count != undefined && count >= 0)
  15852. return true;
  15853. else
  15854. return false;
  15855. }
  15856. static saveUserData(time = 1000, event, arg) {
  15857. if (this.userSaving)
  15858. return;
  15859. this.userSaving = true;
  15860. Laya.timer.once(time, this, () => {
  15861. this.userSaving = false;
  15862. this.userData.saveData();
  15863. if (event)
  15864. xGame.eventMgr.event(event, arg);
  15865. });
  15866. }
  15867. static saveGameData() {
  15868. if (this.gameSaving)
  15869. return;
  15870. this.gameSaving = true;
  15871. Laya.timer.once(1000, this, () => {
  15872. this.gameSaving = false;
  15873. this.gameData.saveData();
  15874. });
  15875. }
  15876. static saveItemData() {
  15877. let fun = () => {
  15878. this.itemData.saveData();
  15879. };
  15880. Laya.timer.clear(this, fun);
  15881. Laya.timer.once(500, this, fun);
  15882. }
  15883. static saveData() {
  15884. this.saveUserData();
  15885. this.saveGameData();
  15886. }
  15887. static getBigSkillList() {
  15888. return this.userData.bigSkills;
  15889. }
  15890. static getBigSkillByIndex(index) {
  15891. return this.userData.bigSkills[index];
  15892. }
  15893. static setBigSkill(index, val, addUp = true) {
  15894. if (addUp) {
  15895. this.userData.bigSkills[index] += val;
  15896. }
  15897. else {
  15898. this.userData.bigSkills[index] = val;
  15899. }
  15900. this.saveUserData();
  15901. }
  15902. static coinEnough(need) {
  15903. if (typeof need != "number") {
  15904. console.error("金币格式错误");
  15905. return;
  15906. }
  15907. return this.userData.coin >= need;
  15908. }
  15909. static setCoin(val) {
  15910. if (typeof val != "number") {
  15911. return;
  15912. }
  15913. this.userData.coin += val;
  15914. this.saveUserData();
  15915. xGame.eventMgr.event(COIN_CHANGE);
  15916. }
  15917. static getCoin() {
  15918. return this.userData.coin;
  15919. }
  15920. static diamondEnough(need) {
  15921. if (typeof need != "number") {
  15922. console.error("金币格式错误");
  15923. return;
  15924. }
  15925. return this.userData.diamond >= need;
  15926. }
  15927. static setDiamond(val) {
  15928. if (typeof val != "number") {
  15929. return;
  15930. }
  15931. this.userData.diamond += val;
  15932. this.saveUserData();
  15933. xGame.eventMgr.event(DIAMOND_CHANGE);
  15934. }
  15935. static getDiamond() {
  15936. return this.userData.diamond;
  15937. }
  15938. static getSkillSuccessTimes() {
  15939. return this.userData.skillSuccessTimes;
  15940. }
  15941. static setSkillSuccessTimes(val, addUp = true) {
  15942. if (addUp)
  15943. this.userData.skillSuccessTimes += val;
  15944. else
  15945. this.userData.skillSuccessTimes = val;
  15946. this.saveUserData();
  15947. }
  15948. static getSkillAccTimes() {
  15949. return this.userData.skillAccTimes;
  15950. }
  15951. static setSkillAccTimes(val) {
  15952. this.userData.skillAccTimes += val;
  15953. this.saveUserData();
  15954. }
  15955. static getSkillGuide() {
  15956. if (!xGame.common.openGuide) {
  15957. return 1;
  15958. }
  15959. return this.userData.skillGuide;
  15960. }
  15961. static setSkillGuide(val) {
  15962. this.userData.skillGuide = val;
  15963. this.saveUserData();
  15964. }
  15965. static getPlaceBallLevelList() {
  15966. return this.userData.placeBallData;
  15967. }
  15968. static getPlaceBallLevel(level) {
  15969. let arr = this.userData.placeBallData;
  15970. let index = level - 1;
  15971. let out;
  15972. if (arr[index]) {
  15973. out = arr[index];
  15974. }
  15975. else {
  15976. let max = arr.length;
  15977. if (max == index) {
  15978. out = {
  15979. star: 0,
  15980. play: true,
  15981. isCur: true,
  15982. getAward: false
  15983. };
  15984. }
  15985. else {
  15986. out = {
  15987. star: 0,
  15988. play: false,
  15989. getAward: false
  15990. };
  15991. }
  15992. }
  15993. return out;
  15994. }
  15995. static setPlaceBallLevel(level, star) {
  15996. let arr = this.userData.placeBallData;
  15997. let index = level - 1;
  15998. if (arr[index]) {
  15999. arr[index].star = Math.max(arr[index].star, star);
  16000. }
  16001. else {
  16002. let max = arr.length;
  16003. if (max == index) {
  16004. arr.push({
  16005. star: star,
  16006. play: true,
  16007. getAward: false
  16008. });
  16009. }
  16010. else {
  16011. console.error("关卡存储出错");
  16012. }
  16013. }
  16014. this.saveUserData();
  16015. }
  16016. static setPlaceBallAward(level) {
  16017. let arr = this.userData.placeBallData;
  16018. let index = level - 1;
  16019. if (arr[index]) {
  16020. arr[index].getAward = true;
  16021. }
  16022. this.saveUserData();
  16023. }
  16024. static getShareDiamondTimes() {
  16025. return this.userData.shareDiamondTimes;
  16026. }
  16027. static setShareDiamondTimes(val, addUp = true) {
  16028. if (addUp) {
  16029. this.userData.shareDiamondTimes += val;
  16030. }
  16031. else {
  16032. this.userData.shareDiamondTimes = val;
  16033. }
  16034. this.saveUserData();
  16035. }
  16036. static getDailyVideoShareTimes() {
  16037. return this.userData.dailyVideoShareTimes;
  16038. }
  16039. static setDailyVideoShareTimes(val, addUp = true) {
  16040. if (addUp) {
  16041. this.userData.dailyVideoShareTimes += val;
  16042. }
  16043. else {
  16044. this.userData.dailyVideoShareTimes = val;
  16045. }
  16046. this.saveUserData();
  16047. }
  16048. static getSecretary(index) {
  16049. return this.userData.secretary[index];
  16050. }
  16051. static setSecretary(index, val) {
  16052. this.userData.secretary[index] = val;
  16053. this.saveUserData();
  16054. }
  16055. static getCurSecretary() {
  16056. return this.userData.curSecretary;
  16057. }
  16058. static setCurSecretary(index) {
  16059. this.userData.curSecretary = index;
  16060. this.saveUserData();
  16061. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16062. }
  16063. static getBallRod(index) {
  16064. return this.userData.ballRod[index];
  16065. }
  16066. static setBallRod(index, val) {
  16067. this.userData.ballRod[index] = val;
  16068. this.saveUserData();
  16069. }
  16070. static getCurBallRod() {
  16071. return this.userData.curBallRod;
  16072. }
  16073. static setCurBallRod(index) {
  16074. this.userData.curBallRod = index;
  16075. this.saveUserData();
  16076. }
  16077. static setSignData(val) {
  16078. this.userData.signData = val;
  16079. this.saveUserData();
  16080. }
  16081. static getSignData() {
  16082. return this.userData.signData;
  16083. }
  16084. static setSignTime(val) {
  16085. this.userData.signTime = val;
  16086. this.saveUserData();
  16087. }
  16088. static getSignTime() {
  16089. return this.userData.signTime;
  16090. }
  16091. static getDrawTimes() {
  16092. return this.userData.drawTimes;
  16093. }
  16094. static setDrawTimes(val, addUp = true) {
  16095. if (addUp) {
  16096. this.userData.drawTimes += val;
  16097. }
  16098. else {
  16099. this.userData.drawTimes = val;
  16100. }
  16101. this.saveUserData();
  16102. }
  16103. static getDrawAwardTimes() {
  16104. return this.userData.drawAwardTimes;
  16105. }
  16106. static setDrawAwardTimes(val) {
  16107. this.userData.drawAwardTimes = val;
  16108. this.saveUserData();
  16109. }
  16110. static getDailyfreeDrawTimes() {
  16111. return this.userData.dailyfreeDrawTimes;
  16112. }
  16113. static setDailyfreeDrawTimes(val) {
  16114. this.userData.dailyfreeDrawTimes = val;
  16115. this.saveUserData();
  16116. }
  16117. static setPower(val, addUp = true) {
  16118. if (addUp)
  16119. this.userData.power += val;
  16120. else
  16121. this.userData.power = val;
  16122. if (this.userData.power >= xGame.common.maxPower) {
  16123. this.userData.power = xGame.common.maxPower;
  16124. }
  16125. xGame.eventMgr.event(POWER_CHANGE, val);
  16126. this.saveUserData();
  16127. }
  16128. static getPower() {
  16129. return this.userData.power;
  16130. }
  16131. static setPowerTime(val) {
  16132. this.userData.powerTime = val;
  16133. this.saveUserData();
  16134. }
  16135. static getPowerTime() {
  16136. return this.userData.powerTime;
  16137. }
  16138. static powerEnough() {
  16139. return this.getPower() > 0;
  16140. }
  16141. static getChallengeTimes() {
  16142. return this.userData.challengeTimes;
  16143. }
  16144. static setChallengeTimes(val) {
  16145. this.userData.challengeTimes += val;
  16146. this.saveUserData();
  16147. }
  16148. static getExtraSign() {
  16149. return this.userData.extraSign;
  16150. }
  16151. static setExtraSign(val) {
  16152. this.userData.extraSign = val;
  16153. this.saveUserData();
  16154. }
  16155. static getClassicTimes() {
  16156. return this.userData.classicTimes;
  16157. }
  16158. static setClassicTimes() {
  16159. this.userData.classicTimes += 1;
  16160. this.saveUserData();
  16161. }
  16162. static getGuideHelpLine() {
  16163. return this.userData.guideHelpLine;
  16164. }
  16165. static setGuideHelpLine() {
  16166. this.userData.guideHelpLine = 1;
  16167. this.saveUserData();
  16168. }
  16169. static getNewUser() {
  16170. return this.userData.newUser;
  16171. }
  16172. static setNewUser() {
  16173. this.userData.newUser = false;
  16174. this.saveUserData();
  16175. }
  16176. static getRootBallFoul() {
  16177. return this.userData.rootBallFoul;
  16178. }
  16179. static setRootBallFoul() {
  16180. this.userData.rootBallFoul = 1;
  16181. this.saveUserData();
  16182. }
  16183. static getTimeoutFoul() {
  16184. return this.userData.timeoutFoul;
  16185. }
  16186. static setTimeoutFoul() {
  16187. this.userData.timeoutFoul = 1;
  16188. this.saveUserData();
  16189. }
  16190. }
  16191. DataMgr.isNewUser = false;
  16192. DataMgr.fristEnter = true;
  16193. DataMgr.levelType = 0;
  16194. DataMgr.awardId = 0;
  16195. DataMgr.awardCoin = 0;
  16196. DataMgr.sceneId = -1;
  16197. DataMgr.tryId = 0;
  16198. DataMgr.curLevel = 1;
  16199. DataMgr.vipLevel = 0;
  16200. DataMgr.maxLevel = 0;
  16201. DataMgr.awardRatio = 1;
  16202. DataMgr.gameList = [];
  16203. DataMgr.rankList = [];
  16204. DataMgr.recoverTime = 480000;
  16205. DataMgr.minScore = 0;
  16206. DataMgr.rankDis = 0;
  16207. DataMgr.userSaving = false;
  16208. DataMgr.gameSaving = false;
  16209. class D3Tween extends Laya.Script3D {
  16210. constructor() {
  16211. super();
  16212. this.isInited = false;
  16213. }
  16214. ;
  16215. init() {
  16216. if (this.isInited)
  16217. return;
  16218. this.isInited = true;
  16219. this.gameObj = this.owner;
  16220. this.transform = this.gameObj.transform;
  16221. }
  16222. get rotX() {
  16223. return this.transform.localRotationEulerX;
  16224. }
  16225. set rotX(v) {
  16226. this.transform.localRotationEulerX = v;
  16227. }
  16228. get rotY() {
  16229. return this.transform.localRotationEulerY;
  16230. }
  16231. set rotY(v) {
  16232. this.transform.localRotationEulerY = v;
  16233. }
  16234. get rotZ() {
  16235. return this.transform.localRotationEulerZ;
  16236. }
  16237. set rotZ(v) {
  16238. this.transform.localRotationEulerZ = v;
  16239. }
  16240. get posX() {
  16241. return this.transform.localPositionX;
  16242. }
  16243. set posX(v) {
  16244. this.transform.localPositionX = v;
  16245. }
  16246. get posY() {
  16247. return this.transform.localPositionY;
  16248. }
  16249. set posY(v) {
  16250. this.transform.localPositionY = v;
  16251. }
  16252. get posZ() {
  16253. return this.transform.localPositionZ;
  16254. }
  16255. set posZ(v) {
  16256. this.transform.localPositionZ = v;
  16257. }
  16258. get rotation() {
  16259. return this.transform.localRotation;
  16260. }
  16261. set rotation(v) {
  16262. this.transform.localRotation = v;
  16263. }
  16264. }
  16265. class D2Hole extends Laya.Script {
  16266. constructor() { super(); }
  16267. onTriggerEnter(collider) {
  16268. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16269. return;
  16270. }
  16271. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16272. if (collider.owner["mySrc"].isRunSkillAni) {
  16273. return;
  16274. }
  16275. if (collider.owner["mySrc"].number != 0) {
  16276. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16277. }
  16278. xGame.common.ballColliHole(collider);
  16279. xGame.common.recoverCameraView();
  16280. }
  16281. }
  16282. }
  16283. class Table extends Laya.Script3D {
  16284. constructor() {
  16285. super();
  16286. this.isSetBorder = false;
  16287. this.inited = false;
  16288. }
  16289. ;
  16290. onAwake() {
  16291. this.init();
  16292. }
  16293. init() {
  16294. if (this.inited)
  16295. return;
  16296. this.inited = true;
  16297. this.gameObj = this.owner;
  16298. this.border = this.gameObj.getChildByName("border");
  16299. }
  16300. setBorderPos() {
  16301. if (this.isSetBorder)
  16302. return;
  16303. this.isSetBorder = true;
  16304. let ui = xGame.common.gameUI.ui;
  16305. let bar1 = this.border.getChildByName("bar1");
  16306. let bar2 = this.border.getChildByName("bar2");
  16307. let bar3 = this.border.getChildByName("bar3");
  16308. let bar4 = this.border.getChildByName("bar4");
  16309. let bar5 = this.border.getChildByName("bar5");
  16310. let bar6 = this.border.getChildByName("bar6");
  16311. this.setInfo(bar1, ui.border.bar1, "box");
  16312. this.setInfo(bar2, ui.border.bar2, "box");
  16313. this.setInfo(bar3, ui.border.bar3, "box");
  16314. this.setInfo(bar4, ui.border.bar4, "box");
  16315. this.setInfo(bar5, ui.border.bar5, "box");
  16316. this.setInfo(bar6, ui.border.bar6, "box");
  16317. let circle1 = this.border.getChildByName("circle1");
  16318. let circle2 = this.border.getChildByName("circle2");
  16319. let circle3 = this.border.getChildByName("circle3");
  16320. let circle4 = this.border.getChildByName("circle4");
  16321. let circle5 = this.border.getChildByName("circle5");
  16322. let circle6 = this.border.getChildByName("circle6");
  16323. this.setInfo(circle1, ui.border.circle1, "circle");
  16324. this.setInfo(circle2, ui.border.circle2, "circle");
  16325. this.setInfo(circle3, ui.border.circle3, "circle");
  16326. this.setInfo(circle4, ui.border.circle4, "circle");
  16327. this.setInfo(circle5, ui.border.circle5, "circle");
  16328. this.setInfo(circle6, ui.border.circle6, "circle");
  16329. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16330. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16331. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16332. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16333. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16334. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16335. let arr = xGame.common.gameMgr.holePosList;
  16336. xGame.common.gameMgr.posObj = {
  16337. "1": arr[0],
  16338. "3": arr[2],
  16339. "4": arr[3],
  16340. "6": arr[5]
  16341. };
  16342. }
  16343. initHolePos(x, y) {
  16344. if (x < 300)
  16345. x += 25;
  16346. else if (x > 1000)
  16347. x -= 25;
  16348. else if (y > 200)
  16349. y -= 10;
  16350. else
  16351. y += 10;
  16352. if (y < 200)
  16353. y += 30;
  16354. else if (y > 500)
  16355. y -= 30;
  16356. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16357. }
  16358. setInfo(d3Obj, d2Obj, type) {
  16359. let ui = xGame.common.gameUI.ui;
  16360. let sprite = new Laya.Sprite();
  16361. ui.border.displayObject.addChild(sprite);
  16362. let colli = xGame.common.getCollider(type);
  16363. sprite.addComponentIntance(colli);
  16364. let rigy = xGame.common.getRigbody();
  16365. rigy.type = "static";
  16366. sprite.addComponentIntance(rigy);
  16367. let d3Pos = d3Obj.transform.position;
  16368. xGame.common.pos3to2Convert(d3Pos);
  16369. let scaleX = d3Obj.transform.localScaleX;
  16370. let scaleZ = d3Obj.transform.localScaleZ;
  16371. let width = xGame.common.scale3to2Convert(scaleZ);
  16372. let height = xGame.common.scale3to2Convert(scaleX);
  16373. sprite.pivotX = width / 2;
  16374. sprite.pivotY = height / 2;
  16375. sprite.x = d3Pos.x;
  16376. sprite.y = d3Pos.y;
  16377. sprite.width = width;
  16378. sprite.height = height;
  16379. d2Obj.x = d3Pos.x;
  16380. d2Obj.y = d3Pos.y;
  16381. d2Obj.width = width;
  16382. d2Obj.height = height;
  16383. if (type == "box") {
  16384. colli.width = width;
  16385. colli.height = height;
  16386. colli.isSensor = false;
  16387. colli.label = "border";
  16388. }
  16389. else {
  16390. colli.radius = width / 2;
  16391. colli.isSensor = true;
  16392. colli.label = "hole";
  16393. sprite.addComponent(D2Hole);
  16394. }
  16395. }
  16396. }
  16397. class D3World extends Laya.Script3D {
  16398. constructor() {
  16399. super();
  16400. this.loadNum = 0;
  16401. this.setLoadNum = 7;
  16402. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16403. }
  16404. onAwake() {
  16405. }
  16406. loadScene() {
  16407. this.scene = this.owner;
  16408. let url = `res/unityRes/root.lh`;
  16409. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16410. this.scene.addChild(prefab);
  16411. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16412. this.putCameraInfo();
  16413. this.camera.enableHDR = false;
  16414. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16415. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16416. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16417. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16418. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16419. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16420. this.knife.active = false;
  16421. this.loadD3Obj();
  16422. }));
  16423. }
  16424. putCameraInfo() {
  16425. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16426. this.cameraObj = new cameraType();
  16427. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16428. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16429. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16430. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16431. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16432. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16433. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16434. this.visitAngleChild.init();
  16435. this.visitRootObj.posX = this.visitAngleChild.posX;
  16436. this.visitRootObj.posY = this.visitAngleChild.posY;
  16437. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16438. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16439. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16440. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16441. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16442. xGame.common.showOneCamera("mainCamera");
  16443. }
  16444. loadD3Obj() {
  16445. this.loadTable();
  16446. this.loadRoom();
  16447. this.loadInHoleParticial();
  16448. this.loadIceParticial();
  16449. this.loadHitParticial();
  16450. this.loadFireworksParticial();
  16451. this.loadBall();
  16452. }
  16453. loadInHoleParticial() {
  16454. this.loadD3Res("inHoleEft", "", (prefab) => {
  16455. prefab.addComponent(Partical);
  16456. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16457. });
  16458. }
  16459. loadIceParticial() {
  16460. this.loadD3Res("iceEft", "", (prefab) => {
  16461. prefab.addComponent(Partical);
  16462. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16463. });
  16464. }
  16465. loadHitParticial() {
  16466. this.loadD3Res("hitEft", "", (prefab) => {
  16467. prefab.addComponent(Partical);
  16468. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16469. });
  16470. }
  16471. loadFireworksParticial() {
  16472. this.loadD3Res("fireworksEft", "", (prefab) => {
  16473. prefab.addComponent(Partical);
  16474. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16475. });
  16476. }
  16477. loadBall(index = 1) {
  16478. this.loadD3Res("ball", index, (prefab) => {
  16479. this.ballPrefab = prefab;
  16480. this.ballPrefab.addComponent(Ball);
  16481. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16482. });
  16483. }
  16484. loadTable(index = 1) {
  16485. this.loadD3Res("table", index, (prefab) => {
  16486. this.tableSrc = prefab.addComponent(Table);
  16487. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16488. this.d3Hand.init();
  16489. this.tableRoot.addChild(prefab);
  16490. });
  16491. }
  16492. loadRoom(index = 1) {
  16493. this.loadD3Res("room", index, (prefab) => {
  16494. this.roomRoot.addChild(prefab);
  16495. });
  16496. }
  16497. loadD3Res(type, index, callback) {
  16498. let url = `res/unityRes/${type}${index}.lh`;
  16499. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16500. callback && callback(prefab);
  16501. this.checkResLoad();
  16502. }));
  16503. }
  16504. checkResLoad() {
  16505. this.loadNum++;
  16506. if (this.loadNum >= this.setLoadNum) {
  16507. xGame.eventMgr.event(D3RES_LOADED);
  16508. }
  16509. }
  16510. prePlayEft() {
  16511. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16512. eft.transform.localPositionX = 0;
  16513. eft.transform.localPositionY = -5;
  16514. eft.transform.localPositionZ = 0;
  16515. eft.active = true;
  16516. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16517. ice.transform.localPositionX = 0;
  16518. ice.transform.localPositionY = -5;
  16519. ice.transform.localPositionZ = 0;
  16520. ice.active = true;
  16521. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16522. hit.transform.localPositionX = 0;
  16523. hit.transform.localPositionY = -5;
  16524. hit.transform.localPositionZ = 0;
  16525. hit.active = true;
  16526. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16527. fireworks.transform.localPositionX = 0;
  16528. fireworks.transform.localPositionY = -5;
  16529. fireworks.transform.localPositionZ = 0;
  16530. fireworks.active = true;
  16531. }
  16532. }
  16533. class cameraType {
  16534. }
  16535. class MoyuMgr$1 {
  16536. static initMoyu() {
  16537. this.moyuView = new MoyuView$1();
  16538. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16539. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16540. this.moyuView.ui.displayObject.zOrder = 1000;
  16541. this.moyuView.init();
  16542. this.moyuView.showTip(true);
  16543. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16544. window['XApk'] = this;
  16545. }
  16546. static showAge(show) {
  16547. if (this.moyuView)
  16548. this.moyuView.showAge(show);
  16549. }
  16550. static onPlatMsg(idx) {
  16551. if (!MoyuMgr$1.moyuView)
  16552. return;
  16553. if (idx == '0') {
  16554. MoyuMgr$1.moyuView.showTip(false);
  16555. }
  16556. }
  16557. static showAgree(call) {
  16558. if (this.moyuView)
  16559. this.moyuView.showAgree(call);
  16560. else
  16561. call && call();
  16562. }
  16563. static showXy(type = 1) {
  16564. if (this.moyuView)
  16565. this.moyuView.showXy(type);
  16566. }
  16567. }
  16568. MoyuMgr$1.isAdvise = false;
  16569. class MoyuView$1 {
  16570. constructor() {
  16571. this.ysxyNum = 1;
  16572. this.ysJson = null;
  16573. this.ui = ui_UIMoyu.createInstance();
  16574. }
  16575. init() {
  16576. this.ui.mainBg.visible = false;
  16577. this.ui.xyNode.visible = false;
  16578. this.ui.ageNode.visible = false;
  16579. this.ui.tipNode.visible = false;
  16580. this.ui.rnNode.visible = false;
  16581. this.ui.fcmNode.visible = false;
  16582. this.ui.ageTip.visible = false;
  16583. this.ui.msgNode.visible = false;
  16584. this.ui.visible = false;
  16585. this.ui.xyNode.xyList.setVirtual();
  16586. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16587. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16588. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16589. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16590. this.ui.xyNode.btnKnown.visible = false;
  16591. this.ui.xyNode.xy1.visible = false;
  16592. this.ui.xyNode.xy2.visible = false;
  16593. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16594. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16595. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16596. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16597. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16598. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16599. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16600. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16601. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16602. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16603. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16604. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16605. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16606. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16607. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16608. this.ysxyNum = 2;
  16609. }
  16610. }
  16611. onClick(obj) {
  16612. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16613. switch (obj) {
  16614. case this.ui.ageTip:
  16615. if (Moyu.isTTApk) {
  16616. this.ui.ageNode.visible = true;
  16617. this.ui.mainBg.visible = true;
  16618. }
  16619. break;
  16620. case this.ui.tipNode:
  16621. this.showTip(false);
  16622. break;
  16623. case this.ui.ageNode.btnAge:
  16624. this.ui.ageNode.visible = false;
  16625. this.ui.mainBg.visible = false;
  16626. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16627. this.ui.visible = false;
  16628. break;
  16629. case this.ui.xyNode.btnXy3:
  16630. case this.ui.xyNode.btnXy1:
  16631. this.loadXy(1);
  16632. break;
  16633. case this.ui.xyNode.btnXy2:
  16634. this.loadXy(2);
  16635. break;
  16636. case this.ui.xyNode.btnBack:
  16637. this.ui.xyNode.xy1.visible = true;
  16638. this.ui.xyNode.xy2.visible = false;
  16639. break;
  16640. case this.ui.xyNode.btnKnown:
  16641. this.ui.xyNode.visible = false;
  16642. this.ui.mainBg.visible = false;
  16643. this.ui.visible = false;
  16644. break;
  16645. case this.ui.rnNode.btnCheck:
  16646. this.check();
  16647. break;
  16648. case this.ui.rnNode.btnExit:
  16649. case this.ui.xyNode.btnNo:
  16650. this.ysxyNum--;
  16651. if (this.ysxyNum > 0)
  16652. this.showMsg("Refuse to quit the game once again");
  16653. else {
  16654. Moyu.userAgree(false);
  16655. Moyu.exit();
  16656. }
  16657. break;
  16658. case this.ui.xyNode.btnSure:
  16659. case this.ui.xyNode.btnYes:
  16660. DataMgr.userData.isAgree = true;
  16661. DataMgr.saveUserData();
  16662. this.onAgree();
  16663. break;
  16664. case this.ui.rnNode.btnDone:
  16665. this.ui.rnNode.visible = false;
  16666. this.ui.visible = false;
  16667. break;
  16668. case this.ui.fcmNode.btnRn:
  16669. this.showRn();
  16670. break;
  16671. }
  16672. }
  16673. showTip(show) {
  16674. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16675. return;
  16676. if (show) {
  16677. MoyuMgr$1.isAdvise = true;
  16678. this.ui.visible = true;
  16679. this.ui.tipNode.visible = true;
  16680. this.ui.tipNode.alpha = 1;
  16681. Laya.timer.once(1000, this, this.showTip, [false]);
  16682. }
  16683. else {
  16684. this.ui.tipNode.alpha = 1;
  16685. this.ui.tipNode.visible = true;
  16686. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16687. this.ui.tipNode.visible = false;
  16688. MoyuMgr$1.isAdvise = false;
  16689. }), 1000);
  16690. }
  16691. }
  16692. showAge(show, px = 0, py = 0) {
  16693. if (Moyu.platType > 10 && !Moyu.isIos) {
  16694. this.ui.ageTip.x = px;
  16695. this.ui.ageTip.y = py;
  16696. this.ui.ageTip.visible = show;
  16697. if (show)
  16698. this.ui.visible = true;
  16699. }
  16700. }
  16701. showAgree(call) {
  16702. this.agreeCall = call;
  16703. this.onAgree();
  16704. return;
  16705. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16706. this.showXy(0);
  16707. }
  16708. else
  16709. this.onAgree();
  16710. }
  16711. onAgree() {
  16712. if (!this.ui.ageNode.visible)
  16713. this.ui.visible = false;
  16714. this.ui.xyNode.visible = false;
  16715. Moyu.userAgree(true);
  16716. this.showAge(false);
  16717. this.agreeCall && this.agreeCall();
  16718. this.showRn();
  16719. }
  16720. showMsg(txt) {
  16721. this.ui.msgNode.txtMsg.text = txt;
  16722. this.ui.msgNode.visible = true;
  16723. this.ui.msgNode.alpha = 1;
  16724. this.ui.visible = true;
  16725. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16726. this.ui.msgNode.visible = false;
  16727. }), 2500, true);
  16728. }
  16729. showRn() {
  16730. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16731. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16732. this.ui.rnNode.rn1.visible = true;
  16733. this.ui.rnNode.rn2.visible = false;
  16734. this.ui.rnNode.rn3.visible = false;
  16735. this.ui.rnNode.rn4.visible = false;
  16736. this.ui.rnNode.visible = true;
  16737. this.ui.mainBg.visible = true;
  16738. this.ui.rnNode.btnDone.visible = false;
  16739. this.ui.rnNode.btnExit.visible = true;
  16740. this.ui.rnNode.btnCheck.visible = true;
  16741. this.ui.fcmNode.visible = false;
  16742. this.ui.visible = true;
  16743. return;
  16744. }
  16745. }
  16746. this.showFcm();
  16747. }
  16748. showFcm() {
  16749. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16750. Moyu.initFCM(true);
  16751. if (Moyu.gameTime < 1)
  16752. this.fcmLoop();
  16753. else if (Moyu.gameTime < 999)
  16754. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16755. }
  16756. }
  16757. fcmLoop() {
  16758. if (Moyu.gameTime < 1) {
  16759. this.ui.rnNode.visible = false;
  16760. this.ui.fcmNode.visible = true;
  16761. this.ui.mainBg.visible = true;
  16762. this.ui.visible = true;
  16763. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16764. Laya.timer.clear(this.ui, this.fcmLoop);
  16765. }
  16766. }
  16767. check() {
  16768. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16769. this.ui.rnNode.rn1.visible = false;
  16770. this.ui.rnNode.rn2.visible = false;
  16771. this.ui.rnNode.rn4.visible = true;
  16772. }
  16773. else if (this.ui.rnNode.rn4.visible) {
  16774. let name = this.ui.rnNode.inputName.text;
  16775. let code = this.ui.rnNode.inputCode.text;
  16776. if (code && code.length == 18) {
  16777. this.ui.rnNode.rn1.visible = false;
  16778. this.ui.rnNode.rn4.visible = false;
  16779. Moyu.authenticate(name, code, (res) => {
  16780. this.ui.rnNode.rn2.visible = !res;
  16781. this.ui.rnNode.rn3.visible = res;
  16782. this.ui.rnNode.btnDone.visible = res;
  16783. this.ui.rnNode.btnExit.visible = !res;
  16784. this.ui.rnNode.btnCheck.visible = !res;
  16785. if (res)
  16786. this.showFcm();
  16787. });
  16788. }
  16789. else
  16790. this.showMsg("信息填写不完整");
  16791. }
  16792. }
  16793. loadXy(type = 0) {
  16794. this.ui.xyNode.xy1.visible = false;
  16795. this.ui.xyNode.xy2.visible = true;
  16796. this.ui.xyNode.xyList.scrollToView(0);
  16797. if (type == 1) {
  16798. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16799. }
  16800. else if (type == 2) {
  16801. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16802. }
  16803. }
  16804. showXy(type = 0) {
  16805. this.xyBtn();
  16806. if (type == 0) {
  16807. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16808. this.ui.xyNode.btnSure.visible = true;
  16809. }
  16810. else {
  16811. this.ui.xyNode.btnYes.visible = true;
  16812. this.ui.xyNode.btnNo.visible = true;
  16813. }
  16814. }
  16815. else {
  16816. this.ui.xyNode.btnKnown.visible = true;
  16817. this.ui.mainBg.visible = true;
  16818. }
  16819. this.ui.xyNode.xy1.visible = true;
  16820. this.ui.xyNode.xy2.visible = false;
  16821. this.ui.xyNode.visible = true;
  16822. this.ui.visible = true;
  16823. }
  16824. xyBtn() {
  16825. this.ui.xyNode.btnSure.visible = false;
  16826. this.ui.xyNode.btnYes.visible = false;
  16827. this.ui.xyNode.btnNo.visible = false;
  16828. this.ui.xyNode.btnKnown.visible = false;
  16829. {
  16830. this.ui.xyNode.btnXy3.visible = false;
  16831. this.ui.xyNode.btnXy2.visible = true;
  16832. this.ui.xyNode.btnXy1.visible = true;
  16833. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16834. }
  16835. }
  16836. createXY(json) {
  16837. this.ysJson = json.content;
  16838. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16839. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16840. this.ui.xyNode.xy2.visible = true;
  16841. }
  16842. renderListItem(idx, cell) {
  16843. let xy = this.ysJson[idx];
  16844. cell.height = xy.line * 30;
  16845. cell.xyItem.text = xy.text;
  16846. }
  16847. onDestroy() {
  16848. this.agreeCall = null;
  16849. }
  16850. }
  16851. class UILoading extends UIBase {
  16852. constructor() {
  16853. super();
  16854. this.accTime = 0;
  16855. this.curNum = 0;
  16856. this.rate = 1;
  16857. this.loadSubOk = false;
  16858. this.loadResOK = false;
  16859. this.openLoading = true;
  16860. this.beginLoadRes = false;
  16861. this.finishD2 = false;
  16862. this.finishD3 = false;
  16863. }
  16864. onConstructor() {
  16865. this.ui = ui_UILoading.createInstance();
  16866. this.contentPane = this.ui;
  16867. this.isEject = false;
  16868. this._initUI();
  16869. this._addEvent();
  16870. }
  16871. _initUI() {
  16872. MoyuMgr$1.initMoyu();
  16873. }
  16874. _addEvent() {
  16875. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16876. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16877. }
  16878. show() {
  16879. super.show();
  16880. console.log('zh:加载分包资源');
  16881. loadSubRes(this.subResProgress.bind(this));
  16882. this.ui.txtLoad.text = "Loading...";
  16883. }
  16884. subResProgress(pro, finish) {
  16885. this.curNum = pro;
  16886. if (finish) {
  16887. this.curNum = 1;
  16888. this.loadSubOk = true;
  16889. }
  16890. }
  16891. laodD3Res() {
  16892. let scene3D = new Laya.Scene3D();
  16893. xGame.common.d3Scene = scene3D;
  16894. xGame.common.d3World = scene3D.addComponent(D3World);
  16895. xGame.common.d3World.loadScene();
  16896. }
  16897. loadD2Res() {
  16898. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16899. this.finishD2 = true;
  16900. this.checkLoadAll();
  16901. this.curNum = 1;
  16902. }), Laya.Handler.create(this, (pro) => {
  16903. this.curNum = pro;
  16904. }, null, false));
  16905. }
  16906. d3ResFinish() {
  16907. this.finishD3 = true;
  16908. this.checkLoadAll();
  16909. }
  16910. checkLoadAll() {
  16911. if (this.finishD2 && this.finishD3) {
  16912. this.loadResOK = true;
  16913. }
  16914. }
  16915. loadRes() {
  16916. this.laodD3Res();
  16917. this.loadD2Res();
  16918. }
  16919. myUpdate(dt) {
  16920. if (!this.openLoading)
  16921. return;
  16922. this.accTime += dt * this.rate;
  16923. if (this.accTime >= this.curNum)
  16924. this.accTime = this.curNum;
  16925. this.ui.loadinfo.value = this.accTime * 100;
  16926. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16927. if (!this.beginLoadRes) {
  16928. this.beginLoadRes = true;
  16929. this.ui.txtLoad.text = "Loading...";
  16930. this.curNum = 0;
  16931. this.accTime = 0;
  16932. this.loadRes();
  16933. }
  16934. if (this.loadResOK) {
  16935. this.openLoading = false;
  16936. Laya.timer.once(300, this, () => {
  16937. xGame.common.d3Scene.active = false;
  16938. MoyuMgr$1.showAgree(enterGame);
  16939. });
  16940. }
  16941. }
  16942. }
  16943. release() {
  16944. }
  16945. hide() {
  16946. super.hide();
  16947. this.release();
  16948. }
  16949. onClose() {
  16950. this.hide();
  16951. }
  16952. }
  16953. UILoading.uiName = "UILoading";
  16954. class UIRepentProp$1 extends UIBase {
  16955. constructor() {
  16956. super();
  16957. this.viewType = 0;
  16958. this.regretType = 0;
  16959. }
  16960. onConstructor() {
  16961. this.ui = ui_UIRepentProp.createInstance();
  16962. this.contentPane = this.ui;
  16963. this.isEject = false;
  16964. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  16965. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  16966. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  16967. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  16968. }
  16969. show(viewType, regretType, callback) {
  16970. PlatMgr.showInsert(true);
  16971. this.viewType = viewType;
  16972. this.regretType = regretType;
  16973. this.callback = callback;
  16974. super.show();
  16975. this.ui.t0.play();
  16976. this.ui.c1.selectedIndex = this.viewType;
  16977. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  16978. if (this.viewType == 0) {
  16979. let guide = DataMgr.getGuideHelpLine();
  16980. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  16981. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  16982. }
  16983. xGame.common.gameMgr.gamePause = true;
  16984. }
  16985. hideSelf() {
  16986. xGame.common.gameMgr.gamePause = false;
  16987. this.callback && this.callback(false);
  16988. this.hide();
  16989. }
  16990. videoRegret() {
  16991. Moyu.showVideoAd(() => {
  16992. this.callback && this.callback(true);
  16993. this.hideSelf();
  16994. }, EAdType.regretBall);
  16995. }
  16996. videoAddHelpLine() {
  16997. let guide = DataMgr.getGuideHelpLine();
  16998. if (guide == 0) {
  16999. this.callback && this.callback(true);
  17000. this.hideSelf();
  17001. DataMgr.setGuideHelpLine();
  17002. xGame.common.gameUI.ui.guideNode.visible = false;
  17003. }
  17004. else {
  17005. Moyu.showVideoAd(() => {
  17006. this.callback && this.callback(true);
  17007. this.hideSelf();
  17008. }, EAdType.longHelpLine);
  17009. }
  17010. }
  17011. }
  17012. UIRepentProp$1.uiName = "UIRepentProp";
  17013. class UIRodMethod$1 extends UIBase {
  17014. constructor() {
  17015. super();
  17016. this.isPressd = false;
  17017. }
  17018. onConstructor() {
  17019. this.ui = ui_UIRodMethod.createInstance();
  17020. this.contentPane = this.ui;
  17021. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17022. this.moveDir = new Laya.Vector2();
  17023. this.moveDest = new Laya.Vector2();
  17024. this.centerPos = new Laya.Vector2();
  17025. xGame.common.uiRodMethod = this;
  17026. }
  17027. show() {
  17028. super.show();
  17029. xGame.common.gameMgr.gamePause = true;
  17030. this.openPressDotEvent();
  17031. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17032. this.centerPos.x = this.ui.white.x;
  17033. this.centerPos.y = this.ui.white.y;
  17034. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17035. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17036. this.setDot();
  17037. }
  17038. setDot() {
  17039. this.ui.dot.x = this.moveDest.x;
  17040. this.ui.dot.y = this.moveDest.y;
  17041. }
  17042. closeSelf() {
  17043. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17044. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17045. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17046. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17047. xGame.common.gameMgr.gamePause = false;
  17048. this.hide();
  17049. }
  17050. openPressDotEvent() {
  17051. this.closePressDotEvent();
  17052. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17053. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17054. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17055. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17056. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17057. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17058. }
  17059. closePressDotEvent() {
  17060. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17061. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17062. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17063. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17064. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17065. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17066. }
  17067. onDown(e) {
  17068. if (e.type == Laya.Event.MOUSE_DOWN)
  17069. this.isPressd = true;
  17070. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17071. this.isPressd = false;
  17072. if (!this.isPressd)
  17073. return;
  17074. this.moveDest.x = e.stageX;
  17075. this.moveDest.y = e.stageY;
  17076. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17077. if (dis > 6724) {
  17078. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17079. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17080. }
  17081. this.setDot();
  17082. }
  17083. resetRod() {
  17084. this.ui.dot.x = this.ui.white.x;
  17085. this.ui.dot.y = this.ui.white.y;
  17086. this.gameRod.dot.x = this.gameRod.bg.x;
  17087. this.gameRod.dot.y = this.gameRod.bg.y;
  17088. xGame.common.rodOffest.x = 0;
  17089. xGame.common.rodOffest.y = 0;
  17090. }
  17091. }
  17092. UIRodMethod$1.uiName = "UIRodMethod";
  17093. class UIMsg$1 extends UIBase {
  17094. constructor() {
  17095. super();
  17096. }
  17097. onConstructor() {
  17098. this.ui = ui_UIMsg.createInstance();
  17099. this.contentPane = this.ui;
  17100. this.isEject = false;
  17101. this.isMuti = true;
  17102. }
  17103. show(msg, callback) {
  17104. super.show();
  17105. this.ui.tipsNode.msgTxt.text = msg;
  17106. this.ui.alpha = 1;
  17107. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17108. this.hide();
  17109. callback && callback();
  17110. }), 1000);
  17111. }
  17112. }
  17113. UIMsg$1.uiName = "UIMsg";
  17114. class UITips$1 extends UIBase {
  17115. constructor() {
  17116. super();
  17117. this.type = 0;
  17118. }
  17119. onConstructor() {
  17120. this.ui = ui_UITips.createInstance();
  17121. this.contentPane = this.ui;
  17122. this.isEject = false;
  17123. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17124. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17125. }
  17126. show(tipsTxt, womanTxt, type) {
  17127. super.show();
  17128. this.ui.t0.play();
  17129. this.ui.myNode.tipsTxt.text = tipsTxt;
  17130. this.ui.myNode.womanTxt.text = womanTxt;
  17131. PlatMgr.showInsert(true);
  17132. this.ui.myNode.c1.selectedIndex = type;
  17133. this.type = type;
  17134. switch (this.type) {
  17135. case TipsType.exitGame:
  17136. xGame.common.gameMgr.gamePause = true;
  17137. break;
  17138. case TipsType.foul:
  17139. Laya.timer.once(200, this, () => {
  17140. xGame.common.gameMgr.gamePause = true;
  17141. });
  17142. break;
  17143. default:
  17144. break;
  17145. }
  17146. }
  17147. clickLeftBtn() {
  17148. this.hide();
  17149. xGame.common.gameMgr.gamePause = false;
  17150. switch (this.type) {
  17151. case TipsType.exitGame:
  17152. break;
  17153. case TipsType.foul:
  17154. break;
  17155. default:
  17156. break;
  17157. }
  17158. }
  17159. clickRightBtn() {
  17160. this.hide();
  17161. switch (this.type) {
  17162. case TipsType.exitGame:
  17163. xGame.eventMgr.event(RESET_GAME);
  17164. xGame.uiMgr.Show(UIMain$1);
  17165. Moyu.recordEnd(this, null);
  17166. xGame.common.longHelpLine = false;
  17167. break;
  17168. case TipsType.foul:
  17169. xGame.common.gameMgr.gamePause = false;
  17170. Laya.timer.clearAll(this);
  17171. break;
  17172. default:
  17173. break;
  17174. }
  17175. }
  17176. }
  17177. UITips$1.uiName = "UITips";
  17178. class UIGame$1 extends UIBase {
  17179. constructor() {
  17180. super();
  17181. this.powerNum = 0;
  17182. this.isD3Inited = false;
  17183. this.isPrePlay = false;
  17184. this.isMoveRod = false;
  17185. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17186. this.rulerDis = 20;
  17187. this.rulerOffset = 0;
  17188. }
  17189. onConstructor() {
  17190. this.ui = ui_UIGame.createInstance();
  17191. this.contentPane = this.ui;
  17192. this.ui.x += xGame.common.sysOffestNum;
  17193. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17194. this.isEject = false;
  17195. xGame.common.gameUI = this;
  17196. this.initSelf();
  17197. }
  17198. isTurnSelf() {
  17199. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17200. return true;
  17201. }
  17202. }
  17203. initSelf() {
  17204. let topUI = this.ui.topNode;
  17205. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17206. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17207. this.barInfo = {};
  17208. this.barInfo.curY = 0;
  17209. this.barInfo.height = this.ui.powerNode.height;
  17210. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17211. this.barInfo.powerStartY = this.ui.powerNode.y;
  17212. xGame.common.aiPlayer = new AIPlayer();
  17213. xGame.common.gameMgr = new GameMgr();
  17214. xGame.common.skillMgr = new SkillMgr();
  17215. xGame.common.wordsMgr = new WordsMgr();
  17216. xGame.common.talkMgr = new TalkMgr();
  17217. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17218. console.log("加载经典模式表情文件chenggon !");
  17219. });
  17220. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17221. console.log("挑战模式奖励模式spine加载成功!");
  17222. });
  17223. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17224. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17225. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17226. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17227. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17228. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17229. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17230. }
  17231. returnHome() {
  17232. let tips = "Are you sure to exit the game?";
  17233. let woman = "Boss, why don't you play for a while longer?";
  17234. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17235. }
  17236. addRodMethodClick() {
  17237. if (this.isTurnSelf()) {
  17238. xGame.uiMgr.Show(UIRodMethod$1);
  17239. }
  17240. }
  17241. clickHelpLineBtn(force = false) {
  17242. if (!this.isTurnSelf())
  17243. return;
  17244. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17245. if (success) {
  17246. xGame.common.longHelpLine = true;
  17247. xGame.common.d2World.getHelpLine();
  17248. Moyu.sendDataEvent("guideNum");
  17249. }
  17250. else {
  17251. }
  17252. });
  17253. }
  17254. renderSelfDisplayBalls(index, target) {
  17255. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17256. target.myImg.url = xGame.common.getGameIconUrl(str);
  17257. }
  17258. renderAIDisplayBalls(index, target) {
  17259. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17260. target.myImg.url = xGame.common.getGameIconUrl(str);
  17261. ;
  17262. }
  17263. updateMode() {
  17264. if (xGame.common.gameMode == GameMode.classic) {
  17265. this.ui.topNode.scoreNode.visible = false;
  17266. }
  17267. else if (xGame.common.gameMode == GameMode.bigMove) {
  17268. this.ui.topNode.scoreNode.visible = true;
  17269. }
  17270. }
  17271. show() {
  17272. super.show();
  17273. console.log("zh:uigame show");
  17274. this.ui.alpha = 0;
  17275. this.updateSelf();
  17276. console.log("zh:uigame bf gamemusic01 start");
  17277. xGame.soundMgr.playMusic("gamemusic01");
  17278. console.log("zh:uigame bf gamemusic01 end");
  17279. xGame.common.gameMgr.gamePause = false;
  17280. xGame.common.gameUI.ui.blackAni.visible = false;
  17281. xGame.common.gameUI.ui.whiteAni.visible = false;
  17282. this.ui.powerEft.visible = false;
  17283. this.ui.colorNode.visible = false;
  17284. this.updateHead();
  17285. }
  17286. updateSelf() {
  17287. if (xGame.common.gameMode == GameMode.classic) {
  17288. this.ui.c1.selectedIndex = 0;
  17289. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17290. this.ui.topNode.middleNode.visible = true;
  17291. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17292. }
  17293. else if (xGame.common.gameMode == GameMode.bigMove) {
  17294. this.ui.c1.selectedIndex = 0;
  17295. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17296. this.ui.topNode.middleNode.visible = false;
  17297. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17298. let rand = xGame.common.randomNum(1, max);
  17299. let guide = DataMgr.getSkillGuide();
  17300. if (guide == 0)
  17301. rand = 1;
  17302. xGame.common.bigMoveLevelIndex = rand;
  17303. }
  17304. else if (xGame.common.gameMode == GameMode.placeBall) {
  17305. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17306. this.ui.c1.selectedIndex = 1 + data.type;
  17307. this.ui.alpha = 1;
  17308. this.startGame();
  17309. }
  17310. this.updateMode();
  17311. this.initD3world();
  17312. this.initD2world();
  17313. }
  17314. startGame() {
  17315. this.ui.snowNode.visible = Math.random() <= 0.1;
  17316. this.ui.d2Node.visible = false;
  17317. xGame.common.d3World.d3Hand.gameObj.active = false;
  17318. xGame.common.d3World.tableSrc.init();
  17319. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17320. this.cameraViewChange(() => {
  17321. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17322. switch (xGame.common.gameMode) {
  17323. case GameMode.classic:
  17324. xGame.common.d3World.d3Hand.gameObj.active = true;
  17325. this.playPutBallD3Ani();
  17326. break;
  17327. case GameMode.bigMove:
  17328. this.enterGame();
  17329. Laya.timer.once(500, this, () => {
  17330. this.ui.topNode.middleNode.visible = true;
  17331. this.ui.topNode.middleNode.t0.play();
  17332. });
  17333. break;
  17334. case GameMode.placeBall:
  17335. this.enterGame();
  17336. break;
  17337. default:
  17338. break;
  17339. }
  17340. });
  17341. PlatMgr.showBanner(false);
  17342. }
  17343. enterGame() {
  17344. this.ui.d2Node.visible = true;
  17345. xGame.common.d3World.d3Hand.gameObj.active = false;
  17346. xGame.common.showOneCamera("mainCamera");
  17347. Moyu.recordGame(30, true);
  17348. if (!this.isPrePlay) {
  17349. this.isPrePlay = true;
  17350. xGame.common.d3World.prePlayEft();
  17351. }
  17352. xGame.common.gameMgr.gameReady();
  17353. this.openAllEvent();
  17354. this.ui.snowNode.visible = false;
  17355. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17356. this.ui.helpBtn.visible = condition;
  17357. }
  17358. showHelpLineGuide() {
  17359. let longGuide = DataMgr.getGuideHelpLine();
  17360. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17361. this.ui.helpBtn.visible = true;
  17362. this.ui.guideNode.visible = true;
  17363. }
  17364. }
  17365. setTurnAlpha(alpha) {
  17366. this.ui.keduNode.alpha = alpha;
  17367. this.ui.ganNode.alpha = alpha;
  17368. this.ui.rodMethodNode.alpha = alpha;
  17369. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17370. }
  17371. cameraViewChange(callback) {
  17372. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17373. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17374. xGame.common.showOneCamera("visitAngle");
  17375. cameraSrc.localRotationEulerY = 180;
  17376. cameraSrc.localRotationEulerZ = 0;
  17377. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17378. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17379. callback && callback();
  17380. }));
  17381. }));
  17382. }
  17383. playPutBallD3Ani() {
  17384. xGame.common.showOneCamera("mainCamera");
  17385. let handSrc = xGame.common.d3World.d3Hand;
  17386. handSrc.gameObj.active = true;
  17387. handSrc.transform.localPositionZ = 3;
  17388. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17389. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17390. handSrc.gameObj.active = false;
  17391. this.enterGame();
  17392. }), 400);
  17393. }));
  17394. }
  17395. updateHead() {
  17396. let user = Moyu.getUserInfo();
  17397. this.ui.topNode.selfNameTxt.text = user.nickName;
  17398. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17399. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17400. if (DataMgr.getSkillGuide() < 1) {
  17401. this.ui.topNode.aiNameTxt.text = 'billiards';
  17402. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17403. }
  17404. else {
  17405. this.ui.topNode.aiNameTxt.text = aiData.name;
  17406. let randNo = Math.floor(Math.random() * 10) + 1;
  17407. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17408. }
  17409. }
  17410. initD2world() {
  17411. let node = this.ui.d2Root.displayObject;
  17412. let src = node.getComponent(D2World);
  17413. if (!src) {
  17414. xGame.common.d2World = node.addComponent(D2World);
  17415. }
  17416. xGame.common.d2World.initSelf();
  17417. }
  17418. initD3world() {
  17419. if (this.isD3Inited)
  17420. return;
  17421. this.isD3Inited = true;
  17422. let scene3D = xGame.common.d3Scene;
  17423. this.ui.d3Root.displayObject.addChild(scene3D);
  17424. scene3D.active = true;
  17425. xGame.common.d3World.tableSrc.setBorderPos();
  17426. }
  17427. onRootMove(e) {
  17428. let rootBall = xGame.common.d2World.rootBall;
  17429. this.ui.moveNode.x = e.x;
  17430. this.ui.moveNode.y = e.y;
  17431. rootBall.gameObj.x = e.x;
  17432. rootBall.gameObj.y = e.y;
  17433. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17434. }
  17435. aiRootMove(move) {
  17436. if (move)
  17437. this.hideBallUI();
  17438. else {
  17439. this.showBallUI();
  17440. xGame.common.d2World.getHelpLine();
  17441. }
  17442. }
  17443. aiForce(type, force = 0) {
  17444. this.pressTarget = PressType.powerNode;
  17445. if (type == 1)
  17446. this.onEventUp({ force: true });
  17447. else if (type == 2)
  17448. this.onEventMove({ stageY: force, force: true });
  17449. }
  17450. onEventPress(e) {
  17451. if (e.stopPropagation)
  17452. e.stopPropagation();
  17453. if (!this.isTurnSelf())
  17454. return;
  17455. let target = e.target;
  17456. switch (target) {
  17457. case this.ui.myPowerNode.displayObject:
  17458. this.pressTarget = PressType.powerNode;
  17459. this.barInfo.curY = e.stageY;
  17460. this.updateBarInfo();
  17461. break;
  17462. case this.ui.moveNode.displayObject:
  17463. this.pressTarget = PressType.moveNode;
  17464. this.hideBallUI();
  17465. this.eventObj.curX = this.ui.moveNode.x;
  17466. this.eventObj.curY = this.ui.moveNode.y;
  17467. this.ui.moveNode.finger.visible = false;
  17468. this.eventObj.lastX = e.stageX;
  17469. this.eventObj.lastY = e.stageY;
  17470. break;
  17471. case this.ui.rulerClickNode.displayObject:
  17472. this.pressTarget = PressType.rulerNode;
  17473. this.eventObj.lastY = e.stageY;
  17474. break;
  17475. case this.ui.d2Root.displayObject:
  17476. this.pressTarget = PressType.d2Root;
  17477. this.eventObj.lastX = e.stageX;
  17478. this.eventObj.lastY = e.stageY;
  17479. this.eventObj.starX = e.stageX;
  17480. this.eventObj.starY = e.stageY;
  17481. this.eventObj.curX = 0;
  17482. this.eventObj.curY = 0;
  17483. xGame.common.d2World.d2Gan.setGanLastInfo();
  17484. this.rulerOffset = 0;
  17485. break;
  17486. default:
  17487. break;
  17488. }
  17489. }
  17490. onEventMove(e) {
  17491. if (e.stopPropagation)
  17492. e.stopPropagation();
  17493. if (e && e.force) {
  17494. }
  17495. else {
  17496. if (!this.isTurnSelf())
  17497. return;
  17498. }
  17499. switch (this.pressTarget) {
  17500. case PressType.powerNode:
  17501. this.barInfo.curY = e.stageY;
  17502. this.updateBarInfo();
  17503. this.isMoveRod = true;
  17504. break;
  17505. case PressType.moveNode:
  17506. let rootBall = xGame.common.d2World.rootBall;
  17507. let radius = rootBall.gameObj.width / 2;
  17508. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17509. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17510. let border = xGame.common.d2World.borderRect;
  17511. if (curX <= border.x + radius)
  17512. curX = border.x + radius;
  17513. else if (curX >= border.x + border.width - radius)
  17514. curX = border.x + border.width - radius;
  17515. if (curY <= border.y + radius)
  17516. curY = border.y + radius;
  17517. else if (curY >= border.y + border.height - radius)
  17518. curY = border.y + border.height - radius;
  17519. if (xGame.common.gameMgr.isOpenBall) {
  17520. if (curX >= border.x + border.openBallW - radius)
  17521. curX = border.x + border.openBallW - radius;
  17522. }
  17523. this.ui.moveNode.x = curX;
  17524. this.ui.moveNode.y = curY;
  17525. rootBall.gameObj.x = curX;
  17526. rootBall.gameObj.y = curY;
  17527. rootBall.d3BallSrc.setTransPos(curX, curY);
  17528. this.isMoveRod = true;
  17529. break;
  17530. case PressType.rulerNode:
  17531. let yy = e.stageY - this.eventObj.lastY;
  17532. this.eventObj.lastY = e.stageY;
  17533. let ruler1 = this.ui.rulerNode.img1;
  17534. let ruler2 = this.ui.rulerNode.img2;
  17535. ruler1.y += yy;
  17536. ruler2.y += yy;
  17537. this.rulerOffset += yy;
  17538. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17539. this.rulerOffset = 0;
  17540. xGame.soundMgr.playSound("inch", 1, 10);
  17541. }
  17542. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17543. let h = ruler1.height;
  17544. this.checkGuide();
  17545. this.isMoveRod = true;
  17546. if (ruler1.y >= h) {
  17547. ruler1.y = -h;
  17548. ruler2.y = 0;
  17549. return;
  17550. }
  17551. else if (ruler1.y <= -h) {
  17552. ruler1.y = h;
  17553. ruler2.y = 0;
  17554. return;
  17555. }
  17556. if (ruler2.y >= h) {
  17557. ruler2.y = -h;
  17558. ruler1.y = 0;
  17559. return;
  17560. }
  17561. else if (ruler2.y <= -h) {
  17562. ruler2.y = h;
  17563. ruler1.y = 0;
  17564. return;
  17565. }
  17566. break;
  17567. case PressType.d2Root:
  17568. this.eventObj.curX = e.stageX;
  17569. this.eventObj.curY = e.stageY;
  17570. let offset = this.checkRodMoveDir();
  17571. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17572. this.eventObj.lastX = e.stageX;
  17573. this.eventObj.lastY = e.stageY;
  17574. break;
  17575. default:
  17576. break;
  17577. }
  17578. }
  17579. onEventUp(e) {
  17580. if (e.stopPropagation)
  17581. e.stopPropagation();
  17582. if (e && e.force) {
  17583. }
  17584. else {
  17585. if (!this.isTurnSelf())
  17586. return;
  17587. }
  17588. switch (this.pressTarget) {
  17589. case PressType.powerNode:
  17590. this.ui.powerNode.value = 0;
  17591. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17592. this.ui.powerTxt.text = "";
  17593. if (this.powerNum > 0) {
  17594. xGame.eventMgr.event(BALL_SHOOT);
  17595. xGame.common.d2World.shoot(this.powerNum);
  17596. xGame.common.d2World.d2Gan.shoot();
  17597. xGame.common.d2World.d2HelpLine.shoot();
  17598. this.finishGuide();
  17599. this.ui.powerEft.visible = false;
  17600. this.ui.colorNode.visible = false;
  17601. let ganStr = "";
  17602. if (this.powerNum <= 30) {
  17603. ganStr = "gan_30";
  17604. }
  17605. else if (this.powerNum <= 60) {
  17606. ganStr = "gan_50";
  17607. }
  17608. else {
  17609. ganStr = "gan_80";
  17610. }
  17611. xGame.soundMgr.playSound(ganStr);
  17612. }
  17613. break;
  17614. case PressType.moveNode:
  17615. let rootBall = xGame.common.d2World.rootBall;
  17616. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17617. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17618. let isIntersect = this.judgeBallIntersect();
  17619. if (isIntersect) {
  17620. this.ui.moveNode.x = lastX;
  17621. this.ui.moveNode.y = lastY;
  17622. rootBall.gameObj.x = lastX;
  17623. rootBall.gameObj.y = lastY;
  17624. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17625. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17626. }
  17627. else {
  17628. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17629. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17630. }
  17631. this.showBallUI();
  17632. this.ui.moveNode.finger.visible = true;
  17633. xGame.common.d2World.getHelpLine();
  17634. break;
  17635. case PressType.rulerNode:
  17636. break;
  17637. case PressType.d2Root:
  17638. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17639. if (dis <= 25) {
  17640. this.moveToClickDot(e);
  17641. }
  17642. break;
  17643. default:
  17644. break;
  17645. }
  17646. this.pressTarget = -1;
  17647. }
  17648. checkGuide() {
  17649. let guide = DataMgr.getSkillGuide();
  17650. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17651. xGame.common.guideStep++;
  17652. xGame.common.gameUI.ui.guide2.visible = false;
  17653. xGame.common.gameUI.ui.guide3.visible = true;
  17654. }
  17655. }
  17656. finishGuide() {
  17657. let guide = DataMgr.getSkillGuide();
  17658. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17659. xGame.common.guideStep = 10;
  17660. this.closeAllGuide();
  17661. }
  17662. }
  17663. closeAllGuide() {
  17664. xGame.common.gameUI.ui.guide1.visible = false;
  17665. xGame.common.gameUI.ui.guide2.visible = false;
  17666. xGame.common.gameUI.ui.guide3.visible = false;
  17667. }
  17668. updateBarInfo() {
  17669. let star = this.ui.powerNode.y;
  17670. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17671. if (rate >= 1)
  17672. rate = 1;
  17673. if (rate <= 0)
  17674. rate = 0;
  17675. this.powerNum = Math.ceil(rate * 100);
  17676. this.ui.powerNode.value = this.powerNum;
  17677. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17678. this.ui.colorNode.value = this.powerNum;
  17679. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17680. this.ui.powerEft.visible = this.powerNum != 0;
  17681. this.ui.colorNode.visible = this.powerNum != 0;
  17682. this.ui.powerTxt.text = this.powerNum + "";
  17683. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17684. }
  17685. forceCancel() {
  17686. this.ui.powerNode.value = 0;
  17687. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17688. this.ui.powerTxt.text = "";
  17689. }
  17690. checkRodMoveDir() {
  17691. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17692. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17693. if (tempX >= 0 && tempY <= 0) {
  17694. return this.checkDir();
  17695. }
  17696. else if (tempX < 0 && tempY < 0) {
  17697. return this.checkDir(1, -1);
  17698. }
  17699. else if (tempX < 0 && tempY > 0) {
  17700. return this.checkDir(-1, -1);
  17701. }
  17702. else {
  17703. return this.checkDir(-1, 1);
  17704. }
  17705. }
  17706. checkDir(flagX = 1, flagY = 1) {
  17707. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17708. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17709. if (offsetY == 0) {
  17710. return offsetX * flagX;
  17711. }
  17712. if (offsetX == 0) {
  17713. return offsetY * flagY;
  17714. }
  17715. let angle = offsetY / offsetX;
  17716. if (Math.abs(angle) >= 1) {
  17717. return offsetY * flagY;
  17718. }
  17719. else {
  17720. return offsetX * flagX;
  17721. }
  17722. }
  17723. judgeBallIntersect() {
  17724. let rootBall = xGame.common.d2World.rootBall;
  17725. let ballArr = xGame.common.d2World.ballArr;
  17726. let radius = rootBall.gameObj.width / 2;
  17727. let temp;
  17728. let isIntersect = false;
  17729. for (let index = 0; index < ballArr.length; index++) {
  17730. temp = ballArr[index];
  17731. if (temp.number == rootBall.number)
  17732. continue;
  17733. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17734. if (isIntersect) {
  17735. break;
  17736. }
  17737. }
  17738. return isIntersect;
  17739. }
  17740. hideBallUI() {
  17741. let d2Gan = xGame.common.d2World.d2Gan;
  17742. if (!d2Gan.ui.isDisposed)
  17743. d2Gan.ui.visible = false;
  17744. let d2Help = xGame.common.d2World.d2HelpLine;
  17745. if (!d2Help.ui.isDisposed)
  17746. d2Help.ui.visible = false;
  17747. let rootBall = xGame.common.d2World.rootBall;
  17748. if (!rootBall.destroyed) {
  17749. rootBall.gameObj.active = false;
  17750. }
  17751. }
  17752. showBallUI() {
  17753. let d2Gan = xGame.common.d2World.d2Gan;
  17754. if (!d2Gan.ui.isDisposed)
  17755. d2Gan.ui.visible = true;
  17756. let d2Help = xGame.common.d2World.d2HelpLine;
  17757. if (!d2Help.ui.isDisposed)
  17758. d2Help.ui.visible = true;
  17759. let rootBall = xGame.common.d2World.rootBall;
  17760. if (!rootBall.destroyed) {
  17761. rootBall.gameObj.active = true;
  17762. }
  17763. }
  17764. moveToClickDot(e) {
  17765. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17766. let root = xGame.common.d2World.rootBall.gameObj;
  17767. let xx = e.stageX - xGame.common.sysOffestNum;
  17768. let yy = e.stageY;
  17769. let x = xx - root.x;
  17770. let y = yy - root.y;
  17771. let angle = xGame.common.getfguiRotation(x, y);
  17772. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17773. xGame.common.d2World.getHelpLine();
  17774. }
  17775. this.isMoveRod = false;
  17776. xGame.common.clickedBall = false;
  17777. }
  17778. openAllEvent() {
  17779. this.closeAllEvent();
  17780. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17781. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17782. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17783. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17784. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17785. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17786. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17787. }
  17788. closeAllEvent() {
  17789. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17790. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17791. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17792. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17793. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17794. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17795. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17796. }
  17797. resetGame() {
  17798. this.closeAllEvent();
  17799. this.hideBallUI();
  17800. xGame.common.gameMgr.gamePause = true;
  17801. }
  17802. }
  17803. UIGame$1.uiName = "UIGame";
  17804. class UIAddCoin$1 extends UIBase {
  17805. constructor() {
  17806. super();
  17807. this.coinNum = 2000;
  17808. }
  17809. onConstructor() {
  17810. this.ui = ui_UIAddCoin.createInstance();
  17811. this.contentPane = this.ui;
  17812. this.isEject = false;
  17813. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17814. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17815. }
  17816. show() {
  17817. super.show();
  17818. this.ui.t0.play();
  17819. }
  17820. videoAddCoin() {
  17821. Moyu.showVideoAd(() => {
  17822. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17823. this.hide();
  17824. }, EAdType.addFailCoin);
  17825. }
  17826. }
  17827. UIAddCoin$1.uiName = "UIAddCoin";
  17828. class UIInvitation$1 extends UIBase {
  17829. constructor() {
  17830. super();
  17831. }
  17832. onConstructor() {
  17833. this.ui = ui_UIInvitation.createInstance();
  17834. this.contentPane = this.ui;
  17835. this.isEject = false;
  17836. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17837. }
  17838. show() {
  17839. super.show();
  17840. }
  17841. enterGame() {
  17842. xGame.common.gameMode = GameMode.classic;
  17843. DataMgr.setChallengeTimes(1);
  17844. xGame.common.passAwardCoin = 2000;
  17845. let need = xGame.common.classicNiceNeddCoin;
  17846. if (DataMgr.coinEnough(need)) {
  17847. DataMgr.setCoin(-need);
  17848. xGame.eventMgr.event(RESTART_GAME, true);
  17849. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17850. }
  17851. else {
  17852. xGame.eventMgr.event(RESTART_GAME, true);
  17853. }
  17854. this.hide();
  17855. }
  17856. hide() {
  17857. super.hide();
  17858. }
  17859. }
  17860. UIInvitation$1.uiName = "UIInvitation";
  17861. class UIPower$1 extends UIBase {
  17862. constructor() {
  17863. super();
  17864. }
  17865. onConstructor() {
  17866. this.ui = ui_UIPower.createInstance();
  17867. this.contentPane = this.ui;
  17868. this.isEject = false;
  17869. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17870. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17871. }
  17872. show() {
  17873. super.show();
  17874. this.ui.t0.play();
  17875. }
  17876. videoGetPower() {
  17877. Moyu.showVideoAd(() => {
  17878. DataMgr.setPower(xGame.common.videoPower, true);
  17879. xGame.eventMgr.event(POWER_TIME);
  17880. this.hide();
  17881. }, EAdType.getPower);
  17882. }
  17883. }
  17884. UIPower$1.uiName = "UIPower";
  17885. class UIGameEnd$1 extends UIBase {
  17886. constructor() {
  17887. super();
  17888. this.success = false;
  17889. this.awardCoinNum = 1000;
  17890. this.awardDiamondNum = 10;
  17891. }
  17892. onConstructor() {
  17893. this.ui = ui_UIGameEnd.createInstance();
  17894. this.contentPane = this.ui;
  17895. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17896. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17897. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17898. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17899. this.ui.talkNode.visible = false;
  17900. if (Moyu.isKs)
  17901. this.ui.closeNode.closeBtn.x += 100;
  17902. }
  17903. updateType() {
  17904. switch (xGame.common.gameMode) {
  17905. case GameMode.classic:
  17906. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17907. this.ui.coinNode.visible = this.success;
  17908. if (!this.success) {
  17909. Laya.timer.once(500, this, () => {
  17910. xGame.uiMgr.Show(UIAddCoin$1);
  17911. });
  17912. }
  17913. this.ui.isGetAward.visible = false;
  17914. this.ui.leftBtn.c1.selectedIndex = 3;
  17915. this.ui.rightBtn.c1.selectedIndex = 0;
  17916. this.moneyNode.ui.c1.selectedIndex = 1;
  17917. break;
  17918. case GameMode.bigMove:
  17919. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17920. this.ui.coinNode.visible = this.success;
  17921. if (xGame.common.gameMode == GameMode.bigMove) {
  17922. if (this.success) {
  17923. DataMgr.setSkillSuccessTimes(1, true);
  17924. DataMgr.setSkillAccTimes(1);
  17925. }
  17926. else {
  17927. DataMgr.setSkillSuccessTimes(0, false);
  17928. }
  17929. }
  17930. if (!this.success) {
  17931. Laya.timer.once(500, this, () => {
  17932. xGame.uiMgr.Show(UIAddCoin$1);
  17933. });
  17934. }
  17935. this.ui.isGetAward.visible = false;
  17936. this.ui.leftBtn.c1.selectedIndex = 3;
  17937. this.ui.rightBtn.c1.selectedIndex = 0;
  17938. this.moneyNode.ui.c1.selectedIndex = 1;
  17939. break;
  17940. case GameMode.placeBall:
  17941. this.ui.coinNode.visible = false;
  17942. if (this.success) {
  17943. if (xGame.common.placeBallStarNum == 3) {
  17944. this.ui.c1.selectedIndex = 2;
  17945. }
  17946. else {
  17947. this.ui.c1.selectedIndex = 3;
  17948. }
  17949. }
  17950. else {
  17951. this.ui.c1.selectedIndex = 4;
  17952. }
  17953. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17954. if (cfg.type == PlaceBallType.challenge) {
  17955. this.ui.c1.selectedIndex = 2;
  17956. }
  17957. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  17958. this.updatePlaceBallBtn();
  17959. this.updatePlaceBallStarNum();
  17960. this.updatePlaceBallAwardState();
  17961. this.moneyNode.ui.c1.selectedIndex = 2;
  17962. this.moneyNode.checkPowerTime();
  17963. this.moneyNode.powerChange();
  17964. DataMgr.upRankData();
  17965. break;
  17966. default:
  17967. break;
  17968. }
  17969. }
  17970. updatePlaceBallBtn() {
  17971. this.ui.leftBtn.c1.selectedIndex = 5;
  17972. if (this.success) {
  17973. this.ui.rightBtn.c1.selectedIndex = 14;
  17974. }
  17975. else {
  17976. if (xGame.common.placeBallStarNum == 3) {
  17977. this.ui.rightBtn.c1.selectedIndex = 14;
  17978. }
  17979. else {
  17980. this.ui.rightBtn.c1.selectedIndex = 1;
  17981. }
  17982. }
  17983. }
  17984. updatePlaceBallStarNum() {
  17985. let starNum = xGame.common.placeBallStarNum;
  17986. if (starNum == 0)
  17987. this.ui.starNumNode.c1.selectedIndex = 3;
  17988. else {
  17989. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  17990. }
  17991. }
  17992. updatePlaceBallAwardState() {
  17993. let level = xGame.common.placeBallCurLevel;
  17994. let starNum = xGame.common.placeBallStarNum;
  17995. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  17996. let data = cfgTable.placeballData[level].award;
  17997. let cfg = cfgTable.placeballData[level];
  17998. this.awardDiamondNum = data[1];
  17999. this.awardCoinNum = data[0];
  18000. if (cfg.type == PlaceBallType.challenge) {
  18001. this.awardDiamondNum = 0;
  18002. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18003. }
  18004. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18005. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18006. if (cfg.type == PlaceBallType.challenge) {
  18007. this.ui.awardNode.coinNode.visible = true;
  18008. }
  18009. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18010. this.ui.awardNode.diamondNode.x = 265;
  18011. this.ui.awardNode.coinNode.x = 354;
  18012. }
  18013. else {
  18014. this.ui.awardNode.diamondNode.x = 291;
  18015. this.ui.awardNode.coinNode.x = 291;
  18016. }
  18017. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18018. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18019. if (this.awardCoinNum == 0) {
  18020. this.ui.awardNode.coinNode.numTxt.text = "";
  18021. }
  18022. if (getAward) {
  18023. this.ui.isGetAward.visible = true;
  18024. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18025. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18026. }
  18027. else {
  18028. this.ui.isGetAward.visible = false;
  18029. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18030. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18031. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18032. }
  18033. else {
  18034. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18035. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18036. }
  18037. }
  18038. }
  18039. show(success) {
  18040. super.show();
  18041. xGame.eventMgr.event(RESET_GAME);
  18042. this.success = success;
  18043. Laya.timer.clearAll(this);
  18044. this.playSecretaryAni();
  18045. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18046. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18047. offsetTime = Math.floor(offsetTime / 1000);
  18048. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18049. this.updateType();
  18050. Laya.timer.once(200, this, () => {
  18051. this.addAward(() => {
  18052. this.updateType();
  18053. Laya.timer.once(500, this, () => {
  18054. this.showChallengeLevel();
  18055. });
  18056. });
  18057. });
  18058. if (this.success) {
  18059. xGame.soundMgr.playSound('slots_roll01');
  18060. xGame.soundMgr.playSound("s_win");
  18061. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18062. }
  18063. else {
  18064. xGame.soundMgr.playSound('matchwin01');
  18065. xGame.soundMgr.playSound("s_lose");
  18066. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18067. }
  18068. if (!Moyu.isLegal)
  18069. PlatMgr.showBanner(true);
  18070. let challengeNum = DataMgr.getChallengeTimes();
  18071. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18072. DataMgr.setChallengeTimes(1);
  18073. }
  18074. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18075. DataMgr.setClassicTimes();
  18076. }
  18077. }
  18078. showChallengeLevel() {
  18079. if (DataMgr.getChallengeTimes() != 0)
  18080. return;
  18081. let skill = DataMgr.getSkillAccTimes();
  18082. let put = DataMgr.getPlaceBallLevelList().length;
  18083. if (skill >= 3 || put >= 5) {
  18084. xGame.uiMgr.Show(UIInvitation$1);
  18085. this.hide();
  18086. }
  18087. }
  18088. addAward(callback) {
  18089. if (!this.success) {
  18090. callback && callback();
  18091. return;
  18092. }
  18093. switch (xGame.common.gameMode) {
  18094. case GameMode.classic:
  18095. this.awardCoinNum = xGame.common.passAwardCoin;
  18096. this.awardDiamondNum = 0;
  18097. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18098. break;
  18099. case GameMode.bigMove:
  18100. this.awardCoinNum = xGame.common.passAwardCoin;
  18101. this.awardDiamondNum = 0;
  18102. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18103. callback && callback();
  18104. break;
  18105. case GameMode.placeBall:
  18106. let level = xGame.common.placeBallCurLevel;
  18107. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18108. if (xGame.common.placeBallStarNum != 3) {
  18109. callback && callback();
  18110. return;
  18111. }
  18112. else {
  18113. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18114. if (getAward) {
  18115. callback && callback();
  18116. return;
  18117. }
  18118. }
  18119. let cfg = cfgTable.placeballData[level];
  18120. let data = cfgTable.placeballData[level].award;
  18121. this.awardCoinNum = data[0];
  18122. this.awardDiamondNum = data[1];
  18123. if (cfg.type == PlaceBallType.challenge) {
  18124. this.awardDiamondNum = 0;
  18125. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18126. }
  18127. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18128. let diamondAward;
  18129. if (this.awardDiamondNum > 0) {
  18130. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18131. xGame.common.getAward([diamondAward, coinAward], callback);
  18132. }
  18133. else {
  18134. xGame.common.getAward([coinAward], callback);
  18135. }
  18136. if (cfg.type == PlaceBallType.normal) {
  18137. DataMgr.setPlaceBallAward(level);
  18138. }
  18139. break;
  18140. default:
  18141. break;
  18142. }
  18143. }
  18144. playSecretaryAni() {
  18145. let parent = this.ui.secretary.displayObject;
  18146. parent.destroyChildren();
  18147. let xx = this.ui.secretary.width / 2;
  18148. let yy = this.ui.secretary.height;
  18149. let scale = xGame.common.getSecretaryScale();
  18150. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18151. if (this.success) {
  18152. let rand = Math.random() <= 0.5 ? 2 : 3;
  18153. xGame.common.secretary.play(data, rand, false, parent, () => {
  18154. xGame.common.secretary.play(data, 1, true, parent);
  18155. });
  18156. }
  18157. else {
  18158. xGame.common.secretary.play(data, 0, true, parent);
  18159. }
  18160. }
  18161. restartGame() {
  18162. switch (xGame.common.gameMode) {
  18163. case GameMode.classic:
  18164. xGame.eventMgr.event(RESTART_GAME);
  18165. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18166. break;
  18167. case GameMode.bigMove:
  18168. this.hide();
  18169. xGame.eventMgr.event(RESTART_GAME);
  18170. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18171. break;
  18172. default:
  18173. break;
  18174. }
  18175. }
  18176. hide() {
  18177. super.hide();
  18178. xGame.common.stopGirlPop(this.ui.talkNode);
  18179. PlatMgr.showBanner(false);
  18180. }
  18181. returnHome() {
  18182. this.hide();
  18183. let showFailWords = !this.success;
  18184. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18185. }
  18186. clickLeftBtn() {
  18187. switch (xGame.common.gameMode) {
  18188. case GameMode.classic:
  18189. case GameMode.bigMove:
  18190. this.returnHome();
  18191. break;
  18192. case GameMode.placeBall:
  18193. let level = xGame.common.placeBallCurLevel;
  18194. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18195. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18196. break;
  18197. default:
  18198. break;
  18199. }
  18200. }
  18201. powerStartPlaceBallLevel(level, btn) {
  18202. if (DataMgr.powerEnough()) {
  18203. btn.touchable = false;
  18204. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18205. btn.touchable = true;
  18206. DataMgr.setPower(-1);
  18207. xGame.eventMgr.event(POWER_TIME);
  18208. this.startPlaceBallLevel(level);
  18209. }));
  18210. }
  18211. else {
  18212. xGame.uiMgr.Show(UIPower$1, 0);
  18213. }
  18214. }
  18215. clickRightBtn() {
  18216. switch (xGame.common.gameMode) {
  18217. case GameMode.classic:
  18218. console.log('zh:clickRightBtn 111');
  18219. case GameMode.bigMove:
  18220. console.log('zh:clickRightBtn 222');
  18221. this.restartGame();
  18222. break;
  18223. case GameMode.placeBall:
  18224. console.log('zh:clickRightBtn 333');
  18225. let level = xGame.common.placeBallCurLevel;
  18226. let data = DataMgr.getPlaceBallLevel(level);
  18227. let curPss = data.play && !data.isCur;
  18228. if (curPss) {
  18229. console.log('zh:clickRightBtn 333-111');
  18230. console.log('zh:当前LV=' + level);
  18231. if (level == 60) {
  18232. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18233. Laya.timer.once(3000, this, () => {
  18234. this.returnHome();
  18235. });
  18236. }
  18237. else {
  18238. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18239. }
  18240. }
  18241. else {
  18242. console.log('zh:clickRightBtn 333-000');
  18243. Moyu.sendDataEvent("placeBallNextLevel");
  18244. Moyu.showVideoAd(() => {
  18245. DataMgr.setPlaceBallLevel(level, 1);
  18246. this.startPlaceBallLevel(level + 1);
  18247. }, xGame.define.EAdType.placeBallNextLevel);
  18248. }
  18249. break;
  18250. default:
  18251. console.log('zh:clickRightBtn 444');
  18252. break;
  18253. }
  18254. }
  18255. startPlaceBallLevel(level) {
  18256. xGame.common.gameMode = GameMode.placeBall;
  18257. xGame.common.placeBallCurLevel = level;
  18258. xGame.uiMgr.Show(UIGame$1);
  18259. this.hide();
  18260. }
  18261. }
  18262. UIGameEnd$1.uiName = "UIGameEnd";
  18263. class ShowItem$1 {
  18264. constructor() {
  18265. this.ui = ui_ShowItem.createInstance();
  18266. }
  18267. destroySelf() {
  18268. if (!this.ui.isDisposed) {
  18269. this.ui.removeFromParent();
  18270. this.ui.dispose();
  18271. }
  18272. }
  18273. setParent(parent) {
  18274. parent.addChild(this.ui);
  18275. }
  18276. setPos(x, y) {
  18277. this.ui.x = x;
  18278. this.ui.y = y;
  18279. }
  18280. setUrl(index) {
  18281. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18282. }
  18283. }
  18284. class UILevelProp$1 extends UIBase {
  18285. constructor() {
  18286. super();
  18287. this.firstPos = 385;
  18288. this.secondPos = 467;
  18289. this.showItemArr = [];
  18290. }
  18291. onConstructor() {
  18292. this.ui = ui_UILevelProp.createInstance();
  18293. this.contentPane = this.ui;
  18294. this.isEject = false;
  18295. this.addUIClick(this.ui.closeBtn, this.hide);
  18296. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18297. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18298. }
  18299. show(level) {
  18300. super.show();
  18301. this.ui.t1.play();
  18302. this.level = level;
  18303. this.data = cfgTable.placeballData[this.level];
  18304. this.updateSelf();
  18305. this.showPreView();
  18306. this.moneyNode.ui.c1.selectedIndex = 2;
  18307. this.moneyNode.checkPowerTime();
  18308. this.moneyNode.powerChange();
  18309. }
  18310. showPreView() {
  18311. let item;
  18312. let data;
  18313. for (let index = 0; index < this.showItemArr.length; index++) {
  18314. item = this.showItemArr[index];
  18315. item.destroySelf();
  18316. }
  18317. this.showItemArr = [];
  18318. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18319. for (const key in cfgData) {
  18320. data = cfgData[key];
  18321. item = new ShowItem$1();
  18322. item.setParent(this.ui.myNode.displayRoot);
  18323. item.setPos(data.x, data.y);
  18324. item.setUrl(data.value);
  18325. this.showItemArr.push(item);
  18326. }
  18327. }
  18328. updateSelf() {
  18329. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18330. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18331. if (this.data.ball == -1) {
  18332. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18333. }
  18334. else {
  18335. this.ui.myNode.conditionTxt.text = "Reward";
  18336. }
  18337. let localData = DataMgr.getPlaceBallLevel(this.level);
  18338. let getAward = localData.getAward;
  18339. let cfg = cfgTable.placeballData[this.level];
  18340. let coin = this.data.award[0];
  18341. let diamond = this.data.award[1];
  18342. if (cfg.type == PlaceBallType.challenge) {
  18343. diamond = 0;
  18344. coin = 100;
  18345. }
  18346. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18347. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18348. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18349. if (cfg.type == PlaceBallType.challenge) {
  18350. this.ui.myNode.coinNode.numTxt.text = "";
  18351. }
  18352. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18353. if (coin > 0 && diamond > 0) {
  18354. this.ui.myNode.diamondNode.x = 385;
  18355. this.ui.myNode.coinNode.x = 467;
  18356. }
  18357. else {
  18358. this.ui.myNode.diamondNode.x = 385;
  18359. this.ui.myNode.coinNode.x = 385;
  18360. }
  18361. if (!getAward) {
  18362. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18363. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18364. }
  18365. else {
  18366. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18367. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18368. }
  18369. }
  18370. startGame() {
  18371. if (DataMgr.powerEnough()) {
  18372. this.ui.myNode.startBtn.touchable = false;
  18373. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18374. console.log('zh:startGame ');
  18375. this.ui.myNode.startBtn.touchable = true;
  18376. DataMgr.setPower(-1);
  18377. xGame.eventMgr.event(POWER_TIME);
  18378. xGame.common.gameMode = GameMode.placeBall;
  18379. xGame.common.placeBallCurLevel = this.level;
  18380. xGame.uiMgr.Show(UIGame$1);
  18381. xGame.uiMgr.Hide(UILevelDisplay$1);
  18382. xGame.uiMgr.Hide(UIMain$1);
  18383. this.hide();
  18384. }));
  18385. }
  18386. else {
  18387. console.log('zh:startGame no power');
  18388. xGame.uiMgr.Show(UIPower$1);
  18389. }
  18390. }
  18391. hide() {
  18392. super.hide();
  18393. }
  18394. }
  18395. UILevelProp$1.uiName = "UILevelProp";
  18396. class PutBallLevelDisplay$1 {
  18397. constructor(ui, index) {
  18398. this.index = 0;
  18399. this.ui = ui;
  18400. this.index = index;
  18401. this.ui.onClick(this, this.clickSelf);
  18402. this.updateSelf();
  18403. this.ui.levelTxt.text = (this.index + 1) + "";
  18404. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18405. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18406. }
  18407. updateSelf() {
  18408. let level = this.index + 1;
  18409. this.data = DataMgr.getPlaceBallLevel(level);
  18410. this.ui.starNode.c1.selectedIndex = this.data.star;
  18411. let isChallenge = cfgTable.placeballData[level].type;
  18412. if (this.data.isCur) {
  18413. if (isChallenge) {
  18414. this.ui.c1.selectedIndex = 5;
  18415. }
  18416. else {
  18417. this.ui.c1.selectedIndex = 2;
  18418. }
  18419. }
  18420. else {
  18421. if (this.data.play) {
  18422. if (this.data.star == 3) {
  18423. this.ui.c1.selectedIndex = 0;
  18424. }
  18425. else {
  18426. this.ui.c1.selectedIndex = 1;
  18427. }
  18428. }
  18429. else {
  18430. if (isChallenge) {
  18431. this.ui.c1.selectedIndex = 4;
  18432. }
  18433. else {
  18434. this.ui.c1.selectedIndex = 3;
  18435. }
  18436. }
  18437. }
  18438. }
  18439. clickSelf() {
  18440. if (!this.data.play)
  18441. return;
  18442. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18443. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18444. }
  18445. }
  18446. class UILevelDisplay$1 extends UIBase {
  18447. constructor() {
  18448. super();
  18449. }
  18450. onConstructor() {
  18451. this.ui = ui_UILevelDisplay.createInstance();
  18452. this.contentPane = this.ui;
  18453. this.isEject = false;
  18454. this.myList = this.ui.myNode.myList;
  18455. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18456. this.levelItemArr = [];
  18457. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18458. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18459. this.myList.numItems = levelNum;
  18460. if (Moyu.isKs)
  18461. this.ui.closeNode.closeBtn.x += 100;
  18462. }
  18463. levelItemRender(index, target) {
  18464. let item = new PutBallLevelDisplay$1(target, index);
  18465. this.levelItemArr.push(item);
  18466. }
  18467. show() {
  18468. super.show();
  18469. this.updateLevel();
  18470. this.scrollToPlace();
  18471. }
  18472. updateLevel() {
  18473. let temp;
  18474. for (let index = 0; index < this.levelItemArr.length; index++) {
  18475. temp = this.levelItemArr[index];
  18476. temp.updateSelf();
  18477. }
  18478. }
  18479. scrollToPlace() {
  18480. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18481. let passArr = DataMgr.getPlaceBallLevelList();
  18482. let offest = passArr.length;
  18483. if (offest >= maxNum - 1)
  18484. offest = maxNum - 1;
  18485. this.myList.scrollToView(offest, true, true);
  18486. }
  18487. hide() {
  18488. super.hide();
  18489. }
  18490. }
  18491. UILevelDisplay$1.uiName = "UILevelDisplay";
  18492. class UIMatching$1 extends UIBase {
  18493. constructor() {
  18494. super();
  18495. }
  18496. onConstructor() {
  18497. this.ui = ui_UIMatching.createInstance();
  18498. this.contentPane = this.ui;
  18499. this.isEject = false;
  18500. }
  18501. show(callback) {
  18502. super.show();
  18503. PlatMgr.showBanner(true);
  18504. this.callback = callback;
  18505. let user = Moyu.getUserInfo();
  18506. if (!this.selfPot) {
  18507. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18508. }
  18509. if (!this.aiPot) {
  18510. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18511. }
  18512. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18513. this.ui.selfHead.nameTxt.text = user.nickName;
  18514. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18515. this.ui.aiHead.nameTxt.text = "???";
  18516. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18517. this.ui.selfHead.c1.selectedIndex = 0;
  18518. this.ui.aiHead.c1.selectedIndex = 0;
  18519. this.ui.selfHead.x = this.selfPot.x;
  18520. this.ui.selfHead.y = this.selfPot.y;
  18521. this.ui.aiHead.x = this.aiPot.x;
  18522. this.ui.aiHead.y = this.aiPot.y;
  18523. switch (xGame.common.gameMode) {
  18524. case GameMode.classic:
  18525. break;
  18526. case GameMode.bigMove:
  18527. this.initSkillData();
  18528. break;
  18529. default:
  18530. break;
  18531. }
  18532. this.ui.t1.play(Laya.Handler.create(this, () => {
  18533. this.ui.t2.play(Laya.Handler.create(this, () => {
  18534. switch (xGame.common.gameMode) {
  18535. case GameMode.classic:
  18536. this.waitingPeople();
  18537. break;
  18538. case GameMode.bigMove:
  18539. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18540. break;
  18541. default:
  18542. break;
  18543. }
  18544. }));
  18545. }));
  18546. }
  18547. initSkillData() {
  18548. this.skillSelectData = [];
  18549. let skillUrl = xGame.common.skillIconList;
  18550. let skillName = xGame.common.skillNameList;
  18551. let skillLevel = DataMgr.getBigSkillList();
  18552. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18553. for (let index = 0; index < 5; index++) {
  18554. let obj = {};
  18555. obj.skillImg = skillUrl[index];
  18556. obj.skillName = skillName[index];
  18557. obj.skillType = skillType[index];
  18558. obj.skillLevel = skillLevel[index];
  18559. this.skillSelectData.push(obj);
  18560. }
  18561. }
  18562. getAISkillLevel(myLevel) {
  18563. let video = xGame.common.upSkillLevel;
  18564. let aiLevel;
  18565. let temp;
  18566. if (video) {
  18567. temp = xGame.common.randomNum(-2, -1);
  18568. }
  18569. else {
  18570. if (myLevel <= 5) {
  18571. temp = xGame.common.randomNum(1, 3);
  18572. }
  18573. else if (myLevel <= 9) {
  18574. temp = xGame.common.randomNum(-2, 1);
  18575. }
  18576. else {
  18577. temp = xGame.common.randomNum(-4, 0);
  18578. }
  18579. }
  18580. aiLevel = temp + myLevel;
  18581. if (aiLevel <= 1)
  18582. aiLevel = 1;
  18583. if (aiLevel >= 10)
  18584. aiLevel = 10;
  18585. return aiLevel;
  18586. }
  18587. getAISkillType() {
  18588. return xGame.common.randomNum(1, 4);
  18589. let successTimes = DataMgr.getSkillSuccessTimes();
  18590. let info = cfgTable.aiskillData[successTimes];
  18591. if (!info) {
  18592. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18593. info = cfgTable.aiskillData[max];
  18594. }
  18595. let dataArr = info.skillselect;
  18596. let myCfg = {};
  18597. for (let index = 0; index < dataArr.length; index++) {
  18598. let temp = dataArr[index].split('-');
  18599. myCfg[temp[0]] = {};
  18600. myCfg[temp[0]].id = parseInt(temp[0]);
  18601. myCfg[temp[0]].weight = parseInt(temp[1]);
  18602. }
  18603. let aiCfg = xGame.common.initWeight(myCfg);
  18604. let curData = xGame.common.getRandomWeightData(aiCfg);
  18605. return parseInt(curData.id);
  18606. }
  18607. getAISkillData(index) {
  18608. let myLevel = this.skillSelectData[index].skillLevel;
  18609. let aiLevel = this.getAISkillLevel(myLevel);
  18610. let aiType = this.getAISkillType() - 1;
  18611. return { aiLevel, aiType } = { aiLevel, aiType };
  18612. }
  18613. skillSelectFinish(index) {
  18614. let aiInfo = this.getAISkillData(index);
  18615. xGame.common.gameMgr.selfCurSkill = index;
  18616. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18617. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18618. this.ui.selfHead.c1.selectedIndex = 1;
  18619. this.ui.aiHead.c1.selectedIndex = 1;
  18620. let myData = this.skillSelectData[index];
  18621. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18622. let guide = DataMgr.getSkillGuide();
  18623. if (guide == 0) {
  18624. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18625. }
  18626. else {
  18627. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18628. }
  18629. let aiData = this.skillSelectData[aiInfo.aiType];
  18630. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18631. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18632. this.waitingPeople();
  18633. }
  18634. waitingPeople() {
  18635. let time = xGame.common.randomNum(1000, 3000);
  18636. time += 1000;
  18637. Laya.timer.once(time, this, () => {
  18638. this.matchingSuccess();
  18639. });
  18640. }
  18641. matchingSuccess() {
  18642. let gameUI = xGame.common.gameUI;
  18643. let name = gameUI.ui.topNode.aiNameTxt.text;
  18644. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18645. this.ui.aiHead.nameTxt.text = name;
  18646. this.ui.aiHead.headImg.url = url;
  18647. name = gameUI.ui.topNode.selfNameTxt.text;
  18648. url = gameUI.ui.topNode.selfHeadLoader.url;
  18649. this.ui.selfHead.nameTxt.text = name;
  18650. this.ui.selfHead.headImg.url = url;
  18651. this.ui.t3.play(Laya.Handler.create(this, () => {
  18652. this.callback && this.callback();
  18653. this.ui.t4.play(Laya.Handler.create(this, () => {
  18654. this.destroySelf();
  18655. }));
  18656. }));
  18657. }
  18658. destroySelf() {
  18659. this.callback = null;
  18660. this.skillSelectData = null;
  18661. this.selfPot = null;
  18662. this.aiPot = null;
  18663. if (!this.ui.isDisposed) {
  18664. this.ui.removeFromParent();
  18665. this.ui.dispose();
  18666. }
  18667. xGame.uiMgr.destroyUI(this);
  18668. }
  18669. }
  18670. UIMatching$1.uiName = "UIMatching";
  18671. class SkillDisplay$1 {
  18672. constructor(ui, data, uiIndex) {
  18673. this.starX = 0;
  18674. this.starY = 0;
  18675. this.index = 0;
  18676. this.ui = ui;
  18677. this.data = data;
  18678. this.index = uiIndex;
  18679. this.initSelf();
  18680. console.log('zh:SkillDisplay constructor this.skillData=', data);
  18681. }
  18682. initSelf() {
  18683. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18684. this.ui.nameTxt.text = this.data.name;
  18685. this.ui.describeTxt.text = this.data.describe;
  18686. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18687. this.ui.startBtn.onClick(this, this.startGame);
  18688. this.updateSelf();
  18689. }
  18690. updateSelf() {
  18691. this.checkTry();
  18692. let level = DataMgr.getBigSkillByIndex(this.index);
  18693. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18694. }
  18695. checkTry() {
  18696. let index = this.index;
  18697. let level = DataMgr.getBigSkillByIndex(index);
  18698. if (level == null) {
  18699. DataMgr.setBigSkill(index, 1, false);
  18700. level = 1;
  18701. }
  18702. this.ui.levelTxt.text = "LV." + level;
  18703. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18704. this.ui.tryNode.visible = true;
  18705. else
  18706. this.ui.tryNode.visible = false;
  18707. }
  18708. clickAddLevel() {
  18709. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18710. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18711. Moyu.showVideoAd(() => {
  18712. DataMgr.setBigSkill(this.data.index, 1);
  18713. this.updateSelf();
  18714. xGame.common.upSkillLevel = true;
  18715. }, EAdType.upSkill);
  18716. }
  18717. startGame() {
  18718. if (this.data.index == 3) {
  18719. alert('Coming soon!');
  18720. return;
  18721. }
  18722. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18723. let needCoin = xGame.common.bigMoveNeedCoin;
  18724. xGame.common.passAwardCoin = 2000;
  18725. let guide = DataMgr.getSkillGuide();
  18726. console.log('zh:startGame guide=' + guide);
  18727. xGame.common.temSelfLevel = 0;
  18728. if (guide == 0) {
  18729. needCoin = 0;
  18730. xGame.common.temSelfLevel = 100;
  18731. }
  18732. if (DataMgr.coinEnough(needCoin)) {
  18733. DataMgr.setCoin(-needCoin);
  18734. xGame.common.curPlayerSkillType = this.index;
  18735. if (guide == 0)
  18736. xGame.common.curPlayerSkillType = 0;
  18737. xGame.uiMgr.Show(UIGame$1);
  18738. xGame.uiMgr.Hide(UIMain$1);
  18739. xGame.uiMgr.Show(UIMatching$1, () => {
  18740. xGame.common.gameUI.ui.alpha = 1;
  18741. xGame.common.gameUI.startGame();
  18742. xGame.uiMgr.Hide(UISkill$1);
  18743. });
  18744. }
  18745. else {
  18746. xGame.uiMgr.Show(UIAddProp$1, 0);
  18747. Moyu.sendDataEvent("AddCoinVideo");
  18748. }
  18749. }
  18750. }
  18751. class UISkill$1 extends UIBase {
  18752. constructor() {
  18753. super();
  18754. this.skillData = [];
  18755. }
  18756. onConstructor() {
  18757. this.ui = ui_UISkill.createInstance();
  18758. this.contentPane = this.ui;
  18759. this.isEject = false;
  18760. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18761. this.initSkillData();
  18762. console.log('zh:aaaaaa1111111111');
  18763. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18764. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18765. console.log('zh:aaaaaa22222222');
  18766. this.displayList = [];
  18767. this.ui.skillNode.skillList.numItems = 3;
  18768. this.addUIClick(this.ui, this.interuptSecretary);
  18769. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18770. this.ui.talkNode.visible = false;
  18771. if (Moyu.isKs)
  18772. this.ui.closeNode.closeBtn.x += 100;
  18773. }
  18774. show() {
  18775. super.show();
  18776. this.playSecretaryIdle();
  18777. this.moneyNode.ui.c1.selectedIndex = 1;
  18778. Laya.timer.clearAll(this);
  18779. xGame.soundMgr.playSound("s_start");
  18780. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18781. let guide = DataMgr.getSkillGuide();
  18782. this.ui.guideNode.visible = guide == 0;
  18783. let item = this.getSkillItemByUIIndex(0);
  18784. if (guide == 0) {
  18785. item.ui.c1.selectedIndex = 1;
  18786. }
  18787. else {
  18788. item.ui.c1.selectedIndex = 0;
  18789. }
  18790. this.ui.guideNode.guideBtn.visible = guide == 0;
  18791. for (let index = 0; index < this.displayList.length; index++) {
  18792. this.displayList[index].checkTry();
  18793. }
  18794. }
  18795. getSkillItemByUIIndex(cur) {
  18796. for (let index = 0; index < this.displayList.length; index++) {
  18797. if (this.displayList[index].index == cur) {
  18798. return this.displayList[index];
  18799. }
  18800. }
  18801. }
  18802. enterGuideLevel() {
  18803. let item = this.getSkillItemByUIIndex(0);
  18804. item.startGame();
  18805. if (DataMgr.getNewUser())
  18806. Moyu.sendDataEvent("gameStart1");
  18807. }
  18808. initSkillData() {
  18809. this.skillData = [];
  18810. let nameList = xGame.common.skillNameList;
  18811. let iconList = xGame.common.skillIconList;
  18812. let describeList = [
  18813. "Jump shot executed — ball bounced and pocketed an extra one!",
  18814. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  18815. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  18816. ];
  18817. console.log('zh:initSkillData 111111111');
  18818. let data;
  18819. for (let index = 0; index < nameList.length; index++) {
  18820. data = {};
  18821. data.name = nameList[index];
  18822. data.icon = iconList[index];
  18823. data.describe = describeList[index];
  18824. data.index = index;
  18825. this.skillData.push(data);
  18826. }
  18827. }
  18828. updateSkillItem(index, target) {
  18829. if (this.displayList[index] == null) {
  18830. let uiIndex;
  18831. switch (index) {
  18832. case 0:
  18833. uiIndex = 1;
  18834. break;
  18835. case 1:
  18836. uiIndex = 0;
  18837. break;
  18838. case 2:
  18839. uiIndex = 2;
  18840. break;
  18841. case 3:
  18842. uiIndex = 3;
  18843. break;
  18844. default:
  18845. break;
  18846. }
  18847. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18848. this.displayList.push(temp);
  18849. }
  18850. }
  18851. playSecretaryIdle() {
  18852. let parent = this.ui.secretary.displayObject;
  18853. parent.destroyChildren();
  18854. let xx = this.ui.secretary.width / 2;
  18855. let yy = this.ui.secretary.height;
  18856. let scale = xGame.common.getSecretaryScale();
  18857. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18858. xGame.common.secretary.play(data, 1, true, parent);
  18859. }
  18860. returnUIMain() {
  18861. this.hide();
  18862. xGame.common.stopGirlPop(this.ui.talkNode);
  18863. xGame.uiMgr.Show(UIMain$1);
  18864. }
  18865. interuptSecretary() {
  18866. Laya.timer.clearAll(this);
  18867. this.playSecretaryRandomSound();
  18868. }
  18869. playSecretaryRandomSound() {
  18870. if (this.isHide)
  18871. return;
  18872. let time = xGame.common.randomNum(45000, 60000);
  18873. Laya.timer.once(time, this, () => {
  18874. if (this.isHide)
  18875. return;
  18876. let index = xGame.common.randomNum(4, 7);
  18877. xGame.soundMgr.playSound("s_main0" + index);
  18878. let words = 1;
  18879. switch (index) {
  18880. case 4:
  18881. words = 5;
  18882. break;
  18883. case 5:
  18884. words = 3;
  18885. break;
  18886. case 6:
  18887. words = 6;
  18888. break;
  18889. case 7:
  18890. words = 7;
  18891. break;
  18892. default:
  18893. break;
  18894. }
  18895. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18896. this.playSecretaryRandomSound();
  18897. });
  18898. }
  18899. }
  18900. UISkill$1.uiName = "UISkill";
  18901. class UIAddProp$1 extends UIBase {
  18902. constructor() {
  18903. super();
  18904. this.curType = "";
  18905. }
  18906. onConstructor() {
  18907. this.ui = ui_UIAddProp.createInstance();
  18908. this.contentPane = this.ui;
  18909. this.isEject = false;
  18910. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18911. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18912. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18913. this.updateUI();
  18914. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18915. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18916. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18917. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18918. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18919. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18920. }
  18921. show(type) {
  18922. super.show();
  18923. this.curType = type == 0 ? "coin" : "diamond";
  18924. this.switchBtn("");
  18925. this.ui.t0.play();
  18926. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18927. PlatMgr.showInsert(true);
  18928. }
  18929. closeSelf() {
  18930. this.hide();
  18931. }
  18932. updateUI() {
  18933. let data = cfgTable.moneyData;
  18934. let temp;
  18935. let obj;
  18936. for (const key in data) {
  18937. temp = data[key];
  18938. obj = this.ui.myNode["node" + key];
  18939. if (parseInt(key) <= 2) {
  18940. obj.diamondTxt.text = "+" + temp.num;
  18941. }
  18942. else {
  18943. obj.coinTxt.text = temp.num;
  18944. obj.diamondTxt.text = temp.get.split('_')[1];
  18945. }
  18946. }
  18947. this.updateDiamondShare();
  18948. }
  18949. updateDiamondShare() {
  18950. let data = DataMgr.getShareDiamondTimes();
  18951. if (data >= xGame.common.maxShareDiamondTimes) {
  18952. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  18953. this.ui.myNode.node1.touchable = false;
  18954. }
  18955. else {
  18956. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  18957. this.ui.myNode.node1.touchable = true;
  18958. }
  18959. }
  18960. switchBtn(type) {
  18961. if (type == "")
  18962. type = this.curType;
  18963. else {
  18964. if (this.curType == type) {
  18965. return;
  18966. }
  18967. else {
  18968. this.curType = type;
  18969. }
  18970. }
  18971. if (type == "coin") {
  18972. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  18973. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  18974. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  18975. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  18976. this.ui.myNode.c1.selectedIndex = 0;
  18977. }
  18978. else {
  18979. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  18980. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  18981. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  18982. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  18983. this.ui.myNode.c1.selectedIndex = 1;
  18984. }
  18985. }
  18986. convertCoin(index) {
  18987. let data = cfgTable.moneyData[index];
  18988. let coinNum = data.num;
  18989. let str = data.get.split('_')[1];
  18990. let needDiamond = parseInt(str);
  18991. if (DataMgr.diamondEnough(needDiamond)) {
  18992. DataMgr.setDiamond(-needDiamond);
  18993. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  18994. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  18995. }
  18996. else {
  18997. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  18998. this.switchBtn("diamond");
  18999. }
  19000. }
  19001. videoGetDiamond() {
  19002. let num = cfgTable.moneyData[2].num;
  19003. Moyu.showVideoAd(() => {
  19004. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19005. this.closeSelf();
  19006. }, EAdType.addDiamond);
  19007. }
  19008. videoGetCoin() {
  19009. Moyu.showVideoAd(() => {
  19010. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19011. this.closeSelf();
  19012. }, EAdType.addCoin);
  19013. }
  19014. shareGetDiamond() {
  19015. let times = DataMgr.getShareDiamondTimes();
  19016. if (times >= xGame.common.maxShareDiamondTimes) {
  19017. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19018. }
  19019. else {
  19020. if (Moyu.isTT) {
  19021. let num = cfgTable.moneyData[1].num;
  19022. Moyu.shareVideo = '';
  19023. Moyu.shareGame((success) => {
  19024. if (success) {
  19025. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19026. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19027. DataMgr.setShareDiamondTimes(1);
  19028. this.updateDiamondShare();
  19029. }
  19030. else {
  19031. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19032. }
  19033. });
  19034. }
  19035. else {
  19036. Moyu.showVideoAd(() => {
  19037. let diamond = xGame.common.randomNum(50, 100);
  19038. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19039. DataMgr.setShareDiamondTimes(1);
  19040. this.updateDiamondShare();
  19041. }, EAdType.randomDiamond);
  19042. }
  19043. }
  19044. }
  19045. openPutBallView() {
  19046. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19047. let skill = xGame.uiMgr.getUI(UISkill$1);
  19048. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19049. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19050. if (end && !end.isHide) {
  19051. xGame.uiMgr.Hide(UIGameEnd$1);
  19052. xGame.uiMgr.Show(UIMain$1);
  19053. }
  19054. if (skill && !skill.isHide)
  19055. xGame.uiMgr.Hide(UISkill$1);
  19056. if (uigame && !uigame.isHide)
  19057. xGame.uiMgr.Hide(UIGame$1);
  19058. if (level && !level.isHide) {
  19059. }
  19060. else {
  19061. xGame.uiMgr.Show(UILevelDisplay$1);
  19062. }
  19063. this.closeSelf();
  19064. }
  19065. }
  19066. UIAddProp$1.uiName = "UIAddProp";
  19067. class MoneyNode$1 {
  19068. constructor(ui) {
  19069. this.leftTime = 0;
  19070. this.ui = ui;
  19071. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19072. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19073. this.ui.addPowerBtn.onClick(this, this.addPower);
  19074. this.ui.c1.selectedIndex = 1;
  19075. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19076. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19077. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19078. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19079. this.coinChange();
  19080. this.diamondChange();
  19081. this.powerChange();
  19082. }
  19083. addPower() {
  19084. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19085. xGame.uiMgr.Show(UIPower$1);
  19086. }
  19087. powerChange() {
  19088. let powerNum = DataMgr.getPower();
  19089. this.ui.powerTxt.text = powerNum + "";
  19090. }
  19091. checkPowerTime() {
  19092. let cur = new Date().getTime();
  19093. let last = DataMgr.getPowerTime();
  19094. if (last == 0) {
  19095. last = cur;
  19096. DataMgr.setPowerTime(cur);
  19097. }
  19098. let power = DataMgr.getPower();
  19099. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19100. Laya.timer.clearAll(this);
  19101. if (power >= xGame.common.natureMaxPower) {
  19102. this.ui.powerTimeTxt.text = "";
  19103. DataMgr.setPowerTime(cur);
  19104. return;
  19105. }
  19106. if (power + offset >= xGame.common.natureMaxPower) {
  19107. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19108. this.ui.powerTimeTxt.text = "";
  19109. DataMgr.setPowerTime(cur);
  19110. }
  19111. else {
  19112. if (offset > 0) {
  19113. DataMgr.setPower(offset);
  19114. DataMgr.setPowerTime(cur);
  19115. }
  19116. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19117. this.leftTime = xGame.common.powerRecoverNum - time;
  19118. if (this.leftTime <= 0)
  19119. this.leftTime = 0;
  19120. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19121. Laya.timer.loop(1000, this, this.updatePowerTime);
  19122. }
  19123. }
  19124. updatePowerTime() {
  19125. this.leftTime -= 1;
  19126. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19127. if (this.leftTime <= 0) {
  19128. this.checkPowerTime();
  19129. }
  19130. }
  19131. coinChange() {
  19132. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19133. }
  19134. diamondChange() {
  19135. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19136. }
  19137. addCoin() {
  19138. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19139. Moyu.sendDataEvent("AddCoinBtn");
  19140. xGame.uiMgr.Show(UIAddProp$1, 0);
  19141. }
  19142. addDiamond() {
  19143. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19144. Moyu.sendDataEvent("AddDiamondBtn");
  19145. xGame.uiMgr.Show(UIAddProp$1, 1);
  19146. }
  19147. }
  19148. class SettingNode$1 {
  19149. constructor(ui) {
  19150. this.showSetting = false;
  19151. this.openSound = true;
  19152. this.openShake = true;
  19153. this.ui = ui;
  19154. this.ui.soundBtn.onClick(this, this.switchSound);
  19155. this.ui.shakeBtn.onClick(this, this.switchShake);
  19156. this.ui.xyBtn.onClick(this, this.onXy);
  19157. this.ui.clickNode.onClick(this, this.changeSetting);
  19158. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19159. }
  19160. changeSetting() {
  19161. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19162. this.showSetting = !this.showSetting;
  19163. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19164. }
  19165. switchSound() {
  19166. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19167. this.openSound = !this.openSound;
  19168. Moyu.onSetting(this.openSound, this.openShake);
  19169. xGame.soundMgr.onSetting(this.openSound);
  19170. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19171. }
  19172. switchShake() {
  19173. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19174. this.openShake = !this.openShake;
  19175. Moyu.onSetting(this.openSound, this.openShake);
  19176. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19177. }
  19178. onXy() {
  19179. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19180. MoyuMgr$1.showXy(1);
  19181. }
  19182. }
  19183. class UIDraw$1 extends UIBase {
  19184. constructor() {
  19185. super();
  19186. this.curKey = 0;
  19187. }
  19188. onConstructor() {
  19189. this.ui = ui_UIDraw.createInstance();
  19190. this.contentPane = this.ui;
  19191. this.isEject = false;
  19192. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19193. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19194. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19195. this.initDraw();
  19196. this.initUI();
  19197. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19198. if (Moyu.isKs)
  19199. this.ui.closeNode.closeBtn.x += 100;
  19200. }
  19201. show() {
  19202. super.show();
  19203. this.ui.t0.play();
  19204. this.playSecretaryIdle();
  19205. this.updateDraw();
  19206. this.checkFree();
  19207. if (PlatMgr.bannerDelay > 0) {
  19208. this.ui.closeNode.closeBtn.visible = false;
  19209. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19210. this.ui.closeNode.closeBtn.visible = true;
  19211. });
  19212. }
  19213. PlatMgr.showRateBanner();
  19214. }
  19215. hide() {
  19216. Laya.timer.clearAll(this);
  19217. super.hide();
  19218. }
  19219. checkFree() {
  19220. let isFree = DataMgr.getDailyfreeDrawTimes();
  19221. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19222. }
  19223. initDraw() {
  19224. this.drawObj = [];
  19225. let data = cfgTable.drawData;
  19226. let temp;
  19227. let weight = 0;
  19228. for (const key in data) {
  19229. temp = data[key];
  19230. weight += temp.weight;
  19231. this.drawObj.push(weight);
  19232. }
  19233. this.allWeight = weight;
  19234. }
  19235. initUI() {
  19236. let data = cfgTable.drawData;
  19237. let temp;
  19238. let img;
  19239. let txt;
  19240. for (const key in data) {
  19241. temp = data[key];
  19242. img = this.ui.myNode.rotNode["img" + key];
  19243. txt = this.ui.myNode.rotNode["txt" + key];
  19244. img.url = xGame.common.getGameIconUrl(temp.icon);
  19245. txt.visible = true;
  19246. if (temp.award > 2) {
  19247. img.rotation = 0;
  19248. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19249. }
  19250. else {
  19251. img.rotation = temp.rotation;
  19252. txt.text = temp.num;
  19253. }
  19254. }
  19255. }
  19256. getCurkey() {
  19257. let rand = Math.random() * this.allWeight;
  19258. let temp;
  19259. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19260. temp = this.drawObj[index];
  19261. if (index == 0) {
  19262. if (rand < temp) {
  19263. return index + 1;
  19264. }
  19265. }
  19266. else {
  19267. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19268. return index + 1;
  19269. }
  19270. }
  19271. }
  19272. return 2;
  19273. }
  19274. startDraw() {
  19275. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19276. if (freeTimes > 0) {
  19277. this.beginDraw();
  19278. DataMgr.setDailyfreeDrawTimes(0);
  19279. this.checkFree();
  19280. }
  19281. else {
  19282. Moyu.sendDataEvent("turntable");
  19283. Moyu.showVideoAd(() => {
  19284. this.beginDraw();
  19285. }, EAdType.draw);
  19286. }
  19287. }
  19288. beginDraw() {
  19289. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19290. this.ui.drawBtn.touchable = false;
  19291. this.curKey = this.getCurkey();
  19292. console.log("当前key", this.curKey);
  19293. let cell = 60;
  19294. let lap = 3;
  19295. let angle = cell * (this.curKey - 1) + lap * 360;
  19296. let target = this.ui.myNode.rotNode;
  19297. target.rotation = 0;
  19298. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19299. console.log("旋转完成");
  19300. this.ui.drawBtn.touchable = true;
  19301. this.getAward();
  19302. }));
  19303. }
  19304. getAward() {
  19305. let data = cfgTable.drawData[this.curKey];
  19306. let temp = new AwardType();
  19307. temp.type = data.award;
  19308. temp.num = data.num;
  19309. xGame.common.getAward([temp], () => {
  19310. DataMgr.setDrawTimes(1);
  19311. this.updateDraw();
  19312. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19313. });
  19314. }
  19315. updateDraw() {
  19316. let drawTimes = DataMgr.getDrawTimes();
  19317. let awardTimes = DataMgr.getDrawAwardTimes();
  19318. if (Math.floor(drawTimes / 3) > awardTimes) {
  19319. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19320. this.ui.extraNode.boxBtn.touchable = true;
  19321. this.ui.extraNode.tipsTxt.text = "3/3";
  19322. this.ui.extraNode.barNode.width = 265;
  19323. this.getExtraAward();
  19324. }
  19325. else {
  19326. this.ui.extraNode.boxBtn.t0.stop();
  19327. this.ui.extraNode.boxBtn.touchable = false;
  19328. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19329. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19330. }
  19331. let data = cfgTable.drawData[1];
  19332. if (awardTimes == 0) {
  19333. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19334. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19335. this.ui.myNode.rotNode.img1.rotation = 0;
  19336. }
  19337. else {
  19338. let award = data.nextid;
  19339. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19340. this.ui.myNode.rotNode.txt1.text = award[1];
  19341. this.ui.myNode.rotNode.img1.rotation = 0;
  19342. }
  19343. }
  19344. getExtraAward() {
  19345. let drawTimes = DataMgr.getDrawTimes();
  19346. let awardTimes = DataMgr.getDrawAwardTimes();
  19347. let data = cfgTable.drawData[1];
  19348. let award = new AwardType();
  19349. if (awardTimes == 0) {
  19350. award.num = data.num;
  19351. award.type = data.award;
  19352. xGame.common.getAward([award], () => {
  19353. let all = Math.floor(drawTimes / 3);
  19354. DataMgr.setDrawAwardTimes(all);
  19355. this.updateDraw();
  19356. });
  19357. }
  19358. else {
  19359. award.num = parseInt(data.nextid[1]);
  19360. award.type = parseInt(data.nextid[0]);
  19361. xGame.common.getAward([award], () => {
  19362. let all = Math.floor(drawTimes / 3);
  19363. DataMgr.setDrawAwardTimes(all);
  19364. this.updateDraw();
  19365. });
  19366. }
  19367. }
  19368. closeSelf() {
  19369. this.hide();
  19370. }
  19371. playSecretaryIdle() {
  19372. let parent = this.ui.secretary.displayObject;
  19373. parent.destroyChildren();
  19374. let xx = this.ui.secretary.width / 2;
  19375. let yy = this.ui.secretary.height;
  19376. let scale = xGame.common.getSecretaryScale();
  19377. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19378. xGame.common.secretary.play(data, 1, true, parent);
  19379. }
  19380. }
  19381. UIDraw$1.uiName = "UIDraw";
  19382. class UIRanking$1 extends UIBase {
  19383. constructor() {
  19384. super();
  19385. this.showSelf = true;
  19386. this.rankType = 1;
  19387. this.rankList = [];
  19388. this.myIndex = 0;
  19389. this.myStar = 0;
  19390. }
  19391. onConstructor() {
  19392. this.ui = ui_UIRanking.createInstance();
  19393. this.contentPane = this.ui;
  19394. this.isEject = false;
  19395. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19396. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19397. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19398. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19399. this.ui.myNode.myList.setVirtual();
  19400. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19401. }
  19402. show() {
  19403. super.show();
  19404. this.myIndex = 51;
  19405. Moyu.getRankList({
  19406. rankId: xGame.common.curRankID,
  19407. type: MoyuRankType.total,
  19408. page: 1,
  19409. pageSize: 50,
  19410. }, this, this.updateItemData);
  19411. this.updateSelf();
  19412. let self = Moyu.getUserInfo();
  19413. if (!self.isAuth) {
  19414. Moyu.initUser(this, () => {
  19415. DataMgr.upRankData();
  19416. });
  19417. }
  19418. }
  19419. updateSelfItem() {
  19420. let self = Moyu.getUserInfo();
  19421. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19422. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19423. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19424. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19425. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19426. }
  19427. updateItemData(data) {
  19428. this.myStar = xGame.common.getAllStarNum();
  19429. if (this.rankList.length < 2) {
  19430. this.rankList = data;
  19431. let self = Moyu.getUserInfo();
  19432. for (let i = 0; i < data.length; i++) {
  19433. let data = this.rankList[i];
  19434. if (data.userId == self.userId) {
  19435. this.rankList.splice(i, 1);
  19436. break;
  19437. }
  19438. }
  19439. for (let i = 0; i < data.length; i++) {
  19440. let data = this.rankList[i];
  19441. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19442. this.myIndex = i + 1;
  19443. let user = { headIcon: self.headIcon, nickName: "myself" };
  19444. let ud = { user: user, data: {} };
  19445. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19446. if (Moyu.platType < 11) {
  19447. user.headIcon = self.headIcon;
  19448. user.nickName = self.nickName;
  19449. }
  19450. this.rankList.splice(i, 0, md);
  19451. break;
  19452. }
  19453. }
  19454. }
  19455. this.updateSelfItem();
  19456. this.ui.myNode.myList.numItems = this.rankList.length;
  19457. }
  19458. updateItemUI(index, obj) {
  19459. let data = this.rankList[index];
  19460. let userData = JSON.parse(data.userData).user;
  19461. obj.nameTxt.text = userData.nickName.toString();
  19462. obj.valueTxt.text = data.rankScore;
  19463. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19464. obj.rankTxt.text = index + 1;
  19465. switch (index) {
  19466. case 0:
  19467. this.setImg(obj, 1, 0, 0);
  19468. obj.rankTxt.color = "#FFC047";
  19469. break;
  19470. case 1:
  19471. this.setImg(obj, 0, 1, 0);
  19472. obj.rankTxt.color = "#ACACAC";
  19473. break;
  19474. case 2:
  19475. this.setImg(obj, 0, 0, 1);
  19476. obj.rankTxt.color = "#D09672";
  19477. break;
  19478. default:
  19479. this.setImg(obj, 0, 0, 0);
  19480. obj.rankTxt.color = "#496FAB";
  19481. break;
  19482. }
  19483. }
  19484. setImg(obj, a, b, c) {
  19485. obj.img1.visible = a ? true : false;
  19486. obj.img2.visible = b ? true : false;
  19487. obj.img3.visible = c ? true : false;
  19488. }
  19489. changeList(type) {
  19490. this.rankType = type;
  19491. this.updateSelf();
  19492. }
  19493. changeSelfNode() {
  19494. this.showSelf = !this.showSelf;
  19495. this.updateSelf();
  19496. }
  19497. updateSelf() {
  19498. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19499. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19500. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19501. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19502. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19503. }
  19504. }
  19505. UIRanking$1.uiName = "UIRanking";
  19506. class UISecretary$1 extends UIBase {
  19507. constructor() {
  19508. super();
  19509. this.curIndex = 1;
  19510. }
  19511. onConstructor() {
  19512. this.ui = ui_UISecretary.createInstance();
  19513. this.contentPane = this.ui;
  19514. this.isEject = false;
  19515. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19516. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  19517. this.addUIClick(this.ui.rightBtn, this.turnRight);
  19518. this.nodeObj = { left: null, right: null, cur: null };
  19519. this.nodeObj.left = this.ui.myNode.gameNode1;
  19520. this.nodeObj.right = this.ui.myNode.gameNode2;
  19521. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19522. }
  19523. show() {
  19524. super.show();
  19525. this.ui.t0.play();
  19526. this.updateData();
  19527. }
  19528. addSecretarySpine(node, spineName) {
  19529. if (spineName == "mishu") {
  19530. if (this.secretarySpine1) {
  19531. node.displayObject.destroyChildren();
  19532. this.playWoman(this.secretarySpine1, node.displayObject);
  19533. }
  19534. else {
  19535. let spine1 = new SpineMgr("mishu", () => {
  19536. this.secretarySpine1 = spine1;
  19537. this.playWoman(this.secretarySpine1, node.displayObject);
  19538. });
  19539. }
  19540. }
  19541. else {
  19542. if (this.secretarySpine2) {
  19543. node.displayObject.destroyChildren();
  19544. this.playWoman(this.secretarySpine2, node.displayObject);
  19545. }
  19546. else {
  19547. let spine2 = new SpineMgr("xiaomishu2", () => {
  19548. this.secretarySpine2 = spine2;
  19549. this.playWoman(this.secretarySpine2, node.displayObject);
  19550. });
  19551. }
  19552. }
  19553. }
  19554. playWoman(node, parent) {
  19555. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  19556. let yy = this.ui.myNode.gameNode1.secretary.height;
  19557. let scale = 1.5;
  19558. if (node == this.secretarySpine2) {
  19559. scale = 1.2;
  19560. }
  19561. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19562. node.play(data, 1, true, parent);
  19563. }
  19564. turnLeft() {
  19565. this.curIndex--;
  19566. if (this.curIndex < 1) {
  19567. this.curIndex = 2;
  19568. }
  19569. let left = this.nodeObj.left;
  19570. let right = this.nodeObj.right;
  19571. let cur = this.nodeObj.cur;
  19572. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19573. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19574. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19575. this.updateData();
  19576. }));
  19577. this.ui.myNode.setChildIndex(right, 2);
  19578. this.nodeObj.left = cur;
  19579. this.nodeObj.right = left;
  19580. this.nodeObj.cur = right;
  19581. }
  19582. turnRight() {
  19583. this.curIndex++;
  19584. if (this.curIndex > 2) {
  19585. this.curIndex = 1;
  19586. }
  19587. let left = this.nodeObj.left;
  19588. let right = this.nodeObj.right;
  19589. let cur = this.nodeObj.cur;
  19590. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19591. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19592. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19593. this.updateData();
  19594. }));
  19595. this.ui.myNode.setChildIndex(left, 2);
  19596. this.nodeObj.left = right;
  19597. this.nodeObj.right = cur;
  19598. this.nodeObj.cur = left;
  19599. }
  19600. updateData() {
  19601. let data = cfgTable.secretaryshopData;
  19602. let children = this.ui.myNode._children;
  19603. let temp;
  19604. let curData;
  19605. for (let index = 0; index < children.length; index++) {
  19606. temp = children[index];
  19607. if (index == 2) {
  19608. curData = data[this.curIndex];
  19609. temp.purchaseBtn.touchable = true;
  19610. }
  19611. else {
  19612. temp.purchaseBtn.touchable = false;
  19613. if (this.curIndex == 1) {
  19614. curData = data[2];
  19615. }
  19616. else {
  19617. curData = data[1];
  19618. }
  19619. }
  19620. temp.heightTxt.text = curData.height;
  19621. temp.foodTxt.text = curData.food;
  19622. temp.historyTxt.text = curData.history;
  19623. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19624. this.addSecretarySpine(temp.secretary, curData.spine);
  19625. let womanIndex = curData.id - 1;
  19626. let getWoman = DataMgr.getSecretary(womanIndex);
  19627. let curUse = DataMgr.getCurSecretary();
  19628. if (getWoman) {
  19629. if (curUse == womanIndex) {
  19630. temp.purchaseBtn.c1.selectedIndex = 1;
  19631. }
  19632. else {
  19633. temp.purchaseBtn.c1.selectedIndex = 2;
  19634. }
  19635. }
  19636. else {
  19637. temp.purchaseBtn.c1.selectedIndex = 0;
  19638. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19639. }
  19640. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19641. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19642. }
  19643. }
  19644. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19645. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19646. if (getWoman) {
  19647. if (curUse != womanIndex) {
  19648. console.log();
  19649. DataMgr.setCurSecretary(womanIndex);
  19650. this.updateData();
  19651. }
  19652. }
  19653. else {
  19654. let need = needDiamond;
  19655. if (DataMgr.diamondEnough(need)) {
  19656. DataMgr.setDiamond(-need);
  19657. DataMgr.setSecretary(womanIndex, 1);
  19658. DataMgr.setCurSecretary(womanIndex);
  19659. this.updateData();
  19660. }
  19661. else {
  19662. xGame.uiMgr.Show(UIAddProp$1, 1);
  19663. }
  19664. }
  19665. }
  19666. closeSelf() {
  19667. this.hide();
  19668. }
  19669. }
  19670. UISecretary$1.uiName = "UISecretary";
  19671. class BallRodDisplay$1 {
  19672. constructor(ui, index) {
  19673. this.index = 0;
  19674. this.uiIndex = 0;
  19675. this.ui = ui;
  19676. this.index = index;
  19677. this.initData();
  19678. }
  19679. initData() {
  19680. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19681. let data = cfgTable.ballrodData[this.index + 1];
  19682. this.ui.nameTxt.text = data.name;
  19683. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19684. this.ui.levelNode.c1.selectedIndex = data.quality;
  19685. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19686. if (data.spine) {
  19687. this.mySpine = new SpineMgr(data.spine, () => {
  19688. let xx = 150;
  19689. let yy = 70;
  19690. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19691. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19692. });
  19693. }
  19694. }
  19695. updateSelf() {
  19696. let get = DataMgr.getBallRod(this.index);
  19697. if (get == null)
  19698. get = 1;
  19699. let curUse = DataMgr.getCurBallRod();
  19700. if (get) {
  19701. if (curUse == this.index) {
  19702. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19703. }
  19704. else {
  19705. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19706. }
  19707. }
  19708. else {
  19709. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19710. }
  19711. }
  19712. buyBallRod() {
  19713. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19714. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19715. switch (selectedIndex) {
  19716. case 0:
  19717. break;
  19718. case 1:
  19719. DataMgr.setCurBallRod(this.index);
  19720. let ui = xGame.uiMgr.getUI(UIShop$1);
  19721. ui.updateBallRod();
  19722. break;
  19723. case 2:
  19724. let data = cfgTable.ballrodData[this.index + 1];
  19725. let need = data.price;
  19726. if (DataMgr.diamondEnough(need)) {
  19727. DataMgr.setDiamond(-need);
  19728. DataMgr.setBallRod(this.index, 1);
  19729. DataMgr.setCurBallRod(this.index);
  19730. let ui = xGame.uiMgr.getUI(UIShop$1);
  19731. ui.updateBallRod();
  19732. }
  19733. else {
  19734. xGame.uiMgr.Show(UIAddProp$1, 1);
  19735. }
  19736. break;
  19737. default:
  19738. break;
  19739. }
  19740. }
  19741. }
  19742. class UIShop$1 extends UIBase {
  19743. constructor() {
  19744. super();
  19745. this.itemNums = 0;
  19746. }
  19747. onConstructor() {
  19748. this.ui = ui_UIShop.createInstance();
  19749. this.contentPane = this.ui;
  19750. this.isEject = false;
  19751. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19752. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19753. this.addUIClick(this.ui, this.interuptSecretary);
  19754. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19755. this.ballRodArr = [];
  19756. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19757. this.ui.myNode.myList.numItems = this.itemNums;
  19758. if (Moyu.isKs)
  19759. this.ui.closeNode.closeBtn.x += 100;
  19760. }
  19761. show() {
  19762. super.show();
  19763. this.playSecretaryIdle();
  19764. this.updateBallRod();
  19765. }
  19766. updateBallRod() {
  19767. for (let index = 0; index < this.ballRodArr.length; index++) {
  19768. this.ballRodArr[index].updateSelf();
  19769. }
  19770. }
  19771. renderBallRod(sort, obj) {
  19772. let index = this.getIndexBySort(sort + 1) - 1;
  19773. let ballRod = new BallRodDisplay$1(obj, index);
  19774. this.ballRodArr.push(ballRod);
  19775. }
  19776. getIndexBySort(sort) {
  19777. let object = cfgTable.ballrodData;
  19778. for (const key in object) {
  19779. if (object[key].sort == sort) {
  19780. return parseInt(key);
  19781. }
  19782. }
  19783. }
  19784. playSecretaryIdle() {
  19785. let parent = this.ui.secretary.displayObject;
  19786. parent.destroyChildren();
  19787. let xx = this.ui.secretary.width / 2;
  19788. let yy = this.ui.secretary.height;
  19789. let scale = xGame.common.getSecretaryScale();
  19790. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19791. xGame.common.secretary.play(data, 1, true, parent);
  19792. }
  19793. interuptSecretary() {
  19794. Laya.timer.clearAll(this);
  19795. this.playSecretaryRandomSound();
  19796. }
  19797. playSecretaryRandomSound() {
  19798. if (this.isHide)
  19799. return;
  19800. let time = xGame.common.randomNum(45000, 60000);
  19801. Laya.timer.once(time, this, () => {
  19802. if (this.isHide)
  19803. return;
  19804. let index = xGame.common.randomNum(4, 7);
  19805. xGame.soundMgr.playSound("s_main0" + index);
  19806. let words = 1;
  19807. switch (index) {
  19808. case 4:
  19809. words = 5;
  19810. break;
  19811. case 5:
  19812. words = 3;
  19813. break;
  19814. case 6:
  19815. words = 6;
  19816. break;
  19817. case 7:
  19818. words = 7;
  19819. break;
  19820. default:
  19821. break;
  19822. }
  19823. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19824. this.playSecretaryRandomSound();
  19825. });
  19826. }
  19827. closeSelf() {
  19828. this.hide();
  19829. }
  19830. }
  19831. UIShop$1.uiName = "UIShop";
  19832. class SignMax$1 {
  19833. constructor(ui) {
  19834. this.ui = ui;
  19835. }
  19836. updateSelf(index, sameDay, curDayIndex) {
  19837. let data = cfgTable.signData[index + 1];
  19838. this.ui.titleTxt.text = data.title;
  19839. let arr1 = data.award[0].split('-');
  19840. let arr2 = data.award[1].split('-');
  19841. let num1 = parseInt(arr1[1]);
  19842. let num2 = parseInt(arr2[1]);
  19843. this.ui.numTxt1.text = num1 + "";
  19844. this.ui.numTxt2.text = num2 + "";
  19845. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19846. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19847. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19848. this.ui.numTxt1.visible = false;
  19849. }
  19850. else {
  19851. this.ui.numTxt1.visible = true;
  19852. }
  19853. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19854. this.ui.numTxt2.visible = false;
  19855. }
  19856. else {
  19857. this.ui.numTxt2.visible = true;
  19858. }
  19859. if (index < curDayIndex) {
  19860. this.ui.c1.selectedIndex = 1;
  19861. }
  19862. else if (index == curDayIndex) {
  19863. if (sameDay) {
  19864. this.ui.c1.selectedIndex = 2;
  19865. }
  19866. else {
  19867. this.ui.c1.selectedIndex = 2;
  19868. }
  19869. }
  19870. else {
  19871. this.ui.c1.selectedIndex = 0;
  19872. }
  19873. }
  19874. }
  19875. class SignNormal$1 {
  19876. constructor(ui) {
  19877. this.ui = ui;
  19878. }
  19879. updateSelf(index, sameDay, curDayIndex) {
  19880. let data = cfgTable.signData[index + 1];
  19881. this.ui.titleTxt.text = data.title;
  19882. let arr = data.award[0].split('-');
  19883. let type = parseInt(arr[0]);
  19884. let num = parseInt(arr[1]);
  19885. this.ui.numTxt.text = num + "";
  19886. if (type > 2) {
  19887. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19888. this.ui.myIcon.rotation = 0;
  19889. }
  19890. else {
  19891. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19892. this.ui.myIcon.rotation = 0;
  19893. }
  19894. if (xGame.common.signAwardContainsRod(data.award)) {
  19895. this.ui.numTxt.visible = false;
  19896. }
  19897. else {
  19898. this.ui.numTxt.visible = true;
  19899. }
  19900. if (index < curDayIndex) {
  19901. this.ui.c1.selectedIndex = 1;
  19902. }
  19903. else if (index == curDayIndex) {
  19904. if (sameDay) {
  19905. this.ui.c1.selectedIndex = 2;
  19906. }
  19907. else {
  19908. this.ui.c1.selectedIndex = 2;
  19909. }
  19910. }
  19911. else {
  19912. this.ui.c1.selectedIndex = 0;
  19913. }
  19914. }
  19915. }
  19916. class UISign$1 extends UIBase {
  19917. constructor() {
  19918. super();
  19919. this.curDayIndex = 0;
  19920. this.starX = 0;
  19921. }
  19922. onConstructor() {
  19923. this.ui = ui_UISign.createInstance();
  19924. this.contentPane = this.ui;
  19925. this.isEject = false;
  19926. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19927. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19928. this.initSignItem();
  19929. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19930. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19931. }
  19932. show() {
  19933. super.show();
  19934. this.ui.t0.play();
  19935. this.playSecretaryIdle();
  19936. this.updateSign();
  19937. }
  19938. initSignItem() {
  19939. this.signArr = [];
  19940. for (let index = 0; index < 6; index++) {
  19941. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19942. this.signArr.push(temp);
  19943. }
  19944. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19945. if (Moyu.isKs)
  19946. this.ui.closeNode.closeBtn.x += 100;
  19947. }
  19948. updateSign() {
  19949. let sameDay = xGame.common.judgeSameDay();
  19950. let max = 7;
  19951. this.curDayIndex = DataMgr.getSignData();
  19952. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19953. this.curDayIndex = 0;
  19954. if (!sameDay) {
  19955. this.ui.normalBtn.visible = true;
  19956. this.ui.tipsNode.visible = false;
  19957. this.ui.againBtn.visible = false;
  19958. }
  19959. else {
  19960. this.ui.normalBtn.visible = false;
  19961. let again = DataMgr.getExtraSign();
  19962. let isCurrency = false;
  19963. let index = this.curDayIndex;
  19964. if (index == 0)
  19965. index = 7;
  19966. let award = cfgTable.signData[index].award;
  19967. let num = award[0].split("-")[0];
  19968. if (num == "1" || num == "2")
  19969. isCurrency = true;
  19970. let showAgain = again == 0 && isCurrency;
  19971. this.ui.againBtn.visible = showAgain;
  19972. this.ui.tipsNode.visible = !showAgain;
  19973. }
  19974. for (let index = 0; index < this.signArr.length; index++) {
  19975. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  19976. }
  19977. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  19978. }
  19979. playSecretaryIdle() {
  19980. let parent = this.ui.secretary.displayObject;
  19981. parent.destroyChildren();
  19982. let xx = this.ui.secretary.width / 2;
  19983. let yy = this.ui.secretary.height;
  19984. let scale = xGame.common.getSecretaryScale();
  19985. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19986. xGame.common.secretary.play(data, 1, true, parent);
  19987. }
  19988. closeSelf() {
  19989. this.hide();
  19990. }
  19991. normalGetAward() {
  19992. let sameDay = xGame.common.judgeSameDay();
  19993. if (!sameDay) {
  19994. let award = cfgTable.signData[this.curDayIndex + 1].award;
  19995. let temp;
  19996. let type;
  19997. let num;
  19998. let arr = [];
  19999. for (let index = 0; index < award.length; index++) {
  20000. temp = award[index].split("-");
  20001. type = parseInt(temp[0]);
  20002. num = parseInt(temp[1]);
  20003. let awardType = new AwardType();
  20004. awardType.num = num;
  20005. awardType.type = type;
  20006. arr.push(awardType);
  20007. }
  20008. xGame.common.getAward(arr, (watchVideo) => {
  20009. this.curDayIndex++;
  20010. if (this.curDayIndex > 7)
  20011. this.curDayIndex = 0;
  20012. DataMgr.setSignData(this.curDayIndex);
  20013. DataMgr.setSignTime(new Date().getTime());
  20014. if (watchVideo) {
  20015. DataMgr.setExtraSign(1);
  20016. Moyu.sendDataEvent("signIn1");
  20017. }
  20018. this.updateSign();
  20019. });
  20020. }
  20021. }
  20022. againGetAward() {
  20023. Moyu.sendDataEvent("signIn2");
  20024. Moyu.showVideoAd(() => {
  20025. let index = this.curDayIndex;
  20026. if (index == 0)
  20027. index = 7;
  20028. let award = cfgTable.signData[index].award;
  20029. let temp;
  20030. let type;
  20031. let num;
  20032. for (let index = 0; index < award.length; index++) {
  20033. temp = award[index].split("-");
  20034. type = parseInt(temp[0]);
  20035. num = parseInt(temp[1]) * 3;
  20036. xGame.common.playObjFlyAnim(num, type);
  20037. }
  20038. DataMgr.setExtraSign(1);
  20039. this.updateSign();
  20040. }, EAdType.againSign);
  20041. }
  20042. }
  20043. UISign$1.uiName = "UISign";
  20044. class UIModeSelection$1 extends UIBase {
  20045. constructor() {
  20046. super();
  20047. }
  20048. onConstructor() {
  20049. this.ui = ui_UIModeSelection.createInstance();
  20050. this.contentPane = this.ui;
  20051. this.isEject = false;
  20052. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20053. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20054. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20055. this.addUIClick(this.ui.closeBtn, this.hide);
  20056. this.peopleArr = [650, 6900, 3800];
  20057. this.peopleOffest = [50, 500, 200];
  20058. this.updateSelf();
  20059. }
  20060. show(callback) {
  20061. super.show();
  20062. this.ui.t0.play();
  20063. this.callback = callback;
  20064. }
  20065. updateSelf() {
  20066. let cfg = cfgTable.modeselectData;
  20067. for (let index = 1; index <= 3; index++) {
  20068. let node = this.ui.myNode["type" + index];
  20069. node.need.text = cfg[index].need;
  20070. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20071. node.peopleTxt.text = this.getRandPeople(index - 1);
  20072. }
  20073. }
  20074. enterGame(type) {
  20075. xGame.common.classicRoomType = type;
  20076. let cfg = cfgTable.modeselectData[type];
  20077. let need = cfg.need;
  20078. xGame.common.passAwardCoin = cfg.award;
  20079. if (DataMgr.coinEnough(need)) {
  20080. DataMgr.setCoin(-need);
  20081. this.ui.myNode["type" + type].t0.play();
  20082. Laya.timer.once(200, this, () => {
  20083. this.callback && this.callback();
  20084. });
  20085. }
  20086. else {
  20087. Moyu.sendDataEvent("AddCoinVideo");
  20088. xGame.uiMgr.Show(UIAddProp$1, 0);
  20089. }
  20090. }
  20091. getRandPeople(index) {
  20092. let rand = this.peopleOffest[index];
  20093. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20094. }
  20095. }
  20096. UIModeSelection$1.uiName = "UIModeSelection";
  20097. class UIMain$1 extends UIBase {
  20098. constructor() {
  20099. super();
  20100. this.firstEnter = true;
  20101. }
  20102. onConstructor() {
  20103. this.ui = ui_UIMain.createInstance();
  20104. this.contentPane = this.ui;
  20105. this.isEject = false;
  20106. this.addEvent();
  20107. this.addClickSpine();
  20108. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20109. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20110. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20111. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20112. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20113. let curUse = DataMgr.getCurSecretary();
  20114. this.changeSecretary(curUse);
  20115. this.ui.talkNode.visible = false;
  20116. let guide = DataMgr.getSkillGuide();
  20117. if (xGame.common.isNewDay && guide == 1) {
  20118. xGame.common.isNewDay = false;
  20119. xGame.soundMgr.playSound("s_main01");
  20120. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20121. console.log("播放小秘书每天语音");
  20122. }
  20123. this.onGetUserInfo();
  20124. this.ui.n83.visible = false;
  20125. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20126. }
  20127. changeSecretary(curUse) {
  20128. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20129. xGame.common.secretary && xGame.common.secretary.dispose();
  20130. this.addSecretarySpine(name);
  20131. }
  20132. addSecretarySpine(name) {
  20133. let spine = new SpineMgr(name, () => {
  20134. this.playSecretaryIdle();
  20135. });
  20136. xGame.common.secretary = spine;
  20137. }
  20138. addClickSpine() {
  20139. let clickSpine = new SpineMgr("dianji", () => {
  20140. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20141. let parent = Laya.stage;
  20142. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20143. clickSpine.play(data, 0, false, parent, (spine) => {
  20144. spine.destroy(true);
  20145. });
  20146. });
  20147. });
  20148. }
  20149. addEvent() {
  20150. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20151. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20152. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20153. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20154. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20155. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20156. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20157. this.addUIClick(this.ui, this.interuptSecretary);
  20158. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20159. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20160. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20161. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20162. this.addUIClick(this.ui.signBtn, this.openSignView);
  20163. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20164. this.addUIClick(this.ui.rankBtn, this.openRanking);
  20165. }
  20166. show(showFailWords) {
  20167. super.show();
  20168. this.moneyNode.ui.c1.selectedIndex = 1;
  20169. this.playSecretaryIdle();
  20170. xGame.soundMgr.playMusic("caromhall01");
  20171. Laya.timer.clearAll(this);
  20172. this.playSecretaryRandomSound();
  20173. if (showFailWords) {
  20174. setTimeout(() => {
  20175. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20176. let words = -1;
  20177. if (str == "s_main02") {
  20178. words = 2;
  20179. }
  20180. else {
  20181. words = 3;
  20182. }
  20183. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20184. xGame.soundMgr.playSound(str);
  20185. }, 300);
  20186. }
  20187. this.showGuide();
  20188. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20189. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20190. let guide = DataMgr.getSkillGuide();
  20191. if (guide == 1) {
  20192. let randTime = xGame.common.randomNum(300, 800);
  20193. if (this.firstEnter) {
  20194. this.firstEnter = false;
  20195. randTime += 900;
  20196. }
  20197. Laya.timer.once(randTime, this, () => {
  20198. xGame.common.autoPopUIView();
  20199. });
  20200. }
  20201. }
  20202. checkActive(show) {
  20203. }
  20204. showGuide() {
  20205. let guide = DataMgr.getSkillGuide();
  20206. this.ui.guideBtn.visible = guide == 0;
  20207. this.ui.enterGuide.visible = false;
  20208. this.ui.secretaryGuide.visible = guide == 0;
  20209. if (guide == 0) {
  20210. xGame.soundMgr.playSound("s_guide");
  20211. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20212. }
  20213. }
  20214. ensureSecretary() {
  20215. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20216. this.ui.secretaryGuide.visible = false;
  20217. this.ui.enterGuide.visible = true;
  20218. this.ui.wordsNode.t0.play();
  20219. if (DataMgr.getNewUser())
  20220. Moyu.sendDataEvent("gameReady");
  20221. }
  20222. playSecretaryIdle() {
  20223. let parent = this.ui.secretary.displayObject;
  20224. parent.destroyChildren();
  20225. let xx = this.ui.secretary.width / 2;
  20226. let yy = this.ui.secretary.height;
  20227. let scale = xGame.common.getSecretaryScale();
  20228. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20229. xGame.common.secretary.play(data, 1, true, parent);
  20230. }
  20231. startGame(type) {
  20232. xGame.common.gameMode = type;
  20233. Moyu.sendDataEvent("PlayGame", { type: type });
  20234. switch (xGame.common.gameMode) {
  20235. case GameMode.classic:
  20236. let challengeTimes = DataMgr.getChallengeTimes();
  20237. if (challengeTimes == 0) {
  20238. xGame.uiMgr.Show(UIInvitation$1);
  20239. }
  20240. else {
  20241. this.beginGame();
  20242. }
  20243. break;
  20244. case GameMode.bigMove:
  20245. this.beginGame();
  20246. if (DataMgr.getNewUser())
  20247. Moyu.sendDataEvent("gameStart0");
  20248. break;
  20249. default:
  20250. break;
  20251. }
  20252. }
  20253. beginGame(isNice = false) {
  20254. if (xGame.common.gameMode == GameMode.classic) {
  20255. if (isNice) {
  20256. this.enterClassic();
  20257. }
  20258. else {
  20259. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20260. this.enterClassic();
  20261. });
  20262. }
  20263. }
  20264. else if (xGame.common.gameMode == GameMode.bigMove) {
  20265. this.ui.enterGuide.visible = false;
  20266. xGame.uiMgr.Show(UISkill$1);
  20267. }
  20268. }
  20269. enterClassic() {
  20270. xGame.uiMgr.Show(UIGame$1);
  20271. xGame.uiMgr.Show(UIMatching$1, () => {
  20272. if (!this.isHide)
  20273. this.hide();
  20274. xGame.common.gameUI.ui.alpha = 1;
  20275. xGame.common.gameUI.startGame();
  20276. xGame.uiMgr.Hide(UIGameEnd$1);
  20277. });
  20278. }
  20279. startGlobal() {
  20280. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20281. }
  20282. startWeekly() {
  20283. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20284. }
  20285. startPlaceBall() {
  20286. xGame.uiMgr.Show(UILevelDisplay$1);
  20287. }
  20288. hide() {
  20289. super.hide();
  20290. xGame.common.stopGirlPop(this.ui.talkNode);
  20291. }
  20292. onGetUserInfo(force = false) {
  20293. if (Moyu.isWx) {
  20294. let info = Moyu.getSystemInfo();
  20295. if (info)
  20296. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20297. }
  20298. else {
  20299. Moyu.initUser(this, this.freshUser, force);
  20300. }
  20301. if (!Moyu.hasUserInfo) {
  20302. let user = Moyu.getUserInfo();
  20303. user.headIcon = 'res/ty_touxiang.png';
  20304. }
  20305. this.freshUser();
  20306. }
  20307. freshUser() {
  20308. let user = Moyu.getUserInfo();
  20309. if (!user.isAuth) {
  20310. user.headIcon = 'res/ty_touxiang.png';
  20311. }
  20312. else
  20313. DataMgr.upRankData();
  20314. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20315. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20316. }
  20317. interuptSecretary() {
  20318. Laya.timer.clearAll(this);
  20319. this.playSecretaryRandomSound();
  20320. }
  20321. playSecretaryRandomSound() {
  20322. if (this.isHide)
  20323. return;
  20324. let time = xGame.common.randomNum(45000, 60000);
  20325. Laya.timer.once(time, this, () => {
  20326. if (this.isHide)
  20327. return;
  20328. let index = xGame.common.randomNum(4, 7);
  20329. xGame.soundMgr.playSound("s_main0" + index);
  20330. let words = 1;
  20331. switch (index) {
  20332. case 4:
  20333. words = 5;
  20334. break;
  20335. case 5:
  20336. words = 3;
  20337. break;
  20338. case 6:
  20339. words = 6;
  20340. break;
  20341. case 7:
  20342. words = 7;
  20343. break;
  20344. default:
  20345. break;
  20346. }
  20347. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20348. this.playSecretaryRandomSound();
  20349. });
  20350. }
  20351. openSecretaryView() {
  20352. xGame.uiMgr.Show(UISecretary$1);
  20353. Moyu.sendDataEvent("secretary");
  20354. }
  20355. openShopView() {
  20356. xGame.uiMgr.Show(UIShop$1);
  20357. }
  20358. openSignView() {
  20359. xGame.uiMgr.Show(UISign$1);
  20360. }
  20361. openDrawView() {
  20362. xGame.uiMgr.Show(UIDraw$1);
  20363. }
  20364. openRanking() {
  20365. xGame.uiMgr.Show(UIRanking$1);
  20366. Moyu.sendDataEvent("rankingList");
  20367. }
  20368. }
  20369. UIMain$1.uiName = "UIMain";
  20370. function InitShader() {
  20371. }
  20372. function appInit() {
  20373. xGame.context.init(getLoadingResList(), initCallback);
  20374. }
  20375. function getLoadingResList() {
  20376. return [
  20377. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20378. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20379. ];
  20380. }
  20381. function getGameResList() {
  20382. return [
  20383. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20384. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20385. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20386. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20387. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20388. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20389. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20390. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20391. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20392. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20393. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20394. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20395. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20396. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20397. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20398. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20399. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20400. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20401. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20402. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20403. ];
  20404. }
  20405. function initCallback() {
  20406. window["DataMgr"] = DataMgr;
  20407. DataMgr.Init();
  20408. Moyu.init(getPlat(), this, () => {
  20409. DataMgr.isNewDay();
  20410. PlatMgr.initConfig();
  20411. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20412. }, true);
  20413. console.log('zh:开始sm init1 start');
  20414. xGame.soundMgr.init();
  20415. console.log('zh:开始sm init1 end');
  20416. xGame.uiMgr.init();
  20417. xGame.uiMgr.bindFUI(fguiRes.loading);
  20418. xGame.uiMgr.Show(UILoading);
  20419. }
  20420. function loadSubRes(callback) {
  20421. var tab = ["asset", "res", "spine"];
  20422. let subDone = 0;
  20423. for (var i = 0; i < tab.length; i++) {
  20424. let sub = tab[i];
  20425. Moyu.loadSubRes(sub, (pro) => {
  20426. callback && callback(pro, false);
  20427. }).then(() => {
  20428. subDone++;
  20429. if (subDone >= tab.length)
  20430. callback && callback(1, true);
  20431. });
  20432. }
  20433. }
  20434. function enterGame() {
  20435. xGame.cfgMgr.init();
  20436. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20437. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20438. xGame.uiMgr.Hide(UILoading);
  20439. fgui.UIPackage.removePackage(fguiRes.loading);
  20440. xGame.uiMgr.bindFUI(fguiRes.game);
  20441. xGame.uiMgr.Show(UIMain$1);
  20442. if (DataMgr.getNewUser())
  20443. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20444. }
  20445. function getPlat() {
  20446. let cfg = new MoyuCfg();
  20447. cfg.plat = MoyuPlat.web;
  20448. cfg.myId = 120;
  20449. cfg.myKey = '8848a885774230a4';
  20450. cfg.version = 0;
  20451. if (window.hasOwnProperty("gamebox")) {
  20452. cfg.plat = MoyuPlat.f399;
  20453. cfg.version = 0;
  20454. }
  20455. else if (window.hasOwnProperty("ks")) {
  20456. cfg.plat = MoyuPlat.ks;
  20457. cfg.version = 0;
  20458. cfg.ads.ksVideoId = '2300002254_01';
  20459. cfg.ads.ksInsertId = '2300002254_02';
  20460. }
  20461. else if (Laya.Browser.onTTMiniGame) {
  20462. cfg.plat = MoyuPlat.tt;
  20463. cfg.version = 0;
  20464. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20465. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20466. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20467. }
  20468. else if (Laya.Browser.onMiniGame) {
  20469. cfg.plat = MoyuPlat.wx;
  20470. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20471. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20472. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20473. }
  20474. else if (Laya.Browser.onQQMiniGame) {
  20475. cfg.plat = MoyuPlat.qq;
  20476. }
  20477. else if (Laya.Browser.onQGMiniGame) {
  20478. cfg.plat = MoyuPlat.op;
  20479. cfg.ads.opVideoId = '455502';
  20480. cfg.ads.opBannerId = '455507';
  20481. }
  20482. else if (Laya.Browser.onVVMiniGame) {
  20483. cfg.plat = MoyuPlat.vv;
  20484. cfg.version = 0;
  20485. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20486. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20487. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20488. }
  20489. else if (Laya.Browser.onHWMiniGame) {
  20490. cfg.plat = MoyuPlat.hw;
  20491. }
  20492. else if (window["mz"]) {
  20493. cfg.plat = MoyuPlat.mz;
  20494. }
  20495. else {
  20496. let cfg = window['conchConfig'];
  20497. if (cfg) {
  20498. var os = cfg.getOS();
  20499. if (os == "Conch-ios") {
  20500. cfg.plat = MoyuPlat.ios;
  20501. }
  20502. else if (os == "Conch-android") {
  20503. }
  20504. }
  20505. }
  20506. return cfg;
  20507. }
  20508. class Main {
  20509. constructor() {
  20510. if (window["Laya3D"])
  20511. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20512. else {
  20513. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20514. this.initMain();
  20515. }
  20516. }
  20517. initMain() {
  20518. Laya["Physics"] && Laya["Physics"].enable();
  20519. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20520. Laya.stage.scaleMode = GameConfig.scaleMode;
  20521. Laya.stage.screenMode = GameConfig.screenMode;
  20522. Laya.stage.alignV = GameConfig.alignV;
  20523. Laya.stage.alignH = GameConfig.alignH;
  20524. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20525. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20526. Laya.enableDebugPanel();
  20527. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20528. Laya["PhysicsDebugDraw"].enable();
  20529. if (GameConfig.stat)
  20530. Laya.Stat.show();
  20531. Laya.alertGlobalError(true);
  20532. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20533. }
  20534. onVersionLoaded() {
  20535. appInit();
  20536. }
  20537. }
  20538. new Main();
  20539. }());
  20540. //# sourceMappingURL=bundle.js.map