bundle.js 796 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893
  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.starNumNode = (this.getChild("starNumNode"));
  3930. this.awardNode = (this.getChild("awardNode"));
  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.liucheng1 = (this.getChild("liucheng1"));
  4045. this.rightBtn = (this.getChild("rightBtn"));
  4046. this.n75 = (this.getChild("n75"));
  4047. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4048. this.liucheng2 = (this.getChild("liucheng2"));
  4049. this.guideBtn = (this.getChild("guideBtn"));
  4050. this.n73 = (this.getChild("n73"));
  4051. this.wordsNode = (this.getChild("wordsNode"));
  4052. this.enterGuide = (this.getChild("enterGuide"));
  4053. this.talkNode = (this.getChild("talkNode"));
  4054. this.n83 = (this.getChild("n83"));
  4055. this.n84 = (this.getChild("n84"));
  4056. }
  4057. }
  4058. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4059. class ui_UIMoyu extends fgui.GComponent {
  4060. static createInstance() {
  4061. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4062. }
  4063. onConstruct() {
  4064. this.ageTip = (this.getChild("ageTip"));
  4065. this.mainBg = (this.getChild("mainBg"));
  4066. this.xyNode = (this.getChild("xyNode"));
  4067. this.rnNode = (this.getChild("rnNode"));
  4068. this.fcmNode = (this.getChild("fcmNode"));
  4069. this.ageNode = (this.getChild("ageNode"));
  4070. this.tipNode = (this.getChild("tipNode"));
  4071. this.msgNode = (this.getChild("msgNode"));
  4072. }
  4073. }
  4074. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4075. class MoyuMgr {
  4076. static initMoyu() {
  4077. this.moyuView = new MoyuView();
  4078. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4079. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4080. this.moyuView.ui.displayObject.zOrder = 1000;
  4081. this.moyuView.init();
  4082. this.moyuView.showTip(true);
  4083. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4084. window['XApk'] = this;
  4085. }
  4086. static showAge(show) {
  4087. if (this.moyuView)
  4088. this.moyuView.showAge(show);
  4089. }
  4090. static onPlatMsg(idx) {
  4091. if (!MoyuMgr.moyuView)
  4092. return;
  4093. if (idx == '0') {
  4094. MoyuMgr.moyuView.showTip(false);
  4095. }
  4096. }
  4097. static showAgree(call) {
  4098. if (this.moyuView)
  4099. this.moyuView.showAgree(call);
  4100. else
  4101. call && call();
  4102. }
  4103. static showXy(type = 1) {
  4104. if (this.moyuView)
  4105. this.moyuView.showXy(type);
  4106. }
  4107. }
  4108. MoyuMgr.isAdvise = false;
  4109. class MoyuView {
  4110. constructor() {
  4111. this.ysxyNum = 1;
  4112. this.ysJson = null;
  4113. this.ui = ui_UIMoyu.createInstance();
  4114. }
  4115. init() {
  4116. this.ui.mainBg.visible = false;
  4117. this.ui.xyNode.visible = false;
  4118. this.ui.ageNode.visible = false;
  4119. this.ui.tipNode.visible = false;
  4120. this.ui.rnNode.visible = false;
  4121. this.ui.fcmNode.visible = false;
  4122. this.ui.ageTip.visible = false;
  4123. this.ui.msgNode.visible = false;
  4124. this.ui.visible = false;
  4125. this.ui.xyNode.xyList.setVirtual();
  4126. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4127. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4128. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4129. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4130. this.ui.xyNode.btnKnown.visible = false;
  4131. this.ui.xyNode.xy1.visible = false;
  4132. this.ui.xyNode.xy2.visible = false;
  4133. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4134. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4135. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4136. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4137. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4138. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4139. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4140. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4141. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4142. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4143. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4144. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4145. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4146. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4147. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4148. this.ysxyNum = 2;
  4149. }
  4150. }
  4151. onClick(obj) {
  4152. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4153. switch (obj) {
  4154. case this.ui.ageTip:
  4155. if (Moyu.isTTApk) {
  4156. this.ui.ageNode.visible = true;
  4157. this.ui.mainBg.visible = true;
  4158. }
  4159. break;
  4160. case this.ui.tipNode:
  4161. this.showTip(false);
  4162. break;
  4163. case this.ui.ageNode.btnAge:
  4164. this.ui.ageNode.visible = false;
  4165. this.ui.mainBg.visible = false;
  4166. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4167. this.ui.visible = false;
  4168. break;
  4169. case this.ui.xyNode.btnXy3:
  4170. case this.ui.xyNode.btnXy1:
  4171. this.loadXy(1);
  4172. break;
  4173. case this.ui.xyNode.btnXy2:
  4174. this.loadXy(2);
  4175. break;
  4176. case this.ui.xyNode.btnBack:
  4177. this.ui.xyNode.xy1.visible = true;
  4178. this.ui.xyNode.xy2.visible = false;
  4179. break;
  4180. case this.ui.xyNode.btnKnown:
  4181. this.ui.xyNode.visible = false;
  4182. this.ui.mainBg.visible = false;
  4183. this.ui.visible = false;
  4184. break;
  4185. case this.ui.rnNode.btnCheck:
  4186. this.check();
  4187. break;
  4188. case this.ui.rnNode.btnExit:
  4189. case this.ui.xyNode.btnNo:
  4190. this.ysxyNum--;
  4191. if (this.ysxyNum > 0)
  4192. this.showMsg("再次拒绝退出游戏");
  4193. else {
  4194. Moyu.userAgree(false);
  4195. Moyu.exit();
  4196. }
  4197. break;
  4198. case this.ui.xyNode.btnSure:
  4199. case this.ui.xyNode.btnYes:
  4200. DataMgr.userData.isAgree = true;
  4201. DataMgr.saveUserData();
  4202. this.onAgree();
  4203. break;
  4204. case this.ui.rnNode.btnDone:
  4205. this.ui.rnNode.visible = false;
  4206. this.ui.visible = false;
  4207. break;
  4208. case this.ui.fcmNode.btnRn:
  4209. this.showRn();
  4210. break;
  4211. }
  4212. }
  4213. showTip(show) {
  4214. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4215. return;
  4216. if (show) {
  4217. MoyuMgr.isAdvise = true;
  4218. this.ui.visible = true;
  4219. this.ui.tipNode.visible = true;
  4220. this.ui.tipNode.alpha = 1;
  4221. Laya.timer.once(1000, this, this.showTip, [false]);
  4222. }
  4223. else {
  4224. this.ui.tipNode.alpha = 1;
  4225. this.ui.tipNode.visible = true;
  4226. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4227. this.ui.tipNode.visible = false;
  4228. MoyuMgr.isAdvise = false;
  4229. }), 1000);
  4230. }
  4231. }
  4232. showAge(show, px = 0, py = 0) {
  4233. if (Moyu.platType > 10 && !Moyu.isIos) {
  4234. this.ui.ageTip.x = px;
  4235. this.ui.ageTip.y = py;
  4236. this.ui.ageTip.visible = show;
  4237. if (show)
  4238. this.ui.visible = true;
  4239. }
  4240. }
  4241. showAgree(call) {
  4242. this.agreeCall = call;
  4243. this.onAgree();
  4244. return;
  4245. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4246. this.showXy(0);
  4247. }
  4248. else
  4249. this.onAgree();
  4250. }
  4251. onAgree() {
  4252. if (!this.ui.ageNode.visible)
  4253. this.ui.visible = false;
  4254. this.ui.xyNode.visible = false;
  4255. Moyu.userAgree(true);
  4256. this.showAge(false);
  4257. this.agreeCall && this.agreeCall();
  4258. this.showRn();
  4259. }
  4260. showMsg(txt) {
  4261. this.ui.msgNode.txtMsg.text = txt;
  4262. this.ui.msgNode.visible = true;
  4263. this.ui.msgNode.alpha = 1;
  4264. this.ui.visible = true;
  4265. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4266. this.ui.msgNode.visible = false;
  4267. }), 2500, true);
  4268. }
  4269. showRn() {
  4270. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4271. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4272. this.ui.rnNode.rn1.visible = true;
  4273. this.ui.rnNode.rn2.visible = false;
  4274. this.ui.rnNode.rn3.visible = false;
  4275. this.ui.rnNode.rn4.visible = false;
  4276. this.ui.rnNode.visible = true;
  4277. this.ui.mainBg.visible = true;
  4278. this.ui.rnNode.btnDone.visible = false;
  4279. this.ui.rnNode.btnExit.visible = true;
  4280. this.ui.rnNode.btnCheck.visible = true;
  4281. this.ui.fcmNode.visible = false;
  4282. this.ui.visible = true;
  4283. return;
  4284. }
  4285. }
  4286. this.showFcm();
  4287. }
  4288. showFcm() {
  4289. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4290. Moyu.initFCM(true);
  4291. if (Moyu.gameTime < 1)
  4292. this.fcmLoop();
  4293. else if (Moyu.gameTime < 999)
  4294. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4295. }
  4296. }
  4297. fcmLoop() {
  4298. if (Moyu.gameTime < 1) {
  4299. this.ui.rnNode.visible = false;
  4300. this.ui.fcmNode.visible = true;
  4301. this.ui.mainBg.visible = true;
  4302. this.ui.visible = true;
  4303. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4304. Laya.timer.clear(this.ui, this.fcmLoop);
  4305. }
  4306. }
  4307. check() {
  4308. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4309. this.ui.rnNode.rn1.visible = false;
  4310. this.ui.rnNode.rn2.visible = false;
  4311. this.ui.rnNode.rn4.visible = true;
  4312. }
  4313. else if (this.ui.rnNode.rn4.visible) {
  4314. let name = this.ui.rnNode.inputName.text;
  4315. let code = this.ui.rnNode.inputCode.text;
  4316. if (code && code.length == 18) {
  4317. this.ui.rnNode.rn1.visible = false;
  4318. this.ui.rnNode.rn4.visible = false;
  4319. Moyu.authenticate(name, code, (res) => {
  4320. this.ui.rnNode.rn2.visible = !res;
  4321. this.ui.rnNode.rn3.visible = res;
  4322. this.ui.rnNode.btnDone.visible = res;
  4323. this.ui.rnNode.btnExit.visible = !res;
  4324. this.ui.rnNode.btnCheck.visible = !res;
  4325. if (res)
  4326. this.showFcm();
  4327. });
  4328. }
  4329. else
  4330. this.showMsg("信息填写不完整");
  4331. }
  4332. }
  4333. loadXy(type = 0) {
  4334. this.ui.xyNode.xy1.visible = false;
  4335. this.ui.xyNode.xy2.visible = true;
  4336. this.ui.xyNode.xyList.scrollToView(0);
  4337. if (type == 1) {
  4338. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4339. }
  4340. else if (type == 2) {
  4341. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4342. }
  4343. }
  4344. showXy(type = 0) {
  4345. this.xyBtn();
  4346. if (type == 0) {
  4347. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4348. this.ui.xyNode.btnSure.visible = true;
  4349. }
  4350. else {
  4351. this.ui.xyNode.btnYes.visible = true;
  4352. this.ui.xyNode.btnNo.visible = true;
  4353. }
  4354. }
  4355. else {
  4356. this.ui.xyNode.btnKnown.visible = true;
  4357. this.ui.mainBg.visible = true;
  4358. }
  4359. this.ui.xyNode.xy1.visible = true;
  4360. this.ui.xyNode.xy2.visible = false;
  4361. this.ui.xyNode.visible = true;
  4362. this.ui.visible = true;
  4363. }
  4364. xyBtn() {
  4365. this.ui.xyNode.btnSure.visible = false;
  4366. this.ui.xyNode.btnYes.visible = false;
  4367. this.ui.xyNode.btnNo.visible = false;
  4368. this.ui.xyNode.btnKnown.visible = false;
  4369. {
  4370. this.ui.xyNode.btnXy3.visible = false;
  4371. this.ui.xyNode.btnXy2.visible = true;
  4372. this.ui.xyNode.btnXy1.visible = true;
  4373. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4374. }
  4375. }
  4376. createXY(json) {
  4377. this.ysJson = json.content;
  4378. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4379. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4380. this.ui.xyNode.xy2.visible = true;
  4381. }
  4382. renderListItem(idx, cell) {
  4383. let xy = this.ysJson[idx];
  4384. cell.height = xy.line * 30;
  4385. cell.xyItem.text = xy.text;
  4386. }
  4387. onDestroy() {
  4388. this.agreeCall = null;
  4389. }
  4390. }
  4391. class SettingNode {
  4392. constructor(ui) {
  4393. this.showSetting = false;
  4394. this.openSound = true;
  4395. this.openShake = true;
  4396. this.ui = ui;
  4397. this.ui.soundBtn.onClick(this, this.switchSound);
  4398. this.ui.shakeBtn.onClick(this, this.switchShake);
  4399. this.ui.xyBtn.onClick(this, this.onXy);
  4400. this.ui.clickNode.onClick(this, this.changeSetting);
  4401. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4402. }
  4403. changeSetting() {
  4404. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4405. this.showSetting = !this.showSetting;
  4406. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4407. }
  4408. switchSound() {
  4409. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4410. this.openSound = !this.openSound;
  4411. Moyu.onSetting(this.openSound, this.openShake);
  4412. xGame.soundMgr.onSetting(this.openSound);
  4413. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4414. }
  4415. switchShake() {
  4416. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4417. this.openShake = !this.openShake;
  4418. Moyu.onSetting(this.openSound, this.openShake);
  4419. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4420. }
  4421. onXy() {
  4422. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4423. MoyuMgr.showXy(1);
  4424. }
  4425. }
  4426. class ui_UILevelDisplay extends fgui.GComponent {
  4427. static createInstance() {
  4428. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4429. }
  4430. onConstruct() {
  4431. this.n9 = (this.getChild("n9"));
  4432. this.myNode = (this.getChild("myNode"));
  4433. this.closeNode = (this.getChild("closeNode"));
  4434. }
  4435. }
  4436. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4437. class ui_UILevelProp extends fgui.GComponent {
  4438. static createInstance() {
  4439. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4440. }
  4441. onConstruct() {
  4442. this.n16 = (this.getChild("n16"));
  4443. this.myNode = (this.getChild("myNode"));
  4444. this.closeBtn = (this.getChild("closeBtn"));
  4445. this.moneyNode = (this.getChild("moneyNode"));
  4446. this.t1 = this.getTransition("t1");
  4447. }
  4448. }
  4449. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4450. class ui_ShowItem extends fgui.GComponent {
  4451. static createInstance() {
  4452. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4453. }
  4454. onConstruct() {
  4455. this.myImg = (this.getChild("myImg"));
  4456. }
  4457. }
  4458. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4459. class ShowItem {
  4460. constructor() {
  4461. this.ui = ui_ShowItem.createInstance();
  4462. }
  4463. destroySelf() {
  4464. if (!this.ui.isDisposed) {
  4465. this.ui.removeFromParent();
  4466. this.ui.dispose();
  4467. }
  4468. }
  4469. setParent(parent) {
  4470. parent.addChild(this.ui);
  4471. }
  4472. setPos(x, y) {
  4473. this.ui.x = x;
  4474. this.ui.y = y;
  4475. }
  4476. setUrl(index) {
  4477. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4478. }
  4479. }
  4480. class ui_UIPower extends fgui.GComponent {
  4481. static createInstance() {
  4482. return (fgui.UIPackage.createObject("game", "UIPower"));
  4483. }
  4484. onConstruct() {
  4485. this.n11 = (this.getChild("n11"));
  4486. this.myNode = (this.getChild("myNode"));
  4487. this.t0 = this.getTransition("t0");
  4488. }
  4489. }
  4490. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4491. class UIPower extends UIBase {
  4492. constructor() {
  4493. super();
  4494. }
  4495. onConstructor() {
  4496. this.ui = ui_UIPower.createInstance();
  4497. this.contentPane = this.ui;
  4498. this.isEject = false;
  4499. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4500. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4501. }
  4502. show() {
  4503. super.show();
  4504. this.ui.t0.play();
  4505. }
  4506. videoGetPower() {
  4507. Moyu.showVideoAd(() => {
  4508. DataMgr.setPower(xGame.common.videoPower, true);
  4509. xGame.eventMgr.event(POWER_TIME);
  4510. this.hide();
  4511. }, EAdType.getPower);
  4512. }
  4513. }
  4514. UIPower.uiName = "UIPower";
  4515. class UILevelProp extends UIBase {
  4516. constructor() {
  4517. super();
  4518. this.firstPos = 385;
  4519. this.secondPos = 467;
  4520. this.showItemArr = [];
  4521. }
  4522. onConstructor() {
  4523. this.ui = ui_UILevelProp.createInstance();
  4524. this.contentPane = this.ui;
  4525. this.isEject = false;
  4526. this.addUIClick(this.ui.closeBtn, this.hide);
  4527. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4528. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4529. }
  4530. show(level) {
  4531. super.show();
  4532. this.ui.t1.play();
  4533. this.level = level;
  4534. this.data = cfgTable.placeballData[this.level];
  4535. this.updateSelf();
  4536. this.showPreView();
  4537. this.moneyNode.ui.c1.selectedIndex = 2;
  4538. this.moneyNode.checkPowerTime();
  4539. this.moneyNode.powerChange();
  4540. }
  4541. showPreView() {
  4542. let item;
  4543. let data;
  4544. for (let index = 0; index < this.showItemArr.length; index++) {
  4545. item = this.showItemArr[index];
  4546. item.destroySelf();
  4547. }
  4548. this.showItemArr = [];
  4549. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4550. for (const key in cfgData) {
  4551. data = cfgData[key];
  4552. item = new ShowItem();
  4553. item.setParent(this.ui.myNode.displayRoot);
  4554. item.setPos(data.x, data.y);
  4555. item.setUrl(data.value);
  4556. this.showItemArr.push(item);
  4557. }
  4558. }
  4559. updateSelf() {
  4560. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4561. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4562. if (this.data.ball == -1) {
  4563. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4564. }
  4565. else {
  4566. this.ui.myNode.conditionTxt.text = "Reward";
  4567. }
  4568. let localData = DataMgr.getPlaceBallLevel(this.level);
  4569. let getAward = localData.getAward;
  4570. let cfg = cfgTable.placeballData[this.level];
  4571. let coin = this.data.award[0];
  4572. let diamond = this.data.award[1];
  4573. if (cfg.type == PlaceBallType.challenge) {
  4574. diamond = 0;
  4575. coin = 100;
  4576. }
  4577. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4578. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4579. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4580. if (cfg.type == PlaceBallType.challenge) {
  4581. this.ui.myNode.coinNode.numTxt.text = "";
  4582. }
  4583. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4584. if (coin > 0 && diamond > 0) {
  4585. this.ui.myNode.diamondNode.x = 385;
  4586. this.ui.myNode.coinNode.x = 467;
  4587. }
  4588. else {
  4589. this.ui.myNode.diamondNode.x = 385;
  4590. this.ui.myNode.coinNode.x = 385;
  4591. }
  4592. if (!getAward) {
  4593. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4594. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4595. }
  4596. else {
  4597. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4598. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4599. }
  4600. }
  4601. startGame() {
  4602. if (DataMgr.powerEnough()) {
  4603. this.ui.myNode.startBtn.touchable = false;
  4604. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4605. console.log('zh:startGame ');
  4606. this.ui.myNode.startBtn.touchable = true;
  4607. DataMgr.setPower(-1);
  4608. xGame.eventMgr.event(POWER_TIME);
  4609. xGame.common.gameMode = GameMode.placeBall;
  4610. xGame.common.placeBallCurLevel = this.level;
  4611. xGame.uiMgr.Show(UIGame);
  4612. xGame.uiMgr.Hide(UILevelDisplay);
  4613. xGame.uiMgr.Hide(UIMain);
  4614. this.hide();
  4615. }));
  4616. }
  4617. else {
  4618. xGame.uiMgr.Show(UIPower);
  4619. }
  4620. }
  4621. hide() {
  4622. super.hide();
  4623. }
  4624. }
  4625. UILevelProp.uiName = "UILevelProp";
  4626. class PutBallLevelDisplay {
  4627. constructor(ui, index) {
  4628. this.index = 0;
  4629. this.ui = ui;
  4630. this.index = index;
  4631. this.ui.onClick(this, this.clickSelf);
  4632. this.updateSelf();
  4633. this.ui.levelTxt.text = (this.index + 1) + "";
  4634. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4635. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4636. }
  4637. updateSelf() {
  4638. let level = this.index + 1;
  4639. this.data = DataMgr.getPlaceBallLevel(level);
  4640. this.ui.starNode.c1.selectedIndex = this.data.star;
  4641. let isChallenge = cfgTable.placeballData[level].type;
  4642. if (this.data.isCur) {
  4643. if (isChallenge) {
  4644. this.ui.c1.selectedIndex = 5;
  4645. }
  4646. else {
  4647. this.ui.c1.selectedIndex = 2;
  4648. }
  4649. }
  4650. else {
  4651. if (this.data.play) {
  4652. if (this.data.star == 3) {
  4653. this.ui.c1.selectedIndex = 0;
  4654. }
  4655. else {
  4656. this.ui.c1.selectedIndex = 1;
  4657. }
  4658. }
  4659. else {
  4660. if (isChallenge) {
  4661. this.ui.c1.selectedIndex = 4;
  4662. }
  4663. else {
  4664. this.ui.c1.selectedIndex = 3;
  4665. }
  4666. }
  4667. }
  4668. }
  4669. clickSelf() {
  4670. if (!this.data.play)
  4671. return;
  4672. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4673. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4674. }
  4675. }
  4676. class UILevelDisplay extends UIBase {
  4677. constructor() {
  4678. super();
  4679. }
  4680. onConstructor() {
  4681. this.ui = ui_UILevelDisplay.createInstance();
  4682. this.contentPane = this.ui;
  4683. this.isEject = false;
  4684. this.myList = this.ui.myNode.myList;
  4685. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4686. this.levelItemArr = [];
  4687. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4688. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4689. this.myList.numItems = levelNum;
  4690. if (Moyu.isKs)
  4691. this.ui.closeNode.closeBtn.x += 100;
  4692. }
  4693. levelItemRender(index, target) {
  4694. let item = new PutBallLevelDisplay(target, index);
  4695. this.levelItemArr.push(item);
  4696. }
  4697. show() {
  4698. super.show();
  4699. this.updateLevel();
  4700. this.scrollToPlace();
  4701. }
  4702. updateLevel() {
  4703. let temp;
  4704. for (let index = 0; index < this.levelItemArr.length; index++) {
  4705. temp = this.levelItemArr[index];
  4706. temp.updateSelf();
  4707. }
  4708. }
  4709. scrollToPlace() {
  4710. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4711. let passArr = DataMgr.getPlaceBallLevelList();
  4712. let offest = passArr.length;
  4713. if (offest >= maxNum - 1)
  4714. offest = maxNum - 1;
  4715. this.myList.scrollToView(offest, true, true);
  4716. }
  4717. hide() {
  4718. super.hide();
  4719. }
  4720. }
  4721. UILevelDisplay.uiName = "UILevelDisplay";
  4722. class ui_UIMatching extends fgui.GComponent {
  4723. static createInstance() {
  4724. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4725. }
  4726. onConstruct() {
  4727. this.n5 = (this.getChild("n5"));
  4728. this.n49 = (this.getChild("n49"));
  4729. this.n51 = (this.getChild("n51"));
  4730. this.n64 = (this.getChild("n64"));
  4731. this.n2 = (this.getChild("n2"));
  4732. this.n53 = (this.getChild("n53"));
  4733. this.n54 = (this.getChild("n54"));
  4734. this.n56 = (this.getChild("n56"));
  4735. this.n58 = (this.getChild("n58"));
  4736. this.n59 = (this.getChild("n59"));
  4737. this.n57 = (this.getChild("n57"));
  4738. this.n60 = (this.getChild("n60"));
  4739. this.n62 = (this.getChild("n62"));
  4740. this.awardTxt = (this.getChild("awardTxt"));
  4741. this.n61 = (this.getChild("n61"));
  4742. this.selfHead = (this.getChild("selfHead"));
  4743. this.aiHead = (this.getChild("aiHead"));
  4744. this.n82 = (this.getChild("n82"));
  4745. this.n84 = (this.getChild("n84"));
  4746. this.n83 = (this.getChild("n83"));
  4747. this.t1 = this.getTransition("t1");
  4748. this.t2 = this.getTransition("t2");
  4749. this.t3 = this.getTransition("t3");
  4750. this.t4 = this.getTransition("t4");
  4751. }
  4752. }
  4753. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4754. class UIMatching extends UIBase {
  4755. constructor() {
  4756. super();
  4757. }
  4758. onConstructor() {
  4759. this.ui = ui_UIMatching.createInstance();
  4760. this.contentPane = this.ui;
  4761. this.isEject = false;
  4762. }
  4763. show(callback) {
  4764. super.show();
  4765. PlatMgr.showBanner(true);
  4766. this.callback = callback;
  4767. let user = Moyu.getUserInfo();
  4768. if (!this.selfPot) {
  4769. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4770. }
  4771. if (!this.aiPot) {
  4772. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4773. }
  4774. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4775. this.ui.selfHead.nameTxt.text = user.nickName;
  4776. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4777. this.ui.aiHead.nameTxt.text = "???";
  4778. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4779. this.ui.selfHead.c1.selectedIndex = 0;
  4780. this.ui.aiHead.c1.selectedIndex = 0;
  4781. this.ui.selfHead.x = this.selfPot.x;
  4782. this.ui.selfHead.y = this.selfPot.y;
  4783. this.ui.aiHead.x = this.aiPot.x;
  4784. this.ui.aiHead.y = this.aiPot.y;
  4785. switch (xGame.common.gameMode) {
  4786. case GameMode.classic:
  4787. break;
  4788. case GameMode.bigMove:
  4789. this.initSkillData();
  4790. break;
  4791. default:
  4792. break;
  4793. }
  4794. this.ui.t1.play(Laya.Handler.create(this, () => {
  4795. this.ui.t2.play(Laya.Handler.create(this, () => {
  4796. switch (xGame.common.gameMode) {
  4797. case GameMode.classic:
  4798. this.waitingPeople();
  4799. break;
  4800. case GameMode.bigMove:
  4801. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4802. break;
  4803. default:
  4804. break;
  4805. }
  4806. }));
  4807. }));
  4808. }
  4809. initSkillData() {
  4810. this.skillSelectData = [];
  4811. let skillUrl = xGame.common.skillIconList;
  4812. let skillName = xGame.common.skillNameList;
  4813. let skillLevel = DataMgr.getBigSkillList();
  4814. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4815. for (let index = 0; index < 5; index++) {
  4816. let obj = {};
  4817. obj.skillImg = skillUrl[index];
  4818. obj.skillName = skillName[index];
  4819. obj.skillType = skillType[index];
  4820. obj.skillLevel = skillLevel[index];
  4821. this.skillSelectData.push(obj);
  4822. }
  4823. }
  4824. getAISkillLevel(myLevel) {
  4825. let video = xGame.common.upSkillLevel;
  4826. let aiLevel;
  4827. let temp;
  4828. if (video) {
  4829. temp = xGame.common.randomNum(-2, -1);
  4830. }
  4831. else {
  4832. if (myLevel <= 5) {
  4833. temp = xGame.common.randomNum(1, 3);
  4834. }
  4835. else if (myLevel <= 9) {
  4836. temp = xGame.common.randomNum(-2, 1);
  4837. }
  4838. else {
  4839. temp = xGame.common.randomNum(-4, 0);
  4840. }
  4841. }
  4842. aiLevel = temp + myLevel;
  4843. if (aiLevel <= 1)
  4844. aiLevel = 1;
  4845. if (aiLevel >= 10)
  4846. aiLevel = 10;
  4847. return aiLevel;
  4848. }
  4849. getAISkillType() {
  4850. return xGame.common.randomNum(1, 4);
  4851. let successTimes = DataMgr.getSkillSuccessTimes();
  4852. let info = cfgTable.aiskillData[successTimes];
  4853. if (!info) {
  4854. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4855. info = cfgTable.aiskillData[max];
  4856. }
  4857. let dataArr = info.skillselect;
  4858. let myCfg = {};
  4859. for (let index = 0; index < dataArr.length; index++) {
  4860. let temp = dataArr[index].split('-');
  4861. myCfg[temp[0]] = {};
  4862. myCfg[temp[0]].id = parseInt(temp[0]);
  4863. myCfg[temp[0]].weight = parseInt(temp[1]);
  4864. }
  4865. let aiCfg = xGame.common.initWeight(myCfg);
  4866. let curData = xGame.common.getRandomWeightData(aiCfg);
  4867. return parseInt(curData.id);
  4868. }
  4869. getAISkillData(index) {
  4870. let myLevel = this.skillSelectData[index].skillLevel;
  4871. let aiLevel = this.getAISkillLevel(myLevel);
  4872. let aiType = this.getAISkillType() - 1;
  4873. return { aiLevel, aiType } = { aiLevel, aiType };
  4874. }
  4875. skillSelectFinish(index) {
  4876. let aiInfo = this.getAISkillData(index);
  4877. xGame.common.gameMgr.selfCurSkill = index;
  4878. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4879. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4880. this.ui.selfHead.c1.selectedIndex = 1;
  4881. this.ui.aiHead.c1.selectedIndex = 1;
  4882. let myData = this.skillSelectData[index];
  4883. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4884. let guide = DataMgr.getSkillGuide();
  4885. if (guide == 0) {
  4886. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  4887. }
  4888. else {
  4889. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4890. }
  4891. let aiData = this.skillSelectData[aiInfo.aiType];
  4892. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4893. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4894. this.waitingPeople();
  4895. }
  4896. waitingPeople() {
  4897. let time = xGame.common.randomNum(1000, 3000);
  4898. time += 1000;
  4899. Laya.timer.once(time, this, () => {
  4900. this.matchingSuccess();
  4901. });
  4902. }
  4903. matchingSuccess() {
  4904. let gameUI = xGame.common.gameUI;
  4905. let name = gameUI.ui.topNode.aiNameTxt.text;
  4906. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4907. this.ui.aiHead.nameTxt.text = name;
  4908. this.ui.aiHead.headImg.url = url;
  4909. name = gameUI.ui.topNode.selfNameTxt.text;
  4910. url = gameUI.ui.topNode.selfHeadLoader.url;
  4911. this.ui.selfHead.nameTxt.text = name;
  4912. this.ui.selfHead.headImg.url = url;
  4913. this.ui.t3.play(Laya.Handler.create(this, () => {
  4914. this.callback && this.callback();
  4915. this.ui.t4.play(Laya.Handler.create(this, () => {
  4916. this.destroySelf();
  4917. }));
  4918. }));
  4919. }
  4920. destroySelf() {
  4921. this.callback = null;
  4922. this.skillSelectData = null;
  4923. this.selfPot = null;
  4924. this.aiPot = null;
  4925. if (!this.ui.isDisposed) {
  4926. this.ui.removeFromParent();
  4927. this.ui.dispose();
  4928. }
  4929. xGame.uiMgr.destroyUI(this);
  4930. }
  4931. }
  4932. UIMatching.uiName = "UIMatching";
  4933. class ui_UIRanking extends fgui.GComponent {
  4934. static createInstance() {
  4935. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4936. }
  4937. onConstruct() {
  4938. this.n26 = (this.getChild("n26"));
  4939. this.myNode = (this.getChild("myNode"));
  4940. }
  4941. }
  4942. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4943. class UIRanking extends UIBase {
  4944. constructor() {
  4945. super();
  4946. this.showSelf = true;
  4947. this.rankType = 1;
  4948. this.rankList = [];
  4949. this.myIndex = 0;
  4950. this.myStar = 0;
  4951. }
  4952. onConstructor() {
  4953. this.ui = ui_UIRanking.createInstance();
  4954. this.contentPane = this.ui;
  4955. this.isEject = false;
  4956. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4957. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4958. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4959. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4960. this.ui.myNode.myList.setVirtual();
  4961. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4962. }
  4963. show() {
  4964. super.show();
  4965. this.myIndex = 51;
  4966. Moyu.getRankList({
  4967. rankId: xGame.common.curRankID,
  4968. type: MoyuRankType.total,
  4969. page: 1,
  4970. pageSize: 50,
  4971. }, this, this.updateItemData);
  4972. this.updateSelf();
  4973. let self = Moyu.getUserInfo();
  4974. if (!self.isAuth) {
  4975. Moyu.initUser(this, () => {
  4976. DataMgr.upRankData();
  4977. });
  4978. }
  4979. }
  4980. updateSelfItem() {
  4981. let self = Moyu.getUserInfo();
  4982. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4983. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4984. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4985. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  4986. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4987. }
  4988. updateItemData(data) {
  4989. this.myStar = xGame.common.getAllStarNum();
  4990. if (this.rankList.length < 2) {
  4991. this.rankList = data;
  4992. let self = Moyu.getUserInfo();
  4993. for (let i = 0; i < data.length; i++) {
  4994. let data = this.rankList[i];
  4995. if (data.userId == self.userId) {
  4996. this.rankList.splice(i, 1);
  4997. break;
  4998. }
  4999. }
  5000. for (let i = 0; i < data.length; i++) {
  5001. let data = this.rankList[i];
  5002. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5003. this.myIndex = i + 1;
  5004. let user = { headIcon: self.headIcon, nickName: "myself" };
  5005. let ud = { user: user, data: {} };
  5006. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5007. if (Moyu.platType < 11) {
  5008. user.headIcon = self.headIcon;
  5009. user.nickName = self.nickName;
  5010. }
  5011. this.rankList.splice(i, 0, md);
  5012. break;
  5013. }
  5014. }
  5015. }
  5016. this.updateSelfItem();
  5017. this.ui.myNode.myList.numItems = this.rankList.length;
  5018. }
  5019. updateItemUI(index, obj) {
  5020. let data = this.rankList[index];
  5021. let userData = JSON.parse(data.userData).user;
  5022. obj.nameTxt.text = userData.nickName.toString();
  5023. obj.valueTxt.text = data.rankScore;
  5024. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5025. obj.rankTxt.text = index + 1;
  5026. switch (index) {
  5027. case 0:
  5028. this.setImg(obj, 1, 0, 0);
  5029. obj.rankTxt.color = "#FFC047";
  5030. break;
  5031. case 1:
  5032. this.setImg(obj, 0, 1, 0);
  5033. obj.rankTxt.color = "#ACACAC";
  5034. break;
  5035. case 2:
  5036. this.setImg(obj, 0, 0, 1);
  5037. obj.rankTxt.color = "#D09672";
  5038. break;
  5039. default:
  5040. this.setImg(obj, 0, 0, 0);
  5041. obj.rankTxt.color = "#496FAB";
  5042. break;
  5043. }
  5044. }
  5045. setImg(obj, a, b, c) {
  5046. obj.img1.visible = a ? true : false;
  5047. obj.img2.visible = b ? true : false;
  5048. obj.img3.visible = c ? true : false;
  5049. }
  5050. changeList(type) {
  5051. this.rankType = type;
  5052. this.updateSelf();
  5053. }
  5054. changeSelfNode() {
  5055. this.showSelf = !this.showSelf;
  5056. this.updateSelf();
  5057. }
  5058. updateSelf() {
  5059. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5060. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5061. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5062. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5063. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5064. }
  5065. }
  5066. UIRanking.uiName = "UIRanking";
  5067. class ui_UISecretary extends fgui.GComponent {
  5068. static createInstance() {
  5069. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5070. }
  5071. onConstruct() {
  5072. this.n0 = (this.getChild("n0"));
  5073. this.myNode = (this.getChild("myNode"));
  5074. this.rightBtn = (this.getChild("rightBtn"));
  5075. this.leftBtn = (this.getChild("leftBtn"));
  5076. this.closeBtn = (this.getChild("closeBtn"));
  5077. this.t0 = this.getTransition("t0");
  5078. }
  5079. }
  5080. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5081. class UISecretary extends UIBase {
  5082. constructor() {
  5083. super();
  5084. this.curIndex = 1;
  5085. }
  5086. onConstructor() {
  5087. this.ui = ui_UISecretary.createInstance();
  5088. this.contentPane = this.ui;
  5089. this.isEject = false;
  5090. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5091. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  5092. this.addUIClick(this.ui.rightBtn, this.turnRight);
  5093. this.nodeObj = { left: null, right: null, cur: null };
  5094. this.nodeObj.left = this.ui.myNode.gameNode1;
  5095. this.nodeObj.right = this.ui.myNode.gameNode2;
  5096. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5097. }
  5098. show() {
  5099. super.show();
  5100. this.ui.t0.play();
  5101. this.updateData();
  5102. }
  5103. addSecretarySpine(node, spineName) {
  5104. if (spineName == "mishu") {
  5105. if (this.secretarySpine1) {
  5106. node.displayObject.destroyChildren();
  5107. this.playWoman(this.secretarySpine1, node.displayObject);
  5108. }
  5109. else {
  5110. let spine1 = new SpineMgr("mishu", () => {
  5111. this.secretarySpine1 = spine1;
  5112. this.playWoman(this.secretarySpine1, node.displayObject);
  5113. });
  5114. }
  5115. }
  5116. else {
  5117. if (this.secretarySpine2) {
  5118. node.displayObject.destroyChildren();
  5119. this.playWoman(this.secretarySpine2, node.displayObject);
  5120. }
  5121. else {
  5122. let spine2 = new SpineMgr("xiaomishu2", () => {
  5123. this.secretarySpine2 = spine2;
  5124. this.playWoman(this.secretarySpine2, node.displayObject);
  5125. });
  5126. }
  5127. }
  5128. }
  5129. playWoman(node, parent) {
  5130. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  5131. let yy = this.ui.myNode.gameNode1.secretary.height;
  5132. let scale = 1.5;
  5133. if (node == this.secretarySpine2) {
  5134. scale = 1.2;
  5135. }
  5136. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5137. node.play(data, 1, true, parent);
  5138. }
  5139. turnLeft() {
  5140. this.curIndex--;
  5141. if (this.curIndex < 1) {
  5142. this.curIndex = 2;
  5143. }
  5144. let left = this.nodeObj.left;
  5145. let right = this.nodeObj.right;
  5146. let cur = this.nodeObj.cur;
  5147. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5148. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5149. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5150. this.updateData();
  5151. }));
  5152. this.ui.myNode.setChildIndex(right, 2);
  5153. this.nodeObj.left = cur;
  5154. this.nodeObj.right = left;
  5155. this.nodeObj.cur = right;
  5156. }
  5157. turnRight() {
  5158. this.curIndex++;
  5159. if (this.curIndex > 2) {
  5160. this.curIndex = 1;
  5161. }
  5162. let left = this.nodeObj.left;
  5163. let right = this.nodeObj.right;
  5164. let cur = this.nodeObj.cur;
  5165. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5166. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5167. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5168. this.updateData();
  5169. }));
  5170. this.ui.myNode.setChildIndex(left, 2);
  5171. this.nodeObj.left = right;
  5172. this.nodeObj.right = cur;
  5173. this.nodeObj.cur = left;
  5174. }
  5175. updateData() {
  5176. let data = cfgTable.secretaryshopData;
  5177. let children = this.ui.myNode._children;
  5178. let temp;
  5179. let curData;
  5180. for (let index = 0; index < children.length; index++) {
  5181. temp = children[index];
  5182. if (index == 2) {
  5183. curData = data[this.curIndex];
  5184. temp.purchaseBtn.touchable = true;
  5185. }
  5186. else {
  5187. temp.purchaseBtn.touchable = false;
  5188. if (this.curIndex == 1) {
  5189. curData = data[2];
  5190. }
  5191. else {
  5192. curData = data[1];
  5193. }
  5194. }
  5195. temp.heightTxt.text = curData.height;
  5196. temp.foodTxt.text = curData.food;
  5197. temp.historyTxt.text = curData.history;
  5198. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5199. this.addSecretarySpine(temp.secretary, curData.spine);
  5200. let womanIndex = curData.id - 1;
  5201. let getWoman = DataMgr.getSecretary(womanIndex);
  5202. let curUse = DataMgr.getCurSecretary();
  5203. if (getWoman) {
  5204. if (curUse == womanIndex) {
  5205. temp.purchaseBtn.c1.selectedIndex = 1;
  5206. }
  5207. else {
  5208. temp.purchaseBtn.c1.selectedIndex = 2;
  5209. }
  5210. }
  5211. else {
  5212. temp.purchaseBtn.c1.selectedIndex = 0;
  5213. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5214. }
  5215. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5216. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5217. }
  5218. }
  5219. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5220. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5221. if (getWoman) {
  5222. if (curUse != womanIndex) {
  5223. console.log();
  5224. DataMgr.setCurSecretary(womanIndex);
  5225. this.updateData();
  5226. }
  5227. }
  5228. else {
  5229. let need = needDiamond;
  5230. if (DataMgr.diamondEnough(need)) {
  5231. DataMgr.setDiamond(-need);
  5232. DataMgr.setSecretary(womanIndex, 1);
  5233. DataMgr.setCurSecretary(womanIndex);
  5234. this.updateData();
  5235. }
  5236. else {
  5237. xGame.uiMgr.Show(UIAddProp, 1);
  5238. }
  5239. }
  5240. }
  5241. closeSelf() {
  5242. this.hide();
  5243. }
  5244. }
  5245. UISecretary.uiName = "UISecretary";
  5246. class ui_UIShop extends fgui.GComponent {
  5247. static createInstance() {
  5248. return (fgui.UIPackage.createObject("game", "UIShop"));
  5249. }
  5250. onConstruct() {
  5251. this.n48 = (this.getChild("n48"));
  5252. this.n0 = (this.getChild("n0"));
  5253. this.secretary = (this.getChild("secretary"));
  5254. this.talkNode = (this.getChild("talkNode"));
  5255. this.closeNode = (this.getChild("closeNode"));
  5256. this.moneyNode = (this.getChild("moneyNode"));
  5257. this.myNode = (this.getChild("myNode"));
  5258. }
  5259. }
  5260. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5261. class BallRodDisplay {
  5262. constructor(ui, index) {
  5263. this.index = 0;
  5264. this.uiIndex = 0;
  5265. this.ui = ui;
  5266. this.index = index;
  5267. this.initData();
  5268. }
  5269. initData() {
  5270. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5271. let data = cfgTable.ballrodData[this.index + 1];
  5272. this.ui.nameTxt.text = data.name;
  5273. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5274. this.ui.levelNode.c1.selectedIndex = data.quality;
  5275. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5276. if (data.spine) {
  5277. this.mySpine = new SpineMgr(data.spine, () => {
  5278. let xx = 150;
  5279. let yy = 70;
  5280. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5281. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5282. });
  5283. }
  5284. }
  5285. updateSelf() {
  5286. let get = DataMgr.getBallRod(this.index);
  5287. if (get == null)
  5288. get = 1;
  5289. let curUse = DataMgr.getCurBallRod();
  5290. if (get) {
  5291. if (curUse == this.index) {
  5292. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5293. }
  5294. else {
  5295. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5296. }
  5297. }
  5298. else {
  5299. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5300. }
  5301. }
  5302. buyBallRod() {
  5303. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5304. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5305. switch (selectedIndex) {
  5306. case 0:
  5307. break;
  5308. case 1:
  5309. DataMgr.setCurBallRod(this.index);
  5310. let ui = xGame.uiMgr.getUI(UIShop);
  5311. ui.updateBallRod();
  5312. break;
  5313. case 2:
  5314. let data = cfgTable.ballrodData[this.index + 1];
  5315. let need = data.price;
  5316. if (DataMgr.diamondEnough(need)) {
  5317. DataMgr.setDiamond(-need);
  5318. DataMgr.setBallRod(this.index, 1);
  5319. DataMgr.setCurBallRod(this.index);
  5320. let ui = xGame.uiMgr.getUI(UIShop);
  5321. ui.updateBallRod();
  5322. }
  5323. else {
  5324. xGame.uiMgr.Show(UIAddProp, 1);
  5325. }
  5326. break;
  5327. default:
  5328. break;
  5329. }
  5330. }
  5331. }
  5332. class UIShop extends UIBase {
  5333. constructor() {
  5334. super();
  5335. this.itemNums = 0;
  5336. }
  5337. onConstructor() {
  5338. this.ui = ui_UIShop.createInstance();
  5339. this.contentPane = this.ui;
  5340. this.isEject = false;
  5341. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5342. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5343. this.addUIClick(this.ui, this.interuptSecretary);
  5344. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5345. this.ballRodArr = [];
  5346. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5347. this.ui.myNode.myList.numItems = this.itemNums;
  5348. if (Moyu.isKs)
  5349. this.ui.closeNode.closeBtn.x += 100;
  5350. }
  5351. show() {
  5352. super.show();
  5353. this.playSecretaryIdle();
  5354. this.updateBallRod();
  5355. }
  5356. updateBallRod() {
  5357. for (let index = 0; index < this.ballRodArr.length; index++) {
  5358. this.ballRodArr[index].updateSelf();
  5359. }
  5360. }
  5361. renderBallRod(sort, obj) {
  5362. let index = this.getIndexBySort(sort + 1) - 1;
  5363. let ballRod = new BallRodDisplay(obj, index);
  5364. this.ballRodArr.push(ballRod);
  5365. }
  5366. getIndexBySort(sort) {
  5367. let object = cfgTable.ballrodData;
  5368. for (const key in object) {
  5369. if (object[key].sort == sort) {
  5370. return parseInt(key);
  5371. }
  5372. }
  5373. }
  5374. playSecretaryIdle() {
  5375. let parent = this.ui.secretary.displayObject;
  5376. parent.destroyChildren();
  5377. let xx = this.ui.secretary.width / 2;
  5378. let yy = this.ui.secretary.height;
  5379. let scale = xGame.common.getSecretaryScale();
  5380. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5381. xGame.common.secretary.play(data, 1, true, parent);
  5382. }
  5383. interuptSecretary() {
  5384. Laya.timer.clearAll(this);
  5385. this.playSecretaryRandomSound();
  5386. }
  5387. playSecretaryRandomSound() {
  5388. if (this.isHide)
  5389. return;
  5390. let time = xGame.common.randomNum(45000, 60000);
  5391. Laya.timer.once(time, this, () => {
  5392. if (this.isHide)
  5393. return;
  5394. let index = xGame.common.randomNum(4, 7);
  5395. xGame.soundMgr.playSound("s_main0" + index);
  5396. let words = 1;
  5397. switch (index) {
  5398. case 4:
  5399. words = 5;
  5400. break;
  5401. case 5:
  5402. words = 3;
  5403. break;
  5404. case 6:
  5405. words = 6;
  5406. break;
  5407. case 7:
  5408. words = 7;
  5409. break;
  5410. default:
  5411. break;
  5412. }
  5413. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5414. this.playSecretaryRandomSound();
  5415. });
  5416. }
  5417. closeSelf() {
  5418. this.hide();
  5419. }
  5420. }
  5421. UIShop.uiName = "UIShop";
  5422. class ui_UISign extends fgui.GComponent {
  5423. static createInstance() {
  5424. return (fgui.UIPackage.createObject("game", "UISign"));
  5425. }
  5426. onConstruct() {
  5427. this.n6 = (this.getChild("n6"));
  5428. this.closeNode = (this.getChild("closeNode"));
  5429. this.myNode = (this.getChild("myNode"));
  5430. this.moneyNode = (this.getChild("moneyNode"));
  5431. this.secretary = (this.getChild("secretary"));
  5432. this.talkNode = (this.getChild("talkNode"));
  5433. this.tripleBtn = (this.getChild("tripleBtn"));
  5434. this.normalBtn = (this.getChild("normalBtn"));
  5435. this.tipsNode = (this.getChild("tipsNode"));
  5436. this.againBtn = (this.getChild("againBtn"));
  5437. this.t0 = this.getTransition("t0");
  5438. }
  5439. }
  5440. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5441. class SignMax {
  5442. constructor(ui) {
  5443. this.ui = ui;
  5444. }
  5445. updateSelf(index, sameDay, curDayIndex) {
  5446. let data = cfgTable.signData[index + 1];
  5447. this.ui.titleTxt.text = data.title;
  5448. let arr1 = data.award[0].split('-');
  5449. let arr2 = data.award[1].split('-');
  5450. let num1 = parseInt(arr1[1]);
  5451. let num2 = parseInt(arr2[1]);
  5452. this.ui.numTxt1.text = num1 + "";
  5453. this.ui.numTxt2.text = num2 + "";
  5454. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5455. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5456. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5457. this.ui.numTxt1.visible = false;
  5458. }
  5459. else {
  5460. this.ui.numTxt1.visible = true;
  5461. }
  5462. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5463. this.ui.numTxt2.visible = false;
  5464. }
  5465. else {
  5466. this.ui.numTxt2.visible = true;
  5467. }
  5468. if (index < curDayIndex) {
  5469. this.ui.c1.selectedIndex = 1;
  5470. }
  5471. else if (index == curDayIndex) {
  5472. if (sameDay) {
  5473. this.ui.c1.selectedIndex = 2;
  5474. }
  5475. else {
  5476. this.ui.c1.selectedIndex = 2;
  5477. }
  5478. }
  5479. else {
  5480. this.ui.c1.selectedIndex = 0;
  5481. }
  5482. }
  5483. }
  5484. class SignNormal {
  5485. constructor(ui) {
  5486. this.ui = ui;
  5487. }
  5488. updateSelf(index, sameDay, curDayIndex) {
  5489. let data = cfgTable.signData[index + 1];
  5490. this.ui.titleTxt.text = data.title;
  5491. let arr = data.award[0].split('-');
  5492. let type = parseInt(arr[0]);
  5493. let num = parseInt(arr[1]);
  5494. this.ui.numTxt.text = num + "";
  5495. if (type > 2) {
  5496. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5497. this.ui.myIcon.rotation = 0;
  5498. }
  5499. else {
  5500. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5501. this.ui.myIcon.rotation = 0;
  5502. }
  5503. if (xGame.common.signAwardContainsRod(data.award)) {
  5504. this.ui.numTxt.visible = false;
  5505. }
  5506. else {
  5507. this.ui.numTxt.visible = true;
  5508. }
  5509. if (index < curDayIndex) {
  5510. this.ui.c1.selectedIndex = 1;
  5511. }
  5512. else if (index == curDayIndex) {
  5513. if (sameDay) {
  5514. this.ui.c1.selectedIndex = 2;
  5515. }
  5516. else {
  5517. this.ui.c1.selectedIndex = 2;
  5518. }
  5519. }
  5520. else {
  5521. this.ui.c1.selectedIndex = 0;
  5522. }
  5523. }
  5524. }
  5525. class UISign extends UIBase {
  5526. constructor() {
  5527. super();
  5528. this.curDayIndex = 0;
  5529. this.starX = 0;
  5530. }
  5531. onConstructor() {
  5532. this.ui = ui_UISign.createInstance();
  5533. this.contentPane = this.ui;
  5534. this.isEject = false;
  5535. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5536. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5537. this.initSignItem();
  5538. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5539. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5540. }
  5541. show() {
  5542. super.show();
  5543. this.ui.t0.play();
  5544. this.playSecretaryIdle();
  5545. this.updateSign();
  5546. }
  5547. initSignItem() {
  5548. this.signArr = [];
  5549. for (let index = 0; index < 6; index++) {
  5550. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5551. this.signArr.push(temp);
  5552. }
  5553. this.signMax = new SignMax(this.ui.myNode.day7);
  5554. if (Moyu.isKs)
  5555. this.ui.closeNode.closeBtn.x += 100;
  5556. }
  5557. updateSign() {
  5558. let sameDay = xGame.common.judgeSameDay();
  5559. let max = 7;
  5560. this.curDayIndex = DataMgr.getSignData();
  5561. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5562. this.curDayIndex = 0;
  5563. if (!sameDay) {
  5564. this.ui.normalBtn.visible = true;
  5565. this.ui.tipsNode.visible = false;
  5566. this.ui.againBtn.visible = false;
  5567. }
  5568. else {
  5569. this.ui.normalBtn.visible = false;
  5570. let again = DataMgr.getExtraSign();
  5571. let isCurrency = false;
  5572. let index = this.curDayIndex;
  5573. if (index == 0)
  5574. index = 7;
  5575. let award = cfgTable.signData[index].award;
  5576. let num = award[0].split("-")[0];
  5577. if (num == "1" || num == "2")
  5578. isCurrency = true;
  5579. let showAgain = again == 0 && isCurrency;
  5580. this.ui.againBtn.visible = showAgain;
  5581. this.ui.tipsNode.visible = !showAgain;
  5582. }
  5583. for (let index = 0; index < this.signArr.length; index++) {
  5584. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5585. }
  5586. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5587. }
  5588. playSecretaryIdle() {
  5589. let parent = this.ui.secretary.displayObject;
  5590. parent.destroyChildren();
  5591. let xx = this.ui.secretary.width / 2;
  5592. let yy = this.ui.secretary.height;
  5593. let scale = xGame.common.getSecretaryScale();
  5594. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5595. xGame.common.secretary.play(data, 1, true, parent);
  5596. }
  5597. closeSelf() {
  5598. this.hide();
  5599. }
  5600. normalGetAward() {
  5601. let sameDay = xGame.common.judgeSameDay();
  5602. if (!sameDay) {
  5603. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5604. let temp;
  5605. let type;
  5606. let num;
  5607. let arr = [];
  5608. for (let index = 0; index < award.length; index++) {
  5609. temp = award[index].split("-");
  5610. type = parseInt(temp[0]);
  5611. num = parseInt(temp[1]);
  5612. let awardType = new AwardType();
  5613. awardType.num = num;
  5614. awardType.type = type;
  5615. arr.push(awardType);
  5616. }
  5617. xGame.common.getAward(arr, (watchVideo) => {
  5618. this.curDayIndex++;
  5619. if (this.curDayIndex > 7)
  5620. this.curDayIndex = 0;
  5621. DataMgr.setSignData(this.curDayIndex);
  5622. DataMgr.setSignTime(new Date().getTime());
  5623. if (watchVideo) {
  5624. DataMgr.setExtraSign(1);
  5625. Moyu.sendDataEvent("signIn1");
  5626. }
  5627. this.updateSign();
  5628. });
  5629. }
  5630. }
  5631. againGetAward() {
  5632. Moyu.sendDataEvent("signIn2");
  5633. Moyu.showVideoAd(() => {
  5634. let index = this.curDayIndex;
  5635. if (index == 0)
  5636. index = 7;
  5637. let award = cfgTable.signData[index].award;
  5638. let temp;
  5639. let type;
  5640. let num;
  5641. for (let index = 0; index < award.length; index++) {
  5642. temp = award[index].split("-");
  5643. type = parseInt(temp[0]);
  5644. num = parseInt(temp[1]) * 3;
  5645. xGame.common.playObjFlyAnim(num, type);
  5646. }
  5647. DataMgr.setExtraSign(1);
  5648. this.updateSign();
  5649. }, EAdType.againSign);
  5650. }
  5651. }
  5652. UISign.uiName = "UISign";
  5653. class ui_UISkill extends fgui.GComponent {
  5654. static createInstance() {
  5655. return (fgui.UIPackage.createObject("game", "UISkill"));
  5656. }
  5657. onConstruct() {
  5658. this.n48 = (this.getChild("n48"));
  5659. this.n0 = (this.getChild("n0"));
  5660. this.secretary = (this.getChild("secretary"));
  5661. this.talkNode = (this.getChild("talkNode"));
  5662. this.closeNode = (this.getChild("closeNode"));
  5663. this.moneyNode = (this.getChild("moneyNode"));
  5664. this.skillNode = (this.getChild("skillNode"));
  5665. this.guideNode = (this.getChild("guideNode"));
  5666. }
  5667. }
  5668. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5669. class SkillDisplay {
  5670. constructor(ui, data, uiIndex) {
  5671. this.starX = 0;
  5672. this.starY = 0;
  5673. this.index = 0;
  5674. this.ui = ui;
  5675. this.data = data;
  5676. this.index = uiIndex;
  5677. this.initSelf();
  5678. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5679. }
  5680. initSelf() {
  5681. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5682. this.ui.nameTxt.text = this.data.name;
  5683. this.ui.describeTxt.text = this.data.describe;
  5684. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5685. this.ui.startBtn.onClick(this, this.startGame);
  5686. this.updateSelf();
  5687. }
  5688. updateSelf() {
  5689. this.checkTry();
  5690. let level = DataMgr.getBigSkillByIndex(this.index);
  5691. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5692. }
  5693. checkTry() {
  5694. let index = this.index;
  5695. let level = DataMgr.getBigSkillByIndex(index);
  5696. if (level == null) {
  5697. DataMgr.setBigSkill(index, 1, false);
  5698. level = 1;
  5699. }
  5700. this.ui.levelTxt.text = "LV." + level;
  5701. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5702. this.ui.tryNode.visible = true;
  5703. else
  5704. this.ui.tryNode.visible = false;
  5705. }
  5706. clickAddLevel() {
  5707. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5708. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5709. Moyu.showVideoAd(() => {
  5710. DataMgr.setBigSkill(this.data.index, 1);
  5711. this.updateSelf();
  5712. xGame.common.upSkillLevel = true;
  5713. }, EAdType.upSkill);
  5714. }
  5715. startGame() {
  5716. if (this.data.index == 3) {
  5717. alert('期待吧');
  5718. return;
  5719. }
  5720. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5721. let needCoin = xGame.common.bigMoveNeedCoin;
  5722. xGame.common.passAwardCoin = 2000;
  5723. let guide = DataMgr.getSkillGuide();
  5724. console.log('zh:startGame guide=' + guide);
  5725. xGame.common.temSelfLevel = 0;
  5726. if (guide == 0) {
  5727. needCoin = 0;
  5728. xGame.common.temSelfLevel = 100;
  5729. }
  5730. if (DataMgr.coinEnough(needCoin)) {
  5731. DataMgr.setCoin(-needCoin);
  5732. xGame.common.curPlayerSkillType = this.index;
  5733. if (guide == 0)
  5734. xGame.common.curPlayerSkillType = 0;
  5735. xGame.uiMgr.Show(UIGame);
  5736. xGame.uiMgr.Hide(UIMain);
  5737. xGame.uiMgr.Show(UIMatching, () => {
  5738. xGame.common.gameUI.ui.alpha = 1;
  5739. xGame.common.gameUI.startGame();
  5740. xGame.uiMgr.Hide(UISkill);
  5741. });
  5742. }
  5743. else {
  5744. xGame.uiMgr.Show(UIAddProp, 0);
  5745. Moyu.sendDataEvent("AddCoinVideo");
  5746. }
  5747. }
  5748. }
  5749. class UISkill extends UIBase {
  5750. constructor() {
  5751. super();
  5752. this.skillData = [];
  5753. }
  5754. onConstructor() {
  5755. this.ui = ui_UISkill.createInstance();
  5756. this.contentPane = this.ui;
  5757. this.isEject = false;
  5758. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5759. this.initSkillData();
  5760. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5761. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5762. this.displayList = [];
  5763. this.ui.skillNode.skillList.numItems = 4;
  5764. this.addUIClick(this.ui, this.interuptSecretary);
  5765. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5766. this.ui.talkNode.visible = false;
  5767. if (Moyu.isKs)
  5768. this.ui.closeNode.closeBtn.x += 100;
  5769. }
  5770. show() {
  5771. super.show();
  5772. this.playSecretaryIdle();
  5773. this.moneyNode.ui.c1.selectedIndex = 1;
  5774. Laya.timer.clearAll(this);
  5775. xGame.soundMgr.playSound("s_start");
  5776. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5777. let guide = DataMgr.getSkillGuide();
  5778. this.ui.guideNode.visible = guide == 0;
  5779. let item = this.getSkillItemByUIIndex(0);
  5780. if (guide == 0) {
  5781. item.ui.c1.selectedIndex = 1;
  5782. }
  5783. else {
  5784. item.ui.c1.selectedIndex = 0;
  5785. }
  5786. this.ui.guideNode.guideBtn.visible = guide == 0;
  5787. for (let index = 0; index < this.displayList.length; index++) {
  5788. this.displayList[index].checkTry();
  5789. }
  5790. }
  5791. getSkillItemByUIIndex(cur) {
  5792. for (let index = 0; index < this.displayList.length; index++) {
  5793. if (this.displayList[index].index == cur) {
  5794. return this.displayList[index];
  5795. }
  5796. }
  5797. }
  5798. enterGuideLevel() {
  5799. let item = this.getSkillItemByUIIndex(0);
  5800. item.startGame();
  5801. if (DataMgr.getNewUser())
  5802. Moyu.sendDataEvent("gameStart1");
  5803. }
  5804. initSkillData() {
  5805. this.skillData = [];
  5806. let nameList = xGame.common.skillNameList;
  5807. let iconList = xGame.common.skillIconList;
  5808. let describeList = [
  5809. "Jump shot executed — ball bounced and pocketed an extra one!",
  5810. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5811. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5812. ];
  5813. let data;
  5814. for (let index = 0; index < nameList.length; index++) {
  5815. data = {};
  5816. data.name = nameList[index];
  5817. data.icon = iconList[index];
  5818. data.describe = describeList[index];
  5819. data.index = index;
  5820. this.skillData.push(data);
  5821. }
  5822. }
  5823. updateSkillItem(index, target) {
  5824. if (this.displayList[index] == null) {
  5825. let uiIndex;
  5826. switch (index) {
  5827. case 0:
  5828. uiIndex = 1;
  5829. break;
  5830. case 1:
  5831. uiIndex = 0;
  5832. break;
  5833. case 2:
  5834. uiIndex = 2;
  5835. break;
  5836. case 3:
  5837. uiIndex = 3;
  5838. break;
  5839. default:
  5840. break;
  5841. }
  5842. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5843. this.displayList.push(temp);
  5844. }
  5845. }
  5846. playSecretaryIdle() {
  5847. let parent = this.ui.secretary.displayObject;
  5848. parent.destroyChildren();
  5849. let xx = this.ui.secretary.width / 2;
  5850. let yy = this.ui.secretary.height;
  5851. let scale = xGame.common.getSecretaryScale();
  5852. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5853. xGame.common.secretary.play(data, 1, true, parent);
  5854. }
  5855. returnUIMain() {
  5856. this.hide();
  5857. xGame.common.stopGirlPop(this.ui.talkNode);
  5858. xGame.uiMgr.Show(UIMain);
  5859. }
  5860. interuptSecretary() {
  5861. Laya.timer.clearAll(this);
  5862. this.playSecretaryRandomSound();
  5863. }
  5864. playSecretaryRandomSound() {
  5865. if (this.isHide)
  5866. return;
  5867. let time = xGame.common.randomNum(45000, 60000);
  5868. Laya.timer.once(time, this, () => {
  5869. if (this.isHide)
  5870. return;
  5871. let index = xGame.common.randomNum(4, 7);
  5872. xGame.soundMgr.playSound("s_main0" + index);
  5873. let words = 1;
  5874. switch (index) {
  5875. case 4:
  5876. words = 5;
  5877. break;
  5878. case 5:
  5879. words = 3;
  5880. break;
  5881. case 6:
  5882. words = 6;
  5883. break;
  5884. case 7:
  5885. words = 7;
  5886. break;
  5887. default:
  5888. break;
  5889. }
  5890. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5891. this.playSecretaryRandomSound();
  5892. });
  5893. }
  5894. }
  5895. UISkill.uiName = "UISkill";
  5896. class ui_UIMsg extends fgui.GComponent {
  5897. static createInstance() {
  5898. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5899. }
  5900. onConstruct() {
  5901. this.tipsNode = (this.getChild("tipsNode"));
  5902. }
  5903. }
  5904. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5905. class UIMsg extends UIBase {
  5906. constructor() {
  5907. super();
  5908. }
  5909. onConstructor() {
  5910. this.ui = ui_UIMsg.createInstance();
  5911. this.contentPane = this.ui;
  5912. this.isEject = false;
  5913. this.isMuti = true;
  5914. }
  5915. show(msg, callback) {
  5916. super.show();
  5917. this.ui.tipsNode.msgTxt.text = msg;
  5918. this.ui.alpha = 1;
  5919. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5920. this.hide();
  5921. callback && callback();
  5922. }), 1000);
  5923. }
  5924. }
  5925. UIMsg.uiName = "UIMsg";
  5926. class ui_UIModeSelection extends fgui.GComponent {
  5927. static createInstance() {
  5928. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5929. }
  5930. onConstruct() {
  5931. this.n19 = (this.getChild("n19"));
  5932. this.closeBtn = (this.getChild("closeBtn"));
  5933. this.myNode = (this.getChild("myNode"));
  5934. this.t0 = this.getTransition("t0");
  5935. }
  5936. }
  5937. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5938. class UIModeSelection extends UIBase {
  5939. constructor() {
  5940. super();
  5941. }
  5942. onConstructor() {
  5943. this.ui = ui_UIModeSelection.createInstance();
  5944. this.contentPane = this.ui;
  5945. this.isEject = false;
  5946. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5947. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5948. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5949. this.addUIClick(this.ui.closeBtn, this.hide);
  5950. this.peopleArr = [650, 6900, 3800];
  5951. this.peopleOffest = [50, 500, 200];
  5952. this.updateSelf();
  5953. }
  5954. show(callback) {
  5955. super.show();
  5956. this.ui.t0.play();
  5957. this.callback = callback;
  5958. }
  5959. updateSelf() {
  5960. let cfg = cfgTable.modeselectData;
  5961. for (let index = 1; index <= 3; index++) {
  5962. let node = this.ui.myNode["type" + index];
  5963. node.need.text = cfg[index].need;
  5964. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  5965. node.peopleTxt.text = this.getRandPeople(index - 1);
  5966. }
  5967. }
  5968. enterGame(type) {
  5969. xGame.common.classicRoomType = type;
  5970. let cfg = cfgTable.modeselectData[type];
  5971. let need = cfg.need;
  5972. xGame.common.passAwardCoin = cfg.award;
  5973. if (DataMgr.coinEnough(need)) {
  5974. DataMgr.setCoin(-need);
  5975. this.ui.myNode["type" + type].t0.play();
  5976. Laya.timer.once(200, this, () => {
  5977. this.callback && this.callback();
  5978. });
  5979. }
  5980. else {
  5981. Moyu.sendDataEvent("AddCoinVideo");
  5982. xGame.uiMgr.Show(UIAddProp, 0);
  5983. }
  5984. }
  5985. getRandPeople(index) {
  5986. let rand = this.peopleOffest[index];
  5987. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5988. }
  5989. }
  5990. UIModeSelection.uiName = "UIModeSelection";
  5991. class UIMain extends UIBase {
  5992. constructor() {
  5993. super();
  5994. this.firstEnter = true;
  5995. }
  5996. onConstructor() {
  5997. this.ui = ui_UIMain.createInstance();
  5998. this.contentPane = this.ui;
  5999. this.isEject = false;
  6000. this.addEvent();
  6001. this.addClickSpine();
  6002. this.settingNode = new SettingNode(this.ui.settingNode);
  6003. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6004. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6005. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6006. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6007. let curUse = DataMgr.getCurSecretary();
  6008. this.changeSecretary(curUse);
  6009. this.ui.talkNode.visible = false;
  6010. let guide = DataMgr.getSkillGuide();
  6011. if (xGame.common.isNewDay && guide == 1) {
  6012. xGame.common.isNewDay = false;
  6013. xGame.soundMgr.playSound("s_main01");
  6014. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6015. console.log("播放小秘书每天语音");
  6016. }
  6017. this.onGetUserInfo();
  6018. this.ui.n83.visible = false;
  6019. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6020. }
  6021. changeSecretary(curUse) {
  6022. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6023. xGame.common.secretary && xGame.common.secretary.dispose();
  6024. this.addSecretarySpine(name);
  6025. }
  6026. addSecretarySpine(name) {
  6027. let spine = new SpineMgr(name, () => {
  6028. this.playSecretaryIdle();
  6029. });
  6030. xGame.common.secretary = spine;
  6031. }
  6032. addClickSpine() {
  6033. let clickSpine = new SpineMgr("dianji", () => {
  6034. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6035. let parent = Laya.stage;
  6036. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6037. clickSpine.play(data, 0, false, parent, (spine) => {
  6038. spine.destroy(true);
  6039. });
  6040. });
  6041. });
  6042. }
  6043. addEvent() {
  6044. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6045. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6046. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6047. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6048. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6049. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6050. this.addUIClick(this.ui, this.interuptSecretary);
  6051. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6052. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6053. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6054. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6055. this.addUIClick(this.ui.signBtn, this.openSignView);
  6056. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6057. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6058. }
  6059. show(showFailWords) {
  6060. super.show();
  6061. this.moneyNode.ui.c1.selectedIndex = 1;
  6062. this.playSecretaryIdle();
  6063. xGame.soundMgr.playMusic("caromhall01");
  6064. Laya.timer.clearAll(this);
  6065. this.playSecretaryRandomSound();
  6066. if (showFailWords) {
  6067. setTimeout(() => {
  6068. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6069. let words = -1;
  6070. if (str == "s_main02") {
  6071. words = 2;
  6072. }
  6073. else {
  6074. words = 3;
  6075. }
  6076. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6077. xGame.soundMgr.playSound(str);
  6078. }, 300);
  6079. }
  6080. this.showGuide();
  6081. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6082. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6083. let guide = DataMgr.getSkillGuide();
  6084. if (guide == 1) {
  6085. let randTime = xGame.common.randomNum(300, 800);
  6086. if (this.firstEnter) {
  6087. this.firstEnter = false;
  6088. randTime += 900;
  6089. }
  6090. Laya.timer.once(randTime, this, () => {
  6091. xGame.common.autoPopUIView();
  6092. });
  6093. }
  6094. }
  6095. checkActive(show) {
  6096. }
  6097. showGuide() {
  6098. let guide = DataMgr.getSkillGuide();
  6099. this.ui.guideBtn.visible = guide == 0;
  6100. this.ui.enterGuide.visible = false;
  6101. this.ui.secretaryGuide.visible = guide == 0;
  6102. if (guide == 0) {
  6103. xGame.soundMgr.playSound("s_guide");
  6104. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6105. }
  6106. }
  6107. ensureSecretary() {
  6108. this.ui.secretaryGuide.visible = false;
  6109. this.ui.enterGuide.visible = true;
  6110. this.ui.wordsNode.t0.play();
  6111. if (DataMgr.getNewUser())
  6112. Moyu.sendDataEvent("gameReady");
  6113. }
  6114. playSecretaryIdle() {
  6115. let parent = this.ui.secretary.displayObject;
  6116. parent.destroyChildren();
  6117. let xx = this.ui.secretary.width / 2;
  6118. let yy = this.ui.secretary.height;
  6119. let scale = xGame.common.getSecretaryScale();
  6120. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6121. xGame.common.secretary.play(data, 1, true, parent);
  6122. }
  6123. startGame(type) {
  6124. xGame.common.gameMode = type;
  6125. Moyu.sendDataEvent("PlayGame", { type: type });
  6126. switch (xGame.common.gameMode) {
  6127. case GameMode.classic:
  6128. let challengeTimes = DataMgr.getChallengeTimes();
  6129. if (challengeTimes == 0) {
  6130. xGame.uiMgr.Show(UIInvitation);
  6131. }
  6132. else {
  6133. this.beginGame();
  6134. }
  6135. break;
  6136. case GameMode.bigMove:
  6137. this.beginGame();
  6138. if (DataMgr.getNewUser())
  6139. Moyu.sendDataEvent("gameStart0");
  6140. break;
  6141. default:
  6142. break;
  6143. }
  6144. }
  6145. beginGame(isNice = false) {
  6146. if (xGame.common.gameMode == GameMode.classic) {
  6147. if (isNice) {
  6148. this.enterClassic();
  6149. }
  6150. else {
  6151. xGame.uiMgr.Show(UIModeSelection, () => {
  6152. this.enterClassic();
  6153. });
  6154. }
  6155. }
  6156. else if (xGame.common.gameMode == GameMode.bigMove) {
  6157. this.ui.enterGuide.visible = false;
  6158. xGame.uiMgr.Show(UISkill);
  6159. }
  6160. }
  6161. enterClassic() {
  6162. xGame.uiMgr.Show(UIGame);
  6163. xGame.uiMgr.Show(UIMatching, () => {
  6164. if (!this.isHide)
  6165. this.hide();
  6166. xGame.common.gameUI.ui.alpha = 1;
  6167. xGame.common.gameUI.startGame();
  6168. xGame.uiMgr.Hide(UIGameEnd);
  6169. });
  6170. }
  6171. startGlobal() {
  6172. xGame.uiMgr.Show(UIMsg, "Coming Soon~");
  6173. }
  6174. startWeekly() {
  6175. xGame.uiMgr.Show(UIMsg, "Coming Soon~");
  6176. }
  6177. startPlaceBall() {
  6178. xGame.uiMgr.Show(UILevelDisplay);
  6179. }
  6180. hide() {
  6181. super.hide();
  6182. xGame.common.stopGirlPop(this.ui.talkNode);
  6183. }
  6184. onGetUserInfo(force = false) {
  6185. if (Moyu.isWx) {
  6186. let info = Moyu.getSystemInfo();
  6187. if (info)
  6188. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6189. }
  6190. else {
  6191. Moyu.initUser(this, this.freshUser, force);
  6192. }
  6193. if (!Moyu.hasUserInfo) {
  6194. let user = Moyu.getUserInfo();
  6195. user.headIcon = 'res/ty_touxiang.png';
  6196. }
  6197. this.freshUser();
  6198. }
  6199. freshUser() {
  6200. let user = Moyu.getUserInfo();
  6201. if (!user.isAuth) {
  6202. user.headIcon = 'res/ty_touxiang.png';
  6203. }
  6204. else
  6205. DataMgr.upRankData();
  6206. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6207. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6208. }
  6209. interuptSecretary() {
  6210. Laya.timer.clearAll(this);
  6211. this.playSecretaryRandomSound();
  6212. }
  6213. playSecretaryRandomSound() {
  6214. if (this.isHide)
  6215. return;
  6216. let time = xGame.common.randomNum(45000, 60000);
  6217. Laya.timer.once(time, this, () => {
  6218. if (this.isHide)
  6219. return;
  6220. let index = xGame.common.randomNum(4, 7);
  6221. xGame.soundMgr.playSound("s_main0" + index);
  6222. let words = 1;
  6223. switch (index) {
  6224. case 4:
  6225. words = 5;
  6226. break;
  6227. case 5:
  6228. words = 3;
  6229. break;
  6230. case 6:
  6231. words = 6;
  6232. break;
  6233. case 7:
  6234. words = 7;
  6235. break;
  6236. default:
  6237. break;
  6238. }
  6239. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6240. this.playSecretaryRandomSound();
  6241. });
  6242. }
  6243. openSecretaryView() {
  6244. xGame.uiMgr.Show(UISecretary);
  6245. Moyu.sendDataEvent("secretary");
  6246. }
  6247. openShopView() {
  6248. xGame.uiMgr.Show(UIShop);
  6249. }
  6250. openSignView() {
  6251. xGame.uiMgr.Show(UISign);
  6252. }
  6253. openDrawView() {
  6254. xGame.uiMgr.Show(UIDraw);
  6255. }
  6256. openRanking() {
  6257. xGame.uiMgr.Show(UIRanking);
  6258. Moyu.sendDataEvent("rankingList");
  6259. }
  6260. }
  6261. UIMain.uiName = "UIMain";
  6262. class UIGameEnd extends UIBase {
  6263. constructor() {
  6264. super();
  6265. this.success = false;
  6266. this.awardCoinNum = 1000;
  6267. this.awardDiamondNum = 10;
  6268. }
  6269. onConstructor() {
  6270. this.ui = ui_UIGameEnd.createInstance();
  6271. this.contentPane = this.ui;
  6272. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6273. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6274. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6275. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6276. this.ui.talkNode.visible = false;
  6277. if (Moyu.isKs)
  6278. this.ui.closeNode.closeBtn.x += 100;
  6279. }
  6280. updateType() {
  6281. switch (xGame.common.gameMode) {
  6282. case GameMode.classic:
  6283. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6284. this.ui.coinNode.visible = this.success;
  6285. if (!this.success) {
  6286. Laya.timer.once(500, this, () => {
  6287. xGame.uiMgr.Show(UIAddCoin);
  6288. });
  6289. }
  6290. this.ui.isGetAward.visible = false;
  6291. this.ui.leftBtn.c1.selectedIndex = 3;
  6292. this.ui.rightBtn.c1.selectedIndex = 0;
  6293. this.moneyNode.ui.c1.selectedIndex = 1;
  6294. break;
  6295. case GameMode.bigMove:
  6296. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6297. this.ui.coinNode.visible = this.success;
  6298. if (xGame.common.gameMode == GameMode.bigMove) {
  6299. if (this.success) {
  6300. DataMgr.setSkillSuccessTimes(1, true);
  6301. DataMgr.setSkillAccTimes(1);
  6302. }
  6303. else {
  6304. DataMgr.setSkillSuccessTimes(0, false);
  6305. }
  6306. }
  6307. if (!this.success) {
  6308. Laya.timer.once(500, this, () => {
  6309. xGame.uiMgr.Show(UIAddCoin);
  6310. });
  6311. }
  6312. this.ui.isGetAward.visible = false;
  6313. this.ui.leftBtn.c1.selectedIndex = 3;
  6314. this.ui.rightBtn.c1.selectedIndex = 0;
  6315. this.moneyNode.ui.c1.selectedIndex = 1;
  6316. break;
  6317. case GameMode.placeBall:
  6318. this.ui.coinNode.visible = false;
  6319. if (this.success) {
  6320. if (xGame.common.placeBallStarNum == 3) {
  6321. this.ui.c1.selectedIndex = 2;
  6322. }
  6323. else {
  6324. this.ui.c1.selectedIndex = 3;
  6325. }
  6326. }
  6327. else {
  6328. this.ui.c1.selectedIndex = 4;
  6329. }
  6330. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6331. if (cfg.type == PlaceBallType.challenge) {
  6332. this.ui.c1.selectedIndex = 2;
  6333. }
  6334. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6335. this.updatePlaceBallBtn();
  6336. this.updatePlaceBallStarNum();
  6337. this.updatePlaceBallAwardState();
  6338. this.moneyNode.ui.c1.selectedIndex = 2;
  6339. this.moneyNode.checkPowerTime();
  6340. this.moneyNode.powerChange();
  6341. DataMgr.upRankData();
  6342. break;
  6343. default:
  6344. break;
  6345. }
  6346. }
  6347. updatePlaceBallBtn() {
  6348. this.ui.leftBtn.c1.selectedIndex = 5;
  6349. if (this.success) {
  6350. this.ui.rightBtn.c1.selectedIndex = 14;
  6351. }
  6352. else {
  6353. if (xGame.common.placeBallStarNum == 3) {
  6354. this.ui.rightBtn.c1.selectedIndex = 14;
  6355. }
  6356. else {
  6357. this.ui.rightBtn.c1.selectedIndex = 1;
  6358. }
  6359. }
  6360. }
  6361. updatePlaceBallStarNum() {
  6362. let starNum = xGame.common.placeBallStarNum;
  6363. if (starNum == 0)
  6364. this.ui.starNumNode.c1.selectedIndex = 3;
  6365. else {
  6366. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6367. }
  6368. }
  6369. updatePlaceBallAwardState() {
  6370. let level = xGame.common.placeBallCurLevel;
  6371. let starNum = xGame.common.placeBallStarNum;
  6372. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6373. let data = cfgTable.placeballData[level].award;
  6374. let cfg = cfgTable.placeballData[level];
  6375. this.awardDiamondNum = data[1];
  6376. this.awardCoinNum = data[0];
  6377. if (cfg.type == PlaceBallType.challenge) {
  6378. this.awardDiamondNum = 0;
  6379. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6380. }
  6381. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6382. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6383. if (cfg.type == PlaceBallType.challenge) {
  6384. this.ui.awardNode.coinNode.visible = true;
  6385. }
  6386. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6387. this.ui.awardNode.diamondNode.x = 265;
  6388. this.ui.awardNode.coinNode.x = 354;
  6389. }
  6390. else {
  6391. this.ui.awardNode.diamondNode.x = 291;
  6392. this.ui.awardNode.coinNode.x = 291;
  6393. }
  6394. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6395. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6396. if (this.awardCoinNum == 0) {
  6397. this.ui.awardNode.coinNode.numTxt.text = "";
  6398. }
  6399. if (getAward) {
  6400. this.ui.isGetAward.visible = true;
  6401. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6402. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6403. }
  6404. else {
  6405. this.ui.isGetAward.visible = false;
  6406. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6407. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6408. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6409. }
  6410. else {
  6411. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6412. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6413. }
  6414. }
  6415. }
  6416. show(success) {
  6417. super.show();
  6418. xGame.eventMgr.event(RESET_GAME);
  6419. this.success = success;
  6420. Laya.timer.clearAll(this);
  6421. this.playSecretaryAni();
  6422. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6423. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6424. offsetTime = Math.floor(offsetTime / 1000);
  6425. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6426. this.updateType();
  6427. Laya.timer.once(200, this, () => {
  6428. this.addAward(() => {
  6429. this.updateType();
  6430. Laya.timer.once(500, this, () => {
  6431. this.showChallengeLevel();
  6432. });
  6433. });
  6434. });
  6435. if (this.success) {
  6436. xGame.soundMgr.playSound('slots_roll01');
  6437. xGame.soundMgr.playSound("s_win");
  6438. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6439. }
  6440. else {
  6441. xGame.soundMgr.playSound('matchwin01');
  6442. xGame.soundMgr.playSound("s_lose");
  6443. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6444. }
  6445. if (!Moyu.isLegal)
  6446. PlatMgr.showBanner(true);
  6447. let challengeNum = DataMgr.getChallengeTimes();
  6448. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6449. DataMgr.setChallengeTimes(1);
  6450. }
  6451. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6452. DataMgr.setClassicTimes();
  6453. }
  6454. }
  6455. showChallengeLevel() {
  6456. if (DataMgr.getChallengeTimes() != 0)
  6457. return;
  6458. let skill = DataMgr.getSkillAccTimes();
  6459. let put = DataMgr.getPlaceBallLevelList().length;
  6460. if (skill >= 3 || put >= 5) {
  6461. xGame.uiMgr.Show(UIInvitation);
  6462. this.hide();
  6463. }
  6464. }
  6465. addAward(callback) {
  6466. if (!this.success) {
  6467. callback && callback();
  6468. return;
  6469. }
  6470. switch (xGame.common.gameMode) {
  6471. case GameMode.classic:
  6472. this.awardCoinNum = xGame.common.passAwardCoin;
  6473. this.awardDiamondNum = 0;
  6474. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6475. break;
  6476. case GameMode.bigMove:
  6477. this.awardCoinNum = xGame.common.passAwardCoin;
  6478. this.awardDiamondNum = 0;
  6479. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6480. callback && callback();
  6481. break;
  6482. case GameMode.placeBall:
  6483. let level = xGame.common.placeBallCurLevel;
  6484. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6485. if (xGame.common.placeBallStarNum != 3) {
  6486. callback && callback();
  6487. return;
  6488. }
  6489. else {
  6490. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6491. if (getAward) {
  6492. callback && callback();
  6493. return;
  6494. }
  6495. }
  6496. let cfg = cfgTable.placeballData[level];
  6497. let data = cfgTable.placeballData[level].award;
  6498. this.awardCoinNum = data[0];
  6499. this.awardDiamondNum = data[1];
  6500. if (cfg.type == PlaceBallType.challenge) {
  6501. this.awardDiamondNum = 0;
  6502. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6503. }
  6504. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6505. let diamondAward;
  6506. if (this.awardDiamondNum > 0) {
  6507. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6508. xGame.common.getAward([diamondAward, coinAward], callback);
  6509. }
  6510. else {
  6511. xGame.common.getAward([coinAward], callback);
  6512. }
  6513. if (cfg.type == PlaceBallType.normal) {
  6514. DataMgr.setPlaceBallAward(level);
  6515. }
  6516. break;
  6517. default:
  6518. break;
  6519. }
  6520. }
  6521. playSecretaryAni() {
  6522. let parent = this.ui.secretary.displayObject;
  6523. parent.destroyChildren();
  6524. let xx = this.ui.secretary.width / 2;
  6525. let yy = this.ui.secretary.height;
  6526. let scale = xGame.common.getSecretaryScale();
  6527. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6528. if (this.success) {
  6529. let rand = Math.random() <= 0.5 ? 2 : 3;
  6530. xGame.common.secretary.play(data, rand, false, parent, () => {
  6531. xGame.common.secretary.play(data, 1, true, parent);
  6532. });
  6533. }
  6534. else {
  6535. xGame.common.secretary.play(data, 0, true, parent);
  6536. }
  6537. }
  6538. restartGame() {
  6539. switch (xGame.common.gameMode) {
  6540. case GameMode.classic:
  6541. xGame.eventMgr.event(RESTART_GAME);
  6542. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6543. break;
  6544. case GameMode.bigMove:
  6545. this.hide();
  6546. xGame.eventMgr.event(RESTART_GAME);
  6547. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6548. break;
  6549. default:
  6550. break;
  6551. }
  6552. }
  6553. hide() {
  6554. super.hide();
  6555. xGame.common.stopGirlPop(this.ui.talkNode);
  6556. PlatMgr.showBanner(false);
  6557. }
  6558. returnHome() {
  6559. this.hide();
  6560. let showFailWords = !this.success;
  6561. xGame.uiMgr.Show(UIMain, showFailWords);
  6562. }
  6563. clickLeftBtn() {
  6564. switch (xGame.common.gameMode) {
  6565. case GameMode.classic:
  6566. case GameMode.bigMove:
  6567. this.returnHome();
  6568. break;
  6569. case GameMode.placeBall:
  6570. let level = xGame.common.placeBallCurLevel;
  6571. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6572. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6573. break;
  6574. default:
  6575. break;
  6576. }
  6577. }
  6578. powerStartPlaceBallLevel(level, btn) {
  6579. if (DataMgr.powerEnough()) {
  6580. btn.touchable = false;
  6581. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6582. btn.touchable = true;
  6583. DataMgr.setPower(-1);
  6584. xGame.eventMgr.event(POWER_TIME);
  6585. this.startPlaceBallLevel(level);
  6586. }));
  6587. }
  6588. else {
  6589. xGame.uiMgr.Show(UIPower, 0);
  6590. }
  6591. }
  6592. clickRightBtn() {
  6593. switch (xGame.common.gameMode) {
  6594. case GameMode.classic:
  6595. case GameMode.bigMove:
  6596. this.restartGame();
  6597. break;
  6598. case GameMode.placeBall:
  6599. let level = xGame.common.placeBallCurLevel;
  6600. let data = DataMgr.getPlaceBallLevel(level);
  6601. let curPss = data.play && !data.isCur;
  6602. if (curPss) {
  6603. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6604. }
  6605. else {
  6606. Moyu.sendDataEvent("placeBallNextLevel");
  6607. Moyu.showVideoAd(() => {
  6608. DataMgr.setPlaceBallLevel(level, 1);
  6609. this.startPlaceBallLevel(level + 1);
  6610. }, xGame.define.EAdType.placeBallNextLevel);
  6611. }
  6612. break;
  6613. default:
  6614. break;
  6615. }
  6616. }
  6617. startPlaceBallLevel(level) {
  6618. xGame.common.gameMode = GameMode.placeBall;
  6619. xGame.common.placeBallCurLevel = level;
  6620. xGame.uiMgr.Show(UIGame);
  6621. this.hide();
  6622. }
  6623. }
  6624. UIGameEnd.uiName = "UIGameEnd";
  6625. class ui_UIRepentProp extends fgui.GComponent {
  6626. static createInstance() {
  6627. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6628. }
  6629. onConstruct() {
  6630. this.c1 = this.getController("c1");
  6631. this.n11 = (this.getChild("n11"));
  6632. this.regretNode = (this.getChild("regretNode"));
  6633. this.helpLineNode = (this.getChild("helpLineNode"));
  6634. this.t0 = this.getTransition("t0");
  6635. }
  6636. }
  6637. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6638. class UIRepentProp extends UIBase {
  6639. constructor() {
  6640. super();
  6641. this.viewType = 0;
  6642. this.regretType = 0;
  6643. }
  6644. onConstructor() {
  6645. this.ui = ui_UIRepentProp.createInstance();
  6646. this.contentPane = this.ui;
  6647. this.isEject = false;
  6648. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6649. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6650. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6651. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6652. }
  6653. show(viewType, regretType, callback) {
  6654. PlatMgr.showInsert(true);
  6655. this.viewType = viewType;
  6656. this.regretType = regretType;
  6657. this.callback = callback;
  6658. super.show();
  6659. this.ui.t0.play();
  6660. this.ui.c1.selectedIndex = this.viewType;
  6661. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6662. if (this.viewType == 0) {
  6663. let guide = DataMgr.getGuideHelpLine();
  6664. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6665. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6666. }
  6667. xGame.common.gameMgr.gamePause = true;
  6668. }
  6669. hideSelf() {
  6670. xGame.common.gameMgr.gamePause = false;
  6671. this.callback && this.callback(false);
  6672. this.hide();
  6673. }
  6674. videoRegret() {
  6675. Moyu.showVideoAd(() => {
  6676. this.callback && this.callback(true);
  6677. this.hideSelf();
  6678. }, EAdType.regretBall);
  6679. }
  6680. videoAddHelpLine() {
  6681. let guide = DataMgr.getGuideHelpLine();
  6682. if (guide == 0) {
  6683. this.callback && this.callback(true);
  6684. this.hideSelf();
  6685. DataMgr.setGuideHelpLine();
  6686. xGame.common.gameUI.ui.guideNode.visible = false;
  6687. }
  6688. else {
  6689. Moyu.showVideoAd(() => {
  6690. this.callback && this.callback(true);
  6691. this.hideSelf();
  6692. }, EAdType.longHelpLine);
  6693. }
  6694. }
  6695. }
  6696. UIRepentProp.uiName = "UIRepentProp";
  6697. class ui_UIVideoShare extends fgui.GComponent {
  6698. static createInstance() {
  6699. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6700. }
  6701. onConstruct() {
  6702. this.n10 = (this.getChild("n10"));
  6703. this.myNode = (this.getChild("myNode"));
  6704. this.t0 = this.getTransition("t0");
  6705. }
  6706. }
  6707. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6708. class UIVideoShare extends UIBase {
  6709. constructor() {
  6710. super();
  6711. this.success = false;
  6712. this.awardNum = 0;
  6713. this.isShared = true;
  6714. }
  6715. onConstructor() {
  6716. this.ui = ui_UIVideoShare.createInstance();
  6717. this.contentPane = this.ui;
  6718. this.isEject = false;
  6719. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6720. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6721. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6722. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6723. }
  6724. show(success) {
  6725. super.show();
  6726. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6727. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6728. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6729. this.success = success;
  6730. let time = xGame.common.randomNum(600, 1500);
  6731. Moyu.showInsertAd(time, 60000);
  6732. if (success)
  6733. xGame.soundMgr.playSound("applause");
  6734. this.ui.t0.play();
  6735. this.checkShareState();
  6736. let times = DataMgr.getDailyVideoShareTimes();
  6737. this.awardNum = times == 0 ? 2000 : 200;
  6738. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6739. }
  6740. checkShareState() {
  6741. if (PlatMgr.forceShare == 0) {
  6742. this.ui.myNode.closeBtn.visible = true;
  6743. this.ui.myNode.tipsNode.visible = false;
  6744. this.ui.myNode.closeBtn.x = 90;
  6745. this.ui.myNode.shareBtn.x = 342;
  6746. }
  6747. else if (PlatMgr.forceShare == 1) {
  6748. this.ui.myNode.closeBtn.visible = false;
  6749. this.ui.myNode.tipsNode.visible = true;
  6750. this.ui.myNode.shareBtn.x = 218;
  6751. this.isShared = true;
  6752. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6753. }
  6754. }
  6755. checkForceShare() {
  6756. this.isShared = !this.isShared;
  6757. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6758. }
  6759. videoShare() {
  6760. if (PlatMgr.forceShare == 1) {
  6761. if (this.isShared) {
  6762. this.shareGame();
  6763. }
  6764. else {
  6765. this.hideSelf();
  6766. }
  6767. }
  6768. else {
  6769. this.shareGame();
  6770. }
  6771. }
  6772. shareGame() {
  6773. Moyu.sendDataEvent("VideoShare");
  6774. if (Moyu.canShare() > 100) {
  6775. Moyu.shareGame((success) => {
  6776. if (success) {
  6777. DataMgr.setDailyVideoShareTimes(1);
  6778. DataMgr.setCoin(this.awardNum);
  6779. }
  6780. this.hideSelf();
  6781. }, this);
  6782. }
  6783. else {
  6784. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6785. this.hideSelf();
  6786. }
  6787. }
  6788. hideSelf() {
  6789. this.hide();
  6790. xGame.uiMgr.Show(UIGameEnd, this.success);
  6791. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6792. xGame.common.screenImg.destroy();
  6793. xGame.common.screenImg = null;
  6794. }
  6795. }
  6796. }
  6797. UIVideoShare.uiName = "UIVideoShare";
  6798. class ui_UITips extends fgui.GComponent {
  6799. static createInstance() {
  6800. return (fgui.UIPackage.createObject("game", "UITips"));
  6801. }
  6802. onConstruct() {
  6803. this.n0 = (this.getChild("n0"));
  6804. this.myNode = (this.getChild("myNode"));
  6805. this.t0 = this.getTransition("t0");
  6806. }
  6807. }
  6808. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6809. class UITips extends UIBase {
  6810. constructor() {
  6811. super();
  6812. this.type = 0;
  6813. }
  6814. onConstructor() {
  6815. this.ui = ui_UITips.createInstance();
  6816. this.contentPane = this.ui;
  6817. this.isEject = false;
  6818. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  6819. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  6820. }
  6821. show(tipsTxt, womanTxt, type) {
  6822. super.show();
  6823. this.ui.t0.play();
  6824. this.ui.myNode.tipsTxt.text = tipsTxt;
  6825. this.ui.myNode.womanTxt.text = womanTxt;
  6826. PlatMgr.showInsert(true);
  6827. this.ui.myNode.c1.selectedIndex = type;
  6828. this.type = type;
  6829. switch (this.type) {
  6830. case TipsType.exitGame:
  6831. xGame.common.gameMgr.gamePause = true;
  6832. break;
  6833. case TipsType.foul:
  6834. Laya.timer.once(200, this, () => {
  6835. xGame.common.gameMgr.gamePause = true;
  6836. });
  6837. break;
  6838. default:
  6839. break;
  6840. }
  6841. }
  6842. clickLeftBtn() {
  6843. this.hide();
  6844. xGame.common.gameMgr.gamePause = false;
  6845. switch (this.type) {
  6846. case TipsType.exitGame:
  6847. break;
  6848. case TipsType.foul:
  6849. break;
  6850. default:
  6851. break;
  6852. }
  6853. }
  6854. clickRightBtn() {
  6855. this.hide();
  6856. switch (this.type) {
  6857. case TipsType.exitGame:
  6858. xGame.eventMgr.event(RESET_GAME);
  6859. xGame.uiMgr.Show(UIMain);
  6860. Moyu.recordEnd(this, null);
  6861. xGame.common.longHelpLine = false;
  6862. break;
  6863. case TipsType.foul:
  6864. xGame.common.gameMgr.gamePause = false;
  6865. Laya.timer.clearAll(this);
  6866. break;
  6867. default:
  6868. break;
  6869. }
  6870. }
  6871. }
  6872. UITips.uiName = "UITips";
  6873. class GameMgr {
  6874. constructor() {
  6875. this.selfCamp = "";
  6876. this.selfFoulNum = 0;
  6877. this.selfBallArr = [];
  6878. this.selfTimer = 0;
  6879. this.selfScore = 0;
  6880. this.aiCamp = "";
  6881. this.aiFoulNum = 0;
  6882. this.aiBallArr = [];
  6883. this.aiTimer = 0;
  6884. this.aiScore = 0;
  6885. this.aiSkillLevelNum = 1;
  6886. this.targertScore = 0;
  6887. this.setTime = 30;
  6888. this.selfTurnRate = 0.5;
  6889. this.accTime = 0;
  6890. this.curFoul = "";
  6891. this.maxFoulTimes = 3;
  6892. this.isFirstInGame = true;
  6893. this.firstColliObj = null;
  6894. this.inHoleBalls = [];
  6895. this.blackNum = 8;
  6896. this.success = false;
  6897. this.holePosList = [];
  6898. this.posObj = {};
  6899. this._selfTurn = false;
  6900. this.lastRootBallPos = new Laya.Vector2(311, 430);
  6901. this.ensureBallType = false;
  6902. this.isOpenBall = true;
  6903. this.finishOneShoot = true;
  6904. this.isEnd = false;
  6905. this.isChangeTurn = false;
  6906. this.isInterrupt = false;
  6907. this.aiPlayedBreakArmy = false;
  6908. this.isTouchedBall = false;
  6909. this.finishBalls = 0;
  6910. this.needBalls = 0;
  6911. this.allBallNum = 0;
  6912. this.placeBallPosData = {};
  6913. this.curHP = 0;
  6914. this.showLongView = false;
  6915. this.firstShoot = true;
  6916. this._gamePause = false;
  6917. this.trunCount = 0;
  6918. this.isBlackInHole = false;
  6919. this.isEnter = true;
  6920. xGame.eventMgr.offAll(ALL_BALL_STOP);
  6921. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  6922. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  6923. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  6924. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  6925. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  6926. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  6927. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  6928. }
  6929. get gamePause() {
  6930. return this._gamePause;
  6931. }
  6932. set gamePause(v) {
  6933. if (v) {
  6934. Laya.physicsTimer.pause();
  6935. }
  6936. else {
  6937. Laya.physicsTimer.resume();
  6938. }
  6939. this._gamePause = v;
  6940. }
  6941. get selfTurn() {
  6942. return this._selfTurn;
  6943. }
  6944. set selfTurn(val) {
  6945. this.trunCount++;
  6946. this._selfTurn = val;
  6947. if (val) {
  6948. xGame.common.d2World.d2Gan.ui.self.visible = true;
  6949. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  6950. }
  6951. else {
  6952. xGame.common.d2World.d2Gan.ui.self.visible = false;
  6953. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  6954. if (this.trunCount > 1)
  6955. PlatMgr.openBox();
  6956. }
  6957. }
  6958. resetGame() {
  6959. this.inHoleBalls = [];
  6960. this.isFirstInGame = true;
  6961. this.firstColliObj = null;
  6962. this.aiCamp = "";
  6963. this.selfCamp = "";
  6964. this.aiFoulNum = 0;
  6965. this.selfFoulNum = 0;
  6966. this.selfBallArr = [];
  6967. this.aiBallArr = [];
  6968. this.gamePause = false;
  6969. this.ensureBallType = false;
  6970. this.isInterrupt = false;
  6971. this.updateLeftBall();
  6972. this.clearTime();
  6973. this.aiPlayedBreakArmy = false;
  6974. this.isBlackInHole = false;
  6975. this.placeBallPosData = {};
  6976. if (xGame.common.d3World.knifeRoot) {
  6977. xGame.common.d3World.knifeRoot.destroyChildren();
  6978. }
  6979. }
  6980. gameReady() {
  6981. this.trunCount = 0;
  6982. this.firstColliObj = null;
  6983. this.isFirstInGame = true;
  6984. this.selfTurn = Math.random() <= this.selfTurnRate;
  6985. let challengeNum = DataMgr.getChallengeTimes();
  6986. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6987. this.selfTurn = true;
  6988. }
  6989. if (xGame.common.gameMode == GameMode.placeBall)
  6990. this.selfTurn = true;
  6991. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  6992. this.selfTurn = true;
  6993. }
  6994. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  6995. this.checkGuide();
  6996. if (xGame.common.uiRodMethod)
  6997. xGame.common.uiRodMethod.resetRod();
  6998. xGame.common.d2World.getHelpLine();
  6999. this.isOpenBall = true;
  7000. this.isTouchedBall = false;
  7001. xGame.common.aiPlayer.stopRun();
  7002. this.setTime = 30;
  7003. let ui = xGame.common.gameUI.ui;
  7004. switch (xGame.common.gameMode) {
  7005. case GameMode.classic:
  7006. xGame.common.aiPlayer.init();
  7007. this.blackNum = 8;
  7008. this.placeRootBall();
  7009. this.peoplePlay(9, 10);
  7010. ui.wordsBtn.visible = true;
  7011. ui.aiWordsBtn.visible = true;
  7012. xGame.common.talkMgr.changeAIState(true);
  7013. DataMgr.gameData.gameCount++;
  7014. DataMgr.saveGameData();
  7015. break;
  7016. case GameMode.bigMove:
  7017. this.blackNum = -1;
  7018. this.selfScore = 0;
  7019. this.aiScore = 0;
  7020. xGame.common.aiPlayer.init();
  7021. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7022. this.updateSelfScore();
  7023. this.updateAIScore();
  7024. this.updateTargetSroce();
  7025. this.placeRootBall();
  7026. this.peoplePlay(9, 10);
  7027. ui.wordsBtn.visible = true;
  7028. ui.aiWordsBtn.visible = true;
  7029. xGame.common.talkMgr.changeAIState(true);
  7030. if (DataMgr.getSkillGuide() < 1)
  7031. DataMgr.gameData.gameCount = 0;
  7032. else {
  7033. DataMgr.gameData.gameCount++;
  7034. DataMgr.saveGameData();
  7035. PlatMgr.openTry();
  7036. }
  7037. if (xGame.common.d3World.knifeRoot) {
  7038. xGame.common.d3World.knifeRoot.destroyChildren();
  7039. }
  7040. break;
  7041. case GameMode.placeBall:
  7042. this.blackNum = -1;
  7043. this.selfTurn = true;
  7044. this.setTime = 10000;
  7045. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7046. this.curHP = this.placeBallData.hp;
  7047. if (this.placeBallData.ball == -1)
  7048. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7049. else
  7050. this.needBalls = this.placeBallData.ball;
  7051. console.log("需要的进球数目", this.needBalls);
  7052. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7053. this.finishBalls = 0;
  7054. this.placeBallPosData = {};
  7055. this.updatePlaceBallPos();
  7056. this.updatePlaceBallState();
  7057. this.finishOneShoot = true;
  7058. xGame.common.gameUI.ui.moveNode.visible = false;
  7059. this.isOpenBall = false;
  7060. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7061. ui.wordsBtn.visible = false;
  7062. ui.aiWordsBtn.visible = false;
  7063. xGame.common.talkMgr.changeAIState(false);
  7064. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7065. PlatMgr.openBox();
  7066. });
  7067. break;
  7068. default:
  7069. break;
  7070. }
  7071. this.showLongView = false;
  7072. xGame.common.wordsMgr.comboTimes = 1;
  7073. let guide = DataMgr.getSkillGuide();
  7074. if (guide)
  7075. xGame.eventMgr.event(WAIT_SHOOT);
  7076. xGame.common.upSkillLevel = false;
  7077. xGame.common.gameStartTime = new Date().getTime();
  7078. this.firstShoot = true;
  7079. }
  7080. checkGuide() {
  7081. let guide = DataMgr.getSkillGuide();
  7082. let gameUI = xGame.common.gameUI.ui;
  7083. gameUI.guide1.visible = false;
  7084. gameUI.guide2.visible = false;
  7085. gameUI.guide3.visible = false;
  7086. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7087. this.selfTurn = true;
  7088. }
  7089. else {
  7090. return;
  7091. }
  7092. let oneBall = this.getOneBall();
  7093. gameUI.guide1.visible = true;
  7094. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7095. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7096. }
  7097. getOneBall() {
  7098. let arr = xGame.common.d2World.ballArr;
  7099. for (let index = 0; index < arr.length; index++) {
  7100. if (arr[index].number == 0)
  7101. continue;
  7102. return arr[index];
  7103. }
  7104. }
  7105. updateSelfScore() {
  7106. let ui = xGame.common.gameUI.ui.topNode;
  7107. ui.selfScoreTxt.text = this.selfScore + "";
  7108. }
  7109. updateAIScore() {
  7110. let ui = xGame.common.gameUI.ui.topNode;
  7111. ui.aiScoreTxt.text = this.aiScore + "";
  7112. }
  7113. updateTargetSroce() {
  7114. let ui = xGame.common.gameUI.ui.topNode;
  7115. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7116. }
  7117. updateLeftBall() {
  7118. let topUI = xGame.common.gameUI.ui.topNode;
  7119. topUI.selfBallList.numItems = this.selfBallArr.length;
  7120. topUI.aiBallList.numItems = this.aiBallArr.length;
  7121. }
  7122. ballShoot() {
  7123. this.clearTime();
  7124. this.finishOneShoot = false;
  7125. xGame.common.gameUI.ui.moveNode.visible = false;
  7126. if (xGame.common.gameUI.ui.guideNode.visible) {
  7127. xGame.common.gameUI.ui.guideNode.visible = false;
  7128. }
  7129. if (this.firstShoot) {
  7130. this.firstShoot = false;
  7131. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7132. }
  7133. }
  7134. ensureCamp(number) {
  7135. this.ensureBallType = true;
  7136. this.isOpenBall = false;
  7137. if (xGame.common.gameMode != GameMode.classic)
  7138. return;
  7139. let full = [1, 2, 3, 4, 5, 6, 7];
  7140. let flower = [9, 10, 11, 12, 13, 14, 15];
  7141. let sayWords = "";
  7142. if (this.selfTurn) {
  7143. if (number <= 7) {
  7144. this.selfCamp = ballCamp.full;
  7145. this.selfBallArr = full;
  7146. this.aiCamp = ballCamp.flower;
  7147. this.aiBallArr = flower;
  7148. sayWords = cfgTable.wordsData[3].msg;
  7149. }
  7150. else {
  7151. this.selfCamp = ballCamp.flower;
  7152. this.selfBallArr = flower;
  7153. this.aiCamp = ballCamp.full;
  7154. this.aiBallArr = full;
  7155. sayWords = cfgTable.wordsData[4].msg;
  7156. }
  7157. }
  7158. else {
  7159. if (number <= 7) {
  7160. this.selfCamp = ballCamp.flower;
  7161. this.selfBallArr = flower;
  7162. this.aiCamp = ballCamp.full;
  7163. this.aiBallArr = full;
  7164. sayWords = cfgTable.wordsData[2].msg;
  7165. }
  7166. else {
  7167. this.selfCamp = ballCamp.full;
  7168. this.selfBallArr = full;
  7169. this.aiCamp = ballCamp.flower;
  7170. this.aiBallArr = flower;
  7171. sayWords = cfgTable.wordsData[1].msg;
  7172. }
  7173. }
  7174. this.updateLeftBall();
  7175. xGame.uiMgr.Show(UIMsg, sayWords);
  7176. }
  7177. updatePlaceBallState() {
  7178. let ui = xGame.common.gameUI.ui;
  7179. switch (this.placeBallData.type) {
  7180. case PlaceBallType.normal:
  7181. let normal = ui.placeNormalNode;
  7182. normal.hpTxt.text = this.curHP + "";
  7183. this.updatePlaceBallStar(normal);
  7184. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7185. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7186. break;
  7187. case PlaceBallType.challenge:
  7188. let challenge = ui.placeChallengeNode;
  7189. challenge.hpTxt.text = "Shots:" + this.curHP;
  7190. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7191. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7192. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7193. break;
  7194. default:
  7195. break;
  7196. }
  7197. }
  7198. playSubHpAni() {
  7199. let ui = xGame.common.gameUI.ui;
  7200. switch (this.placeBallData.type) {
  7201. case PlaceBallType.normal:
  7202. let normal = ui.placeNormalNode;
  7203. normal.hpTxt.visible = false;
  7204. normal.starAni.c1.selectedIndex = 1;
  7205. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7206. normal.hpTxt.visible = true;
  7207. normal.starAni.c1.selectedIndex = 0;
  7208. }));
  7209. break;
  7210. default:
  7211. break;
  7212. }
  7213. }
  7214. getEndStarNum() {
  7215. let num;
  7216. let level = xGame.common.placeBallCurLevel;
  7217. if (this.curHP == this.placeBallData.hp) {
  7218. num = 3;
  7219. }
  7220. else if (this.curHP <= 1) {
  7221. num = 1;
  7222. }
  7223. else {
  7224. num = 2;
  7225. }
  7226. if (!this.success) {
  7227. num = 0;
  7228. }
  7229. else {
  7230. DataMgr.setPlaceBallLevel(level, num);
  7231. }
  7232. let myType = cfgTable.placeballData[level].type;
  7233. if (this.success && myType == 1) {
  7234. num = 3;
  7235. }
  7236. xGame.common.placeBallStarNum = num;
  7237. }
  7238. updatePlaceBallStar(node) {
  7239. let star = 0;
  7240. if (this.curHP == this.placeBallData.hp) {
  7241. star = 3;
  7242. }
  7243. else if (this.curHP >= 2) {
  7244. star = 2;
  7245. }
  7246. else if (this.curHP == 1) {
  7247. star = 1;
  7248. }
  7249. else {
  7250. star = 0;
  7251. }
  7252. let temp;
  7253. for (let index = 1; index <= 3; index++) {
  7254. temp = node["star" + index];
  7255. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7256. }
  7257. node.myProgress.value = (star / 3) * 100;
  7258. }
  7259. openRegretView(isFoul, GoalNum, challenge = false) {
  7260. let regretType = -1;
  7261. if (isFoul) {
  7262. regretType = 1;
  7263. }
  7264. else {
  7265. if (GoalNum <= 0) {
  7266. regretType = 0;
  7267. }
  7268. }
  7269. if (challenge) {
  7270. regretType = 1;
  7271. }
  7272. if (regretType != -1) {
  7273. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7274. if (success) {
  7275. this.curHP++;
  7276. this.updatePlaceBallState();
  7277. this.setPlaceBallAllPos();
  7278. xGame.common.gameUI.ui.moveNode.visible = false;
  7279. }
  7280. else {
  7281. if (this.curHP <= 0) {
  7282. this.success = false;
  7283. this.gameEnd();
  7284. }
  7285. this.playSubHpAni();
  7286. }
  7287. this.updatePlaceBallState();
  7288. this.updatePlaceBallPos();
  7289. });
  7290. }
  7291. }
  7292. setPlaceBallAllPos() {
  7293. let allBall = xGame.common.d2World.ballArr;
  7294. let cfgArr = this.placeBallPosData;
  7295. let temp;
  7296. let obj;
  7297. for (let index = 0; index < allBall.length; index++) {
  7298. temp = allBall[index];
  7299. if (temp.destroyed)
  7300. continue;
  7301. obj = cfgArr[temp.myUNID];
  7302. if (obj && obj.src && !obj.src.destroyed) {
  7303. temp.gameObj.x = obj.posX;
  7304. temp.gameObj.y = obj.posY;
  7305. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7306. }
  7307. }
  7308. xGame.common.d2World.getHelpLine();
  7309. }
  7310. updatePlaceBallPos() {
  7311. let arr = xGame.common.d2World.ballArr;
  7312. let temp;
  7313. for (let index = 0; index < arr.length; index++) {
  7314. temp = arr[index];
  7315. if (!this.placeBallPosData[temp.myUNID]) {
  7316. this.placeBallPosData[temp.myUNID] = {
  7317. src: temp,
  7318. posX: temp.gameObj.x,
  7319. posY: temp.gameObj.y
  7320. };
  7321. }
  7322. else {
  7323. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7324. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7325. }
  7326. }
  7327. let check;
  7328. for (const key in this.placeBallPosData) {
  7329. check = this.placeBallPosData[key];
  7330. if (check.src.destroyed) {
  7331. delete this.placeBallPosData[key];
  7332. }
  7333. }
  7334. }
  7335. gameRun(type) {
  7336. if (this.gamePause)
  7337. return;
  7338. this.curFoul = this.getFoulType();
  7339. if (type) {
  7340. xGame.common.d2World.d2Gan.shoot();
  7341. xGame.common.gameUI.forceCancel();
  7342. this.curFoul = type;
  7343. }
  7344. this.isEnd = false;
  7345. this.isChangeTurn = true;
  7346. if (xGame.common.gameMode == GameMode.classic) {
  7347. this.judgeClassic(this.curFoul);
  7348. this.checkClassicWords(() => {
  7349. xGame.common.destroyClassicEmotion();
  7350. if (this.isEnd) {
  7351. if (this.isBlackInHole) {
  7352. xGame.common.gameUI.ui.blackAni.visible = true;
  7353. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7354. xGame.common.gameUI.ui.blackAni.visible = false;
  7355. this.gameEnd();
  7356. }));
  7357. }
  7358. else {
  7359. this.gameEnd();
  7360. }
  7361. }
  7362. else {
  7363. this.waitShoot();
  7364. xGame.eventMgr.event(WAIT_SHOOT);
  7365. }
  7366. });
  7367. }
  7368. else if (xGame.common.gameMode == GameMode.bigMove) {
  7369. xGame.common.aiPlayer.stopRun();
  7370. let scoreArr = this.getScore(this.curFoul);
  7371. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7372. this.isEnd = true;
  7373. }
  7374. this.checkBigSkillWords(() => {
  7375. if (this.isEnd) {
  7376. this.gameEnd();
  7377. }
  7378. else {
  7379. this.waitShoot();
  7380. xGame.eventMgr.event(WAIT_SHOOT);
  7381. }
  7382. });
  7383. }
  7384. else if (xGame.common.gameMode == GameMode.placeBall) {
  7385. xGame.common.destroyAwardSpine();
  7386. let isFoul = this.curFoul == FoulType.rootHole;
  7387. let GoalNum = this.inHoleBalls.length;
  7388. if (this.inHoleBalls.indexOf(0) > -1)
  7389. GoalNum -= 1;
  7390. if (isFoul) {
  7391. this.placeRootBall();
  7392. }
  7393. console.log("neeballs", this.needBalls);
  7394. console.log("当前完成的goalNum", GoalNum);
  7395. this.finishBalls += GoalNum;
  7396. console.log("当前完成的finishballs", this.finishBalls);
  7397. let need = this.needBalls;
  7398. if (this.placeBallData.type == PlaceBallType.challenge) {
  7399. need += 100;
  7400. }
  7401. if (this.finishBalls >= need) {
  7402. this.success = true;
  7403. this.gameEnd();
  7404. }
  7405. else {
  7406. switch (this.placeBallData.type) {
  7407. case PlaceBallType.normal:
  7408. if (!isFoul && GoalNum > 0) {
  7409. this.updatePlaceBallPos();
  7410. this.updatePlaceBallState();
  7411. }
  7412. else {
  7413. this.curHP--;
  7414. this.openRegretView(isFoul, GoalNum);
  7415. }
  7416. this.waitShoot();
  7417. xGame.eventMgr.event(WAIT_SHOOT);
  7418. break;
  7419. case PlaceBallType.challenge:
  7420. this.curHP--;
  7421. this.updatePlaceBallState();
  7422. if (isFoul) {
  7423. this.openRegretView(isFoul, GoalNum, true);
  7424. }
  7425. else {
  7426. this.updatePlaceBallPos();
  7427. if (this.curHP <= 0) {
  7428. this.success = true;
  7429. this.gameEnd();
  7430. }
  7431. }
  7432. this.waitShoot();
  7433. xGame.eventMgr.event(WAIT_SHOOT);
  7434. break;
  7435. default:
  7436. break;
  7437. }
  7438. }
  7439. }
  7440. }
  7441. checkClassicWords(callback) {
  7442. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7443. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7444. let type = this.getClassicWordsType();
  7445. if (condition && type != -1) {
  7446. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7447. xGame.soundMgr.playSound(str);
  7448. xGame.common.wordsMgr.playClassicWords(type, callback);
  7449. }
  7450. else {
  7451. Laya.timer.once(300, this, () => {
  7452. callback && callback();
  7453. });
  7454. }
  7455. }
  7456. getClassicWordsType() {
  7457. let d2world = xGame.common.d2World;
  7458. let type = -1;
  7459. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7460. type = ClassicWordsType.perfectShow;
  7461. return type;
  7462. }
  7463. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7464. type = ClassicWordsType.directShoot;
  7465. return type;
  7466. }
  7467. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7468. type = ClassicWordsType.anotherShoot;
  7469. return type;
  7470. }
  7471. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7472. type = ClassicWordsType.bigPower;
  7473. return type;
  7474. }
  7475. let minSpeed = 1;
  7476. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7477. type = ClassicWordsType.hardShoot;
  7478. return type;
  7479. }
  7480. if (this.inHoleBalls.length > 0) {
  7481. type = ClassicWordsType.directShoot;
  7482. return type;
  7483. }
  7484. return type;
  7485. }
  7486. checkBigSkillWords(callback) {
  7487. if (this.curFoul == FoulType.timeOut) {
  7488. callback && callback();
  7489. }
  7490. else {
  7491. let playSkill = false;
  7492. if (this.selfTurn) {
  7493. playSkill = true;
  7494. }
  7495. else {
  7496. if (!this.aiPlayedBreakArmy) {
  7497. this.aiPlayedBreakArmy = true;
  7498. playSkill = true;
  7499. }
  7500. if (this.aiCurSkill != SkillType.breakArmy) {
  7501. playSkill = true;
  7502. }
  7503. }
  7504. if (xGame.common.skillMgr.playedLastSkill) {
  7505. xGame.common.skillMgr.playedLastSkill = false;
  7506. playSkill = false;
  7507. }
  7508. if (playSkill) {
  7509. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7510. let selfExtra = 0;
  7511. let aiExtra = 0;
  7512. if (this.selfTurn)
  7513. selfExtra += extraScore;
  7514. else
  7515. aiExtra += extraScore;
  7516. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7517. this.isEnd = true;
  7518. }
  7519. this.playBigSkillTimes(callback);
  7520. });
  7521. }
  7522. else {
  7523. this.playBigSkillTimes(callback);
  7524. }
  7525. }
  7526. }
  7527. playBigSkillTimes(callback) {
  7528. let length = this.inHoleBalls.length;
  7529. if (this.inHoleBalls.indexOf(0) > -1) {
  7530. length = this.inHoleBalls.length - 1;
  7531. }
  7532. if (length <= 0) {
  7533. callback && callback();
  7534. return;
  7535. }
  7536. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7537. callback && callback();
  7538. });
  7539. }
  7540. playSkillTips() {
  7541. let levelNum = 0;
  7542. let curType;
  7543. if (this.selfTurn) {
  7544. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7545. curType = this.selfCurSkill;
  7546. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7547. levelNum += 5;
  7548. }
  7549. }
  7550. else {
  7551. levelNum = this.aiSkillLevelNum;
  7552. curType = this.aiCurSkill;
  7553. }
  7554. let str = ``;
  7555. switch (curType) {
  7556. case SkillType.highSpace:
  7557. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7558. break;
  7559. case SkillType.breakArmy:
  7560. str = `You pocketed ${levelNum} extra balls`;
  7561. break;
  7562. case SkillType.ice:
  7563. str = `${levelNum * 2} extra balls were frozen`;
  7564. break;
  7565. case SkillType.fireworks:
  7566. str = `${levelNum} extra balls exploded `;
  7567. break;
  7568. case SkillType.GuanYu:
  7569. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  7570. break;
  7571. default:
  7572. break;
  7573. }
  7574. xGame.uiMgr.Show(UIMsg, str);
  7575. }
  7576. getFoulType() {
  7577. let foulType = "";
  7578. if (this.firstColliObj == null) {
  7579. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7580. return FoulType.rootHole;
  7581. }
  7582. return FoulType.notTouch;
  7583. }
  7584. else {
  7585. if (this.selfTurn) {
  7586. if (this.selfBallArr.length > 0) {
  7587. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7588. foulType = FoulType.wrongTouch;
  7589. }
  7590. }
  7591. else {
  7592. if (this.ensureBallType) {
  7593. }
  7594. else {
  7595. if (this.firstColliObj == this.blackNum) {
  7596. foulType = FoulType.wrongTouch;
  7597. }
  7598. }
  7599. }
  7600. }
  7601. else {
  7602. if (this.aiBallArr.length > 0) {
  7603. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7604. foulType = FoulType.wrongTouch;
  7605. }
  7606. }
  7607. else {
  7608. if (this.ensureBallType) {
  7609. }
  7610. else {
  7611. if (this.firstColliObj == this.blackNum) {
  7612. foulType = FoulType.wrongTouch;
  7613. }
  7614. }
  7615. }
  7616. }
  7617. if (this.inHoleBalls.length <= 0) {
  7618. return foulType;
  7619. }
  7620. let temp;
  7621. if (this.inHoleBalls.indexOf(0) > -1) {
  7622. foulType = FoulType.rootHole;
  7623. }
  7624. else {
  7625. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7626. temp = this.inHoleBalls[index];
  7627. if (this.selfTurn) {
  7628. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7629. foulType = FoulType.wrongHole;
  7630. break;
  7631. }
  7632. }
  7633. else {
  7634. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7635. foulType = FoulType.wrongHole;
  7636. break;
  7637. }
  7638. }
  7639. }
  7640. }
  7641. let foo;
  7642. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7643. temp = this.inHoleBalls[index];
  7644. foo = this.selfBallArr.indexOf(temp);
  7645. if (foo > -1) {
  7646. this.selfBallArr.splice(foo, 1);
  7647. }
  7648. foo = this.aiBallArr.indexOf(temp);
  7649. if (foo > -1) {
  7650. this.aiBallArr.splice(foo, 1);
  7651. }
  7652. }
  7653. this.updateLeftBall();
  7654. }
  7655. return foulType;
  7656. }
  7657. judgeGameEndByBlack(arr) {
  7658. if (this.selfTurn) {
  7659. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7660. this.selfFoulNum = this.maxFoulTimes;
  7661. return true;
  7662. }
  7663. }
  7664. else {
  7665. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7666. this.aiFoulNum = this.maxFoulTimes;
  7667. return true;
  7668. }
  7669. }
  7670. }
  7671. judgeClassic(type) {
  7672. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7673. xGame.common.aiPlayer.stopRun();
  7674. if (this.judgeNormalSuccess()) {
  7675. this.isEnd = true;
  7676. return;
  7677. }
  7678. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7679. if (this.selfTurn) {
  7680. if (isFoul) {
  7681. this.selfFoulNum++;
  7682. }
  7683. if (this.selfFoulNum >= this.maxFoulTimes) {
  7684. this.success = false;
  7685. this.isEnd = true;
  7686. return;
  7687. }
  7688. }
  7689. else {
  7690. if (isFoul)
  7691. this.aiFoulNum++;
  7692. if (this.aiFoulNum >= this.maxFoulTimes) {
  7693. this.success = true;
  7694. this.isEnd = true;
  7695. return;
  7696. }
  7697. }
  7698. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7699. this.isChangeTurn = false;
  7700. }
  7701. else {
  7702. this.isInterrupt = true;
  7703. }
  7704. }
  7705. waitShoot() {
  7706. if (xGame.common.gameMode == GameMode.classic) {
  7707. switch (this.curFoul) {
  7708. case FoulType.timeOut:
  7709. case FoulType.rootHole:
  7710. this.selfTurn = !this.selfTurn;
  7711. this.peoplePlay(5, 6, true);
  7712. break;
  7713. case FoulType.notTouch:
  7714. this.selfTurn = !this.selfTurn;
  7715. this.peoplePlay(7, 7);
  7716. break;
  7717. case FoulType.wrongHole:
  7718. this.selfTurn = !this.selfTurn;
  7719. this.peoplePlay(11, 11);
  7720. break;
  7721. default:
  7722. if (this.inHoleBalls.length > 0) {
  7723. this.peoplePlay(0, 0, false, false);
  7724. }
  7725. else {
  7726. this.selfTurn = !this.selfTurn;
  7727. this.peoplePlay(7, 7);
  7728. }
  7729. break;
  7730. }
  7731. }
  7732. else if (xGame.common.gameMode == GameMode.bigMove) {
  7733. if (this.curFoul == FoulType.timeOut) {
  7734. this.selfTurn = !this.selfTurn;
  7735. this.peoplePlay(14, 15);
  7736. this.placeRootBall();
  7737. }
  7738. else {
  7739. this.selfTurn = !this.selfTurn;
  7740. if (this.curFoul == FoulType.rootHole) {
  7741. this.peoplePlay(12, 13);
  7742. this.placeRootBall();
  7743. }
  7744. else {
  7745. this.peoplePlay(0, 0, false, false);
  7746. }
  7747. }
  7748. }
  7749. else if (xGame.common.gameMode == GameMode.placeBall) {
  7750. this.finishOneShoot = true;
  7751. }
  7752. this.gameResult();
  7753. }
  7754. gameResult() {
  7755. this.firstColliObj = null;
  7756. this.inHoleBalls = [];
  7757. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7758. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7759. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7760. if (xGame.common.uiRodMethod)
  7761. xGame.common.uiRodMethod.resetRod();
  7762. xGame.common.d2World.rootBall.showSelf();
  7763. this.clearIceSkill();
  7764. if (this.selfTurn) {
  7765. console.log("gameResult");
  7766. PlatMgr.gameInsert();
  7767. }
  7768. xGame.common.d3World.knifeRoot.destroyChildren();
  7769. if (this.selfTurn) {
  7770. xGame.common.gameUI.showHelpLineGuide();
  7771. xGame.common.gameUI.setTurnAlpha(true);
  7772. }
  7773. else {
  7774. xGame.common.gameUI.setTurnAlpha(false);
  7775. }
  7776. }
  7777. getScore(type) {
  7778. let selfAdd = 0;
  7779. let aiAdd = 0;
  7780. if (type == FoulType.timeOut) {
  7781. if (this.selfTurn)
  7782. aiAdd += 3;
  7783. else
  7784. selfAdd += 3;
  7785. }
  7786. else {
  7787. if (this.inHoleBalls.length > 0) {
  7788. if (this.selfTurn) {
  7789. if (type == FoulType.rootHole) {
  7790. aiAdd += 3;
  7791. if (this.inHoleBalls.length - 1 > 0) {
  7792. selfAdd += this.inHoleBalls.length - 1;
  7793. }
  7794. }
  7795. else {
  7796. selfAdd += this.inHoleBalls.length;
  7797. }
  7798. }
  7799. else {
  7800. if (type == FoulType.rootHole) {
  7801. selfAdd += 3;
  7802. if (this.inHoleBalls.length - 1 > 0) {
  7803. aiAdd += this.inHoleBalls.length - 1;
  7804. }
  7805. }
  7806. else {
  7807. aiAdd += this.inHoleBalls.length;
  7808. }
  7809. }
  7810. }
  7811. }
  7812. return [selfAdd, aiAdd];
  7813. }
  7814. judgeScoreEnd(selfAdd, aiAdd) {
  7815. this.selfScore += selfAdd;
  7816. this.aiScore += aiAdd;
  7817. this.updateAIScore();
  7818. this.updateSelfScore();
  7819. if (this.selfScore >= this.targertScore) {
  7820. this.success = true;
  7821. return true;
  7822. }
  7823. if (this.aiScore >= this.targertScore) {
  7824. this.success = false;
  7825. return true;
  7826. }
  7827. let ballArr = xGame.common.d2World.ballArr;
  7828. if (ballArr.length == 1 && ballArr[0].number == 0) {
  7829. if (this.selfScore > this.aiScore) {
  7830. this.success = true;
  7831. return true;
  7832. }
  7833. else if (this.selfScore < this.aiScore) {
  7834. this.success = false;
  7835. return true;
  7836. }
  7837. else {
  7838. if (this.selfTurn) {
  7839. this.success = false;
  7840. }
  7841. else {
  7842. this.success = true;
  7843. }
  7844. return true;
  7845. }
  7846. }
  7847. }
  7848. clearIceSkill() {
  7849. let arr = xGame.common.d2World.ballArr;
  7850. let temp;
  7851. if (this.selfTurn) {
  7852. if (this.selfCurSkill == SkillType.ice) {
  7853. for (let index = 0; index < arr.length; index++) {
  7854. temp = arr[index];
  7855. if (temp.ballFunc == "ice") {
  7856. temp.setBallFunc("normal", "self");
  7857. }
  7858. }
  7859. }
  7860. }
  7861. else {
  7862. if (this.aiCurSkill == SkillType.ice) {
  7863. for (let index = 0; index < arr.length; index++) {
  7864. temp = arr[index];
  7865. if (temp.ballFunc == "ice") {
  7866. temp.setBallFunc("normal", "ai");
  7867. }
  7868. }
  7869. }
  7870. }
  7871. }
  7872. judgeNormalSuccess() {
  7873. if (this.selfTurn) {
  7874. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7875. this.success = true;
  7876. return true;
  7877. }
  7878. }
  7879. else {
  7880. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7881. this.success = false;
  7882. return true;
  7883. }
  7884. }
  7885. }
  7886. gameEnd() {
  7887. if (Moyu.isTT) {
  7888. xGame.common.screenImg = getScreenImg();
  7889. }
  7890. console.log("游戏结束", this.success);
  7891. xGame.common.aiPlayer.stopRun();
  7892. if (xGame.common.gameMode == GameMode.placeBall) {
  7893. this.getEndStarNum();
  7894. this.updatePlaceBallState();
  7895. }
  7896. this.isEnter = false;
  7897. Moyu.recordEnd(this, () => {
  7898. if (this.isEnter)
  7899. return;
  7900. this.isEnter = true;
  7901. console.log("进入录结束回调");
  7902. this.enterNext();
  7903. });
  7904. Laya.timer.once(1000, this, () => {
  7905. if (this.isEnter)
  7906. return;
  7907. this.isEnter = true;
  7908. this.enterNext();
  7909. });
  7910. xGame.common.longHelpLine = false;
  7911. }
  7912. enterNext() {
  7913. Laya.timer.clearAll(this);
  7914. if (Moyu.canShare() > 100 || Moyu.isKs) {
  7915. xGame.uiMgr.Show(UIVideoShare, this.success);
  7916. }
  7917. else {
  7918. xGame.uiMgr.Show(UIGameEnd, this.success);
  7919. }
  7920. }
  7921. aiLeave() {
  7922. let ui = xGame.common.gameUI.ui;
  7923. ui.topNode.aiNameTxt.text = "offline";
  7924. }
  7925. aiGameEnd(suc) {
  7926. this.success = suc;
  7927. xGame.common.aiPlayer.stopRun();
  7928. if (this.success) {
  7929. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  7930. Laya.timer.once(1000, this, () => {
  7931. this.clearTime();
  7932. this.gameEnd();
  7933. });
  7934. }
  7935. }
  7936. openTimer() {
  7937. let src = xGame.common.gameUI;
  7938. if (this.selfTurn) {
  7939. src.ui.topNode.selfProgress.visible = true;
  7940. src.ui.topNode.aiProgress.visible = false;
  7941. this.curTimer = src.ui.topNode.selfProgress;
  7942. }
  7943. else {
  7944. src.ui.topNode.selfProgress.visible = false;
  7945. src.ui.topNode.aiProgress.visible = true;
  7946. this.curTimer = src.ui.topNode.aiProgress;
  7947. }
  7948. this.accTime = 0;
  7949. Laya.timer.clearAll(this);
  7950. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  7951. this.curTimer.value = 100;
  7952. }
  7953. updateTime(dt) {
  7954. if (this.gamePause)
  7955. return;
  7956. this.accTime += dt;
  7957. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  7958. if (this.accTime >= this.setTime) {
  7959. this.clearTime();
  7960. console.log("时钟进入了gameRun");
  7961. this.gameRun(FoulType.timeOut);
  7962. }
  7963. }
  7964. clearTime() {
  7965. let src = xGame.common.gameUI;
  7966. src.ui.topNode.selfProgress.visible = false;
  7967. src.ui.topNode.aiProgress.visible = false;
  7968. Laya.timer.clearAll(this);
  7969. }
  7970. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  7971. let ui = xGame.common.gameUI.ui;
  7972. let selfMsg, aiMsg;
  7973. if (sayWords) {
  7974. selfMsg = cfgTable.wordsData[selfIndex].msg;
  7975. aiMsg = cfgTable.wordsData[aiIndex].msg;
  7976. if (Foul) {
  7977. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  7978. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  7979. this.placeRootBall();
  7980. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  7981. if (this.curFoul == FoulType.rootHole) {
  7982. if (!DataMgr.getRootBallFoul()) {
  7983. DataMgr.setRootBallFoul();
  7984. aiMsg = "";
  7985. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  7986. let woman = "Boss, pay attention next time~";
  7987. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7988. }
  7989. }
  7990. else if (this.curFoul == FoulType.timeOut) {
  7991. if (!DataMgr.getTimeoutFoul()) {
  7992. DataMgr.setTimeoutFoul();
  7993. aiMsg = "";
  7994. let tips = "Game timeout, 3 fouls, this game failed.";
  7995. let woman = "Boss, pay attention to the timeline~";
  7996. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7997. }
  7998. }
  7999. }
  8000. }
  8001. }
  8002. if (this.selfTurn) {
  8003. if (sayWords) {
  8004. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8005. ui.selfTurn.visible = true;
  8006. ui.aiTurn.visible = false;
  8007. ui.selfTurn.t0.play();
  8008. Moyu.vibration();
  8009. });
  8010. }
  8011. }
  8012. else {
  8013. let aiNum = xGame.tools.random(1, 11);
  8014. let challengeNum = DataMgr.getChallengeTimes();
  8015. let delay = false;
  8016. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8017. aiNum = 9;
  8018. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8019. aiNum = 3;
  8020. if (challengeNum == 3) {
  8021. if (!this.showLongView) {
  8022. this.showLongView = true;
  8023. delay = true;
  8024. }
  8025. }
  8026. }
  8027. }
  8028. if (delay) {
  8029. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8030. if (success) {
  8031. xGame.common.longHelpLine = true;
  8032. xGame.common.d2World.getHelpLine();
  8033. }
  8034. else {
  8035. aiNum = 10;
  8036. }
  8037. xGame.common.aiPlayer.setAiLevel(aiNum);
  8038. if (sayWords) {
  8039. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8040. xGame.common.aiPlayer.runAI();
  8041. ui.selfTurn.visible = false;
  8042. ui.aiTurn.visible = true;
  8043. ui.aiTurn.t0.play();
  8044. });
  8045. }
  8046. else {
  8047. xGame.common.aiPlayer.runAI();
  8048. }
  8049. this.openTimer();
  8050. this.finishOneShoot = true;
  8051. if (this.selfTurn) {
  8052. ui.topNode.selfKuang.visible = true;
  8053. ui.topNode.aiKuang.visible = false;
  8054. ui.topNode.selfTips.visible = true;
  8055. ui.topNode.aiTips.visible = false;
  8056. }
  8057. else {
  8058. ui.topNode.selfKuang.visible = false;
  8059. ui.topNode.aiKuang.visible = true;
  8060. ui.topNode.selfTips.visible = false;
  8061. ui.topNode.aiTips.visible = true;
  8062. }
  8063. });
  8064. return;
  8065. }
  8066. if (xGame.common.gameMode == GameMode.classic) {
  8067. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8068. if (cfg) {
  8069. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8070. aiNum = aiLevel;
  8071. }
  8072. }
  8073. xGame.common.aiPlayer.setAiLevel(aiNum);
  8074. if (sayWords) {
  8075. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8076. xGame.common.aiPlayer.runAI();
  8077. ui.selfTurn.visible = false;
  8078. ui.aiTurn.visible = true;
  8079. ui.aiTurn.t0.play();
  8080. });
  8081. }
  8082. else {
  8083. xGame.common.aiPlayer.runAI();
  8084. }
  8085. }
  8086. this.openTimer();
  8087. this.finishOneShoot = true;
  8088. if (this.selfTurn) {
  8089. ui.topNode.selfKuang.visible = true;
  8090. ui.topNode.aiKuang.visible = false;
  8091. ui.topNode.selfTips.visible = true;
  8092. ui.topNode.aiTips.visible = false;
  8093. }
  8094. else {
  8095. ui.topNode.selfKuang.visible = false;
  8096. ui.topNode.aiKuang.visible = true;
  8097. ui.topNode.selfTips.visible = false;
  8098. ui.topNode.aiTips.visible = true;
  8099. }
  8100. }
  8101. placeRootBall() {
  8102. let rootBall = xGame.common.d2World.rootBall;
  8103. if (!rootBall)
  8104. return;
  8105. rootBall.gameObj.x = this.lastRootBallPos.x;
  8106. rootBall.gameObj.y = this.lastRootBallPos.y;
  8107. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8108. let moveNode = xGame.common.gameUI.ui.moveNode;
  8109. moveNode.visible = true;
  8110. moveNode.x = this.lastRootBallPos.x;
  8111. moveNode.y = this.lastRootBallPos.y;
  8112. if (!this.selfTurn) {
  8113. xGame.common.aiPlayer.resetRoot();
  8114. }
  8115. }
  8116. }
  8117. class ui_guanyuAni extends fgui.GComponent {
  8118. static createInstance() {
  8119. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8120. }
  8121. onConstruct() {
  8122. this.n0 = (this.getChild("n0"));
  8123. }
  8124. }
  8125. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8126. class UIFireworks extends UIBase {
  8127. constructor() {
  8128. super();
  8129. }
  8130. onConstructor() {
  8131. this.isEject = false;
  8132. }
  8133. show(callback) {
  8134. super.show();
  8135. }
  8136. }
  8137. UIFireworks.uiName = "UIFireworks";
  8138. class ui_UIGuanYu extends fgui.GComponent {
  8139. static createInstance() {
  8140. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8141. }
  8142. onConstruct() {
  8143. this.n2 = (this.getChild("n2"));
  8144. this.n1 = (this.getChild("n1"));
  8145. this.n3 = (this.getChild("n3"));
  8146. this.n4 = (this.getChild("n4"));
  8147. this.n5 = (this.getChild("n5"));
  8148. this.n6 = (this.getChild("n6"));
  8149. this.n8 = (this.getChild("n8"));
  8150. this.n7 = (this.getChild("n7"));
  8151. this.t0 = this.getTransition("t0");
  8152. }
  8153. }
  8154. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8155. class UIGuanYu extends UIBase {
  8156. constructor() {
  8157. super();
  8158. }
  8159. onConstructor() {
  8160. this.ui = ui_UIGuanYu.createInstance();
  8161. this.contentPane = this.ui;
  8162. this.isEject = false;
  8163. }
  8164. show(callback) {
  8165. super.show();
  8166. this.ui.t0.play(Laya.Handler.create(this, () => {
  8167. callback && callback();
  8168. this.hide();
  8169. }));
  8170. }
  8171. }
  8172. UIGuanYu.uiName = "UIGuanYu";
  8173. class SkillMgr {
  8174. constructor() {
  8175. this.leveNum = 0;
  8176. this.extraScore = 0;
  8177. this.selfTurn = false;
  8178. this.playedLastSkill = false;
  8179. this.tweenArr = [];
  8180. this._finishNum = 0;
  8181. this._curFinish = 0;
  8182. this._rootX = 0;
  8183. this._rootY = 0;
  8184. this.knifeTimes = 0;
  8185. this.knifeV2 = new Laya.Vector2();
  8186. this.knifeV3 = new Laya.Vector3();
  8187. this.rtStarX = 0;
  8188. this.rtStarY = 0;
  8189. this.addBigSkillSpine();
  8190. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8191. }
  8192. addBigSkillSpine() {
  8193. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8194. console.log("extra2 success");
  8195. });
  8196. }
  8197. runBigSkill(callback) {
  8198. this.tweenArr = [];
  8199. this.callback = callback;
  8200. this.judgeSkill();
  8201. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8202. let guide = DataMgr.getSkillGuide();
  8203. if (!xGame.common.gameMgr.selfTurn) {
  8204. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8205. }
  8206. else {
  8207. if (xGame.common.temSelfLevel != 0) {
  8208. this.leveNum = xGame.common.temSelfLevel;
  8209. }
  8210. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8211. this.leveNum += 5;
  8212. }
  8213. }
  8214. if (guide == 0) {
  8215. DataMgr.setSkillGuide(1);
  8216. if (DataMgr.getNewUser()) {
  8217. Moyu.sendDataEvent("gameFirstPlay");
  8218. DataMgr.setNewUser();
  8219. }
  8220. }
  8221. this.playSpineAni(() => {
  8222. switch (this.curSkill) {
  8223. case SkillType.highSpace:
  8224. this.runHighSpace();
  8225. break;
  8226. case SkillType.breakArmy:
  8227. this.runBreakArmy();
  8228. break;
  8229. case SkillType.ice:
  8230. this.runIce();
  8231. break;
  8232. case SkillType.fireworks:
  8233. this.runFireworks();
  8234. break;
  8235. case SkillType.GuanYu:
  8236. this.runGuanYu();
  8237. break;
  8238. default:
  8239. break;
  8240. }
  8241. });
  8242. }
  8243. judgeSkill() {
  8244. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8245. let gameMgr = xGame.common.gameMgr;
  8246. let type;
  8247. for (let index = 0; index < typeArr.length; index++) {
  8248. type = typeArr[index];
  8249. if (gameMgr.selfTurn) {
  8250. if (gameMgr.selfCurSkill == type) {
  8251. this.selfTurn = true;
  8252. this.curSkill = type;
  8253. return;
  8254. }
  8255. }
  8256. else {
  8257. if (gameMgr.aiCurSkill == type) {
  8258. this.selfTurn = false;
  8259. this.curSkill = type;
  8260. return;
  8261. }
  8262. }
  8263. }
  8264. }
  8265. playSpineAni(callback) {
  8266. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8267. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8268. parent.destroyChildren();
  8269. let aniIndex = 0;
  8270. let skillSpine;
  8271. switch (this.curSkill) {
  8272. case SkillType.highSpace:
  8273. aniIndex = 1;
  8274. xGame.soundMgr.playSound("skill01");
  8275. skillSpine = this.skillSpine2;
  8276. data.scaleX = 0.5;
  8277. data.scaleY = 0.5;
  8278. skillSpine.play(data, 1, false, parent, () => {
  8279. callback && callback();
  8280. });
  8281. break;
  8282. case SkillType.breakArmy:
  8283. aniIndex = 2;
  8284. xGame.soundMgr.playSound("skill02");
  8285. skillSpine = this.skillSpine2;
  8286. data.scaleX = 0.5;
  8287. data.scaleY = 0.5;
  8288. skillSpine.play(data, 2, false, parent, () => {
  8289. callback && callback();
  8290. });
  8291. break;
  8292. case SkillType.ice:
  8293. aniIndex = 0;
  8294. xGame.soundMgr.playSound("skill03");
  8295. skillSpine = this.skillSpine2;
  8296. data.scaleX = 0.5;
  8297. data.scaleY = 0.5;
  8298. skillSpine.play(data, 0, false, parent, () => {
  8299. callback && callback();
  8300. });
  8301. break;
  8302. case SkillType.fireworks:
  8303. xGame.soundMgr.playSound("skill_04_01");
  8304. xGame.soundMgr.playSound("skill04");
  8305. xGame.uiMgr.Show(UIFireworks, callback);
  8306. break;
  8307. case SkillType.GuanYu:
  8308. xGame.soundMgr.playSound("skill05_1");
  8309. xGame.soundMgr.playSound("skill05");
  8310. xGame.uiMgr.Show(UIGuanYu, callback);
  8311. break;
  8312. default:
  8313. break;
  8314. }
  8315. }
  8316. getAllBallArr() {
  8317. let arr = xGame.common.d2World.ballArr;
  8318. let outArr = [];
  8319. for (let index = 0; index < arr.length; index++) {
  8320. if (arr[index] instanceof D2RootBallSrc)
  8321. continue;
  8322. if (arr[index].ballFunc == "ice")
  8323. continue;
  8324. if (arr[index].destroyed)
  8325. continue;
  8326. outArr.push(arr[index]);
  8327. }
  8328. return outArr;
  8329. }
  8330. getOneArr(deletObj) {
  8331. let allArr = this.getAllBallArr();
  8332. let temp;
  8333. for (let index = 0; index < allArr.length; index++) {
  8334. temp = allArr[index];
  8335. if (temp.id == deletObj.id) {
  8336. allArr.splice(index, 1);
  8337. break;
  8338. }
  8339. }
  8340. return allArr;
  8341. }
  8342. getNearBallBag(ball) {
  8343. let ui = xGame.common.gameUI.ui;
  8344. let circleArr = [];
  8345. for (let index = 1; index <= 6; index++) {
  8346. circleArr.push(ui.border["circle" + index]);
  8347. }
  8348. let outIndex = 0;
  8349. let temp;
  8350. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8351. ;
  8352. let dis = 0;
  8353. for (let index = 1; index < circleArr.length; index++) {
  8354. temp = circleArr[index];
  8355. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8356. if (dis < min) {
  8357. min = dis;
  8358. outIndex = index;
  8359. }
  8360. }
  8361. return [circleArr[outIndex], outIndex];
  8362. }
  8363. ballFlyToBag(ballArr, time = 300) {
  8364. let temp;
  8365. let hole;
  8366. this._finishNum = ballArr.length;
  8367. this._curFinish = 0;
  8368. let holeObj = {};
  8369. let holeCfg = {
  8370. "1": 0,
  8371. "2": 0,
  8372. "3": 0,
  8373. "4": 0,
  8374. "5": 0,
  8375. "6": 0
  8376. };
  8377. for (let index = 0; index < ballArr.length; index++) {
  8378. temp = ballArr[index];
  8379. temp.outColli.isSensor = true;
  8380. temp.innerColli.isSensor = true;
  8381. temp.isRunSkillAni = true;
  8382. let holeArr = this.getNearBallBag(temp);
  8383. hole = holeArr[0];
  8384. holeObj[index] = holeArr[1];
  8385. temp.d3BallSrc.scaleXYZ = 0.5;
  8386. this.tweenArr.push(temp.d3BallSrc, temp);
  8387. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8388. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8389. }));
  8390. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8391. let mIndex = holeObj[this._curFinish];
  8392. let isDone = holeCfg[mIndex];
  8393. if (isDone) {
  8394. ballArr[this._curFinish].checkWrongBall(false);
  8395. }
  8396. else {
  8397. holeCfg[mIndex] = 1;
  8398. ballArr[this._curFinish].checkWrongBall();
  8399. }
  8400. this._curFinish++;
  8401. if (this._curFinish >= this._finishNum) {
  8402. if (this.curSkill == SkillType.highSpace) {
  8403. }
  8404. else if (this.curSkill == SkillType.breakArmy) {
  8405. let rootBall = xGame.common.d2World.rootBall;
  8406. rootBall.gameObj.x = this._rootX;
  8407. rootBall.gameObj.y = this._rootY;
  8408. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8409. xGame.common.d2World.d2Gan.ui.visible = true;
  8410. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8411. xGame.common.d2World.getHelpLine();
  8412. this.callback && this.callback(this.extraScore);
  8413. }
  8414. }
  8415. }));
  8416. }
  8417. }
  8418. runHighSpace() {
  8419. let rootBall = xGame.common.d2World.rootBall;
  8420. rootBall.showSelf();
  8421. let d3Src = rootBall.d3BallSrc;
  8422. let allArr = this.getAllBallArr();
  8423. if (allArr.length <= 0) {
  8424. this.callback && this.callback(0);
  8425. return;
  8426. }
  8427. let selectBall = xGame.common.d2World.targetBall;
  8428. let wrong = selectBall && selectBall.destroyed;
  8429. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8430. selectBall = xGame.common.getRandArrEle(allArr);
  8431. }
  8432. let targetD3Src = selectBall.d3BallSrc;
  8433. xGame.common.d2World.d2Gan.ui.visible = false;
  8434. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8435. d3Src.scaleXYZ = 0.5;
  8436. this.tweenArr.push(d3Src);
  8437. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8438. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8439. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8440. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8441. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8442. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8443. let outArr = [selectBall];
  8444. let other = this.leveNum - 1;
  8445. if (other > 0) {
  8446. let nearArr = this.getOneArr(selectBall);
  8447. if (nearArr.length > 0) {
  8448. xGame.common.botherArr(nearArr);
  8449. if (other >= nearArr.length)
  8450. other = nearArr.length;
  8451. for (let index = 0; index < other; index++) {
  8452. outArr.push(nearArr[index]);
  8453. }
  8454. }
  8455. }
  8456. xGame.common.extraMoveNum = other + 1;
  8457. this.extraScore = other + 1;
  8458. this._rootX = selectBall.gameObj.x;
  8459. this._rootY = selectBall.gameObj.y;
  8460. rootBall.gameObj.x = this._rootX;
  8461. rootBall.gameObj.y = this._rootY;
  8462. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8463. Laya.Tween.clearAll(d3Src);
  8464. this.addRandomForce(outArr);
  8465. }));
  8466. }));
  8467. }
  8468. addRandomForce(outArr) {
  8469. if (outArr.length > 0) {
  8470. xGame.common.d2World.openCheckStill = true;
  8471. this.playedLastSkill = true;
  8472. }
  8473. let temp;
  8474. for (let index = 0; index < outArr.length; index++) {
  8475. let angle = xGame.common.randomNum(0, 360);
  8476. let linearPercent = xGame.common.randomNum(65, 100);
  8477. temp = outArr[index];
  8478. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8479. }
  8480. }
  8481. setLinearSpeed(angle, rigy, linearPercent) {
  8482. let sin = Math.sin(angle * Math.PI / 180);
  8483. let cos = Math.cos(angle * Math.PI / 180);
  8484. let maxSpeed = 4;
  8485. let speed = new Laya.Vector2();
  8486. speed.x = maxSpeed * linearPercent * sin;
  8487. speed.y = -maxSpeed * linearPercent * cos;
  8488. rigy.applyLinearImpulseToCenter(speed);
  8489. }
  8490. runBreakArmy() {
  8491. xGame.common.d2World.d2Gan.ui.visible = false;
  8492. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8493. let gameUI = xGame.common.gameUI.ui;
  8494. gameUI.skillRod.visible = true;
  8495. gameUI.skillRod.rotation = 110;
  8496. let outArr = this.getAllBallArr();
  8497. if (outArr.length <= 0) {
  8498. gameUI.skillRod.visible = false;
  8499. this.callback && this.callback(0);
  8500. return;
  8501. }
  8502. xGame.common.botherArr(outArr);
  8503. if (this.leveNum >= outArr.length)
  8504. this.leveNum = outArr.length;
  8505. let deleteNum = outArr.length - this.leveNum;
  8506. outArr.splice(0, deleteNum);
  8507. this.extraScore = this.leveNum;
  8508. let potX = gameUI.skillRod.x;
  8509. let potY = gameUI.skillRod.y;
  8510. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8511. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8512. let disArr = [];
  8513. for (let index = 0; index < outArr.length; index++) {
  8514. let obj = outArr[index];
  8515. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8516. dis = Math.pow(dis, 0.5);
  8517. disArr.push(dis);
  8518. }
  8519. this.tweenArr.push(gameUI.skillRod);
  8520. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8521. })).update = Laya.Handler.create(this, (e, t, c) => {
  8522. let angle = gameUI.skillRod.rotation;
  8523. let xx;
  8524. let yy;
  8525. let temp;
  8526. for (let index = 0; index < outArr.length; index++) {
  8527. temp = outArr[index];
  8528. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8529. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8530. yy -= 20;
  8531. temp.gameObj.x = xx;
  8532. temp.gameObj.y = yy;
  8533. temp.d3BallSrc.setTransPos(xx, yy);
  8534. }
  8535. if (angle <= 60) {
  8536. Laya.Tween.clearAll(gameUI.skillRod);
  8537. this.ballFlyToBag(outArr, 150);
  8538. gameUI.skillRod.visible = false;
  8539. }
  8540. }, null, false);
  8541. }
  8542. runIce() {
  8543. let ballArr = xGame.common.d2World.ballArr;
  8544. this.leveNum *= 2;
  8545. if (this.leveNum >= ballArr.length - 1)
  8546. this.leveNum = ballArr.length - 1;
  8547. let tempArr = [];
  8548. let outArr = [];
  8549. for (let index = 0; index < ballArr.length; index++) {
  8550. if (ballArr[index] instanceof D2RootBallSrc)
  8551. continue;
  8552. tempArr.push(ballArr[index]);
  8553. }
  8554. if (tempArr.length <= 0) {
  8555. this.callback && this.callback(0);
  8556. return;
  8557. }
  8558. xGame.common.botherArr(tempArr);
  8559. for (let index = 0; index < this.leveNum; index++) {
  8560. outArr.push(tempArr[index]);
  8561. }
  8562. this.extraScore = this.leveNum;
  8563. let temp;
  8564. for (let index = 0; index < outArr.length; index++) {
  8565. temp = outArr[index];
  8566. temp.d3BallSrc.playIceEft();
  8567. }
  8568. Laya.timer.once(2000, this, () => {
  8569. for (let index = 0; index < outArr.length; index++) {
  8570. temp = outArr[index];
  8571. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8572. temp.setBallFunc("ice", str);
  8573. }
  8574. this.callback && this.callback(0);
  8575. });
  8576. }
  8577. runFireworks() {
  8578. let allArr = this.getAllBallArr();
  8579. if (allArr.length <= 0) {
  8580. this.callback && this.callback(0);
  8581. return;
  8582. }
  8583. xGame.common.d2World.d2Gan.ui.visible = false;
  8584. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8585. let outArr = [];
  8586. let other = this.leveNum;
  8587. if (other > 0) {
  8588. if (allArr.length > 0) {
  8589. xGame.common.botherArr(allArr);
  8590. if (other >= allArr.length)
  8591. other = allArr.length;
  8592. for (let index = 0; index < other; index++) {
  8593. outArr.push(allArr[index]);
  8594. }
  8595. }
  8596. }
  8597. xGame.common.extraMoveNum = other;
  8598. this.extraScore = other;
  8599. this.addRandmomFireworks(outArr);
  8600. }
  8601. addRandmomFireworks(outArr) {
  8602. Laya.timer.once(1100, this, () => {
  8603. if (outArr.length > 0) {
  8604. xGame.common.d2World.openCheckStill = true;
  8605. this.playedLastSkill = true;
  8606. }
  8607. });
  8608. xGame.soundMgr.playSound("skill_04_02");
  8609. let temp;
  8610. let delay = -200;
  8611. for (let index = 0; index < outArr.length; index++) {
  8612. temp = outArr[index];
  8613. delay += 200;
  8614. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8615. let angle = xGame.common.randomNum(0, 360);
  8616. angle = this.getFireworksAngle(obj);
  8617. let linearPercent = xGame.common.randomNum(45, 80);
  8618. if (!obj.destroyed)
  8619. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8620. });
  8621. }
  8622. }
  8623. getFireworksAngle(obj) {
  8624. let rootBall = xGame.common.d2World.rootBall;
  8625. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8626. }
  8627. resetGame() {
  8628. Laya.timer.clearAll(this);
  8629. if (this.tweenArr) {
  8630. for (let index = 0; index < this.tweenArr.length; index++) {
  8631. Laya.Tween.clearAll(this.tweenArr[index]);
  8632. }
  8633. }
  8634. this.tweenArr = null;
  8635. }
  8636. runGuanYu() {
  8637. xGame.common.d2World.d2Gan.ui.visible = false;
  8638. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8639. let rootBall = xGame.common.d2World.rootBall;
  8640. if (rootBall.isInHole) {
  8641. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8642. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8643. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8644. rootBall.showSelf();
  8645. }
  8646. this.rtStarX = rootBall.gameObj.x;
  8647. this.rtStarY = rootBall.gameObj.y;
  8648. this.knifeTimes = 0;
  8649. this.playedLastSkill = true;
  8650. rootBall.forceRun = true;
  8651. rootBall.rigy.type = "static";
  8652. xGame.common.d2World.openCheckStill = true;
  8653. this.guanyuRandomKnife();
  8654. }
  8655. guanyuRandomKnife() {
  8656. let rootBall = xGame.common.d2World.rootBall;
  8657. let dir = this.getRandDir();
  8658. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8659. console.log("当前angle", angle);
  8660. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8661. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8662. let dis = 324;
  8663. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8664. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8665. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8666. this.rtStarX = rootBall.gameObj.x;
  8667. this.rtStarY = rootBall.gameObj.y;
  8668. this.knifeTimes++;
  8669. let skillLevel;
  8670. if (xGame.common.gameMgr.selfTurn) {
  8671. skillLevel = DataMgr.getBigSkillByIndex(4);
  8672. }
  8673. else {
  8674. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8675. }
  8676. if (!skillLevel)
  8677. skillLevel = 1;
  8678. skillLevel += 2;
  8679. if (this.knifeTimes < skillLevel) {
  8680. Laya.timer.once(400, this, () => {
  8681. this.guanyuRandomKnife();
  8682. });
  8683. }
  8684. else {
  8685. rootBall.forceRun = false;
  8686. rootBall.rigy.type = "dynamic";
  8687. xGame.common.extraMoveNum = skillLevel;
  8688. }
  8689. }));
  8690. }
  8691. getRandDir() {
  8692. let rootBall = xGame.common.d2World.rootBall;
  8693. let allBall = this.getAllBallArr();
  8694. let target = xGame.common.getRandArrEle(allBall);
  8695. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8696. return this.knifeV2;
  8697. }
  8698. cloneKnife(x, y, rotation) {
  8699. let parent = xGame.common.d3World.knifeRoot;
  8700. let prefab = xGame.common.d3World.knife;
  8701. let clone = prefab.clone();
  8702. parent.addChild(clone);
  8703. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8704. clone.transform.localPositionX = this.knifeV3.x;
  8705. clone.transform.localPositionY = 0;
  8706. clone.transform.localPositionZ = this.knifeV3.z;
  8707. clone.transform.localRotationEulerX = 0;
  8708. clone.transform.localRotationEulerY = rotation;
  8709. clone.transform.localRotationEulerZ = 0;
  8710. clone.active = true;
  8711. return clone;
  8712. }
  8713. cloneGuanYuEft(x, y, angle) {
  8714. return;
  8715. let parent = xGame.common.gameUI.ui.guanyuNode;
  8716. let eft = new ui_guanyuAni();
  8717. eft.parent = parent;
  8718. eft.x = x;
  8719. eft.y = y;
  8720. eft.rotation = angle;
  8721. }
  8722. }
  8723. class ui_UIWordsList extends fgui.GComponent {
  8724. static createInstance() {
  8725. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8726. }
  8727. onConstruct() {
  8728. this.c1 = this.getController("c1");
  8729. this.n74 = (this.getChild("n74"));
  8730. this.clickNode = (this.getChild("clickNode"));
  8731. this.myNode = (this.getChild("myNode"));
  8732. this.n68 = (this.getChild("n68"));
  8733. this.n66 = (this.getChild("n66"));
  8734. this.n55 = (this.getChild("n55"));
  8735. this.wordsBtn = (this.getChild("wordsBtn"));
  8736. this.emotionBtn = (this.getChild("emotionBtn"));
  8737. this.mybggg = (this.getChild("mybggg"));
  8738. this.wordsList = (this.getChild("wordsList"));
  8739. this.emotionList = (this.getChild("emotionList"));
  8740. this.myRoot = (this.getChild("myRoot"));
  8741. }
  8742. }
  8743. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8744. class EmotionDisplay {
  8745. constructor(index, ui) {
  8746. this.ui = ui;
  8747. this.index = index;
  8748. this.ui.onClick(this, this.clickSelf);
  8749. this.updateSelf();
  8750. }
  8751. updateSelf() {
  8752. let data = cfgTable.emotionData[this.index + 1];
  8753. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8754. }
  8755. clickSelf() {
  8756. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8757. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8758. xGame.common.talkMgr.closeTalkView();
  8759. }
  8760. }
  8761. class WordsDisplay {
  8762. constructor(index, ui) {
  8763. this.ui = ui;
  8764. this.index = index;
  8765. this.ui.onClick(this, this.clickSelf);
  8766. this.updateSelf();
  8767. }
  8768. updateSelf() {
  8769. let data = cfgTable.talkwordsData[this.index + 1];
  8770. this.ui.txt.text = data.msg;
  8771. }
  8772. clickSelf() {
  8773. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8774. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8775. xGame.common.talkMgr.closeTalkView();
  8776. }
  8777. }
  8778. class UIWordsList extends UIBase {
  8779. constructor() {
  8780. super();
  8781. }
  8782. onConstructor() {
  8783. this.ui = ui_UIWordsList.createInstance();
  8784. this.contentPane = this.ui;
  8785. this.isEject = false;
  8786. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8787. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8788. this.addUIClick(this.ui.clickNode, this.hide);
  8789. this.initTalkList();
  8790. this.initEmotionList();
  8791. }
  8792. show() {
  8793. super.show();
  8794. }
  8795. initTalkList() {
  8796. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8797. let data = cfgTable.talkwordsData;
  8798. let length = Object.keys(data).length;
  8799. this.ui.wordsList.numItems = length;
  8800. }
  8801. initEmotionList() {
  8802. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8803. let data = cfgTable.emotionData;
  8804. let length = Object.keys(data).length;
  8805. this.ui.emotionList.numItems = length;
  8806. }
  8807. renderTalkItem(index, obj) {
  8808. let temp = new WordsDisplay(index, obj);
  8809. }
  8810. renderEmotionItem(index, obj) {
  8811. let temp = new EmotionDisplay(index, obj);
  8812. }
  8813. openTalkList() {
  8814. this.ui.c1.selectedIndex = 0;
  8815. }
  8816. openEmotionList() {
  8817. this.ui.c1.selectedIndex = 1;
  8818. }
  8819. }
  8820. UIWordsList.uiName = "UIWordsList";
  8821. class TalkMgr {
  8822. constructor() {
  8823. this.aiSpeak = true;
  8824. this.emotionList = [];
  8825. this.talkList = [];
  8826. this.addEvent();
  8827. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8828. this.emotionList = [];
  8829. this.talkList = [];
  8830. for (let k in cfgTable.emotionData) {
  8831. this.emotionList.push(cfgTable.emotionData[k].id);
  8832. }
  8833. for (let k in cfgTable.talkwordsData) {
  8834. this.talkList.push(cfgTable.talkwordsData[k].id);
  8835. }
  8836. }
  8837. addEvent() {
  8838. let ui = xGame.common.gameUI.ui;
  8839. ui.wordsBtn.visible = true;
  8840. ui.wordsBtn.onClick(this, this.openTalkView);
  8841. ui.aiWordsBtn.visible = true;
  8842. ui.aiWordsBtn.onClick(this, this.clickAIState);
  8843. }
  8844. openTalkView() {
  8845. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8846. xGame.uiMgr.Show(UIWordsList);
  8847. }
  8848. closeTalkView() {
  8849. xGame.uiMgr.Hide(UIWordsList);
  8850. }
  8851. clickAIState() {
  8852. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8853. this.aiSpeak = !this.aiSpeak;
  8854. this.changeAIState(this.aiSpeak);
  8855. }
  8856. changeAIState(speak) {
  8857. this.aiSpeak = speak;
  8858. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  8859. if (speak) {
  8860. btn.c1.selectedIndex = 0;
  8861. }
  8862. else {
  8863. btn.c1.selectedIndex = 1;
  8864. }
  8865. }
  8866. showSelfTalk(wordsId) {
  8867. let ui = xGame.common.gameUI.ui;
  8868. ui.selfTalk.visible = true;
  8869. ui.selfTalk.myNode.c1.selectedIndex = 1;
  8870. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8871. ui.selfTalk.t0.play();
  8872. }
  8873. showSelfEmotion(emotionId) {
  8874. let ui = xGame.common.gameUI.ui;
  8875. ui.selfTalk.visible = true;
  8876. ui.selfTalk.myNode.c1.selectedIndex = 0;
  8877. this.selfSpine && this.selfSpine.dispose();
  8878. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8879. let spineData = cfgTable.emotionData[emotionId].spine;
  8880. this.selfSpine = new SpineMgr(spineData, () => {
  8881. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  8882. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  8883. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8884. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  8885. });
  8886. ui.selfTalk.t0.play();
  8887. }
  8888. showAITalk(wordsId) {
  8889. if (!this.aiSpeak)
  8890. return;
  8891. if (DataMgr.gameData.gameCount < 2)
  8892. return;
  8893. if (wordsId < 1)
  8894. wordsId = this.getRandTalk();
  8895. let ui = xGame.common.gameUI.ui;
  8896. ui.aiTalk.visible = true;
  8897. ui.aiTalk.myNode.c1.selectedIndex = 1;
  8898. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8899. ui.aiTalk.t0.play();
  8900. }
  8901. getRandTalk() {
  8902. let rand = xGame.tools.random(0, this.talkList.length);
  8903. return this.emotionList[rand];
  8904. }
  8905. getRandEmotion() {
  8906. let rand = xGame.tools.random(0, this.emotionList.length);
  8907. return this.emotionList[rand];
  8908. }
  8909. showAIEmotion(emotionId) {
  8910. if (!this.aiSpeak)
  8911. return;
  8912. if (DataMgr.gameData.gameCount < 2)
  8913. return;
  8914. if (emotionId < 1)
  8915. emotionId = this.getRandEmotion();
  8916. let ui = xGame.common.gameUI.ui;
  8917. ui.aiTalk.visible = true;
  8918. ui.aiTalk.myNode.c1.selectedIndex = 0;
  8919. this.aiSpine && this.aiSpine.dispose();
  8920. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8921. let spineData = cfgTable.emotionData[emotionId].spine;
  8922. this.aiSpine = new SpineMgr(spineData, () => {
  8923. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  8924. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  8925. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8926. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  8927. });
  8928. ui.aiTalk.t0.play();
  8929. }
  8930. resetGame() {
  8931. let ui = xGame.common.gameUI.ui;
  8932. ui.aiTalk.visible = false;
  8933. ui.selfTalk.visible = false;
  8934. this.aiSpine && this.aiSpine.dispose();
  8935. this.selfSpine && this.selfSpine.dispose();
  8936. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8937. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8938. this.closeTalkView();
  8939. }
  8940. }
  8941. class WordsMgr {
  8942. constructor() {
  8943. this.comboTimes = 1;
  8944. this.skillTimes = 0;
  8945. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  8946. this.comboSpine = new SpineMgr("yxz_liangan");
  8947. this.skillSpine = new SpineMgr("yiganxqiu");
  8948. this.scoreSpine = new SpineMgr("defen");
  8949. }
  8950. setClassicCombo(isInterrupt) {
  8951. if (isInterrupt) {
  8952. this.comboTimes = 0;
  8953. }
  8954. }
  8955. playClassicWords(type, callback) {
  8956. this.callback = callback;
  8957. let aniIndex = type;
  8958. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8959. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8960. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  8961. mySpine.destroy(true);
  8962. this.playClassicTimes();
  8963. });
  8964. }
  8965. playClassicTimes() {
  8966. this.comboTimes++;
  8967. if (this.comboTimes <= 1) {
  8968. this.callback && this.callback();
  8969. }
  8970. else {
  8971. let aniIndex = this.comboTimes - 1;
  8972. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8973. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8974. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  8975. mySpine.destroy(true);
  8976. this.callback && this.callback();
  8977. });
  8978. }
  8979. }
  8980. playBigSkillTimes(times, callback) {
  8981. if (times <= 0) {
  8982. callback && callback();
  8983. return;
  8984. }
  8985. this.callback = callback;
  8986. let pre = "sz_0";
  8987. let aniIndex = 0;
  8988. this.getWordsImg(times, pre, () => {
  8989. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8990. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  8991. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  8992. let r1 = ``;
  8993. let r2 = ``;
  8994. if (times <= 9) {
  8995. r1 = `res/d2Res/${pre}${times}.png`;
  8996. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  8997. aniIndex = 0;
  8998. }
  8999. else {
  9000. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9001. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9002. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9003. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9004. aniIndex = 1;
  9005. }
  9006. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9007. mySpine.destroy(true);
  9008. xGame.common.gameMgr.playSkillTips();
  9009. this.playScore(times);
  9010. xGame.common.playRandomMutiBallBigSkillSound();
  9011. }, mySpine);
  9012. });
  9013. }
  9014. playScore(score) {
  9015. let pre = "sz_";
  9016. let aniIndex = 0;
  9017. this.getWordsImg(score, pre, () => {
  9018. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9019. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9020. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9021. let r1 = ``;
  9022. let r2 = ``;
  9023. if (score <= 9) {
  9024. r1 = `res/d2Res/${pre}${score}.png`;
  9025. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9026. aniIndex = 0;
  9027. }
  9028. else {
  9029. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9030. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9031. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9032. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9033. aniIndex = 1;
  9034. }
  9035. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9036. mySpine.destroy(true);
  9037. this.callback && this.callback();
  9038. }, mySpine);
  9039. });
  9040. }
  9041. getWordsImg(number, pre = "", callback) {
  9042. let arr = [];
  9043. if (number <= 9) {
  9044. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9045. }
  9046. else {
  9047. 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 });
  9048. }
  9049. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9050. callback && callback();
  9051. }));
  9052. }
  9053. }
  9054. class ui_UIRodMethod extends fgui.GComponent {
  9055. static createInstance() {
  9056. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9057. }
  9058. onConstruct() {
  9059. this.n24 = (this.getChild("n24"));
  9060. this.white = (this.getChild("white"));
  9061. this.dot = (this.getChild("dot"));
  9062. this.sureBtn = (this.getChild("sureBtn"));
  9063. this.n20 = (this.getChild("n20"));
  9064. this.n21 = (this.getChild("n21"));
  9065. this.n22 = (this.getChild("n22"));
  9066. this.n23 = (this.getChild("n23"));
  9067. this.n5 = (this.getChild("n5"));
  9068. this.n14 = (this.getChild("n14"));
  9069. this.t0 = this.getTransition("t0");
  9070. }
  9071. }
  9072. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9073. class UIRodMethod extends UIBase {
  9074. constructor() {
  9075. super();
  9076. this.isPressd = false;
  9077. }
  9078. onConstructor() {
  9079. this.ui = ui_UIRodMethod.createInstance();
  9080. this.contentPane = this.ui;
  9081. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9082. this.moveDir = new Laya.Vector2();
  9083. this.moveDest = new Laya.Vector2();
  9084. this.centerPos = new Laya.Vector2();
  9085. xGame.common.uiRodMethod = this;
  9086. }
  9087. show() {
  9088. super.show();
  9089. xGame.common.gameMgr.gamePause = true;
  9090. this.openPressDotEvent();
  9091. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9092. this.centerPos.x = this.ui.white.x;
  9093. this.centerPos.y = this.ui.white.y;
  9094. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9095. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9096. this.setDot();
  9097. }
  9098. setDot() {
  9099. this.ui.dot.x = this.moveDest.x;
  9100. this.ui.dot.y = this.moveDest.y;
  9101. }
  9102. closeSelf() {
  9103. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9104. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9105. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9106. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9107. xGame.common.gameMgr.gamePause = false;
  9108. this.hide();
  9109. }
  9110. openPressDotEvent() {
  9111. this.closePressDotEvent();
  9112. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9113. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9114. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9115. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9116. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9117. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9118. }
  9119. closePressDotEvent() {
  9120. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9121. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9122. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9123. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9124. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9125. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9126. }
  9127. onDown(e) {
  9128. if (e.type == Laya.Event.MOUSE_DOWN)
  9129. this.isPressd = true;
  9130. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9131. this.isPressd = false;
  9132. if (!this.isPressd)
  9133. return;
  9134. this.moveDest.x = e.stageX;
  9135. this.moveDest.y = e.stageY;
  9136. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9137. if (dis > 6724) {
  9138. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9139. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9140. }
  9141. this.setDot();
  9142. }
  9143. resetRod() {
  9144. this.ui.dot.x = this.ui.white.x;
  9145. this.ui.dot.y = this.ui.white.y;
  9146. this.gameRod.dot.x = this.gameRod.bg.x;
  9147. this.gameRod.dot.y = this.gameRod.bg.y;
  9148. xGame.common.rodOffest.x = 0;
  9149. xGame.common.rodOffest.y = 0;
  9150. }
  9151. }
  9152. UIRodMethod.uiName = "UIRodMethod";
  9153. class UIGame extends UIBase {
  9154. constructor() {
  9155. super();
  9156. this.powerNum = 0;
  9157. this.isD3Inited = false;
  9158. this.isPrePlay = false;
  9159. this.isMoveRod = false;
  9160. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9161. this.rulerDis = 20;
  9162. this.rulerOffset = 0;
  9163. }
  9164. onConstructor() {
  9165. this.ui = ui_UIGame.createInstance();
  9166. this.contentPane = this.ui;
  9167. this.ui.x += xGame.common.sysOffestNum;
  9168. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9169. this.isEject = false;
  9170. xGame.common.gameUI = this;
  9171. this.initSelf();
  9172. }
  9173. isTurnSelf() {
  9174. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9175. return true;
  9176. }
  9177. }
  9178. initSelf() {
  9179. let topUI = this.ui.topNode;
  9180. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9181. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9182. this.barInfo = {};
  9183. this.barInfo.curY = 0;
  9184. this.barInfo.height = this.ui.powerNode.height;
  9185. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9186. this.barInfo.powerStartY = this.ui.powerNode.y;
  9187. xGame.common.aiPlayer = new AIPlayer();
  9188. xGame.common.gameMgr = new GameMgr();
  9189. xGame.common.skillMgr = new SkillMgr();
  9190. xGame.common.wordsMgr = new WordsMgr();
  9191. xGame.common.talkMgr = new TalkMgr();
  9192. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9193. console.log("加载经典模式表情文件chenggon !");
  9194. });
  9195. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9196. console.log("挑战模式奖励模式spine加载成功!");
  9197. });
  9198. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9199. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9200. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9201. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9202. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9203. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9204. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9205. }
  9206. returnHome() {
  9207. let tips = "Are you sure to exit the game?";
  9208. let woman = "Boss, why don't you play for a while longer?";
  9209. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9210. }
  9211. addRodMethodClick() {
  9212. if (this.isTurnSelf()) {
  9213. xGame.uiMgr.Show(UIRodMethod);
  9214. }
  9215. }
  9216. clickHelpLineBtn(force = false) {
  9217. if (!this.isTurnSelf())
  9218. return;
  9219. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9220. if (success) {
  9221. xGame.common.longHelpLine = true;
  9222. xGame.common.d2World.getHelpLine();
  9223. Moyu.sendDataEvent("guideNum");
  9224. }
  9225. else {
  9226. }
  9227. });
  9228. }
  9229. renderSelfDisplayBalls(index, target) {
  9230. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9231. target.myImg.url = xGame.common.getGameIconUrl(str);
  9232. }
  9233. renderAIDisplayBalls(index, target) {
  9234. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9235. target.myImg.url = xGame.common.getGameIconUrl(str);
  9236. ;
  9237. }
  9238. updateMode() {
  9239. if (xGame.common.gameMode == GameMode.classic) {
  9240. this.ui.topNode.scoreNode.visible = false;
  9241. }
  9242. else if (xGame.common.gameMode == GameMode.bigMove) {
  9243. this.ui.topNode.scoreNode.visible = true;
  9244. }
  9245. }
  9246. show() {
  9247. super.show();
  9248. console.log("zh:uigame show");
  9249. this.ui.alpha = 0;
  9250. this.updateSelf();
  9251. console.log("zh:uigame bf gamemusic01 start");
  9252. xGame.soundMgr.playMusic("gamemusic01");
  9253. console.log("zh:uigame bf gamemusic01 end");
  9254. xGame.common.gameMgr.gamePause = false;
  9255. xGame.common.gameUI.ui.blackAni.visible = false;
  9256. xGame.common.gameUI.ui.whiteAni.visible = false;
  9257. this.ui.powerEft.visible = false;
  9258. this.ui.colorNode.visible = false;
  9259. this.updateHead();
  9260. }
  9261. updateSelf() {
  9262. if (xGame.common.gameMode == GameMode.classic) {
  9263. this.ui.c1.selectedIndex = 0;
  9264. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9265. this.ui.topNode.middleNode.visible = true;
  9266. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9267. }
  9268. else if (xGame.common.gameMode == GameMode.bigMove) {
  9269. this.ui.c1.selectedIndex = 0;
  9270. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9271. this.ui.topNode.middleNode.visible = false;
  9272. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9273. let rand = xGame.common.randomNum(1, max);
  9274. let guide = DataMgr.getSkillGuide();
  9275. if (guide == 0)
  9276. rand = 1;
  9277. xGame.common.bigMoveLevelIndex = rand;
  9278. }
  9279. else if (xGame.common.gameMode == GameMode.placeBall) {
  9280. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9281. this.ui.c1.selectedIndex = 1 + data.type;
  9282. this.ui.alpha = 1;
  9283. this.startGame();
  9284. }
  9285. this.updateMode();
  9286. this.initD3world();
  9287. this.initD2world();
  9288. }
  9289. startGame() {
  9290. this.ui.snowNode.visible = Math.random() <= 0.1;
  9291. this.ui.d2Node.visible = false;
  9292. xGame.common.d3World.d3Hand.gameObj.active = false;
  9293. xGame.common.d3World.tableSrc.init();
  9294. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9295. this.cameraViewChange(() => {
  9296. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9297. switch (xGame.common.gameMode) {
  9298. case GameMode.classic:
  9299. xGame.common.d3World.d3Hand.gameObj.active = true;
  9300. this.playPutBallD3Ani();
  9301. break;
  9302. case GameMode.bigMove:
  9303. this.enterGame();
  9304. Laya.timer.once(500, this, () => {
  9305. this.ui.topNode.middleNode.visible = true;
  9306. this.ui.topNode.middleNode.t0.play();
  9307. });
  9308. break;
  9309. case GameMode.placeBall:
  9310. this.enterGame();
  9311. break;
  9312. default:
  9313. break;
  9314. }
  9315. });
  9316. PlatMgr.showBanner(false);
  9317. }
  9318. enterGame() {
  9319. this.ui.d2Node.visible = true;
  9320. xGame.common.d3World.d3Hand.gameObj.active = false;
  9321. xGame.common.showOneCamera("mainCamera");
  9322. Moyu.recordGame(30, true);
  9323. if (!this.isPrePlay) {
  9324. this.isPrePlay = true;
  9325. xGame.common.d3World.prePlayEft();
  9326. }
  9327. xGame.common.gameMgr.gameReady();
  9328. this.openAllEvent();
  9329. this.ui.snowNode.visible = false;
  9330. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9331. this.ui.helpBtn.visible = condition;
  9332. }
  9333. showHelpLineGuide() {
  9334. let longGuide = DataMgr.getGuideHelpLine();
  9335. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9336. this.ui.helpBtn.visible = true;
  9337. this.ui.guideNode.visible = true;
  9338. }
  9339. }
  9340. setTurnAlpha(alpha) {
  9341. this.ui.keduNode.alpha = alpha;
  9342. this.ui.ganNode.alpha = alpha;
  9343. this.ui.rodMethodNode.alpha = alpha;
  9344. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9345. }
  9346. cameraViewChange(callback) {
  9347. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9348. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9349. xGame.common.showOneCamera("visitAngle");
  9350. cameraSrc.localRotationEulerY = 180;
  9351. cameraSrc.localRotationEulerZ = 0;
  9352. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9353. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9354. callback && callback();
  9355. }));
  9356. }));
  9357. }
  9358. playPutBallD3Ani() {
  9359. xGame.common.showOneCamera("mainCamera");
  9360. let handSrc = xGame.common.d3World.d3Hand;
  9361. handSrc.gameObj.active = true;
  9362. handSrc.transform.localPositionZ = 3;
  9363. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9364. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9365. handSrc.gameObj.active = false;
  9366. this.enterGame();
  9367. }), 400);
  9368. }));
  9369. }
  9370. updateHead() {
  9371. let user = Moyu.getUserInfo();
  9372. this.ui.topNode.selfNameTxt.text = user.nickName;
  9373. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9374. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9375. if (DataMgr.getSkillGuide() < 1) {
  9376. this.ui.topNode.aiNameTxt.text = 'billiards';
  9377. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9378. }
  9379. else {
  9380. this.ui.topNode.aiNameTxt.text = aiData.name;
  9381. this.ui.topNode.aiHeadLoader.url = baseHeadUrl + aiData.icon;
  9382. }
  9383. }
  9384. initD2world() {
  9385. let node = this.ui.d2Root.displayObject;
  9386. let src = node.getComponent(D2World);
  9387. if (!src) {
  9388. xGame.common.d2World = node.addComponent(D2World);
  9389. }
  9390. xGame.common.d2World.initSelf();
  9391. }
  9392. initD3world() {
  9393. if (this.isD3Inited)
  9394. return;
  9395. this.isD3Inited = true;
  9396. let scene3D = xGame.common.d3Scene;
  9397. this.ui.d3Root.displayObject.addChild(scene3D);
  9398. scene3D.active = true;
  9399. xGame.common.d3World.tableSrc.setBorderPos();
  9400. }
  9401. onRootMove(e) {
  9402. let rootBall = xGame.common.d2World.rootBall;
  9403. this.ui.moveNode.x = e.x;
  9404. this.ui.moveNode.y = e.y;
  9405. rootBall.gameObj.x = e.x;
  9406. rootBall.gameObj.y = e.y;
  9407. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9408. }
  9409. aiRootMove(move) {
  9410. if (move)
  9411. this.hideBallUI();
  9412. else {
  9413. this.showBallUI();
  9414. xGame.common.d2World.getHelpLine();
  9415. }
  9416. }
  9417. aiForce(type, force = 0) {
  9418. this.pressTarget = PressType.powerNode;
  9419. if (type == 1)
  9420. this.onEventUp({ force: true });
  9421. else if (type == 2)
  9422. this.onEventMove({ stageY: force, force: true });
  9423. }
  9424. onEventPress(e) {
  9425. if (e.stopPropagation)
  9426. e.stopPropagation();
  9427. if (!this.isTurnSelf())
  9428. return;
  9429. let target = e.target;
  9430. switch (target) {
  9431. case this.ui.myPowerNode.displayObject:
  9432. this.pressTarget = PressType.powerNode;
  9433. this.barInfo.curY = e.stageY;
  9434. this.updateBarInfo();
  9435. break;
  9436. case this.ui.moveNode.displayObject:
  9437. this.pressTarget = PressType.moveNode;
  9438. this.hideBallUI();
  9439. this.eventObj.curX = this.ui.moveNode.x;
  9440. this.eventObj.curY = this.ui.moveNode.y;
  9441. this.ui.moveNode.finger.visible = false;
  9442. this.eventObj.lastX = e.stageX;
  9443. this.eventObj.lastY = e.stageY;
  9444. break;
  9445. case this.ui.rulerClickNode.displayObject:
  9446. this.pressTarget = PressType.rulerNode;
  9447. this.eventObj.lastY = e.stageY;
  9448. break;
  9449. case this.ui.d2Root.displayObject:
  9450. this.pressTarget = PressType.d2Root;
  9451. this.eventObj.lastX = e.stageX;
  9452. this.eventObj.lastY = e.stageY;
  9453. this.eventObj.starX = e.stageX;
  9454. this.eventObj.starY = e.stageY;
  9455. this.eventObj.curX = 0;
  9456. this.eventObj.curY = 0;
  9457. xGame.common.d2World.d2Gan.setGanLastInfo();
  9458. this.rulerOffset = 0;
  9459. break;
  9460. default:
  9461. break;
  9462. }
  9463. }
  9464. onEventMove(e) {
  9465. if (e.stopPropagation)
  9466. e.stopPropagation();
  9467. if (e && e.force) {
  9468. }
  9469. else {
  9470. if (!this.isTurnSelf())
  9471. return;
  9472. }
  9473. switch (this.pressTarget) {
  9474. case PressType.powerNode:
  9475. this.barInfo.curY = e.stageY;
  9476. this.updateBarInfo();
  9477. this.isMoveRod = true;
  9478. break;
  9479. case PressType.moveNode:
  9480. let rootBall = xGame.common.d2World.rootBall;
  9481. let radius = rootBall.gameObj.width / 2;
  9482. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9483. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9484. let border = xGame.common.d2World.borderRect;
  9485. if (curX <= border.x + radius)
  9486. curX = border.x + radius;
  9487. else if (curX >= border.x + border.width - radius)
  9488. curX = border.x + border.width - radius;
  9489. if (curY <= border.y + radius)
  9490. curY = border.y + radius;
  9491. else if (curY >= border.y + border.height - radius)
  9492. curY = border.y + border.height - radius;
  9493. if (xGame.common.gameMgr.isOpenBall) {
  9494. if (curX >= border.x + border.openBallW - radius)
  9495. curX = border.x + border.openBallW - radius;
  9496. }
  9497. this.ui.moveNode.x = curX;
  9498. this.ui.moveNode.y = curY;
  9499. rootBall.gameObj.x = curX;
  9500. rootBall.gameObj.y = curY;
  9501. rootBall.d3BallSrc.setTransPos(curX, curY);
  9502. this.isMoveRod = true;
  9503. break;
  9504. case PressType.rulerNode:
  9505. let yy = e.stageY - this.eventObj.lastY;
  9506. this.eventObj.lastY = e.stageY;
  9507. let ruler1 = this.ui.rulerNode.img1;
  9508. let ruler2 = this.ui.rulerNode.img2;
  9509. ruler1.y += yy;
  9510. ruler2.y += yy;
  9511. this.rulerOffset += yy;
  9512. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9513. this.rulerOffset = 0;
  9514. xGame.soundMgr.playSound("inch", 1, 10);
  9515. }
  9516. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9517. let h = ruler1.height;
  9518. this.checkGuide();
  9519. this.isMoveRod = true;
  9520. if (ruler1.y >= h) {
  9521. ruler1.y = -h;
  9522. ruler2.y = 0;
  9523. return;
  9524. }
  9525. else if (ruler1.y <= -h) {
  9526. ruler1.y = h;
  9527. ruler2.y = 0;
  9528. return;
  9529. }
  9530. if (ruler2.y >= h) {
  9531. ruler2.y = -h;
  9532. ruler1.y = 0;
  9533. return;
  9534. }
  9535. else if (ruler2.y <= -h) {
  9536. ruler2.y = h;
  9537. ruler1.y = 0;
  9538. return;
  9539. }
  9540. break;
  9541. case PressType.d2Root:
  9542. this.eventObj.curX = e.stageX;
  9543. this.eventObj.curY = e.stageY;
  9544. let offset = this.checkRodMoveDir();
  9545. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9546. this.eventObj.lastX = e.stageX;
  9547. this.eventObj.lastY = e.stageY;
  9548. break;
  9549. default:
  9550. break;
  9551. }
  9552. }
  9553. onEventUp(e) {
  9554. if (e.stopPropagation)
  9555. e.stopPropagation();
  9556. if (e && e.force) {
  9557. }
  9558. else {
  9559. if (!this.isTurnSelf())
  9560. return;
  9561. }
  9562. switch (this.pressTarget) {
  9563. case PressType.powerNode:
  9564. this.ui.powerNode.value = 0;
  9565. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9566. this.ui.powerTxt.text = "";
  9567. if (this.powerNum > 0) {
  9568. xGame.eventMgr.event(BALL_SHOOT);
  9569. xGame.common.d2World.shoot(this.powerNum);
  9570. xGame.common.d2World.d2Gan.shoot();
  9571. xGame.common.d2World.d2HelpLine.shoot();
  9572. this.finishGuide();
  9573. this.ui.powerEft.visible = false;
  9574. this.ui.colorNode.visible = false;
  9575. let ganStr = "";
  9576. if (this.powerNum <= 30) {
  9577. ganStr = "gan_30";
  9578. }
  9579. else if (this.powerNum <= 60) {
  9580. ganStr = "gan_50";
  9581. }
  9582. else {
  9583. ganStr = "gan_80";
  9584. }
  9585. xGame.soundMgr.playSound(ganStr);
  9586. }
  9587. break;
  9588. case PressType.moveNode:
  9589. let rootBall = xGame.common.d2World.rootBall;
  9590. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9591. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9592. let isIntersect = this.judgeBallIntersect();
  9593. if (isIntersect) {
  9594. this.ui.moveNode.x = lastX;
  9595. this.ui.moveNode.y = lastY;
  9596. rootBall.gameObj.x = lastX;
  9597. rootBall.gameObj.y = lastY;
  9598. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9599. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9600. }
  9601. else {
  9602. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9603. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9604. }
  9605. this.showBallUI();
  9606. this.ui.moveNode.finger.visible = true;
  9607. xGame.common.d2World.getHelpLine();
  9608. break;
  9609. case PressType.rulerNode:
  9610. break;
  9611. case PressType.d2Root:
  9612. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9613. if (dis <= 25) {
  9614. this.moveToClickDot(e);
  9615. }
  9616. break;
  9617. default:
  9618. break;
  9619. }
  9620. this.pressTarget = -1;
  9621. }
  9622. checkGuide() {
  9623. let guide = DataMgr.getSkillGuide();
  9624. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9625. xGame.common.guideStep++;
  9626. xGame.common.gameUI.ui.guide2.visible = false;
  9627. xGame.common.gameUI.ui.guide3.visible = true;
  9628. }
  9629. }
  9630. finishGuide() {
  9631. let guide = DataMgr.getSkillGuide();
  9632. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9633. xGame.common.guideStep = 10;
  9634. this.closeAllGuide();
  9635. }
  9636. }
  9637. closeAllGuide() {
  9638. xGame.common.gameUI.ui.guide1.visible = false;
  9639. xGame.common.gameUI.ui.guide2.visible = false;
  9640. xGame.common.gameUI.ui.guide3.visible = false;
  9641. }
  9642. updateBarInfo() {
  9643. let star = this.ui.powerNode.y;
  9644. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9645. if (rate >= 1)
  9646. rate = 1;
  9647. if (rate <= 0)
  9648. rate = 0;
  9649. this.powerNum = Math.ceil(rate * 100);
  9650. this.ui.powerNode.value = this.powerNum;
  9651. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9652. this.ui.colorNode.value = this.powerNum;
  9653. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9654. this.ui.powerEft.visible = this.powerNum != 0;
  9655. this.ui.colorNode.visible = this.powerNum != 0;
  9656. this.ui.powerTxt.text = this.powerNum + "";
  9657. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9658. }
  9659. forceCancel() {
  9660. this.ui.powerNode.value = 0;
  9661. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9662. this.ui.powerTxt.text = "";
  9663. }
  9664. checkRodMoveDir() {
  9665. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9666. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9667. if (tempX >= 0 && tempY <= 0) {
  9668. return this.checkDir();
  9669. }
  9670. else if (tempX < 0 && tempY < 0) {
  9671. return this.checkDir(1, -1);
  9672. }
  9673. else if (tempX < 0 && tempY > 0) {
  9674. return this.checkDir(-1, -1);
  9675. }
  9676. else {
  9677. return this.checkDir(-1, 1);
  9678. }
  9679. }
  9680. checkDir(flagX = 1, flagY = 1) {
  9681. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9682. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9683. if (offsetY == 0) {
  9684. return offsetX * flagX;
  9685. }
  9686. if (offsetX == 0) {
  9687. return offsetY * flagY;
  9688. }
  9689. let angle = offsetY / offsetX;
  9690. if (Math.abs(angle) >= 1) {
  9691. return offsetY * flagY;
  9692. }
  9693. else {
  9694. return offsetX * flagX;
  9695. }
  9696. }
  9697. judgeBallIntersect() {
  9698. let rootBall = xGame.common.d2World.rootBall;
  9699. let ballArr = xGame.common.d2World.ballArr;
  9700. let radius = rootBall.gameObj.width / 2;
  9701. let temp;
  9702. let isIntersect = false;
  9703. for (let index = 0; index < ballArr.length; index++) {
  9704. temp = ballArr[index];
  9705. if (temp.number == rootBall.number)
  9706. continue;
  9707. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9708. if (isIntersect) {
  9709. break;
  9710. }
  9711. }
  9712. return isIntersect;
  9713. }
  9714. hideBallUI() {
  9715. let d2Gan = xGame.common.d2World.d2Gan;
  9716. if (!d2Gan.ui.isDisposed)
  9717. d2Gan.ui.visible = false;
  9718. let d2Help = xGame.common.d2World.d2HelpLine;
  9719. if (!d2Help.ui.isDisposed)
  9720. d2Help.ui.visible = false;
  9721. let rootBall = xGame.common.d2World.rootBall;
  9722. if (!rootBall.destroyed) {
  9723. rootBall.gameObj.active = false;
  9724. }
  9725. }
  9726. showBallUI() {
  9727. let d2Gan = xGame.common.d2World.d2Gan;
  9728. if (!d2Gan.ui.isDisposed)
  9729. d2Gan.ui.visible = true;
  9730. let d2Help = xGame.common.d2World.d2HelpLine;
  9731. if (!d2Help.ui.isDisposed)
  9732. d2Help.ui.visible = true;
  9733. let rootBall = xGame.common.d2World.rootBall;
  9734. if (!rootBall.destroyed) {
  9735. rootBall.gameObj.active = true;
  9736. }
  9737. }
  9738. moveToClickDot(e) {
  9739. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9740. let root = xGame.common.d2World.rootBall.gameObj;
  9741. let xx = e.stageX - xGame.common.sysOffestNum;
  9742. let yy = e.stageY;
  9743. let x = xx - root.x;
  9744. let y = yy - root.y;
  9745. let angle = xGame.common.getfguiRotation(x, y);
  9746. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9747. xGame.common.d2World.getHelpLine();
  9748. }
  9749. this.isMoveRod = false;
  9750. xGame.common.clickedBall = false;
  9751. }
  9752. openAllEvent() {
  9753. this.closeAllEvent();
  9754. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9755. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9756. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9757. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9758. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9759. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9760. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9761. }
  9762. closeAllEvent() {
  9763. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9764. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9765. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9766. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9767. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9768. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9769. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9770. }
  9771. resetGame() {
  9772. this.closeAllEvent();
  9773. this.hideBallUI();
  9774. xGame.common.gameMgr.gamePause = true;
  9775. }
  9776. }
  9777. UIGame.uiName = "UIGame";
  9778. class UIAddProp extends UIBase {
  9779. constructor() {
  9780. super();
  9781. this.curType = "";
  9782. }
  9783. onConstructor() {
  9784. this.ui = ui_UIAddProp.createInstance();
  9785. this.contentPane = this.ui;
  9786. this.isEject = false;
  9787. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9788. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9789. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9790. this.updateUI();
  9791. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9792. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9793. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9794. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9795. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9796. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9797. }
  9798. show(type) {
  9799. super.show();
  9800. this.curType = type == 0 ? "coin" : "diamond";
  9801. this.switchBtn("");
  9802. this.ui.t0.play();
  9803. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9804. PlatMgr.showInsert(true);
  9805. }
  9806. closeSelf() {
  9807. this.hide();
  9808. }
  9809. updateUI() {
  9810. let data = cfgTable.moneyData;
  9811. let temp;
  9812. let obj;
  9813. for (const key in data) {
  9814. temp = data[key];
  9815. obj = this.ui.myNode["node" + key];
  9816. if (parseInt(key) <= 2) {
  9817. obj.diamondTxt.text = "+" + temp.num;
  9818. }
  9819. else {
  9820. obj.coinTxt.text = temp.num;
  9821. obj.diamondTxt.text = temp.get.split('_')[1];
  9822. }
  9823. }
  9824. this.updateDiamondShare();
  9825. }
  9826. updateDiamondShare() {
  9827. let data = DataMgr.getShareDiamondTimes();
  9828. if (data >= xGame.common.maxShareDiamondTimes) {
  9829. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  9830. this.ui.myNode.node1.touchable = false;
  9831. }
  9832. else {
  9833. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9834. this.ui.myNode.node1.touchable = true;
  9835. }
  9836. }
  9837. switchBtn(type) {
  9838. if (type == "")
  9839. type = this.curType;
  9840. else {
  9841. if (this.curType == type) {
  9842. return;
  9843. }
  9844. else {
  9845. this.curType = type;
  9846. }
  9847. }
  9848. if (type == "coin") {
  9849. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9850. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9851. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9852. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9853. this.ui.myNode.c1.selectedIndex = 0;
  9854. }
  9855. else {
  9856. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9857. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9858. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9859. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9860. this.ui.myNode.c1.selectedIndex = 1;
  9861. }
  9862. }
  9863. convertCoin(index) {
  9864. let data = cfgTable.moneyData[index];
  9865. let coinNum = data.num;
  9866. let str = data.get.split('_')[1];
  9867. let needDiamond = parseInt(str);
  9868. if (DataMgr.diamondEnough(needDiamond)) {
  9869. DataMgr.setDiamond(-needDiamond);
  9870. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9871. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  9872. }
  9873. else {
  9874. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  9875. this.switchBtn("diamond");
  9876. }
  9877. }
  9878. videoGetDiamond() {
  9879. let num = cfgTable.moneyData[2].num;
  9880. Moyu.showVideoAd(() => {
  9881. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9882. this.closeSelf();
  9883. }, EAdType.addDiamond);
  9884. }
  9885. videoGetCoin() {
  9886. Moyu.showVideoAd(() => {
  9887. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9888. this.closeSelf();
  9889. }, EAdType.addCoin);
  9890. }
  9891. shareGetDiamond() {
  9892. let times = DataMgr.getShareDiamondTimes();
  9893. if (times >= xGame.common.maxShareDiamondTimes) {
  9894. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  9895. }
  9896. else {
  9897. if (Moyu.isTT) {
  9898. let num = cfgTable.moneyData[1].num;
  9899. Moyu.shareVideo = '';
  9900. Moyu.shareGame((success) => {
  9901. if (success) {
  9902. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9903. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9904. DataMgr.setShareDiamondTimes(1);
  9905. this.updateDiamondShare();
  9906. }
  9907. else {
  9908. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9909. }
  9910. });
  9911. }
  9912. else {
  9913. Moyu.showVideoAd(() => {
  9914. let diamond = xGame.common.randomNum(50, 100);
  9915. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9916. DataMgr.setShareDiamondTimes(1);
  9917. this.updateDiamondShare();
  9918. }, EAdType.randomDiamond);
  9919. }
  9920. }
  9921. }
  9922. openPutBallView() {
  9923. let end = xGame.uiMgr.getUI(UIGameEnd);
  9924. let skill = xGame.uiMgr.getUI(UISkill);
  9925. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9926. let uigame = xGame.uiMgr.getUI(UIGame);
  9927. if (end && !end.isHide) {
  9928. xGame.uiMgr.Hide(UIGameEnd);
  9929. xGame.uiMgr.Show(UIMain);
  9930. }
  9931. if (skill && !skill.isHide)
  9932. xGame.uiMgr.Hide(UISkill);
  9933. if (uigame && !uigame.isHide)
  9934. xGame.uiMgr.Hide(UIGame);
  9935. if (level && !level.isHide) {
  9936. }
  9937. else {
  9938. xGame.uiMgr.Show(UILevelDisplay);
  9939. }
  9940. this.closeSelf();
  9941. }
  9942. }
  9943. UIAddProp.uiName = "UIAddProp";
  9944. class MoneyNode {
  9945. constructor(ui) {
  9946. this.leftTime = 0;
  9947. this.ui = ui;
  9948. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9949. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9950. this.ui.addPowerBtn.onClick(this, this.addPower);
  9951. this.ui.c1.selectedIndex = 1;
  9952. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9953. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9954. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9955. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  9956. this.coinChange();
  9957. this.diamondChange();
  9958. this.powerChange();
  9959. }
  9960. addPower() {
  9961. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9962. xGame.uiMgr.Show(UIPower);
  9963. }
  9964. powerChange() {
  9965. let powerNum = DataMgr.getPower();
  9966. this.ui.powerTxt.text = powerNum + "";
  9967. }
  9968. checkPowerTime() {
  9969. let cur = new Date().getTime();
  9970. let last = DataMgr.getPowerTime();
  9971. if (last == 0) {
  9972. last = cur;
  9973. DataMgr.setPowerTime(cur);
  9974. }
  9975. let power = DataMgr.getPower();
  9976. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  9977. Laya.timer.clearAll(this);
  9978. if (power >= xGame.common.natureMaxPower) {
  9979. this.ui.powerTimeTxt.text = "";
  9980. DataMgr.setPowerTime(cur);
  9981. return;
  9982. }
  9983. if (power + offset >= xGame.common.natureMaxPower) {
  9984. DataMgr.setPower(xGame.common.natureMaxPower, false);
  9985. this.ui.powerTimeTxt.text = "";
  9986. DataMgr.setPowerTime(cur);
  9987. }
  9988. else {
  9989. if (offset > 0) {
  9990. DataMgr.setPower(offset);
  9991. DataMgr.setPowerTime(cur);
  9992. }
  9993. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  9994. this.leftTime = xGame.common.powerRecoverNum - time;
  9995. if (this.leftTime <= 0)
  9996. this.leftTime = 0;
  9997. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  9998. Laya.timer.loop(1000, this, this.updatePowerTime);
  9999. }
  10000. }
  10001. updatePowerTime() {
  10002. this.leftTime -= 1;
  10003. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10004. if (this.leftTime <= 0) {
  10005. this.checkPowerTime();
  10006. }
  10007. }
  10008. coinChange() {
  10009. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10010. }
  10011. diamondChange() {
  10012. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10013. }
  10014. addCoin() {
  10015. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10016. Moyu.sendDataEvent("AddCoinBtn");
  10017. xGame.uiMgr.Show(UIAddProp, 0);
  10018. }
  10019. addDiamond() {
  10020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10021. Moyu.sendDataEvent("AddDiamondBtn");
  10022. xGame.uiMgr.Show(UIAddProp, 1);
  10023. }
  10024. }
  10025. class UIDraw extends UIBase {
  10026. constructor() {
  10027. super();
  10028. this.curKey = 0;
  10029. }
  10030. onConstructor() {
  10031. this.ui = ui_UIDraw.createInstance();
  10032. this.contentPane = this.ui;
  10033. this.isEject = false;
  10034. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10035. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10036. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10037. this.initDraw();
  10038. this.initUI();
  10039. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10040. if (Moyu.isKs)
  10041. this.ui.closeNode.closeBtn.x += 100;
  10042. }
  10043. show() {
  10044. super.show();
  10045. this.ui.t0.play();
  10046. this.playSecretaryIdle();
  10047. this.updateDraw();
  10048. this.checkFree();
  10049. if (PlatMgr.bannerDelay > 0) {
  10050. this.ui.closeNode.closeBtn.visible = false;
  10051. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10052. this.ui.closeNode.closeBtn.visible = true;
  10053. });
  10054. }
  10055. PlatMgr.showRateBanner();
  10056. }
  10057. hide() {
  10058. Laya.timer.clearAll(this);
  10059. super.hide();
  10060. }
  10061. checkFree() {
  10062. let isFree = DataMgr.getDailyfreeDrawTimes();
  10063. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10064. }
  10065. initDraw() {
  10066. this.drawObj = [];
  10067. let data = cfgTable.drawData;
  10068. let temp;
  10069. let weight = 0;
  10070. for (const key in data) {
  10071. temp = data[key];
  10072. weight += temp.weight;
  10073. this.drawObj.push(weight);
  10074. }
  10075. this.allWeight = weight;
  10076. }
  10077. initUI() {
  10078. let data = cfgTable.drawData;
  10079. let temp;
  10080. let img;
  10081. let txt;
  10082. for (const key in data) {
  10083. temp = data[key];
  10084. img = this.ui.myNode.rotNode["img" + key];
  10085. txt = this.ui.myNode.rotNode["txt" + key];
  10086. img.url = xGame.common.getGameIconUrl(temp.icon);
  10087. txt.visible = true;
  10088. if (temp.award > 2) {
  10089. img.rotation = 0;
  10090. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10091. }
  10092. else {
  10093. img.rotation = temp.rotation;
  10094. txt.text = temp.num;
  10095. }
  10096. }
  10097. }
  10098. getCurkey() {
  10099. let rand = Math.random() * this.allWeight;
  10100. let temp;
  10101. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10102. temp = this.drawObj[index];
  10103. if (index == 0) {
  10104. if (rand < temp) {
  10105. return index + 1;
  10106. }
  10107. }
  10108. else {
  10109. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10110. return index + 1;
  10111. }
  10112. }
  10113. }
  10114. return 2;
  10115. }
  10116. startDraw() {
  10117. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10118. if (freeTimes > 0) {
  10119. this.beginDraw();
  10120. DataMgr.setDailyfreeDrawTimes(0);
  10121. this.checkFree();
  10122. }
  10123. else {
  10124. Moyu.sendDataEvent("turntable");
  10125. Moyu.showVideoAd(() => {
  10126. this.beginDraw();
  10127. }, EAdType.draw);
  10128. }
  10129. }
  10130. beginDraw() {
  10131. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10132. this.ui.drawBtn.touchable = false;
  10133. this.curKey = this.getCurkey();
  10134. console.log("当前key", this.curKey);
  10135. let cell = 60;
  10136. let lap = 3;
  10137. let angle = cell * (this.curKey - 1) + lap * 360;
  10138. let target = this.ui.myNode.rotNode;
  10139. target.rotation = 0;
  10140. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10141. console.log("旋转完成");
  10142. this.ui.drawBtn.touchable = true;
  10143. this.getAward();
  10144. }));
  10145. }
  10146. getAward() {
  10147. let data = cfgTable.drawData[this.curKey];
  10148. let temp = new AwardType();
  10149. temp.type = data.award;
  10150. temp.num = data.num;
  10151. xGame.common.getAward([temp], () => {
  10152. DataMgr.setDrawTimes(1);
  10153. this.updateDraw();
  10154. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10155. });
  10156. }
  10157. updateDraw() {
  10158. let drawTimes = DataMgr.getDrawTimes();
  10159. let awardTimes = DataMgr.getDrawAwardTimes();
  10160. if (Math.floor(drawTimes / 3) > awardTimes) {
  10161. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10162. this.ui.extraNode.boxBtn.touchable = true;
  10163. this.ui.extraNode.tipsTxt.text = "3/3";
  10164. this.ui.extraNode.barNode.width = 265;
  10165. this.getExtraAward();
  10166. }
  10167. else {
  10168. this.ui.extraNode.boxBtn.t0.stop();
  10169. this.ui.extraNode.boxBtn.touchable = false;
  10170. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10171. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10172. }
  10173. let data = cfgTable.drawData[1];
  10174. if (awardTimes == 0) {
  10175. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10176. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10177. this.ui.myNode.rotNode.img1.rotation = 0;
  10178. }
  10179. else {
  10180. let award = data.nextid;
  10181. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10182. this.ui.myNode.rotNode.txt1.text = award[1];
  10183. this.ui.myNode.rotNode.img1.rotation = 0;
  10184. }
  10185. }
  10186. getExtraAward() {
  10187. let drawTimes = DataMgr.getDrawTimes();
  10188. let awardTimes = DataMgr.getDrawAwardTimes();
  10189. let data = cfgTable.drawData[1];
  10190. let award = new AwardType();
  10191. if (awardTimes == 0) {
  10192. award.num = data.num;
  10193. award.type = data.award;
  10194. xGame.common.getAward([award], () => {
  10195. let all = Math.floor(drawTimes / 3);
  10196. DataMgr.setDrawAwardTimes(all);
  10197. this.updateDraw();
  10198. });
  10199. }
  10200. else {
  10201. award.num = parseInt(data.nextid[1]);
  10202. award.type = parseInt(data.nextid[0]);
  10203. xGame.common.getAward([award], () => {
  10204. let all = Math.floor(drawTimes / 3);
  10205. DataMgr.setDrawAwardTimes(all);
  10206. this.updateDraw();
  10207. });
  10208. }
  10209. }
  10210. closeSelf() {
  10211. this.hide();
  10212. }
  10213. playSecretaryIdle() {
  10214. let parent = this.ui.secretary.displayObject;
  10215. parent.destroyChildren();
  10216. let xx = this.ui.secretary.width / 2;
  10217. let yy = this.ui.secretary.height;
  10218. let scale = xGame.common.getSecretaryScale();
  10219. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10220. xGame.common.secretary.play(data, 1, true, parent);
  10221. }
  10222. }
  10223. UIDraw.uiName = "UIDraw";
  10224. class ui_UIFlyEft extends fgui.GComponent {
  10225. static createInstance() {
  10226. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10227. }
  10228. onConstruct() {
  10229. this.n0 = (this.getChild("n0"));
  10230. this.n1 = (this.getChild("n1"));
  10231. this.n2 = (this.getChild("n2"));
  10232. this.n3 = (this.getChild("n3"));
  10233. this.n4 = (this.getChild("n4"));
  10234. this.n5 = (this.getChild("n5"));
  10235. this.n6 = (this.getChild("n6"));
  10236. this.n7 = (this.getChild("n7"));
  10237. this.iconNode = (this.getChild("iconNode"));
  10238. this.txt = (this.getChild("txt"));
  10239. this.txtNode = (this.getChild("txtNode"));
  10240. }
  10241. }
  10242. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10243. class UIFlyEft extends UIBase {
  10244. constructor() {
  10245. super();
  10246. this.max = 8;
  10247. this.delay = 0;
  10248. }
  10249. onConstructor() {
  10250. this.ui = ui_UIFlyEft.createInstance();
  10251. this.contentPane = this.ui;
  10252. this.isEject = false;
  10253. this.isMuti = true;
  10254. this.ui.x += xGame.common.sysOffestNum;
  10255. }
  10256. getArrPos() {
  10257. if (this.iconPos && this.iconPos.length > 0)
  10258. return;
  10259. this.iconPos = [];
  10260. let temp;
  10261. for (let index = 0; index < this.max; index++) {
  10262. temp = this.ui["n" + index];
  10263. this.iconPos.push([temp.x, temp.y]);
  10264. }
  10265. }
  10266. show(stPos, edPos, num, type, callback) {
  10267. super.show();
  10268. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10269. this.getArrPos();
  10270. this.updateUI(type);
  10271. this.updatePos();
  10272. this.runFly(edPos, callback);
  10273. this.runWorlds(stPos, num);
  10274. }
  10275. updateUI(type) {
  10276. let temp;
  10277. let str;
  10278. for (let index = 0; index < this.max; index++) {
  10279. temp = this.ui["n" + index];
  10280. str = this.getIconStr(type);
  10281. temp.url = xGame.common.getGameIconUrl(str);
  10282. }
  10283. }
  10284. getIconStr(type) {
  10285. switch (type) {
  10286. case Prop.diamond:
  10287. return "ty_zs";
  10288. case Prop.coin:
  10289. return "ty_jb";
  10290. default:
  10291. break;
  10292. }
  10293. }
  10294. updatePos() {
  10295. let temp;
  10296. for (let index = 0; index < this.max; index++) {
  10297. temp = this.ui["n" + index];
  10298. temp.x = this.iconPos[index][0];
  10299. temp.y = this.iconPos[index][1];
  10300. }
  10301. }
  10302. runFly(endPos, callback) {
  10303. let all = 0;
  10304. let temp;
  10305. for (let index = 0; index < this.max; index++) {
  10306. temp = this.ui["n" + index];
  10307. temp.visible = true;
  10308. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10309. temp.visible = false;
  10310. all++;
  10311. if (all >= this.max) {
  10312. callback && callback();
  10313. }
  10314. }), 20 * index);
  10315. }
  10316. }
  10317. runWorlds(stPos, num) {
  10318. let str = "+" + num;
  10319. this.ui.txt.text = str;
  10320. let starX = stPos.x;
  10321. let starY = stPos.y + 50;
  10322. this.ui.txt.x = starX;
  10323. this.ui.txt.y = starY;
  10324. this.ui.txt.visible = true;
  10325. this.ui.txt.alpha = 1;
  10326. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10327. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10328. this.ui.txt.visible = false;
  10329. this.hide();
  10330. }));
  10331. }));
  10332. }
  10333. }
  10334. UIFlyEft.uiName = "UIFlyEft";
  10335. class ui_UIGetAward extends fgui.GComponent {
  10336. static createInstance() {
  10337. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10338. }
  10339. onConstruct() {
  10340. this.n4 = (this.getChild("n4"));
  10341. this.n0 = (this.getChild("n0"));
  10342. this.myList = (this.getChild("myList"));
  10343. this.n1 = (this.getChild("n1"));
  10344. this.eftNode = (this.getChild("eftNode"));
  10345. this.btnNode = (this.getChild("btnNode"));
  10346. this.t0 = this.getTransition("t0");
  10347. }
  10348. }
  10349. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10350. class UIGetAward extends UIBase {
  10351. constructor() {
  10352. super();
  10353. this.showTriple = true;
  10354. }
  10355. onConstructor() {
  10356. this.ui = ui_UIGetAward.createInstance();
  10357. this.contentPane = this.ui;
  10358. this.isEject = false;
  10359. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10360. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10361. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10362. }
  10363. show(arr, showTriple, callback) {
  10364. super.show();
  10365. this.ui.t0.play();
  10366. this.ui.eftNode.visible = true;
  10367. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10368. this.ui.eftNode.visible = false;
  10369. }), 1, 0, 0, 0.9);
  10370. this.awardArr = arr;
  10371. this.showTriple = showTriple;
  10372. this.callback = callback;
  10373. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10374. this.ui.myList.numItems = arr.length;
  10375. xGame.soundMgr.playSound("getaward");
  10376. }
  10377. updateSelf(index, obj) {
  10378. let temp = this.awardArr[index];
  10379. let icon = this.getIcon(temp.type);
  10380. let str = icon;
  10381. if (temp.type > 2) {
  10382. str = "s" + icon;
  10383. }
  10384. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10385. obj.myIcon.rotation = 0;
  10386. obj.numTxt.text = temp.num + "";
  10387. obj.numTxt.visible = temp.type > 2 ? false : true;
  10388. obj.nameTxt.text = this.getNameStr(temp.type);
  10389. }
  10390. renderItem(index, obj) {
  10391. this.updateSelf(index, obj);
  10392. }
  10393. tripleGetAward() {
  10394. Moyu.showVideoAd(() => {
  10395. this.getAward(3);
  10396. }, EAdType.triple);
  10397. }
  10398. normalGetAward() {
  10399. if (PlatMgr.isMisVideo())
  10400. this.tripleGetAward();
  10401. else
  10402. this.getAward();
  10403. }
  10404. getAward(times = 1) {
  10405. this.hide();
  10406. for (let index = 0; index < this.awardArr.length; index++) {
  10407. this.awardArr[index].num *= times;
  10408. }
  10409. this.callback && this.callback(times != 1);
  10410. }
  10411. getIcon(type) {
  10412. switch (type) {
  10413. case Prop.diamond:
  10414. return "ty_zs";
  10415. case Prop.coin:
  10416. return "ty_jb";
  10417. case Prop.gan1:
  10418. return "qg1";
  10419. case Prop.gan2:
  10420. return "qg2";
  10421. case Prop.gan3:
  10422. return "qg3";
  10423. case Prop.gan4:
  10424. return "qg4";
  10425. default:
  10426. break;
  10427. }
  10428. }
  10429. getNameStr(type) {
  10430. switch (type) {
  10431. case Prop.diamond:
  10432. return "Diamond";
  10433. case Prop.coin:
  10434. return "Coins";
  10435. case Prop.gan1:
  10436. case Prop.gan2:
  10437. case Prop.gan3:
  10438. case Prop.gan4:
  10439. return cfgTable.ballrodData[type - 1].name;
  10440. default:
  10441. break;
  10442. }
  10443. }
  10444. }
  10445. UIGetAward.uiName = "UIGetAward";
  10446. class Common {
  10447. constructor() {
  10448. this.convertNum = 0.025;
  10449. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10450. this.scaleV3One = new Laya.Vector3();
  10451. this.scaleV3Two = new Laya.Vector3();
  10452. this.posV4 = new Laya.Vector4();
  10453. this.showDebug = false;
  10454. this.openGuide = true;
  10455. this.rodOffest = new Laya.Vector2(0, 0);
  10456. this.rodAngle = 0;
  10457. this.gameMode = GameMode.classic;
  10458. this.bigMoveLevelIndex = 1;
  10459. this.bigMoveNeedCoin = 1000;
  10460. this.classicNiceNeddCoin = 1000;
  10461. this.passAwardCoin = 2000;
  10462. this.classicRoomType = 1;
  10463. this.maxPower = 20;
  10464. this.natureMaxPower = 5;
  10465. this.videoPower = 2;
  10466. this.powerRecoverNum = 900;
  10467. this.curPlayerSkillType = 0;
  10468. this.isNewDay = false;
  10469. this.clickedBall = false;
  10470. this.placeBallCurLevel = 0;
  10471. this.placeBallStarNum = 0;
  10472. this.longHelpLine = false;
  10473. this.maxShareDiamondTimes = 3;
  10474. this.guideStep = 0;
  10475. this.temSelfLevel = 0;
  10476. this.extraMoveNum = 0;
  10477. this.curRankID = 0;
  10478. this.rankID = {
  10479. normalStar: 12000,
  10480. wxStar: 12001
  10481. };
  10482. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot", "Coming Soon"];
  10483. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4", "gf_jn4"];
  10484. this.btnClickStr = "buttonclick";
  10485. this.maxSkillLevel = 10;
  10486. this.upSkillLevel = false;
  10487. this.gameStartTime = 0;
  10488. this._sysOffestNum = 0;
  10489. this.angleV2 = new Laya.Vector2();
  10490. this.rootV = new Laya.Vector2(0, 1);
  10491. this.tempDir1 = new Laya.Vector2();
  10492. this.tempDir2 = new Laya.Vector2();
  10493. this.ballSize = 33;
  10494. this.stPos = new Laya.Point();
  10495. this.edPos = new Laya.Point();
  10496. Common._instance = this;
  10497. window["common"] = this;
  10498. }
  10499. static getInstance() {
  10500. if (!this._instance) {
  10501. this._instance = new Common();
  10502. }
  10503. return this._instance;
  10504. }
  10505. get sysOffestNum() {
  10506. if (this._sysOffestNum == 0) {
  10507. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10508. }
  10509. return this._sysOffestNum;
  10510. }
  10511. testShader() {
  10512. let test = new LightShader();
  10513. test.texture = "res/d3Res/ballTexture/ball1.png";
  10514. Laya.stage.addChild(test);
  10515. }
  10516. playScale(node) {
  10517. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10518. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10519. }));
  10520. }));
  10521. }
  10522. setGroup(colli, ...group) {
  10523. let out = 0;
  10524. for (let index = 0; index < group.length; index++) {
  10525. if (index == 0) {
  10526. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10527. }
  10528. else {
  10529. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10530. }
  10531. }
  10532. colli.collisionGroup = out;
  10533. }
  10534. setCanGroupWith(colli, ...group) {
  10535. let out = 0;
  10536. for (let index = 0; index < group.length; index++) {
  10537. if (index == 0) {
  10538. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10539. }
  10540. else {
  10541. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10542. }
  10543. }
  10544. colli.canCollideWith = out;
  10545. }
  10546. loadPrefab(name, callback) {
  10547. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10548. let prefab = new Laya.Prefab();
  10549. prefab.json = obj;
  10550. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10551. callback && callback(img);
  10552. }));
  10553. }
  10554. pos2to3Convert(x, y, d3Pos) {
  10555. x = x + this.sysOffestNum;
  10556. d3Pos.setValue(x, y, 0);
  10557. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10558. if (success) {
  10559. }
  10560. else {
  10561. console.error("转换出错了。。。。。。。。");
  10562. }
  10563. }
  10564. scale2to3Convert(num) {
  10565. this.scaleV3One.setValue(0, 0, 0);
  10566. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10567. this.scaleV3Two.setValue(0, num, 0);
  10568. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10569. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10570. return outNum;
  10571. }
  10572. pos3to2Convert(d3Pos) {
  10573. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10574. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10575. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10576. d3Pos.x -= this.sysOffestNum;
  10577. }
  10578. scale3to2Convert(num) {
  10579. let scale = this.scale2to3Convert(1);
  10580. let d2Out = num / scale;
  10581. return d2Out;
  10582. }
  10583. getCollider(type, restitution = 0.9, density = 10) {
  10584. let colli;
  10585. if (type == "box")
  10586. colli = new Laya.BoxCollider();
  10587. else
  10588. colli = new Laya.CircleCollider();
  10589. colli.friction = 0;
  10590. colli.restitution = restitution;
  10591. colli.density = density;
  10592. return colli;
  10593. }
  10594. getRigbody() {
  10595. let rigy = new Laya.RigidBody();
  10596. rigy.bullet = true;
  10597. rigy.allowRotation = false;
  10598. rigy.allowSleep = false;
  10599. rigy.gravityScale = 0;
  10600. return rigy;
  10601. }
  10602. getfguiRotation(x, y) {
  10603. this.angleV2.setValue(x, y);
  10604. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10605. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10606. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10607. angle = -angle;
  10608. }
  10609. return 180 + angle;
  10610. }
  10611. getAngle(x, y) {
  10612. this.angleV2.setValue(x, y);
  10613. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10614. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10615. return angle;
  10616. }
  10617. randomNum(a, b) {
  10618. return a + Math.floor((b - a + 1) * Math.random());
  10619. }
  10620. getRandArrEle(arr) {
  10621. return arr[Math.floor(arr.length * Math.random())];
  10622. }
  10623. getSign(val) {
  10624. return val >= 0 ? 1 : -1;
  10625. }
  10626. botherArr(arr) {
  10627. let times = arr.length + 2;
  10628. let length = arr.length;
  10629. let a;
  10630. let b;
  10631. let temp;
  10632. for (let index = 0; index < times; index++) {
  10633. a = Math.floor(Math.random() * length);
  10634. b = Math.floor(Math.random() * length);
  10635. temp = arr[a];
  10636. arr[a] = arr[b];
  10637. arr[b] = temp;
  10638. }
  10639. }
  10640. getGameIconUrl(id) {
  10641. return "ui://game/" + id;
  10642. }
  10643. getComponentUrl(id) {
  10644. return "ui://game/" + id;
  10645. }
  10646. getAnimation() {
  10647. }
  10648. judgeSkillType(type = SkillType.highSpace) {
  10649. if (this.gameMode == GameMode.classic)
  10650. return;
  10651. let gameMgr = this.gameMgr;
  10652. if (gameMgr.selfTurn) {
  10653. if (gameMgr.selfCurSkill == type) {
  10654. return true;
  10655. }
  10656. }
  10657. else {
  10658. if (gameMgr.aiCurSkill == type) {
  10659. return true;
  10660. }
  10661. }
  10662. }
  10663. ballColliHole(collider) {
  10664. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10665. xGame.common.gameMgr.isFirstInGame = false;
  10666. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10667. }
  10668. collider.owner.mySrc.checkWrongBall();
  10669. }
  10670. getArrMaxEle(arr) {
  10671. let max = -Infinity;
  10672. for (let index = 0; index < arr.length; index++) {
  10673. max = Math.max(arr[index], max);
  10674. }
  10675. return max;
  10676. }
  10677. getArrMinEle(arr) {
  10678. let min = Infinity;
  10679. for (let index = 0; index < arr.length; index++) {
  10680. min = Math.min(arr[index], min);
  10681. }
  10682. return min;
  10683. }
  10684. playRandomMutiBallBigSkillSound() {
  10685. if (Math.random() <= 0.5)
  10686. return;
  10687. let rand = this.randomNum(1, 6);
  10688. let str = "ganfa0" + rand;
  10689. xGame.soundMgr.playSound(str);
  10690. }
  10691. showOneCamera(type) {
  10692. let object = xGame.common.d3World.cameraObj;
  10693. for (const key in object) {
  10694. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10695. object[key].init();
  10696. object[key].owner.active = key == type;
  10697. }
  10698. }
  10699. }
  10700. checkBallOverBorder(x, y) {
  10701. let radius = 17;
  10702. let condition = this._checkBorder(x + radius, y) ||
  10703. this._checkBorder(x - radius, y) ||
  10704. this._checkBorder(x, y + radius) ||
  10705. this._checkBorder(x, y - radius);
  10706. if (condition) {
  10707. return true;
  10708. }
  10709. }
  10710. _checkBorder(x, y) {
  10711. let borderRect = this.d2World.borderRect;
  10712. let xOffest = 20;
  10713. let yOffest = 20;
  10714. if (y <= borderRect.y - yOffest) {
  10715. return true;
  10716. }
  10717. if (y >= borderRect.y + borderRect.height + yOffest) {
  10718. return true;
  10719. }
  10720. if (x <= borderRect.x - xOffest) {
  10721. return true;
  10722. }
  10723. if (x >= borderRect.x + borderRect.width + xOffest) {
  10724. return true;
  10725. }
  10726. }
  10727. initWeight(cfg) {
  10728. let allCfgData = { data: {}, allWeightNum: 0 };
  10729. let weightCfg = allCfgData.data;
  10730. let weight = 0;
  10731. for (const key in cfg) {
  10732. weightCfg[key] = {};
  10733. weightCfg[key].id = cfg[key].id;
  10734. weightCfg[key].minWeight = weight;
  10735. weight += cfg[key].weight;
  10736. weightCfg[key].maxWeight = weight;
  10737. }
  10738. allCfgData.allWeightNum = weight;
  10739. return allCfgData;
  10740. }
  10741. getRandomWeightData(cfg) {
  10742. let weightCfg = cfg.data;
  10743. let allWeightNum = cfg.allWeightNum;
  10744. let rand = Math.floor(Math.random() * allWeightNum);
  10745. for (const key in weightCfg) {
  10746. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10747. return weightCfg[key];
  10748. }
  10749. }
  10750. return weightCfg[1];
  10751. }
  10752. showGirlTalkPop(wordsIndex, node, msgNode) {
  10753. node.visible = true;
  10754. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10755. node.t0.play(Laya.Handler.create(this, () => {
  10756. node.visible = false;
  10757. }));
  10758. }
  10759. stopGirlPop(node) {
  10760. node.t0.stop();
  10761. node.visible = false;
  10762. }
  10763. createHead(loader, url, size = 107) {
  10764. if (Laya.Browser.name == "Browser") {
  10765. loader.url = url;
  10766. return;
  10767. }
  10768. if (Moyu.isTT) {
  10769. let localImage = new Image();
  10770. localImage.src = url;
  10771. localImage.onload = () => {
  10772. let t2d = new Laya.Texture2D();
  10773. t2d.width = size;
  10774. t2d.height = size;
  10775. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10776. t2d.loadImageSource(localImage);
  10777. };
  10778. }
  10779. else {
  10780. loader.url = url;
  10781. }
  10782. }
  10783. addTestCoin(num) {
  10784. DataMgr.setCoin(num);
  10785. }
  10786. addTestDiamond(num) {
  10787. DataMgr.setDiamond(num);
  10788. }
  10789. addTestSkill() {
  10790. DataMgr.setBigSkill(0, 99);
  10791. DataMgr.setBigSkill(1, 99);
  10792. DataMgr.setBigSkill(2, 99);
  10793. }
  10794. playClassicEmotion(number, x, y) {
  10795. if (this.gameMode == GameMode.bigMove)
  10796. return;
  10797. let randIndex = this.randomNum(0, 2);
  10798. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10799. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10800. if (this.gameMgr.selfTurn) {
  10801. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10802. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10803. }
  10804. else {
  10805. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10806. }
  10807. else {
  10808. if (number == this.gameMgr.blackNum) {
  10809. if (this.gameMgr.selfBallArr.length == 0) {
  10810. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10811. }
  10812. else {
  10813. }
  10814. }
  10815. else {
  10816. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10817. }
  10818. }
  10819. }
  10820. }
  10821. else {
  10822. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10823. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10824. }
  10825. else {
  10826. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10827. }
  10828. else {
  10829. if (number == this.gameMgr.blackNum) {
  10830. if (this.gameMgr.aiBallArr.length == 0) {
  10831. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10832. }
  10833. else {
  10834. }
  10835. }
  10836. else {
  10837. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10838. }
  10839. }
  10840. }
  10841. }
  10842. }
  10843. playHappySound(number) {
  10844. if (this.gameMode != GameMode.classic)
  10845. return;
  10846. if (number == 8)
  10847. return;
  10848. let play = false;
  10849. if (this.gameMgr.selfTurn) {
  10850. if (this.gameMgr.ensureBallType) {
  10851. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10852. play = true;
  10853. }
  10854. }
  10855. else {
  10856. play = true;
  10857. }
  10858. }
  10859. else {
  10860. if (this.gameMgr.ensureBallType) {
  10861. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10862. play = true;
  10863. }
  10864. }
  10865. else {
  10866. play = true;
  10867. }
  10868. }
  10869. if (play)
  10870. xGame.soundMgr.playSound("applause");
  10871. }
  10872. destroyClassicEmotion() {
  10873. if (this.gameMode == GameMode.bigMove)
  10874. return;
  10875. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10876. parent.destroyChildren();
  10877. }
  10878. playAwardSpine(x, y) {
  10879. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10880. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10881. this.awardSpine.play(data, 0, false, parent);
  10882. }
  10883. destroyAwardSpine() {
  10884. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10885. parent.destroyChildren();
  10886. }
  10887. isBlock(bx, by, hx, hy, except = null) {
  10888. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10889. let balls = xGame.common.d2World.ballArr;
  10890. let outArr = [];
  10891. for (let index = 0; index < balls.length; index++) {
  10892. let obj = balls[index];
  10893. if (obj.number == 0)
  10894. continue;
  10895. if (obj == except)
  10896. continue;
  10897. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10898. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10899. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10900. if (num >= 1)
  10901. num = 1;
  10902. if (num < 0)
  10903. continue;
  10904. let gap = Math.sin(Math.acos(num)) * dis;
  10905. if (gap < this.ballSize) {
  10906. outArr.push({
  10907. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10908. disHon: Math.cos(Math.acos(num)) * dis,
  10909. disVer: Math.sin(Math.acos(num)) * dis,
  10910. src: balls[index],
  10911. dir: this.tempDir1
  10912. });
  10913. }
  10914. }
  10915. if (outArr.length > 0) {
  10916. outArr.sort((a, b) => { return a.dis - b.dis; });
  10917. return outArr[0];
  10918. }
  10919. }
  10920. AngleBetween(vector1, vector2) {
  10921. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10922. return rad * (180 / Math.PI);
  10923. }
  10924. getSecretaryScale() {
  10925. if (this.secretary.spineName == "mishu") {
  10926. return 1.28;
  10927. }
  10928. else {
  10929. return 1.024;
  10930. }
  10931. }
  10932. signAwardContainsRod(arr) {
  10933. let temp;
  10934. for (let index = 0; index < arr.length; index++) {
  10935. temp = arr[index].split('-')[0];
  10936. if (parseInt(temp) > 2) {
  10937. return true;
  10938. }
  10939. }
  10940. }
  10941. judgeSameDay() {
  10942. let lastTime = DataMgr.getSignTime();
  10943. let curTime = new Date().getTime();
  10944. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10945. return true;
  10946. }
  10947. return false;
  10948. }
  10949. getAward(arr, callback) {
  10950. let showTriple = arr[0].type <= 2;
  10951. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10952. let temp;
  10953. for (let index = 0; index < arr.length; index++) {
  10954. temp = arr[index];
  10955. switch (temp.type) {
  10956. case 1:
  10957. this.playObjFlyAnim(temp.num, temp.type);
  10958. break;
  10959. case 2:
  10960. this.playObjFlyAnim(temp.num, temp.type);
  10961. break;
  10962. case 3:
  10963. case 4:
  10964. case 5:
  10965. case 6:
  10966. DataMgr.setBallRod(temp.type - 2, 1);
  10967. DataMgr.setCurBallRod(temp.type - 2);
  10968. break;
  10969. default:
  10970. break;
  10971. }
  10972. }
  10973. callback && callback(watchVideo);
  10974. });
  10975. }
  10976. getMoneyNode() {
  10977. let moneyNode;
  10978. let sign = xGame.uiMgr.getUI(UISign);
  10979. let draw = xGame.uiMgr.getUI(UIDraw);
  10980. let end = xGame.uiMgr.getUI(UIGameEnd);
  10981. let skill = xGame.uiMgr.getUI(UISkill);
  10982. if (sign && !sign.isHide)
  10983. moneyNode = sign.ui.moneyNode;
  10984. if (draw && !draw.isHide)
  10985. moneyNode = draw.ui.moneyNode;
  10986. if (end && !end.isHide)
  10987. moneyNode = end.ui.moneyNode;
  10988. if (skill && !skill.isHide)
  10989. moneyNode = skill.ui.moneyNode;
  10990. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  10991. let main = xGame.uiMgr.getUI(UIMain);
  10992. if (condition1 && main && !main.isHide) {
  10993. moneyNode = main.ui.moneyNode;
  10994. }
  10995. return moneyNode;
  10996. }
  10997. playObjFlyAnim(num, type, callback = null) {
  10998. this.stPos.x = Laya.stage.width / 2;
  10999. this.stPos.y = Laya.stage.height / 2;
  11000. let moneyNode = this.getMoneyNode();
  11001. switch (type) {
  11002. case Prop.diamond:
  11003. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11004. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11005. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11006. this.edPos.x /= 2;
  11007. this.edPos.y /= 2;
  11008. break;
  11009. case Prop.coin:
  11010. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11011. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11012. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11013. this.edPos.x /= 2;
  11014. this.edPos.y /= 2;
  11015. break;
  11016. default:
  11017. break;
  11018. }
  11019. xGame.soundMgr.playSound("coinbag");
  11020. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11021. switch (type) {
  11022. case Prop.diamond:
  11023. DataMgr.setDiamond(num);
  11024. break;
  11025. case Prop.coin:
  11026. DataMgr.setCoin(num);
  11027. break;
  11028. default:
  11029. break;
  11030. }
  11031. callback && callback();
  11032. });
  11033. }
  11034. autoPopUIView() {
  11035. let arr = [];
  11036. let sign = this.judgeSameDay() ? false : true;
  11037. if (sign)
  11038. arr.push("sign");
  11039. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11040. if (draw)
  11041. arr.push("draw");
  11042. if (arr.length <= 0)
  11043. return;
  11044. let str = this.getRandArrEle(arr);
  11045. switch (str) {
  11046. case "sign":
  11047. xGame.uiMgr.Show(UISign);
  11048. break;
  11049. case "draw":
  11050. xGame.uiMgr.Show(UIDraw);
  11051. break;
  11052. default:
  11053. break;
  11054. }
  11055. }
  11056. getMSTime(time) {
  11057. let min = Math.floor(time / 60);
  11058. let sec = Math.floor((time - min * 60));
  11059. if (sec < 10)
  11060. sec = "0" + sec;
  11061. if (min < 10)
  11062. min = "0" + min;
  11063. return `${min}:${sec}`;
  11064. }
  11065. testPower() {
  11066. DataMgr.setPower(0, false);
  11067. }
  11068. getAllStarNum() {
  11069. let data = DataMgr.getPlaceBallLevelList();
  11070. let out = 0;
  11071. for (let index = 0; index < data.length; index++) {
  11072. out += data[index].star;
  11073. }
  11074. return out;
  11075. }
  11076. recoverCameraView() {
  11077. Laya.timer.once(900, this, () => {
  11078. xGame.common.showOneCamera("mainCamera");
  11079. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11080. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11081. xGame.common.gameUI.ui.border.alpha = 0;
  11082. if (Laya.physicsTimer.scale < 1) {
  11083. Laya.physicsTimer.scale = 1;
  11084. }
  11085. }
  11086. });
  11087. }
  11088. getClassicLevel() {
  11089. let successTimes = DataMgr.getClassicTimes();
  11090. let needKey = "";
  11091. let lastKey = "";
  11092. let cfg = cfgTable.classictimesData;
  11093. let data;
  11094. for (const key in cfg) {
  11095. data = cfg[key];
  11096. if (successTimes <= data.times) {
  11097. needKey = key;
  11098. }
  11099. lastKey = key;
  11100. }
  11101. if (needKey == "")
  11102. needKey = lastKey;
  11103. return cfg[needKey];
  11104. }
  11105. }
  11106. Common._instance = null;
  11107. class ui_Component92 extends fgui.GComponent {
  11108. static createInstance() {
  11109. return (fgui.UIPackage.createObject("game", "Component92"));
  11110. }
  11111. onConstruct() {
  11112. this.n0 = (this.getChild("n0"));
  11113. }
  11114. }
  11115. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11116. class ui_Component129 extends fgui.GProgressBar {
  11117. static createInstance() {
  11118. return (fgui.UIPackage.createObject("game", "Component129"));
  11119. }
  11120. onConstruct() {
  11121. this.bar_v = (this.getChild("bar_v"));
  11122. this.n84 = (this.getChild("n84"));
  11123. }
  11124. }
  11125. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11126. class ui_Component130 extends fgui.GComponent {
  11127. static createInstance() {
  11128. return (fgui.UIPackage.createObject("game", "Component130"));
  11129. }
  11130. onConstruct() {
  11131. this.ani = (this.getChild("ani"));
  11132. this.t0 = this.getTransition("t0");
  11133. }
  11134. }
  11135. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11136. class ui_powerEft extends fgui.GComponent {
  11137. static createInstance() {
  11138. return (fgui.UIPackage.createObject("game", "powerEft"));
  11139. }
  11140. onConstruct() {
  11141. this.ani = (this.getChild("ani"));
  11142. this.n88 = (this.getChild("n88"));
  11143. this.n89 = (this.getChild("n89"));
  11144. }
  11145. }
  11146. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11147. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11148. static createInstance() {
  11149. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11150. }
  11151. onConstruct() {
  11152. this.c1 = this.getController("c1");
  11153. this.n2 = (this.getChild("n2"));
  11154. this.n22 = (this.getChild("n22"));
  11155. this.n23 = (this.getChild("n23"));
  11156. this.n15 = (this.getChild("n15"));
  11157. this.challenge = (this.getChild("challenge"));
  11158. this.n17 = (this.getChild("n17"));
  11159. this.n3 = (this.getChild("n3"));
  11160. this.starNode = (this.getChild("starNode"));
  11161. this.levelTxt = (this.getChild("levelTxt"));
  11162. this.n14 = (this.getChild("n14"));
  11163. this.n19 = (this.getChild("n19"));
  11164. this.n20 = (this.getChild("n20"));
  11165. this.n21 = (this.getChild("n21"));
  11166. this.special = (this.getChild("special"));
  11167. }
  11168. }
  11169. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11170. class ui_Component79 extends fgui.GComponent {
  11171. static createInstance() {
  11172. return (fgui.UIPackage.createObject("game", "Component79"));
  11173. }
  11174. onConstruct() {
  11175. this.c1 = this.getController("c1");
  11176. this.n7 = (this.getChild("n7"));
  11177. this.n8 = (this.getChild("n8"));
  11178. this.n9 = (this.getChild("n9"));
  11179. this.n10 = (this.getChild("n10"));
  11180. this.n11 = (this.getChild("n11"));
  11181. this.n12 = (this.getChild("n12"));
  11182. }
  11183. }
  11184. ui_Component79.URL = "ui://isxx5ak7avag477";
  11185. class ui_Component80 extends fgui.GComponent {
  11186. static createInstance() {
  11187. return (fgui.UIPackage.createObject("game", "Component80"));
  11188. }
  11189. onConstruct() {
  11190. this.n0 = (this.getChild("n0"));
  11191. this.n1 = (this.getChild("n1"));
  11192. this.myList = (this.getChild("myList"));
  11193. this.t0 = this.getTransition("t0");
  11194. }
  11195. }
  11196. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11197. class ui_SignNormal extends fgui.GComponent {
  11198. static createInstance() {
  11199. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11200. }
  11201. onConstruct() {
  11202. this.c1 = this.getController("c1");
  11203. this.n7 = (this.getChild("n7"));
  11204. this.n15 = (this.getChild("n15"));
  11205. this.titleTxt = (this.getChild("titleTxt"));
  11206. this.n8 = (this.getChild("n8"));
  11207. this.myIcon = (this.getChild("myIcon"));
  11208. this.numTxt = (this.getChild("numTxt"));
  11209. this.n12 = (this.getChild("n12"));
  11210. this.n13 = (this.getChild("n13"));
  11211. this.n17 = (this.getChild("n17"));
  11212. this.n14 = (this.getChild("n14"));
  11213. }
  11214. }
  11215. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11216. class ui_screenNode extends fgui.GComponent {
  11217. static createInstance() {
  11218. return (fgui.UIPackage.createObject("game", "screenNode"));
  11219. }
  11220. onConstruct() {
  11221. this.n9 = (this.getChild("n9"));
  11222. this.screenImg = (this.getChild("screenImg"));
  11223. }
  11224. }
  11225. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11226. class ui_GetAwrad_com1 extends fgui.GComponent {
  11227. static createInstance() {
  11228. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11229. }
  11230. onConstruct() {
  11231. this.n38 = (this.getChild("n38"));
  11232. this.n39 = (this.getChild("n39"));
  11233. this.n40 = (this.getChild("n40"));
  11234. this.t0 = this.getTransition("t0");
  11235. this.t1 = this.getTransition("t1");
  11236. }
  11237. }
  11238. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11239. class ui_GetAwrad_com2 extends fgui.GComponent {
  11240. static createInstance() {
  11241. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11242. }
  11243. onConstruct() {
  11244. this.n39 = (this.getChild("n39"));
  11245. this.n40 = (this.getChild("n40"));
  11246. this.t0 = this.getTransition("t0");
  11247. }
  11248. }
  11249. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11250. class ui_Component128 extends fgui.GComponent {
  11251. static createInstance() {
  11252. return (fgui.UIPackage.createObject("game", "Component128"));
  11253. }
  11254. onConstruct() {
  11255. this.n38 = (this.getChild("n38"));
  11256. this.n40 = (this.getChild("n40"));
  11257. }
  11258. }
  11259. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11260. class ui_Component100_1 extends fgui.GComponent {
  11261. static createInstance() {
  11262. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11263. }
  11264. onConstruct() {
  11265. this.myNode = (this.getChild("myNode"));
  11266. this.t0 = this.getTransition("t0");
  11267. }
  11268. }
  11269. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11270. class ui_Component142 extends fgui.GComponent {
  11271. static createInstance() {
  11272. return (fgui.UIPackage.createObject("game", "Component142"));
  11273. }
  11274. onConstruct() {
  11275. this.n41 = (this.getChild("n41"));
  11276. this.n42 = (this.getChild("n42"));
  11277. }
  11278. }
  11279. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11280. class ui_main_guang extends fgui.GComponent {
  11281. static createInstance() {
  11282. return (fgui.UIPackage.createObject("game", "main_guang"));
  11283. }
  11284. onConstruct() {
  11285. this.n1 = (this.getChild("n1"));
  11286. this.n2 = (this.getChild("n2"));
  11287. this.n3 = (this.getChild("n3"));
  11288. this.n4 = (this.getChild("n4"));
  11289. this.n5 = (this.getChild("n5"));
  11290. this.n6 = (this.getChild("n6"));
  11291. this.n8 = (this.getChild("n8"));
  11292. this.t0 = this.getTransition("t0");
  11293. }
  11294. }
  11295. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11296. class ui_try_com1 extends fgui.GComponent {
  11297. static createInstance() {
  11298. return (fgui.UIPackage.createObject("game", "try_com1"));
  11299. }
  11300. onConstruct() {
  11301. this.c1 = this.getController("c1");
  11302. this.n0 = (this.getChild("n0"));
  11303. this.n2 = (this.getChild("n2"));
  11304. this.cancelBtn = (this.getChild("cancelBtn"));
  11305. this.videoBtn = (this.getChild("videoBtn"));
  11306. this.n9 = (this.getChild("n9"));
  11307. this.n24 = (this.getChild("n24"));
  11308. this.titleTxt = (this.getChild("titleTxt"));
  11309. this.n32 = (this.getChild("n32"));
  11310. this.n29 = (this.getChild("n29"));
  11311. this.n36 = (this.getChild("n36"));
  11312. this.txtTime = (this.getChild("txtTime"));
  11313. this.t0 = this.getTransition("t0");
  11314. }
  11315. }
  11316. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11317. class ui_try_com2 extends fgui.GComponent {
  11318. static createInstance() {
  11319. return (fgui.UIPackage.createObject("game", "try_com2"));
  11320. }
  11321. onConstruct() {
  11322. this.skillicon = (this.getChild("skillicon"));
  11323. this.n35 = (this.getChild("n35"));
  11324. this.n31 = (this.getChild("n31"));
  11325. this.n32 = (this.getChild("n32"));
  11326. this.n33 = (this.getChild("n33"));
  11327. this.n34 = (this.getChild("n34"));
  11328. }
  11329. }
  11330. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11331. class ui_try_com3 extends fgui.GComponent {
  11332. static createInstance() {
  11333. return (fgui.UIPackage.createObject("game", "try_com3"));
  11334. }
  11335. onConstruct() {
  11336. this.n33 = (this.getChild("n33"));
  11337. this.n34 = (this.getChild("n34"));
  11338. this.n35 = (this.getChild("n35"));
  11339. this.t0 = this.getTransition("t0");
  11340. }
  11341. }
  11342. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11343. class ui_Component121 extends fgui.GButton {
  11344. static createInstance() {
  11345. return (fgui.UIPackage.createObject("game", "Component121"));
  11346. }
  11347. onConstruct() {
  11348. this.n3 = (this.getChild("n3"));
  11349. this.t0 = this.getTransition("t0");
  11350. }
  11351. }
  11352. ui_Component121.URL = "ui://isxx5ak7cy72v4ib";
  11353. class ui_huihe1 extends fgui.GComponent {
  11354. static createInstance() {
  11355. return (fgui.UIPackage.createObject("game", "huihe1"));
  11356. }
  11357. onConstruct() {
  11358. this.n0 = (this.getChild("n0"));
  11359. this.n1 = (this.getChild("n1"));
  11360. this.t0 = this.getTransition("t0");
  11361. }
  11362. }
  11363. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11364. class ui_huihe2 extends fgui.GComponent {
  11365. static createInstance() {
  11366. return (fgui.UIPackage.createObject("game", "huihe2"));
  11367. }
  11368. onConstruct() {
  11369. this.n0 = (this.getChild("n0"));
  11370. this.n1 = (this.getChild("n1"));
  11371. this.t0 = this.getTransition("t0");
  11372. }
  11373. }
  11374. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11375. class ui_Component143 extends fgui.GComponent {
  11376. static createInstance() {
  11377. return (fgui.UIPackage.createObject("game", "Component143"));
  11378. }
  11379. onConstruct() {
  11380. this.n3 = (this.getChild("n3"));
  11381. this.n4 = (this.getChild("n4"));
  11382. this.n5 = (this.getChild("n5"));
  11383. this.n6 = (this.getChild("n6"));
  11384. this.n7 = (this.getChild("n7"));
  11385. this.n8 = (this.getChild("n8"));
  11386. this.n9 = (this.getChild("n9"));
  11387. this.n10 = (this.getChild("n10"));
  11388. this.t0 = this.getTransition("t0");
  11389. }
  11390. }
  11391. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11392. class ui_dh_jingbi2 extends fgui.GComponent {
  11393. static createInstance() {
  11394. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11395. }
  11396. onConstruct() {
  11397. this.n0 = (this.getChild("n0"));
  11398. this.n1 = (this.getChild("n1"));
  11399. this.n2 = (this.getChild("n2"));
  11400. this.n3 = (this.getChild("n3"));
  11401. this.n4 = (this.getChild("n4"));
  11402. this.n5 = (this.getChild("n5"));
  11403. this.n6 = (this.getChild("n6"));
  11404. this.n8 = (this.getChild("n8"));
  11405. this.n10 = (this.getChild("n10"));
  11406. this.t0 = this.getTransition("t0");
  11407. }
  11408. }
  11409. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11410. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11411. static createInstance() {
  11412. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11413. }
  11414. onConstruct() {
  11415. this.n1 = (this.getChild("n1"));
  11416. this.n4 = (this.getChild("n4"));
  11417. this.t0 = this.getTransition("t0");
  11418. }
  11419. }
  11420. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11421. class ui_dh_jingbi3 extends fgui.GComponent {
  11422. static createInstance() {
  11423. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11424. }
  11425. onConstruct() {
  11426. this.n0 = (this.getChild("n0"));
  11427. this.n1 = (this.getChild("n1"));
  11428. this.n2 = (this.getChild("n2"));
  11429. this.n3 = (this.getChild("n3"));
  11430. this.n4 = (this.getChild("n4"));
  11431. this.n5 = (this.getChild("n5"));
  11432. this.n6 = (this.getChild("n6"));
  11433. this.n8 = (this.getChild("n8"));
  11434. this.n10 = (this.getChild("n10"));
  11435. this.t0 = this.getTransition("t0");
  11436. }
  11437. }
  11438. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11439. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11440. static createInstance() {
  11441. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11442. }
  11443. onConstruct() {
  11444. this.n3 = (this.getChild("n3"));
  11445. this.n1 = (this.getChild("n1"));
  11446. this.t0 = this.getTransition("t0");
  11447. }
  11448. }
  11449. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11450. class ui_hb_jinbi1 extends fgui.GButton {
  11451. static createInstance() {
  11452. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11453. }
  11454. onConstruct() {
  11455. this.n20 = (this.getChild("n20"));
  11456. this.n25 = (this.getChild("n25"));
  11457. this.coinTxt = (this.getChild("coinTxt"));
  11458. this.n28 = (this.getChild("n28"));
  11459. this.n32 = (this.getChild("n32"));
  11460. this.n38 = (this.getChild("n38"));
  11461. this.n45 = (this.getChild("n45"));
  11462. this.getTips = (this.getChild("getTips"));
  11463. this.n39 = (this.getChild("n39"));
  11464. this.diamondTxt = (this.getChild("diamondTxt"));
  11465. this.n41 = (this.getChild("n41"));
  11466. this.n42 = (this.getChild("n42"));
  11467. this.n46 = (this.getChild("n46"));
  11468. this.n47 = (this.getChild("n47"));
  11469. this.n48 = (this.getChild("n48"));
  11470. this.t0 = this.getTransition("t0");
  11471. }
  11472. }
  11473. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11474. class ui_hb_jinbi2 extends fgui.GButton {
  11475. static createInstance() {
  11476. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  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.n39 = (this.getChild("n39"));
  11486. this.diamondTxt = (this.getChild("diamondTxt"));
  11487. this.n41 = (this.getChild("n41"));
  11488. this.n42 = (this.getChild("n42"));
  11489. this.n43 = (this.getChild("n43"));
  11490. this.n44 = (this.getChild("n44"));
  11491. this.n45 = (this.getChild("n45"));
  11492. this.t0 = this.getTransition("t0");
  11493. }
  11494. }
  11495. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11496. class ui_hb_jinbi3 extends fgui.GButton {
  11497. static createInstance() {
  11498. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11499. }
  11500. onConstruct() {
  11501. this.n20 = (this.getChild("n20"));
  11502. this.n25 = (this.getChild("n25"));
  11503. this.coinTxt = (this.getChild("coinTxt"));
  11504. this.n28 = (this.getChild("n28"));
  11505. this.n32 = (this.getChild("n32"));
  11506. this.n38 = (this.getChild("n38"));
  11507. this.n39 = (this.getChild("n39"));
  11508. this.diamondTxt = (this.getChild("diamondTxt"));
  11509. this.n41 = (this.getChild("n41"));
  11510. this.n42 = (this.getChild("n42"));
  11511. this.n43 = (this.getChild("n43"));
  11512. this.n44 = (this.getChild("n44"));
  11513. this.n45 = (this.getChild("n45"));
  11514. this.t0 = this.getTransition("t0");
  11515. }
  11516. }
  11517. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11518. class ui_Component104 extends fgui.GComponent {
  11519. static createInstance() {
  11520. return (fgui.UIPackage.createObject("game", "Component104"));
  11521. }
  11522. onConstruct() {
  11523. this.c1 = this.getController("c1");
  11524. this.n12 = (this.getChild("n12"));
  11525. this.coinBtn = (this.getChild("coinBtn"));
  11526. this.diamondBtn = (this.getChild("diamondBtn"));
  11527. this.node3 = (this.getChild("node3"));
  11528. this.node4 = (this.getChild("node4"));
  11529. this.node5 = (this.getChild("node5"));
  11530. this.node1 = (this.getChild("node1"));
  11531. this.node2 = (this.getChild("node2"));
  11532. this.node6 = (this.getChild("node6"));
  11533. this.t0 = this.getTransition("t0");
  11534. }
  11535. }
  11536. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11537. class ui_Component105 extends fgui.GButton {
  11538. static createInstance() {
  11539. return (fgui.UIPackage.createObject("game", "Component105"));
  11540. }
  11541. onConstruct() {
  11542. this.c1 = this.getController("c1");
  11543. this.n49 = (this.getChild("n49"));
  11544. this.n18 = (this.getChild("n18"));
  11545. this.n46 = (this.getChild("n46"));
  11546. this.n48 = (this.getChild("n48"));
  11547. }
  11548. }
  11549. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11550. class ui_Component106 extends fgui.GButton {
  11551. static createInstance() {
  11552. return (fgui.UIPackage.createObject("game", "Component106"));
  11553. }
  11554. onConstruct() {
  11555. this.c1 = this.getController("c1");
  11556. this.n49 = (this.getChild("n49"));
  11557. this.n18 = (this.getChild("n18"));
  11558. this.n46 = (this.getChild("n46"));
  11559. this.n48 = (this.getChild("n48"));
  11560. }
  11561. }
  11562. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11563. class ui_hb_zs1 extends fgui.GButton {
  11564. static createInstance() {
  11565. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11566. }
  11567. onConstruct() {
  11568. this.c1 = this.getController("c1");
  11569. this.n20 = (this.getChild("n20"));
  11570. this.n21 = (this.getChild("n21"));
  11571. this.n26 = (this.getChild("n26"));
  11572. this.n27 = (this.getChild("n27"));
  11573. this.shareTxt = (this.getChild("shareTxt"));
  11574. this.n32 = (this.getChild("n32"));
  11575. this.n38 = (this.getChild("n38"));
  11576. this.n39 = (this.getChild("n39"));
  11577. this.n44 = (this.getChild("n44"));
  11578. this.diamondTxt = (this.getChild("diamondTxt"));
  11579. this.n41 = (this.getChild("n41"));
  11580. this.n45 = (this.getChild("n45"));
  11581. this.n47 = (this.getChild("n47"));
  11582. this.n48 = (this.getChild("n48"));
  11583. this.randTxt = (this.getChild("randTxt"));
  11584. this.n50 = (this.getChild("n50"));
  11585. this.t0 = this.getTransition("t0");
  11586. }
  11587. }
  11588. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11589. class ui_dh_zs1 extends fgui.GComponent {
  11590. static createInstance() {
  11591. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11592. }
  11593. onConstruct() {
  11594. this.n10 = (this.getChild("n10"));
  11595. this.n9 = (this.getChild("n9"));
  11596. this.n1 = (this.getChild("n1"));
  11597. this.n2 = (this.getChild("n2"));
  11598. this.n3 = (this.getChild("n3"));
  11599. this.n4 = (this.getChild("n4"));
  11600. this.n5 = (this.getChild("n5"));
  11601. this.n6 = (this.getChild("n6"));
  11602. this.n8 = (this.getChild("n8"));
  11603. this.n11 = (this.getChild("n11"));
  11604. this.t0 = this.getTransition("t0");
  11605. }
  11606. }
  11607. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11608. class ui_dh_zs1_1 extends fgui.GComponent {
  11609. static createInstance() {
  11610. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11611. }
  11612. onConstruct() {
  11613. this.n3 = (this.getChild("n3"));
  11614. this.n1 = (this.getChild("n1"));
  11615. this.t0 = this.getTransition("t0");
  11616. }
  11617. }
  11618. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11619. class ui_hb_zs2 extends fgui.GButton {
  11620. static createInstance() {
  11621. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11622. }
  11623. onConstruct() {
  11624. this.n20 = (this.getChild("n20"));
  11625. this.n21 = (this.getChild("n21"));
  11626. this.n26 = (this.getChild("n26"));
  11627. this.n27 = (this.getChild("n27"));
  11628. this.n32 = (this.getChild("n32"));
  11629. this.n38 = (this.getChild("n38"));
  11630. this.n39 = (this.getChild("n39"));
  11631. this.n44 = (this.getChild("n44"));
  11632. this.diamondTxt = (this.getChild("diamondTxt"));
  11633. this.n41 = (this.getChild("n41"));
  11634. this.n45 = (this.getChild("n45"));
  11635. this.t0 = this.getTransition("t0");
  11636. }
  11637. }
  11638. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11639. class ui_hb_zs3 extends fgui.GButton {
  11640. static createInstance() {
  11641. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11642. }
  11643. onConstruct() {
  11644. this.n20 = (this.getChild("n20"));
  11645. this.n21 = (this.getChild("n21"));
  11646. this.n26 = (this.getChild("n26"));
  11647. this.n27 = (this.getChild("n27"));
  11648. this.n32 = (this.getChild("n32"));
  11649. this.n38 = (this.getChild("n38"));
  11650. this.n47 = (this.getChild("n47"));
  11651. this.t0 = this.getTransition("t0");
  11652. }
  11653. }
  11654. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11655. class ui_dh_zs2 extends fgui.GComponent {
  11656. static createInstance() {
  11657. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11658. }
  11659. onConstruct() {
  11660. this.n10 = (this.getChild("n10"));
  11661. this.n9 = (this.getChild("n9"));
  11662. this.n1 = (this.getChild("n1"));
  11663. this.n2 = (this.getChild("n2"));
  11664. this.n3 = (this.getChild("n3"));
  11665. this.n4 = (this.getChild("n4"));
  11666. this.n5 = (this.getChild("n5"));
  11667. this.n6 = (this.getChild("n6"));
  11668. this.n8 = (this.getChild("n8"));
  11669. this.n11 = (this.getChild("n11"));
  11670. this.t0 = this.getTransition("t0");
  11671. }
  11672. }
  11673. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11674. class ui_dh_zs2_1 extends fgui.GComponent {
  11675. static createInstance() {
  11676. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11677. }
  11678. onConstruct() {
  11679. this.n3 = (this.getChild("n3"));
  11680. this.n1 = (this.getChild("n1"));
  11681. this.t0 = this.getTransition("t0");
  11682. }
  11683. }
  11684. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11685. class ui_dh_zs3 extends fgui.GComponent {
  11686. static createInstance() {
  11687. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11688. }
  11689. onConstruct() {
  11690. this.n10 = (this.getChild("n10"));
  11691. this.n9 = (this.getChild("n9"));
  11692. this.n1 = (this.getChild("n1"));
  11693. this.n2 = (this.getChild("n2"));
  11694. this.n3 = (this.getChild("n3"));
  11695. this.n4 = (this.getChild("n4"));
  11696. this.n5 = (this.getChild("n5"));
  11697. this.n6 = (this.getChild("n6"));
  11698. this.n8 = (this.getChild("n8"));
  11699. this.n11 = (this.getChild("n11"));
  11700. this.t0 = this.getTransition("t0");
  11701. }
  11702. }
  11703. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11704. class ui_dh_zs3_1 extends fgui.GComponent {
  11705. static createInstance() {
  11706. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11707. }
  11708. onConstruct() {
  11709. this.n3 = (this.getChild("n3"));
  11710. this.n1 = (this.getChild("n1"));
  11711. this.t0 = this.getTransition("t0");
  11712. }
  11713. }
  11714. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11715. class ui_Component107 extends fgui.GComponent {
  11716. static createInstance() {
  11717. return (fgui.UIPackage.createObject("game", "Component107"));
  11718. }
  11719. onConstruct() {
  11720. this.n18 = (this.getChild("n18"));
  11721. this.n19 = (this.getChild("n19"));
  11722. this.n20 = (this.getChild("n20"));
  11723. this.n21 = (this.getChild("n21"));
  11724. this.n22 = (this.getChild("n22"));
  11725. this.levelTxt = (this.getChild("levelTxt"));
  11726. this.t0 = this.getTransition("t0");
  11727. }
  11728. }
  11729. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11730. class ui_box_com1 extends fgui.GComponent {
  11731. static createInstance() {
  11732. return (fgui.UIPackage.createObject("game", "box_com1"));
  11733. }
  11734. onConstruct() {
  11735. this.n14 = (this.getChild("n14"));
  11736. this.n6 = (this.getChild("n6"));
  11737. this.t0 = this.getTransition("t0");
  11738. }
  11739. }
  11740. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11741. class ui_box_com2 extends fgui.GProgressBar {
  11742. static createInstance() {
  11743. return (fgui.UIPackage.createObject("game", "box_com2"));
  11744. }
  11745. onConstruct() {
  11746. this.bg0 = (this.getChild("bg0"));
  11747. this.bg = (this.getChild("bg"));
  11748. this.bar = (this.getChild("bar"));
  11749. this.n7 = (this.getChild("n7"));
  11750. this.n8 = (this.getChild("n8"));
  11751. this.n10 = (this.getChild("n10"));
  11752. this.n11 = (this.getChild("n11"));
  11753. this.n12 = (this.getChild("n12"));
  11754. }
  11755. }
  11756. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11757. class ui_box_com4 extends fgui.GComponent {
  11758. static createInstance() {
  11759. return (fgui.UIPackage.createObject("game", "box_com4"));
  11760. }
  11761. onConstruct() {
  11762. this.n8 = (this.getChild("n8"));
  11763. this.t0 = this.getTransition("t0");
  11764. }
  11765. }
  11766. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11767. class ui_box_com3 extends fgui.GComponent {
  11768. static createInstance() {
  11769. return (fgui.UIPackage.createObject("game", "box_com3"));
  11770. }
  11771. onConstruct() {
  11772. this.n2 = (this.getChild("n2"));
  11773. this.n3 = (this.getChild("n3"));
  11774. this.n4 = (this.getChild("n4"));
  11775. this.n5 = (this.getChild("n5"));
  11776. this.t0 = this.getTransition("t0");
  11777. this.t1 = this.getTransition("t1");
  11778. }
  11779. }
  11780. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11781. class ui_Component97 extends fgui.GComponent {
  11782. static createInstance() {
  11783. return (fgui.UIPackage.createObject("game", "Component97"));
  11784. }
  11785. onConstruct() {
  11786. this.c1 = this.getController("c1");
  11787. this.n46 = (this.getChild("n46"));
  11788. this.diamondNode = (this.getChild("diamondNode"));
  11789. this.coinNode = (this.getChild("coinNode"));
  11790. this.t0 = this.getTransition("t0");
  11791. }
  11792. }
  11793. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11794. class ui_Component98 extends fgui.GButton {
  11795. static createInstance() {
  11796. return (fgui.UIPackage.createObject("game", "Component98"));
  11797. }
  11798. onConstruct() {
  11799. this.n8 = (this.getChild("n8"));
  11800. this.n40 = (this.getChild("n40"));
  11801. }
  11802. }
  11803. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11804. class ui_Component28_11 extends fgui.GButton {
  11805. static createInstance() {
  11806. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11807. }
  11808. onConstruct() {
  11809. this.c1 = this.getController("c1");
  11810. this.n12 = (this.getChild("n12"));
  11811. this.n17 = (this.getChild("n17"));
  11812. this.n13 = (this.getChild("n13"));
  11813. this.diamondTxt = (this.getChild("diamondTxt"));
  11814. this.n15 = (this.getChild("n15"));
  11815. this.n16 = (this.getChild("n16"));
  11816. }
  11817. }
  11818. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11819. class ui_Component58_11 extends fgui.GComponent {
  11820. static createInstance() {
  11821. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11822. }
  11823. onConstruct() {
  11824. this.n23 = (this.getChild("n23"));
  11825. this.n41 = (this.getChild("n41"));
  11826. this.myList = (this.getChild("myList"));
  11827. this.n45 = (this.getChild("n45"));
  11828. this.n44 = (this.getChild("n44"));
  11829. this.t0 = this.getTransition("t0");
  11830. }
  11831. }
  11832. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11833. class ui_Component100 extends fgui.GComponent {
  11834. static createInstance() {
  11835. return (fgui.UIPackage.createObject("game", "Component100"));
  11836. }
  11837. onConstruct() {
  11838. this.c1 = this.getController("c1");
  11839. this.n75 = (this.getChild("n75"));
  11840. this.n76 = (this.getChild("n76"));
  11841. this.n80 = (this.getChild("n80"));
  11842. this.txt = (this.getChild("txt"));
  11843. this.spineRoot = (this.getChild("spineRoot"));
  11844. }
  11845. }
  11846. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11847. class ui_Component101 extends fgui.GComponent {
  11848. static createInstance() {
  11849. return (fgui.UIPackage.createObject("game", "Component101"));
  11850. }
  11851. onConstruct() {
  11852. this.c1 = this.getController("c1");
  11853. this.n36 = (this.getChild("n36"));
  11854. this.n35 = (this.getChild("n35"));
  11855. this.n33 = (this.getChild("n33"));
  11856. this.n34 = (this.getChild("n34"));
  11857. }
  11858. }
  11859. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11860. class ui_Component53 extends fgui.GComponent {
  11861. static createInstance() {
  11862. return (fgui.UIPackage.createObject("game", "Component53"));
  11863. }
  11864. onConstruct() {
  11865. this.n0 = (this.getChild("n0"));
  11866. this.n1 = (this.getChild("n1"));
  11867. this.n2 = (this.getChild("n2"));
  11868. this.n3 = (this.getChild("n3"));
  11869. this.n4 = (this.getChild("n4"));
  11870. this.n5 = (this.getChild("n5"));
  11871. this.n6 = (this.getChild("n6"));
  11872. this.n7 = (this.getChild("n7"));
  11873. this.n8 = (this.getChild("n8"));
  11874. this.n9 = (this.getChild("n9"));
  11875. this.n10 = (this.getChild("n10"));
  11876. this.n11 = (this.getChild("n11"));
  11877. this.n12 = (this.getChild("n12"));
  11878. this.n13 = (this.getChild("n13"));
  11879. this.n14 = (this.getChild("n14"));
  11880. this.n15 = (this.getChild("n15"));
  11881. this.n16 = (this.getChild("n16"));
  11882. this.n19 = (this.getChild("n19"));
  11883. this.n20 = (this.getChild("n20"));
  11884. this.n21 = (this.getChild("n21"));
  11885. this.n22 = (this.getChild("n22"));
  11886. this.n23 = (this.getChild("n23"));
  11887. this.n24 = (this.getChild("n24"));
  11888. this.n25 = (this.getChild("n25"));
  11889. this.n26 = (this.getChild("n26"));
  11890. this.n27 = (this.getChild("n27"));
  11891. this.n28 = (this.getChild("n28"));
  11892. this.n29 = (this.getChild("n29"));
  11893. this.n30 = (this.getChild("n30"));
  11894. this.n31 = (this.getChild("n31"));
  11895. this.n32 = (this.getChild("n32"));
  11896. this.n33 = (this.getChild("n33"));
  11897. this.n34 = (this.getChild("n34"));
  11898. this.n35 = (this.getChild("n35"));
  11899. this.t0 = this.getTransition("t0");
  11900. }
  11901. }
  11902. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11903. class ui_Component58 extends fgui.GComponent {
  11904. static createInstance() {
  11905. return (fgui.UIPackage.createObject("game", "Component58"));
  11906. }
  11907. onConstruct() {
  11908. this.n23 = (this.getChild("n23"));
  11909. this.n41 = (this.getChild("n41"));
  11910. this.n8 = (this.getChild("n8"));
  11911. this.skillList = (this.getChild("skillList"));
  11912. this.t0 = this.getTransition("t0");
  11913. }
  11914. }
  11915. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11916. class ui_Component59 extends fgui.GComponent {
  11917. static createInstance() {
  11918. return (fgui.UIPackage.createObject("game", "Component59"));
  11919. }
  11920. onConstruct() {
  11921. this.n3 = (this.getChild("n3"));
  11922. this.msgTxt = (this.getChild("msgTxt"));
  11923. this.t0 = this.getTransition("t0");
  11924. }
  11925. }
  11926. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11927. class ui_RulerNode extends fgui.GComponent {
  11928. static createInstance() {
  11929. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11930. }
  11931. onConstruct() {
  11932. this.n6 = (this.getChild("n6"));
  11933. this.n4 = (this.getChild("n4"));
  11934. this.img1 = (this.getChild("img1"));
  11935. this.img2 = (this.getChild("img2"));
  11936. }
  11937. }
  11938. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11939. class ui_Component108 extends fgui.GComponent {
  11940. static createInstance() {
  11941. return (fgui.UIPackage.createObject("game", "Component108"));
  11942. }
  11943. onConstruct() {
  11944. this.n19 = (this.getChild("n19"));
  11945. this.t0 = this.getTransition("t0");
  11946. }
  11947. }
  11948. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11949. class ui_Component63 extends fgui.GComponent {
  11950. static createInstance() {
  11951. return (fgui.UIPackage.createObject("game", "Component63"));
  11952. }
  11953. onConstruct() {
  11954. this.n66 = (this.getChild("n66"));
  11955. this.n56 = (this.getChild("n56"));
  11956. this.n63 = (this.getChild("n63"));
  11957. this.n65 = (this.getChild("n65"));
  11958. this.t0 = this.getTransition("t0");
  11959. }
  11960. }
  11961. ui_Component63.URL = "ui://isxx5ak7h657452";
  11962. class ui_topNode extends fgui.GComponent {
  11963. static createInstance() {
  11964. return (fgui.UIPackage.createObject("game", "topNode"));
  11965. }
  11966. onConstruct() {
  11967. this.selfProgress = (this.getChild("selfProgress"));
  11968. this.aiProgress = (this.getChild("aiProgress"));
  11969. this.selfKuang = (this.getChild("selfKuang"));
  11970. this.aiKuang = (this.getChild("aiKuang"));
  11971. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  11972. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  11973. this.n33 = (this.getChild("n33"));
  11974. this.n34 = (this.getChild("n34"));
  11975. this.selfNameTxt = (this.getChild("selfNameTxt"));
  11976. this.aiNameTxt = (this.getChild("aiNameTxt"));
  11977. this.selfBallList = (this.getChild("selfBallList"));
  11978. this.aiBallList = (this.getChild("aiBallList"));
  11979. this.middleNode = (this.getChild("middleNode"));
  11980. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  11981. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  11982. this.scoreNode = (this.getChild("scoreNode"));
  11983. this.selfTips = (this.getChild("selfTips"));
  11984. this.aiTips = (this.getChild("aiTips"));
  11985. }
  11986. }
  11987. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  11988. class ui_selfProgress extends fgui.GProgressBar {
  11989. static createInstance() {
  11990. return (fgui.UIPackage.createObject("game", "selfProgress"));
  11991. }
  11992. onConstruct() {
  11993. this.n3 = (this.getChild("n3"));
  11994. this.bar = (this.getChild("bar"));
  11995. }
  11996. }
  11997. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  11998. class ui_aiProgress extends fgui.GProgressBar {
  11999. static createInstance() {
  12000. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12001. }
  12002. onConstruct() {
  12003. this.n3 = (this.getChild("n3"));
  12004. this.bar = (this.getChild("bar"));
  12005. }
  12006. }
  12007. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12008. class ui_ballDisplay extends fgui.GComponent {
  12009. static createInstance() {
  12010. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12011. }
  12012. onConstruct() {
  12013. this.myImg = (this.getChild("myImg"));
  12014. }
  12015. }
  12016. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12017. class ui_moveNode extends fgui.GComponent {
  12018. static createInstance() {
  12019. return (fgui.UIPackage.createObject("game", "moveNode"));
  12020. }
  12021. onConstruct() {
  12022. this.n8 = (this.getChild("n8"));
  12023. this.finger = (this.getChild("finger"));
  12024. }
  12025. }
  12026. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12027. class ui_cancelBtn extends fgui.GButton {
  12028. static createInstance() {
  12029. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12030. }
  12031. onConstruct() {
  12032. this.c1 = this.getController("c1");
  12033. this.n0 = (this.getChild("n0"));
  12034. this.n1 = (this.getChild("n1"));
  12035. }
  12036. }
  12037. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12038. class ui_shareBtn extends fgui.GButton {
  12039. static createInstance() {
  12040. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12041. }
  12042. onConstruct() {
  12043. this.c1 = this.getController("c1");
  12044. this.n2 = (this.getChild("n2"));
  12045. this.n1 = (this.getChild("n1"));
  12046. this.n3 = (this.getChild("n3"));
  12047. this.n4 = (this.getChild("n4"));
  12048. this.n5 = (this.getChild("n5"));
  12049. this.n6 = (this.getChild("n6"));
  12050. }
  12051. }
  12052. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12053. class ui_share2Btn extends fgui.GButton {
  12054. static createInstance() {
  12055. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12056. }
  12057. onConstruct() {
  12058. this.n3 = (this.getChild("n3"));
  12059. }
  12060. }
  12061. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12062. class ui_rodMethodNode extends fgui.GComponent {
  12063. static createInstance() {
  12064. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12065. }
  12066. onConstruct() {
  12067. this.bg = (this.getChild("bg"));
  12068. this.dot = (this.getChild("dot"));
  12069. }
  12070. }
  12071. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12072. class ui_sureBtn extends fgui.GButton {
  12073. static createInstance() {
  12074. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12075. }
  12076. onConstruct() {
  12077. this.n2 = (this.getChild("n2"));
  12078. this.n1 = (this.getChild("n1"));
  12079. }
  12080. }
  12081. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12082. class ui_Component18 extends fgui.GComponent {
  12083. static createInstance() {
  12084. return (fgui.UIPackage.createObject("game", "Component18"));
  12085. }
  12086. onConstruct() {
  12087. this.c1 = this.getController("c1");
  12088. this.nameTxt = (this.getChild("nameTxt"));
  12089. this.headImg = (this.getChild("headImg"));
  12090. this.n24 = (this.getChild("n24"));
  12091. this.skillImg = (this.getChild("skillImg"));
  12092. this.skillTxt = (this.getChild("skillTxt"));
  12093. }
  12094. }
  12095. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12096. class ui_Component45 extends fgui.GComponent {
  12097. static createInstance() {
  12098. return (fgui.UIPackage.createObject("game", "Component45"));
  12099. }
  12100. onConstruct() {
  12101. this.c1 = this.getController("c1");
  12102. this.n40 = (this.getChild("n40"));
  12103. this.n41 = (this.getChild("n41"));
  12104. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12105. this.n42 = (this.getChild("n42"));
  12106. this.awardTxt = (this.getChild("awardTxt"));
  12107. this.n44 = (this.getChild("n44"));
  12108. this.t0 = this.getTransition("t0");
  12109. }
  12110. }
  12111. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12112. class ui_emotionDisplay extends fgui.GButton {
  12113. static createInstance() {
  12114. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12115. }
  12116. onConstruct() {
  12117. this.myIcon = (this.getChild("myIcon"));
  12118. }
  12119. }
  12120. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12121. class ui_Component49 extends fgui.GButton {
  12122. static createInstance() {
  12123. return (fgui.UIPackage.createObject("game", "Component49"));
  12124. }
  12125. onConstruct() {
  12126. this.n69 = (this.getChild("n69"));
  12127. this.n56 = (this.getChild("n56"));
  12128. }
  12129. }
  12130. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12131. class ui_Component50 extends fgui.GButton {
  12132. static createInstance() {
  12133. return (fgui.UIPackage.createObject("game", "Component50"));
  12134. }
  12135. onConstruct() {
  12136. this.n54 = (this.getChild("n54"));
  12137. this.n65 = (this.getChild("n65"));
  12138. }
  12139. }
  12140. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12141. class ui_Component51 extends fgui.GButton {
  12142. static createInstance() {
  12143. return (fgui.UIPackage.createObject("game", "Component51"));
  12144. }
  12145. onConstruct() {
  12146. this.c1 = this.getController("c1");
  12147. this.n51 = (this.getChild("n51"));
  12148. this.n54 = (this.getChild("n54"));
  12149. }
  12150. }
  12151. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12152. class ui_Button5 extends fgui.GButton {
  12153. static createInstance() {
  12154. return (fgui.UIPackage.createObject("game", "Button5"));
  12155. }
  12156. onConstruct() {
  12157. this.c1 = this.getController("c1");
  12158. this.n0 = (this.getChild("n0"));
  12159. this.n2 = (this.getChild("n2"));
  12160. }
  12161. }
  12162. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12163. class ui_Component124 extends fgui.GComponent {
  12164. static createInstance() {
  12165. return (fgui.UIPackage.createObject("game", "Component124"));
  12166. }
  12167. onConstruct() {
  12168. this.n22 = (this.getChild("n22"));
  12169. this.shareNode = (this.getChild("shareNode"));
  12170. }
  12171. }
  12172. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12173. class ui_Component125 extends fgui.GComponent {
  12174. static createInstance() {
  12175. return (fgui.UIPackage.createObject("game", "Component125"));
  12176. }
  12177. onConstruct() {
  12178. this.n29 = (this.getChild("n29"));
  12179. this.coinTxt = (this.getChild("coinTxt"));
  12180. }
  12181. }
  12182. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12183. class ui_Component52 extends fgui.GButton {
  12184. static createInstance() {
  12185. return (fgui.UIPackage.createObject("game", "Component52"));
  12186. }
  12187. onConstruct() {
  12188. this.n35 = (this.getChild("n35"));
  12189. this.n36 = (this.getChild("n36"));
  12190. }
  12191. }
  12192. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12193. class ui_drawBtn extends fgui.GButton {
  12194. static createInstance() {
  12195. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12196. }
  12197. onConstruct() {
  12198. this.c1 = this.getController("c1");
  12199. this.n2 = (this.getChild("n2"));
  12200. this.n1 = (this.getChild("n1"));
  12201. this.n5 = (this.getChild("n5"));
  12202. }
  12203. }
  12204. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12205. class ui_Component43 extends fgui.GButton {
  12206. static createInstance() {
  12207. return (fgui.UIPackage.createObject("game", "Component43"));
  12208. }
  12209. onConstruct() {
  12210. this.n49 = (this.getChild("n49"));
  12211. }
  12212. }
  12213. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12214. class ui_wordsDisplay extends fgui.GComponent {
  12215. static createInstance() {
  12216. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12217. }
  12218. onConstruct() {
  12219. this.txt = (this.getChild("txt"));
  12220. this.n63 = (this.getChild("n63"));
  12221. }
  12222. }
  12223. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12224. class ui_Component3 extends fgui.GComponent {
  12225. static createInstance() {
  12226. return (fgui.UIPackage.createObject("game", "Component3"));
  12227. }
  12228. onConstruct() {
  12229. this.n26 = (this.getChild("n26"));
  12230. this.n24 = (this.getChild("n24"));
  12231. this.nameTxt = (this.getChild("nameTxt"));
  12232. this.headRoot = (this.getChild("headRoot"));
  12233. }
  12234. }
  12235. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12236. class ui_Component4 extends fgui.GComponent {
  12237. static createInstance() {
  12238. return (fgui.UIPackage.createObject("game", "Component4"));
  12239. }
  12240. onConstruct() {
  12241. this.n44 = (this.getChild("n44"));
  12242. this.headImg = (this.getChild("headImg"));
  12243. }
  12244. }
  12245. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12246. class ui_Component7 extends fgui.GButton {
  12247. static createInstance() {
  12248. return (fgui.UIPackage.createObject("game", "Component7"));
  12249. }
  12250. onConstruct() {
  12251. this.n17 = (this.getChild("n17"));
  12252. }
  12253. }
  12254. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12255. class ui_Component8 extends fgui.GButton {
  12256. static createInstance() {
  12257. return (fgui.UIPackage.createObject("game", "Component8"));
  12258. }
  12259. onConstruct() {
  12260. this.n19 = (this.getChild("n19"));
  12261. }
  12262. }
  12263. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12264. class ui_Component9 extends fgui.GButton {
  12265. static createInstance() {
  12266. return (fgui.UIPackage.createObject("game", "Component9"));
  12267. }
  12268. onConstruct() {
  12269. this.n18 = (this.getChild("n18"));
  12270. }
  12271. }
  12272. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12273. class ui_Component10 extends fgui.GButton {
  12274. static createInstance() {
  12275. return (fgui.UIPackage.createObject("game", "Component10"));
  12276. }
  12277. onConstruct() {
  12278. this.c1 = this.getController("c1");
  12279. this.n40 = (this.getChild("n40"));
  12280. this.n41 = (this.getChild("n41"));
  12281. }
  12282. }
  12283. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12284. class ui_Component11 extends fgui.GButton {
  12285. static createInstance() {
  12286. return (fgui.UIPackage.createObject("game", "Component11"));
  12287. }
  12288. onConstruct() {
  12289. this.n34 = (this.getChild("n34"));
  12290. }
  12291. }
  12292. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12293. class ui_Component12 extends fgui.GButton {
  12294. static createInstance() {
  12295. return (fgui.UIPackage.createObject("game", "Component12"));
  12296. }
  12297. onConstruct() {
  12298. this.n35 = (this.getChild("n35"));
  12299. }
  12300. }
  12301. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12302. class ui_Component13 extends fgui.GButton {
  12303. static createInstance() {
  12304. return (fgui.UIPackage.createObject("game", "Component13"));
  12305. }
  12306. onConstruct() {
  12307. this.n27 = (this.getChild("n27"));
  12308. this.n36 = (this.getChild("n36"));
  12309. }
  12310. }
  12311. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12312. class ui_Component16 extends fgui.GButton {
  12313. static createInstance() {
  12314. return (fgui.UIPackage.createObject("game", "Component16"));
  12315. }
  12316. onConstruct() {
  12317. }
  12318. }
  12319. ui_Component16.URL = "ui://isxx5ak7ixm43xz";
  12320. class ui_dh_js_tuowei extends fgui.GComponent {
  12321. static createInstance() {
  12322. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12323. }
  12324. onConstruct() {
  12325. this.n19 = (this.getChild("n19"));
  12326. this.n18 = (this.getChild("n18"));
  12327. this.n0 = (this.getChild("n0"));
  12328. this.n3 = (this.getChild("n3"));
  12329. this.n4 = (this.getChild("n4"));
  12330. this.n5 = (this.getChild("n5"));
  12331. this.n6 = (this.getChild("n6"));
  12332. this.n8 = (this.getChild("n8"));
  12333. this.n9 = (this.getChild("n9"));
  12334. this.n10 = (this.getChild("n10"));
  12335. this.n11 = (this.getChild("n11"));
  12336. this.n12 = (this.getChild("n12"));
  12337. this.n13 = (this.getChild("n13"));
  12338. this.n14 = (this.getChild("n14"));
  12339. this.n15 = (this.getChild("n15"));
  12340. this.n20 = (this.getChild("n20"));
  12341. this.t0 = this.getTransition("t0");
  12342. this.t1 = this.getTransition("t1");
  12343. }
  12344. }
  12345. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12346. class ui_dh_js_tw_g extends fgui.GComponent {
  12347. static createInstance() {
  12348. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12349. }
  12350. onConstruct() {
  12351. this.n0 = (this.getChild("n0"));
  12352. this.n1 = (this.getChild("n1"));
  12353. this.t0 = this.getTransition("t0");
  12354. }
  12355. }
  12356. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12357. class ui_dh_js_xingxing extends fgui.GComponent {
  12358. static createInstance() {
  12359. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12360. }
  12361. onConstruct() {
  12362. this.n1 = (this.getChild("n1"));
  12363. this.n2 = (this.getChild("n2"));
  12364. this.n3 = (this.getChild("n3"));
  12365. this.n4 = (this.getChild("n4"));
  12366. this.n0 = (this.getChild("n0"));
  12367. this.t2 = this.getTransition("t2");
  12368. this.t1 = this.getTransition("t1");
  12369. }
  12370. }
  12371. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12372. class ui_dh_zy_jiazai extends fgui.GComponent {
  12373. static createInstance() {
  12374. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12375. }
  12376. onConstruct() {
  12377. this.c1 = this.getController("c1");
  12378. this.n0 = (this.getChild("n0"));
  12379. this.n1 = (this.getChild("n1"));
  12380. this.n2 = (this.getChild("n2"));
  12381. this.n4 = (this.getChild("n4"));
  12382. this.n5 = (this.getChild("n5"));
  12383. this.n6 = (this.getChild("n6"));
  12384. this.n8 = (this.getChild("n8"));
  12385. this.n7 = (this.getChild("n7"));
  12386. this.t0 = this.getTransition("t0");
  12387. }
  12388. }
  12389. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12390. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12391. static createInstance() {
  12392. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12393. }
  12394. onConstruct() {
  12395. this.c1 = this.getController("c1");
  12396. this.n3 = (this.getChild("n3"));
  12397. this.n5 = (this.getChild("n5"));
  12398. this.n4 = (this.getChild("n4"));
  12399. this.n0 = (this.getChild("n0"));
  12400. this.n1 = (this.getChild("n1"));
  12401. this.n2 = (this.getChild("n2"));
  12402. }
  12403. }
  12404. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12405. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12406. static createInstance() {
  12407. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12408. }
  12409. onConstruct() {
  12410. this.n19 = (this.getChild("n19"));
  12411. this.n21 = (this.getChild("n21"));
  12412. this.n0 = (this.getChild("n0"));
  12413. this.n3 = (this.getChild("n3"));
  12414. this.n4 = (this.getChild("n4"));
  12415. this.n5 = (this.getChild("n5"));
  12416. this.n6 = (this.getChild("n6"));
  12417. this.n8 = (this.getChild("n8"));
  12418. this.n9 = (this.getChild("n9"));
  12419. this.n10 = (this.getChild("n10"));
  12420. this.n11 = (this.getChild("n11"));
  12421. this.n12 = (this.getChild("n12"));
  12422. this.n13 = (this.getChild("n13"));
  12423. this.n14 = (this.getChild("n14"));
  12424. this.n15 = (this.getChild("n15"));
  12425. this.n23 = (this.getChild("n23"));
  12426. this.t0 = this.getTransition("t0");
  12427. this.t1 = this.getTransition("t1");
  12428. }
  12429. }
  12430. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12431. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12432. static createInstance() {
  12433. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12434. }
  12435. onConstruct() {
  12436. this.n1 = (this.getChild("n1"));
  12437. this.n2 = (this.getChild("n2"));
  12438. this.t0 = this.getTransition("t0");
  12439. }
  12440. }
  12441. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12442. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12443. static createInstance() {
  12444. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12445. }
  12446. onConstruct() {
  12447. this.n4 = (this.getChild("n4"));
  12448. this.n2 = (this.getChild("n2"));
  12449. this.n3 = (this.getChild("n3"));
  12450. this.idle = this.getTransition("idle");
  12451. this.attack = this.getTransition("attack");
  12452. }
  12453. }
  12454. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12455. class ui_special extends fgui.GComponent {
  12456. static createInstance() {
  12457. return (fgui.UIPackage.createObject("game", "special"));
  12458. }
  12459. onConstruct() {
  12460. this.n18 = (this.getChild("n18"));
  12461. this.n19 = (this.getChild("n19"));
  12462. this.n20 = (this.getChild("n20"));
  12463. this.n21 = (this.getChild("n21"));
  12464. this.n22 = (this.getChild("n22"));
  12465. this.levelTxt = (this.getChild("levelTxt"));
  12466. this.n24 = (this.getChild("n24"));
  12467. this.n25 = (this.getChild("n25"));
  12468. this.t0 = this.getTransition("t0");
  12469. }
  12470. }
  12471. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12472. class ui_Component145 extends fgui.GComponent {
  12473. static createInstance() {
  12474. return (fgui.UIPackage.createObject("game", "Component145"));
  12475. }
  12476. onConstruct() {
  12477. this.guanyuNode = (this.getChild("guanyuNode"));
  12478. }
  12479. }
  12480. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12481. class ui_longBtn extends fgui.GButton {
  12482. static createInstance() {
  12483. return (fgui.UIPackage.createObject("game", "longBtn"));
  12484. }
  12485. onConstruct() {
  12486. this.c1 = this.getController("c1");
  12487. this.n2 = (this.getChild("n2"));
  12488. this.n1 = (this.getChild("n1"));
  12489. this.n4 = (this.getChild("n4"));
  12490. }
  12491. }
  12492. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12493. class ui_Component146 extends fgui.GComponent {
  12494. static createInstance() {
  12495. return (fgui.UIPackage.createObject("game", "Component146"));
  12496. }
  12497. onConstruct() {
  12498. this.n89 = (this.getChild("n89"));
  12499. this.n90 = (this.getChild("n90"));
  12500. this.guideBtn = (this.getChild("guideBtn"));
  12501. }
  12502. }
  12503. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12504. class ui_Component146_11 extends fgui.GComponent {
  12505. static createInstance() {
  12506. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12507. }
  12508. onConstruct() {
  12509. this.n89 = (this.getChild("n89"));
  12510. this.n90 = (this.getChild("n90"));
  12511. this.guideBtn = (this.getChild("guideBtn"));
  12512. }
  12513. }
  12514. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12515. class ui_Component111_1 extends fgui.GComponent {
  12516. static createInstance() {
  12517. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12518. }
  12519. onConstruct() {
  12520. this.n68 = (this.getChild("n68"));
  12521. this.myMask = (this.getChild("myMask"));
  12522. }
  12523. }
  12524. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12525. class ui_Component64_1 extends fgui.GComponent {
  12526. static createInstance() {
  12527. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12528. }
  12529. onConstruct() {
  12530. this.n57 = (this.getChild("n57"));
  12531. this.n54 = (this.getChild("n54"));
  12532. this.n55 = (this.getChild("n55"));
  12533. this.n56 = (this.getChild("n56"));
  12534. this.t1 = this.getTransition("t1");
  12535. }
  12536. }
  12537. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12538. class ui_ModeSelection_com123 extends fgui.GComponent {
  12539. static createInstance() {
  12540. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12541. }
  12542. onConstruct() {
  12543. this.type1 = (this.getChild("type1"));
  12544. this.type2 = (this.getChild("type2"));
  12545. this.type3 = (this.getChild("type3"));
  12546. this.n38 = (this.getChild("n38"));
  12547. this.t0 = this.getTransition("t0");
  12548. }
  12549. }
  12550. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12551. class ui_Component132_2 extends fgui.GComponent {
  12552. static createInstance() {
  12553. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12554. }
  12555. onConstruct() {
  12556. this.n25 = (this.getChild("n25"));
  12557. this.n26 = (this.getChild("n26"));
  12558. this.n27 = (this.getChild("n27"));
  12559. this.t0 = this.getTransition("t0");
  12560. }
  12561. }
  12562. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12563. class ui_UIPower$1 extends fgui.GComponent {
  12564. static createInstance() {
  12565. return (fgui.UIPackage.createObject("game", "UIPower"));
  12566. }
  12567. onConstruct() {
  12568. this.n11 = (this.getChild("n11"));
  12569. this.myNode = (this.getChild("myNode"));
  12570. this.t0 = this.getTransition("t0");
  12571. }
  12572. }
  12573. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12574. class ui_Component133 extends fgui.GComponent {
  12575. static createInstance() {
  12576. return (fgui.UIPackage.createObject("game", "Component133"));
  12577. }
  12578. onConstruct() {
  12579. this.n29 = (this.getChild("n29"));
  12580. this.n30 = (this.getChild("n30"));
  12581. }
  12582. }
  12583. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12584. class ui_Component134 extends fgui.GComponent {
  12585. static createInstance() {
  12586. return (fgui.UIPackage.createObject("game", "Component134"));
  12587. }
  12588. onConstruct() {
  12589. this.n30 = (this.getChild("n30"));
  12590. this.n31 = (this.getChild("n31"));
  12591. this.t0 = this.getTransition("t0");
  12592. }
  12593. }
  12594. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12595. class ui_Component135 extends fgui.GComponent {
  12596. static createInstance() {
  12597. return (fgui.UIPackage.createObject("game", "Component135"));
  12598. }
  12599. onConstruct() {
  12600. this.n30 = (this.getChild("n30"));
  12601. this.t0 = this.getTransition("t0");
  12602. }
  12603. }
  12604. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12605. class ui_Component137 extends fgui.GComponent {
  12606. static createInstance() {
  12607. return (fgui.UIPackage.createObject("game", "Component137"));
  12608. }
  12609. onConstruct() {
  12610. this.n28 = (this.getChild("n28"));
  12611. this.n29 = (this.getChild("n29"));
  12612. this.n30 = (this.getChild("n30"));
  12613. this.n32 = (this.getChild("n32"));
  12614. }
  12615. }
  12616. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12617. class ui_dh_zuanshi extends fgui.GButton {
  12618. static createInstance() {
  12619. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12620. }
  12621. onConstruct() {
  12622. this.n1 = (this.getChild("n1"));
  12623. this.n2 = (this.getChild("n2"));
  12624. this.n0 = (this.getChild("n0"));
  12625. this.n3 = (this.getChild("n3"));
  12626. this.n4 = (this.getChild("n4"));
  12627. }
  12628. }
  12629. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12630. class ui_Component138 extends fgui.GComponent {
  12631. static createInstance() {
  12632. return (fgui.UIPackage.createObject("game", "Component138"));
  12633. }
  12634. onConstruct() {
  12635. this.n1 = (this.getChild("n1"));
  12636. this.n2 = (this.getChild("n2"));
  12637. this.t0 = this.getTransition("t0");
  12638. }
  12639. }
  12640. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12641. class ui_Component139 extends fgui.GComponent {
  12642. static createInstance() {
  12643. return (fgui.UIPackage.createObject("game", "Component139"));
  12644. }
  12645. onConstruct() {
  12646. this.n0 = (this.getChild("n0"));
  12647. this.t0 = this.getTransition("t0");
  12648. }
  12649. }
  12650. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12651. class ui_Component140 extends fgui.GComponent {
  12652. static createInstance() {
  12653. return (fgui.UIPackage.createObject("game", "Component140"));
  12654. }
  12655. onConstruct() {
  12656. this.n2 = (this.getChild("n2"));
  12657. this.n3 = (this.getChild("n3"));
  12658. this.t0 = this.getTransition("t0");
  12659. }
  12660. }
  12661. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12662. class ui_Component141 extends fgui.GComponent {
  12663. static createInstance() {
  12664. return (fgui.UIPackage.createObject("game", "Component141"));
  12665. }
  12666. onConstruct() {
  12667. this.n0 = (this.getChild("n0"));
  12668. this.t0 = this.getTransition("t0");
  12669. }
  12670. }
  12671. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12672. class ui_powerNode extends fgui.GProgressBar {
  12673. static createInstance() {
  12674. return (fgui.UIPackage.createObject("game", "powerNode"));
  12675. }
  12676. onConstruct() {
  12677. this.n2 = (this.getChild("n2"));
  12678. this.bar_v = (this.getChild("bar_v"));
  12679. this.showImg = (this.getChild("showImg"));
  12680. this.n12 = (this.getChild("n12"));
  12681. }
  12682. }
  12683. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12684. class ui_dh_jingbi1 extends fgui.GComponent {
  12685. static createInstance() {
  12686. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12687. }
  12688. onConstruct() {
  12689. this.n0 = (this.getChild("n0"));
  12690. this.n1 = (this.getChild("n1"));
  12691. this.n2 = (this.getChild("n2"));
  12692. this.n3 = (this.getChild("n3"));
  12693. this.n4 = (this.getChild("n4"));
  12694. this.n5 = (this.getChild("n5"));
  12695. this.n6 = (this.getChild("n6"));
  12696. this.n8 = (this.getChild("n8"));
  12697. this.t0 = this.getTransition("t0");
  12698. }
  12699. }
  12700. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12701. class ui_Component94 extends fgui.GButton {
  12702. static createInstance() {
  12703. return (fgui.UIPackage.createObject("game", "Component94"));
  12704. }
  12705. onConstruct() {
  12706. this.n77 = (this.getChild("n77"));
  12707. }
  12708. }
  12709. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12710. class ui_Component95 extends fgui.GButton {
  12711. static createInstance() {
  12712. return (fgui.UIPackage.createObject("game", "Component95"));
  12713. }
  12714. onConstruct() {
  12715. this.n77 = (this.getChild("n77"));
  12716. }
  12717. }
  12718. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12719. class ui_Component126 extends fgui.GComponent {
  12720. static createInstance() {
  12721. return (fgui.UIPackage.createObject("game", "Component126"));
  12722. }
  12723. onConstruct() {
  12724. this.c1 = this.getController("c1");
  12725. this.normalBtn = (this.getChild("normalBtn"));
  12726. this.tripleBtn = (this.getChild("tripleBtn"));
  12727. }
  12728. }
  12729. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12730. class ui_Component60 extends fgui.GComponent {
  12731. static createInstance() {
  12732. return (fgui.UIPackage.createObject("game", "Component60"));
  12733. }
  12734. onConstruct() {
  12735. this.c1 = this.getController("c1");
  12736. this.n48 = (this.getChild("n48"));
  12737. this.womanTxt = (this.getChild("womanTxt"));
  12738. this.t0 = this.getTransition("t0");
  12739. }
  12740. }
  12741. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12742. class ui_Component98_3 extends fgui.GButton {
  12743. static createInstance() {
  12744. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12745. }
  12746. onConstruct() {
  12747. this.c1 = this.getController("c1");
  12748. this.n8 = (this.getChild("n8"));
  12749. this.n41 = (this.getChild("n41"));
  12750. this.n40 = (this.getChild("n40"));
  12751. }
  12752. }
  12753. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12754. class ui_ModeSelection_com1 extends fgui.GButton {
  12755. static createInstance() {
  12756. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12757. }
  12758. onConstruct() {
  12759. this.n34 = (this.getChild("n34"));
  12760. this.n36 = (this.getChild("n36"));
  12761. this.n22 = (this.getChild("n22"));
  12762. this.n20 = (this.getChild("n20"));
  12763. this.n23 = (this.getChild("n23"));
  12764. this.n24 = (this.getChild("n24"));
  12765. this.n26 = (this.getChild("n26"));
  12766. this.n33 = (this.getChild("n33"));
  12767. this.coinImg = (this.getChild("coinImg"));
  12768. this.need = (this.getChild("need"));
  12769. this.n35 = (this.getChild("n35"));
  12770. this.n29 = (this.getChild("n29"));
  12771. this.tipsTxt = (this.getChild("tipsTxt"));
  12772. this.n30 = (this.getChild("n30"));
  12773. this.peopleTxt = (this.getChild("peopleTxt"));
  12774. this.t0 = this.getTransition("t0");
  12775. }
  12776. }
  12777. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12778. class ui_ModeSelection_com2 extends fgui.GButton {
  12779. static createInstance() {
  12780. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12781. }
  12782. onConstruct() {
  12783. this.n36 = (this.getChild("n36"));
  12784. this.n34 = (this.getChild("n34"));
  12785. this.n22 = (this.getChild("n22"));
  12786. this.n20 = (this.getChild("n20"));
  12787. this.n23 = (this.getChild("n23"));
  12788. this.n24 = (this.getChild("n24"));
  12789. this.n26 = (this.getChild("n26"));
  12790. this.n33 = (this.getChild("n33"));
  12791. this.coinImg = (this.getChild("coinImg"));
  12792. this.need = (this.getChild("need"));
  12793. this.n35 = (this.getChild("n35"));
  12794. this.n29 = (this.getChild("n29"));
  12795. this.tipsTxt = (this.getChild("tipsTxt"));
  12796. this.n30 = (this.getChild("n30"));
  12797. this.peopleTxt = (this.getChild("peopleTxt"));
  12798. this.t0 = this.getTransition("t0");
  12799. }
  12800. }
  12801. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12802. class ui_ModeSelection_com3 extends fgui.GButton {
  12803. static createInstance() {
  12804. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12805. }
  12806. onConstruct() {
  12807. this.n34 = (this.getChild("n34"));
  12808. this.n36 = (this.getChild("n36"));
  12809. this.n22 = (this.getChild("n22"));
  12810. this.n20 = (this.getChild("n20"));
  12811. this.n23 = (this.getChild("n23"));
  12812. this.n24 = (this.getChild("n24"));
  12813. this.n26 = (this.getChild("n26"));
  12814. this.n33 = (this.getChild("n33"));
  12815. this.coinImg = (this.getChild("coinImg"));
  12816. this.need = (this.getChild("need"));
  12817. this.n35 = (this.getChild("n35"));
  12818. this.n29 = (this.getChild("n29"));
  12819. this.tipsTxt = (this.getChild("tipsTxt"));
  12820. this.n30 = (this.getChild("n30"));
  12821. this.peopleTxt = (this.getChild("peopleTxt"));
  12822. this.t0 = this.getTransition("t0");
  12823. }
  12824. }
  12825. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12826. class ui_Invitation_com1 extends fgui.GComponent {
  12827. static createInstance() {
  12828. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12829. }
  12830. onConstruct() {
  12831. this.n14 = (this.getChild("n14"));
  12832. this.n13 = (this.getChild("n13"));
  12833. this.n3 = (this.getChild("n3"));
  12834. this.n1 = (this.getChild("n1"));
  12835. this.n6 = (this.getChild("n6"));
  12836. this.n7 = (this.getChild("n7"));
  12837. this.enterBtn = (this.getChild("enterBtn"));
  12838. this.n11 = (this.getChild("n11"));
  12839. this.n12 = (this.getChild("n12"));
  12840. this.n15 = (this.getChild("n15"));
  12841. this.t0 = this.getTransition("t0");
  12842. this.t1 = this.getTransition("t1");
  12843. }
  12844. }
  12845. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12846. class ui_Component87_1 extends fgui.GComponent {
  12847. static createInstance() {
  12848. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12849. }
  12850. onConstruct() {
  12851. this.n74 = (this.getChild("n74"));
  12852. this.n73 = (this.getChild("n73"));
  12853. this.ballTxt = (this.getChild("ballTxt"));
  12854. this.n76 = (this.getChild("n76"));
  12855. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12856. this.levelTxt = (this.getChild("levelTxt"));
  12857. this.n87 = (this.getChild("n87"));
  12858. this.n84 = (this.getChild("n84"));
  12859. this.hpTxt = (this.getChild("hpTxt"));
  12860. this.n89 = (this.getChild("n89"));
  12861. this.tipsTxt = (this.getChild("tipsTxt"));
  12862. }
  12863. }
  12864. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12865. class ui_sqg1 extends fgui.GComponent {
  12866. static createInstance() {
  12867. return (fgui.UIPackage.createObject("game", "sqg1"));
  12868. }
  12869. onConstruct() {
  12870. this.n1 = (this.getChild("n1"));
  12871. this.n0 = (this.getChild("n0"));
  12872. }
  12873. }
  12874. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12875. class ui_sqg2 extends fgui.GComponent {
  12876. static createInstance() {
  12877. return (fgui.UIPackage.createObject("game", "sqg2"));
  12878. }
  12879. onConstruct() {
  12880. this.n1 = (this.getChild("n1"));
  12881. this.n0 = (this.getChild("n0"));
  12882. }
  12883. }
  12884. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12885. class ui_sqg3 extends fgui.GComponent {
  12886. static createInstance() {
  12887. return (fgui.UIPackage.createObject("game", "sqg3"));
  12888. }
  12889. onConstruct() {
  12890. this.n1 = (this.getChild("n1"));
  12891. this.n0 = (this.getChild("n0"));
  12892. }
  12893. }
  12894. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12895. class ui_sqg4 extends fgui.GComponent {
  12896. static createInstance() {
  12897. return (fgui.UIPackage.createObject("game", "sqg4"));
  12898. }
  12899. onConstruct() {
  12900. this.n1 = (this.getChild("n1"));
  12901. this.n0 = (this.getChild("n0"));
  12902. }
  12903. }
  12904. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12905. class ui_Component36 extends fgui.GButton {
  12906. static createInstance() {
  12907. return (fgui.UIPackage.createObject("game", "Component36"));
  12908. }
  12909. onConstruct() {
  12910. this.c1 = this.getController("c1");
  12911. this.n53 = (this.getChild("n53"));
  12912. this.n56 = (this.getChild("n56"));
  12913. }
  12914. }
  12915. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12916. class ui_Component37 extends fgui.GButton {
  12917. static createInstance() {
  12918. return (fgui.UIPackage.createObject("game", "Component37"));
  12919. }
  12920. onConstruct() {
  12921. this.c1 = this.getController("c1");
  12922. this.n52 = (this.getChild("n52"));
  12923. this.n54 = (this.getChild("n54"));
  12924. }
  12925. }
  12926. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12927. class ui_UISetting extends fgui.GComponent {
  12928. static createInstance() {
  12929. return (fgui.UIPackage.createObject("game", "UISetting"));
  12930. }
  12931. onConstruct() {
  12932. this.c1 = this.getController("c1");
  12933. this.n4 = (this.getChild("n4"));
  12934. this.soundBtn = (this.getChild("soundBtn"));
  12935. this.shakeBtn = (this.getChild("shakeBtn"));
  12936. this.clickNode = (this.getChild("clickNode"));
  12937. this.xyBtn = (this.getChild("xyBtn"));
  12938. }
  12939. }
  12940. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12941. class ui_Component39 extends fgui.GComponent {
  12942. static createInstance() {
  12943. return (fgui.UIPackage.createObject("game", "Component39"));
  12944. }
  12945. onConstruct() {
  12946. this.n5 = (this.getChild("n5"));
  12947. this.n6 = (this.getChild("n6"));
  12948. this.n7 = (this.getChild("n7"));
  12949. this.t0 = this.getTransition("t0");
  12950. }
  12951. }
  12952. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12953. class ui_Component40 extends fgui.GButton {
  12954. static createInstance() {
  12955. return (fgui.UIPackage.createObject("game", "Component40"));
  12956. }
  12957. onConstruct() {
  12958. this.n46 = (this.getChild("n46"));
  12959. this.n47 = (this.getChild("n47"));
  12960. }
  12961. }
  12962. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  12963. class ui_Component41 extends fgui.GComponent {
  12964. static createInstance() {
  12965. return (fgui.UIPackage.createObject("game", "Component41"));
  12966. }
  12967. onConstruct() {
  12968. this.c1 = this.getController("c1");
  12969. this.n0 = (this.getChild("n0"));
  12970. this.titleTxt = (this.getChild("titleTxt"));
  12971. this.n2 = (this.getChild("n2"));
  12972. this.msgTips = (this.getChild("msgTips"));
  12973. this.numTxt = (this.getChild("numTxt"));
  12974. this.n18 = (this.getChild("n18"));
  12975. this.cancelBtn = (this.getChild("cancelBtn"));
  12976. this.videoBtn = (this.getChild("videoBtn"));
  12977. this.n10 = (this.getChild("n10"));
  12978. }
  12979. }
  12980. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  12981. class ui_Component42 extends fgui.GComponent {
  12982. static createInstance() {
  12983. return (fgui.UIPackage.createObject("game", "Component42"));
  12984. }
  12985. onConstruct() {
  12986. this.c1 = this.getController("c1");
  12987. this.n1 = (this.getChild("n1"));
  12988. this.n2 = (this.getChild("n2"));
  12989. this.n3 = (this.getChild("n3"));
  12990. this.tipsTxt = (this.getChild("tipsTxt"));
  12991. this.cancelBtn = (this.getChild("cancelBtn"));
  12992. this.sureBtn = (this.getChild("sureBtn"));
  12993. this.n11 = (this.getChild("n11"));
  12994. this.n13 = (this.getChild("n13"));
  12995. this.n14 = (this.getChild("n14"));
  12996. this.womanTxt = (this.getChild("womanTxt"));
  12997. this.t0 = this.getTransition("t0");
  12998. }
  12999. }
  13000. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13001. class ui_dh_js_shengli extends fgui.GComponent {
  13002. static createInstance() {
  13003. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13004. }
  13005. onConstruct() {
  13006. this.n3 = (this.getChild("n3"));
  13007. this.n4 = (this.getChild("n4"));
  13008. this.n1 = (this.getChild("n1"));
  13009. this.n2 = (this.getChild("n2"));
  13010. this.n5 = (this.getChild("n5"));
  13011. this.n6 = (this.getChild("n6"));
  13012. this.n7 = (this.getChild("n7"));
  13013. this.n8 = (this.getChild("n8"));
  13014. this.attack = this.getTransition("attack");
  13015. this.idle = this.getTransition("idle");
  13016. }
  13017. }
  13018. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13019. class ui_dh_js_shengli_g extends fgui.GComponent {
  13020. static createInstance() {
  13021. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13022. }
  13023. onConstruct() {
  13024. this.n3 = (this.getChild("n3"));
  13025. this.n1 = (this.getChild("n1"));
  13026. this.t0 = this.getTransition("t0");
  13027. }
  13028. }
  13029. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13030. class ui_dh_js_shibai extends fgui.GComponent {
  13031. static createInstance() {
  13032. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13033. }
  13034. onConstruct() {
  13035. this.n0 = (this.getChild("n0"));
  13036. this.n1 = (this.getChild("n1"));
  13037. this.n2 = (this.getChild("n2"));
  13038. this.n3 = (this.getChild("n3"));
  13039. this.idle = this.getTransition("idle");
  13040. this.attack = this.getTransition("attack");
  13041. }
  13042. }
  13043. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13044. class ui_dh_zy_ganfa extends fgui.GButton {
  13045. static createInstance() {
  13046. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13047. }
  13048. onConstruct() {
  13049. this.n0 = (this.getChild("n0"));
  13050. }
  13051. }
  13052. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13053. class ui_dh_zy_sc_guang extends fgui.GButton {
  13054. static createInstance() {
  13055. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13056. }
  13057. onConstruct() {
  13058. this.n0 = (this.getChild("n0"));
  13059. this.n2 = (this.getChild("n2"));
  13060. }
  13061. }
  13062. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13063. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13064. static createInstance() {
  13065. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13066. }
  13067. onConstruct() {
  13068. this.n0 = (this.getChild("n0"));
  13069. this.n3 = (this.getChild("n3"));
  13070. this.t0 = this.getTransition("t0");
  13071. }
  13072. }
  13073. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13074. class ui_dh_zy_wanfa extends fgui.GButton {
  13075. static createInstance() {
  13076. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13077. }
  13078. onConstruct() {
  13079. this.n0 = (this.getChild("n0"));
  13080. }
  13081. }
  13082. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13083. class ui_Component53_1 extends fgui.GComponent {
  13084. static createInstance() {
  13085. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13086. }
  13087. onConstruct() {
  13088. this.n0 = (this.getChild("n0"));
  13089. this.n1 = (this.getChild("n1"));
  13090. this.n2 = (this.getChild("n2"));
  13091. this.n3 = (this.getChild("n3"));
  13092. this.n4 = (this.getChild("n4"));
  13093. this.n5 = (this.getChild("n5"));
  13094. this.n6 = (this.getChild("n6"));
  13095. this.n7 = (this.getChild("n7"));
  13096. this.n8 = (this.getChild("n8"));
  13097. this.n9 = (this.getChild("n9"));
  13098. this.n10 = (this.getChild("n10"));
  13099. this.n11 = (this.getChild("n11"));
  13100. this.n12 = (this.getChild("n12"));
  13101. this.n13 = (this.getChild("n13"));
  13102. this.n14 = (this.getChild("n14"));
  13103. this.n15 = (this.getChild("n15"));
  13104. this.n16 = (this.getChild("n16"));
  13105. this.n19 = (this.getChild("n19"));
  13106. this.n20 = (this.getChild("n20"));
  13107. this.n21 = (this.getChild("n21"));
  13108. this.n22 = (this.getChild("n22"));
  13109. this.n23 = (this.getChild("n23"));
  13110. this.n24 = (this.getChild("n24"));
  13111. this.n25 = (this.getChild("n25"));
  13112. this.n26 = (this.getChild("n26"));
  13113. this.n27 = (this.getChild("n27"));
  13114. this.n28 = (this.getChild("n28"));
  13115. this.n29 = (this.getChild("n29"));
  13116. this.n30 = (this.getChild("n30"));
  13117. this.n31 = (this.getChild("n31"));
  13118. this.n32 = (this.getChild("n32"));
  13119. this.n33 = (this.getChild("n33"));
  13120. this.n34 = (this.getChild("n34"));
  13121. this.n35 = (this.getChild("n35"));
  13122. this.t0 = this.getTransition("t0");
  13123. }
  13124. }
  13125. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13126. class ui_Component30 extends fgui.GComponent {
  13127. static createInstance() {
  13128. return (fgui.UIPackage.createObject("game", "Component30"));
  13129. }
  13130. onConstruct() {
  13131. this.c1 = this.getController("c1");
  13132. this.n46 = (this.getChild("n46"));
  13133. this.n47 = (this.getChild("n47"));
  13134. this.numTxt = (this.getChild("numTxt"));
  13135. this.n50 = (this.getChild("n50"));
  13136. this.n53 = (this.getChild("n53"));
  13137. this.n54 = (this.getChild("n54"));
  13138. this.n55 = (this.getChild("n55"));
  13139. this.n56 = (this.getChild("n56"));
  13140. }
  13141. }
  13142. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13143. class ui_Component30_1 extends fgui.GComponent {
  13144. static createInstance() {
  13145. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13146. }
  13147. onConstruct() {
  13148. this.c1 = this.getController("c1");
  13149. this.n46 = (this.getChild("n46"));
  13150. this.n47 = (this.getChild("n47"));
  13151. this.numTxt = (this.getChild("numTxt"));
  13152. this.n50 = (this.getChild("n50"));
  13153. this.n51 = (this.getChild("n51"));
  13154. this.n52 = (this.getChild("n52"));
  13155. this.n53 = (this.getChild("n53"));
  13156. this.n54 = (this.getChild("n54"));
  13157. }
  13158. }
  13159. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13160. class ui_Component31 extends fgui.GComponent {
  13161. static createInstance() {
  13162. return (fgui.UIPackage.createObject("game", "Component31"));
  13163. }
  13164. onConstruct() {
  13165. this.n55 = (this.getChild("n55"));
  13166. this.n54 = (this.getChild("n54"));
  13167. this.conditionTxt = (this.getChild("conditionTxt"));
  13168. this.n57 = (this.getChild("n57"));
  13169. this.t0 = this.getTransition("t0");
  13170. }
  13171. }
  13172. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13173. class ui_Component32 extends fgui.GComponent {
  13174. static createInstance() {
  13175. return (fgui.UIPackage.createObject("game", "Component32"));
  13176. }
  13177. onConstruct() {
  13178. this.n5 = (this.getChild("n5"));
  13179. this.n6 = (this.getChild("n6"));
  13180. this.n7 = (this.getChild("n7"));
  13181. this.t0 = this.getTransition("t0");
  13182. }
  13183. }
  13184. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13185. class ui_AwardItem extends fgui.GComponent {
  13186. static createInstance() {
  13187. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13188. }
  13189. onConstruct() {
  13190. this.n9 = (this.getChild("n9"));
  13191. this.myIcon = (this.getChild("myIcon"));
  13192. this.numTxt = (this.getChild("numTxt"));
  13193. this.nameTxt = (this.getChild("nameTxt"));
  13194. this.n16 = (this.getChild("n16"));
  13195. this.n17 = (this.getChild("n17"));
  13196. }
  13197. }
  13198. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13199. class ui_ranking_com1 extends fgui.GButton {
  13200. static createInstance() {
  13201. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13202. }
  13203. onConstruct() {
  13204. this.c1 = this.getController("c1");
  13205. this.n49 = (this.getChild("n49"));
  13206. this.n18 = (this.getChild("n18"));
  13207. this.n46 = (this.getChild("n46"));
  13208. this.n48 = (this.getChild("n48"));
  13209. this.n50 = (this.getChild("n50"));
  13210. }
  13211. }
  13212. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13213. class ui_ranking_com2 extends fgui.GButton {
  13214. static createInstance() {
  13215. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13216. }
  13217. onConstruct() {
  13218. this.c1 = this.getController("c1");
  13219. this.n49 = (this.getChild("n49"));
  13220. this.n18 = (this.getChild("n18"));
  13221. this.n46 = (this.getChild("n46"));
  13222. this.n48 = (this.getChild("n48"));
  13223. this.n50 = (this.getChild("n50"));
  13224. }
  13225. }
  13226. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13227. class ui_ranking_com3 extends fgui.GComponent {
  13228. static createInstance() {
  13229. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13230. }
  13231. onConstruct() {
  13232. this.n17 = (this.getChild("n17"));
  13233. this.myIcon = (this.getChild("myIcon"));
  13234. }
  13235. }
  13236. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13237. class ui_ranking_com4 extends fgui.GComponent {
  13238. static createInstance() {
  13239. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13240. }
  13241. onConstruct() {
  13242. this.n16 = (this.getChild("n16"));
  13243. this.head = (this.getChild("head"));
  13244. }
  13245. }
  13246. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13247. class ui_ranking_com5 extends fgui.GComponent {
  13248. static createInstance() {
  13249. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13250. }
  13251. onConstruct() {
  13252. this.c1 = this.getController("c1");
  13253. this.c2 = this.getController("c2");
  13254. this.n2 = (this.getChild("n2"));
  13255. this.n3 = (this.getChild("n3"));
  13256. this.levelBtn = (this.getChild("levelBtn"));
  13257. this.starBtn = (this.getChild("starBtn"));
  13258. this.n23 = (this.getChild("n23"));
  13259. this.n24 = (this.getChild("n24"));
  13260. this.n25 = (this.getChild("n25"));
  13261. this.myList = (this.getChild("myList"));
  13262. this.selfNode = (this.getChild("selfNode"));
  13263. this.n9 = (this.getChild("n9"));
  13264. this.n12 = (this.getChild("n12"));
  13265. this.n13 = (this.getChild("n13"));
  13266. this.n14 = (this.getChild("n14"));
  13267. this.n39 = (this.getChild("n39"));
  13268. this.n41 = (this.getChild("n41"));
  13269. this.n42 = (this.getChild("n42"));
  13270. this.n45 = (this.getChild("n45"));
  13271. this.changeBtn = (this.getChild("changeBtn"));
  13272. this.closeBtn = (this.getChild("closeBtn"));
  13273. this.t0 = this.getTransition("t0");
  13274. }
  13275. }
  13276. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13277. class ui_RankItem extends fgui.GComponent {
  13278. static createInstance() {
  13279. return (fgui.UIPackage.createObject("game", "RankItem"));
  13280. }
  13281. onConstruct() {
  13282. this.n10 = (this.getChild("n10"));
  13283. this.n11 = (this.getChild("n11"));
  13284. this.rankTxt = (this.getChild("rankTxt"));
  13285. this.headNode = (this.getChild("headNode"));
  13286. this.nameTxt = (this.getChild("nameTxt"));
  13287. this.n19 = (this.getChild("n19"));
  13288. this.valueTxt = (this.getChild("valueTxt"));
  13289. this.img1 = (this.getChild("img1"));
  13290. this.img2 = (this.getChild("img2"));
  13291. this.img3 = (this.getChild("img3"));
  13292. }
  13293. }
  13294. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13295. class ui_ranking_com9 extends fgui.GComponent {
  13296. static createInstance() {
  13297. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13298. }
  13299. onConstruct() {
  13300. this.c1 = this.getController("c1");
  13301. this.n27 = (this.getChild("n27"));
  13302. this.n28 = (this.getChild("n28"));
  13303. this.headNode = (this.getChild("headNode"));
  13304. this.rankTxt = (this.getChild("rankTxt"));
  13305. this.nameTxt = (this.getChild("nameTxt"));
  13306. this.n34 = (this.getChild("n34"));
  13307. this.valueTxt = (this.getChild("valueTxt"));
  13308. this.n36 = (this.getChild("n36"));
  13309. this.n37 = (this.getChild("n37"));
  13310. this.n38 = (this.getChild("n38"));
  13311. this.n39 = (this.getChild("n39"));
  13312. this.n40 = (this.getChild("n40"));
  13313. }
  13314. }
  13315. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13316. class ui_ranking_com10 extends fgui.GComponent {
  13317. static createInstance() {
  13318. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13319. }
  13320. onConstruct() {
  13321. this.n23 = (this.getChild("n23"));
  13322. this.n24 = (this.getChild("n24"));
  13323. }
  13324. }
  13325. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13326. class ui_ranking_com11 extends fgui.GComponent {
  13327. static createInstance() {
  13328. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13329. }
  13330. onConstruct() {
  13331. this.n24 = (this.getChild("n24"));
  13332. this.n25 = (this.getChild("n25"));
  13333. this.t0 = this.getTransition("t0");
  13334. }
  13335. }
  13336. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13337. class ui_ranking_com13 extends fgui.GButton {
  13338. static createInstance() {
  13339. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13340. }
  13341. onConstruct() {
  13342. this.c1 = this.getController("c1");
  13343. this.n44 = (this.getChild("n44"));
  13344. this.n45 = (this.getChild("n45"));
  13345. this.n46 = (this.getChild("n46"));
  13346. }
  13347. }
  13348. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13349. class ui_Component122 extends fgui.GComponent {
  13350. static createInstance() {
  13351. return (fgui.UIPackage.createObject("game", "Component122"));
  13352. }
  13353. onConstruct() {
  13354. this.gameNode1 = (this.getChild("gameNode1"));
  13355. this.gameNode2 = (this.getChild("gameNode2"));
  13356. this.gameNode3 = (this.getChild("gameNode3"));
  13357. }
  13358. }
  13359. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13360. class ui_skillItem extends fgui.GComponent {
  13361. static createInstance() {
  13362. return (fgui.UIPackage.createObject("game", "skillItem"));
  13363. }
  13364. onConstruct() {
  13365. this.c1 = this.getController("c1");
  13366. this.n31 = (this.getChild("n31"));
  13367. this.n6 = (this.getChild("n6"));
  13368. this.skillImg = (this.getChild("skillImg"));
  13369. this.nameTxt = (this.getChild("nameTxt"));
  13370. this.levelTxt = (this.getChild("levelTxt"));
  13371. this.n28 = (this.getChild("n28"));
  13372. this.describeTxt = (this.getChild("describeTxt"));
  13373. this.n32 = (this.getChild("n32"));
  13374. this.mutiBtn = (this.getChild("mutiBtn"));
  13375. this.tryNode = (this.getChild("tryNode"));
  13376. this.normalBtn = (this.getChild("normalBtn"));
  13377. this.startBtn = (this.getChild("startBtn"));
  13378. this.n42 = (this.getChild("n42"));
  13379. this.n43 = (this.getChild("n43"));
  13380. this.n44 = (this.getChild("n44"));
  13381. }
  13382. }
  13383. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13384. class ui_Component26 extends fgui.GButton {
  13385. static createInstance() {
  13386. return (fgui.UIPackage.createObject("game", "Component26"));
  13387. }
  13388. onConstruct() {
  13389. this.n11 = (this.getChild("n11"));
  13390. this.n30 = (this.getChild("n30"));
  13391. this.n34 = (this.getChild("n34"));
  13392. }
  13393. }
  13394. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13395. class ui_Component28 extends fgui.GButton {
  13396. static createInstance() {
  13397. return (fgui.UIPackage.createObject("game", "Component28"));
  13398. }
  13399. onConstruct() {
  13400. this.n12 = (this.getChild("n12"));
  13401. this.n31 = (this.getChild("n31"));
  13402. this.curTxt = (this.getChild("curTxt"));
  13403. this.n33 = (this.getChild("n33"));
  13404. }
  13405. }
  13406. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13407. class ui_Component113 extends fgui.GComponent {
  13408. static createInstance() {
  13409. return (fgui.UIPackage.createObject("game", "Component113"));
  13410. }
  13411. onConstruct() {
  13412. this.n85 = (this.getChild("n85"));
  13413. this.n86 = (this.getChild("n86"));
  13414. this.n77 = (this.getChild("n77"));
  13415. this.n79 = (this.getChild("n79"));
  13416. this.n80 = (this.getChild("n80"));
  13417. this.n81 = (this.getChild("n81"));
  13418. this.n82 = (this.getChild("n82"));
  13419. this.n84 = (this.getChild("n84"));
  13420. this.n87 = (this.getChild("n87"));
  13421. this.t0 = this.getTransition("t0");
  13422. }
  13423. }
  13424. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13425. class ui_Component114 extends fgui.GComponent {
  13426. static createInstance() {
  13427. return (fgui.UIPackage.createObject("game", "Component114"));
  13428. }
  13429. onConstruct() {
  13430. this.n77 = (this.getChild("n77"));
  13431. this.t0 = this.getTransition("t0");
  13432. }
  13433. }
  13434. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13435. class ui_Component115 extends fgui.GComponent {
  13436. static createInstance() {
  13437. return (fgui.UIPackage.createObject("game", "Component115"));
  13438. }
  13439. onConstruct() {
  13440. this.n83 = (this.getChild("n83"));
  13441. this.fingerNode = (this.getChild("fingerNode"));
  13442. this.n84 = (this.getChild("n84"));
  13443. }
  13444. }
  13445. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13446. class ui_Component117 extends fgui.GComponent {
  13447. static createInstance() {
  13448. return (fgui.UIPackage.createObject("game", "Component117"));
  13449. }
  13450. onConstruct() {
  13451. this.n87 = (this.getChild("n87"));
  13452. this.n88 = (this.getChild("n88"));
  13453. this.n84 = (this.getChild("n84"));
  13454. this.n85 = (this.getChild("n85"));
  13455. this.n86 = (this.getChild("n86"));
  13456. this.t0 = this.getTransition("t0");
  13457. }
  13458. }
  13459. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13460. class ui_Component98_1 extends fgui.GButton {
  13461. static createInstance() {
  13462. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13463. }
  13464. onConstruct() {
  13465. this.c1 = this.getController("c1");
  13466. this.n8 = (this.getChild("n8"));
  13467. this.n41 = (this.getChild("n41"));
  13468. this.n40 = (this.getChild("n40"));
  13469. }
  13470. }
  13471. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13472. class ui_Component61 extends fgui.GComponent {
  13473. static createInstance() {
  13474. return (fgui.UIPackage.createObject("game", "Component61"));
  13475. }
  13476. onConstruct() {
  13477. this.n14 = (this.getChild("n14"));
  13478. this.n6 = (this.getChild("n6"));
  13479. this.t0 = this.getTransition("t0");
  13480. }
  13481. }
  13482. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13483. class ui_Component62 extends fgui.GComponent {
  13484. static createInstance() {
  13485. return (fgui.UIPackage.createObject("game", "Component62"));
  13486. }
  13487. onConstruct() {
  13488. this.n66 = (this.getChild("n66"));
  13489. this.n56 = (this.getChild("n56"));
  13490. this.n63 = (this.getChild("n63"));
  13491. this.n65 = (this.getChild("n65"));
  13492. this.t0 = this.getTransition("t0");
  13493. }
  13494. }
  13495. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13496. class ui_d3Root extends fgui.GComponent {
  13497. static createInstance() {
  13498. return (fgui.UIPackage.createObject("game", "d3Root"));
  13499. }
  13500. onConstruct() {
  13501. }
  13502. }
  13503. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13504. class ui_d2Root extends fgui.GComponent {
  13505. static createInstance() {
  13506. return (fgui.UIPackage.createObject("game", "d2Root"));
  13507. }
  13508. onConstruct() {
  13509. }
  13510. }
  13511. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13512. class ui_ballNode extends fgui.GComponent {
  13513. static createInstance() {
  13514. return (fgui.UIPackage.createObject("game", "ballNode"));
  13515. }
  13516. onConstruct() {
  13517. }
  13518. }
  13519. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13520. class ui_border extends fgui.GComponent {
  13521. static createInstance() {
  13522. return (fgui.UIPackage.createObject("game", "border"));
  13523. }
  13524. onConstruct() {
  13525. this.bar1 = (this.getChild("bar1"));
  13526. this.bar2 = (this.getChild("bar2"));
  13527. this.bar3 = (this.getChild("bar3"));
  13528. this.bar4 = (this.getChild("bar4"));
  13529. this.bar5 = (this.getChild("bar5"));
  13530. this.bar6 = (this.getChild("bar6"));
  13531. this.circle1 = (this.getChild("circle1"));
  13532. this.circle2 = (this.getChild("circle2"));
  13533. this.circle3 = (this.getChild("circle3"));
  13534. this.circle4 = (this.getChild("circle4"));
  13535. this.circle5 = (this.getChild("circle5"));
  13536. this.circle6 = (this.getChild("circle6"));
  13537. this.n28 = (this.getChild("n28"));
  13538. }
  13539. }
  13540. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13541. class ui_Component41_2 extends fgui.GComponent {
  13542. static createInstance() {
  13543. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13544. }
  13545. onConstruct() {
  13546. this.c1 = this.getController("c1");
  13547. this.n0 = (this.getChild("n0"));
  13548. this.n2 = (this.getChild("n2"));
  13549. this.n19 = (this.getChild("n19"));
  13550. this.cancelBtn = (this.getChild("cancelBtn"));
  13551. this.videoBtn = (this.getChild("videoBtn"));
  13552. this.n9 = (this.getChild("n9"));
  13553. this.n22 = (this.getChild("n22"));
  13554. this.tipsTxt = (this.getChild("tipsTxt"));
  13555. this.n23 = (this.getChild("n23"));
  13556. this.n24 = (this.getChild("n24"));
  13557. this.n26 = (this.getChild("n26"));
  13558. this.n27 = (this.getChild("n27"));
  13559. this.titleTxt = (this.getChild("titleTxt"));
  13560. }
  13561. }
  13562. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13563. class ui_Component41_1 extends fgui.GComponent {
  13564. static createInstance() {
  13565. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13566. }
  13567. onConstruct() {
  13568. this.c1 = this.getController("c1");
  13569. this.n0 = (this.getChild("n0"));
  13570. this.n2 = (this.getChild("n2"));
  13571. this.cancelBtn = (this.getChild("cancelBtn"));
  13572. this.videoBtn = (this.getChild("videoBtn"));
  13573. this.n27 = (this.getChild("n27"));
  13574. this.n30 = (this.getChild("n30"));
  13575. this.n31 = (this.getChild("n31"));
  13576. this.n32 = (this.getChild("n32"));
  13577. this.n33 = (this.getChild("n33"));
  13578. this.n34 = (this.getChild("n34"));
  13579. this.n35 = (this.getChild("n35"));
  13580. this.n36 = (this.getChild("n36"));
  13581. this.n1 = (this.getChild("n1"));
  13582. this.n37 = (this.getChild("n37"));
  13583. this.t0 = this.getTransition("t0");
  13584. this.t1 = this.getTransition("t1");
  13585. this.t2 = this.getTransition("t2");
  13586. this.t3 = this.getTransition("t3");
  13587. }
  13588. }
  13589. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13590. class ui_againBtn extends fgui.GButton {
  13591. static createInstance() {
  13592. return (fgui.UIPackage.createObject("game", "againBtn"));
  13593. }
  13594. onConstruct() {
  13595. this.n2 = (this.getChild("n2"));
  13596. this.n1 = (this.getChild("n1"));
  13597. this.n5 = (this.getChild("n5"));
  13598. }
  13599. }
  13600. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13601. class ui_Component118 extends fgui.GButton {
  13602. static createInstance() {
  13603. return (fgui.UIPackage.createObject("game", "Component118"));
  13604. }
  13605. onConstruct() {
  13606. this.c1 = this.getController("c1");
  13607. this.n14 = (this.getChild("n14"));
  13608. this.n9 = (this.getChild("n9"));
  13609. this.n10 = (this.getChild("n10"));
  13610. this.diamondTxt = (this.getChild("diamondTxt"));
  13611. this.n13 = (this.getChild("n13"));
  13612. this.n15 = (this.getChild("n15"));
  13613. }
  13614. }
  13615. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13616. class ui_Component119 extends fgui.GComponent {
  13617. static createInstance() {
  13618. return (fgui.UIPackage.createObject("game", "Component119"));
  13619. }
  13620. onConstruct() {
  13621. this.n1 = (this.getChild("n1"));
  13622. this.n2 = (this.getChild("n2"));
  13623. this.n13 = (this.getChild("n13"));
  13624. this.n6 = (this.getChild("n6"));
  13625. this.screenNode = (this.getChild("screenNode"));
  13626. this.n15 = (this.getChild("n15"));
  13627. this.closeBtn = (this.getChild("closeBtn"));
  13628. this.share2Btn = (this.getChild("share2Btn"));
  13629. this.shareBtn = (this.getChild("shareBtn"));
  13630. this.tipsNode = (this.getChild("tipsNode"));
  13631. this.awardNode = (this.getChild("awardNode"));
  13632. }
  13633. }
  13634. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13635. class ui_Component132_1 extends fgui.GComponent {
  13636. static createInstance() {
  13637. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13638. }
  13639. onConstruct() {
  13640. this.n25 = (this.getChild("n25"));
  13641. this.n26 = (this.getChild("n26"));
  13642. this.n27 = (this.getChild("n27"));
  13643. this.t0 = this.getTransition("t0");
  13644. }
  13645. }
  13646. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13647. class ui_SecretaryDisplay extends fgui.GComponent {
  13648. static createInstance() {
  13649. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13650. }
  13651. onConstruct() {
  13652. this.n2 = (this.getChild("n2"));
  13653. this.levelTxt = (this.getChild("levelTxt"));
  13654. this.n4 = (this.getChild("n4"));
  13655. this.secretary = (this.getChild("secretary"));
  13656. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13657. this.n16 = (this.getChild("n16"));
  13658. this.n37 = (this.getChild("n37"));
  13659. this.n41 = (this.getChild("n41"));
  13660. this.n14 = (this.getChild("n14"));
  13661. this.n17 = (this.getChild("n17"));
  13662. this.heightTxt = (this.getChild("heightTxt"));
  13663. this.n46 = (this.getChild("n46"));
  13664. this.n36 = (this.getChild("n36"));
  13665. this.n38 = (this.getChild("n38"));
  13666. this.foodTxt = (this.getChild("foodTxt"));
  13667. this.n47 = (this.getChild("n47"));
  13668. this.n40 = (this.getChild("n40"));
  13669. this.n42 = (this.getChild("n42"));
  13670. this.historyTxt = (this.getChild("historyTxt"));
  13671. this.n48 = (this.getChild("n48"));
  13672. this.nameImg = (this.getChild("nameImg"));
  13673. this.n12 = (this.getChild("n12"));
  13674. this.n49 = (this.getChild("n49"));
  13675. this.t0 = this.getTransition("t0");
  13676. }
  13677. }
  13678. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13679. class ui_BallRodDisplay extends fgui.GComponent {
  13680. static createInstance() {
  13681. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13682. }
  13683. onConstruct() {
  13684. this.c1 = this.getController("c1");
  13685. this.n31 = (this.getChild("n31"));
  13686. this.n6 = (this.getChild("n6"));
  13687. this.nameTxt = (this.getChild("nameTxt"));
  13688. this.rodImg = (this.getChild("rodImg"));
  13689. this.levelNode = (this.getChild("levelNode"));
  13690. this.eftRod = (this.getChild("eftRod"));
  13691. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13692. }
  13693. }
  13694. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13695. class ui_Component111_11 extends fgui.GComponent {
  13696. static createInstance() {
  13697. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13698. }
  13699. onConstruct() {
  13700. this.n68 = (this.getChild("n68"));
  13701. this.n69 = (this.getChild("n69"));
  13702. }
  13703. }
  13704. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13705. class ui_Component112 extends fgui.GComponent {
  13706. static createInstance() {
  13707. return (fgui.UIPackage.createObject("game", "Component112"));
  13708. }
  13709. onConstruct() {
  13710. this.n68 = (this.getChild("n68"));
  13711. this.n70 = (this.getChild("n70"));
  13712. this.myMask = (this.getChild("myMask"));
  13713. }
  13714. }
  13715. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13716. class ui_Component111 extends fgui.GComponent {
  13717. static createInstance() {
  13718. return (fgui.UIPackage.createObject("game", "Component111"));
  13719. }
  13720. onConstruct() {
  13721. this.n68 = (this.getChild("n68"));
  13722. this.myMask = (this.getChild("myMask"));
  13723. }
  13724. }
  13725. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13726. class ui_Component144 extends fgui.GButton {
  13727. static createInstance() {
  13728. return (fgui.UIPackage.createObject("game", "Component144"));
  13729. }
  13730. onConstruct() {
  13731. this.n8 = (this.getChild("n8"));
  13732. }
  13733. }
  13734. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13735. class ui_Sign_com2 extends fgui.GComponent {
  13736. static createInstance() {
  13737. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13738. }
  13739. onConstruct() {
  13740. this.n0 = (this.getChild("n0"));
  13741. this.n1 = (this.getChild("n1"));
  13742. this.t0 = this.getTransition("t0");
  13743. }
  13744. }
  13745. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13746. class ui_Sign_guang extends fgui.GComponent {
  13747. static createInstance() {
  13748. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13749. }
  13750. onConstruct() {
  13751. this.n1 = (this.getChild("n1"));
  13752. this.n2 = (this.getChild("n2"));
  13753. this.n3 = (this.getChild("n3"));
  13754. this.n4 = (this.getChild("n4"));
  13755. this.n5 = (this.getChild("n5"));
  13756. this.n6 = (this.getChild("n6"));
  13757. this.n8 = (this.getChild("n8"));
  13758. }
  13759. }
  13760. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13761. class ui_SignMax extends fgui.GComponent {
  13762. static createInstance() {
  13763. return (fgui.UIPackage.createObject("game", "SignMax"));
  13764. }
  13765. onConstruct() {
  13766. this.c1 = this.getController("c1");
  13767. this.n7 = (this.getChild("n7"));
  13768. this.n15 = (this.getChild("n15"));
  13769. this.n8 = (this.getChild("n8"));
  13770. this.titleTxt = (this.getChild("titleTxt"));
  13771. this.myIcon1 = (this.getChild("myIcon1"));
  13772. this.numTxt1 = (this.getChild("numTxt1"));
  13773. this.myIcon2 = (this.getChild("myIcon2"));
  13774. this.n20 = (this.getChild("n20"));
  13775. this.n17 = (this.getChild("n17"));
  13776. this.numTxt2 = (this.getChild("numTxt2"));
  13777. this.n12 = (this.getChild("n12"));
  13778. this.n13 = (this.getChild("n13"));
  13779. this.n21 = (this.getChild("n21"));
  13780. this.n14 = (this.getChild("n14"));
  13781. }
  13782. }
  13783. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13784. class ui_Sign_com2_1 extends fgui.GComponent {
  13785. static createInstance() {
  13786. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13787. }
  13788. onConstruct() {
  13789. this.n0 = (this.getChild("n0"));
  13790. this.n1 = (this.getChild("n1"));
  13791. this.t0 = this.getTransition("t0");
  13792. }
  13793. }
  13794. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13795. class ui_Sign_com5 extends fgui.GComponent {
  13796. static createInstance() {
  13797. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13798. }
  13799. onConstruct() {
  13800. this.n3 = (this.getChild("n3"));
  13801. this.n29 = (this.getChild("n29"));
  13802. this.n4 = (this.getChild("n4"));
  13803. this.day1 = (this.getChild("day1"));
  13804. this.day2 = (this.getChild("day2"));
  13805. this.day3 = (this.getChild("day3"));
  13806. this.day4 = (this.getChild("day4"));
  13807. this.day5 = (this.getChild("day5"));
  13808. this.day6 = (this.getChild("day6"));
  13809. this.day7 = (this.getChild("day7"));
  13810. this.t0 = this.getTransition("t0");
  13811. }
  13812. }
  13813. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13814. class ui_Sign_com8 extends fgui.GComponent {
  13815. static createInstance() {
  13816. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13817. }
  13818. onConstruct() {
  13819. this.n48 = (this.getChild("n48"));
  13820. this.womanTxt = (this.getChild("womanTxt"));
  13821. this.t0 = this.getTransition("t0");
  13822. }
  13823. }
  13824. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13825. class ui_Sign_com6 extends fgui.GComponent {
  13826. static createInstance() {
  13827. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13828. }
  13829. onConstruct() {
  13830. this.n2 = (this.getChild("n2"));
  13831. this.n3 = (this.getChild("n3"));
  13832. this.t0 = this.getTransition("t0");
  13833. }
  13834. }
  13835. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13836. class ui_Sign_com7 extends fgui.GComponent {
  13837. static createInstance() {
  13838. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13839. }
  13840. onConstruct() {
  13841. this.n29 = (this.getChild("n29"));
  13842. this.n2 = (this.getChild("n2"));
  13843. }
  13844. }
  13845. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13846. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13847. static createInstance() {
  13848. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13849. }
  13850. onConstruct() {
  13851. this.n5 = (this.getChild("n5"));
  13852. this.n4 = (this.getChild("n4"));
  13853. this.t0 = this.getTransition("t0");
  13854. }
  13855. }
  13856. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13857. class ui_UITurntable_com2 extends fgui.GComponent {
  13858. static createInstance() {
  13859. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13860. }
  13861. onConstruct() {
  13862. this.c1 = this.getController("c1");
  13863. this.n4 = (this.getChild("n4"));
  13864. this.n6 = (this.getChild("n6"));
  13865. this.n10 = (this.getChild("n10"));
  13866. this.n11 = (this.getChild("n11"));
  13867. this.n12 = (this.getChild("n12"));
  13868. this.n13 = (this.getChild("n13"));
  13869. this.n14 = (this.getChild("n14"));
  13870. this.n15 = (this.getChild("n15"));
  13871. this.n16 = (this.getChild("n16"));
  13872. this.n17 = (this.getChild("n17"));
  13873. this.n18 = (this.getChild("n18"));
  13874. this.n19 = (this.getChild("n19"));
  13875. this.n20 = (this.getChild("n20"));
  13876. this.n21 = (this.getChild("n21"));
  13877. this.n22 = (this.getChild("n22"));
  13878. this.n23 = (this.getChild("n23"));
  13879. this.n24 = (this.getChild("n24"));
  13880. this.n25 = (this.getChild("n25"));
  13881. this.n26 = (this.getChild("n26"));
  13882. this.n27 = (this.getChild("n27"));
  13883. this.n28 = (this.getChild("n28"));
  13884. this.n29 = (this.getChild("n29"));
  13885. this.n30 = (this.getChild("n30"));
  13886. this.n31 = (this.getChild("n31"));
  13887. this.n32 = (this.getChild("n32"));
  13888. this.n33 = (this.getChild("n33"));
  13889. }
  13890. }
  13891. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13892. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13893. static createInstance() {
  13894. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13895. }
  13896. onConstruct() {
  13897. this.n5 = (this.getChild("n5"));
  13898. this.n4 = (this.getChild("n4"));
  13899. this.t0 = this.getTransition("t0");
  13900. }
  13901. }
  13902. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13903. class ui_UITurntable_com5 extends fgui.GComponent {
  13904. static createInstance() {
  13905. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13906. }
  13907. onConstruct() {
  13908. this.flashNode = (this.getChild("flashNode"));
  13909. this.rotNode = (this.getChild("rotNode"));
  13910. this.n3 = (this.getChild("n3"));
  13911. this.n21 = (this.getChild("n21"));
  13912. this.t0 = this.getTransition("t0");
  13913. }
  13914. }
  13915. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  13916. class ui_UITurntable_com7 extends fgui.GComponent {
  13917. static createInstance() {
  13918. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  13919. }
  13920. onConstruct() {
  13921. this.n2 = (this.getChild("n2"));
  13922. this.n35 = (this.getChild("n35"));
  13923. this.img1 = (this.getChild("img1"));
  13924. this.img2 = (this.getChild("img2"));
  13925. this.img3 = (this.getChild("img3"));
  13926. this.img4 = (this.getChild("img4"));
  13927. this.img6 = (this.getChild("img6"));
  13928. this.img5 = (this.getChild("img5"));
  13929. this.txt1 = (this.getChild("txt1"));
  13930. this.txt2 = (this.getChild("txt2"));
  13931. this.txt3 = (this.getChild("txt3"));
  13932. this.txt4 = (this.getChild("txt4"));
  13933. this.txt5 = (this.getChild("txt5"));
  13934. this.txt6 = (this.getChild("txt6"));
  13935. }
  13936. }
  13937. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  13938. class ui_UITurntable_com9 extends fgui.GComponent {
  13939. static createInstance() {
  13940. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  13941. }
  13942. onConstruct() {
  13943. this.n38 = (this.getChild("n38"));
  13944. this.n39 = (this.getChild("n39"));
  13945. }
  13946. }
  13947. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  13948. class ui_UITurntable_com10 extends fgui.GComponent {
  13949. static createInstance() {
  13950. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  13951. }
  13952. onConstruct() {
  13953. this.n39 = (this.getChild("n39"));
  13954. this.n40 = (this.getChild("n40"));
  13955. this.t0 = this.getTransition("t0");
  13956. }
  13957. }
  13958. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  13959. class ui_UITurntable_com11 extends fgui.GComponent {
  13960. static createInstance() {
  13961. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  13962. }
  13963. onConstruct() {
  13964. this.n38 = (this.getChild("n38"));
  13965. this.n39 = (this.getChild("n39"));
  13966. this.n40 = (this.getChild("n40"));
  13967. this.t0 = this.getTransition("t0");
  13968. }
  13969. }
  13970. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  13971. class ui_UITurntable_com12 extends fgui.GComponent {
  13972. static createInstance() {
  13973. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  13974. }
  13975. onConstruct() {
  13976. this.n43 = (this.getChild("n43"));
  13977. this.barNode = (this.getChild("barNode"));
  13978. this.tipsTxt = (this.getChild("tipsTxt"));
  13979. this.n45 = (this.getChild("n45"));
  13980. this.boxBtn = (this.getChild("boxBtn"));
  13981. }
  13982. }
  13983. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  13984. class ui_UITurntable_com1 extends fgui.GButton {
  13985. static createInstance() {
  13986. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  13987. }
  13988. onConstruct() {
  13989. this.n41 = (this.getChild("n41"));
  13990. this.n42 = (this.getChild("n42"));
  13991. this.t0 = this.getTransition("t0");
  13992. }
  13993. }
  13994. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  13995. class ui_UITurntable_com3 extends fgui.GComponent {
  13996. static createInstance() {
  13997. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  13998. }
  13999. onConstruct() {
  14000. this.n48 = (this.getChild("n48"));
  14001. this.womanTxt = (this.getChild("womanTxt"));
  14002. this.t0 = this.getTransition("t0");
  14003. }
  14004. }
  14005. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14006. class ui_cancelBtn2 extends fgui.GButton {
  14007. static createInstance() {
  14008. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14009. }
  14010. onConstruct() {
  14011. this.c1 = this.getController("c1");
  14012. this.n0 = (this.getChild("n0"));
  14013. this.n1 = (this.getChild("n1"));
  14014. this.n2 = (this.getChild("n2"));
  14015. this.n3 = (this.getChild("n3"));
  14016. this.n4 = (this.getChild("n4"));
  14017. this.n5 = (this.getChild("n5"));
  14018. this.n6 = (this.getChild("n6"));
  14019. this.n7 = (this.getChild("n7"));
  14020. this.n8 = (this.getChild("n8"));
  14021. this.powerEft = (this.getChild("powerEft"));
  14022. }
  14023. }
  14024. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14025. class ui_shareBtn2 extends fgui.GButton {
  14026. static createInstance() {
  14027. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14028. }
  14029. onConstruct() {
  14030. this.c1 = this.getController("c1");
  14031. this.n2 = (this.getChild("n2"));
  14032. this.n24 = (this.getChild("n24"));
  14033. this.n1 = (this.getChild("n1"));
  14034. this.n3 = (this.getChild("n3"));
  14035. this.n23 = (this.getChild("n23"));
  14036. this.n4 = (this.getChild("n4"));
  14037. this.n5 = (this.getChild("n5"));
  14038. this.n6 = (this.getChild("n6"));
  14039. this.n20 = (this.getChild("n20"));
  14040. this.n21 = (this.getChild("n21"));
  14041. this.n22 = (this.getChild("n22"));
  14042. this.powerEft = (this.getChild("powerEft"));
  14043. }
  14044. }
  14045. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14046. class ui_UIMoney extends fgui.GComponent {
  14047. static createInstance() {
  14048. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14049. }
  14050. onConstruct() {
  14051. this.c1 = this.getController("c1");
  14052. this.n4 = (this.getChild("n4"));
  14053. this.coinImg = (this.getChild("coinImg"));
  14054. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14055. this.coinTxt = (this.getChild("coinTxt"));
  14056. this.n7 = (this.getChild("n7"));
  14057. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14058. this.diamondTxt = (this.getChild("diamondTxt"));
  14059. this.diamondImg = (this.getChild("diamondImg"));
  14060. this.n12 = (this.getChild("n12"));
  14061. this.powerImg = (this.getChild("powerImg"));
  14062. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14063. this.powerTxt = (this.getChild("powerTxt"));
  14064. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14065. }
  14066. }
  14067. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14068. class ui_backBtn extends fgui.GButton {
  14069. static createInstance() {
  14070. return (fgui.UIPackage.createObject("game", "backBtn"));
  14071. }
  14072. onConstruct() {
  14073. this.n0 = (this.getChild("n0"));
  14074. this.t0 = this.getTransition("t0");
  14075. this.t1 = this.getTransition("t1");
  14076. }
  14077. }
  14078. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14079. class ui_MoneyBtn extends fgui.GButton {
  14080. static createInstance() {
  14081. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14082. }
  14083. onConstruct() {
  14084. this.button = this.getController("button");
  14085. this.n0 = (this.getChild("n0"));
  14086. }
  14087. }
  14088. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14089. class ui_UIMoneyBtn extends fgui.GComponent {
  14090. static createInstance() {
  14091. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14092. }
  14093. onConstruct() {
  14094. this.n1 = (this.getChild("n1"));
  14095. this.closeBtn = (this.getChild("closeBtn"));
  14096. }
  14097. }
  14098. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14099. class ui_Component64 extends fgui.GComponent {
  14100. static createInstance() {
  14101. return (fgui.UIPackage.createObject("game", "Component64"));
  14102. }
  14103. onConstruct() {
  14104. this.n57 = (this.getChild("n57"));
  14105. this.n54 = (this.getChild("n54"));
  14106. this.n55 = (this.getChild("n55"));
  14107. this.n56 = (this.getChild("n56"));
  14108. this.t1 = this.getTransition("t1");
  14109. }
  14110. }
  14111. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14112. class ui_Component41_3 extends fgui.GComponent {
  14113. static createInstance() {
  14114. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14115. }
  14116. onConstruct() {
  14117. this.c1 = this.getController("c1");
  14118. this.n0 = (this.getChild("n0"));
  14119. this.n2 = (this.getChild("n2"));
  14120. this.cancelBtn = (this.getChild("cancelBtn"));
  14121. this.videoBtn = (this.getChild("videoBtn"));
  14122. this.n9 = (this.getChild("n9"));
  14123. this.n24 = (this.getChild("n24"));
  14124. this.n27 = (this.getChild("n27"));
  14125. this.titleTxt = (this.getChild("titleTxt"));
  14126. this.n28 = (this.getChild("n28"));
  14127. this.t0 = this.getTransition("t0");
  14128. }
  14129. }
  14130. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14131. class ui_dh_zs_4 extends fgui.GComponent {
  14132. static createInstance() {
  14133. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14134. }
  14135. onConstruct() {
  14136. this.n1 = (this.getChild("n1"));
  14137. this.n2 = (this.getChild("n2"));
  14138. this.n3 = (this.getChild("n3"));
  14139. this.n4 = (this.getChild("n4"));
  14140. this.n5 = (this.getChild("n5"));
  14141. this.n6 = (this.getChild("n6"));
  14142. this.n8 = (this.getChild("n8"));
  14143. this.t0 = this.getTransition("t0");
  14144. }
  14145. }
  14146. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14147. class ui_Component71_1 extends fgui.GButton {
  14148. static createInstance() {
  14149. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14150. }
  14151. onConstruct() {
  14152. this.n17 = (this.getChild("n17"));
  14153. this.t0 = this.getTransition("t0");
  14154. }
  14155. }
  14156. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14157. class ui_Component83 extends fgui.GComponent {
  14158. static createInstance() {
  14159. return (fgui.UIPackage.createObject("game", "Component83"));
  14160. }
  14161. onConstruct() {
  14162. this.c1 = this.getController("c1");
  14163. this.n17 = (this.getChild("n17"));
  14164. this.n19 = (this.getChild("n19"));
  14165. this.n20 = (this.getChild("n20"));
  14166. }
  14167. }
  14168. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14169. class ui_Component84 extends fgui.GComponent {
  14170. static createInstance() {
  14171. return (fgui.UIPackage.createObject("game", "Component84"));
  14172. }
  14173. onConstruct() {
  14174. this.c1 = this.getController("c1");
  14175. this.n4 = (this.getChild("n4"));
  14176. this.n22 = (this.getChild("n22"));
  14177. this.n23 = (this.getChild("n23"));
  14178. this.numTxt = (this.getChild("numTxt"));
  14179. this.n25 = (this.getChild("n25"));
  14180. this.n26 = (this.getChild("n26"));
  14181. }
  14182. }
  14183. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14184. class ui_Component84_1 extends fgui.GComponent {
  14185. static createInstance() {
  14186. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14187. }
  14188. onConstruct() {
  14189. this.c1 = this.getController("c1");
  14190. this.n4 = (this.getChild("n4"));
  14191. this.n22 = (this.getChild("n22"));
  14192. this.n23 = (this.getChild("n23"));
  14193. this.numTxt = (this.getChild("numTxt"));
  14194. this.n25 = (this.getChild("n25"));
  14195. this.n26 = (this.getChild("n26"));
  14196. }
  14197. }
  14198. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14199. class ui_Component85 extends fgui.GComponent {
  14200. static createInstance() {
  14201. return (fgui.UIPackage.createObject("game", "Component85"));
  14202. }
  14203. onConstruct() {
  14204. this.n1 = (this.getChild("n1"));
  14205. this.n6 = (this.getChild("n6"));
  14206. this.n2 = (this.getChild("n2"));
  14207. this.n3 = (this.getChild("n3"));
  14208. this.levelTxt = (this.getChild("levelTxt"));
  14209. this.n10 = (this.getChild("n10"));
  14210. this.n11 = (this.getChild("n11"));
  14211. this.n12 = (this.getChild("n12"));
  14212. this.n13 = (this.getChild("n13"));
  14213. this.n14 = (this.getChild("n14"));
  14214. this.modeNode = (this.getChild("modeNode"));
  14215. this.n18 = (this.getChild("n18"));
  14216. this.conditionTxt = (this.getChild("conditionTxt"));
  14217. this.diamondNode = (this.getChild("diamondNode"));
  14218. this.coinNode = (this.getChild("coinNode"));
  14219. this.startBtn = (this.getChild("startBtn"));
  14220. this.n28 = (this.getChild("n28"));
  14221. this.displayRoot = (this.getChild("displayRoot"));
  14222. this.t0 = this.getTransition("t0");
  14223. }
  14224. }
  14225. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14226. class ui_Component86 extends fgui.GButton {
  14227. static createInstance() {
  14228. return (fgui.UIPackage.createObject("game", "Component86"));
  14229. }
  14230. onConstruct() {
  14231. this.n15 = (this.getChild("n15"));
  14232. this.t0 = this.getTransition("t0");
  14233. }
  14234. }
  14235. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14236. class ui_Component87 extends fgui.GComponent {
  14237. static createInstance() {
  14238. return (fgui.UIPackage.createObject("game", "Component87"));
  14239. }
  14240. onConstruct() {
  14241. this.n66 = (this.getChild("n66"));
  14242. this.myProgress = (this.getChild("myProgress"));
  14243. this.starAni = (this.getChild("starAni"));
  14244. this.hpTxt = (this.getChild("hpTxt"));
  14245. this.n74 = (this.getChild("n74"));
  14246. this.n73 = (this.getChild("n73"));
  14247. this.ballTxt = (this.getChild("ballTxt"));
  14248. this.n76 = (this.getChild("n76"));
  14249. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14250. this.levelTxt = (this.getChild("levelTxt"));
  14251. this.star1 = (this.getChild("star1"));
  14252. this.star2 = (this.getChild("star2"));
  14253. this.star3 = (this.getChild("star3"));
  14254. }
  14255. }
  14256. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14257. class ui_Component88 extends fgui.GProgressBar {
  14258. static createInstance() {
  14259. return (fgui.UIPackage.createObject("game", "Component88"));
  14260. }
  14261. onConstruct() {
  14262. this.n68 = (this.getChild("n68"));
  14263. this.bar = (this.getChild("bar"));
  14264. }
  14265. }
  14266. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14267. class ui_Component89 extends fgui.GComponent {
  14268. static createInstance() {
  14269. return (fgui.UIPackage.createObject("game", "Component89"));
  14270. }
  14271. onConstruct() {
  14272. this.c1 = this.getController("c1");
  14273. this.n71 = (this.getChild("n71"));
  14274. this.n72 = (this.getChild("n72"));
  14275. }
  14276. }
  14277. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14278. class ui_Component90 extends fgui.GComponent {
  14279. static createInstance() {
  14280. return (fgui.UIPackage.createObject("game", "Component90"));
  14281. }
  14282. onConstruct() {
  14283. this.c1 = this.getController("c1");
  14284. this.n64 = (this.getChild("n64"));
  14285. this.n65 = (this.getChild("n65"));
  14286. this.n66 = (this.getChild("n66"));
  14287. this.t0 = this.getTransition("t0");
  14288. }
  14289. }
  14290. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14291. class ui_Component127 extends fgui.GButton {
  14292. static createInstance() {
  14293. return (fgui.UIPackage.createObject("game", "Component127"));
  14294. }
  14295. onConstruct() {
  14296. this.n5 = (this.getChild("n5"));
  14297. }
  14298. }
  14299. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14300. class gameBinder {
  14301. static bindAll() {
  14302. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14303. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14304. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14305. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14306. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14307. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14308. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14309. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14310. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14311. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14312. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14313. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14314. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14315. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14316. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14317. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14318. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14319. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14320. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14321. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14322. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14323. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14324. fgui.UIObjectFactory.setExtension(ui_Component121.URL, ui_Component121);
  14325. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14326. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14327. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14328. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14329. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14330. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14331. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14332. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14333. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14334. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14335. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14336. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14337. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14338. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14339. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14340. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14341. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14342. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14343. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14344. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14345. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14346. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14347. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14348. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14349. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14350. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14351. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14352. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14353. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14354. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14355. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14356. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14357. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14358. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14359. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14360. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14361. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14362. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14363. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14364. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14365. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14366. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14367. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14368. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14369. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14370. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14371. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14372. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14373. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14374. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14375. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14376. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14377. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14378. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14379. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14380. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14381. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14382. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14383. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14384. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14385. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14386. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14387. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14388. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14389. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14390. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14391. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14392. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14393. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14394. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14395. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14396. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14397. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14398. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14399. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14400. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14401. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14402. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14403. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14404. fgui.UIObjectFactory.setExtension(ui_Component16.URL, ui_Component16);
  14405. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14406. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14407. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14408. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14409. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14410. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14411. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14412. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14413. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14414. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14415. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14416. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14417. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14418. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14419. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14420. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14421. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14422. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14423. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14424. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14425. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14426. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14427. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14428. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14429. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14430. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14431. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14432. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14433. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14434. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14435. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14436. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14437. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14438. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14439. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14440. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14441. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14442. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14443. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14444. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14445. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14446. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14447. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14448. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14449. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14450. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14451. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14452. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14453. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14454. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14455. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14456. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14457. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14458. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14459. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14460. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14461. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14462. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14463. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14464. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14465. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14466. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14467. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14468. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14469. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14470. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14471. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14472. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14473. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14474. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14475. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14476. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14477. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14478. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14479. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14480. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14481. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14482. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14483. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14484. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14485. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14486. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14487. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14488. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14489. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14490. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14491. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14492. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14493. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14494. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14495. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14496. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14497. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14498. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14499. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14500. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14501. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14502. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14503. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14504. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14505. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14506. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14507. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14508. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14509. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14510. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14511. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14512. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14513. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14514. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14515. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14516. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14517. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14518. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14519. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14520. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14521. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14522. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14523. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14524. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14525. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14526. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14527. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14528. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14529. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14530. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14531. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14532. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14533. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14534. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14535. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14536. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14537. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14538. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14539. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14540. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14541. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14542. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14543. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14544. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14545. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14546. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14547. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14548. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14549. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14550. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14551. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14552. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14553. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14554. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14555. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14556. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14557. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14558. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14559. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14560. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14561. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14562. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14563. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14564. }
  14565. }
  14566. class ui_btn6 extends fgui.GButton {
  14567. static createInstance() {
  14568. return (fgui.UIPackage.createObject("loading", "btn6"));
  14569. }
  14570. onConstruct() {
  14571. this.n6 = (this.getChild("n6"));
  14572. this.n1 = (this.getChild("n1"));
  14573. }
  14574. }
  14575. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14576. class ui_xyItem extends fgui.GComponent {
  14577. static createInstance() {
  14578. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14579. }
  14580. onConstruct() {
  14581. this.xyItem = (this.getChild("xyItem"));
  14582. }
  14583. }
  14584. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14585. class ui_loadinfo extends fgui.GProgressBar {
  14586. static createInstance() {
  14587. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14588. }
  14589. onConstruct() {
  14590. this.bg = (this.getChild("bg"));
  14591. this.bar = (this.getChild("bar"));
  14592. this.title = (this.getChild("title"));
  14593. this.ani = (this.getChild("ani"));
  14594. }
  14595. }
  14596. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14597. class ui_xyNode extends fgui.GComponent {
  14598. static createInstance() {
  14599. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14600. }
  14601. onConstruct() {
  14602. this.n0 = (this.getChild("n0"));
  14603. this.btnYes = (this.getChild("btnYes"));
  14604. this.btnNo = (this.getChild("btnNo"));
  14605. this.btnKnown = (this.getChild("btnKnown"));
  14606. this.btnSure = (this.getChild("btnSure"));
  14607. this.txtWelcom = (this.getChild("txtWelcom"));
  14608. this.txtXy = (this.getChild("txtXy"));
  14609. this.n75 = (this.getChild("n75"));
  14610. this.btnXy1 = (this.getChild("btnXy1"));
  14611. this.btnXy3 = (this.getChild("btnXy3"));
  14612. this.btnXy2 = (this.getChild("btnXy2"));
  14613. this.n74 = (this.getChild("n74"));
  14614. this.xy1 = (this.getChild("xy1"));
  14615. this.txtTitle = (this.getChild("txtTitle"));
  14616. this.btnBack = (this.getChild("btnBack"));
  14617. this.xyList = (this.getChild("xyList"));
  14618. this.xy2 = (this.getChild("xy2"));
  14619. this.xyNode = (this.getChild("xyNode"));
  14620. }
  14621. }
  14622. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14623. class ui_ageNode extends fgui.GComponent {
  14624. static createInstance() {
  14625. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14626. }
  14627. onConstruct() {
  14628. this.n3 = (this.getChild("n3"));
  14629. this.n7 = (this.getChild("n7"));
  14630. this.n4 = (this.getChild("n4"));
  14631. this.btnAge = (this.getChild("btnAge"));
  14632. this.ageNode = (this.getChild("ageNode"));
  14633. }
  14634. }
  14635. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14636. class ui_rnNode extends fgui.GComponent {
  14637. static createInstance() {
  14638. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14639. }
  14640. onConstruct() {
  14641. this.n28 = (this.getChild("n28"));
  14642. this.n30 = (this.getChild("n30"));
  14643. this.n33 = (this.getChild("n33"));
  14644. this.rn1 = (this.getChild("rn1"));
  14645. this.n40 = (this.getChild("n40"));
  14646. this.n41 = (this.getChild("n41"));
  14647. this.rn3 = (this.getChild("rn3"));
  14648. this.n37 = (this.getChild("n37"));
  14649. this.n39 = (this.getChild("n39"));
  14650. this.rn2 = (this.getChild("rn2"));
  14651. this.n47 = (this.getChild("n47"));
  14652. this.n49 = (this.getChild("n49"));
  14653. this.n44 = (this.getChild("n44"));
  14654. this.inputCode = (this.getChild("inputCode"));
  14655. this.inputName = (this.getChild("inputName"));
  14656. this.n48 = (this.getChild("n48"));
  14657. this.n50 = (this.getChild("n50"));
  14658. this.rn4 = (this.getChild("rn4"));
  14659. this.btnCheck = (this.getChild("btnCheck"));
  14660. this.btnExit = (this.getChild("btnExit"));
  14661. this.btnDone = (this.getChild("btnDone"));
  14662. this.rnNode = (this.getChild("rnNode"));
  14663. }
  14664. }
  14665. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14666. class ui_tipNode extends fgui.GComponent {
  14667. static createInstance() {
  14668. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14669. }
  14670. onConstruct() {
  14671. this.bg = (this.getChild("bg"));
  14672. this.n55 = (this.getChild("n55"));
  14673. this.n56 = (this.getChild("n56"));
  14674. this.tipNode = (this.getChild("tipNode"));
  14675. }
  14676. }
  14677. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14678. class ui_fcmNode extends fgui.GComponent {
  14679. static createInstance() {
  14680. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14681. }
  14682. onConstruct() {
  14683. this.n63 = (this.getChild("n63"));
  14684. this.n62 = (this.getChild("n62"));
  14685. this.btnRn = (this.getChild("btnRn"));
  14686. this.n61 = (this.getChild("n61"));
  14687. this.n58 = (this.getChild("n58"));
  14688. this.fcmNode = (this.getChild("fcmNode"));
  14689. }
  14690. }
  14691. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14692. class ui_msgNode extends fgui.GComponent {
  14693. static createInstance() {
  14694. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14695. }
  14696. onConstruct() {
  14697. this.n69 = (this.getChild("n69"));
  14698. this.txtMsg = (this.getChild("txtMsg"));
  14699. this.msgNode = (this.getChild("msgNode"));
  14700. }
  14701. }
  14702. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14703. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14704. static createInstance() {
  14705. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14706. }
  14707. onConstruct() {
  14708. this.n1 = (this.getChild("n1"));
  14709. this.n13 = (this.getChild("n13"));
  14710. this.n14 = (this.getChild("n14"));
  14711. this.n15 = (this.getChild("n15"));
  14712. this.n3 = (this.getChild("n3"));
  14713. this.n4 = (this.getChild("n4"));
  14714. this.n5 = (this.getChild("n5"));
  14715. this.n6 = (this.getChild("n6"));
  14716. this.n7 = (this.getChild("n7"));
  14717. this.n8 = (this.getChild("n8"));
  14718. this.n9 = (this.getChild("n9"));
  14719. this.n10 = (this.getChild("n10"));
  14720. this.n12 = (this.getChild("n12"));
  14721. this.n11 = (this.getChild("n11"));
  14722. this.n16 = (this.getChild("n16"));
  14723. this.n17 = (this.getChild("n17"));
  14724. this.n18 = (this.getChild("n18"));
  14725. this.n20 = (this.getChild("n20"));
  14726. this.n21 = (this.getChild("n21"));
  14727. this.t0 = this.getTransition("t0");
  14728. }
  14729. }
  14730. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14731. class ui_btn5 extends fgui.GButton {
  14732. static createInstance() {
  14733. return (fgui.UIPackage.createObject("loading", "btn5"));
  14734. }
  14735. onConstruct() {
  14736. this.n9 = (this.getChild("n9"));
  14737. this.n1 = (this.getChild("n1"));
  14738. }
  14739. }
  14740. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14741. class ui_UILoading extends fgui.GComponent {
  14742. static createInstance() {
  14743. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14744. }
  14745. onConstruct() {
  14746. this.n12 = (this.getChild("n12"));
  14747. this.loadinfo = (this.getChild("loadinfo"));
  14748. this.n13 = (this.getChild("n13"));
  14749. this.txtLoad = (this.getChild("txtLoad"));
  14750. this.n19 = (this.getChild("n19"));
  14751. this.n20 = (this.getChild("n20"));
  14752. this.t_d = (this.getChild("t_d"));
  14753. this.n18 = (this.getChild("n18"));
  14754. }
  14755. }
  14756. ui_UILoading.URL = "ui://37nctnhwphc33";
  14757. class ui_AgeItem extends fgui.GComponent {
  14758. static createInstance() {
  14759. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14760. }
  14761. onConstruct() {
  14762. this.txtAge = (this.getChild("txtAge"));
  14763. }
  14764. }
  14765. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14766. class ui_btn1 extends fgui.GButton {
  14767. static createInstance() {
  14768. return (fgui.UIPackage.createObject("loading", "btn1"));
  14769. }
  14770. onConstruct() {
  14771. this.n6 = (this.getChild("n6"));
  14772. this.n1 = (this.getChild("n1"));
  14773. }
  14774. }
  14775. ui_btn1.URL = "ui://37nctnhwxe622p";
  14776. class ui_btn3 extends fgui.GButton {
  14777. static createInstance() {
  14778. return (fgui.UIPackage.createObject("loading", "btn3"));
  14779. }
  14780. onConstruct() {
  14781. this.n9 = (this.getChild("n9"));
  14782. this.n1 = (this.getChild("n1"));
  14783. }
  14784. }
  14785. ui_btn3.URL = "ui://37nctnhwxe622s";
  14786. class ui_btn2 extends fgui.GButton {
  14787. static createInstance() {
  14788. return (fgui.UIPackage.createObject("loading", "btn2"));
  14789. }
  14790. onConstruct() {
  14791. this.n6 = (this.getChild("n6"));
  14792. this.n1 = (this.getChild("n1"));
  14793. }
  14794. }
  14795. ui_btn2.URL = "ui://37nctnhwxe622t";
  14796. class ui_btnBack extends fgui.GButton {
  14797. static createInstance() {
  14798. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14799. }
  14800. onConstruct() {
  14801. this.n6 = (this.getChild("n6"));
  14802. this.n7 = (this.getChild("n7"));
  14803. }
  14804. }
  14805. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14806. class ui_btnXy1 extends fgui.GButton {
  14807. static createInstance() {
  14808. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14809. }
  14810. onConstruct() {
  14811. this.n1 = (this.getChild("n1"));
  14812. }
  14813. }
  14814. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14815. class ui_btnXy2 extends fgui.GButton {
  14816. static createInstance() {
  14817. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14818. }
  14819. onConstruct() {
  14820. this.n1 = (this.getChild("n1"));
  14821. }
  14822. }
  14823. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14824. class ui_btnXy3 extends fgui.GButton {
  14825. static createInstance() {
  14826. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14827. }
  14828. onConstruct() {
  14829. this.n1 = (this.getChild("n1"));
  14830. }
  14831. }
  14832. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14833. class ui_btn4 extends fgui.GButton {
  14834. static createInstance() {
  14835. return (fgui.UIPackage.createObject("loading", "btn4"));
  14836. }
  14837. onConstruct() {
  14838. this.n9 = (this.getChild("n9"));
  14839. this.n1 = (this.getChild("n1"));
  14840. }
  14841. }
  14842. ui_btn4.URL = "ui://37nctnhwxe622z";
  14843. class loadingBinder {
  14844. static bindAll() {
  14845. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14846. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14847. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14848. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14849. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14850. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14851. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14852. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14853. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14854. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14855. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14856. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14857. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14858. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14859. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14860. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14861. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14862. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14863. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14864. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14865. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14866. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14867. }
  14868. }
  14869. class UIMgr {
  14870. constructor() {
  14871. this._stage = null;
  14872. this._uiList = [];
  14873. this._showList = [];
  14874. this._bindPkgList = [];
  14875. this.uiIndex = 0;
  14876. }
  14877. static get inst() {
  14878. if (UIMgr._inst == null) {
  14879. UIMgr._inst = new UIMgr();
  14880. }
  14881. return UIMgr._inst;
  14882. }
  14883. setStage(s) {
  14884. if (this._stage) {
  14885. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14886. return;
  14887. }
  14888. this._stage = s;
  14889. }
  14890. init() {
  14891. this.setStage(Laya.stage);
  14892. fairygui.UIConfig.defaultFont = "微软雅黑";
  14893. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14894. fairygui.UIConfig.packageFileExtension = "obj";
  14895. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14896. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14897. fairygui.GRoot.inst.width = Laya.stage.width;
  14898. fairygui.GRoot.inst.height = Laya.stage.height;
  14899. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14900. }
  14901. addAllUpdate() {
  14902. this.uiIndex = 0;
  14903. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14904. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14905. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14906. }
  14907. }
  14908. }
  14909. bindFUI(pkgname) {
  14910. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  14911. return;
  14912. }
  14913. switch (pkgname) {
  14914. case fguiRes.loading:
  14915. fairygui.UIPackage.addPackage(pkgname);
  14916. loadingBinder.bindAll();
  14917. this._bindPkgList.push(pkgname);
  14918. break;
  14919. case fguiRes.game:
  14920. fairygui.UIPackage.addPackage(pkgname);
  14921. gameBinder.bindAll();
  14922. this._bindPkgList.push(pkgname);
  14923. break;
  14924. default:
  14925. break;
  14926. }
  14927. }
  14928. Show(cls, ...param) {
  14929. let nameStr = cls.uiName;
  14930. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14931. let temp = this._uiList[i];
  14932. let str = temp.className;
  14933. if (str == nameStr) {
  14934. if (temp.isMuti) {
  14935. if (temp.isHide) {
  14936. temp.show(...param);
  14937. this._uiList.splice(i, 1);
  14938. this._uiList.push(temp);
  14939. return temp;
  14940. }
  14941. }
  14942. else {
  14943. temp.show(...param);
  14944. this._uiList.splice(i, 1);
  14945. this._uiList.push(temp);
  14946. return temp;
  14947. }
  14948. }
  14949. }
  14950. let ui = new cls();
  14951. ui.className = nameStr;
  14952. this._showUI(ui, param);
  14953. return ui;
  14954. }
  14955. destroyUI(ui) {
  14956. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14957. let temp = this._uiList[i].className;
  14958. if (temp == ui.className) {
  14959. this._uiList.splice(i, 1);
  14960. break;
  14961. }
  14962. }
  14963. this.checkUIState();
  14964. }
  14965. _showUI(ui, param) {
  14966. this._uiList.push(ui);
  14967. ui.show(...param);
  14968. }
  14969. Hide(uiClass) {
  14970. let ui = this.getUI(uiClass);
  14971. if (ui && !ui.isHide) {
  14972. ui.hide();
  14973. }
  14974. }
  14975. getUI(ui) {
  14976. let nameStr = ui.uiName;
  14977. for (let index = 0; index < this._uiList.length; index++) {
  14978. let temp = this._uiList[index];
  14979. if (temp.className == nameStr) {
  14980. return temp;
  14981. }
  14982. }
  14983. return null;
  14984. }
  14985. isShow(cls) {
  14986. for (var i of this._uiList) {
  14987. if (i instanceof cls) {
  14988. return i.isShowing;
  14989. }
  14990. }
  14991. return false;
  14992. }
  14993. showUINum() {
  14994. let num = 0;
  14995. for (var i of this._uiList) {
  14996. if (i.isShowing) {
  14997. num++;
  14998. }
  14999. }
  15000. return num;
  15001. }
  15002. checkUIState() {
  15003. Laya.timer.clear(this, this._uiCheck);
  15004. Laya.timer.once(400, this, this._uiCheck);
  15005. }
  15006. _uiCheck() {
  15007. let showList = [];
  15008. for (var i of this._uiList) {
  15009. if (!i.isHide) {
  15010. showList.push(i);
  15011. }
  15012. }
  15013. for (let index = 0; index < showList.length; index++) {
  15014. if (index == showList.length - 1) {
  15015. showList[index].checkActive(true);
  15016. }
  15017. else {
  15018. showList[index].checkActive(false);
  15019. }
  15020. }
  15021. }
  15022. showTip(msg, time = 600, size = 30) {
  15023. }
  15024. }
  15025. class UIShowList {
  15026. }
  15027. class SoundMgr {
  15028. constructor() {
  15029. this.soundMax = 4;
  15030. this.isLoad = false;
  15031. this.soundMap = {};
  15032. this.isSound = true;
  15033. this.openShake = true;
  15034. SoundMgr._instance = this;
  15035. }
  15036. static getInstance() {
  15037. if (!this._instance) {
  15038. this._instance = new SoundMgr();
  15039. }
  15040. return this._instance;
  15041. }
  15042. init() {
  15043. console.log('zh:sm init 1');
  15044. Laya.SoundManager.autoReleaseSound = true;
  15045. Laya.SoundManager.autoStopMusic = true;
  15046. Laya.SoundManager.musicVolume = 0.3;
  15047. Laya.SoundManager.soundVolume = 0.5;
  15048. this.musicPlayed = false;
  15049. this.audioUrl = "asset/sound/ogg/";
  15050. console.log('zh:sm init 2');
  15051. console.log('zh:dev type ');
  15052. if (Laya.Browser.onAndroid) {
  15053. console.log('zh:dev type android');
  15054. this.audioUrl = "asset/sound/ogg/";
  15055. this.isLoad = true;
  15056. }
  15057. else {
  15058. console.log('zh:dev type not android');
  15059. this.audioUrl = "asset/sound/mp3/";
  15060. this.isLoad = true;
  15061. }
  15062. }
  15063. onSetting(isS) {
  15064. this.isSound = isS;
  15065. this.mute(!this.isSound);
  15066. }
  15067. clearCount() {
  15068. for (var key in this.soundMap) {
  15069. delete this.soundMap[key];
  15070. }
  15071. }
  15072. playMusic(path, loop = 0) {
  15073. console.log('zh:playMusic 1 PATH=' + path);
  15074. this.musicPath = path;
  15075. if (!this.isLoad)
  15076. console.log('zh:playMusic 2');
  15077. return;
  15078. if (!path || path == "")
  15079. console.log('zh:playMusic 3');
  15080. return;
  15081. if (!this.isSound)
  15082. console.log('zh:playMusic 4');
  15083. return;
  15084. this.musicPlayed = true;
  15085. console.log('zh:playMusic 5');
  15086. let url = this.getUrl(path);
  15087. console.log('zh:playMusic 6' + url);
  15088. if (Laya.Browser.onPC) {
  15089. console.log('zh:playMusic 7');
  15090. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15091. console.log('zh:playMusic 8');
  15092. this.play(url, loop);
  15093. }));
  15094. }
  15095. else
  15096. this.play(url, loop);
  15097. }
  15098. play(url, loop) {
  15099. Laya.SoundManager.playMusic(url, loop);
  15100. }
  15101. getUrl(path) {
  15102. let url = this.audioUrl + path;
  15103. if (Laya.Browser.onAndroid) {
  15104. url += ".ogg";
  15105. }
  15106. else {
  15107. url += ".mp3";
  15108. }
  15109. return url;
  15110. }
  15111. pauseMusic(pause) {
  15112. if (pause) {
  15113. this.mute(true);
  15114. }
  15115. else if (this.isSound)
  15116. this.mute(false);
  15117. }
  15118. stopMusic() {
  15119. Laya.SoundManager.stopMusic();
  15120. if (Moyu.isNeedPlatAudio) {
  15121. Moyu.stopMusic();
  15122. }
  15123. }
  15124. mute(mute) {
  15125. if (Moyu.isNeedPlatAudio) {
  15126. Moyu.pauseMusic(mute);
  15127. }
  15128. else {
  15129. Laya.SoundManager.musicMuted = mute;
  15130. if (!mute && !this.musicPlayed && this.musicPath) {
  15131. this.playMusic(this.musicPath);
  15132. }
  15133. }
  15134. }
  15135. stopSound(path) {
  15136. let url = this.getUrl(path);
  15137. Laya.SoundManager.stopSound(url);
  15138. }
  15139. playSound(path, loop = 1, soundMax = this.soundMax) {
  15140. if (!this.isLoad)
  15141. return;
  15142. if (!this.isSound)
  15143. return;
  15144. if (!path || path == "")
  15145. return;
  15146. let url = this.getUrl(path);
  15147. if (Moyu.isNeedPlatAudio) {
  15148. Moyu.playSound(path, loop == 0);
  15149. }
  15150. else {
  15151. let count = 1;
  15152. if (this.soundMap[path])
  15153. count = this.soundMap[path] + 1;
  15154. if (count > soundMax)
  15155. return;
  15156. this.soundMap[path] = count;
  15157. Laya.SoundManager.playSound(url, loop);
  15158. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15159. }
  15160. }
  15161. removePath(path) {
  15162. if (this.soundMap[path]) {
  15163. let count = this.soundMap[path];
  15164. count--;
  15165. if (count < 1)
  15166. delete this.soundMap[path];
  15167. else
  15168. this.soundMap[path] = count;
  15169. }
  15170. }
  15171. playBtnSound() {
  15172. this.playSound("btn");
  15173. }
  15174. playGetSound() {
  15175. }
  15176. playCloseUISound() {
  15177. }
  15178. }
  15179. SoundMgr._instance = null;
  15180. var Handler$1 = Laya.Handler;
  15181. var EResType;
  15182. (function (EResType) {
  15183. EResType[EResType["none"] = 0] = "none";
  15184. EResType[EResType["nromal"] = 1] = "nromal";
  15185. EResType[EResType["td"] = 2] = "td";
  15186. EResType[EResType["sk"] = 3] = "sk";
  15187. })(EResType || (EResType = {}));
  15188. class CResLoader {
  15189. constructor(doneCall, proCall) {
  15190. this.completrCall = doneCall;
  15191. this.progressCall = proCall;
  15192. this.progressHander = new Handler$1(this, this.onProgress);
  15193. this.tdResMap = {};
  15194. }
  15195. load(resList) {
  15196. this.resCount = 0;
  15197. this.loadCount = 0;
  15198. for (let i = 0; i < resList.length; i++) {
  15199. let path = resList[i];
  15200. if (!path)
  15201. continue;
  15202. this.resCount++;
  15203. let type = this.getResType(path);
  15204. if (type == EResType.nromal)
  15205. this.loadNromal(path);
  15206. else if (type == EResType.td)
  15207. this.loadTd(path);
  15208. }
  15209. }
  15210. getRes(path) {
  15211. let type = this.getResType(path);
  15212. if (type == EResType.nromal)
  15213. return Laya.loader.getRes(path);
  15214. else if (type == EResType.td) {
  15215. let res = this.tdResMap[path];
  15216. if (res)
  15217. return res.clone();
  15218. return null;
  15219. }
  15220. }
  15221. destroy() {
  15222. this.progressHander.clear();
  15223. this.progressHander = null;
  15224. }
  15225. clearRes(path) {
  15226. let type = this.getResType(path);
  15227. if (type == EResType.nromal)
  15228. Laya.loader.clearRes(path);
  15229. else if (type == EResType.td) {
  15230. let obj = this.tdResMap[path];
  15231. if (obj)
  15232. obj.destroy();
  15233. delete this.tdResMap[path];
  15234. }
  15235. }
  15236. getResType(path) {
  15237. let exs = this.getExtension(path);
  15238. if (exs == "sk")
  15239. return EResType.sk;
  15240. if (exs == "ls" || exs == "lh" || exs == "lm")
  15241. return EResType.td;
  15242. else
  15243. return EResType.nromal;
  15244. }
  15245. getExtension(res) {
  15246. var index = res.lastIndexOf(".");
  15247. return res.substr(index + 1);
  15248. }
  15249. loadNromal(path) {
  15250. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15251. if (res) {
  15252. this.onLoad();
  15253. }
  15254. else
  15255. console.log("load res fail:" + path);
  15256. }), this.progressHander);
  15257. }
  15258. loadSk() {
  15259. }
  15260. loadTd(path) {
  15261. if (this.tdResMap[path]) {
  15262. this.onLoad();
  15263. return;
  15264. }
  15265. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15266. if (res) {
  15267. this.tdResMap[path] = res;
  15268. this.onLoad();
  15269. }
  15270. else
  15271. console.log("load res fail:" + path);
  15272. }));
  15273. }
  15274. onLoad() {
  15275. this.loadCount++;
  15276. this.onProgress(1);
  15277. if (this.loadCount >= this.resCount) {
  15278. this.completrCall.run();
  15279. }
  15280. }
  15281. onProgress(pro) {
  15282. let progress = (this.loadCount + pro) / this.resCount;
  15283. this.progressCall.runWith(progress);
  15284. }
  15285. }
  15286. var Handler$2 = Laya.Handler;
  15287. class ResInfo {
  15288. constructor() {
  15289. this.index = 0;
  15290. }
  15291. }
  15292. class ResMgr {
  15293. constructor() {
  15294. this.resList = [];
  15295. this.doneList = [];
  15296. this.resMap = {};
  15297. this.currentLoad = null;
  15298. this.completeHandler = new Handler$2(this, this.onComplete);
  15299. this.progressHandler = new Handler$2(this, this.onProgress);
  15300. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15301. }
  15302. static getInstance() {
  15303. if (ResMgr._instance == null) {
  15304. ResMgr._instance = new ResMgr();
  15305. }
  15306. return ResMgr._instance;
  15307. }
  15308. loadList(list, completeHandler, progressHandler) {
  15309. if (list.length < 1) {
  15310. completeHandler.run();
  15311. return;
  15312. }
  15313. let info = this.getResInfo();
  15314. info.resList = list;
  15315. info.completeHandler = completeHandler;
  15316. info.progressHandler = progressHandler;
  15317. this.resList.push(info);
  15318. this.startLoad();
  15319. }
  15320. loadFguiRes(list, completeHandler, progressHandler) {
  15321. Laya.loader.load(list, completeHandler, progressHandler);
  15322. }
  15323. loadAny(list, completeHandler, progressHandler) {
  15324. Laya.loader.load(list, completeHandler, progressHandler);
  15325. }
  15326. load(path, completeHandler, progressHandler) {
  15327. let count = this.resMap[path];
  15328. if (count && count > 0) {
  15329. if (completeHandler)
  15330. completeHandler.run();
  15331. }
  15332. else
  15333. this.loadList([path], completeHandler, progressHandler);
  15334. }
  15335. getRes(path) {
  15336. let res = this.resMap[path];
  15337. if (!res)
  15338. this.showLog("资源不存在:" + path);
  15339. else
  15340. return this.loader.getRes(path);
  15341. }
  15342. clearList(list, force = false) {
  15343. if (!list || list.length < 1)
  15344. return;
  15345. let cr = () => {
  15346. for (const k in list) {
  15347. let v = list[k];
  15348. if (!v)
  15349. continue;
  15350. if (force) {
  15351. this.loader.clearRes(v);
  15352. delete this.resMap[v];
  15353. }
  15354. else {
  15355. let count = this.resMap[v];
  15356. if (count && count > 1) {
  15357. count--;
  15358. this.resMap[v] = count;
  15359. }
  15360. else {
  15361. this.loader.clearRes(v);
  15362. delete this.resMap[v];
  15363. }
  15364. }
  15365. }
  15366. if (!window.hasOwnProperty("ks"))
  15367. Laya.Resource.destroyUnusedResources();
  15368. };
  15369. Laya.timer.clearAll(this);
  15370. Laya.timer.once(2000, this, cr);
  15371. }
  15372. clear3D() {
  15373. for (const k in this.loader.tdResMap) {
  15374. this.loader.clearRes(k);
  15375. if (this.resMap[k])
  15376. delete this.resMap[k];
  15377. }
  15378. if (!window.hasOwnProperty("ks"))
  15379. Laya.Resource.destroyUnusedResources();
  15380. }
  15381. clear(path, force = false) {
  15382. this.clearList([path], force);
  15383. }
  15384. getResInfo() {
  15385. if (this.doneList.length > 0)
  15386. return this.doneList.pop();
  15387. else
  15388. return new ResInfo();
  15389. }
  15390. startLoad() {
  15391. if (this.currentLoad)
  15392. return;
  15393. this.currentLoad = this.resList.pop();
  15394. if (this.currentLoad) {
  15395. this.loader.load(this.currentLoad.resList);
  15396. }
  15397. }
  15398. onComplete() {
  15399. if (!this.currentLoad)
  15400. return;
  15401. for (const k in this.currentLoad.resList) {
  15402. let v = this.currentLoad.resList[k];
  15403. let count = this.resMap[v];
  15404. if (count)
  15405. count++;
  15406. else
  15407. count = 1;
  15408. this.resMap[v] = count;
  15409. }
  15410. if (this.currentLoad.completeHandler)
  15411. this.currentLoad.completeHandler.run();
  15412. this.doneList.push(this.currentLoad);
  15413. this.currentLoad = null;
  15414. this.startLoad();
  15415. }
  15416. onProgress(pro) {
  15417. if (!this.currentLoad)
  15418. return;
  15419. if (this.currentLoad.progressHandler)
  15420. this.currentLoad.progressHandler.runWith(pro);
  15421. }
  15422. showLog(str, ...args) {
  15423. console.log("[ResLoader] " + str);
  15424. }
  15425. }
  15426. ResMgr._instance = null;
  15427. class EventMgr extends Laya.EventDispatcher {
  15428. }
  15429. let eventMgr = new EventMgr();
  15430. class ConfigMgr {
  15431. static getInstance() {
  15432. if (!this._instance) {
  15433. this._instance = new ConfigMgr();
  15434. }
  15435. return this._instance;
  15436. }
  15437. init() {
  15438. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15439. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15440. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15441. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15442. }
  15443. getUserInfoByIndex(index) {
  15444. return this.npcJson[index];
  15445. }
  15446. getRandomUserInfo() {
  15447. let index = xGame.tools.random(0, this.npcJson.length);
  15448. return this.npcJson[index];
  15449. }
  15450. getMaxBigMoveLength() {
  15451. return Object.keys(this.levelCfg).length;
  15452. }
  15453. getBigMoveLevelByIndex(index) {
  15454. let cfg = this.levelCfg;
  15455. cfg = cfg[index];
  15456. return cfg;
  15457. }
  15458. getRandomClassicLevel() {
  15459. let cfg = this.classicCfg;
  15460. let num = Object.keys(cfg).length;
  15461. let rand = xGame.common.randomNum(1, num);
  15462. return cfg[rand];
  15463. }
  15464. getPlaceBallByLevel(level) {
  15465. return this.placeBallCfg[level];
  15466. }
  15467. getMaxPlaceBall() {
  15468. return Object.keys(this.placeBallCfg).length;
  15469. }
  15470. }
  15471. class PoolD3Mgr {
  15472. constructor() {
  15473. this.pool = {};
  15474. }
  15475. static get ins() {
  15476. return this._ins || (this._ins = new PoolD3Mgr);
  15477. }
  15478. createList(key, prefab, parent) {
  15479. if (!this.pool[key]) {
  15480. this.pool[key] = {};
  15481. this.pool[key].prefab = prefab;
  15482. this.pool[key].list = [];
  15483. this.pool[key].parent = parent;
  15484. }
  15485. }
  15486. getItem(key) {
  15487. if (!this.pool[key]) {
  15488. return;
  15489. }
  15490. let temp;
  15491. if (this.pool[key].list.length > 0) {
  15492. temp = this.pool[key].list.pop();
  15493. }
  15494. else {
  15495. temp = this.pool[key].prefab.clone();
  15496. if (this.pool[key].parent) {
  15497. this.pool[key].parent.addChild(temp);
  15498. }
  15499. }
  15500. temp.active = true;
  15501. return temp;
  15502. }
  15503. putItem(key, obj) {
  15504. if (!this.pool[key]) {
  15505. return;
  15506. }
  15507. obj.active = false;
  15508. this.pool[key].list.push(obj);
  15509. }
  15510. }
  15511. let context$1 = context;
  15512. let uiMgr = UIMgr.inst;
  15513. let soundMgr = SoundMgr.getInstance();
  15514. let resMgr = ResMgr.getInstance();
  15515. let httpMgr = HttpMgr.getInstance();
  15516. let common = Common.getInstance();
  15517. let cfgMgr = ConfigMgr.getInstance();
  15518. let poolD3Mgr = PoolD3Mgr.ins;
  15519. let d3TexUrl = "res/d3Res/";
  15520. let d3ModeUrl = "res/unityRes/";
  15521. function setStageSize(view) {
  15522. if (view.width) {
  15523. view.width = Laya.stage.width;
  15524. view.height = Laya.stage.height;
  15525. }
  15526. }
  15527. function filledBg(view) {
  15528. let wh = Laya.stage.height / Laya.stage.width;
  15529. if (wh > 16 / 9) {
  15530. view.height = Laya.stage.height;
  15531. view.width = Laya.stage.height / 1334 * 750;
  15532. }
  15533. else {
  15534. view.width = Laya.stage.width;
  15535. view.height = Laya.stage.width / 750 * 1334;
  15536. }
  15537. }
  15538. function setNotch(view) {
  15539. if (view.height) {
  15540. view.y += context$1.notchHeight;
  15541. }
  15542. }
  15543. function showTip(str) {
  15544. uiMgr.Show(UIMsg, str);
  15545. }
  15546. function log(...args) {
  15547. console.log(args);
  15548. }
  15549. let xGame = {
  15550. context: context$1,
  15551. eventMgr,
  15552. resMgr,
  15553. uiMgr,
  15554. soundMgr,
  15555. define,
  15556. tools,
  15557. httpMgr,
  15558. d3TexUrl,
  15559. d3ModeUrl,
  15560. common,
  15561. cfgMgr,
  15562. poolD3Mgr,
  15563. setStageSize,
  15564. filledBg,
  15565. setNotch,
  15566. showTip,
  15567. log,
  15568. };
  15569. window["xGame"] = xGame;
  15570. let dataName = 'tBall_';
  15571. class UserData {
  15572. constructor() {
  15573. this.userId = "";
  15574. this.isAgree = false;
  15575. this.coinNum = 0;
  15576. this.gemNum = 0;
  15577. this.sound = true;
  15578. this.vibration = true;
  15579. this.currentDate = 0;
  15580. this.createTime = 0;
  15581. this.awardTime = 0;
  15582. this.roleId = 1;
  15583. this.roleList = [];
  15584. this.roleAds = [];
  15585. this.dressId = 101;
  15586. this.itemId = 201;
  15587. this.bigSkills = [1, 1, 1, 1, 1];
  15588. this.coin = 4000;
  15589. this.diamond = 0;
  15590. this.skillSuccessTimes = 0;
  15591. this.skillGuide = 0;
  15592. this.skillAccTimes = 0;
  15593. this.placeBallData = [];
  15594. this.shareDiamondTimes = 0;
  15595. this.dailyVideoShareTimes = 0;
  15596. this.secretary = [1, 0];
  15597. this.curSecretary = 0;
  15598. this.ballRod = [1, 0, 0, 0, 0, 1];
  15599. this.curBallRod = 5;
  15600. this.signData = 0;
  15601. this.signTime = 0;
  15602. this.drawTimes = 0;
  15603. this.drawAwardTimes = 0;
  15604. this.dailyfreeDrawTimes = 1;
  15605. this.power = 5;
  15606. this.powerTime = 0;
  15607. this.challengeTimes = 0;
  15608. this.extraSign = 0;
  15609. this.classicTimes = 0;
  15610. this.guideHelpLine = 0;
  15611. this.newUser = true;
  15612. this.rootBallFoul = 0;
  15613. this.timeoutFoul = 0;
  15614. this.roleList = [1];
  15615. }
  15616. saveData() {
  15617. let data = {};
  15618. for (let k in this) {
  15619. data[k.toString()] = this[k];
  15620. }
  15621. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15622. }
  15623. getData() {
  15624. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15625. if (ld) {
  15626. let localData = JSON.parse(ld);
  15627. if (localData) {
  15628. for (let k in this) {
  15629. let key = k.toString();
  15630. let data = localData[key];
  15631. if (data != undefined) {
  15632. this[k] = data;
  15633. }
  15634. }
  15635. }
  15636. }
  15637. }
  15638. }
  15639. class ItemData {
  15640. constructor() {
  15641. this.itemList = {};
  15642. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15643. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15644. }
  15645. saveData() {
  15646. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15647. }
  15648. getData() {
  15649. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15650. if (ld) {
  15651. let localData = JSON.parse(ld);
  15652. if (localData) {
  15653. this.itemList = localData;
  15654. }
  15655. }
  15656. }
  15657. }
  15658. class GameData {
  15659. constructor() {
  15660. this.curLevel = 0;
  15661. this.gameType = 1;
  15662. this.signIdx = 0;
  15663. this.signMax = 0;
  15664. this.rotaryTime = 0;
  15665. this.rotaryCount = 0;
  15666. this.rotaryList = [];
  15667. this.diyCount = 3;
  15668. this.awardIdx = 0;
  15669. this.shareNum = 2;
  15670. this.rankWeek = 0;
  15671. this.rankScore = 0;
  15672. this.gameCount = 0;
  15673. this.trySkill = -1;
  15674. this.tryTime = 0;
  15675. }
  15676. saveData() {
  15677. let data = {};
  15678. for (let k in this) {
  15679. data[k.toString()] = this[k];
  15680. }
  15681. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15682. }
  15683. getData() {
  15684. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15685. if (ld) {
  15686. let localData = JSON.parse(ld);
  15687. if (localData) {
  15688. for (let k in this) {
  15689. let key = k.toString();
  15690. let data = localData[key];
  15691. if (data != undefined) {
  15692. this[k] = data;
  15693. }
  15694. }
  15695. }
  15696. }
  15697. }
  15698. }
  15699. class DataMgr {
  15700. static Init() {
  15701. this.userData = new UserData();
  15702. this.gameData = new GameData();
  15703. this.itemData = new ItemData();
  15704. this.userData.getData();
  15705. this.gameData.getData();
  15706. this.itemData.getData();
  15707. this.roleId = this.userData.roleId;
  15708. this.resetUse();
  15709. }
  15710. static isNewDay() {
  15711. Moyu.isNewDay(this, (isnew) => {
  15712. xGame.common.isNewDay = isnew;
  15713. if (!isnew)
  15714. return;
  15715. DataMgr.setShareDiamondTimes(0, false);
  15716. DataMgr.setDailyVideoShareTimes(0, false);
  15717. DataMgr.setDailyfreeDrawTimes(1);
  15718. DataMgr.setExtraSign(0);
  15719. });
  15720. }
  15721. static deletData() {
  15722. Laya.LocalStorage.clear();
  15723. }
  15724. static upRankData() {
  15725. let num = xGame.common.getAllStarNum();
  15726. if (num > 0)
  15727. Moyu.upRankData(xGame.common.curRankID, num);
  15728. }
  15729. static addItem(id, count = 1) {
  15730. let v = this.itemData.itemList[id];
  15731. if (!v)
  15732. v = { id: id, count: count, adnum: 0, active: true };
  15733. else {
  15734. if (v.active) {
  15735. v.count += count;
  15736. }
  15737. else {
  15738. v.count = count;
  15739. v.active = true;
  15740. }
  15741. }
  15742. this.itemData.itemList[id] = v;
  15743. xGame.soundMgr.playGetSound();
  15744. this.saveItemData();
  15745. }
  15746. static hasItem(id) {
  15747. let v = this.itemData.itemList[id];
  15748. if (v && v.active)
  15749. return true;
  15750. return false;
  15751. }
  15752. static getItem(id) {
  15753. let v = this.itemData.itemList[id];
  15754. return v;
  15755. }
  15756. static getItemCount(id) {
  15757. let v = this.itemData.itemList[id];
  15758. if (v && v.active)
  15759. return v.count;
  15760. return 0;
  15761. }
  15762. static getItemAd(id) {
  15763. let v = this.itemData.itemList[id];
  15764. if (v) {
  15765. return v.adnum;
  15766. }
  15767. return 0;
  15768. }
  15769. static onItemAd(id, num = 1) {
  15770. let v = this.itemData.itemList[id];
  15771. if (!v)
  15772. v = { id: id, count: 1, adnum: num, active: false };
  15773. else
  15774. v.adnum += num;
  15775. this.itemData.itemList[id] = v;
  15776. this.saveItemData();
  15777. }
  15778. static costItem(id, count) {
  15779. let v = this.itemData.itemList[id];
  15780. if (v && v.active) {
  15781. if (v.count < count)
  15782. return false;
  15783. else {
  15784. v.count -= count;
  15785. this.itemData.itemList[id] = v;
  15786. return true;
  15787. }
  15788. }
  15789. return false;
  15790. }
  15791. static resetUse() {
  15792. this.dressId = this.userData.dressId;
  15793. this.itemId = this.userData.itemId;
  15794. }
  15795. static passLevel() {
  15796. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15797. this.gameData.curLevel++;
  15798. this.curLevel = this.gameData.curLevel;
  15799. this.saveGameData();
  15800. }
  15801. static useRole(id) {
  15802. this.roleId = id;
  15803. if (this.hasRole(id)) {
  15804. this.userData.roleId = id;
  15805. this.saveUserData();
  15806. }
  15807. }
  15808. static addRole(id) {
  15809. if (this.hasRole(id))
  15810. return;
  15811. this.userData.roleList.push(id);
  15812. this.saveUserData();
  15813. }
  15814. static hasRole(id) {
  15815. return this.userData.roleList.indexOf(id) >= 0;
  15816. }
  15817. static gemEnough(num) {
  15818. return this.userData.gemNum >= num;
  15819. }
  15820. static roleHasAd(id) {
  15821. let count = this.userData.roleAds[id];
  15822. if (count != undefined && count >= 0)
  15823. return true;
  15824. else
  15825. return false;
  15826. }
  15827. static saveUserData(time = 1000, event, arg) {
  15828. if (this.userSaving)
  15829. return;
  15830. this.userSaving = true;
  15831. Laya.timer.once(time, this, () => {
  15832. this.userSaving = false;
  15833. this.userData.saveData();
  15834. if (event)
  15835. xGame.eventMgr.event(event, arg);
  15836. });
  15837. }
  15838. static saveGameData() {
  15839. if (this.gameSaving)
  15840. return;
  15841. this.gameSaving = true;
  15842. Laya.timer.once(1000, this, () => {
  15843. this.gameSaving = false;
  15844. this.gameData.saveData();
  15845. });
  15846. }
  15847. static saveItemData() {
  15848. let fun = () => {
  15849. this.itemData.saveData();
  15850. };
  15851. Laya.timer.clear(this, fun);
  15852. Laya.timer.once(500, this, fun);
  15853. }
  15854. static saveData() {
  15855. this.saveUserData();
  15856. this.saveGameData();
  15857. }
  15858. static getBigSkillList() {
  15859. return this.userData.bigSkills;
  15860. }
  15861. static getBigSkillByIndex(index) {
  15862. return this.userData.bigSkills[index];
  15863. }
  15864. static setBigSkill(index, val, addUp = true) {
  15865. if (addUp) {
  15866. this.userData.bigSkills[index] += val;
  15867. }
  15868. else {
  15869. this.userData.bigSkills[index] = val;
  15870. }
  15871. this.saveUserData();
  15872. }
  15873. static coinEnough(need) {
  15874. if (typeof need != "number") {
  15875. console.error("金币格式错误");
  15876. return;
  15877. }
  15878. return this.userData.coin >= need;
  15879. }
  15880. static setCoin(val) {
  15881. if (typeof val != "number") {
  15882. return;
  15883. }
  15884. this.userData.coin += val;
  15885. this.saveUserData();
  15886. xGame.eventMgr.event(COIN_CHANGE);
  15887. }
  15888. static getCoin() {
  15889. return this.userData.coin;
  15890. }
  15891. static diamondEnough(need) {
  15892. if (typeof need != "number") {
  15893. console.error("金币格式错误");
  15894. return;
  15895. }
  15896. return this.userData.diamond >= need;
  15897. }
  15898. static setDiamond(val) {
  15899. if (typeof val != "number") {
  15900. return;
  15901. }
  15902. this.userData.diamond += val;
  15903. this.saveUserData();
  15904. xGame.eventMgr.event(DIAMOND_CHANGE);
  15905. }
  15906. static getDiamond() {
  15907. return this.userData.diamond;
  15908. }
  15909. static getSkillSuccessTimes() {
  15910. return this.userData.skillSuccessTimes;
  15911. }
  15912. static setSkillSuccessTimes(val, addUp = true) {
  15913. if (addUp)
  15914. this.userData.skillSuccessTimes += val;
  15915. else
  15916. this.userData.skillSuccessTimes = val;
  15917. this.saveUserData();
  15918. }
  15919. static getSkillAccTimes() {
  15920. return this.userData.skillAccTimes;
  15921. }
  15922. static setSkillAccTimes(val) {
  15923. this.userData.skillAccTimes += val;
  15924. this.saveUserData();
  15925. }
  15926. static getSkillGuide() {
  15927. if (!xGame.common.openGuide) {
  15928. return 1;
  15929. }
  15930. return this.userData.skillGuide;
  15931. }
  15932. static setSkillGuide(val) {
  15933. this.userData.skillGuide = val;
  15934. this.saveUserData();
  15935. }
  15936. static getPlaceBallLevelList() {
  15937. return this.userData.placeBallData;
  15938. }
  15939. static getPlaceBallLevel(level) {
  15940. let arr = this.userData.placeBallData;
  15941. let index = level - 1;
  15942. let out;
  15943. if (arr[index]) {
  15944. out = arr[index];
  15945. }
  15946. else {
  15947. let max = arr.length;
  15948. if (max == index) {
  15949. out = {
  15950. star: 0,
  15951. play: true,
  15952. isCur: true,
  15953. getAward: false
  15954. };
  15955. }
  15956. else {
  15957. out = {
  15958. star: 0,
  15959. play: false,
  15960. getAward: false
  15961. };
  15962. }
  15963. }
  15964. return out;
  15965. }
  15966. static setPlaceBallLevel(level, star) {
  15967. let arr = this.userData.placeBallData;
  15968. let index = level - 1;
  15969. if (arr[index]) {
  15970. arr[index].star = Math.max(arr[index].star, star);
  15971. }
  15972. else {
  15973. let max = arr.length;
  15974. if (max == index) {
  15975. arr.push({
  15976. star: star,
  15977. play: true,
  15978. getAward: false
  15979. });
  15980. }
  15981. else {
  15982. console.error("关卡存储出错");
  15983. }
  15984. }
  15985. this.saveUserData();
  15986. }
  15987. static setPlaceBallAward(level) {
  15988. let arr = this.userData.placeBallData;
  15989. let index = level - 1;
  15990. if (arr[index]) {
  15991. arr[index].getAward = true;
  15992. }
  15993. this.saveUserData();
  15994. }
  15995. static getShareDiamondTimes() {
  15996. return this.userData.shareDiamondTimes;
  15997. }
  15998. static setShareDiamondTimes(val, addUp = true) {
  15999. if (addUp) {
  16000. this.userData.shareDiamondTimes += val;
  16001. }
  16002. else {
  16003. this.userData.shareDiamondTimes = val;
  16004. }
  16005. this.saveUserData();
  16006. }
  16007. static getDailyVideoShareTimes() {
  16008. return this.userData.dailyVideoShareTimes;
  16009. }
  16010. static setDailyVideoShareTimes(val, addUp = true) {
  16011. if (addUp) {
  16012. this.userData.dailyVideoShareTimes += val;
  16013. }
  16014. else {
  16015. this.userData.dailyVideoShareTimes = val;
  16016. }
  16017. this.saveUserData();
  16018. }
  16019. static getSecretary(index) {
  16020. return this.userData.secretary[index];
  16021. }
  16022. static setSecretary(index, val) {
  16023. this.userData.secretary[index] = val;
  16024. this.saveUserData();
  16025. }
  16026. static getCurSecretary() {
  16027. return this.userData.curSecretary;
  16028. }
  16029. static setCurSecretary(index) {
  16030. this.userData.curSecretary = index;
  16031. this.saveUserData();
  16032. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16033. }
  16034. static getBallRod(index) {
  16035. return this.userData.ballRod[index];
  16036. }
  16037. static setBallRod(index, val) {
  16038. this.userData.ballRod[index] = val;
  16039. this.saveUserData();
  16040. }
  16041. static getCurBallRod() {
  16042. return this.userData.curBallRod;
  16043. }
  16044. static setCurBallRod(index) {
  16045. this.userData.curBallRod = index;
  16046. this.saveUserData();
  16047. }
  16048. static setSignData(val) {
  16049. this.userData.signData = val;
  16050. this.saveUserData();
  16051. }
  16052. static getSignData() {
  16053. return this.userData.signData;
  16054. }
  16055. static setSignTime(val) {
  16056. this.userData.signTime = val;
  16057. this.saveUserData();
  16058. }
  16059. static getSignTime() {
  16060. return this.userData.signTime;
  16061. }
  16062. static getDrawTimes() {
  16063. return this.userData.drawTimes;
  16064. }
  16065. static setDrawTimes(val, addUp = true) {
  16066. if (addUp) {
  16067. this.userData.drawTimes += val;
  16068. }
  16069. else {
  16070. this.userData.drawTimes = val;
  16071. }
  16072. this.saveUserData();
  16073. }
  16074. static getDrawAwardTimes() {
  16075. return this.userData.drawAwardTimes;
  16076. }
  16077. static setDrawAwardTimes(val) {
  16078. this.userData.drawAwardTimes = val;
  16079. this.saveUserData();
  16080. }
  16081. static getDailyfreeDrawTimes() {
  16082. return this.userData.dailyfreeDrawTimes;
  16083. }
  16084. static setDailyfreeDrawTimes(val) {
  16085. this.userData.dailyfreeDrawTimes = val;
  16086. this.saveUserData();
  16087. }
  16088. static setPower(val, addUp = true) {
  16089. if (addUp)
  16090. this.userData.power += val;
  16091. else
  16092. this.userData.power = val;
  16093. if (this.userData.power >= xGame.common.maxPower) {
  16094. this.userData.power = xGame.common.maxPower;
  16095. }
  16096. xGame.eventMgr.event(POWER_CHANGE, val);
  16097. this.saveUserData();
  16098. }
  16099. static getPower() {
  16100. return this.userData.power;
  16101. }
  16102. static setPowerTime(val) {
  16103. this.userData.powerTime = val;
  16104. this.saveUserData();
  16105. }
  16106. static getPowerTime() {
  16107. return this.userData.powerTime;
  16108. }
  16109. static powerEnough() {
  16110. return this.getPower() > 0;
  16111. }
  16112. static getChallengeTimes() {
  16113. return this.userData.challengeTimes;
  16114. }
  16115. static setChallengeTimes(val) {
  16116. this.userData.challengeTimes += val;
  16117. this.saveUserData();
  16118. }
  16119. static getExtraSign() {
  16120. return this.userData.extraSign;
  16121. }
  16122. static setExtraSign(val) {
  16123. this.userData.extraSign = val;
  16124. this.saveUserData();
  16125. }
  16126. static getClassicTimes() {
  16127. return this.userData.classicTimes;
  16128. }
  16129. static setClassicTimes() {
  16130. this.userData.classicTimes += 1;
  16131. this.saveUserData();
  16132. }
  16133. static getGuideHelpLine() {
  16134. return this.userData.guideHelpLine;
  16135. }
  16136. static setGuideHelpLine() {
  16137. this.userData.guideHelpLine = 1;
  16138. this.saveUserData();
  16139. }
  16140. static getNewUser() {
  16141. return this.userData.newUser;
  16142. }
  16143. static setNewUser() {
  16144. this.userData.newUser = false;
  16145. this.saveUserData();
  16146. }
  16147. static getRootBallFoul() {
  16148. return this.userData.rootBallFoul;
  16149. }
  16150. static setRootBallFoul() {
  16151. this.userData.rootBallFoul = 1;
  16152. this.saveUserData();
  16153. }
  16154. static getTimeoutFoul() {
  16155. return this.userData.timeoutFoul;
  16156. }
  16157. static setTimeoutFoul() {
  16158. this.userData.timeoutFoul = 1;
  16159. this.saveUserData();
  16160. }
  16161. }
  16162. DataMgr.isNewUser = false;
  16163. DataMgr.fristEnter = true;
  16164. DataMgr.levelType = 0;
  16165. DataMgr.awardId = 0;
  16166. DataMgr.awardCoin = 0;
  16167. DataMgr.sceneId = -1;
  16168. DataMgr.tryId = 0;
  16169. DataMgr.curLevel = 1;
  16170. DataMgr.vipLevel = 0;
  16171. DataMgr.maxLevel = 0;
  16172. DataMgr.awardRatio = 1;
  16173. DataMgr.gameList = [];
  16174. DataMgr.rankList = [];
  16175. DataMgr.recoverTime = 480000;
  16176. DataMgr.minScore = 0;
  16177. DataMgr.rankDis = 0;
  16178. DataMgr.userSaving = false;
  16179. DataMgr.gameSaving = false;
  16180. class D3Tween extends Laya.Script3D {
  16181. constructor() {
  16182. super();
  16183. this.isInited = false;
  16184. }
  16185. ;
  16186. init() {
  16187. if (this.isInited)
  16188. return;
  16189. this.isInited = true;
  16190. this.gameObj = this.owner;
  16191. this.transform = this.gameObj.transform;
  16192. }
  16193. get rotX() {
  16194. return this.transform.localRotationEulerX;
  16195. }
  16196. set rotX(v) {
  16197. this.transform.localRotationEulerX = v;
  16198. }
  16199. get rotY() {
  16200. return this.transform.localRotationEulerY;
  16201. }
  16202. set rotY(v) {
  16203. this.transform.localRotationEulerY = v;
  16204. }
  16205. get rotZ() {
  16206. return this.transform.localRotationEulerZ;
  16207. }
  16208. set rotZ(v) {
  16209. this.transform.localRotationEulerZ = v;
  16210. }
  16211. get posX() {
  16212. return this.transform.localPositionX;
  16213. }
  16214. set posX(v) {
  16215. this.transform.localPositionX = v;
  16216. }
  16217. get posY() {
  16218. return this.transform.localPositionY;
  16219. }
  16220. set posY(v) {
  16221. this.transform.localPositionY = v;
  16222. }
  16223. get posZ() {
  16224. return this.transform.localPositionZ;
  16225. }
  16226. set posZ(v) {
  16227. this.transform.localPositionZ = v;
  16228. }
  16229. get rotation() {
  16230. return this.transform.localRotation;
  16231. }
  16232. set rotation(v) {
  16233. this.transform.localRotation = v;
  16234. }
  16235. }
  16236. class D2Hole extends Laya.Script {
  16237. constructor() { super(); }
  16238. onTriggerEnter(collider) {
  16239. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16240. return;
  16241. }
  16242. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16243. if (collider.owner["mySrc"].isRunSkillAni) {
  16244. return;
  16245. }
  16246. if (collider.owner["mySrc"].number != 0) {
  16247. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16248. }
  16249. xGame.common.ballColliHole(collider);
  16250. xGame.common.recoverCameraView();
  16251. }
  16252. }
  16253. }
  16254. class Table extends Laya.Script3D {
  16255. constructor() {
  16256. super();
  16257. this.isSetBorder = false;
  16258. this.inited = false;
  16259. }
  16260. ;
  16261. onAwake() {
  16262. this.init();
  16263. }
  16264. init() {
  16265. if (this.inited)
  16266. return;
  16267. this.inited = true;
  16268. this.gameObj = this.owner;
  16269. this.border = this.gameObj.getChildByName("border");
  16270. }
  16271. setBorderPos() {
  16272. if (this.isSetBorder)
  16273. return;
  16274. this.isSetBorder = true;
  16275. let ui = xGame.common.gameUI.ui;
  16276. let bar1 = this.border.getChildByName("bar1");
  16277. let bar2 = this.border.getChildByName("bar2");
  16278. let bar3 = this.border.getChildByName("bar3");
  16279. let bar4 = this.border.getChildByName("bar4");
  16280. let bar5 = this.border.getChildByName("bar5");
  16281. let bar6 = this.border.getChildByName("bar6");
  16282. this.setInfo(bar1, ui.border.bar1, "box");
  16283. this.setInfo(bar2, ui.border.bar2, "box");
  16284. this.setInfo(bar3, ui.border.bar3, "box");
  16285. this.setInfo(bar4, ui.border.bar4, "box");
  16286. this.setInfo(bar5, ui.border.bar5, "box");
  16287. this.setInfo(bar6, ui.border.bar6, "box");
  16288. let circle1 = this.border.getChildByName("circle1");
  16289. let circle2 = this.border.getChildByName("circle2");
  16290. let circle3 = this.border.getChildByName("circle3");
  16291. let circle4 = this.border.getChildByName("circle4");
  16292. let circle5 = this.border.getChildByName("circle5");
  16293. let circle6 = this.border.getChildByName("circle6");
  16294. this.setInfo(circle1, ui.border.circle1, "circle");
  16295. this.setInfo(circle2, ui.border.circle2, "circle");
  16296. this.setInfo(circle3, ui.border.circle3, "circle");
  16297. this.setInfo(circle4, ui.border.circle4, "circle");
  16298. this.setInfo(circle5, ui.border.circle5, "circle");
  16299. this.setInfo(circle6, ui.border.circle6, "circle");
  16300. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16301. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16302. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16303. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16304. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16305. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16306. let arr = xGame.common.gameMgr.holePosList;
  16307. xGame.common.gameMgr.posObj = {
  16308. "1": arr[0],
  16309. "3": arr[2],
  16310. "4": arr[3],
  16311. "6": arr[5]
  16312. };
  16313. }
  16314. initHolePos(x, y) {
  16315. if (x < 300)
  16316. x += 25;
  16317. else if (x > 1000)
  16318. x -= 25;
  16319. else if (y > 200)
  16320. y -= 10;
  16321. else
  16322. y += 10;
  16323. if (y < 200)
  16324. y += 30;
  16325. else if (y > 500)
  16326. y -= 30;
  16327. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16328. }
  16329. setInfo(d3Obj, d2Obj, type) {
  16330. let ui = xGame.common.gameUI.ui;
  16331. let sprite = new Laya.Sprite();
  16332. ui.border.displayObject.addChild(sprite);
  16333. let colli = xGame.common.getCollider(type);
  16334. sprite.addComponentIntance(colli);
  16335. let rigy = xGame.common.getRigbody();
  16336. rigy.type = "static";
  16337. sprite.addComponentIntance(rigy);
  16338. let d3Pos = d3Obj.transform.position;
  16339. xGame.common.pos3to2Convert(d3Pos);
  16340. let scaleX = d3Obj.transform.localScaleX;
  16341. let scaleZ = d3Obj.transform.localScaleZ;
  16342. let width = xGame.common.scale3to2Convert(scaleZ);
  16343. let height = xGame.common.scale3to2Convert(scaleX);
  16344. sprite.pivotX = width / 2;
  16345. sprite.pivotY = height / 2;
  16346. sprite.x = d3Pos.x;
  16347. sprite.y = d3Pos.y;
  16348. sprite.width = width;
  16349. sprite.height = height;
  16350. d2Obj.x = d3Pos.x;
  16351. d2Obj.y = d3Pos.y;
  16352. d2Obj.width = width;
  16353. d2Obj.height = height;
  16354. if (type == "box") {
  16355. colli.width = width;
  16356. colli.height = height;
  16357. colli.isSensor = false;
  16358. colli.label = "border";
  16359. }
  16360. else {
  16361. colli.radius = width / 2;
  16362. colli.isSensor = true;
  16363. colli.label = "hole";
  16364. sprite.addComponent(D2Hole);
  16365. }
  16366. }
  16367. }
  16368. class D3World extends Laya.Script3D {
  16369. constructor() {
  16370. super();
  16371. this.loadNum = 0;
  16372. this.setLoadNum = 7;
  16373. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16374. }
  16375. onAwake() {
  16376. }
  16377. loadScene() {
  16378. this.scene = this.owner;
  16379. let url = `res/unityRes/root.lh`;
  16380. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16381. this.scene.addChild(prefab);
  16382. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16383. this.putCameraInfo();
  16384. this.camera.enableHDR = false;
  16385. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16386. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16387. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16388. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16389. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16390. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16391. this.knife.active = false;
  16392. this.loadD3Obj();
  16393. }));
  16394. }
  16395. putCameraInfo() {
  16396. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16397. this.cameraObj = new cameraType();
  16398. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16399. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16400. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16401. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16402. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16403. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16404. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16405. this.visitAngleChild.init();
  16406. this.visitRootObj.posX = this.visitAngleChild.posX;
  16407. this.visitRootObj.posY = this.visitAngleChild.posY;
  16408. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16409. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16410. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16411. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16412. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16413. xGame.common.showOneCamera("mainCamera");
  16414. }
  16415. loadD3Obj() {
  16416. this.loadTable();
  16417. this.loadRoom();
  16418. this.loadInHoleParticial();
  16419. this.loadIceParticial();
  16420. this.loadHitParticial();
  16421. this.loadFireworksParticial();
  16422. this.loadBall();
  16423. }
  16424. loadInHoleParticial() {
  16425. this.loadD3Res("inHoleEft", "", (prefab) => {
  16426. prefab.addComponent(Partical);
  16427. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16428. });
  16429. }
  16430. loadIceParticial() {
  16431. this.loadD3Res("iceEft", "", (prefab) => {
  16432. prefab.addComponent(Partical);
  16433. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16434. });
  16435. }
  16436. loadHitParticial() {
  16437. this.loadD3Res("hitEft", "", (prefab) => {
  16438. prefab.addComponent(Partical);
  16439. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16440. });
  16441. }
  16442. loadFireworksParticial() {
  16443. this.loadD3Res("fireworksEft", "", (prefab) => {
  16444. prefab.addComponent(Partical);
  16445. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16446. });
  16447. }
  16448. loadBall(index = 1) {
  16449. this.loadD3Res("ball", index, (prefab) => {
  16450. this.ballPrefab = prefab;
  16451. this.ballPrefab.addComponent(Ball);
  16452. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16453. });
  16454. }
  16455. loadTable(index = 1) {
  16456. this.loadD3Res("table", index, (prefab) => {
  16457. this.tableSrc = prefab.addComponent(Table);
  16458. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16459. this.d3Hand.init();
  16460. this.tableRoot.addChild(prefab);
  16461. });
  16462. }
  16463. loadRoom(index = 1) {
  16464. this.loadD3Res("room", index, (prefab) => {
  16465. this.roomRoot.addChild(prefab);
  16466. });
  16467. }
  16468. loadD3Res(type, index, callback) {
  16469. let url = `res/unityRes/${type}${index}.lh`;
  16470. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16471. callback && callback(prefab);
  16472. this.checkResLoad();
  16473. }));
  16474. }
  16475. checkResLoad() {
  16476. this.loadNum++;
  16477. if (this.loadNum >= this.setLoadNum) {
  16478. xGame.eventMgr.event(D3RES_LOADED);
  16479. }
  16480. }
  16481. prePlayEft() {
  16482. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16483. eft.transform.localPositionX = 0;
  16484. eft.transform.localPositionY = -5;
  16485. eft.transform.localPositionZ = 0;
  16486. eft.active = true;
  16487. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16488. ice.transform.localPositionX = 0;
  16489. ice.transform.localPositionY = -5;
  16490. ice.transform.localPositionZ = 0;
  16491. ice.active = true;
  16492. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16493. hit.transform.localPositionX = 0;
  16494. hit.transform.localPositionY = -5;
  16495. hit.transform.localPositionZ = 0;
  16496. hit.active = true;
  16497. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16498. fireworks.transform.localPositionX = 0;
  16499. fireworks.transform.localPositionY = -5;
  16500. fireworks.transform.localPositionZ = 0;
  16501. fireworks.active = true;
  16502. }
  16503. }
  16504. class cameraType {
  16505. }
  16506. class MoyuMgr$1 {
  16507. static initMoyu() {
  16508. this.moyuView = new MoyuView$1();
  16509. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16510. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16511. this.moyuView.ui.displayObject.zOrder = 1000;
  16512. this.moyuView.init();
  16513. this.moyuView.showTip(true);
  16514. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16515. window['XApk'] = this;
  16516. }
  16517. static showAge(show) {
  16518. if (this.moyuView)
  16519. this.moyuView.showAge(show);
  16520. }
  16521. static onPlatMsg(idx) {
  16522. if (!MoyuMgr$1.moyuView)
  16523. return;
  16524. if (idx == '0') {
  16525. MoyuMgr$1.moyuView.showTip(false);
  16526. }
  16527. }
  16528. static showAgree(call) {
  16529. if (this.moyuView)
  16530. this.moyuView.showAgree(call);
  16531. else
  16532. call && call();
  16533. }
  16534. static showXy(type = 1) {
  16535. if (this.moyuView)
  16536. this.moyuView.showXy(type);
  16537. }
  16538. }
  16539. MoyuMgr$1.isAdvise = false;
  16540. class MoyuView$1 {
  16541. constructor() {
  16542. this.ysxyNum = 1;
  16543. this.ysJson = null;
  16544. this.ui = ui_UIMoyu.createInstance();
  16545. }
  16546. init() {
  16547. this.ui.mainBg.visible = false;
  16548. this.ui.xyNode.visible = false;
  16549. this.ui.ageNode.visible = false;
  16550. this.ui.tipNode.visible = false;
  16551. this.ui.rnNode.visible = false;
  16552. this.ui.fcmNode.visible = false;
  16553. this.ui.ageTip.visible = false;
  16554. this.ui.msgNode.visible = false;
  16555. this.ui.visible = false;
  16556. this.ui.xyNode.xyList.setVirtual();
  16557. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16558. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16559. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16560. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16561. this.ui.xyNode.btnKnown.visible = false;
  16562. this.ui.xyNode.xy1.visible = false;
  16563. this.ui.xyNode.xy2.visible = false;
  16564. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16565. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16566. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16567. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16568. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16569. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16570. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16571. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16572. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16573. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16574. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16575. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16576. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16577. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16578. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16579. this.ysxyNum = 2;
  16580. }
  16581. }
  16582. onClick(obj) {
  16583. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16584. switch (obj) {
  16585. case this.ui.ageTip:
  16586. if (Moyu.isTTApk) {
  16587. this.ui.ageNode.visible = true;
  16588. this.ui.mainBg.visible = true;
  16589. }
  16590. break;
  16591. case this.ui.tipNode:
  16592. this.showTip(false);
  16593. break;
  16594. case this.ui.ageNode.btnAge:
  16595. this.ui.ageNode.visible = false;
  16596. this.ui.mainBg.visible = false;
  16597. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16598. this.ui.visible = false;
  16599. break;
  16600. case this.ui.xyNode.btnXy3:
  16601. case this.ui.xyNode.btnXy1:
  16602. this.loadXy(1);
  16603. break;
  16604. case this.ui.xyNode.btnXy2:
  16605. this.loadXy(2);
  16606. break;
  16607. case this.ui.xyNode.btnBack:
  16608. this.ui.xyNode.xy1.visible = true;
  16609. this.ui.xyNode.xy2.visible = false;
  16610. break;
  16611. case this.ui.xyNode.btnKnown:
  16612. this.ui.xyNode.visible = false;
  16613. this.ui.mainBg.visible = false;
  16614. this.ui.visible = false;
  16615. break;
  16616. case this.ui.rnNode.btnCheck:
  16617. this.check();
  16618. break;
  16619. case this.ui.rnNode.btnExit:
  16620. case this.ui.xyNode.btnNo:
  16621. this.ysxyNum--;
  16622. if (this.ysxyNum > 0)
  16623. this.showMsg("再次拒绝退出游戏");
  16624. else {
  16625. Moyu.userAgree(false);
  16626. Moyu.exit();
  16627. }
  16628. break;
  16629. case this.ui.xyNode.btnSure:
  16630. case this.ui.xyNode.btnYes:
  16631. DataMgr.userData.isAgree = true;
  16632. DataMgr.saveUserData();
  16633. this.onAgree();
  16634. break;
  16635. case this.ui.rnNode.btnDone:
  16636. this.ui.rnNode.visible = false;
  16637. this.ui.visible = false;
  16638. break;
  16639. case this.ui.fcmNode.btnRn:
  16640. this.showRn();
  16641. break;
  16642. }
  16643. }
  16644. showTip(show) {
  16645. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16646. return;
  16647. if (show) {
  16648. MoyuMgr$1.isAdvise = true;
  16649. this.ui.visible = true;
  16650. this.ui.tipNode.visible = true;
  16651. this.ui.tipNode.alpha = 1;
  16652. Laya.timer.once(1000, this, this.showTip, [false]);
  16653. }
  16654. else {
  16655. this.ui.tipNode.alpha = 1;
  16656. this.ui.tipNode.visible = true;
  16657. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16658. this.ui.tipNode.visible = false;
  16659. MoyuMgr$1.isAdvise = false;
  16660. }), 1000);
  16661. }
  16662. }
  16663. showAge(show, px = 0, py = 0) {
  16664. if (Moyu.platType > 10 && !Moyu.isIos) {
  16665. this.ui.ageTip.x = px;
  16666. this.ui.ageTip.y = py;
  16667. this.ui.ageTip.visible = show;
  16668. if (show)
  16669. this.ui.visible = true;
  16670. }
  16671. }
  16672. showAgree(call) {
  16673. this.agreeCall = call;
  16674. this.onAgree();
  16675. return;
  16676. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16677. this.showXy(0);
  16678. }
  16679. else
  16680. this.onAgree();
  16681. }
  16682. onAgree() {
  16683. if (!this.ui.ageNode.visible)
  16684. this.ui.visible = false;
  16685. this.ui.xyNode.visible = false;
  16686. Moyu.userAgree(true);
  16687. this.showAge(false);
  16688. this.agreeCall && this.agreeCall();
  16689. this.showRn();
  16690. }
  16691. showMsg(txt) {
  16692. this.ui.msgNode.txtMsg.text = txt;
  16693. this.ui.msgNode.visible = true;
  16694. this.ui.msgNode.alpha = 1;
  16695. this.ui.visible = true;
  16696. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16697. this.ui.msgNode.visible = false;
  16698. }), 2500, true);
  16699. }
  16700. showRn() {
  16701. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16702. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16703. this.ui.rnNode.rn1.visible = true;
  16704. this.ui.rnNode.rn2.visible = false;
  16705. this.ui.rnNode.rn3.visible = false;
  16706. this.ui.rnNode.rn4.visible = false;
  16707. this.ui.rnNode.visible = true;
  16708. this.ui.mainBg.visible = true;
  16709. this.ui.rnNode.btnDone.visible = false;
  16710. this.ui.rnNode.btnExit.visible = true;
  16711. this.ui.rnNode.btnCheck.visible = true;
  16712. this.ui.fcmNode.visible = false;
  16713. this.ui.visible = true;
  16714. return;
  16715. }
  16716. }
  16717. this.showFcm();
  16718. }
  16719. showFcm() {
  16720. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16721. Moyu.initFCM(true);
  16722. if (Moyu.gameTime < 1)
  16723. this.fcmLoop();
  16724. else if (Moyu.gameTime < 999)
  16725. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16726. }
  16727. }
  16728. fcmLoop() {
  16729. if (Moyu.gameTime < 1) {
  16730. this.ui.rnNode.visible = false;
  16731. this.ui.fcmNode.visible = true;
  16732. this.ui.mainBg.visible = true;
  16733. this.ui.visible = true;
  16734. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16735. Laya.timer.clear(this.ui, this.fcmLoop);
  16736. }
  16737. }
  16738. check() {
  16739. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16740. this.ui.rnNode.rn1.visible = false;
  16741. this.ui.rnNode.rn2.visible = false;
  16742. this.ui.rnNode.rn4.visible = true;
  16743. }
  16744. else if (this.ui.rnNode.rn4.visible) {
  16745. let name = this.ui.rnNode.inputName.text;
  16746. let code = this.ui.rnNode.inputCode.text;
  16747. if (code && code.length == 18) {
  16748. this.ui.rnNode.rn1.visible = false;
  16749. this.ui.rnNode.rn4.visible = false;
  16750. Moyu.authenticate(name, code, (res) => {
  16751. this.ui.rnNode.rn2.visible = !res;
  16752. this.ui.rnNode.rn3.visible = res;
  16753. this.ui.rnNode.btnDone.visible = res;
  16754. this.ui.rnNode.btnExit.visible = !res;
  16755. this.ui.rnNode.btnCheck.visible = !res;
  16756. if (res)
  16757. this.showFcm();
  16758. });
  16759. }
  16760. else
  16761. this.showMsg("信息填写不完整");
  16762. }
  16763. }
  16764. loadXy(type = 0) {
  16765. this.ui.xyNode.xy1.visible = false;
  16766. this.ui.xyNode.xy2.visible = true;
  16767. this.ui.xyNode.xyList.scrollToView(0);
  16768. if (type == 1) {
  16769. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16770. }
  16771. else if (type == 2) {
  16772. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16773. }
  16774. }
  16775. showXy(type = 0) {
  16776. this.xyBtn();
  16777. if (type == 0) {
  16778. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16779. this.ui.xyNode.btnSure.visible = true;
  16780. }
  16781. else {
  16782. this.ui.xyNode.btnYes.visible = true;
  16783. this.ui.xyNode.btnNo.visible = true;
  16784. }
  16785. }
  16786. else {
  16787. this.ui.xyNode.btnKnown.visible = true;
  16788. this.ui.mainBg.visible = true;
  16789. }
  16790. this.ui.xyNode.xy1.visible = true;
  16791. this.ui.xyNode.xy2.visible = false;
  16792. this.ui.xyNode.visible = true;
  16793. this.ui.visible = true;
  16794. }
  16795. xyBtn() {
  16796. this.ui.xyNode.btnSure.visible = false;
  16797. this.ui.xyNode.btnYes.visible = false;
  16798. this.ui.xyNode.btnNo.visible = false;
  16799. this.ui.xyNode.btnKnown.visible = false;
  16800. {
  16801. this.ui.xyNode.btnXy3.visible = false;
  16802. this.ui.xyNode.btnXy2.visible = true;
  16803. this.ui.xyNode.btnXy1.visible = true;
  16804. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16805. }
  16806. }
  16807. createXY(json) {
  16808. this.ysJson = json.content;
  16809. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16810. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16811. this.ui.xyNode.xy2.visible = true;
  16812. }
  16813. renderListItem(idx, cell) {
  16814. let xy = this.ysJson[idx];
  16815. cell.height = xy.line * 30;
  16816. cell.xyItem.text = xy.text;
  16817. }
  16818. onDestroy() {
  16819. this.agreeCall = null;
  16820. }
  16821. }
  16822. class UILoading extends UIBase {
  16823. constructor() {
  16824. super();
  16825. this.accTime = 0;
  16826. this.curNum = 0;
  16827. this.rate = 1;
  16828. this.loadSubOk = false;
  16829. this.loadResOK = false;
  16830. this.openLoading = true;
  16831. this.beginLoadRes = false;
  16832. this.finishD2 = false;
  16833. this.finishD3 = false;
  16834. }
  16835. onConstructor() {
  16836. this.ui = ui_UILoading.createInstance();
  16837. this.contentPane = this.ui;
  16838. this.isEject = false;
  16839. this._initUI();
  16840. this._addEvent();
  16841. }
  16842. _initUI() {
  16843. MoyuMgr$1.initMoyu();
  16844. }
  16845. _addEvent() {
  16846. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16847. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16848. }
  16849. show() {
  16850. super.show();
  16851. console.log('zh:加载分包资源');
  16852. loadSubRes(this.subResProgress.bind(this));
  16853. this.ui.txtLoad.text = "Loading...";
  16854. }
  16855. subResProgress(pro, finish) {
  16856. this.curNum = pro;
  16857. if (finish) {
  16858. this.curNum = 1;
  16859. this.loadSubOk = true;
  16860. }
  16861. }
  16862. laodD3Res() {
  16863. let scene3D = new Laya.Scene3D();
  16864. xGame.common.d3Scene = scene3D;
  16865. xGame.common.d3World = scene3D.addComponent(D3World);
  16866. xGame.common.d3World.loadScene();
  16867. }
  16868. loadD2Res() {
  16869. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16870. this.finishD2 = true;
  16871. this.checkLoadAll();
  16872. this.curNum = 1;
  16873. }), Laya.Handler.create(this, (pro) => {
  16874. this.curNum = pro;
  16875. }, null, false));
  16876. }
  16877. d3ResFinish() {
  16878. this.finishD3 = true;
  16879. this.checkLoadAll();
  16880. }
  16881. checkLoadAll() {
  16882. if (this.finishD2 && this.finishD3) {
  16883. this.loadResOK = true;
  16884. }
  16885. }
  16886. loadRes() {
  16887. this.laodD3Res();
  16888. this.loadD2Res();
  16889. }
  16890. myUpdate(dt) {
  16891. if (!this.openLoading)
  16892. return;
  16893. this.accTime += dt * this.rate;
  16894. if (this.accTime >= this.curNum)
  16895. this.accTime = this.curNum;
  16896. this.ui.loadinfo.value = this.accTime * 100;
  16897. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16898. if (!this.beginLoadRes) {
  16899. this.beginLoadRes = true;
  16900. this.ui.txtLoad.text = "Loading...";
  16901. this.curNum = 0;
  16902. this.accTime = 0;
  16903. this.loadRes();
  16904. }
  16905. if (this.loadResOK) {
  16906. this.openLoading = false;
  16907. Laya.timer.once(300, this, () => {
  16908. xGame.common.d3Scene.active = false;
  16909. MoyuMgr$1.showAgree(enterGame);
  16910. });
  16911. }
  16912. }
  16913. }
  16914. release() {
  16915. }
  16916. hide() {
  16917. super.hide();
  16918. this.release();
  16919. }
  16920. onClose() {
  16921. this.hide();
  16922. }
  16923. }
  16924. UILoading.uiName = "UILoading";
  16925. class UIRepentProp$1 extends UIBase {
  16926. constructor() {
  16927. super();
  16928. this.viewType = 0;
  16929. this.regretType = 0;
  16930. }
  16931. onConstructor() {
  16932. this.ui = ui_UIRepentProp.createInstance();
  16933. this.contentPane = this.ui;
  16934. this.isEject = false;
  16935. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  16936. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  16937. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  16938. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  16939. }
  16940. show(viewType, regretType, callback) {
  16941. PlatMgr.showInsert(true);
  16942. this.viewType = viewType;
  16943. this.regretType = regretType;
  16944. this.callback = callback;
  16945. super.show();
  16946. this.ui.t0.play();
  16947. this.ui.c1.selectedIndex = this.viewType;
  16948. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  16949. if (this.viewType == 0) {
  16950. let guide = DataMgr.getGuideHelpLine();
  16951. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  16952. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  16953. }
  16954. xGame.common.gameMgr.gamePause = true;
  16955. }
  16956. hideSelf() {
  16957. xGame.common.gameMgr.gamePause = false;
  16958. this.callback && this.callback(false);
  16959. this.hide();
  16960. }
  16961. videoRegret() {
  16962. Moyu.showVideoAd(() => {
  16963. this.callback && this.callback(true);
  16964. this.hideSelf();
  16965. }, EAdType.regretBall);
  16966. }
  16967. videoAddHelpLine() {
  16968. let guide = DataMgr.getGuideHelpLine();
  16969. if (guide == 0) {
  16970. this.callback && this.callback(true);
  16971. this.hideSelf();
  16972. DataMgr.setGuideHelpLine();
  16973. xGame.common.gameUI.ui.guideNode.visible = false;
  16974. }
  16975. else {
  16976. Moyu.showVideoAd(() => {
  16977. this.callback && this.callback(true);
  16978. this.hideSelf();
  16979. }, EAdType.longHelpLine);
  16980. }
  16981. }
  16982. }
  16983. UIRepentProp$1.uiName = "UIRepentProp";
  16984. class UIRodMethod$1 extends UIBase {
  16985. constructor() {
  16986. super();
  16987. this.isPressd = false;
  16988. }
  16989. onConstructor() {
  16990. this.ui = ui_UIRodMethod.createInstance();
  16991. this.contentPane = this.ui;
  16992. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  16993. this.moveDir = new Laya.Vector2();
  16994. this.moveDest = new Laya.Vector2();
  16995. this.centerPos = new Laya.Vector2();
  16996. xGame.common.uiRodMethod = this;
  16997. }
  16998. show() {
  16999. super.show();
  17000. xGame.common.gameMgr.gamePause = true;
  17001. this.openPressDotEvent();
  17002. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17003. this.centerPos.x = this.ui.white.x;
  17004. this.centerPos.y = this.ui.white.y;
  17005. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17006. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17007. this.setDot();
  17008. }
  17009. setDot() {
  17010. this.ui.dot.x = this.moveDest.x;
  17011. this.ui.dot.y = this.moveDest.y;
  17012. }
  17013. closeSelf() {
  17014. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17015. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17016. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17017. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17018. xGame.common.gameMgr.gamePause = false;
  17019. this.hide();
  17020. }
  17021. openPressDotEvent() {
  17022. this.closePressDotEvent();
  17023. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17024. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17025. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17026. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17027. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17028. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17029. }
  17030. closePressDotEvent() {
  17031. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17032. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17033. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17034. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17035. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17036. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17037. }
  17038. onDown(e) {
  17039. if (e.type == Laya.Event.MOUSE_DOWN)
  17040. this.isPressd = true;
  17041. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17042. this.isPressd = false;
  17043. if (!this.isPressd)
  17044. return;
  17045. this.moveDest.x = e.stageX;
  17046. this.moveDest.y = e.stageY;
  17047. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17048. if (dis > 6724) {
  17049. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17050. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17051. }
  17052. this.setDot();
  17053. }
  17054. resetRod() {
  17055. this.ui.dot.x = this.ui.white.x;
  17056. this.ui.dot.y = this.ui.white.y;
  17057. this.gameRod.dot.x = this.gameRod.bg.x;
  17058. this.gameRod.dot.y = this.gameRod.bg.y;
  17059. xGame.common.rodOffest.x = 0;
  17060. xGame.common.rodOffest.y = 0;
  17061. }
  17062. }
  17063. UIRodMethod$1.uiName = "UIRodMethod";
  17064. class UIMsg$1 extends UIBase {
  17065. constructor() {
  17066. super();
  17067. }
  17068. onConstructor() {
  17069. this.ui = ui_UIMsg.createInstance();
  17070. this.contentPane = this.ui;
  17071. this.isEject = false;
  17072. this.isMuti = true;
  17073. }
  17074. show(msg, callback) {
  17075. super.show();
  17076. this.ui.tipsNode.msgTxt.text = msg;
  17077. this.ui.alpha = 1;
  17078. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17079. this.hide();
  17080. callback && callback();
  17081. }), 1000);
  17082. }
  17083. }
  17084. UIMsg$1.uiName = "UIMsg";
  17085. class UITips$1 extends UIBase {
  17086. constructor() {
  17087. super();
  17088. this.type = 0;
  17089. }
  17090. onConstructor() {
  17091. this.ui = ui_UITips.createInstance();
  17092. this.contentPane = this.ui;
  17093. this.isEject = false;
  17094. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17095. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17096. }
  17097. show(tipsTxt, womanTxt, type) {
  17098. super.show();
  17099. this.ui.t0.play();
  17100. this.ui.myNode.tipsTxt.text = tipsTxt;
  17101. this.ui.myNode.womanTxt.text = womanTxt;
  17102. PlatMgr.showInsert(true);
  17103. this.ui.myNode.c1.selectedIndex = type;
  17104. this.type = type;
  17105. switch (this.type) {
  17106. case TipsType.exitGame:
  17107. xGame.common.gameMgr.gamePause = true;
  17108. break;
  17109. case TipsType.foul:
  17110. Laya.timer.once(200, this, () => {
  17111. xGame.common.gameMgr.gamePause = true;
  17112. });
  17113. break;
  17114. default:
  17115. break;
  17116. }
  17117. }
  17118. clickLeftBtn() {
  17119. this.hide();
  17120. xGame.common.gameMgr.gamePause = false;
  17121. switch (this.type) {
  17122. case TipsType.exitGame:
  17123. break;
  17124. case TipsType.foul:
  17125. break;
  17126. default:
  17127. break;
  17128. }
  17129. }
  17130. clickRightBtn() {
  17131. this.hide();
  17132. switch (this.type) {
  17133. case TipsType.exitGame:
  17134. xGame.eventMgr.event(RESET_GAME);
  17135. xGame.uiMgr.Show(UIMain$1);
  17136. Moyu.recordEnd(this, null);
  17137. xGame.common.longHelpLine = false;
  17138. break;
  17139. case TipsType.foul:
  17140. xGame.common.gameMgr.gamePause = false;
  17141. Laya.timer.clearAll(this);
  17142. break;
  17143. default:
  17144. break;
  17145. }
  17146. }
  17147. }
  17148. UITips$1.uiName = "UITips";
  17149. class UIGame$1 extends UIBase {
  17150. constructor() {
  17151. super();
  17152. this.powerNum = 0;
  17153. this.isD3Inited = false;
  17154. this.isPrePlay = false;
  17155. this.isMoveRod = false;
  17156. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17157. this.rulerDis = 20;
  17158. this.rulerOffset = 0;
  17159. }
  17160. onConstructor() {
  17161. this.ui = ui_UIGame.createInstance();
  17162. this.contentPane = this.ui;
  17163. this.ui.x += xGame.common.sysOffestNum;
  17164. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17165. this.isEject = false;
  17166. xGame.common.gameUI = this;
  17167. this.initSelf();
  17168. }
  17169. isTurnSelf() {
  17170. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17171. return true;
  17172. }
  17173. }
  17174. initSelf() {
  17175. let topUI = this.ui.topNode;
  17176. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17177. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17178. this.barInfo = {};
  17179. this.barInfo.curY = 0;
  17180. this.barInfo.height = this.ui.powerNode.height;
  17181. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17182. this.barInfo.powerStartY = this.ui.powerNode.y;
  17183. xGame.common.aiPlayer = new AIPlayer();
  17184. xGame.common.gameMgr = new GameMgr();
  17185. xGame.common.skillMgr = new SkillMgr();
  17186. xGame.common.wordsMgr = new WordsMgr();
  17187. xGame.common.talkMgr = new TalkMgr();
  17188. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17189. console.log("加载经典模式表情文件chenggon !");
  17190. });
  17191. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17192. console.log("挑战模式奖励模式spine加载成功!");
  17193. });
  17194. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17195. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17196. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17197. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17198. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17199. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17200. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17201. }
  17202. returnHome() {
  17203. let tips = "Are you sure to exit the game?";
  17204. let woman = "Boss, why don't you play for a while longer?";
  17205. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17206. }
  17207. addRodMethodClick() {
  17208. if (this.isTurnSelf()) {
  17209. xGame.uiMgr.Show(UIRodMethod$1);
  17210. }
  17211. }
  17212. clickHelpLineBtn(force = false) {
  17213. if (!this.isTurnSelf())
  17214. return;
  17215. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17216. if (success) {
  17217. xGame.common.longHelpLine = true;
  17218. xGame.common.d2World.getHelpLine();
  17219. Moyu.sendDataEvent("guideNum");
  17220. }
  17221. else {
  17222. }
  17223. });
  17224. }
  17225. renderSelfDisplayBalls(index, target) {
  17226. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17227. target.myImg.url = xGame.common.getGameIconUrl(str);
  17228. }
  17229. renderAIDisplayBalls(index, target) {
  17230. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17231. target.myImg.url = xGame.common.getGameIconUrl(str);
  17232. ;
  17233. }
  17234. updateMode() {
  17235. if (xGame.common.gameMode == GameMode.classic) {
  17236. this.ui.topNode.scoreNode.visible = false;
  17237. }
  17238. else if (xGame.common.gameMode == GameMode.bigMove) {
  17239. this.ui.topNode.scoreNode.visible = true;
  17240. }
  17241. }
  17242. show() {
  17243. super.show();
  17244. console.log("zh:uigame show");
  17245. this.ui.alpha = 0;
  17246. this.updateSelf();
  17247. console.log("zh:uigame bf gamemusic01 start");
  17248. xGame.soundMgr.playMusic("gamemusic01");
  17249. console.log("zh:uigame bf gamemusic01 end");
  17250. xGame.common.gameMgr.gamePause = false;
  17251. xGame.common.gameUI.ui.blackAni.visible = false;
  17252. xGame.common.gameUI.ui.whiteAni.visible = false;
  17253. this.ui.powerEft.visible = false;
  17254. this.ui.colorNode.visible = false;
  17255. this.updateHead();
  17256. }
  17257. updateSelf() {
  17258. if (xGame.common.gameMode == GameMode.classic) {
  17259. this.ui.c1.selectedIndex = 0;
  17260. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17261. this.ui.topNode.middleNode.visible = true;
  17262. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17263. }
  17264. else if (xGame.common.gameMode == GameMode.bigMove) {
  17265. this.ui.c1.selectedIndex = 0;
  17266. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17267. this.ui.topNode.middleNode.visible = false;
  17268. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17269. let rand = xGame.common.randomNum(1, max);
  17270. let guide = DataMgr.getSkillGuide();
  17271. if (guide == 0)
  17272. rand = 1;
  17273. xGame.common.bigMoveLevelIndex = rand;
  17274. }
  17275. else if (xGame.common.gameMode == GameMode.placeBall) {
  17276. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17277. this.ui.c1.selectedIndex = 1 + data.type;
  17278. this.ui.alpha = 1;
  17279. this.startGame();
  17280. }
  17281. this.updateMode();
  17282. this.initD3world();
  17283. this.initD2world();
  17284. }
  17285. startGame() {
  17286. this.ui.snowNode.visible = Math.random() <= 0.1;
  17287. this.ui.d2Node.visible = false;
  17288. xGame.common.d3World.d3Hand.gameObj.active = false;
  17289. xGame.common.d3World.tableSrc.init();
  17290. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17291. this.cameraViewChange(() => {
  17292. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17293. switch (xGame.common.gameMode) {
  17294. case GameMode.classic:
  17295. xGame.common.d3World.d3Hand.gameObj.active = true;
  17296. this.playPutBallD3Ani();
  17297. break;
  17298. case GameMode.bigMove:
  17299. this.enterGame();
  17300. Laya.timer.once(500, this, () => {
  17301. this.ui.topNode.middleNode.visible = true;
  17302. this.ui.topNode.middleNode.t0.play();
  17303. });
  17304. break;
  17305. case GameMode.placeBall:
  17306. this.enterGame();
  17307. break;
  17308. default:
  17309. break;
  17310. }
  17311. });
  17312. PlatMgr.showBanner(false);
  17313. }
  17314. enterGame() {
  17315. this.ui.d2Node.visible = true;
  17316. xGame.common.d3World.d3Hand.gameObj.active = false;
  17317. xGame.common.showOneCamera("mainCamera");
  17318. Moyu.recordGame(30, true);
  17319. if (!this.isPrePlay) {
  17320. this.isPrePlay = true;
  17321. xGame.common.d3World.prePlayEft();
  17322. }
  17323. xGame.common.gameMgr.gameReady();
  17324. this.openAllEvent();
  17325. this.ui.snowNode.visible = false;
  17326. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17327. this.ui.helpBtn.visible = condition;
  17328. }
  17329. showHelpLineGuide() {
  17330. let longGuide = DataMgr.getGuideHelpLine();
  17331. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17332. this.ui.helpBtn.visible = true;
  17333. this.ui.guideNode.visible = true;
  17334. }
  17335. }
  17336. setTurnAlpha(alpha) {
  17337. this.ui.keduNode.alpha = alpha;
  17338. this.ui.ganNode.alpha = alpha;
  17339. this.ui.rodMethodNode.alpha = alpha;
  17340. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17341. }
  17342. cameraViewChange(callback) {
  17343. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17344. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17345. xGame.common.showOneCamera("visitAngle");
  17346. cameraSrc.localRotationEulerY = 180;
  17347. cameraSrc.localRotationEulerZ = 0;
  17348. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17349. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17350. callback && callback();
  17351. }));
  17352. }));
  17353. }
  17354. playPutBallD3Ani() {
  17355. xGame.common.showOneCamera("mainCamera");
  17356. let handSrc = xGame.common.d3World.d3Hand;
  17357. handSrc.gameObj.active = true;
  17358. handSrc.transform.localPositionZ = 3;
  17359. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17360. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17361. handSrc.gameObj.active = false;
  17362. this.enterGame();
  17363. }), 400);
  17364. }));
  17365. }
  17366. updateHead() {
  17367. let user = Moyu.getUserInfo();
  17368. this.ui.topNode.selfNameTxt.text = user.nickName;
  17369. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17370. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17371. if (DataMgr.getSkillGuide() < 1) {
  17372. this.ui.topNode.aiNameTxt.text = 'billiards';
  17373. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17374. }
  17375. else {
  17376. this.ui.topNode.aiNameTxt.text = aiData.name;
  17377. this.ui.topNode.aiHeadLoader.url = baseHeadUrl + aiData.icon;
  17378. }
  17379. }
  17380. initD2world() {
  17381. let node = this.ui.d2Root.displayObject;
  17382. let src = node.getComponent(D2World);
  17383. if (!src) {
  17384. xGame.common.d2World = node.addComponent(D2World);
  17385. }
  17386. xGame.common.d2World.initSelf();
  17387. }
  17388. initD3world() {
  17389. if (this.isD3Inited)
  17390. return;
  17391. this.isD3Inited = true;
  17392. let scene3D = xGame.common.d3Scene;
  17393. this.ui.d3Root.displayObject.addChild(scene3D);
  17394. scene3D.active = true;
  17395. xGame.common.d3World.tableSrc.setBorderPos();
  17396. }
  17397. onRootMove(e) {
  17398. let rootBall = xGame.common.d2World.rootBall;
  17399. this.ui.moveNode.x = e.x;
  17400. this.ui.moveNode.y = e.y;
  17401. rootBall.gameObj.x = e.x;
  17402. rootBall.gameObj.y = e.y;
  17403. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17404. }
  17405. aiRootMove(move) {
  17406. if (move)
  17407. this.hideBallUI();
  17408. else {
  17409. this.showBallUI();
  17410. xGame.common.d2World.getHelpLine();
  17411. }
  17412. }
  17413. aiForce(type, force = 0) {
  17414. this.pressTarget = PressType.powerNode;
  17415. if (type == 1)
  17416. this.onEventUp({ force: true });
  17417. else if (type == 2)
  17418. this.onEventMove({ stageY: force, force: true });
  17419. }
  17420. onEventPress(e) {
  17421. if (e.stopPropagation)
  17422. e.stopPropagation();
  17423. if (!this.isTurnSelf())
  17424. return;
  17425. let target = e.target;
  17426. switch (target) {
  17427. case this.ui.myPowerNode.displayObject:
  17428. this.pressTarget = PressType.powerNode;
  17429. this.barInfo.curY = e.stageY;
  17430. this.updateBarInfo();
  17431. break;
  17432. case this.ui.moveNode.displayObject:
  17433. this.pressTarget = PressType.moveNode;
  17434. this.hideBallUI();
  17435. this.eventObj.curX = this.ui.moveNode.x;
  17436. this.eventObj.curY = this.ui.moveNode.y;
  17437. this.ui.moveNode.finger.visible = false;
  17438. this.eventObj.lastX = e.stageX;
  17439. this.eventObj.lastY = e.stageY;
  17440. break;
  17441. case this.ui.rulerClickNode.displayObject:
  17442. this.pressTarget = PressType.rulerNode;
  17443. this.eventObj.lastY = e.stageY;
  17444. break;
  17445. case this.ui.d2Root.displayObject:
  17446. this.pressTarget = PressType.d2Root;
  17447. this.eventObj.lastX = e.stageX;
  17448. this.eventObj.lastY = e.stageY;
  17449. this.eventObj.starX = e.stageX;
  17450. this.eventObj.starY = e.stageY;
  17451. this.eventObj.curX = 0;
  17452. this.eventObj.curY = 0;
  17453. xGame.common.d2World.d2Gan.setGanLastInfo();
  17454. this.rulerOffset = 0;
  17455. break;
  17456. default:
  17457. break;
  17458. }
  17459. }
  17460. onEventMove(e) {
  17461. if (e.stopPropagation)
  17462. e.stopPropagation();
  17463. if (e && e.force) {
  17464. }
  17465. else {
  17466. if (!this.isTurnSelf())
  17467. return;
  17468. }
  17469. switch (this.pressTarget) {
  17470. case PressType.powerNode:
  17471. this.barInfo.curY = e.stageY;
  17472. this.updateBarInfo();
  17473. this.isMoveRod = true;
  17474. break;
  17475. case PressType.moveNode:
  17476. let rootBall = xGame.common.d2World.rootBall;
  17477. let radius = rootBall.gameObj.width / 2;
  17478. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17479. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17480. let border = xGame.common.d2World.borderRect;
  17481. if (curX <= border.x + radius)
  17482. curX = border.x + radius;
  17483. else if (curX >= border.x + border.width - radius)
  17484. curX = border.x + border.width - radius;
  17485. if (curY <= border.y + radius)
  17486. curY = border.y + radius;
  17487. else if (curY >= border.y + border.height - radius)
  17488. curY = border.y + border.height - radius;
  17489. if (xGame.common.gameMgr.isOpenBall) {
  17490. if (curX >= border.x + border.openBallW - radius)
  17491. curX = border.x + border.openBallW - radius;
  17492. }
  17493. this.ui.moveNode.x = curX;
  17494. this.ui.moveNode.y = curY;
  17495. rootBall.gameObj.x = curX;
  17496. rootBall.gameObj.y = curY;
  17497. rootBall.d3BallSrc.setTransPos(curX, curY);
  17498. this.isMoveRod = true;
  17499. break;
  17500. case PressType.rulerNode:
  17501. let yy = e.stageY - this.eventObj.lastY;
  17502. this.eventObj.lastY = e.stageY;
  17503. let ruler1 = this.ui.rulerNode.img1;
  17504. let ruler2 = this.ui.rulerNode.img2;
  17505. ruler1.y += yy;
  17506. ruler2.y += yy;
  17507. this.rulerOffset += yy;
  17508. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17509. this.rulerOffset = 0;
  17510. xGame.soundMgr.playSound("inch", 1, 10);
  17511. }
  17512. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17513. let h = ruler1.height;
  17514. this.checkGuide();
  17515. this.isMoveRod = true;
  17516. if (ruler1.y >= h) {
  17517. ruler1.y = -h;
  17518. ruler2.y = 0;
  17519. return;
  17520. }
  17521. else if (ruler1.y <= -h) {
  17522. ruler1.y = h;
  17523. ruler2.y = 0;
  17524. return;
  17525. }
  17526. if (ruler2.y >= h) {
  17527. ruler2.y = -h;
  17528. ruler1.y = 0;
  17529. return;
  17530. }
  17531. else if (ruler2.y <= -h) {
  17532. ruler2.y = h;
  17533. ruler1.y = 0;
  17534. return;
  17535. }
  17536. break;
  17537. case PressType.d2Root:
  17538. this.eventObj.curX = e.stageX;
  17539. this.eventObj.curY = e.stageY;
  17540. let offset = this.checkRodMoveDir();
  17541. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17542. this.eventObj.lastX = e.stageX;
  17543. this.eventObj.lastY = e.stageY;
  17544. break;
  17545. default:
  17546. break;
  17547. }
  17548. }
  17549. onEventUp(e) {
  17550. if (e.stopPropagation)
  17551. e.stopPropagation();
  17552. if (e && e.force) {
  17553. }
  17554. else {
  17555. if (!this.isTurnSelf())
  17556. return;
  17557. }
  17558. switch (this.pressTarget) {
  17559. case PressType.powerNode:
  17560. this.ui.powerNode.value = 0;
  17561. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17562. this.ui.powerTxt.text = "";
  17563. if (this.powerNum > 0) {
  17564. xGame.eventMgr.event(BALL_SHOOT);
  17565. xGame.common.d2World.shoot(this.powerNum);
  17566. xGame.common.d2World.d2Gan.shoot();
  17567. xGame.common.d2World.d2HelpLine.shoot();
  17568. this.finishGuide();
  17569. this.ui.powerEft.visible = false;
  17570. this.ui.colorNode.visible = false;
  17571. let ganStr = "";
  17572. if (this.powerNum <= 30) {
  17573. ganStr = "gan_30";
  17574. }
  17575. else if (this.powerNum <= 60) {
  17576. ganStr = "gan_50";
  17577. }
  17578. else {
  17579. ganStr = "gan_80";
  17580. }
  17581. xGame.soundMgr.playSound(ganStr);
  17582. }
  17583. break;
  17584. case PressType.moveNode:
  17585. let rootBall = xGame.common.d2World.rootBall;
  17586. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17587. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17588. let isIntersect = this.judgeBallIntersect();
  17589. if (isIntersect) {
  17590. this.ui.moveNode.x = lastX;
  17591. this.ui.moveNode.y = lastY;
  17592. rootBall.gameObj.x = lastX;
  17593. rootBall.gameObj.y = lastY;
  17594. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17595. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17596. }
  17597. else {
  17598. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17599. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17600. }
  17601. this.showBallUI();
  17602. this.ui.moveNode.finger.visible = true;
  17603. xGame.common.d2World.getHelpLine();
  17604. break;
  17605. case PressType.rulerNode:
  17606. break;
  17607. case PressType.d2Root:
  17608. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17609. if (dis <= 25) {
  17610. this.moveToClickDot(e);
  17611. }
  17612. break;
  17613. default:
  17614. break;
  17615. }
  17616. this.pressTarget = -1;
  17617. }
  17618. checkGuide() {
  17619. let guide = DataMgr.getSkillGuide();
  17620. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17621. xGame.common.guideStep++;
  17622. xGame.common.gameUI.ui.guide2.visible = false;
  17623. xGame.common.gameUI.ui.guide3.visible = true;
  17624. }
  17625. }
  17626. finishGuide() {
  17627. let guide = DataMgr.getSkillGuide();
  17628. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17629. xGame.common.guideStep = 10;
  17630. this.closeAllGuide();
  17631. }
  17632. }
  17633. closeAllGuide() {
  17634. xGame.common.gameUI.ui.guide1.visible = false;
  17635. xGame.common.gameUI.ui.guide2.visible = false;
  17636. xGame.common.gameUI.ui.guide3.visible = false;
  17637. }
  17638. updateBarInfo() {
  17639. let star = this.ui.powerNode.y;
  17640. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17641. if (rate >= 1)
  17642. rate = 1;
  17643. if (rate <= 0)
  17644. rate = 0;
  17645. this.powerNum = Math.ceil(rate * 100);
  17646. this.ui.powerNode.value = this.powerNum;
  17647. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17648. this.ui.colorNode.value = this.powerNum;
  17649. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17650. this.ui.powerEft.visible = this.powerNum != 0;
  17651. this.ui.colorNode.visible = this.powerNum != 0;
  17652. this.ui.powerTxt.text = this.powerNum + "";
  17653. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17654. }
  17655. forceCancel() {
  17656. this.ui.powerNode.value = 0;
  17657. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17658. this.ui.powerTxt.text = "";
  17659. }
  17660. checkRodMoveDir() {
  17661. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17662. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17663. if (tempX >= 0 && tempY <= 0) {
  17664. return this.checkDir();
  17665. }
  17666. else if (tempX < 0 && tempY < 0) {
  17667. return this.checkDir(1, -1);
  17668. }
  17669. else if (tempX < 0 && tempY > 0) {
  17670. return this.checkDir(-1, -1);
  17671. }
  17672. else {
  17673. return this.checkDir(-1, 1);
  17674. }
  17675. }
  17676. checkDir(flagX = 1, flagY = 1) {
  17677. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17678. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17679. if (offsetY == 0) {
  17680. return offsetX * flagX;
  17681. }
  17682. if (offsetX == 0) {
  17683. return offsetY * flagY;
  17684. }
  17685. let angle = offsetY / offsetX;
  17686. if (Math.abs(angle) >= 1) {
  17687. return offsetY * flagY;
  17688. }
  17689. else {
  17690. return offsetX * flagX;
  17691. }
  17692. }
  17693. judgeBallIntersect() {
  17694. let rootBall = xGame.common.d2World.rootBall;
  17695. let ballArr = xGame.common.d2World.ballArr;
  17696. let radius = rootBall.gameObj.width / 2;
  17697. let temp;
  17698. let isIntersect = false;
  17699. for (let index = 0; index < ballArr.length; index++) {
  17700. temp = ballArr[index];
  17701. if (temp.number == rootBall.number)
  17702. continue;
  17703. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17704. if (isIntersect) {
  17705. break;
  17706. }
  17707. }
  17708. return isIntersect;
  17709. }
  17710. hideBallUI() {
  17711. let d2Gan = xGame.common.d2World.d2Gan;
  17712. if (!d2Gan.ui.isDisposed)
  17713. d2Gan.ui.visible = false;
  17714. let d2Help = xGame.common.d2World.d2HelpLine;
  17715. if (!d2Help.ui.isDisposed)
  17716. d2Help.ui.visible = false;
  17717. let rootBall = xGame.common.d2World.rootBall;
  17718. if (!rootBall.destroyed) {
  17719. rootBall.gameObj.active = false;
  17720. }
  17721. }
  17722. showBallUI() {
  17723. let d2Gan = xGame.common.d2World.d2Gan;
  17724. if (!d2Gan.ui.isDisposed)
  17725. d2Gan.ui.visible = true;
  17726. let d2Help = xGame.common.d2World.d2HelpLine;
  17727. if (!d2Help.ui.isDisposed)
  17728. d2Help.ui.visible = true;
  17729. let rootBall = xGame.common.d2World.rootBall;
  17730. if (!rootBall.destroyed) {
  17731. rootBall.gameObj.active = true;
  17732. }
  17733. }
  17734. moveToClickDot(e) {
  17735. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17736. let root = xGame.common.d2World.rootBall.gameObj;
  17737. let xx = e.stageX - xGame.common.sysOffestNum;
  17738. let yy = e.stageY;
  17739. let x = xx - root.x;
  17740. let y = yy - root.y;
  17741. let angle = xGame.common.getfguiRotation(x, y);
  17742. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17743. xGame.common.d2World.getHelpLine();
  17744. }
  17745. this.isMoveRod = false;
  17746. xGame.common.clickedBall = false;
  17747. }
  17748. openAllEvent() {
  17749. this.closeAllEvent();
  17750. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17751. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17752. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17753. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17754. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17755. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17756. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17757. }
  17758. closeAllEvent() {
  17759. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17760. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17761. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17762. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17763. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17764. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17765. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17766. }
  17767. resetGame() {
  17768. this.closeAllEvent();
  17769. this.hideBallUI();
  17770. xGame.common.gameMgr.gamePause = true;
  17771. }
  17772. }
  17773. UIGame$1.uiName = "UIGame";
  17774. class UIAddCoin$1 extends UIBase {
  17775. constructor() {
  17776. super();
  17777. this.coinNum = 2000;
  17778. }
  17779. onConstructor() {
  17780. this.ui = ui_UIAddCoin.createInstance();
  17781. this.contentPane = this.ui;
  17782. this.isEject = false;
  17783. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17784. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17785. }
  17786. show() {
  17787. super.show();
  17788. this.ui.t0.play();
  17789. }
  17790. videoAddCoin() {
  17791. Moyu.showVideoAd(() => {
  17792. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17793. this.hide();
  17794. }, EAdType.addFailCoin);
  17795. }
  17796. }
  17797. UIAddCoin$1.uiName = "UIAddCoin";
  17798. class UIInvitation$1 extends UIBase {
  17799. constructor() {
  17800. super();
  17801. }
  17802. onConstructor() {
  17803. this.ui = ui_UIInvitation.createInstance();
  17804. this.contentPane = this.ui;
  17805. this.isEject = false;
  17806. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17807. }
  17808. show() {
  17809. super.show();
  17810. }
  17811. enterGame() {
  17812. xGame.common.gameMode = GameMode.classic;
  17813. DataMgr.setChallengeTimes(1);
  17814. xGame.common.passAwardCoin = 2000;
  17815. let need = xGame.common.classicNiceNeddCoin;
  17816. if (DataMgr.coinEnough(need)) {
  17817. DataMgr.setCoin(-need);
  17818. xGame.eventMgr.event(RESTART_GAME, true);
  17819. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17820. }
  17821. else {
  17822. xGame.eventMgr.event(RESTART_GAME, true);
  17823. }
  17824. this.hide();
  17825. }
  17826. hide() {
  17827. super.hide();
  17828. }
  17829. }
  17830. UIInvitation$1.uiName = "UIInvitation";
  17831. class UIPower$1 extends UIBase {
  17832. constructor() {
  17833. super();
  17834. }
  17835. onConstructor() {
  17836. this.ui = ui_UIPower.createInstance();
  17837. this.contentPane = this.ui;
  17838. this.isEject = false;
  17839. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17840. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17841. }
  17842. show() {
  17843. super.show();
  17844. this.ui.t0.play();
  17845. }
  17846. videoGetPower() {
  17847. Moyu.showVideoAd(() => {
  17848. DataMgr.setPower(xGame.common.videoPower, true);
  17849. xGame.eventMgr.event(POWER_TIME);
  17850. this.hide();
  17851. }, EAdType.getPower);
  17852. }
  17853. }
  17854. UIPower$1.uiName = "UIPower";
  17855. class UIGameEnd$1 extends UIBase {
  17856. constructor() {
  17857. super();
  17858. this.success = false;
  17859. this.awardCoinNum = 1000;
  17860. this.awardDiamondNum = 10;
  17861. }
  17862. onConstructor() {
  17863. this.ui = ui_UIGameEnd.createInstance();
  17864. this.contentPane = this.ui;
  17865. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17866. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17867. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17868. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17869. this.ui.talkNode.visible = false;
  17870. if (Moyu.isKs)
  17871. this.ui.closeNode.closeBtn.x += 100;
  17872. }
  17873. updateType() {
  17874. switch (xGame.common.gameMode) {
  17875. case GameMode.classic:
  17876. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17877. this.ui.coinNode.visible = this.success;
  17878. if (!this.success) {
  17879. Laya.timer.once(500, this, () => {
  17880. xGame.uiMgr.Show(UIAddCoin$1);
  17881. });
  17882. }
  17883. this.ui.isGetAward.visible = false;
  17884. this.ui.leftBtn.c1.selectedIndex = 3;
  17885. this.ui.rightBtn.c1.selectedIndex = 0;
  17886. this.moneyNode.ui.c1.selectedIndex = 1;
  17887. break;
  17888. case GameMode.bigMove:
  17889. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17890. this.ui.coinNode.visible = this.success;
  17891. if (xGame.common.gameMode == GameMode.bigMove) {
  17892. if (this.success) {
  17893. DataMgr.setSkillSuccessTimes(1, true);
  17894. DataMgr.setSkillAccTimes(1);
  17895. }
  17896. else {
  17897. DataMgr.setSkillSuccessTimes(0, false);
  17898. }
  17899. }
  17900. if (!this.success) {
  17901. Laya.timer.once(500, this, () => {
  17902. xGame.uiMgr.Show(UIAddCoin$1);
  17903. });
  17904. }
  17905. this.ui.isGetAward.visible = false;
  17906. this.ui.leftBtn.c1.selectedIndex = 3;
  17907. this.ui.rightBtn.c1.selectedIndex = 0;
  17908. this.moneyNode.ui.c1.selectedIndex = 1;
  17909. break;
  17910. case GameMode.placeBall:
  17911. this.ui.coinNode.visible = false;
  17912. if (this.success) {
  17913. if (xGame.common.placeBallStarNum == 3) {
  17914. this.ui.c1.selectedIndex = 2;
  17915. }
  17916. else {
  17917. this.ui.c1.selectedIndex = 3;
  17918. }
  17919. }
  17920. else {
  17921. this.ui.c1.selectedIndex = 4;
  17922. }
  17923. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17924. if (cfg.type == PlaceBallType.challenge) {
  17925. this.ui.c1.selectedIndex = 2;
  17926. }
  17927. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  17928. this.updatePlaceBallBtn();
  17929. this.updatePlaceBallStarNum();
  17930. this.updatePlaceBallAwardState();
  17931. this.moneyNode.ui.c1.selectedIndex = 2;
  17932. this.moneyNode.checkPowerTime();
  17933. this.moneyNode.powerChange();
  17934. DataMgr.upRankData();
  17935. break;
  17936. default:
  17937. break;
  17938. }
  17939. }
  17940. updatePlaceBallBtn() {
  17941. this.ui.leftBtn.c1.selectedIndex = 5;
  17942. if (this.success) {
  17943. this.ui.rightBtn.c1.selectedIndex = 14;
  17944. }
  17945. else {
  17946. if (xGame.common.placeBallStarNum == 3) {
  17947. this.ui.rightBtn.c1.selectedIndex = 14;
  17948. }
  17949. else {
  17950. this.ui.rightBtn.c1.selectedIndex = 1;
  17951. }
  17952. }
  17953. }
  17954. updatePlaceBallStarNum() {
  17955. let starNum = xGame.common.placeBallStarNum;
  17956. if (starNum == 0)
  17957. this.ui.starNumNode.c1.selectedIndex = 3;
  17958. else {
  17959. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  17960. }
  17961. }
  17962. updatePlaceBallAwardState() {
  17963. let level = xGame.common.placeBallCurLevel;
  17964. let starNum = xGame.common.placeBallStarNum;
  17965. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  17966. let data = cfgTable.placeballData[level].award;
  17967. let cfg = cfgTable.placeballData[level];
  17968. this.awardDiamondNum = data[1];
  17969. this.awardCoinNum = data[0];
  17970. if (cfg.type == PlaceBallType.challenge) {
  17971. this.awardDiamondNum = 0;
  17972. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  17973. }
  17974. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  17975. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  17976. if (cfg.type == PlaceBallType.challenge) {
  17977. this.ui.awardNode.coinNode.visible = true;
  17978. }
  17979. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  17980. this.ui.awardNode.diamondNode.x = 265;
  17981. this.ui.awardNode.coinNode.x = 354;
  17982. }
  17983. else {
  17984. this.ui.awardNode.diamondNode.x = 291;
  17985. this.ui.awardNode.coinNode.x = 291;
  17986. }
  17987. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  17988. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  17989. if (this.awardCoinNum == 0) {
  17990. this.ui.awardNode.coinNode.numTxt.text = "";
  17991. }
  17992. if (getAward) {
  17993. this.ui.isGetAward.visible = true;
  17994. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  17995. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  17996. }
  17997. else {
  17998. this.ui.isGetAward.visible = false;
  17999. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18000. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18001. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18002. }
  18003. else {
  18004. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18005. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18006. }
  18007. }
  18008. }
  18009. show(success) {
  18010. super.show();
  18011. xGame.eventMgr.event(RESET_GAME);
  18012. this.success = success;
  18013. Laya.timer.clearAll(this);
  18014. this.playSecretaryAni();
  18015. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18016. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18017. offsetTime = Math.floor(offsetTime / 1000);
  18018. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18019. this.updateType();
  18020. Laya.timer.once(200, this, () => {
  18021. this.addAward(() => {
  18022. this.updateType();
  18023. Laya.timer.once(500, this, () => {
  18024. this.showChallengeLevel();
  18025. });
  18026. });
  18027. });
  18028. if (this.success) {
  18029. xGame.soundMgr.playSound('slots_roll01');
  18030. xGame.soundMgr.playSound("s_win");
  18031. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18032. }
  18033. else {
  18034. xGame.soundMgr.playSound('matchwin01');
  18035. xGame.soundMgr.playSound("s_lose");
  18036. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18037. }
  18038. if (!Moyu.isLegal)
  18039. PlatMgr.showBanner(true);
  18040. let challengeNum = DataMgr.getChallengeTimes();
  18041. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18042. DataMgr.setChallengeTimes(1);
  18043. }
  18044. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18045. DataMgr.setClassicTimes();
  18046. }
  18047. }
  18048. showChallengeLevel() {
  18049. if (DataMgr.getChallengeTimes() != 0)
  18050. return;
  18051. let skill = DataMgr.getSkillAccTimes();
  18052. let put = DataMgr.getPlaceBallLevelList().length;
  18053. if (skill >= 3 || put >= 5) {
  18054. xGame.uiMgr.Show(UIInvitation$1);
  18055. this.hide();
  18056. }
  18057. }
  18058. addAward(callback) {
  18059. if (!this.success) {
  18060. callback && callback();
  18061. return;
  18062. }
  18063. switch (xGame.common.gameMode) {
  18064. case GameMode.classic:
  18065. this.awardCoinNum = xGame.common.passAwardCoin;
  18066. this.awardDiamondNum = 0;
  18067. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18068. break;
  18069. case GameMode.bigMove:
  18070. this.awardCoinNum = xGame.common.passAwardCoin;
  18071. this.awardDiamondNum = 0;
  18072. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18073. callback && callback();
  18074. break;
  18075. case GameMode.placeBall:
  18076. let level = xGame.common.placeBallCurLevel;
  18077. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18078. if (xGame.common.placeBallStarNum != 3) {
  18079. callback && callback();
  18080. return;
  18081. }
  18082. else {
  18083. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18084. if (getAward) {
  18085. callback && callback();
  18086. return;
  18087. }
  18088. }
  18089. let cfg = cfgTable.placeballData[level];
  18090. let data = cfgTable.placeballData[level].award;
  18091. this.awardCoinNum = data[0];
  18092. this.awardDiamondNum = data[1];
  18093. if (cfg.type == PlaceBallType.challenge) {
  18094. this.awardDiamondNum = 0;
  18095. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18096. }
  18097. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18098. let diamondAward;
  18099. if (this.awardDiamondNum > 0) {
  18100. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18101. xGame.common.getAward([diamondAward, coinAward], callback);
  18102. }
  18103. else {
  18104. xGame.common.getAward([coinAward], callback);
  18105. }
  18106. if (cfg.type == PlaceBallType.normal) {
  18107. DataMgr.setPlaceBallAward(level);
  18108. }
  18109. break;
  18110. default:
  18111. break;
  18112. }
  18113. }
  18114. playSecretaryAni() {
  18115. let parent = this.ui.secretary.displayObject;
  18116. parent.destroyChildren();
  18117. let xx = this.ui.secretary.width / 2;
  18118. let yy = this.ui.secretary.height;
  18119. let scale = xGame.common.getSecretaryScale();
  18120. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18121. if (this.success) {
  18122. let rand = Math.random() <= 0.5 ? 2 : 3;
  18123. xGame.common.secretary.play(data, rand, false, parent, () => {
  18124. xGame.common.secretary.play(data, 1, true, parent);
  18125. });
  18126. }
  18127. else {
  18128. xGame.common.secretary.play(data, 0, true, parent);
  18129. }
  18130. }
  18131. restartGame() {
  18132. switch (xGame.common.gameMode) {
  18133. case GameMode.classic:
  18134. xGame.eventMgr.event(RESTART_GAME);
  18135. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18136. break;
  18137. case GameMode.bigMove:
  18138. this.hide();
  18139. xGame.eventMgr.event(RESTART_GAME);
  18140. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18141. break;
  18142. default:
  18143. break;
  18144. }
  18145. }
  18146. hide() {
  18147. super.hide();
  18148. xGame.common.stopGirlPop(this.ui.talkNode);
  18149. PlatMgr.showBanner(false);
  18150. }
  18151. returnHome() {
  18152. this.hide();
  18153. let showFailWords = !this.success;
  18154. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18155. }
  18156. clickLeftBtn() {
  18157. switch (xGame.common.gameMode) {
  18158. case GameMode.classic:
  18159. case GameMode.bigMove:
  18160. this.returnHome();
  18161. break;
  18162. case GameMode.placeBall:
  18163. let level = xGame.common.placeBallCurLevel;
  18164. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18165. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18166. break;
  18167. default:
  18168. break;
  18169. }
  18170. }
  18171. powerStartPlaceBallLevel(level, btn) {
  18172. if (DataMgr.powerEnough()) {
  18173. btn.touchable = false;
  18174. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18175. btn.touchable = true;
  18176. DataMgr.setPower(-1);
  18177. xGame.eventMgr.event(POWER_TIME);
  18178. this.startPlaceBallLevel(level);
  18179. }));
  18180. }
  18181. else {
  18182. xGame.uiMgr.Show(UIPower$1, 0);
  18183. }
  18184. }
  18185. clickRightBtn() {
  18186. switch (xGame.common.gameMode) {
  18187. case GameMode.classic:
  18188. case GameMode.bigMove:
  18189. this.restartGame();
  18190. break;
  18191. case GameMode.placeBall:
  18192. let level = xGame.common.placeBallCurLevel;
  18193. let data = DataMgr.getPlaceBallLevel(level);
  18194. let curPss = data.play && !data.isCur;
  18195. if (curPss) {
  18196. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18197. }
  18198. else {
  18199. Moyu.sendDataEvent("placeBallNextLevel");
  18200. Moyu.showVideoAd(() => {
  18201. DataMgr.setPlaceBallLevel(level, 1);
  18202. this.startPlaceBallLevel(level + 1);
  18203. }, xGame.define.EAdType.placeBallNextLevel);
  18204. }
  18205. break;
  18206. default:
  18207. break;
  18208. }
  18209. }
  18210. startPlaceBallLevel(level) {
  18211. xGame.common.gameMode = GameMode.placeBall;
  18212. xGame.common.placeBallCurLevel = level;
  18213. xGame.uiMgr.Show(UIGame$1);
  18214. this.hide();
  18215. }
  18216. }
  18217. UIGameEnd$1.uiName = "UIGameEnd";
  18218. class ShowItem$1 {
  18219. constructor() {
  18220. this.ui = ui_ShowItem.createInstance();
  18221. }
  18222. destroySelf() {
  18223. if (!this.ui.isDisposed) {
  18224. this.ui.removeFromParent();
  18225. this.ui.dispose();
  18226. }
  18227. }
  18228. setParent(parent) {
  18229. parent.addChild(this.ui);
  18230. }
  18231. setPos(x, y) {
  18232. this.ui.x = x;
  18233. this.ui.y = y;
  18234. }
  18235. setUrl(index) {
  18236. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18237. }
  18238. }
  18239. class UILevelProp$1 extends UIBase {
  18240. constructor() {
  18241. super();
  18242. this.firstPos = 385;
  18243. this.secondPos = 467;
  18244. this.showItemArr = [];
  18245. }
  18246. onConstructor() {
  18247. this.ui = ui_UILevelProp.createInstance();
  18248. this.contentPane = this.ui;
  18249. this.isEject = false;
  18250. this.addUIClick(this.ui.closeBtn, this.hide);
  18251. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18252. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18253. }
  18254. show(level) {
  18255. super.show();
  18256. this.ui.t1.play();
  18257. this.level = level;
  18258. this.data = cfgTable.placeballData[this.level];
  18259. this.updateSelf();
  18260. this.showPreView();
  18261. this.moneyNode.ui.c1.selectedIndex = 2;
  18262. this.moneyNode.checkPowerTime();
  18263. this.moneyNode.powerChange();
  18264. }
  18265. showPreView() {
  18266. let item;
  18267. let data;
  18268. for (let index = 0; index < this.showItemArr.length; index++) {
  18269. item = this.showItemArr[index];
  18270. item.destroySelf();
  18271. }
  18272. this.showItemArr = [];
  18273. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18274. for (const key in cfgData) {
  18275. data = cfgData[key];
  18276. item = new ShowItem$1();
  18277. item.setParent(this.ui.myNode.displayRoot);
  18278. item.setPos(data.x, data.y);
  18279. item.setUrl(data.value);
  18280. this.showItemArr.push(item);
  18281. }
  18282. }
  18283. updateSelf() {
  18284. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18285. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18286. if (this.data.ball == -1) {
  18287. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18288. }
  18289. else {
  18290. this.ui.myNode.conditionTxt.text = "Reward";
  18291. }
  18292. let localData = DataMgr.getPlaceBallLevel(this.level);
  18293. let getAward = localData.getAward;
  18294. let cfg = cfgTable.placeballData[this.level];
  18295. let coin = this.data.award[0];
  18296. let diamond = this.data.award[1];
  18297. if (cfg.type == PlaceBallType.challenge) {
  18298. diamond = 0;
  18299. coin = 100;
  18300. }
  18301. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18302. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18303. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18304. if (cfg.type == PlaceBallType.challenge) {
  18305. this.ui.myNode.coinNode.numTxt.text = "";
  18306. }
  18307. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18308. if (coin > 0 && diamond > 0) {
  18309. this.ui.myNode.diamondNode.x = 385;
  18310. this.ui.myNode.coinNode.x = 467;
  18311. }
  18312. else {
  18313. this.ui.myNode.diamondNode.x = 385;
  18314. this.ui.myNode.coinNode.x = 385;
  18315. }
  18316. if (!getAward) {
  18317. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18318. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18319. }
  18320. else {
  18321. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18322. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18323. }
  18324. }
  18325. startGame() {
  18326. if (DataMgr.powerEnough()) {
  18327. this.ui.myNode.startBtn.touchable = false;
  18328. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18329. console.log('zh:startGame ');
  18330. this.ui.myNode.startBtn.touchable = true;
  18331. DataMgr.setPower(-1);
  18332. xGame.eventMgr.event(POWER_TIME);
  18333. xGame.common.gameMode = GameMode.placeBall;
  18334. xGame.common.placeBallCurLevel = this.level;
  18335. xGame.uiMgr.Show(UIGame$1);
  18336. xGame.uiMgr.Hide(UILevelDisplay$1);
  18337. xGame.uiMgr.Hide(UIMain$1);
  18338. this.hide();
  18339. }));
  18340. }
  18341. else {
  18342. xGame.uiMgr.Show(UIPower$1);
  18343. }
  18344. }
  18345. hide() {
  18346. super.hide();
  18347. }
  18348. }
  18349. UILevelProp$1.uiName = "UILevelProp";
  18350. class PutBallLevelDisplay$1 {
  18351. constructor(ui, index) {
  18352. this.index = 0;
  18353. this.ui = ui;
  18354. this.index = index;
  18355. this.ui.onClick(this, this.clickSelf);
  18356. this.updateSelf();
  18357. this.ui.levelTxt.text = (this.index + 1) + "";
  18358. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18359. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18360. }
  18361. updateSelf() {
  18362. let level = this.index + 1;
  18363. this.data = DataMgr.getPlaceBallLevel(level);
  18364. this.ui.starNode.c1.selectedIndex = this.data.star;
  18365. let isChallenge = cfgTable.placeballData[level].type;
  18366. if (this.data.isCur) {
  18367. if (isChallenge) {
  18368. this.ui.c1.selectedIndex = 5;
  18369. }
  18370. else {
  18371. this.ui.c1.selectedIndex = 2;
  18372. }
  18373. }
  18374. else {
  18375. if (this.data.play) {
  18376. if (this.data.star == 3) {
  18377. this.ui.c1.selectedIndex = 0;
  18378. }
  18379. else {
  18380. this.ui.c1.selectedIndex = 1;
  18381. }
  18382. }
  18383. else {
  18384. if (isChallenge) {
  18385. this.ui.c1.selectedIndex = 4;
  18386. }
  18387. else {
  18388. this.ui.c1.selectedIndex = 3;
  18389. }
  18390. }
  18391. }
  18392. }
  18393. clickSelf() {
  18394. if (!this.data.play)
  18395. return;
  18396. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18397. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18398. }
  18399. }
  18400. class UILevelDisplay$1 extends UIBase {
  18401. constructor() {
  18402. super();
  18403. }
  18404. onConstructor() {
  18405. this.ui = ui_UILevelDisplay.createInstance();
  18406. this.contentPane = this.ui;
  18407. this.isEject = false;
  18408. this.myList = this.ui.myNode.myList;
  18409. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18410. this.levelItemArr = [];
  18411. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18412. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18413. this.myList.numItems = levelNum;
  18414. if (Moyu.isKs)
  18415. this.ui.closeNode.closeBtn.x += 100;
  18416. }
  18417. levelItemRender(index, target) {
  18418. let item = new PutBallLevelDisplay$1(target, index);
  18419. this.levelItemArr.push(item);
  18420. }
  18421. show() {
  18422. super.show();
  18423. this.updateLevel();
  18424. this.scrollToPlace();
  18425. }
  18426. updateLevel() {
  18427. let temp;
  18428. for (let index = 0; index < this.levelItemArr.length; index++) {
  18429. temp = this.levelItemArr[index];
  18430. temp.updateSelf();
  18431. }
  18432. }
  18433. scrollToPlace() {
  18434. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18435. let passArr = DataMgr.getPlaceBallLevelList();
  18436. let offest = passArr.length;
  18437. if (offest >= maxNum - 1)
  18438. offest = maxNum - 1;
  18439. this.myList.scrollToView(offest, true, true);
  18440. }
  18441. hide() {
  18442. super.hide();
  18443. }
  18444. }
  18445. UILevelDisplay$1.uiName = "UILevelDisplay";
  18446. class UIMatching$1 extends UIBase {
  18447. constructor() {
  18448. super();
  18449. }
  18450. onConstructor() {
  18451. this.ui = ui_UIMatching.createInstance();
  18452. this.contentPane = this.ui;
  18453. this.isEject = false;
  18454. }
  18455. show(callback) {
  18456. super.show();
  18457. PlatMgr.showBanner(true);
  18458. this.callback = callback;
  18459. let user = Moyu.getUserInfo();
  18460. if (!this.selfPot) {
  18461. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18462. }
  18463. if (!this.aiPot) {
  18464. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18465. }
  18466. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18467. this.ui.selfHead.nameTxt.text = user.nickName;
  18468. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18469. this.ui.aiHead.nameTxt.text = "???";
  18470. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18471. this.ui.selfHead.c1.selectedIndex = 0;
  18472. this.ui.aiHead.c1.selectedIndex = 0;
  18473. this.ui.selfHead.x = this.selfPot.x;
  18474. this.ui.selfHead.y = this.selfPot.y;
  18475. this.ui.aiHead.x = this.aiPot.x;
  18476. this.ui.aiHead.y = this.aiPot.y;
  18477. switch (xGame.common.gameMode) {
  18478. case GameMode.classic:
  18479. break;
  18480. case GameMode.bigMove:
  18481. this.initSkillData();
  18482. break;
  18483. default:
  18484. break;
  18485. }
  18486. this.ui.t1.play(Laya.Handler.create(this, () => {
  18487. this.ui.t2.play(Laya.Handler.create(this, () => {
  18488. switch (xGame.common.gameMode) {
  18489. case GameMode.classic:
  18490. this.waitingPeople();
  18491. break;
  18492. case GameMode.bigMove:
  18493. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18494. break;
  18495. default:
  18496. break;
  18497. }
  18498. }));
  18499. }));
  18500. }
  18501. initSkillData() {
  18502. this.skillSelectData = [];
  18503. let skillUrl = xGame.common.skillIconList;
  18504. let skillName = xGame.common.skillNameList;
  18505. let skillLevel = DataMgr.getBigSkillList();
  18506. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18507. for (let index = 0; index < 5; index++) {
  18508. let obj = {};
  18509. obj.skillImg = skillUrl[index];
  18510. obj.skillName = skillName[index];
  18511. obj.skillType = skillType[index];
  18512. obj.skillLevel = skillLevel[index];
  18513. this.skillSelectData.push(obj);
  18514. }
  18515. }
  18516. getAISkillLevel(myLevel) {
  18517. let video = xGame.common.upSkillLevel;
  18518. let aiLevel;
  18519. let temp;
  18520. if (video) {
  18521. temp = xGame.common.randomNum(-2, -1);
  18522. }
  18523. else {
  18524. if (myLevel <= 5) {
  18525. temp = xGame.common.randomNum(1, 3);
  18526. }
  18527. else if (myLevel <= 9) {
  18528. temp = xGame.common.randomNum(-2, 1);
  18529. }
  18530. else {
  18531. temp = xGame.common.randomNum(-4, 0);
  18532. }
  18533. }
  18534. aiLevel = temp + myLevel;
  18535. if (aiLevel <= 1)
  18536. aiLevel = 1;
  18537. if (aiLevel >= 10)
  18538. aiLevel = 10;
  18539. return aiLevel;
  18540. }
  18541. getAISkillType() {
  18542. return xGame.common.randomNum(1, 4);
  18543. let successTimes = DataMgr.getSkillSuccessTimes();
  18544. let info = cfgTable.aiskillData[successTimes];
  18545. if (!info) {
  18546. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18547. info = cfgTable.aiskillData[max];
  18548. }
  18549. let dataArr = info.skillselect;
  18550. let myCfg = {};
  18551. for (let index = 0; index < dataArr.length; index++) {
  18552. let temp = dataArr[index].split('-');
  18553. myCfg[temp[0]] = {};
  18554. myCfg[temp[0]].id = parseInt(temp[0]);
  18555. myCfg[temp[0]].weight = parseInt(temp[1]);
  18556. }
  18557. let aiCfg = xGame.common.initWeight(myCfg);
  18558. let curData = xGame.common.getRandomWeightData(aiCfg);
  18559. return parseInt(curData.id);
  18560. }
  18561. getAISkillData(index) {
  18562. let myLevel = this.skillSelectData[index].skillLevel;
  18563. let aiLevel = this.getAISkillLevel(myLevel);
  18564. let aiType = this.getAISkillType() - 1;
  18565. return { aiLevel, aiType } = { aiLevel, aiType };
  18566. }
  18567. skillSelectFinish(index) {
  18568. let aiInfo = this.getAISkillData(index);
  18569. xGame.common.gameMgr.selfCurSkill = index;
  18570. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18571. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18572. this.ui.selfHead.c1.selectedIndex = 1;
  18573. this.ui.aiHead.c1.selectedIndex = 1;
  18574. let myData = this.skillSelectData[index];
  18575. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18576. let guide = DataMgr.getSkillGuide();
  18577. if (guide == 0) {
  18578. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18579. }
  18580. else {
  18581. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18582. }
  18583. let aiData = this.skillSelectData[aiInfo.aiType];
  18584. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18585. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18586. this.waitingPeople();
  18587. }
  18588. waitingPeople() {
  18589. let time = xGame.common.randomNum(1000, 3000);
  18590. time += 1000;
  18591. Laya.timer.once(time, this, () => {
  18592. this.matchingSuccess();
  18593. });
  18594. }
  18595. matchingSuccess() {
  18596. let gameUI = xGame.common.gameUI;
  18597. let name = gameUI.ui.topNode.aiNameTxt.text;
  18598. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18599. this.ui.aiHead.nameTxt.text = name;
  18600. this.ui.aiHead.headImg.url = url;
  18601. name = gameUI.ui.topNode.selfNameTxt.text;
  18602. url = gameUI.ui.topNode.selfHeadLoader.url;
  18603. this.ui.selfHead.nameTxt.text = name;
  18604. this.ui.selfHead.headImg.url = url;
  18605. this.ui.t3.play(Laya.Handler.create(this, () => {
  18606. this.callback && this.callback();
  18607. this.ui.t4.play(Laya.Handler.create(this, () => {
  18608. this.destroySelf();
  18609. }));
  18610. }));
  18611. }
  18612. destroySelf() {
  18613. this.callback = null;
  18614. this.skillSelectData = null;
  18615. this.selfPot = null;
  18616. this.aiPot = null;
  18617. if (!this.ui.isDisposed) {
  18618. this.ui.removeFromParent();
  18619. this.ui.dispose();
  18620. }
  18621. xGame.uiMgr.destroyUI(this);
  18622. }
  18623. }
  18624. UIMatching$1.uiName = "UIMatching";
  18625. class SkillDisplay$1 {
  18626. constructor(ui, data, uiIndex) {
  18627. this.starX = 0;
  18628. this.starY = 0;
  18629. this.index = 0;
  18630. this.ui = ui;
  18631. this.data = data;
  18632. this.index = uiIndex;
  18633. this.initSelf();
  18634. console.log('zh:SkillDisplay constructor this.skillData=', data);
  18635. }
  18636. initSelf() {
  18637. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18638. this.ui.nameTxt.text = this.data.name;
  18639. this.ui.describeTxt.text = this.data.describe;
  18640. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18641. this.ui.startBtn.onClick(this, this.startGame);
  18642. this.updateSelf();
  18643. }
  18644. updateSelf() {
  18645. this.checkTry();
  18646. let level = DataMgr.getBigSkillByIndex(this.index);
  18647. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18648. }
  18649. checkTry() {
  18650. let index = this.index;
  18651. let level = DataMgr.getBigSkillByIndex(index);
  18652. if (level == null) {
  18653. DataMgr.setBigSkill(index, 1, false);
  18654. level = 1;
  18655. }
  18656. this.ui.levelTxt.text = "LV." + level;
  18657. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18658. this.ui.tryNode.visible = true;
  18659. else
  18660. this.ui.tryNode.visible = false;
  18661. }
  18662. clickAddLevel() {
  18663. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18664. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18665. Moyu.showVideoAd(() => {
  18666. DataMgr.setBigSkill(this.data.index, 1);
  18667. this.updateSelf();
  18668. xGame.common.upSkillLevel = true;
  18669. }, EAdType.upSkill);
  18670. }
  18671. startGame() {
  18672. if (this.data.index == 3) {
  18673. alert('期待吧');
  18674. return;
  18675. }
  18676. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18677. let needCoin = xGame.common.bigMoveNeedCoin;
  18678. xGame.common.passAwardCoin = 2000;
  18679. let guide = DataMgr.getSkillGuide();
  18680. console.log('zh:startGame guide=' + guide);
  18681. xGame.common.temSelfLevel = 0;
  18682. if (guide == 0) {
  18683. needCoin = 0;
  18684. xGame.common.temSelfLevel = 100;
  18685. }
  18686. if (DataMgr.coinEnough(needCoin)) {
  18687. DataMgr.setCoin(-needCoin);
  18688. xGame.common.curPlayerSkillType = this.index;
  18689. if (guide == 0)
  18690. xGame.common.curPlayerSkillType = 0;
  18691. xGame.uiMgr.Show(UIGame$1);
  18692. xGame.uiMgr.Hide(UIMain$1);
  18693. xGame.uiMgr.Show(UIMatching$1, () => {
  18694. xGame.common.gameUI.ui.alpha = 1;
  18695. xGame.common.gameUI.startGame();
  18696. xGame.uiMgr.Hide(UISkill$1);
  18697. });
  18698. }
  18699. else {
  18700. xGame.uiMgr.Show(UIAddProp$1, 0);
  18701. Moyu.sendDataEvent("AddCoinVideo");
  18702. }
  18703. }
  18704. }
  18705. class UISkill$1 extends UIBase {
  18706. constructor() {
  18707. super();
  18708. this.skillData = [];
  18709. }
  18710. onConstructor() {
  18711. this.ui = ui_UISkill.createInstance();
  18712. this.contentPane = this.ui;
  18713. this.isEject = false;
  18714. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18715. this.initSkillData();
  18716. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18717. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18718. this.displayList = [];
  18719. this.ui.skillNode.skillList.numItems = 4;
  18720. this.addUIClick(this.ui, this.interuptSecretary);
  18721. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18722. this.ui.talkNode.visible = false;
  18723. if (Moyu.isKs)
  18724. this.ui.closeNode.closeBtn.x += 100;
  18725. }
  18726. show() {
  18727. super.show();
  18728. this.playSecretaryIdle();
  18729. this.moneyNode.ui.c1.selectedIndex = 1;
  18730. Laya.timer.clearAll(this);
  18731. xGame.soundMgr.playSound("s_start");
  18732. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18733. let guide = DataMgr.getSkillGuide();
  18734. this.ui.guideNode.visible = guide == 0;
  18735. let item = this.getSkillItemByUIIndex(0);
  18736. if (guide == 0) {
  18737. item.ui.c1.selectedIndex = 1;
  18738. }
  18739. else {
  18740. item.ui.c1.selectedIndex = 0;
  18741. }
  18742. this.ui.guideNode.guideBtn.visible = guide == 0;
  18743. for (let index = 0; index < this.displayList.length; index++) {
  18744. this.displayList[index].checkTry();
  18745. }
  18746. }
  18747. getSkillItemByUIIndex(cur) {
  18748. for (let index = 0; index < this.displayList.length; index++) {
  18749. if (this.displayList[index].index == cur) {
  18750. return this.displayList[index];
  18751. }
  18752. }
  18753. }
  18754. enterGuideLevel() {
  18755. let item = this.getSkillItemByUIIndex(0);
  18756. item.startGame();
  18757. if (DataMgr.getNewUser())
  18758. Moyu.sendDataEvent("gameStart1");
  18759. }
  18760. initSkillData() {
  18761. this.skillData = [];
  18762. let nameList = xGame.common.skillNameList;
  18763. let iconList = xGame.common.skillIconList;
  18764. let describeList = [
  18765. "Jump shot executed — ball bounced and pocketed an extra one!",
  18766. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  18767. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  18768. ];
  18769. let data;
  18770. for (let index = 0; index < nameList.length; index++) {
  18771. data = {};
  18772. data.name = nameList[index];
  18773. data.icon = iconList[index];
  18774. data.describe = describeList[index];
  18775. data.index = index;
  18776. this.skillData.push(data);
  18777. }
  18778. }
  18779. updateSkillItem(index, target) {
  18780. if (this.displayList[index] == null) {
  18781. let uiIndex;
  18782. switch (index) {
  18783. case 0:
  18784. uiIndex = 1;
  18785. break;
  18786. case 1:
  18787. uiIndex = 0;
  18788. break;
  18789. case 2:
  18790. uiIndex = 2;
  18791. break;
  18792. case 3:
  18793. uiIndex = 3;
  18794. break;
  18795. default:
  18796. break;
  18797. }
  18798. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18799. this.displayList.push(temp);
  18800. }
  18801. }
  18802. playSecretaryIdle() {
  18803. let parent = this.ui.secretary.displayObject;
  18804. parent.destroyChildren();
  18805. let xx = this.ui.secretary.width / 2;
  18806. let yy = this.ui.secretary.height;
  18807. let scale = xGame.common.getSecretaryScale();
  18808. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18809. xGame.common.secretary.play(data, 1, true, parent);
  18810. }
  18811. returnUIMain() {
  18812. this.hide();
  18813. xGame.common.stopGirlPop(this.ui.talkNode);
  18814. xGame.uiMgr.Show(UIMain$1);
  18815. }
  18816. interuptSecretary() {
  18817. Laya.timer.clearAll(this);
  18818. this.playSecretaryRandomSound();
  18819. }
  18820. playSecretaryRandomSound() {
  18821. if (this.isHide)
  18822. return;
  18823. let time = xGame.common.randomNum(45000, 60000);
  18824. Laya.timer.once(time, this, () => {
  18825. if (this.isHide)
  18826. return;
  18827. let index = xGame.common.randomNum(4, 7);
  18828. xGame.soundMgr.playSound("s_main0" + index);
  18829. let words = 1;
  18830. switch (index) {
  18831. case 4:
  18832. words = 5;
  18833. break;
  18834. case 5:
  18835. words = 3;
  18836. break;
  18837. case 6:
  18838. words = 6;
  18839. break;
  18840. case 7:
  18841. words = 7;
  18842. break;
  18843. default:
  18844. break;
  18845. }
  18846. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18847. this.playSecretaryRandomSound();
  18848. });
  18849. }
  18850. }
  18851. UISkill$1.uiName = "UISkill";
  18852. class UIAddProp$1 extends UIBase {
  18853. constructor() {
  18854. super();
  18855. this.curType = "";
  18856. }
  18857. onConstructor() {
  18858. this.ui = ui_UIAddProp.createInstance();
  18859. this.contentPane = this.ui;
  18860. this.isEject = false;
  18861. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18862. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18863. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18864. this.updateUI();
  18865. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18866. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18867. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18868. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18869. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18870. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18871. }
  18872. show(type) {
  18873. super.show();
  18874. this.curType = type == 0 ? "coin" : "diamond";
  18875. this.switchBtn("");
  18876. this.ui.t0.play();
  18877. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18878. PlatMgr.showInsert(true);
  18879. }
  18880. closeSelf() {
  18881. this.hide();
  18882. }
  18883. updateUI() {
  18884. let data = cfgTable.moneyData;
  18885. let temp;
  18886. let obj;
  18887. for (const key in data) {
  18888. temp = data[key];
  18889. obj = this.ui.myNode["node" + key];
  18890. if (parseInt(key) <= 2) {
  18891. obj.diamondTxt.text = "+" + temp.num;
  18892. }
  18893. else {
  18894. obj.coinTxt.text = temp.num;
  18895. obj.diamondTxt.text = temp.get.split('_')[1];
  18896. }
  18897. }
  18898. this.updateDiamondShare();
  18899. }
  18900. updateDiamondShare() {
  18901. let data = DataMgr.getShareDiamondTimes();
  18902. if (data >= xGame.common.maxShareDiamondTimes) {
  18903. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  18904. this.ui.myNode.node1.touchable = false;
  18905. }
  18906. else {
  18907. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  18908. this.ui.myNode.node1.touchable = true;
  18909. }
  18910. }
  18911. switchBtn(type) {
  18912. if (type == "")
  18913. type = this.curType;
  18914. else {
  18915. if (this.curType == type) {
  18916. return;
  18917. }
  18918. else {
  18919. this.curType = type;
  18920. }
  18921. }
  18922. if (type == "coin") {
  18923. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  18924. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  18925. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  18926. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  18927. this.ui.myNode.c1.selectedIndex = 0;
  18928. }
  18929. else {
  18930. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  18931. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  18932. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  18933. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  18934. this.ui.myNode.c1.selectedIndex = 1;
  18935. }
  18936. }
  18937. convertCoin(index) {
  18938. let data = cfgTable.moneyData[index];
  18939. let coinNum = data.num;
  18940. let str = data.get.split('_')[1];
  18941. let needDiamond = parseInt(str);
  18942. if (DataMgr.diamondEnough(needDiamond)) {
  18943. DataMgr.setDiamond(-needDiamond);
  18944. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  18945. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  18946. }
  18947. else {
  18948. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  18949. this.switchBtn("diamond");
  18950. }
  18951. }
  18952. videoGetDiamond() {
  18953. let num = cfgTable.moneyData[2].num;
  18954. Moyu.showVideoAd(() => {
  18955. xGame.common.playObjFlyAnim(num, Prop.diamond);
  18956. this.closeSelf();
  18957. }, EAdType.addDiamond);
  18958. }
  18959. videoGetCoin() {
  18960. Moyu.showVideoAd(() => {
  18961. xGame.common.playObjFlyAnim(2000, Prop.coin);
  18962. this.closeSelf();
  18963. }, EAdType.addCoin);
  18964. }
  18965. shareGetDiamond() {
  18966. let times = DataMgr.getShareDiamondTimes();
  18967. if (times >= xGame.common.maxShareDiamondTimes) {
  18968. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  18969. }
  18970. else {
  18971. if (Moyu.isTT) {
  18972. let num = cfgTable.moneyData[1].num;
  18973. Moyu.shareVideo = '';
  18974. Moyu.shareGame((success) => {
  18975. if (success) {
  18976. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  18977. xGame.common.playObjFlyAnim(num, Prop.diamond);
  18978. DataMgr.setShareDiamondTimes(1);
  18979. this.updateDiamondShare();
  18980. }
  18981. else {
  18982. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  18983. }
  18984. });
  18985. }
  18986. else {
  18987. Moyu.showVideoAd(() => {
  18988. let diamond = xGame.common.randomNum(50, 100);
  18989. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  18990. DataMgr.setShareDiamondTimes(1);
  18991. this.updateDiamondShare();
  18992. }, EAdType.randomDiamond);
  18993. }
  18994. }
  18995. }
  18996. openPutBallView() {
  18997. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  18998. let skill = xGame.uiMgr.getUI(UISkill$1);
  18999. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19000. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19001. if (end && !end.isHide) {
  19002. xGame.uiMgr.Hide(UIGameEnd$1);
  19003. xGame.uiMgr.Show(UIMain$1);
  19004. }
  19005. if (skill && !skill.isHide)
  19006. xGame.uiMgr.Hide(UISkill$1);
  19007. if (uigame && !uigame.isHide)
  19008. xGame.uiMgr.Hide(UIGame$1);
  19009. if (level && !level.isHide) {
  19010. }
  19011. else {
  19012. xGame.uiMgr.Show(UILevelDisplay$1);
  19013. }
  19014. this.closeSelf();
  19015. }
  19016. }
  19017. UIAddProp$1.uiName = "UIAddProp";
  19018. class MoneyNode$1 {
  19019. constructor(ui) {
  19020. this.leftTime = 0;
  19021. this.ui = ui;
  19022. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19023. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19024. this.ui.addPowerBtn.onClick(this, this.addPower);
  19025. this.ui.c1.selectedIndex = 1;
  19026. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19027. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19028. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19029. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19030. this.coinChange();
  19031. this.diamondChange();
  19032. this.powerChange();
  19033. }
  19034. addPower() {
  19035. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19036. xGame.uiMgr.Show(UIPower$1);
  19037. }
  19038. powerChange() {
  19039. let powerNum = DataMgr.getPower();
  19040. this.ui.powerTxt.text = powerNum + "";
  19041. }
  19042. checkPowerTime() {
  19043. let cur = new Date().getTime();
  19044. let last = DataMgr.getPowerTime();
  19045. if (last == 0) {
  19046. last = cur;
  19047. DataMgr.setPowerTime(cur);
  19048. }
  19049. let power = DataMgr.getPower();
  19050. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19051. Laya.timer.clearAll(this);
  19052. if (power >= xGame.common.natureMaxPower) {
  19053. this.ui.powerTimeTxt.text = "";
  19054. DataMgr.setPowerTime(cur);
  19055. return;
  19056. }
  19057. if (power + offset >= xGame.common.natureMaxPower) {
  19058. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19059. this.ui.powerTimeTxt.text = "";
  19060. DataMgr.setPowerTime(cur);
  19061. }
  19062. else {
  19063. if (offset > 0) {
  19064. DataMgr.setPower(offset);
  19065. DataMgr.setPowerTime(cur);
  19066. }
  19067. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19068. this.leftTime = xGame.common.powerRecoverNum - time;
  19069. if (this.leftTime <= 0)
  19070. this.leftTime = 0;
  19071. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19072. Laya.timer.loop(1000, this, this.updatePowerTime);
  19073. }
  19074. }
  19075. updatePowerTime() {
  19076. this.leftTime -= 1;
  19077. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19078. if (this.leftTime <= 0) {
  19079. this.checkPowerTime();
  19080. }
  19081. }
  19082. coinChange() {
  19083. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19084. }
  19085. diamondChange() {
  19086. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19087. }
  19088. addCoin() {
  19089. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19090. Moyu.sendDataEvent("AddCoinBtn");
  19091. xGame.uiMgr.Show(UIAddProp$1, 0);
  19092. }
  19093. addDiamond() {
  19094. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19095. Moyu.sendDataEvent("AddDiamondBtn");
  19096. xGame.uiMgr.Show(UIAddProp$1, 1);
  19097. }
  19098. }
  19099. class SettingNode$1 {
  19100. constructor(ui) {
  19101. this.showSetting = false;
  19102. this.openSound = true;
  19103. this.openShake = true;
  19104. this.ui = ui;
  19105. this.ui.soundBtn.onClick(this, this.switchSound);
  19106. this.ui.shakeBtn.onClick(this, this.switchShake);
  19107. this.ui.xyBtn.onClick(this, this.onXy);
  19108. this.ui.clickNode.onClick(this, this.changeSetting);
  19109. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19110. }
  19111. changeSetting() {
  19112. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19113. this.showSetting = !this.showSetting;
  19114. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19115. }
  19116. switchSound() {
  19117. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19118. this.openSound = !this.openSound;
  19119. Moyu.onSetting(this.openSound, this.openShake);
  19120. xGame.soundMgr.onSetting(this.openSound);
  19121. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19122. }
  19123. switchShake() {
  19124. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19125. this.openShake = !this.openShake;
  19126. Moyu.onSetting(this.openSound, this.openShake);
  19127. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19128. }
  19129. onXy() {
  19130. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19131. MoyuMgr$1.showXy(1);
  19132. }
  19133. }
  19134. class UIDraw$1 extends UIBase {
  19135. constructor() {
  19136. super();
  19137. this.curKey = 0;
  19138. }
  19139. onConstructor() {
  19140. this.ui = ui_UIDraw.createInstance();
  19141. this.contentPane = this.ui;
  19142. this.isEject = false;
  19143. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19144. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19145. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19146. this.initDraw();
  19147. this.initUI();
  19148. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19149. if (Moyu.isKs)
  19150. this.ui.closeNode.closeBtn.x += 100;
  19151. }
  19152. show() {
  19153. super.show();
  19154. this.ui.t0.play();
  19155. this.playSecretaryIdle();
  19156. this.updateDraw();
  19157. this.checkFree();
  19158. if (PlatMgr.bannerDelay > 0) {
  19159. this.ui.closeNode.closeBtn.visible = false;
  19160. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19161. this.ui.closeNode.closeBtn.visible = true;
  19162. });
  19163. }
  19164. PlatMgr.showRateBanner();
  19165. }
  19166. hide() {
  19167. Laya.timer.clearAll(this);
  19168. super.hide();
  19169. }
  19170. checkFree() {
  19171. let isFree = DataMgr.getDailyfreeDrawTimes();
  19172. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19173. }
  19174. initDraw() {
  19175. this.drawObj = [];
  19176. let data = cfgTable.drawData;
  19177. let temp;
  19178. let weight = 0;
  19179. for (const key in data) {
  19180. temp = data[key];
  19181. weight += temp.weight;
  19182. this.drawObj.push(weight);
  19183. }
  19184. this.allWeight = weight;
  19185. }
  19186. initUI() {
  19187. let data = cfgTable.drawData;
  19188. let temp;
  19189. let img;
  19190. let txt;
  19191. for (const key in data) {
  19192. temp = data[key];
  19193. img = this.ui.myNode.rotNode["img" + key];
  19194. txt = this.ui.myNode.rotNode["txt" + key];
  19195. img.url = xGame.common.getGameIconUrl(temp.icon);
  19196. txt.visible = true;
  19197. if (temp.award > 2) {
  19198. img.rotation = 0;
  19199. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19200. }
  19201. else {
  19202. img.rotation = temp.rotation;
  19203. txt.text = temp.num;
  19204. }
  19205. }
  19206. }
  19207. getCurkey() {
  19208. let rand = Math.random() * this.allWeight;
  19209. let temp;
  19210. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19211. temp = this.drawObj[index];
  19212. if (index == 0) {
  19213. if (rand < temp) {
  19214. return index + 1;
  19215. }
  19216. }
  19217. else {
  19218. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19219. return index + 1;
  19220. }
  19221. }
  19222. }
  19223. return 2;
  19224. }
  19225. startDraw() {
  19226. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19227. if (freeTimes > 0) {
  19228. this.beginDraw();
  19229. DataMgr.setDailyfreeDrawTimes(0);
  19230. this.checkFree();
  19231. }
  19232. else {
  19233. Moyu.sendDataEvent("turntable");
  19234. Moyu.showVideoAd(() => {
  19235. this.beginDraw();
  19236. }, EAdType.draw);
  19237. }
  19238. }
  19239. beginDraw() {
  19240. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19241. this.ui.drawBtn.touchable = false;
  19242. this.curKey = this.getCurkey();
  19243. console.log("当前key", this.curKey);
  19244. let cell = 60;
  19245. let lap = 3;
  19246. let angle = cell * (this.curKey - 1) + lap * 360;
  19247. let target = this.ui.myNode.rotNode;
  19248. target.rotation = 0;
  19249. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19250. console.log("旋转完成");
  19251. this.ui.drawBtn.touchable = true;
  19252. this.getAward();
  19253. }));
  19254. }
  19255. getAward() {
  19256. let data = cfgTable.drawData[this.curKey];
  19257. let temp = new AwardType();
  19258. temp.type = data.award;
  19259. temp.num = data.num;
  19260. xGame.common.getAward([temp], () => {
  19261. DataMgr.setDrawTimes(1);
  19262. this.updateDraw();
  19263. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19264. });
  19265. }
  19266. updateDraw() {
  19267. let drawTimes = DataMgr.getDrawTimes();
  19268. let awardTimes = DataMgr.getDrawAwardTimes();
  19269. if (Math.floor(drawTimes / 3) > awardTimes) {
  19270. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19271. this.ui.extraNode.boxBtn.touchable = true;
  19272. this.ui.extraNode.tipsTxt.text = "3/3";
  19273. this.ui.extraNode.barNode.width = 265;
  19274. this.getExtraAward();
  19275. }
  19276. else {
  19277. this.ui.extraNode.boxBtn.t0.stop();
  19278. this.ui.extraNode.boxBtn.touchable = false;
  19279. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19280. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19281. }
  19282. let data = cfgTable.drawData[1];
  19283. if (awardTimes == 0) {
  19284. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19285. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19286. this.ui.myNode.rotNode.img1.rotation = 0;
  19287. }
  19288. else {
  19289. let award = data.nextid;
  19290. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19291. this.ui.myNode.rotNode.txt1.text = award[1];
  19292. this.ui.myNode.rotNode.img1.rotation = 0;
  19293. }
  19294. }
  19295. getExtraAward() {
  19296. let drawTimes = DataMgr.getDrawTimes();
  19297. let awardTimes = DataMgr.getDrawAwardTimes();
  19298. let data = cfgTable.drawData[1];
  19299. let award = new AwardType();
  19300. if (awardTimes == 0) {
  19301. award.num = data.num;
  19302. award.type = data.award;
  19303. xGame.common.getAward([award], () => {
  19304. let all = Math.floor(drawTimes / 3);
  19305. DataMgr.setDrawAwardTimes(all);
  19306. this.updateDraw();
  19307. });
  19308. }
  19309. else {
  19310. award.num = parseInt(data.nextid[1]);
  19311. award.type = parseInt(data.nextid[0]);
  19312. xGame.common.getAward([award], () => {
  19313. let all = Math.floor(drawTimes / 3);
  19314. DataMgr.setDrawAwardTimes(all);
  19315. this.updateDraw();
  19316. });
  19317. }
  19318. }
  19319. closeSelf() {
  19320. this.hide();
  19321. }
  19322. playSecretaryIdle() {
  19323. let parent = this.ui.secretary.displayObject;
  19324. parent.destroyChildren();
  19325. let xx = this.ui.secretary.width / 2;
  19326. let yy = this.ui.secretary.height;
  19327. let scale = xGame.common.getSecretaryScale();
  19328. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19329. xGame.common.secretary.play(data, 1, true, parent);
  19330. }
  19331. }
  19332. UIDraw$1.uiName = "UIDraw";
  19333. class UIRanking$1 extends UIBase {
  19334. constructor() {
  19335. super();
  19336. this.showSelf = true;
  19337. this.rankType = 1;
  19338. this.rankList = [];
  19339. this.myIndex = 0;
  19340. this.myStar = 0;
  19341. }
  19342. onConstructor() {
  19343. this.ui = ui_UIRanking.createInstance();
  19344. this.contentPane = this.ui;
  19345. this.isEject = false;
  19346. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19347. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19348. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19349. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19350. this.ui.myNode.myList.setVirtual();
  19351. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19352. }
  19353. show() {
  19354. super.show();
  19355. this.myIndex = 51;
  19356. Moyu.getRankList({
  19357. rankId: xGame.common.curRankID,
  19358. type: MoyuRankType.total,
  19359. page: 1,
  19360. pageSize: 50,
  19361. }, this, this.updateItemData);
  19362. this.updateSelf();
  19363. let self = Moyu.getUserInfo();
  19364. if (!self.isAuth) {
  19365. Moyu.initUser(this, () => {
  19366. DataMgr.upRankData();
  19367. });
  19368. }
  19369. }
  19370. updateSelfItem() {
  19371. let self = Moyu.getUserInfo();
  19372. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19373. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19374. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19375. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19376. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19377. }
  19378. updateItemData(data) {
  19379. this.myStar = xGame.common.getAllStarNum();
  19380. if (this.rankList.length < 2) {
  19381. this.rankList = data;
  19382. let self = Moyu.getUserInfo();
  19383. for (let i = 0; i < data.length; i++) {
  19384. let data = this.rankList[i];
  19385. if (data.userId == self.userId) {
  19386. this.rankList.splice(i, 1);
  19387. break;
  19388. }
  19389. }
  19390. for (let i = 0; i < data.length; i++) {
  19391. let data = this.rankList[i];
  19392. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19393. this.myIndex = i + 1;
  19394. let user = { headIcon: self.headIcon, nickName: "myself" };
  19395. let ud = { user: user, data: {} };
  19396. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19397. if (Moyu.platType < 11) {
  19398. user.headIcon = self.headIcon;
  19399. user.nickName = self.nickName;
  19400. }
  19401. this.rankList.splice(i, 0, md);
  19402. break;
  19403. }
  19404. }
  19405. }
  19406. this.updateSelfItem();
  19407. this.ui.myNode.myList.numItems = this.rankList.length;
  19408. }
  19409. updateItemUI(index, obj) {
  19410. let data = this.rankList[index];
  19411. let userData = JSON.parse(data.userData).user;
  19412. obj.nameTxt.text = userData.nickName.toString();
  19413. obj.valueTxt.text = data.rankScore;
  19414. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19415. obj.rankTxt.text = index + 1;
  19416. switch (index) {
  19417. case 0:
  19418. this.setImg(obj, 1, 0, 0);
  19419. obj.rankTxt.color = "#FFC047";
  19420. break;
  19421. case 1:
  19422. this.setImg(obj, 0, 1, 0);
  19423. obj.rankTxt.color = "#ACACAC";
  19424. break;
  19425. case 2:
  19426. this.setImg(obj, 0, 0, 1);
  19427. obj.rankTxt.color = "#D09672";
  19428. break;
  19429. default:
  19430. this.setImg(obj, 0, 0, 0);
  19431. obj.rankTxt.color = "#496FAB";
  19432. break;
  19433. }
  19434. }
  19435. setImg(obj, a, b, c) {
  19436. obj.img1.visible = a ? true : false;
  19437. obj.img2.visible = b ? true : false;
  19438. obj.img3.visible = c ? true : false;
  19439. }
  19440. changeList(type) {
  19441. this.rankType = type;
  19442. this.updateSelf();
  19443. }
  19444. changeSelfNode() {
  19445. this.showSelf = !this.showSelf;
  19446. this.updateSelf();
  19447. }
  19448. updateSelf() {
  19449. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19450. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19451. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19452. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19453. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19454. }
  19455. }
  19456. UIRanking$1.uiName = "UIRanking";
  19457. class UISecretary$1 extends UIBase {
  19458. constructor() {
  19459. super();
  19460. this.curIndex = 1;
  19461. }
  19462. onConstructor() {
  19463. this.ui = ui_UISecretary.createInstance();
  19464. this.contentPane = this.ui;
  19465. this.isEject = false;
  19466. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19467. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  19468. this.addUIClick(this.ui.rightBtn, this.turnRight);
  19469. this.nodeObj = { left: null, right: null, cur: null };
  19470. this.nodeObj.left = this.ui.myNode.gameNode1;
  19471. this.nodeObj.right = this.ui.myNode.gameNode2;
  19472. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19473. }
  19474. show() {
  19475. super.show();
  19476. this.ui.t0.play();
  19477. this.updateData();
  19478. }
  19479. addSecretarySpine(node, spineName) {
  19480. if (spineName == "mishu") {
  19481. if (this.secretarySpine1) {
  19482. node.displayObject.destroyChildren();
  19483. this.playWoman(this.secretarySpine1, node.displayObject);
  19484. }
  19485. else {
  19486. let spine1 = new SpineMgr("mishu", () => {
  19487. this.secretarySpine1 = spine1;
  19488. this.playWoman(this.secretarySpine1, node.displayObject);
  19489. });
  19490. }
  19491. }
  19492. else {
  19493. if (this.secretarySpine2) {
  19494. node.displayObject.destroyChildren();
  19495. this.playWoman(this.secretarySpine2, node.displayObject);
  19496. }
  19497. else {
  19498. let spine2 = new SpineMgr("xiaomishu2", () => {
  19499. this.secretarySpine2 = spine2;
  19500. this.playWoman(this.secretarySpine2, node.displayObject);
  19501. });
  19502. }
  19503. }
  19504. }
  19505. playWoman(node, parent) {
  19506. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  19507. let yy = this.ui.myNode.gameNode1.secretary.height;
  19508. let scale = 1.5;
  19509. if (node == this.secretarySpine2) {
  19510. scale = 1.2;
  19511. }
  19512. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19513. node.play(data, 1, true, parent);
  19514. }
  19515. turnLeft() {
  19516. this.curIndex--;
  19517. if (this.curIndex < 1) {
  19518. this.curIndex = 2;
  19519. }
  19520. let left = this.nodeObj.left;
  19521. let right = this.nodeObj.right;
  19522. let cur = this.nodeObj.cur;
  19523. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19524. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19525. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19526. this.updateData();
  19527. }));
  19528. this.ui.myNode.setChildIndex(right, 2);
  19529. this.nodeObj.left = cur;
  19530. this.nodeObj.right = left;
  19531. this.nodeObj.cur = right;
  19532. }
  19533. turnRight() {
  19534. this.curIndex++;
  19535. if (this.curIndex > 2) {
  19536. this.curIndex = 1;
  19537. }
  19538. let left = this.nodeObj.left;
  19539. let right = this.nodeObj.right;
  19540. let cur = this.nodeObj.cur;
  19541. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19542. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19543. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19544. this.updateData();
  19545. }));
  19546. this.ui.myNode.setChildIndex(left, 2);
  19547. this.nodeObj.left = right;
  19548. this.nodeObj.right = cur;
  19549. this.nodeObj.cur = left;
  19550. }
  19551. updateData() {
  19552. let data = cfgTable.secretaryshopData;
  19553. let children = this.ui.myNode._children;
  19554. let temp;
  19555. let curData;
  19556. for (let index = 0; index < children.length; index++) {
  19557. temp = children[index];
  19558. if (index == 2) {
  19559. curData = data[this.curIndex];
  19560. temp.purchaseBtn.touchable = true;
  19561. }
  19562. else {
  19563. temp.purchaseBtn.touchable = false;
  19564. if (this.curIndex == 1) {
  19565. curData = data[2];
  19566. }
  19567. else {
  19568. curData = data[1];
  19569. }
  19570. }
  19571. temp.heightTxt.text = curData.height;
  19572. temp.foodTxt.text = curData.food;
  19573. temp.historyTxt.text = curData.history;
  19574. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19575. this.addSecretarySpine(temp.secretary, curData.spine);
  19576. let womanIndex = curData.id - 1;
  19577. let getWoman = DataMgr.getSecretary(womanIndex);
  19578. let curUse = DataMgr.getCurSecretary();
  19579. if (getWoman) {
  19580. if (curUse == womanIndex) {
  19581. temp.purchaseBtn.c1.selectedIndex = 1;
  19582. }
  19583. else {
  19584. temp.purchaseBtn.c1.selectedIndex = 2;
  19585. }
  19586. }
  19587. else {
  19588. temp.purchaseBtn.c1.selectedIndex = 0;
  19589. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19590. }
  19591. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19592. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19593. }
  19594. }
  19595. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19596. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19597. if (getWoman) {
  19598. if (curUse != womanIndex) {
  19599. console.log();
  19600. DataMgr.setCurSecretary(womanIndex);
  19601. this.updateData();
  19602. }
  19603. }
  19604. else {
  19605. let need = needDiamond;
  19606. if (DataMgr.diamondEnough(need)) {
  19607. DataMgr.setDiamond(-need);
  19608. DataMgr.setSecretary(womanIndex, 1);
  19609. DataMgr.setCurSecretary(womanIndex);
  19610. this.updateData();
  19611. }
  19612. else {
  19613. xGame.uiMgr.Show(UIAddProp$1, 1);
  19614. }
  19615. }
  19616. }
  19617. closeSelf() {
  19618. this.hide();
  19619. }
  19620. }
  19621. UISecretary$1.uiName = "UISecretary";
  19622. class BallRodDisplay$1 {
  19623. constructor(ui, index) {
  19624. this.index = 0;
  19625. this.uiIndex = 0;
  19626. this.ui = ui;
  19627. this.index = index;
  19628. this.initData();
  19629. }
  19630. initData() {
  19631. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19632. let data = cfgTable.ballrodData[this.index + 1];
  19633. this.ui.nameTxt.text = data.name;
  19634. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19635. this.ui.levelNode.c1.selectedIndex = data.quality;
  19636. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19637. if (data.spine) {
  19638. this.mySpine = new SpineMgr(data.spine, () => {
  19639. let xx = 150;
  19640. let yy = 70;
  19641. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19642. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19643. });
  19644. }
  19645. }
  19646. updateSelf() {
  19647. let get = DataMgr.getBallRod(this.index);
  19648. if (get == null)
  19649. get = 1;
  19650. let curUse = DataMgr.getCurBallRod();
  19651. if (get) {
  19652. if (curUse == this.index) {
  19653. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19654. }
  19655. else {
  19656. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19657. }
  19658. }
  19659. else {
  19660. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19661. }
  19662. }
  19663. buyBallRod() {
  19664. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19665. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19666. switch (selectedIndex) {
  19667. case 0:
  19668. break;
  19669. case 1:
  19670. DataMgr.setCurBallRod(this.index);
  19671. let ui = xGame.uiMgr.getUI(UIShop$1);
  19672. ui.updateBallRod();
  19673. break;
  19674. case 2:
  19675. let data = cfgTable.ballrodData[this.index + 1];
  19676. let need = data.price;
  19677. if (DataMgr.diamondEnough(need)) {
  19678. DataMgr.setDiamond(-need);
  19679. DataMgr.setBallRod(this.index, 1);
  19680. DataMgr.setCurBallRod(this.index);
  19681. let ui = xGame.uiMgr.getUI(UIShop$1);
  19682. ui.updateBallRod();
  19683. }
  19684. else {
  19685. xGame.uiMgr.Show(UIAddProp$1, 1);
  19686. }
  19687. break;
  19688. default:
  19689. break;
  19690. }
  19691. }
  19692. }
  19693. class UIShop$1 extends UIBase {
  19694. constructor() {
  19695. super();
  19696. this.itemNums = 0;
  19697. }
  19698. onConstructor() {
  19699. this.ui = ui_UIShop.createInstance();
  19700. this.contentPane = this.ui;
  19701. this.isEject = false;
  19702. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19703. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19704. this.addUIClick(this.ui, this.interuptSecretary);
  19705. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19706. this.ballRodArr = [];
  19707. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19708. this.ui.myNode.myList.numItems = this.itemNums;
  19709. if (Moyu.isKs)
  19710. this.ui.closeNode.closeBtn.x += 100;
  19711. }
  19712. show() {
  19713. super.show();
  19714. this.playSecretaryIdle();
  19715. this.updateBallRod();
  19716. }
  19717. updateBallRod() {
  19718. for (let index = 0; index < this.ballRodArr.length; index++) {
  19719. this.ballRodArr[index].updateSelf();
  19720. }
  19721. }
  19722. renderBallRod(sort, obj) {
  19723. let index = this.getIndexBySort(sort + 1) - 1;
  19724. let ballRod = new BallRodDisplay$1(obj, index);
  19725. this.ballRodArr.push(ballRod);
  19726. }
  19727. getIndexBySort(sort) {
  19728. let object = cfgTable.ballrodData;
  19729. for (const key in object) {
  19730. if (object[key].sort == sort) {
  19731. return parseInt(key);
  19732. }
  19733. }
  19734. }
  19735. playSecretaryIdle() {
  19736. let parent = this.ui.secretary.displayObject;
  19737. parent.destroyChildren();
  19738. let xx = this.ui.secretary.width / 2;
  19739. let yy = this.ui.secretary.height;
  19740. let scale = xGame.common.getSecretaryScale();
  19741. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19742. xGame.common.secretary.play(data, 1, true, parent);
  19743. }
  19744. interuptSecretary() {
  19745. Laya.timer.clearAll(this);
  19746. this.playSecretaryRandomSound();
  19747. }
  19748. playSecretaryRandomSound() {
  19749. if (this.isHide)
  19750. return;
  19751. let time = xGame.common.randomNum(45000, 60000);
  19752. Laya.timer.once(time, this, () => {
  19753. if (this.isHide)
  19754. return;
  19755. let index = xGame.common.randomNum(4, 7);
  19756. xGame.soundMgr.playSound("s_main0" + index);
  19757. let words = 1;
  19758. switch (index) {
  19759. case 4:
  19760. words = 5;
  19761. break;
  19762. case 5:
  19763. words = 3;
  19764. break;
  19765. case 6:
  19766. words = 6;
  19767. break;
  19768. case 7:
  19769. words = 7;
  19770. break;
  19771. default:
  19772. break;
  19773. }
  19774. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19775. this.playSecretaryRandomSound();
  19776. });
  19777. }
  19778. closeSelf() {
  19779. this.hide();
  19780. }
  19781. }
  19782. UIShop$1.uiName = "UIShop";
  19783. class SignMax$1 {
  19784. constructor(ui) {
  19785. this.ui = ui;
  19786. }
  19787. updateSelf(index, sameDay, curDayIndex) {
  19788. let data = cfgTable.signData[index + 1];
  19789. this.ui.titleTxt.text = data.title;
  19790. let arr1 = data.award[0].split('-');
  19791. let arr2 = data.award[1].split('-');
  19792. let num1 = parseInt(arr1[1]);
  19793. let num2 = parseInt(arr2[1]);
  19794. this.ui.numTxt1.text = num1 + "";
  19795. this.ui.numTxt2.text = num2 + "";
  19796. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19797. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19798. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19799. this.ui.numTxt1.visible = false;
  19800. }
  19801. else {
  19802. this.ui.numTxt1.visible = true;
  19803. }
  19804. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19805. this.ui.numTxt2.visible = false;
  19806. }
  19807. else {
  19808. this.ui.numTxt2.visible = true;
  19809. }
  19810. if (index < curDayIndex) {
  19811. this.ui.c1.selectedIndex = 1;
  19812. }
  19813. else if (index == curDayIndex) {
  19814. if (sameDay) {
  19815. this.ui.c1.selectedIndex = 2;
  19816. }
  19817. else {
  19818. this.ui.c1.selectedIndex = 2;
  19819. }
  19820. }
  19821. else {
  19822. this.ui.c1.selectedIndex = 0;
  19823. }
  19824. }
  19825. }
  19826. class SignNormal$1 {
  19827. constructor(ui) {
  19828. this.ui = ui;
  19829. }
  19830. updateSelf(index, sameDay, curDayIndex) {
  19831. let data = cfgTable.signData[index + 1];
  19832. this.ui.titleTxt.text = data.title;
  19833. let arr = data.award[0].split('-');
  19834. let type = parseInt(arr[0]);
  19835. let num = parseInt(arr[1]);
  19836. this.ui.numTxt.text = num + "";
  19837. if (type > 2) {
  19838. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19839. this.ui.myIcon.rotation = 0;
  19840. }
  19841. else {
  19842. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19843. this.ui.myIcon.rotation = 0;
  19844. }
  19845. if (xGame.common.signAwardContainsRod(data.award)) {
  19846. this.ui.numTxt.visible = false;
  19847. }
  19848. else {
  19849. this.ui.numTxt.visible = true;
  19850. }
  19851. if (index < curDayIndex) {
  19852. this.ui.c1.selectedIndex = 1;
  19853. }
  19854. else if (index == curDayIndex) {
  19855. if (sameDay) {
  19856. this.ui.c1.selectedIndex = 2;
  19857. }
  19858. else {
  19859. this.ui.c1.selectedIndex = 2;
  19860. }
  19861. }
  19862. else {
  19863. this.ui.c1.selectedIndex = 0;
  19864. }
  19865. }
  19866. }
  19867. class UISign$1 extends UIBase {
  19868. constructor() {
  19869. super();
  19870. this.curDayIndex = 0;
  19871. this.starX = 0;
  19872. }
  19873. onConstructor() {
  19874. this.ui = ui_UISign.createInstance();
  19875. this.contentPane = this.ui;
  19876. this.isEject = false;
  19877. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19878. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19879. this.initSignItem();
  19880. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19881. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19882. }
  19883. show() {
  19884. super.show();
  19885. this.ui.t0.play();
  19886. this.playSecretaryIdle();
  19887. this.updateSign();
  19888. }
  19889. initSignItem() {
  19890. this.signArr = [];
  19891. for (let index = 0; index < 6; index++) {
  19892. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19893. this.signArr.push(temp);
  19894. }
  19895. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19896. if (Moyu.isKs)
  19897. this.ui.closeNode.closeBtn.x += 100;
  19898. }
  19899. updateSign() {
  19900. let sameDay = xGame.common.judgeSameDay();
  19901. let max = 7;
  19902. this.curDayIndex = DataMgr.getSignData();
  19903. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19904. this.curDayIndex = 0;
  19905. if (!sameDay) {
  19906. this.ui.normalBtn.visible = true;
  19907. this.ui.tipsNode.visible = false;
  19908. this.ui.againBtn.visible = false;
  19909. }
  19910. else {
  19911. this.ui.normalBtn.visible = false;
  19912. let again = DataMgr.getExtraSign();
  19913. let isCurrency = false;
  19914. let index = this.curDayIndex;
  19915. if (index == 0)
  19916. index = 7;
  19917. let award = cfgTable.signData[index].award;
  19918. let num = award[0].split("-")[0];
  19919. if (num == "1" || num == "2")
  19920. isCurrency = true;
  19921. let showAgain = again == 0 && isCurrency;
  19922. this.ui.againBtn.visible = showAgain;
  19923. this.ui.tipsNode.visible = !showAgain;
  19924. }
  19925. for (let index = 0; index < this.signArr.length; index++) {
  19926. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  19927. }
  19928. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  19929. }
  19930. playSecretaryIdle() {
  19931. let parent = this.ui.secretary.displayObject;
  19932. parent.destroyChildren();
  19933. let xx = this.ui.secretary.width / 2;
  19934. let yy = this.ui.secretary.height;
  19935. let scale = xGame.common.getSecretaryScale();
  19936. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19937. xGame.common.secretary.play(data, 1, true, parent);
  19938. }
  19939. closeSelf() {
  19940. this.hide();
  19941. }
  19942. normalGetAward() {
  19943. let sameDay = xGame.common.judgeSameDay();
  19944. if (!sameDay) {
  19945. let award = cfgTable.signData[this.curDayIndex + 1].award;
  19946. let temp;
  19947. let type;
  19948. let num;
  19949. let arr = [];
  19950. for (let index = 0; index < award.length; index++) {
  19951. temp = award[index].split("-");
  19952. type = parseInt(temp[0]);
  19953. num = parseInt(temp[1]);
  19954. let awardType = new AwardType();
  19955. awardType.num = num;
  19956. awardType.type = type;
  19957. arr.push(awardType);
  19958. }
  19959. xGame.common.getAward(arr, (watchVideo) => {
  19960. this.curDayIndex++;
  19961. if (this.curDayIndex > 7)
  19962. this.curDayIndex = 0;
  19963. DataMgr.setSignData(this.curDayIndex);
  19964. DataMgr.setSignTime(new Date().getTime());
  19965. if (watchVideo) {
  19966. DataMgr.setExtraSign(1);
  19967. Moyu.sendDataEvent("signIn1");
  19968. }
  19969. this.updateSign();
  19970. });
  19971. }
  19972. }
  19973. againGetAward() {
  19974. Moyu.sendDataEvent("signIn2");
  19975. Moyu.showVideoAd(() => {
  19976. let index = this.curDayIndex;
  19977. if (index == 0)
  19978. index = 7;
  19979. let award = cfgTable.signData[index].award;
  19980. let temp;
  19981. let type;
  19982. let num;
  19983. for (let index = 0; index < award.length; index++) {
  19984. temp = award[index].split("-");
  19985. type = parseInt(temp[0]);
  19986. num = parseInt(temp[1]) * 3;
  19987. xGame.common.playObjFlyAnim(num, type);
  19988. }
  19989. DataMgr.setExtraSign(1);
  19990. this.updateSign();
  19991. }, EAdType.againSign);
  19992. }
  19993. }
  19994. UISign$1.uiName = "UISign";
  19995. class UIModeSelection$1 extends UIBase {
  19996. constructor() {
  19997. super();
  19998. }
  19999. onConstructor() {
  20000. this.ui = ui_UIModeSelection.createInstance();
  20001. this.contentPane = this.ui;
  20002. this.isEject = false;
  20003. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20004. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20005. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20006. this.addUIClick(this.ui.closeBtn, this.hide);
  20007. this.peopleArr = [650, 6900, 3800];
  20008. this.peopleOffest = [50, 500, 200];
  20009. this.updateSelf();
  20010. }
  20011. show(callback) {
  20012. super.show();
  20013. this.ui.t0.play();
  20014. this.callback = callback;
  20015. }
  20016. updateSelf() {
  20017. let cfg = cfgTable.modeselectData;
  20018. for (let index = 1; index <= 3; index++) {
  20019. let node = this.ui.myNode["type" + index];
  20020. node.need.text = cfg[index].need;
  20021. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20022. node.peopleTxt.text = this.getRandPeople(index - 1);
  20023. }
  20024. }
  20025. enterGame(type) {
  20026. xGame.common.classicRoomType = type;
  20027. let cfg = cfgTable.modeselectData[type];
  20028. let need = cfg.need;
  20029. xGame.common.passAwardCoin = cfg.award;
  20030. if (DataMgr.coinEnough(need)) {
  20031. DataMgr.setCoin(-need);
  20032. this.ui.myNode["type" + type].t0.play();
  20033. Laya.timer.once(200, this, () => {
  20034. this.callback && this.callback();
  20035. });
  20036. }
  20037. else {
  20038. Moyu.sendDataEvent("AddCoinVideo");
  20039. xGame.uiMgr.Show(UIAddProp$1, 0);
  20040. }
  20041. }
  20042. getRandPeople(index) {
  20043. let rand = this.peopleOffest[index];
  20044. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20045. }
  20046. }
  20047. UIModeSelection$1.uiName = "UIModeSelection";
  20048. class UIMain$1 extends UIBase {
  20049. constructor() {
  20050. super();
  20051. this.firstEnter = true;
  20052. }
  20053. onConstructor() {
  20054. this.ui = ui_UIMain.createInstance();
  20055. this.contentPane = this.ui;
  20056. this.isEject = false;
  20057. this.addEvent();
  20058. this.addClickSpine();
  20059. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20060. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20061. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20062. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20063. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20064. let curUse = DataMgr.getCurSecretary();
  20065. this.changeSecretary(curUse);
  20066. this.ui.talkNode.visible = false;
  20067. let guide = DataMgr.getSkillGuide();
  20068. if (xGame.common.isNewDay && guide == 1) {
  20069. xGame.common.isNewDay = false;
  20070. xGame.soundMgr.playSound("s_main01");
  20071. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20072. console.log("播放小秘书每天语音");
  20073. }
  20074. this.onGetUserInfo();
  20075. this.ui.n83.visible = false;
  20076. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20077. }
  20078. changeSecretary(curUse) {
  20079. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20080. xGame.common.secretary && xGame.common.secretary.dispose();
  20081. this.addSecretarySpine(name);
  20082. }
  20083. addSecretarySpine(name) {
  20084. let spine = new SpineMgr(name, () => {
  20085. this.playSecretaryIdle();
  20086. });
  20087. xGame.common.secretary = spine;
  20088. }
  20089. addClickSpine() {
  20090. let clickSpine = new SpineMgr("dianji", () => {
  20091. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20092. let parent = Laya.stage;
  20093. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20094. clickSpine.play(data, 0, false, parent, (spine) => {
  20095. spine.destroy(true);
  20096. });
  20097. });
  20098. });
  20099. }
  20100. addEvent() {
  20101. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20102. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20103. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20104. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20105. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20106. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20107. this.addUIClick(this.ui, this.interuptSecretary);
  20108. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20109. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20110. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20111. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20112. this.addUIClick(this.ui.signBtn, this.openSignView);
  20113. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20114. this.addUIClick(this.ui.rankBtn, this.openRanking);
  20115. }
  20116. show(showFailWords) {
  20117. super.show();
  20118. this.moneyNode.ui.c1.selectedIndex = 1;
  20119. this.playSecretaryIdle();
  20120. xGame.soundMgr.playMusic("caromhall01");
  20121. Laya.timer.clearAll(this);
  20122. this.playSecretaryRandomSound();
  20123. if (showFailWords) {
  20124. setTimeout(() => {
  20125. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20126. let words = -1;
  20127. if (str == "s_main02") {
  20128. words = 2;
  20129. }
  20130. else {
  20131. words = 3;
  20132. }
  20133. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20134. xGame.soundMgr.playSound(str);
  20135. }, 300);
  20136. }
  20137. this.showGuide();
  20138. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20139. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20140. let guide = DataMgr.getSkillGuide();
  20141. if (guide == 1) {
  20142. let randTime = xGame.common.randomNum(300, 800);
  20143. if (this.firstEnter) {
  20144. this.firstEnter = false;
  20145. randTime += 900;
  20146. }
  20147. Laya.timer.once(randTime, this, () => {
  20148. xGame.common.autoPopUIView();
  20149. });
  20150. }
  20151. }
  20152. checkActive(show) {
  20153. }
  20154. showGuide() {
  20155. let guide = DataMgr.getSkillGuide();
  20156. this.ui.guideBtn.visible = guide == 0;
  20157. this.ui.enterGuide.visible = false;
  20158. this.ui.secretaryGuide.visible = guide == 0;
  20159. if (guide == 0) {
  20160. xGame.soundMgr.playSound("s_guide");
  20161. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20162. }
  20163. }
  20164. ensureSecretary() {
  20165. this.ui.secretaryGuide.visible = false;
  20166. this.ui.enterGuide.visible = true;
  20167. this.ui.wordsNode.t0.play();
  20168. if (DataMgr.getNewUser())
  20169. Moyu.sendDataEvent("gameReady");
  20170. }
  20171. playSecretaryIdle() {
  20172. let parent = this.ui.secretary.displayObject;
  20173. parent.destroyChildren();
  20174. let xx = this.ui.secretary.width / 2;
  20175. let yy = this.ui.secretary.height;
  20176. let scale = xGame.common.getSecretaryScale();
  20177. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20178. xGame.common.secretary.play(data, 1, true, parent);
  20179. }
  20180. startGame(type) {
  20181. xGame.common.gameMode = type;
  20182. Moyu.sendDataEvent("PlayGame", { type: type });
  20183. switch (xGame.common.gameMode) {
  20184. case GameMode.classic:
  20185. let challengeTimes = DataMgr.getChallengeTimes();
  20186. if (challengeTimes == 0) {
  20187. xGame.uiMgr.Show(UIInvitation$1);
  20188. }
  20189. else {
  20190. this.beginGame();
  20191. }
  20192. break;
  20193. case GameMode.bigMove:
  20194. this.beginGame();
  20195. if (DataMgr.getNewUser())
  20196. Moyu.sendDataEvent("gameStart0");
  20197. break;
  20198. default:
  20199. break;
  20200. }
  20201. }
  20202. beginGame(isNice = false) {
  20203. if (xGame.common.gameMode == GameMode.classic) {
  20204. if (isNice) {
  20205. this.enterClassic();
  20206. }
  20207. else {
  20208. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20209. this.enterClassic();
  20210. });
  20211. }
  20212. }
  20213. else if (xGame.common.gameMode == GameMode.bigMove) {
  20214. this.ui.enterGuide.visible = false;
  20215. xGame.uiMgr.Show(UISkill$1);
  20216. }
  20217. }
  20218. enterClassic() {
  20219. xGame.uiMgr.Show(UIGame$1);
  20220. xGame.uiMgr.Show(UIMatching$1, () => {
  20221. if (!this.isHide)
  20222. this.hide();
  20223. xGame.common.gameUI.ui.alpha = 1;
  20224. xGame.common.gameUI.startGame();
  20225. xGame.uiMgr.Hide(UIGameEnd$1);
  20226. });
  20227. }
  20228. startGlobal() {
  20229. xGame.uiMgr.Show(UIMsg$1, "Coming Soon~");
  20230. }
  20231. startWeekly() {
  20232. xGame.uiMgr.Show(UIMsg$1, "Coming Soon~");
  20233. }
  20234. startPlaceBall() {
  20235. xGame.uiMgr.Show(UILevelDisplay$1);
  20236. }
  20237. hide() {
  20238. super.hide();
  20239. xGame.common.stopGirlPop(this.ui.talkNode);
  20240. }
  20241. onGetUserInfo(force = false) {
  20242. if (Moyu.isWx) {
  20243. let info = Moyu.getSystemInfo();
  20244. if (info)
  20245. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20246. }
  20247. else {
  20248. Moyu.initUser(this, this.freshUser, force);
  20249. }
  20250. if (!Moyu.hasUserInfo) {
  20251. let user = Moyu.getUserInfo();
  20252. user.headIcon = 'res/ty_touxiang.png';
  20253. }
  20254. this.freshUser();
  20255. }
  20256. freshUser() {
  20257. let user = Moyu.getUserInfo();
  20258. if (!user.isAuth) {
  20259. user.headIcon = 'res/ty_touxiang.png';
  20260. }
  20261. else
  20262. DataMgr.upRankData();
  20263. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20264. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20265. }
  20266. interuptSecretary() {
  20267. Laya.timer.clearAll(this);
  20268. this.playSecretaryRandomSound();
  20269. }
  20270. playSecretaryRandomSound() {
  20271. if (this.isHide)
  20272. return;
  20273. let time = xGame.common.randomNum(45000, 60000);
  20274. Laya.timer.once(time, this, () => {
  20275. if (this.isHide)
  20276. return;
  20277. let index = xGame.common.randomNum(4, 7);
  20278. xGame.soundMgr.playSound("s_main0" + index);
  20279. let words = 1;
  20280. switch (index) {
  20281. case 4:
  20282. words = 5;
  20283. break;
  20284. case 5:
  20285. words = 3;
  20286. break;
  20287. case 6:
  20288. words = 6;
  20289. break;
  20290. case 7:
  20291. words = 7;
  20292. break;
  20293. default:
  20294. break;
  20295. }
  20296. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20297. this.playSecretaryRandomSound();
  20298. });
  20299. }
  20300. openSecretaryView() {
  20301. xGame.uiMgr.Show(UISecretary$1);
  20302. Moyu.sendDataEvent("secretary");
  20303. }
  20304. openShopView() {
  20305. xGame.uiMgr.Show(UIShop$1);
  20306. }
  20307. openSignView() {
  20308. xGame.uiMgr.Show(UISign$1);
  20309. }
  20310. openDrawView() {
  20311. xGame.uiMgr.Show(UIDraw$1);
  20312. }
  20313. openRanking() {
  20314. xGame.uiMgr.Show(UIRanking$1);
  20315. Moyu.sendDataEvent("rankingList");
  20316. }
  20317. }
  20318. UIMain$1.uiName = "UIMain";
  20319. function InitShader() {
  20320. }
  20321. function appInit() {
  20322. xGame.context.init(getLoadingResList(), initCallback);
  20323. }
  20324. function getLoadingResList() {
  20325. return [
  20326. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20327. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20328. ];
  20329. }
  20330. function getGameResList() {
  20331. return [
  20332. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20333. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20334. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20335. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20336. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20337. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20338. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20339. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20340. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20341. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20342. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20343. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20344. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20345. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20346. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20347. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20348. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20349. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20350. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20351. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20352. ];
  20353. }
  20354. function initCallback() {
  20355. window["DataMgr"] = DataMgr;
  20356. DataMgr.Init();
  20357. Moyu.init(getPlat(), this, () => {
  20358. DataMgr.isNewDay();
  20359. PlatMgr.initConfig();
  20360. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20361. }, true);
  20362. console.log('zh:开始sm init1 start');
  20363. xGame.soundMgr.init();
  20364. console.log('zh:开始sm init1 end');
  20365. xGame.uiMgr.init();
  20366. xGame.uiMgr.bindFUI(fguiRes.loading);
  20367. xGame.uiMgr.Show(UILoading);
  20368. }
  20369. function loadSubRes(callback) {
  20370. var tab = ["asset", "res", "spine"];
  20371. let subDone = 0;
  20372. for (var i = 0; i < tab.length; i++) {
  20373. let sub = tab[i];
  20374. Moyu.loadSubRes(sub, (pro) => {
  20375. callback && callback(pro, false);
  20376. }).then(() => {
  20377. subDone++;
  20378. if (subDone >= tab.length)
  20379. callback && callback(1, true);
  20380. });
  20381. }
  20382. }
  20383. function enterGame() {
  20384. xGame.cfgMgr.init();
  20385. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20386. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20387. xGame.uiMgr.Hide(UILoading);
  20388. fgui.UIPackage.removePackage(fguiRes.loading);
  20389. xGame.uiMgr.bindFUI(fguiRes.game);
  20390. xGame.uiMgr.Show(UIMain$1);
  20391. if (DataMgr.getNewUser())
  20392. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20393. }
  20394. function getPlat() {
  20395. let cfg = new MoyuCfg();
  20396. cfg.plat = MoyuPlat.web;
  20397. cfg.myId = 120;
  20398. cfg.myKey = '8848a885774230a4';
  20399. cfg.version = 0;
  20400. if (window.hasOwnProperty("gamebox")) {
  20401. cfg.plat = MoyuPlat.f399;
  20402. cfg.version = 0;
  20403. }
  20404. else if (window.hasOwnProperty("ks")) {
  20405. cfg.plat = MoyuPlat.ks;
  20406. cfg.version = 0;
  20407. cfg.ads.ksVideoId = '2300002254_01';
  20408. cfg.ads.ksInsertId = '2300002254_02';
  20409. }
  20410. else if (Laya.Browser.onTTMiniGame) {
  20411. cfg.plat = MoyuPlat.tt;
  20412. cfg.version = 0;
  20413. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20414. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20415. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20416. }
  20417. else if (Laya.Browser.onMiniGame) {
  20418. cfg.plat = MoyuPlat.wx;
  20419. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20420. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20421. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20422. }
  20423. else if (Laya.Browser.onQQMiniGame) {
  20424. cfg.plat = MoyuPlat.qq;
  20425. }
  20426. else if (Laya.Browser.onQGMiniGame) {
  20427. cfg.plat = MoyuPlat.op;
  20428. cfg.ads.opVideoId = '455502';
  20429. cfg.ads.opBannerId = '455507';
  20430. }
  20431. else if (Laya.Browser.onVVMiniGame) {
  20432. cfg.plat = MoyuPlat.vv;
  20433. cfg.version = 0;
  20434. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20435. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20436. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20437. }
  20438. else if (Laya.Browser.onHWMiniGame) {
  20439. cfg.plat = MoyuPlat.hw;
  20440. }
  20441. else if (window["mz"]) {
  20442. cfg.plat = MoyuPlat.mz;
  20443. }
  20444. else {
  20445. let cfg = window['conchConfig'];
  20446. if (cfg) {
  20447. var os = cfg.getOS();
  20448. if (os == "Conch-ios") {
  20449. cfg.plat = MoyuPlat.ios;
  20450. }
  20451. else if (os == "Conch-android") {
  20452. }
  20453. }
  20454. }
  20455. return cfg;
  20456. }
  20457. class Main {
  20458. constructor() {
  20459. if (window["Laya3D"])
  20460. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20461. else {
  20462. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20463. this.initMain();
  20464. }
  20465. }
  20466. initMain() {
  20467. Laya["Physics"] && Laya["Physics"].enable();
  20468. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20469. Laya.stage.scaleMode = GameConfig.scaleMode;
  20470. Laya.stage.screenMode = GameConfig.screenMode;
  20471. Laya.stage.alignV = GameConfig.alignV;
  20472. Laya.stage.alignH = GameConfig.alignH;
  20473. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20474. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20475. Laya.enableDebugPanel();
  20476. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20477. Laya["PhysicsDebugDraw"].enable();
  20478. if (GameConfig.stat)
  20479. Laya.Stat.show();
  20480. Laya.alertGlobalError(true);
  20481. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20482. }
  20483. onVersionLoaded() {
  20484. appInit();
  20485. }
  20486. }
  20487. new Main();
  20488. }());
  20489. //# sourceMappingURL=bundle.js.map