bundle.js 798 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class UIBox extends UIBase {
  1062. constructor() {
  1063. super();
  1064. this.boxNum = 0;
  1065. this.boxMax = 10;
  1066. this.inAd = false;
  1067. this.isClose = false;
  1068. }
  1069. onConstructor() {
  1070. this.ui = ui_UIBox.createInstance();
  1071. this.contentPane = this.ui;
  1072. this.isEject = false;
  1073. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1074. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1075. Laya.timer.loop(1000, this, this.update);
  1076. }
  1077. update() {
  1078. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1079. this.boxNum -= 1;
  1080. this.upBar();
  1081. }
  1082. }
  1083. upBar() {
  1084. if (this.boxNum > this.boxMax)
  1085. this.boxNum = this.boxMax;
  1086. this.ui.bar.value = this.boxNum * 10;
  1087. }
  1088. show() {
  1089. super.show();
  1090. this.isClose = false;
  1091. this.boxNum = 0;
  1092. this.inAd = false;
  1093. this.upBar();
  1094. this.ui.t0.play();
  1095. this.ui.closeBtn.visible = false;
  1096. Laya.timer.once(3000, this, () => {
  1097. this.ui.closeBtn.visible = true;
  1098. this.ui.bar.alpha = 1;
  1099. });
  1100. Laya.timer.once(500, this, () => {
  1101. this.ui.t1.play();
  1102. });
  1103. }
  1104. hide() {
  1105. Laya.timer.clearAll(this);
  1106. Moyu.showBannerAd(false);
  1107. super.hide();
  1108. }
  1109. onOpenBox() {
  1110. this.boxNum++;
  1111. if (this.boxNum < this.boxMax) {
  1112. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1113. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1114. }
  1115. else if (this.boxNum == this.boxMax) {
  1116. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1117. this.ui.openBtn.c1.selectedIndex = 13;
  1118. this.inAd = true;
  1119. }
  1120. else
  1121. this.getAward();
  1122. }
  1123. else if (this.inAd) {
  1124. Moyu.showVideoAd(() => {
  1125. this.getAward();
  1126. }, EAdType.box);
  1127. }
  1128. this.upBar();
  1129. }
  1130. onCloseBox() {
  1131. if (this.isClose)
  1132. this.hide();
  1133. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1134. this.isClose = true;
  1135. PlatMgr.showBanner(true, 0, 3000);
  1136. }
  1137. else
  1138. this.hide();
  1139. }
  1140. getAward() {
  1141. let str = "";
  1142. if (Math.random() < 0.5) {
  1143. let max = Moyu.isLegal ? 500 : 2500;
  1144. let num = xGame.tools.random(max, 500 + max);
  1145. DataMgr.setCoin(num);
  1146. str = "金币x" + num;
  1147. }
  1148. else {
  1149. let max = Moyu.isLegal ? 10 : 30;
  1150. let num = xGame.tools.random(max, 30 + max);
  1151. DataMgr.setDiamond(num);
  1152. str = "钻石x" + num;
  1153. }
  1154. xGame.showTip("恭喜获得-" + str);
  1155. this.hide();
  1156. }
  1157. }
  1158. UIBox.uiName = "UIBox";
  1159. class ui_UITry extends fgui.GComponent {
  1160. static createInstance() {
  1161. return (fgui.UIPackage.createObject("game", "UITry"));
  1162. }
  1163. onConstruct() {
  1164. this.n11 = (this.getChild("n11"));
  1165. this.myNode = (this.getChild("myNode"));
  1166. this.t0 = this.getTransition("t0");
  1167. }
  1168. }
  1169. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1170. class UITry extends UIBase {
  1171. constructor() {
  1172. super();
  1173. this.closeTime = 0;
  1174. this.closeNum = 0;
  1175. this.skillUrl = xGame.common.skillIconList;
  1176. }
  1177. onConstructor() {
  1178. this.ui = ui_UITry.createInstance();
  1179. this.contentPane = this.ui;
  1180. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1181. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1182. }
  1183. show() {
  1184. super.show();
  1185. this.closeNum = 0;
  1186. this.closeTime = 15;
  1187. this.ui.t0.play();
  1188. PlatMgr.showRateBanner();
  1189. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1190. Laya.timer.loop(1000, this, this.updateTime);
  1191. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1192. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1193. xGame.common.gameMgr.gamePause = true;
  1194. }
  1195. updateTime() {
  1196. if (this.closeTime > 1) {
  1197. this.closeTime--;
  1198. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1199. }
  1200. else
  1201. this.hide();
  1202. }
  1203. hide() {
  1204. Laya.timer.clearAll(this);
  1205. Moyu.showBannerAd(false);
  1206. super.hide();
  1207. xGame.common.gameMgr.gamePause = false;
  1208. }
  1209. onTry() {
  1210. Moyu.showVideoAd(() => {
  1211. let select = xGame.common.curPlayerSkillType;
  1212. DataMgr.gameData.trySkill = select;
  1213. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1214. DataMgr.saveGameData();
  1215. DataMgr.setBigSkill(select, 1);
  1216. xGame.showTip("Trial Successful");
  1217. this.hide();
  1218. }, EAdType.try);
  1219. }
  1220. onCancel() {
  1221. if (this.closeNum > 0) {
  1222. this.closeNum--;
  1223. if (this.closeNum < 2)
  1224. this.hide();
  1225. return;
  1226. }
  1227. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1228. this.onTry();
  1229. }
  1230. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1231. this.closeNum = 3;
  1232. }
  1233. else
  1234. this.hide();
  1235. }
  1236. }
  1237. UITry.uiName = "UITry";
  1238. class PlatMgr {
  1239. static initConfig() {
  1240. this.lastVt = 0;
  1241. if (!Moyu.platConfig)
  1242. return;
  1243. for (let k in Moyu.platConfig) {
  1244. let pd = this[k];
  1245. let pc = Moyu.platConfig[k];
  1246. if (pd != undefined && pc != undefined)
  1247. this[k] = pc;
  1248. }
  1249. Moyu.setBannerPos(0.5, 1);
  1250. }
  1251. static rand100(num) {
  1252. return xGame.tools.random(0, 100) < num;
  1253. }
  1254. static isMisVideo() {
  1255. let dt = Laya.timer.currTimer - this.lastVt;
  1256. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1257. this.lastVt = Laya.timer.currTimer;
  1258. return true;
  1259. }
  1260. else {
  1261. if (this.rand100(this.fullVideoRate))
  1262. Moyu.showInsertAd(0, 0, 'full');
  1263. return false;
  1264. }
  1265. }
  1266. static showVideo(call, type) {
  1267. Moyu.showVideoAd(() => {
  1268. this.lastVt = Laya.timer.currTimer;
  1269. call && call();
  1270. }, type);
  1271. }
  1272. static showInsert(delay = false) {
  1273. if (this.getRand() < this.insertRate) {
  1274. let dt = delay ? this.insertDelay : 0;
  1275. Moyu.showInsertAd(dt, this.insertGap);
  1276. }
  1277. }
  1278. static gameInsert() {
  1279. if (this.getRand() < this.gameInsertRate) {
  1280. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1281. }
  1282. }
  1283. static showRateBanner() {
  1284. if (this.getRand() < this.bannerRate)
  1285. this.showBanner(true, this.bannerDelay, 3000);
  1286. }
  1287. static showBanner(show, delay = 0, hide = 0) {
  1288. if (!show)
  1289. Moyu.showBannerAd(false);
  1290. else {
  1291. Laya.timer.clear(this, this.bannerShow);
  1292. if (delay > 0)
  1293. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1294. else
  1295. this.bannerShow(true);
  1296. if (hide > 0)
  1297. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1298. }
  1299. }
  1300. static bannerShow(show) {
  1301. Moyu.showBannerAd(show);
  1302. console.log("showBanner" + show);
  1303. }
  1304. static getRand() {
  1305. return xGame.tools.random(0, 100);
  1306. }
  1307. static openBox() {
  1308. if (this.getRand() < this.boxRate)
  1309. xGame.uiMgr.Show(UIBox);
  1310. }
  1311. static openTry() {
  1312. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1313. return;
  1314. if (this.getRand() < this.tryRate)
  1315. xGame.uiMgr.Show(UITry);
  1316. else if (DataMgr.gameData.gameCount == 1)
  1317. xGame.uiMgr.Show(UITry);
  1318. }
  1319. }
  1320. PlatMgr.forceShare = 0;
  1321. PlatMgr.signAdRate = 0;
  1322. PlatMgr.forceVideoRate = 0;
  1323. PlatMgr.forceVideoGap = 0;
  1324. PlatMgr.fullVideoRate = 0;
  1325. PlatMgr.gameInsertRate = 0;
  1326. PlatMgr.insertGap = 0;
  1327. PlatMgr.insertDelay = 0;
  1328. PlatMgr.insertRate = 0;
  1329. PlatMgr.boxRate = 0;
  1330. PlatMgr.boxVideoRate = 0;
  1331. PlatMgr.boxInsertRate = 0;
  1332. PlatMgr.boxBannerRate = 0;
  1333. PlatMgr.tryRate = 0;
  1334. PlatMgr.tryClose3Rate = 0;
  1335. PlatMgr.tryVideoRate = 0;
  1336. PlatMgr.bannerRate = 0;
  1337. PlatMgr.lastVt = 0;
  1338. class ui_UIAddProp extends fgui.GComponent {
  1339. static createInstance() {
  1340. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1341. }
  1342. onConstruct() {
  1343. this.n11 = (this.getChild("n11"));
  1344. this.myNode = (this.getChild("myNode"));
  1345. this.closeBtn = (this.getChild("closeBtn"));
  1346. this.t0 = this.getTransition("t0");
  1347. }
  1348. }
  1349. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1350. class SpineMgr {
  1351. constructor(name, loadCb = null) {
  1352. this.loaded = false;
  1353. this.spineName = '';
  1354. this.loadedCallback = loadCb;
  1355. this.templet = new Laya.Templet();
  1356. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1357. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1358. if (name === 'mishu') {
  1359. this.templet.loadAni('spine/nvmishu.sk');
  1360. }
  1361. else {
  1362. this.templet.loadAni(`spine/${name}.sk`);
  1363. }
  1364. this.templet.lock = true;
  1365. this.spineName = name;
  1366. }
  1367. onError() {
  1368. console.log("zh:spine加载出错");
  1369. }
  1370. parseComplete() {
  1371. this.loaded = true;
  1372. this.loadedCallback && this.loadedCallback();
  1373. }
  1374. dispose() {
  1375. if (this.templet && !this.templet.destroyed) {
  1376. this.templet.destroy();
  1377. }
  1378. this.templet = null;
  1379. }
  1380. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1381. if (!this.loaded) {
  1382. return;
  1383. }
  1384. let spine;
  1385. if (mySpine) {
  1386. spine = mySpine;
  1387. }
  1388. else {
  1389. spine = this.createSpine(data, parent);
  1390. }
  1391. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1392. if (!isLoop) {
  1393. spine.on(Laya.Event.STOPPED, this, () => {
  1394. spine.offAll(Laya.Event.STOPPED);
  1395. callback && callback(spine);
  1396. });
  1397. }
  1398. return spine;
  1399. }
  1400. createSpine(data, parent, type = 1) {
  1401. let spine;
  1402. spine = this.templet.buildArmature(type);
  1403. spine.showSkinByIndex(0);
  1404. parent.addChild(spine);
  1405. spine.pos(data.x, data.y);
  1406. spine.scale(data.scaleX, data.scaleY, true);
  1407. return spine;
  1408. }
  1409. }
  1410. var AIState;
  1411. (function (AIState) {
  1412. AIState[AIState["none"] = 0] = "none";
  1413. AIState[AIState["idle"] = 1] = "idle";
  1414. AIState[AIState["reset"] = 2] = "reset";
  1415. AIState[AIState["move"] = 3] = "move";
  1416. AIState[AIState["wait"] = 4] = "wait";
  1417. AIState[AIState["select"] = 5] = "select";
  1418. AIState[AIState["turn"] = 6] = "turn";
  1419. AIState[AIState["shoot"] = 7] = "shoot";
  1420. AIState[AIState["leave"] = 8] = "leave";
  1421. })(AIState || (AIState = {}));
  1422. class AIPlayer {
  1423. constructor() {
  1424. this.dtime = 30;
  1425. this.awayTime = 0;
  1426. this.awayNum = 0;
  1427. this.hideTime = 0;
  1428. this.rootMoveTime = 0;
  1429. this.isGuide = false;
  1430. this.state = AIState.none;
  1431. this.waitTime = 0;
  1432. this.forceNum = 0;
  1433. this.forceMax = 0;
  1434. this.ballSize = 33;
  1435. this.selectNum = 0;
  1436. this.destRot = 0;
  1437. this.aiLv = 10;
  1438. this.kickBall = [];
  1439. this.lineBall = [];
  1440. this.scoreBall = [];
  1441. this.holeBall = [];
  1442. this.turnNum = 0;
  1443. this.setNum = 0;
  1444. this.setMax = 0;
  1445. this.setRate = 0;
  1446. this.rectL = 0;
  1447. this.rectR = 0;
  1448. this.rectT = 0;
  1449. this.rectB = 0;
  1450. this.rootPos = { x: 0, y: 0 };
  1451. this.bestForce = 0;
  1452. this.bestAngle = 180;
  1453. this.bestPos = { x: 0, y: 0 };
  1454. this.bestKick = { x: 0, y: 0 };
  1455. this.posList = [];
  1456. this.posIdx = 0;
  1457. this.chatTime = 3000;
  1458. this.tempDir1 = new Laya.Vector2();
  1459. this.tempDir2 = new Laya.Vector2();
  1460. this.tempDir3 = new Laya.Vector2();
  1461. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1462. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1463. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1464. this.gameSrc = xGame.common.gameUI;
  1465. this.hideTime = Laya.timer.currTimer;
  1466. Moyu.setOnTipCall((id) => {
  1467. if (id == 20012)
  1468. this.hideTime = Laya.timer.currTimer;
  1469. else
  1470. (id == 20011);
  1471. {
  1472. let dt = Laya.timer.currTimer - this.hideTime;
  1473. console.log("onshow" + dt);
  1474. if (dt > 30000 && this.state > AIState.none)
  1475. xGame.common.gameMgr.aiGameEnd(false);
  1476. }
  1477. }, this);
  1478. }
  1479. init() {
  1480. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1481. this.awayTime = xGame.tools.random(5000, 10000);
  1482. this.awayNum = 0;
  1483. this.hideTime = Laya.timer.currTimer;
  1484. let rect = xGame.common.d2World.borderRect;
  1485. this.rectL = Math.ceil(rect.x) + 17;
  1486. this.rectT = Math.ceil(rect.y) + 17;
  1487. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1488. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1489. this.wBall = xGame.common.d2World.rootBall;
  1490. this.ballSize = this.wBall.gameObj.width - 1;
  1491. if (this.posList.length < 1) {
  1492. let dp = 40;
  1493. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1494. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1495. let dx = i < this.rectR ? i : this.rectR;
  1496. let dy = j < this.rectB ? j : this.rectB;
  1497. let order = xGame.tools.random(0, 1000);
  1498. this.posList.push({ x: dx, y: dy, order: order });
  1499. }
  1500. }
  1501. this.posList.sort(function (a, b) {
  1502. return a.order - b.order;
  1503. });
  1504. this.setMax = this.posList.length;
  1505. }
  1506. this.state = AIState.idle;
  1507. }
  1508. setAiLevel(num) {
  1509. this.aiLv = num;
  1510. }
  1511. initBall() {
  1512. this.rootPos.x = this.wBall.gameObj.x;
  1513. this.rootPos.y = this.wBall.gameObj.y;
  1514. this.initHoleBall();
  1515. }
  1516. initHoleBall() {
  1517. this.kickBall = [];
  1518. this.lineBall = [];
  1519. this.scoreBall = [];
  1520. this.holeBall = [];
  1521. this.selectNum = 0;
  1522. this.forceNum = 0;
  1523. this.forceMax = 0;
  1524. this.turnNum = 0;
  1525. let list = xGame.common.d2World.ballArr;
  1526. if (list.length < 20 && !this.isGuide) {
  1527. let holes = xGame.common.gameMgr.holePosList;
  1528. for (let i = 0; i < list.length; i++) {
  1529. let obj = list[i];
  1530. if (!obj)
  1531. continue;
  1532. obj.kickPos.x = 0;
  1533. obj.kickPos.y = 0;
  1534. obj.poleAngle = 0;
  1535. obj.hard = 0;
  1536. obj.borderDis = 0;
  1537. obj.kickAngle = 180;
  1538. if (obj.number == 0)
  1539. continue;
  1540. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1541. continue;
  1542. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1543. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1544. continue;
  1545. }
  1546. let b = obj.gameObj;
  1547. let wbp = this.rootPos;
  1548. let bx = wbp.x - b.x;
  1549. let by = wbp.y - b.y;
  1550. obj.borderDis = xGame.tools.random(0, 100);
  1551. this.kickBall.push(obj);
  1552. if (!this.isLine(wbp, obj))
  1553. continue;
  1554. obj.kickAngle = xGame.tools.random(90, 180);
  1555. obj.kickPos.x = b.x;
  1556. obj.kickPos.y = b.y;
  1557. this.lineBall.push(obj);
  1558. let minDis = 999999;
  1559. let hole = false;
  1560. for (let j = 0; j < holes.length; j++) {
  1561. let hp = holes[j];
  1562. if (bx >= 0 && hp.x > b.x + 100)
  1563. continue;
  1564. if (bx <= 0 && hp.x < b.x - 100)
  1565. continue;
  1566. if (by < -10 && hp.y < wbp.y)
  1567. continue;
  1568. if (by > 10 && hp.y > wbp.y)
  1569. continue;
  1570. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1571. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1572. if (dis < minDis) {
  1573. let dx = b.x - this.tempDir1.x * this.ballSize;
  1574. let dy = b.y - this.tempDir1.y * this.ballSize;
  1575. this.tempDir3.x = this.tempDir1.x;
  1576. this.tempDir3.y = this.tempDir1.y;
  1577. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1578. obj.kickPos.x = dx;
  1579. obj.kickPos.y = dy;
  1580. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1581. if (num > 1)
  1582. num = 1;
  1583. obj.kickAngle = Math.acos(num) * 57.3;
  1584. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1585. dis = dis * 2;
  1586. if (Math.abs(hp.x - 600) < 100)
  1587. dis += 50;
  1588. obj.hard = dis + obj.kickAngle * 3;
  1589. hole = true;
  1590. }
  1591. }
  1592. }
  1593. }
  1594. if (hole) {
  1595. this.scoreBall.push(obj);
  1596. this.holeBall.push(obj);
  1597. }
  1598. }
  1599. this.scoreBall.sort(function (a, b) {
  1600. return a.hard - b.hard;
  1601. });
  1602. this.holeBall.sort(function (a, b) {
  1603. return a.kickAngle - b.kickAngle;
  1604. });
  1605. this.kickBall.sort(function (a, b) {
  1606. return a.borderDis - b.borderDis;
  1607. });
  1608. }
  1609. else {
  1610. let max = list.length - 1;
  1611. let i = xGame.tools.random(0, max);
  1612. for (i; i <= max; i++) {
  1613. let idx = i >= max ? i -= max : i;
  1614. let obj = list[idx];
  1615. if (obj && obj.number != 0) {
  1616. obj.kickAngle = xGame.tools.random(90, 180);
  1617. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1618. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1619. this.lineBall.push(obj);
  1620. break;
  1621. }
  1622. }
  1623. }
  1624. }
  1625. selectBall() {
  1626. let ball = null;
  1627. this.destRot = 0;
  1628. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1629. let ai = 110 - this.aiLv * 10;
  1630. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1631. let score = false;
  1632. if (this.scoreBall.length < 1) {
  1633. if (this.lineBall.length < 1) {
  1634. for (let i = 0; i < this.kickBall.length; i++) {
  1635. let list = [];
  1636. let bo = this.kickBall[i];
  1637. let bobj = bo.gameObj;
  1638. let rect = xGame.common.d2World.borderRect;
  1639. let mobj = this.wBall.gameObj;
  1640. let minb = bobj.y - rect.y - 20;
  1641. let minw = mobj.y - rect.y - 50;
  1642. if (minb > 0 && minw > 0) {
  1643. let dlenx = 0;
  1644. let dleny = mobj.y - rect.y;
  1645. let spx = mobj.x;
  1646. let spy = rect.y - dleny;
  1647. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1648. }
  1649. minb = rect.y + rect.height - bobj.y - 20;
  1650. minw = rect.y + rect.height - mobj.y - 50;
  1651. if (minb > 0 && minw > 0) {
  1652. let dlenx = 0;
  1653. let dleny = rect.y + rect.height - mobj.y;
  1654. let spx = mobj.x;
  1655. let spy = rect.y + rect.height + dleny;
  1656. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1657. }
  1658. minb = bobj.x - rect.x - 20;
  1659. minw = mobj.x - rect.x - 50;
  1660. if (minb > 0 && minw > 0) {
  1661. let dlenx = mobj.x - rect.x;
  1662. let dleny = 0;
  1663. let spx = rect.x - dlenx;
  1664. let spy = mobj.y;
  1665. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1666. }
  1667. minb = rect.x + rect.width - bobj.x - 20;
  1668. minw = rect.x + rect.width - mobj.x - 50;
  1669. if (minb > 0 && minw > 0) {
  1670. let dlenx = rect.x + rect.width - mobj.x;
  1671. let dleny = 0;
  1672. let spx = rect.x + rect.width + dlenx;
  1673. let spy = mobj.y;
  1674. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1675. }
  1676. list.sort(function (a, b) {
  1677. return a.order - b.order;
  1678. });
  1679. for (let i = 0; i < list.length; i++) {
  1680. let data = list[i];
  1681. let mx = mobj.x - bobj.x;
  1682. let my = mobj.y - bobj.y;
  1683. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1684. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1685. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1686. if (num > 1)
  1687. num = 1;
  1688. let cos = Math.acos(num);
  1689. if (cos > 1.57)
  1690. cos = 1.57;
  1691. else if (cos < 0.01)
  1692. cos = 0.01;
  1693. let tan = Math.tan(cos);
  1694. let dx = tan * data.dleny;
  1695. let dy = tan * data.dlenx;
  1696. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1697. if (Math.abs(bx - 667) < 40)
  1698. continue;
  1699. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1700. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1701. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1702. this.forceMax = dis * 0.08;
  1703. this.destRot += mis * 0.1;
  1704. this.setKick(bx, by);
  1705. return true;
  1706. }
  1707. }
  1708. }
  1709. }
  1710. else {
  1711. ball = xGame.common.getRandArrEle(this.lineBall);
  1712. }
  1713. }
  1714. else {
  1715. for (let i = 0; i < this.scoreBall.length; i++) {
  1716. if (i < this.scoreBall.length - 1) {
  1717. let rand = 70 + this.aiLv * 10 + i * 10;
  1718. if (xGame.tools.random(0, 100) < rand) {
  1719. ball = this.scoreBall[i];
  1720. break;
  1721. }
  1722. }
  1723. else {
  1724. ball = this.scoreBall[i];
  1725. break;
  1726. }
  1727. }
  1728. score = true;
  1729. this.selectNum++;
  1730. }
  1731. if (!ball)
  1732. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1733. if (this.selectNum >= max) {
  1734. let dx = ball.gameObj.x;
  1735. let dy = ball.gameObj.y;
  1736. let kickAngle = 0;
  1737. if (score) {
  1738. dx = ball.kickPos.x;
  1739. dy = ball.kickPos.y;
  1740. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1741. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1742. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1743. if (adot > 1)
  1744. adot = 1;
  1745. kickAngle = Math.acos(adot) * 57.3;
  1746. if (kickAngle > 45) {
  1747. let kdx = ball.kickPos.x - ball.gameObj.x;
  1748. let kdy = ball.kickPos.y - ball.gameObj.y;
  1749. dx = ball.kickPos.x - kdx * mis * 0.3;
  1750. dy = ball.kickPos.y - kdy * mis * 0.3;
  1751. }
  1752. else
  1753. this.destRot += mis;
  1754. }
  1755. else if (ball.poleAngle != 0) {
  1756. this.destRot += ball.poleAngle;
  1757. }
  1758. if (xGame.common.gameMode == 0) {
  1759. let af = kickAngle * 0.08;
  1760. this.forceMax = ball.hard * 0.1 + af * af;
  1761. }
  1762. this.setKick(dx, dy);
  1763. }
  1764. else {
  1765. let rand = this.aiLv * 5 + 40;
  1766. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1767. ball = xGame.common.getRandArrEle(this.scoreBall);
  1768. else
  1769. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1770. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1771. if (xGame.tools.random(0, 100) > rand) {
  1772. this.selectNum = max;
  1773. }
  1774. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1775. this.selectNum++;
  1776. }
  1777. ball.onClick(0, true);
  1778. }
  1779. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1780. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1781. let balls = xGame.common.d2World.ballArr;
  1782. let max = xGame.tools.getDis(hx, hy, bx, by);
  1783. for (let index = 0; index < balls.length; index++) {
  1784. let obj = balls[index];
  1785. if (obj.number == 0)
  1786. continue;
  1787. if (obj.number == bn || obj.number == dn)
  1788. continue;
  1789. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1790. if (dis * dis > max)
  1791. continue;
  1792. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1793. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1794. if (num > 1)
  1795. num = 1;
  1796. if (num < 0)
  1797. continue;
  1798. let gap = Math.sin(Math.acos(num)) * dis;
  1799. if (gap < this.ballSize)
  1800. return true;
  1801. }
  1802. return false;
  1803. }
  1804. isLine(xy, ball) {
  1805. let bx = xy.x;
  1806. let by = xy.y;
  1807. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1808. let dis = ball.getDestDis(xy);
  1809. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1810. let sin = Math.sin(angle);
  1811. let cos = Math.cos(angle);
  1812. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1813. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1814. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1815. let dx = bx + this.tempDir2.x * dis;
  1816. let dy = by + this.tempDir2.y * dis;
  1817. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1818. sin = Math.sin(-angle);
  1819. cos = Math.cos(-angle);
  1820. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1821. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1822. dx = bx + this.tempDir2.x * dis;
  1823. dy = by + this.tempDir2.y * dis;
  1824. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1825. if (isr && isl)
  1826. return false;
  1827. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1828. }
  1829. return true;
  1830. }
  1831. turnPole() {
  1832. this.turnNum++;
  1833. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1834. let dr = rot - this.destRot;
  1835. let abs = Math.abs(dr) % 360;
  1836. if (abs > 180) {
  1837. if (rot > 180)
  1838. rot -= 360;
  1839. if (this.destRot > 180)
  1840. this.destRot -= 360;
  1841. }
  1842. let max = this.turnNum * 5 + this.aiLv * 5;
  1843. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  1844. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  1845. let at = xGame.tools.random(1000, 2000);
  1846. if (!this.onAway(3))
  1847. at += xGame.tools.random(10000, 15000);
  1848. this.setState(AIState.shoot, at);
  1849. }
  1850. else {
  1851. let mr = 0;
  1852. if (abs > 3)
  1853. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  1854. else if (Math.random() > 0.6)
  1855. mr = xGame.tools.random(1, 10) * 0.1;
  1856. mr = dr > 0 ? -mr : mr;
  1857. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  1858. }
  1859. }
  1860. setKick(dx, dy) {
  1861. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  1862. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1863. this.tempDir1.x = 0;
  1864. this.tempDir1.y = 1;
  1865. this.tempDir2.y = -this.tempDir2.y;
  1866. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1867. if (num > 1)
  1868. num = 1;
  1869. let rot = Math.acos(num) * 57.3;
  1870. if (this.tempDir2.x < 0)
  1871. rot = 360 - rot;
  1872. this.destRot += rot;
  1873. if (!xGame.common.gameMgr.finishOneShoot) {
  1874. this.forceMax += xGame.tools.random(10, 50);
  1875. this.forceMax -= this.aiLv * 2;
  1876. if (this.forceMax < 20)
  1877. this.forceMax = 20;
  1878. }
  1879. if (this.forceMax > 100)
  1880. this.forceMax = 101;
  1881. else if (this.forceMax < 10)
  1882. this.forceMax += xGame.tools.random(0, 10);
  1883. if (xGame.common.gameMode == 1)
  1884. this.forceMax = xGame.tools.random(80, 100);
  1885. else
  1886. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  1887. let max = 2000 - this.aiLv * 100;
  1888. if (Math.random() > 0.8)
  1889. max += xGame.tools.random(100, 2000);
  1890. this.setState(AIState.turn, xGame.tools.random(500, max));
  1891. }
  1892. shoot() {
  1893. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  1894. if (Math.random() > 0.8) {
  1895. this.gameSrc.aiForce(1);
  1896. this.setState(AIState.wait);
  1897. }
  1898. }
  1899. else {
  1900. let df = xGame.tools.random(3, 8);
  1901. if (this.forceNum < this.forceMax)
  1902. this.forceNum += df;
  1903. else
  1904. this.forceNum -= df;
  1905. let startY = this.gameSrc.ui.powerNode.y;
  1906. let height = this.gameSrc.ui.powerNode.height;
  1907. let force = startY + height * this.forceNum * 0.01;
  1908. this.gameSrc.aiForce(2, force);
  1909. }
  1910. }
  1911. reset() {
  1912. for (let i = 0; i < 4; i++) {
  1913. this.setRate--;
  1914. this.setNum++;
  1915. let pos = this.posList[this.posIdx];
  1916. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  1917. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  1918. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  1919. this.rootPos.x = 387;
  1920. if (this.rootPos.x < this.rectL)
  1921. this.rootPos.x = this.rectL;
  1922. else if (this.rootPos.x > this.rectR)
  1923. this.rootPos.x = this.rectR;
  1924. if (this.rootPos.y < this.rectT)
  1925. this.rootPos.y = this.rectT;
  1926. else if (this.rootPos.y > this.rectB)
  1927. this.rootPos.y = this.rectB;
  1928. this.posIdx++;
  1929. let max = this.posList.length;
  1930. if (this.posIdx >= max)
  1931. this.posIdx -= max;
  1932. this.initHoleBall();
  1933. let ball = null;
  1934. if (this.scoreBall.length > 0)
  1935. ball = this.scoreBall[0];
  1936. else if (this.lineBall.length > 0)
  1937. ball = xGame.common.getRandArrEle(this.lineBall);
  1938. if (ball && ball.kickAngle < this.bestAngle) {
  1939. this.bestAngle = ball.kickAngle;
  1940. this.bestKick.x = ball.kickPos.x;
  1941. this.bestKick.y = ball.kickPos.y;
  1942. this.bestPos.x = this.rootPos.x;
  1943. this.bestPos.y = this.rootPos.y;
  1944. this.bestForce = ball.hard * 0.08;
  1945. }
  1946. }
  1947. if (this.setNum >= this.setMax)
  1948. this.setMax = 0;
  1949. if (this.setRate < 1) {
  1950. this.setState(AIState.move, 0);
  1951. this.rootMoveTime = Laya.timer.currTimer;
  1952. this.gameSrc.aiRootMove(true);
  1953. }
  1954. }
  1955. delayLine() {
  1956. this.gameSrc.aiRootMove(false);
  1957. }
  1958. move() {
  1959. if (this.bestPos.x < 1)
  1960. this.bestPos = this.rootPos;
  1961. let wObj = this.wBall.gameObj;
  1962. let destx = wObj.x;
  1963. let desty = wObj.y;
  1964. let dx = Math.abs(destx - this.bestPos.x);
  1965. let dy = Math.abs(desty - this.bestPos.y);
  1966. let mx = 3 + dx * 0.03;
  1967. let my = 3 + dy * 0.03;
  1968. if (dx < 4 && dy < 4) {
  1969. let dt = Laya.timer.currTimer - this.rootMoveTime;
  1970. dt = dt < 1000 ? 1000 - dt : 0;
  1971. if (this.setMax > 0) {
  1972. let min = this.setMax * 0.3 + this.aiLv * 5;
  1973. this.setRate = xGame.tools.random(min, this.setMax);
  1974. this.setState(AIState.reset, 0);
  1975. }
  1976. else {
  1977. this.destRot = 0;
  1978. this.forceMax = this.bestForce;
  1979. this.setKick(this.bestKick.x, this.bestKick.y);
  1980. }
  1981. if (dt > 100) {
  1982. Laya.timer.clear(this, this.delayLine);
  1983. Laya.timer.once(dt, this, this.delayLine);
  1984. }
  1985. else
  1986. this.gameSrc.aiRootMove(false);
  1987. }
  1988. else {
  1989. if (dx > 4)
  1990. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  1991. if (dy > 4)
  1992. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  1993. this.gameSrc.onRootMove({ x: destx, y: desty });
  1994. }
  1995. }
  1996. resetRoot() {
  1997. this.bestAngle = 180;
  1998. this.bestForce = 0;
  1999. this.setMax = this.posList.length;
  2000. this.posIdx = xGame.tools.random(0, this.setMax);
  2001. let min = this.setMax * 0.3 + this.aiLv * 5;
  2002. this.setRate = xGame.tools.random(min, this.setMax);
  2003. let max = 2000 - this.aiLv * 100;
  2004. if (Math.random() > 0.8)
  2005. max += xGame.tools.random(100, 1000);
  2006. if (this.isGuide)
  2007. this.setState(AIState.select, 500);
  2008. else if (this.onAway(2))
  2009. this.setState(AIState.reset, xGame.tools.random(400, max));
  2010. else
  2011. this.setState(AIState.none);
  2012. if (xGame.common.gameMgr.finishOneShoot)
  2013. this.chat();
  2014. }
  2015. runAI() {
  2016. if (this.state > AIState.idle)
  2017. return;
  2018. this.initBall();
  2019. this.onGame(2500);
  2020. if (Math.random() > 0.6)
  2021. this.chat();
  2022. }
  2023. stopRun() {
  2024. this.setState(AIState.idle);
  2025. }
  2026. onGame(base) {
  2027. let max = base - this.aiLv * 100;
  2028. if (Math.random() > 0.8)
  2029. max += xGame.tools.random(100, 1000);
  2030. if (this.onAway(2))
  2031. this.setState(AIState.select, xGame.tools.random(500, max));
  2032. else
  2033. this.setState(AIState.none);
  2034. }
  2035. setState(sta, wt = 0) {
  2036. if (this.state == AIState.none)
  2037. return;
  2038. this.state = sta;
  2039. this.waitTime = wt;
  2040. }
  2041. onUpdate() {
  2042. if (this.state == AIState.none)
  2043. return;
  2044. this.awayTime -= this.dtime;
  2045. if (this.awayTime < 1) {
  2046. this.awayTime = xGame.tools.random(6000, 10000);
  2047. this.awayNum += (11 - this.aiLv);
  2048. this.onAway(1);
  2049. }
  2050. if (this.waitTime >= 0) {
  2051. this.waitTime -= this.dtime;
  2052. return;
  2053. }
  2054. switch (this.state) {
  2055. case AIState.idle:
  2056. this.chat();
  2057. break;
  2058. case AIState.reset:
  2059. this.reset();
  2060. break;
  2061. case AIState.move:
  2062. this.move();
  2063. break;
  2064. case AIState.leave:
  2065. this.state = AIState.none;
  2066. xGame.common.gameMgr.aiGameEnd(true);
  2067. break;
  2068. case AIState.select:
  2069. this.selectBall();
  2070. break;
  2071. case AIState.turn:
  2072. this.turnPole();
  2073. break;
  2074. case AIState.shoot:
  2075. this.shoot();
  2076. break;
  2077. }
  2078. }
  2079. onAway(type) {
  2080. if (type == 1) {
  2081. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2082. let num = this.awayNum + db * 20;
  2083. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2084. xGame.common.gameMgr.aiLeave();
  2085. this.setState(AIState.leave, 6666);
  2086. }
  2087. }
  2088. else if (type == 2) {
  2089. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2090. let num = this.awayNum + db * 30;
  2091. if (xGame.tools.random(0, 10000) < num)
  2092. return false;
  2093. }
  2094. else if (type == 3) {
  2095. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2096. let num = this.awayNum + db * 10;
  2097. if (xGame.tools.random(0, 4000) < num)
  2098. return false;
  2099. }
  2100. return true;
  2101. }
  2102. chat() {
  2103. if (this.chatTime > 0) {
  2104. this.chatTime -= this.dtime;
  2105. return;
  2106. }
  2107. this.chatTime = xGame.tools.random(2000, 10000);
  2108. let rand = xGame.tools.random(0, 100);
  2109. if (rand < 15)
  2110. this.talk();
  2111. else if (rand < 35)
  2112. this.emotion();
  2113. }
  2114. talk() {
  2115. xGame.common.talkMgr.showAITalk(0);
  2116. }
  2117. emotion() {
  2118. xGame.common.talkMgr.showAIEmotion(0);
  2119. }
  2120. resetAI() {
  2121. this.stopRun();
  2122. this.state = AIState.none;
  2123. }
  2124. }
  2125. class Partical extends Laya.Script3D {
  2126. constructor() {
  2127. super();
  2128. this.duration = 2000;
  2129. }
  2130. ;
  2131. onAwake() {
  2132. this.gameObj = this.owner;
  2133. }
  2134. onEnable() {
  2135. this.openTimer();
  2136. }
  2137. openTimer() {
  2138. Laya.timer.once(this.duration, this, this.disappear);
  2139. }
  2140. setCallback(obj, callback) {
  2141. this.obj = obj;
  2142. this.callback = callback;
  2143. Laya.timer.clearAll(this);
  2144. Laya.timer.once(this.duration, this, this.disappear);
  2145. }
  2146. disappear() {
  2147. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2148. this.callback && this.callback(this.obj);
  2149. }
  2150. }
  2151. class Ball extends Laya.Script3D {
  2152. constructor() {
  2153. super();
  2154. this.posV3 = new Laya.Vector3();
  2155. this.rotRate = 2.1;
  2156. this.rotSpeed = new Laya.Vector3();
  2157. this.myIndex = 0;
  2158. }
  2159. onAwake() {
  2160. this.gameObj = this.owner;
  2161. this.transform = this.gameObj.transform;
  2162. this.ballNode = this.gameObj.getChildByName("Ball");
  2163. this.shadowNode = this.gameObj.getChildByName("shadow");
  2164. }
  2165. initSelf(index, x, y, owner) {
  2166. this.d2BallSrc = owner;
  2167. this.myIndex = index;
  2168. this.setAlbedoTexture();
  2169. this.setTransPos(x, y);
  2170. this.setScale();
  2171. this.ballNode.transform.localRotationEulerX = 90;
  2172. if (index == 0) {
  2173. }
  2174. }
  2175. setAlbedoTexture(isIce = false) {
  2176. let url;
  2177. if (isIce) {
  2178. url = `res/d3Res/ballTexture/ice.jpg`;
  2179. }
  2180. else {
  2181. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2182. }
  2183. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2184. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2185. }));
  2186. }
  2187. runFireworks(obj, delay, callback) {
  2188. Laya.timer.clearAll(this);
  2189. Laya.timer.once(delay + 1, this, () => {
  2190. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2191. fire.transform.localPositionX = this.transform.localPositionX;
  2192. fire.transform.localPositionY = this.transform.localPositionY;
  2193. fire.transform.localPositionZ = this.transform.localPositionZ;
  2194. let src = fire.getComponent(Partical);
  2195. src.duration = 1000;
  2196. src.setCallback(obj, callback);
  2197. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2198. eft.transform.localPositionX = this.transform.localPositionX;
  2199. eft.transform.localPositionY = this.transform.localPositionY;
  2200. eft.transform.localPositionZ = this.transform.localPositionZ;
  2201. });
  2202. }
  2203. setTransPos(x, y) {
  2204. this.setRotation();
  2205. xGame.common.pos2to3Convert(x, y, this.posV3);
  2206. this.transform.localPositionX = this.posV3.x;
  2207. this.transform.localPositionY = 0;
  2208. this.transform.localPositionZ = this.posV3.z;
  2209. this.transform.localRotationEulerX = 0;
  2210. this.transform.localRotationEulerY = 0;
  2211. this.transform.localRotationEulerZ = 0;
  2212. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2213. this.shadowNode.transform.localPositionY = 0.1;
  2214. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2215. }
  2216. setRotation() {
  2217. if (this.d2BallSrc.canRot) {
  2218. let speed = this.d2BallSrc.rigy.linearVelocity;
  2219. this.rotSpeed.x = speed.x * this.rotRate;
  2220. this.rotSpeed.z = speed.y * this.rotRate;
  2221. this.rotSpeed.y = this.d2BallSrc.rotY;
  2222. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2223. }
  2224. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2225. this.rotSpeed.x = this.rotSpeed.y = 0;
  2226. this.rotSpeed.y = this.d2BallSrc.rotY;
  2227. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2228. }
  2229. }
  2230. setScale() {
  2231. let radius = xGame.common.d2World.rootBall.ui.width;
  2232. let scale = xGame.common.scale2to3Convert(radius);
  2233. this.transform.localScaleX = scale;
  2234. this.transform.localScaleY = scale;
  2235. this.transform.localScaleZ = scale;
  2236. }
  2237. playInHoleEft() {
  2238. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2239. eft.transform.position = this.transform.position;
  2240. }
  2241. playIceEft() {
  2242. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2243. eft.transform.position = this.transform.position;
  2244. }
  2245. get scaleXYZ() {
  2246. return this.transform.localScaleX;
  2247. }
  2248. set scaleXYZ(val) {
  2249. this.transform.localScaleX = val;
  2250. this.transform.localScaleY = val;
  2251. this.transform.localScaleZ = val;
  2252. }
  2253. get posX() {
  2254. return this.transform.localPositionX;
  2255. }
  2256. set posX(val) {
  2257. this.transform.localPositionX = val;
  2258. }
  2259. get posY() {
  2260. return this.transform.localPositionY;
  2261. }
  2262. set posY(val) {
  2263. this.transform.localPositionY = val;
  2264. }
  2265. get posZ() {
  2266. return this.transform.localPositionZ;
  2267. }
  2268. set posZ(val) {
  2269. this.transform.localPositionZ = val;
  2270. }
  2271. destroySelf() {
  2272. this.posV3 = null;
  2273. this.rotSpeed = null;
  2274. this.d2BallSrc = null;
  2275. this.ballNode = null;
  2276. this.gameObj.destroy(true);
  2277. this.transform = null;
  2278. this.destroy();
  2279. }
  2280. }
  2281. class ui_D2Ball extends fgui.GComponent {
  2282. static createInstance() {
  2283. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2284. }
  2285. onConstruct() {
  2286. this.myIcon = (this.getChild("myIcon"));
  2287. this.inner = (this.getChild("inner"));
  2288. this.n8 = (this.getChild("n8"));
  2289. this.n4 = (this.getChild("n4"));
  2290. this.wrongTips = (this.getChild("wrongTips"));
  2291. this.rightTips = (this.getChild("rightTips"));
  2292. this.breathAni = this.getTransition("breathAni");
  2293. }
  2294. }
  2295. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2296. class D2BallSrc extends Laya.Script {
  2297. constructor() {
  2298. super();
  2299. this.number = 0;
  2300. this.startX = 0;
  2301. this.startY = 0;
  2302. this.angleV2 = new Laya.Vector2();
  2303. this.isRootBall = false;
  2304. this.isBlackBall = false;
  2305. this.ballType = "";
  2306. this.canRot = true;
  2307. this.rotY = 0;
  2308. this.poleAngle = 0;
  2309. this.kickPos = { x: 0, y: 0 };
  2310. this.hard = 0;
  2311. this.kickAngle = 0;
  2312. this.borderDis = 0;
  2313. this.speedP10 = 5.6;
  2314. this.lastSpeed = { x: 0, y: 0 };
  2315. this.stillSpeed = 0.12;
  2316. this.ballFunc = "normal";
  2317. this.isRunSkillAni = false;
  2318. this.isInHole = false;
  2319. this.iceOwner = "";
  2320. this.forceRun = false;
  2321. this.myUNID = "";
  2322. this.rectL = 0;
  2323. this.rectR = 0;
  2324. this.rectT = 0;
  2325. this.rectB = 0;
  2326. this.forceVec = new Laya.Vector2();
  2327. this.lastDis = 0;
  2328. this.helpOut = { type: "", x: 0, y: 0 };
  2329. }
  2330. initSelf(number, x, y, d3Ball) {
  2331. if (!this.gameObj)
  2332. this.gameObj = this.owner;
  2333. this.number = number;
  2334. this.startX = x;
  2335. this.startY = y;
  2336. this.d3Ball = d3Ball;
  2337. this.isRootBall = false;
  2338. this.isBlackBall = false;
  2339. this.ballType = "";
  2340. if (number == 0) {
  2341. this.isRootBall = true;
  2342. }
  2343. else if (number == 8) {
  2344. this.isBlackBall = true;
  2345. }
  2346. else {
  2347. if (number <= 7) {
  2348. this.ballType = ballCamp.full;
  2349. }
  2350. else {
  2351. this.ballType = ballCamp.flower;
  2352. }
  2353. }
  2354. this.setInfo();
  2355. this.setD3Ball();
  2356. this.owner["mySrc"] = this;
  2357. this.rigy.linearDamping = 1;
  2358. D2BallSrc._unid++;
  2359. this.myUNID = "d2ball" + D2BallSrc._unid;
  2360. let rect = xGame.common.d2World.borderRect;
  2361. this.rectL = Math.ceil(rect.x) + 20;
  2362. this.rectT = Math.ceil(rect.y) + 20;
  2363. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2364. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2365. }
  2366. setInfo() {
  2367. this.gameObj.x = this.startX;
  2368. this.gameObj.y = this.startY;
  2369. let radius = this.ui.width / 2;
  2370. this.gameObj.width = radius * 2;
  2371. this.gameObj.height = radius * 2;
  2372. if (xGame.common.showDebug) {
  2373. this.ui.myIcon.alpha = 1;
  2374. this.ui.inner.alpha = 1;
  2375. }
  2376. else {
  2377. this.ui.myIcon.alpha = 0;
  2378. this.ui.inner.alpha = 0;
  2379. }
  2380. }
  2381. setD3Ball() {
  2382. this.d3Ball = this.d3Ball;
  2383. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2384. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2385. }
  2386. onUpdate() {
  2387. if (xGame.common.gameMgr.gamePause)
  2388. return;
  2389. if (this.isInHole)
  2390. return;
  2391. if (!xGame.common.d2World.openCheckStill)
  2392. return;
  2393. this.runBall();
  2394. }
  2395. runBall() {
  2396. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2397. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2398. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2399. this.judgeBorder();
  2400. }
  2401. getDestDis(dest) {
  2402. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2403. }
  2404. setmyXY(x, y) {
  2405. this.d3BallSrc.setTransPos(x, y);
  2406. }
  2407. getSpeed() {
  2408. let speed = this.rigy.linearVelocity;
  2409. return speed.x * speed.x + speed.y * speed.y;
  2410. }
  2411. onTriggerEnter(collider) {
  2412. if (!collider || !collider.owner)
  2413. return;
  2414. let coll = "collide";
  2415. let speed = this.getSpeed();
  2416. let sv2 = this.speedP10 * this.speedP10;
  2417. if (collider.label == "ball") {
  2418. if (speed < 9 && this.number != 0)
  2419. coll = "";
  2420. else if (speed < sv2)
  2421. coll = "collide_4";
  2422. else if (speed < sv2 * 6.2)
  2423. coll = "collide_3";
  2424. else if (speed < sv2 * 25)
  2425. coll = "collide_2";
  2426. else if (speed < sv2 * 56)
  2427. coll = "collide_1";
  2428. xGame.soundMgr.playSound(coll);
  2429. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2430. if (collider.owner) {
  2431. let rig = collider.owner.getComponent(D2BallSrc);
  2432. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2433. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2434. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2435. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2436. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2437. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2438. let rx = 0;
  2439. let ry = 0;
  2440. if (this.gameObj.x < this.rectL)
  2441. rx = vx;
  2442. else if (this.gameObj.x > this.rectR)
  2443. rx = -vx;
  2444. else if (this.gameObj.y < this.rectT)
  2445. ry = vy;
  2446. else if (this.gameObj.y > this.rectB)
  2447. ry = -vy;
  2448. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2449. }
  2450. }
  2451. if (this.number != 0) {
  2452. return;
  2453. }
  2454. else {
  2455. if (this.forceRun) {
  2456. console.log("randon force");
  2457. this.applyForce(collider);
  2458. }
  2459. }
  2460. if (xGame.common.d2World.isOnSameLine) {
  2461. xGame.common.d2World.isOnSameLine = false;
  2462. this.rigy.linearVelocity = { x: 0, y: 0 };
  2463. }
  2464. if (xGame.common.gameMgr.firstColliObj == null) {
  2465. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2466. xGame.common.gameMgr.isTouchedBall = true;
  2467. }
  2468. }
  2469. else {
  2470. xGame.common.recoverCameraView();
  2471. let wallStr = "";
  2472. if (speed < 9) { }
  2473. else if (speed < sv2) { }
  2474. else if (speed < sv2 * 6.2)
  2475. wallStr = "wall_30";
  2476. else if (speed < sv2 * 25)
  2477. wallStr = "wall_50";
  2478. else if (speed < sv2 * 56)
  2479. wallStr = "wall_80";
  2480. xGame.soundMgr.playSound(wallStr);
  2481. }
  2482. }
  2483. applyForce(collider) {
  2484. let src = collider.owner.mySrc;
  2485. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2486. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2487. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2488. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2489. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2490. }
  2491. checkWrongBall(playEft = true) {
  2492. if (this.isInHole)
  2493. return;
  2494. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2495. if (this.number != 0 && playEft)
  2496. this.d3BallSrc.playInHoleEft();
  2497. let coll = "inpocket_1";
  2498. let speed = this.getSpeed();
  2499. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2500. if (speed < 9 && this.number != 0)
  2501. coll = "";
  2502. else if (speed < sv2 * 6.2)
  2503. coll = "inpocket_4";
  2504. else if (speed < sv2 * 25)
  2505. coll = "collide_3";
  2506. else if (speed < sv2 * 56)
  2507. coll = "collide_2";
  2508. xGame.soundMgr.playSound(coll);
  2509. this.isInHole = true;
  2510. if (this.number == 0) {
  2511. console.log("白球进了。。");
  2512. this.reset();
  2513. this.rigy.linearVelocity = { x: 0, y: 0 };
  2514. this.hideSelf();
  2515. xGame.common.gameUI.ui.whiteAni.visible = true;
  2516. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2517. xGame.common.gameUI.ui.whiteAni.visible = false;
  2518. }));
  2519. }
  2520. else {
  2521. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2522. xGame.common.d2World.removeOneBall(this);
  2523. this.destroySelf();
  2524. xGame.common.playHappySound(this.number);
  2525. this.runFlyEft();
  2526. }
  2527. }
  2528. runFlyEft() {
  2529. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2530. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2531. }
  2532. }
  2533. hideSelf() {
  2534. if (this.d3Ball)
  2535. this.d3Ball.active = false;
  2536. }
  2537. showSelf() {
  2538. this.isInHole = false;
  2539. if (this.d3Ball && !this.d3Ball.active)
  2540. this.d3Ball.active = true;
  2541. }
  2542. isStill() {
  2543. let speed = this.rigy.linearVelocity;
  2544. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2545. this.rigy.linearVelocity = { x: 0, y: 0 };
  2546. return true;
  2547. }
  2548. return false;
  2549. }
  2550. reset() {
  2551. }
  2552. destroySelf() {
  2553. this.d3BallSrc.destroySelf();
  2554. if (!this.ui.isDisposed) {
  2555. this.ui.removeFromParent();
  2556. this.ui.dispose();
  2557. this.ui = null;
  2558. }
  2559. this.outColli = null;
  2560. this.innerColli = null;
  2561. this.rigy = null;
  2562. this.d3Ball = null;
  2563. this.d3BallSrc = null;
  2564. this.angleV2 = null;
  2565. this.gameObj.destroy(true);
  2566. this.destroy();
  2567. }
  2568. judgeBorder() {
  2569. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2570. return;
  2571. }
  2572. if (this.destroyed)
  2573. return;
  2574. if (xGame.common.gameMode == GameMode.classic)
  2575. return;
  2576. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2577. if (isOver) {
  2578. this.checkWrongBall();
  2579. }
  2580. }
  2581. onClick(e, force = false) {
  2582. if (this.number == 0)
  2583. return;
  2584. if (force) {
  2585. }
  2586. else {
  2587. if (xGame.common.d2World.openCheckStill)
  2588. return;
  2589. if (!xGame.common.gameMgr.selfTurn) {
  2590. return;
  2591. }
  2592. }
  2593. if (!xGame.common.gameMgr.finishOneShoot)
  2594. return;
  2595. let root = xGame.common.d2World.rootBall.gameObj;
  2596. let x = this.gameObj.x - root.x;
  2597. let y = this.gameObj.y - root.y;
  2598. let angle = xGame.common.getfguiRotation(x, y);
  2599. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2600. xGame.common.d2World.getHelpLine();
  2601. xGame.common.clickedBall = true;
  2602. this.checkGuide();
  2603. }
  2604. checkGuide() {
  2605. let guide = DataMgr.getSkillGuide();
  2606. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2607. xGame.common.guideStep++;
  2608. xGame.common.gameUI.ui.guide1.visible = false;
  2609. xGame.common.gameUI.ui.guide2.visible = true;
  2610. }
  2611. }
  2612. checkDistance(disX, disY, angle) {
  2613. let diameter = this.gameObj.width - 1;
  2614. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2615. if (!this.lastDis)
  2616. this.lastDis = dis;
  2617. else {
  2618. if (dis > this.lastDis) {
  2619. this.helpOut.type = "remove";
  2620. return this.helpOut;
  2621. }
  2622. }
  2623. if (dis <= Math.pow(diameter, 2)) {
  2624. let del = 0.01;
  2625. let offest = 0;
  2626. let realX = disX - this.gameObj.x;
  2627. let realY = disY - this.gameObj.y;
  2628. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2629. offest += del;
  2630. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2631. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2632. }
  2633. this.helpOut.type = "ok";
  2634. this.helpOut.x = realX + this.gameObj.x;
  2635. this.helpOut.y = realY + this.gameObj.y;
  2636. return this.helpOut;
  2637. }
  2638. else {
  2639. this.helpOut.type = "no";
  2640. return this.helpOut;
  2641. }
  2642. }
  2643. clearBallEft() {
  2644. this.clearBallRightEft();
  2645. this.clearBallWrongEft();
  2646. }
  2647. clearBallRightEft() {
  2648. this.ui.breathAni.stop();
  2649. this.ui.rightTips.visible = false;
  2650. }
  2651. clearBallWrongEft() {
  2652. this.ui.wrongTips.visible = false;
  2653. }
  2654. showWrongEft() {
  2655. if (!xGame.common.gameMgr.selfTurn)
  2656. return;
  2657. this.ui.wrongTips.visible = true;
  2658. }
  2659. showRightEft() {
  2660. if (!xGame.common.gameMgr.selfTurn)
  2661. return;
  2662. this.ui.rightTips.visible = true;
  2663. this.ui.rightTips.scaleX = 1;
  2664. this.ui.rightTips.scaleY = 1;
  2665. this.ui.breathAni.play();
  2666. }
  2667. setBallFunc(type, owner) {
  2668. if (type == "ice") {
  2669. this.ballFunc = type;
  2670. this.d3BallSrc.setAlbedoTexture(true);
  2671. this.rigy.type = "static";
  2672. this.iceOwner = owner;
  2673. }
  2674. else {
  2675. if (owner == this.iceOwner) {
  2676. this.ballFunc = type;
  2677. this.d3BallSrc.setAlbedoTexture(false);
  2678. this.rigy.type = "dynamic";
  2679. }
  2680. }
  2681. }
  2682. }
  2683. D2BallSrc._unid = 0;
  2684. class D2RootBallSrc extends D2BallSrc {
  2685. constructor() {
  2686. super();
  2687. this.maxSpeed = 0;
  2688. this.classicMaxSpeed = 2.2;
  2689. this.bigSkillMaxSpeed = 4;
  2690. this.angle = 0;
  2691. this.allPercent = 0;
  2692. this.linearPercent = 0;
  2693. this.anglePercent = 0;
  2694. this.maxAngleRate = 0.6;
  2695. this.baseRot = 7;
  2696. this.angleMax = 0;
  2697. this.speed = new Laya.Vector2();
  2698. this.rotSpeed = new Laya.Vector2();
  2699. }
  2700. isStill() {
  2701. let speed = this.rigy.linearVelocity;
  2702. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2703. if (this.anglePercent <= 0.1) {
  2704. this.rigy.linearVelocity = { x: 0, y: 0 };
  2705. return true;
  2706. }
  2707. }
  2708. return false;
  2709. }
  2710. reset() {
  2711. this.linearPercent = 0;
  2712. this.anglePercent = 0;
  2713. }
  2714. setSpeed(percent, angle) {
  2715. this.allPercent = percent;
  2716. this.angle = angle;
  2717. this.setAngleSpeed();
  2718. this.setLinearSpeed();
  2719. let hit = "hit";
  2720. if (percent < 25)
  2721. hit = "hit03";
  2722. else if (percent < 50)
  2723. hit = "hit02";
  2724. else if (percent < 75)
  2725. hit = "hit01";
  2726. xGame.soundMgr.playSound(hit);
  2727. }
  2728. setAngleSpeed() {
  2729. let offest = xGame.common.rodOffest;
  2730. let radius = 82;
  2731. let rate = Math.abs(offest.y / radius) * 0.5;
  2732. if (offest.y > 0)
  2733. this.angleMax = -this.baseRot * 2;
  2734. else
  2735. this.angleMax = this.baseRot;
  2736. this.rotY = -offest.x / radius * 100;
  2737. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2738. this.linearPercent = this.allPercent - this.anglePercent;
  2739. }
  2740. setLinearSpeed() {
  2741. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2742. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2743. if (!xGame.common.longHelpLine) {
  2744. let offset = -150 + xGame.common.randomNum(0, 300);
  2745. offset /= 100;
  2746. this.angle += offset;
  2747. }
  2748. }
  2749. }
  2750. let sin = Math.sin(this.angle * Math.PI / 180);
  2751. let cos = Math.cos(this.angle * Math.PI / 180);
  2752. switch (xGame.common.gameMode) {
  2753. case GameMode.classic:
  2754. this.maxSpeed = this.classicMaxSpeed;
  2755. break;
  2756. case GameMode.bigMove:
  2757. this.maxSpeed = this.bigSkillMaxSpeed;
  2758. break;
  2759. case GameMode.placeBall:
  2760. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2761. if (data.type == 1) {
  2762. this.maxSpeed = this.bigSkillMaxSpeed;
  2763. }
  2764. else {
  2765. this.maxSpeed = this.classicMaxSpeed;
  2766. }
  2767. break;
  2768. default:
  2769. break;
  2770. }
  2771. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2772. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2773. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2774. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2775. this.rigy.applyLinearImpulseToCenter(this.speed);
  2776. }
  2777. onUpdate() {
  2778. if (this.anglePercent > 0.1) {
  2779. this.anglePercent *= 0.97;
  2780. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2781. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2782. this.rigy.applyForceToCenter(this.rotSpeed);
  2783. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2784. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2785. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2786. if (num > 0.9)
  2787. this.canRot = true;
  2788. }
  2789. else
  2790. this.canRot = true;
  2791. if (Math.abs(this.rotY) > 0.1)
  2792. this.rotY *= 0.98;
  2793. super.onUpdate();
  2794. }
  2795. destroySelf() {
  2796. super.destroySelf();
  2797. this.speed = null;
  2798. }
  2799. }
  2800. class D2Ball extends Laya.Sprite {
  2801. constructor(isRootBall = false) {
  2802. super();
  2803. this.ui = ui_D2Ball.createInstance();
  2804. this.pivotX = this.ui.width / 2;
  2805. this.pivotY = this.ui.width / 2;
  2806. this.x = 0;
  2807. this.y = 0;
  2808. this.addChild(this.ui.displayObject);
  2809. this.ui.displayObject.x += this.ui.width / 2;
  2810. this.ui.displayObject.y += this.ui.width / 2;
  2811. if (isRootBall) {
  2812. this.d2Src = this.addComponent(D2RootBallSrc);
  2813. }
  2814. else {
  2815. this.d2Src = this.addComponent(D2BallSrc);
  2816. }
  2817. this.d2Src.ui = this.ui;
  2818. this.addCircleCollider();
  2819. this.addInnerCircleCollider();
  2820. this.addRigyBody();
  2821. }
  2822. addCircleCollider() {
  2823. let colli = xGame.common.getCollider("circle");
  2824. colli.radius = this.ui.width / 2;
  2825. this.addComponentIntance(colli);
  2826. this.d2Src.outColli = colli;
  2827. colli.label = "ball";
  2828. }
  2829. addInnerCircleCollider() {
  2830. let colli = xGame.common.getCollider("circle");
  2831. colli.radius = this.ui.inner.width / 2;
  2832. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2833. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2834. this.addComponentIntance(colli);
  2835. this.d2Src.innerColli = colli;
  2836. colli.label = "inner";
  2837. }
  2838. addRigyBody() {
  2839. let rigy = xGame.common.getRigbody();
  2840. rigy.type = "dynamic";
  2841. this.addComponentIntance(rigy);
  2842. this.d2Src.rigy = rigy;
  2843. }
  2844. disposeSelf() {
  2845. if (!this.ui.isDisposed) {
  2846. this.ui.dispose();
  2847. this.ui.removeFromParent();
  2848. this.ui = null;
  2849. }
  2850. }
  2851. }
  2852. class ui_D2Gan extends fgui.GComponent {
  2853. static createInstance() {
  2854. return (fgui.UIPackage.createObject("game", "D2Gan"));
  2855. }
  2856. onConstruct() {
  2857. this.myIcon = (this.getChild("myIcon"));
  2858. this.selfRodIcon = (this.getChild("selfRodIcon"));
  2859. this.selfEftRoot = (this.getChild("selfEftRoot"));
  2860. this.self = (this.getChild("self"));
  2861. this.aiRodIcon = (this.getChild("aiRodIcon"));
  2862. this.aiEftRoot = (this.getChild("aiEftRoot"));
  2863. this.ai = (this.getChild("ai"));
  2864. }
  2865. }
  2866. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  2867. class D2Gan {
  2868. constructor() {
  2869. this.offset = 0.15;
  2870. this.cell = 1.5;
  2871. this.onBallCell = 0.4;
  2872. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  2873. this.moveNum = 70;
  2874. this.rulerRate = 0.1;
  2875. this.ui = ui_D2Gan.createInstance();
  2876. this.changeSelfRod();
  2877. this.changeAIRod();
  2878. }
  2879. changeSelfRod() {
  2880. let index = DataMgr.getCurBallRod();
  2881. let data = cfgTable.ballrodData[index + 1];
  2882. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2883. this.selfMySpine && this.selfMySpine.dispose();
  2884. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2885. if (data.spine) {
  2886. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2887. this.selfMySpine = new SpineMgr(data.spine, () => {
  2888. let xx = this.ui.selfEftRoot.width / 2;
  2889. let yy = this.ui.selfEftRoot.height / 2;
  2890. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2891. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  2892. outSpine.rotation = -90;
  2893. });
  2894. }
  2895. }
  2896. changeAIRod() {
  2897. let length = Object.keys(cfgTable.ballrodData).length;
  2898. let rand = Math.floor(length * Math.random()) + 1;
  2899. let data = cfgTable.ballrodData[rand];
  2900. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2901. this.aiMySpine && this.aiMySpine.dispose();
  2902. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2903. if (data.spine) {
  2904. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2905. this.aiMySpine = new SpineMgr(data.spine, () => {
  2906. let xx = this.ui.aiEftRoot.width / 2;
  2907. let yy = this.ui.aiEftRoot.height / 2;
  2908. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2909. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  2910. outSpine.rotation = -90;
  2911. });
  2912. }
  2913. }
  2914. setGanLastInfo() {
  2915. this.lastInfo.rotation = this.ui.rotation;
  2916. this.lastInfo.x = this.ui.x;
  2917. this.lastInfo.y = this.ui.y;
  2918. }
  2919. rotateSelf(flag, isRuler = false) {
  2920. let angle;
  2921. flag = flag * this.offset;
  2922. if (xGame.common.d2World.isHelpLineOnBall) {
  2923. angle = flag * this.onBallCell;
  2924. }
  2925. else {
  2926. angle = flag * this.cell;
  2927. }
  2928. if (isRuler) {
  2929. angle *= this.rulerRate;
  2930. }
  2931. this.ui.rotation += angle;
  2932. xGame.common.d2World.getHelpLine();
  2933. }
  2934. checkDistance() {
  2935. let target = xGame.common.d2World.targetBall;
  2936. let root = xGame.common.d2World.rootBall;
  2937. if (target == null) {
  2938. return 1;
  2939. }
  2940. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  2941. if (dis <= 2500) {
  2942. return 5;
  2943. }
  2944. return 1;
  2945. }
  2946. rotDest(rot) {
  2947. this.ui.rotation = rot;
  2948. xGame.common.d2World.getHelpLine();
  2949. }
  2950. storagePower(powerNum) {
  2951. let pos = (powerNum / 100) * this.moveNum;
  2952. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  2953. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  2954. this.ui.x = this.lastInfo.x + xx;
  2955. this.ui.y = this.lastInfo.y + yy;
  2956. }
  2957. shoot() {
  2958. this.storagePower(0);
  2959. this.ui.visible = false;
  2960. }
  2961. destroySelf() {
  2962. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2963. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2964. this.selfMySpine && this.selfMySpine.dispose();
  2965. this.aiMySpine && this.aiMySpine.dispose();
  2966. this.lastInfo = null;
  2967. if (!this.ui.isDisposed) {
  2968. this.ui.removeFromParent();
  2969. this.ui.dispose();
  2970. }
  2971. }
  2972. }
  2973. class ui_HelpLine extends fgui.GComponent {
  2974. static createInstance() {
  2975. return (fgui.UIPackage.createObject("game", "HelpLine"));
  2976. }
  2977. onConstruct() {
  2978. this.n10 = (this.getChild("n10"));
  2979. this.rect = (this.getChild("rect"));
  2980. this.dir11 = (this.getChild("dir11"));
  2981. this.dir = (this.getChild("dir"));
  2982. this.rootDir = (this.getChild("rootDir"));
  2983. this.dirDot = (this.getChild("dirDot"));
  2984. }
  2985. }
  2986. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  2987. class D2HelpLine {
  2988. constructor() {
  2989. this.starX = 0;
  2990. this.starY = 0;
  2991. this.ui = ui_HelpLine.createInstance();
  2992. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  2993. this.starX = this.ui.rect.x;
  2994. this.starY = this.ui.rect.y;
  2995. }
  2996. shoot() {
  2997. this.ui.visible = false;
  2998. }
  2999. destroySelf() {
  3000. if (this.ui.isDisposed) {
  3001. this.ui.removeFromParent();
  3002. this.ui.dispose();
  3003. }
  3004. }
  3005. }
  3006. class D2World extends Laya.Script {
  3007. constructor() {
  3008. super();
  3009. this.ballArr = [];
  3010. this.openCheckStill = false;
  3011. this.checkArr = [];
  3012. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3013. this.isHelpLineOnBall = false;
  3014. this.isOnSameLine = false;
  3015. this.reflectAngle = 0;
  3016. this.powerPercent = 0;
  3017. this.inHolesSpeed = [];
  3018. this.outDir = new Laya.Vector2();
  3019. this.rootDir = new Laya.Vector2();
  3020. this.aiLv = 0;
  3021. this.rootPos = new Laya.Vector2();
  3022. this.tempDir1 = new Laya.Vector2();
  3023. this.tempDir2 = new Laya.Vector2();
  3024. this.tempDir3 = new Laya.Vector2();
  3025. this.ballSize = 33;
  3026. this.destRot = 0;
  3027. }
  3028. initSelf() {
  3029. this.createBalls();
  3030. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3031. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3032. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3033. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3034. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3035. }
  3036. setBorderRect() {
  3037. let ui = xGame.common.gameUI.ui;
  3038. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3039. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3040. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3041. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3042. this.borderRect.x = starX;
  3043. this.borderRect.y = starY;
  3044. this.borderRect.width = width;
  3045. this.borderRect.height = height;
  3046. }
  3047. resetGame() {
  3048. this.openCheckStill = false;
  3049. let temp;
  3050. for (let index = 0; index < this.ballArr.length; index++) {
  3051. temp = this.ballArr[index];
  3052. temp.destroySelf();
  3053. }
  3054. xGame.common.d3World.ballRoot.destroyChildren();
  3055. xGame.common.gameUI.ui.ballNode.removeChildren();
  3056. console.log("进入摧毁逻辑");
  3057. this.d2Gan.destroySelf();
  3058. this.d2HelpLine.destroySelf();
  3059. this.ballArr = [];
  3060. }
  3061. setD2Gan() {
  3062. let ballNode = this.rootBall.ui;
  3063. let d2Gan = new D2Gan();
  3064. this.d2Gan = d2Gan;
  3065. let ganNode = d2Gan.ui;
  3066. ballNode.addChild(ganNode);
  3067. ganNode.pivotX = ganNode.pivotX;
  3068. ganNode.pivotY = ganNode.pivotY;
  3069. ganNode.x = ganNode.myIcon.width / 2;
  3070. ganNode.y = this.rootBall.gameObj.width;
  3071. d2Gan.setGanLastInfo();
  3072. }
  3073. setHelpLine() {
  3074. let d2Help = new D2HelpLine();
  3075. this.d2HelpLine = d2Help;
  3076. }
  3077. createBalls() {
  3078. let cfg;
  3079. switch (xGame.common.gameMode) {
  3080. case GameMode.classic:
  3081. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3082. break;
  3083. case GameMode.bigMove:
  3084. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3085. break;
  3086. case GameMode.placeBall:
  3087. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3088. break;
  3089. default:
  3090. break;
  3091. }
  3092. cfg = JSON.parse(JSON.stringify(cfg));
  3093. for (const key in cfg) {
  3094. if (cfg[key].value == 0) {
  3095. this.createRootBall(cfg[key]);
  3096. delete cfg[key];
  3097. break;
  3098. }
  3099. }
  3100. this.createOtherBalls(cfg);
  3101. }
  3102. createRootBall(data) {
  3103. let root = new D2Ball(true);
  3104. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3105. this.rootBall = root.d2Src;
  3106. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3107. let d3BallSrc = d3Ball.getComponent(Ball);
  3108. xGame.common.d3World.rootBall = d3Ball;
  3109. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3110. let xx = data.x;
  3111. let yy = data.y;
  3112. let numer = data.value;
  3113. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3114. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3115. this.ballArr.push(this.rootBall);
  3116. this.setD2Gan();
  3117. this.setHelpLine();
  3118. }
  3119. createOtherBalls(cfg) {
  3120. let temp;
  3121. let src;
  3122. let data;
  3123. for (const key in cfg) {
  3124. data = cfg[key];
  3125. temp = new D2Ball();
  3126. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3127. src = temp.d2Src;
  3128. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3129. src.initSelf(data.value, data.x, data.y, d3Ball);
  3130. this.ballArr.push(src);
  3131. }
  3132. }
  3133. shoot(percent) {
  3134. this.powerPercent = percent;
  3135. this.openCheckStill = true;
  3136. let d2Angle = this.d2Gan.ui.rotation;
  3137. this.rootBall.setSpeed(percent, d2Angle);
  3138. this.clearBallAllEft();
  3139. this.changePlayerView();
  3140. }
  3141. onUpdate() {
  3142. if (!this.openCheckStill)
  3143. return;
  3144. this.checkStill();
  3145. }
  3146. checkStill() {
  3147. for (let index = 0; index < this.ballArr.length; index++) {
  3148. if (!this.ballArr[index].isStill()) {
  3149. return;
  3150. }
  3151. }
  3152. xGame.eventMgr.event(ALL_BALL_STOP);
  3153. }
  3154. allBallStop() {
  3155. this.openCheckStill = false;
  3156. xGame.common.recoverCameraView();
  3157. }
  3158. waitShoot() {
  3159. if (!this.d2Gan.ui.isDisposed) {
  3160. this.d2Gan.ui.visible = true;
  3161. }
  3162. if (!this.d2HelpLine.ui.isDisposed) {
  3163. this.d2HelpLine.ui.visible = true;
  3164. }
  3165. this.clearBallAllEft();
  3166. this.showBallRightEft();
  3167. this.getHelpLine();
  3168. this.inHolesSpeed = [];
  3169. this.selectOneBall();
  3170. }
  3171. _getAllBallArr() {
  3172. let arr = this.ballArr;
  3173. let outArr = [];
  3174. for (let index = 0; index < arr.length; index++) {
  3175. if (arr[index] instanceof D2RootBallSrc)
  3176. continue;
  3177. if (arr[index].ballFunc == "ice")
  3178. continue;
  3179. if (arr[index].destroyed)
  3180. continue;
  3181. outArr.push(arr[index]);
  3182. }
  3183. return outArr;
  3184. }
  3185. _getBlackObj() {
  3186. let arr = this.ballArr;
  3187. for (let index = 0; index < arr.length; index++) {
  3188. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3189. return arr[index];
  3190. }
  3191. }
  3192. }
  3193. selectOneBall() {
  3194. let all = this._getAllBallArr();
  3195. let target;
  3196. switch (xGame.common.gameMode) {
  3197. case GameMode.classic:
  3198. if (xGame.common.gameMgr.selfTurn) {
  3199. let self = xGame.common.gameMgr.selfBallArr;
  3200. let black = this._getBlackObj();
  3201. if (xGame.common.gameMgr.ensureBallType) {
  3202. if (self.length > 0) {
  3203. let out = [];
  3204. for (let j = 0; j < all.length; j++) {
  3205. if (self.indexOf(all[j].number) > -1) {
  3206. out.push(all[j]);
  3207. }
  3208. }
  3209. target = this.selectBestEnterOne(out);
  3210. }
  3211. else {
  3212. target = this.selectBestEnterOne([black]);
  3213. }
  3214. }
  3215. else {
  3216. target = this.selectBestEnterOne(all);
  3217. }
  3218. }
  3219. else {
  3220. target = this.selectBestEnterOne(all);
  3221. }
  3222. break;
  3223. case GameMode.bigMove:
  3224. target = this.selectBestEnterOne(all);
  3225. break;
  3226. case GameMode.placeBall:
  3227. if (all.length > 0) {
  3228. target = this.selectBestEnterOne(all);
  3229. }
  3230. break;
  3231. default:
  3232. break;
  3233. }
  3234. if (target && !target.destroyed && target.onClick) {
  3235. target.onClick(0, true);
  3236. let num = -200 + xGame.common.randomNum(0, 400);
  3237. num /= 150;
  3238. if (xGame.common.longHelpLine) {
  3239. num = 0;
  3240. }
  3241. this.destRot += num;
  3242. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3243. }
  3244. }
  3245. removeOneBall(ball) {
  3246. for (let index = 0; index < this.ballArr.length; index++) {
  3247. if (this.ballArr[index].id == ball.id) {
  3248. this.ballArr.splice(index, 1);
  3249. break;
  3250. }
  3251. }
  3252. }
  3253. getHelpLine() {
  3254. this.d2HelpLine.ui.dirDot.visible = false;
  3255. this.isOnSameLine = false;
  3256. let startX = this.rootBall.gameObj.x;
  3257. let startY = this.rootBall.gameObj.y;
  3258. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3259. if (dis == null) {
  3260. this.d2HelpLine.ui.visible = false;
  3261. console.error("辅助线异常");
  3262. return;
  3263. }
  3264. this.d2HelpLine.ui.visible = true;
  3265. let angle = this.d2Gan.ui.rotation;
  3266. let radius = 16.5;
  3267. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3268. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3269. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3270. if (colliObj == null) {
  3271. this.getColliPos(disX, disY, radius, angle);
  3272. xGame.common.d2World.isHelpLineOnBall = false;
  3273. this.targetBall = null;
  3274. this.reflectAngle = 0;
  3275. this.showBallWrongEft();
  3276. }
  3277. else {
  3278. let target = colliObj.src;
  3279. let radius = 16.5;
  3280. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3281. dis1 = Math.sqrt(dis1);
  3282. let realDis = colliObj.disHon - dis1;
  3283. let dir = colliObj.dir;
  3284. let xx = startX + dir.x * realDis;
  3285. let yy = startY + dir.y * realDis;
  3286. this.getColliPos(xx, yy, radius, angle);
  3287. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3288. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3289. let offset = xGame.common.rodOffest;
  3290. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3291. this.isOnSameLine = true;
  3292. }
  3293. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3294. xGame.common.d2World.isHelpLineOnBall = true;
  3295. this.targetBall = target;
  3296. this.reflectAngle = reflectAngle;
  3297. this.showBallWrongEft();
  3298. if (xGame.common.longHelpLine) {
  3299. this.delayReflectLine(target, reflectAngle);
  3300. }
  3301. }
  3302. }
  3303. getBorderDot(startX, startY, angle) {
  3304. let radius = 17;
  3305. let distance;
  3306. let isDone;
  3307. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3308. isDone = this.judgeUpDown(distance, angle, startX);
  3309. if (isDone != null) {
  3310. return isDone;
  3311. }
  3312. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3313. isDone = this.judgeUpDown(distance, angle, startX);
  3314. if (isDone != null) {
  3315. return isDone;
  3316. }
  3317. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3318. isDone = this.judgeLeftRight(distance, angle, startY);
  3319. if (isDone != null) {
  3320. return isDone;
  3321. }
  3322. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3323. isDone = this.judgeLeftRight(distance, angle, startY);
  3324. if (isDone != null) {
  3325. return isDone;
  3326. }
  3327. }
  3328. judgeUpDown(distance, angle, startX) {
  3329. let flag = Math.sin(angle * Math.PI / 180);
  3330. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3331. if (distance >= 0) {
  3332. if (flag > 0) {
  3333. if (temp < this.borderRect.x + this.borderRect.width) {
  3334. return distance;
  3335. }
  3336. }
  3337. else {
  3338. if (temp > this.borderRect.x) {
  3339. return distance;
  3340. }
  3341. }
  3342. }
  3343. }
  3344. judgeLeftRight(distance, angle, starY) {
  3345. let flag = -Math.cos(angle * Math.PI / 180);
  3346. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3347. if (distance >= 0) {
  3348. if (flag > 0) {
  3349. if (temp < this.borderRect.y + this.borderRect.height) {
  3350. return distance;
  3351. }
  3352. }
  3353. else {
  3354. if (temp > this.borderRect.y) {
  3355. return distance;
  3356. }
  3357. }
  3358. }
  3359. }
  3360. clearBallAllEft() {
  3361. let temp;
  3362. for (let index = 0; index < this.ballArr.length; index++) {
  3363. temp = this.ballArr[index];
  3364. temp.clearBallEft();
  3365. }
  3366. }
  3367. showBallRightEft() {
  3368. let gameMgr = xGame.common.gameMgr;
  3369. let temp;
  3370. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3371. if (targetArr.length <= 0)
  3372. return;
  3373. for (let index = 0; index < this.ballArr.length; index++) {
  3374. temp = this.ballArr[index];
  3375. if (targetArr.indexOf(temp.number) > -1) {
  3376. temp.showRightEft();
  3377. }
  3378. }
  3379. }
  3380. showBallWrongEft() {
  3381. let gameMgr = xGame.common.gameMgr;
  3382. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3383. if (targetArr.length <= 0)
  3384. return;
  3385. let temp;
  3386. for (let index = 0; index < this.ballArr.length; index++) {
  3387. temp = this.ballArr[index];
  3388. if (this.targetBall && this.targetBall.number == temp.number) {
  3389. if (targetArr.indexOf(temp.number) <= -1) {
  3390. temp.showWrongEft();
  3391. }
  3392. else {
  3393. temp.clearBallWrongEft();
  3394. }
  3395. }
  3396. else {
  3397. temp.clearBallWrongEft();
  3398. }
  3399. }
  3400. }
  3401. getColliPos(x, y, radius, angle) {
  3402. this.d2HelpLine.ui.x = x;
  3403. this.d2HelpLine.ui.y = y;
  3404. let dirX = x - this.rootBall.gameObj.x;
  3405. let dirY = y - this.rootBall.gameObj.y;
  3406. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3407. if (rectH <= 0)
  3408. rectH = 0;
  3409. this.d2HelpLine.ui.rect.height = 0;
  3410. this.d2HelpLine.ui.rect.height = rectH;
  3411. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3412. if (rectH < this.rootBall.gameObj.width) {
  3413. this.d2HelpLine.ui.rect.visible = false;
  3414. }
  3415. else {
  3416. this.d2HelpLine.ui.rect.visible = true;
  3417. }
  3418. this.d2HelpLine.ui.dir.visible = false;
  3419. this.d2HelpLine.ui.rootDir.visible = false;
  3420. }
  3421. getReflectLine(x, y, radius, target) {
  3422. this.d2HelpLine.ui.dir.visible = true;
  3423. let dirX = target.x - x;
  3424. let dirY = target.y - y;
  3425. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3426. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3427. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3428. this.d2HelpLine.ui.dir.height = 48;
  3429. this.d2HelpLine.ui.dir.rotation = angle;
  3430. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3431. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3432. return angle;
  3433. }
  3434. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3435. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3436. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3437. let targetX = target.gameObj.x;
  3438. let targetY = target.gameObj.y;
  3439. this.outDir.setValue(targetX - xx, targetY - yy);
  3440. this.rootDir.setValue(rtX - xx, rtY - yy);
  3441. let ver = Math.PI / 2;
  3442. let sin = Math.sin(ver);
  3443. let cos = Math.cos(ver);
  3444. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3445. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3446. this.outDir.setValue(outX, outY);
  3447. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3448. Laya.Vector2.normalize(this.outDir, this.outDir);
  3449. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3450. if (Math.abs(result) <= 0.08) {
  3451. this.d2HelpLine.ui.rootDir.visible = false;
  3452. return;
  3453. }
  3454. if (result > 0) {
  3455. angle += 90;
  3456. }
  3457. else if (result < 0) {
  3458. angle -= 90;
  3459. }
  3460. this.d2HelpLine.ui.rootDir.visible = true;
  3461. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3462. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3463. this.d2HelpLine.ui.rootDir.rotation = angle;
  3464. }
  3465. delayReflectLine(obj, angle) {
  3466. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3467. return;
  3468. }
  3469. this.isOnSameLine = false;
  3470. let startX = obj.gameObj.x;
  3471. let startY = obj.gameObj.y;
  3472. let dis = this.getBorderDot(startX, startY, angle);
  3473. if (dis == null) {
  3474. this.d2HelpLine.ui.dirDot.visible = false;
  3475. return;
  3476. }
  3477. this.d2HelpLine.ui.visible = true;
  3478. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3479. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3480. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3481. if (colliObj == null) {
  3482. this.setDelayLine(disX, disY, obj, angle);
  3483. }
  3484. else {
  3485. let radius = 16;
  3486. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3487. dis1 = Math.sqrt(dis1);
  3488. let realDis = colliObj.disHon - dis1;
  3489. let dir = colliObj.dir;
  3490. let xx = startX + dir.x * realDis;
  3491. let yy = startY + dir.y * realDis;
  3492. this.setDelayLine(xx, yy, obj, angle);
  3493. }
  3494. }
  3495. setDelayLine(x, y, obj, angle) {
  3496. let dirX = x - obj.gameObj.x;
  3497. let dirY = y - obj.gameObj.y;
  3498. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3499. if (rectH <= 0)
  3500. rectH = 0;
  3501. this.d2HelpLine.ui.dir.height = rectH;
  3502. this.d2HelpLine.ui.dirDot.visible = true;
  3503. this.d2HelpLine.ui.dirDot.x = 17;
  3504. this.d2HelpLine.ui.dirDot.y = 17;
  3505. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3506. ;
  3507. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3508. }
  3509. changePlayerView() {
  3510. if (Math.random() >= 0.7)
  3511. return;
  3512. if (!this.targetBall) {
  3513. return;
  3514. }
  3515. if (!xGame.common.gameMgr.selfTurn)
  3516. return;
  3517. switch (xGame.common.gameMode) {
  3518. case GameMode.classic:
  3519. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3520. if (this.targetBall.number != 8) {
  3521. return;
  3522. }
  3523. }
  3524. break;
  3525. case GameMode.bigMove:
  3526. return;
  3527. case GameMode.placeBall:
  3528. break;
  3529. default:
  3530. break;
  3531. }
  3532. let startX = this.targetBall.gameObj.x;
  3533. let startY = this.targetBall.gameObj.y;
  3534. let angle = this.reflectAngle;
  3535. let dis = this.getBorderDot(startX, startY, angle);
  3536. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3537. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3538. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3539. if (colliObj) {
  3540. return;
  3541. }
  3542. let offset = 40;
  3543. let posObj = xGame.common.gameMgr.posObj;
  3544. let temp;
  3545. let radius;
  3546. let tarX, tarY;
  3547. for (const key in posObj) {
  3548. temp = posObj[key];
  3549. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3550. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3551. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3552. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3553. xGame.common.showOneCamera("angle" + key);
  3554. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3555. Laya.physicsTimer.scale = 0.7;
  3556. break;
  3557. }
  3558. }
  3559. }
  3560. selectBestEnterOne(arr) {
  3561. this.aiLv = xGame.tools.random(1, 11);
  3562. this.aiLv = 10;
  3563. this.wBall = xGame.common.d2World.rootBall;
  3564. this.rootPos.x = this.wBall.gameObj.x;
  3565. this.rootPos.y = this.wBall.gameObj.y;
  3566. this.initHoleBall(arr);
  3567. return this.selectBall();
  3568. }
  3569. selectBall() {
  3570. let ball = null;
  3571. this.destRot = 0;
  3572. let ai = 110 - this.aiLv * 10;
  3573. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3574. let score = false;
  3575. if (this.scoreBall.length < 1) {
  3576. if (this.lineBall.length < 1) {
  3577. for (let i = 0; i < this.kickBall.length; i++) {
  3578. let list = [];
  3579. let bo = this.kickBall[i];
  3580. let bobj = bo.gameObj;
  3581. let rect = xGame.common.d2World.borderRect;
  3582. let mobj = this.wBall.gameObj;
  3583. let minb = bobj.y - rect.y - 20;
  3584. let minw = mobj.y - rect.y - 50;
  3585. if (minb > 0 && minw > 0) {
  3586. let dlenx = 0;
  3587. let dleny = mobj.y - rect.y;
  3588. let spx = mobj.x;
  3589. let spy = rect.y - dleny;
  3590. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3591. }
  3592. minb = rect.y + rect.height - bobj.y - 20;
  3593. minw = rect.y + rect.height - mobj.y - 50;
  3594. if (minb > 0 && minw > 0) {
  3595. let dlenx = 0;
  3596. let dleny = rect.y + rect.height - mobj.y;
  3597. let spx = mobj.x;
  3598. let spy = rect.y + rect.height + dleny;
  3599. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3600. }
  3601. minb = bobj.x - rect.x - 20;
  3602. minw = mobj.x - rect.x - 50;
  3603. if (minb > 0 && minw > 0) {
  3604. let dlenx = mobj.x - rect.x;
  3605. let dleny = 0;
  3606. let spx = rect.x - dlenx;
  3607. let spy = mobj.y;
  3608. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3609. }
  3610. minb = rect.x + rect.width - bobj.x - 20;
  3611. minw = rect.x + rect.width - mobj.x - 50;
  3612. if (minb > 0 && minw > 0) {
  3613. let dlenx = rect.x + rect.width - mobj.x;
  3614. let dleny = 0;
  3615. let spx = rect.x + rect.width + dlenx;
  3616. let spy = mobj.y;
  3617. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3618. }
  3619. list.sort(function (a, b) {
  3620. return a.order - b.order;
  3621. });
  3622. for (let i = 0; i < list.length; i++) {
  3623. let data = list[i];
  3624. let mx = mobj.x - bobj.x;
  3625. let my = mobj.y - bobj.y;
  3626. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3627. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3628. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3629. if (num > 1)
  3630. num = 1;
  3631. let cos = Math.acos(num);
  3632. if (cos > 1.57)
  3633. cos = 1.57;
  3634. else if (cos < 0.01)
  3635. cos = 0.01;
  3636. let tan = Math.tan(cos);
  3637. let dx = tan * data.dleny;
  3638. let dy = tan * data.dlenx;
  3639. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3640. if (Math.abs(bx - 667) < 40)
  3641. continue;
  3642. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3643. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3644. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3645. this.forceMax = dis * 0.08;
  3646. this.destRot += mis * 0.1;
  3647. this.setKick(bx, by);
  3648. return true;
  3649. }
  3650. }
  3651. }
  3652. }
  3653. else {
  3654. ball = xGame.common.getRandArrEle(this.lineBall);
  3655. }
  3656. }
  3657. else {
  3658. for (let i = 0; i < this.scoreBall.length; i++) {
  3659. if (i < this.scoreBall.length - 1) {
  3660. let rand = 70 + this.aiLv * 10 + i * 10;
  3661. if (xGame.tools.random(0, 100) < rand) {
  3662. ball = this.scoreBall[i];
  3663. break;
  3664. }
  3665. }
  3666. else {
  3667. ball = this.scoreBall[i];
  3668. break;
  3669. }
  3670. }
  3671. score = true;
  3672. this.selectNum++;
  3673. }
  3674. if (!ball)
  3675. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3676. let dx = ball.gameObj.x;
  3677. let dy = ball.gameObj.y;
  3678. let kickAngle = 0;
  3679. if (score) {
  3680. dx = ball.kickPos.x;
  3681. dy = ball.kickPos.y;
  3682. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3683. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3684. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3685. if (adot > 1)
  3686. adot = 1;
  3687. kickAngle = Math.acos(adot) * 57.3;
  3688. if (kickAngle > 45) {
  3689. let kdx = ball.kickPos.x - ball.gameObj.x;
  3690. let kdy = ball.kickPos.y - ball.gameObj.y;
  3691. dx = ball.kickPos.x - kdx * mis * 0.3;
  3692. dy = ball.kickPos.y - kdy * mis * 0.3;
  3693. }
  3694. else
  3695. this.destRot += mis;
  3696. }
  3697. else if (ball.poleAngle != 0) {
  3698. this.destRot += ball.poleAngle;
  3699. }
  3700. if (xGame.common.gameMode == 0) {
  3701. let af = kickAngle * 0.08;
  3702. this.forceMax = ball.hard * 0.1 + af * af;
  3703. }
  3704. this.setKick(dx, dy);
  3705. return ball;
  3706. }
  3707. initHoleBall(arr) {
  3708. this.kickBall = [];
  3709. this.lineBall = [];
  3710. this.scoreBall = [];
  3711. this.holeBall = [];
  3712. this.selectNum = 0;
  3713. this.forceNum = 0;
  3714. this.forceMax = 0;
  3715. this.turnNum = 0;
  3716. let list = arr;
  3717. let holes = xGame.common.gameMgr.holePosList;
  3718. let self = xGame.common.aiPlayer;
  3719. for (let i = 0; i < list.length; i++) {
  3720. let obj = list[i];
  3721. if (!obj)
  3722. continue;
  3723. obj.kickPos.x = 0;
  3724. obj.kickPos.y = 0;
  3725. obj.poleAngle = 0;
  3726. obj.hard = 0;
  3727. obj.borderDis = 0;
  3728. obj.kickAngle = 180;
  3729. let b = obj.gameObj;
  3730. let wbp = this.rootPos;
  3731. let bx = wbp.x - b.x;
  3732. let by = wbp.y - b.y;
  3733. obj.borderDis = xGame.tools.random(0, 100);
  3734. this.kickBall.push(obj);
  3735. if (!this.isLine(wbp, obj))
  3736. continue;
  3737. obj.kickAngle = xGame.tools.random(90, 180);
  3738. obj.kickPos.x = b.x;
  3739. obj.kickPos.y = b.y;
  3740. this.lineBall.push(obj);
  3741. let minDis = 999999;
  3742. let hole = false;
  3743. for (let j = 0; j < holes.length; j++) {
  3744. let hp = holes[j];
  3745. if (bx >= 0 && hp.x > b.x + 100)
  3746. continue;
  3747. if (bx <= 0 && hp.x < b.x - 100)
  3748. continue;
  3749. if (by < -10 && hp.y < wbp.y)
  3750. continue;
  3751. if (by > 10 && hp.y > wbp.y)
  3752. continue;
  3753. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3754. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3755. if (dis < minDis) {
  3756. let dx = b.x - this.tempDir1.x * this.ballSize;
  3757. let dy = b.y - this.tempDir1.y * this.ballSize;
  3758. this.tempDir3.x = this.tempDir1.x;
  3759. this.tempDir3.y = this.tempDir1.y;
  3760. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3761. obj.kickPos.x = dx;
  3762. obj.kickPos.y = dy;
  3763. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3764. if (num > 1)
  3765. num = 1;
  3766. obj.kickAngle = Math.acos(num) * 57.3;
  3767. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3768. dis = dis * 2;
  3769. if (Math.abs(hp.x - 600) < 100)
  3770. dis += 50;
  3771. obj.hard = dis + obj.kickAngle * 3;
  3772. hole = true;
  3773. }
  3774. }
  3775. }
  3776. }
  3777. if (hole) {
  3778. this.scoreBall.push(obj);
  3779. this.holeBall.push(obj);
  3780. }
  3781. }
  3782. this.scoreBall.sort(function (a, b) {
  3783. return a.hard - b.hard;
  3784. });
  3785. this.holeBall.sort(function (a, b) {
  3786. return a.kickAngle - b.kickAngle;
  3787. });
  3788. this.kickBall.sort(function (a, b) {
  3789. return a.borderDis - b.borderDis;
  3790. });
  3791. }
  3792. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3793. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3794. let balls = xGame.common.d2World.ballArr;
  3795. let max = xGame.tools.getDis(hx, hy, bx, by);
  3796. for (let index = 0; index < balls.length; index++) {
  3797. let obj = balls[index];
  3798. if (obj.number == 0)
  3799. continue;
  3800. if (obj.number == bn || obj.number == dn)
  3801. continue;
  3802. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3803. if (dis * dis > max)
  3804. continue;
  3805. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3806. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3807. if (num > 1)
  3808. num = 1;
  3809. if (num < 0)
  3810. continue;
  3811. let gap = Math.sin(Math.acos(num)) * dis;
  3812. if (gap < this.ballSize)
  3813. return true;
  3814. }
  3815. return false;
  3816. }
  3817. isLine(xy, ball) {
  3818. let bx = xy.x;
  3819. let by = xy.y;
  3820. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3821. let dis = ball.getDestDis(xy);
  3822. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3823. let sin = Math.sin(angle);
  3824. let cos = Math.cos(angle);
  3825. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3826. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3827. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3828. let dx = bx + this.tempDir2.x * dis;
  3829. let dy = by + this.tempDir2.y * dis;
  3830. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3831. sin = Math.sin(-angle);
  3832. cos = Math.cos(-angle);
  3833. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3834. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3835. dx = bx + this.tempDir2.x * dis;
  3836. dy = by + this.tempDir2.y * dis;
  3837. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  3838. if (isr && isl)
  3839. return false;
  3840. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  3841. }
  3842. return true;
  3843. }
  3844. setKick(dx, dy) {
  3845. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  3846. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3847. this.tempDir1.x = 0;
  3848. this.tempDir1.y = 1;
  3849. this.tempDir2.y = -this.tempDir2.y;
  3850. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3851. if (num > 1)
  3852. num = 1;
  3853. let rot = Math.acos(num) * 57.3;
  3854. if (this.tempDir2.x < 0)
  3855. rot = 360 - rot;
  3856. this.destRot += rot;
  3857. }
  3858. }
  3859. class ui_UIGame extends fgui.GComponent {
  3860. static createInstance() {
  3861. return (fgui.UIPackage.createObject("game", "UIGame"));
  3862. }
  3863. onConstruct() {
  3864. this.c1 = this.getController("c1");
  3865. this.d3Root = (this.getChild("d3Root"));
  3866. this.clickNode = (this.getChild("clickNode"));
  3867. this.d2Root = (this.getChild("d2Root"));
  3868. this.topNode = (this.getChild("topNode"));
  3869. this.n72 = (this.getChild("n72"));
  3870. this.n40 = (this.getChild("n40"));
  3871. this.rulerNode = (this.getChild("rulerNode"));
  3872. this.rulerClickNode = (this.getChild("rulerClickNode"));
  3873. this.n50 = (this.getChild("n50"));
  3874. this.keduNode = (this.getChild("keduNode"));
  3875. this.powerTxt = (this.getChild("powerTxt"));
  3876. this.powerNode = (this.getChild("powerNode"));
  3877. this.colorNode = (this.getChild("colorNode"));
  3878. this.powerEft = (this.getChild("powerEft"));
  3879. this.myPowerNode = (this.getChild("myPowerNode"));
  3880. this.ganNode = (this.getChild("ganNode"));
  3881. this.rodMethodNode = (this.getChild("rodMethodNode"));
  3882. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  3883. this.placeNormalNode = (this.getChild("placeNormalNode"));
  3884. this.skillRod = (this.getChild("skillRod"));
  3885. this.border = (this.getChild("border"));
  3886. this.bigSkillNode = (this.getChild("bigSkillNode"));
  3887. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  3888. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  3889. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  3890. this.awardSpineNode = (this.getChild("awardSpineNode"));
  3891. this.guanyuNode = (this.getChild("guanyuNode"));
  3892. this.helpBtn = (this.getChild("helpBtn"));
  3893. this.wordsBtn = (this.getChild("wordsBtn"));
  3894. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  3895. this.returnBtn = (this.getChild("returnBtn"));
  3896. this.ballNode = (this.getChild("ballNode"));
  3897. this.whiteAni = (this.getChild("whiteAni"));
  3898. this.blackAni = (this.getChild("blackAni"));
  3899. this.selfTurn = (this.getChild("selfTurn"));
  3900. this.aiTurn = (this.getChild("aiTurn"));
  3901. this.deskNode = (this.getChild("deskNode"));
  3902. this.moveNode = (this.getChild("moveNode"));
  3903. this.selfTalk = (this.getChild("selfTalk"));
  3904. this.aiTalk = (this.getChild("aiTalk"));
  3905. this.d2Node = (this.getChild("d2Node"));
  3906. this.snowNode = (this.getChild("snowNode"));
  3907. this.guide2 = (this.getChild("guide2"));
  3908. this.guide1 = (this.getChild("guide1"));
  3909. this.guide3 = (this.getChild("guide3"));
  3910. this.guideNode = (this.getChild("guideNode"));
  3911. }
  3912. }
  3913. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  3914. class ui_UIGameEnd extends fgui.GComponent {
  3915. static createInstance() {
  3916. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  3917. }
  3918. onConstruct() {
  3919. this.c1 = this.getController("c1");
  3920. this.n22 = (this.getChild("n22"));
  3921. this.n2 = (this.getChild("n2"));
  3922. this.n52 = (this.getChild("n52"));
  3923. this.n53 = (this.getChild("n53"));
  3924. this.coinNode = (this.getChild("coinNode"));
  3925. this.closeNode = (this.getChild("closeNode"));
  3926. this.moneyNode = (this.getChild("moneyNode"));
  3927. this.secretary = (this.getChild("secretary"));
  3928. this.n27 = (this.getChild("n27"));
  3929. this.n29 = (this.getChild("n29"));
  3930. this.talkNode = (this.getChild("talkNode"));
  3931. this.n38 = (this.getChild("n38"));
  3932. this.n39 = (this.getChild("n39"));
  3933. this.n40 = (this.getChild("n40"));
  3934. this.awardNode = (this.getChild("awardNode"));
  3935. this.starNumNode = (this.getChild("starNumNode"));
  3936. this.n47 = (this.getChild("n47"));
  3937. this.conditionNode = (this.getChild("conditionNode"));
  3938. this.isGetAward = (this.getChild("isGetAward"));
  3939. this.leftBtn = (this.getChild("leftBtn"));
  3940. this.rightBtn = (this.getChild("rightBtn"));
  3941. this.btnNode = (this.getChild("btnNode"));
  3942. }
  3943. }
  3944. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  3945. class ui_UIAddCoin extends fgui.GComponent {
  3946. static createInstance() {
  3947. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  3948. }
  3949. onConstruct() {
  3950. this.n11 = (this.getChild("n11"));
  3951. this.myNode = (this.getChild("myNode"));
  3952. this.t0 = this.getTransition("t0");
  3953. }
  3954. }
  3955. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  3956. class UIAddCoin extends UIBase {
  3957. constructor() {
  3958. super();
  3959. this.coinNum = 2000;
  3960. }
  3961. onConstructor() {
  3962. this.ui = ui_UIAddCoin.createInstance();
  3963. this.contentPane = this.ui;
  3964. this.isEject = false;
  3965. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  3966. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  3967. }
  3968. show() {
  3969. super.show();
  3970. this.ui.t0.play();
  3971. }
  3972. videoAddCoin() {
  3973. Moyu.showVideoAd(() => {
  3974. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  3975. this.hide();
  3976. }, EAdType.addFailCoin);
  3977. }
  3978. }
  3979. UIAddCoin.uiName = "UIAddCoin";
  3980. class ui_UIInvitation extends fgui.GComponent {
  3981. static createInstance() {
  3982. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  3983. }
  3984. onConstruct() {
  3985. this.n14 = (this.getChild("n14"));
  3986. this.myNode = (this.getChild("myNode"));
  3987. this.t0 = this.getTransition("t0");
  3988. }
  3989. }
  3990. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  3991. class UIInvitation extends UIBase {
  3992. constructor() {
  3993. super();
  3994. }
  3995. onConstructor() {
  3996. this.ui = ui_UIInvitation.createInstance();
  3997. this.contentPane = this.ui;
  3998. this.isEject = false;
  3999. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4000. }
  4001. show() {
  4002. super.show();
  4003. }
  4004. enterGame() {
  4005. xGame.common.gameMode = GameMode.classic;
  4006. DataMgr.setChallengeTimes(1);
  4007. xGame.common.passAwardCoin = 2000;
  4008. let need = xGame.common.classicNiceNeddCoin;
  4009. if (DataMgr.coinEnough(need)) {
  4010. DataMgr.setCoin(-need);
  4011. xGame.eventMgr.event(RESTART_GAME, true);
  4012. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4013. }
  4014. else {
  4015. xGame.eventMgr.event(RESTART_GAME, true);
  4016. }
  4017. this.hide();
  4018. }
  4019. hide() {
  4020. super.hide();
  4021. }
  4022. }
  4023. UIInvitation.uiName = "UIInvitation";
  4024. class ui_UIMain extends fgui.GComponent {
  4025. static createInstance() {
  4026. return (fgui.UIPackage.createObject("game", "UIMain"));
  4027. }
  4028. onConstruct() {
  4029. this.n47 = (this.getChild("n47"));
  4030. this.n10 = (this.getChild("n10"));
  4031. this.secretary = (this.getChild("secretary"));
  4032. this.n33 = (this.getChild("n33"));
  4033. this.shopBtn = (this.getChild("shopBtn"));
  4034. this.moneyNode = (this.getChild("moneyNode"));
  4035. this.headNode = (this.getChild("headNode"));
  4036. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4037. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4038. this.classicBtn = (this.getChild("classicBtn"));
  4039. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4040. this.globalBtn = (this.getChild("globalBtn"));
  4041. this.n44 = (this.getChild("n44"));
  4042. this.signBtn = (this.getChild("signBtn"));
  4043. this.drawBtn = (this.getChild("drawBtn"));
  4044. this.settingNode = (this.getChild("settingNode"));
  4045. this.n45 = (this.getChild("n45"));
  4046. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4047. this.n46 = (this.getChild("n46"));
  4048. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4049. this.liucheng1 = (this.getChild("liucheng1"));
  4050. this.rightBtn = (this.getChild("rightBtn"));
  4051. this.n75 = (this.getChild("n75"));
  4052. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4053. this.liucheng2 = (this.getChild("liucheng2"));
  4054. this.guideBtn = (this.getChild("guideBtn"));
  4055. this.n73 = (this.getChild("n73"));
  4056. this.wordsNode = (this.getChild("wordsNode"));
  4057. this.enterGuide = (this.getChild("enterGuide"));
  4058. this.talkNode = (this.getChild("talkNode"));
  4059. this.n83 = (this.getChild("n83"));
  4060. this.n84 = (this.getChild("n84"));
  4061. }
  4062. }
  4063. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4064. class ui_UIMoyu extends fgui.GComponent {
  4065. static createInstance() {
  4066. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4067. }
  4068. onConstruct() {
  4069. this.ageTip = (this.getChild("ageTip"));
  4070. this.mainBg = (this.getChild("mainBg"));
  4071. this.xyNode = (this.getChild("xyNode"));
  4072. this.rnNode = (this.getChild("rnNode"));
  4073. this.fcmNode = (this.getChild("fcmNode"));
  4074. this.ageNode = (this.getChild("ageNode"));
  4075. this.tipNode = (this.getChild("tipNode"));
  4076. this.msgNode = (this.getChild("msgNode"));
  4077. }
  4078. }
  4079. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4080. class MoyuMgr {
  4081. static initMoyu() {
  4082. this.moyuView = new MoyuView();
  4083. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4084. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4085. this.moyuView.ui.displayObject.zOrder = 1000;
  4086. this.moyuView.init();
  4087. this.moyuView.showTip(true);
  4088. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4089. window['XApk'] = this;
  4090. }
  4091. static showAge(show) {
  4092. if (this.moyuView)
  4093. this.moyuView.showAge(show);
  4094. }
  4095. static onPlatMsg(idx) {
  4096. if (!MoyuMgr.moyuView)
  4097. return;
  4098. if (idx == '0') {
  4099. MoyuMgr.moyuView.showTip(false);
  4100. }
  4101. }
  4102. static showAgree(call) {
  4103. if (this.moyuView)
  4104. this.moyuView.showAgree(call);
  4105. else
  4106. call && call();
  4107. }
  4108. static showXy(type = 1) {
  4109. if (this.moyuView)
  4110. this.moyuView.showXy(type);
  4111. }
  4112. }
  4113. MoyuMgr.isAdvise = false;
  4114. class MoyuView {
  4115. constructor() {
  4116. this.ysxyNum = 1;
  4117. this.ysJson = null;
  4118. this.ui = ui_UIMoyu.createInstance();
  4119. }
  4120. init() {
  4121. this.ui.mainBg.visible = false;
  4122. this.ui.xyNode.visible = false;
  4123. this.ui.ageNode.visible = false;
  4124. this.ui.tipNode.visible = false;
  4125. this.ui.rnNode.visible = false;
  4126. this.ui.fcmNode.visible = false;
  4127. this.ui.ageTip.visible = false;
  4128. this.ui.msgNode.visible = false;
  4129. this.ui.visible = false;
  4130. this.ui.xyNode.xyList.setVirtual();
  4131. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4132. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4133. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4134. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4135. this.ui.xyNode.btnKnown.visible = false;
  4136. this.ui.xyNode.xy1.visible = false;
  4137. this.ui.xyNode.xy2.visible = false;
  4138. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4139. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4140. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4141. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4142. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4143. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4144. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4145. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4146. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4147. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4148. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4149. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4150. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4151. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4152. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4153. this.ysxyNum = 2;
  4154. }
  4155. }
  4156. onClick(obj) {
  4157. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4158. switch (obj) {
  4159. case this.ui.ageTip:
  4160. if (Moyu.isTTApk) {
  4161. this.ui.ageNode.visible = true;
  4162. this.ui.mainBg.visible = true;
  4163. }
  4164. break;
  4165. case this.ui.tipNode:
  4166. this.showTip(false);
  4167. break;
  4168. case this.ui.ageNode.btnAge:
  4169. this.ui.ageNode.visible = false;
  4170. this.ui.mainBg.visible = false;
  4171. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4172. this.ui.visible = false;
  4173. break;
  4174. case this.ui.xyNode.btnXy3:
  4175. case this.ui.xyNode.btnXy1:
  4176. this.loadXy(1);
  4177. break;
  4178. case this.ui.xyNode.btnXy2:
  4179. this.loadXy(2);
  4180. break;
  4181. case this.ui.xyNode.btnBack:
  4182. this.ui.xyNode.xy1.visible = true;
  4183. this.ui.xyNode.xy2.visible = false;
  4184. break;
  4185. case this.ui.xyNode.btnKnown:
  4186. this.ui.xyNode.visible = false;
  4187. this.ui.mainBg.visible = false;
  4188. this.ui.visible = false;
  4189. break;
  4190. case this.ui.rnNode.btnCheck:
  4191. this.check();
  4192. break;
  4193. case this.ui.rnNode.btnExit:
  4194. case this.ui.xyNode.btnNo:
  4195. this.ysxyNum--;
  4196. if (this.ysxyNum > 0)
  4197. this.showMsg("Refuse to quit the game once again");
  4198. else {
  4199. Moyu.userAgree(false);
  4200. Moyu.exit();
  4201. }
  4202. break;
  4203. case this.ui.xyNode.btnSure:
  4204. case this.ui.xyNode.btnYes:
  4205. DataMgr.userData.isAgree = true;
  4206. DataMgr.saveUserData();
  4207. this.onAgree();
  4208. break;
  4209. case this.ui.rnNode.btnDone:
  4210. this.ui.rnNode.visible = false;
  4211. this.ui.visible = false;
  4212. break;
  4213. case this.ui.fcmNode.btnRn:
  4214. this.showRn();
  4215. break;
  4216. }
  4217. }
  4218. showTip(show) {
  4219. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4220. return;
  4221. if (show) {
  4222. MoyuMgr.isAdvise = true;
  4223. this.ui.visible = true;
  4224. this.ui.tipNode.visible = true;
  4225. this.ui.tipNode.alpha = 1;
  4226. Laya.timer.once(1000, this, this.showTip, [false]);
  4227. }
  4228. else {
  4229. this.ui.tipNode.alpha = 1;
  4230. this.ui.tipNode.visible = true;
  4231. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4232. this.ui.tipNode.visible = false;
  4233. MoyuMgr.isAdvise = false;
  4234. }), 1000);
  4235. }
  4236. }
  4237. showAge(show, px = 0, py = 0) {
  4238. if (Moyu.platType > 10 && !Moyu.isIos) {
  4239. this.ui.ageTip.x = px;
  4240. this.ui.ageTip.y = py;
  4241. this.ui.ageTip.visible = show;
  4242. if (show)
  4243. this.ui.visible = true;
  4244. }
  4245. }
  4246. showAgree(call) {
  4247. this.agreeCall = call;
  4248. this.onAgree();
  4249. return;
  4250. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4251. this.showXy(0);
  4252. }
  4253. else
  4254. this.onAgree();
  4255. }
  4256. onAgree() {
  4257. if (!this.ui.ageNode.visible)
  4258. this.ui.visible = false;
  4259. this.ui.xyNode.visible = false;
  4260. Moyu.userAgree(true);
  4261. this.showAge(false);
  4262. this.agreeCall && this.agreeCall();
  4263. this.showRn();
  4264. }
  4265. showMsg(txt) {
  4266. this.ui.msgNode.txtMsg.text = txt;
  4267. this.ui.msgNode.visible = true;
  4268. this.ui.msgNode.alpha = 1;
  4269. this.ui.visible = true;
  4270. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4271. this.ui.msgNode.visible = false;
  4272. }), 2500, true);
  4273. }
  4274. showRn() {
  4275. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4276. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4277. this.ui.rnNode.rn1.visible = true;
  4278. this.ui.rnNode.rn2.visible = false;
  4279. this.ui.rnNode.rn3.visible = false;
  4280. this.ui.rnNode.rn4.visible = false;
  4281. this.ui.rnNode.visible = true;
  4282. this.ui.mainBg.visible = true;
  4283. this.ui.rnNode.btnDone.visible = false;
  4284. this.ui.rnNode.btnExit.visible = true;
  4285. this.ui.rnNode.btnCheck.visible = true;
  4286. this.ui.fcmNode.visible = false;
  4287. this.ui.visible = true;
  4288. return;
  4289. }
  4290. }
  4291. this.showFcm();
  4292. }
  4293. showFcm() {
  4294. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4295. Moyu.initFCM(true);
  4296. if (Moyu.gameTime < 1)
  4297. this.fcmLoop();
  4298. else if (Moyu.gameTime < 999)
  4299. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4300. }
  4301. }
  4302. fcmLoop() {
  4303. if (Moyu.gameTime < 1) {
  4304. this.ui.rnNode.visible = false;
  4305. this.ui.fcmNode.visible = true;
  4306. this.ui.mainBg.visible = true;
  4307. this.ui.visible = true;
  4308. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4309. Laya.timer.clear(this.ui, this.fcmLoop);
  4310. }
  4311. }
  4312. check() {
  4313. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4314. this.ui.rnNode.rn1.visible = false;
  4315. this.ui.rnNode.rn2.visible = false;
  4316. this.ui.rnNode.rn4.visible = true;
  4317. }
  4318. else if (this.ui.rnNode.rn4.visible) {
  4319. let name = this.ui.rnNode.inputName.text;
  4320. let code = this.ui.rnNode.inputCode.text;
  4321. if (code && code.length == 18) {
  4322. this.ui.rnNode.rn1.visible = false;
  4323. this.ui.rnNode.rn4.visible = false;
  4324. Moyu.authenticate(name, code, (res) => {
  4325. this.ui.rnNode.rn2.visible = !res;
  4326. this.ui.rnNode.rn3.visible = res;
  4327. this.ui.rnNode.btnDone.visible = res;
  4328. this.ui.rnNode.btnExit.visible = !res;
  4329. this.ui.rnNode.btnCheck.visible = !res;
  4330. if (res)
  4331. this.showFcm();
  4332. });
  4333. }
  4334. else
  4335. this.showMsg("信息填写不完整");
  4336. }
  4337. }
  4338. loadXy(type = 0) {
  4339. this.ui.xyNode.xy1.visible = false;
  4340. this.ui.xyNode.xy2.visible = true;
  4341. this.ui.xyNode.xyList.scrollToView(0);
  4342. if (type == 1) {
  4343. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4344. }
  4345. else if (type == 2) {
  4346. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4347. }
  4348. }
  4349. showXy(type = 0) {
  4350. this.xyBtn();
  4351. if (type == 0) {
  4352. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4353. this.ui.xyNode.btnSure.visible = true;
  4354. }
  4355. else {
  4356. this.ui.xyNode.btnYes.visible = true;
  4357. this.ui.xyNode.btnNo.visible = true;
  4358. }
  4359. }
  4360. else {
  4361. this.ui.xyNode.btnKnown.visible = true;
  4362. this.ui.mainBg.visible = true;
  4363. }
  4364. this.ui.xyNode.xy1.visible = true;
  4365. this.ui.xyNode.xy2.visible = false;
  4366. this.ui.xyNode.visible = true;
  4367. this.ui.visible = true;
  4368. }
  4369. xyBtn() {
  4370. this.ui.xyNode.btnSure.visible = false;
  4371. this.ui.xyNode.btnYes.visible = false;
  4372. this.ui.xyNode.btnNo.visible = false;
  4373. this.ui.xyNode.btnKnown.visible = false;
  4374. {
  4375. this.ui.xyNode.btnXy3.visible = false;
  4376. this.ui.xyNode.btnXy2.visible = true;
  4377. this.ui.xyNode.btnXy1.visible = true;
  4378. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4379. }
  4380. }
  4381. createXY(json) {
  4382. this.ysJson = json.content;
  4383. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4384. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4385. this.ui.xyNode.xy2.visible = true;
  4386. }
  4387. renderListItem(idx, cell) {
  4388. let xy = this.ysJson[idx];
  4389. cell.height = xy.line * 30;
  4390. cell.xyItem.text = xy.text;
  4391. }
  4392. onDestroy() {
  4393. this.agreeCall = null;
  4394. }
  4395. }
  4396. class SettingNode {
  4397. constructor(ui) {
  4398. this.showSetting = false;
  4399. this.openSound = true;
  4400. this.openShake = true;
  4401. this.ui = ui;
  4402. this.ui.soundBtn.onClick(this, this.switchSound);
  4403. this.ui.shakeBtn.onClick(this, this.switchShake);
  4404. this.ui.xyBtn.onClick(this, this.onXy);
  4405. this.ui.clickNode.onClick(this, this.changeSetting);
  4406. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4407. this.ui.xyBtn.visible = false;
  4408. this.ui.shakeBtn.visible = false;
  4409. }
  4410. changeSetting() {
  4411. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4412. this.showSetting = !this.showSetting;
  4413. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4414. }
  4415. switchSound() {
  4416. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4417. this.openSound = !this.openSound;
  4418. Moyu.onSetting(this.openSound, this.openShake);
  4419. xGame.soundMgr.onSetting(this.openSound);
  4420. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4421. }
  4422. switchShake() {
  4423. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4424. this.openShake = !this.openShake;
  4425. Moyu.onSetting(this.openSound, this.openShake);
  4426. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4427. }
  4428. onXy() {
  4429. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4430. MoyuMgr.showXy(1);
  4431. }
  4432. }
  4433. class ui_UILevelDisplay extends fgui.GComponent {
  4434. static createInstance() {
  4435. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4436. }
  4437. onConstruct() {
  4438. this.n9 = (this.getChild("n9"));
  4439. this.myNode = (this.getChild("myNode"));
  4440. this.closeNode = (this.getChild("closeNode"));
  4441. }
  4442. }
  4443. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4444. class ui_UILevelProp extends fgui.GComponent {
  4445. static createInstance() {
  4446. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4447. }
  4448. onConstruct() {
  4449. this.n16 = (this.getChild("n16"));
  4450. this.myNode = (this.getChild("myNode"));
  4451. this.closeBtn = (this.getChild("closeBtn"));
  4452. this.moneyNode = (this.getChild("moneyNode"));
  4453. this.t1 = this.getTransition("t1");
  4454. }
  4455. }
  4456. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4457. class ui_ShowItem extends fgui.GComponent {
  4458. static createInstance() {
  4459. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4460. }
  4461. onConstruct() {
  4462. this.myImg = (this.getChild("myImg"));
  4463. }
  4464. }
  4465. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4466. class ShowItem {
  4467. constructor() {
  4468. this.ui = ui_ShowItem.createInstance();
  4469. }
  4470. destroySelf() {
  4471. if (!this.ui.isDisposed) {
  4472. this.ui.removeFromParent();
  4473. this.ui.dispose();
  4474. }
  4475. }
  4476. setParent(parent) {
  4477. parent.addChild(this.ui);
  4478. }
  4479. setPos(x, y) {
  4480. this.ui.x = x;
  4481. this.ui.y = y;
  4482. }
  4483. setUrl(index) {
  4484. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4485. }
  4486. }
  4487. class ui_UIPower extends fgui.GComponent {
  4488. static createInstance() {
  4489. return (fgui.UIPackage.createObject("game", "UIPower"));
  4490. }
  4491. onConstruct() {
  4492. this.n11 = (this.getChild("n11"));
  4493. this.myNode = (this.getChild("myNode"));
  4494. this.t0 = this.getTransition("t0");
  4495. }
  4496. }
  4497. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4498. class UIPower extends UIBase {
  4499. constructor() {
  4500. super();
  4501. }
  4502. onConstructor() {
  4503. this.ui = ui_UIPower.createInstance();
  4504. this.contentPane = this.ui;
  4505. this.isEject = false;
  4506. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4507. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4508. }
  4509. show() {
  4510. super.show();
  4511. this.ui.t0.play();
  4512. }
  4513. videoGetPower() {
  4514. Moyu.showVideoAd(() => {
  4515. DataMgr.setPower(xGame.common.videoPower, true);
  4516. xGame.eventMgr.event(POWER_TIME);
  4517. this.hide();
  4518. }, EAdType.getPower);
  4519. }
  4520. }
  4521. UIPower.uiName = "UIPower";
  4522. class UILevelProp extends UIBase {
  4523. constructor() {
  4524. super();
  4525. this.firstPos = 385;
  4526. this.secondPos = 467;
  4527. this.showItemArr = [];
  4528. }
  4529. onConstructor() {
  4530. this.ui = ui_UILevelProp.createInstance();
  4531. this.contentPane = this.ui;
  4532. this.isEject = false;
  4533. this.addUIClick(this.ui.closeBtn, this.hide);
  4534. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4535. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4536. }
  4537. show(level) {
  4538. super.show();
  4539. this.ui.t1.play();
  4540. this.level = level;
  4541. this.data = cfgTable.placeballData[this.level];
  4542. this.updateSelf();
  4543. this.showPreView();
  4544. this.moneyNode.ui.c1.selectedIndex = 2;
  4545. this.moneyNode.checkPowerTime();
  4546. this.moneyNode.powerChange();
  4547. }
  4548. showPreView() {
  4549. let item;
  4550. let data;
  4551. for (let index = 0; index < this.showItemArr.length; index++) {
  4552. item = this.showItemArr[index];
  4553. item.destroySelf();
  4554. }
  4555. this.showItemArr = [];
  4556. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4557. for (const key in cfgData) {
  4558. data = cfgData[key];
  4559. item = new ShowItem();
  4560. item.setParent(this.ui.myNode.displayRoot);
  4561. item.setPos(data.x, data.y);
  4562. item.setUrl(data.value);
  4563. this.showItemArr.push(item);
  4564. }
  4565. }
  4566. updateSelf() {
  4567. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4568. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4569. if (this.data.ball == -1) {
  4570. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4571. }
  4572. else {
  4573. this.ui.myNode.conditionTxt.text = "Reward";
  4574. }
  4575. let localData = DataMgr.getPlaceBallLevel(this.level);
  4576. let getAward = localData.getAward;
  4577. let cfg = cfgTable.placeballData[this.level];
  4578. let coin = this.data.award[0];
  4579. let diamond = this.data.award[1];
  4580. if (cfg.type == PlaceBallType.challenge) {
  4581. diamond = 0;
  4582. coin = 100;
  4583. }
  4584. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4585. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4586. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4587. if (cfg.type == PlaceBallType.challenge) {
  4588. this.ui.myNode.coinNode.numTxt.text = "";
  4589. }
  4590. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4591. if (coin > 0 && diamond > 0) {
  4592. this.ui.myNode.diamondNode.x = 385;
  4593. this.ui.myNode.coinNode.x = 467;
  4594. }
  4595. else {
  4596. this.ui.myNode.diamondNode.x = 385;
  4597. this.ui.myNode.coinNode.x = 385;
  4598. }
  4599. if (!getAward) {
  4600. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4601. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4602. }
  4603. else {
  4604. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4605. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4606. }
  4607. }
  4608. startGame() {
  4609. if (DataMgr.powerEnough()) {
  4610. this.ui.myNode.startBtn.touchable = false;
  4611. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4612. console.log('zh:startGame ');
  4613. this.ui.myNode.startBtn.touchable = true;
  4614. DataMgr.setPower(-1);
  4615. xGame.eventMgr.event(POWER_TIME);
  4616. xGame.common.gameMode = GameMode.placeBall;
  4617. xGame.common.placeBallCurLevel = this.level;
  4618. xGame.uiMgr.Show(UIGame);
  4619. xGame.uiMgr.Hide(UILevelDisplay);
  4620. xGame.uiMgr.Hide(UIMain);
  4621. this.hide();
  4622. }));
  4623. }
  4624. else {
  4625. console.log('zh:startGame no power');
  4626. xGame.uiMgr.Show(UIPower);
  4627. }
  4628. }
  4629. hide() {
  4630. super.hide();
  4631. }
  4632. }
  4633. UILevelProp.uiName = "UILevelProp";
  4634. class PutBallLevelDisplay {
  4635. constructor(ui, index) {
  4636. this.index = 0;
  4637. this.ui = ui;
  4638. this.index = index;
  4639. this.ui.onClick(this, this.clickSelf);
  4640. this.updateSelf();
  4641. this.ui.levelTxt.text = (this.index + 1) + "";
  4642. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4643. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4644. }
  4645. updateSelf() {
  4646. let level = this.index + 1;
  4647. this.data = DataMgr.getPlaceBallLevel(level);
  4648. this.ui.starNode.c1.selectedIndex = this.data.star;
  4649. let isChallenge = cfgTable.placeballData[level].type;
  4650. if (this.data.isCur) {
  4651. if (isChallenge) {
  4652. this.ui.c1.selectedIndex = 5;
  4653. }
  4654. else {
  4655. this.ui.c1.selectedIndex = 2;
  4656. }
  4657. }
  4658. else {
  4659. if (this.data.play) {
  4660. if (this.data.star == 3) {
  4661. this.ui.c1.selectedIndex = 0;
  4662. }
  4663. else {
  4664. this.ui.c1.selectedIndex = 1;
  4665. }
  4666. }
  4667. else {
  4668. if (isChallenge) {
  4669. this.ui.c1.selectedIndex = 4;
  4670. }
  4671. else {
  4672. this.ui.c1.selectedIndex = 3;
  4673. }
  4674. }
  4675. }
  4676. }
  4677. clickSelf() {
  4678. if (!this.data.play)
  4679. return;
  4680. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4681. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4682. }
  4683. }
  4684. class UILevelDisplay extends UIBase {
  4685. constructor() {
  4686. super();
  4687. }
  4688. onConstructor() {
  4689. this.ui = ui_UILevelDisplay.createInstance();
  4690. this.contentPane = this.ui;
  4691. this.isEject = false;
  4692. this.myList = this.ui.myNode.myList;
  4693. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4694. this.levelItemArr = [];
  4695. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4696. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4697. this.myList.numItems = levelNum;
  4698. if (Moyu.isKs)
  4699. this.ui.closeNode.closeBtn.x += 100;
  4700. }
  4701. levelItemRender(index, target) {
  4702. let item = new PutBallLevelDisplay(target, index);
  4703. this.levelItemArr.push(item);
  4704. }
  4705. show() {
  4706. super.show();
  4707. this.updateLevel();
  4708. this.scrollToPlace();
  4709. }
  4710. updateLevel() {
  4711. let temp;
  4712. for (let index = 0; index < this.levelItemArr.length; index++) {
  4713. temp = this.levelItemArr[index];
  4714. temp.updateSelf();
  4715. }
  4716. }
  4717. scrollToPlace() {
  4718. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4719. let passArr = DataMgr.getPlaceBallLevelList();
  4720. let offest = passArr.length;
  4721. if (offest >= maxNum - 1)
  4722. offest = maxNum - 1;
  4723. this.myList.scrollToView(offest, true, true);
  4724. }
  4725. hide() {
  4726. super.hide();
  4727. }
  4728. }
  4729. UILevelDisplay.uiName = "UILevelDisplay";
  4730. class ui_UIMatching extends fgui.GComponent {
  4731. static createInstance() {
  4732. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4733. }
  4734. onConstruct() {
  4735. this.n5 = (this.getChild("n5"));
  4736. this.n49 = (this.getChild("n49"));
  4737. this.n51 = (this.getChild("n51"));
  4738. this.n64 = (this.getChild("n64"));
  4739. this.n2 = (this.getChild("n2"));
  4740. this.n53 = (this.getChild("n53"));
  4741. this.n54 = (this.getChild("n54"));
  4742. this.n56 = (this.getChild("n56"));
  4743. this.n58 = (this.getChild("n58"));
  4744. this.n59 = (this.getChild("n59"));
  4745. this.n57 = (this.getChild("n57"));
  4746. this.n60 = (this.getChild("n60"));
  4747. this.n62 = (this.getChild("n62"));
  4748. this.awardTxt = (this.getChild("awardTxt"));
  4749. this.n61 = (this.getChild("n61"));
  4750. this.selfHead = (this.getChild("selfHead"));
  4751. this.aiHead = (this.getChild("aiHead"));
  4752. this.n82 = (this.getChild("n82"));
  4753. this.n84 = (this.getChild("n84"));
  4754. this.n83 = (this.getChild("n83"));
  4755. this.t1 = this.getTransition("t1");
  4756. this.t2 = this.getTransition("t2");
  4757. this.t3 = this.getTransition("t3");
  4758. this.t4 = this.getTransition("t4");
  4759. }
  4760. }
  4761. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4762. class UIMatching extends UIBase {
  4763. constructor() {
  4764. super();
  4765. }
  4766. onConstructor() {
  4767. this.ui = ui_UIMatching.createInstance();
  4768. this.contentPane = this.ui;
  4769. this.isEject = false;
  4770. }
  4771. show(callback) {
  4772. super.show();
  4773. PlatMgr.showBanner(true);
  4774. this.callback = callback;
  4775. let user = Moyu.getUserInfo();
  4776. if (!this.selfPot) {
  4777. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4778. }
  4779. if (!this.aiPot) {
  4780. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4781. }
  4782. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4783. this.ui.selfHead.nameTxt.text = user.nickName;
  4784. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4785. this.ui.aiHead.nameTxt.text = "???";
  4786. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4787. this.ui.selfHead.c1.selectedIndex = 0;
  4788. this.ui.aiHead.c1.selectedIndex = 0;
  4789. this.ui.selfHead.x = this.selfPot.x;
  4790. this.ui.selfHead.y = this.selfPot.y;
  4791. this.ui.aiHead.x = this.aiPot.x;
  4792. this.ui.aiHead.y = this.aiPot.y;
  4793. switch (xGame.common.gameMode) {
  4794. case GameMode.classic:
  4795. break;
  4796. case GameMode.bigMove:
  4797. this.initSkillData();
  4798. break;
  4799. default:
  4800. break;
  4801. }
  4802. this.ui.t1.play(Laya.Handler.create(this, () => {
  4803. this.ui.t2.play(Laya.Handler.create(this, () => {
  4804. switch (xGame.common.gameMode) {
  4805. case GameMode.classic:
  4806. this.waitingPeople();
  4807. break;
  4808. case GameMode.bigMove:
  4809. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4810. break;
  4811. default:
  4812. break;
  4813. }
  4814. }));
  4815. }));
  4816. }
  4817. initSkillData() {
  4818. this.skillSelectData = [];
  4819. let skillUrl = xGame.common.skillIconList;
  4820. let skillName = xGame.common.skillNameList;
  4821. let skillLevel = DataMgr.getBigSkillList();
  4822. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4823. for (let index = 0; index < 5; index++) {
  4824. let obj = {};
  4825. obj.skillImg = skillUrl[index];
  4826. obj.skillName = skillName[index];
  4827. obj.skillType = skillType[index];
  4828. obj.skillLevel = skillLevel[index];
  4829. this.skillSelectData.push(obj);
  4830. }
  4831. }
  4832. getAISkillLevel(myLevel) {
  4833. let video = xGame.common.upSkillLevel;
  4834. let aiLevel;
  4835. let temp;
  4836. if (video) {
  4837. temp = xGame.common.randomNum(-2, -1);
  4838. }
  4839. else {
  4840. if (myLevel <= 5) {
  4841. temp = xGame.common.randomNum(1, 3);
  4842. }
  4843. else if (myLevel <= 9) {
  4844. temp = xGame.common.randomNum(-2, 1);
  4845. }
  4846. else {
  4847. temp = xGame.common.randomNum(-4, 0);
  4848. }
  4849. }
  4850. aiLevel = temp + myLevel;
  4851. if (aiLevel <= 1)
  4852. aiLevel = 1;
  4853. if (aiLevel >= 10)
  4854. aiLevel = 10;
  4855. return aiLevel;
  4856. }
  4857. getAISkillType() {
  4858. return xGame.common.randomNum(1, 4);
  4859. let successTimes = DataMgr.getSkillSuccessTimes();
  4860. let info = cfgTable.aiskillData[successTimes];
  4861. if (!info) {
  4862. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4863. info = cfgTable.aiskillData[max];
  4864. }
  4865. let dataArr = info.skillselect;
  4866. let myCfg = {};
  4867. for (let index = 0; index < dataArr.length; index++) {
  4868. let temp = dataArr[index].split('-');
  4869. myCfg[temp[0]] = {};
  4870. myCfg[temp[0]].id = parseInt(temp[0]);
  4871. myCfg[temp[0]].weight = parseInt(temp[1]);
  4872. }
  4873. let aiCfg = xGame.common.initWeight(myCfg);
  4874. let curData = xGame.common.getRandomWeightData(aiCfg);
  4875. return parseInt(curData.id);
  4876. }
  4877. getAISkillData(index) {
  4878. let myLevel = this.skillSelectData[index].skillLevel;
  4879. let aiLevel = this.getAISkillLevel(myLevel);
  4880. let aiType = this.getAISkillType() - 1;
  4881. return { aiLevel, aiType } = { aiLevel, aiType };
  4882. }
  4883. skillSelectFinish(index) {
  4884. let aiInfo = this.getAISkillData(index);
  4885. xGame.common.gameMgr.selfCurSkill = index;
  4886. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4887. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4888. this.ui.selfHead.c1.selectedIndex = 1;
  4889. this.ui.aiHead.c1.selectedIndex = 1;
  4890. let myData = this.skillSelectData[index];
  4891. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4892. let guide = DataMgr.getSkillGuide();
  4893. if (guide == 0) {
  4894. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  4895. }
  4896. else {
  4897. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4898. }
  4899. let aiData = this.skillSelectData[aiInfo.aiType];
  4900. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4901. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4902. this.waitingPeople();
  4903. }
  4904. waitingPeople() {
  4905. let time = xGame.common.randomNum(1000, 3000);
  4906. time += 1000;
  4907. Laya.timer.once(time, this, () => {
  4908. this.matchingSuccess();
  4909. });
  4910. }
  4911. matchingSuccess() {
  4912. let gameUI = xGame.common.gameUI;
  4913. let name = gameUI.ui.topNode.aiNameTxt.text;
  4914. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4915. this.ui.aiHead.nameTxt.text = name;
  4916. this.ui.aiHead.headImg.url = url;
  4917. name = gameUI.ui.topNode.selfNameTxt.text;
  4918. url = gameUI.ui.topNode.selfHeadLoader.url;
  4919. this.ui.selfHead.nameTxt.text = name;
  4920. this.ui.selfHead.headImg.url = url;
  4921. this.ui.t3.play(Laya.Handler.create(this, () => {
  4922. this.callback && this.callback();
  4923. this.ui.t4.play(Laya.Handler.create(this, () => {
  4924. this.destroySelf();
  4925. }));
  4926. }));
  4927. }
  4928. destroySelf() {
  4929. this.callback = null;
  4930. this.skillSelectData = null;
  4931. this.selfPot = null;
  4932. this.aiPot = null;
  4933. if (!this.ui.isDisposed) {
  4934. this.ui.removeFromParent();
  4935. this.ui.dispose();
  4936. }
  4937. xGame.uiMgr.destroyUI(this);
  4938. }
  4939. }
  4940. UIMatching.uiName = "UIMatching";
  4941. class ui_UIRanking extends fgui.GComponent {
  4942. static createInstance() {
  4943. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4944. }
  4945. onConstruct() {
  4946. this.n26 = (this.getChild("n26"));
  4947. this.myNode = (this.getChild("myNode"));
  4948. }
  4949. }
  4950. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4951. class UIRanking extends UIBase {
  4952. constructor() {
  4953. super();
  4954. this.showSelf = true;
  4955. this.rankType = 1;
  4956. this.rankList = [];
  4957. this.myIndex = 0;
  4958. this.myStar = 0;
  4959. }
  4960. onConstructor() {
  4961. this.ui = ui_UIRanking.createInstance();
  4962. this.contentPane = this.ui;
  4963. this.isEject = false;
  4964. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4965. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4966. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4967. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4968. this.ui.myNode.myList.setVirtual();
  4969. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4970. }
  4971. show() {
  4972. super.show();
  4973. this.myIndex = 51;
  4974. Moyu.getRankList({
  4975. rankId: xGame.common.curRankID,
  4976. type: MoyuRankType.total,
  4977. page: 1,
  4978. pageSize: 50,
  4979. }, this, this.updateItemData);
  4980. this.updateSelf();
  4981. let self = Moyu.getUserInfo();
  4982. if (!self.isAuth) {
  4983. Moyu.initUser(this, () => {
  4984. DataMgr.upRankData();
  4985. });
  4986. }
  4987. }
  4988. updateSelfItem() {
  4989. let self = Moyu.getUserInfo();
  4990. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4991. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4992. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4993. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  4994. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4995. }
  4996. updateItemData(data) {
  4997. this.myStar = xGame.common.getAllStarNum();
  4998. if (this.rankList.length < 2) {
  4999. this.rankList = data;
  5000. let self = Moyu.getUserInfo();
  5001. for (let i = 0; i < data.length; i++) {
  5002. let data = this.rankList[i];
  5003. if (data.userId == self.userId) {
  5004. this.rankList.splice(i, 1);
  5005. break;
  5006. }
  5007. }
  5008. for (let i = 0; i < data.length; i++) {
  5009. let data = this.rankList[i];
  5010. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5011. this.myIndex = i + 1;
  5012. let user = { headIcon: self.headIcon, nickName: "myself" };
  5013. let ud = { user: user, data: {} };
  5014. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5015. if (Moyu.platType < 11) {
  5016. user.headIcon = self.headIcon;
  5017. user.nickName = self.nickName;
  5018. }
  5019. this.rankList.splice(i, 0, md);
  5020. break;
  5021. }
  5022. }
  5023. }
  5024. this.updateSelfItem();
  5025. this.ui.myNode.myList.numItems = this.rankList.length;
  5026. }
  5027. updateItemUI(index, obj) {
  5028. let data = this.rankList[index];
  5029. let userData = JSON.parse(data.userData).user;
  5030. obj.nameTxt.text = userData.nickName.toString();
  5031. obj.valueTxt.text = data.rankScore;
  5032. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5033. obj.rankTxt.text = index + 1;
  5034. switch (index) {
  5035. case 0:
  5036. this.setImg(obj, 1, 0, 0);
  5037. obj.rankTxt.color = "#FFC047";
  5038. break;
  5039. case 1:
  5040. this.setImg(obj, 0, 1, 0);
  5041. obj.rankTxt.color = "#ACACAC";
  5042. break;
  5043. case 2:
  5044. this.setImg(obj, 0, 0, 1);
  5045. obj.rankTxt.color = "#D09672";
  5046. break;
  5047. default:
  5048. this.setImg(obj, 0, 0, 0);
  5049. obj.rankTxt.color = "#496FAB";
  5050. break;
  5051. }
  5052. }
  5053. setImg(obj, a, b, c) {
  5054. obj.img1.visible = a ? true : false;
  5055. obj.img2.visible = b ? true : false;
  5056. obj.img3.visible = c ? true : false;
  5057. }
  5058. changeList(type) {
  5059. this.rankType = type;
  5060. this.updateSelf();
  5061. }
  5062. changeSelfNode() {
  5063. this.showSelf = !this.showSelf;
  5064. this.updateSelf();
  5065. }
  5066. updateSelf() {
  5067. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5068. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5069. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5070. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5071. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5072. }
  5073. }
  5074. UIRanking.uiName = "UIRanking";
  5075. class ui_UISecretary extends fgui.GComponent {
  5076. static createInstance() {
  5077. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5078. }
  5079. onConstruct() {
  5080. this.n0 = (this.getChild("n0"));
  5081. this.myNode = (this.getChild("myNode"));
  5082. this.closeBtn = (this.getChild("closeBtn"));
  5083. this.t0 = this.getTransition("t0");
  5084. }
  5085. }
  5086. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5087. class UISecretary extends UIBase {
  5088. constructor() {
  5089. super();
  5090. this.curIndex = 1;
  5091. }
  5092. onConstructor() {
  5093. this.ui = ui_UISecretary.createInstance();
  5094. this.contentPane = this.ui;
  5095. this.isEject = false;
  5096. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5097. this.nodeObj = { left: null, right: null, cur: null };
  5098. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5099. }
  5100. show() {
  5101. super.show();
  5102. this.ui.t0.play();
  5103. this.updateData();
  5104. }
  5105. addSecretarySpine(node, spineName) {
  5106. if (spineName == "mishu") {
  5107. if (this.secretarySpine1) {
  5108. node.displayObject.destroyChildren();
  5109. this.playWoman(this.secretarySpine1, node.displayObject);
  5110. }
  5111. else {
  5112. let spine1 = new SpineMgr("mishu", () => {
  5113. this.secretarySpine1 = spine1;
  5114. this.playWoman(this.secretarySpine1, node.displayObject);
  5115. });
  5116. }
  5117. }
  5118. else {
  5119. if (this.secretarySpine2) {
  5120. node.displayObject.destroyChildren();
  5121. this.playWoman(this.secretarySpine2, node.displayObject);
  5122. }
  5123. else {
  5124. let spine2 = new SpineMgr("xiaomishu2", () => {
  5125. this.secretarySpine2 = spine2;
  5126. this.playWoman(this.secretarySpine2, node.displayObject);
  5127. });
  5128. }
  5129. }
  5130. }
  5131. playWoman(node, parent) {
  5132. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5133. let yy = this.ui.myNode.gameNode3.secretary.height;
  5134. let scale = 1.5;
  5135. if (node == this.secretarySpine2) {
  5136. scale = 1.2;
  5137. }
  5138. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5139. node.play(data, 0, true, parent);
  5140. }
  5141. turnLeft() {
  5142. this.curIndex--;
  5143. if (this.curIndex < 1) {
  5144. this.curIndex = 2;
  5145. }
  5146. let left = this.nodeObj.left;
  5147. let right = this.nodeObj.right;
  5148. let cur = this.nodeObj.cur;
  5149. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5150. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5151. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5152. this.updateData();
  5153. }));
  5154. this.ui.myNode.setChildIndex(right, 2);
  5155. this.nodeObj.left = cur;
  5156. this.nodeObj.right = left;
  5157. this.nodeObj.cur = right;
  5158. }
  5159. turnRight() {
  5160. this.curIndex++;
  5161. if (this.curIndex > 2) {
  5162. this.curIndex = 1;
  5163. }
  5164. let left = this.nodeObj.left;
  5165. let right = this.nodeObj.right;
  5166. let cur = this.nodeObj.cur;
  5167. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5168. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5169. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5170. this.updateData();
  5171. }));
  5172. this.ui.myNode.setChildIndex(left, 2);
  5173. this.nodeObj.left = right;
  5174. this.nodeObj.right = cur;
  5175. this.nodeObj.cur = left;
  5176. }
  5177. updateData() {
  5178. let data = cfgTable.secretaryshopData;
  5179. let children = this.ui.myNode._children;
  5180. let temp;
  5181. let curData;
  5182. for (let index = 0; index < children.length; index++) {
  5183. temp = children[index];
  5184. curData = data[1];
  5185. temp.heightTxt.text = curData.height;
  5186. temp.foodTxt.text = curData.food;
  5187. temp.historyTxt.text = curData.history;
  5188. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5189. this.addSecretarySpine(temp.secretary, curData.spine);
  5190. let womanIndex = curData.id - 1;
  5191. let getWoman = DataMgr.getSecretary(womanIndex);
  5192. let curUse = DataMgr.getCurSecretary();
  5193. if (getWoman) {
  5194. if (curUse == womanIndex) {
  5195. temp.purchaseBtn.c1.selectedIndex = 1;
  5196. }
  5197. else {
  5198. temp.purchaseBtn.c1.selectedIndex = 2;
  5199. }
  5200. }
  5201. else {
  5202. temp.purchaseBtn.c1.selectedIndex = 0;
  5203. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5204. }
  5205. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5206. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5207. }
  5208. }
  5209. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5210. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5211. if (getWoman) {
  5212. if (curUse != womanIndex) {
  5213. console.log();
  5214. DataMgr.setCurSecretary(womanIndex);
  5215. this.updateData();
  5216. }
  5217. }
  5218. else {
  5219. let need = needDiamond;
  5220. if (DataMgr.diamondEnough(need)) {
  5221. DataMgr.setDiamond(-need);
  5222. DataMgr.setSecretary(womanIndex, 1);
  5223. DataMgr.setCurSecretary(womanIndex);
  5224. this.updateData();
  5225. }
  5226. else {
  5227. xGame.uiMgr.Show(UIAddProp, 1);
  5228. }
  5229. }
  5230. }
  5231. closeSelf() {
  5232. this.hide();
  5233. }
  5234. }
  5235. UISecretary.uiName = "UISecretary";
  5236. class ui_UIShop extends fgui.GComponent {
  5237. static createInstance() {
  5238. return (fgui.UIPackage.createObject("game", "UIShop"));
  5239. }
  5240. onConstruct() {
  5241. this.n48 = (this.getChild("n48"));
  5242. this.n0 = (this.getChild("n0"));
  5243. this.secretary = (this.getChild("secretary"));
  5244. this.talkNode = (this.getChild("talkNode"));
  5245. this.closeNode = (this.getChild("closeNode"));
  5246. this.moneyNode = (this.getChild("moneyNode"));
  5247. this.myNode = (this.getChild("myNode"));
  5248. }
  5249. }
  5250. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5251. class BallRodDisplay {
  5252. constructor(ui, index) {
  5253. this.index = 0;
  5254. this.uiIndex = 0;
  5255. this.ui = ui;
  5256. this.index = index;
  5257. this.initData();
  5258. }
  5259. initData() {
  5260. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5261. let data = cfgTable.ballrodData[this.index + 1];
  5262. this.ui.nameTxt.text = data.name;
  5263. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5264. this.ui.levelNode.c1.selectedIndex = data.quality;
  5265. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5266. if (data.spine) {
  5267. this.mySpine = new SpineMgr(data.spine, () => {
  5268. let xx = 150;
  5269. let yy = 70;
  5270. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5271. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5272. });
  5273. }
  5274. }
  5275. updateSelf() {
  5276. let get = DataMgr.getBallRod(this.index);
  5277. if (get == null)
  5278. get = 1;
  5279. let curUse = DataMgr.getCurBallRod();
  5280. if (get) {
  5281. if (curUse == this.index) {
  5282. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5283. }
  5284. else {
  5285. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5286. }
  5287. }
  5288. else {
  5289. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5290. }
  5291. }
  5292. buyBallRod() {
  5293. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5294. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5295. switch (selectedIndex) {
  5296. case 0:
  5297. break;
  5298. case 1:
  5299. DataMgr.setCurBallRod(this.index);
  5300. let ui = xGame.uiMgr.getUI(UIShop);
  5301. ui.updateBallRod();
  5302. break;
  5303. case 2:
  5304. let data = cfgTable.ballrodData[this.index + 1];
  5305. let need = data.price;
  5306. if (DataMgr.diamondEnough(need)) {
  5307. DataMgr.setDiamond(-need);
  5308. DataMgr.setBallRod(this.index, 1);
  5309. DataMgr.setCurBallRod(this.index);
  5310. let ui = xGame.uiMgr.getUI(UIShop);
  5311. ui.updateBallRod();
  5312. }
  5313. else {
  5314. xGame.uiMgr.Show(UIAddProp, 1);
  5315. }
  5316. break;
  5317. default:
  5318. break;
  5319. }
  5320. }
  5321. }
  5322. class UIShop extends UIBase {
  5323. constructor() {
  5324. super();
  5325. this.itemNums = 0;
  5326. }
  5327. onConstructor() {
  5328. this.ui = ui_UIShop.createInstance();
  5329. this.contentPane = this.ui;
  5330. this.isEject = false;
  5331. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5332. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5333. this.addUIClick(this.ui, this.interuptSecretary);
  5334. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5335. this.ballRodArr = [];
  5336. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5337. this.ui.myNode.myList.numItems = this.itemNums;
  5338. if (Moyu.isKs)
  5339. this.ui.closeNode.closeBtn.x += 100;
  5340. }
  5341. show() {
  5342. super.show();
  5343. this.playSecretaryIdle();
  5344. this.updateBallRod();
  5345. }
  5346. updateBallRod() {
  5347. for (let index = 0; index < this.ballRodArr.length; index++) {
  5348. this.ballRodArr[index].updateSelf();
  5349. }
  5350. }
  5351. renderBallRod(sort, obj) {
  5352. let index = this.getIndexBySort(sort + 1) - 1;
  5353. let ballRod = new BallRodDisplay(obj, index);
  5354. this.ballRodArr.push(ballRod);
  5355. }
  5356. getIndexBySort(sort) {
  5357. let object = cfgTable.ballrodData;
  5358. for (const key in object) {
  5359. if (object[key].sort == sort) {
  5360. return parseInt(key);
  5361. }
  5362. }
  5363. }
  5364. playSecretaryIdle() {
  5365. let parent = this.ui.secretary.displayObject;
  5366. parent.destroyChildren();
  5367. let xx = this.ui.secretary.width / 2;
  5368. let yy = this.ui.secretary.height;
  5369. let scale = xGame.common.getSecretaryScale();
  5370. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5371. xGame.common.secretary.play(data, 0, true, parent);
  5372. }
  5373. interuptSecretary() {
  5374. Laya.timer.clearAll(this);
  5375. this.playSecretaryRandomSound();
  5376. }
  5377. playSecretaryRandomSound() {
  5378. if (this.isHide)
  5379. return;
  5380. let time = xGame.common.randomNum(45000, 60000);
  5381. Laya.timer.once(time, this, () => {
  5382. if (this.isHide)
  5383. return;
  5384. let index = xGame.common.randomNum(4, 7);
  5385. xGame.soundMgr.playSound("s_main0" + index);
  5386. let words = 1;
  5387. switch (index) {
  5388. case 4:
  5389. words = 5;
  5390. break;
  5391. case 5:
  5392. words = 3;
  5393. break;
  5394. case 6:
  5395. words = 6;
  5396. break;
  5397. case 7:
  5398. words = 7;
  5399. break;
  5400. default:
  5401. break;
  5402. }
  5403. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5404. this.playSecretaryRandomSound();
  5405. });
  5406. }
  5407. closeSelf() {
  5408. this.hide();
  5409. }
  5410. }
  5411. UIShop.uiName = "UIShop";
  5412. class ui_UISign extends fgui.GComponent {
  5413. static createInstance() {
  5414. return (fgui.UIPackage.createObject("game", "UISign"));
  5415. }
  5416. onConstruct() {
  5417. this.n6 = (this.getChild("n6"));
  5418. this.closeNode = (this.getChild("closeNode"));
  5419. this.myNode = (this.getChild("myNode"));
  5420. this.moneyNode = (this.getChild("moneyNode"));
  5421. this.secretary = (this.getChild("secretary"));
  5422. this.talkNode = (this.getChild("talkNode"));
  5423. this.tripleBtn = (this.getChild("tripleBtn"));
  5424. this.normalBtn = (this.getChild("normalBtn"));
  5425. this.tipsNode = (this.getChild("tipsNode"));
  5426. this.againBtn = (this.getChild("againBtn"));
  5427. this.t0 = this.getTransition("t0");
  5428. }
  5429. }
  5430. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5431. class SignMax {
  5432. constructor(ui) {
  5433. this.ui = ui;
  5434. }
  5435. updateSelf(index, sameDay, curDayIndex) {
  5436. let data = cfgTable.signData[index + 1];
  5437. this.ui.titleTxt.text = data.title;
  5438. let arr1 = data.award[0].split('-');
  5439. let arr2 = data.award[1].split('-');
  5440. let num1 = parseInt(arr1[1]);
  5441. let num2 = parseInt(arr2[1]);
  5442. this.ui.numTxt1.text = num1 + "";
  5443. this.ui.numTxt2.text = num2 + "";
  5444. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5445. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5446. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5447. this.ui.numTxt1.visible = false;
  5448. }
  5449. else {
  5450. this.ui.numTxt1.visible = true;
  5451. }
  5452. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5453. this.ui.numTxt2.visible = false;
  5454. }
  5455. else {
  5456. this.ui.numTxt2.visible = true;
  5457. }
  5458. if (index < curDayIndex) {
  5459. this.ui.c1.selectedIndex = 1;
  5460. }
  5461. else if (index == curDayIndex) {
  5462. if (sameDay) {
  5463. this.ui.c1.selectedIndex = 2;
  5464. }
  5465. else {
  5466. this.ui.c1.selectedIndex = 2;
  5467. }
  5468. }
  5469. else {
  5470. this.ui.c1.selectedIndex = 0;
  5471. }
  5472. }
  5473. }
  5474. class SignNormal {
  5475. constructor(ui) {
  5476. this.ui = ui;
  5477. }
  5478. updateSelf(index, sameDay, curDayIndex) {
  5479. let data = cfgTable.signData[index + 1];
  5480. this.ui.titleTxt.text = data.title;
  5481. let arr = data.award[0].split('-');
  5482. let type = parseInt(arr[0]);
  5483. let num = parseInt(arr[1]);
  5484. this.ui.numTxt.text = num + "";
  5485. if (type > 2) {
  5486. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5487. this.ui.myIcon.rotation = 0;
  5488. }
  5489. else {
  5490. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5491. this.ui.myIcon.rotation = 0;
  5492. }
  5493. if (xGame.common.signAwardContainsRod(data.award)) {
  5494. this.ui.numTxt.visible = false;
  5495. }
  5496. else {
  5497. this.ui.numTxt.visible = true;
  5498. }
  5499. if (index < curDayIndex) {
  5500. this.ui.c1.selectedIndex = 1;
  5501. }
  5502. else if (index == curDayIndex) {
  5503. if (sameDay) {
  5504. this.ui.c1.selectedIndex = 2;
  5505. }
  5506. else {
  5507. this.ui.c1.selectedIndex = 2;
  5508. }
  5509. }
  5510. else {
  5511. this.ui.c1.selectedIndex = 0;
  5512. }
  5513. }
  5514. }
  5515. class UISign extends UIBase {
  5516. constructor() {
  5517. super();
  5518. this.curDayIndex = 0;
  5519. this.starX = 0;
  5520. }
  5521. onConstructor() {
  5522. this.ui = ui_UISign.createInstance();
  5523. this.contentPane = this.ui;
  5524. this.isEject = false;
  5525. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5526. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5527. this.initSignItem();
  5528. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5529. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5530. }
  5531. show() {
  5532. super.show();
  5533. this.ui.t0.play();
  5534. this.playSecretaryIdle();
  5535. this.updateSign();
  5536. }
  5537. initSignItem() {
  5538. this.signArr = [];
  5539. for (let index = 0; index < 6; index++) {
  5540. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5541. this.signArr.push(temp);
  5542. }
  5543. this.signMax = new SignMax(this.ui.myNode.day7);
  5544. if (Moyu.isKs)
  5545. this.ui.closeNode.closeBtn.x += 100;
  5546. }
  5547. updateSign() {
  5548. let sameDay = xGame.common.judgeSameDay();
  5549. let max = 7;
  5550. this.curDayIndex = DataMgr.getSignData();
  5551. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5552. this.curDayIndex = 0;
  5553. if (!sameDay) {
  5554. this.ui.normalBtn.visible = true;
  5555. this.ui.tipsNode.visible = false;
  5556. this.ui.againBtn.visible = false;
  5557. }
  5558. else {
  5559. this.ui.normalBtn.visible = false;
  5560. let again = DataMgr.getExtraSign();
  5561. let isCurrency = false;
  5562. let index = this.curDayIndex;
  5563. if (index == 0)
  5564. index = 7;
  5565. let award = cfgTable.signData[index].award;
  5566. let num = award[0].split("-")[0];
  5567. if (num == "1" || num == "2")
  5568. isCurrency = true;
  5569. let showAgain = again == 0 && isCurrency;
  5570. this.ui.againBtn.visible = showAgain;
  5571. this.ui.tipsNode.visible = !showAgain;
  5572. }
  5573. for (let index = 0; index < this.signArr.length; index++) {
  5574. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5575. }
  5576. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5577. }
  5578. playSecretaryIdle() {
  5579. let parent = this.ui.secretary.displayObject;
  5580. parent.destroyChildren();
  5581. let xx = this.ui.secretary.width / 2;
  5582. let yy = this.ui.secretary.height;
  5583. let scale = xGame.common.getSecretaryScale();
  5584. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5585. xGame.common.secretary.play(data, 0, true, parent);
  5586. }
  5587. closeSelf() {
  5588. this.hide();
  5589. }
  5590. normalGetAward() {
  5591. let sameDay = xGame.common.judgeSameDay();
  5592. if (!sameDay) {
  5593. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5594. let temp;
  5595. let type;
  5596. let num;
  5597. let arr = [];
  5598. for (let index = 0; index < award.length; index++) {
  5599. temp = award[index].split("-");
  5600. type = parseInt(temp[0]);
  5601. num = parseInt(temp[1]);
  5602. let awardType = new AwardType();
  5603. awardType.num = num;
  5604. awardType.type = type;
  5605. arr.push(awardType);
  5606. }
  5607. xGame.common.getAward(arr, (watchVideo) => {
  5608. this.curDayIndex++;
  5609. if (this.curDayIndex > 7)
  5610. this.curDayIndex = 0;
  5611. DataMgr.setSignData(this.curDayIndex);
  5612. DataMgr.setSignTime(new Date().getTime());
  5613. if (watchVideo) {
  5614. DataMgr.setExtraSign(1);
  5615. Moyu.sendDataEvent("signIn1");
  5616. }
  5617. this.updateSign();
  5618. });
  5619. }
  5620. }
  5621. againGetAward() {
  5622. Moyu.sendDataEvent("signIn2");
  5623. Moyu.showVideoAd(() => {
  5624. let index = this.curDayIndex;
  5625. if (index == 0)
  5626. index = 7;
  5627. let award = cfgTable.signData[index].award;
  5628. let temp;
  5629. let type;
  5630. let num;
  5631. for (let index = 0; index < award.length; index++) {
  5632. temp = award[index].split("-");
  5633. type = parseInt(temp[0]);
  5634. num = parseInt(temp[1]) * 3;
  5635. xGame.common.playObjFlyAnim(num, type);
  5636. }
  5637. DataMgr.setExtraSign(1);
  5638. this.updateSign();
  5639. }, EAdType.againSign);
  5640. }
  5641. }
  5642. UISign.uiName = "UISign";
  5643. class ui_UISkill extends fgui.GComponent {
  5644. static createInstance() {
  5645. return (fgui.UIPackage.createObject("game", "UISkill"));
  5646. }
  5647. onConstruct() {
  5648. this.n48 = (this.getChild("n48"));
  5649. this.n0 = (this.getChild("n0"));
  5650. this.secretary = (this.getChild("secretary"));
  5651. this.talkNode = (this.getChild("talkNode"));
  5652. this.closeNode = (this.getChild("closeNode"));
  5653. this.moneyNode = (this.getChild("moneyNode"));
  5654. this.skillNode = (this.getChild("skillNode"));
  5655. this.guideNode = (this.getChild("guideNode"));
  5656. }
  5657. }
  5658. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5659. class SkillDisplay {
  5660. constructor(ui, data, uiIndex) {
  5661. this.starX = 0;
  5662. this.starY = 0;
  5663. this.index = 0;
  5664. this.ui = ui;
  5665. this.data = data;
  5666. this.index = uiIndex;
  5667. this.initSelf();
  5668. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5669. }
  5670. initSelf() {
  5671. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5672. this.ui.nameTxt.text = this.data.name;
  5673. this.ui.describeTxt.text = this.data.describe;
  5674. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5675. this.ui.startBtn.onClick(this, this.startGame);
  5676. this.updateSelf();
  5677. }
  5678. updateSelf() {
  5679. this.checkTry();
  5680. let level = DataMgr.getBigSkillByIndex(this.index);
  5681. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5682. }
  5683. checkTry() {
  5684. let index = this.index;
  5685. let level = DataMgr.getBigSkillByIndex(index);
  5686. if (level == null) {
  5687. DataMgr.setBigSkill(index, 1, false);
  5688. level = 1;
  5689. }
  5690. this.ui.levelTxt.text = "LV." + level;
  5691. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5692. this.ui.tryNode.visible = true;
  5693. else
  5694. this.ui.tryNode.visible = false;
  5695. }
  5696. clickAddLevel() {
  5697. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5698. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5699. Moyu.showVideoAd(() => {
  5700. DataMgr.setBigSkill(this.data.index, 1);
  5701. this.updateSelf();
  5702. xGame.common.upSkillLevel = true;
  5703. }, EAdType.upSkill);
  5704. }
  5705. startGame() {
  5706. if (this.data.index == 3) {
  5707. alert('Coming soon!');
  5708. return;
  5709. }
  5710. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5711. let needCoin = xGame.common.bigMoveNeedCoin;
  5712. xGame.common.passAwardCoin = 2000;
  5713. let guide = DataMgr.getSkillGuide();
  5714. console.log('zh:startGame guide=' + guide);
  5715. xGame.common.temSelfLevel = 0;
  5716. if (guide == 0) {
  5717. needCoin = 0;
  5718. xGame.common.temSelfLevel = 100;
  5719. }
  5720. if (DataMgr.coinEnough(needCoin)) {
  5721. DataMgr.setCoin(-needCoin);
  5722. xGame.common.curPlayerSkillType = this.index;
  5723. if (guide == 0)
  5724. xGame.common.curPlayerSkillType = 0;
  5725. xGame.uiMgr.Show(UIGame);
  5726. xGame.uiMgr.Hide(UIMain);
  5727. xGame.uiMgr.Show(UIMatching, () => {
  5728. xGame.common.gameUI.ui.alpha = 1;
  5729. xGame.common.gameUI.startGame();
  5730. xGame.uiMgr.Hide(UISkill);
  5731. });
  5732. }
  5733. else {
  5734. xGame.uiMgr.Show(UIAddProp, 0);
  5735. Moyu.sendDataEvent("AddCoinVideo");
  5736. }
  5737. }
  5738. }
  5739. class UISkill extends UIBase {
  5740. constructor() {
  5741. super();
  5742. this.skillData = [];
  5743. }
  5744. onConstructor() {
  5745. this.ui = ui_UISkill.createInstance();
  5746. this.contentPane = this.ui;
  5747. this.isEject = false;
  5748. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5749. this.initSkillData();
  5750. console.log('zh:aaaaaa1111111111');
  5751. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5752. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5753. console.log('zh:aaaaaa22222222');
  5754. this.displayList = [];
  5755. this.ui.skillNode.skillList.numItems = 3;
  5756. this.addUIClick(this.ui, this.interuptSecretary);
  5757. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5758. this.ui.talkNode.visible = false;
  5759. if (Moyu.isKs)
  5760. this.ui.closeNode.closeBtn.x += 100;
  5761. }
  5762. show() {
  5763. super.show();
  5764. this.playSecretaryIdle();
  5765. this.moneyNode.ui.c1.selectedIndex = 1;
  5766. Laya.timer.clearAll(this);
  5767. xGame.soundMgr.playSound("s_start");
  5768. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5769. let guide = DataMgr.getSkillGuide();
  5770. this.ui.guideNode.visible = guide == 0;
  5771. let item = this.getSkillItemByUIIndex(0);
  5772. if (guide == 0) {
  5773. item.ui.c1.selectedIndex = 1;
  5774. }
  5775. else {
  5776. item.ui.c1.selectedIndex = 0;
  5777. }
  5778. this.ui.guideNode.guideBtn.visible = guide == 0;
  5779. for (let index = 0; index < this.displayList.length; index++) {
  5780. this.displayList[index].checkTry();
  5781. }
  5782. }
  5783. getSkillItemByUIIndex(cur) {
  5784. for (let index = 0; index < this.displayList.length; index++) {
  5785. if (this.displayList[index].index == cur) {
  5786. return this.displayList[index];
  5787. }
  5788. }
  5789. }
  5790. enterGuideLevel() {
  5791. let item = this.getSkillItemByUIIndex(0);
  5792. item.startGame();
  5793. if (DataMgr.getNewUser())
  5794. Moyu.sendDataEvent("gameStart1");
  5795. }
  5796. initSkillData() {
  5797. this.skillData = [];
  5798. let nameList = xGame.common.skillNameList;
  5799. let iconList = xGame.common.skillIconList;
  5800. let describeList = [
  5801. "Jump shot executed — ball bounced and pocketed an extra one!",
  5802. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5803. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5804. ];
  5805. console.log('zh:initSkillData 111111111');
  5806. let data;
  5807. for (let index = 0; index < nameList.length; index++) {
  5808. data = {};
  5809. data.name = nameList[index];
  5810. data.icon = iconList[index];
  5811. data.describe = describeList[index];
  5812. data.index = index;
  5813. this.skillData.push(data);
  5814. }
  5815. }
  5816. updateSkillItem(index, target) {
  5817. if (this.displayList[index] == null) {
  5818. let uiIndex;
  5819. switch (index) {
  5820. case 0:
  5821. uiIndex = 1;
  5822. break;
  5823. case 1:
  5824. uiIndex = 0;
  5825. break;
  5826. case 2:
  5827. uiIndex = 2;
  5828. break;
  5829. case 3:
  5830. uiIndex = 3;
  5831. break;
  5832. default:
  5833. break;
  5834. }
  5835. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5836. this.displayList.push(temp);
  5837. }
  5838. }
  5839. playSecretaryIdle() {
  5840. let parent = this.ui.secretary.displayObject;
  5841. parent.destroyChildren();
  5842. let xx = this.ui.secretary.width / 2;
  5843. let yy = this.ui.secretary.height;
  5844. let scale = xGame.common.getSecretaryScale();
  5845. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5846. xGame.common.secretary.play(data, 0, true, parent);
  5847. }
  5848. returnUIMain() {
  5849. this.hide();
  5850. xGame.common.stopGirlPop(this.ui.talkNode);
  5851. xGame.uiMgr.Show(UIMain);
  5852. }
  5853. interuptSecretary() {
  5854. Laya.timer.clearAll(this);
  5855. this.playSecretaryRandomSound();
  5856. }
  5857. playSecretaryRandomSound() {
  5858. if (this.isHide)
  5859. return;
  5860. let time = xGame.common.randomNum(45000, 60000);
  5861. Laya.timer.once(time, this, () => {
  5862. if (this.isHide)
  5863. return;
  5864. let index = xGame.common.randomNum(4, 7);
  5865. xGame.soundMgr.playSound("s_main0" + index);
  5866. let words = 1;
  5867. switch (index) {
  5868. case 4:
  5869. words = 5;
  5870. break;
  5871. case 5:
  5872. words = 3;
  5873. break;
  5874. case 6:
  5875. words = 6;
  5876. break;
  5877. case 7:
  5878. words = 7;
  5879. break;
  5880. default:
  5881. break;
  5882. }
  5883. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5884. this.playSecretaryRandomSound();
  5885. });
  5886. }
  5887. }
  5888. UISkill.uiName = "UISkill";
  5889. class ui_UIMsg extends fgui.GComponent {
  5890. static createInstance() {
  5891. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5892. }
  5893. onConstruct() {
  5894. this.tipsNode = (this.getChild("tipsNode"));
  5895. }
  5896. }
  5897. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5898. class UIMsg extends UIBase {
  5899. constructor() {
  5900. super();
  5901. }
  5902. onConstructor() {
  5903. this.ui = ui_UIMsg.createInstance();
  5904. this.contentPane = this.ui;
  5905. this.isEject = false;
  5906. this.isMuti = true;
  5907. }
  5908. show(msg, callback) {
  5909. super.show();
  5910. this.ui.tipsNode.msgTxt.text = msg;
  5911. this.ui.alpha = 1;
  5912. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5913. this.hide();
  5914. callback && callback();
  5915. }), 1000);
  5916. }
  5917. }
  5918. UIMsg.uiName = "UIMsg";
  5919. class ui_UIModeSelection extends fgui.GComponent {
  5920. static createInstance() {
  5921. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5922. }
  5923. onConstruct() {
  5924. this.n19 = (this.getChild("n19"));
  5925. this.closeBtn = (this.getChild("closeBtn"));
  5926. this.myNode = (this.getChild("myNode"));
  5927. this.t0 = this.getTransition("t0");
  5928. }
  5929. }
  5930. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5931. class UIModeSelection extends UIBase {
  5932. constructor() {
  5933. super();
  5934. }
  5935. onConstructor() {
  5936. this.ui = ui_UIModeSelection.createInstance();
  5937. this.contentPane = this.ui;
  5938. this.isEject = false;
  5939. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5940. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5941. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5942. this.addUIClick(this.ui.closeBtn, this.hide);
  5943. this.peopleArr = [650, 6900, 3800];
  5944. this.peopleOffest = [50, 500, 200];
  5945. this.updateSelf();
  5946. }
  5947. show(callback) {
  5948. super.show();
  5949. this.ui.t0.play();
  5950. this.callback = callback;
  5951. }
  5952. updateSelf() {
  5953. let cfg = cfgTable.modeselectData;
  5954. for (let index = 1; index <= 3; index++) {
  5955. let node = this.ui.myNode["type" + index];
  5956. node.need.text = cfg[index].need;
  5957. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  5958. node.peopleTxt.text = this.getRandPeople(index - 1);
  5959. }
  5960. }
  5961. enterGame(type) {
  5962. xGame.common.classicRoomType = type;
  5963. let cfg = cfgTable.modeselectData[type];
  5964. let need = cfg.need;
  5965. xGame.common.passAwardCoin = cfg.award;
  5966. if (DataMgr.coinEnough(need)) {
  5967. DataMgr.setCoin(-need);
  5968. this.ui.myNode["type" + type].t0.play();
  5969. Laya.timer.once(200, this, () => {
  5970. this.callback && this.callback();
  5971. });
  5972. }
  5973. else {
  5974. Moyu.sendDataEvent("AddCoinVideo");
  5975. xGame.uiMgr.Show(UIAddProp, 0);
  5976. }
  5977. }
  5978. getRandPeople(index) {
  5979. let rand = this.peopleOffest[index];
  5980. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5981. }
  5982. }
  5983. UIModeSelection.uiName = "UIModeSelection";
  5984. class UIMain extends UIBase {
  5985. constructor() {
  5986. super();
  5987. this.firstEnter = true;
  5988. }
  5989. onConstructor() {
  5990. this.ui = ui_UIMain.createInstance();
  5991. this.contentPane = this.ui;
  5992. this.isEject = false;
  5993. this.addEvent();
  5994. this.addClickSpine();
  5995. this.settingNode = new SettingNode(this.ui.settingNode);
  5996. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5997. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  5998. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  5999. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6000. let curUse = DataMgr.getCurSecretary();
  6001. this.changeSecretary(curUse);
  6002. this.ui.talkNode.visible = false;
  6003. let guide = DataMgr.getSkillGuide();
  6004. if (xGame.common.isNewDay && guide == 1) {
  6005. xGame.common.isNewDay = false;
  6006. xGame.soundMgr.playSound("s_main01");
  6007. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6008. console.log("播放小秘书每天语音");
  6009. }
  6010. this.onGetUserInfo();
  6011. this.ui.n83.visible = false;
  6012. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6013. }
  6014. changeSecretary(curUse) {
  6015. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6016. xGame.common.secretary && xGame.common.secretary.dispose();
  6017. this.addSecretarySpine(name);
  6018. }
  6019. addSecretarySpine(name) {
  6020. let spine = new SpineMgr(name, () => {
  6021. this.playSecretaryIdle();
  6022. });
  6023. xGame.common.secretary = spine;
  6024. }
  6025. addClickSpine() {
  6026. let clickSpine = new SpineMgr("dianji", () => {
  6027. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6028. let parent = Laya.stage;
  6029. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6030. clickSpine.play(data, 0, false, parent, (spine) => {
  6031. spine.destroy(true);
  6032. });
  6033. });
  6034. });
  6035. }
  6036. addEvent() {
  6037. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6038. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6039. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6040. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6041. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6042. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6043. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6044. this.addUIClick(this.ui, this.interuptSecretary);
  6045. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6046. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6047. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6048. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6049. this.addUIClick(this.ui.signBtn, this.openSignView);
  6050. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6051. }
  6052. show(showFailWords) {
  6053. super.show();
  6054. this.moneyNode.ui.c1.selectedIndex = 1;
  6055. this.playSecretaryIdle();
  6056. xGame.soundMgr.playMusic("caromhall01");
  6057. Laya.timer.clearAll(this);
  6058. this.playSecretaryRandomSound();
  6059. if (showFailWords) {
  6060. setTimeout(() => {
  6061. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6062. let words = -1;
  6063. if (str == "s_main02") {
  6064. words = 2;
  6065. }
  6066. else {
  6067. words = 3;
  6068. }
  6069. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6070. xGame.soundMgr.playSound(str);
  6071. }, 300);
  6072. }
  6073. this.showGuide();
  6074. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6075. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6076. let guide = DataMgr.getSkillGuide();
  6077. if (guide == 1) {
  6078. let randTime = xGame.common.randomNum(300, 800);
  6079. if (this.firstEnter) {
  6080. this.firstEnter = false;
  6081. randTime += 900;
  6082. }
  6083. Laya.timer.once(randTime, this, () => {
  6084. xGame.common.autoPopUIView();
  6085. });
  6086. }
  6087. }
  6088. checkActive(show) {
  6089. }
  6090. showGuide() {
  6091. let guide = DataMgr.getSkillGuide();
  6092. this.ui.guideBtn.visible = guide == 0;
  6093. this.ui.enterGuide.visible = false;
  6094. this.ui.secretaryGuide.visible = guide == 0;
  6095. if (guide == 0) {
  6096. xGame.soundMgr.playSound("s_guide");
  6097. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6098. }
  6099. }
  6100. ensureSecretary() {
  6101. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6102. this.ui.secretaryGuide.visible = false;
  6103. this.ui.enterGuide.visible = true;
  6104. this.ui.wordsNode.t0.play();
  6105. if (DataMgr.getNewUser())
  6106. Moyu.sendDataEvent("gameReady");
  6107. }
  6108. playSecretaryIdle() {
  6109. let parent = this.ui.secretary.displayObject;
  6110. parent.destroyChildren();
  6111. let xx = this.ui.secretary.width / 2;
  6112. let yy = this.ui.secretary.height;
  6113. let scale = xGame.common.getSecretaryScale();
  6114. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6115. console.log("zh:playSecretaryIdle", data);
  6116. xGame.common.secretary.play(data, 0, true, parent);
  6117. }
  6118. startGame(type) {
  6119. xGame.common.gameMode = type;
  6120. Moyu.sendDataEvent("PlayGame", { type: type });
  6121. switch (xGame.common.gameMode) {
  6122. case GameMode.classic:
  6123. let challengeTimes = DataMgr.getChallengeTimes();
  6124. if (challengeTimes == 0) {
  6125. xGame.uiMgr.Show(UIInvitation);
  6126. }
  6127. else {
  6128. this.beginGame();
  6129. }
  6130. break;
  6131. case GameMode.bigMove:
  6132. this.beginGame();
  6133. if (DataMgr.getNewUser())
  6134. Moyu.sendDataEvent("gameStart0");
  6135. break;
  6136. default:
  6137. break;
  6138. }
  6139. }
  6140. beginGame(isNice = false) {
  6141. if (xGame.common.gameMode == GameMode.classic) {
  6142. if (isNice) {
  6143. this.enterClassic();
  6144. }
  6145. else {
  6146. xGame.uiMgr.Show(UIModeSelection, () => {
  6147. this.enterClassic();
  6148. });
  6149. }
  6150. }
  6151. else if (xGame.common.gameMode == GameMode.bigMove) {
  6152. this.ui.enterGuide.visible = false;
  6153. xGame.uiMgr.Show(UISkill);
  6154. }
  6155. }
  6156. enterClassic() {
  6157. xGame.uiMgr.Show(UIGame);
  6158. xGame.uiMgr.Show(UIMatching, () => {
  6159. if (!this.isHide)
  6160. this.hide();
  6161. xGame.common.gameUI.ui.alpha = 1;
  6162. xGame.common.gameUI.startGame();
  6163. xGame.uiMgr.Hide(UIGameEnd);
  6164. });
  6165. }
  6166. startGlobal() {
  6167. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6168. }
  6169. startWeekly() {
  6170. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6171. }
  6172. startPlaceBall() {
  6173. xGame.uiMgr.Show(UILevelDisplay);
  6174. }
  6175. hide() {
  6176. super.hide();
  6177. xGame.common.stopGirlPop(this.ui.talkNode);
  6178. }
  6179. onGetUserInfo(force = false) {
  6180. if (Moyu.isWx) {
  6181. let info = Moyu.getSystemInfo();
  6182. if (info)
  6183. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6184. }
  6185. else {
  6186. Moyu.initUser(this, this.freshUser, force);
  6187. }
  6188. if (!Moyu.hasUserInfo) {
  6189. let user = Moyu.getUserInfo();
  6190. user.headIcon = 'res/ty_touxiang.png';
  6191. }
  6192. this.freshUser();
  6193. }
  6194. freshUser() {
  6195. let user = Moyu.getUserInfo();
  6196. if (!user.isAuth) {
  6197. user.headIcon = 'res/ty_touxiang.png';
  6198. }
  6199. else
  6200. DataMgr.upRankData();
  6201. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6202. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6203. }
  6204. interuptSecretary() {
  6205. Laya.timer.clearAll(this);
  6206. this.playSecretaryRandomSound();
  6207. }
  6208. playSecretaryRandomSound() {
  6209. if (this.isHide)
  6210. return;
  6211. let time = xGame.common.randomNum(45000, 60000);
  6212. Laya.timer.once(time, this, () => {
  6213. if (this.isHide)
  6214. return;
  6215. let index = xGame.common.randomNum(4, 7);
  6216. xGame.soundMgr.playSound("s_main0" + index);
  6217. let words = 1;
  6218. switch (index) {
  6219. case 4:
  6220. words = 5;
  6221. break;
  6222. case 5:
  6223. words = 3;
  6224. break;
  6225. case 6:
  6226. words = 6;
  6227. break;
  6228. case 7:
  6229. words = 7;
  6230. break;
  6231. default:
  6232. break;
  6233. }
  6234. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6235. this.playSecretaryRandomSound();
  6236. });
  6237. }
  6238. openSecretaryView() {
  6239. xGame.uiMgr.Show(UISecretary);
  6240. Moyu.sendDataEvent("secretary");
  6241. }
  6242. openShopView() {
  6243. xGame.uiMgr.Show(UIShop);
  6244. }
  6245. openSignView() {
  6246. xGame.uiMgr.Show(UISign);
  6247. }
  6248. openDrawView() {
  6249. xGame.uiMgr.Show(UIDraw);
  6250. }
  6251. openRanking() {
  6252. xGame.uiMgr.Show(UIRanking);
  6253. Moyu.sendDataEvent("rankingList");
  6254. }
  6255. }
  6256. UIMain.uiName = "UIMain";
  6257. class UIGameEnd extends UIBase {
  6258. constructor() {
  6259. super();
  6260. this.success = false;
  6261. this.awardCoinNum = 1000;
  6262. this.awardDiamondNum = 10;
  6263. }
  6264. onConstructor() {
  6265. this.ui = ui_UIGameEnd.createInstance();
  6266. this.contentPane = this.ui;
  6267. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6268. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6269. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6270. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6271. this.ui.talkNode.visible = false;
  6272. if (Moyu.isKs)
  6273. this.ui.closeNode.closeBtn.x += 100;
  6274. }
  6275. updateType() {
  6276. switch (xGame.common.gameMode) {
  6277. case GameMode.classic:
  6278. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6279. this.ui.coinNode.visible = this.success;
  6280. if (!this.success) {
  6281. Laya.timer.once(500, this, () => {
  6282. xGame.uiMgr.Show(UIAddCoin);
  6283. });
  6284. }
  6285. this.ui.isGetAward.visible = false;
  6286. this.ui.leftBtn.c1.selectedIndex = 3;
  6287. this.ui.rightBtn.c1.selectedIndex = 0;
  6288. this.moneyNode.ui.c1.selectedIndex = 1;
  6289. break;
  6290. case GameMode.bigMove:
  6291. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6292. this.ui.coinNode.visible = this.success;
  6293. if (xGame.common.gameMode == GameMode.bigMove) {
  6294. if (this.success) {
  6295. DataMgr.setSkillSuccessTimes(1, true);
  6296. DataMgr.setSkillAccTimes(1);
  6297. }
  6298. else {
  6299. DataMgr.setSkillSuccessTimes(0, false);
  6300. }
  6301. }
  6302. if (!this.success) {
  6303. Laya.timer.once(500, this, () => {
  6304. xGame.uiMgr.Show(UIAddCoin);
  6305. });
  6306. }
  6307. this.ui.isGetAward.visible = false;
  6308. this.ui.leftBtn.c1.selectedIndex = 3;
  6309. this.ui.rightBtn.c1.selectedIndex = 0;
  6310. this.moneyNode.ui.c1.selectedIndex = 1;
  6311. break;
  6312. case GameMode.placeBall:
  6313. this.ui.coinNode.visible = false;
  6314. if (this.success) {
  6315. if (xGame.common.placeBallStarNum == 3) {
  6316. this.ui.c1.selectedIndex = 2;
  6317. }
  6318. else {
  6319. this.ui.c1.selectedIndex = 3;
  6320. }
  6321. }
  6322. else {
  6323. this.ui.c1.selectedIndex = 4;
  6324. }
  6325. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6326. if (cfg.type == PlaceBallType.challenge) {
  6327. this.ui.c1.selectedIndex = 2;
  6328. }
  6329. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6330. this.updatePlaceBallBtn();
  6331. this.updatePlaceBallStarNum();
  6332. this.updatePlaceBallAwardState();
  6333. this.moneyNode.ui.c1.selectedIndex = 2;
  6334. this.moneyNode.checkPowerTime();
  6335. this.moneyNode.powerChange();
  6336. DataMgr.upRankData();
  6337. break;
  6338. default:
  6339. break;
  6340. }
  6341. }
  6342. updatePlaceBallBtn() {
  6343. this.ui.leftBtn.c1.selectedIndex = 5;
  6344. if (this.success) {
  6345. this.ui.rightBtn.c1.selectedIndex = 14;
  6346. }
  6347. else {
  6348. if (xGame.common.placeBallStarNum == 3) {
  6349. this.ui.rightBtn.c1.selectedIndex = 14;
  6350. }
  6351. else {
  6352. this.ui.rightBtn.c1.selectedIndex = 1;
  6353. }
  6354. }
  6355. }
  6356. updatePlaceBallStarNum() {
  6357. let starNum = xGame.common.placeBallStarNum;
  6358. if (starNum == 0)
  6359. this.ui.starNumNode.c1.selectedIndex = 3;
  6360. else {
  6361. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6362. }
  6363. }
  6364. updatePlaceBallAwardState() {
  6365. let level = xGame.common.placeBallCurLevel;
  6366. let starNum = xGame.common.placeBallStarNum;
  6367. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6368. let data = cfgTable.placeballData[level].award;
  6369. let cfg = cfgTable.placeballData[level];
  6370. this.awardDiamondNum = data[1];
  6371. this.awardCoinNum = data[0];
  6372. if (cfg.type == PlaceBallType.challenge) {
  6373. this.awardDiamondNum = 0;
  6374. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6375. }
  6376. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6377. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6378. if (cfg.type == PlaceBallType.challenge) {
  6379. this.ui.awardNode.coinNode.visible = true;
  6380. }
  6381. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6382. this.ui.awardNode.diamondNode.x = 265;
  6383. this.ui.awardNode.coinNode.x = 354;
  6384. }
  6385. else {
  6386. this.ui.awardNode.diamondNode.x = 291;
  6387. this.ui.awardNode.coinNode.x = 291;
  6388. }
  6389. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6390. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6391. if (this.awardCoinNum == 0) {
  6392. this.ui.awardNode.coinNode.numTxt.text = "";
  6393. }
  6394. if (getAward) {
  6395. this.ui.isGetAward.visible = true;
  6396. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6397. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6398. }
  6399. else {
  6400. this.ui.isGetAward.visible = false;
  6401. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6402. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6403. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6404. }
  6405. else {
  6406. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6407. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6408. }
  6409. }
  6410. }
  6411. show(success) {
  6412. super.show();
  6413. xGame.eventMgr.event(RESET_GAME);
  6414. this.success = success;
  6415. Laya.timer.clearAll(this);
  6416. this.playSecretaryAni();
  6417. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6418. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6419. offsetTime = Math.floor(offsetTime / 1000);
  6420. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6421. this.updateType();
  6422. Laya.timer.once(200, this, () => {
  6423. this.addAward(() => {
  6424. this.updateType();
  6425. Laya.timer.once(500, this, () => {
  6426. this.showChallengeLevel();
  6427. });
  6428. });
  6429. });
  6430. if (this.success) {
  6431. xGame.soundMgr.playSound('slots_roll01');
  6432. xGame.soundMgr.playSound("s_win");
  6433. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6434. }
  6435. else {
  6436. xGame.soundMgr.playSound('matchwin01');
  6437. xGame.soundMgr.playSound("s_lose");
  6438. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6439. }
  6440. if (!Moyu.isLegal)
  6441. PlatMgr.showBanner(true);
  6442. let challengeNum = DataMgr.getChallengeTimes();
  6443. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6444. DataMgr.setChallengeTimes(1);
  6445. }
  6446. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6447. DataMgr.setClassicTimes();
  6448. }
  6449. }
  6450. showChallengeLevel() {
  6451. if (DataMgr.getChallengeTimes() != 0)
  6452. return;
  6453. let skill = DataMgr.getSkillAccTimes();
  6454. let put = DataMgr.getPlaceBallLevelList().length;
  6455. if (skill >= 3 || put >= 5) {
  6456. xGame.uiMgr.Show(UIInvitation);
  6457. this.hide();
  6458. }
  6459. }
  6460. addAward(callback) {
  6461. if (!this.success) {
  6462. callback && callback();
  6463. return;
  6464. }
  6465. switch (xGame.common.gameMode) {
  6466. case GameMode.classic:
  6467. this.awardCoinNum = xGame.common.passAwardCoin;
  6468. this.awardDiamondNum = 0;
  6469. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6470. break;
  6471. case GameMode.bigMove:
  6472. this.awardCoinNum = xGame.common.passAwardCoin;
  6473. this.awardDiamondNum = 0;
  6474. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6475. callback && callback();
  6476. break;
  6477. case GameMode.placeBall:
  6478. let level = xGame.common.placeBallCurLevel;
  6479. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6480. if (xGame.common.placeBallStarNum != 3) {
  6481. callback && callback();
  6482. return;
  6483. }
  6484. else {
  6485. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6486. if (getAward) {
  6487. callback && callback();
  6488. return;
  6489. }
  6490. }
  6491. let cfg = cfgTable.placeballData[level];
  6492. let data = cfgTable.placeballData[level].award;
  6493. this.awardCoinNum = data[0];
  6494. this.awardDiamondNum = data[1];
  6495. if (cfg.type == PlaceBallType.challenge) {
  6496. this.awardDiamondNum = 0;
  6497. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6498. }
  6499. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6500. let diamondAward;
  6501. if (this.awardDiamondNum > 0) {
  6502. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6503. xGame.common.getAward([diamondAward, coinAward], callback);
  6504. }
  6505. else {
  6506. xGame.common.getAward([coinAward], callback);
  6507. }
  6508. if (cfg.type == PlaceBallType.normal) {
  6509. DataMgr.setPlaceBallAward(level);
  6510. }
  6511. break;
  6512. default:
  6513. break;
  6514. }
  6515. }
  6516. playSecretaryAni_old() {
  6517. let parent = this.ui.secretary.displayObject;
  6518. parent.destroyChildren();
  6519. let xx = this.ui.secretary.width / 2;
  6520. let yy = this.ui.secretary.height;
  6521. let scale = xGame.common.getSecretaryScale();
  6522. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6523. if (this.success) {
  6524. let rand = Math.random() <= 0.5 ? 2 : 3;
  6525. xGame.common.secretary.play(data, rand, false, parent, () => {
  6526. xGame.common.secretary.play(data, 1, true, parent);
  6527. });
  6528. }
  6529. else {
  6530. xGame.common.secretary.play(data, 0, true, parent);
  6531. }
  6532. }
  6533. playSecretaryAni() {
  6534. let parent = this.ui.secretary.displayObject;
  6535. parent.destroyChildren();
  6536. let xx = this.ui.secretary.width / 2;
  6537. let yy = this.ui.secretary.height;
  6538. let scale = xGame.common.getSecretaryScale();
  6539. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6540. if (this.success) {
  6541. let rand = 0;
  6542. xGame.common.secretary.play(data, 0, true, parent);
  6543. }
  6544. else {
  6545. xGame.common.secretary.play(data, 0, true, parent);
  6546. }
  6547. }
  6548. restartGame() {
  6549. switch (xGame.common.gameMode) {
  6550. case GameMode.classic:
  6551. xGame.eventMgr.event(RESTART_GAME);
  6552. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6553. break;
  6554. case GameMode.bigMove:
  6555. this.hide();
  6556. xGame.eventMgr.event(RESTART_GAME);
  6557. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6558. break;
  6559. default:
  6560. break;
  6561. }
  6562. }
  6563. hide() {
  6564. super.hide();
  6565. xGame.common.stopGirlPop(this.ui.talkNode);
  6566. PlatMgr.showBanner(false);
  6567. }
  6568. returnHome() {
  6569. this.hide();
  6570. let showFailWords = !this.success;
  6571. xGame.uiMgr.Show(UIMain, showFailWords);
  6572. }
  6573. clickLeftBtn() {
  6574. switch (xGame.common.gameMode) {
  6575. case GameMode.classic:
  6576. case GameMode.bigMove:
  6577. this.returnHome();
  6578. break;
  6579. case GameMode.placeBall:
  6580. let level = xGame.common.placeBallCurLevel;
  6581. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6582. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6583. break;
  6584. default:
  6585. break;
  6586. }
  6587. }
  6588. powerStartPlaceBallLevel(level, btn) {
  6589. if (DataMgr.powerEnough()) {
  6590. btn.touchable = false;
  6591. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6592. btn.touchable = true;
  6593. DataMgr.setPower(-1);
  6594. xGame.eventMgr.event(POWER_TIME);
  6595. this.startPlaceBallLevel(level);
  6596. }));
  6597. }
  6598. else {
  6599. xGame.uiMgr.Show(UIPower, 0);
  6600. }
  6601. }
  6602. clickRightBtn() {
  6603. switch (xGame.common.gameMode) {
  6604. case GameMode.classic:
  6605. console.log('zh:clickRightBtn 111');
  6606. case GameMode.bigMove:
  6607. console.log('zh:clickRightBtn 222');
  6608. this.restartGame();
  6609. break;
  6610. case GameMode.placeBall:
  6611. console.log('zh:clickRightBtn 333');
  6612. let level = xGame.common.placeBallCurLevel;
  6613. let data = DataMgr.getPlaceBallLevel(level);
  6614. let curPss = data.play && !data.isCur;
  6615. if (curPss) {
  6616. console.log('zh:clickRightBtn 333-111');
  6617. console.log('zh:当前LV=' + level);
  6618. if (level == 60) {
  6619. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  6620. Laya.timer.once(3000, this, () => {
  6621. this.returnHome();
  6622. });
  6623. }
  6624. else {
  6625. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6626. }
  6627. }
  6628. else {
  6629. console.log('zh:clickRightBtn 333-000');
  6630. Moyu.sendDataEvent("placeBallNextLevel");
  6631. Moyu.showVideoAd(() => {
  6632. DataMgr.setPlaceBallLevel(level, 1);
  6633. this.startPlaceBallLevel(level + 1);
  6634. }, xGame.define.EAdType.placeBallNextLevel);
  6635. }
  6636. break;
  6637. default:
  6638. console.log('zh:clickRightBtn 444');
  6639. break;
  6640. }
  6641. }
  6642. startPlaceBallLevel(level) {
  6643. xGame.common.gameMode = GameMode.placeBall;
  6644. xGame.common.placeBallCurLevel = level;
  6645. xGame.uiMgr.Show(UIGame);
  6646. this.hide();
  6647. }
  6648. }
  6649. UIGameEnd.uiName = "UIGameEnd";
  6650. class ui_UIRepentProp extends fgui.GComponent {
  6651. static createInstance() {
  6652. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6653. }
  6654. onConstruct() {
  6655. this.c1 = this.getController("c1");
  6656. this.n11 = (this.getChild("n11"));
  6657. this.regretNode = (this.getChild("regretNode"));
  6658. this.helpLineNode = (this.getChild("helpLineNode"));
  6659. this.t0 = this.getTransition("t0");
  6660. }
  6661. }
  6662. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6663. class UIRepentProp extends UIBase {
  6664. constructor() {
  6665. super();
  6666. this.viewType = 0;
  6667. this.regretType = 0;
  6668. }
  6669. onConstructor() {
  6670. this.ui = ui_UIRepentProp.createInstance();
  6671. this.contentPane = this.ui;
  6672. this.isEject = false;
  6673. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6674. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6675. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6676. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6677. }
  6678. show(viewType, regretType, callback) {
  6679. PlatMgr.showInsert(true);
  6680. this.viewType = viewType;
  6681. this.regretType = regretType;
  6682. this.callback = callback;
  6683. super.show();
  6684. this.ui.t0.play();
  6685. this.ui.c1.selectedIndex = this.viewType;
  6686. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6687. if (this.viewType == 0) {
  6688. let guide = DataMgr.getGuideHelpLine();
  6689. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6690. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6691. }
  6692. xGame.common.gameMgr.gamePause = true;
  6693. }
  6694. hideSelf() {
  6695. xGame.common.gameMgr.gamePause = false;
  6696. this.callback && this.callback(false);
  6697. this.hide();
  6698. }
  6699. videoRegret() {
  6700. Moyu.showVideoAd(() => {
  6701. this.callback && this.callback(true);
  6702. this.hideSelf();
  6703. }, EAdType.regretBall);
  6704. }
  6705. videoAddHelpLine() {
  6706. let guide = DataMgr.getGuideHelpLine();
  6707. if (guide == 0) {
  6708. this.callback && this.callback(true);
  6709. this.hideSelf();
  6710. DataMgr.setGuideHelpLine();
  6711. xGame.common.gameUI.ui.guideNode.visible = false;
  6712. }
  6713. else {
  6714. Moyu.showVideoAd(() => {
  6715. this.callback && this.callback(true);
  6716. this.hideSelf();
  6717. }, EAdType.longHelpLine);
  6718. }
  6719. }
  6720. }
  6721. UIRepentProp.uiName = "UIRepentProp";
  6722. class ui_UIVideoShare extends fgui.GComponent {
  6723. static createInstance() {
  6724. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6725. }
  6726. onConstruct() {
  6727. this.n10 = (this.getChild("n10"));
  6728. this.myNode = (this.getChild("myNode"));
  6729. this.t0 = this.getTransition("t0");
  6730. }
  6731. }
  6732. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6733. class UIVideoShare extends UIBase {
  6734. constructor() {
  6735. super();
  6736. this.success = false;
  6737. this.awardNum = 0;
  6738. this.isShared = true;
  6739. }
  6740. onConstructor() {
  6741. this.ui = ui_UIVideoShare.createInstance();
  6742. this.contentPane = this.ui;
  6743. this.isEject = false;
  6744. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6745. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6746. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6747. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6748. }
  6749. show(success) {
  6750. super.show();
  6751. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6752. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6753. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6754. this.success = success;
  6755. let time = xGame.common.randomNum(600, 1500);
  6756. Moyu.showInsertAd(time, 60000);
  6757. if (success)
  6758. xGame.soundMgr.playSound("applause");
  6759. this.ui.t0.play();
  6760. this.checkShareState();
  6761. let times = DataMgr.getDailyVideoShareTimes();
  6762. this.awardNum = times == 0 ? 2000 : 200;
  6763. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6764. }
  6765. checkShareState() {
  6766. if (PlatMgr.forceShare == 0) {
  6767. this.ui.myNode.closeBtn.visible = true;
  6768. this.ui.myNode.tipsNode.visible = false;
  6769. this.ui.myNode.closeBtn.x = 90;
  6770. this.ui.myNode.shareBtn.x = 342;
  6771. }
  6772. else if (PlatMgr.forceShare == 1) {
  6773. this.ui.myNode.closeBtn.visible = false;
  6774. this.ui.myNode.tipsNode.visible = true;
  6775. this.ui.myNode.shareBtn.x = 218;
  6776. this.isShared = true;
  6777. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6778. }
  6779. }
  6780. checkForceShare() {
  6781. this.isShared = !this.isShared;
  6782. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6783. }
  6784. videoShare() {
  6785. if (PlatMgr.forceShare == 1) {
  6786. if (this.isShared) {
  6787. this.shareGame();
  6788. }
  6789. else {
  6790. this.hideSelf();
  6791. }
  6792. }
  6793. else {
  6794. this.shareGame();
  6795. }
  6796. }
  6797. shareGame() {
  6798. Moyu.sendDataEvent("VideoShare");
  6799. if (Moyu.canShare() > 100) {
  6800. Moyu.shareGame((success) => {
  6801. if (success) {
  6802. DataMgr.setDailyVideoShareTimes(1);
  6803. DataMgr.setCoin(this.awardNum);
  6804. }
  6805. this.hideSelf();
  6806. }, this);
  6807. }
  6808. else {
  6809. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6810. this.hideSelf();
  6811. }
  6812. }
  6813. hideSelf() {
  6814. this.hide();
  6815. xGame.uiMgr.Show(UIGameEnd, this.success);
  6816. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6817. xGame.common.screenImg.destroy();
  6818. xGame.common.screenImg = null;
  6819. }
  6820. }
  6821. }
  6822. UIVideoShare.uiName = "UIVideoShare";
  6823. class ui_UITips extends fgui.GComponent {
  6824. static createInstance() {
  6825. return (fgui.UIPackage.createObject("game", "UITips"));
  6826. }
  6827. onConstruct() {
  6828. this.n0 = (this.getChild("n0"));
  6829. this.myNode = (this.getChild("myNode"));
  6830. this.t0 = this.getTransition("t0");
  6831. }
  6832. }
  6833. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6834. class UITips extends UIBase {
  6835. constructor() {
  6836. super();
  6837. this.type = 0;
  6838. }
  6839. onConstructor() {
  6840. this.ui = ui_UITips.createInstance();
  6841. this.contentPane = this.ui;
  6842. this.isEject = false;
  6843. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  6844. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  6845. }
  6846. show(tipsTxt, womanTxt, type) {
  6847. super.show();
  6848. this.ui.t0.play();
  6849. this.ui.myNode.tipsTxt.text = tipsTxt;
  6850. this.ui.myNode.womanTxt.text = womanTxt;
  6851. PlatMgr.showInsert(true);
  6852. this.ui.myNode.c1.selectedIndex = type;
  6853. this.type = type;
  6854. switch (this.type) {
  6855. case TipsType.exitGame:
  6856. xGame.common.gameMgr.gamePause = true;
  6857. break;
  6858. case TipsType.foul:
  6859. Laya.timer.once(200, this, () => {
  6860. xGame.common.gameMgr.gamePause = true;
  6861. });
  6862. break;
  6863. default:
  6864. break;
  6865. }
  6866. }
  6867. clickLeftBtn() {
  6868. this.hide();
  6869. xGame.common.gameMgr.gamePause = false;
  6870. switch (this.type) {
  6871. case TipsType.exitGame:
  6872. break;
  6873. case TipsType.foul:
  6874. break;
  6875. default:
  6876. break;
  6877. }
  6878. }
  6879. clickRightBtn() {
  6880. this.hide();
  6881. switch (this.type) {
  6882. case TipsType.exitGame:
  6883. xGame.eventMgr.event(RESET_GAME);
  6884. xGame.uiMgr.Show(UIMain);
  6885. Moyu.recordEnd(this, null);
  6886. xGame.common.longHelpLine = false;
  6887. break;
  6888. case TipsType.foul:
  6889. xGame.common.gameMgr.gamePause = false;
  6890. Laya.timer.clearAll(this);
  6891. break;
  6892. default:
  6893. break;
  6894. }
  6895. }
  6896. }
  6897. UITips.uiName = "UITips";
  6898. class GameMgr {
  6899. constructor() {
  6900. this.selfCamp = "";
  6901. this.selfFoulNum = 0;
  6902. this.selfBallArr = [];
  6903. this.selfTimer = 0;
  6904. this.selfScore = 0;
  6905. this.aiCamp = "";
  6906. this.aiFoulNum = 0;
  6907. this.aiBallArr = [];
  6908. this.aiTimer = 0;
  6909. this.aiScore = 0;
  6910. this.aiSkillLevelNum = 1;
  6911. this.targertScore = 0;
  6912. this.setTime = 30;
  6913. this.selfTurnRate = 0.5;
  6914. this.accTime = 0;
  6915. this.curFoul = "";
  6916. this.maxFoulTimes = 3;
  6917. this.isFirstInGame = true;
  6918. this.firstColliObj = null;
  6919. this.inHoleBalls = [];
  6920. this.blackNum = 8;
  6921. this.success = false;
  6922. this.holePosList = [];
  6923. this.posObj = {};
  6924. this._selfTurn = false;
  6925. this.lastRootBallPos = new Laya.Vector2(311, 430);
  6926. this.ensureBallType = false;
  6927. this.isOpenBall = true;
  6928. this.finishOneShoot = true;
  6929. this.isEnd = false;
  6930. this.isChangeTurn = false;
  6931. this.isInterrupt = false;
  6932. this.aiPlayedBreakArmy = false;
  6933. this.isTouchedBall = false;
  6934. this.finishBalls = 0;
  6935. this.needBalls = 0;
  6936. this.allBallNum = 0;
  6937. this.placeBallPosData = {};
  6938. this.curHP = 0;
  6939. this.showLongView = false;
  6940. this.firstShoot = true;
  6941. this._gamePause = false;
  6942. this.trunCount = 0;
  6943. this.isBlackInHole = false;
  6944. this.isEnter = true;
  6945. xGame.eventMgr.offAll(ALL_BALL_STOP);
  6946. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  6947. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  6948. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  6949. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  6950. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  6951. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  6952. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  6953. }
  6954. get gamePause() {
  6955. return this._gamePause;
  6956. }
  6957. set gamePause(v) {
  6958. if (v) {
  6959. Laya.physicsTimer.pause();
  6960. }
  6961. else {
  6962. Laya.physicsTimer.resume();
  6963. }
  6964. this._gamePause = v;
  6965. }
  6966. get selfTurn() {
  6967. return this._selfTurn;
  6968. }
  6969. set selfTurn(val) {
  6970. this.trunCount++;
  6971. this._selfTurn = val;
  6972. if (val) {
  6973. xGame.common.d2World.d2Gan.ui.self.visible = true;
  6974. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  6975. }
  6976. else {
  6977. xGame.common.d2World.d2Gan.ui.self.visible = false;
  6978. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  6979. if (this.trunCount > 1)
  6980. PlatMgr.openBox();
  6981. }
  6982. }
  6983. resetGame() {
  6984. this.inHoleBalls = [];
  6985. this.isFirstInGame = true;
  6986. this.firstColliObj = null;
  6987. this.aiCamp = "";
  6988. this.selfCamp = "";
  6989. this.aiFoulNum = 0;
  6990. this.selfFoulNum = 0;
  6991. this.selfBallArr = [];
  6992. this.aiBallArr = [];
  6993. this.gamePause = false;
  6994. this.ensureBallType = false;
  6995. this.isInterrupt = false;
  6996. this.updateLeftBall();
  6997. this.clearTime();
  6998. this.aiPlayedBreakArmy = false;
  6999. this.isBlackInHole = false;
  7000. this.placeBallPosData = {};
  7001. if (xGame.common.d3World.knifeRoot) {
  7002. xGame.common.d3World.knifeRoot.destroyChildren();
  7003. }
  7004. }
  7005. gameReady() {
  7006. this.trunCount = 0;
  7007. this.firstColliObj = null;
  7008. this.isFirstInGame = true;
  7009. this.selfTurn = Math.random() <= this.selfTurnRate;
  7010. let challengeNum = DataMgr.getChallengeTimes();
  7011. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7012. this.selfTurn = true;
  7013. }
  7014. if (xGame.common.gameMode == GameMode.placeBall)
  7015. this.selfTurn = true;
  7016. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7017. this.selfTurn = true;
  7018. }
  7019. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7020. this.checkGuide();
  7021. if (xGame.common.uiRodMethod)
  7022. xGame.common.uiRodMethod.resetRod();
  7023. xGame.common.d2World.getHelpLine();
  7024. this.isOpenBall = true;
  7025. this.isTouchedBall = false;
  7026. xGame.common.aiPlayer.stopRun();
  7027. this.setTime = 30;
  7028. let ui = xGame.common.gameUI.ui;
  7029. switch (xGame.common.gameMode) {
  7030. case GameMode.classic:
  7031. xGame.common.aiPlayer.init();
  7032. this.blackNum = 8;
  7033. this.placeRootBall();
  7034. this.peoplePlay(9, 10);
  7035. ui.wordsBtn.visible = true;
  7036. ui.aiWordsBtn.visible = true;
  7037. xGame.common.talkMgr.changeAIState(true);
  7038. DataMgr.gameData.gameCount++;
  7039. DataMgr.saveGameData();
  7040. break;
  7041. case GameMode.bigMove:
  7042. this.blackNum = -1;
  7043. this.selfScore = 0;
  7044. this.aiScore = 0;
  7045. xGame.common.aiPlayer.init();
  7046. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7047. this.updateSelfScore();
  7048. this.updateAIScore();
  7049. this.updateTargetSroce();
  7050. this.placeRootBall();
  7051. this.peoplePlay(9, 10);
  7052. ui.wordsBtn.visible = true;
  7053. ui.aiWordsBtn.visible = true;
  7054. xGame.common.talkMgr.changeAIState(true);
  7055. if (DataMgr.getSkillGuide() < 1)
  7056. DataMgr.gameData.gameCount = 0;
  7057. else {
  7058. DataMgr.gameData.gameCount++;
  7059. DataMgr.saveGameData();
  7060. PlatMgr.openTry();
  7061. }
  7062. if (xGame.common.d3World.knifeRoot) {
  7063. xGame.common.d3World.knifeRoot.destroyChildren();
  7064. }
  7065. break;
  7066. case GameMode.placeBall:
  7067. this.blackNum = -1;
  7068. this.selfTurn = true;
  7069. this.setTime = 10000;
  7070. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7071. this.curHP = this.placeBallData.hp;
  7072. if (this.placeBallData.ball == -1)
  7073. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7074. else
  7075. this.needBalls = this.placeBallData.ball;
  7076. console.log("需要的进球数目", this.needBalls);
  7077. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7078. this.finishBalls = 0;
  7079. this.placeBallPosData = {};
  7080. this.updatePlaceBallPos();
  7081. this.updatePlaceBallState();
  7082. this.finishOneShoot = true;
  7083. xGame.common.gameUI.ui.moveNode.visible = false;
  7084. this.isOpenBall = false;
  7085. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7086. ui.wordsBtn.visible = false;
  7087. ui.aiWordsBtn.visible = false;
  7088. xGame.common.talkMgr.changeAIState(false);
  7089. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7090. PlatMgr.openBox();
  7091. });
  7092. break;
  7093. default:
  7094. break;
  7095. }
  7096. this.showLongView = false;
  7097. xGame.common.wordsMgr.comboTimes = 1;
  7098. let guide = DataMgr.getSkillGuide();
  7099. if (guide)
  7100. xGame.eventMgr.event(WAIT_SHOOT);
  7101. xGame.common.upSkillLevel = false;
  7102. xGame.common.gameStartTime = new Date().getTime();
  7103. this.firstShoot = true;
  7104. }
  7105. checkGuide() {
  7106. let guide = DataMgr.getSkillGuide();
  7107. let gameUI = xGame.common.gameUI.ui;
  7108. gameUI.guide1.visible = false;
  7109. gameUI.guide2.visible = false;
  7110. gameUI.guide3.visible = false;
  7111. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7112. this.selfTurn = true;
  7113. }
  7114. else {
  7115. return;
  7116. }
  7117. let oneBall = this.getOneBall();
  7118. gameUI.guide1.visible = true;
  7119. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7120. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7121. }
  7122. getOneBall() {
  7123. let arr = xGame.common.d2World.ballArr;
  7124. for (let index = 0; index < arr.length; index++) {
  7125. if (arr[index].number == 0)
  7126. continue;
  7127. return arr[index];
  7128. }
  7129. }
  7130. updateSelfScore() {
  7131. let ui = xGame.common.gameUI.ui.topNode;
  7132. ui.selfScoreTxt.text = this.selfScore + "";
  7133. }
  7134. updateAIScore() {
  7135. let ui = xGame.common.gameUI.ui.topNode;
  7136. ui.aiScoreTxt.text = this.aiScore + "";
  7137. }
  7138. updateTargetSroce() {
  7139. let ui = xGame.common.gameUI.ui.topNode;
  7140. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7141. }
  7142. updateLeftBall() {
  7143. let topUI = xGame.common.gameUI.ui.topNode;
  7144. topUI.selfBallList.numItems = this.selfBallArr.length;
  7145. topUI.aiBallList.numItems = this.aiBallArr.length;
  7146. }
  7147. ballShoot() {
  7148. this.clearTime();
  7149. this.finishOneShoot = false;
  7150. xGame.common.gameUI.ui.moveNode.visible = false;
  7151. if (xGame.common.gameUI.ui.guideNode.visible) {
  7152. xGame.common.gameUI.ui.guideNode.visible = false;
  7153. }
  7154. if (this.firstShoot) {
  7155. this.firstShoot = false;
  7156. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7157. }
  7158. }
  7159. ensureCamp(number) {
  7160. this.ensureBallType = true;
  7161. this.isOpenBall = false;
  7162. if (xGame.common.gameMode != GameMode.classic)
  7163. return;
  7164. let full = [1, 2, 3, 4, 5, 6, 7];
  7165. let flower = [9, 10, 11, 12, 13, 14, 15];
  7166. let sayWords = "";
  7167. if (this.selfTurn) {
  7168. if (number <= 7) {
  7169. this.selfCamp = ballCamp.full;
  7170. this.selfBallArr = full;
  7171. this.aiCamp = ballCamp.flower;
  7172. this.aiBallArr = flower;
  7173. sayWords = cfgTable.wordsData[3].msg;
  7174. }
  7175. else {
  7176. this.selfCamp = ballCamp.flower;
  7177. this.selfBallArr = flower;
  7178. this.aiCamp = ballCamp.full;
  7179. this.aiBallArr = full;
  7180. sayWords = cfgTable.wordsData[4].msg;
  7181. }
  7182. }
  7183. else {
  7184. if (number <= 7) {
  7185. this.selfCamp = ballCamp.flower;
  7186. this.selfBallArr = flower;
  7187. this.aiCamp = ballCamp.full;
  7188. this.aiBallArr = full;
  7189. sayWords = cfgTable.wordsData[2].msg;
  7190. }
  7191. else {
  7192. this.selfCamp = ballCamp.full;
  7193. this.selfBallArr = full;
  7194. this.aiCamp = ballCamp.flower;
  7195. this.aiBallArr = flower;
  7196. sayWords = cfgTable.wordsData[1].msg;
  7197. }
  7198. }
  7199. this.updateLeftBall();
  7200. xGame.uiMgr.Show(UIMsg, sayWords);
  7201. }
  7202. updatePlaceBallState() {
  7203. let ui = xGame.common.gameUI.ui;
  7204. switch (this.placeBallData.type) {
  7205. case PlaceBallType.normal:
  7206. let normal = ui.placeNormalNode;
  7207. normal.hpTxt.text = this.curHP + "";
  7208. this.updatePlaceBallStar(normal);
  7209. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7210. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7211. break;
  7212. case PlaceBallType.challenge:
  7213. let challenge = ui.placeChallengeNode;
  7214. challenge.hpTxt.text = "Shots:" + this.curHP;
  7215. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7216. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7217. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7218. break;
  7219. default:
  7220. break;
  7221. }
  7222. }
  7223. playSubHpAni() {
  7224. let ui = xGame.common.gameUI.ui;
  7225. switch (this.placeBallData.type) {
  7226. case PlaceBallType.normal:
  7227. let normal = ui.placeNormalNode;
  7228. normal.hpTxt.visible = false;
  7229. normal.starAni.c1.selectedIndex = 1;
  7230. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7231. normal.hpTxt.visible = true;
  7232. normal.starAni.c1.selectedIndex = 0;
  7233. }));
  7234. break;
  7235. default:
  7236. break;
  7237. }
  7238. }
  7239. getEndStarNum() {
  7240. let num;
  7241. let level = xGame.common.placeBallCurLevel;
  7242. if (this.curHP == this.placeBallData.hp) {
  7243. num = 3;
  7244. }
  7245. else if (this.curHP <= 1) {
  7246. num = 1;
  7247. }
  7248. else {
  7249. num = 2;
  7250. }
  7251. if (!this.success) {
  7252. num = 0;
  7253. }
  7254. else {
  7255. DataMgr.setPlaceBallLevel(level, num);
  7256. }
  7257. let myType = cfgTable.placeballData[level].type;
  7258. if (this.success && myType == 1) {
  7259. num = 3;
  7260. }
  7261. xGame.common.placeBallStarNum = num;
  7262. }
  7263. updatePlaceBallStar(node) {
  7264. let star = 0;
  7265. if (this.curHP == this.placeBallData.hp) {
  7266. star = 3;
  7267. }
  7268. else if (this.curHP >= 2) {
  7269. star = 2;
  7270. }
  7271. else if (this.curHP == 1) {
  7272. star = 1;
  7273. }
  7274. else {
  7275. star = 0;
  7276. }
  7277. let temp;
  7278. for (let index = 1; index <= 3; index++) {
  7279. temp = node["star" + index];
  7280. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7281. }
  7282. node.myProgress.value = (star / 3) * 100;
  7283. }
  7284. openRegretView(isFoul, GoalNum, challenge = false) {
  7285. let regretType = -1;
  7286. if (isFoul) {
  7287. regretType = 1;
  7288. }
  7289. else {
  7290. if (GoalNum <= 0) {
  7291. regretType = 0;
  7292. }
  7293. }
  7294. if (challenge) {
  7295. regretType = 1;
  7296. }
  7297. if (regretType != -1) {
  7298. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7299. if (success) {
  7300. this.curHP++;
  7301. this.updatePlaceBallState();
  7302. this.setPlaceBallAllPos();
  7303. xGame.common.gameUI.ui.moveNode.visible = false;
  7304. }
  7305. else {
  7306. if (this.curHP <= 0) {
  7307. this.success = false;
  7308. this.gameEnd();
  7309. }
  7310. this.playSubHpAni();
  7311. }
  7312. this.updatePlaceBallState();
  7313. this.updatePlaceBallPos();
  7314. });
  7315. }
  7316. }
  7317. setPlaceBallAllPos() {
  7318. let allBall = xGame.common.d2World.ballArr;
  7319. let cfgArr = this.placeBallPosData;
  7320. let temp;
  7321. let obj;
  7322. for (let index = 0; index < allBall.length; index++) {
  7323. temp = allBall[index];
  7324. if (temp.destroyed)
  7325. continue;
  7326. obj = cfgArr[temp.myUNID];
  7327. if (obj && obj.src && !obj.src.destroyed) {
  7328. temp.gameObj.x = obj.posX;
  7329. temp.gameObj.y = obj.posY;
  7330. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7331. }
  7332. }
  7333. xGame.common.d2World.getHelpLine();
  7334. }
  7335. updatePlaceBallPos() {
  7336. let arr = xGame.common.d2World.ballArr;
  7337. let temp;
  7338. for (let index = 0; index < arr.length; index++) {
  7339. temp = arr[index];
  7340. if (!this.placeBallPosData[temp.myUNID]) {
  7341. this.placeBallPosData[temp.myUNID] = {
  7342. src: temp,
  7343. posX: temp.gameObj.x,
  7344. posY: temp.gameObj.y
  7345. };
  7346. }
  7347. else {
  7348. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7349. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7350. }
  7351. }
  7352. let check;
  7353. for (const key in this.placeBallPosData) {
  7354. check = this.placeBallPosData[key];
  7355. if (check.src.destroyed) {
  7356. delete this.placeBallPosData[key];
  7357. }
  7358. }
  7359. }
  7360. gameRun(type) {
  7361. if (this.gamePause)
  7362. return;
  7363. this.curFoul = this.getFoulType();
  7364. if (type) {
  7365. xGame.common.d2World.d2Gan.shoot();
  7366. xGame.common.gameUI.forceCancel();
  7367. this.curFoul = type;
  7368. }
  7369. this.isEnd = false;
  7370. this.isChangeTurn = true;
  7371. if (xGame.common.gameMode == GameMode.classic) {
  7372. this.judgeClassic(this.curFoul);
  7373. this.checkClassicWords(() => {
  7374. xGame.common.destroyClassicEmotion();
  7375. if (this.isEnd) {
  7376. if (this.isBlackInHole) {
  7377. xGame.common.gameUI.ui.blackAni.visible = true;
  7378. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7379. xGame.common.gameUI.ui.blackAni.visible = false;
  7380. this.gameEnd();
  7381. }));
  7382. }
  7383. else {
  7384. this.gameEnd();
  7385. }
  7386. }
  7387. else {
  7388. this.waitShoot();
  7389. xGame.eventMgr.event(WAIT_SHOOT);
  7390. }
  7391. });
  7392. }
  7393. else if (xGame.common.gameMode == GameMode.bigMove) {
  7394. xGame.common.aiPlayer.stopRun();
  7395. let scoreArr = this.getScore(this.curFoul);
  7396. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7397. this.isEnd = true;
  7398. }
  7399. this.checkBigSkillWords(() => {
  7400. if (this.isEnd) {
  7401. this.gameEnd();
  7402. }
  7403. else {
  7404. this.waitShoot();
  7405. xGame.eventMgr.event(WAIT_SHOOT);
  7406. }
  7407. });
  7408. }
  7409. else if (xGame.common.gameMode == GameMode.placeBall) {
  7410. xGame.common.destroyAwardSpine();
  7411. let isFoul = this.curFoul == FoulType.rootHole;
  7412. let GoalNum = this.inHoleBalls.length;
  7413. if (this.inHoleBalls.indexOf(0) > -1)
  7414. GoalNum -= 1;
  7415. if (isFoul) {
  7416. this.placeRootBall();
  7417. }
  7418. console.log("neeballs", this.needBalls);
  7419. console.log("当前完成的goalNum", GoalNum);
  7420. this.finishBalls += GoalNum;
  7421. console.log("当前完成的finishballs", this.finishBalls);
  7422. let need = this.needBalls;
  7423. if (this.placeBallData.type == PlaceBallType.challenge) {
  7424. need += 100;
  7425. }
  7426. if (this.finishBalls >= need) {
  7427. this.success = true;
  7428. this.gameEnd();
  7429. }
  7430. else {
  7431. switch (this.placeBallData.type) {
  7432. case PlaceBallType.normal:
  7433. if (!isFoul && GoalNum > 0) {
  7434. this.updatePlaceBallPos();
  7435. this.updatePlaceBallState();
  7436. }
  7437. else {
  7438. this.curHP--;
  7439. this.openRegretView(isFoul, GoalNum);
  7440. }
  7441. this.waitShoot();
  7442. xGame.eventMgr.event(WAIT_SHOOT);
  7443. break;
  7444. case PlaceBallType.challenge:
  7445. this.curHP--;
  7446. this.updatePlaceBallState();
  7447. if (isFoul) {
  7448. this.openRegretView(isFoul, GoalNum, true);
  7449. }
  7450. else {
  7451. this.updatePlaceBallPos();
  7452. if (this.curHP <= 0) {
  7453. this.success = true;
  7454. this.gameEnd();
  7455. }
  7456. }
  7457. this.waitShoot();
  7458. xGame.eventMgr.event(WAIT_SHOOT);
  7459. break;
  7460. default:
  7461. break;
  7462. }
  7463. }
  7464. }
  7465. }
  7466. checkClassicWords(callback) {
  7467. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7468. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7469. let type = this.getClassicWordsType();
  7470. if (condition && type != -1) {
  7471. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7472. xGame.soundMgr.playSound(str);
  7473. xGame.common.wordsMgr.playClassicWords(type, callback);
  7474. }
  7475. else {
  7476. Laya.timer.once(300, this, () => {
  7477. callback && callback();
  7478. });
  7479. }
  7480. }
  7481. getClassicWordsType() {
  7482. let d2world = xGame.common.d2World;
  7483. let type = -1;
  7484. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7485. type = ClassicWordsType.perfectShow;
  7486. return type;
  7487. }
  7488. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7489. type = ClassicWordsType.directShoot;
  7490. return type;
  7491. }
  7492. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7493. type = ClassicWordsType.anotherShoot;
  7494. return type;
  7495. }
  7496. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7497. type = ClassicWordsType.bigPower;
  7498. return type;
  7499. }
  7500. let minSpeed = 1;
  7501. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7502. type = ClassicWordsType.hardShoot;
  7503. return type;
  7504. }
  7505. if (this.inHoleBalls.length > 0) {
  7506. type = ClassicWordsType.directShoot;
  7507. return type;
  7508. }
  7509. return type;
  7510. }
  7511. checkBigSkillWords(callback) {
  7512. if (this.curFoul == FoulType.timeOut) {
  7513. callback && callback();
  7514. }
  7515. else {
  7516. let playSkill = false;
  7517. if (this.selfTurn) {
  7518. playSkill = true;
  7519. }
  7520. else {
  7521. if (!this.aiPlayedBreakArmy) {
  7522. this.aiPlayedBreakArmy = true;
  7523. playSkill = true;
  7524. }
  7525. if (this.aiCurSkill != SkillType.breakArmy) {
  7526. playSkill = true;
  7527. }
  7528. }
  7529. if (xGame.common.skillMgr.playedLastSkill) {
  7530. xGame.common.skillMgr.playedLastSkill = false;
  7531. playSkill = false;
  7532. }
  7533. if (playSkill) {
  7534. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7535. let selfExtra = 0;
  7536. let aiExtra = 0;
  7537. if (this.selfTurn)
  7538. selfExtra += extraScore;
  7539. else
  7540. aiExtra += extraScore;
  7541. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7542. this.isEnd = true;
  7543. }
  7544. this.playBigSkillTimes(callback);
  7545. });
  7546. }
  7547. else {
  7548. this.playBigSkillTimes(callback);
  7549. }
  7550. }
  7551. }
  7552. playBigSkillTimes(callback) {
  7553. let length = this.inHoleBalls.length;
  7554. if (this.inHoleBalls.indexOf(0) > -1) {
  7555. length = this.inHoleBalls.length - 1;
  7556. }
  7557. if (length <= 0) {
  7558. callback && callback();
  7559. return;
  7560. }
  7561. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7562. callback && callback();
  7563. });
  7564. }
  7565. playSkillTips() {
  7566. let levelNum = 0;
  7567. let curType;
  7568. if (this.selfTurn) {
  7569. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7570. curType = this.selfCurSkill;
  7571. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7572. levelNum += 5;
  7573. }
  7574. }
  7575. else {
  7576. levelNum = this.aiSkillLevelNum;
  7577. curType = this.aiCurSkill;
  7578. }
  7579. let str = ``;
  7580. switch (curType) {
  7581. case SkillType.highSpace:
  7582. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7583. break;
  7584. case SkillType.breakArmy:
  7585. str = `You pocketed ${levelNum} extra balls`;
  7586. break;
  7587. case SkillType.ice:
  7588. str = `${levelNum * 2} extra balls were frozen`;
  7589. break;
  7590. case SkillType.fireworks:
  7591. str = `${levelNum} extra balls exploded `;
  7592. break;
  7593. case SkillType.GuanYu:
  7594. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  7595. break;
  7596. default:
  7597. break;
  7598. }
  7599. xGame.uiMgr.Show(UIMsg, str);
  7600. }
  7601. getFoulType() {
  7602. let foulType = "";
  7603. if (this.firstColliObj == null) {
  7604. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7605. return FoulType.rootHole;
  7606. }
  7607. return FoulType.notTouch;
  7608. }
  7609. else {
  7610. if (this.selfTurn) {
  7611. if (this.selfBallArr.length > 0) {
  7612. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7613. foulType = FoulType.wrongTouch;
  7614. }
  7615. }
  7616. else {
  7617. if (this.ensureBallType) {
  7618. }
  7619. else {
  7620. if (this.firstColliObj == this.blackNum) {
  7621. foulType = FoulType.wrongTouch;
  7622. }
  7623. }
  7624. }
  7625. }
  7626. else {
  7627. if (this.aiBallArr.length > 0) {
  7628. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7629. foulType = FoulType.wrongTouch;
  7630. }
  7631. }
  7632. else {
  7633. if (this.ensureBallType) {
  7634. }
  7635. else {
  7636. if (this.firstColliObj == this.blackNum) {
  7637. foulType = FoulType.wrongTouch;
  7638. }
  7639. }
  7640. }
  7641. }
  7642. if (this.inHoleBalls.length <= 0) {
  7643. return foulType;
  7644. }
  7645. let temp;
  7646. if (this.inHoleBalls.indexOf(0) > -1) {
  7647. foulType = FoulType.rootHole;
  7648. }
  7649. else {
  7650. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7651. temp = this.inHoleBalls[index];
  7652. if (this.selfTurn) {
  7653. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7654. foulType = FoulType.wrongHole;
  7655. break;
  7656. }
  7657. }
  7658. else {
  7659. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7660. foulType = FoulType.wrongHole;
  7661. break;
  7662. }
  7663. }
  7664. }
  7665. }
  7666. let foo;
  7667. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7668. temp = this.inHoleBalls[index];
  7669. foo = this.selfBallArr.indexOf(temp);
  7670. if (foo > -1) {
  7671. this.selfBallArr.splice(foo, 1);
  7672. }
  7673. foo = this.aiBallArr.indexOf(temp);
  7674. if (foo > -1) {
  7675. this.aiBallArr.splice(foo, 1);
  7676. }
  7677. }
  7678. this.updateLeftBall();
  7679. }
  7680. return foulType;
  7681. }
  7682. judgeGameEndByBlack(arr) {
  7683. if (this.selfTurn) {
  7684. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7685. this.selfFoulNum = this.maxFoulTimes;
  7686. return true;
  7687. }
  7688. }
  7689. else {
  7690. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7691. this.aiFoulNum = this.maxFoulTimes;
  7692. return true;
  7693. }
  7694. }
  7695. }
  7696. judgeClassic(type) {
  7697. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7698. xGame.common.aiPlayer.stopRun();
  7699. if (this.judgeNormalSuccess()) {
  7700. this.isEnd = true;
  7701. return;
  7702. }
  7703. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7704. if (this.selfTurn) {
  7705. if (isFoul) {
  7706. this.selfFoulNum++;
  7707. }
  7708. if (this.selfFoulNum >= this.maxFoulTimes) {
  7709. this.success = false;
  7710. this.isEnd = true;
  7711. return;
  7712. }
  7713. }
  7714. else {
  7715. if (isFoul)
  7716. this.aiFoulNum++;
  7717. if (this.aiFoulNum >= this.maxFoulTimes) {
  7718. this.success = true;
  7719. this.isEnd = true;
  7720. return;
  7721. }
  7722. }
  7723. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7724. this.isChangeTurn = false;
  7725. }
  7726. else {
  7727. this.isInterrupt = true;
  7728. }
  7729. }
  7730. waitShoot() {
  7731. if (xGame.common.gameMode == GameMode.classic) {
  7732. switch (this.curFoul) {
  7733. case FoulType.timeOut:
  7734. case FoulType.rootHole:
  7735. this.selfTurn = !this.selfTurn;
  7736. this.peoplePlay(5, 6, true);
  7737. break;
  7738. case FoulType.notTouch:
  7739. this.selfTurn = !this.selfTurn;
  7740. this.peoplePlay(7, 7);
  7741. break;
  7742. case FoulType.wrongHole:
  7743. this.selfTurn = !this.selfTurn;
  7744. this.peoplePlay(11, 11);
  7745. break;
  7746. default:
  7747. if (this.inHoleBalls.length > 0) {
  7748. this.peoplePlay(0, 0, false, false);
  7749. }
  7750. else {
  7751. this.selfTurn = !this.selfTurn;
  7752. this.peoplePlay(7, 7);
  7753. }
  7754. break;
  7755. }
  7756. }
  7757. else if (xGame.common.gameMode == GameMode.bigMove) {
  7758. if (this.curFoul == FoulType.timeOut) {
  7759. this.selfTurn = !this.selfTurn;
  7760. this.peoplePlay(14, 15);
  7761. this.placeRootBall();
  7762. }
  7763. else {
  7764. this.selfTurn = !this.selfTurn;
  7765. if (this.curFoul == FoulType.rootHole) {
  7766. this.peoplePlay(12, 13);
  7767. this.placeRootBall();
  7768. }
  7769. else {
  7770. this.peoplePlay(0, 0, false, false);
  7771. }
  7772. }
  7773. }
  7774. else if (xGame.common.gameMode == GameMode.placeBall) {
  7775. this.finishOneShoot = true;
  7776. }
  7777. this.gameResult();
  7778. }
  7779. gameResult() {
  7780. this.firstColliObj = null;
  7781. this.inHoleBalls = [];
  7782. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7783. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7784. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7785. if (xGame.common.uiRodMethod)
  7786. xGame.common.uiRodMethod.resetRod();
  7787. xGame.common.d2World.rootBall.showSelf();
  7788. this.clearIceSkill();
  7789. if (this.selfTurn) {
  7790. console.log("gameResult");
  7791. PlatMgr.gameInsert();
  7792. }
  7793. xGame.common.d3World.knifeRoot.destroyChildren();
  7794. if (this.selfTurn) {
  7795. xGame.common.gameUI.showHelpLineGuide();
  7796. xGame.common.gameUI.setTurnAlpha(true);
  7797. }
  7798. else {
  7799. xGame.common.gameUI.setTurnAlpha(false);
  7800. }
  7801. }
  7802. getScore(type) {
  7803. let selfAdd = 0;
  7804. let aiAdd = 0;
  7805. if (type == FoulType.timeOut) {
  7806. if (this.selfTurn)
  7807. aiAdd += 3;
  7808. else
  7809. selfAdd += 3;
  7810. }
  7811. else {
  7812. if (this.inHoleBalls.length > 0) {
  7813. if (this.selfTurn) {
  7814. if (type == FoulType.rootHole) {
  7815. aiAdd += 3;
  7816. if (this.inHoleBalls.length - 1 > 0) {
  7817. selfAdd += this.inHoleBalls.length - 1;
  7818. }
  7819. }
  7820. else {
  7821. selfAdd += this.inHoleBalls.length;
  7822. }
  7823. }
  7824. else {
  7825. if (type == FoulType.rootHole) {
  7826. selfAdd += 3;
  7827. if (this.inHoleBalls.length - 1 > 0) {
  7828. aiAdd += this.inHoleBalls.length - 1;
  7829. }
  7830. }
  7831. else {
  7832. aiAdd += this.inHoleBalls.length;
  7833. }
  7834. }
  7835. }
  7836. }
  7837. return [selfAdd, aiAdd];
  7838. }
  7839. judgeScoreEnd(selfAdd, aiAdd) {
  7840. this.selfScore += selfAdd;
  7841. this.aiScore += aiAdd;
  7842. this.updateAIScore();
  7843. this.updateSelfScore();
  7844. if (this.selfScore >= this.targertScore) {
  7845. this.success = true;
  7846. return true;
  7847. }
  7848. if (this.aiScore >= this.targertScore) {
  7849. this.success = false;
  7850. return true;
  7851. }
  7852. let ballArr = xGame.common.d2World.ballArr;
  7853. if (ballArr.length == 1 && ballArr[0].number == 0) {
  7854. if (this.selfScore > this.aiScore) {
  7855. this.success = true;
  7856. return true;
  7857. }
  7858. else if (this.selfScore < this.aiScore) {
  7859. this.success = false;
  7860. return true;
  7861. }
  7862. else {
  7863. if (this.selfTurn) {
  7864. this.success = false;
  7865. }
  7866. else {
  7867. this.success = true;
  7868. }
  7869. return true;
  7870. }
  7871. }
  7872. }
  7873. clearIceSkill() {
  7874. let arr = xGame.common.d2World.ballArr;
  7875. let temp;
  7876. if (this.selfTurn) {
  7877. if (this.selfCurSkill == SkillType.ice) {
  7878. for (let index = 0; index < arr.length; index++) {
  7879. temp = arr[index];
  7880. if (temp.ballFunc == "ice") {
  7881. temp.setBallFunc("normal", "self");
  7882. }
  7883. }
  7884. }
  7885. }
  7886. else {
  7887. if (this.aiCurSkill == SkillType.ice) {
  7888. for (let index = 0; index < arr.length; index++) {
  7889. temp = arr[index];
  7890. if (temp.ballFunc == "ice") {
  7891. temp.setBallFunc("normal", "ai");
  7892. }
  7893. }
  7894. }
  7895. }
  7896. }
  7897. judgeNormalSuccess() {
  7898. if (this.selfTurn) {
  7899. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7900. this.success = true;
  7901. return true;
  7902. }
  7903. }
  7904. else {
  7905. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7906. this.success = false;
  7907. return true;
  7908. }
  7909. }
  7910. }
  7911. gameEnd() {
  7912. if (Moyu.isTT) {
  7913. xGame.common.screenImg = getScreenImg();
  7914. }
  7915. console.log("游戏结束", this.success);
  7916. xGame.common.aiPlayer.stopRun();
  7917. if (xGame.common.gameMode == GameMode.placeBall) {
  7918. this.getEndStarNum();
  7919. this.updatePlaceBallState();
  7920. }
  7921. this.isEnter = false;
  7922. Moyu.recordEnd(this, () => {
  7923. if (this.isEnter)
  7924. return;
  7925. this.isEnter = true;
  7926. console.log("进入录结束回调");
  7927. this.enterNext();
  7928. });
  7929. Laya.timer.once(1000, this, () => {
  7930. if (this.isEnter)
  7931. return;
  7932. this.isEnter = true;
  7933. this.enterNext();
  7934. });
  7935. xGame.common.longHelpLine = false;
  7936. }
  7937. enterNext() {
  7938. Laya.timer.clearAll(this);
  7939. if (Moyu.canShare() > 100 || Moyu.isKs) {
  7940. xGame.uiMgr.Show(UIVideoShare, this.success);
  7941. }
  7942. else {
  7943. xGame.uiMgr.Show(UIGameEnd, this.success);
  7944. }
  7945. }
  7946. aiLeave() {
  7947. let ui = xGame.common.gameUI.ui;
  7948. ui.topNode.aiNameTxt.text = "offline";
  7949. }
  7950. aiGameEnd(suc) {
  7951. this.success = suc;
  7952. xGame.common.aiPlayer.stopRun();
  7953. if (this.success) {
  7954. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  7955. Laya.timer.once(1000, this, () => {
  7956. this.clearTime();
  7957. this.gameEnd();
  7958. });
  7959. }
  7960. }
  7961. openTimer() {
  7962. let src = xGame.common.gameUI;
  7963. if (this.selfTurn) {
  7964. src.ui.topNode.selfProgress.visible = true;
  7965. src.ui.topNode.aiProgress.visible = false;
  7966. this.curTimer = src.ui.topNode.selfProgress;
  7967. }
  7968. else {
  7969. src.ui.topNode.selfProgress.visible = false;
  7970. src.ui.topNode.aiProgress.visible = true;
  7971. this.curTimer = src.ui.topNode.aiProgress;
  7972. }
  7973. this.accTime = 0;
  7974. Laya.timer.clearAll(this);
  7975. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  7976. this.curTimer.value = 100;
  7977. }
  7978. updateTime(dt) {
  7979. if (this.gamePause)
  7980. return;
  7981. this.accTime += dt;
  7982. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  7983. if (this.accTime >= this.setTime) {
  7984. this.clearTime();
  7985. console.log("时钟进入了gameRun");
  7986. this.gameRun(FoulType.timeOut);
  7987. }
  7988. }
  7989. clearTime() {
  7990. let src = xGame.common.gameUI;
  7991. src.ui.topNode.selfProgress.visible = false;
  7992. src.ui.topNode.aiProgress.visible = false;
  7993. Laya.timer.clearAll(this);
  7994. }
  7995. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  7996. let ui = xGame.common.gameUI.ui;
  7997. let selfMsg, aiMsg;
  7998. if (sayWords) {
  7999. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8000. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8001. if (Foul) {
  8002. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8003. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8004. this.placeRootBall();
  8005. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8006. if (this.curFoul == FoulType.rootHole) {
  8007. if (!DataMgr.getRootBallFoul()) {
  8008. DataMgr.setRootBallFoul();
  8009. aiMsg = "";
  8010. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8011. let woman = "Boss, pay attention next time~";
  8012. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8013. }
  8014. }
  8015. else if (this.curFoul == FoulType.timeOut) {
  8016. if (!DataMgr.getTimeoutFoul()) {
  8017. DataMgr.setTimeoutFoul();
  8018. aiMsg = "";
  8019. let tips = "Game timeout, 3 fouls, this game failed.";
  8020. let woman = "Boss, pay attention to the timeline~";
  8021. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8022. }
  8023. }
  8024. }
  8025. }
  8026. }
  8027. if (this.selfTurn) {
  8028. if (sayWords) {
  8029. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8030. ui.selfTurn.visible = true;
  8031. ui.aiTurn.visible = false;
  8032. ui.selfTurn.t0.play();
  8033. Moyu.vibration();
  8034. });
  8035. }
  8036. }
  8037. else {
  8038. let aiNum = xGame.tools.random(1, 11);
  8039. let challengeNum = DataMgr.getChallengeTimes();
  8040. let delay = false;
  8041. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8042. aiNum = 9;
  8043. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8044. aiNum = 3;
  8045. if (challengeNum == 3) {
  8046. if (!this.showLongView) {
  8047. this.showLongView = true;
  8048. delay = true;
  8049. }
  8050. }
  8051. }
  8052. }
  8053. if (delay) {
  8054. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8055. if (success) {
  8056. xGame.common.longHelpLine = true;
  8057. xGame.common.d2World.getHelpLine();
  8058. }
  8059. else {
  8060. aiNum = 10;
  8061. }
  8062. xGame.common.aiPlayer.setAiLevel(aiNum);
  8063. if (sayWords) {
  8064. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8065. xGame.common.aiPlayer.runAI();
  8066. ui.selfTurn.visible = false;
  8067. ui.aiTurn.visible = true;
  8068. ui.aiTurn.t0.play();
  8069. });
  8070. }
  8071. else {
  8072. xGame.common.aiPlayer.runAI();
  8073. }
  8074. this.openTimer();
  8075. this.finishOneShoot = true;
  8076. if (this.selfTurn) {
  8077. ui.topNode.selfKuang.visible = true;
  8078. ui.topNode.aiKuang.visible = false;
  8079. ui.topNode.selfTips.visible = true;
  8080. ui.topNode.aiTips.visible = false;
  8081. }
  8082. else {
  8083. ui.topNode.selfKuang.visible = false;
  8084. ui.topNode.aiKuang.visible = true;
  8085. ui.topNode.selfTips.visible = false;
  8086. ui.topNode.aiTips.visible = true;
  8087. }
  8088. });
  8089. return;
  8090. }
  8091. if (xGame.common.gameMode == GameMode.classic) {
  8092. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8093. if (cfg) {
  8094. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8095. aiNum = aiLevel;
  8096. }
  8097. }
  8098. xGame.common.aiPlayer.setAiLevel(aiNum);
  8099. if (sayWords) {
  8100. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8101. xGame.common.aiPlayer.runAI();
  8102. ui.selfTurn.visible = false;
  8103. ui.aiTurn.visible = true;
  8104. ui.aiTurn.t0.play();
  8105. });
  8106. }
  8107. else {
  8108. xGame.common.aiPlayer.runAI();
  8109. }
  8110. }
  8111. this.openTimer();
  8112. this.finishOneShoot = true;
  8113. if (this.selfTurn) {
  8114. ui.topNode.selfKuang.visible = true;
  8115. ui.topNode.aiKuang.visible = false;
  8116. ui.topNode.selfTips.visible = true;
  8117. ui.topNode.aiTips.visible = false;
  8118. }
  8119. else {
  8120. ui.topNode.selfKuang.visible = false;
  8121. ui.topNode.aiKuang.visible = true;
  8122. ui.topNode.selfTips.visible = false;
  8123. ui.topNode.aiTips.visible = true;
  8124. }
  8125. }
  8126. placeRootBall() {
  8127. let rootBall = xGame.common.d2World.rootBall;
  8128. if (!rootBall)
  8129. return;
  8130. rootBall.gameObj.x = this.lastRootBallPos.x;
  8131. rootBall.gameObj.y = this.lastRootBallPos.y;
  8132. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8133. let moveNode = xGame.common.gameUI.ui.moveNode;
  8134. moveNode.visible = true;
  8135. moveNode.x = this.lastRootBallPos.x;
  8136. moveNode.y = this.lastRootBallPos.y;
  8137. if (!this.selfTurn) {
  8138. xGame.common.aiPlayer.resetRoot();
  8139. }
  8140. }
  8141. }
  8142. class ui_guanyuAni extends fgui.GComponent {
  8143. static createInstance() {
  8144. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8145. }
  8146. onConstruct() {
  8147. this.n0 = (this.getChild("n0"));
  8148. }
  8149. }
  8150. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8151. class UIFireworks extends UIBase {
  8152. constructor() {
  8153. super();
  8154. }
  8155. onConstructor() {
  8156. this.isEject = false;
  8157. }
  8158. show(callback) {
  8159. super.show();
  8160. }
  8161. }
  8162. UIFireworks.uiName = "UIFireworks";
  8163. class ui_UIGuanYu extends fgui.GComponent {
  8164. static createInstance() {
  8165. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8166. }
  8167. onConstruct() {
  8168. this.n2 = (this.getChild("n2"));
  8169. this.n1 = (this.getChild("n1"));
  8170. this.n3 = (this.getChild("n3"));
  8171. this.n4 = (this.getChild("n4"));
  8172. this.n5 = (this.getChild("n5"));
  8173. this.n6 = (this.getChild("n6"));
  8174. this.n8 = (this.getChild("n8"));
  8175. this.n7 = (this.getChild("n7"));
  8176. this.t0 = this.getTransition("t0");
  8177. }
  8178. }
  8179. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8180. class UIGuanYu extends UIBase {
  8181. constructor() {
  8182. super();
  8183. }
  8184. onConstructor() {
  8185. this.ui = ui_UIGuanYu.createInstance();
  8186. this.contentPane = this.ui;
  8187. this.isEject = false;
  8188. }
  8189. show(callback) {
  8190. super.show();
  8191. this.ui.t0.play(Laya.Handler.create(this, () => {
  8192. callback && callback();
  8193. this.hide();
  8194. }));
  8195. }
  8196. }
  8197. UIGuanYu.uiName = "UIGuanYu";
  8198. class SkillMgr {
  8199. constructor() {
  8200. this.leveNum = 0;
  8201. this.extraScore = 0;
  8202. this.selfTurn = false;
  8203. this.playedLastSkill = false;
  8204. this.tweenArr = [];
  8205. this._finishNum = 0;
  8206. this._curFinish = 0;
  8207. this._rootX = 0;
  8208. this._rootY = 0;
  8209. this.knifeTimes = 0;
  8210. this.knifeV2 = new Laya.Vector2();
  8211. this.knifeV3 = new Laya.Vector3();
  8212. this.rtStarX = 0;
  8213. this.rtStarY = 0;
  8214. this.addBigSkillSpine();
  8215. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8216. }
  8217. addBigSkillSpine() {
  8218. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8219. console.log("extra2 success");
  8220. });
  8221. }
  8222. runBigSkill(callback) {
  8223. this.tweenArr = [];
  8224. this.callback = callback;
  8225. this.judgeSkill();
  8226. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8227. let guide = DataMgr.getSkillGuide();
  8228. if (!xGame.common.gameMgr.selfTurn) {
  8229. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8230. }
  8231. else {
  8232. if (xGame.common.temSelfLevel != 0) {
  8233. this.leveNum = xGame.common.temSelfLevel;
  8234. }
  8235. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8236. this.leveNum += 5;
  8237. }
  8238. }
  8239. if (guide == 0) {
  8240. DataMgr.setSkillGuide(1);
  8241. if (DataMgr.getNewUser()) {
  8242. Moyu.sendDataEvent("gameFirstPlay");
  8243. DataMgr.setNewUser();
  8244. }
  8245. }
  8246. this.playSpineAni(() => {
  8247. switch (this.curSkill) {
  8248. case SkillType.highSpace:
  8249. this.runHighSpace();
  8250. break;
  8251. case SkillType.breakArmy:
  8252. this.runBreakArmy();
  8253. break;
  8254. case SkillType.ice:
  8255. this.runIce();
  8256. break;
  8257. case SkillType.fireworks:
  8258. this.runFireworks();
  8259. break;
  8260. case SkillType.GuanYu:
  8261. this.runGuanYu();
  8262. break;
  8263. default:
  8264. break;
  8265. }
  8266. });
  8267. }
  8268. judgeSkill() {
  8269. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8270. let gameMgr = xGame.common.gameMgr;
  8271. let type;
  8272. for (let index = 0; index < typeArr.length; index++) {
  8273. type = typeArr[index];
  8274. if (gameMgr.selfTurn) {
  8275. if (gameMgr.selfCurSkill == type) {
  8276. this.selfTurn = true;
  8277. this.curSkill = type;
  8278. return;
  8279. }
  8280. }
  8281. else {
  8282. if (gameMgr.aiCurSkill == type) {
  8283. this.selfTurn = false;
  8284. this.curSkill = type;
  8285. return;
  8286. }
  8287. }
  8288. }
  8289. }
  8290. playSpineAni(callback) {
  8291. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8292. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8293. parent.destroyChildren();
  8294. let aniIndex = 0;
  8295. let skillSpine;
  8296. switch (this.curSkill) {
  8297. case SkillType.highSpace:
  8298. aniIndex = 1;
  8299. xGame.soundMgr.playSound("skill01");
  8300. skillSpine = this.skillSpine2;
  8301. data.scaleX = 0.5;
  8302. data.scaleY = 0.5;
  8303. skillSpine.play(data, 1, false, parent, () => {
  8304. callback && callback();
  8305. });
  8306. break;
  8307. case SkillType.breakArmy:
  8308. aniIndex = 2;
  8309. xGame.soundMgr.playSound("skill02");
  8310. skillSpine = this.skillSpine2;
  8311. data.scaleX = 0.5;
  8312. data.scaleY = 0.5;
  8313. skillSpine.play(data, 2, false, parent, () => {
  8314. callback && callback();
  8315. });
  8316. break;
  8317. case SkillType.ice:
  8318. aniIndex = 0;
  8319. xGame.soundMgr.playSound("skill03");
  8320. skillSpine = this.skillSpine2;
  8321. data.scaleX = 0.5;
  8322. data.scaleY = 0.5;
  8323. skillSpine.play(data, 0, false, parent, () => {
  8324. callback && callback();
  8325. });
  8326. break;
  8327. case SkillType.fireworks:
  8328. xGame.soundMgr.playSound("skill_04_01");
  8329. xGame.soundMgr.playSound("skill04");
  8330. xGame.uiMgr.Show(UIFireworks, callback);
  8331. break;
  8332. case SkillType.GuanYu:
  8333. xGame.soundMgr.playSound("skill05_1");
  8334. xGame.soundMgr.playSound("skill05");
  8335. xGame.uiMgr.Show(UIGuanYu, callback);
  8336. break;
  8337. default:
  8338. break;
  8339. }
  8340. }
  8341. getAllBallArr() {
  8342. let arr = xGame.common.d2World.ballArr;
  8343. let outArr = [];
  8344. for (let index = 0; index < arr.length; index++) {
  8345. if (arr[index] instanceof D2RootBallSrc)
  8346. continue;
  8347. if (arr[index].ballFunc == "ice")
  8348. continue;
  8349. if (arr[index].destroyed)
  8350. continue;
  8351. outArr.push(arr[index]);
  8352. }
  8353. return outArr;
  8354. }
  8355. getOneArr(deletObj) {
  8356. let allArr = this.getAllBallArr();
  8357. let temp;
  8358. for (let index = 0; index < allArr.length; index++) {
  8359. temp = allArr[index];
  8360. if (temp.id == deletObj.id) {
  8361. allArr.splice(index, 1);
  8362. break;
  8363. }
  8364. }
  8365. return allArr;
  8366. }
  8367. getNearBallBag(ball) {
  8368. let ui = xGame.common.gameUI.ui;
  8369. let circleArr = [];
  8370. for (let index = 1; index <= 6; index++) {
  8371. circleArr.push(ui.border["circle" + index]);
  8372. }
  8373. let outIndex = 0;
  8374. let temp;
  8375. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8376. ;
  8377. let dis = 0;
  8378. for (let index = 1; index < circleArr.length; index++) {
  8379. temp = circleArr[index];
  8380. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8381. if (dis < min) {
  8382. min = dis;
  8383. outIndex = index;
  8384. }
  8385. }
  8386. return [circleArr[outIndex], outIndex];
  8387. }
  8388. ballFlyToBag(ballArr, time = 300) {
  8389. let temp;
  8390. let hole;
  8391. this._finishNum = ballArr.length;
  8392. this._curFinish = 0;
  8393. let holeObj = {};
  8394. let holeCfg = {
  8395. "1": 0,
  8396. "2": 0,
  8397. "3": 0,
  8398. "4": 0,
  8399. "5": 0,
  8400. "6": 0
  8401. };
  8402. for (let index = 0; index < ballArr.length; index++) {
  8403. temp = ballArr[index];
  8404. temp.outColli.isSensor = true;
  8405. temp.innerColli.isSensor = true;
  8406. temp.isRunSkillAni = true;
  8407. let holeArr = this.getNearBallBag(temp);
  8408. hole = holeArr[0];
  8409. holeObj[index] = holeArr[1];
  8410. temp.d3BallSrc.scaleXYZ = 0.5;
  8411. this.tweenArr.push(temp.d3BallSrc, temp);
  8412. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8413. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8414. }));
  8415. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8416. let mIndex = holeObj[this._curFinish];
  8417. let isDone = holeCfg[mIndex];
  8418. if (isDone) {
  8419. ballArr[this._curFinish].checkWrongBall(false);
  8420. }
  8421. else {
  8422. holeCfg[mIndex] = 1;
  8423. ballArr[this._curFinish].checkWrongBall();
  8424. }
  8425. this._curFinish++;
  8426. if (this._curFinish >= this._finishNum) {
  8427. if (this.curSkill == SkillType.highSpace) {
  8428. }
  8429. else if (this.curSkill == SkillType.breakArmy) {
  8430. let rootBall = xGame.common.d2World.rootBall;
  8431. rootBall.gameObj.x = this._rootX;
  8432. rootBall.gameObj.y = this._rootY;
  8433. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8434. xGame.common.d2World.d2Gan.ui.visible = true;
  8435. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8436. xGame.common.d2World.getHelpLine();
  8437. this.callback && this.callback(this.extraScore);
  8438. }
  8439. }
  8440. }));
  8441. }
  8442. }
  8443. runHighSpace() {
  8444. let rootBall = xGame.common.d2World.rootBall;
  8445. rootBall.showSelf();
  8446. let d3Src = rootBall.d3BallSrc;
  8447. let allArr = this.getAllBallArr();
  8448. if (allArr.length <= 0) {
  8449. this.callback && this.callback(0);
  8450. return;
  8451. }
  8452. let selectBall = xGame.common.d2World.targetBall;
  8453. let wrong = selectBall && selectBall.destroyed;
  8454. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8455. selectBall = xGame.common.getRandArrEle(allArr);
  8456. }
  8457. let targetD3Src = selectBall.d3BallSrc;
  8458. xGame.common.d2World.d2Gan.ui.visible = false;
  8459. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8460. d3Src.scaleXYZ = 0.5;
  8461. this.tweenArr.push(d3Src);
  8462. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8463. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8464. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8465. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8466. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8467. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8468. let outArr = [selectBall];
  8469. let other = this.leveNum - 1;
  8470. if (other > 0) {
  8471. let nearArr = this.getOneArr(selectBall);
  8472. if (nearArr.length > 0) {
  8473. xGame.common.botherArr(nearArr);
  8474. if (other >= nearArr.length)
  8475. other = nearArr.length;
  8476. for (let index = 0; index < other; index++) {
  8477. outArr.push(nearArr[index]);
  8478. }
  8479. }
  8480. }
  8481. xGame.common.extraMoveNum = other + 1;
  8482. this.extraScore = other + 1;
  8483. this._rootX = selectBall.gameObj.x;
  8484. this._rootY = selectBall.gameObj.y;
  8485. rootBall.gameObj.x = this._rootX;
  8486. rootBall.gameObj.y = this._rootY;
  8487. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8488. Laya.Tween.clearAll(d3Src);
  8489. this.addRandomForce(outArr);
  8490. }));
  8491. }));
  8492. }
  8493. addRandomForce(outArr) {
  8494. if (outArr.length > 0) {
  8495. xGame.common.d2World.openCheckStill = true;
  8496. this.playedLastSkill = true;
  8497. }
  8498. let temp;
  8499. for (let index = 0; index < outArr.length; index++) {
  8500. let angle = xGame.common.randomNum(0, 360);
  8501. let linearPercent = xGame.common.randomNum(65, 100);
  8502. temp = outArr[index];
  8503. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8504. }
  8505. }
  8506. setLinearSpeed(angle, rigy, linearPercent) {
  8507. let sin = Math.sin(angle * Math.PI / 180);
  8508. let cos = Math.cos(angle * Math.PI / 180);
  8509. let maxSpeed = 4;
  8510. let speed = new Laya.Vector2();
  8511. speed.x = maxSpeed * linearPercent * sin;
  8512. speed.y = -maxSpeed * linearPercent * cos;
  8513. rigy.applyLinearImpulseToCenter(speed);
  8514. }
  8515. runBreakArmy() {
  8516. xGame.common.d2World.d2Gan.ui.visible = false;
  8517. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8518. let gameUI = xGame.common.gameUI.ui;
  8519. gameUI.skillRod.visible = true;
  8520. gameUI.skillRod.rotation = 110;
  8521. let outArr = this.getAllBallArr();
  8522. if (outArr.length <= 0) {
  8523. gameUI.skillRod.visible = false;
  8524. this.callback && this.callback(0);
  8525. return;
  8526. }
  8527. xGame.common.botherArr(outArr);
  8528. if (this.leveNum >= outArr.length)
  8529. this.leveNum = outArr.length;
  8530. let deleteNum = outArr.length - this.leveNum;
  8531. outArr.splice(0, deleteNum);
  8532. this.extraScore = this.leveNum;
  8533. let potX = gameUI.skillRod.x;
  8534. let potY = gameUI.skillRod.y;
  8535. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8536. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8537. let disArr = [];
  8538. for (let index = 0; index < outArr.length; index++) {
  8539. let obj = outArr[index];
  8540. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8541. dis = Math.pow(dis, 0.5);
  8542. disArr.push(dis);
  8543. }
  8544. this.tweenArr.push(gameUI.skillRod);
  8545. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8546. })).update = Laya.Handler.create(this, (e, t, c) => {
  8547. let angle = gameUI.skillRod.rotation;
  8548. let xx;
  8549. let yy;
  8550. let temp;
  8551. for (let index = 0; index < outArr.length; index++) {
  8552. temp = outArr[index];
  8553. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8554. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8555. yy -= 20;
  8556. temp.gameObj.x = xx;
  8557. temp.gameObj.y = yy;
  8558. temp.d3BallSrc.setTransPos(xx, yy);
  8559. }
  8560. if (angle <= 60) {
  8561. Laya.Tween.clearAll(gameUI.skillRod);
  8562. this.ballFlyToBag(outArr, 150);
  8563. gameUI.skillRod.visible = false;
  8564. }
  8565. }, null, false);
  8566. }
  8567. runIce() {
  8568. let ballArr = xGame.common.d2World.ballArr;
  8569. this.leveNum *= 2;
  8570. if (this.leveNum >= ballArr.length - 1)
  8571. this.leveNum = ballArr.length - 1;
  8572. let tempArr = [];
  8573. let outArr = [];
  8574. for (let index = 0; index < ballArr.length; index++) {
  8575. if (ballArr[index] instanceof D2RootBallSrc)
  8576. continue;
  8577. tempArr.push(ballArr[index]);
  8578. }
  8579. if (tempArr.length <= 0) {
  8580. this.callback && this.callback(0);
  8581. return;
  8582. }
  8583. xGame.common.botherArr(tempArr);
  8584. for (let index = 0; index < this.leveNum; index++) {
  8585. outArr.push(tempArr[index]);
  8586. }
  8587. this.extraScore = this.leveNum;
  8588. let temp;
  8589. for (let index = 0; index < outArr.length; index++) {
  8590. temp = outArr[index];
  8591. temp.d3BallSrc.playIceEft();
  8592. }
  8593. Laya.timer.once(2000, this, () => {
  8594. for (let index = 0; index < outArr.length; index++) {
  8595. temp = outArr[index];
  8596. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8597. temp.setBallFunc("ice", str);
  8598. }
  8599. this.callback && this.callback(0);
  8600. });
  8601. }
  8602. runFireworks() {
  8603. let allArr = this.getAllBallArr();
  8604. if (allArr.length <= 0) {
  8605. this.callback && this.callback(0);
  8606. return;
  8607. }
  8608. xGame.common.d2World.d2Gan.ui.visible = false;
  8609. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8610. let outArr = [];
  8611. let other = this.leveNum;
  8612. if (other > 0) {
  8613. if (allArr.length > 0) {
  8614. xGame.common.botherArr(allArr);
  8615. if (other >= allArr.length)
  8616. other = allArr.length;
  8617. for (let index = 0; index < other; index++) {
  8618. outArr.push(allArr[index]);
  8619. }
  8620. }
  8621. }
  8622. xGame.common.extraMoveNum = other;
  8623. this.extraScore = other;
  8624. this.addRandmomFireworks(outArr);
  8625. }
  8626. addRandmomFireworks(outArr) {
  8627. Laya.timer.once(1100, this, () => {
  8628. if (outArr.length > 0) {
  8629. xGame.common.d2World.openCheckStill = true;
  8630. this.playedLastSkill = true;
  8631. }
  8632. });
  8633. xGame.soundMgr.playSound("skill_04_02");
  8634. let temp;
  8635. let delay = -200;
  8636. for (let index = 0; index < outArr.length; index++) {
  8637. temp = outArr[index];
  8638. delay += 200;
  8639. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8640. let angle = xGame.common.randomNum(0, 360);
  8641. angle = this.getFireworksAngle(obj);
  8642. let linearPercent = xGame.common.randomNum(45, 80);
  8643. if (!obj.destroyed)
  8644. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8645. });
  8646. }
  8647. }
  8648. getFireworksAngle(obj) {
  8649. let rootBall = xGame.common.d2World.rootBall;
  8650. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8651. }
  8652. resetGame() {
  8653. Laya.timer.clearAll(this);
  8654. if (this.tweenArr) {
  8655. for (let index = 0; index < this.tweenArr.length; index++) {
  8656. Laya.Tween.clearAll(this.tweenArr[index]);
  8657. }
  8658. }
  8659. this.tweenArr = null;
  8660. }
  8661. runGuanYu() {
  8662. xGame.common.d2World.d2Gan.ui.visible = false;
  8663. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8664. let rootBall = xGame.common.d2World.rootBall;
  8665. if (rootBall.isInHole) {
  8666. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8667. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8668. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8669. rootBall.showSelf();
  8670. }
  8671. this.rtStarX = rootBall.gameObj.x;
  8672. this.rtStarY = rootBall.gameObj.y;
  8673. this.knifeTimes = 0;
  8674. this.playedLastSkill = true;
  8675. rootBall.forceRun = true;
  8676. rootBall.rigy.type = "static";
  8677. xGame.common.d2World.openCheckStill = true;
  8678. this.guanyuRandomKnife();
  8679. }
  8680. guanyuRandomKnife() {
  8681. let rootBall = xGame.common.d2World.rootBall;
  8682. let dir = this.getRandDir();
  8683. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8684. console.log("当前angle", angle);
  8685. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8686. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8687. let dis = 324;
  8688. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8689. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8690. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8691. this.rtStarX = rootBall.gameObj.x;
  8692. this.rtStarY = rootBall.gameObj.y;
  8693. this.knifeTimes++;
  8694. let skillLevel;
  8695. if (xGame.common.gameMgr.selfTurn) {
  8696. skillLevel = DataMgr.getBigSkillByIndex(4);
  8697. }
  8698. else {
  8699. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8700. }
  8701. if (!skillLevel)
  8702. skillLevel = 1;
  8703. skillLevel += 2;
  8704. if (this.knifeTimes < skillLevel) {
  8705. Laya.timer.once(400, this, () => {
  8706. this.guanyuRandomKnife();
  8707. });
  8708. }
  8709. else {
  8710. rootBall.forceRun = false;
  8711. rootBall.rigy.type = "dynamic";
  8712. xGame.common.extraMoveNum = skillLevel;
  8713. }
  8714. }));
  8715. }
  8716. getRandDir() {
  8717. let rootBall = xGame.common.d2World.rootBall;
  8718. let allBall = this.getAllBallArr();
  8719. let target = xGame.common.getRandArrEle(allBall);
  8720. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8721. return this.knifeV2;
  8722. }
  8723. cloneKnife(x, y, rotation) {
  8724. let parent = xGame.common.d3World.knifeRoot;
  8725. let prefab = xGame.common.d3World.knife;
  8726. let clone = prefab.clone();
  8727. parent.addChild(clone);
  8728. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8729. clone.transform.localPositionX = this.knifeV3.x;
  8730. clone.transform.localPositionY = 0;
  8731. clone.transform.localPositionZ = this.knifeV3.z;
  8732. clone.transform.localRotationEulerX = 0;
  8733. clone.transform.localRotationEulerY = rotation;
  8734. clone.transform.localRotationEulerZ = 0;
  8735. clone.active = true;
  8736. return clone;
  8737. }
  8738. cloneGuanYuEft(x, y, angle) {
  8739. return;
  8740. let parent = xGame.common.gameUI.ui.guanyuNode;
  8741. let eft = new ui_guanyuAni();
  8742. eft.parent = parent;
  8743. eft.x = x;
  8744. eft.y = y;
  8745. eft.rotation = angle;
  8746. }
  8747. }
  8748. class ui_UIWordsList extends fgui.GComponent {
  8749. static createInstance() {
  8750. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8751. }
  8752. onConstruct() {
  8753. this.c1 = this.getController("c1");
  8754. this.n74 = (this.getChild("n74"));
  8755. this.clickNode = (this.getChild("clickNode"));
  8756. this.myNode = (this.getChild("myNode"));
  8757. this.n68 = (this.getChild("n68"));
  8758. this.n66 = (this.getChild("n66"));
  8759. this.n55 = (this.getChild("n55"));
  8760. this.wordsBtn = (this.getChild("wordsBtn"));
  8761. this.emotionBtn = (this.getChild("emotionBtn"));
  8762. this.mybggg = (this.getChild("mybggg"));
  8763. this.wordsList = (this.getChild("wordsList"));
  8764. this.emotionList = (this.getChild("emotionList"));
  8765. this.myRoot = (this.getChild("myRoot"));
  8766. }
  8767. }
  8768. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8769. class EmotionDisplay {
  8770. constructor(index, ui) {
  8771. this.ui = ui;
  8772. this.index = index;
  8773. this.ui.onClick(this, this.clickSelf);
  8774. this.updateSelf();
  8775. }
  8776. updateSelf() {
  8777. let data = cfgTable.emotionData[this.index + 1];
  8778. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8779. }
  8780. clickSelf() {
  8781. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8782. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8783. xGame.common.talkMgr.closeTalkView();
  8784. }
  8785. }
  8786. class WordsDisplay {
  8787. constructor(index, ui) {
  8788. this.ui = ui;
  8789. this.index = index;
  8790. this.ui.onClick(this, this.clickSelf);
  8791. this.updateSelf();
  8792. }
  8793. updateSelf() {
  8794. let data = cfgTable.talkwordsData[this.index + 1];
  8795. this.ui.txt.text = data.msg;
  8796. }
  8797. clickSelf() {
  8798. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8799. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8800. xGame.common.talkMgr.closeTalkView();
  8801. }
  8802. }
  8803. class UIWordsList extends UIBase {
  8804. constructor() {
  8805. super();
  8806. }
  8807. onConstructor() {
  8808. this.ui = ui_UIWordsList.createInstance();
  8809. this.contentPane = this.ui;
  8810. this.isEject = false;
  8811. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8812. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8813. this.addUIClick(this.ui.clickNode, this.hide);
  8814. this.initTalkList();
  8815. this.initEmotionList();
  8816. }
  8817. show() {
  8818. super.show();
  8819. }
  8820. initTalkList() {
  8821. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8822. let data = cfgTable.talkwordsData;
  8823. let length = Object.keys(data).length;
  8824. this.ui.wordsList.numItems = length;
  8825. }
  8826. initEmotionList() {
  8827. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8828. let data = cfgTable.emotionData;
  8829. let length = Object.keys(data).length;
  8830. this.ui.emotionList.numItems = length;
  8831. }
  8832. renderTalkItem(index, obj) {
  8833. let temp = new WordsDisplay(index, obj);
  8834. }
  8835. renderEmotionItem(index, obj) {
  8836. let temp = new EmotionDisplay(index, obj);
  8837. }
  8838. openTalkList() {
  8839. this.ui.c1.selectedIndex = 0;
  8840. }
  8841. openEmotionList() {
  8842. this.ui.c1.selectedIndex = 1;
  8843. }
  8844. }
  8845. UIWordsList.uiName = "UIWordsList";
  8846. class TalkMgr {
  8847. constructor() {
  8848. this.aiSpeak = true;
  8849. this.emotionList = [];
  8850. this.talkList = [];
  8851. this.addEvent();
  8852. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8853. this.emotionList = [];
  8854. this.talkList = [];
  8855. for (let k in cfgTable.emotionData) {
  8856. this.emotionList.push(cfgTable.emotionData[k].id);
  8857. }
  8858. for (let k in cfgTable.talkwordsData) {
  8859. this.talkList.push(cfgTable.talkwordsData[k].id);
  8860. }
  8861. }
  8862. addEvent() {
  8863. let ui = xGame.common.gameUI.ui;
  8864. ui.wordsBtn.visible = true;
  8865. ui.wordsBtn.onClick(this, this.openTalkView);
  8866. ui.aiWordsBtn.visible = true;
  8867. ui.aiWordsBtn.onClick(this, this.clickAIState);
  8868. }
  8869. openTalkView() {
  8870. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8871. xGame.uiMgr.Show(UIWordsList);
  8872. }
  8873. closeTalkView() {
  8874. xGame.uiMgr.Hide(UIWordsList);
  8875. }
  8876. clickAIState() {
  8877. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8878. this.aiSpeak = !this.aiSpeak;
  8879. this.changeAIState(this.aiSpeak);
  8880. }
  8881. changeAIState(speak) {
  8882. this.aiSpeak = speak;
  8883. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  8884. if (speak) {
  8885. btn.c1.selectedIndex = 0;
  8886. }
  8887. else {
  8888. btn.c1.selectedIndex = 1;
  8889. }
  8890. }
  8891. showSelfTalk(wordsId) {
  8892. let ui = xGame.common.gameUI.ui;
  8893. ui.selfTalk.visible = true;
  8894. ui.selfTalk.myNode.c1.selectedIndex = 1;
  8895. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8896. ui.selfTalk.t0.play();
  8897. }
  8898. showSelfEmotion(emotionId) {
  8899. let ui = xGame.common.gameUI.ui;
  8900. ui.selfTalk.visible = true;
  8901. ui.selfTalk.myNode.c1.selectedIndex = 0;
  8902. this.selfSpine && this.selfSpine.dispose();
  8903. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8904. let spineData = cfgTable.emotionData[emotionId].spine;
  8905. this.selfSpine = new SpineMgr(spineData, () => {
  8906. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  8907. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  8908. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8909. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  8910. });
  8911. ui.selfTalk.t0.play();
  8912. }
  8913. showAITalk(wordsId) {
  8914. if (!this.aiSpeak)
  8915. return;
  8916. if (DataMgr.gameData.gameCount < 2)
  8917. return;
  8918. if (wordsId < 1)
  8919. wordsId = this.getRandTalk();
  8920. let ui = xGame.common.gameUI.ui;
  8921. ui.aiTalk.visible = true;
  8922. ui.aiTalk.myNode.c1.selectedIndex = 1;
  8923. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8924. ui.aiTalk.t0.play();
  8925. }
  8926. getRandTalk() {
  8927. let rand = xGame.tools.random(0, this.talkList.length);
  8928. return this.emotionList[rand];
  8929. }
  8930. getRandEmotion() {
  8931. let rand = xGame.tools.random(0, this.emotionList.length);
  8932. return this.emotionList[rand];
  8933. }
  8934. showAIEmotion(emotionId) {
  8935. if (!this.aiSpeak)
  8936. return;
  8937. if (DataMgr.gameData.gameCount < 2)
  8938. return;
  8939. if (emotionId < 1)
  8940. emotionId = this.getRandEmotion();
  8941. let ui = xGame.common.gameUI.ui;
  8942. ui.aiTalk.visible = true;
  8943. ui.aiTalk.myNode.c1.selectedIndex = 0;
  8944. this.aiSpine && this.aiSpine.dispose();
  8945. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8946. let spineData = cfgTable.emotionData[emotionId].spine;
  8947. this.aiSpine = new SpineMgr(spineData, () => {
  8948. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  8949. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  8950. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8951. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  8952. });
  8953. ui.aiTalk.t0.play();
  8954. }
  8955. resetGame() {
  8956. let ui = xGame.common.gameUI.ui;
  8957. ui.aiTalk.visible = false;
  8958. ui.selfTalk.visible = false;
  8959. this.aiSpine && this.aiSpine.dispose();
  8960. this.selfSpine && this.selfSpine.dispose();
  8961. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8962. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8963. this.closeTalkView();
  8964. }
  8965. }
  8966. class WordsMgr {
  8967. constructor() {
  8968. this.comboTimes = 1;
  8969. this.skillTimes = 0;
  8970. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  8971. this.comboSpine = new SpineMgr("yxz_liangan");
  8972. this.skillSpine = new SpineMgr("yiganxqiu");
  8973. this.scoreSpine = new SpineMgr("defen");
  8974. }
  8975. setClassicCombo(isInterrupt) {
  8976. if (isInterrupt) {
  8977. this.comboTimes = 0;
  8978. }
  8979. }
  8980. playClassicWords(type, callback) {
  8981. this.callback = callback;
  8982. let aniIndex = type;
  8983. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8984. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8985. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  8986. mySpine.destroy(true);
  8987. this.playClassicTimes();
  8988. });
  8989. }
  8990. playClassicTimes() {
  8991. this.comboTimes++;
  8992. if (this.comboTimes <= 1) {
  8993. this.callback && this.callback();
  8994. }
  8995. else {
  8996. let aniIndex = this.comboTimes - 1;
  8997. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8998. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8999. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9000. mySpine.destroy(true);
  9001. this.callback && this.callback();
  9002. });
  9003. }
  9004. }
  9005. playBigSkillTimes(times, callback) {
  9006. if (times <= 0) {
  9007. callback && callback();
  9008. return;
  9009. }
  9010. this.callback = callback;
  9011. let pre = "sz_0";
  9012. let aniIndex = 0;
  9013. this.getWordsImg(times, pre, () => {
  9014. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9015. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9016. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9017. let r1 = ``;
  9018. let r2 = ``;
  9019. if (times <= 9) {
  9020. r1 = `res/d2Res/${pre}${times}.png`;
  9021. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9022. aniIndex = 0;
  9023. }
  9024. else {
  9025. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9026. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9027. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9028. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9029. aniIndex = 1;
  9030. }
  9031. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9032. mySpine.destroy(true);
  9033. xGame.common.gameMgr.playSkillTips();
  9034. this.playScore(times);
  9035. xGame.common.playRandomMutiBallBigSkillSound();
  9036. }, mySpine);
  9037. });
  9038. }
  9039. playScore(score) {
  9040. let pre = "sz_";
  9041. let aniIndex = 0;
  9042. this.getWordsImg(score, pre, () => {
  9043. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9044. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9045. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9046. let r1 = ``;
  9047. let r2 = ``;
  9048. if (score <= 9) {
  9049. r1 = `res/d2Res/${pre}${score}.png`;
  9050. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9051. aniIndex = 0;
  9052. }
  9053. else {
  9054. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9055. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9056. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9057. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9058. aniIndex = 1;
  9059. }
  9060. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9061. mySpine.destroy(true);
  9062. this.callback && this.callback();
  9063. }, mySpine);
  9064. });
  9065. }
  9066. getWordsImg(number, pre = "", callback) {
  9067. let arr = [];
  9068. if (number <= 9) {
  9069. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9070. }
  9071. else {
  9072. 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 });
  9073. }
  9074. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9075. callback && callback();
  9076. }));
  9077. }
  9078. }
  9079. class ui_UIRodMethod extends fgui.GComponent {
  9080. static createInstance() {
  9081. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9082. }
  9083. onConstruct() {
  9084. this.n24 = (this.getChild("n24"));
  9085. this.white = (this.getChild("white"));
  9086. this.dot = (this.getChild("dot"));
  9087. this.sureBtn = (this.getChild("sureBtn"));
  9088. this.n20 = (this.getChild("n20"));
  9089. this.n21 = (this.getChild("n21"));
  9090. this.n22 = (this.getChild("n22"));
  9091. this.n23 = (this.getChild("n23"));
  9092. this.n5 = (this.getChild("n5"));
  9093. this.n14 = (this.getChild("n14"));
  9094. this.t0 = this.getTransition("t0");
  9095. }
  9096. }
  9097. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9098. class UIRodMethod extends UIBase {
  9099. constructor() {
  9100. super();
  9101. this.isPressd = false;
  9102. }
  9103. onConstructor() {
  9104. this.ui = ui_UIRodMethod.createInstance();
  9105. this.contentPane = this.ui;
  9106. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9107. this.moveDir = new Laya.Vector2();
  9108. this.moveDest = new Laya.Vector2();
  9109. this.centerPos = new Laya.Vector2();
  9110. xGame.common.uiRodMethod = this;
  9111. }
  9112. show() {
  9113. super.show();
  9114. xGame.common.gameMgr.gamePause = true;
  9115. this.openPressDotEvent();
  9116. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9117. this.centerPos.x = this.ui.white.x;
  9118. this.centerPos.y = this.ui.white.y;
  9119. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9120. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9121. this.setDot();
  9122. }
  9123. setDot() {
  9124. this.ui.dot.x = this.moveDest.x;
  9125. this.ui.dot.y = this.moveDest.y;
  9126. }
  9127. closeSelf() {
  9128. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9129. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9130. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9131. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9132. xGame.common.gameMgr.gamePause = false;
  9133. this.hide();
  9134. }
  9135. openPressDotEvent() {
  9136. this.closePressDotEvent();
  9137. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9138. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9139. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9140. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9141. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9142. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9143. }
  9144. closePressDotEvent() {
  9145. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9146. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9147. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9148. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9149. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9150. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9151. }
  9152. onDown(e) {
  9153. if (e.type == Laya.Event.MOUSE_DOWN)
  9154. this.isPressd = true;
  9155. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9156. this.isPressd = false;
  9157. if (!this.isPressd)
  9158. return;
  9159. this.moveDest.x = e.stageX;
  9160. this.moveDest.y = e.stageY;
  9161. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9162. if (dis > 6724) {
  9163. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9164. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9165. }
  9166. this.setDot();
  9167. }
  9168. resetRod() {
  9169. this.ui.dot.x = this.ui.white.x;
  9170. this.ui.dot.y = this.ui.white.y;
  9171. this.gameRod.dot.x = this.gameRod.bg.x;
  9172. this.gameRod.dot.y = this.gameRod.bg.y;
  9173. xGame.common.rodOffest.x = 0;
  9174. xGame.common.rodOffest.y = 0;
  9175. }
  9176. }
  9177. UIRodMethod.uiName = "UIRodMethod";
  9178. class UIGame extends UIBase {
  9179. constructor() {
  9180. super();
  9181. this.powerNum = 0;
  9182. this.isD3Inited = false;
  9183. this.isPrePlay = false;
  9184. this.isMoveRod = false;
  9185. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9186. this.rulerDis = 20;
  9187. this.rulerOffset = 0;
  9188. }
  9189. onConstructor() {
  9190. this.ui = ui_UIGame.createInstance();
  9191. this.contentPane = this.ui;
  9192. this.ui.x += xGame.common.sysOffestNum;
  9193. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9194. this.isEject = false;
  9195. xGame.common.gameUI = this;
  9196. this.initSelf();
  9197. }
  9198. isTurnSelf() {
  9199. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9200. return true;
  9201. }
  9202. }
  9203. initSelf() {
  9204. let topUI = this.ui.topNode;
  9205. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9206. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9207. this.barInfo = {};
  9208. this.barInfo.curY = 0;
  9209. this.barInfo.height = this.ui.powerNode.height;
  9210. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9211. this.barInfo.powerStartY = this.ui.powerNode.y;
  9212. xGame.common.aiPlayer = new AIPlayer();
  9213. xGame.common.gameMgr = new GameMgr();
  9214. xGame.common.skillMgr = new SkillMgr();
  9215. xGame.common.wordsMgr = new WordsMgr();
  9216. xGame.common.talkMgr = new TalkMgr();
  9217. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9218. console.log("加载经典模式表情文件chenggon !");
  9219. });
  9220. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9221. console.log("挑战模式奖励模式spine加载成功!");
  9222. });
  9223. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9224. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9225. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9226. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9227. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9228. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9229. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9230. }
  9231. returnHome() {
  9232. let tips = "Are you sure to exit the game?";
  9233. let woman = "Boss, why don't you play for a while longer?";
  9234. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9235. }
  9236. addRodMethodClick() {
  9237. if (this.isTurnSelf()) {
  9238. xGame.uiMgr.Show(UIRodMethod);
  9239. }
  9240. }
  9241. clickHelpLineBtn(force = false) {
  9242. if (!this.isTurnSelf())
  9243. return;
  9244. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9245. if (success) {
  9246. xGame.common.longHelpLine = true;
  9247. xGame.common.d2World.getHelpLine();
  9248. Moyu.sendDataEvent("guideNum");
  9249. }
  9250. else {
  9251. }
  9252. });
  9253. }
  9254. renderSelfDisplayBalls(index, target) {
  9255. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9256. target.myImg.url = xGame.common.getGameIconUrl(str);
  9257. }
  9258. renderAIDisplayBalls(index, target) {
  9259. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9260. target.myImg.url = xGame.common.getGameIconUrl(str);
  9261. ;
  9262. }
  9263. updateMode() {
  9264. if (xGame.common.gameMode == GameMode.classic) {
  9265. this.ui.topNode.scoreNode.visible = false;
  9266. }
  9267. else if (xGame.common.gameMode == GameMode.bigMove) {
  9268. this.ui.topNode.scoreNode.visible = true;
  9269. }
  9270. }
  9271. show() {
  9272. super.show();
  9273. console.log("zh:uigame show");
  9274. this.ui.alpha = 0;
  9275. this.updateSelf();
  9276. console.log("zh:uigame bf gamemusic01 start");
  9277. xGame.soundMgr.playMusic("gamemusic01");
  9278. console.log("zh:uigame bf gamemusic01 end");
  9279. xGame.common.gameMgr.gamePause = false;
  9280. xGame.common.gameUI.ui.blackAni.visible = false;
  9281. xGame.common.gameUI.ui.whiteAni.visible = false;
  9282. this.ui.powerEft.visible = false;
  9283. this.ui.colorNode.visible = false;
  9284. this.updateHead();
  9285. }
  9286. updateSelf() {
  9287. if (xGame.common.gameMode == GameMode.classic) {
  9288. this.ui.c1.selectedIndex = 0;
  9289. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9290. this.ui.topNode.middleNode.visible = true;
  9291. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9292. }
  9293. else if (xGame.common.gameMode == GameMode.bigMove) {
  9294. this.ui.c1.selectedIndex = 0;
  9295. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9296. this.ui.topNode.middleNode.visible = false;
  9297. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9298. let rand = xGame.common.randomNum(1, max);
  9299. let guide = DataMgr.getSkillGuide();
  9300. if (guide == 0)
  9301. rand = 1;
  9302. xGame.common.bigMoveLevelIndex = rand;
  9303. }
  9304. else if (xGame.common.gameMode == GameMode.placeBall) {
  9305. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9306. this.ui.c1.selectedIndex = 1 + data.type;
  9307. this.ui.alpha = 1;
  9308. this.startGame();
  9309. }
  9310. this.updateMode();
  9311. this.initD3world();
  9312. this.initD2world();
  9313. }
  9314. startGame() {
  9315. this.ui.snowNode.visible = Math.random() <= 0.1;
  9316. this.ui.d2Node.visible = false;
  9317. xGame.common.d3World.d3Hand.gameObj.active = false;
  9318. xGame.common.d3World.tableSrc.init();
  9319. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9320. this.cameraViewChange(() => {
  9321. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9322. switch (xGame.common.gameMode) {
  9323. case GameMode.classic:
  9324. xGame.common.d3World.d3Hand.gameObj.active = true;
  9325. this.playPutBallD3Ani();
  9326. break;
  9327. case GameMode.bigMove:
  9328. this.enterGame();
  9329. Laya.timer.once(500, this, () => {
  9330. this.ui.topNode.middleNode.visible = true;
  9331. this.ui.topNode.middleNode.t0.play();
  9332. });
  9333. break;
  9334. case GameMode.placeBall:
  9335. this.enterGame();
  9336. break;
  9337. default:
  9338. break;
  9339. }
  9340. });
  9341. PlatMgr.showBanner(false);
  9342. }
  9343. enterGame() {
  9344. this.ui.d2Node.visible = true;
  9345. xGame.common.d3World.d3Hand.gameObj.active = false;
  9346. xGame.common.showOneCamera("mainCamera");
  9347. Moyu.recordGame(30, true);
  9348. if (!this.isPrePlay) {
  9349. this.isPrePlay = true;
  9350. xGame.common.d3World.prePlayEft();
  9351. }
  9352. xGame.common.gameMgr.gameReady();
  9353. this.openAllEvent();
  9354. this.ui.snowNode.visible = false;
  9355. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9356. this.ui.helpBtn.visible = condition;
  9357. }
  9358. showHelpLineGuide() {
  9359. let longGuide = DataMgr.getGuideHelpLine();
  9360. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9361. this.ui.helpBtn.visible = true;
  9362. this.ui.guideNode.visible = true;
  9363. }
  9364. }
  9365. setTurnAlpha(alpha) {
  9366. this.ui.keduNode.alpha = alpha;
  9367. this.ui.ganNode.alpha = alpha;
  9368. this.ui.rodMethodNode.alpha = alpha;
  9369. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9370. }
  9371. cameraViewChange(callback) {
  9372. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9373. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9374. xGame.common.showOneCamera("visitAngle");
  9375. cameraSrc.localRotationEulerY = 180;
  9376. cameraSrc.localRotationEulerZ = 0;
  9377. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9378. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9379. callback && callback();
  9380. }));
  9381. }));
  9382. }
  9383. playPutBallD3Ani() {
  9384. xGame.common.showOneCamera("mainCamera");
  9385. let handSrc = xGame.common.d3World.d3Hand;
  9386. handSrc.gameObj.active = true;
  9387. handSrc.transform.localPositionZ = 3;
  9388. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9389. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9390. handSrc.gameObj.active = false;
  9391. this.enterGame();
  9392. }), 400);
  9393. }));
  9394. }
  9395. updateHead() {
  9396. let user = Moyu.getUserInfo();
  9397. this.ui.topNode.selfNameTxt.text = user.nickName;
  9398. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9399. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9400. if (DataMgr.getSkillGuide() < 1) {
  9401. this.ui.topNode.aiNameTxt.text = 'billiards';
  9402. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9403. }
  9404. else {
  9405. this.ui.topNode.aiNameTxt.text = aiData.name;
  9406. let randNo = Math.floor(Math.random() * 10) + 1;
  9407. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9408. }
  9409. }
  9410. initD2world() {
  9411. let node = this.ui.d2Root.displayObject;
  9412. let src = node.getComponent(D2World);
  9413. if (!src) {
  9414. xGame.common.d2World = node.addComponent(D2World);
  9415. }
  9416. xGame.common.d2World.initSelf();
  9417. }
  9418. initD3world() {
  9419. if (this.isD3Inited)
  9420. return;
  9421. this.isD3Inited = true;
  9422. let scene3D = xGame.common.d3Scene;
  9423. this.ui.d3Root.displayObject.addChild(scene3D);
  9424. scene3D.active = true;
  9425. xGame.common.d3World.tableSrc.setBorderPos();
  9426. }
  9427. onRootMove(e) {
  9428. let rootBall = xGame.common.d2World.rootBall;
  9429. this.ui.moveNode.x = e.x;
  9430. this.ui.moveNode.y = e.y;
  9431. rootBall.gameObj.x = e.x;
  9432. rootBall.gameObj.y = e.y;
  9433. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9434. }
  9435. aiRootMove(move) {
  9436. if (move)
  9437. this.hideBallUI();
  9438. else {
  9439. this.showBallUI();
  9440. xGame.common.d2World.getHelpLine();
  9441. }
  9442. }
  9443. aiForce(type, force = 0) {
  9444. this.pressTarget = PressType.powerNode;
  9445. if (type == 1)
  9446. this.onEventUp({ force: true });
  9447. else if (type == 2)
  9448. this.onEventMove({ stageY: force, force: true });
  9449. }
  9450. onEventPress(e) {
  9451. if (e.stopPropagation)
  9452. e.stopPropagation();
  9453. if (!this.isTurnSelf())
  9454. return;
  9455. let target = e.target;
  9456. switch (target) {
  9457. case this.ui.myPowerNode.displayObject:
  9458. this.pressTarget = PressType.powerNode;
  9459. this.barInfo.curY = e.stageY;
  9460. this.updateBarInfo();
  9461. break;
  9462. case this.ui.moveNode.displayObject:
  9463. this.pressTarget = PressType.moveNode;
  9464. this.hideBallUI();
  9465. this.eventObj.curX = this.ui.moveNode.x;
  9466. this.eventObj.curY = this.ui.moveNode.y;
  9467. this.ui.moveNode.finger.visible = false;
  9468. this.eventObj.lastX = e.stageX;
  9469. this.eventObj.lastY = e.stageY;
  9470. break;
  9471. case this.ui.rulerClickNode.displayObject:
  9472. this.pressTarget = PressType.rulerNode;
  9473. this.eventObj.lastY = e.stageY;
  9474. break;
  9475. case this.ui.d2Root.displayObject:
  9476. this.pressTarget = PressType.d2Root;
  9477. this.eventObj.lastX = e.stageX;
  9478. this.eventObj.lastY = e.stageY;
  9479. this.eventObj.starX = e.stageX;
  9480. this.eventObj.starY = e.stageY;
  9481. this.eventObj.curX = 0;
  9482. this.eventObj.curY = 0;
  9483. xGame.common.d2World.d2Gan.setGanLastInfo();
  9484. this.rulerOffset = 0;
  9485. break;
  9486. default:
  9487. break;
  9488. }
  9489. }
  9490. onEventMove(e) {
  9491. if (e.stopPropagation)
  9492. e.stopPropagation();
  9493. if (e && e.force) {
  9494. }
  9495. else {
  9496. if (!this.isTurnSelf())
  9497. return;
  9498. }
  9499. switch (this.pressTarget) {
  9500. case PressType.powerNode:
  9501. this.barInfo.curY = e.stageY;
  9502. this.updateBarInfo();
  9503. this.isMoveRod = true;
  9504. break;
  9505. case PressType.moveNode:
  9506. let rootBall = xGame.common.d2World.rootBall;
  9507. let radius = rootBall.gameObj.width / 2;
  9508. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9509. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9510. let border = xGame.common.d2World.borderRect;
  9511. if (curX <= border.x + radius)
  9512. curX = border.x + radius;
  9513. else if (curX >= border.x + border.width - radius)
  9514. curX = border.x + border.width - radius;
  9515. if (curY <= border.y + radius)
  9516. curY = border.y + radius;
  9517. else if (curY >= border.y + border.height - radius)
  9518. curY = border.y + border.height - radius;
  9519. if (xGame.common.gameMgr.isOpenBall) {
  9520. if (curX >= border.x + border.openBallW - radius)
  9521. curX = border.x + border.openBallW - radius;
  9522. }
  9523. this.ui.moveNode.x = curX;
  9524. this.ui.moveNode.y = curY;
  9525. rootBall.gameObj.x = curX;
  9526. rootBall.gameObj.y = curY;
  9527. rootBall.d3BallSrc.setTransPos(curX, curY);
  9528. this.isMoveRod = true;
  9529. break;
  9530. case PressType.rulerNode:
  9531. let yy = e.stageY - this.eventObj.lastY;
  9532. this.eventObj.lastY = e.stageY;
  9533. let ruler1 = this.ui.rulerNode.img1;
  9534. let ruler2 = this.ui.rulerNode.img2;
  9535. ruler1.y += yy;
  9536. ruler2.y += yy;
  9537. this.rulerOffset += yy;
  9538. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9539. this.rulerOffset = 0;
  9540. xGame.soundMgr.playSound("inch", 1, 10);
  9541. }
  9542. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9543. let h = ruler1.height;
  9544. this.checkGuide();
  9545. this.isMoveRod = true;
  9546. if (ruler1.y >= h) {
  9547. ruler1.y = -h;
  9548. ruler2.y = 0;
  9549. return;
  9550. }
  9551. else if (ruler1.y <= -h) {
  9552. ruler1.y = h;
  9553. ruler2.y = 0;
  9554. return;
  9555. }
  9556. if (ruler2.y >= h) {
  9557. ruler2.y = -h;
  9558. ruler1.y = 0;
  9559. return;
  9560. }
  9561. else if (ruler2.y <= -h) {
  9562. ruler2.y = h;
  9563. ruler1.y = 0;
  9564. return;
  9565. }
  9566. break;
  9567. case PressType.d2Root:
  9568. this.eventObj.curX = e.stageX;
  9569. this.eventObj.curY = e.stageY;
  9570. let offset = this.checkRodMoveDir();
  9571. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9572. this.eventObj.lastX = e.stageX;
  9573. this.eventObj.lastY = e.stageY;
  9574. break;
  9575. default:
  9576. break;
  9577. }
  9578. }
  9579. onEventUp(e) {
  9580. if (e.stopPropagation)
  9581. e.stopPropagation();
  9582. if (e && e.force) {
  9583. }
  9584. else {
  9585. if (!this.isTurnSelf())
  9586. return;
  9587. }
  9588. switch (this.pressTarget) {
  9589. case PressType.powerNode:
  9590. this.ui.powerNode.value = 0;
  9591. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9592. this.ui.powerTxt.text = "";
  9593. if (this.powerNum > 0) {
  9594. xGame.eventMgr.event(BALL_SHOOT);
  9595. xGame.common.d2World.shoot(this.powerNum);
  9596. xGame.common.d2World.d2Gan.shoot();
  9597. xGame.common.d2World.d2HelpLine.shoot();
  9598. this.finishGuide();
  9599. this.ui.powerEft.visible = false;
  9600. this.ui.colorNode.visible = false;
  9601. let ganStr = "";
  9602. if (this.powerNum <= 30) {
  9603. ganStr = "gan_30";
  9604. }
  9605. else if (this.powerNum <= 60) {
  9606. ganStr = "gan_50";
  9607. }
  9608. else {
  9609. ganStr = "gan_80";
  9610. }
  9611. xGame.soundMgr.playSound(ganStr);
  9612. }
  9613. break;
  9614. case PressType.moveNode:
  9615. let rootBall = xGame.common.d2World.rootBall;
  9616. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9617. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9618. let isIntersect = this.judgeBallIntersect();
  9619. if (isIntersect) {
  9620. this.ui.moveNode.x = lastX;
  9621. this.ui.moveNode.y = lastY;
  9622. rootBall.gameObj.x = lastX;
  9623. rootBall.gameObj.y = lastY;
  9624. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9625. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9626. }
  9627. else {
  9628. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9629. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9630. }
  9631. this.showBallUI();
  9632. this.ui.moveNode.finger.visible = true;
  9633. xGame.common.d2World.getHelpLine();
  9634. break;
  9635. case PressType.rulerNode:
  9636. break;
  9637. case PressType.d2Root:
  9638. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9639. if (dis <= 25) {
  9640. this.moveToClickDot(e);
  9641. }
  9642. break;
  9643. default:
  9644. break;
  9645. }
  9646. this.pressTarget = -1;
  9647. }
  9648. checkGuide() {
  9649. let guide = DataMgr.getSkillGuide();
  9650. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9651. xGame.common.guideStep++;
  9652. xGame.common.gameUI.ui.guide2.visible = false;
  9653. xGame.common.gameUI.ui.guide3.visible = true;
  9654. }
  9655. }
  9656. finishGuide() {
  9657. let guide = DataMgr.getSkillGuide();
  9658. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9659. xGame.common.guideStep = 10;
  9660. this.closeAllGuide();
  9661. }
  9662. }
  9663. closeAllGuide() {
  9664. xGame.common.gameUI.ui.guide1.visible = false;
  9665. xGame.common.gameUI.ui.guide2.visible = false;
  9666. xGame.common.gameUI.ui.guide3.visible = false;
  9667. }
  9668. updateBarInfo() {
  9669. let star = this.ui.powerNode.y;
  9670. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9671. if (rate >= 1)
  9672. rate = 1;
  9673. if (rate <= 0)
  9674. rate = 0;
  9675. this.powerNum = Math.ceil(rate * 100);
  9676. this.ui.powerNode.value = this.powerNum;
  9677. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9678. this.ui.colorNode.value = this.powerNum;
  9679. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9680. this.ui.powerEft.visible = this.powerNum != 0;
  9681. this.ui.colorNode.visible = this.powerNum != 0;
  9682. this.ui.powerTxt.text = this.powerNum + "";
  9683. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9684. }
  9685. forceCancel() {
  9686. this.ui.powerNode.value = 0;
  9687. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9688. this.ui.powerTxt.text = "";
  9689. }
  9690. checkRodMoveDir() {
  9691. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9692. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9693. if (tempX >= 0 && tempY <= 0) {
  9694. return this.checkDir();
  9695. }
  9696. else if (tempX < 0 && tempY < 0) {
  9697. return this.checkDir(1, -1);
  9698. }
  9699. else if (tempX < 0 && tempY > 0) {
  9700. return this.checkDir(-1, -1);
  9701. }
  9702. else {
  9703. return this.checkDir(-1, 1);
  9704. }
  9705. }
  9706. checkDir(flagX = 1, flagY = 1) {
  9707. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9708. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9709. if (offsetY == 0) {
  9710. return offsetX * flagX;
  9711. }
  9712. if (offsetX == 0) {
  9713. return offsetY * flagY;
  9714. }
  9715. let angle = offsetY / offsetX;
  9716. if (Math.abs(angle) >= 1) {
  9717. return offsetY * flagY;
  9718. }
  9719. else {
  9720. return offsetX * flagX;
  9721. }
  9722. }
  9723. judgeBallIntersect() {
  9724. let rootBall = xGame.common.d2World.rootBall;
  9725. let ballArr = xGame.common.d2World.ballArr;
  9726. let radius = rootBall.gameObj.width / 2;
  9727. let temp;
  9728. let isIntersect = false;
  9729. for (let index = 0; index < ballArr.length; index++) {
  9730. temp = ballArr[index];
  9731. if (temp.number == rootBall.number)
  9732. continue;
  9733. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9734. if (isIntersect) {
  9735. break;
  9736. }
  9737. }
  9738. return isIntersect;
  9739. }
  9740. hideBallUI() {
  9741. let d2Gan = xGame.common.d2World.d2Gan;
  9742. if (!d2Gan.ui.isDisposed)
  9743. d2Gan.ui.visible = false;
  9744. let d2Help = xGame.common.d2World.d2HelpLine;
  9745. if (!d2Help.ui.isDisposed)
  9746. d2Help.ui.visible = false;
  9747. let rootBall = xGame.common.d2World.rootBall;
  9748. if (!rootBall.destroyed) {
  9749. rootBall.gameObj.active = false;
  9750. }
  9751. }
  9752. showBallUI() {
  9753. let d2Gan = xGame.common.d2World.d2Gan;
  9754. if (!d2Gan.ui.isDisposed)
  9755. d2Gan.ui.visible = true;
  9756. let d2Help = xGame.common.d2World.d2HelpLine;
  9757. if (!d2Help.ui.isDisposed)
  9758. d2Help.ui.visible = true;
  9759. let rootBall = xGame.common.d2World.rootBall;
  9760. if (!rootBall.destroyed) {
  9761. rootBall.gameObj.active = true;
  9762. }
  9763. }
  9764. moveToClickDot(e) {
  9765. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9766. let root = xGame.common.d2World.rootBall.gameObj;
  9767. let xx = e.stageX - xGame.common.sysOffestNum;
  9768. let yy = e.stageY;
  9769. let x = xx - root.x;
  9770. let y = yy - root.y;
  9771. let angle = xGame.common.getfguiRotation(x, y);
  9772. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9773. xGame.common.d2World.getHelpLine();
  9774. }
  9775. this.isMoveRod = false;
  9776. xGame.common.clickedBall = false;
  9777. }
  9778. openAllEvent() {
  9779. this.closeAllEvent();
  9780. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9781. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9782. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9783. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9784. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9785. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9786. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9787. }
  9788. closeAllEvent() {
  9789. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9790. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9791. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9792. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9793. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9794. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9795. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9796. }
  9797. resetGame() {
  9798. this.closeAllEvent();
  9799. this.hideBallUI();
  9800. xGame.common.gameMgr.gamePause = true;
  9801. }
  9802. }
  9803. UIGame.uiName = "UIGame";
  9804. class UIAddProp extends UIBase {
  9805. constructor() {
  9806. super();
  9807. this.curType = "";
  9808. }
  9809. onConstructor() {
  9810. this.ui = ui_UIAddProp.createInstance();
  9811. this.contentPane = this.ui;
  9812. this.isEject = false;
  9813. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9814. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9815. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9816. this.updateUI();
  9817. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9818. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9819. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9820. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9821. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9822. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9823. }
  9824. show(type) {
  9825. super.show();
  9826. this.curType = type == 0 ? "coin" : "diamond";
  9827. this.switchBtn("");
  9828. this.ui.t0.play();
  9829. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9830. PlatMgr.showInsert(true);
  9831. }
  9832. closeSelf() {
  9833. this.hide();
  9834. }
  9835. updateUI() {
  9836. let data = cfgTable.moneyData;
  9837. let temp;
  9838. let obj;
  9839. for (const key in data) {
  9840. temp = data[key];
  9841. obj = this.ui.myNode["node" + key];
  9842. if (parseInt(key) <= 2) {
  9843. obj.diamondTxt.text = "+" + temp.num;
  9844. }
  9845. else {
  9846. obj.coinTxt.text = temp.num;
  9847. obj.diamondTxt.text = temp.get.split('_')[1];
  9848. }
  9849. }
  9850. this.updateDiamondShare();
  9851. }
  9852. updateDiamondShare() {
  9853. let data = DataMgr.getShareDiamondTimes();
  9854. if (data >= xGame.common.maxShareDiamondTimes) {
  9855. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  9856. this.ui.myNode.node1.touchable = false;
  9857. }
  9858. else {
  9859. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9860. this.ui.myNode.node1.touchable = true;
  9861. }
  9862. }
  9863. switchBtn(type) {
  9864. if (type == "")
  9865. type = this.curType;
  9866. else {
  9867. if (this.curType == type) {
  9868. return;
  9869. }
  9870. else {
  9871. this.curType = type;
  9872. }
  9873. }
  9874. if (type == "coin") {
  9875. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9876. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9877. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9878. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9879. this.ui.myNode.c1.selectedIndex = 0;
  9880. }
  9881. else {
  9882. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9883. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9884. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9885. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9886. this.ui.myNode.c1.selectedIndex = 1;
  9887. }
  9888. }
  9889. convertCoin(index) {
  9890. let data = cfgTable.moneyData[index];
  9891. let coinNum = data.num;
  9892. let str = data.get.split('_')[1];
  9893. let needDiamond = parseInt(str);
  9894. if (DataMgr.diamondEnough(needDiamond)) {
  9895. DataMgr.setDiamond(-needDiamond);
  9896. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9897. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  9898. }
  9899. else {
  9900. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  9901. this.switchBtn("diamond");
  9902. }
  9903. }
  9904. videoGetDiamond() {
  9905. let num = cfgTable.moneyData[2].num;
  9906. Moyu.showVideoAd(() => {
  9907. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9908. this.closeSelf();
  9909. }, EAdType.addDiamond);
  9910. }
  9911. videoGetCoin() {
  9912. Moyu.showVideoAd(() => {
  9913. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9914. this.closeSelf();
  9915. }, EAdType.addCoin);
  9916. }
  9917. shareGetDiamond() {
  9918. let times = DataMgr.getShareDiamondTimes();
  9919. if (times >= xGame.common.maxShareDiamondTimes) {
  9920. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  9921. }
  9922. else {
  9923. if (Moyu.isTT) {
  9924. let num = cfgTable.moneyData[1].num;
  9925. Moyu.shareVideo = '';
  9926. Moyu.shareGame((success) => {
  9927. if (success) {
  9928. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9929. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9930. DataMgr.setShareDiamondTimes(1);
  9931. this.updateDiamondShare();
  9932. }
  9933. else {
  9934. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9935. }
  9936. });
  9937. }
  9938. else {
  9939. Moyu.showVideoAd(() => {
  9940. let diamond = xGame.common.randomNum(50, 100);
  9941. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9942. DataMgr.setShareDiamondTimes(1);
  9943. this.updateDiamondShare();
  9944. }, EAdType.randomDiamond);
  9945. }
  9946. }
  9947. }
  9948. openPutBallView() {
  9949. let end = xGame.uiMgr.getUI(UIGameEnd);
  9950. let skill = xGame.uiMgr.getUI(UISkill);
  9951. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9952. let uigame = xGame.uiMgr.getUI(UIGame);
  9953. if (end && !end.isHide) {
  9954. xGame.uiMgr.Hide(UIGameEnd);
  9955. xGame.uiMgr.Show(UIMain);
  9956. }
  9957. if (skill && !skill.isHide)
  9958. xGame.uiMgr.Hide(UISkill);
  9959. if (uigame && !uigame.isHide)
  9960. xGame.uiMgr.Hide(UIGame);
  9961. if (level && !level.isHide) {
  9962. }
  9963. else {
  9964. xGame.uiMgr.Show(UILevelDisplay);
  9965. }
  9966. this.closeSelf();
  9967. }
  9968. }
  9969. UIAddProp.uiName = "UIAddProp";
  9970. class MoneyNode {
  9971. constructor(ui) {
  9972. this.leftTime = 0;
  9973. this.ui = ui;
  9974. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9975. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9976. this.ui.addPowerBtn.onClick(this, this.addPower);
  9977. this.ui.c1.selectedIndex = 1;
  9978. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9979. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9980. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9981. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  9982. this.coinChange();
  9983. this.diamondChange();
  9984. this.powerChange();
  9985. }
  9986. addPower() {
  9987. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9988. xGame.uiMgr.Show(UIPower);
  9989. }
  9990. powerChange() {
  9991. let powerNum = DataMgr.getPower();
  9992. this.ui.powerTxt.text = powerNum + "";
  9993. }
  9994. checkPowerTime() {
  9995. let cur = new Date().getTime();
  9996. let last = DataMgr.getPowerTime();
  9997. if (last == 0) {
  9998. last = cur;
  9999. DataMgr.setPowerTime(cur);
  10000. }
  10001. let power = DataMgr.getPower();
  10002. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10003. Laya.timer.clearAll(this);
  10004. if (power >= xGame.common.natureMaxPower) {
  10005. this.ui.powerTimeTxt.text = "";
  10006. DataMgr.setPowerTime(cur);
  10007. return;
  10008. }
  10009. if (power + offset >= xGame.common.natureMaxPower) {
  10010. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10011. this.ui.powerTimeTxt.text = "";
  10012. DataMgr.setPowerTime(cur);
  10013. }
  10014. else {
  10015. if (offset > 0) {
  10016. DataMgr.setPower(offset);
  10017. DataMgr.setPowerTime(cur);
  10018. }
  10019. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10020. this.leftTime = xGame.common.powerRecoverNum - time;
  10021. if (this.leftTime <= 0)
  10022. this.leftTime = 0;
  10023. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10024. Laya.timer.loop(1000, this, this.updatePowerTime);
  10025. }
  10026. }
  10027. updatePowerTime() {
  10028. this.leftTime -= 1;
  10029. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10030. if (this.leftTime <= 0) {
  10031. this.checkPowerTime();
  10032. }
  10033. }
  10034. coinChange() {
  10035. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10036. }
  10037. diamondChange() {
  10038. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10039. }
  10040. addCoin() {
  10041. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10042. Moyu.sendDataEvent("AddCoinBtn");
  10043. xGame.uiMgr.Show(UIAddProp, 0);
  10044. }
  10045. addDiamond() {
  10046. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10047. Moyu.sendDataEvent("AddDiamondBtn");
  10048. xGame.uiMgr.Show(UIAddProp, 1);
  10049. }
  10050. }
  10051. class UIDraw extends UIBase {
  10052. constructor() {
  10053. super();
  10054. this.curKey = 0;
  10055. }
  10056. onConstructor() {
  10057. this.ui = ui_UIDraw.createInstance();
  10058. this.contentPane = this.ui;
  10059. this.isEject = false;
  10060. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10061. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10062. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10063. this.initDraw();
  10064. this.initUI();
  10065. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10066. if (Moyu.isKs)
  10067. this.ui.closeNode.closeBtn.x += 100;
  10068. }
  10069. show() {
  10070. super.show();
  10071. this.ui.t0.play();
  10072. this.playSecretaryIdle();
  10073. this.updateDraw();
  10074. this.checkFree();
  10075. if (PlatMgr.bannerDelay > 0) {
  10076. this.ui.closeNode.closeBtn.visible = false;
  10077. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10078. this.ui.closeNode.closeBtn.visible = true;
  10079. });
  10080. }
  10081. PlatMgr.showRateBanner();
  10082. }
  10083. hide() {
  10084. Laya.timer.clearAll(this);
  10085. super.hide();
  10086. }
  10087. checkFree() {
  10088. let isFree = DataMgr.getDailyfreeDrawTimes();
  10089. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10090. }
  10091. initDraw() {
  10092. this.drawObj = [];
  10093. let data = cfgTable.drawData;
  10094. let temp;
  10095. let weight = 0;
  10096. for (const key in data) {
  10097. temp = data[key];
  10098. weight += temp.weight;
  10099. this.drawObj.push(weight);
  10100. }
  10101. this.allWeight = weight;
  10102. }
  10103. initUI() {
  10104. let data = cfgTable.drawData;
  10105. let temp;
  10106. let img;
  10107. let txt;
  10108. for (const key in data) {
  10109. temp = data[key];
  10110. img = this.ui.myNode.rotNode["img" + key];
  10111. txt = this.ui.myNode.rotNode["txt" + key];
  10112. img.url = xGame.common.getGameIconUrl(temp.icon);
  10113. txt.visible = true;
  10114. if (temp.award > 2) {
  10115. img.rotation = 0;
  10116. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10117. }
  10118. else {
  10119. img.rotation = temp.rotation;
  10120. txt.text = temp.num;
  10121. }
  10122. }
  10123. }
  10124. getCurkey() {
  10125. let rand = Math.random() * this.allWeight;
  10126. let temp;
  10127. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10128. temp = this.drawObj[index];
  10129. if (index == 0) {
  10130. if (rand < temp) {
  10131. return index + 1;
  10132. }
  10133. }
  10134. else {
  10135. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10136. return index + 1;
  10137. }
  10138. }
  10139. }
  10140. return 2;
  10141. }
  10142. startDraw() {
  10143. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10144. if (freeTimes > 0) {
  10145. this.beginDraw();
  10146. DataMgr.setDailyfreeDrawTimes(0);
  10147. this.checkFree();
  10148. }
  10149. else {
  10150. Moyu.sendDataEvent("turntable");
  10151. Moyu.showVideoAd(() => {
  10152. this.beginDraw();
  10153. }, EAdType.draw);
  10154. }
  10155. }
  10156. beginDraw() {
  10157. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10158. this.ui.drawBtn.touchable = false;
  10159. this.curKey = this.getCurkey();
  10160. console.log("当前key", this.curKey);
  10161. let cell = 60;
  10162. let lap = 3;
  10163. let angle = cell * (this.curKey - 1) + lap * 360;
  10164. let target = this.ui.myNode.rotNode;
  10165. target.rotation = 0;
  10166. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10167. console.log("旋转完成");
  10168. this.ui.drawBtn.touchable = true;
  10169. this.getAward();
  10170. }));
  10171. }
  10172. getAward() {
  10173. let data = cfgTable.drawData[this.curKey];
  10174. let temp = new AwardType();
  10175. temp.type = data.award;
  10176. temp.num = data.num;
  10177. xGame.common.getAward([temp], () => {
  10178. DataMgr.setDrawTimes(1);
  10179. this.updateDraw();
  10180. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10181. });
  10182. }
  10183. updateDraw() {
  10184. let drawTimes = DataMgr.getDrawTimes();
  10185. let awardTimes = DataMgr.getDrawAwardTimes();
  10186. if (Math.floor(drawTimes / 3) > awardTimes) {
  10187. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10188. this.ui.extraNode.boxBtn.touchable = true;
  10189. this.ui.extraNode.tipsTxt.text = "3/3";
  10190. this.ui.extraNode.barNode.width = 265;
  10191. this.getExtraAward();
  10192. }
  10193. else {
  10194. this.ui.extraNode.boxBtn.t0.stop();
  10195. this.ui.extraNode.boxBtn.touchable = false;
  10196. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10197. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10198. }
  10199. let data = cfgTable.drawData[1];
  10200. if (awardTimes == 0) {
  10201. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10202. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10203. this.ui.myNode.rotNode.img1.rotation = 0;
  10204. }
  10205. else {
  10206. let award = data.nextid;
  10207. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10208. this.ui.myNode.rotNode.txt1.text = award[1];
  10209. this.ui.myNode.rotNode.img1.rotation = 0;
  10210. }
  10211. }
  10212. getExtraAward() {
  10213. let drawTimes = DataMgr.getDrawTimes();
  10214. let awardTimes = DataMgr.getDrawAwardTimes();
  10215. let data = cfgTable.drawData[1];
  10216. let award = new AwardType();
  10217. if (awardTimes == 0) {
  10218. award.num = data.num;
  10219. award.type = data.award;
  10220. xGame.common.getAward([award], () => {
  10221. let all = Math.floor(drawTimes / 3);
  10222. DataMgr.setDrawAwardTimes(all);
  10223. this.updateDraw();
  10224. });
  10225. }
  10226. else {
  10227. award.num = parseInt(data.nextid[1]);
  10228. award.type = parseInt(data.nextid[0]);
  10229. xGame.common.getAward([award], () => {
  10230. let all = Math.floor(drawTimes / 3);
  10231. DataMgr.setDrawAwardTimes(all);
  10232. this.updateDraw();
  10233. });
  10234. }
  10235. }
  10236. closeSelf() {
  10237. this.hide();
  10238. }
  10239. playSecretaryIdle() {
  10240. let parent = this.ui.secretary.displayObject;
  10241. parent.destroyChildren();
  10242. let xx = this.ui.secretary.width / 2;
  10243. let yy = this.ui.secretary.height;
  10244. let scale = xGame.common.getSecretaryScale();
  10245. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10246. xGame.common.secretary.play(data, 0, true, parent);
  10247. }
  10248. }
  10249. UIDraw.uiName = "UIDraw";
  10250. class ui_UIFlyEft extends fgui.GComponent {
  10251. static createInstance() {
  10252. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10253. }
  10254. onConstruct() {
  10255. this.n0 = (this.getChild("n0"));
  10256. this.n1 = (this.getChild("n1"));
  10257. this.n2 = (this.getChild("n2"));
  10258. this.n3 = (this.getChild("n3"));
  10259. this.n4 = (this.getChild("n4"));
  10260. this.n5 = (this.getChild("n5"));
  10261. this.n6 = (this.getChild("n6"));
  10262. this.n7 = (this.getChild("n7"));
  10263. this.iconNode = (this.getChild("iconNode"));
  10264. this.txt = (this.getChild("txt"));
  10265. this.txtNode = (this.getChild("txtNode"));
  10266. }
  10267. }
  10268. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10269. class UIFlyEft extends UIBase {
  10270. constructor() {
  10271. super();
  10272. this.max = 8;
  10273. this.delay = 0;
  10274. }
  10275. onConstructor() {
  10276. this.ui = ui_UIFlyEft.createInstance();
  10277. this.contentPane = this.ui;
  10278. this.isEject = false;
  10279. this.isMuti = true;
  10280. this.ui.x += xGame.common.sysOffestNum;
  10281. }
  10282. getArrPos() {
  10283. if (this.iconPos && this.iconPos.length > 0)
  10284. return;
  10285. this.iconPos = [];
  10286. let temp;
  10287. for (let index = 0; index < this.max; index++) {
  10288. temp = this.ui["n" + index];
  10289. this.iconPos.push([temp.x, temp.y]);
  10290. }
  10291. }
  10292. show(stPos, edPos, num, type, callback) {
  10293. super.show();
  10294. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10295. this.getArrPos();
  10296. this.updateUI(type);
  10297. this.updatePos();
  10298. this.runFly(edPos, callback);
  10299. this.runWorlds(stPos, num);
  10300. }
  10301. updateUI(type) {
  10302. let temp;
  10303. let str;
  10304. for (let index = 0; index < this.max; index++) {
  10305. temp = this.ui["n" + index];
  10306. str = this.getIconStr(type);
  10307. temp.url = xGame.common.getGameIconUrl(str);
  10308. }
  10309. }
  10310. getIconStr(type) {
  10311. switch (type) {
  10312. case Prop.diamond:
  10313. return "ty_zs";
  10314. case Prop.coin:
  10315. return "ty_jb";
  10316. default:
  10317. break;
  10318. }
  10319. }
  10320. updatePos() {
  10321. let temp;
  10322. for (let index = 0; index < this.max; index++) {
  10323. temp = this.ui["n" + index];
  10324. temp.x = this.iconPos[index][0];
  10325. temp.y = this.iconPos[index][1];
  10326. }
  10327. }
  10328. runFly(endPos, callback) {
  10329. let all = 0;
  10330. let temp;
  10331. for (let index = 0; index < this.max; index++) {
  10332. temp = this.ui["n" + index];
  10333. temp.visible = true;
  10334. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10335. temp.visible = false;
  10336. all++;
  10337. if (all >= this.max) {
  10338. callback && callback();
  10339. }
  10340. }), 20 * index);
  10341. }
  10342. }
  10343. runWorlds(stPos, num) {
  10344. let str = "+" + num;
  10345. this.ui.txt.text = str;
  10346. let starX = stPos.x;
  10347. let starY = stPos.y + 50;
  10348. this.ui.txt.x = starX;
  10349. this.ui.txt.y = starY;
  10350. this.ui.txt.visible = true;
  10351. this.ui.txt.alpha = 1;
  10352. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10353. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10354. this.ui.txt.visible = false;
  10355. this.hide();
  10356. }));
  10357. }));
  10358. }
  10359. }
  10360. UIFlyEft.uiName = "UIFlyEft";
  10361. class ui_UIGetAward extends fgui.GComponent {
  10362. static createInstance() {
  10363. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10364. }
  10365. onConstruct() {
  10366. this.n4 = (this.getChild("n4"));
  10367. this.n0 = (this.getChild("n0"));
  10368. this.myList = (this.getChild("myList"));
  10369. this.n1 = (this.getChild("n1"));
  10370. this.eftNode = (this.getChild("eftNode"));
  10371. this.btnNode = (this.getChild("btnNode"));
  10372. this.t0 = this.getTransition("t0");
  10373. }
  10374. }
  10375. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10376. class UIGetAward extends UIBase {
  10377. constructor() {
  10378. super();
  10379. this.showTriple = true;
  10380. }
  10381. onConstructor() {
  10382. this.ui = ui_UIGetAward.createInstance();
  10383. this.contentPane = this.ui;
  10384. this.isEject = false;
  10385. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10386. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10387. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10388. }
  10389. show(arr, showTriple, callback) {
  10390. super.show();
  10391. this.ui.t0.play();
  10392. this.ui.eftNode.visible = true;
  10393. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10394. this.ui.eftNode.visible = false;
  10395. }), 1, 0, 0, 0.9);
  10396. this.awardArr = arr;
  10397. this.showTriple = showTriple;
  10398. this.callback = callback;
  10399. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10400. this.ui.myList.numItems = arr.length;
  10401. xGame.soundMgr.playSound("getaward");
  10402. }
  10403. updateSelf(index, obj) {
  10404. let temp = this.awardArr[index];
  10405. let icon = this.getIcon(temp.type);
  10406. let str = icon;
  10407. if (temp.type > 2) {
  10408. str = "s" + icon;
  10409. }
  10410. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10411. obj.myIcon.rotation = 0;
  10412. obj.numTxt.text = temp.num + "";
  10413. obj.numTxt.visible = temp.type > 2 ? false : true;
  10414. obj.nameTxt.text = this.getNameStr(temp.type);
  10415. }
  10416. renderItem(index, obj) {
  10417. this.updateSelf(index, obj);
  10418. }
  10419. tripleGetAward() {
  10420. Moyu.showVideoAd(() => {
  10421. this.getAward(3);
  10422. }, EAdType.triple);
  10423. }
  10424. normalGetAward() {
  10425. if (PlatMgr.isMisVideo())
  10426. this.tripleGetAward();
  10427. else
  10428. this.getAward();
  10429. }
  10430. getAward(times = 1) {
  10431. this.hide();
  10432. for (let index = 0; index < this.awardArr.length; index++) {
  10433. this.awardArr[index].num *= times;
  10434. }
  10435. this.callback && this.callback(times != 1);
  10436. }
  10437. getIcon(type) {
  10438. switch (type) {
  10439. case Prop.diamond:
  10440. return "ty_zs";
  10441. case Prop.coin:
  10442. return "ty_jb";
  10443. case Prop.gan1:
  10444. return "qg1";
  10445. case Prop.gan2:
  10446. return "qg2";
  10447. case Prop.gan3:
  10448. return "qg3";
  10449. case Prop.gan4:
  10450. return "qg4";
  10451. default:
  10452. break;
  10453. }
  10454. }
  10455. getNameStr(type) {
  10456. switch (type) {
  10457. case Prop.diamond:
  10458. return "Diamond";
  10459. case Prop.coin:
  10460. return "Coins";
  10461. case Prop.gan1:
  10462. case Prop.gan2:
  10463. case Prop.gan3:
  10464. case Prop.gan4:
  10465. return cfgTable.ballrodData[type - 1].name;
  10466. default:
  10467. break;
  10468. }
  10469. }
  10470. }
  10471. UIGetAward.uiName = "UIGetAward";
  10472. class Common {
  10473. constructor() {
  10474. this.convertNum = 0.025;
  10475. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10476. this.scaleV3One = new Laya.Vector3();
  10477. this.scaleV3Two = new Laya.Vector3();
  10478. this.posV4 = new Laya.Vector4();
  10479. this.showDebug = false;
  10480. this.openGuide = true;
  10481. this.rodOffest = new Laya.Vector2(0, 0);
  10482. this.rodAngle = 0;
  10483. this.gameMode = GameMode.classic;
  10484. this.bigMoveLevelIndex = 1;
  10485. this.bigMoveNeedCoin = 1000;
  10486. this.classicNiceNeddCoin = 1000;
  10487. this.passAwardCoin = 2000;
  10488. this.classicRoomType = 1;
  10489. this.maxPower = 20;
  10490. this.natureMaxPower = 5;
  10491. this.videoPower = 2;
  10492. this.powerRecoverNum = 900;
  10493. this.curPlayerSkillType = 0;
  10494. this.isNewDay = false;
  10495. this.clickedBall = false;
  10496. this.placeBallCurLevel = 0;
  10497. this.placeBallStarNum = 0;
  10498. this.longHelpLine = false;
  10499. this.maxShareDiamondTimes = 3;
  10500. this.guideStep = 0;
  10501. this.temSelfLevel = 0;
  10502. this.extraMoveNum = 0;
  10503. this.curRankID = 0;
  10504. this.rankID = {
  10505. normalStar: 12000,
  10506. wxStar: 12001
  10507. };
  10508. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10509. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10510. this.btnClickStr = "buttonclick";
  10511. this.maxSkillLevel = 10;
  10512. this.upSkillLevel = false;
  10513. this.gameStartTime = 0;
  10514. this._sysOffestNum = 0;
  10515. this.angleV2 = new Laya.Vector2();
  10516. this.rootV = new Laya.Vector2(0, 1);
  10517. this.tempDir1 = new Laya.Vector2();
  10518. this.tempDir2 = new Laya.Vector2();
  10519. this.ballSize = 33;
  10520. this.stPos = new Laya.Point();
  10521. this.edPos = new Laya.Point();
  10522. Common._instance = this;
  10523. window["common"] = this;
  10524. }
  10525. static getInstance() {
  10526. if (!this._instance) {
  10527. this._instance = new Common();
  10528. }
  10529. return this._instance;
  10530. }
  10531. get sysOffestNum() {
  10532. if (this._sysOffestNum == 0) {
  10533. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10534. }
  10535. return this._sysOffestNum;
  10536. }
  10537. testShader() {
  10538. let test = new LightShader();
  10539. test.texture = "res/d3Res/ballTexture/ball1.png";
  10540. Laya.stage.addChild(test);
  10541. }
  10542. playScale(node) {
  10543. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10544. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10545. }));
  10546. }));
  10547. }
  10548. setGroup(colli, ...group) {
  10549. let out = 0;
  10550. for (let index = 0; index < group.length; index++) {
  10551. if (index == 0) {
  10552. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10553. }
  10554. else {
  10555. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10556. }
  10557. }
  10558. colli.collisionGroup = out;
  10559. }
  10560. setCanGroupWith(colli, ...group) {
  10561. let out = 0;
  10562. for (let index = 0; index < group.length; index++) {
  10563. if (index == 0) {
  10564. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10565. }
  10566. else {
  10567. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10568. }
  10569. }
  10570. colli.canCollideWith = out;
  10571. }
  10572. loadPrefab(name, callback) {
  10573. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10574. let prefab = new Laya.Prefab();
  10575. prefab.json = obj;
  10576. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10577. callback && callback(img);
  10578. }));
  10579. }
  10580. pos2to3Convert(x, y, d3Pos) {
  10581. x = x + this.sysOffestNum;
  10582. d3Pos.setValue(x, y, 0);
  10583. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10584. if (success) {
  10585. }
  10586. else {
  10587. console.error("转换出错了。。。。。。。。");
  10588. }
  10589. }
  10590. scale2to3Convert(num) {
  10591. this.scaleV3One.setValue(0, 0, 0);
  10592. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10593. this.scaleV3Two.setValue(0, num, 0);
  10594. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10595. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10596. return outNum;
  10597. }
  10598. pos3to2Convert(d3Pos) {
  10599. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10600. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10601. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10602. d3Pos.x -= this.sysOffestNum;
  10603. }
  10604. scale3to2Convert(num) {
  10605. let scale = this.scale2to3Convert(1);
  10606. let d2Out = num / scale;
  10607. return d2Out;
  10608. }
  10609. getCollider(type, restitution = 0.9, density = 10) {
  10610. let colli;
  10611. if (type == "box")
  10612. colli = new Laya.BoxCollider();
  10613. else
  10614. colli = new Laya.CircleCollider();
  10615. colli.friction = 0;
  10616. colli.restitution = restitution;
  10617. colli.density = density;
  10618. return colli;
  10619. }
  10620. getRigbody() {
  10621. let rigy = new Laya.RigidBody();
  10622. rigy.bullet = true;
  10623. rigy.allowRotation = false;
  10624. rigy.allowSleep = false;
  10625. rigy.gravityScale = 0;
  10626. return rigy;
  10627. }
  10628. getfguiRotation(x, y) {
  10629. this.angleV2.setValue(x, y);
  10630. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10631. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10632. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10633. angle = -angle;
  10634. }
  10635. return 180 + angle;
  10636. }
  10637. getAngle(x, y) {
  10638. this.angleV2.setValue(x, y);
  10639. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10640. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10641. return angle;
  10642. }
  10643. randomNum(a, b) {
  10644. return a + Math.floor((b - a + 1) * Math.random());
  10645. }
  10646. getRandArrEle(arr) {
  10647. return arr[Math.floor(arr.length * Math.random())];
  10648. }
  10649. getSign(val) {
  10650. return val >= 0 ? 1 : -1;
  10651. }
  10652. botherArr(arr) {
  10653. let times = arr.length + 2;
  10654. let length = arr.length;
  10655. let a;
  10656. let b;
  10657. let temp;
  10658. for (let index = 0; index < times; index++) {
  10659. a = Math.floor(Math.random() * length);
  10660. b = Math.floor(Math.random() * length);
  10661. temp = arr[a];
  10662. arr[a] = arr[b];
  10663. arr[b] = temp;
  10664. }
  10665. }
  10666. getGameIconUrl(id) {
  10667. return "ui://game/" + id;
  10668. }
  10669. getComponentUrl(id) {
  10670. return "ui://game/" + id;
  10671. }
  10672. getAnimation() {
  10673. }
  10674. judgeSkillType(type = SkillType.highSpace) {
  10675. if (this.gameMode == GameMode.classic)
  10676. return;
  10677. let gameMgr = this.gameMgr;
  10678. if (gameMgr.selfTurn) {
  10679. if (gameMgr.selfCurSkill == type) {
  10680. return true;
  10681. }
  10682. }
  10683. else {
  10684. if (gameMgr.aiCurSkill == type) {
  10685. return true;
  10686. }
  10687. }
  10688. }
  10689. ballColliHole(collider) {
  10690. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10691. xGame.common.gameMgr.isFirstInGame = false;
  10692. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10693. }
  10694. collider.owner.mySrc.checkWrongBall();
  10695. }
  10696. getArrMaxEle(arr) {
  10697. let max = -Infinity;
  10698. for (let index = 0; index < arr.length; index++) {
  10699. max = Math.max(arr[index], max);
  10700. }
  10701. return max;
  10702. }
  10703. getArrMinEle(arr) {
  10704. let min = Infinity;
  10705. for (let index = 0; index < arr.length; index++) {
  10706. min = Math.min(arr[index], min);
  10707. }
  10708. return min;
  10709. }
  10710. playRandomMutiBallBigSkillSound() {
  10711. if (Math.random() <= 0.5)
  10712. return;
  10713. let rand = this.randomNum(1, 6);
  10714. let str = "ganfa0" + rand;
  10715. xGame.soundMgr.playSound(str);
  10716. }
  10717. showOneCamera(type) {
  10718. let object = xGame.common.d3World.cameraObj;
  10719. for (const key in object) {
  10720. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10721. object[key].init();
  10722. object[key].owner.active = key == type;
  10723. }
  10724. }
  10725. }
  10726. checkBallOverBorder(x, y) {
  10727. let radius = 17;
  10728. let condition = this._checkBorder(x + radius, y) ||
  10729. this._checkBorder(x - radius, y) ||
  10730. this._checkBorder(x, y + radius) ||
  10731. this._checkBorder(x, y - radius);
  10732. if (condition) {
  10733. return true;
  10734. }
  10735. }
  10736. _checkBorder(x, y) {
  10737. let borderRect = this.d2World.borderRect;
  10738. let xOffest = 20;
  10739. let yOffest = 20;
  10740. if (y <= borderRect.y - yOffest) {
  10741. return true;
  10742. }
  10743. if (y >= borderRect.y + borderRect.height + yOffest) {
  10744. return true;
  10745. }
  10746. if (x <= borderRect.x - xOffest) {
  10747. return true;
  10748. }
  10749. if (x >= borderRect.x + borderRect.width + xOffest) {
  10750. return true;
  10751. }
  10752. }
  10753. initWeight(cfg) {
  10754. let allCfgData = { data: {}, allWeightNum: 0 };
  10755. let weightCfg = allCfgData.data;
  10756. let weight = 0;
  10757. for (const key in cfg) {
  10758. weightCfg[key] = {};
  10759. weightCfg[key].id = cfg[key].id;
  10760. weightCfg[key].minWeight = weight;
  10761. weight += cfg[key].weight;
  10762. weightCfg[key].maxWeight = weight;
  10763. }
  10764. allCfgData.allWeightNum = weight;
  10765. return allCfgData;
  10766. }
  10767. getRandomWeightData(cfg) {
  10768. let weightCfg = cfg.data;
  10769. let allWeightNum = cfg.allWeightNum;
  10770. let rand = Math.floor(Math.random() * allWeightNum);
  10771. for (const key in weightCfg) {
  10772. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10773. return weightCfg[key];
  10774. }
  10775. }
  10776. return weightCfg[1];
  10777. }
  10778. showGirlTalkPop(wordsIndex, node, msgNode) {
  10779. node.visible = true;
  10780. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10781. node.t0.play(Laya.Handler.create(this, () => {
  10782. node.visible = false;
  10783. }));
  10784. }
  10785. stopGirlPop(node) {
  10786. node.t0.stop();
  10787. node.visible = false;
  10788. }
  10789. createHead(loader, url, size = 107) {
  10790. if (Laya.Browser.name == "Browser") {
  10791. loader.url = url;
  10792. return;
  10793. }
  10794. if (Moyu.isTT) {
  10795. let localImage = new Image();
  10796. localImage.src = url;
  10797. localImage.onload = () => {
  10798. let t2d = new Laya.Texture2D();
  10799. t2d.width = size;
  10800. t2d.height = size;
  10801. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10802. t2d.loadImageSource(localImage);
  10803. };
  10804. }
  10805. else {
  10806. console.log('zh:url=', url);
  10807. loader.url = url;
  10808. }
  10809. }
  10810. addTestCoin(num) {
  10811. DataMgr.setCoin(num);
  10812. }
  10813. addTestDiamond(num) {
  10814. DataMgr.setDiamond(num);
  10815. }
  10816. addTestSkill() {
  10817. DataMgr.setBigSkill(0, 99);
  10818. DataMgr.setBigSkill(1, 99);
  10819. DataMgr.setBigSkill(2, 99);
  10820. }
  10821. playClassicEmotion(number, x, y) {
  10822. if (this.gameMode == GameMode.bigMove)
  10823. return;
  10824. let randIndex = this.randomNum(0, 2);
  10825. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10826. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10827. if (this.gameMgr.selfTurn) {
  10828. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10829. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10830. }
  10831. else {
  10832. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10833. }
  10834. else {
  10835. if (number == this.gameMgr.blackNum) {
  10836. if (this.gameMgr.selfBallArr.length == 0) {
  10837. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10838. }
  10839. else {
  10840. }
  10841. }
  10842. else {
  10843. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10844. }
  10845. }
  10846. }
  10847. }
  10848. else {
  10849. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10850. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10851. }
  10852. else {
  10853. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10854. }
  10855. else {
  10856. if (number == this.gameMgr.blackNum) {
  10857. if (this.gameMgr.aiBallArr.length == 0) {
  10858. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10859. }
  10860. else {
  10861. }
  10862. }
  10863. else {
  10864. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10865. }
  10866. }
  10867. }
  10868. }
  10869. }
  10870. playHappySound(number) {
  10871. if (this.gameMode != GameMode.classic)
  10872. return;
  10873. if (number == 8)
  10874. return;
  10875. let play = false;
  10876. if (this.gameMgr.selfTurn) {
  10877. if (this.gameMgr.ensureBallType) {
  10878. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10879. play = true;
  10880. }
  10881. }
  10882. else {
  10883. play = true;
  10884. }
  10885. }
  10886. else {
  10887. if (this.gameMgr.ensureBallType) {
  10888. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10889. play = true;
  10890. }
  10891. }
  10892. else {
  10893. play = true;
  10894. }
  10895. }
  10896. if (play)
  10897. xGame.soundMgr.playSound("applause");
  10898. }
  10899. destroyClassicEmotion() {
  10900. if (this.gameMode == GameMode.bigMove)
  10901. return;
  10902. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10903. parent.destroyChildren();
  10904. }
  10905. playAwardSpine(x, y) {
  10906. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10907. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10908. this.awardSpine.play(data, 0, false, parent);
  10909. }
  10910. destroyAwardSpine() {
  10911. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10912. parent.destroyChildren();
  10913. }
  10914. isBlock(bx, by, hx, hy, except = null) {
  10915. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10916. let balls = xGame.common.d2World.ballArr;
  10917. let outArr = [];
  10918. for (let index = 0; index < balls.length; index++) {
  10919. let obj = balls[index];
  10920. if (obj.number == 0)
  10921. continue;
  10922. if (obj == except)
  10923. continue;
  10924. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10925. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10926. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10927. if (num >= 1)
  10928. num = 1;
  10929. if (num < 0)
  10930. continue;
  10931. let gap = Math.sin(Math.acos(num)) * dis;
  10932. if (gap < this.ballSize) {
  10933. outArr.push({
  10934. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10935. disHon: Math.cos(Math.acos(num)) * dis,
  10936. disVer: Math.sin(Math.acos(num)) * dis,
  10937. src: balls[index],
  10938. dir: this.tempDir1
  10939. });
  10940. }
  10941. }
  10942. if (outArr.length > 0) {
  10943. outArr.sort((a, b) => { return a.dis - b.dis; });
  10944. return outArr[0];
  10945. }
  10946. }
  10947. AngleBetween(vector1, vector2) {
  10948. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10949. return rad * (180 / Math.PI);
  10950. }
  10951. getSecretaryScale() {
  10952. if (this.secretary.spineName == "mishu") {
  10953. return 1.28;
  10954. }
  10955. else {
  10956. return 1.024;
  10957. }
  10958. }
  10959. signAwardContainsRod(arr) {
  10960. let temp;
  10961. for (let index = 0; index < arr.length; index++) {
  10962. temp = arr[index].split('-')[0];
  10963. if (parseInt(temp) > 2) {
  10964. return true;
  10965. }
  10966. }
  10967. }
  10968. judgeSameDay() {
  10969. let lastTime = DataMgr.getSignTime();
  10970. let curTime = new Date().getTime();
  10971. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10972. return true;
  10973. }
  10974. return false;
  10975. }
  10976. getAward(arr, callback) {
  10977. let showTriple = arr[0].type <= 2;
  10978. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10979. let temp;
  10980. for (let index = 0; index < arr.length; index++) {
  10981. temp = arr[index];
  10982. switch (temp.type) {
  10983. case 1:
  10984. this.playObjFlyAnim(temp.num, temp.type);
  10985. break;
  10986. case 2:
  10987. this.playObjFlyAnim(temp.num, temp.type);
  10988. break;
  10989. case 3:
  10990. case 4:
  10991. case 5:
  10992. case 6:
  10993. DataMgr.setBallRod(temp.type - 2, 1);
  10994. DataMgr.setCurBallRod(temp.type - 2);
  10995. break;
  10996. default:
  10997. break;
  10998. }
  10999. }
  11000. callback && callback(watchVideo);
  11001. });
  11002. }
  11003. getMoneyNode() {
  11004. let moneyNode;
  11005. let sign = xGame.uiMgr.getUI(UISign);
  11006. let draw = xGame.uiMgr.getUI(UIDraw);
  11007. let end = xGame.uiMgr.getUI(UIGameEnd);
  11008. let skill = xGame.uiMgr.getUI(UISkill);
  11009. if (sign && !sign.isHide)
  11010. moneyNode = sign.ui.moneyNode;
  11011. if (draw && !draw.isHide)
  11012. moneyNode = draw.ui.moneyNode;
  11013. if (end && !end.isHide)
  11014. moneyNode = end.ui.moneyNode;
  11015. if (skill && !skill.isHide)
  11016. moneyNode = skill.ui.moneyNode;
  11017. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11018. let main = xGame.uiMgr.getUI(UIMain);
  11019. if (condition1 && main && !main.isHide) {
  11020. moneyNode = main.ui.moneyNode;
  11021. }
  11022. return moneyNode;
  11023. }
  11024. playObjFlyAnim(num, type, callback = null) {
  11025. this.stPos.x = Laya.stage.width / 2;
  11026. this.stPos.y = Laya.stage.height / 2;
  11027. let moneyNode = this.getMoneyNode();
  11028. switch (type) {
  11029. case Prop.diamond:
  11030. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11031. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11032. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11033. this.edPos.x /= 2;
  11034. this.edPos.y /= 2;
  11035. break;
  11036. case Prop.coin:
  11037. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11038. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11039. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11040. this.edPos.x /= 2;
  11041. this.edPos.y /= 2;
  11042. break;
  11043. default:
  11044. break;
  11045. }
  11046. xGame.soundMgr.playSound("coinbag");
  11047. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11048. switch (type) {
  11049. case Prop.diamond:
  11050. DataMgr.setDiamond(num);
  11051. break;
  11052. case Prop.coin:
  11053. DataMgr.setCoin(num);
  11054. break;
  11055. default:
  11056. break;
  11057. }
  11058. callback && callback();
  11059. });
  11060. }
  11061. autoPopUIView() {
  11062. let arr = [];
  11063. let sign = this.judgeSameDay() ? false : true;
  11064. if (sign)
  11065. arr.push("sign");
  11066. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11067. if (draw)
  11068. arr.push("draw");
  11069. if (arr.length <= 0)
  11070. return;
  11071. let str = this.getRandArrEle(arr);
  11072. switch (str) {
  11073. case "sign":
  11074. xGame.uiMgr.Show(UISign);
  11075. break;
  11076. case "draw":
  11077. xGame.uiMgr.Show(UIDraw);
  11078. break;
  11079. default:
  11080. break;
  11081. }
  11082. }
  11083. getMSTime(time) {
  11084. let min = Math.floor(time / 60);
  11085. let sec = Math.floor((time - min * 60));
  11086. if (sec < 10)
  11087. sec = "0" + sec;
  11088. if (min < 10)
  11089. min = "0" + min;
  11090. return `${min}:${sec}`;
  11091. }
  11092. testPower() {
  11093. DataMgr.setPower(0, false);
  11094. }
  11095. getAllStarNum() {
  11096. let data = DataMgr.getPlaceBallLevelList();
  11097. let out = 0;
  11098. for (let index = 0; index < data.length; index++) {
  11099. out += data[index].star;
  11100. }
  11101. return out;
  11102. }
  11103. recoverCameraView() {
  11104. Laya.timer.once(900, this, () => {
  11105. xGame.common.showOneCamera("mainCamera");
  11106. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11107. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11108. xGame.common.gameUI.ui.border.alpha = 0;
  11109. if (Laya.physicsTimer.scale < 1) {
  11110. Laya.physicsTimer.scale = 1;
  11111. }
  11112. }
  11113. });
  11114. }
  11115. getClassicLevel() {
  11116. let successTimes = DataMgr.getClassicTimes();
  11117. let needKey = "";
  11118. let lastKey = "";
  11119. let cfg = cfgTable.classictimesData;
  11120. let data;
  11121. for (const key in cfg) {
  11122. data = cfg[key];
  11123. if (successTimes <= data.times) {
  11124. needKey = key;
  11125. }
  11126. lastKey = key;
  11127. }
  11128. if (needKey == "")
  11129. needKey = lastKey;
  11130. return cfg[needKey];
  11131. }
  11132. }
  11133. Common._instance = null;
  11134. class ui_Component92 extends fgui.GComponent {
  11135. static createInstance() {
  11136. return (fgui.UIPackage.createObject("game", "Component92"));
  11137. }
  11138. onConstruct() {
  11139. this.n0 = (this.getChild("n0"));
  11140. }
  11141. }
  11142. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11143. class ui_Component129 extends fgui.GProgressBar {
  11144. static createInstance() {
  11145. return (fgui.UIPackage.createObject("game", "Component129"));
  11146. }
  11147. onConstruct() {
  11148. this.bar_v = (this.getChild("bar_v"));
  11149. this.n84 = (this.getChild("n84"));
  11150. }
  11151. }
  11152. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11153. class ui_Component130 extends fgui.GComponent {
  11154. static createInstance() {
  11155. return (fgui.UIPackage.createObject("game", "Component130"));
  11156. }
  11157. onConstruct() {
  11158. this.ani = (this.getChild("ani"));
  11159. this.t0 = this.getTransition("t0");
  11160. }
  11161. }
  11162. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11163. class ui_powerEft extends fgui.GComponent {
  11164. static createInstance() {
  11165. return (fgui.UIPackage.createObject("game", "powerEft"));
  11166. }
  11167. onConstruct() {
  11168. this.ani = (this.getChild("ani"));
  11169. this.n88 = (this.getChild("n88"));
  11170. this.n89 = (this.getChild("n89"));
  11171. }
  11172. }
  11173. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11174. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11175. static createInstance() {
  11176. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11177. }
  11178. onConstruct() {
  11179. this.c1 = this.getController("c1");
  11180. this.n2 = (this.getChild("n2"));
  11181. this.n22 = (this.getChild("n22"));
  11182. this.n23 = (this.getChild("n23"));
  11183. this.n15 = (this.getChild("n15"));
  11184. this.challenge = (this.getChild("challenge"));
  11185. this.n17 = (this.getChild("n17"));
  11186. this.n3 = (this.getChild("n3"));
  11187. this.starNode = (this.getChild("starNode"));
  11188. this.levelTxt = (this.getChild("levelTxt"));
  11189. this.n14 = (this.getChild("n14"));
  11190. this.n19 = (this.getChild("n19"));
  11191. this.n20 = (this.getChild("n20"));
  11192. this.n21 = (this.getChild("n21"));
  11193. this.special = (this.getChild("special"));
  11194. }
  11195. }
  11196. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11197. class ui_Component79 extends fgui.GComponent {
  11198. static createInstance() {
  11199. return (fgui.UIPackage.createObject("game", "Component79"));
  11200. }
  11201. onConstruct() {
  11202. this.c1 = this.getController("c1");
  11203. this.n7 = (this.getChild("n7"));
  11204. this.n8 = (this.getChild("n8"));
  11205. this.n9 = (this.getChild("n9"));
  11206. this.n10 = (this.getChild("n10"));
  11207. this.n11 = (this.getChild("n11"));
  11208. this.n12 = (this.getChild("n12"));
  11209. }
  11210. }
  11211. ui_Component79.URL = "ui://isxx5ak7avag477";
  11212. class ui_Component80 extends fgui.GComponent {
  11213. static createInstance() {
  11214. return (fgui.UIPackage.createObject("game", "Component80"));
  11215. }
  11216. onConstruct() {
  11217. this.n0 = (this.getChild("n0"));
  11218. this.n1 = (this.getChild("n1"));
  11219. this.myList = (this.getChild("myList"));
  11220. this.t0 = this.getTransition("t0");
  11221. }
  11222. }
  11223. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11224. class ui_SignNormal extends fgui.GComponent {
  11225. static createInstance() {
  11226. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11227. }
  11228. onConstruct() {
  11229. this.c1 = this.getController("c1");
  11230. this.n7 = (this.getChild("n7"));
  11231. this.n15 = (this.getChild("n15"));
  11232. this.titleTxt = (this.getChild("titleTxt"));
  11233. this.n8 = (this.getChild("n8"));
  11234. this.myIcon = (this.getChild("myIcon"));
  11235. this.numTxt = (this.getChild("numTxt"));
  11236. this.n12 = (this.getChild("n12"));
  11237. this.n13 = (this.getChild("n13"));
  11238. this.n17 = (this.getChild("n17"));
  11239. this.n14 = (this.getChild("n14"));
  11240. }
  11241. }
  11242. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11243. class ui_screenNode extends fgui.GComponent {
  11244. static createInstance() {
  11245. return (fgui.UIPackage.createObject("game", "screenNode"));
  11246. }
  11247. onConstruct() {
  11248. this.n9 = (this.getChild("n9"));
  11249. this.screenImg = (this.getChild("screenImg"));
  11250. }
  11251. }
  11252. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11253. class ui_GetAwrad_com1 extends fgui.GComponent {
  11254. static createInstance() {
  11255. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11256. }
  11257. onConstruct() {
  11258. this.n38 = (this.getChild("n38"));
  11259. this.n39 = (this.getChild("n39"));
  11260. this.n40 = (this.getChild("n40"));
  11261. this.t0 = this.getTransition("t0");
  11262. this.t1 = this.getTransition("t1");
  11263. }
  11264. }
  11265. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11266. class ui_GetAwrad_com2 extends fgui.GComponent {
  11267. static createInstance() {
  11268. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11269. }
  11270. onConstruct() {
  11271. this.n39 = (this.getChild("n39"));
  11272. this.n40 = (this.getChild("n40"));
  11273. this.t0 = this.getTransition("t0");
  11274. }
  11275. }
  11276. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11277. class ui_Component128 extends fgui.GComponent {
  11278. static createInstance() {
  11279. return (fgui.UIPackage.createObject("game", "Component128"));
  11280. }
  11281. onConstruct() {
  11282. this.n38 = (this.getChild("n38"));
  11283. this.n40 = (this.getChild("n40"));
  11284. }
  11285. }
  11286. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11287. class ui_Component100_1 extends fgui.GComponent {
  11288. static createInstance() {
  11289. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11290. }
  11291. onConstruct() {
  11292. this.myNode = (this.getChild("myNode"));
  11293. this.t0 = this.getTransition("t0");
  11294. }
  11295. }
  11296. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11297. class ui_Component142 extends fgui.GComponent {
  11298. static createInstance() {
  11299. return (fgui.UIPackage.createObject("game", "Component142"));
  11300. }
  11301. onConstruct() {
  11302. this.n41 = (this.getChild("n41"));
  11303. this.n42 = (this.getChild("n42"));
  11304. }
  11305. }
  11306. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11307. class ui_main_guang extends fgui.GComponent {
  11308. static createInstance() {
  11309. return (fgui.UIPackage.createObject("game", "main_guang"));
  11310. }
  11311. onConstruct() {
  11312. this.n1 = (this.getChild("n1"));
  11313. this.n2 = (this.getChild("n2"));
  11314. this.n3 = (this.getChild("n3"));
  11315. this.n4 = (this.getChild("n4"));
  11316. this.n5 = (this.getChild("n5"));
  11317. this.n6 = (this.getChild("n6"));
  11318. this.n8 = (this.getChild("n8"));
  11319. this.t0 = this.getTransition("t0");
  11320. }
  11321. }
  11322. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11323. class ui_try_com1 extends fgui.GComponent {
  11324. static createInstance() {
  11325. return (fgui.UIPackage.createObject("game", "try_com1"));
  11326. }
  11327. onConstruct() {
  11328. this.c1 = this.getController("c1");
  11329. this.n0 = (this.getChild("n0"));
  11330. this.n2 = (this.getChild("n2"));
  11331. this.cancelBtn = (this.getChild("cancelBtn"));
  11332. this.videoBtn = (this.getChild("videoBtn"));
  11333. this.n9 = (this.getChild("n9"));
  11334. this.n24 = (this.getChild("n24"));
  11335. this.titleTxt = (this.getChild("titleTxt"));
  11336. this.n32 = (this.getChild("n32"));
  11337. this.n29 = (this.getChild("n29"));
  11338. this.n36 = (this.getChild("n36"));
  11339. this.txtTime = (this.getChild("txtTime"));
  11340. this.t0 = this.getTransition("t0");
  11341. }
  11342. }
  11343. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11344. class ui_try_com2 extends fgui.GComponent {
  11345. static createInstance() {
  11346. return (fgui.UIPackage.createObject("game", "try_com2"));
  11347. }
  11348. onConstruct() {
  11349. this.skillicon = (this.getChild("skillicon"));
  11350. this.n35 = (this.getChild("n35"));
  11351. this.n31 = (this.getChild("n31"));
  11352. this.n32 = (this.getChild("n32"));
  11353. this.n33 = (this.getChild("n33"));
  11354. this.n34 = (this.getChild("n34"));
  11355. }
  11356. }
  11357. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11358. class ui_try_com3 extends fgui.GComponent {
  11359. static createInstance() {
  11360. return (fgui.UIPackage.createObject("game", "try_com3"));
  11361. }
  11362. onConstruct() {
  11363. this.n33 = (this.getChild("n33"));
  11364. this.n34 = (this.getChild("n34"));
  11365. this.n35 = (this.getChild("n35"));
  11366. this.t0 = this.getTransition("t0");
  11367. }
  11368. }
  11369. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11370. class ui_huihe1 extends fgui.GComponent {
  11371. static createInstance() {
  11372. return (fgui.UIPackage.createObject("game", "huihe1"));
  11373. }
  11374. onConstruct() {
  11375. this.n0 = (this.getChild("n0"));
  11376. this.n1 = (this.getChild("n1"));
  11377. this.t0 = this.getTransition("t0");
  11378. }
  11379. }
  11380. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11381. class ui_huihe2 extends fgui.GComponent {
  11382. static createInstance() {
  11383. return (fgui.UIPackage.createObject("game", "huihe2"));
  11384. }
  11385. onConstruct() {
  11386. this.n0 = (this.getChild("n0"));
  11387. this.n1 = (this.getChild("n1"));
  11388. this.t0 = this.getTransition("t0");
  11389. }
  11390. }
  11391. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11392. class ui_Component143 extends fgui.GComponent {
  11393. static createInstance() {
  11394. return (fgui.UIPackage.createObject("game", "Component143"));
  11395. }
  11396. onConstruct() {
  11397. this.n3 = (this.getChild("n3"));
  11398. this.n4 = (this.getChild("n4"));
  11399. this.n5 = (this.getChild("n5"));
  11400. this.n6 = (this.getChild("n6"));
  11401. this.n7 = (this.getChild("n7"));
  11402. this.n8 = (this.getChild("n8"));
  11403. this.n9 = (this.getChild("n9"));
  11404. this.n10 = (this.getChild("n10"));
  11405. this.t0 = this.getTransition("t0");
  11406. }
  11407. }
  11408. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11409. class ui_dh_jingbi2 extends fgui.GComponent {
  11410. static createInstance() {
  11411. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11412. }
  11413. onConstruct() {
  11414. this.n0 = (this.getChild("n0"));
  11415. this.n1 = (this.getChild("n1"));
  11416. this.n2 = (this.getChild("n2"));
  11417. this.n3 = (this.getChild("n3"));
  11418. this.n4 = (this.getChild("n4"));
  11419. this.n5 = (this.getChild("n5"));
  11420. this.n6 = (this.getChild("n6"));
  11421. this.n8 = (this.getChild("n8"));
  11422. this.n10 = (this.getChild("n10"));
  11423. this.t0 = this.getTransition("t0");
  11424. }
  11425. }
  11426. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11427. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11428. static createInstance() {
  11429. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11430. }
  11431. onConstruct() {
  11432. this.n1 = (this.getChild("n1"));
  11433. this.n4 = (this.getChild("n4"));
  11434. this.t0 = this.getTransition("t0");
  11435. }
  11436. }
  11437. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11438. class ui_dh_jingbi3 extends fgui.GComponent {
  11439. static createInstance() {
  11440. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11441. }
  11442. onConstruct() {
  11443. this.n0 = (this.getChild("n0"));
  11444. this.n1 = (this.getChild("n1"));
  11445. this.n2 = (this.getChild("n2"));
  11446. this.n3 = (this.getChild("n3"));
  11447. this.n4 = (this.getChild("n4"));
  11448. this.n5 = (this.getChild("n5"));
  11449. this.n6 = (this.getChild("n6"));
  11450. this.n8 = (this.getChild("n8"));
  11451. this.n10 = (this.getChild("n10"));
  11452. this.t0 = this.getTransition("t0");
  11453. }
  11454. }
  11455. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11456. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11457. static createInstance() {
  11458. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11459. }
  11460. onConstruct() {
  11461. this.n3 = (this.getChild("n3"));
  11462. this.n1 = (this.getChild("n1"));
  11463. this.t0 = this.getTransition("t0");
  11464. }
  11465. }
  11466. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11467. class ui_hb_jinbi1 extends fgui.GButton {
  11468. static createInstance() {
  11469. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11470. }
  11471. onConstruct() {
  11472. this.n20 = (this.getChild("n20"));
  11473. this.n25 = (this.getChild("n25"));
  11474. this.coinTxt = (this.getChild("coinTxt"));
  11475. this.n28 = (this.getChild("n28"));
  11476. this.n32 = (this.getChild("n32"));
  11477. this.n38 = (this.getChild("n38"));
  11478. this.n45 = (this.getChild("n45"));
  11479. this.getTips = (this.getChild("getTips"));
  11480. this.n39 = (this.getChild("n39"));
  11481. this.diamondTxt = (this.getChild("diamondTxt"));
  11482. this.n41 = (this.getChild("n41"));
  11483. this.n42 = (this.getChild("n42"));
  11484. this.n46 = (this.getChild("n46"));
  11485. this.n47 = (this.getChild("n47"));
  11486. this.n48 = (this.getChild("n48"));
  11487. this.t0 = this.getTransition("t0");
  11488. }
  11489. }
  11490. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11491. class ui_hb_jinbi2 extends fgui.GButton {
  11492. static createInstance() {
  11493. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11494. }
  11495. onConstruct() {
  11496. this.n20 = (this.getChild("n20"));
  11497. this.n25 = (this.getChild("n25"));
  11498. this.coinTxt = (this.getChild("coinTxt"));
  11499. this.n28 = (this.getChild("n28"));
  11500. this.n32 = (this.getChild("n32"));
  11501. this.n38 = (this.getChild("n38"));
  11502. this.n39 = (this.getChild("n39"));
  11503. this.diamondTxt = (this.getChild("diamondTxt"));
  11504. this.n41 = (this.getChild("n41"));
  11505. this.n42 = (this.getChild("n42"));
  11506. this.n43 = (this.getChild("n43"));
  11507. this.n44 = (this.getChild("n44"));
  11508. this.n45 = (this.getChild("n45"));
  11509. this.t0 = this.getTransition("t0");
  11510. }
  11511. }
  11512. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11513. class ui_hb_jinbi3 extends fgui.GButton {
  11514. static createInstance() {
  11515. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11516. }
  11517. onConstruct() {
  11518. this.n20 = (this.getChild("n20"));
  11519. this.n25 = (this.getChild("n25"));
  11520. this.coinTxt = (this.getChild("coinTxt"));
  11521. this.n28 = (this.getChild("n28"));
  11522. this.n32 = (this.getChild("n32"));
  11523. this.n38 = (this.getChild("n38"));
  11524. this.n39 = (this.getChild("n39"));
  11525. this.diamondTxt = (this.getChild("diamondTxt"));
  11526. this.n41 = (this.getChild("n41"));
  11527. this.n42 = (this.getChild("n42"));
  11528. this.n43 = (this.getChild("n43"));
  11529. this.n44 = (this.getChild("n44"));
  11530. this.n45 = (this.getChild("n45"));
  11531. this.t0 = this.getTransition("t0");
  11532. }
  11533. }
  11534. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11535. class ui_Component104 extends fgui.GComponent {
  11536. static createInstance() {
  11537. return (fgui.UIPackage.createObject("game", "Component104"));
  11538. }
  11539. onConstruct() {
  11540. this.c1 = this.getController("c1");
  11541. this.n12 = (this.getChild("n12"));
  11542. this.coinBtn = (this.getChild("coinBtn"));
  11543. this.diamondBtn = (this.getChild("diamondBtn"));
  11544. this.node3 = (this.getChild("node3"));
  11545. this.node4 = (this.getChild("node4"));
  11546. this.node5 = (this.getChild("node5"));
  11547. this.node1 = (this.getChild("node1"));
  11548. this.node2 = (this.getChild("node2"));
  11549. this.node6 = (this.getChild("node6"));
  11550. this.t0 = this.getTransition("t0");
  11551. }
  11552. }
  11553. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11554. class ui_Component105 extends fgui.GButton {
  11555. static createInstance() {
  11556. return (fgui.UIPackage.createObject("game", "Component105"));
  11557. }
  11558. onConstruct() {
  11559. this.c1 = this.getController("c1");
  11560. this.n49 = (this.getChild("n49"));
  11561. this.n18 = (this.getChild("n18"));
  11562. this.n46 = (this.getChild("n46"));
  11563. this.n48 = (this.getChild("n48"));
  11564. }
  11565. }
  11566. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11567. class ui_Component106 extends fgui.GButton {
  11568. static createInstance() {
  11569. return (fgui.UIPackage.createObject("game", "Component106"));
  11570. }
  11571. onConstruct() {
  11572. this.c1 = this.getController("c1");
  11573. this.n49 = (this.getChild("n49"));
  11574. this.n18 = (this.getChild("n18"));
  11575. this.n46 = (this.getChild("n46"));
  11576. this.n48 = (this.getChild("n48"));
  11577. }
  11578. }
  11579. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11580. class ui_hb_zs1 extends fgui.GButton {
  11581. static createInstance() {
  11582. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11583. }
  11584. onConstruct() {
  11585. this.c1 = this.getController("c1");
  11586. this.n20 = (this.getChild("n20"));
  11587. this.n21 = (this.getChild("n21"));
  11588. this.n26 = (this.getChild("n26"));
  11589. this.n27 = (this.getChild("n27"));
  11590. this.shareTxt = (this.getChild("shareTxt"));
  11591. this.n32 = (this.getChild("n32"));
  11592. this.n38 = (this.getChild("n38"));
  11593. this.n39 = (this.getChild("n39"));
  11594. this.n44 = (this.getChild("n44"));
  11595. this.diamondTxt = (this.getChild("diamondTxt"));
  11596. this.n41 = (this.getChild("n41"));
  11597. this.n45 = (this.getChild("n45"));
  11598. this.n47 = (this.getChild("n47"));
  11599. this.n48 = (this.getChild("n48"));
  11600. this.randTxt = (this.getChild("randTxt"));
  11601. this.n50 = (this.getChild("n50"));
  11602. this.t0 = this.getTransition("t0");
  11603. }
  11604. }
  11605. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11606. class ui_dh_zs1 extends fgui.GComponent {
  11607. static createInstance() {
  11608. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11609. }
  11610. onConstruct() {
  11611. this.n10 = (this.getChild("n10"));
  11612. this.n9 = (this.getChild("n9"));
  11613. this.n1 = (this.getChild("n1"));
  11614. this.n2 = (this.getChild("n2"));
  11615. this.n3 = (this.getChild("n3"));
  11616. this.n4 = (this.getChild("n4"));
  11617. this.n5 = (this.getChild("n5"));
  11618. this.n6 = (this.getChild("n6"));
  11619. this.n8 = (this.getChild("n8"));
  11620. this.n11 = (this.getChild("n11"));
  11621. this.t0 = this.getTransition("t0");
  11622. }
  11623. }
  11624. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11625. class ui_dh_zs1_1 extends fgui.GComponent {
  11626. static createInstance() {
  11627. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11628. }
  11629. onConstruct() {
  11630. this.n3 = (this.getChild("n3"));
  11631. this.n1 = (this.getChild("n1"));
  11632. this.t0 = this.getTransition("t0");
  11633. }
  11634. }
  11635. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11636. class ui_hb_zs2 extends fgui.GButton {
  11637. static createInstance() {
  11638. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11639. }
  11640. onConstruct() {
  11641. this.n20 = (this.getChild("n20"));
  11642. this.n21 = (this.getChild("n21"));
  11643. this.n26 = (this.getChild("n26"));
  11644. this.n27 = (this.getChild("n27"));
  11645. this.n32 = (this.getChild("n32"));
  11646. this.n38 = (this.getChild("n38"));
  11647. this.n39 = (this.getChild("n39"));
  11648. this.n44 = (this.getChild("n44"));
  11649. this.diamondTxt = (this.getChild("diamondTxt"));
  11650. this.n41 = (this.getChild("n41"));
  11651. this.n45 = (this.getChild("n45"));
  11652. this.t0 = this.getTransition("t0");
  11653. }
  11654. }
  11655. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11656. class ui_hb_zs3 extends fgui.GButton {
  11657. static createInstance() {
  11658. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11659. }
  11660. onConstruct() {
  11661. this.n20 = (this.getChild("n20"));
  11662. this.n21 = (this.getChild("n21"));
  11663. this.n26 = (this.getChild("n26"));
  11664. this.n27 = (this.getChild("n27"));
  11665. this.n32 = (this.getChild("n32"));
  11666. this.n38 = (this.getChild("n38"));
  11667. this.n47 = (this.getChild("n47"));
  11668. this.t0 = this.getTransition("t0");
  11669. }
  11670. }
  11671. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11672. class ui_dh_zs2 extends fgui.GComponent {
  11673. static createInstance() {
  11674. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11675. }
  11676. onConstruct() {
  11677. this.n10 = (this.getChild("n10"));
  11678. this.n9 = (this.getChild("n9"));
  11679. this.n1 = (this.getChild("n1"));
  11680. this.n2 = (this.getChild("n2"));
  11681. this.n3 = (this.getChild("n3"));
  11682. this.n4 = (this.getChild("n4"));
  11683. this.n5 = (this.getChild("n5"));
  11684. this.n6 = (this.getChild("n6"));
  11685. this.n8 = (this.getChild("n8"));
  11686. this.n11 = (this.getChild("n11"));
  11687. this.t0 = this.getTransition("t0");
  11688. }
  11689. }
  11690. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11691. class ui_dh_zs2_1 extends fgui.GComponent {
  11692. static createInstance() {
  11693. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11694. }
  11695. onConstruct() {
  11696. this.n3 = (this.getChild("n3"));
  11697. this.n1 = (this.getChild("n1"));
  11698. this.t0 = this.getTransition("t0");
  11699. }
  11700. }
  11701. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11702. class ui_dh_zs3 extends fgui.GComponent {
  11703. static createInstance() {
  11704. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11705. }
  11706. onConstruct() {
  11707. this.n10 = (this.getChild("n10"));
  11708. this.n9 = (this.getChild("n9"));
  11709. this.n1 = (this.getChild("n1"));
  11710. this.n2 = (this.getChild("n2"));
  11711. this.n3 = (this.getChild("n3"));
  11712. this.n4 = (this.getChild("n4"));
  11713. this.n5 = (this.getChild("n5"));
  11714. this.n6 = (this.getChild("n6"));
  11715. this.n8 = (this.getChild("n8"));
  11716. this.n11 = (this.getChild("n11"));
  11717. this.t0 = this.getTransition("t0");
  11718. }
  11719. }
  11720. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11721. class ui_dh_zs3_1 extends fgui.GComponent {
  11722. static createInstance() {
  11723. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11724. }
  11725. onConstruct() {
  11726. this.n3 = (this.getChild("n3"));
  11727. this.n1 = (this.getChild("n1"));
  11728. this.t0 = this.getTransition("t0");
  11729. }
  11730. }
  11731. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11732. class ui_Component107 extends fgui.GComponent {
  11733. static createInstance() {
  11734. return (fgui.UIPackage.createObject("game", "Component107"));
  11735. }
  11736. onConstruct() {
  11737. this.n18 = (this.getChild("n18"));
  11738. this.n19 = (this.getChild("n19"));
  11739. this.n20 = (this.getChild("n20"));
  11740. this.n21 = (this.getChild("n21"));
  11741. this.n22 = (this.getChild("n22"));
  11742. this.levelTxt = (this.getChild("levelTxt"));
  11743. this.t0 = this.getTransition("t0");
  11744. }
  11745. }
  11746. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11747. class ui_box_com1 extends fgui.GComponent {
  11748. static createInstance() {
  11749. return (fgui.UIPackage.createObject("game", "box_com1"));
  11750. }
  11751. onConstruct() {
  11752. this.n14 = (this.getChild("n14"));
  11753. this.n6 = (this.getChild("n6"));
  11754. this.t0 = this.getTransition("t0");
  11755. }
  11756. }
  11757. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11758. class ui_box_com2 extends fgui.GProgressBar {
  11759. static createInstance() {
  11760. return (fgui.UIPackage.createObject("game", "box_com2"));
  11761. }
  11762. onConstruct() {
  11763. this.bg0 = (this.getChild("bg0"));
  11764. this.bg = (this.getChild("bg"));
  11765. this.bar = (this.getChild("bar"));
  11766. this.n7 = (this.getChild("n7"));
  11767. this.n8 = (this.getChild("n8"));
  11768. this.n10 = (this.getChild("n10"));
  11769. this.n11 = (this.getChild("n11"));
  11770. this.n12 = (this.getChild("n12"));
  11771. }
  11772. }
  11773. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11774. class ui_box_com4 extends fgui.GComponent {
  11775. static createInstance() {
  11776. return (fgui.UIPackage.createObject("game", "box_com4"));
  11777. }
  11778. onConstruct() {
  11779. this.n8 = (this.getChild("n8"));
  11780. this.t0 = this.getTransition("t0");
  11781. }
  11782. }
  11783. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11784. class ui_box_com3 extends fgui.GComponent {
  11785. static createInstance() {
  11786. return (fgui.UIPackage.createObject("game", "box_com3"));
  11787. }
  11788. onConstruct() {
  11789. this.n2 = (this.getChild("n2"));
  11790. this.n3 = (this.getChild("n3"));
  11791. this.n4 = (this.getChild("n4"));
  11792. this.n5 = (this.getChild("n5"));
  11793. this.t0 = this.getTransition("t0");
  11794. this.t1 = this.getTransition("t1");
  11795. }
  11796. }
  11797. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11798. class ui_Component97 extends fgui.GComponent {
  11799. static createInstance() {
  11800. return (fgui.UIPackage.createObject("game", "Component97"));
  11801. }
  11802. onConstruct() {
  11803. this.c1 = this.getController("c1");
  11804. this.n46 = (this.getChild("n46"));
  11805. this.diamondNode = (this.getChild("diamondNode"));
  11806. this.coinNode = (this.getChild("coinNode"));
  11807. this.t0 = this.getTransition("t0");
  11808. }
  11809. }
  11810. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11811. class ui_Component98 extends fgui.GButton {
  11812. static createInstance() {
  11813. return (fgui.UIPackage.createObject("game", "Component98"));
  11814. }
  11815. onConstruct() {
  11816. this.n8 = (this.getChild("n8"));
  11817. this.n40 = (this.getChild("n40"));
  11818. }
  11819. }
  11820. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11821. class ui_Component28_11 extends fgui.GButton {
  11822. static createInstance() {
  11823. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11824. }
  11825. onConstruct() {
  11826. this.c1 = this.getController("c1");
  11827. this.n12 = (this.getChild("n12"));
  11828. this.n17 = (this.getChild("n17"));
  11829. this.n13 = (this.getChild("n13"));
  11830. this.diamondTxt = (this.getChild("diamondTxt"));
  11831. this.n15 = (this.getChild("n15"));
  11832. this.n16 = (this.getChild("n16"));
  11833. }
  11834. }
  11835. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11836. class ui_Component58_11 extends fgui.GComponent {
  11837. static createInstance() {
  11838. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11839. }
  11840. onConstruct() {
  11841. this.n23 = (this.getChild("n23"));
  11842. this.n41 = (this.getChild("n41"));
  11843. this.myList = (this.getChild("myList"));
  11844. this.n45 = (this.getChild("n45"));
  11845. this.n44 = (this.getChild("n44"));
  11846. this.t0 = this.getTransition("t0");
  11847. }
  11848. }
  11849. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11850. class ui_Component100 extends fgui.GComponent {
  11851. static createInstance() {
  11852. return (fgui.UIPackage.createObject("game", "Component100"));
  11853. }
  11854. onConstruct() {
  11855. this.c1 = this.getController("c1");
  11856. this.n75 = (this.getChild("n75"));
  11857. this.n76 = (this.getChild("n76"));
  11858. this.n80 = (this.getChild("n80"));
  11859. this.txt = (this.getChild("txt"));
  11860. this.spineRoot = (this.getChild("spineRoot"));
  11861. }
  11862. }
  11863. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11864. class ui_Component101 extends fgui.GComponent {
  11865. static createInstance() {
  11866. return (fgui.UIPackage.createObject("game", "Component101"));
  11867. }
  11868. onConstruct() {
  11869. this.c1 = this.getController("c1");
  11870. this.n36 = (this.getChild("n36"));
  11871. this.n35 = (this.getChild("n35"));
  11872. this.n33 = (this.getChild("n33"));
  11873. this.n34 = (this.getChild("n34"));
  11874. }
  11875. }
  11876. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11877. class ui_Component53 extends fgui.GComponent {
  11878. static createInstance() {
  11879. return (fgui.UIPackage.createObject("game", "Component53"));
  11880. }
  11881. onConstruct() {
  11882. this.n0 = (this.getChild("n0"));
  11883. this.n1 = (this.getChild("n1"));
  11884. this.n2 = (this.getChild("n2"));
  11885. this.n3 = (this.getChild("n3"));
  11886. this.n4 = (this.getChild("n4"));
  11887. this.n5 = (this.getChild("n5"));
  11888. this.n6 = (this.getChild("n6"));
  11889. this.n7 = (this.getChild("n7"));
  11890. this.n8 = (this.getChild("n8"));
  11891. this.n9 = (this.getChild("n9"));
  11892. this.n10 = (this.getChild("n10"));
  11893. this.n11 = (this.getChild("n11"));
  11894. this.n12 = (this.getChild("n12"));
  11895. this.n13 = (this.getChild("n13"));
  11896. this.n14 = (this.getChild("n14"));
  11897. this.n15 = (this.getChild("n15"));
  11898. this.n16 = (this.getChild("n16"));
  11899. this.n19 = (this.getChild("n19"));
  11900. this.n20 = (this.getChild("n20"));
  11901. this.n21 = (this.getChild("n21"));
  11902. this.n22 = (this.getChild("n22"));
  11903. this.n23 = (this.getChild("n23"));
  11904. this.n24 = (this.getChild("n24"));
  11905. this.n25 = (this.getChild("n25"));
  11906. this.n26 = (this.getChild("n26"));
  11907. this.n27 = (this.getChild("n27"));
  11908. this.n28 = (this.getChild("n28"));
  11909. this.n29 = (this.getChild("n29"));
  11910. this.n30 = (this.getChild("n30"));
  11911. this.n31 = (this.getChild("n31"));
  11912. this.n32 = (this.getChild("n32"));
  11913. this.n33 = (this.getChild("n33"));
  11914. this.n34 = (this.getChild("n34"));
  11915. this.n35 = (this.getChild("n35"));
  11916. this.t0 = this.getTransition("t0");
  11917. }
  11918. }
  11919. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11920. class ui_Component58 extends fgui.GComponent {
  11921. static createInstance() {
  11922. return (fgui.UIPackage.createObject("game", "Component58"));
  11923. }
  11924. onConstruct() {
  11925. this.n23 = (this.getChild("n23"));
  11926. this.n41 = (this.getChild("n41"));
  11927. this.n8 = (this.getChild("n8"));
  11928. this.skillList = (this.getChild("skillList"));
  11929. this.t0 = this.getTransition("t0");
  11930. }
  11931. }
  11932. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11933. class ui_Component59 extends fgui.GComponent {
  11934. static createInstance() {
  11935. return (fgui.UIPackage.createObject("game", "Component59"));
  11936. }
  11937. onConstruct() {
  11938. this.n3 = (this.getChild("n3"));
  11939. this.msgTxt = (this.getChild("msgTxt"));
  11940. this.t0 = this.getTransition("t0");
  11941. }
  11942. }
  11943. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11944. class ui_RulerNode extends fgui.GComponent {
  11945. static createInstance() {
  11946. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11947. }
  11948. onConstruct() {
  11949. this.n6 = (this.getChild("n6"));
  11950. this.n4 = (this.getChild("n4"));
  11951. this.img1 = (this.getChild("img1"));
  11952. this.img2 = (this.getChild("img2"));
  11953. }
  11954. }
  11955. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11956. class ui_Component108 extends fgui.GComponent {
  11957. static createInstance() {
  11958. return (fgui.UIPackage.createObject("game", "Component108"));
  11959. }
  11960. onConstruct() {
  11961. this.n19 = (this.getChild("n19"));
  11962. this.t0 = this.getTransition("t0");
  11963. }
  11964. }
  11965. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11966. class ui_Component63 extends fgui.GComponent {
  11967. static createInstance() {
  11968. return (fgui.UIPackage.createObject("game", "Component63"));
  11969. }
  11970. onConstruct() {
  11971. this.n66 = (this.getChild("n66"));
  11972. this.n56 = (this.getChild("n56"));
  11973. this.n63 = (this.getChild("n63"));
  11974. this.n65 = (this.getChild("n65"));
  11975. this.t0 = this.getTransition("t0");
  11976. }
  11977. }
  11978. ui_Component63.URL = "ui://isxx5ak7h657452";
  11979. class ui_topNode extends fgui.GComponent {
  11980. static createInstance() {
  11981. return (fgui.UIPackage.createObject("game", "topNode"));
  11982. }
  11983. onConstruct() {
  11984. this.selfProgress = (this.getChild("selfProgress"));
  11985. this.aiProgress = (this.getChild("aiProgress"));
  11986. this.selfKuang = (this.getChild("selfKuang"));
  11987. this.aiKuang = (this.getChild("aiKuang"));
  11988. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  11989. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  11990. this.n33 = (this.getChild("n33"));
  11991. this.n34 = (this.getChild("n34"));
  11992. this.selfNameTxt = (this.getChild("selfNameTxt"));
  11993. this.aiNameTxt = (this.getChild("aiNameTxt"));
  11994. this.selfBallList = (this.getChild("selfBallList"));
  11995. this.aiBallList = (this.getChild("aiBallList"));
  11996. this.middleNode = (this.getChild("middleNode"));
  11997. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  11998. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  11999. this.scoreNode = (this.getChild("scoreNode"));
  12000. this.selfTips = (this.getChild("selfTips"));
  12001. this.aiTips = (this.getChild("aiTips"));
  12002. }
  12003. }
  12004. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12005. class ui_selfProgress extends fgui.GProgressBar {
  12006. static createInstance() {
  12007. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12008. }
  12009. onConstruct() {
  12010. this.n3 = (this.getChild("n3"));
  12011. this.bar = (this.getChild("bar"));
  12012. }
  12013. }
  12014. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12015. class ui_aiProgress extends fgui.GProgressBar {
  12016. static createInstance() {
  12017. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12018. }
  12019. onConstruct() {
  12020. this.n3 = (this.getChild("n3"));
  12021. this.bar = (this.getChild("bar"));
  12022. }
  12023. }
  12024. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12025. class ui_ballDisplay extends fgui.GComponent {
  12026. static createInstance() {
  12027. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12028. }
  12029. onConstruct() {
  12030. this.myImg = (this.getChild("myImg"));
  12031. }
  12032. }
  12033. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12034. class ui_moveNode extends fgui.GComponent {
  12035. static createInstance() {
  12036. return (fgui.UIPackage.createObject("game", "moveNode"));
  12037. }
  12038. onConstruct() {
  12039. this.n8 = (this.getChild("n8"));
  12040. this.finger = (this.getChild("finger"));
  12041. }
  12042. }
  12043. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12044. class ui_cancelBtn extends fgui.GButton {
  12045. static createInstance() {
  12046. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12047. }
  12048. onConstruct() {
  12049. this.c1 = this.getController("c1");
  12050. this.n0 = (this.getChild("n0"));
  12051. this.n1 = (this.getChild("n1"));
  12052. }
  12053. }
  12054. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12055. class ui_shareBtn extends fgui.GButton {
  12056. static createInstance() {
  12057. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12058. }
  12059. onConstruct() {
  12060. this.c1 = this.getController("c1");
  12061. this.n2 = (this.getChild("n2"));
  12062. this.n1 = (this.getChild("n1"));
  12063. this.n3 = (this.getChild("n3"));
  12064. this.n4 = (this.getChild("n4"));
  12065. this.n5 = (this.getChild("n5"));
  12066. this.n6 = (this.getChild("n6"));
  12067. }
  12068. }
  12069. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12070. class ui_share2Btn extends fgui.GButton {
  12071. static createInstance() {
  12072. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12073. }
  12074. onConstruct() {
  12075. this.n3 = (this.getChild("n3"));
  12076. }
  12077. }
  12078. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12079. class ui_rodMethodNode extends fgui.GComponent {
  12080. static createInstance() {
  12081. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12082. }
  12083. onConstruct() {
  12084. this.bg = (this.getChild("bg"));
  12085. this.dot = (this.getChild("dot"));
  12086. }
  12087. }
  12088. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12089. class ui_sureBtn extends fgui.GButton {
  12090. static createInstance() {
  12091. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12092. }
  12093. onConstruct() {
  12094. this.n2 = (this.getChild("n2"));
  12095. this.n1 = (this.getChild("n1"));
  12096. }
  12097. }
  12098. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12099. class ui_Component18 extends fgui.GComponent {
  12100. static createInstance() {
  12101. return (fgui.UIPackage.createObject("game", "Component18"));
  12102. }
  12103. onConstruct() {
  12104. this.c1 = this.getController("c1");
  12105. this.nameTxt = (this.getChild("nameTxt"));
  12106. this.headImg = (this.getChild("headImg"));
  12107. this.n24 = (this.getChild("n24"));
  12108. this.skillImg = (this.getChild("skillImg"));
  12109. this.skillTxt = (this.getChild("skillTxt"));
  12110. }
  12111. }
  12112. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12113. class ui_Component45 extends fgui.GComponent {
  12114. static createInstance() {
  12115. return (fgui.UIPackage.createObject("game", "Component45"));
  12116. }
  12117. onConstruct() {
  12118. this.c1 = this.getController("c1");
  12119. this.n40 = (this.getChild("n40"));
  12120. this.n41 = (this.getChild("n41"));
  12121. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12122. this.n42 = (this.getChild("n42"));
  12123. this.awardTxt = (this.getChild("awardTxt"));
  12124. this.n44 = (this.getChild("n44"));
  12125. this.t0 = this.getTransition("t0");
  12126. }
  12127. }
  12128. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12129. class ui_emotionDisplay extends fgui.GButton {
  12130. static createInstance() {
  12131. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12132. }
  12133. onConstruct() {
  12134. this.myIcon = (this.getChild("myIcon"));
  12135. }
  12136. }
  12137. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12138. class ui_Component49 extends fgui.GButton {
  12139. static createInstance() {
  12140. return (fgui.UIPackage.createObject("game", "Component49"));
  12141. }
  12142. onConstruct() {
  12143. this.n69 = (this.getChild("n69"));
  12144. this.n56 = (this.getChild("n56"));
  12145. }
  12146. }
  12147. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12148. class ui_Component50 extends fgui.GButton {
  12149. static createInstance() {
  12150. return (fgui.UIPackage.createObject("game", "Component50"));
  12151. }
  12152. onConstruct() {
  12153. this.n54 = (this.getChild("n54"));
  12154. this.n65 = (this.getChild("n65"));
  12155. }
  12156. }
  12157. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12158. class ui_Component51 extends fgui.GButton {
  12159. static createInstance() {
  12160. return (fgui.UIPackage.createObject("game", "Component51"));
  12161. }
  12162. onConstruct() {
  12163. this.c1 = this.getController("c1");
  12164. this.n51 = (this.getChild("n51"));
  12165. this.n54 = (this.getChild("n54"));
  12166. }
  12167. }
  12168. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12169. class ui_Button5 extends fgui.GButton {
  12170. static createInstance() {
  12171. return (fgui.UIPackage.createObject("game", "Button5"));
  12172. }
  12173. onConstruct() {
  12174. this.c1 = this.getController("c1");
  12175. this.n0 = (this.getChild("n0"));
  12176. this.n2 = (this.getChild("n2"));
  12177. }
  12178. }
  12179. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12180. class ui_Component124 extends fgui.GComponent {
  12181. static createInstance() {
  12182. return (fgui.UIPackage.createObject("game", "Component124"));
  12183. }
  12184. onConstruct() {
  12185. this.n22 = (this.getChild("n22"));
  12186. this.shareNode = (this.getChild("shareNode"));
  12187. }
  12188. }
  12189. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12190. class ui_Component125 extends fgui.GComponent {
  12191. static createInstance() {
  12192. return (fgui.UIPackage.createObject("game", "Component125"));
  12193. }
  12194. onConstruct() {
  12195. this.n29 = (this.getChild("n29"));
  12196. this.coinTxt = (this.getChild("coinTxt"));
  12197. }
  12198. }
  12199. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12200. class ui_Component52 extends fgui.GButton {
  12201. static createInstance() {
  12202. return (fgui.UIPackage.createObject("game", "Component52"));
  12203. }
  12204. onConstruct() {
  12205. this.n35 = (this.getChild("n35"));
  12206. this.n36 = (this.getChild("n36"));
  12207. }
  12208. }
  12209. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12210. class ui_drawBtn extends fgui.GButton {
  12211. static createInstance() {
  12212. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12213. }
  12214. onConstruct() {
  12215. this.c1 = this.getController("c1");
  12216. this.n2 = (this.getChild("n2"));
  12217. this.n1 = (this.getChild("n1"));
  12218. }
  12219. }
  12220. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12221. class ui_Component43 extends fgui.GButton {
  12222. static createInstance() {
  12223. return (fgui.UIPackage.createObject("game", "Component43"));
  12224. }
  12225. onConstruct() {
  12226. this.n49 = (this.getChild("n49"));
  12227. }
  12228. }
  12229. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12230. class ui_wordsDisplay extends fgui.GComponent {
  12231. static createInstance() {
  12232. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12233. }
  12234. onConstruct() {
  12235. this.txt = (this.getChild("txt"));
  12236. this.n63 = (this.getChild("n63"));
  12237. }
  12238. }
  12239. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12240. class ui_Component3 extends fgui.GComponent {
  12241. static createInstance() {
  12242. return (fgui.UIPackage.createObject("game", "Component3"));
  12243. }
  12244. onConstruct() {
  12245. this.n26 = (this.getChild("n26"));
  12246. this.n24 = (this.getChild("n24"));
  12247. this.nameTxt = (this.getChild("nameTxt"));
  12248. this.headRoot = (this.getChild("headRoot"));
  12249. }
  12250. }
  12251. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12252. class ui_Component4 extends fgui.GComponent {
  12253. static createInstance() {
  12254. return (fgui.UIPackage.createObject("game", "Component4"));
  12255. }
  12256. onConstruct() {
  12257. this.headImg = (this.getChild("headImg"));
  12258. }
  12259. }
  12260. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12261. class ui_Component7 extends fgui.GButton {
  12262. static createInstance() {
  12263. return (fgui.UIPackage.createObject("game", "Component7"));
  12264. }
  12265. onConstruct() {
  12266. this.n17 = (this.getChild("n17"));
  12267. }
  12268. }
  12269. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12270. class ui_Component8 extends fgui.GButton {
  12271. static createInstance() {
  12272. return (fgui.UIPackage.createObject("game", "Component8"));
  12273. }
  12274. onConstruct() {
  12275. this.n19 = (this.getChild("n19"));
  12276. }
  12277. }
  12278. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12279. class ui_Component9 extends fgui.GButton {
  12280. static createInstance() {
  12281. return (fgui.UIPackage.createObject("game", "Component9"));
  12282. }
  12283. onConstruct() {
  12284. this.n18 = (this.getChild("n18"));
  12285. }
  12286. }
  12287. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12288. class ui_Component10 extends fgui.GButton {
  12289. static createInstance() {
  12290. return (fgui.UIPackage.createObject("game", "Component10"));
  12291. }
  12292. onConstruct() {
  12293. this.c1 = this.getController("c1");
  12294. this.n40 = (this.getChild("n40"));
  12295. }
  12296. }
  12297. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12298. class ui_Component11 extends fgui.GButton {
  12299. static createInstance() {
  12300. return (fgui.UIPackage.createObject("game", "Component11"));
  12301. }
  12302. onConstruct() {
  12303. this.n34 = (this.getChild("n34"));
  12304. }
  12305. }
  12306. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12307. class ui_Component12 extends fgui.GButton {
  12308. static createInstance() {
  12309. return (fgui.UIPackage.createObject("game", "Component12"));
  12310. }
  12311. onConstruct() {
  12312. this.n35 = (this.getChild("n35"));
  12313. }
  12314. }
  12315. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12316. class ui_Component13 extends fgui.GButton {
  12317. static createInstance() {
  12318. return (fgui.UIPackage.createObject("game", "Component13"));
  12319. }
  12320. onConstruct() {
  12321. this.n27 = (this.getChild("n27"));
  12322. this.n36 = (this.getChild("n36"));
  12323. }
  12324. }
  12325. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12326. class ui_dh_js_tuowei extends fgui.GComponent {
  12327. static createInstance() {
  12328. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12329. }
  12330. onConstruct() {
  12331. this.n19 = (this.getChild("n19"));
  12332. this.n18 = (this.getChild("n18"));
  12333. this.n0 = (this.getChild("n0"));
  12334. this.n3 = (this.getChild("n3"));
  12335. this.n4 = (this.getChild("n4"));
  12336. this.n5 = (this.getChild("n5"));
  12337. this.n6 = (this.getChild("n6"));
  12338. this.n8 = (this.getChild("n8"));
  12339. this.n9 = (this.getChild("n9"));
  12340. this.n10 = (this.getChild("n10"));
  12341. this.n11 = (this.getChild("n11"));
  12342. this.n12 = (this.getChild("n12"));
  12343. this.n13 = (this.getChild("n13"));
  12344. this.n14 = (this.getChild("n14"));
  12345. this.n15 = (this.getChild("n15"));
  12346. this.n20 = (this.getChild("n20"));
  12347. this.t0 = this.getTransition("t0");
  12348. this.t1 = this.getTransition("t1");
  12349. }
  12350. }
  12351. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12352. class ui_dh_js_tw_g extends fgui.GComponent {
  12353. static createInstance() {
  12354. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12355. }
  12356. onConstruct() {
  12357. this.n0 = (this.getChild("n0"));
  12358. this.n1 = (this.getChild("n1"));
  12359. this.t0 = this.getTransition("t0");
  12360. }
  12361. }
  12362. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12363. class ui_dh_js_xingxing extends fgui.GComponent {
  12364. static createInstance() {
  12365. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12366. }
  12367. onConstruct() {
  12368. this.n1 = (this.getChild("n1"));
  12369. this.n2 = (this.getChild("n2"));
  12370. this.n3 = (this.getChild("n3"));
  12371. this.n4 = (this.getChild("n4"));
  12372. this.n0 = (this.getChild("n0"));
  12373. this.t2 = this.getTransition("t2");
  12374. this.t1 = this.getTransition("t1");
  12375. }
  12376. }
  12377. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12378. class ui_dh_zy_jiazai extends fgui.GComponent {
  12379. static createInstance() {
  12380. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12381. }
  12382. onConstruct() {
  12383. this.c1 = this.getController("c1");
  12384. this.n0 = (this.getChild("n0"));
  12385. this.n1 = (this.getChild("n1"));
  12386. this.n2 = (this.getChild("n2"));
  12387. this.n4 = (this.getChild("n4"));
  12388. this.n5 = (this.getChild("n5"));
  12389. this.n6 = (this.getChild("n6"));
  12390. this.n8 = (this.getChild("n8"));
  12391. this.n7 = (this.getChild("n7"));
  12392. this.t0 = this.getTransition("t0");
  12393. }
  12394. }
  12395. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12396. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12397. static createInstance() {
  12398. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12399. }
  12400. onConstruct() {
  12401. this.c1 = this.getController("c1");
  12402. this.n3 = (this.getChild("n3"));
  12403. this.n5 = (this.getChild("n5"));
  12404. this.n4 = (this.getChild("n4"));
  12405. this.n0 = (this.getChild("n0"));
  12406. this.n1 = (this.getChild("n1"));
  12407. this.n2 = (this.getChild("n2"));
  12408. }
  12409. }
  12410. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12411. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12412. static createInstance() {
  12413. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12414. }
  12415. onConstruct() {
  12416. this.n19 = (this.getChild("n19"));
  12417. this.n21 = (this.getChild("n21"));
  12418. this.n0 = (this.getChild("n0"));
  12419. this.n3 = (this.getChild("n3"));
  12420. this.n4 = (this.getChild("n4"));
  12421. this.n5 = (this.getChild("n5"));
  12422. this.n6 = (this.getChild("n6"));
  12423. this.n8 = (this.getChild("n8"));
  12424. this.n9 = (this.getChild("n9"));
  12425. this.n10 = (this.getChild("n10"));
  12426. this.n11 = (this.getChild("n11"));
  12427. this.n12 = (this.getChild("n12"));
  12428. this.n13 = (this.getChild("n13"));
  12429. this.n14 = (this.getChild("n14"));
  12430. this.n15 = (this.getChild("n15"));
  12431. this.n23 = (this.getChild("n23"));
  12432. this.t0 = this.getTransition("t0");
  12433. this.t1 = this.getTransition("t1");
  12434. }
  12435. }
  12436. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12437. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12438. static createInstance() {
  12439. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12440. }
  12441. onConstruct() {
  12442. this.n1 = (this.getChild("n1"));
  12443. this.n2 = (this.getChild("n2"));
  12444. this.t0 = this.getTransition("t0");
  12445. }
  12446. }
  12447. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12448. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12449. static createInstance() {
  12450. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12451. }
  12452. onConstruct() {
  12453. this.n4 = (this.getChild("n4"));
  12454. this.n2 = (this.getChild("n2"));
  12455. this.n3 = (this.getChild("n3"));
  12456. this.idle = this.getTransition("idle");
  12457. this.attack = this.getTransition("attack");
  12458. }
  12459. }
  12460. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12461. class ui_special extends fgui.GComponent {
  12462. static createInstance() {
  12463. return (fgui.UIPackage.createObject("game", "special"));
  12464. }
  12465. onConstruct() {
  12466. this.n18 = (this.getChild("n18"));
  12467. this.n19 = (this.getChild("n19"));
  12468. this.n20 = (this.getChild("n20"));
  12469. this.n21 = (this.getChild("n21"));
  12470. this.n22 = (this.getChild("n22"));
  12471. this.levelTxt = (this.getChild("levelTxt"));
  12472. this.n24 = (this.getChild("n24"));
  12473. this.n25 = (this.getChild("n25"));
  12474. this.t0 = this.getTransition("t0");
  12475. }
  12476. }
  12477. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12478. class ui_Component145 extends fgui.GComponent {
  12479. static createInstance() {
  12480. return (fgui.UIPackage.createObject("game", "Component145"));
  12481. }
  12482. onConstruct() {
  12483. this.guanyuNode = (this.getChild("guanyuNode"));
  12484. }
  12485. }
  12486. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12487. class ui_longBtn extends fgui.GButton {
  12488. static createInstance() {
  12489. return (fgui.UIPackage.createObject("game", "longBtn"));
  12490. }
  12491. onConstruct() {
  12492. this.c1 = this.getController("c1");
  12493. this.n2 = (this.getChild("n2"));
  12494. this.n1 = (this.getChild("n1"));
  12495. this.n4 = (this.getChild("n4"));
  12496. }
  12497. }
  12498. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12499. class ui_Component146 extends fgui.GComponent {
  12500. static createInstance() {
  12501. return (fgui.UIPackage.createObject("game", "Component146"));
  12502. }
  12503. onConstruct() {
  12504. this.n89 = (this.getChild("n89"));
  12505. this.n90 = (this.getChild("n90"));
  12506. this.guideBtn = (this.getChild("guideBtn"));
  12507. }
  12508. }
  12509. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12510. class ui_Component146_11 extends fgui.GComponent {
  12511. static createInstance() {
  12512. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12513. }
  12514. onConstruct() {
  12515. this.n89 = (this.getChild("n89"));
  12516. this.n90 = (this.getChild("n90"));
  12517. this.guideBtn = (this.getChild("guideBtn"));
  12518. }
  12519. }
  12520. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12521. class ui_Component111_1 extends fgui.GComponent {
  12522. static createInstance() {
  12523. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12524. }
  12525. onConstruct() {
  12526. this.n68 = (this.getChild("n68"));
  12527. this.myMask = (this.getChild("myMask"));
  12528. }
  12529. }
  12530. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12531. class ui_Component64_1 extends fgui.GComponent {
  12532. static createInstance() {
  12533. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12534. }
  12535. onConstruct() {
  12536. this.n57 = (this.getChild("n57"));
  12537. this.n54 = (this.getChild("n54"));
  12538. this.n55 = (this.getChild("n55"));
  12539. this.n56 = (this.getChild("n56"));
  12540. this.t1 = this.getTransition("t1");
  12541. }
  12542. }
  12543. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12544. class ui_ModeSelection_com123 extends fgui.GComponent {
  12545. static createInstance() {
  12546. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12547. }
  12548. onConstruct() {
  12549. this.type1 = (this.getChild("type1"));
  12550. this.type2 = (this.getChild("type2"));
  12551. this.type3 = (this.getChild("type3"));
  12552. this.n38 = (this.getChild("n38"));
  12553. this.t0 = this.getTransition("t0");
  12554. }
  12555. }
  12556. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12557. class ui_Component132_2 extends fgui.GComponent {
  12558. static createInstance() {
  12559. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12560. }
  12561. onConstruct() {
  12562. this.n25 = (this.getChild("n25"));
  12563. this.n26 = (this.getChild("n26"));
  12564. this.n27 = (this.getChild("n27"));
  12565. this.t0 = this.getTransition("t0");
  12566. }
  12567. }
  12568. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12569. class ui_UIPower$1 extends fgui.GComponent {
  12570. static createInstance() {
  12571. return (fgui.UIPackage.createObject("game", "UIPower"));
  12572. }
  12573. onConstruct() {
  12574. this.n11 = (this.getChild("n11"));
  12575. this.myNode = (this.getChild("myNode"));
  12576. this.t0 = this.getTransition("t0");
  12577. }
  12578. }
  12579. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12580. class ui_Component133 extends fgui.GComponent {
  12581. static createInstance() {
  12582. return (fgui.UIPackage.createObject("game", "Component133"));
  12583. }
  12584. onConstruct() {
  12585. this.n29 = (this.getChild("n29"));
  12586. this.n30 = (this.getChild("n30"));
  12587. }
  12588. }
  12589. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12590. class ui_Component134 extends fgui.GComponent {
  12591. static createInstance() {
  12592. return (fgui.UIPackage.createObject("game", "Component134"));
  12593. }
  12594. onConstruct() {
  12595. this.n30 = (this.getChild("n30"));
  12596. this.n31 = (this.getChild("n31"));
  12597. this.t0 = this.getTransition("t0");
  12598. }
  12599. }
  12600. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12601. class ui_Component135 extends fgui.GComponent {
  12602. static createInstance() {
  12603. return (fgui.UIPackage.createObject("game", "Component135"));
  12604. }
  12605. onConstruct() {
  12606. this.n30 = (this.getChild("n30"));
  12607. this.t0 = this.getTransition("t0");
  12608. }
  12609. }
  12610. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12611. class ui_Component137 extends fgui.GComponent {
  12612. static createInstance() {
  12613. return (fgui.UIPackage.createObject("game", "Component137"));
  12614. }
  12615. onConstruct() {
  12616. this.n28 = (this.getChild("n28"));
  12617. this.n29 = (this.getChild("n29"));
  12618. this.n30 = (this.getChild("n30"));
  12619. this.n32 = (this.getChild("n32"));
  12620. }
  12621. }
  12622. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12623. class ui_dh_zuanshi extends fgui.GButton {
  12624. static createInstance() {
  12625. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12626. }
  12627. onConstruct() {
  12628. this.n1 = (this.getChild("n1"));
  12629. this.n2 = (this.getChild("n2"));
  12630. this.n0 = (this.getChild("n0"));
  12631. this.n3 = (this.getChild("n3"));
  12632. this.n4 = (this.getChild("n4"));
  12633. }
  12634. }
  12635. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12636. class ui_Component138 extends fgui.GComponent {
  12637. static createInstance() {
  12638. return (fgui.UIPackage.createObject("game", "Component138"));
  12639. }
  12640. onConstruct() {
  12641. this.n1 = (this.getChild("n1"));
  12642. this.n2 = (this.getChild("n2"));
  12643. this.t0 = this.getTransition("t0");
  12644. }
  12645. }
  12646. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12647. class ui_Component139 extends fgui.GComponent {
  12648. static createInstance() {
  12649. return (fgui.UIPackage.createObject("game", "Component139"));
  12650. }
  12651. onConstruct() {
  12652. this.n0 = (this.getChild("n0"));
  12653. this.t0 = this.getTransition("t0");
  12654. }
  12655. }
  12656. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12657. class ui_Component140 extends fgui.GComponent {
  12658. static createInstance() {
  12659. return (fgui.UIPackage.createObject("game", "Component140"));
  12660. }
  12661. onConstruct() {
  12662. this.n2 = (this.getChild("n2"));
  12663. this.n3 = (this.getChild("n3"));
  12664. this.t0 = this.getTransition("t0");
  12665. }
  12666. }
  12667. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12668. class ui_Component141 extends fgui.GComponent {
  12669. static createInstance() {
  12670. return (fgui.UIPackage.createObject("game", "Component141"));
  12671. }
  12672. onConstruct() {
  12673. this.n0 = (this.getChild("n0"));
  12674. this.t0 = this.getTransition("t0");
  12675. }
  12676. }
  12677. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12678. class ui_powerNode extends fgui.GProgressBar {
  12679. static createInstance() {
  12680. return (fgui.UIPackage.createObject("game", "powerNode"));
  12681. }
  12682. onConstruct() {
  12683. this.n2 = (this.getChild("n2"));
  12684. this.bar_v = (this.getChild("bar_v"));
  12685. this.showImg = (this.getChild("showImg"));
  12686. this.n12 = (this.getChild("n12"));
  12687. }
  12688. }
  12689. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12690. class ui_dh_jingbi1 extends fgui.GComponent {
  12691. static createInstance() {
  12692. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12693. }
  12694. onConstruct() {
  12695. this.n0 = (this.getChild("n0"));
  12696. this.n1 = (this.getChild("n1"));
  12697. this.n2 = (this.getChild("n2"));
  12698. this.n3 = (this.getChild("n3"));
  12699. this.n4 = (this.getChild("n4"));
  12700. this.n5 = (this.getChild("n5"));
  12701. this.n6 = (this.getChild("n6"));
  12702. this.n8 = (this.getChild("n8"));
  12703. this.t0 = this.getTransition("t0");
  12704. }
  12705. }
  12706. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12707. class ui_Component94 extends fgui.GButton {
  12708. static createInstance() {
  12709. return (fgui.UIPackage.createObject("game", "Component94"));
  12710. }
  12711. onConstruct() {
  12712. this.n77 = (this.getChild("n77"));
  12713. }
  12714. }
  12715. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12716. class ui_Component95 extends fgui.GButton {
  12717. static createInstance() {
  12718. return (fgui.UIPackage.createObject("game", "Component95"));
  12719. }
  12720. onConstruct() {
  12721. this.n77 = (this.getChild("n77"));
  12722. }
  12723. }
  12724. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12725. class ui_Component126 extends fgui.GComponent {
  12726. static createInstance() {
  12727. return (fgui.UIPackage.createObject("game", "Component126"));
  12728. }
  12729. onConstruct() {
  12730. this.c1 = this.getController("c1");
  12731. this.normalBtn = (this.getChild("normalBtn"));
  12732. this.tripleBtn = (this.getChild("tripleBtn"));
  12733. }
  12734. }
  12735. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12736. class ui_Component60 extends fgui.GComponent {
  12737. static createInstance() {
  12738. return (fgui.UIPackage.createObject("game", "Component60"));
  12739. }
  12740. onConstruct() {
  12741. this.c1 = this.getController("c1");
  12742. this.n48 = (this.getChild("n48"));
  12743. this.womanTxt = (this.getChild("womanTxt"));
  12744. this.t0 = this.getTransition("t0");
  12745. }
  12746. }
  12747. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12748. class ui_Component98_3 extends fgui.GButton {
  12749. static createInstance() {
  12750. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12751. }
  12752. onConstruct() {
  12753. this.c1 = this.getController("c1");
  12754. this.n8 = (this.getChild("n8"));
  12755. this.n41 = (this.getChild("n41"));
  12756. this.n40 = (this.getChild("n40"));
  12757. }
  12758. }
  12759. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12760. class ui_ModeSelection_com1 extends fgui.GButton {
  12761. static createInstance() {
  12762. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12763. }
  12764. onConstruct() {
  12765. this.n34 = (this.getChild("n34"));
  12766. this.n36 = (this.getChild("n36"));
  12767. this.n22 = (this.getChild("n22"));
  12768. this.n20 = (this.getChild("n20"));
  12769. this.n23 = (this.getChild("n23"));
  12770. this.n24 = (this.getChild("n24"));
  12771. this.n26 = (this.getChild("n26"));
  12772. this.n33 = (this.getChild("n33"));
  12773. this.coinImg = (this.getChild("coinImg"));
  12774. this.need = (this.getChild("need"));
  12775. this.n35 = (this.getChild("n35"));
  12776. this.n29 = (this.getChild("n29"));
  12777. this.tipsTxt = (this.getChild("tipsTxt"));
  12778. this.n30 = (this.getChild("n30"));
  12779. this.peopleTxt = (this.getChild("peopleTxt"));
  12780. this.t0 = this.getTransition("t0");
  12781. }
  12782. }
  12783. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12784. class ui_ModeSelection_com2 extends fgui.GButton {
  12785. static createInstance() {
  12786. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12787. }
  12788. onConstruct() {
  12789. this.n36 = (this.getChild("n36"));
  12790. this.n34 = (this.getChild("n34"));
  12791. this.n22 = (this.getChild("n22"));
  12792. this.n20 = (this.getChild("n20"));
  12793. this.n23 = (this.getChild("n23"));
  12794. this.n24 = (this.getChild("n24"));
  12795. this.n26 = (this.getChild("n26"));
  12796. this.n33 = (this.getChild("n33"));
  12797. this.coinImg = (this.getChild("coinImg"));
  12798. this.need = (this.getChild("need"));
  12799. this.n35 = (this.getChild("n35"));
  12800. this.n29 = (this.getChild("n29"));
  12801. this.tipsTxt = (this.getChild("tipsTxt"));
  12802. this.n30 = (this.getChild("n30"));
  12803. this.peopleTxt = (this.getChild("peopleTxt"));
  12804. this.t0 = this.getTransition("t0");
  12805. }
  12806. }
  12807. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12808. class ui_ModeSelection_com3 extends fgui.GButton {
  12809. static createInstance() {
  12810. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12811. }
  12812. onConstruct() {
  12813. this.n34 = (this.getChild("n34"));
  12814. this.n36 = (this.getChild("n36"));
  12815. this.n22 = (this.getChild("n22"));
  12816. this.n20 = (this.getChild("n20"));
  12817. this.n23 = (this.getChild("n23"));
  12818. this.n24 = (this.getChild("n24"));
  12819. this.n26 = (this.getChild("n26"));
  12820. this.n33 = (this.getChild("n33"));
  12821. this.coinImg = (this.getChild("coinImg"));
  12822. this.need = (this.getChild("need"));
  12823. this.n35 = (this.getChild("n35"));
  12824. this.n29 = (this.getChild("n29"));
  12825. this.tipsTxt = (this.getChild("tipsTxt"));
  12826. this.n30 = (this.getChild("n30"));
  12827. this.peopleTxt = (this.getChild("peopleTxt"));
  12828. this.t0 = this.getTransition("t0");
  12829. }
  12830. }
  12831. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12832. class ui_Invitation_com1 extends fgui.GComponent {
  12833. static createInstance() {
  12834. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12835. }
  12836. onConstruct() {
  12837. this.n14 = (this.getChild("n14"));
  12838. this.n13 = (this.getChild("n13"));
  12839. this.n3 = (this.getChild("n3"));
  12840. this.n1 = (this.getChild("n1"));
  12841. this.n6 = (this.getChild("n6"));
  12842. this.n7 = (this.getChild("n7"));
  12843. this.enterBtn = (this.getChild("enterBtn"));
  12844. this.n11 = (this.getChild("n11"));
  12845. this.n12 = (this.getChild("n12"));
  12846. this.n15 = (this.getChild("n15"));
  12847. this.t0 = this.getTransition("t0");
  12848. this.t1 = this.getTransition("t1");
  12849. }
  12850. }
  12851. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12852. class ui_Component87_1 extends fgui.GComponent {
  12853. static createInstance() {
  12854. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12855. }
  12856. onConstruct() {
  12857. this.n74 = (this.getChild("n74"));
  12858. this.n73 = (this.getChild("n73"));
  12859. this.ballTxt = (this.getChild("ballTxt"));
  12860. this.n76 = (this.getChild("n76"));
  12861. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12862. this.levelTxt = (this.getChild("levelTxt"));
  12863. this.n87 = (this.getChild("n87"));
  12864. this.n84 = (this.getChild("n84"));
  12865. this.hpTxt = (this.getChild("hpTxt"));
  12866. this.n89 = (this.getChild("n89"));
  12867. this.tipsTxt = (this.getChild("tipsTxt"));
  12868. }
  12869. }
  12870. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12871. class ui_sqg1 extends fgui.GComponent {
  12872. static createInstance() {
  12873. return (fgui.UIPackage.createObject("game", "sqg1"));
  12874. }
  12875. onConstruct() {
  12876. this.n1 = (this.getChild("n1"));
  12877. this.n0 = (this.getChild("n0"));
  12878. }
  12879. }
  12880. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12881. class ui_sqg2 extends fgui.GComponent {
  12882. static createInstance() {
  12883. return (fgui.UIPackage.createObject("game", "sqg2"));
  12884. }
  12885. onConstruct() {
  12886. this.n1 = (this.getChild("n1"));
  12887. this.n0 = (this.getChild("n0"));
  12888. }
  12889. }
  12890. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12891. class ui_sqg3 extends fgui.GComponent {
  12892. static createInstance() {
  12893. return (fgui.UIPackage.createObject("game", "sqg3"));
  12894. }
  12895. onConstruct() {
  12896. this.n1 = (this.getChild("n1"));
  12897. this.n0 = (this.getChild("n0"));
  12898. }
  12899. }
  12900. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12901. class ui_sqg4 extends fgui.GComponent {
  12902. static createInstance() {
  12903. return (fgui.UIPackage.createObject("game", "sqg4"));
  12904. }
  12905. onConstruct() {
  12906. this.n1 = (this.getChild("n1"));
  12907. this.n0 = (this.getChild("n0"));
  12908. }
  12909. }
  12910. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12911. class ui_Component36 extends fgui.GButton {
  12912. static createInstance() {
  12913. return (fgui.UIPackage.createObject("game", "Component36"));
  12914. }
  12915. onConstruct() {
  12916. this.c1 = this.getController("c1");
  12917. this.n53 = (this.getChild("n53"));
  12918. this.n56 = (this.getChild("n56"));
  12919. }
  12920. }
  12921. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12922. class ui_Component37 extends fgui.GButton {
  12923. static createInstance() {
  12924. return (fgui.UIPackage.createObject("game", "Component37"));
  12925. }
  12926. onConstruct() {
  12927. this.c1 = this.getController("c1");
  12928. this.n52 = (this.getChild("n52"));
  12929. this.n54 = (this.getChild("n54"));
  12930. }
  12931. }
  12932. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12933. class ui_UISetting extends fgui.GComponent {
  12934. static createInstance() {
  12935. return (fgui.UIPackage.createObject("game", "UISetting"));
  12936. }
  12937. onConstruct() {
  12938. this.c1 = this.getController("c1");
  12939. this.n4 = (this.getChild("n4"));
  12940. this.soundBtn = (this.getChild("soundBtn"));
  12941. this.shakeBtn = (this.getChild("shakeBtn"));
  12942. this.clickNode = (this.getChild("clickNode"));
  12943. this.xyBtn = (this.getChild("xyBtn"));
  12944. }
  12945. }
  12946. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12947. class ui_Component39 extends fgui.GComponent {
  12948. static createInstance() {
  12949. return (fgui.UIPackage.createObject("game", "Component39"));
  12950. }
  12951. onConstruct() {
  12952. this.n5 = (this.getChild("n5"));
  12953. this.n6 = (this.getChild("n6"));
  12954. this.n7 = (this.getChild("n7"));
  12955. this.t0 = this.getTransition("t0");
  12956. }
  12957. }
  12958. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12959. class ui_Component40 extends fgui.GButton {
  12960. static createInstance() {
  12961. return (fgui.UIPackage.createObject("game", "Component40"));
  12962. }
  12963. onConstruct() {
  12964. this.n46 = (this.getChild("n46"));
  12965. this.n47 = (this.getChild("n47"));
  12966. }
  12967. }
  12968. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  12969. class ui_Component41 extends fgui.GComponent {
  12970. static createInstance() {
  12971. return (fgui.UIPackage.createObject("game", "Component41"));
  12972. }
  12973. onConstruct() {
  12974. this.c1 = this.getController("c1");
  12975. this.n0 = (this.getChild("n0"));
  12976. this.titleTxt = (this.getChild("titleTxt"));
  12977. this.n2 = (this.getChild("n2"));
  12978. this.msgTips = (this.getChild("msgTips"));
  12979. this.numTxt = (this.getChild("numTxt"));
  12980. this.n18 = (this.getChild("n18"));
  12981. this.cancelBtn = (this.getChild("cancelBtn"));
  12982. this.videoBtn = (this.getChild("videoBtn"));
  12983. this.n10 = (this.getChild("n10"));
  12984. }
  12985. }
  12986. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  12987. class ui_Component42 extends fgui.GComponent {
  12988. static createInstance() {
  12989. return (fgui.UIPackage.createObject("game", "Component42"));
  12990. }
  12991. onConstruct() {
  12992. this.c1 = this.getController("c1");
  12993. this.n1 = (this.getChild("n1"));
  12994. this.n2 = (this.getChild("n2"));
  12995. this.n3 = (this.getChild("n3"));
  12996. this.tipsTxt = (this.getChild("tipsTxt"));
  12997. this.cancelBtn = (this.getChild("cancelBtn"));
  12998. this.sureBtn = (this.getChild("sureBtn"));
  12999. this.n11 = (this.getChild("n11"));
  13000. this.n13 = (this.getChild("n13"));
  13001. this.n14 = (this.getChild("n14"));
  13002. this.womanTxt = (this.getChild("womanTxt"));
  13003. this.t0 = this.getTransition("t0");
  13004. }
  13005. }
  13006. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13007. class ui_dh_js_shengli extends fgui.GComponent {
  13008. static createInstance() {
  13009. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13010. }
  13011. onConstruct() {
  13012. this.n3 = (this.getChild("n3"));
  13013. this.n4 = (this.getChild("n4"));
  13014. this.n1 = (this.getChild("n1"));
  13015. this.n2 = (this.getChild("n2"));
  13016. this.n5 = (this.getChild("n5"));
  13017. this.n6 = (this.getChild("n6"));
  13018. this.n7 = (this.getChild("n7"));
  13019. this.n8 = (this.getChild("n8"));
  13020. this.attack = this.getTransition("attack");
  13021. this.idle = this.getTransition("idle");
  13022. }
  13023. }
  13024. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13025. class ui_dh_js_shengli_g extends fgui.GComponent {
  13026. static createInstance() {
  13027. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13028. }
  13029. onConstruct() {
  13030. this.n3 = (this.getChild("n3"));
  13031. this.n1 = (this.getChild("n1"));
  13032. this.t0 = this.getTransition("t0");
  13033. }
  13034. }
  13035. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13036. class ui_dh_js_shibai extends fgui.GComponent {
  13037. static createInstance() {
  13038. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13039. }
  13040. onConstruct() {
  13041. this.n0 = (this.getChild("n0"));
  13042. this.n1 = (this.getChild("n1"));
  13043. this.n2 = (this.getChild("n2"));
  13044. this.n3 = (this.getChild("n3"));
  13045. this.idle = this.getTransition("idle");
  13046. this.attack = this.getTransition("attack");
  13047. }
  13048. }
  13049. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13050. class ui_dh_zy_ganfa extends fgui.GButton {
  13051. static createInstance() {
  13052. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13053. }
  13054. onConstruct() {
  13055. this.n0 = (this.getChild("n0"));
  13056. }
  13057. }
  13058. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13059. class ui_dh_zy_sc_guang extends fgui.GButton {
  13060. static createInstance() {
  13061. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13062. }
  13063. onConstruct() {
  13064. this.n0 = (this.getChild("n0"));
  13065. this.n2 = (this.getChild("n2"));
  13066. }
  13067. }
  13068. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13069. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13070. static createInstance() {
  13071. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13072. }
  13073. onConstruct() {
  13074. this.n0 = (this.getChild("n0"));
  13075. this.n3 = (this.getChild("n3"));
  13076. this.t0 = this.getTransition("t0");
  13077. }
  13078. }
  13079. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13080. class ui_dh_zy_wanfa extends fgui.GButton {
  13081. static createInstance() {
  13082. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13083. }
  13084. onConstruct() {
  13085. this.n0 = (this.getChild("n0"));
  13086. }
  13087. }
  13088. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13089. class ui_Component53_1 extends fgui.GComponent {
  13090. static createInstance() {
  13091. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13092. }
  13093. onConstruct() {
  13094. this.n0 = (this.getChild("n0"));
  13095. this.n1 = (this.getChild("n1"));
  13096. this.n2 = (this.getChild("n2"));
  13097. this.n3 = (this.getChild("n3"));
  13098. this.n4 = (this.getChild("n4"));
  13099. this.n5 = (this.getChild("n5"));
  13100. this.n6 = (this.getChild("n6"));
  13101. this.n7 = (this.getChild("n7"));
  13102. this.n8 = (this.getChild("n8"));
  13103. this.n9 = (this.getChild("n9"));
  13104. this.n10 = (this.getChild("n10"));
  13105. this.n11 = (this.getChild("n11"));
  13106. this.n12 = (this.getChild("n12"));
  13107. this.n13 = (this.getChild("n13"));
  13108. this.n14 = (this.getChild("n14"));
  13109. this.n15 = (this.getChild("n15"));
  13110. this.n16 = (this.getChild("n16"));
  13111. this.n19 = (this.getChild("n19"));
  13112. this.n20 = (this.getChild("n20"));
  13113. this.n21 = (this.getChild("n21"));
  13114. this.n22 = (this.getChild("n22"));
  13115. this.n23 = (this.getChild("n23"));
  13116. this.n24 = (this.getChild("n24"));
  13117. this.n25 = (this.getChild("n25"));
  13118. this.n26 = (this.getChild("n26"));
  13119. this.n27 = (this.getChild("n27"));
  13120. this.n28 = (this.getChild("n28"));
  13121. this.n29 = (this.getChild("n29"));
  13122. this.n30 = (this.getChild("n30"));
  13123. this.n31 = (this.getChild("n31"));
  13124. this.n32 = (this.getChild("n32"));
  13125. this.n33 = (this.getChild("n33"));
  13126. this.n34 = (this.getChild("n34"));
  13127. this.n35 = (this.getChild("n35"));
  13128. this.t0 = this.getTransition("t0");
  13129. }
  13130. }
  13131. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13132. class ui_Component30 extends fgui.GComponent {
  13133. static createInstance() {
  13134. return (fgui.UIPackage.createObject("game", "Component30"));
  13135. }
  13136. onConstruct() {
  13137. this.c1 = this.getController("c1");
  13138. this.n46 = (this.getChild("n46"));
  13139. this.n47 = (this.getChild("n47"));
  13140. this.numTxt = (this.getChild("numTxt"));
  13141. this.n50 = (this.getChild("n50"));
  13142. this.n53 = (this.getChild("n53"));
  13143. this.n54 = (this.getChild("n54"));
  13144. this.n55 = (this.getChild("n55"));
  13145. this.n56 = (this.getChild("n56"));
  13146. }
  13147. }
  13148. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13149. class ui_Component30_1 extends fgui.GComponent {
  13150. static createInstance() {
  13151. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13152. }
  13153. onConstruct() {
  13154. this.c1 = this.getController("c1");
  13155. this.n46 = (this.getChild("n46"));
  13156. this.n47 = (this.getChild("n47"));
  13157. this.numTxt = (this.getChild("numTxt"));
  13158. this.n50 = (this.getChild("n50"));
  13159. this.n51 = (this.getChild("n51"));
  13160. this.n52 = (this.getChild("n52"));
  13161. this.n53 = (this.getChild("n53"));
  13162. this.n54 = (this.getChild("n54"));
  13163. }
  13164. }
  13165. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13166. class ui_Component31 extends fgui.GComponent {
  13167. static createInstance() {
  13168. return (fgui.UIPackage.createObject("game", "Component31"));
  13169. }
  13170. onConstruct() {
  13171. this.n55 = (this.getChild("n55"));
  13172. this.n54 = (this.getChild("n54"));
  13173. this.conditionTxt = (this.getChild("conditionTxt"));
  13174. this.n57 = (this.getChild("n57"));
  13175. this.t0 = this.getTransition("t0");
  13176. }
  13177. }
  13178. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13179. class ui_Component32 extends fgui.GComponent {
  13180. static createInstance() {
  13181. return (fgui.UIPackage.createObject("game", "Component32"));
  13182. }
  13183. onConstruct() {
  13184. this.n5 = (this.getChild("n5"));
  13185. this.n6 = (this.getChild("n6"));
  13186. this.n7 = (this.getChild("n7"));
  13187. this.t0 = this.getTransition("t0");
  13188. }
  13189. }
  13190. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13191. class ui_AwardItem extends fgui.GComponent {
  13192. static createInstance() {
  13193. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13194. }
  13195. onConstruct() {
  13196. this.n9 = (this.getChild("n9"));
  13197. this.myIcon = (this.getChild("myIcon"));
  13198. this.numTxt = (this.getChild("numTxt"));
  13199. this.nameTxt = (this.getChild("nameTxt"));
  13200. this.n16 = (this.getChild("n16"));
  13201. this.n17 = (this.getChild("n17"));
  13202. }
  13203. }
  13204. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13205. class ui_ranking_com1 extends fgui.GButton {
  13206. static createInstance() {
  13207. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13208. }
  13209. onConstruct() {
  13210. this.c1 = this.getController("c1");
  13211. this.n49 = (this.getChild("n49"));
  13212. this.n18 = (this.getChild("n18"));
  13213. this.n46 = (this.getChild("n46"));
  13214. this.n48 = (this.getChild("n48"));
  13215. this.n50 = (this.getChild("n50"));
  13216. }
  13217. }
  13218. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13219. class ui_ranking_com2 extends fgui.GButton {
  13220. static createInstance() {
  13221. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13222. }
  13223. onConstruct() {
  13224. this.c1 = this.getController("c1");
  13225. this.n49 = (this.getChild("n49"));
  13226. this.n18 = (this.getChild("n18"));
  13227. this.n46 = (this.getChild("n46"));
  13228. this.n48 = (this.getChild("n48"));
  13229. this.n50 = (this.getChild("n50"));
  13230. }
  13231. }
  13232. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13233. class ui_ranking_com3 extends fgui.GComponent {
  13234. static createInstance() {
  13235. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13236. }
  13237. onConstruct() {
  13238. this.n17 = (this.getChild("n17"));
  13239. this.myIcon = (this.getChild("myIcon"));
  13240. }
  13241. }
  13242. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13243. class ui_ranking_com4 extends fgui.GComponent {
  13244. static createInstance() {
  13245. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13246. }
  13247. onConstruct() {
  13248. this.n16 = (this.getChild("n16"));
  13249. this.head = (this.getChild("head"));
  13250. }
  13251. }
  13252. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13253. class ui_ranking_com5 extends fgui.GComponent {
  13254. static createInstance() {
  13255. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13256. }
  13257. onConstruct() {
  13258. this.c1 = this.getController("c1");
  13259. this.c2 = this.getController("c2");
  13260. this.n2 = (this.getChild("n2"));
  13261. this.n3 = (this.getChild("n3"));
  13262. this.levelBtn = (this.getChild("levelBtn"));
  13263. this.starBtn = (this.getChild("starBtn"));
  13264. this.n23 = (this.getChild("n23"));
  13265. this.n24 = (this.getChild("n24"));
  13266. this.n25 = (this.getChild("n25"));
  13267. this.myList = (this.getChild("myList"));
  13268. this.selfNode = (this.getChild("selfNode"));
  13269. this.n9 = (this.getChild("n9"));
  13270. this.n12 = (this.getChild("n12"));
  13271. this.n13 = (this.getChild("n13"));
  13272. this.n14 = (this.getChild("n14"));
  13273. this.n39 = (this.getChild("n39"));
  13274. this.n41 = (this.getChild("n41"));
  13275. this.n42 = (this.getChild("n42"));
  13276. this.n45 = (this.getChild("n45"));
  13277. this.changeBtn = (this.getChild("changeBtn"));
  13278. this.closeBtn = (this.getChild("closeBtn"));
  13279. this.t0 = this.getTransition("t0");
  13280. }
  13281. }
  13282. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13283. class ui_RankItem extends fgui.GComponent {
  13284. static createInstance() {
  13285. return (fgui.UIPackage.createObject("game", "RankItem"));
  13286. }
  13287. onConstruct() {
  13288. this.n10 = (this.getChild("n10"));
  13289. this.n11 = (this.getChild("n11"));
  13290. this.rankTxt = (this.getChild("rankTxt"));
  13291. this.headNode = (this.getChild("headNode"));
  13292. this.nameTxt = (this.getChild("nameTxt"));
  13293. this.n19 = (this.getChild("n19"));
  13294. this.valueTxt = (this.getChild("valueTxt"));
  13295. this.img1 = (this.getChild("img1"));
  13296. this.img2 = (this.getChild("img2"));
  13297. this.img3 = (this.getChild("img3"));
  13298. }
  13299. }
  13300. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13301. class ui_ranking_com9 extends fgui.GComponent {
  13302. static createInstance() {
  13303. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13304. }
  13305. onConstruct() {
  13306. this.c1 = this.getController("c1");
  13307. this.n27 = (this.getChild("n27"));
  13308. this.n28 = (this.getChild("n28"));
  13309. this.headNode = (this.getChild("headNode"));
  13310. this.rankTxt = (this.getChild("rankTxt"));
  13311. this.nameTxt = (this.getChild("nameTxt"));
  13312. this.n34 = (this.getChild("n34"));
  13313. this.valueTxt = (this.getChild("valueTxt"));
  13314. this.n36 = (this.getChild("n36"));
  13315. this.n37 = (this.getChild("n37"));
  13316. this.n38 = (this.getChild("n38"));
  13317. this.n39 = (this.getChild("n39"));
  13318. this.n40 = (this.getChild("n40"));
  13319. }
  13320. }
  13321. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13322. class ui_ranking_com10 extends fgui.GComponent {
  13323. static createInstance() {
  13324. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13325. }
  13326. onConstruct() {
  13327. this.n23 = (this.getChild("n23"));
  13328. this.n24 = (this.getChild("n24"));
  13329. }
  13330. }
  13331. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13332. class ui_ranking_com11 extends fgui.GComponent {
  13333. static createInstance() {
  13334. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13335. }
  13336. onConstruct() {
  13337. this.n24 = (this.getChild("n24"));
  13338. this.n25 = (this.getChild("n25"));
  13339. this.t0 = this.getTransition("t0");
  13340. }
  13341. }
  13342. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13343. class ui_ranking_com13 extends fgui.GButton {
  13344. static createInstance() {
  13345. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13346. }
  13347. onConstruct() {
  13348. this.c1 = this.getController("c1");
  13349. this.n44 = (this.getChild("n44"));
  13350. this.n45 = (this.getChild("n45"));
  13351. this.n46 = (this.getChild("n46"));
  13352. }
  13353. }
  13354. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13355. class ui_Component122 extends fgui.GComponent {
  13356. static createInstance() {
  13357. return (fgui.UIPackage.createObject("game", "Component122"));
  13358. }
  13359. onConstruct() {
  13360. this.gameNode3 = (this.getChild("gameNode3"));
  13361. }
  13362. }
  13363. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13364. class ui_skillItem extends fgui.GComponent {
  13365. static createInstance() {
  13366. return (fgui.UIPackage.createObject("game", "skillItem"));
  13367. }
  13368. onConstruct() {
  13369. this.c1 = this.getController("c1");
  13370. this.n31 = (this.getChild("n31"));
  13371. this.n6 = (this.getChild("n6"));
  13372. this.skillImg = (this.getChild("skillImg"));
  13373. this.nameTxt = (this.getChild("nameTxt"));
  13374. this.levelTxt = (this.getChild("levelTxt"));
  13375. this.n28 = (this.getChild("n28"));
  13376. this.describeTxt = (this.getChild("describeTxt"));
  13377. this.n32 = (this.getChild("n32"));
  13378. this.mutiBtn = (this.getChild("mutiBtn"));
  13379. this.tryNode = (this.getChild("tryNode"));
  13380. this.normalBtn = (this.getChild("normalBtn"));
  13381. this.startBtn = (this.getChild("startBtn"));
  13382. this.n42 = (this.getChild("n42"));
  13383. this.n43 = (this.getChild("n43"));
  13384. this.n44 = (this.getChild("n44"));
  13385. }
  13386. }
  13387. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13388. class ui_Component26 extends fgui.GButton {
  13389. static createInstance() {
  13390. return (fgui.UIPackage.createObject("game", "Component26"));
  13391. }
  13392. onConstruct() {
  13393. this.n11 = (this.getChild("n11"));
  13394. this.n30 = (this.getChild("n30"));
  13395. this.n34 = (this.getChild("n34"));
  13396. }
  13397. }
  13398. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13399. class ui_Component28 extends fgui.GButton {
  13400. static createInstance() {
  13401. return (fgui.UIPackage.createObject("game", "Component28"));
  13402. }
  13403. onConstruct() {
  13404. this.n12 = (this.getChild("n12"));
  13405. this.n31 = (this.getChild("n31"));
  13406. this.curTxt = (this.getChild("curTxt"));
  13407. this.n33 = (this.getChild("n33"));
  13408. }
  13409. }
  13410. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13411. class ui_Component1302 extends fgui.GComponent {
  13412. static createInstance() {
  13413. return (fgui.UIPackage.createObject("game", "Component1302"));
  13414. }
  13415. onConstruct() {
  13416. this.n2 = (this.getChild("n2"));
  13417. this.n3 = (this.getChild("n3"));
  13418. }
  13419. }
  13420. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13421. class ui_Component113 extends fgui.GComponent {
  13422. static createInstance() {
  13423. return (fgui.UIPackage.createObject("game", "Component113"));
  13424. }
  13425. onConstruct() {
  13426. this.n85 = (this.getChild("n85"));
  13427. this.n86 = (this.getChild("n86"));
  13428. this.n77 = (this.getChild("n77"));
  13429. this.n79 = (this.getChild("n79"));
  13430. this.n80 = (this.getChild("n80"));
  13431. this.n81 = (this.getChild("n81"));
  13432. this.n82 = (this.getChild("n82"));
  13433. this.n84 = (this.getChild("n84"));
  13434. this.n87 = (this.getChild("n87"));
  13435. this.t0 = this.getTransition("t0");
  13436. }
  13437. }
  13438. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13439. class ui_Component114 extends fgui.GComponent {
  13440. static createInstance() {
  13441. return (fgui.UIPackage.createObject("game", "Component114"));
  13442. }
  13443. onConstruct() {
  13444. this.n77 = (this.getChild("n77"));
  13445. this.t0 = this.getTransition("t0");
  13446. }
  13447. }
  13448. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13449. class ui_Component115 extends fgui.GComponent {
  13450. static createInstance() {
  13451. return (fgui.UIPackage.createObject("game", "Component115"));
  13452. }
  13453. onConstruct() {
  13454. this.n83 = (this.getChild("n83"));
  13455. this.fingerNode = (this.getChild("fingerNode"));
  13456. this.n84 = (this.getChild("n84"));
  13457. }
  13458. }
  13459. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13460. class ui_Component117 extends fgui.GComponent {
  13461. static createInstance() {
  13462. return (fgui.UIPackage.createObject("game", "Component117"));
  13463. }
  13464. onConstruct() {
  13465. this.n87 = (this.getChild("n87"));
  13466. this.n88 = (this.getChild("n88"));
  13467. this.n84 = (this.getChild("n84"));
  13468. this.n85 = (this.getChild("n85"));
  13469. this.n86 = (this.getChild("n86"));
  13470. this.t0 = this.getTransition("t0");
  13471. }
  13472. }
  13473. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13474. class ui_Component98_1 extends fgui.GButton {
  13475. static createInstance() {
  13476. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13477. }
  13478. onConstruct() {
  13479. this.c1 = this.getController("c1");
  13480. this.n8 = (this.getChild("n8"));
  13481. this.n41 = (this.getChild("n41"));
  13482. this.n40 = (this.getChild("n40"));
  13483. }
  13484. }
  13485. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13486. class ui_Component61 extends fgui.GComponent {
  13487. static createInstance() {
  13488. return (fgui.UIPackage.createObject("game", "Component61"));
  13489. }
  13490. onConstruct() {
  13491. this.n14 = (this.getChild("n14"));
  13492. this.n6 = (this.getChild("n6"));
  13493. this.t0 = this.getTransition("t0");
  13494. }
  13495. }
  13496. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13497. class ui_Component62 extends fgui.GComponent {
  13498. static createInstance() {
  13499. return (fgui.UIPackage.createObject("game", "Component62"));
  13500. }
  13501. onConstruct() {
  13502. this.n66 = (this.getChild("n66"));
  13503. this.n56 = (this.getChild("n56"));
  13504. this.n63 = (this.getChild("n63"));
  13505. this.n65 = (this.getChild("n65"));
  13506. this.t0 = this.getTransition("t0");
  13507. }
  13508. }
  13509. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13510. class ui_d3Root extends fgui.GComponent {
  13511. static createInstance() {
  13512. return (fgui.UIPackage.createObject("game", "d3Root"));
  13513. }
  13514. onConstruct() {
  13515. }
  13516. }
  13517. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13518. class ui_d2Root extends fgui.GComponent {
  13519. static createInstance() {
  13520. return (fgui.UIPackage.createObject("game", "d2Root"));
  13521. }
  13522. onConstruct() {
  13523. }
  13524. }
  13525. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13526. class ui_ballNode extends fgui.GComponent {
  13527. static createInstance() {
  13528. return (fgui.UIPackage.createObject("game", "ballNode"));
  13529. }
  13530. onConstruct() {
  13531. }
  13532. }
  13533. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13534. class ui_border extends fgui.GComponent {
  13535. static createInstance() {
  13536. return (fgui.UIPackage.createObject("game", "border"));
  13537. }
  13538. onConstruct() {
  13539. this.bar1 = (this.getChild("bar1"));
  13540. this.bar2 = (this.getChild("bar2"));
  13541. this.bar3 = (this.getChild("bar3"));
  13542. this.bar4 = (this.getChild("bar4"));
  13543. this.bar5 = (this.getChild("bar5"));
  13544. this.bar6 = (this.getChild("bar6"));
  13545. this.circle1 = (this.getChild("circle1"));
  13546. this.circle2 = (this.getChild("circle2"));
  13547. this.circle3 = (this.getChild("circle3"));
  13548. this.circle4 = (this.getChild("circle4"));
  13549. this.circle5 = (this.getChild("circle5"));
  13550. this.circle6 = (this.getChild("circle6"));
  13551. this.n28 = (this.getChild("n28"));
  13552. }
  13553. }
  13554. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13555. class ui_Component41_2 extends fgui.GComponent {
  13556. static createInstance() {
  13557. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13558. }
  13559. onConstruct() {
  13560. this.c1 = this.getController("c1");
  13561. this.n0 = (this.getChild("n0"));
  13562. this.n2 = (this.getChild("n2"));
  13563. this.n19 = (this.getChild("n19"));
  13564. this.cancelBtn = (this.getChild("cancelBtn"));
  13565. this.videoBtn = (this.getChild("videoBtn"));
  13566. this.n9 = (this.getChild("n9"));
  13567. this.n22 = (this.getChild("n22"));
  13568. this.tipsTxt = (this.getChild("tipsTxt"));
  13569. this.n23 = (this.getChild("n23"));
  13570. this.n24 = (this.getChild("n24"));
  13571. this.n26 = (this.getChild("n26"));
  13572. this.n27 = (this.getChild("n27"));
  13573. this.titleTxt = (this.getChild("titleTxt"));
  13574. }
  13575. }
  13576. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13577. class ui_Component41_1 extends fgui.GComponent {
  13578. static createInstance() {
  13579. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13580. }
  13581. onConstruct() {
  13582. this.c1 = this.getController("c1");
  13583. this.n0 = (this.getChild("n0"));
  13584. this.n2 = (this.getChild("n2"));
  13585. this.cancelBtn = (this.getChild("cancelBtn"));
  13586. this.videoBtn = (this.getChild("videoBtn"));
  13587. this.n27 = (this.getChild("n27"));
  13588. this.n30 = (this.getChild("n30"));
  13589. this.n31 = (this.getChild("n31"));
  13590. this.n32 = (this.getChild("n32"));
  13591. this.n33 = (this.getChild("n33"));
  13592. this.n34 = (this.getChild("n34"));
  13593. this.n35 = (this.getChild("n35"));
  13594. this.n36 = (this.getChild("n36"));
  13595. this.n1 = (this.getChild("n1"));
  13596. this.n37 = (this.getChild("n37"));
  13597. this.t0 = this.getTransition("t0");
  13598. this.t1 = this.getTransition("t1");
  13599. this.t2 = this.getTransition("t2");
  13600. this.t3 = this.getTransition("t3");
  13601. }
  13602. }
  13603. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13604. class ui_againBtn extends fgui.GButton {
  13605. static createInstance() {
  13606. return (fgui.UIPackage.createObject("game", "againBtn"));
  13607. }
  13608. onConstruct() {
  13609. this.n2 = (this.getChild("n2"));
  13610. this.n1 = (this.getChild("n1"));
  13611. this.n5 = (this.getChild("n5"));
  13612. }
  13613. }
  13614. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13615. class ui_Component118 extends fgui.GButton {
  13616. static createInstance() {
  13617. return (fgui.UIPackage.createObject("game", "Component118"));
  13618. }
  13619. onConstruct() {
  13620. this.c1 = this.getController("c1");
  13621. this.n14 = (this.getChild("n14"));
  13622. this.n9 = (this.getChild("n9"));
  13623. this.n10 = (this.getChild("n10"));
  13624. this.diamondTxt = (this.getChild("diamondTxt"));
  13625. this.n13 = (this.getChild("n13"));
  13626. this.n15 = (this.getChild("n15"));
  13627. }
  13628. }
  13629. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13630. class ui_Component119 extends fgui.GComponent {
  13631. static createInstance() {
  13632. return (fgui.UIPackage.createObject("game", "Component119"));
  13633. }
  13634. onConstruct() {
  13635. this.n1 = (this.getChild("n1"));
  13636. this.n2 = (this.getChild("n2"));
  13637. this.n13 = (this.getChild("n13"));
  13638. this.n6 = (this.getChild("n6"));
  13639. this.screenNode = (this.getChild("screenNode"));
  13640. this.n15 = (this.getChild("n15"));
  13641. this.closeBtn = (this.getChild("closeBtn"));
  13642. this.share2Btn = (this.getChild("share2Btn"));
  13643. this.shareBtn = (this.getChild("shareBtn"));
  13644. this.tipsNode = (this.getChild("tipsNode"));
  13645. this.awardNode = (this.getChild("awardNode"));
  13646. }
  13647. }
  13648. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13649. class ui_Component132_1 extends fgui.GComponent {
  13650. static createInstance() {
  13651. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13652. }
  13653. onConstruct() {
  13654. this.n25 = (this.getChild("n25"));
  13655. this.n26 = (this.getChild("n26"));
  13656. this.n27 = (this.getChild("n27"));
  13657. this.t0 = this.getTransition("t0");
  13658. }
  13659. }
  13660. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13661. class ui_SecretaryDisplay extends fgui.GComponent {
  13662. static createInstance() {
  13663. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13664. }
  13665. onConstruct() {
  13666. this.n2 = (this.getChild("n2"));
  13667. this.levelTxt = (this.getChild("levelTxt"));
  13668. this.n4 = (this.getChild("n4"));
  13669. this.secretary = (this.getChild("secretary"));
  13670. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13671. this.n16 = (this.getChild("n16"));
  13672. this.n37 = (this.getChild("n37"));
  13673. this.n41 = (this.getChild("n41"));
  13674. this.n14 = (this.getChild("n14"));
  13675. this.n17 = (this.getChild("n17"));
  13676. this.heightTxt = (this.getChild("heightTxt"));
  13677. this.n46 = (this.getChild("n46"));
  13678. this.n36 = (this.getChild("n36"));
  13679. this.n38 = (this.getChild("n38"));
  13680. this.foodTxt = (this.getChild("foodTxt"));
  13681. this.n47 = (this.getChild("n47"));
  13682. this.n40 = (this.getChild("n40"));
  13683. this.n42 = (this.getChild("n42"));
  13684. this.historyTxt = (this.getChild("historyTxt"));
  13685. this.n48 = (this.getChild("n48"));
  13686. this.nameImg = (this.getChild("nameImg"));
  13687. this.n12 = (this.getChild("n12"));
  13688. this.n49 = (this.getChild("n49"));
  13689. this.t0 = this.getTransition("t0");
  13690. }
  13691. }
  13692. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13693. class ui_BallRodDisplay extends fgui.GComponent {
  13694. static createInstance() {
  13695. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13696. }
  13697. onConstruct() {
  13698. this.c1 = this.getController("c1");
  13699. this.n31 = (this.getChild("n31"));
  13700. this.n6 = (this.getChild("n6"));
  13701. this.nameTxt = (this.getChild("nameTxt"));
  13702. this.rodImg = (this.getChild("rodImg"));
  13703. this.levelNode = (this.getChild("levelNode"));
  13704. this.eftRod = (this.getChild("eftRod"));
  13705. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13706. }
  13707. }
  13708. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13709. class ui_Component111_11 extends fgui.GComponent {
  13710. static createInstance() {
  13711. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13712. }
  13713. onConstruct() {
  13714. this.n68 = (this.getChild("n68"));
  13715. this.n69 = (this.getChild("n69"));
  13716. }
  13717. }
  13718. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13719. class ui_Component112 extends fgui.GComponent {
  13720. static createInstance() {
  13721. return (fgui.UIPackage.createObject("game", "Component112"));
  13722. }
  13723. onConstruct() {
  13724. this.n68 = (this.getChild("n68"));
  13725. this.n70 = (this.getChild("n70"));
  13726. this.myMask = (this.getChild("myMask"));
  13727. }
  13728. }
  13729. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13730. class ui_Component111 extends fgui.GComponent {
  13731. static createInstance() {
  13732. return (fgui.UIPackage.createObject("game", "Component111"));
  13733. }
  13734. onConstruct() {
  13735. this.n68 = (this.getChild("n68"));
  13736. this.myMask = (this.getChild("myMask"));
  13737. }
  13738. }
  13739. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13740. class ui_Component144 extends fgui.GButton {
  13741. static createInstance() {
  13742. return (fgui.UIPackage.createObject("game", "Component144"));
  13743. }
  13744. onConstruct() {
  13745. this.n8 = (this.getChild("n8"));
  13746. }
  13747. }
  13748. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13749. class ui_Sign_com2 extends fgui.GComponent {
  13750. static createInstance() {
  13751. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13752. }
  13753. onConstruct() {
  13754. this.n0 = (this.getChild("n0"));
  13755. this.n1 = (this.getChild("n1"));
  13756. this.t0 = this.getTransition("t0");
  13757. }
  13758. }
  13759. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13760. class ui_Sign_guang extends fgui.GComponent {
  13761. static createInstance() {
  13762. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13763. }
  13764. onConstruct() {
  13765. this.n1 = (this.getChild("n1"));
  13766. this.n2 = (this.getChild("n2"));
  13767. this.n3 = (this.getChild("n3"));
  13768. this.n4 = (this.getChild("n4"));
  13769. this.n5 = (this.getChild("n5"));
  13770. this.n6 = (this.getChild("n6"));
  13771. this.n8 = (this.getChild("n8"));
  13772. }
  13773. }
  13774. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13775. class ui_SignMax extends fgui.GComponent {
  13776. static createInstance() {
  13777. return (fgui.UIPackage.createObject("game", "SignMax"));
  13778. }
  13779. onConstruct() {
  13780. this.c1 = this.getController("c1");
  13781. this.n7 = (this.getChild("n7"));
  13782. this.n15 = (this.getChild("n15"));
  13783. this.n8 = (this.getChild("n8"));
  13784. this.titleTxt = (this.getChild("titleTxt"));
  13785. this.myIcon1 = (this.getChild("myIcon1"));
  13786. this.numTxt1 = (this.getChild("numTxt1"));
  13787. this.myIcon2 = (this.getChild("myIcon2"));
  13788. this.n20 = (this.getChild("n20"));
  13789. this.n17 = (this.getChild("n17"));
  13790. this.numTxt2 = (this.getChild("numTxt2"));
  13791. this.n12 = (this.getChild("n12"));
  13792. this.n13 = (this.getChild("n13"));
  13793. this.n21 = (this.getChild("n21"));
  13794. this.n14 = (this.getChild("n14"));
  13795. }
  13796. }
  13797. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13798. class ui_Sign_com2_1 extends fgui.GComponent {
  13799. static createInstance() {
  13800. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13801. }
  13802. onConstruct() {
  13803. this.n0 = (this.getChild("n0"));
  13804. this.n1 = (this.getChild("n1"));
  13805. this.t0 = this.getTransition("t0");
  13806. }
  13807. }
  13808. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13809. class ui_Sign_com5 extends fgui.GComponent {
  13810. static createInstance() {
  13811. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13812. }
  13813. onConstruct() {
  13814. this.n3 = (this.getChild("n3"));
  13815. this.n29 = (this.getChild("n29"));
  13816. this.n4 = (this.getChild("n4"));
  13817. this.day1 = (this.getChild("day1"));
  13818. this.day2 = (this.getChild("day2"));
  13819. this.day3 = (this.getChild("day3"));
  13820. this.day4 = (this.getChild("day4"));
  13821. this.day5 = (this.getChild("day5"));
  13822. this.day6 = (this.getChild("day6"));
  13823. this.day7 = (this.getChild("day7"));
  13824. this.t0 = this.getTransition("t0");
  13825. }
  13826. }
  13827. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13828. class ui_Sign_com8 extends fgui.GComponent {
  13829. static createInstance() {
  13830. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13831. }
  13832. onConstruct() {
  13833. this.n48 = (this.getChild("n48"));
  13834. this.womanTxt = (this.getChild("womanTxt"));
  13835. this.t0 = this.getTransition("t0");
  13836. }
  13837. }
  13838. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13839. class ui_Sign_com6 extends fgui.GComponent {
  13840. static createInstance() {
  13841. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13842. }
  13843. onConstruct() {
  13844. this.n2 = (this.getChild("n2"));
  13845. this.n3 = (this.getChild("n3"));
  13846. this.t0 = this.getTransition("t0");
  13847. }
  13848. }
  13849. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13850. class ui_Sign_com7 extends fgui.GComponent {
  13851. static createInstance() {
  13852. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13853. }
  13854. onConstruct() {
  13855. this.n29 = (this.getChild("n29"));
  13856. this.n2 = (this.getChild("n2"));
  13857. }
  13858. }
  13859. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13860. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13861. static createInstance() {
  13862. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13863. }
  13864. onConstruct() {
  13865. this.n5 = (this.getChild("n5"));
  13866. this.n4 = (this.getChild("n4"));
  13867. this.t0 = this.getTransition("t0");
  13868. }
  13869. }
  13870. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13871. class ui_UITurntable_com2 extends fgui.GComponent {
  13872. static createInstance() {
  13873. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13874. }
  13875. onConstruct() {
  13876. this.c1 = this.getController("c1");
  13877. this.n4 = (this.getChild("n4"));
  13878. this.n6 = (this.getChild("n6"));
  13879. this.n10 = (this.getChild("n10"));
  13880. this.n11 = (this.getChild("n11"));
  13881. this.n12 = (this.getChild("n12"));
  13882. this.n13 = (this.getChild("n13"));
  13883. this.n14 = (this.getChild("n14"));
  13884. this.n15 = (this.getChild("n15"));
  13885. this.n16 = (this.getChild("n16"));
  13886. this.n17 = (this.getChild("n17"));
  13887. this.n18 = (this.getChild("n18"));
  13888. this.n19 = (this.getChild("n19"));
  13889. this.n20 = (this.getChild("n20"));
  13890. this.n21 = (this.getChild("n21"));
  13891. this.n22 = (this.getChild("n22"));
  13892. this.n23 = (this.getChild("n23"));
  13893. this.n24 = (this.getChild("n24"));
  13894. this.n25 = (this.getChild("n25"));
  13895. this.n26 = (this.getChild("n26"));
  13896. this.n27 = (this.getChild("n27"));
  13897. this.n28 = (this.getChild("n28"));
  13898. this.n29 = (this.getChild("n29"));
  13899. this.n30 = (this.getChild("n30"));
  13900. this.n31 = (this.getChild("n31"));
  13901. this.n32 = (this.getChild("n32"));
  13902. this.n33 = (this.getChild("n33"));
  13903. }
  13904. }
  13905. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13906. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13907. static createInstance() {
  13908. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13909. }
  13910. onConstruct() {
  13911. this.n5 = (this.getChild("n5"));
  13912. this.n4 = (this.getChild("n4"));
  13913. this.t0 = this.getTransition("t0");
  13914. }
  13915. }
  13916. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13917. class ui_UITurntable_com5 extends fgui.GComponent {
  13918. static createInstance() {
  13919. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13920. }
  13921. onConstruct() {
  13922. this.flashNode = (this.getChild("flashNode"));
  13923. this.rotNode = (this.getChild("rotNode"));
  13924. this.n3 = (this.getChild("n3"));
  13925. this.n21 = (this.getChild("n21"));
  13926. this.t0 = this.getTransition("t0");
  13927. }
  13928. }
  13929. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  13930. class ui_UITurntable_com7 extends fgui.GComponent {
  13931. static createInstance() {
  13932. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  13933. }
  13934. onConstruct() {
  13935. this.n2 = (this.getChild("n2"));
  13936. this.n35 = (this.getChild("n35"));
  13937. this.img1 = (this.getChild("img1"));
  13938. this.img2 = (this.getChild("img2"));
  13939. this.img3 = (this.getChild("img3"));
  13940. this.img4 = (this.getChild("img4"));
  13941. this.img6 = (this.getChild("img6"));
  13942. this.img5 = (this.getChild("img5"));
  13943. this.txt1 = (this.getChild("txt1"));
  13944. this.txt2 = (this.getChild("txt2"));
  13945. this.txt3 = (this.getChild("txt3"));
  13946. this.txt4 = (this.getChild("txt4"));
  13947. this.txt5 = (this.getChild("txt5"));
  13948. this.txt6 = (this.getChild("txt6"));
  13949. }
  13950. }
  13951. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  13952. class ui_UITurntable_com9 extends fgui.GComponent {
  13953. static createInstance() {
  13954. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  13955. }
  13956. onConstruct() {
  13957. this.n38 = (this.getChild("n38"));
  13958. this.n39 = (this.getChild("n39"));
  13959. }
  13960. }
  13961. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  13962. class ui_UITurntable_com10 extends fgui.GComponent {
  13963. static createInstance() {
  13964. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  13965. }
  13966. onConstruct() {
  13967. this.n39 = (this.getChild("n39"));
  13968. this.n40 = (this.getChild("n40"));
  13969. this.t0 = this.getTransition("t0");
  13970. }
  13971. }
  13972. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  13973. class ui_UITurntable_com11 extends fgui.GComponent {
  13974. static createInstance() {
  13975. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  13976. }
  13977. onConstruct() {
  13978. this.n38 = (this.getChild("n38"));
  13979. this.n39 = (this.getChild("n39"));
  13980. this.n40 = (this.getChild("n40"));
  13981. this.t0 = this.getTransition("t0");
  13982. }
  13983. }
  13984. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  13985. class ui_UITurntable_com12 extends fgui.GComponent {
  13986. static createInstance() {
  13987. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  13988. }
  13989. onConstruct() {
  13990. this.n43 = (this.getChild("n43"));
  13991. this.barNode = (this.getChild("barNode"));
  13992. this.tipsTxt = (this.getChild("tipsTxt"));
  13993. this.n45 = (this.getChild("n45"));
  13994. this.boxBtn = (this.getChild("boxBtn"));
  13995. }
  13996. }
  13997. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  13998. class ui_UITurntable_com1 extends fgui.GButton {
  13999. static createInstance() {
  14000. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14001. }
  14002. onConstruct() {
  14003. this.n41 = (this.getChild("n41"));
  14004. this.n42 = (this.getChild("n42"));
  14005. this.t0 = this.getTransition("t0");
  14006. }
  14007. }
  14008. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14009. class ui_UITurntable_com3 extends fgui.GComponent {
  14010. static createInstance() {
  14011. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14012. }
  14013. onConstruct() {
  14014. this.n48 = (this.getChild("n48"));
  14015. this.womanTxt = (this.getChild("womanTxt"));
  14016. this.t0 = this.getTransition("t0");
  14017. }
  14018. }
  14019. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14020. class ui_cancelBtn2 extends fgui.GButton {
  14021. static createInstance() {
  14022. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14023. }
  14024. onConstruct() {
  14025. this.c1 = this.getController("c1");
  14026. this.n0 = (this.getChild("n0"));
  14027. this.n1 = (this.getChild("n1"));
  14028. this.n2 = (this.getChild("n2"));
  14029. this.n3 = (this.getChild("n3"));
  14030. this.n4 = (this.getChild("n4"));
  14031. this.n5 = (this.getChild("n5"));
  14032. this.n6 = (this.getChild("n6"));
  14033. this.n7 = (this.getChild("n7"));
  14034. this.n8 = (this.getChild("n8"));
  14035. this.powerEft = (this.getChild("powerEft"));
  14036. }
  14037. }
  14038. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14039. class ui_shareBtn2 extends fgui.GButton {
  14040. static createInstance() {
  14041. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14042. }
  14043. onConstruct() {
  14044. this.c1 = this.getController("c1");
  14045. this.n2 = (this.getChild("n2"));
  14046. this.n24 = (this.getChild("n24"));
  14047. this.n1 = (this.getChild("n1"));
  14048. this.n3 = (this.getChild("n3"));
  14049. this.n23 = (this.getChild("n23"));
  14050. this.n4 = (this.getChild("n4"));
  14051. this.n5 = (this.getChild("n5"));
  14052. this.n6 = (this.getChild("n6"));
  14053. this.n20 = (this.getChild("n20"));
  14054. this.n21 = (this.getChild("n21"));
  14055. this.n22 = (this.getChild("n22"));
  14056. this.powerEft = (this.getChild("powerEft"));
  14057. }
  14058. }
  14059. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14060. class ui_UIMoney extends fgui.GComponent {
  14061. static createInstance() {
  14062. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14063. }
  14064. onConstruct() {
  14065. this.c1 = this.getController("c1");
  14066. this.n4 = (this.getChild("n4"));
  14067. this.coinImg = (this.getChild("coinImg"));
  14068. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14069. this.coinTxt = (this.getChild("coinTxt"));
  14070. this.n7 = (this.getChild("n7"));
  14071. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14072. this.diamondTxt = (this.getChild("diamondTxt"));
  14073. this.diamondImg = (this.getChild("diamondImg"));
  14074. this.n12 = (this.getChild("n12"));
  14075. this.powerImg = (this.getChild("powerImg"));
  14076. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14077. this.powerTxt = (this.getChild("powerTxt"));
  14078. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14079. }
  14080. }
  14081. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14082. class ui_backBtn extends fgui.GButton {
  14083. static createInstance() {
  14084. return (fgui.UIPackage.createObject("game", "backBtn"));
  14085. }
  14086. onConstruct() {
  14087. this.n0 = (this.getChild("n0"));
  14088. this.t0 = this.getTransition("t0");
  14089. this.t1 = this.getTransition("t1");
  14090. }
  14091. }
  14092. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14093. class ui_MoneyBtn extends fgui.GButton {
  14094. static createInstance() {
  14095. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14096. }
  14097. onConstruct() {
  14098. this.button = this.getController("button");
  14099. this.n0 = (this.getChild("n0"));
  14100. }
  14101. }
  14102. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14103. class ui_UIMoneyBtn extends fgui.GComponent {
  14104. static createInstance() {
  14105. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14106. }
  14107. onConstruct() {
  14108. this.n1 = (this.getChild("n1"));
  14109. this.closeBtn = (this.getChild("closeBtn"));
  14110. }
  14111. }
  14112. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14113. class ui_Component64 extends fgui.GComponent {
  14114. static createInstance() {
  14115. return (fgui.UIPackage.createObject("game", "Component64"));
  14116. }
  14117. onConstruct() {
  14118. this.n57 = (this.getChild("n57"));
  14119. this.n54 = (this.getChild("n54"));
  14120. this.n55 = (this.getChild("n55"));
  14121. this.n56 = (this.getChild("n56"));
  14122. this.t1 = this.getTransition("t1");
  14123. }
  14124. }
  14125. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14126. class ui_Component41_3 extends fgui.GComponent {
  14127. static createInstance() {
  14128. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14129. }
  14130. onConstruct() {
  14131. this.c1 = this.getController("c1");
  14132. this.n0 = (this.getChild("n0"));
  14133. this.n2 = (this.getChild("n2"));
  14134. this.cancelBtn = (this.getChild("cancelBtn"));
  14135. this.videoBtn = (this.getChild("videoBtn"));
  14136. this.n9 = (this.getChild("n9"));
  14137. this.n24 = (this.getChild("n24"));
  14138. this.n27 = (this.getChild("n27"));
  14139. this.titleTxt = (this.getChild("titleTxt"));
  14140. this.n28 = (this.getChild("n28"));
  14141. this.t0 = this.getTransition("t0");
  14142. }
  14143. }
  14144. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14145. class ui_dh_zs_4 extends fgui.GComponent {
  14146. static createInstance() {
  14147. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14148. }
  14149. onConstruct() {
  14150. this.n1 = (this.getChild("n1"));
  14151. this.n2 = (this.getChild("n2"));
  14152. this.n3 = (this.getChild("n3"));
  14153. this.n4 = (this.getChild("n4"));
  14154. this.n5 = (this.getChild("n5"));
  14155. this.n6 = (this.getChild("n6"));
  14156. this.n8 = (this.getChild("n8"));
  14157. this.t0 = this.getTransition("t0");
  14158. }
  14159. }
  14160. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14161. class ui_Component71_1 extends fgui.GButton {
  14162. static createInstance() {
  14163. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14164. }
  14165. onConstruct() {
  14166. this.n17 = (this.getChild("n17"));
  14167. this.t0 = this.getTransition("t0");
  14168. }
  14169. }
  14170. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14171. class ui_Component83 extends fgui.GComponent {
  14172. static createInstance() {
  14173. return (fgui.UIPackage.createObject("game", "Component83"));
  14174. }
  14175. onConstruct() {
  14176. this.c1 = this.getController("c1");
  14177. this.n17 = (this.getChild("n17"));
  14178. this.n19 = (this.getChild("n19"));
  14179. this.n20 = (this.getChild("n20"));
  14180. }
  14181. }
  14182. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14183. class ui_Component84 extends fgui.GComponent {
  14184. static createInstance() {
  14185. return (fgui.UIPackage.createObject("game", "Component84"));
  14186. }
  14187. onConstruct() {
  14188. this.c1 = this.getController("c1");
  14189. this.n4 = (this.getChild("n4"));
  14190. this.n22 = (this.getChild("n22"));
  14191. this.n23 = (this.getChild("n23"));
  14192. this.numTxt = (this.getChild("numTxt"));
  14193. this.n25 = (this.getChild("n25"));
  14194. this.n26 = (this.getChild("n26"));
  14195. }
  14196. }
  14197. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14198. class ui_Component84_1 extends fgui.GComponent {
  14199. static createInstance() {
  14200. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14201. }
  14202. onConstruct() {
  14203. this.c1 = this.getController("c1");
  14204. this.n4 = (this.getChild("n4"));
  14205. this.n22 = (this.getChild("n22"));
  14206. this.n23 = (this.getChild("n23"));
  14207. this.numTxt = (this.getChild("numTxt"));
  14208. this.n25 = (this.getChild("n25"));
  14209. this.n26 = (this.getChild("n26"));
  14210. }
  14211. }
  14212. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14213. class ui_Component85 extends fgui.GComponent {
  14214. static createInstance() {
  14215. return (fgui.UIPackage.createObject("game", "Component85"));
  14216. }
  14217. onConstruct() {
  14218. this.n1 = (this.getChild("n1"));
  14219. this.n6 = (this.getChild("n6"));
  14220. this.n2 = (this.getChild("n2"));
  14221. this.n3 = (this.getChild("n3"));
  14222. this.levelTxt = (this.getChild("levelTxt"));
  14223. this.n10 = (this.getChild("n10"));
  14224. this.n11 = (this.getChild("n11"));
  14225. this.n12 = (this.getChild("n12"));
  14226. this.n13 = (this.getChild("n13"));
  14227. this.n14 = (this.getChild("n14"));
  14228. this.modeNode = (this.getChild("modeNode"));
  14229. this.n18 = (this.getChild("n18"));
  14230. this.conditionTxt = (this.getChild("conditionTxt"));
  14231. this.diamondNode = (this.getChild("diamondNode"));
  14232. this.coinNode = (this.getChild("coinNode"));
  14233. this.startBtn = (this.getChild("startBtn"));
  14234. this.n28 = (this.getChild("n28"));
  14235. this.displayRoot = (this.getChild("displayRoot"));
  14236. this.t0 = this.getTransition("t0");
  14237. }
  14238. }
  14239. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14240. class ui_Component86 extends fgui.GButton {
  14241. static createInstance() {
  14242. return (fgui.UIPackage.createObject("game", "Component86"));
  14243. }
  14244. onConstruct() {
  14245. this.n15 = (this.getChild("n15"));
  14246. this.t0 = this.getTransition("t0");
  14247. }
  14248. }
  14249. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14250. class ui_Component87 extends fgui.GComponent {
  14251. static createInstance() {
  14252. return (fgui.UIPackage.createObject("game", "Component87"));
  14253. }
  14254. onConstruct() {
  14255. this.n66 = (this.getChild("n66"));
  14256. this.myProgress = (this.getChild("myProgress"));
  14257. this.starAni = (this.getChild("starAni"));
  14258. this.hpTxt = (this.getChild("hpTxt"));
  14259. this.n74 = (this.getChild("n74"));
  14260. this.n73 = (this.getChild("n73"));
  14261. this.ballTxt = (this.getChild("ballTxt"));
  14262. this.n76 = (this.getChild("n76"));
  14263. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14264. this.levelTxt = (this.getChild("levelTxt"));
  14265. this.star1 = (this.getChild("star1"));
  14266. this.star2 = (this.getChild("star2"));
  14267. this.star3 = (this.getChild("star3"));
  14268. }
  14269. }
  14270. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14271. class ui_Component88 extends fgui.GProgressBar {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "Component88"));
  14274. }
  14275. onConstruct() {
  14276. this.n68 = (this.getChild("n68"));
  14277. this.bar = (this.getChild("bar"));
  14278. }
  14279. }
  14280. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14281. class ui_Component89 extends fgui.GComponent {
  14282. static createInstance() {
  14283. return (fgui.UIPackage.createObject("game", "Component89"));
  14284. }
  14285. onConstruct() {
  14286. this.c1 = this.getController("c1");
  14287. this.n71 = (this.getChild("n71"));
  14288. this.n72 = (this.getChild("n72"));
  14289. }
  14290. }
  14291. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14292. class ui_Component90 extends fgui.GComponent {
  14293. static createInstance() {
  14294. return (fgui.UIPackage.createObject("game", "Component90"));
  14295. }
  14296. onConstruct() {
  14297. this.c1 = this.getController("c1");
  14298. this.n64 = (this.getChild("n64"));
  14299. this.n65 = (this.getChild("n65"));
  14300. this.n66 = (this.getChild("n66"));
  14301. this.t0 = this.getTransition("t0");
  14302. }
  14303. }
  14304. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14305. class ui_Component127 extends fgui.GButton {
  14306. static createInstance() {
  14307. return (fgui.UIPackage.createObject("game", "Component127"));
  14308. }
  14309. onConstruct() {
  14310. this.n5 = (this.getChild("n5"));
  14311. }
  14312. }
  14313. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14314. class gameBinder {
  14315. static bindAll() {
  14316. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14317. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14318. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14319. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14320. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14321. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14322. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14323. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14324. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14325. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14326. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14327. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14328. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14329. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14330. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14331. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14332. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14333. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14334. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14335. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14336. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14337. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14338. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14339. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14340. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14341. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14342. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14343. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14344. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14345. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14346. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14347. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14348. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14349. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14350. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14351. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14352. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14353. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14354. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14355. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14356. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14357. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14358. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14359. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14360. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14361. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14362. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14363. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14364. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14365. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14366. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14367. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14368. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14369. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14370. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14371. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14372. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14373. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14374. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14375. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14376. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14377. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14378. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14379. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14380. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14381. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14382. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14383. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14384. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14385. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14386. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14387. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14388. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14389. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14390. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14391. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14392. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14393. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14394. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14395. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14396. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14397. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14398. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14399. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14400. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14401. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14402. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14403. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14404. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14405. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14406. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14407. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14408. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14409. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14410. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14411. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14412. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14413. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14414. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14415. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14416. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14417. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14418. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14419. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14420. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14421. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14422. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14423. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14424. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14425. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14426. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14427. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14428. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14429. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14430. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14431. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14432. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14433. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14434. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14435. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14436. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14437. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14438. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14439. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14440. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14441. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14442. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14443. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14444. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14445. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14446. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14447. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14448. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14449. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14450. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14451. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14452. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14453. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14454. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14455. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14456. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14457. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14458. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14459. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14460. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14461. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14462. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14463. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14464. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14465. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14466. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14467. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14468. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14469. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14470. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14471. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14472. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14473. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14474. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14475. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14476. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14477. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14478. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14479. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14480. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14481. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14482. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14483. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14484. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14485. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14486. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14487. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14488. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14489. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14490. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14491. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14492. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14493. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14494. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14495. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14496. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14497. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14498. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14499. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14500. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14501. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14502. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14503. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14504. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14505. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14506. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14507. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14508. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14509. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14510. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14511. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14512. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14513. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14514. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14515. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14516. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14517. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14518. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14519. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14520. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14521. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14522. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14523. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14524. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14525. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14526. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14527. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14528. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14529. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14530. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14531. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14532. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14533. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14534. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14535. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14536. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14537. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14538. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14539. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14540. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14541. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14542. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14543. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14544. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14545. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14546. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14547. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14548. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14549. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14550. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14551. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14552. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14553. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14554. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14555. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14556. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14557. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14558. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14559. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14560. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14561. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14562. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14563. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14564. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14565. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14566. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14567. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14568. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14569. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14570. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14571. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14572. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14573. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14574. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14575. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14576. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14577. }
  14578. }
  14579. class ui_btn6 extends fgui.GButton {
  14580. static createInstance() {
  14581. return (fgui.UIPackage.createObject("loading", "btn6"));
  14582. }
  14583. onConstruct() {
  14584. this.n6 = (this.getChild("n6"));
  14585. this.n1 = (this.getChild("n1"));
  14586. }
  14587. }
  14588. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14589. class ui_xyItem extends fgui.GComponent {
  14590. static createInstance() {
  14591. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14592. }
  14593. onConstruct() {
  14594. this.xyItem = (this.getChild("xyItem"));
  14595. }
  14596. }
  14597. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14598. class ui_loadinfo extends fgui.GProgressBar {
  14599. static createInstance() {
  14600. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14601. }
  14602. onConstruct() {
  14603. this.bg = (this.getChild("bg"));
  14604. this.bar = (this.getChild("bar"));
  14605. this.title = (this.getChild("title"));
  14606. this.ani = (this.getChild("ani"));
  14607. }
  14608. }
  14609. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14610. class ui_xyNode extends fgui.GComponent {
  14611. static createInstance() {
  14612. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14613. }
  14614. onConstruct() {
  14615. this.n0 = (this.getChild("n0"));
  14616. this.btnYes = (this.getChild("btnYes"));
  14617. this.btnNo = (this.getChild("btnNo"));
  14618. this.btnKnown = (this.getChild("btnKnown"));
  14619. this.btnSure = (this.getChild("btnSure"));
  14620. this.txtWelcom = (this.getChild("txtWelcom"));
  14621. this.txtXy = (this.getChild("txtXy"));
  14622. this.n75 = (this.getChild("n75"));
  14623. this.btnXy1 = (this.getChild("btnXy1"));
  14624. this.btnXy3 = (this.getChild("btnXy3"));
  14625. this.btnXy2 = (this.getChild("btnXy2"));
  14626. this.n74 = (this.getChild("n74"));
  14627. this.xy1 = (this.getChild("xy1"));
  14628. this.txtTitle = (this.getChild("txtTitle"));
  14629. this.btnBack = (this.getChild("btnBack"));
  14630. this.xyList = (this.getChild("xyList"));
  14631. this.xy2 = (this.getChild("xy2"));
  14632. this.xyNode = (this.getChild("xyNode"));
  14633. }
  14634. }
  14635. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14636. class ui_ageNode extends fgui.GComponent {
  14637. static createInstance() {
  14638. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14639. }
  14640. onConstruct() {
  14641. this.n3 = (this.getChild("n3"));
  14642. this.n7 = (this.getChild("n7"));
  14643. this.n4 = (this.getChild("n4"));
  14644. this.btnAge = (this.getChild("btnAge"));
  14645. this.ageNode = (this.getChild("ageNode"));
  14646. }
  14647. }
  14648. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14649. class ui_rnNode extends fgui.GComponent {
  14650. static createInstance() {
  14651. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14652. }
  14653. onConstruct() {
  14654. this.n28 = (this.getChild("n28"));
  14655. this.n30 = (this.getChild("n30"));
  14656. this.n33 = (this.getChild("n33"));
  14657. this.rn1 = (this.getChild("rn1"));
  14658. this.n40 = (this.getChild("n40"));
  14659. this.n41 = (this.getChild("n41"));
  14660. this.rn3 = (this.getChild("rn3"));
  14661. this.n37 = (this.getChild("n37"));
  14662. this.n39 = (this.getChild("n39"));
  14663. this.rn2 = (this.getChild("rn2"));
  14664. this.n47 = (this.getChild("n47"));
  14665. this.n49 = (this.getChild("n49"));
  14666. this.n44 = (this.getChild("n44"));
  14667. this.inputCode = (this.getChild("inputCode"));
  14668. this.inputName = (this.getChild("inputName"));
  14669. this.n48 = (this.getChild("n48"));
  14670. this.n50 = (this.getChild("n50"));
  14671. this.rn4 = (this.getChild("rn4"));
  14672. this.btnCheck = (this.getChild("btnCheck"));
  14673. this.btnExit = (this.getChild("btnExit"));
  14674. this.btnDone = (this.getChild("btnDone"));
  14675. this.rnNode = (this.getChild("rnNode"));
  14676. }
  14677. }
  14678. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14679. class ui_tipNode extends fgui.GComponent {
  14680. static createInstance() {
  14681. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14682. }
  14683. onConstruct() {
  14684. this.bg = (this.getChild("bg"));
  14685. this.n55 = (this.getChild("n55"));
  14686. this.n56 = (this.getChild("n56"));
  14687. this.tipNode = (this.getChild("tipNode"));
  14688. }
  14689. }
  14690. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14691. class ui_fcmNode extends fgui.GComponent {
  14692. static createInstance() {
  14693. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14694. }
  14695. onConstruct() {
  14696. this.n63 = (this.getChild("n63"));
  14697. this.n62 = (this.getChild("n62"));
  14698. this.btnRn = (this.getChild("btnRn"));
  14699. this.n61 = (this.getChild("n61"));
  14700. this.n58 = (this.getChild("n58"));
  14701. this.fcmNode = (this.getChild("fcmNode"));
  14702. }
  14703. }
  14704. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14705. class ui_msgNode extends fgui.GComponent {
  14706. static createInstance() {
  14707. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14708. }
  14709. onConstruct() {
  14710. this.n69 = (this.getChild("n69"));
  14711. this.txtMsg = (this.getChild("txtMsg"));
  14712. this.msgNode = (this.getChild("msgNode"));
  14713. }
  14714. }
  14715. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14716. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14717. static createInstance() {
  14718. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14719. }
  14720. onConstruct() {
  14721. this.n1 = (this.getChild("n1"));
  14722. this.n13 = (this.getChild("n13"));
  14723. this.n14 = (this.getChild("n14"));
  14724. this.n15 = (this.getChild("n15"));
  14725. this.n3 = (this.getChild("n3"));
  14726. this.n4 = (this.getChild("n4"));
  14727. this.n5 = (this.getChild("n5"));
  14728. this.n6 = (this.getChild("n6"));
  14729. this.n7 = (this.getChild("n7"));
  14730. this.n8 = (this.getChild("n8"));
  14731. this.n9 = (this.getChild("n9"));
  14732. this.n10 = (this.getChild("n10"));
  14733. this.n12 = (this.getChild("n12"));
  14734. this.n11 = (this.getChild("n11"));
  14735. this.n16 = (this.getChild("n16"));
  14736. this.n17 = (this.getChild("n17"));
  14737. this.n18 = (this.getChild("n18"));
  14738. this.n20 = (this.getChild("n20"));
  14739. this.n21 = (this.getChild("n21"));
  14740. this.t0 = this.getTransition("t0");
  14741. }
  14742. }
  14743. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14744. class ui_btn5 extends fgui.GButton {
  14745. static createInstance() {
  14746. return (fgui.UIPackage.createObject("loading", "btn5"));
  14747. }
  14748. onConstruct() {
  14749. this.n9 = (this.getChild("n9"));
  14750. this.n1 = (this.getChild("n1"));
  14751. }
  14752. }
  14753. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14754. class ui_UILoading extends fgui.GComponent {
  14755. static createInstance() {
  14756. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14757. }
  14758. onConstruct() {
  14759. this.n12 = (this.getChild("n12"));
  14760. this.loadinfo = (this.getChild("loadinfo"));
  14761. this.n13 = (this.getChild("n13"));
  14762. this.txtLoad = (this.getChild("txtLoad"));
  14763. this.n18 = (this.getChild("n18"));
  14764. }
  14765. }
  14766. ui_UILoading.URL = "ui://37nctnhwphc33";
  14767. class ui_AgeItem extends fgui.GComponent {
  14768. static createInstance() {
  14769. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14770. }
  14771. onConstruct() {
  14772. this.txtAge = (this.getChild("txtAge"));
  14773. }
  14774. }
  14775. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14776. class ui_btn1 extends fgui.GButton {
  14777. static createInstance() {
  14778. return (fgui.UIPackage.createObject("loading", "btn1"));
  14779. }
  14780. onConstruct() {
  14781. this.n6 = (this.getChild("n6"));
  14782. this.n1 = (this.getChild("n1"));
  14783. }
  14784. }
  14785. ui_btn1.URL = "ui://37nctnhwxe622p";
  14786. class ui_btn3 extends fgui.GButton {
  14787. static createInstance() {
  14788. return (fgui.UIPackage.createObject("loading", "btn3"));
  14789. }
  14790. onConstruct() {
  14791. this.n9 = (this.getChild("n9"));
  14792. this.n1 = (this.getChild("n1"));
  14793. }
  14794. }
  14795. ui_btn3.URL = "ui://37nctnhwxe622s";
  14796. class ui_btn2 extends fgui.GButton {
  14797. static createInstance() {
  14798. return (fgui.UIPackage.createObject("loading", "btn2"));
  14799. }
  14800. onConstruct() {
  14801. this.n6 = (this.getChild("n6"));
  14802. this.n1 = (this.getChild("n1"));
  14803. }
  14804. }
  14805. ui_btn2.URL = "ui://37nctnhwxe622t";
  14806. class ui_btnBack extends fgui.GButton {
  14807. static createInstance() {
  14808. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14809. }
  14810. onConstruct() {
  14811. this.n6 = (this.getChild("n6"));
  14812. this.n7 = (this.getChild("n7"));
  14813. }
  14814. }
  14815. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14816. class ui_btnXy1 extends fgui.GButton {
  14817. static createInstance() {
  14818. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14819. }
  14820. onConstruct() {
  14821. this.n1 = (this.getChild("n1"));
  14822. }
  14823. }
  14824. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14825. class ui_btnXy2 extends fgui.GButton {
  14826. static createInstance() {
  14827. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14828. }
  14829. onConstruct() {
  14830. this.n1 = (this.getChild("n1"));
  14831. }
  14832. }
  14833. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14834. class ui_btnXy3 extends fgui.GButton {
  14835. static createInstance() {
  14836. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14837. }
  14838. onConstruct() {
  14839. this.n1 = (this.getChild("n1"));
  14840. }
  14841. }
  14842. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14843. class ui_btn4 extends fgui.GButton {
  14844. static createInstance() {
  14845. return (fgui.UIPackage.createObject("loading", "btn4"));
  14846. }
  14847. onConstruct() {
  14848. this.n9 = (this.getChild("n9"));
  14849. this.n1 = (this.getChild("n1"));
  14850. }
  14851. }
  14852. ui_btn4.URL = "ui://37nctnhwxe622z";
  14853. class loadingBinder {
  14854. static bindAll() {
  14855. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14856. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14857. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14858. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14859. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14860. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14861. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14862. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14863. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14864. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14865. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14866. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14867. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14868. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14869. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14870. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14871. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14872. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14873. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14874. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14875. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14876. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14877. }
  14878. }
  14879. class UIMgr {
  14880. constructor() {
  14881. this._stage = null;
  14882. this._uiList = [];
  14883. this._showList = [];
  14884. this._bindPkgList = [];
  14885. this.uiIndex = 0;
  14886. }
  14887. static get inst() {
  14888. if (UIMgr._inst == null) {
  14889. UIMgr._inst = new UIMgr();
  14890. }
  14891. return UIMgr._inst;
  14892. }
  14893. setStage(s) {
  14894. if (this._stage) {
  14895. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14896. return;
  14897. }
  14898. this._stage = s;
  14899. }
  14900. init() {
  14901. this.setStage(Laya.stage);
  14902. fairygui.UIConfig.defaultFont = "微软雅黑";
  14903. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14904. fairygui.UIConfig.packageFileExtension = "obj";
  14905. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14906. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14907. fairygui.GRoot.inst.width = Laya.stage.width;
  14908. fairygui.GRoot.inst.height = Laya.stage.height;
  14909. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14910. }
  14911. addAllUpdate() {
  14912. this.uiIndex = 0;
  14913. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14914. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14915. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14916. }
  14917. }
  14918. }
  14919. bindFUI(pkgname) {
  14920. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  14921. return;
  14922. }
  14923. switch (pkgname) {
  14924. case fguiRes.loading:
  14925. fairygui.UIPackage.addPackage(pkgname);
  14926. loadingBinder.bindAll();
  14927. this._bindPkgList.push(pkgname);
  14928. break;
  14929. case fguiRes.game:
  14930. fairygui.UIPackage.addPackage(pkgname);
  14931. gameBinder.bindAll();
  14932. this._bindPkgList.push(pkgname);
  14933. break;
  14934. default:
  14935. break;
  14936. }
  14937. }
  14938. Show(cls, ...param) {
  14939. let nameStr = cls.uiName;
  14940. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14941. let temp = this._uiList[i];
  14942. let str = temp.className;
  14943. if (str == nameStr) {
  14944. if (temp.isMuti) {
  14945. if (temp.isHide) {
  14946. temp.show(...param);
  14947. this._uiList.splice(i, 1);
  14948. this._uiList.push(temp);
  14949. return temp;
  14950. }
  14951. }
  14952. else {
  14953. temp.show(...param);
  14954. this._uiList.splice(i, 1);
  14955. this._uiList.push(temp);
  14956. return temp;
  14957. }
  14958. }
  14959. }
  14960. let ui = new cls();
  14961. ui.className = nameStr;
  14962. this._showUI(ui, param);
  14963. return ui;
  14964. }
  14965. destroyUI(ui) {
  14966. for (let i = this._uiList.length - 1; i >= 0; i--) {
  14967. let temp = this._uiList[i].className;
  14968. if (temp == ui.className) {
  14969. this._uiList.splice(i, 1);
  14970. break;
  14971. }
  14972. }
  14973. this.checkUIState();
  14974. }
  14975. _showUI(ui, param) {
  14976. this._uiList.push(ui);
  14977. ui.show(...param);
  14978. }
  14979. Hide(uiClass) {
  14980. let ui = this.getUI(uiClass);
  14981. if (ui && !ui.isHide) {
  14982. ui.hide();
  14983. }
  14984. }
  14985. getUI(ui) {
  14986. let nameStr = ui.uiName;
  14987. for (let index = 0; index < this._uiList.length; index++) {
  14988. let temp = this._uiList[index];
  14989. if (temp.className == nameStr) {
  14990. return temp;
  14991. }
  14992. }
  14993. return null;
  14994. }
  14995. isShow(cls) {
  14996. for (var i of this._uiList) {
  14997. if (i instanceof cls) {
  14998. return i.isShowing;
  14999. }
  15000. }
  15001. return false;
  15002. }
  15003. showUINum() {
  15004. let num = 0;
  15005. for (var i of this._uiList) {
  15006. if (i.isShowing) {
  15007. num++;
  15008. }
  15009. }
  15010. return num;
  15011. }
  15012. checkUIState() {
  15013. Laya.timer.clear(this, this._uiCheck);
  15014. Laya.timer.once(400, this, this._uiCheck);
  15015. }
  15016. _uiCheck() {
  15017. let showList = [];
  15018. for (var i of this._uiList) {
  15019. if (!i.isHide) {
  15020. showList.push(i);
  15021. }
  15022. }
  15023. for (let index = 0; index < showList.length; index++) {
  15024. if (index == showList.length - 1) {
  15025. showList[index].checkActive(true);
  15026. }
  15027. else {
  15028. showList[index].checkActive(false);
  15029. }
  15030. }
  15031. }
  15032. showTip(msg, time = 600, size = 30) {
  15033. }
  15034. }
  15035. class UIShowList {
  15036. }
  15037. class SoundMgr {
  15038. constructor() {
  15039. this.soundMax = 4;
  15040. this.isLoad = false;
  15041. this.soundMap = {};
  15042. this.isSound = true;
  15043. this.openShake = true;
  15044. SoundMgr._instance = this;
  15045. }
  15046. static getInstance() {
  15047. if (!this._instance) {
  15048. this._instance = new SoundMgr();
  15049. }
  15050. return this._instance;
  15051. }
  15052. init() {
  15053. console.log('zh:sm init 1');
  15054. Laya.SoundManager.autoReleaseSound = true;
  15055. Laya.SoundManager.autoStopMusic = true;
  15056. Laya.SoundManager.musicVolume = 0.3;
  15057. Laya.SoundManager.soundVolume = 0.5;
  15058. this.musicPlayed = false;
  15059. this.audioUrl = "asset/sound/ogg/";
  15060. console.log('zh:sm init 2');
  15061. console.log('zh:dev type ');
  15062. if (Laya.Browser.onAndroid) {
  15063. console.log('zh:dev type android');
  15064. this.audioUrl = "asset/sound/ogg/";
  15065. this.isLoad = true;
  15066. }
  15067. else {
  15068. console.log('zh:dev type not android');
  15069. this.audioUrl = "asset/sound/mp3/";
  15070. this.isLoad = true;
  15071. }
  15072. }
  15073. onSetting(isS) {
  15074. this.isSound = isS;
  15075. this.mute(!this.isSound);
  15076. }
  15077. clearCount() {
  15078. for (var key in this.soundMap) {
  15079. delete this.soundMap[key];
  15080. }
  15081. }
  15082. playMusic(path, loop = 0) {
  15083. console.log('zh:playMusic 1 PATH=' + path);
  15084. this.musicPath = path;
  15085. if (!this.isLoad)
  15086. console.log('zh:playMusic 2');
  15087. return;
  15088. if (!path || path == "")
  15089. console.log('zh:playMusic 3');
  15090. return;
  15091. if (!this.isSound)
  15092. console.log('zh:playMusic 4');
  15093. return;
  15094. this.musicPlayed = true;
  15095. console.log('zh:playMusic 5');
  15096. let url = this.getUrl(path);
  15097. console.log('zh:playMusic 6' + url);
  15098. if (Laya.Browser.onPC) {
  15099. console.log('zh:playMusic 7');
  15100. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15101. console.log('zh:playMusic 8');
  15102. this.play(url, loop);
  15103. }));
  15104. }
  15105. else
  15106. this.play(url, loop);
  15107. }
  15108. play(url, loop) {
  15109. Laya.SoundManager.playMusic(url, loop);
  15110. }
  15111. getUrl(path) {
  15112. let url = this.audioUrl + path;
  15113. if (Laya.Browser.onAndroid) {
  15114. url += ".ogg";
  15115. }
  15116. else {
  15117. url += ".mp3";
  15118. }
  15119. return url;
  15120. }
  15121. pauseMusic(pause) {
  15122. if (pause) {
  15123. this.mute(true);
  15124. }
  15125. else if (this.isSound)
  15126. this.mute(false);
  15127. }
  15128. stopMusic() {
  15129. Laya.SoundManager.stopMusic();
  15130. if (Moyu.isNeedPlatAudio) {
  15131. Moyu.stopMusic();
  15132. }
  15133. }
  15134. mute(mute) {
  15135. if (Moyu.isNeedPlatAudio) {
  15136. Moyu.pauseMusic(mute);
  15137. }
  15138. else {
  15139. Laya.SoundManager.musicMuted = mute;
  15140. if (!mute && !this.musicPlayed && this.musicPath) {
  15141. this.playMusic(this.musicPath);
  15142. }
  15143. }
  15144. }
  15145. stopSound(path) {
  15146. let url = this.getUrl(path);
  15147. Laya.SoundManager.stopSound(url);
  15148. }
  15149. playSound(path, loop = 1, soundMax = this.soundMax) {
  15150. if (!this.isLoad)
  15151. return;
  15152. if (!this.isSound)
  15153. return;
  15154. if (!path || path == "")
  15155. return;
  15156. let url = this.getUrl(path);
  15157. if (Moyu.isNeedPlatAudio) {
  15158. Moyu.playSound(path, loop == 0);
  15159. }
  15160. else {
  15161. let count = 1;
  15162. if (this.soundMap[path])
  15163. count = this.soundMap[path] + 1;
  15164. if (count > soundMax)
  15165. return;
  15166. this.soundMap[path] = count;
  15167. Laya.SoundManager.playSound(url, loop);
  15168. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15169. }
  15170. }
  15171. removePath(path) {
  15172. if (this.soundMap[path]) {
  15173. let count = this.soundMap[path];
  15174. count--;
  15175. if (count < 1)
  15176. delete this.soundMap[path];
  15177. else
  15178. this.soundMap[path] = count;
  15179. }
  15180. }
  15181. playBtnSound() {
  15182. this.playSound("btn");
  15183. }
  15184. playGetSound() {
  15185. }
  15186. playCloseUISound() {
  15187. }
  15188. }
  15189. SoundMgr._instance = null;
  15190. var Handler$1 = Laya.Handler;
  15191. var EResType;
  15192. (function (EResType) {
  15193. EResType[EResType["none"] = 0] = "none";
  15194. EResType[EResType["nromal"] = 1] = "nromal";
  15195. EResType[EResType["td"] = 2] = "td";
  15196. EResType[EResType["sk"] = 3] = "sk";
  15197. })(EResType || (EResType = {}));
  15198. class CResLoader {
  15199. constructor(doneCall, proCall) {
  15200. this.completrCall = doneCall;
  15201. this.progressCall = proCall;
  15202. this.progressHander = new Handler$1(this, this.onProgress);
  15203. this.tdResMap = {};
  15204. }
  15205. load(resList) {
  15206. this.resCount = 0;
  15207. this.loadCount = 0;
  15208. for (let i = 0; i < resList.length; i++) {
  15209. let path = resList[i];
  15210. if (!path)
  15211. continue;
  15212. this.resCount++;
  15213. let type = this.getResType(path);
  15214. if (type == EResType.nromal)
  15215. this.loadNromal(path);
  15216. else if (type == EResType.td)
  15217. this.loadTd(path);
  15218. }
  15219. }
  15220. getRes(path) {
  15221. let type = this.getResType(path);
  15222. if (type == EResType.nromal)
  15223. return Laya.loader.getRes(path);
  15224. else if (type == EResType.td) {
  15225. let res = this.tdResMap[path];
  15226. if (res)
  15227. return res.clone();
  15228. return null;
  15229. }
  15230. }
  15231. destroy() {
  15232. this.progressHander.clear();
  15233. this.progressHander = null;
  15234. }
  15235. clearRes(path) {
  15236. let type = this.getResType(path);
  15237. if (type == EResType.nromal)
  15238. Laya.loader.clearRes(path);
  15239. else if (type == EResType.td) {
  15240. let obj = this.tdResMap[path];
  15241. if (obj)
  15242. obj.destroy();
  15243. delete this.tdResMap[path];
  15244. }
  15245. }
  15246. getResType(path) {
  15247. let exs = this.getExtension(path);
  15248. if (exs == "sk")
  15249. return EResType.sk;
  15250. if (exs == "ls" || exs == "lh" || exs == "lm")
  15251. return EResType.td;
  15252. else
  15253. return EResType.nromal;
  15254. }
  15255. getExtension(res) {
  15256. var index = res.lastIndexOf(".");
  15257. return res.substr(index + 1);
  15258. }
  15259. loadNromal(path) {
  15260. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15261. if (res) {
  15262. this.onLoad();
  15263. }
  15264. else
  15265. console.log("load res fail:" + path);
  15266. }), this.progressHander);
  15267. }
  15268. loadSk() {
  15269. }
  15270. loadTd(path) {
  15271. if (this.tdResMap[path]) {
  15272. this.onLoad();
  15273. return;
  15274. }
  15275. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15276. if (res) {
  15277. this.tdResMap[path] = res;
  15278. this.onLoad();
  15279. }
  15280. else
  15281. console.log("load res fail:" + path);
  15282. }));
  15283. }
  15284. onLoad() {
  15285. this.loadCount++;
  15286. this.onProgress(1);
  15287. if (this.loadCount >= this.resCount) {
  15288. this.completrCall.run();
  15289. }
  15290. }
  15291. onProgress(pro) {
  15292. let progress = (this.loadCount + pro) / this.resCount;
  15293. this.progressCall.runWith(progress);
  15294. }
  15295. }
  15296. var Handler$2 = Laya.Handler;
  15297. class ResInfo {
  15298. constructor() {
  15299. this.index = 0;
  15300. }
  15301. }
  15302. class ResMgr {
  15303. constructor() {
  15304. this.resList = [];
  15305. this.doneList = [];
  15306. this.resMap = {};
  15307. this.currentLoad = null;
  15308. this.completeHandler = new Handler$2(this, this.onComplete);
  15309. this.progressHandler = new Handler$2(this, this.onProgress);
  15310. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15311. }
  15312. static getInstance() {
  15313. if (ResMgr._instance == null) {
  15314. ResMgr._instance = new ResMgr();
  15315. }
  15316. return ResMgr._instance;
  15317. }
  15318. loadList(list, completeHandler, progressHandler) {
  15319. if (list.length < 1) {
  15320. completeHandler.run();
  15321. return;
  15322. }
  15323. let info = this.getResInfo();
  15324. info.resList = list;
  15325. info.completeHandler = completeHandler;
  15326. info.progressHandler = progressHandler;
  15327. this.resList.push(info);
  15328. this.startLoad();
  15329. }
  15330. loadFguiRes(list, completeHandler, progressHandler) {
  15331. Laya.loader.load(list, completeHandler, progressHandler);
  15332. }
  15333. loadAny(list, completeHandler, progressHandler) {
  15334. Laya.loader.load(list, completeHandler, progressHandler);
  15335. }
  15336. load(path, completeHandler, progressHandler) {
  15337. let count = this.resMap[path];
  15338. if (count && count > 0) {
  15339. if (completeHandler)
  15340. completeHandler.run();
  15341. }
  15342. else
  15343. this.loadList([path], completeHandler, progressHandler);
  15344. }
  15345. getRes(path) {
  15346. let res = this.resMap[path];
  15347. if (!res)
  15348. this.showLog("资源不存在:" + path);
  15349. else
  15350. return this.loader.getRes(path);
  15351. }
  15352. clearList(list, force = false) {
  15353. if (!list || list.length < 1)
  15354. return;
  15355. let cr = () => {
  15356. for (const k in list) {
  15357. let v = list[k];
  15358. if (!v)
  15359. continue;
  15360. if (force) {
  15361. this.loader.clearRes(v);
  15362. delete this.resMap[v];
  15363. }
  15364. else {
  15365. let count = this.resMap[v];
  15366. if (count && count > 1) {
  15367. count--;
  15368. this.resMap[v] = count;
  15369. }
  15370. else {
  15371. this.loader.clearRes(v);
  15372. delete this.resMap[v];
  15373. }
  15374. }
  15375. }
  15376. if (!window.hasOwnProperty("ks"))
  15377. Laya.Resource.destroyUnusedResources();
  15378. };
  15379. Laya.timer.clearAll(this);
  15380. Laya.timer.once(2000, this, cr);
  15381. }
  15382. clear3D() {
  15383. for (const k in this.loader.tdResMap) {
  15384. this.loader.clearRes(k);
  15385. if (this.resMap[k])
  15386. delete this.resMap[k];
  15387. }
  15388. if (!window.hasOwnProperty("ks"))
  15389. Laya.Resource.destroyUnusedResources();
  15390. }
  15391. clear(path, force = false) {
  15392. this.clearList([path], force);
  15393. }
  15394. getResInfo() {
  15395. if (this.doneList.length > 0)
  15396. return this.doneList.pop();
  15397. else
  15398. return new ResInfo();
  15399. }
  15400. startLoad() {
  15401. if (this.currentLoad)
  15402. return;
  15403. this.currentLoad = this.resList.pop();
  15404. if (this.currentLoad) {
  15405. this.loader.load(this.currentLoad.resList);
  15406. }
  15407. }
  15408. onComplete() {
  15409. if (!this.currentLoad)
  15410. return;
  15411. for (const k in this.currentLoad.resList) {
  15412. let v = this.currentLoad.resList[k];
  15413. let count = this.resMap[v];
  15414. if (count)
  15415. count++;
  15416. else
  15417. count = 1;
  15418. this.resMap[v] = count;
  15419. }
  15420. if (this.currentLoad.completeHandler)
  15421. this.currentLoad.completeHandler.run();
  15422. this.doneList.push(this.currentLoad);
  15423. this.currentLoad = null;
  15424. this.startLoad();
  15425. }
  15426. onProgress(pro) {
  15427. if (!this.currentLoad)
  15428. return;
  15429. if (this.currentLoad.progressHandler)
  15430. this.currentLoad.progressHandler.runWith(pro);
  15431. }
  15432. showLog(str, ...args) {
  15433. console.log("[ResLoader] " + str);
  15434. }
  15435. }
  15436. ResMgr._instance = null;
  15437. class EventMgr extends Laya.EventDispatcher {
  15438. }
  15439. let eventMgr = new EventMgr();
  15440. class ConfigMgr {
  15441. static getInstance() {
  15442. if (!this._instance) {
  15443. this._instance = new ConfigMgr();
  15444. }
  15445. return this._instance;
  15446. }
  15447. init() {
  15448. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15449. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15450. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15451. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15452. }
  15453. getUserInfoByIndex(index) {
  15454. return this.npcJson[index];
  15455. }
  15456. getRandomUserInfo() {
  15457. let index = xGame.tools.random(0, this.npcJson.length);
  15458. return this.npcJson[index];
  15459. }
  15460. getMaxBigMoveLength() {
  15461. return Object.keys(this.levelCfg).length;
  15462. }
  15463. getBigMoveLevelByIndex(index) {
  15464. let cfg = this.levelCfg;
  15465. cfg = cfg[index];
  15466. return cfg;
  15467. }
  15468. getRandomClassicLevel() {
  15469. let cfg = this.classicCfg;
  15470. let num = Object.keys(cfg).length;
  15471. let rand = xGame.common.randomNum(1, num);
  15472. return cfg[rand];
  15473. }
  15474. getPlaceBallByLevel(level) {
  15475. return this.placeBallCfg[level];
  15476. }
  15477. getMaxPlaceBall() {
  15478. return Object.keys(this.placeBallCfg).length;
  15479. }
  15480. }
  15481. class PoolD3Mgr {
  15482. constructor() {
  15483. this.pool = {};
  15484. }
  15485. static get ins() {
  15486. return this._ins || (this._ins = new PoolD3Mgr);
  15487. }
  15488. createList(key, prefab, parent) {
  15489. if (!this.pool[key]) {
  15490. this.pool[key] = {};
  15491. this.pool[key].prefab = prefab;
  15492. this.pool[key].list = [];
  15493. this.pool[key].parent = parent;
  15494. }
  15495. }
  15496. getItem(key) {
  15497. if (!this.pool[key]) {
  15498. return;
  15499. }
  15500. let temp;
  15501. if (this.pool[key].list.length > 0) {
  15502. temp = this.pool[key].list.pop();
  15503. }
  15504. else {
  15505. temp = this.pool[key].prefab.clone();
  15506. if (this.pool[key].parent) {
  15507. this.pool[key].parent.addChild(temp);
  15508. }
  15509. }
  15510. temp.active = true;
  15511. return temp;
  15512. }
  15513. putItem(key, obj) {
  15514. if (!this.pool[key]) {
  15515. return;
  15516. }
  15517. obj.active = false;
  15518. this.pool[key].list.push(obj);
  15519. }
  15520. }
  15521. let context$1 = context;
  15522. let uiMgr = UIMgr.inst;
  15523. let soundMgr = SoundMgr.getInstance();
  15524. let resMgr = ResMgr.getInstance();
  15525. let httpMgr = HttpMgr.getInstance();
  15526. let common = Common.getInstance();
  15527. let cfgMgr = ConfigMgr.getInstance();
  15528. let poolD3Mgr = PoolD3Mgr.ins;
  15529. let d3TexUrl = "res/d3Res/";
  15530. let d3ModeUrl = "res/unityRes/";
  15531. function setStageSize(view) {
  15532. if (view.width) {
  15533. view.width = Laya.stage.width;
  15534. view.height = Laya.stage.height;
  15535. }
  15536. }
  15537. function filledBg(view) {
  15538. let wh = Laya.stage.height / Laya.stage.width;
  15539. if (wh > 16 / 9) {
  15540. view.height = Laya.stage.height;
  15541. view.width = Laya.stage.height / 1334 * 750;
  15542. }
  15543. else {
  15544. view.width = Laya.stage.width;
  15545. view.height = Laya.stage.width / 750 * 1334;
  15546. }
  15547. }
  15548. function setNotch(view) {
  15549. if (view.height) {
  15550. view.y += context$1.notchHeight;
  15551. }
  15552. }
  15553. function showTip(str) {
  15554. uiMgr.Show(UIMsg, str);
  15555. }
  15556. function log(...args) {
  15557. console.log(args);
  15558. }
  15559. let xGame = {
  15560. context: context$1,
  15561. eventMgr,
  15562. resMgr,
  15563. uiMgr,
  15564. soundMgr,
  15565. define,
  15566. tools,
  15567. httpMgr,
  15568. d3TexUrl,
  15569. d3ModeUrl,
  15570. common,
  15571. cfgMgr,
  15572. poolD3Mgr,
  15573. setStageSize,
  15574. filledBg,
  15575. setNotch,
  15576. showTip,
  15577. log,
  15578. };
  15579. window["xGame"] = xGame;
  15580. let dataName = 'tBall_';
  15581. class UserData {
  15582. constructor() {
  15583. this.userId = "";
  15584. this.isAgree = false;
  15585. this.coinNum = 0;
  15586. this.gemNum = 0;
  15587. this.sound = true;
  15588. this.vibration = true;
  15589. this.currentDate = 0;
  15590. this.createTime = 0;
  15591. this.awardTime = 0;
  15592. this.roleId = 1;
  15593. this.roleList = [];
  15594. this.roleAds = [];
  15595. this.dressId = 101;
  15596. this.itemId = 201;
  15597. this.bigSkills = [1, 1, 1, 1, 1];
  15598. this.coin = 4000;
  15599. this.diamond = 0;
  15600. this.skillSuccessTimes = 0;
  15601. this.skillGuide = 0;
  15602. this.skillAccTimes = 0;
  15603. this.placeBallData = [];
  15604. this.shareDiamondTimes = 0;
  15605. this.dailyVideoShareTimes = 0;
  15606. this.secretary = [1, 0];
  15607. this.curSecretary = 0;
  15608. this.ballRod = [1, 0, 0, 0, 0, 1];
  15609. this.curBallRod = 5;
  15610. this.signData = 0;
  15611. this.signTime = 0;
  15612. this.drawTimes = 0;
  15613. this.drawAwardTimes = 0;
  15614. this.dailyfreeDrawTimes = 1;
  15615. this.power = 5;
  15616. this.powerTime = 0;
  15617. this.challengeTimes = 0;
  15618. this.extraSign = 0;
  15619. this.classicTimes = 0;
  15620. this.guideHelpLine = 0;
  15621. this.newUser = true;
  15622. this.rootBallFoul = 0;
  15623. this.timeoutFoul = 0;
  15624. this.roleList = [1];
  15625. }
  15626. saveData() {
  15627. let data = {};
  15628. for (let k in this) {
  15629. data[k.toString()] = this[k];
  15630. }
  15631. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15632. }
  15633. getData() {
  15634. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15635. if (ld) {
  15636. let localData = JSON.parse(ld);
  15637. if (localData) {
  15638. for (let k in this) {
  15639. let key = k.toString();
  15640. let data = localData[key];
  15641. if (data != undefined) {
  15642. this[k] = data;
  15643. }
  15644. }
  15645. }
  15646. }
  15647. }
  15648. }
  15649. class ItemData {
  15650. constructor() {
  15651. this.itemList = {};
  15652. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15653. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15654. }
  15655. saveData() {
  15656. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15657. }
  15658. getData() {
  15659. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15660. if (ld) {
  15661. let localData = JSON.parse(ld);
  15662. if (localData) {
  15663. this.itemList = localData;
  15664. }
  15665. }
  15666. }
  15667. }
  15668. class GameData {
  15669. constructor() {
  15670. this.curLevel = 0;
  15671. this.gameType = 1;
  15672. this.signIdx = 0;
  15673. this.signMax = 0;
  15674. this.rotaryTime = 0;
  15675. this.rotaryCount = 0;
  15676. this.rotaryList = [];
  15677. this.diyCount = 3;
  15678. this.awardIdx = 0;
  15679. this.shareNum = 2;
  15680. this.rankWeek = 0;
  15681. this.rankScore = 0;
  15682. this.gameCount = 0;
  15683. this.trySkill = -1;
  15684. this.tryTime = 0;
  15685. }
  15686. saveData() {
  15687. let data = {};
  15688. for (let k in this) {
  15689. data[k.toString()] = this[k];
  15690. }
  15691. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15692. }
  15693. getData() {
  15694. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15695. if (ld) {
  15696. let localData = JSON.parse(ld);
  15697. if (localData) {
  15698. for (let k in this) {
  15699. let key = k.toString();
  15700. let data = localData[key];
  15701. if (data != undefined) {
  15702. this[k] = data;
  15703. }
  15704. }
  15705. }
  15706. }
  15707. }
  15708. }
  15709. class DataMgr {
  15710. static Init() {
  15711. this.userData = new UserData();
  15712. this.gameData = new GameData();
  15713. this.itemData = new ItemData();
  15714. this.userData.getData();
  15715. this.gameData.getData();
  15716. this.itemData.getData();
  15717. this.roleId = this.userData.roleId;
  15718. this.resetUse();
  15719. }
  15720. static isNewDay() {
  15721. Moyu.isNewDay(this, (isnew) => {
  15722. xGame.common.isNewDay = isnew;
  15723. if (!isnew)
  15724. return;
  15725. DataMgr.setShareDiamondTimes(0, false);
  15726. DataMgr.setDailyVideoShareTimes(0, false);
  15727. DataMgr.setDailyfreeDrawTimes(1);
  15728. DataMgr.setExtraSign(0);
  15729. });
  15730. }
  15731. static deletData() {
  15732. Laya.LocalStorage.clear();
  15733. }
  15734. static upRankData() {
  15735. let num = xGame.common.getAllStarNum();
  15736. if (num > 0)
  15737. Moyu.upRankData(xGame.common.curRankID, num);
  15738. }
  15739. static addItem(id, count = 1) {
  15740. let v = this.itemData.itemList[id];
  15741. if (!v)
  15742. v = { id: id, count: count, adnum: 0, active: true };
  15743. else {
  15744. if (v.active) {
  15745. v.count += count;
  15746. }
  15747. else {
  15748. v.count = count;
  15749. v.active = true;
  15750. }
  15751. }
  15752. this.itemData.itemList[id] = v;
  15753. xGame.soundMgr.playGetSound();
  15754. this.saveItemData();
  15755. }
  15756. static hasItem(id) {
  15757. let v = this.itemData.itemList[id];
  15758. if (v && v.active)
  15759. return true;
  15760. return false;
  15761. }
  15762. static getItem(id) {
  15763. let v = this.itemData.itemList[id];
  15764. return v;
  15765. }
  15766. static getItemCount(id) {
  15767. let v = this.itemData.itemList[id];
  15768. if (v && v.active)
  15769. return v.count;
  15770. return 0;
  15771. }
  15772. static getItemAd(id) {
  15773. let v = this.itemData.itemList[id];
  15774. if (v) {
  15775. return v.adnum;
  15776. }
  15777. return 0;
  15778. }
  15779. static onItemAd(id, num = 1) {
  15780. let v = this.itemData.itemList[id];
  15781. if (!v)
  15782. v = { id: id, count: 1, adnum: num, active: false };
  15783. else
  15784. v.adnum += num;
  15785. this.itemData.itemList[id] = v;
  15786. this.saveItemData();
  15787. }
  15788. static costItem(id, count) {
  15789. let v = this.itemData.itemList[id];
  15790. if (v && v.active) {
  15791. if (v.count < count)
  15792. return false;
  15793. else {
  15794. v.count -= count;
  15795. this.itemData.itemList[id] = v;
  15796. return true;
  15797. }
  15798. }
  15799. return false;
  15800. }
  15801. static resetUse() {
  15802. this.dressId = this.userData.dressId;
  15803. this.itemId = this.userData.itemId;
  15804. }
  15805. static passLevel() {
  15806. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15807. this.gameData.curLevel++;
  15808. this.curLevel = this.gameData.curLevel;
  15809. this.saveGameData();
  15810. }
  15811. static useRole(id) {
  15812. this.roleId = id;
  15813. if (this.hasRole(id)) {
  15814. this.userData.roleId = id;
  15815. this.saveUserData();
  15816. }
  15817. }
  15818. static addRole(id) {
  15819. if (this.hasRole(id))
  15820. return;
  15821. this.userData.roleList.push(id);
  15822. this.saveUserData();
  15823. }
  15824. static hasRole(id) {
  15825. return this.userData.roleList.indexOf(id) >= 0;
  15826. }
  15827. static gemEnough(num) {
  15828. return this.userData.gemNum >= num;
  15829. }
  15830. static roleHasAd(id) {
  15831. let count = this.userData.roleAds[id];
  15832. if (count != undefined && count >= 0)
  15833. return true;
  15834. else
  15835. return false;
  15836. }
  15837. static saveUserData(time = 1000, event, arg) {
  15838. if (this.userSaving)
  15839. return;
  15840. this.userSaving = true;
  15841. Laya.timer.once(time, this, () => {
  15842. this.userSaving = false;
  15843. this.userData.saveData();
  15844. if (event)
  15845. xGame.eventMgr.event(event, arg);
  15846. });
  15847. }
  15848. static saveGameData() {
  15849. if (this.gameSaving)
  15850. return;
  15851. this.gameSaving = true;
  15852. Laya.timer.once(1000, this, () => {
  15853. this.gameSaving = false;
  15854. this.gameData.saveData();
  15855. });
  15856. }
  15857. static saveItemData() {
  15858. let fun = () => {
  15859. this.itemData.saveData();
  15860. };
  15861. Laya.timer.clear(this, fun);
  15862. Laya.timer.once(500, this, fun);
  15863. }
  15864. static saveData() {
  15865. this.saveUserData();
  15866. this.saveGameData();
  15867. }
  15868. static getBigSkillList() {
  15869. return this.userData.bigSkills;
  15870. }
  15871. static getBigSkillByIndex(index) {
  15872. return this.userData.bigSkills[index];
  15873. }
  15874. static setBigSkill(index, val, addUp = true) {
  15875. if (addUp) {
  15876. this.userData.bigSkills[index] += val;
  15877. }
  15878. else {
  15879. this.userData.bigSkills[index] = val;
  15880. }
  15881. this.saveUserData();
  15882. }
  15883. static coinEnough(need) {
  15884. if (typeof need != "number") {
  15885. console.error("金币格式错误");
  15886. return;
  15887. }
  15888. return this.userData.coin >= need;
  15889. }
  15890. static setCoin(val) {
  15891. if (typeof val != "number") {
  15892. return;
  15893. }
  15894. this.userData.coin += val;
  15895. this.saveUserData();
  15896. xGame.eventMgr.event(COIN_CHANGE);
  15897. }
  15898. static getCoin() {
  15899. return this.userData.coin;
  15900. }
  15901. static diamondEnough(need) {
  15902. if (typeof need != "number") {
  15903. console.error("金币格式错误");
  15904. return;
  15905. }
  15906. return this.userData.diamond >= need;
  15907. }
  15908. static setDiamond(val) {
  15909. if (typeof val != "number") {
  15910. return;
  15911. }
  15912. this.userData.diamond += val;
  15913. this.saveUserData();
  15914. xGame.eventMgr.event(DIAMOND_CHANGE);
  15915. }
  15916. static getDiamond() {
  15917. return this.userData.diamond;
  15918. }
  15919. static getSkillSuccessTimes() {
  15920. return this.userData.skillSuccessTimes;
  15921. }
  15922. static setSkillSuccessTimes(val, addUp = true) {
  15923. if (addUp)
  15924. this.userData.skillSuccessTimes += val;
  15925. else
  15926. this.userData.skillSuccessTimes = val;
  15927. this.saveUserData();
  15928. }
  15929. static getSkillAccTimes() {
  15930. return this.userData.skillAccTimes;
  15931. }
  15932. static setSkillAccTimes(val) {
  15933. this.userData.skillAccTimes += val;
  15934. this.saveUserData();
  15935. }
  15936. static getSkillGuide() {
  15937. if (!xGame.common.openGuide) {
  15938. return 1;
  15939. }
  15940. return this.userData.skillGuide;
  15941. }
  15942. static setSkillGuide(val) {
  15943. this.userData.skillGuide = val;
  15944. this.saveUserData();
  15945. }
  15946. static getPlaceBallLevelList() {
  15947. return this.userData.placeBallData;
  15948. }
  15949. static getPlaceBallLevel(level) {
  15950. let arr = this.userData.placeBallData;
  15951. let index = level - 1;
  15952. let out;
  15953. if (arr[index]) {
  15954. out = arr[index];
  15955. }
  15956. else {
  15957. let max = arr.length;
  15958. if (max == index) {
  15959. out = {
  15960. star: 0,
  15961. play: true,
  15962. isCur: true,
  15963. getAward: false
  15964. };
  15965. }
  15966. else {
  15967. out = {
  15968. star: 0,
  15969. play: false,
  15970. getAward: false
  15971. };
  15972. }
  15973. }
  15974. return out;
  15975. }
  15976. static setPlaceBallLevel(level, star) {
  15977. let arr = this.userData.placeBallData;
  15978. let index = level - 1;
  15979. if (arr[index]) {
  15980. arr[index].star = Math.max(arr[index].star, star);
  15981. }
  15982. else {
  15983. let max = arr.length;
  15984. if (max == index) {
  15985. arr.push({
  15986. star: star,
  15987. play: true,
  15988. getAward: false
  15989. });
  15990. }
  15991. else {
  15992. console.error("关卡存储出错");
  15993. }
  15994. }
  15995. this.saveUserData();
  15996. }
  15997. static setPlaceBallAward(level) {
  15998. let arr = this.userData.placeBallData;
  15999. let index = level - 1;
  16000. if (arr[index]) {
  16001. arr[index].getAward = true;
  16002. }
  16003. this.saveUserData();
  16004. }
  16005. static getShareDiamondTimes() {
  16006. return this.userData.shareDiamondTimes;
  16007. }
  16008. static setShareDiamondTimes(val, addUp = true) {
  16009. if (addUp) {
  16010. this.userData.shareDiamondTimes += val;
  16011. }
  16012. else {
  16013. this.userData.shareDiamondTimes = val;
  16014. }
  16015. this.saveUserData();
  16016. }
  16017. static getDailyVideoShareTimes() {
  16018. return this.userData.dailyVideoShareTimes;
  16019. }
  16020. static setDailyVideoShareTimes(val, addUp = true) {
  16021. if (addUp) {
  16022. this.userData.dailyVideoShareTimes += val;
  16023. }
  16024. else {
  16025. this.userData.dailyVideoShareTimes = val;
  16026. }
  16027. this.saveUserData();
  16028. }
  16029. static getSecretary(index) {
  16030. return this.userData.secretary[index];
  16031. }
  16032. static setSecretary(index, val) {
  16033. this.userData.secretary[index] = val;
  16034. this.saveUserData();
  16035. }
  16036. static getCurSecretary() {
  16037. return this.userData.curSecretary;
  16038. }
  16039. static setCurSecretary(index) {
  16040. this.userData.curSecretary = index;
  16041. this.saveUserData();
  16042. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16043. }
  16044. static getBallRod(index) {
  16045. return this.userData.ballRod[index];
  16046. }
  16047. static setBallRod(index, val) {
  16048. this.userData.ballRod[index] = val;
  16049. this.saveUserData();
  16050. }
  16051. static getCurBallRod() {
  16052. return this.userData.curBallRod;
  16053. }
  16054. static setCurBallRod(index) {
  16055. this.userData.curBallRod = index;
  16056. this.saveUserData();
  16057. }
  16058. static setSignData(val) {
  16059. this.userData.signData = val;
  16060. this.saveUserData();
  16061. }
  16062. static getSignData() {
  16063. return this.userData.signData;
  16064. }
  16065. static setSignTime(val) {
  16066. this.userData.signTime = val;
  16067. this.saveUserData();
  16068. }
  16069. static getSignTime() {
  16070. return this.userData.signTime;
  16071. }
  16072. static getDrawTimes() {
  16073. return this.userData.drawTimes;
  16074. }
  16075. static setDrawTimes(val, addUp = true) {
  16076. if (addUp) {
  16077. this.userData.drawTimes += val;
  16078. }
  16079. else {
  16080. this.userData.drawTimes = val;
  16081. }
  16082. this.saveUserData();
  16083. }
  16084. static getDrawAwardTimes() {
  16085. return this.userData.drawAwardTimes;
  16086. }
  16087. static setDrawAwardTimes(val) {
  16088. this.userData.drawAwardTimes = val;
  16089. this.saveUserData();
  16090. }
  16091. static getDailyfreeDrawTimes() {
  16092. return this.userData.dailyfreeDrawTimes;
  16093. }
  16094. static setDailyfreeDrawTimes(val) {
  16095. this.userData.dailyfreeDrawTimes = val;
  16096. this.saveUserData();
  16097. }
  16098. static setPower(val, addUp = true) {
  16099. if (addUp)
  16100. this.userData.power += val;
  16101. else
  16102. this.userData.power = val;
  16103. if (this.userData.power >= xGame.common.maxPower) {
  16104. this.userData.power = xGame.common.maxPower;
  16105. }
  16106. xGame.eventMgr.event(POWER_CHANGE, val);
  16107. this.saveUserData();
  16108. }
  16109. static getPower() {
  16110. return this.userData.power;
  16111. }
  16112. static setPowerTime(val) {
  16113. this.userData.powerTime = val;
  16114. this.saveUserData();
  16115. }
  16116. static getPowerTime() {
  16117. return this.userData.powerTime;
  16118. }
  16119. static powerEnough() {
  16120. return this.getPower() > 0;
  16121. }
  16122. static getChallengeTimes() {
  16123. return this.userData.challengeTimes;
  16124. }
  16125. static setChallengeTimes(val) {
  16126. this.userData.challengeTimes += val;
  16127. this.saveUserData();
  16128. }
  16129. static getExtraSign() {
  16130. return this.userData.extraSign;
  16131. }
  16132. static setExtraSign(val) {
  16133. this.userData.extraSign = val;
  16134. this.saveUserData();
  16135. }
  16136. static getClassicTimes() {
  16137. return this.userData.classicTimes;
  16138. }
  16139. static setClassicTimes() {
  16140. this.userData.classicTimes += 1;
  16141. this.saveUserData();
  16142. }
  16143. static getGuideHelpLine() {
  16144. return this.userData.guideHelpLine;
  16145. }
  16146. static setGuideHelpLine() {
  16147. this.userData.guideHelpLine = 1;
  16148. this.saveUserData();
  16149. }
  16150. static getNewUser() {
  16151. return this.userData.newUser;
  16152. }
  16153. static setNewUser() {
  16154. this.userData.newUser = false;
  16155. this.saveUserData();
  16156. }
  16157. static getRootBallFoul() {
  16158. return this.userData.rootBallFoul;
  16159. }
  16160. static setRootBallFoul() {
  16161. this.userData.rootBallFoul = 1;
  16162. this.saveUserData();
  16163. }
  16164. static getTimeoutFoul() {
  16165. return this.userData.timeoutFoul;
  16166. }
  16167. static setTimeoutFoul() {
  16168. this.userData.timeoutFoul = 1;
  16169. this.saveUserData();
  16170. }
  16171. }
  16172. DataMgr.isNewUser = false;
  16173. DataMgr.fristEnter = true;
  16174. DataMgr.levelType = 0;
  16175. DataMgr.awardId = 0;
  16176. DataMgr.awardCoin = 0;
  16177. DataMgr.sceneId = -1;
  16178. DataMgr.tryId = 0;
  16179. DataMgr.curLevel = 1;
  16180. DataMgr.vipLevel = 0;
  16181. DataMgr.maxLevel = 0;
  16182. DataMgr.awardRatio = 1;
  16183. DataMgr.gameList = [];
  16184. DataMgr.rankList = [];
  16185. DataMgr.recoverTime = 480000;
  16186. DataMgr.minScore = 0;
  16187. DataMgr.rankDis = 0;
  16188. DataMgr.userSaving = false;
  16189. DataMgr.gameSaving = false;
  16190. class D3Tween extends Laya.Script3D {
  16191. constructor() {
  16192. super();
  16193. this.isInited = false;
  16194. }
  16195. ;
  16196. init() {
  16197. if (this.isInited)
  16198. return;
  16199. this.isInited = true;
  16200. this.gameObj = this.owner;
  16201. this.transform = this.gameObj.transform;
  16202. }
  16203. get rotX() {
  16204. return this.transform.localRotationEulerX;
  16205. }
  16206. set rotX(v) {
  16207. this.transform.localRotationEulerX = v;
  16208. }
  16209. get rotY() {
  16210. return this.transform.localRotationEulerY;
  16211. }
  16212. set rotY(v) {
  16213. this.transform.localRotationEulerY = v;
  16214. }
  16215. get rotZ() {
  16216. return this.transform.localRotationEulerZ;
  16217. }
  16218. set rotZ(v) {
  16219. this.transform.localRotationEulerZ = v;
  16220. }
  16221. get posX() {
  16222. return this.transform.localPositionX;
  16223. }
  16224. set posX(v) {
  16225. this.transform.localPositionX = v;
  16226. }
  16227. get posY() {
  16228. return this.transform.localPositionY;
  16229. }
  16230. set posY(v) {
  16231. this.transform.localPositionY = v;
  16232. }
  16233. get posZ() {
  16234. return this.transform.localPositionZ;
  16235. }
  16236. set posZ(v) {
  16237. this.transform.localPositionZ = v;
  16238. }
  16239. get rotation() {
  16240. return this.transform.localRotation;
  16241. }
  16242. set rotation(v) {
  16243. this.transform.localRotation = v;
  16244. }
  16245. }
  16246. class D2Hole extends Laya.Script {
  16247. constructor() { super(); }
  16248. onTriggerEnter(collider) {
  16249. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16250. return;
  16251. }
  16252. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16253. if (collider.owner["mySrc"].isRunSkillAni) {
  16254. return;
  16255. }
  16256. if (collider.owner["mySrc"].number != 0) {
  16257. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16258. }
  16259. xGame.common.ballColliHole(collider);
  16260. xGame.common.recoverCameraView();
  16261. }
  16262. }
  16263. }
  16264. class Table extends Laya.Script3D {
  16265. constructor() {
  16266. super();
  16267. this.isSetBorder = false;
  16268. this.inited = false;
  16269. }
  16270. ;
  16271. onAwake() {
  16272. this.init();
  16273. }
  16274. init() {
  16275. if (this.inited)
  16276. return;
  16277. this.inited = true;
  16278. this.gameObj = this.owner;
  16279. this.border = this.gameObj.getChildByName("border");
  16280. }
  16281. setBorderPos() {
  16282. if (this.isSetBorder)
  16283. return;
  16284. this.isSetBorder = true;
  16285. let ui = xGame.common.gameUI.ui;
  16286. let bar1 = this.border.getChildByName("bar1");
  16287. let bar2 = this.border.getChildByName("bar2");
  16288. let bar3 = this.border.getChildByName("bar3");
  16289. let bar4 = this.border.getChildByName("bar4");
  16290. let bar5 = this.border.getChildByName("bar5");
  16291. let bar6 = this.border.getChildByName("bar6");
  16292. this.setInfo(bar1, ui.border.bar1, "box");
  16293. this.setInfo(bar2, ui.border.bar2, "box");
  16294. this.setInfo(bar3, ui.border.bar3, "box");
  16295. this.setInfo(bar4, ui.border.bar4, "box");
  16296. this.setInfo(bar5, ui.border.bar5, "box");
  16297. this.setInfo(bar6, ui.border.bar6, "box");
  16298. let circle1 = this.border.getChildByName("circle1");
  16299. let circle2 = this.border.getChildByName("circle2");
  16300. let circle3 = this.border.getChildByName("circle3");
  16301. let circle4 = this.border.getChildByName("circle4");
  16302. let circle5 = this.border.getChildByName("circle5");
  16303. let circle6 = this.border.getChildByName("circle6");
  16304. this.setInfo(circle1, ui.border.circle1, "circle");
  16305. this.setInfo(circle2, ui.border.circle2, "circle");
  16306. this.setInfo(circle3, ui.border.circle3, "circle");
  16307. this.setInfo(circle4, ui.border.circle4, "circle");
  16308. this.setInfo(circle5, ui.border.circle5, "circle");
  16309. this.setInfo(circle6, ui.border.circle6, "circle");
  16310. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16311. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16312. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16313. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16314. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16315. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16316. let arr = xGame.common.gameMgr.holePosList;
  16317. xGame.common.gameMgr.posObj = {
  16318. "1": arr[0],
  16319. "3": arr[2],
  16320. "4": arr[3],
  16321. "6": arr[5]
  16322. };
  16323. }
  16324. initHolePos(x, y) {
  16325. if (x < 300)
  16326. x += 25;
  16327. else if (x > 1000)
  16328. x -= 25;
  16329. else if (y > 200)
  16330. y -= 10;
  16331. else
  16332. y += 10;
  16333. if (y < 200)
  16334. y += 30;
  16335. else if (y > 500)
  16336. y -= 30;
  16337. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16338. }
  16339. setInfo(d3Obj, d2Obj, type) {
  16340. let ui = xGame.common.gameUI.ui;
  16341. let sprite = new Laya.Sprite();
  16342. ui.border.displayObject.addChild(sprite);
  16343. let colli = xGame.common.getCollider(type);
  16344. sprite.addComponentIntance(colli);
  16345. let rigy = xGame.common.getRigbody();
  16346. rigy.type = "static";
  16347. sprite.addComponentIntance(rigy);
  16348. let d3Pos = d3Obj.transform.position;
  16349. xGame.common.pos3to2Convert(d3Pos);
  16350. let scaleX = d3Obj.transform.localScaleX;
  16351. let scaleZ = d3Obj.transform.localScaleZ;
  16352. let width = xGame.common.scale3to2Convert(scaleZ);
  16353. let height = xGame.common.scale3to2Convert(scaleX);
  16354. sprite.pivotX = width / 2;
  16355. sprite.pivotY = height / 2;
  16356. sprite.x = d3Pos.x;
  16357. sprite.y = d3Pos.y;
  16358. sprite.width = width;
  16359. sprite.height = height;
  16360. d2Obj.x = d3Pos.x;
  16361. d2Obj.y = d3Pos.y;
  16362. d2Obj.width = width;
  16363. d2Obj.height = height;
  16364. if (type == "box") {
  16365. colli.width = width;
  16366. colli.height = height;
  16367. colli.isSensor = false;
  16368. colli.label = "border";
  16369. }
  16370. else {
  16371. colli.radius = width / 2;
  16372. colli.isSensor = true;
  16373. colli.label = "hole";
  16374. sprite.addComponent(D2Hole);
  16375. }
  16376. }
  16377. }
  16378. class D3World extends Laya.Script3D {
  16379. constructor() {
  16380. super();
  16381. this.loadNum = 0;
  16382. this.setLoadNum = 7;
  16383. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16384. }
  16385. onAwake() {
  16386. }
  16387. loadScene() {
  16388. this.scene = this.owner;
  16389. let url = `res/unityRes/root.lh`;
  16390. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16391. this.scene.addChild(prefab);
  16392. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16393. this.putCameraInfo();
  16394. this.camera.enableHDR = false;
  16395. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16396. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16397. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16398. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16399. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16400. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16401. this.knife.active = false;
  16402. this.loadD3Obj();
  16403. }));
  16404. }
  16405. putCameraInfo() {
  16406. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16407. this.cameraObj = new cameraType();
  16408. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16409. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16410. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16411. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16412. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16413. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16414. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16415. this.visitAngleChild.init();
  16416. this.visitRootObj.posX = this.visitAngleChild.posX;
  16417. this.visitRootObj.posY = this.visitAngleChild.posY;
  16418. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16419. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16420. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16421. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16422. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16423. xGame.common.showOneCamera("mainCamera");
  16424. }
  16425. loadD3Obj() {
  16426. this.loadTable();
  16427. this.loadRoom();
  16428. this.loadInHoleParticial();
  16429. this.loadIceParticial();
  16430. this.loadHitParticial();
  16431. this.loadFireworksParticial();
  16432. this.loadBall();
  16433. }
  16434. loadInHoleParticial() {
  16435. this.loadD3Res("inHoleEft", "", (prefab) => {
  16436. prefab.addComponent(Partical);
  16437. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16438. });
  16439. }
  16440. loadIceParticial() {
  16441. this.loadD3Res("iceEft", "", (prefab) => {
  16442. prefab.addComponent(Partical);
  16443. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16444. });
  16445. }
  16446. loadHitParticial() {
  16447. this.loadD3Res("hitEft", "", (prefab) => {
  16448. prefab.addComponent(Partical);
  16449. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16450. });
  16451. }
  16452. loadFireworksParticial() {
  16453. this.loadD3Res("fireworksEft", "", (prefab) => {
  16454. prefab.addComponent(Partical);
  16455. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16456. });
  16457. }
  16458. loadBall(index = 1) {
  16459. this.loadD3Res("ball", index, (prefab) => {
  16460. this.ballPrefab = prefab;
  16461. this.ballPrefab.addComponent(Ball);
  16462. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16463. });
  16464. }
  16465. loadTable(index = 1) {
  16466. this.loadD3Res("table", index, (prefab) => {
  16467. this.tableSrc = prefab.addComponent(Table);
  16468. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16469. this.d3Hand.init();
  16470. this.tableRoot.addChild(prefab);
  16471. });
  16472. }
  16473. loadRoom(index = 1) {
  16474. this.loadD3Res("room", index, (prefab) => {
  16475. this.roomRoot.addChild(prefab);
  16476. });
  16477. }
  16478. loadD3Res(type, index, callback) {
  16479. let url = `res/unityRes/${type}${index}.lh`;
  16480. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16481. callback && callback(prefab);
  16482. this.checkResLoad();
  16483. }));
  16484. }
  16485. checkResLoad() {
  16486. this.loadNum++;
  16487. if (this.loadNum >= this.setLoadNum) {
  16488. xGame.eventMgr.event(D3RES_LOADED);
  16489. }
  16490. }
  16491. prePlayEft() {
  16492. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16493. eft.transform.localPositionX = 0;
  16494. eft.transform.localPositionY = -5;
  16495. eft.transform.localPositionZ = 0;
  16496. eft.active = true;
  16497. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16498. ice.transform.localPositionX = 0;
  16499. ice.transform.localPositionY = -5;
  16500. ice.transform.localPositionZ = 0;
  16501. ice.active = true;
  16502. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16503. hit.transform.localPositionX = 0;
  16504. hit.transform.localPositionY = -5;
  16505. hit.transform.localPositionZ = 0;
  16506. hit.active = true;
  16507. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16508. fireworks.transform.localPositionX = 0;
  16509. fireworks.transform.localPositionY = -5;
  16510. fireworks.transform.localPositionZ = 0;
  16511. fireworks.active = true;
  16512. }
  16513. }
  16514. class cameraType {
  16515. }
  16516. class MoyuMgr$1 {
  16517. static initMoyu() {
  16518. this.moyuView = new MoyuView$1();
  16519. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16520. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16521. this.moyuView.ui.displayObject.zOrder = 1000;
  16522. this.moyuView.init();
  16523. this.moyuView.showTip(true);
  16524. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16525. window['XApk'] = this;
  16526. }
  16527. static showAge(show) {
  16528. if (this.moyuView)
  16529. this.moyuView.showAge(show);
  16530. }
  16531. static onPlatMsg(idx) {
  16532. if (!MoyuMgr$1.moyuView)
  16533. return;
  16534. if (idx == '0') {
  16535. MoyuMgr$1.moyuView.showTip(false);
  16536. }
  16537. }
  16538. static showAgree(call) {
  16539. if (this.moyuView)
  16540. this.moyuView.showAgree(call);
  16541. else
  16542. call && call();
  16543. }
  16544. static showXy(type = 1) {
  16545. if (this.moyuView)
  16546. this.moyuView.showXy(type);
  16547. }
  16548. }
  16549. MoyuMgr$1.isAdvise = false;
  16550. class MoyuView$1 {
  16551. constructor() {
  16552. this.ysxyNum = 1;
  16553. this.ysJson = null;
  16554. this.ui = ui_UIMoyu.createInstance();
  16555. }
  16556. init() {
  16557. this.ui.mainBg.visible = false;
  16558. this.ui.xyNode.visible = false;
  16559. this.ui.ageNode.visible = false;
  16560. this.ui.tipNode.visible = false;
  16561. this.ui.rnNode.visible = false;
  16562. this.ui.fcmNode.visible = false;
  16563. this.ui.ageTip.visible = false;
  16564. this.ui.msgNode.visible = false;
  16565. this.ui.visible = false;
  16566. this.ui.xyNode.xyList.setVirtual();
  16567. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16568. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16569. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16570. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16571. this.ui.xyNode.btnKnown.visible = false;
  16572. this.ui.xyNode.xy1.visible = false;
  16573. this.ui.xyNode.xy2.visible = false;
  16574. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16575. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16576. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16577. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16578. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16579. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16580. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16581. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16582. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16583. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16584. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16585. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16586. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16587. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16588. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16589. this.ysxyNum = 2;
  16590. }
  16591. }
  16592. onClick(obj) {
  16593. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16594. switch (obj) {
  16595. case this.ui.ageTip:
  16596. if (Moyu.isTTApk) {
  16597. this.ui.ageNode.visible = true;
  16598. this.ui.mainBg.visible = true;
  16599. }
  16600. break;
  16601. case this.ui.tipNode:
  16602. this.showTip(false);
  16603. break;
  16604. case this.ui.ageNode.btnAge:
  16605. this.ui.ageNode.visible = false;
  16606. this.ui.mainBg.visible = false;
  16607. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16608. this.ui.visible = false;
  16609. break;
  16610. case this.ui.xyNode.btnXy3:
  16611. case this.ui.xyNode.btnXy1:
  16612. this.loadXy(1);
  16613. break;
  16614. case this.ui.xyNode.btnXy2:
  16615. this.loadXy(2);
  16616. break;
  16617. case this.ui.xyNode.btnBack:
  16618. this.ui.xyNode.xy1.visible = true;
  16619. this.ui.xyNode.xy2.visible = false;
  16620. break;
  16621. case this.ui.xyNode.btnKnown:
  16622. this.ui.xyNode.visible = false;
  16623. this.ui.mainBg.visible = false;
  16624. this.ui.visible = false;
  16625. break;
  16626. case this.ui.rnNode.btnCheck:
  16627. this.check();
  16628. break;
  16629. case this.ui.rnNode.btnExit:
  16630. case this.ui.xyNode.btnNo:
  16631. this.ysxyNum--;
  16632. if (this.ysxyNum > 0)
  16633. this.showMsg("Refuse to quit the game once again");
  16634. else {
  16635. Moyu.userAgree(false);
  16636. Moyu.exit();
  16637. }
  16638. break;
  16639. case this.ui.xyNode.btnSure:
  16640. case this.ui.xyNode.btnYes:
  16641. DataMgr.userData.isAgree = true;
  16642. DataMgr.saveUserData();
  16643. this.onAgree();
  16644. break;
  16645. case this.ui.rnNode.btnDone:
  16646. this.ui.rnNode.visible = false;
  16647. this.ui.visible = false;
  16648. break;
  16649. case this.ui.fcmNode.btnRn:
  16650. this.showRn();
  16651. break;
  16652. }
  16653. }
  16654. showTip(show) {
  16655. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16656. return;
  16657. if (show) {
  16658. MoyuMgr$1.isAdvise = true;
  16659. this.ui.visible = true;
  16660. this.ui.tipNode.visible = true;
  16661. this.ui.tipNode.alpha = 1;
  16662. Laya.timer.once(1000, this, this.showTip, [false]);
  16663. }
  16664. else {
  16665. this.ui.tipNode.alpha = 1;
  16666. this.ui.tipNode.visible = true;
  16667. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16668. this.ui.tipNode.visible = false;
  16669. MoyuMgr$1.isAdvise = false;
  16670. }), 1000);
  16671. }
  16672. }
  16673. showAge(show, px = 0, py = 0) {
  16674. if (Moyu.platType > 10 && !Moyu.isIos) {
  16675. this.ui.ageTip.x = px;
  16676. this.ui.ageTip.y = py;
  16677. this.ui.ageTip.visible = show;
  16678. if (show)
  16679. this.ui.visible = true;
  16680. }
  16681. }
  16682. showAgree(call) {
  16683. this.agreeCall = call;
  16684. this.onAgree();
  16685. return;
  16686. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16687. this.showXy(0);
  16688. }
  16689. else
  16690. this.onAgree();
  16691. }
  16692. onAgree() {
  16693. if (!this.ui.ageNode.visible)
  16694. this.ui.visible = false;
  16695. this.ui.xyNode.visible = false;
  16696. Moyu.userAgree(true);
  16697. this.showAge(false);
  16698. this.agreeCall && this.agreeCall();
  16699. this.showRn();
  16700. }
  16701. showMsg(txt) {
  16702. this.ui.msgNode.txtMsg.text = txt;
  16703. this.ui.msgNode.visible = true;
  16704. this.ui.msgNode.alpha = 1;
  16705. this.ui.visible = true;
  16706. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16707. this.ui.msgNode.visible = false;
  16708. }), 2500, true);
  16709. }
  16710. showRn() {
  16711. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16712. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16713. this.ui.rnNode.rn1.visible = true;
  16714. this.ui.rnNode.rn2.visible = false;
  16715. this.ui.rnNode.rn3.visible = false;
  16716. this.ui.rnNode.rn4.visible = false;
  16717. this.ui.rnNode.visible = true;
  16718. this.ui.mainBg.visible = true;
  16719. this.ui.rnNode.btnDone.visible = false;
  16720. this.ui.rnNode.btnExit.visible = true;
  16721. this.ui.rnNode.btnCheck.visible = true;
  16722. this.ui.fcmNode.visible = false;
  16723. this.ui.visible = true;
  16724. return;
  16725. }
  16726. }
  16727. this.showFcm();
  16728. }
  16729. showFcm() {
  16730. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16731. Moyu.initFCM(true);
  16732. if (Moyu.gameTime < 1)
  16733. this.fcmLoop();
  16734. else if (Moyu.gameTime < 999)
  16735. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16736. }
  16737. }
  16738. fcmLoop() {
  16739. if (Moyu.gameTime < 1) {
  16740. this.ui.rnNode.visible = false;
  16741. this.ui.fcmNode.visible = true;
  16742. this.ui.mainBg.visible = true;
  16743. this.ui.visible = true;
  16744. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16745. Laya.timer.clear(this.ui, this.fcmLoop);
  16746. }
  16747. }
  16748. check() {
  16749. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16750. this.ui.rnNode.rn1.visible = false;
  16751. this.ui.rnNode.rn2.visible = false;
  16752. this.ui.rnNode.rn4.visible = true;
  16753. }
  16754. else if (this.ui.rnNode.rn4.visible) {
  16755. let name = this.ui.rnNode.inputName.text;
  16756. let code = this.ui.rnNode.inputCode.text;
  16757. if (code && code.length == 18) {
  16758. this.ui.rnNode.rn1.visible = false;
  16759. this.ui.rnNode.rn4.visible = false;
  16760. Moyu.authenticate(name, code, (res) => {
  16761. this.ui.rnNode.rn2.visible = !res;
  16762. this.ui.rnNode.rn3.visible = res;
  16763. this.ui.rnNode.btnDone.visible = res;
  16764. this.ui.rnNode.btnExit.visible = !res;
  16765. this.ui.rnNode.btnCheck.visible = !res;
  16766. if (res)
  16767. this.showFcm();
  16768. });
  16769. }
  16770. else
  16771. this.showMsg("信息填写不完整");
  16772. }
  16773. }
  16774. loadXy(type = 0) {
  16775. this.ui.xyNode.xy1.visible = false;
  16776. this.ui.xyNode.xy2.visible = true;
  16777. this.ui.xyNode.xyList.scrollToView(0);
  16778. if (type == 1) {
  16779. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16780. }
  16781. else if (type == 2) {
  16782. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16783. }
  16784. }
  16785. showXy(type = 0) {
  16786. this.xyBtn();
  16787. if (type == 0) {
  16788. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16789. this.ui.xyNode.btnSure.visible = true;
  16790. }
  16791. else {
  16792. this.ui.xyNode.btnYes.visible = true;
  16793. this.ui.xyNode.btnNo.visible = true;
  16794. }
  16795. }
  16796. else {
  16797. this.ui.xyNode.btnKnown.visible = true;
  16798. this.ui.mainBg.visible = true;
  16799. }
  16800. this.ui.xyNode.xy1.visible = true;
  16801. this.ui.xyNode.xy2.visible = false;
  16802. this.ui.xyNode.visible = true;
  16803. this.ui.visible = true;
  16804. }
  16805. xyBtn() {
  16806. this.ui.xyNode.btnSure.visible = false;
  16807. this.ui.xyNode.btnYes.visible = false;
  16808. this.ui.xyNode.btnNo.visible = false;
  16809. this.ui.xyNode.btnKnown.visible = false;
  16810. {
  16811. this.ui.xyNode.btnXy3.visible = false;
  16812. this.ui.xyNode.btnXy2.visible = true;
  16813. this.ui.xyNode.btnXy1.visible = true;
  16814. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16815. }
  16816. }
  16817. createXY(json) {
  16818. this.ysJson = json.content;
  16819. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16820. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16821. this.ui.xyNode.xy2.visible = true;
  16822. }
  16823. renderListItem(idx, cell) {
  16824. let xy = this.ysJson[idx];
  16825. cell.height = xy.line * 30;
  16826. cell.xyItem.text = xy.text;
  16827. }
  16828. onDestroy() {
  16829. this.agreeCall = null;
  16830. }
  16831. }
  16832. class UILoading extends UIBase {
  16833. constructor() {
  16834. super();
  16835. this.accTime = 0;
  16836. this.curNum = 0;
  16837. this.rate = 1;
  16838. this.loadSubOk = false;
  16839. this.loadResOK = false;
  16840. this.openLoading = true;
  16841. this.beginLoadRes = false;
  16842. this.finishD2 = false;
  16843. this.finishD3 = false;
  16844. }
  16845. onConstructor() {
  16846. this.ui = ui_UILoading.createInstance();
  16847. this.contentPane = this.ui;
  16848. this.isEject = false;
  16849. this._initUI();
  16850. this._addEvent();
  16851. }
  16852. _initUI() {
  16853. MoyuMgr$1.initMoyu();
  16854. }
  16855. _addEvent() {
  16856. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16857. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16858. }
  16859. show() {
  16860. super.show();
  16861. console.log('zh:加载分包资源');
  16862. loadSubRes(this.subResProgress.bind(this));
  16863. this.ui.txtLoad.text = "Loading...";
  16864. }
  16865. subResProgress(pro, finish) {
  16866. this.curNum = pro;
  16867. if (finish) {
  16868. this.curNum = 1;
  16869. this.loadSubOk = true;
  16870. }
  16871. }
  16872. laodD3Res() {
  16873. let scene3D = new Laya.Scene3D();
  16874. xGame.common.d3Scene = scene3D;
  16875. xGame.common.d3World = scene3D.addComponent(D3World);
  16876. xGame.common.d3World.loadScene();
  16877. }
  16878. loadD2Res() {
  16879. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16880. this.finishD2 = true;
  16881. this.checkLoadAll();
  16882. this.curNum = 1;
  16883. }), Laya.Handler.create(this, (pro) => {
  16884. this.curNum = pro;
  16885. }, null, false));
  16886. }
  16887. d3ResFinish() {
  16888. this.finishD3 = true;
  16889. this.checkLoadAll();
  16890. }
  16891. checkLoadAll() {
  16892. if (this.finishD2 && this.finishD3) {
  16893. this.loadResOK = true;
  16894. }
  16895. }
  16896. loadRes() {
  16897. this.laodD3Res();
  16898. this.loadD2Res();
  16899. }
  16900. myUpdate(dt) {
  16901. if (!this.openLoading)
  16902. return;
  16903. this.accTime += dt * this.rate;
  16904. if (this.accTime >= this.curNum)
  16905. this.accTime = this.curNum;
  16906. this.ui.loadinfo.value = this.accTime * 100;
  16907. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16908. if (!this.beginLoadRes) {
  16909. this.beginLoadRes = true;
  16910. this.ui.txtLoad.text = "Loading...";
  16911. this.curNum = 0;
  16912. this.accTime = 0;
  16913. this.loadRes();
  16914. }
  16915. if (this.loadResOK) {
  16916. this.openLoading = false;
  16917. Laya.timer.once(300, this, () => {
  16918. xGame.common.d3Scene.active = false;
  16919. MoyuMgr$1.showAgree(enterGame);
  16920. });
  16921. }
  16922. }
  16923. }
  16924. release() {
  16925. }
  16926. hide() {
  16927. super.hide();
  16928. this.release();
  16929. }
  16930. onClose() {
  16931. this.hide();
  16932. }
  16933. }
  16934. UILoading.uiName = "UILoading";
  16935. class UIRepentProp$1 extends UIBase {
  16936. constructor() {
  16937. super();
  16938. this.viewType = 0;
  16939. this.regretType = 0;
  16940. }
  16941. onConstructor() {
  16942. this.ui = ui_UIRepentProp.createInstance();
  16943. this.contentPane = this.ui;
  16944. this.isEject = false;
  16945. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  16946. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  16947. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  16948. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  16949. }
  16950. show(viewType, regretType, callback) {
  16951. PlatMgr.showInsert(true);
  16952. this.viewType = viewType;
  16953. this.regretType = regretType;
  16954. this.callback = callback;
  16955. super.show();
  16956. this.ui.t0.play();
  16957. this.ui.c1.selectedIndex = this.viewType;
  16958. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  16959. if (this.viewType == 0) {
  16960. let guide = DataMgr.getGuideHelpLine();
  16961. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  16962. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  16963. }
  16964. xGame.common.gameMgr.gamePause = true;
  16965. }
  16966. hideSelf() {
  16967. xGame.common.gameMgr.gamePause = false;
  16968. this.callback && this.callback(false);
  16969. this.hide();
  16970. }
  16971. videoRegret() {
  16972. Moyu.showVideoAd(() => {
  16973. this.callback && this.callback(true);
  16974. this.hideSelf();
  16975. }, EAdType.regretBall);
  16976. }
  16977. videoAddHelpLine() {
  16978. let guide = DataMgr.getGuideHelpLine();
  16979. if (guide == 0) {
  16980. this.callback && this.callback(true);
  16981. this.hideSelf();
  16982. DataMgr.setGuideHelpLine();
  16983. xGame.common.gameUI.ui.guideNode.visible = false;
  16984. }
  16985. else {
  16986. Moyu.showVideoAd(() => {
  16987. this.callback && this.callback(true);
  16988. this.hideSelf();
  16989. }, EAdType.longHelpLine);
  16990. }
  16991. }
  16992. }
  16993. UIRepentProp$1.uiName = "UIRepentProp";
  16994. class UIRodMethod$1 extends UIBase {
  16995. constructor() {
  16996. super();
  16997. this.isPressd = false;
  16998. }
  16999. onConstructor() {
  17000. this.ui = ui_UIRodMethod.createInstance();
  17001. this.contentPane = this.ui;
  17002. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17003. this.moveDir = new Laya.Vector2();
  17004. this.moveDest = new Laya.Vector2();
  17005. this.centerPos = new Laya.Vector2();
  17006. xGame.common.uiRodMethod = this;
  17007. }
  17008. show() {
  17009. super.show();
  17010. xGame.common.gameMgr.gamePause = true;
  17011. this.openPressDotEvent();
  17012. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17013. this.centerPos.x = this.ui.white.x;
  17014. this.centerPos.y = this.ui.white.y;
  17015. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17016. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17017. this.setDot();
  17018. }
  17019. setDot() {
  17020. this.ui.dot.x = this.moveDest.x;
  17021. this.ui.dot.y = this.moveDest.y;
  17022. }
  17023. closeSelf() {
  17024. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17025. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17026. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17027. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17028. xGame.common.gameMgr.gamePause = false;
  17029. this.hide();
  17030. }
  17031. openPressDotEvent() {
  17032. this.closePressDotEvent();
  17033. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17034. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17035. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17036. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17037. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17038. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17039. }
  17040. closePressDotEvent() {
  17041. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17042. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17043. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17044. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17045. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17046. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17047. }
  17048. onDown(e) {
  17049. if (e.type == Laya.Event.MOUSE_DOWN)
  17050. this.isPressd = true;
  17051. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17052. this.isPressd = false;
  17053. if (!this.isPressd)
  17054. return;
  17055. this.moveDest.x = e.stageX;
  17056. this.moveDest.y = e.stageY;
  17057. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17058. if (dis > 6724) {
  17059. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17060. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17061. }
  17062. this.setDot();
  17063. }
  17064. resetRod() {
  17065. this.ui.dot.x = this.ui.white.x;
  17066. this.ui.dot.y = this.ui.white.y;
  17067. this.gameRod.dot.x = this.gameRod.bg.x;
  17068. this.gameRod.dot.y = this.gameRod.bg.y;
  17069. xGame.common.rodOffest.x = 0;
  17070. xGame.common.rodOffest.y = 0;
  17071. }
  17072. }
  17073. UIRodMethod$1.uiName = "UIRodMethod";
  17074. class UIMsg$1 extends UIBase {
  17075. constructor() {
  17076. super();
  17077. }
  17078. onConstructor() {
  17079. this.ui = ui_UIMsg.createInstance();
  17080. this.contentPane = this.ui;
  17081. this.isEject = false;
  17082. this.isMuti = true;
  17083. }
  17084. show(msg, callback) {
  17085. super.show();
  17086. this.ui.tipsNode.msgTxt.text = msg;
  17087. this.ui.alpha = 1;
  17088. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17089. this.hide();
  17090. callback && callback();
  17091. }), 1000);
  17092. }
  17093. }
  17094. UIMsg$1.uiName = "UIMsg";
  17095. class UITips$1 extends UIBase {
  17096. constructor() {
  17097. super();
  17098. this.type = 0;
  17099. }
  17100. onConstructor() {
  17101. this.ui = ui_UITips.createInstance();
  17102. this.contentPane = this.ui;
  17103. this.isEject = false;
  17104. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17105. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17106. }
  17107. show(tipsTxt, womanTxt, type) {
  17108. super.show();
  17109. this.ui.t0.play();
  17110. this.ui.myNode.tipsTxt.text = tipsTxt;
  17111. this.ui.myNode.womanTxt.text = womanTxt;
  17112. PlatMgr.showInsert(true);
  17113. this.ui.myNode.c1.selectedIndex = type;
  17114. this.type = type;
  17115. switch (this.type) {
  17116. case TipsType.exitGame:
  17117. xGame.common.gameMgr.gamePause = true;
  17118. break;
  17119. case TipsType.foul:
  17120. Laya.timer.once(200, this, () => {
  17121. xGame.common.gameMgr.gamePause = true;
  17122. });
  17123. break;
  17124. default:
  17125. break;
  17126. }
  17127. }
  17128. clickLeftBtn() {
  17129. this.hide();
  17130. xGame.common.gameMgr.gamePause = false;
  17131. switch (this.type) {
  17132. case TipsType.exitGame:
  17133. break;
  17134. case TipsType.foul:
  17135. break;
  17136. default:
  17137. break;
  17138. }
  17139. }
  17140. clickRightBtn() {
  17141. this.hide();
  17142. switch (this.type) {
  17143. case TipsType.exitGame:
  17144. xGame.eventMgr.event(RESET_GAME);
  17145. xGame.uiMgr.Show(UIMain$1);
  17146. Moyu.recordEnd(this, null);
  17147. xGame.common.longHelpLine = false;
  17148. break;
  17149. case TipsType.foul:
  17150. xGame.common.gameMgr.gamePause = false;
  17151. Laya.timer.clearAll(this);
  17152. break;
  17153. default:
  17154. break;
  17155. }
  17156. }
  17157. }
  17158. UITips$1.uiName = "UITips";
  17159. class UIGame$1 extends UIBase {
  17160. constructor() {
  17161. super();
  17162. this.powerNum = 0;
  17163. this.isD3Inited = false;
  17164. this.isPrePlay = false;
  17165. this.isMoveRod = false;
  17166. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17167. this.rulerDis = 20;
  17168. this.rulerOffset = 0;
  17169. }
  17170. onConstructor() {
  17171. this.ui = ui_UIGame.createInstance();
  17172. this.contentPane = this.ui;
  17173. this.ui.x += xGame.common.sysOffestNum;
  17174. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17175. this.isEject = false;
  17176. xGame.common.gameUI = this;
  17177. this.initSelf();
  17178. }
  17179. isTurnSelf() {
  17180. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17181. return true;
  17182. }
  17183. }
  17184. initSelf() {
  17185. let topUI = this.ui.topNode;
  17186. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17187. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17188. this.barInfo = {};
  17189. this.barInfo.curY = 0;
  17190. this.barInfo.height = this.ui.powerNode.height;
  17191. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17192. this.barInfo.powerStartY = this.ui.powerNode.y;
  17193. xGame.common.aiPlayer = new AIPlayer();
  17194. xGame.common.gameMgr = new GameMgr();
  17195. xGame.common.skillMgr = new SkillMgr();
  17196. xGame.common.wordsMgr = new WordsMgr();
  17197. xGame.common.talkMgr = new TalkMgr();
  17198. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17199. console.log("加载经典模式表情文件chenggon !");
  17200. });
  17201. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17202. console.log("挑战模式奖励模式spine加载成功!");
  17203. });
  17204. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17205. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17206. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17207. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17208. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17209. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17210. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17211. }
  17212. returnHome() {
  17213. let tips = "Are you sure to exit the game?";
  17214. let woman = "Boss, why don't you play for a while longer?";
  17215. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17216. }
  17217. addRodMethodClick() {
  17218. if (this.isTurnSelf()) {
  17219. xGame.uiMgr.Show(UIRodMethod$1);
  17220. }
  17221. }
  17222. clickHelpLineBtn(force = false) {
  17223. if (!this.isTurnSelf())
  17224. return;
  17225. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17226. if (success) {
  17227. xGame.common.longHelpLine = true;
  17228. xGame.common.d2World.getHelpLine();
  17229. Moyu.sendDataEvent("guideNum");
  17230. }
  17231. else {
  17232. }
  17233. });
  17234. }
  17235. renderSelfDisplayBalls(index, target) {
  17236. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17237. target.myImg.url = xGame.common.getGameIconUrl(str);
  17238. }
  17239. renderAIDisplayBalls(index, target) {
  17240. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17241. target.myImg.url = xGame.common.getGameIconUrl(str);
  17242. ;
  17243. }
  17244. updateMode() {
  17245. if (xGame.common.gameMode == GameMode.classic) {
  17246. this.ui.topNode.scoreNode.visible = false;
  17247. }
  17248. else if (xGame.common.gameMode == GameMode.bigMove) {
  17249. this.ui.topNode.scoreNode.visible = true;
  17250. }
  17251. }
  17252. show() {
  17253. super.show();
  17254. console.log("zh:uigame show");
  17255. this.ui.alpha = 0;
  17256. this.updateSelf();
  17257. console.log("zh:uigame bf gamemusic01 start");
  17258. xGame.soundMgr.playMusic("gamemusic01");
  17259. console.log("zh:uigame bf gamemusic01 end");
  17260. xGame.common.gameMgr.gamePause = false;
  17261. xGame.common.gameUI.ui.blackAni.visible = false;
  17262. xGame.common.gameUI.ui.whiteAni.visible = false;
  17263. this.ui.powerEft.visible = false;
  17264. this.ui.colorNode.visible = false;
  17265. this.updateHead();
  17266. }
  17267. updateSelf() {
  17268. if (xGame.common.gameMode == GameMode.classic) {
  17269. this.ui.c1.selectedIndex = 0;
  17270. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17271. this.ui.topNode.middleNode.visible = true;
  17272. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17273. }
  17274. else if (xGame.common.gameMode == GameMode.bigMove) {
  17275. this.ui.c1.selectedIndex = 0;
  17276. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17277. this.ui.topNode.middleNode.visible = false;
  17278. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17279. let rand = xGame.common.randomNum(1, max);
  17280. let guide = DataMgr.getSkillGuide();
  17281. if (guide == 0)
  17282. rand = 1;
  17283. xGame.common.bigMoveLevelIndex = rand;
  17284. }
  17285. else if (xGame.common.gameMode == GameMode.placeBall) {
  17286. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17287. this.ui.c1.selectedIndex = 1 + data.type;
  17288. this.ui.alpha = 1;
  17289. this.startGame();
  17290. }
  17291. this.updateMode();
  17292. this.initD3world();
  17293. this.initD2world();
  17294. }
  17295. startGame() {
  17296. this.ui.snowNode.visible = Math.random() <= 0.1;
  17297. this.ui.d2Node.visible = false;
  17298. xGame.common.d3World.d3Hand.gameObj.active = false;
  17299. xGame.common.d3World.tableSrc.init();
  17300. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17301. this.cameraViewChange(() => {
  17302. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17303. switch (xGame.common.gameMode) {
  17304. case GameMode.classic:
  17305. xGame.common.d3World.d3Hand.gameObj.active = true;
  17306. this.playPutBallD3Ani();
  17307. break;
  17308. case GameMode.bigMove:
  17309. this.enterGame();
  17310. Laya.timer.once(500, this, () => {
  17311. this.ui.topNode.middleNode.visible = true;
  17312. this.ui.topNode.middleNode.t0.play();
  17313. });
  17314. break;
  17315. case GameMode.placeBall:
  17316. this.enterGame();
  17317. break;
  17318. default:
  17319. break;
  17320. }
  17321. });
  17322. PlatMgr.showBanner(false);
  17323. }
  17324. enterGame() {
  17325. this.ui.d2Node.visible = true;
  17326. xGame.common.d3World.d3Hand.gameObj.active = false;
  17327. xGame.common.showOneCamera("mainCamera");
  17328. Moyu.recordGame(30, true);
  17329. if (!this.isPrePlay) {
  17330. this.isPrePlay = true;
  17331. xGame.common.d3World.prePlayEft();
  17332. }
  17333. xGame.common.gameMgr.gameReady();
  17334. this.openAllEvent();
  17335. this.ui.snowNode.visible = false;
  17336. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17337. this.ui.helpBtn.visible = condition;
  17338. }
  17339. showHelpLineGuide() {
  17340. let longGuide = DataMgr.getGuideHelpLine();
  17341. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17342. this.ui.helpBtn.visible = true;
  17343. this.ui.guideNode.visible = true;
  17344. }
  17345. }
  17346. setTurnAlpha(alpha) {
  17347. this.ui.keduNode.alpha = alpha;
  17348. this.ui.ganNode.alpha = alpha;
  17349. this.ui.rodMethodNode.alpha = alpha;
  17350. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17351. }
  17352. cameraViewChange(callback) {
  17353. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17354. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17355. xGame.common.showOneCamera("visitAngle");
  17356. cameraSrc.localRotationEulerY = 180;
  17357. cameraSrc.localRotationEulerZ = 0;
  17358. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17359. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17360. callback && callback();
  17361. }));
  17362. }));
  17363. }
  17364. playPutBallD3Ani() {
  17365. xGame.common.showOneCamera("mainCamera");
  17366. let handSrc = xGame.common.d3World.d3Hand;
  17367. handSrc.gameObj.active = true;
  17368. handSrc.transform.localPositionZ = 3;
  17369. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17370. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17371. handSrc.gameObj.active = false;
  17372. this.enterGame();
  17373. }), 400);
  17374. }));
  17375. }
  17376. updateHead() {
  17377. let user = Moyu.getUserInfo();
  17378. this.ui.topNode.selfNameTxt.text = user.nickName;
  17379. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17380. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17381. if (DataMgr.getSkillGuide() < 1) {
  17382. this.ui.topNode.aiNameTxt.text = 'billiards';
  17383. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17384. }
  17385. else {
  17386. this.ui.topNode.aiNameTxt.text = aiData.name;
  17387. let randNo = Math.floor(Math.random() * 10) + 1;
  17388. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17389. }
  17390. }
  17391. initD2world() {
  17392. let node = this.ui.d2Root.displayObject;
  17393. let src = node.getComponent(D2World);
  17394. if (!src) {
  17395. xGame.common.d2World = node.addComponent(D2World);
  17396. }
  17397. xGame.common.d2World.initSelf();
  17398. }
  17399. initD3world() {
  17400. if (this.isD3Inited)
  17401. return;
  17402. this.isD3Inited = true;
  17403. let scene3D = xGame.common.d3Scene;
  17404. this.ui.d3Root.displayObject.addChild(scene3D);
  17405. scene3D.active = true;
  17406. xGame.common.d3World.tableSrc.setBorderPos();
  17407. }
  17408. onRootMove(e) {
  17409. let rootBall = xGame.common.d2World.rootBall;
  17410. this.ui.moveNode.x = e.x;
  17411. this.ui.moveNode.y = e.y;
  17412. rootBall.gameObj.x = e.x;
  17413. rootBall.gameObj.y = e.y;
  17414. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17415. }
  17416. aiRootMove(move) {
  17417. if (move)
  17418. this.hideBallUI();
  17419. else {
  17420. this.showBallUI();
  17421. xGame.common.d2World.getHelpLine();
  17422. }
  17423. }
  17424. aiForce(type, force = 0) {
  17425. this.pressTarget = PressType.powerNode;
  17426. if (type == 1)
  17427. this.onEventUp({ force: true });
  17428. else if (type == 2)
  17429. this.onEventMove({ stageY: force, force: true });
  17430. }
  17431. onEventPress(e) {
  17432. if (e.stopPropagation)
  17433. e.stopPropagation();
  17434. if (!this.isTurnSelf())
  17435. return;
  17436. let target = e.target;
  17437. switch (target) {
  17438. case this.ui.myPowerNode.displayObject:
  17439. this.pressTarget = PressType.powerNode;
  17440. this.barInfo.curY = e.stageY;
  17441. this.updateBarInfo();
  17442. break;
  17443. case this.ui.moveNode.displayObject:
  17444. this.pressTarget = PressType.moveNode;
  17445. this.hideBallUI();
  17446. this.eventObj.curX = this.ui.moveNode.x;
  17447. this.eventObj.curY = this.ui.moveNode.y;
  17448. this.ui.moveNode.finger.visible = false;
  17449. this.eventObj.lastX = e.stageX;
  17450. this.eventObj.lastY = e.stageY;
  17451. break;
  17452. case this.ui.rulerClickNode.displayObject:
  17453. this.pressTarget = PressType.rulerNode;
  17454. this.eventObj.lastY = e.stageY;
  17455. break;
  17456. case this.ui.d2Root.displayObject:
  17457. this.pressTarget = PressType.d2Root;
  17458. this.eventObj.lastX = e.stageX;
  17459. this.eventObj.lastY = e.stageY;
  17460. this.eventObj.starX = e.stageX;
  17461. this.eventObj.starY = e.stageY;
  17462. this.eventObj.curX = 0;
  17463. this.eventObj.curY = 0;
  17464. xGame.common.d2World.d2Gan.setGanLastInfo();
  17465. this.rulerOffset = 0;
  17466. break;
  17467. default:
  17468. break;
  17469. }
  17470. }
  17471. onEventMove(e) {
  17472. if (e.stopPropagation)
  17473. e.stopPropagation();
  17474. if (e && e.force) {
  17475. }
  17476. else {
  17477. if (!this.isTurnSelf())
  17478. return;
  17479. }
  17480. switch (this.pressTarget) {
  17481. case PressType.powerNode:
  17482. this.barInfo.curY = e.stageY;
  17483. this.updateBarInfo();
  17484. this.isMoveRod = true;
  17485. break;
  17486. case PressType.moveNode:
  17487. let rootBall = xGame.common.d2World.rootBall;
  17488. let radius = rootBall.gameObj.width / 2;
  17489. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17490. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17491. let border = xGame.common.d2World.borderRect;
  17492. if (curX <= border.x + radius)
  17493. curX = border.x + radius;
  17494. else if (curX >= border.x + border.width - radius)
  17495. curX = border.x + border.width - radius;
  17496. if (curY <= border.y + radius)
  17497. curY = border.y + radius;
  17498. else if (curY >= border.y + border.height - radius)
  17499. curY = border.y + border.height - radius;
  17500. if (xGame.common.gameMgr.isOpenBall) {
  17501. if (curX >= border.x + border.openBallW - radius)
  17502. curX = border.x + border.openBallW - radius;
  17503. }
  17504. this.ui.moveNode.x = curX;
  17505. this.ui.moveNode.y = curY;
  17506. rootBall.gameObj.x = curX;
  17507. rootBall.gameObj.y = curY;
  17508. rootBall.d3BallSrc.setTransPos(curX, curY);
  17509. this.isMoveRod = true;
  17510. break;
  17511. case PressType.rulerNode:
  17512. let yy = e.stageY - this.eventObj.lastY;
  17513. this.eventObj.lastY = e.stageY;
  17514. let ruler1 = this.ui.rulerNode.img1;
  17515. let ruler2 = this.ui.rulerNode.img2;
  17516. ruler1.y += yy;
  17517. ruler2.y += yy;
  17518. this.rulerOffset += yy;
  17519. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17520. this.rulerOffset = 0;
  17521. xGame.soundMgr.playSound("inch", 1, 10);
  17522. }
  17523. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17524. let h = ruler1.height;
  17525. this.checkGuide();
  17526. this.isMoveRod = true;
  17527. if (ruler1.y >= h) {
  17528. ruler1.y = -h;
  17529. ruler2.y = 0;
  17530. return;
  17531. }
  17532. else if (ruler1.y <= -h) {
  17533. ruler1.y = h;
  17534. ruler2.y = 0;
  17535. return;
  17536. }
  17537. if (ruler2.y >= h) {
  17538. ruler2.y = -h;
  17539. ruler1.y = 0;
  17540. return;
  17541. }
  17542. else if (ruler2.y <= -h) {
  17543. ruler2.y = h;
  17544. ruler1.y = 0;
  17545. return;
  17546. }
  17547. break;
  17548. case PressType.d2Root:
  17549. this.eventObj.curX = e.stageX;
  17550. this.eventObj.curY = e.stageY;
  17551. let offset = this.checkRodMoveDir();
  17552. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17553. this.eventObj.lastX = e.stageX;
  17554. this.eventObj.lastY = e.stageY;
  17555. break;
  17556. default:
  17557. break;
  17558. }
  17559. }
  17560. onEventUp(e) {
  17561. if (e.stopPropagation)
  17562. e.stopPropagation();
  17563. if (e && e.force) {
  17564. }
  17565. else {
  17566. if (!this.isTurnSelf())
  17567. return;
  17568. }
  17569. switch (this.pressTarget) {
  17570. case PressType.powerNode:
  17571. this.ui.powerNode.value = 0;
  17572. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17573. this.ui.powerTxt.text = "";
  17574. if (this.powerNum > 0) {
  17575. xGame.eventMgr.event(BALL_SHOOT);
  17576. xGame.common.d2World.shoot(this.powerNum);
  17577. xGame.common.d2World.d2Gan.shoot();
  17578. xGame.common.d2World.d2HelpLine.shoot();
  17579. this.finishGuide();
  17580. this.ui.powerEft.visible = false;
  17581. this.ui.colorNode.visible = false;
  17582. let ganStr = "";
  17583. if (this.powerNum <= 30) {
  17584. ganStr = "gan_30";
  17585. }
  17586. else if (this.powerNum <= 60) {
  17587. ganStr = "gan_50";
  17588. }
  17589. else {
  17590. ganStr = "gan_80";
  17591. }
  17592. xGame.soundMgr.playSound(ganStr);
  17593. }
  17594. break;
  17595. case PressType.moveNode:
  17596. let rootBall = xGame.common.d2World.rootBall;
  17597. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17598. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17599. let isIntersect = this.judgeBallIntersect();
  17600. if (isIntersect) {
  17601. this.ui.moveNode.x = lastX;
  17602. this.ui.moveNode.y = lastY;
  17603. rootBall.gameObj.x = lastX;
  17604. rootBall.gameObj.y = lastY;
  17605. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17606. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17607. }
  17608. else {
  17609. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17610. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17611. }
  17612. this.showBallUI();
  17613. this.ui.moveNode.finger.visible = true;
  17614. xGame.common.d2World.getHelpLine();
  17615. break;
  17616. case PressType.rulerNode:
  17617. break;
  17618. case PressType.d2Root:
  17619. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17620. if (dis <= 25) {
  17621. this.moveToClickDot(e);
  17622. }
  17623. break;
  17624. default:
  17625. break;
  17626. }
  17627. this.pressTarget = -1;
  17628. }
  17629. checkGuide() {
  17630. let guide = DataMgr.getSkillGuide();
  17631. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17632. xGame.common.guideStep++;
  17633. xGame.common.gameUI.ui.guide2.visible = false;
  17634. xGame.common.gameUI.ui.guide3.visible = true;
  17635. }
  17636. }
  17637. finishGuide() {
  17638. let guide = DataMgr.getSkillGuide();
  17639. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17640. xGame.common.guideStep = 10;
  17641. this.closeAllGuide();
  17642. }
  17643. }
  17644. closeAllGuide() {
  17645. xGame.common.gameUI.ui.guide1.visible = false;
  17646. xGame.common.gameUI.ui.guide2.visible = false;
  17647. xGame.common.gameUI.ui.guide3.visible = false;
  17648. }
  17649. updateBarInfo() {
  17650. let star = this.ui.powerNode.y;
  17651. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17652. if (rate >= 1)
  17653. rate = 1;
  17654. if (rate <= 0)
  17655. rate = 0;
  17656. this.powerNum = Math.ceil(rate * 100);
  17657. this.ui.powerNode.value = this.powerNum;
  17658. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17659. this.ui.colorNode.value = this.powerNum;
  17660. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17661. this.ui.powerEft.visible = this.powerNum != 0;
  17662. this.ui.colorNode.visible = this.powerNum != 0;
  17663. this.ui.powerTxt.text = this.powerNum + "";
  17664. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17665. }
  17666. forceCancel() {
  17667. this.ui.powerNode.value = 0;
  17668. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17669. this.ui.powerTxt.text = "";
  17670. }
  17671. checkRodMoveDir() {
  17672. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17673. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17674. if (tempX >= 0 && tempY <= 0) {
  17675. return this.checkDir();
  17676. }
  17677. else if (tempX < 0 && tempY < 0) {
  17678. return this.checkDir(1, -1);
  17679. }
  17680. else if (tempX < 0 && tempY > 0) {
  17681. return this.checkDir(-1, -1);
  17682. }
  17683. else {
  17684. return this.checkDir(-1, 1);
  17685. }
  17686. }
  17687. checkDir(flagX = 1, flagY = 1) {
  17688. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17689. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17690. if (offsetY == 0) {
  17691. return offsetX * flagX;
  17692. }
  17693. if (offsetX == 0) {
  17694. return offsetY * flagY;
  17695. }
  17696. let angle = offsetY / offsetX;
  17697. if (Math.abs(angle) >= 1) {
  17698. return offsetY * flagY;
  17699. }
  17700. else {
  17701. return offsetX * flagX;
  17702. }
  17703. }
  17704. judgeBallIntersect() {
  17705. let rootBall = xGame.common.d2World.rootBall;
  17706. let ballArr = xGame.common.d2World.ballArr;
  17707. let radius = rootBall.gameObj.width / 2;
  17708. let temp;
  17709. let isIntersect = false;
  17710. for (let index = 0; index < ballArr.length; index++) {
  17711. temp = ballArr[index];
  17712. if (temp.number == rootBall.number)
  17713. continue;
  17714. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17715. if (isIntersect) {
  17716. break;
  17717. }
  17718. }
  17719. return isIntersect;
  17720. }
  17721. hideBallUI() {
  17722. let d2Gan = xGame.common.d2World.d2Gan;
  17723. if (!d2Gan.ui.isDisposed)
  17724. d2Gan.ui.visible = false;
  17725. let d2Help = xGame.common.d2World.d2HelpLine;
  17726. if (!d2Help.ui.isDisposed)
  17727. d2Help.ui.visible = false;
  17728. let rootBall = xGame.common.d2World.rootBall;
  17729. if (!rootBall.destroyed) {
  17730. rootBall.gameObj.active = false;
  17731. }
  17732. }
  17733. showBallUI() {
  17734. let d2Gan = xGame.common.d2World.d2Gan;
  17735. if (!d2Gan.ui.isDisposed)
  17736. d2Gan.ui.visible = true;
  17737. let d2Help = xGame.common.d2World.d2HelpLine;
  17738. if (!d2Help.ui.isDisposed)
  17739. d2Help.ui.visible = true;
  17740. let rootBall = xGame.common.d2World.rootBall;
  17741. if (!rootBall.destroyed) {
  17742. rootBall.gameObj.active = true;
  17743. }
  17744. }
  17745. moveToClickDot(e) {
  17746. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17747. let root = xGame.common.d2World.rootBall.gameObj;
  17748. let xx = e.stageX - xGame.common.sysOffestNum;
  17749. let yy = e.stageY;
  17750. let x = xx - root.x;
  17751. let y = yy - root.y;
  17752. let angle = xGame.common.getfguiRotation(x, y);
  17753. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17754. xGame.common.d2World.getHelpLine();
  17755. }
  17756. this.isMoveRod = false;
  17757. xGame.common.clickedBall = false;
  17758. }
  17759. openAllEvent() {
  17760. this.closeAllEvent();
  17761. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17762. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17763. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17764. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17765. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17766. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17767. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17768. }
  17769. closeAllEvent() {
  17770. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17771. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17772. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17773. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17774. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17775. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17776. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17777. }
  17778. resetGame() {
  17779. this.closeAllEvent();
  17780. this.hideBallUI();
  17781. xGame.common.gameMgr.gamePause = true;
  17782. }
  17783. }
  17784. UIGame$1.uiName = "UIGame";
  17785. class UIAddCoin$1 extends UIBase {
  17786. constructor() {
  17787. super();
  17788. this.coinNum = 2000;
  17789. }
  17790. onConstructor() {
  17791. this.ui = ui_UIAddCoin.createInstance();
  17792. this.contentPane = this.ui;
  17793. this.isEject = false;
  17794. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17795. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17796. }
  17797. show() {
  17798. super.show();
  17799. this.ui.t0.play();
  17800. }
  17801. videoAddCoin() {
  17802. Moyu.showVideoAd(() => {
  17803. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17804. this.hide();
  17805. }, EAdType.addFailCoin);
  17806. }
  17807. }
  17808. UIAddCoin$1.uiName = "UIAddCoin";
  17809. class UIInvitation$1 extends UIBase {
  17810. constructor() {
  17811. super();
  17812. }
  17813. onConstructor() {
  17814. this.ui = ui_UIInvitation.createInstance();
  17815. this.contentPane = this.ui;
  17816. this.isEject = false;
  17817. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17818. }
  17819. show() {
  17820. super.show();
  17821. }
  17822. enterGame() {
  17823. xGame.common.gameMode = GameMode.classic;
  17824. DataMgr.setChallengeTimes(1);
  17825. xGame.common.passAwardCoin = 2000;
  17826. let need = xGame.common.classicNiceNeddCoin;
  17827. if (DataMgr.coinEnough(need)) {
  17828. DataMgr.setCoin(-need);
  17829. xGame.eventMgr.event(RESTART_GAME, true);
  17830. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17831. }
  17832. else {
  17833. xGame.eventMgr.event(RESTART_GAME, true);
  17834. }
  17835. this.hide();
  17836. }
  17837. hide() {
  17838. super.hide();
  17839. }
  17840. }
  17841. UIInvitation$1.uiName = "UIInvitation";
  17842. class UIPower$1 extends UIBase {
  17843. constructor() {
  17844. super();
  17845. }
  17846. onConstructor() {
  17847. this.ui = ui_UIPower.createInstance();
  17848. this.contentPane = this.ui;
  17849. this.isEject = false;
  17850. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17851. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17852. }
  17853. show() {
  17854. super.show();
  17855. this.ui.t0.play();
  17856. }
  17857. videoGetPower() {
  17858. Moyu.showVideoAd(() => {
  17859. DataMgr.setPower(xGame.common.videoPower, true);
  17860. xGame.eventMgr.event(POWER_TIME);
  17861. this.hide();
  17862. }, EAdType.getPower);
  17863. }
  17864. }
  17865. UIPower$1.uiName = "UIPower";
  17866. class UIGameEnd$1 extends UIBase {
  17867. constructor() {
  17868. super();
  17869. this.success = false;
  17870. this.awardCoinNum = 1000;
  17871. this.awardDiamondNum = 10;
  17872. }
  17873. onConstructor() {
  17874. this.ui = ui_UIGameEnd.createInstance();
  17875. this.contentPane = this.ui;
  17876. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17877. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17878. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17879. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17880. this.ui.talkNode.visible = false;
  17881. if (Moyu.isKs)
  17882. this.ui.closeNode.closeBtn.x += 100;
  17883. }
  17884. updateType() {
  17885. switch (xGame.common.gameMode) {
  17886. case GameMode.classic:
  17887. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17888. this.ui.coinNode.visible = this.success;
  17889. if (!this.success) {
  17890. Laya.timer.once(500, this, () => {
  17891. xGame.uiMgr.Show(UIAddCoin$1);
  17892. });
  17893. }
  17894. this.ui.isGetAward.visible = false;
  17895. this.ui.leftBtn.c1.selectedIndex = 3;
  17896. this.ui.rightBtn.c1.selectedIndex = 0;
  17897. this.moneyNode.ui.c1.selectedIndex = 1;
  17898. break;
  17899. case GameMode.bigMove:
  17900. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17901. this.ui.coinNode.visible = this.success;
  17902. if (xGame.common.gameMode == GameMode.bigMove) {
  17903. if (this.success) {
  17904. DataMgr.setSkillSuccessTimes(1, true);
  17905. DataMgr.setSkillAccTimes(1);
  17906. }
  17907. else {
  17908. DataMgr.setSkillSuccessTimes(0, false);
  17909. }
  17910. }
  17911. if (!this.success) {
  17912. Laya.timer.once(500, this, () => {
  17913. xGame.uiMgr.Show(UIAddCoin$1);
  17914. });
  17915. }
  17916. this.ui.isGetAward.visible = false;
  17917. this.ui.leftBtn.c1.selectedIndex = 3;
  17918. this.ui.rightBtn.c1.selectedIndex = 0;
  17919. this.moneyNode.ui.c1.selectedIndex = 1;
  17920. break;
  17921. case GameMode.placeBall:
  17922. this.ui.coinNode.visible = false;
  17923. if (this.success) {
  17924. if (xGame.common.placeBallStarNum == 3) {
  17925. this.ui.c1.selectedIndex = 2;
  17926. }
  17927. else {
  17928. this.ui.c1.selectedIndex = 3;
  17929. }
  17930. }
  17931. else {
  17932. this.ui.c1.selectedIndex = 4;
  17933. }
  17934. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17935. if (cfg.type == PlaceBallType.challenge) {
  17936. this.ui.c1.selectedIndex = 2;
  17937. }
  17938. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  17939. this.updatePlaceBallBtn();
  17940. this.updatePlaceBallStarNum();
  17941. this.updatePlaceBallAwardState();
  17942. this.moneyNode.ui.c1.selectedIndex = 2;
  17943. this.moneyNode.checkPowerTime();
  17944. this.moneyNode.powerChange();
  17945. DataMgr.upRankData();
  17946. break;
  17947. default:
  17948. break;
  17949. }
  17950. }
  17951. updatePlaceBallBtn() {
  17952. this.ui.leftBtn.c1.selectedIndex = 5;
  17953. if (this.success) {
  17954. this.ui.rightBtn.c1.selectedIndex = 14;
  17955. }
  17956. else {
  17957. if (xGame.common.placeBallStarNum == 3) {
  17958. this.ui.rightBtn.c1.selectedIndex = 14;
  17959. }
  17960. else {
  17961. this.ui.rightBtn.c1.selectedIndex = 1;
  17962. }
  17963. }
  17964. }
  17965. updatePlaceBallStarNum() {
  17966. let starNum = xGame.common.placeBallStarNum;
  17967. if (starNum == 0)
  17968. this.ui.starNumNode.c1.selectedIndex = 3;
  17969. else {
  17970. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  17971. }
  17972. }
  17973. updatePlaceBallAwardState() {
  17974. let level = xGame.common.placeBallCurLevel;
  17975. let starNum = xGame.common.placeBallStarNum;
  17976. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  17977. let data = cfgTable.placeballData[level].award;
  17978. let cfg = cfgTable.placeballData[level];
  17979. this.awardDiamondNum = data[1];
  17980. this.awardCoinNum = data[0];
  17981. if (cfg.type == PlaceBallType.challenge) {
  17982. this.awardDiamondNum = 0;
  17983. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  17984. }
  17985. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  17986. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  17987. if (cfg.type == PlaceBallType.challenge) {
  17988. this.ui.awardNode.coinNode.visible = true;
  17989. }
  17990. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  17991. this.ui.awardNode.diamondNode.x = 265;
  17992. this.ui.awardNode.coinNode.x = 354;
  17993. }
  17994. else {
  17995. this.ui.awardNode.diamondNode.x = 291;
  17996. this.ui.awardNode.coinNode.x = 291;
  17997. }
  17998. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  17999. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18000. if (this.awardCoinNum == 0) {
  18001. this.ui.awardNode.coinNode.numTxt.text = "";
  18002. }
  18003. if (getAward) {
  18004. this.ui.isGetAward.visible = true;
  18005. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18006. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18007. }
  18008. else {
  18009. this.ui.isGetAward.visible = false;
  18010. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18011. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18012. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18013. }
  18014. else {
  18015. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18016. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18017. }
  18018. }
  18019. }
  18020. show(success) {
  18021. super.show();
  18022. xGame.eventMgr.event(RESET_GAME);
  18023. this.success = success;
  18024. Laya.timer.clearAll(this);
  18025. this.playSecretaryAni();
  18026. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18027. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18028. offsetTime = Math.floor(offsetTime / 1000);
  18029. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18030. this.updateType();
  18031. Laya.timer.once(200, this, () => {
  18032. this.addAward(() => {
  18033. this.updateType();
  18034. Laya.timer.once(500, this, () => {
  18035. this.showChallengeLevel();
  18036. });
  18037. });
  18038. });
  18039. if (this.success) {
  18040. xGame.soundMgr.playSound('slots_roll01');
  18041. xGame.soundMgr.playSound("s_win");
  18042. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18043. }
  18044. else {
  18045. xGame.soundMgr.playSound('matchwin01');
  18046. xGame.soundMgr.playSound("s_lose");
  18047. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18048. }
  18049. if (!Moyu.isLegal)
  18050. PlatMgr.showBanner(true);
  18051. let challengeNum = DataMgr.getChallengeTimes();
  18052. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18053. DataMgr.setChallengeTimes(1);
  18054. }
  18055. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18056. DataMgr.setClassicTimes();
  18057. }
  18058. }
  18059. showChallengeLevel() {
  18060. if (DataMgr.getChallengeTimes() != 0)
  18061. return;
  18062. let skill = DataMgr.getSkillAccTimes();
  18063. let put = DataMgr.getPlaceBallLevelList().length;
  18064. if (skill >= 3 || put >= 5) {
  18065. xGame.uiMgr.Show(UIInvitation$1);
  18066. this.hide();
  18067. }
  18068. }
  18069. addAward(callback) {
  18070. if (!this.success) {
  18071. callback && callback();
  18072. return;
  18073. }
  18074. switch (xGame.common.gameMode) {
  18075. case GameMode.classic:
  18076. this.awardCoinNum = xGame.common.passAwardCoin;
  18077. this.awardDiamondNum = 0;
  18078. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18079. break;
  18080. case GameMode.bigMove:
  18081. this.awardCoinNum = xGame.common.passAwardCoin;
  18082. this.awardDiamondNum = 0;
  18083. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18084. callback && callback();
  18085. break;
  18086. case GameMode.placeBall:
  18087. let level = xGame.common.placeBallCurLevel;
  18088. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18089. if (xGame.common.placeBallStarNum != 3) {
  18090. callback && callback();
  18091. return;
  18092. }
  18093. else {
  18094. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18095. if (getAward) {
  18096. callback && callback();
  18097. return;
  18098. }
  18099. }
  18100. let cfg = cfgTable.placeballData[level];
  18101. let data = cfgTable.placeballData[level].award;
  18102. this.awardCoinNum = data[0];
  18103. this.awardDiamondNum = data[1];
  18104. if (cfg.type == PlaceBallType.challenge) {
  18105. this.awardDiamondNum = 0;
  18106. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18107. }
  18108. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18109. let diamondAward;
  18110. if (this.awardDiamondNum > 0) {
  18111. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18112. xGame.common.getAward([diamondAward, coinAward], callback);
  18113. }
  18114. else {
  18115. xGame.common.getAward([coinAward], callback);
  18116. }
  18117. if (cfg.type == PlaceBallType.normal) {
  18118. DataMgr.setPlaceBallAward(level);
  18119. }
  18120. break;
  18121. default:
  18122. break;
  18123. }
  18124. }
  18125. playSecretaryAni_old() {
  18126. let parent = this.ui.secretary.displayObject;
  18127. parent.destroyChildren();
  18128. let xx = this.ui.secretary.width / 2;
  18129. let yy = this.ui.secretary.height;
  18130. let scale = xGame.common.getSecretaryScale();
  18131. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18132. if (this.success) {
  18133. let rand = Math.random() <= 0.5 ? 2 : 3;
  18134. xGame.common.secretary.play(data, rand, false, parent, () => {
  18135. xGame.common.secretary.play(data, 1, true, parent);
  18136. });
  18137. }
  18138. else {
  18139. xGame.common.secretary.play(data, 0, true, parent);
  18140. }
  18141. }
  18142. playSecretaryAni() {
  18143. let parent = this.ui.secretary.displayObject;
  18144. parent.destroyChildren();
  18145. let xx = this.ui.secretary.width / 2;
  18146. let yy = this.ui.secretary.height;
  18147. let scale = xGame.common.getSecretaryScale();
  18148. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18149. if (this.success) {
  18150. let rand = 0;
  18151. xGame.common.secretary.play(data, 0, true, parent);
  18152. }
  18153. else {
  18154. xGame.common.secretary.play(data, 0, true, parent);
  18155. }
  18156. }
  18157. restartGame() {
  18158. switch (xGame.common.gameMode) {
  18159. case GameMode.classic:
  18160. xGame.eventMgr.event(RESTART_GAME);
  18161. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18162. break;
  18163. case GameMode.bigMove:
  18164. this.hide();
  18165. xGame.eventMgr.event(RESTART_GAME);
  18166. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18167. break;
  18168. default:
  18169. break;
  18170. }
  18171. }
  18172. hide() {
  18173. super.hide();
  18174. xGame.common.stopGirlPop(this.ui.talkNode);
  18175. PlatMgr.showBanner(false);
  18176. }
  18177. returnHome() {
  18178. this.hide();
  18179. let showFailWords = !this.success;
  18180. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18181. }
  18182. clickLeftBtn() {
  18183. switch (xGame.common.gameMode) {
  18184. case GameMode.classic:
  18185. case GameMode.bigMove:
  18186. this.returnHome();
  18187. break;
  18188. case GameMode.placeBall:
  18189. let level = xGame.common.placeBallCurLevel;
  18190. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18191. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18192. break;
  18193. default:
  18194. break;
  18195. }
  18196. }
  18197. powerStartPlaceBallLevel(level, btn) {
  18198. if (DataMgr.powerEnough()) {
  18199. btn.touchable = false;
  18200. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18201. btn.touchable = true;
  18202. DataMgr.setPower(-1);
  18203. xGame.eventMgr.event(POWER_TIME);
  18204. this.startPlaceBallLevel(level);
  18205. }));
  18206. }
  18207. else {
  18208. xGame.uiMgr.Show(UIPower$1, 0);
  18209. }
  18210. }
  18211. clickRightBtn() {
  18212. switch (xGame.common.gameMode) {
  18213. case GameMode.classic:
  18214. console.log('zh:clickRightBtn 111');
  18215. case GameMode.bigMove:
  18216. console.log('zh:clickRightBtn 222');
  18217. this.restartGame();
  18218. break;
  18219. case GameMode.placeBall:
  18220. console.log('zh:clickRightBtn 333');
  18221. let level = xGame.common.placeBallCurLevel;
  18222. let data = DataMgr.getPlaceBallLevel(level);
  18223. let curPss = data.play && !data.isCur;
  18224. if (curPss) {
  18225. console.log('zh:clickRightBtn 333-111');
  18226. console.log('zh:当前LV=' + level);
  18227. if (level == 60) {
  18228. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18229. Laya.timer.once(3000, this, () => {
  18230. this.returnHome();
  18231. });
  18232. }
  18233. else {
  18234. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18235. }
  18236. }
  18237. else {
  18238. console.log('zh:clickRightBtn 333-000');
  18239. Moyu.sendDataEvent("placeBallNextLevel");
  18240. Moyu.showVideoAd(() => {
  18241. DataMgr.setPlaceBallLevel(level, 1);
  18242. this.startPlaceBallLevel(level + 1);
  18243. }, xGame.define.EAdType.placeBallNextLevel);
  18244. }
  18245. break;
  18246. default:
  18247. console.log('zh:clickRightBtn 444');
  18248. break;
  18249. }
  18250. }
  18251. startPlaceBallLevel(level) {
  18252. xGame.common.gameMode = GameMode.placeBall;
  18253. xGame.common.placeBallCurLevel = level;
  18254. xGame.uiMgr.Show(UIGame$1);
  18255. this.hide();
  18256. }
  18257. }
  18258. UIGameEnd$1.uiName = "UIGameEnd";
  18259. class ShowItem$1 {
  18260. constructor() {
  18261. this.ui = ui_ShowItem.createInstance();
  18262. }
  18263. destroySelf() {
  18264. if (!this.ui.isDisposed) {
  18265. this.ui.removeFromParent();
  18266. this.ui.dispose();
  18267. }
  18268. }
  18269. setParent(parent) {
  18270. parent.addChild(this.ui);
  18271. }
  18272. setPos(x, y) {
  18273. this.ui.x = x;
  18274. this.ui.y = y;
  18275. }
  18276. setUrl(index) {
  18277. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18278. }
  18279. }
  18280. class UILevelProp$1 extends UIBase {
  18281. constructor() {
  18282. super();
  18283. this.firstPos = 385;
  18284. this.secondPos = 467;
  18285. this.showItemArr = [];
  18286. }
  18287. onConstructor() {
  18288. this.ui = ui_UILevelProp.createInstance();
  18289. this.contentPane = this.ui;
  18290. this.isEject = false;
  18291. this.addUIClick(this.ui.closeBtn, this.hide);
  18292. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18293. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18294. }
  18295. show(level) {
  18296. super.show();
  18297. this.ui.t1.play();
  18298. this.level = level;
  18299. this.data = cfgTable.placeballData[this.level];
  18300. this.updateSelf();
  18301. this.showPreView();
  18302. this.moneyNode.ui.c1.selectedIndex = 2;
  18303. this.moneyNode.checkPowerTime();
  18304. this.moneyNode.powerChange();
  18305. }
  18306. showPreView() {
  18307. let item;
  18308. let data;
  18309. for (let index = 0; index < this.showItemArr.length; index++) {
  18310. item = this.showItemArr[index];
  18311. item.destroySelf();
  18312. }
  18313. this.showItemArr = [];
  18314. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18315. for (const key in cfgData) {
  18316. data = cfgData[key];
  18317. item = new ShowItem$1();
  18318. item.setParent(this.ui.myNode.displayRoot);
  18319. item.setPos(data.x, data.y);
  18320. item.setUrl(data.value);
  18321. this.showItemArr.push(item);
  18322. }
  18323. }
  18324. updateSelf() {
  18325. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18326. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18327. if (this.data.ball == -1) {
  18328. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18329. }
  18330. else {
  18331. this.ui.myNode.conditionTxt.text = "Reward";
  18332. }
  18333. let localData = DataMgr.getPlaceBallLevel(this.level);
  18334. let getAward = localData.getAward;
  18335. let cfg = cfgTable.placeballData[this.level];
  18336. let coin = this.data.award[0];
  18337. let diamond = this.data.award[1];
  18338. if (cfg.type == PlaceBallType.challenge) {
  18339. diamond = 0;
  18340. coin = 100;
  18341. }
  18342. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18343. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18344. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18345. if (cfg.type == PlaceBallType.challenge) {
  18346. this.ui.myNode.coinNode.numTxt.text = "";
  18347. }
  18348. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18349. if (coin > 0 && diamond > 0) {
  18350. this.ui.myNode.diamondNode.x = 385;
  18351. this.ui.myNode.coinNode.x = 467;
  18352. }
  18353. else {
  18354. this.ui.myNode.diamondNode.x = 385;
  18355. this.ui.myNode.coinNode.x = 385;
  18356. }
  18357. if (!getAward) {
  18358. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18359. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18360. }
  18361. else {
  18362. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18363. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18364. }
  18365. }
  18366. startGame() {
  18367. if (DataMgr.powerEnough()) {
  18368. this.ui.myNode.startBtn.touchable = false;
  18369. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18370. console.log('zh:startGame ');
  18371. this.ui.myNode.startBtn.touchable = true;
  18372. DataMgr.setPower(-1);
  18373. xGame.eventMgr.event(POWER_TIME);
  18374. xGame.common.gameMode = GameMode.placeBall;
  18375. xGame.common.placeBallCurLevel = this.level;
  18376. xGame.uiMgr.Show(UIGame$1);
  18377. xGame.uiMgr.Hide(UILevelDisplay$1);
  18378. xGame.uiMgr.Hide(UIMain$1);
  18379. this.hide();
  18380. }));
  18381. }
  18382. else {
  18383. console.log('zh:startGame no power');
  18384. xGame.uiMgr.Show(UIPower$1);
  18385. }
  18386. }
  18387. hide() {
  18388. super.hide();
  18389. }
  18390. }
  18391. UILevelProp$1.uiName = "UILevelProp";
  18392. class PutBallLevelDisplay$1 {
  18393. constructor(ui, index) {
  18394. this.index = 0;
  18395. this.ui = ui;
  18396. this.index = index;
  18397. this.ui.onClick(this, this.clickSelf);
  18398. this.updateSelf();
  18399. this.ui.levelTxt.text = (this.index + 1) + "";
  18400. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18401. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18402. }
  18403. updateSelf() {
  18404. let level = this.index + 1;
  18405. this.data = DataMgr.getPlaceBallLevel(level);
  18406. this.ui.starNode.c1.selectedIndex = this.data.star;
  18407. let isChallenge = cfgTable.placeballData[level].type;
  18408. if (this.data.isCur) {
  18409. if (isChallenge) {
  18410. this.ui.c1.selectedIndex = 5;
  18411. }
  18412. else {
  18413. this.ui.c1.selectedIndex = 2;
  18414. }
  18415. }
  18416. else {
  18417. if (this.data.play) {
  18418. if (this.data.star == 3) {
  18419. this.ui.c1.selectedIndex = 0;
  18420. }
  18421. else {
  18422. this.ui.c1.selectedIndex = 1;
  18423. }
  18424. }
  18425. else {
  18426. if (isChallenge) {
  18427. this.ui.c1.selectedIndex = 4;
  18428. }
  18429. else {
  18430. this.ui.c1.selectedIndex = 3;
  18431. }
  18432. }
  18433. }
  18434. }
  18435. clickSelf() {
  18436. if (!this.data.play)
  18437. return;
  18438. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18439. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18440. }
  18441. }
  18442. class UILevelDisplay$1 extends UIBase {
  18443. constructor() {
  18444. super();
  18445. }
  18446. onConstructor() {
  18447. this.ui = ui_UILevelDisplay.createInstance();
  18448. this.contentPane = this.ui;
  18449. this.isEject = false;
  18450. this.myList = this.ui.myNode.myList;
  18451. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18452. this.levelItemArr = [];
  18453. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18454. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18455. this.myList.numItems = levelNum;
  18456. if (Moyu.isKs)
  18457. this.ui.closeNode.closeBtn.x += 100;
  18458. }
  18459. levelItemRender(index, target) {
  18460. let item = new PutBallLevelDisplay$1(target, index);
  18461. this.levelItemArr.push(item);
  18462. }
  18463. show() {
  18464. super.show();
  18465. this.updateLevel();
  18466. this.scrollToPlace();
  18467. }
  18468. updateLevel() {
  18469. let temp;
  18470. for (let index = 0; index < this.levelItemArr.length; index++) {
  18471. temp = this.levelItemArr[index];
  18472. temp.updateSelf();
  18473. }
  18474. }
  18475. scrollToPlace() {
  18476. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18477. let passArr = DataMgr.getPlaceBallLevelList();
  18478. let offest = passArr.length;
  18479. if (offest >= maxNum - 1)
  18480. offest = maxNum - 1;
  18481. this.myList.scrollToView(offest, true, true);
  18482. }
  18483. hide() {
  18484. super.hide();
  18485. }
  18486. }
  18487. UILevelDisplay$1.uiName = "UILevelDisplay";
  18488. class UIMatching$1 extends UIBase {
  18489. constructor() {
  18490. super();
  18491. }
  18492. onConstructor() {
  18493. this.ui = ui_UIMatching.createInstance();
  18494. this.contentPane = this.ui;
  18495. this.isEject = false;
  18496. }
  18497. show(callback) {
  18498. super.show();
  18499. PlatMgr.showBanner(true);
  18500. this.callback = callback;
  18501. let user = Moyu.getUserInfo();
  18502. if (!this.selfPot) {
  18503. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18504. }
  18505. if (!this.aiPot) {
  18506. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18507. }
  18508. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18509. this.ui.selfHead.nameTxt.text = user.nickName;
  18510. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18511. this.ui.aiHead.nameTxt.text = "???";
  18512. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18513. this.ui.selfHead.c1.selectedIndex = 0;
  18514. this.ui.aiHead.c1.selectedIndex = 0;
  18515. this.ui.selfHead.x = this.selfPot.x;
  18516. this.ui.selfHead.y = this.selfPot.y;
  18517. this.ui.aiHead.x = this.aiPot.x;
  18518. this.ui.aiHead.y = this.aiPot.y;
  18519. switch (xGame.common.gameMode) {
  18520. case GameMode.classic:
  18521. break;
  18522. case GameMode.bigMove:
  18523. this.initSkillData();
  18524. break;
  18525. default:
  18526. break;
  18527. }
  18528. this.ui.t1.play(Laya.Handler.create(this, () => {
  18529. this.ui.t2.play(Laya.Handler.create(this, () => {
  18530. switch (xGame.common.gameMode) {
  18531. case GameMode.classic:
  18532. this.waitingPeople();
  18533. break;
  18534. case GameMode.bigMove:
  18535. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18536. break;
  18537. default:
  18538. break;
  18539. }
  18540. }));
  18541. }));
  18542. }
  18543. initSkillData() {
  18544. this.skillSelectData = [];
  18545. let skillUrl = xGame.common.skillIconList;
  18546. let skillName = xGame.common.skillNameList;
  18547. let skillLevel = DataMgr.getBigSkillList();
  18548. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18549. for (let index = 0; index < 5; index++) {
  18550. let obj = {};
  18551. obj.skillImg = skillUrl[index];
  18552. obj.skillName = skillName[index];
  18553. obj.skillType = skillType[index];
  18554. obj.skillLevel = skillLevel[index];
  18555. this.skillSelectData.push(obj);
  18556. }
  18557. }
  18558. getAISkillLevel(myLevel) {
  18559. let video = xGame.common.upSkillLevel;
  18560. let aiLevel;
  18561. let temp;
  18562. if (video) {
  18563. temp = xGame.common.randomNum(-2, -1);
  18564. }
  18565. else {
  18566. if (myLevel <= 5) {
  18567. temp = xGame.common.randomNum(1, 3);
  18568. }
  18569. else if (myLevel <= 9) {
  18570. temp = xGame.common.randomNum(-2, 1);
  18571. }
  18572. else {
  18573. temp = xGame.common.randomNum(-4, 0);
  18574. }
  18575. }
  18576. aiLevel = temp + myLevel;
  18577. if (aiLevel <= 1)
  18578. aiLevel = 1;
  18579. if (aiLevel >= 10)
  18580. aiLevel = 10;
  18581. return aiLevel;
  18582. }
  18583. getAISkillType() {
  18584. return xGame.common.randomNum(1, 4);
  18585. let successTimes = DataMgr.getSkillSuccessTimes();
  18586. let info = cfgTable.aiskillData[successTimes];
  18587. if (!info) {
  18588. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18589. info = cfgTable.aiskillData[max];
  18590. }
  18591. let dataArr = info.skillselect;
  18592. let myCfg = {};
  18593. for (let index = 0; index < dataArr.length; index++) {
  18594. let temp = dataArr[index].split('-');
  18595. myCfg[temp[0]] = {};
  18596. myCfg[temp[0]].id = parseInt(temp[0]);
  18597. myCfg[temp[0]].weight = parseInt(temp[1]);
  18598. }
  18599. let aiCfg = xGame.common.initWeight(myCfg);
  18600. let curData = xGame.common.getRandomWeightData(aiCfg);
  18601. return parseInt(curData.id);
  18602. }
  18603. getAISkillData(index) {
  18604. let myLevel = this.skillSelectData[index].skillLevel;
  18605. let aiLevel = this.getAISkillLevel(myLevel);
  18606. let aiType = this.getAISkillType() - 1;
  18607. return { aiLevel, aiType } = { aiLevel, aiType };
  18608. }
  18609. skillSelectFinish(index) {
  18610. let aiInfo = this.getAISkillData(index);
  18611. xGame.common.gameMgr.selfCurSkill = index;
  18612. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18613. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18614. this.ui.selfHead.c1.selectedIndex = 1;
  18615. this.ui.aiHead.c1.selectedIndex = 1;
  18616. let myData = this.skillSelectData[index];
  18617. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18618. let guide = DataMgr.getSkillGuide();
  18619. if (guide == 0) {
  18620. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18621. }
  18622. else {
  18623. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18624. }
  18625. let aiData = this.skillSelectData[aiInfo.aiType];
  18626. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18627. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18628. this.waitingPeople();
  18629. }
  18630. waitingPeople() {
  18631. let time = xGame.common.randomNum(1000, 3000);
  18632. time += 1000;
  18633. Laya.timer.once(time, this, () => {
  18634. this.matchingSuccess();
  18635. });
  18636. }
  18637. matchingSuccess() {
  18638. let gameUI = xGame.common.gameUI;
  18639. let name = gameUI.ui.topNode.aiNameTxt.text;
  18640. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18641. this.ui.aiHead.nameTxt.text = name;
  18642. this.ui.aiHead.headImg.url = url;
  18643. name = gameUI.ui.topNode.selfNameTxt.text;
  18644. url = gameUI.ui.topNode.selfHeadLoader.url;
  18645. this.ui.selfHead.nameTxt.text = name;
  18646. this.ui.selfHead.headImg.url = url;
  18647. this.ui.t3.play(Laya.Handler.create(this, () => {
  18648. this.callback && this.callback();
  18649. this.ui.t4.play(Laya.Handler.create(this, () => {
  18650. this.destroySelf();
  18651. }));
  18652. }));
  18653. }
  18654. destroySelf() {
  18655. this.callback = null;
  18656. this.skillSelectData = null;
  18657. this.selfPot = null;
  18658. this.aiPot = null;
  18659. if (!this.ui.isDisposed) {
  18660. this.ui.removeFromParent();
  18661. this.ui.dispose();
  18662. }
  18663. xGame.uiMgr.destroyUI(this);
  18664. }
  18665. }
  18666. UIMatching$1.uiName = "UIMatching";
  18667. class SkillDisplay$1 {
  18668. constructor(ui, data, uiIndex) {
  18669. this.starX = 0;
  18670. this.starY = 0;
  18671. this.index = 0;
  18672. this.ui = ui;
  18673. this.data = data;
  18674. this.index = uiIndex;
  18675. this.initSelf();
  18676. console.log('zh:SkillDisplay constructor this.skillData=', data);
  18677. }
  18678. initSelf() {
  18679. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18680. this.ui.nameTxt.text = this.data.name;
  18681. this.ui.describeTxt.text = this.data.describe;
  18682. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18683. this.ui.startBtn.onClick(this, this.startGame);
  18684. this.updateSelf();
  18685. }
  18686. updateSelf() {
  18687. this.checkTry();
  18688. let level = DataMgr.getBigSkillByIndex(this.index);
  18689. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18690. }
  18691. checkTry() {
  18692. let index = this.index;
  18693. let level = DataMgr.getBigSkillByIndex(index);
  18694. if (level == null) {
  18695. DataMgr.setBigSkill(index, 1, false);
  18696. level = 1;
  18697. }
  18698. this.ui.levelTxt.text = "LV." + level;
  18699. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18700. this.ui.tryNode.visible = true;
  18701. else
  18702. this.ui.tryNode.visible = false;
  18703. }
  18704. clickAddLevel() {
  18705. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18706. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18707. Moyu.showVideoAd(() => {
  18708. DataMgr.setBigSkill(this.data.index, 1);
  18709. this.updateSelf();
  18710. xGame.common.upSkillLevel = true;
  18711. }, EAdType.upSkill);
  18712. }
  18713. startGame() {
  18714. if (this.data.index == 3) {
  18715. alert('Coming soon!');
  18716. return;
  18717. }
  18718. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18719. let needCoin = xGame.common.bigMoveNeedCoin;
  18720. xGame.common.passAwardCoin = 2000;
  18721. let guide = DataMgr.getSkillGuide();
  18722. console.log('zh:startGame guide=' + guide);
  18723. xGame.common.temSelfLevel = 0;
  18724. if (guide == 0) {
  18725. needCoin = 0;
  18726. xGame.common.temSelfLevel = 100;
  18727. }
  18728. if (DataMgr.coinEnough(needCoin)) {
  18729. DataMgr.setCoin(-needCoin);
  18730. xGame.common.curPlayerSkillType = this.index;
  18731. if (guide == 0)
  18732. xGame.common.curPlayerSkillType = 0;
  18733. xGame.uiMgr.Show(UIGame$1);
  18734. xGame.uiMgr.Hide(UIMain$1);
  18735. xGame.uiMgr.Show(UIMatching$1, () => {
  18736. xGame.common.gameUI.ui.alpha = 1;
  18737. xGame.common.gameUI.startGame();
  18738. xGame.uiMgr.Hide(UISkill$1);
  18739. });
  18740. }
  18741. else {
  18742. xGame.uiMgr.Show(UIAddProp$1, 0);
  18743. Moyu.sendDataEvent("AddCoinVideo");
  18744. }
  18745. }
  18746. }
  18747. class UISkill$1 extends UIBase {
  18748. constructor() {
  18749. super();
  18750. this.skillData = [];
  18751. }
  18752. onConstructor() {
  18753. this.ui = ui_UISkill.createInstance();
  18754. this.contentPane = this.ui;
  18755. this.isEject = false;
  18756. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18757. this.initSkillData();
  18758. console.log('zh:aaaaaa1111111111');
  18759. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18760. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18761. console.log('zh:aaaaaa22222222');
  18762. this.displayList = [];
  18763. this.ui.skillNode.skillList.numItems = 3;
  18764. this.addUIClick(this.ui, this.interuptSecretary);
  18765. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18766. this.ui.talkNode.visible = false;
  18767. if (Moyu.isKs)
  18768. this.ui.closeNode.closeBtn.x += 100;
  18769. }
  18770. show() {
  18771. super.show();
  18772. this.playSecretaryIdle();
  18773. this.moneyNode.ui.c1.selectedIndex = 1;
  18774. Laya.timer.clearAll(this);
  18775. xGame.soundMgr.playSound("s_start");
  18776. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18777. let guide = DataMgr.getSkillGuide();
  18778. this.ui.guideNode.visible = guide == 0;
  18779. let item = this.getSkillItemByUIIndex(0);
  18780. if (guide == 0) {
  18781. item.ui.c1.selectedIndex = 1;
  18782. }
  18783. else {
  18784. item.ui.c1.selectedIndex = 0;
  18785. }
  18786. this.ui.guideNode.guideBtn.visible = guide == 0;
  18787. for (let index = 0; index < this.displayList.length; index++) {
  18788. this.displayList[index].checkTry();
  18789. }
  18790. }
  18791. getSkillItemByUIIndex(cur) {
  18792. for (let index = 0; index < this.displayList.length; index++) {
  18793. if (this.displayList[index].index == cur) {
  18794. return this.displayList[index];
  18795. }
  18796. }
  18797. }
  18798. enterGuideLevel() {
  18799. let item = this.getSkillItemByUIIndex(0);
  18800. item.startGame();
  18801. if (DataMgr.getNewUser())
  18802. Moyu.sendDataEvent("gameStart1");
  18803. }
  18804. initSkillData() {
  18805. this.skillData = [];
  18806. let nameList = xGame.common.skillNameList;
  18807. let iconList = xGame.common.skillIconList;
  18808. let describeList = [
  18809. "Jump shot executed — ball bounced and pocketed an extra one!",
  18810. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  18811. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  18812. ];
  18813. console.log('zh:initSkillData 111111111');
  18814. let data;
  18815. for (let index = 0; index < nameList.length; index++) {
  18816. data = {};
  18817. data.name = nameList[index];
  18818. data.icon = iconList[index];
  18819. data.describe = describeList[index];
  18820. data.index = index;
  18821. this.skillData.push(data);
  18822. }
  18823. }
  18824. updateSkillItem(index, target) {
  18825. if (this.displayList[index] == null) {
  18826. let uiIndex;
  18827. switch (index) {
  18828. case 0:
  18829. uiIndex = 1;
  18830. break;
  18831. case 1:
  18832. uiIndex = 0;
  18833. break;
  18834. case 2:
  18835. uiIndex = 2;
  18836. break;
  18837. case 3:
  18838. uiIndex = 3;
  18839. break;
  18840. default:
  18841. break;
  18842. }
  18843. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18844. this.displayList.push(temp);
  18845. }
  18846. }
  18847. playSecretaryIdle() {
  18848. let parent = this.ui.secretary.displayObject;
  18849. parent.destroyChildren();
  18850. let xx = this.ui.secretary.width / 2;
  18851. let yy = this.ui.secretary.height;
  18852. let scale = xGame.common.getSecretaryScale();
  18853. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18854. xGame.common.secretary.play(data, 0, true, parent);
  18855. }
  18856. returnUIMain() {
  18857. this.hide();
  18858. xGame.common.stopGirlPop(this.ui.talkNode);
  18859. xGame.uiMgr.Show(UIMain$1);
  18860. }
  18861. interuptSecretary() {
  18862. Laya.timer.clearAll(this);
  18863. this.playSecretaryRandomSound();
  18864. }
  18865. playSecretaryRandomSound() {
  18866. if (this.isHide)
  18867. return;
  18868. let time = xGame.common.randomNum(45000, 60000);
  18869. Laya.timer.once(time, this, () => {
  18870. if (this.isHide)
  18871. return;
  18872. let index = xGame.common.randomNum(4, 7);
  18873. xGame.soundMgr.playSound("s_main0" + index);
  18874. let words = 1;
  18875. switch (index) {
  18876. case 4:
  18877. words = 5;
  18878. break;
  18879. case 5:
  18880. words = 3;
  18881. break;
  18882. case 6:
  18883. words = 6;
  18884. break;
  18885. case 7:
  18886. words = 7;
  18887. break;
  18888. default:
  18889. break;
  18890. }
  18891. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18892. this.playSecretaryRandomSound();
  18893. });
  18894. }
  18895. }
  18896. UISkill$1.uiName = "UISkill";
  18897. class UIAddProp$1 extends UIBase {
  18898. constructor() {
  18899. super();
  18900. this.curType = "";
  18901. }
  18902. onConstructor() {
  18903. this.ui = ui_UIAddProp.createInstance();
  18904. this.contentPane = this.ui;
  18905. this.isEject = false;
  18906. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18907. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18908. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18909. this.updateUI();
  18910. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18911. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18912. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18913. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18914. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18915. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18916. }
  18917. show(type) {
  18918. super.show();
  18919. this.curType = type == 0 ? "coin" : "diamond";
  18920. this.switchBtn("");
  18921. this.ui.t0.play();
  18922. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18923. PlatMgr.showInsert(true);
  18924. }
  18925. closeSelf() {
  18926. this.hide();
  18927. }
  18928. updateUI() {
  18929. let data = cfgTable.moneyData;
  18930. let temp;
  18931. let obj;
  18932. for (const key in data) {
  18933. temp = data[key];
  18934. obj = this.ui.myNode["node" + key];
  18935. if (parseInt(key) <= 2) {
  18936. obj.diamondTxt.text = "+" + temp.num;
  18937. }
  18938. else {
  18939. obj.coinTxt.text = temp.num;
  18940. obj.diamondTxt.text = temp.get.split('_')[1];
  18941. }
  18942. }
  18943. this.updateDiamondShare();
  18944. }
  18945. updateDiamondShare() {
  18946. let data = DataMgr.getShareDiamondTimes();
  18947. if (data >= xGame.common.maxShareDiamondTimes) {
  18948. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  18949. this.ui.myNode.node1.touchable = false;
  18950. }
  18951. else {
  18952. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  18953. this.ui.myNode.node1.touchable = true;
  18954. }
  18955. }
  18956. switchBtn(type) {
  18957. if (type == "")
  18958. type = this.curType;
  18959. else {
  18960. if (this.curType == type) {
  18961. return;
  18962. }
  18963. else {
  18964. this.curType = type;
  18965. }
  18966. }
  18967. if (type == "coin") {
  18968. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  18969. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  18970. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  18971. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  18972. this.ui.myNode.c1.selectedIndex = 0;
  18973. }
  18974. else {
  18975. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  18976. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  18977. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  18978. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  18979. this.ui.myNode.c1.selectedIndex = 1;
  18980. }
  18981. }
  18982. convertCoin(index) {
  18983. let data = cfgTable.moneyData[index];
  18984. let coinNum = data.num;
  18985. let str = data.get.split('_')[1];
  18986. let needDiamond = parseInt(str);
  18987. if (DataMgr.diamondEnough(needDiamond)) {
  18988. DataMgr.setDiamond(-needDiamond);
  18989. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  18990. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  18991. }
  18992. else {
  18993. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  18994. this.switchBtn("diamond");
  18995. }
  18996. }
  18997. videoGetDiamond() {
  18998. let num = cfgTable.moneyData[2].num;
  18999. Moyu.showVideoAd(() => {
  19000. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19001. this.closeSelf();
  19002. }, EAdType.addDiamond);
  19003. }
  19004. videoGetCoin() {
  19005. Moyu.showVideoAd(() => {
  19006. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19007. this.closeSelf();
  19008. }, EAdType.addCoin);
  19009. }
  19010. shareGetDiamond() {
  19011. let times = DataMgr.getShareDiamondTimes();
  19012. if (times >= xGame.common.maxShareDiamondTimes) {
  19013. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19014. }
  19015. else {
  19016. if (Moyu.isTT) {
  19017. let num = cfgTable.moneyData[1].num;
  19018. Moyu.shareVideo = '';
  19019. Moyu.shareGame((success) => {
  19020. if (success) {
  19021. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19022. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19023. DataMgr.setShareDiamondTimes(1);
  19024. this.updateDiamondShare();
  19025. }
  19026. else {
  19027. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19028. }
  19029. });
  19030. }
  19031. else {
  19032. Moyu.showVideoAd(() => {
  19033. let diamond = xGame.common.randomNum(50, 100);
  19034. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19035. DataMgr.setShareDiamondTimes(1);
  19036. this.updateDiamondShare();
  19037. }, EAdType.randomDiamond);
  19038. }
  19039. }
  19040. }
  19041. openPutBallView() {
  19042. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19043. let skill = xGame.uiMgr.getUI(UISkill$1);
  19044. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19045. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19046. if (end && !end.isHide) {
  19047. xGame.uiMgr.Hide(UIGameEnd$1);
  19048. xGame.uiMgr.Show(UIMain$1);
  19049. }
  19050. if (skill && !skill.isHide)
  19051. xGame.uiMgr.Hide(UISkill$1);
  19052. if (uigame && !uigame.isHide)
  19053. xGame.uiMgr.Hide(UIGame$1);
  19054. if (level && !level.isHide) {
  19055. }
  19056. else {
  19057. xGame.uiMgr.Show(UILevelDisplay$1);
  19058. }
  19059. this.closeSelf();
  19060. }
  19061. }
  19062. UIAddProp$1.uiName = "UIAddProp";
  19063. class MoneyNode$1 {
  19064. constructor(ui) {
  19065. this.leftTime = 0;
  19066. this.ui = ui;
  19067. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19068. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19069. this.ui.addPowerBtn.onClick(this, this.addPower);
  19070. this.ui.c1.selectedIndex = 1;
  19071. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19072. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19073. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19074. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19075. this.coinChange();
  19076. this.diamondChange();
  19077. this.powerChange();
  19078. }
  19079. addPower() {
  19080. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19081. xGame.uiMgr.Show(UIPower$1);
  19082. }
  19083. powerChange() {
  19084. let powerNum = DataMgr.getPower();
  19085. this.ui.powerTxt.text = powerNum + "";
  19086. }
  19087. checkPowerTime() {
  19088. let cur = new Date().getTime();
  19089. let last = DataMgr.getPowerTime();
  19090. if (last == 0) {
  19091. last = cur;
  19092. DataMgr.setPowerTime(cur);
  19093. }
  19094. let power = DataMgr.getPower();
  19095. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19096. Laya.timer.clearAll(this);
  19097. if (power >= xGame.common.natureMaxPower) {
  19098. this.ui.powerTimeTxt.text = "";
  19099. DataMgr.setPowerTime(cur);
  19100. return;
  19101. }
  19102. if (power + offset >= xGame.common.natureMaxPower) {
  19103. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19104. this.ui.powerTimeTxt.text = "";
  19105. DataMgr.setPowerTime(cur);
  19106. }
  19107. else {
  19108. if (offset > 0) {
  19109. DataMgr.setPower(offset);
  19110. DataMgr.setPowerTime(cur);
  19111. }
  19112. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19113. this.leftTime = xGame.common.powerRecoverNum - time;
  19114. if (this.leftTime <= 0)
  19115. this.leftTime = 0;
  19116. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19117. Laya.timer.loop(1000, this, this.updatePowerTime);
  19118. }
  19119. }
  19120. updatePowerTime() {
  19121. this.leftTime -= 1;
  19122. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19123. if (this.leftTime <= 0) {
  19124. this.checkPowerTime();
  19125. }
  19126. }
  19127. coinChange() {
  19128. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19129. }
  19130. diamondChange() {
  19131. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19132. }
  19133. addCoin() {
  19134. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19135. Moyu.sendDataEvent("AddCoinBtn");
  19136. xGame.uiMgr.Show(UIAddProp$1, 0);
  19137. }
  19138. addDiamond() {
  19139. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19140. Moyu.sendDataEvent("AddDiamondBtn");
  19141. xGame.uiMgr.Show(UIAddProp$1, 1);
  19142. }
  19143. }
  19144. class SettingNode$1 {
  19145. constructor(ui) {
  19146. this.showSetting = false;
  19147. this.openSound = true;
  19148. this.openShake = true;
  19149. this.ui = ui;
  19150. this.ui.soundBtn.onClick(this, this.switchSound);
  19151. this.ui.shakeBtn.onClick(this, this.switchShake);
  19152. this.ui.xyBtn.onClick(this, this.onXy);
  19153. this.ui.clickNode.onClick(this, this.changeSetting);
  19154. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19155. this.ui.xyBtn.visible = false;
  19156. this.ui.shakeBtn.visible = false;
  19157. }
  19158. changeSetting() {
  19159. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19160. this.showSetting = !this.showSetting;
  19161. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19162. }
  19163. switchSound() {
  19164. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19165. this.openSound = !this.openSound;
  19166. Moyu.onSetting(this.openSound, this.openShake);
  19167. xGame.soundMgr.onSetting(this.openSound);
  19168. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19169. }
  19170. switchShake() {
  19171. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19172. this.openShake = !this.openShake;
  19173. Moyu.onSetting(this.openSound, this.openShake);
  19174. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19175. }
  19176. onXy() {
  19177. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19178. MoyuMgr$1.showXy(1);
  19179. }
  19180. }
  19181. class UIDraw$1 extends UIBase {
  19182. constructor() {
  19183. super();
  19184. this.curKey = 0;
  19185. }
  19186. onConstructor() {
  19187. this.ui = ui_UIDraw.createInstance();
  19188. this.contentPane = this.ui;
  19189. this.isEject = false;
  19190. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19191. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19192. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19193. this.initDraw();
  19194. this.initUI();
  19195. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19196. if (Moyu.isKs)
  19197. this.ui.closeNode.closeBtn.x += 100;
  19198. }
  19199. show() {
  19200. super.show();
  19201. this.ui.t0.play();
  19202. this.playSecretaryIdle();
  19203. this.updateDraw();
  19204. this.checkFree();
  19205. if (PlatMgr.bannerDelay > 0) {
  19206. this.ui.closeNode.closeBtn.visible = false;
  19207. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19208. this.ui.closeNode.closeBtn.visible = true;
  19209. });
  19210. }
  19211. PlatMgr.showRateBanner();
  19212. }
  19213. hide() {
  19214. Laya.timer.clearAll(this);
  19215. super.hide();
  19216. }
  19217. checkFree() {
  19218. let isFree = DataMgr.getDailyfreeDrawTimes();
  19219. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19220. }
  19221. initDraw() {
  19222. this.drawObj = [];
  19223. let data = cfgTable.drawData;
  19224. let temp;
  19225. let weight = 0;
  19226. for (const key in data) {
  19227. temp = data[key];
  19228. weight += temp.weight;
  19229. this.drawObj.push(weight);
  19230. }
  19231. this.allWeight = weight;
  19232. }
  19233. initUI() {
  19234. let data = cfgTable.drawData;
  19235. let temp;
  19236. let img;
  19237. let txt;
  19238. for (const key in data) {
  19239. temp = data[key];
  19240. img = this.ui.myNode.rotNode["img" + key];
  19241. txt = this.ui.myNode.rotNode["txt" + key];
  19242. img.url = xGame.common.getGameIconUrl(temp.icon);
  19243. txt.visible = true;
  19244. if (temp.award > 2) {
  19245. img.rotation = 0;
  19246. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19247. }
  19248. else {
  19249. img.rotation = temp.rotation;
  19250. txt.text = temp.num;
  19251. }
  19252. }
  19253. }
  19254. getCurkey() {
  19255. let rand = Math.random() * this.allWeight;
  19256. let temp;
  19257. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19258. temp = this.drawObj[index];
  19259. if (index == 0) {
  19260. if (rand < temp) {
  19261. return index + 1;
  19262. }
  19263. }
  19264. else {
  19265. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19266. return index + 1;
  19267. }
  19268. }
  19269. }
  19270. return 2;
  19271. }
  19272. startDraw() {
  19273. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19274. if (freeTimes > 0) {
  19275. this.beginDraw();
  19276. DataMgr.setDailyfreeDrawTimes(0);
  19277. this.checkFree();
  19278. }
  19279. else {
  19280. Moyu.sendDataEvent("turntable");
  19281. Moyu.showVideoAd(() => {
  19282. this.beginDraw();
  19283. }, EAdType.draw);
  19284. }
  19285. }
  19286. beginDraw() {
  19287. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19288. this.ui.drawBtn.touchable = false;
  19289. this.curKey = this.getCurkey();
  19290. console.log("当前key", this.curKey);
  19291. let cell = 60;
  19292. let lap = 3;
  19293. let angle = cell * (this.curKey - 1) + lap * 360;
  19294. let target = this.ui.myNode.rotNode;
  19295. target.rotation = 0;
  19296. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19297. console.log("旋转完成");
  19298. this.ui.drawBtn.touchable = true;
  19299. this.getAward();
  19300. }));
  19301. }
  19302. getAward() {
  19303. let data = cfgTable.drawData[this.curKey];
  19304. let temp = new AwardType();
  19305. temp.type = data.award;
  19306. temp.num = data.num;
  19307. xGame.common.getAward([temp], () => {
  19308. DataMgr.setDrawTimes(1);
  19309. this.updateDraw();
  19310. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19311. });
  19312. }
  19313. updateDraw() {
  19314. let drawTimes = DataMgr.getDrawTimes();
  19315. let awardTimes = DataMgr.getDrawAwardTimes();
  19316. if (Math.floor(drawTimes / 3) > awardTimes) {
  19317. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19318. this.ui.extraNode.boxBtn.touchable = true;
  19319. this.ui.extraNode.tipsTxt.text = "3/3";
  19320. this.ui.extraNode.barNode.width = 265;
  19321. this.getExtraAward();
  19322. }
  19323. else {
  19324. this.ui.extraNode.boxBtn.t0.stop();
  19325. this.ui.extraNode.boxBtn.touchable = false;
  19326. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19327. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19328. }
  19329. let data = cfgTable.drawData[1];
  19330. if (awardTimes == 0) {
  19331. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19332. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19333. this.ui.myNode.rotNode.img1.rotation = 0;
  19334. }
  19335. else {
  19336. let award = data.nextid;
  19337. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19338. this.ui.myNode.rotNode.txt1.text = award[1];
  19339. this.ui.myNode.rotNode.img1.rotation = 0;
  19340. }
  19341. }
  19342. getExtraAward() {
  19343. let drawTimes = DataMgr.getDrawTimes();
  19344. let awardTimes = DataMgr.getDrawAwardTimes();
  19345. let data = cfgTable.drawData[1];
  19346. let award = new AwardType();
  19347. if (awardTimes == 0) {
  19348. award.num = data.num;
  19349. award.type = data.award;
  19350. xGame.common.getAward([award], () => {
  19351. let all = Math.floor(drawTimes / 3);
  19352. DataMgr.setDrawAwardTimes(all);
  19353. this.updateDraw();
  19354. });
  19355. }
  19356. else {
  19357. award.num = parseInt(data.nextid[1]);
  19358. award.type = parseInt(data.nextid[0]);
  19359. xGame.common.getAward([award], () => {
  19360. let all = Math.floor(drawTimes / 3);
  19361. DataMgr.setDrawAwardTimes(all);
  19362. this.updateDraw();
  19363. });
  19364. }
  19365. }
  19366. closeSelf() {
  19367. this.hide();
  19368. }
  19369. playSecretaryIdle() {
  19370. let parent = this.ui.secretary.displayObject;
  19371. parent.destroyChildren();
  19372. let xx = this.ui.secretary.width / 2;
  19373. let yy = this.ui.secretary.height;
  19374. let scale = xGame.common.getSecretaryScale();
  19375. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19376. xGame.common.secretary.play(data, 0, true, parent);
  19377. }
  19378. }
  19379. UIDraw$1.uiName = "UIDraw";
  19380. class UIRanking$1 extends UIBase {
  19381. constructor() {
  19382. super();
  19383. this.showSelf = true;
  19384. this.rankType = 1;
  19385. this.rankList = [];
  19386. this.myIndex = 0;
  19387. this.myStar = 0;
  19388. }
  19389. onConstructor() {
  19390. this.ui = ui_UIRanking.createInstance();
  19391. this.contentPane = this.ui;
  19392. this.isEject = false;
  19393. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19394. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19395. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19396. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19397. this.ui.myNode.myList.setVirtual();
  19398. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19399. }
  19400. show() {
  19401. super.show();
  19402. this.myIndex = 51;
  19403. Moyu.getRankList({
  19404. rankId: xGame.common.curRankID,
  19405. type: MoyuRankType.total,
  19406. page: 1,
  19407. pageSize: 50,
  19408. }, this, this.updateItemData);
  19409. this.updateSelf();
  19410. let self = Moyu.getUserInfo();
  19411. if (!self.isAuth) {
  19412. Moyu.initUser(this, () => {
  19413. DataMgr.upRankData();
  19414. });
  19415. }
  19416. }
  19417. updateSelfItem() {
  19418. let self = Moyu.getUserInfo();
  19419. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19420. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19421. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19422. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19423. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19424. }
  19425. updateItemData(data) {
  19426. this.myStar = xGame.common.getAllStarNum();
  19427. if (this.rankList.length < 2) {
  19428. this.rankList = data;
  19429. let self = Moyu.getUserInfo();
  19430. for (let i = 0; i < data.length; i++) {
  19431. let data = this.rankList[i];
  19432. if (data.userId == self.userId) {
  19433. this.rankList.splice(i, 1);
  19434. break;
  19435. }
  19436. }
  19437. for (let i = 0; i < data.length; i++) {
  19438. let data = this.rankList[i];
  19439. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19440. this.myIndex = i + 1;
  19441. let user = { headIcon: self.headIcon, nickName: "myself" };
  19442. let ud = { user: user, data: {} };
  19443. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19444. if (Moyu.platType < 11) {
  19445. user.headIcon = self.headIcon;
  19446. user.nickName = self.nickName;
  19447. }
  19448. this.rankList.splice(i, 0, md);
  19449. break;
  19450. }
  19451. }
  19452. }
  19453. this.updateSelfItem();
  19454. this.ui.myNode.myList.numItems = this.rankList.length;
  19455. }
  19456. updateItemUI(index, obj) {
  19457. let data = this.rankList[index];
  19458. let userData = JSON.parse(data.userData).user;
  19459. obj.nameTxt.text = userData.nickName.toString();
  19460. obj.valueTxt.text = data.rankScore;
  19461. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19462. obj.rankTxt.text = index + 1;
  19463. switch (index) {
  19464. case 0:
  19465. this.setImg(obj, 1, 0, 0);
  19466. obj.rankTxt.color = "#FFC047";
  19467. break;
  19468. case 1:
  19469. this.setImg(obj, 0, 1, 0);
  19470. obj.rankTxt.color = "#ACACAC";
  19471. break;
  19472. case 2:
  19473. this.setImg(obj, 0, 0, 1);
  19474. obj.rankTxt.color = "#D09672";
  19475. break;
  19476. default:
  19477. this.setImg(obj, 0, 0, 0);
  19478. obj.rankTxt.color = "#496FAB";
  19479. break;
  19480. }
  19481. }
  19482. setImg(obj, a, b, c) {
  19483. obj.img1.visible = a ? true : false;
  19484. obj.img2.visible = b ? true : false;
  19485. obj.img3.visible = c ? true : false;
  19486. }
  19487. changeList(type) {
  19488. this.rankType = type;
  19489. this.updateSelf();
  19490. }
  19491. changeSelfNode() {
  19492. this.showSelf = !this.showSelf;
  19493. this.updateSelf();
  19494. }
  19495. updateSelf() {
  19496. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19497. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19498. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19499. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19500. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19501. }
  19502. }
  19503. UIRanking$1.uiName = "UIRanking";
  19504. class UISecretary$1 extends UIBase {
  19505. constructor() {
  19506. super();
  19507. this.curIndex = 1;
  19508. }
  19509. onConstructor() {
  19510. this.ui = ui_UISecretary.createInstance();
  19511. this.contentPane = this.ui;
  19512. this.isEject = false;
  19513. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19514. this.nodeObj = { left: null, right: null, cur: null };
  19515. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19516. }
  19517. show() {
  19518. super.show();
  19519. this.ui.t0.play();
  19520. this.updateData();
  19521. }
  19522. addSecretarySpine(node, spineName) {
  19523. if (spineName == "mishu") {
  19524. if (this.secretarySpine1) {
  19525. node.displayObject.destroyChildren();
  19526. this.playWoman(this.secretarySpine1, node.displayObject);
  19527. }
  19528. else {
  19529. let spine1 = new SpineMgr("mishu", () => {
  19530. this.secretarySpine1 = spine1;
  19531. this.playWoman(this.secretarySpine1, node.displayObject);
  19532. });
  19533. }
  19534. }
  19535. else {
  19536. if (this.secretarySpine2) {
  19537. node.displayObject.destroyChildren();
  19538. this.playWoman(this.secretarySpine2, node.displayObject);
  19539. }
  19540. else {
  19541. let spine2 = new SpineMgr("xiaomishu2", () => {
  19542. this.secretarySpine2 = spine2;
  19543. this.playWoman(this.secretarySpine2, node.displayObject);
  19544. });
  19545. }
  19546. }
  19547. }
  19548. playWoman(node, parent) {
  19549. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19550. let yy = this.ui.myNode.gameNode3.secretary.height;
  19551. let scale = 1.5;
  19552. if (node == this.secretarySpine2) {
  19553. scale = 1.2;
  19554. }
  19555. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19556. node.play(data, 0, true, parent);
  19557. }
  19558. turnLeft() {
  19559. this.curIndex--;
  19560. if (this.curIndex < 1) {
  19561. this.curIndex = 2;
  19562. }
  19563. let left = this.nodeObj.left;
  19564. let right = this.nodeObj.right;
  19565. let cur = this.nodeObj.cur;
  19566. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19567. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19568. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19569. this.updateData();
  19570. }));
  19571. this.ui.myNode.setChildIndex(right, 2);
  19572. this.nodeObj.left = cur;
  19573. this.nodeObj.right = left;
  19574. this.nodeObj.cur = right;
  19575. }
  19576. turnRight() {
  19577. this.curIndex++;
  19578. if (this.curIndex > 2) {
  19579. this.curIndex = 1;
  19580. }
  19581. let left = this.nodeObj.left;
  19582. let right = this.nodeObj.right;
  19583. let cur = this.nodeObj.cur;
  19584. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19585. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19586. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19587. this.updateData();
  19588. }));
  19589. this.ui.myNode.setChildIndex(left, 2);
  19590. this.nodeObj.left = right;
  19591. this.nodeObj.right = cur;
  19592. this.nodeObj.cur = left;
  19593. }
  19594. updateData() {
  19595. let data = cfgTable.secretaryshopData;
  19596. let children = this.ui.myNode._children;
  19597. let temp;
  19598. let curData;
  19599. for (let index = 0; index < children.length; index++) {
  19600. temp = children[index];
  19601. curData = data[1];
  19602. temp.heightTxt.text = curData.height;
  19603. temp.foodTxt.text = curData.food;
  19604. temp.historyTxt.text = curData.history;
  19605. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19606. this.addSecretarySpine(temp.secretary, curData.spine);
  19607. let womanIndex = curData.id - 1;
  19608. let getWoman = DataMgr.getSecretary(womanIndex);
  19609. let curUse = DataMgr.getCurSecretary();
  19610. if (getWoman) {
  19611. if (curUse == womanIndex) {
  19612. temp.purchaseBtn.c1.selectedIndex = 1;
  19613. }
  19614. else {
  19615. temp.purchaseBtn.c1.selectedIndex = 2;
  19616. }
  19617. }
  19618. else {
  19619. temp.purchaseBtn.c1.selectedIndex = 0;
  19620. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19621. }
  19622. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19623. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19624. }
  19625. }
  19626. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19627. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19628. if (getWoman) {
  19629. if (curUse != womanIndex) {
  19630. console.log();
  19631. DataMgr.setCurSecretary(womanIndex);
  19632. this.updateData();
  19633. }
  19634. }
  19635. else {
  19636. let need = needDiamond;
  19637. if (DataMgr.diamondEnough(need)) {
  19638. DataMgr.setDiamond(-need);
  19639. DataMgr.setSecretary(womanIndex, 1);
  19640. DataMgr.setCurSecretary(womanIndex);
  19641. this.updateData();
  19642. }
  19643. else {
  19644. xGame.uiMgr.Show(UIAddProp$1, 1);
  19645. }
  19646. }
  19647. }
  19648. closeSelf() {
  19649. this.hide();
  19650. }
  19651. }
  19652. UISecretary$1.uiName = "UISecretary";
  19653. class BallRodDisplay$1 {
  19654. constructor(ui, index) {
  19655. this.index = 0;
  19656. this.uiIndex = 0;
  19657. this.ui = ui;
  19658. this.index = index;
  19659. this.initData();
  19660. }
  19661. initData() {
  19662. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19663. let data = cfgTable.ballrodData[this.index + 1];
  19664. this.ui.nameTxt.text = data.name;
  19665. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19666. this.ui.levelNode.c1.selectedIndex = data.quality;
  19667. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19668. if (data.spine) {
  19669. this.mySpine = new SpineMgr(data.spine, () => {
  19670. let xx = 150;
  19671. let yy = 70;
  19672. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19673. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19674. });
  19675. }
  19676. }
  19677. updateSelf() {
  19678. let get = DataMgr.getBallRod(this.index);
  19679. if (get == null)
  19680. get = 1;
  19681. let curUse = DataMgr.getCurBallRod();
  19682. if (get) {
  19683. if (curUse == this.index) {
  19684. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19685. }
  19686. else {
  19687. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19688. }
  19689. }
  19690. else {
  19691. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19692. }
  19693. }
  19694. buyBallRod() {
  19695. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19696. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19697. switch (selectedIndex) {
  19698. case 0:
  19699. break;
  19700. case 1:
  19701. DataMgr.setCurBallRod(this.index);
  19702. let ui = xGame.uiMgr.getUI(UIShop$1);
  19703. ui.updateBallRod();
  19704. break;
  19705. case 2:
  19706. let data = cfgTable.ballrodData[this.index + 1];
  19707. let need = data.price;
  19708. if (DataMgr.diamondEnough(need)) {
  19709. DataMgr.setDiamond(-need);
  19710. DataMgr.setBallRod(this.index, 1);
  19711. DataMgr.setCurBallRod(this.index);
  19712. let ui = xGame.uiMgr.getUI(UIShop$1);
  19713. ui.updateBallRod();
  19714. }
  19715. else {
  19716. xGame.uiMgr.Show(UIAddProp$1, 1);
  19717. }
  19718. break;
  19719. default:
  19720. break;
  19721. }
  19722. }
  19723. }
  19724. class UIShop$1 extends UIBase {
  19725. constructor() {
  19726. super();
  19727. this.itemNums = 0;
  19728. }
  19729. onConstructor() {
  19730. this.ui = ui_UIShop.createInstance();
  19731. this.contentPane = this.ui;
  19732. this.isEject = false;
  19733. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19734. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19735. this.addUIClick(this.ui, this.interuptSecretary);
  19736. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19737. this.ballRodArr = [];
  19738. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19739. this.ui.myNode.myList.numItems = this.itemNums;
  19740. if (Moyu.isKs)
  19741. this.ui.closeNode.closeBtn.x += 100;
  19742. }
  19743. show() {
  19744. super.show();
  19745. this.playSecretaryIdle();
  19746. this.updateBallRod();
  19747. }
  19748. updateBallRod() {
  19749. for (let index = 0; index < this.ballRodArr.length; index++) {
  19750. this.ballRodArr[index].updateSelf();
  19751. }
  19752. }
  19753. renderBallRod(sort, obj) {
  19754. let index = this.getIndexBySort(sort + 1) - 1;
  19755. let ballRod = new BallRodDisplay$1(obj, index);
  19756. this.ballRodArr.push(ballRod);
  19757. }
  19758. getIndexBySort(sort) {
  19759. let object = cfgTable.ballrodData;
  19760. for (const key in object) {
  19761. if (object[key].sort == sort) {
  19762. return parseInt(key);
  19763. }
  19764. }
  19765. }
  19766. playSecretaryIdle() {
  19767. let parent = this.ui.secretary.displayObject;
  19768. parent.destroyChildren();
  19769. let xx = this.ui.secretary.width / 2;
  19770. let yy = this.ui.secretary.height;
  19771. let scale = xGame.common.getSecretaryScale();
  19772. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19773. xGame.common.secretary.play(data, 0, true, parent);
  19774. }
  19775. interuptSecretary() {
  19776. Laya.timer.clearAll(this);
  19777. this.playSecretaryRandomSound();
  19778. }
  19779. playSecretaryRandomSound() {
  19780. if (this.isHide)
  19781. return;
  19782. let time = xGame.common.randomNum(45000, 60000);
  19783. Laya.timer.once(time, this, () => {
  19784. if (this.isHide)
  19785. return;
  19786. let index = xGame.common.randomNum(4, 7);
  19787. xGame.soundMgr.playSound("s_main0" + index);
  19788. let words = 1;
  19789. switch (index) {
  19790. case 4:
  19791. words = 5;
  19792. break;
  19793. case 5:
  19794. words = 3;
  19795. break;
  19796. case 6:
  19797. words = 6;
  19798. break;
  19799. case 7:
  19800. words = 7;
  19801. break;
  19802. default:
  19803. break;
  19804. }
  19805. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19806. this.playSecretaryRandomSound();
  19807. });
  19808. }
  19809. closeSelf() {
  19810. this.hide();
  19811. }
  19812. }
  19813. UIShop$1.uiName = "UIShop";
  19814. class SignMax$1 {
  19815. constructor(ui) {
  19816. this.ui = ui;
  19817. }
  19818. updateSelf(index, sameDay, curDayIndex) {
  19819. let data = cfgTable.signData[index + 1];
  19820. this.ui.titleTxt.text = data.title;
  19821. let arr1 = data.award[0].split('-');
  19822. let arr2 = data.award[1].split('-');
  19823. let num1 = parseInt(arr1[1]);
  19824. let num2 = parseInt(arr2[1]);
  19825. this.ui.numTxt1.text = num1 + "";
  19826. this.ui.numTxt2.text = num2 + "";
  19827. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19828. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19829. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19830. this.ui.numTxt1.visible = false;
  19831. }
  19832. else {
  19833. this.ui.numTxt1.visible = true;
  19834. }
  19835. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19836. this.ui.numTxt2.visible = false;
  19837. }
  19838. else {
  19839. this.ui.numTxt2.visible = true;
  19840. }
  19841. if (index < curDayIndex) {
  19842. this.ui.c1.selectedIndex = 1;
  19843. }
  19844. else if (index == curDayIndex) {
  19845. if (sameDay) {
  19846. this.ui.c1.selectedIndex = 2;
  19847. }
  19848. else {
  19849. this.ui.c1.selectedIndex = 2;
  19850. }
  19851. }
  19852. else {
  19853. this.ui.c1.selectedIndex = 0;
  19854. }
  19855. }
  19856. }
  19857. class SignNormal$1 {
  19858. constructor(ui) {
  19859. this.ui = ui;
  19860. }
  19861. updateSelf(index, sameDay, curDayIndex) {
  19862. let data = cfgTable.signData[index + 1];
  19863. this.ui.titleTxt.text = data.title;
  19864. let arr = data.award[0].split('-');
  19865. let type = parseInt(arr[0]);
  19866. let num = parseInt(arr[1]);
  19867. this.ui.numTxt.text = num + "";
  19868. if (type > 2) {
  19869. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19870. this.ui.myIcon.rotation = 0;
  19871. }
  19872. else {
  19873. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19874. this.ui.myIcon.rotation = 0;
  19875. }
  19876. if (xGame.common.signAwardContainsRod(data.award)) {
  19877. this.ui.numTxt.visible = false;
  19878. }
  19879. else {
  19880. this.ui.numTxt.visible = true;
  19881. }
  19882. if (index < curDayIndex) {
  19883. this.ui.c1.selectedIndex = 1;
  19884. }
  19885. else if (index == curDayIndex) {
  19886. if (sameDay) {
  19887. this.ui.c1.selectedIndex = 2;
  19888. }
  19889. else {
  19890. this.ui.c1.selectedIndex = 2;
  19891. }
  19892. }
  19893. else {
  19894. this.ui.c1.selectedIndex = 0;
  19895. }
  19896. }
  19897. }
  19898. class UISign$1 extends UIBase {
  19899. constructor() {
  19900. super();
  19901. this.curDayIndex = 0;
  19902. this.starX = 0;
  19903. }
  19904. onConstructor() {
  19905. this.ui = ui_UISign.createInstance();
  19906. this.contentPane = this.ui;
  19907. this.isEject = false;
  19908. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19909. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19910. this.initSignItem();
  19911. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19912. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19913. }
  19914. show() {
  19915. super.show();
  19916. this.ui.t0.play();
  19917. this.playSecretaryIdle();
  19918. this.updateSign();
  19919. }
  19920. initSignItem() {
  19921. this.signArr = [];
  19922. for (let index = 0; index < 6; index++) {
  19923. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19924. this.signArr.push(temp);
  19925. }
  19926. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19927. if (Moyu.isKs)
  19928. this.ui.closeNode.closeBtn.x += 100;
  19929. }
  19930. updateSign() {
  19931. let sameDay = xGame.common.judgeSameDay();
  19932. let max = 7;
  19933. this.curDayIndex = DataMgr.getSignData();
  19934. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19935. this.curDayIndex = 0;
  19936. if (!sameDay) {
  19937. this.ui.normalBtn.visible = true;
  19938. this.ui.tipsNode.visible = false;
  19939. this.ui.againBtn.visible = false;
  19940. }
  19941. else {
  19942. this.ui.normalBtn.visible = false;
  19943. let again = DataMgr.getExtraSign();
  19944. let isCurrency = false;
  19945. let index = this.curDayIndex;
  19946. if (index == 0)
  19947. index = 7;
  19948. let award = cfgTable.signData[index].award;
  19949. let num = award[0].split("-")[0];
  19950. if (num == "1" || num == "2")
  19951. isCurrency = true;
  19952. let showAgain = again == 0 && isCurrency;
  19953. this.ui.againBtn.visible = showAgain;
  19954. this.ui.tipsNode.visible = !showAgain;
  19955. }
  19956. for (let index = 0; index < this.signArr.length; index++) {
  19957. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  19958. }
  19959. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  19960. }
  19961. playSecretaryIdle() {
  19962. let parent = this.ui.secretary.displayObject;
  19963. parent.destroyChildren();
  19964. let xx = this.ui.secretary.width / 2;
  19965. let yy = this.ui.secretary.height;
  19966. let scale = xGame.common.getSecretaryScale();
  19967. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19968. xGame.common.secretary.play(data, 0, true, parent);
  19969. }
  19970. closeSelf() {
  19971. this.hide();
  19972. }
  19973. normalGetAward() {
  19974. let sameDay = xGame.common.judgeSameDay();
  19975. if (!sameDay) {
  19976. let award = cfgTable.signData[this.curDayIndex + 1].award;
  19977. let temp;
  19978. let type;
  19979. let num;
  19980. let arr = [];
  19981. for (let index = 0; index < award.length; index++) {
  19982. temp = award[index].split("-");
  19983. type = parseInt(temp[0]);
  19984. num = parseInt(temp[1]);
  19985. let awardType = new AwardType();
  19986. awardType.num = num;
  19987. awardType.type = type;
  19988. arr.push(awardType);
  19989. }
  19990. xGame.common.getAward(arr, (watchVideo) => {
  19991. this.curDayIndex++;
  19992. if (this.curDayIndex > 7)
  19993. this.curDayIndex = 0;
  19994. DataMgr.setSignData(this.curDayIndex);
  19995. DataMgr.setSignTime(new Date().getTime());
  19996. if (watchVideo) {
  19997. DataMgr.setExtraSign(1);
  19998. Moyu.sendDataEvent("signIn1");
  19999. }
  20000. this.updateSign();
  20001. });
  20002. }
  20003. }
  20004. againGetAward() {
  20005. Moyu.sendDataEvent("signIn2");
  20006. Moyu.showVideoAd(() => {
  20007. let index = this.curDayIndex;
  20008. if (index == 0)
  20009. index = 7;
  20010. let award = cfgTable.signData[index].award;
  20011. let temp;
  20012. let type;
  20013. let num;
  20014. for (let index = 0; index < award.length; index++) {
  20015. temp = award[index].split("-");
  20016. type = parseInt(temp[0]);
  20017. num = parseInt(temp[1]) * 3;
  20018. xGame.common.playObjFlyAnim(num, type);
  20019. }
  20020. DataMgr.setExtraSign(1);
  20021. this.updateSign();
  20022. }, EAdType.againSign);
  20023. }
  20024. }
  20025. UISign$1.uiName = "UISign";
  20026. class UIModeSelection$1 extends UIBase {
  20027. constructor() {
  20028. super();
  20029. }
  20030. onConstructor() {
  20031. this.ui = ui_UIModeSelection.createInstance();
  20032. this.contentPane = this.ui;
  20033. this.isEject = false;
  20034. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20035. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20036. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20037. this.addUIClick(this.ui.closeBtn, this.hide);
  20038. this.peopleArr = [650, 6900, 3800];
  20039. this.peopleOffest = [50, 500, 200];
  20040. this.updateSelf();
  20041. }
  20042. show(callback) {
  20043. super.show();
  20044. this.ui.t0.play();
  20045. this.callback = callback;
  20046. }
  20047. updateSelf() {
  20048. let cfg = cfgTable.modeselectData;
  20049. for (let index = 1; index <= 3; index++) {
  20050. let node = this.ui.myNode["type" + index];
  20051. node.need.text = cfg[index].need;
  20052. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20053. node.peopleTxt.text = this.getRandPeople(index - 1);
  20054. }
  20055. }
  20056. enterGame(type) {
  20057. xGame.common.classicRoomType = type;
  20058. let cfg = cfgTable.modeselectData[type];
  20059. let need = cfg.need;
  20060. xGame.common.passAwardCoin = cfg.award;
  20061. if (DataMgr.coinEnough(need)) {
  20062. DataMgr.setCoin(-need);
  20063. this.ui.myNode["type" + type].t0.play();
  20064. Laya.timer.once(200, this, () => {
  20065. this.callback && this.callback();
  20066. });
  20067. }
  20068. else {
  20069. Moyu.sendDataEvent("AddCoinVideo");
  20070. xGame.uiMgr.Show(UIAddProp$1, 0);
  20071. }
  20072. }
  20073. getRandPeople(index) {
  20074. let rand = this.peopleOffest[index];
  20075. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20076. }
  20077. }
  20078. UIModeSelection$1.uiName = "UIModeSelection";
  20079. class UIMain$1 extends UIBase {
  20080. constructor() {
  20081. super();
  20082. this.firstEnter = true;
  20083. }
  20084. onConstructor() {
  20085. this.ui = ui_UIMain.createInstance();
  20086. this.contentPane = this.ui;
  20087. this.isEject = false;
  20088. this.addEvent();
  20089. this.addClickSpine();
  20090. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20091. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20092. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20093. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20094. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20095. let curUse = DataMgr.getCurSecretary();
  20096. this.changeSecretary(curUse);
  20097. this.ui.talkNode.visible = false;
  20098. let guide = DataMgr.getSkillGuide();
  20099. if (xGame.common.isNewDay && guide == 1) {
  20100. xGame.common.isNewDay = false;
  20101. xGame.soundMgr.playSound("s_main01");
  20102. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20103. console.log("播放小秘书每天语音");
  20104. }
  20105. this.onGetUserInfo();
  20106. this.ui.n83.visible = false;
  20107. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20108. }
  20109. changeSecretary(curUse) {
  20110. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20111. xGame.common.secretary && xGame.common.secretary.dispose();
  20112. this.addSecretarySpine(name);
  20113. }
  20114. addSecretarySpine(name) {
  20115. let spine = new SpineMgr(name, () => {
  20116. this.playSecretaryIdle();
  20117. });
  20118. xGame.common.secretary = spine;
  20119. }
  20120. addClickSpine() {
  20121. let clickSpine = new SpineMgr("dianji", () => {
  20122. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20123. let parent = Laya.stage;
  20124. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20125. clickSpine.play(data, 0, false, parent, (spine) => {
  20126. spine.destroy(true);
  20127. });
  20128. });
  20129. });
  20130. }
  20131. addEvent() {
  20132. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20133. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20134. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20135. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20136. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20137. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20138. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20139. this.addUIClick(this.ui, this.interuptSecretary);
  20140. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20141. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20142. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20143. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20144. this.addUIClick(this.ui.signBtn, this.openSignView);
  20145. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20146. }
  20147. show(showFailWords) {
  20148. super.show();
  20149. this.moneyNode.ui.c1.selectedIndex = 1;
  20150. this.playSecretaryIdle();
  20151. xGame.soundMgr.playMusic("caromhall01");
  20152. Laya.timer.clearAll(this);
  20153. this.playSecretaryRandomSound();
  20154. if (showFailWords) {
  20155. setTimeout(() => {
  20156. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20157. let words = -1;
  20158. if (str == "s_main02") {
  20159. words = 2;
  20160. }
  20161. else {
  20162. words = 3;
  20163. }
  20164. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20165. xGame.soundMgr.playSound(str);
  20166. }, 300);
  20167. }
  20168. this.showGuide();
  20169. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20170. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20171. let guide = DataMgr.getSkillGuide();
  20172. if (guide == 1) {
  20173. let randTime = xGame.common.randomNum(300, 800);
  20174. if (this.firstEnter) {
  20175. this.firstEnter = false;
  20176. randTime += 900;
  20177. }
  20178. Laya.timer.once(randTime, this, () => {
  20179. xGame.common.autoPopUIView();
  20180. });
  20181. }
  20182. }
  20183. checkActive(show) {
  20184. }
  20185. showGuide() {
  20186. let guide = DataMgr.getSkillGuide();
  20187. this.ui.guideBtn.visible = guide == 0;
  20188. this.ui.enterGuide.visible = false;
  20189. this.ui.secretaryGuide.visible = guide == 0;
  20190. if (guide == 0) {
  20191. xGame.soundMgr.playSound("s_guide");
  20192. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20193. }
  20194. }
  20195. ensureSecretary() {
  20196. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20197. this.ui.secretaryGuide.visible = false;
  20198. this.ui.enterGuide.visible = true;
  20199. this.ui.wordsNode.t0.play();
  20200. if (DataMgr.getNewUser())
  20201. Moyu.sendDataEvent("gameReady");
  20202. }
  20203. playSecretaryIdle() {
  20204. let parent = this.ui.secretary.displayObject;
  20205. parent.destroyChildren();
  20206. let xx = this.ui.secretary.width / 2;
  20207. let yy = this.ui.secretary.height;
  20208. let scale = xGame.common.getSecretaryScale();
  20209. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20210. console.log("zh:playSecretaryIdle", data);
  20211. xGame.common.secretary.play(data, 0, true, parent);
  20212. }
  20213. startGame(type) {
  20214. xGame.common.gameMode = type;
  20215. Moyu.sendDataEvent("PlayGame", { type: type });
  20216. switch (xGame.common.gameMode) {
  20217. case GameMode.classic:
  20218. let challengeTimes = DataMgr.getChallengeTimes();
  20219. if (challengeTimes == 0) {
  20220. xGame.uiMgr.Show(UIInvitation$1);
  20221. }
  20222. else {
  20223. this.beginGame();
  20224. }
  20225. break;
  20226. case GameMode.bigMove:
  20227. this.beginGame();
  20228. if (DataMgr.getNewUser())
  20229. Moyu.sendDataEvent("gameStart0");
  20230. break;
  20231. default:
  20232. break;
  20233. }
  20234. }
  20235. beginGame(isNice = false) {
  20236. if (xGame.common.gameMode == GameMode.classic) {
  20237. if (isNice) {
  20238. this.enterClassic();
  20239. }
  20240. else {
  20241. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20242. this.enterClassic();
  20243. });
  20244. }
  20245. }
  20246. else if (xGame.common.gameMode == GameMode.bigMove) {
  20247. this.ui.enterGuide.visible = false;
  20248. xGame.uiMgr.Show(UISkill$1);
  20249. }
  20250. }
  20251. enterClassic() {
  20252. xGame.uiMgr.Show(UIGame$1);
  20253. xGame.uiMgr.Show(UIMatching$1, () => {
  20254. if (!this.isHide)
  20255. this.hide();
  20256. xGame.common.gameUI.ui.alpha = 1;
  20257. xGame.common.gameUI.startGame();
  20258. xGame.uiMgr.Hide(UIGameEnd$1);
  20259. });
  20260. }
  20261. startGlobal() {
  20262. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20263. }
  20264. startWeekly() {
  20265. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20266. }
  20267. startPlaceBall() {
  20268. xGame.uiMgr.Show(UILevelDisplay$1);
  20269. }
  20270. hide() {
  20271. super.hide();
  20272. xGame.common.stopGirlPop(this.ui.talkNode);
  20273. }
  20274. onGetUserInfo(force = false) {
  20275. if (Moyu.isWx) {
  20276. let info = Moyu.getSystemInfo();
  20277. if (info)
  20278. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20279. }
  20280. else {
  20281. Moyu.initUser(this, this.freshUser, force);
  20282. }
  20283. if (!Moyu.hasUserInfo) {
  20284. let user = Moyu.getUserInfo();
  20285. user.headIcon = 'res/ty_touxiang.png';
  20286. }
  20287. this.freshUser();
  20288. }
  20289. freshUser() {
  20290. let user = Moyu.getUserInfo();
  20291. if (!user.isAuth) {
  20292. user.headIcon = 'res/ty_touxiang.png';
  20293. }
  20294. else
  20295. DataMgr.upRankData();
  20296. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20297. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20298. }
  20299. interuptSecretary() {
  20300. Laya.timer.clearAll(this);
  20301. this.playSecretaryRandomSound();
  20302. }
  20303. playSecretaryRandomSound() {
  20304. if (this.isHide)
  20305. return;
  20306. let time = xGame.common.randomNum(45000, 60000);
  20307. Laya.timer.once(time, this, () => {
  20308. if (this.isHide)
  20309. return;
  20310. let index = xGame.common.randomNum(4, 7);
  20311. xGame.soundMgr.playSound("s_main0" + index);
  20312. let words = 1;
  20313. switch (index) {
  20314. case 4:
  20315. words = 5;
  20316. break;
  20317. case 5:
  20318. words = 3;
  20319. break;
  20320. case 6:
  20321. words = 6;
  20322. break;
  20323. case 7:
  20324. words = 7;
  20325. break;
  20326. default:
  20327. break;
  20328. }
  20329. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20330. this.playSecretaryRandomSound();
  20331. });
  20332. }
  20333. openSecretaryView() {
  20334. xGame.uiMgr.Show(UISecretary$1);
  20335. Moyu.sendDataEvent("secretary");
  20336. }
  20337. openShopView() {
  20338. xGame.uiMgr.Show(UIShop$1);
  20339. }
  20340. openSignView() {
  20341. xGame.uiMgr.Show(UISign$1);
  20342. }
  20343. openDrawView() {
  20344. xGame.uiMgr.Show(UIDraw$1);
  20345. }
  20346. openRanking() {
  20347. xGame.uiMgr.Show(UIRanking$1);
  20348. Moyu.sendDataEvent("rankingList");
  20349. }
  20350. }
  20351. UIMain$1.uiName = "UIMain";
  20352. function InitShader() {
  20353. }
  20354. function appInit() {
  20355. xGame.context.init(getLoadingResList(), initCallback);
  20356. }
  20357. function getLoadingResList() {
  20358. return [
  20359. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20360. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20361. ];
  20362. }
  20363. function getGameResList() {
  20364. return [
  20365. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20366. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20367. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20368. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20369. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20370. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20371. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20372. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20373. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20374. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20375. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20376. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20377. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20378. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20379. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20380. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20381. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20382. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20383. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20384. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20385. ];
  20386. }
  20387. function initCallback() {
  20388. window["DataMgr"] = DataMgr;
  20389. DataMgr.Init();
  20390. Moyu.init(getPlat(), this, () => {
  20391. DataMgr.isNewDay();
  20392. PlatMgr.initConfig();
  20393. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20394. }, true);
  20395. console.log('zh:开始sm init1 start');
  20396. xGame.soundMgr.init();
  20397. console.log('zh:开始sm init1 end');
  20398. xGame.uiMgr.init();
  20399. xGame.uiMgr.bindFUI(fguiRes.loading);
  20400. xGame.uiMgr.Show(UILoading);
  20401. }
  20402. function loadSubRes(callback) {
  20403. var tab = ["asset", "res", "spine"];
  20404. let subDone = 0;
  20405. for (var i = 0; i < tab.length; i++) {
  20406. let sub = tab[i];
  20407. Moyu.loadSubRes(sub, (pro) => {
  20408. callback && callback(pro, false);
  20409. }).then(() => {
  20410. subDone++;
  20411. if (subDone >= tab.length)
  20412. callback && callback(1, true);
  20413. });
  20414. }
  20415. }
  20416. function enterGame() {
  20417. xGame.cfgMgr.init();
  20418. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20419. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20420. xGame.uiMgr.Hide(UILoading);
  20421. fgui.UIPackage.removePackage(fguiRes.loading);
  20422. xGame.uiMgr.bindFUI(fguiRes.game);
  20423. xGame.uiMgr.Show(UIMain$1);
  20424. if (DataMgr.getNewUser())
  20425. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20426. }
  20427. function getPlat() {
  20428. let cfg = new MoyuCfg();
  20429. cfg.plat = MoyuPlat.web;
  20430. cfg.myId = 120;
  20431. cfg.myKey = '8848a885774230a4';
  20432. cfg.version = 0;
  20433. if (window.hasOwnProperty("gamebox")) {
  20434. cfg.plat = MoyuPlat.f399;
  20435. cfg.version = 0;
  20436. }
  20437. else if (window.hasOwnProperty("ks")) {
  20438. cfg.plat = MoyuPlat.ks;
  20439. cfg.version = 0;
  20440. cfg.ads.ksVideoId = '2300002254_01';
  20441. cfg.ads.ksInsertId = '2300002254_02';
  20442. }
  20443. else if (Laya.Browser.onTTMiniGame) {
  20444. cfg.plat = MoyuPlat.tt;
  20445. cfg.version = 0;
  20446. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20447. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20448. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20449. }
  20450. else if (Laya.Browser.onMiniGame) {
  20451. cfg.plat = MoyuPlat.wx;
  20452. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20453. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20454. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20455. }
  20456. else if (Laya.Browser.onQQMiniGame) {
  20457. cfg.plat = MoyuPlat.qq;
  20458. }
  20459. else if (Laya.Browser.onQGMiniGame) {
  20460. cfg.plat = MoyuPlat.op;
  20461. cfg.ads.opVideoId = '455502';
  20462. cfg.ads.opBannerId = '455507';
  20463. }
  20464. else if (Laya.Browser.onVVMiniGame) {
  20465. cfg.plat = MoyuPlat.vv;
  20466. cfg.version = 0;
  20467. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20468. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20469. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20470. }
  20471. else if (Laya.Browser.onHWMiniGame) {
  20472. cfg.plat = MoyuPlat.hw;
  20473. }
  20474. else if (window["mz"]) {
  20475. cfg.plat = MoyuPlat.mz;
  20476. }
  20477. else {
  20478. let cfg = window['conchConfig'];
  20479. if (cfg) {
  20480. var os = cfg.getOS();
  20481. if (os == "Conch-ios") {
  20482. cfg.plat = MoyuPlat.ios;
  20483. }
  20484. else if (os == "Conch-android") {
  20485. }
  20486. }
  20487. }
  20488. return cfg;
  20489. }
  20490. class Main {
  20491. constructor() {
  20492. if (window["Laya3D"])
  20493. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20494. else {
  20495. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20496. this.initMain();
  20497. }
  20498. }
  20499. initMain() {
  20500. Laya["Physics"] && Laya["Physics"].enable();
  20501. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20502. Laya.stage.scaleMode = GameConfig.scaleMode;
  20503. Laya.stage.screenMode = GameConfig.screenMode;
  20504. Laya.stage.alignV = GameConfig.alignV;
  20505. Laya.stage.alignH = GameConfig.alignH;
  20506. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20507. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20508. Laya.enableDebugPanel();
  20509. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20510. Laya["PhysicsDebugDraw"].enable();
  20511. if (GameConfig.stat)
  20512. Laya.Stat.show();
  20513. Laya.alertGlobalError(true);
  20514. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20515. }
  20516. onVersionLoaded() {
  20517. appInit();
  20518. }
  20519. }
  20520. new Main();
  20521. }());
  20522. //# sourceMappingURL=bundle.js.map