bundle.js 800 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976
  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("试用成功");
  1217. this.hide();
  1218. }, EAdType.try);
  1219. }
  1220. onCancel() {
  1221. if (this.closeNum > 0) {
  1222. this.closeNum--;
  1223. if (this.closeNum < 2)
  1224. this.hide();
  1225. return;
  1226. }
  1227. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1228. this.onTry();
  1229. }
  1230. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1231. this.closeNum = 3;
  1232. }
  1233. else
  1234. this.hide();
  1235. }
  1236. }
  1237. UITry.uiName = "UITry";
  1238. class PlatMgr {
  1239. static initConfig() {
  1240. this.lastVt = 0;
  1241. if (!Moyu.platConfig)
  1242. return;
  1243. for (let k in Moyu.platConfig) {
  1244. let pd = this[k];
  1245. let pc = Moyu.platConfig[k];
  1246. if (pd != undefined && pc != undefined)
  1247. this[k] = pc;
  1248. }
  1249. Moyu.setBannerPos(0.5, 1);
  1250. }
  1251. static rand100(num) {
  1252. return xGame.tools.random(0, 100) < num;
  1253. }
  1254. static isMisVideo() {
  1255. let dt = Laya.timer.currTimer - this.lastVt;
  1256. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1257. this.lastVt = Laya.timer.currTimer;
  1258. return true;
  1259. }
  1260. else {
  1261. if (this.rand100(this.fullVideoRate))
  1262. Moyu.showInsertAd(0, 0, 'full');
  1263. return false;
  1264. }
  1265. }
  1266. static showVideo(call, type) {
  1267. Moyu.showVideoAd(() => {
  1268. this.lastVt = Laya.timer.currTimer;
  1269. call && call();
  1270. }, type);
  1271. }
  1272. static showInsert(delay = false) {
  1273. if (this.getRand() < this.insertRate) {
  1274. let dt = delay ? this.insertDelay : 0;
  1275. Moyu.showInsertAd(dt, this.insertGap);
  1276. }
  1277. }
  1278. static gameInsert() {
  1279. if (this.getRand() < this.gameInsertRate) {
  1280. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1281. }
  1282. }
  1283. static showRateBanner() {
  1284. if (this.getRand() < this.bannerRate)
  1285. this.showBanner(true, this.bannerDelay, 3000);
  1286. }
  1287. static showBanner(show, delay = 0, hide = 0) {
  1288. if (!show)
  1289. Moyu.showBannerAd(false);
  1290. else {
  1291. Laya.timer.clear(this, this.bannerShow);
  1292. if (delay > 0)
  1293. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1294. else
  1295. this.bannerShow(true);
  1296. if (hide > 0)
  1297. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1298. }
  1299. }
  1300. static bannerShow(show) {
  1301. Moyu.showBannerAd(show);
  1302. console.log("showBanner" + show);
  1303. }
  1304. static getRand() {
  1305. return xGame.tools.random(0, 100);
  1306. }
  1307. static openBox() {
  1308. if (this.getRand() < this.boxRate)
  1309. xGame.uiMgr.Show(UIBox);
  1310. }
  1311. static openTry() {
  1312. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1313. return;
  1314. if (this.getRand() < this.tryRate)
  1315. xGame.uiMgr.Show(UITry);
  1316. else if (DataMgr.gameData.gameCount == 1)
  1317. xGame.uiMgr.Show(UITry);
  1318. }
  1319. }
  1320. PlatMgr.forceShare = 0;
  1321. PlatMgr.signAdRate = 0;
  1322. PlatMgr.forceVideoRate = 0;
  1323. PlatMgr.forceVideoGap = 0;
  1324. PlatMgr.fullVideoRate = 0;
  1325. PlatMgr.gameInsertRate = 0;
  1326. PlatMgr.insertGap = 0;
  1327. PlatMgr.insertDelay = 0;
  1328. PlatMgr.insertRate = 0;
  1329. PlatMgr.boxRate = 0;
  1330. PlatMgr.boxVideoRate = 0;
  1331. PlatMgr.boxInsertRate = 0;
  1332. PlatMgr.boxBannerRate = 0;
  1333. PlatMgr.tryRate = 0;
  1334. PlatMgr.tryClose3Rate = 0;
  1335. PlatMgr.tryVideoRate = 0;
  1336. PlatMgr.bannerRate = 0;
  1337. PlatMgr.lastVt = 0;
  1338. class ui_UIAddProp extends fgui.GComponent {
  1339. static createInstance() {
  1340. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1341. }
  1342. onConstruct() {
  1343. this.n11 = (this.getChild("n11"));
  1344. this.myNode = (this.getChild("myNode"));
  1345. this.closeBtn = (this.getChild("closeBtn"));
  1346. this.t0 = this.getTransition("t0");
  1347. }
  1348. }
  1349. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1350. class SpineMgr {
  1351. constructor(name, loadCb = null) {
  1352. this.loaded = false;
  1353. this.spineName = '';
  1354. this.loadedCallback = loadCb;
  1355. this.templet = new Laya.Templet();
  1356. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1357. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1358. this.templet.loadAni(`spine/${name}.sk`);
  1359. this.templet.lock = true;
  1360. this.spineName = name;
  1361. }
  1362. onError() {
  1363. console.log("spine加载出错");
  1364. }
  1365. parseComplete() {
  1366. this.loaded = true;
  1367. this.loadedCallback && this.loadedCallback();
  1368. }
  1369. dispose() {
  1370. if (this.templet && !this.templet.destroyed) {
  1371. this.templet.destroy();
  1372. }
  1373. this.templet = null;
  1374. }
  1375. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1376. if (!this.loaded) {
  1377. return;
  1378. }
  1379. let spine;
  1380. if (mySpine) {
  1381. spine = mySpine;
  1382. }
  1383. else {
  1384. spine = this.createSpine(data, parent);
  1385. }
  1386. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1387. if (!isLoop) {
  1388. spine.on(Laya.Event.STOPPED, this, () => {
  1389. spine.offAll(Laya.Event.STOPPED);
  1390. callback && callback(spine);
  1391. });
  1392. }
  1393. return spine;
  1394. }
  1395. createSpine(data, parent, type = 1) {
  1396. let spine;
  1397. spine = this.templet.buildArmature(type);
  1398. spine.showSkinByIndex(0);
  1399. parent.addChild(spine);
  1400. spine.pos(data.x, data.y);
  1401. spine.scale(data.scaleX, data.scaleY, true);
  1402. return spine;
  1403. }
  1404. }
  1405. var AIState;
  1406. (function (AIState) {
  1407. AIState[AIState["none"] = 0] = "none";
  1408. AIState[AIState["idle"] = 1] = "idle";
  1409. AIState[AIState["reset"] = 2] = "reset";
  1410. AIState[AIState["move"] = 3] = "move";
  1411. AIState[AIState["wait"] = 4] = "wait";
  1412. AIState[AIState["select"] = 5] = "select";
  1413. AIState[AIState["turn"] = 6] = "turn";
  1414. AIState[AIState["shoot"] = 7] = "shoot";
  1415. AIState[AIState["leave"] = 8] = "leave";
  1416. })(AIState || (AIState = {}));
  1417. class AIPlayer {
  1418. constructor() {
  1419. this.dtime = 30;
  1420. this.awayTime = 0;
  1421. this.awayNum = 0;
  1422. this.hideTime = 0;
  1423. this.rootMoveTime = 0;
  1424. this.isGuide = false;
  1425. this.state = AIState.none;
  1426. this.waitTime = 0;
  1427. this.forceNum = 0;
  1428. this.forceMax = 0;
  1429. this.ballSize = 33;
  1430. this.selectNum = 0;
  1431. this.destRot = 0;
  1432. this.aiLv = 10;
  1433. this.kickBall = [];
  1434. this.lineBall = [];
  1435. this.scoreBall = [];
  1436. this.holeBall = [];
  1437. this.turnNum = 0;
  1438. this.setNum = 0;
  1439. this.setMax = 0;
  1440. this.setRate = 0;
  1441. this.rectL = 0;
  1442. this.rectR = 0;
  1443. this.rectT = 0;
  1444. this.rectB = 0;
  1445. this.rootPos = { x: 0, y: 0 };
  1446. this.bestForce = 0;
  1447. this.bestAngle = 180;
  1448. this.bestPos = { x: 0, y: 0 };
  1449. this.bestKick = { x: 0, y: 0 };
  1450. this.posList = [];
  1451. this.posIdx = 0;
  1452. this.chatTime = 3000;
  1453. this.tempDir1 = new Laya.Vector2();
  1454. this.tempDir2 = new Laya.Vector2();
  1455. this.tempDir3 = new Laya.Vector2();
  1456. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1457. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1458. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1459. this.gameSrc = xGame.common.gameUI;
  1460. this.hideTime = Laya.timer.currTimer;
  1461. Moyu.setOnTipCall((id) => {
  1462. if (id == 20012)
  1463. this.hideTime = Laya.timer.currTimer;
  1464. else
  1465. (id == 20011);
  1466. {
  1467. let dt = Laya.timer.currTimer - this.hideTime;
  1468. console.log("onshow" + dt);
  1469. if (dt > 30000 && this.state > AIState.none)
  1470. xGame.common.gameMgr.aiGameEnd(false);
  1471. }
  1472. }, this);
  1473. }
  1474. init() {
  1475. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1476. this.awayTime = xGame.tools.random(5000, 10000);
  1477. this.awayNum = 0;
  1478. this.hideTime = Laya.timer.currTimer;
  1479. let rect = xGame.common.d2World.borderRect;
  1480. this.rectL = Math.ceil(rect.x) + 17;
  1481. this.rectT = Math.ceil(rect.y) + 17;
  1482. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1483. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1484. this.wBall = xGame.common.d2World.rootBall;
  1485. this.ballSize = this.wBall.gameObj.width - 1;
  1486. if (this.posList.length < 1) {
  1487. let dp = 40;
  1488. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1489. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1490. let dx = i < this.rectR ? i : this.rectR;
  1491. let dy = j < this.rectB ? j : this.rectB;
  1492. let order = xGame.tools.random(0, 1000);
  1493. this.posList.push({ x: dx, y: dy, order: order });
  1494. }
  1495. }
  1496. this.posList.sort(function (a, b) {
  1497. return a.order - b.order;
  1498. });
  1499. this.setMax = this.posList.length;
  1500. }
  1501. this.state = AIState.idle;
  1502. }
  1503. setAiLevel(num) {
  1504. this.aiLv = num;
  1505. }
  1506. initBall() {
  1507. this.rootPos.x = this.wBall.gameObj.x;
  1508. this.rootPos.y = this.wBall.gameObj.y;
  1509. this.initHoleBall();
  1510. }
  1511. initHoleBall() {
  1512. this.kickBall = [];
  1513. this.lineBall = [];
  1514. this.scoreBall = [];
  1515. this.holeBall = [];
  1516. this.selectNum = 0;
  1517. this.forceNum = 0;
  1518. this.forceMax = 0;
  1519. this.turnNum = 0;
  1520. let list = xGame.common.d2World.ballArr;
  1521. if (list.length < 20 && !this.isGuide) {
  1522. let holes = xGame.common.gameMgr.holePosList;
  1523. for (let i = 0; i < list.length; i++) {
  1524. let obj = list[i];
  1525. if (!obj)
  1526. continue;
  1527. obj.kickPos.x = 0;
  1528. obj.kickPos.y = 0;
  1529. obj.poleAngle = 0;
  1530. obj.hard = 0;
  1531. obj.borderDis = 0;
  1532. obj.kickAngle = 180;
  1533. if (obj.number == 0)
  1534. continue;
  1535. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1536. continue;
  1537. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1538. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1539. continue;
  1540. }
  1541. let b = obj.gameObj;
  1542. let wbp = this.rootPos;
  1543. let bx = wbp.x - b.x;
  1544. let by = wbp.y - b.y;
  1545. obj.borderDis = xGame.tools.random(0, 100);
  1546. this.kickBall.push(obj);
  1547. if (!this.isLine(wbp, obj))
  1548. continue;
  1549. obj.kickAngle = xGame.tools.random(90, 180);
  1550. obj.kickPos.x = b.x;
  1551. obj.kickPos.y = b.y;
  1552. this.lineBall.push(obj);
  1553. let minDis = 999999;
  1554. let hole = false;
  1555. for (let j = 0; j < holes.length; j++) {
  1556. let hp = holes[j];
  1557. if (bx >= 0 && hp.x > b.x + 100)
  1558. continue;
  1559. if (bx <= 0 && hp.x < b.x - 100)
  1560. continue;
  1561. if (by < -10 && hp.y < wbp.y)
  1562. continue;
  1563. if (by > 10 && hp.y > wbp.y)
  1564. continue;
  1565. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1566. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1567. if (dis < minDis) {
  1568. let dx = b.x - this.tempDir1.x * this.ballSize;
  1569. let dy = b.y - this.tempDir1.y * this.ballSize;
  1570. this.tempDir3.x = this.tempDir1.x;
  1571. this.tempDir3.y = this.tempDir1.y;
  1572. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1573. obj.kickPos.x = dx;
  1574. obj.kickPos.y = dy;
  1575. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1576. if (num > 1)
  1577. num = 1;
  1578. obj.kickAngle = Math.acos(num) * 57.3;
  1579. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1580. dis = dis * 2;
  1581. if (Math.abs(hp.x - 600) < 100)
  1582. dis += 50;
  1583. obj.hard = dis + obj.kickAngle * 3;
  1584. hole = true;
  1585. }
  1586. }
  1587. }
  1588. }
  1589. if (hole) {
  1590. this.scoreBall.push(obj);
  1591. this.holeBall.push(obj);
  1592. }
  1593. }
  1594. this.scoreBall.sort(function (a, b) {
  1595. return a.hard - b.hard;
  1596. });
  1597. this.holeBall.sort(function (a, b) {
  1598. return a.kickAngle - b.kickAngle;
  1599. });
  1600. this.kickBall.sort(function (a, b) {
  1601. return a.borderDis - b.borderDis;
  1602. });
  1603. }
  1604. else {
  1605. let max = list.length - 1;
  1606. let i = xGame.tools.random(0, max);
  1607. for (i; i <= max; i++) {
  1608. let idx = i >= max ? i -= max : i;
  1609. let obj = list[idx];
  1610. if (obj && obj.number != 0) {
  1611. obj.kickAngle = xGame.tools.random(90, 180);
  1612. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1613. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1614. this.lineBall.push(obj);
  1615. break;
  1616. }
  1617. }
  1618. }
  1619. }
  1620. selectBall() {
  1621. let ball = null;
  1622. this.destRot = 0;
  1623. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1624. let ai = 110 - this.aiLv * 10;
  1625. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1626. let score = false;
  1627. if (this.scoreBall.length < 1) {
  1628. if (this.lineBall.length < 1) {
  1629. for (let i = 0; i < this.kickBall.length; i++) {
  1630. let list = [];
  1631. let bo = this.kickBall[i];
  1632. let bobj = bo.gameObj;
  1633. let rect = xGame.common.d2World.borderRect;
  1634. let mobj = this.wBall.gameObj;
  1635. let minb = bobj.y - rect.y - 20;
  1636. let minw = mobj.y - rect.y - 50;
  1637. if (minb > 0 && minw > 0) {
  1638. let dlenx = 0;
  1639. let dleny = mobj.y - rect.y;
  1640. let spx = mobj.x;
  1641. let spy = rect.y - dleny;
  1642. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1643. }
  1644. minb = rect.y + rect.height - bobj.y - 20;
  1645. minw = rect.y + rect.height - mobj.y - 50;
  1646. if (minb > 0 && minw > 0) {
  1647. let dlenx = 0;
  1648. let dleny = rect.y + rect.height - mobj.y;
  1649. let spx = mobj.x;
  1650. let spy = rect.y + rect.height + dleny;
  1651. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1652. }
  1653. minb = bobj.x - rect.x - 20;
  1654. minw = mobj.x - rect.x - 50;
  1655. if (minb > 0 && minw > 0) {
  1656. let dlenx = mobj.x - rect.x;
  1657. let dleny = 0;
  1658. let spx = rect.x - dlenx;
  1659. let spy = mobj.y;
  1660. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1661. }
  1662. minb = rect.x + rect.width - bobj.x - 20;
  1663. minw = rect.x + rect.width - mobj.x - 50;
  1664. if (minb > 0 && minw > 0) {
  1665. let dlenx = rect.x + rect.width - mobj.x;
  1666. let dleny = 0;
  1667. let spx = rect.x + rect.width + dlenx;
  1668. let spy = mobj.y;
  1669. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1670. }
  1671. list.sort(function (a, b) {
  1672. return a.order - b.order;
  1673. });
  1674. for (let i = 0; i < list.length; i++) {
  1675. let data = list[i];
  1676. let mx = mobj.x - bobj.x;
  1677. let my = mobj.y - bobj.y;
  1678. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1679. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1680. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1681. if (num > 1)
  1682. num = 1;
  1683. let cos = Math.acos(num);
  1684. if (cos > 1.57)
  1685. cos = 1.57;
  1686. else if (cos < 0.01)
  1687. cos = 0.01;
  1688. let tan = Math.tan(cos);
  1689. let dx = tan * data.dleny;
  1690. let dy = tan * data.dlenx;
  1691. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1692. if (Math.abs(bx - 667) < 40)
  1693. continue;
  1694. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1695. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1696. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1697. this.forceMax = dis * 0.08;
  1698. this.destRot += mis * 0.1;
  1699. this.setKick(bx, by);
  1700. return true;
  1701. }
  1702. }
  1703. }
  1704. }
  1705. else {
  1706. ball = xGame.common.getRandArrEle(this.lineBall);
  1707. }
  1708. }
  1709. else {
  1710. for (let i = 0; i < this.scoreBall.length; i++) {
  1711. if (i < this.scoreBall.length - 1) {
  1712. let rand = 70 + this.aiLv * 10 + i * 10;
  1713. if (xGame.tools.random(0, 100) < rand) {
  1714. ball = this.scoreBall[i];
  1715. break;
  1716. }
  1717. }
  1718. else {
  1719. ball = this.scoreBall[i];
  1720. break;
  1721. }
  1722. }
  1723. score = true;
  1724. this.selectNum++;
  1725. }
  1726. if (!ball)
  1727. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1728. if (this.selectNum >= max) {
  1729. let dx = ball.gameObj.x;
  1730. let dy = ball.gameObj.y;
  1731. let kickAngle = 0;
  1732. if (score) {
  1733. dx = ball.kickPos.x;
  1734. dy = ball.kickPos.y;
  1735. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1736. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1737. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1738. if (adot > 1)
  1739. adot = 1;
  1740. kickAngle = Math.acos(adot) * 57.3;
  1741. if (kickAngle > 45) {
  1742. let kdx = ball.kickPos.x - ball.gameObj.x;
  1743. let kdy = ball.kickPos.y - ball.gameObj.y;
  1744. dx = ball.kickPos.x - kdx * mis * 0.3;
  1745. dy = ball.kickPos.y - kdy * mis * 0.3;
  1746. }
  1747. else
  1748. this.destRot += mis;
  1749. }
  1750. else if (ball.poleAngle != 0) {
  1751. this.destRot += ball.poleAngle;
  1752. }
  1753. if (xGame.common.gameMode == 0) {
  1754. let af = kickAngle * 0.08;
  1755. this.forceMax = ball.hard * 0.1 + af * af;
  1756. }
  1757. this.setKick(dx, dy);
  1758. }
  1759. else {
  1760. let rand = this.aiLv * 5 + 40;
  1761. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1762. ball = xGame.common.getRandArrEle(this.scoreBall);
  1763. else
  1764. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1765. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1766. if (xGame.tools.random(0, 100) > rand) {
  1767. this.selectNum = max;
  1768. }
  1769. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1770. this.selectNum++;
  1771. }
  1772. ball.onClick(0, true);
  1773. }
  1774. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1775. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1776. let balls = xGame.common.d2World.ballArr;
  1777. let max = xGame.tools.getDis(hx, hy, bx, by);
  1778. for (let index = 0; index < balls.length; index++) {
  1779. let obj = balls[index];
  1780. if (obj.number == 0)
  1781. continue;
  1782. if (obj.number == bn || obj.number == dn)
  1783. continue;
  1784. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1785. if (dis * dis > max)
  1786. continue;
  1787. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1788. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1789. if (num > 1)
  1790. num = 1;
  1791. if (num < 0)
  1792. continue;
  1793. let gap = Math.sin(Math.acos(num)) * dis;
  1794. if (gap < this.ballSize)
  1795. return true;
  1796. }
  1797. return false;
  1798. }
  1799. isLine(xy, ball) {
  1800. let bx = xy.x;
  1801. let by = xy.y;
  1802. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1803. let dis = ball.getDestDis(xy);
  1804. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1805. let sin = Math.sin(angle);
  1806. let cos = Math.cos(angle);
  1807. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1808. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1809. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1810. let dx = bx + this.tempDir2.x * dis;
  1811. let dy = by + this.tempDir2.y * dis;
  1812. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1813. sin = Math.sin(-angle);
  1814. cos = Math.cos(-angle);
  1815. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1816. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1817. dx = bx + this.tempDir2.x * dis;
  1818. dy = by + this.tempDir2.y * dis;
  1819. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1820. if (isr && isl)
  1821. return false;
  1822. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1823. }
  1824. return true;
  1825. }
  1826. turnPole() {
  1827. this.turnNum++;
  1828. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1829. let dr = rot - this.destRot;
  1830. let abs = Math.abs(dr) % 360;
  1831. if (abs > 180) {
  1832. if (rot > 180)
  1833. rot -= 360;
  1834. if (this.destRot > 180)
  1835. this.destRot -= 360;
  1836. }
  1837. let max = this.turnNum * 5 + this.aiLv * 5;
  1838. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  1839. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  1840. let at = xGame.tools.random(1000, 2000);
  1841. if (!this.onAway(3))
  1842. at += xGame.tools.random(10000, 15000);
  1843. this.setState(AIState.shoot, at);
  1844. }
  1845. else {
  1846. let mr = 0;
  1847. if (abs > 3)
  1848. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  1849. else if (Math.random() > 0.6)
  1850. mr = xGame.tools.random(1, 10) * 0.1;
  1851. mr = dr > 0 ? -mr : mr;
  1852. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  1853. }
  1854. }
  1855. setKick(dx, dy) {
  1856. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  1857. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1858. this.tempDir1.x = 0;
  1859. this.tempDir1.y = 1;
  1860. this.tempDir2.y = -this.tempDir2.y;
  1861. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1862. if (num > 1)
  1863. num = 1;
  1864. let rot = Math.acos(num) * 57.3;
  1865. if (this.tempDir2.x < 0)
  1866. rot = 360 - rot;
  1867. this.destRot += rot;
  1868. if (!xGame.common.gameMgr.finishOneShoot) {
  1869. this.forceMax += xGame.tools.random(10, 50);
  1870. this.forceMax -= this.aiLv * 2;
  1871. if (this.forceMax < 20)
  1872. this.forceMax = 20;
  1873. }
  1874. if (this.forceMax > 100)
  1875. this.forceMax = 101;
  1876. else if (this.forceMax < 10)
  1877. this.forceMax += xGame.tools.random(0, 10);
  1878. if (xGame.common.gameMode == 1)
  1879. this.forceMax = xGame.tools.random(80, 100);
  1880. else
  1881. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  1882. let max = 2000 - this.aiLv * 100;
  1883. if (Math.random() > 0.8)
  1884. max += xGame.tools.random(100, 2000);
  1885. this.setState(AIState.turn, xGame.tools.random(500, max));
  1886. }
  1887. shoot() {
  1888. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  1889. if (Math.random() > 0.8) {
  1890. this.gameSrc.aiForce(1);
  1891. this.setState(AIState.wait);
  1892. }
  1893. }
  1894. else {
  1895. let df = xGame.tools.random(3, 8);
  1896. if (this.forceNum < this.forceMax)
  1897. this.forceNum += df;
  1898. else
  1899. this.forceNum -= df;
  1900. let startY = this.gameSrc.ui.powerNode.y;
  1901. let height = this.gameSrc.ui.powerNode.height;
  1902. let force = startY + height * this.forceNum * 0.01;
  1903. this.gameSrc.aiForce(2, force);
  1904. }
  1905. }
  1906. reset() {
  1907. for (let i = 0; i < 4; i++) {
  1908. this.setRate--;
  1909. this.setNum++;
  1910. let pos = this.posList[this.posIdx];
  1911. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  1912. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  1913. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  1914. this.rootPos.x = 387;
  1915. if (this.rootPos.x < this.rectL)
  1916. this.rootPos.x = this.rectL;
  1917. else if (this.rootPos.x > this.rectR)
  1918. this.rootPos.x = this.rectR;
  1919. if (this.rootPos.y < this.rectT)
  1920. this.rootPos.y = this.rectT;
  1921. else if (this.rootPos.y > this.rectB)
  1922. this.rootPos.y = this.rectB;
  1923. this.posIdx++;
  1924. let max = this.posList.length;
  1925. if (this.posIdx >= max)
  1926. this.posIdx -= max;
  1927. this.initHoleBall();
  1928. let ball = null;
  1929. if (this.scoreBall.length > 0)
  1930. ball = this.scoreBall[0];
  1931. else if (this.lineBall.length > 0)
  1932. ball = xGame.common.getRandArrEle(this.lineBall);
  1933. if (ball && ball.kickAngle < this.bestAngle) {
  1934. this.bestAngle = ball.kickAngle;
  1935. this.bestKick.x = ball.kickPos.x;
  1936. this.bestKick.y = ball.kickPos.y;
  1937. this.bestPos.x = this.rootPos.x;
  1938. this.bestPos.y = this.rootPos.y;
  1939. this.bestForce = ball.hard * 0.08;
  1940. }
  1941. }
  1942. if (this.setNum >= this.setMax)
  1943. this.setMax = 0;
  1944. if (this.setRate < 1) {
  1945. this.setState(AIState.move, 0);
  1946. this.rootMoveTime = Laya.timer.currTimer;
  1947. this.gameSrc.aiRootMove(true);
  1948. }
  1949. }
  1950. delayLine() {
  1951. this.gameSrc.aiRootMove(false);
  1952. }
  1953. move() {
  1954. if (this.bestPos.x < 1)
  1955. this.bestPos = this.rootPos;
  1956. let wObj = this.wBall.gameObj;
  1957. let destx = wObj.x;
  1958. let desty = wObj.y;
  1959. let dx = Math.abs(destx - this.bestPos.x);
  1960. let dy = Math.abs(desty - this.bestPos.y);
  1961. let mx = 3 + dx * 0.03;
  1962. let my = 3 + dy * 0.03;
  1963. if (dx < 4 && dy < 4) {
  1964. let dt = Laya.timer.currTimer - this.rootMoveTime;
  1965. dt = dt < 1000 ? 1000 - dt : 0;
  1966. if (this.setMax > 0) {
  1967. let min = this.setMax * 0.3 + this.aiLv * 5;
  1968. this.setRate = xGame.tools.random(min, this.setMax);
  1969. this.setState(AIState.reset, 0);
  1970. }
  1971. else {
  1972. this.destRot = 0;
  1973. this.forceMax = this.bestForce;
  1974. this.setKick(this.bestKick.x, this.bestKick.y);
  1975. }
  1976. if (dt > 100) {
  1977. Laya.timer.clear(this, this.delayLine);
  1978. Laya.timer.once(dt, this, this.delayLine);
  1979. }
  1980. else
  1981. this.gameSrc.aiRootMove(false);
  1982. }
  1983. else {
  1984. if (dx > 4)
  1985. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  1986. if (dy > 4)
  1987. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  1988. this.gameSrc.onRootMove({ x: destx, y: desty });
  1989. }
  1990. }
  1991. resetRoot() {
  1992. this.bestAngle = 180;
  1993. this.bestForce = 0;
  1994. this.setMax = this.posList.length;
  1995. this.posIdx = xGame.tools.random(0, this.setMax);
  1996. let min = this.setMax * 0.3 + this.aiLv * 5;
  1997. this.setRate = xGame.tools.random(min, this.setMax);
  1998. let max = 2000 - this.aiLv * 100;
  1999. if (Math.random() > 0.8)
  2000. max += xGame.tools.random(100, 1000);
  2001. if (this.isGuide)
  2002. this.setState(AIState.select, 500);
  2003. else if (this.onAway(2))
  2004. this.setState(AIState.reset, xGame.tools.random(400, max));
  2005. else
  2006. this.setState(AIState.none);
  2007. if (xGame.common.gameMgr.finishOneShoot)
  2008. this.chat();
  2009. }
  2010. runAI() {
  2011. if (this.state > AIState.idle)
  2012. return;
  2013. this.initBall();
  2014. this.onGame(2500);
  2015. if (Math.random() > 0.6)
  2016. this.chat();
  2017. }
  2018. stopRun() {
  2019. this.setState(AIState.idle);
  2020. }
  2021. onGame(base) {
  2022. let max = base - this.aiLv * 100;
  2023. if (Math.random() > 0.8)
  2024. max += xGame.tools.random(100, 1000);
  2025. if (this.onAway(2))
  2026. this.setState(AIState.select, xGame.tools.random(500, max));
  2027. else
  2028. this.setState(AIState.none);
  2029. }
  2030. setState(sta, wt = 0) {
  2031. if (this.state == AIState.none)
  2032. return;
  2033. this.state = sta;
  2034. this.waitTime = wt;
  2035. }
  2036. onUpdate() {
  2037. if (this.state == AIState.none)
  2038. return;
  2039. this.awayTime -= this.dtime;
  2040. if (this.awayTime < 1) {
  2041. this.awayTime = xGame.tools.random(6000, 10000);
  2042. this.awayNum += (11 - this.aiLv);
  2043. this.onAway(1);
  2044. }
  2045. if (this.waitTime >= 0) {
  2046. this.waitTime -= this.dtime;
  2047. return;
  2048. }
  2049. switch (this.state) {
  2050. case AIState.idle:
  2051. this.chat();
  2052. break;
  2053. case AIState.reset:
  2054. this.reset();
  2055. break;
  2056. case AIState.move:
  2057. this.move();
  2058. break;
  2059. case AIState.leave:
  2060. this.state = AIState.none;
  2061. xGame.common.gameMgr.aiGameEnd(true);
  2062. break;
  2063. case AIState.select:
  2064. this.selectBall();
  2065. break;
  2066. case AIState.turn:
  2067. this.turnPole();
  2068. break;
  2069. case AIState.shoot:
  2070. this.shoot();
  2071. break;
  2072. }
  2073. }
  2074. onAway(type) {
  2075. if (type == 1) {
  2076. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2077. let num = this.awayNum + db * 20;
  2078. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2079. xGame.common.gameMgr.aiLeave();
  2080. this.setState(AIState.leave, 6666);
  2081. }
  2082. }
  2083. else if (type == 2) {
  2084. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2085. let num = this.awayNum + db * 30;
  2086. if (xGame.tools.random(0, 10000) < num)
  2087. return false;
  2088. }
  2089. else if (type == 3) {
  2090. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2091. let num = this.awayNum + db * 10;
  2092. if (xGame.tools.random(0, 4000) < num)
  2093. return false;
  2094. }
  2095. return true;
  2096. }
  2097. chat() {
  2098. if (this.chatTime > 0) {
  2099. this.chatTime -= this.dtime;
  2100. return;
  2101. }
  2102. this.chatTime = xGame.tools.random(2000, 10000);
  2103. let rand = xGame.tools.random(0, 100);
  2104. if (rand < 15)
  2105. this.talk();
  2106. else if (rand < 35)
  2107. this.emotion();
  2108. }
  2109. talk() {
  2110. xGame.common.talkMgr.showAITalk(0);
  2111. }
  2112. emotion() {
  2113. xGame.common.talkMgr.showAIEmotion(0);
  2114. }
  2115. resetAI() {
  2116. this.stopRun();
  2117. this.state = AIState.none;
  2118. }
  2119. }
  2120. class Partical extends Laya.Script3D {
  2121. constructor() {
  2122. super();
  2123. this.duration = 2000;
  2124. }
  2125. ;
  2126. onAwake() {
  2127. this.gameObj = this.owner;
  2128. }
  2129. onEnable() {
  2130. this.openTimer();
  2131. }
  2132. openTimer() {
  2133. Laya.timer.once(this.duration, this, this.disappear);
  2134. }
  2135. setCallback(obj, callback) {
  2136. this.obj = obj;
  2137. this.callback = callback;
  2138. Laya.timer.clearAll(this);
  2139. Laya.timer.once(this.duration, this, this.disappear);
  2140. }
  2141. disappear() {
  2142. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2143. this.callback && this.callback(this.obj);
  2144. }
  2145. }
  2146. class Ball extends Laya.Script3D {
  2147. constructor() {
  2148. super();
  2149. this.posV3 = new Laya.Vector3();
  2150. this.rotRate = 2.1;
  2151. this.rotSpeed = new Laya.Vector3();
  2152. this.myIndex = 0;
  2153. }
  2154. onAwake() {
  2155. this.gameObj = this.owner;
  2156. this.transform = this.gameObj.transform;
  2157. this.ballNode = this.gameObj.getChildByName("Ball");
  2158. this.shadowNode = this.gameObj.getChildByName("shadow");
  2159. }
  2160. initSelf(index, x, y, owner) {
  2161. this.d2BallSrc = owner;
  2162. this.myIndex = index;
  2163. this.setAlbedoTexture();
  2164. this.setTransPos(x, y);
  2165. this.setScale();
  2166. this.ballNode.transform.localRotationEulerX = 90;
  2167. if (index == 0) {
  2168. }
  2169. }
  2170. setAlbedoTexture(isIce = false) {
  2171. let url;
  2172. if (isIce) {
  2173. url = `res/d3Res/ballTexture/ice.jpg`;
  2174. }
  2175. else {
  2176. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2177. }
  2178. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2179. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2180. }));
  2181. }
  2182. runFireworks(obj, delay, callback) {
  2183. Laya.timer.clearAll(this);
  2184. Laya.timer.once(delay + 1, this, () => {
  2185. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2186. fire.transform.localPositionX = this.transform.localPositionX;
  2187. fire.transform.localPositionY = this.transform.localPositionY;
  2188. fire.transform.localPositionZ = this.transform.localPositionZ;
  2189. let src = fire.getComponent(Partical);
  2190. src.duration = 1000;
  2191. src.setCallback(obj, callback);
  2192. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2193. eft.transform.localPositionX = this.transform.localPositionX;
  2194. eft.transform.localPositionY = this.transform.localPositionY;
  2195. eft.transform.localPositionZ = this.transform.localPositionZ;
  2196. });
  2197. }
  2198. setTransPos(x, y) {
  2199. this.setRotation();
  2200. xGame.common.pos2to3Convert(x, y, this.posV3);
  2201. this.transform.localPositionX = this.posV3.x;
  2202. this.transform.localPositionY = 0;
  2203. this.transform.localPositionZ = this.posV3.z;
  2204. this.transform.localRotationEulerX = 0;
  2205. this.transform.localRotationEulerY = 0;
  2206. this.transform.localRotationEulerZ = 0;
  2207. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2208. this.shadowNode.transform.localPositionY = 0.1;
  2209. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2210. }
  2211. setRotation() {
  2212. if (this.d2BallSrc.canRot) {
  2213. let speed = this.d2BallSrc.rigy.linearVelocity;
  2214. this.rotSpeed.x = speed.x * this.rotRate;
  2215. this.rotSpeed.z = speed.y * this.rotRate;
  2216. this.rotSpeed.y = this.d2BallSrc.rotY;
  2217. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2218. }
  2219. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2220. this.rotSpeed.x = this.rotSpeed.y = 0;
  2221. this.rotSpeed.y = this.d2BallSrc.rotY;
  2222. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2223. }
  2224. }
  2225. setScale() {
  2226. let radius = xGame.common.d2World.rootBall.ui.width;
  2227. let scale = xGame.common.scale2to3Convert(radius);
  2228. this.transform.localScaleX = scale;
  2229. this.transform.localScaleY = scale;
  2230. this.transform.localScaleZ = scale;
  2231. }
  2232. playInHoleEft() {
  2233. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2234. eft.transform.position = this.transform.position;
  2235. }
  2236. playIceEft() {
  2237. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2238. eft.transform.position = this.transform.position;
  2239. }
  2240. get scaleXYZ() {
  2241. return this.transform.localScaleX;
  2242. }
  2243. set scaleXYZ(val) {
  2244. this.transform.localScaleX = val;
  2245. this.transform.localScaleY = val;
  2246. this.transform.localScaleZ = val;
  2247. }
  2248. get posX() {
  2249. return this.transform.localPositionX;
  2250. }
  2251. set posX(val) {
  2252. this.transform.localPositionX = val;
  2253. }
  2254. get posY() {
  2255. return this.transform.localPositionY;
  2256. }
  2257. set posY(val) {
  2258. this.transform.localPositionY = val;
  2259. }
  2260. get posZ() {
  2261. return this.transform.localPositionZ;
  2262. }
  2263. set posZ(val) {
  2264. this.transform.localPositionZ = val;
  2265. }
  2266. destroySelf() {
  2267. this.posV3 = null;
  2268. this.rotSpeed = null;
  2269. this.d2BallSrc = null;
  2270. this.ballNode = null;
  2271. this.gameObj.destroy(true);
  2272. this.transform = null;
  2273. this.destroy();
  2274. }
  2275. }
  2276. class ui_D2Ball extends fgui.GComponent {
  2277. static createInstance() {
  2278. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2279. }
  2280. onConstruct() {
  2281. this.myIcon = (this.getChild("myIcon"));
  2282. this.inner = (this.getChild("inner"));
  2283. this.n8 = (this.getChild("n8"));
  2284. this.n4 = (this.getChild("n4"));
  2285. this.wrongTips = (this.getChild("wrongTips"));
  2286. this.rightTips = (this.getChild("rightTips"));
  2287. this.breathAni = this.getTransition("breathAni");
  2288. }
  2289. }
  2290. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2291. class D2BallSrc extends Laya.Script {
  2292. constructor() {
  2293. super();
  2294. this.number = 0;
  2295. this.startX = 0;
  2296. this.startY = 0;
  2297. this.angleV2 = new Laya.Vector2();
  2298. this.isRootBall = false;
  2299. this.isBlackBall = false;
  2300. this.ballType = "";
  2301. this.canRot = true;
  2302. this.rotY = 0;
  2303. this.poleAngle = 0;
  2304. this.kickPos = { x: 0, y: 0 };
  2305. this.hard = 0;
  2306. this.kickAngle = 0;
  2307. this.borderDis = 0;
  2308. this.speedP10 = 5.6;
  2309. this.lastSpeed = { x: 0, y: 0 };
  2310. this.stillSpeed = 0.12;
  2311. this.ballFunc = "normal";
  2312. this.isRunSkillAni = false;
  2313. this.isInHole = false;
  2314. this.iceOwner = "";
  2315. this.forceRun = false;
  2316. this.myUNID = "";
  2317. this.rectL = 0;
  2318. this.rectR = 0;
  2319. this.rectT = 0;
  2320. this.rectB = 0;
  2321. this.forceVec = new Laya.Vector2();
  2322. this.lastDis = 0;
  2323. this.helpOut = { type: "", x: 0, y: 0 };
  2324. }
  2325. initSelf(number, x, y, d3Ball) {
  2326. if (!this.gameObj)
  2327. this.gameObj = this.owner;
  2328. this.number = number;
  2329. this.startX = x;
  2330. this.startY = y;
  2331. this.d3Ball = d3Ball;
  2332. this.isRootBall = false;
  2333. this.isBlackBall = false;
  2334. this.ballType = "";
  2335. if (number == 0) {
  2336. this.isRootBall = true;
  2337. }
  2338. else if (number == 8) {
  2339. this.isBlackBall = true;
  2340. }
  2341. else {
  2342. if (number <= 7) {
  2343. this.ballType = ballCamp.full;
  2344. }
  2345. else {
  2346. this.ballType = ballCamp.flower;
  2347. }
  2348. }
  2349. this.setInfo();
  2350. this.setD3Ball();
  2351. this.owner["mySrc"] = this;
  2352. this.rigy.linearDamping = 1;
  2353. D2BallSrc._unid++;
  2354. this.myUNID = "d2ball" + D2BallSrc._unid;
  2355. let rect = xGame.common.d2World.borderRect;
  2356. this.rectL = Math.ceil(rect.x) + 20;
  2357. this.rectT = Math.ceil(rect.y) + 20;
  2358. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2359. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2360. }
  2361. setInfo() {
  2362. this.gameObj.x = this.startX;
  2363. this.gameObj.y = this.startY;
  2364. let radius = this.ui.width / 2;
  2365. this.gameObj.width = radius * 2;
  2366. this.gameObj.height = radius * 2;
  2367. if (xGame.common.showDebug) {
  2368. this.ui.myIcon.alpha = 1;
  2369. this.ui.inner.alpha = 1;
  2370. }
  2371. else {
  2372. this.ui.myIcon.alpha = 0;
  2373. this.ui.inner.alpha = 0;
  2374. }
  2375. }
  2376. setD3Ball() {
  2377. this.d3Ball = this.d3Ball;
  2378. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2379. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2380. }
  2381. onUpdate() {
  2382. if (xGame.common.gameMgr.gamePause)
  2383. return;
  2384. if (this.isInHole)
  2385. return;
  2386. if (!xGame.common.d2World.openCheckStill)
  2387. return;
  2388. this.runBall();
  2389. }
  2390. runBall() {
  2391. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2392. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2393. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2394. this.judgeBorder();
  2395. }
  2396. getDestDis(dest) {
  2397. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2398. }
  2399. setmyXY(x, y) {
  2400. this.d3BallSrc.setTransPos(x, y);
  2401. }
  2402. getSpeed() {
  2403. let speed = this.rigy.linearVelocity;
  2404. return speed.x * speed.x + speed.y * speed.y;
  2405. }
  2406. onTriggerEnter(collider) {
  2407. if (!collider || !collider.owner)
  2408. return;
  2409. let coll = "collide";
  2410. let speed = this.getSpeed();
  2411. let sv2 = this.speedP10 * this.speedP10;
  2412. if (collider.label == "ball") {
  2413. if (speed < 9 && this.number != 0)
  2414. coll = "";
  2415. else if (speed < sv2)
  2416. coll = "collide_4";
  2417. else if (speed < sv2 * 6.2)
  2418. coll = "collide_3";
  2419. else if (speed < sv2 * 25)
  2420. coll = "collide_2";
  2421. else if (speed < sv2 * 56)
  2422. coll = "collide_1";
  2423. xGame.soundMgr.playSound(coll);
  2424. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2425. if (collider.owner) {
  2426. let rig = collider.owner.getComponent(D2BallSrc);
  2427. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2428. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2429. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2430. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2431. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2432. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2433. let rx = 0;
  2434. let ry = 0;
  2435. if (this.gameObj.x < this.rectL)
  2436. rx = vx;
  2437. else if (this.gameObj.x > this.rectR)
  2438. rx = -vx;
  2439. else if (this.gameObj.y < this.rectT)
  2440. ry = vy;
  2441. else if (this.gameObj.y > this.rectB)
  2442. ry = -vy;
  2443. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2444. }
  2445. }
  2446. if (this.number != 0) {
  2447. return;
  2448. }
  2449. else {
  2450. if (this.forceRun) {
  2451. console.log("randon force");
  2452. this.applyForce(collider);
  2453. }
  2454. }
  2455. if (xGame.common.d2World.isOnSameLine) {
  2456. xGame.common.d2World.isOnSameLine = false;
  2457. this.rigy.linearVelocity = { x: 0, y: 0 };
  2458. }
  2459. if (xGame.common.gameMgr.firstColliObj == null) {
  2460. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2461. xGame.common.gameMgr.isTouchedBall = true;
  2462. }
  2463. }
  2464. else {
  2465. xGame.common.recoverCameraView();
  2466. let wallStr = "";
  2467. if (speed < 9) { }
  2468. else if (speed < sv2) { }
  2469. else if (speed < sv2 * 6.2)
  2470. wallStr = "wall_30";
  2471. else if (speed < sv2 * 25)
  2472. wallStr = "wall_50";
  2473. else if (speed < sv2 * 56)
  2474. wallStr = "wall_80";
  2475. xGame.soundMgr.playSound(wallStr);
  2476. }
  2477. }
  2478. applyForce(collider) {
  2479. let src = collider.owner.mySrc;
  2480. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2481. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2482. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2483. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2484. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2485. }
  2486. checkWrongBall(playEft = true) {
  2487. if (this.isInHole)
  2488. return;
  2489. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2490. if (this.number != 0 && playEft)
  2491. this.d3BallSrc.playInHoleEft();
  2492. let coll = "inpocket_1";
  2493. let speed = this.getSpeed();
  2494. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2495. if (speed < 9 && this.number != 0)
  2496. coll = "";
  2497. else if (speed < sv2 * 6.2)
  2498. coll = "inpocket_4";
  2499. else if (speed < sv2 * 25)
  2500. coll = "collide_3";
  2501. else if (speed < sv2 * 56)
  2502. coll = "collide_2";
  2503. xGame.soundMgr.playSound(coll);
  2504. this.isInHole = true;
  2505. if (this.number == 0) {
  2506. console.log("白球进了。。");
  2507. this.reset();
  2508. this.rigy.linearVelocity = { x: 0, y: 0 };
  2509. this.hideSelf();
  2510. xGame.common.gameUI.ui.whiteAni.visible = true;
  2511. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2512. xGame.common.gameUI.ui.whiteAni.visible = false;
  2513. }));
  2514. }
  2515. else {
  2516. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2517. xGame.common.d2World.removeOneBall(this);
  2518. this.destroySelf();
  2519. xGame.common.playHappySound(this.number);
  2520. this.runFlyEft();
  2521. }
  2522. }
  2523. runFlyEft() {
  2524. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2525. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2526. }
  2527. }
  2528. hideSelf() {
  2529. if (this.d3Ball)
  2530. this.d3Ball.active = false;
  2531. }
  2532. showSelf() {
  2533. this.isInHole = false;
  2534. if (this.d3Ball && !this.d3Ball.active)
  2535. this.d3Ball.active = true;
  2536. }
  2537. isStill() {
  2538. let speed = this.rigy.linearVelocity;
  2539. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2540. this.rigy.linearVelocity = { x: 0, y: 0 };
  2541. return true;
  2542. }
  2543. return false;
  2544. }
  2545. reset() {
  2546. }
  2547. destroySelf() {
  2548. this.d3BallSrc.destroySelf();
  2549. if (!this.ui.isDisposed) {
  2550. this.ui.removeFromParent();
  2551. this.ui.dispose();
  2552. this.ui = null;
  2553. }
  2554. this.outColli = null;
  2555. this.innerColli = null;
  2556. this.rigy = null;
  2557. this.d3Ball = null;
  2558. this.d3BallSrc = null;
  2559. this.angleV2 = null;
  2560. this.gameObj.destroy(true);
  2561. this.destroy();
  2562. }
  2563. judgeBorder() {
  2564. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2565. return;
  2566. }
  2567. if (this.destroyed)
  2568. return;
  2569. if (xGame.common.gameMode == GameMode.classic)
  2570. return;
  2571. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2572. if (isOver) {
  2573. this.checkWrongBall();
  2574. }
  2575. }
  2576. onClick(e, force = false) {
  2577. if (this.number == 0)
  2578. return;
  2579. if (force) {
  2580. }
  2581. else {
  2582. if (xGame.common.d2World.openCheckStill)
  2583. return;
  2584. if (!xGame.common.gameMgr.selfTurn) {
  2585. return;
  2586. }
  2587. }
  2588. if (!xGame.common.gameMgr.finishOneShoot)
  2589. return;
  2590. let root = xGame.common.d2World.rootBall.gameObj;
  2591. let x = this.gameObj.x - root.x;
  2592. let y = this.gameObj.y - root.y;
  2593. let angle = xGame.common.getfguiRotation(x, y);
  2594. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2595. xGame.common.d2World.getHelpLine();
  2596. xGame.common.clickedBall = true;
  2597. this.checkGuide();
  2598. }
  2599. checkGuide() {
  2600. let guide = DataMgr.getSkillGuide();
  2601. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2602. xGame.common.guideStep++;
  2603. xGame.common.gameUI.ui.guide1.visible = false;
  2604. xGame.common.gameUI.ui.guide2.visible = true;
  2605. }
  2606. }
  2607. checkDistance(disX, disY, angle) {
  2608. let diameter = this.gameObj.width - 1;
  2609. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2610. if (!this.lastDis)
  2611. this.lastDis = dis;
  2612. else {
  2613. if (dis > this.lastDis) {
  2614. this.helpOut.type = "remove";
  2615. return this.helpOut;
  2616. }
  2617. }
  2618. if (dis <= Math.pow(diameter, 2)) {
  2619. let del = 0.01;
  2620. let offest = 0;
  2621. let realX = disX - this.gameObj.x;
  2622. let realY = disY - this.gameObj.y;
  2623. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2624. offest += del;
  2625. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2626. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2627. }
  2628. this.helpOut.type = "ok";
  2629. this.helpOut.x = realX + this.gameObj.x;
  2630. this.helpOut.y = realY + this.gameObj.y;
  2631. return this.helpOut;
  2632. }
  2633. else {
  2634. this.helpOut.type = "no";
  2635. return this.helpOut;
  2636. }
  2637. }
  2638. clearBallEft() {
  2639. this.clearBallRightEft();
  2640. this.clearBallWrongEft();
  2641. }
  2642. clearBallRightEft() {
  2643. this.ui.breathAni.stop();
  2644. this.ui.rightTips.visible = false;
  2645. }
  2646. clearBallWrongEft() {
  2647. this.ui.wrongTips.visible = false;
  2648. }
  2649. showWrongEft() {
  2650. if (!xGame.common.gameMgr.selfTurn)
  2651. return;
  2652. this.ui.wrongTips.visible = true;
  2653. }
  2654. showRightEft() {
  2655. if (!xGame.common.gameMgr.selfTurn)
  2656. return;
  2657. this.ui.rightTips.visible = true;
  2658. this.ui.rightTips.scaleX = 1;
  2659. this.ui.rightTips.scaleY = 1;
  2660. this.ui.breathAni.play();
  2661. }
  2662. setBallFunc(type, owner) {
  2663. if (type == "ice") {
  2664. this.ballFunc = type;
  2665. this.d3BallSrc.setAlbedoTexture(true);
  2666. this.rigy.type = "static";
  2667. this.iceOwner = owner;
  2668. }
  2669. else {
  2670. if (owner == this.iceOwner) {
  2671. this.ballFunc = type;
  2672. this.d3BallSrc.setAlbedoTexture(false);
  2673. this.rigy.type = "dynamic";
  2674. }
  2675. }
  2676. }
  2677. }
  2678. D2BallSrc._unid = 0;
  2679. class D2RootBallSrc extends D2BallSrc {
  2680. constructor() {
  2681. super();
  2682. this.maxSpeed = 0;
  2683. this.classicMaxSpeed = 2.2;
  2684. this.bigSkillMaxSpeed = 4;
  2685. this.angle = 0;
  2686. this.allPercent = 0;
  2687. this.linearPercent = 0;
  2688. this.anglePercent = 0;
  2689. this.maxAngleRate = 0.6;
  2690. this.baseRot = 7;
  2691. this.angleMax = 0;
  2692. this.speed = new Laya.Vector2();
  2693. this.rotSpeed = new Laya.Vector2();
  2694. }
  2695. isStill() {
  2696. let speed = this.rigy.linearVelocity;
  2697. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2698. if (this.anglePercent <= 0.1) {
  2699. this.rigy.linearVelocity = { x: 0, y: 0 };
  2700. return true;
  2701. }
  2702. }
  2703. return false;
  2704. }
  2705. reset() {
  2706. this.linearPercent = 0;
  2707. this.anglePercent = 0;
  2708. }
  2709. setSpeed(percent, angle) {
  2710. this.allPercent = percent;
  2711. this.angle = angle;
  2712. this.setAngleSpeed();
  2713. this.setLinearSpeed();
  2714. let hit = "hit";
  2715. if (percent < 25)
  2716. hit = "hit03";
  2717. else if (percent < 50)
  2718. hit = "hit02";
  2719. else if (percent < 75)
  2720. hit = "hit01";
  2721. xGame.soundMgr.playSound(hit);
  2722. }
  2723. setAngleSpeed() {
  2724. let offest = xGame.common.rodOffest;
  2725. let radius = 82;
  2726. let rate = Math.abs(offest.y / radius) * 0.5;
  2727. if (offest.y > 0)
  2728. this.angleMax = -this.baseRot * 2;
  2729. else
  2730. this.angleMax = this.baseRot;
  2731. this.rotY = -offest.x / radius * 100;
  2732. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2733. this.linearPercent = this.allPercent - this.anglePercent;
  2734. }
  2735. setLinearSpeed() {
  2736. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2737. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2738. if (!xGame.common.longHelpLine) {
  2739. let offset = -150 + xGame.common.randomNum(0, 300);
  2740. offset /= 100;
  2741. this.angle += offset;
  2742. }
  2743. }
  2744. }
  2745. let sin = Math.sin(this.angle * Math.PI / 180);
  2746. let cos = Math.cos(this.angle * Math.PI / 180);
  2747. switch (xGame.common.gameMode) {
  2748. case GameMode.classic:
  2749. this.maxSpeed = this.classicMaxSpeed;
  2750. break;
  2751. case GameMode.bigMove:
  2752. this.maxSpeed = this.bigSkillMaxSpeed;
  2753. break;
  2754. case GameMode.placeBall:
  2755. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2756. if (data.type == 1) {
  2757. this.maxSpeed = this.bigSkillMaxSpeed;
  2758. }
  2759. else {
  2760. this.maxSpeed = this.classicMaxSpeed;
  2761. }
  2762. break;
  2763. default:
  2764. break;
  2765. }
  2766. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2767. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2768. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2769. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2770. this.rigy.applyLinearImpulseToCenter(this.speed);
  2771. }
  2772. onUpdate() {
  2773. if (this.anglePercent > 0.1) {
  2774. this.anglePercent *= 0.97;
  2775. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2776. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2777. this.rigy.applyForceToCenter(this.rotSpeed);
  2778. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2779. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2780. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2781. if (num > 0.9)
  2782. this.canRot = true;
  2783. }
  2784. else
  2785. this.canRot = true;
  2786. if (Math.abs(this.rotY) > 0.1)
  2787. this.rotY *= 0.98;
  2788. super.onUpdate();
  2789. }
  2790. destroySelf() {
  2791. super.destroySelf();
  2792. this.speed = null;
  2793. }
  2794. }
  2795. class D2Ball extends Laya.Sprite {
  2796. constructor(isRootBall = false) {
  2797. super();
  2798. this.ui = ui_D2Ball.createInstance();
  2799. this.pivotX = this.ui.width / 2;
  2800. this.pivotY = this.ui.width / 2;
  2801. this.x = 0;
  2802. this.y = 0;
  2803. this.addChild(this.ui.displayObject);
  2804. this.ui.displayObject.x += this.ui.width / 2;
  2805. this.ui.displayObject.y += this.ui.width / 2;
  2806. if (isRootBall) {
  2807. this.d2Src = this.addComponent(D2RootBallSrc);
  2808. }
  2809. else {
  2810. this.d2Src = this.addComponent(D2BallSrc);
  2811. }
  2812. this.d2Src.ui = this.ui;
  2813. this.addCircleCollider();
  2814. this.addInnerCircleCollider();
  2815. this.addRigyBody();
  2816. }
  2817. addCircleCollider() {
  2818. let colli = xGame.common.getCollider("circle");
  2819. colli.radius = this.ui.width / 2;
  2820. this.addComponentIntance(colli);
  2821. this.d2Src.outColli = colli;
  2822. colli.label = "ball";
  2823. }
  2824. addInnerCircleCollider() {
  2825. let colli = xGame.common.getCollider("circle");
  2826. colli.radius = this.ui.inner.width / 2;
  2827. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2828. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2829. this.addComponentIntance(colli);
  2830. this.d2Src.innerColli = colli;
  2831. colli.label = "inner";
  2832. }
  2833. addRigyBody() {
  2834. let rigy = xGame.common.getRigbody();
  2835. rigy.type = "dynamic";
  2836. this.addComponentIntance(rigy);
  2837. this.d2Src.rigy = rigy;
  2838. }
  2839. disposeSelf() {
  2840. if (!this.ui.isDisposed) {
  2841. this.ui.dispose();
  2842. this.ui.removeFromParent();
  2843. this.ui = null;
  2844. }
  2845. }
  2846. }
  2847. class ui_D2Gan extends fgui.GComponent {
  2848. static createInstance() {
  2849. return (fgui.UIPackage.createObject("game", "D2Gan"));
  2850. }
  2851. onConstruct() {
  2852. this.myIcon = (this.getChild("myIcon"));
  2853. this.selfRodIcon = (this.getChild("selfRodIcon"));
  2854. this.selfEftRoot = (this.getChild("selfEftRoot"));
  2855. this.self = (this.getChild("self"));
  2856. this.aiRodIcon = (this.getChild("aiRodIcon"));
  2857. this.aiEftRoot = (this.getChild("aiEftRoot"));
  2858. this.ai = (this.getChild("ai"));
  2859. }
  2860. }
  2861. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  2862. class D2Gan {
  2863. constructor() {
  2864. this.offset = 0.15;
  2865. this.cell = 1.5;
  2866. this.onBallCell = 0.4;
  2867. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  2868. this.moveNum = 70;
  2869. this.rulerRate = 0.1;
  2870. this.ui = ui_D2Gan.createInstance();
  2871. this.changeSelfRod();
  2872. this.changeAIRod();
  2873. }
  2874. changeSelfRod() {
  2875. let index = DataMgr.getCurBallRod();
  2876. let data = cfgTable.ballrodData[index + 1];
  2877. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2878. this.selfMySpine && this.selfMySpine.dispose();
  2879. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2880. if (data.spine) {
  2881. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2882. this.selfMySpine = new SpineMgr(data.spine, () => {
  2883. let xx = this.ui.selfEftRoot.width / 2;
  2884. let yy = this.ui.selfEftRoot.height / 2;
  2885. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2886. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  2887. outSpine.rotation = -90;
  2888. });
  2889. }
  2890. }
  2891. changeAIRod() {
  2892. let length = Object.keys(cfgTable.ballrodData).length;
  2893. let rand = Math.floor(length * Math.random()) + 1;
  2894. let data = cfgTable.ballrodData[rand];
  2895. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2896. this.aiMySpine && this.aiMySpine.dispose();
  2897. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2898. if (data.spine) {
  2899. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2900. this.aiMySpine = new SpineMgr(data.spine, () => {
  2901. let xx = this.ui.aiEftRoot.width / 2;
  2902. let yy = this.ui.aiEftRoot.height / 2;
  2903. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2904. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  2905. outSpine.rotation = -90;
  2906. });
  2907. }
  2908. }
  2909. setGanLastInfo() {
  2910. this.lastInfo.rotation = this.ui.rotation;
  2911. this.lastInfo.x = this.ui.x;
  2912. this.lastInfo.y = this.ui.y;
  2913. }
  2914. rotateSelf(flag, isRuler = false) {
  2915. let angle;
  2916. flag = flag * this.offset;
  2917. if (xGame.common.d2World.isHelpLineOnBall) {
  2918. angle = flag * this.onBallCell;
  2919. }
  2920. else {
  2921. angle = flag * this.cell;
  2922. }
  2923. if (isRuler) {
  2924. angle *= this.rulerRate;
  2925. }
  2926. this.ui.rotation += angle;
  2927. xGame.common.d2World.getHelpLine();
  2928. }
  2929. checkDistance() {
  2930. let target = xGame.common.d2World.targetBall;
  2931. let root = xGame.common.d2World.rootBall;
  2932. if (target == null) {
  2933. return 1;
  2934. }
  2935. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  2936. if (dis <= 2500) {
  2937. return 5;
  2938. }
  2939. return 1;
  2940. }
  2941. rotDest(rot) {
  2942. this.ui.rotation = rot;
  2943. xGame.common.d2World.getHelpLine();
  2944. }
  2945. storagePower(powerNum) {
  2946. let pos = (powerNum / 100) * this.moveNum;
  2947. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  2948. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  2949. this.ui.x = this.lastInfo.x + xx;
  2950. this.ui.y = this.lastInfo.y + yy;
  2951. }
  2952. shoot() {
  2953. this.storagePower(0);
  2954. this.ui.visible = false;
  2955. }
  2956. destroySelf() {
  2957. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2958. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2959. this.selfMySpine && this.selfMySpine.dispose();
  2960. this.aiMySpine && this.aiMySpine.dispose();
  2961. this.lastInfo = null;
  2962. if (!this.ui.isDisposed) {
  2963. this.ui.removeFromParent();
  2964. this.ui.dispose();
  2965. }
  2966. }
  2967. }
  2968. class ui_HelpLine extends fgui.GComponent {
  2969. static createInstance() {
  2970. return (fgui.UIPackage.createObject("game", "HelpLine"));
  2971. }
  2972. onConstruct() {
  2973. this.n10 = (this.getChild("n10"));
  2974. this.rect = (this.getChild("rect"));
  2975. this.dir11 = (this.getChild("dir11"));
  2976. this.dir = (this.getChild("dir"));
  2977. this.rootDir = (this.getChild("rootDir"));
  2978. this.dirDot = (this.getChild("dirDot"));
  2979. }
  2980. }
  2981. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  2982. class D2HelpLine {
  2983. constructor() {
  2984. this.starX = 0;
  2985. this.starY = 0;
  2986. this.ui = ui_HelpLine.createInstance();
  2987. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  2988. this.starX = this.ui.rect.x;
  2989. this.starY = this.ui.rect.y;
  2990. }
  2991. shoot() {
  2992. this.ui.visible = false;
  2993. }
  2994. destroySelf() {
  2995. if (this.ui.isDisposed) {
  2996. this.ui.removeFromParent();
  2997. this.ui.dispose();
  2998. }
  2999. }
  3000. }
  3001. class D2World extends Laya.Script {
  3002. constructor() {
  3003. super();
  3004. this.ballArr = [];
  3005. this.openCheckStill = false;
  3006. this.checkArr = [];
  3007. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3008. this.isHelpLineOnBall = false;
  3009. this.isOnSameLine = false;
  3010. this.reflectAngle = 0;
  3011. this.powerPercent = 0;
  3012. this.inHolesSpeed = [];
  3013. this.outDir = new Laya.Vector2();
  3014. this.rootDir = new Laya.Vector2();
  3015. this.aiLv = 0;
  3016. this.rootPos = new Laya.Vector2();
  3017. this.tempDir1 = new Laya.Vector2();
  3018. this.tempDir2 = new Laya.Vector2();
  3019. this.tempDir3 = new Laya.Vector2();
  3020. this.ballSize = 33;
  3021. this.destRot = 0;
  3022. }
  3023. initSelf() {
  3024. this.createBalls();
  3025. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3026. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3027. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3028. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3029. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3030. }
  3031. setBorderRect() {
  3032. let ui = xGame.common.gameUI.ui;
  3033. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3034. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3035. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3036. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3037. this.borderRect.x = starX;
  3038. this.borderRect.y = starY;
  3039. this.borderRect.width = width;
  3040. this.borderRect.height = height;
  3041. }
  3042. resetGame() {
  3043. this.openCheckStill = false;
  3044. let temp;
  3045. for (let index = 0; index < this.ballArr.length; index++) {
  3046. temp = this.ballArr[index];
  3047. temp.destroySelf();
  3048. }
  3049. xGame.common.d3World.ballRoot.destroyChildren();
  3050. xGame.common.gameUI.ui.ballNode.removeChildren();
  3051. console.log("进入摧毁逻辑");
  3052. this.d2Gan.destroySelf();
  3053. this.d2HelpLine.destroySelf();
  3054. this.ballArr = [];
  3055. }
  3056. setD2Gan() {
  3057. let ballNode = this.rootBall.ui;
  3058. let d2Gan = new D2Gan();
  3059. this.d2Gan = d2Gan;
  3060. let ganNode = d2Gan.ui;
  3061. ballNode.addChild(ganNode);
  3062. ganNode.pivotX = ganNode.pivotX;
  3063. ganNode.pivotY = ganNode.pivotY;
  3064. ganNode.x = ganNode.myIcon.width / 2;
  3065. ganNode.y = this.rootBall.gameObj.width;
  3066. d2Gan.setGanLastInfo();
  3067. }
  3068. setHelpLine() {
  3069. let d2Help = new D2HelpLine();
  3070. this.d2HelpLine = d2Help;
  3071. }
  3072. createBalls() {
  3073. let cfg;
  3074. switch (xGame.common.gameMode) {
  3075. case GameMode.classic:
  3076. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3077. break;
  3078. case GameMode.bigMove:
  3079. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3080. break;
  3081. case GameMode.placeBall:
  3082. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3083. break;
  3084. default:
  3085. break;
  3086. }
  3087. cfg = JSON.parse(JSON.stringify(cfg));
  3088. for (const key in cfg) {
  3089. if (cfg[key].value == 0) {
  3090. this.createRootBall(cfg[key]);
  3091. delete cfg[key];
  3092. break;
  3093. }
  3094. }
  3095. this.createOtherBalls(cfg);
  3096. }
  3097. createRootBall(data) {
  3098. let root = new D2Ball(true);
  3099. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3100. this.rootBall = root.d2Src;
  3101. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3102. let d3BallSrc = d3Ball.getComponent(Ball);
  3103. xGame.common.d3World.rootBall = d3Ball;
  3104. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3105. let xx = data.x;
  3106. let yy = data.y;
  3107. let numer = data.value;
  3108. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3109. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3110. this.ballArr.push(this.rootBall);
  3111. this.setD2Gan();
  3112. this.setHelpLine();
  3113. }
  3114. createOtherBalls(cfg) {
  3115. let temp;
  3116. let src;
  3117. let data;
  3118. for (const key in cfg) {
  3119. data = cfg[key];
  3120. temp = new D2Ball();
  3121. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3122. src = temp.d2Src;
  3123. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3124. src.initSelf(data.value, data.x, data.y, d3Ball);
  3125. this.ballArr.push(src);
  3126. }
  3127. }
  3128. shoot(percent) {
  3129. this.powerPercent = percent;
  3130. this.openCheckStill = true;
  3131. let d2Angle = this.d2Gan.ui.rotation;
  3132. this.rootBall.setSpeed(percent, d2Angle);
  3133. this.clearBallAllEft();
  3134. this.changePlayerView();
  3135. }
  3136. onUpdate() {
  3137. if (!this.openCheckStill)
  3138. return;
  3139. this.checkStill();
  3140. }
  3141. checkStill() {
  3142. for (let index = 0; index < this.ballArr.length; index++) {
  3143. if (!this.ballArr[index].isStill()) {
  3144. return;
  3145. }
  3146. }
  3147. xGame.eventMgr.event(ALL_BALL_STOP);
  3148. }
  3149. allBallStop() {
  3150. this.openCheckStill = false;
  3151. xGame.common.recoverCameraView();
  3152. }
  3153. waitShoot() {
  3154. if (!this.d2Gan.ui.isDisposed) {
  3155. this.d2Gan.ui.visible = true;
  3156. }
  3157. if (!this.d2HelpLine.ui.isDisposed) {
  3158. this.d2HelpLine.ui.visible = true;
  3159. }
  3160. this.clearBallAllEft();
  3161. this.showBallRightEft();
  3162. this.getHelpLine();
  3163. this.inHolesSpeed = [];
  3164. this.selectOneBall();
  3165. }
  3166. _getAllBallArr() {
  3167. let arr = this.ballArr;
  3168. let outArr = [];
  3169. for (let index = 0; index < arr.length; index++) {
  3170. if (arr[index] instanceof D2RootBallSrc)
  3171. continue;
  3172. if (arr[index].ballFunc == "ice")
  3173. continue;
  3174. if (arr[index].destroyed)
  3175. continue;
  3176. outArr.push(arr[index]);
  3177. }
  3178. return outArr;
  3179. }
  3180. _getBlackObj() {
  3181. let arr = this.ballArr;
  3182. for (let index = 0; index < arr.length; index++) {
  3183. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3184. return arr[index];
  3185. }
  3186. }
  3187. }
  3188. selectOneBall() {
  3189. let all = this._getAllBallArr();
  3190. let target;
  3191. switch (xGame.common.gameMode) {
  3192. case GameMode.classic:
  3193. if (xGame.common.gameMgr.selfTurn) {
  3194. let self = xGame.common.gameMgr.selfBallArr;
  3195. let black = this._getBlackObj();
  3196. if (xGame.common.gameMgr.ensureBallType) {
  3197. if (self.length > 0) {
  3198. let out = [];
  3199. for (let j = 0; j < all.length; j++) {
  3200. if (self.indexOf(all[j].number) > -1) {
  3201. out.push(all[j]);
  3202. }
  3203. }
  3204. target = this.selectBestEnterOne(out);
  3205. }
  3206. else {
  3207. target = this.selectBestEnterOne([black]);
  3208. }
  3209. }
  3210. else {
  3211. target = this.selectBestEnterOne(all);
  3212. }
  3213. }
  3214. else {
  3215. target = this.selectBestEnterOne(all);
  3216. }
  3217. break;
  3218. case GameMode.bigMove:
  3219. target = this.selectBestEnterOne(all);
  3220. break;
  3221. case GameMode.placeBall:
  3222. if (all.length > 0) {
  3223. target = this.selectBestEnterOne(all);
  3224. }
  3225. break;
  3226. default:
  3227. break;
  3228. }
  3229. if (target && !target.destroyed && target.onClick) {
  3230. target.onClick(0, true);
  3231. let num = -200 + xGame.common.randomNum(0, 400);
  3232. num /= 150;
  3233. if (xGame.common.longHelpLine) {
  3234. num = 0;
  3235. }
  3236. this.destRot += num;
  3237. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3238. }
  3239. }
  3240. removeOneBall(ball) {
  3241. for (let index = 0; index < this.ballArr.length; index++) {
  3242. if (this.ballArr[index].id == ball.id) {
  3243. this.ballArr.splice(index, 1);
  3244. break;
  3245. }
  3246. }
  3247. }
  3248. getHelpLine() {
  3249. this.d2HelpLine.ui.dirDot.visible = false;
  3250. this.isOnSameLine = false;
  3251. let startX = this.rootBall.gameObj.x;
  3252. let startY = this.rootBall.gameObj.y;
  3253. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3254. if (dis == null) {
  3255. this.d2HelpLine.ui.visible = false;
  3256. console.error("辅助线异常");
  3257. return;
  3258. }
  3259. this.d2HelpLine.ui.visible = true;
  3260. let angle = this.d2Gan.ui.rotation;
  3261. let radius = 16.5;
  3262. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3263. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3264. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3265. if (colliObj == null) {
  3266. this.getColliPos(disX, disY, radius, angle);
  3267. xGame.common.d2World.isHelpLineOnBall = false;
  3268. this.targetBall = null;
  3269. this.reflectAngle = 0;
  3270. this.showBallWrongEft();
  3271. }
  3272. else {
  3273. let target = colliObj.src;
  3274. let radius = 16.5;
  3275. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3276. dis1 = Math.sqrt(dis1);
  3277. let realDis = colliObj.disHon - dis1;
  3278. let dir = colliObj.dir;
  3279. let xx = startX + dir.x * realDis;
  3280. let yy = startY + dir.y * realDis;
  3281. this.getColliPos(xx, yy, radius, angle);
  3282. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3283. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3284. let offset = xGame.common.rodOffest;
  3285. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3286. this.isOnSameLine = true;
  3287. }
  3288. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3289. xGame.common.d2World.isHelpLineOnBall = true;
  3290. this.targetBall = target;
  3291. this.reflectAngle = reflectAngle;
  3292. this.showBallWrongEft();
  3293. if (xGame.common.longHelpLine) {
  3294. this.delayReflectLine(target, reflectAngle);
  3295. }
  3296. }
  3297. }
  3298. getBorderDot(startX, startY, angle) {
  3299. let radius = 17;
  3300. let distance;
  3301. let isDone;
  3302. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3303. isDone = this.judgeUpDown(distance, angle, startX);
  3304. if (isDone != null) {
  3305. return isDone;
  3306. }
  3307. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3308. isDone = this.judgeUpDown(distance, angle, startX);
  3309. if (isDone != null) {
  3310. return isDone;
  3311. }
  3312. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3313. isDone = this.judgeLeftRight(distance, angle, startY);
  3314. if (isDone != null) {
  3315. return isDone;
  3316. }
  3317. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3318. isDone = this.judgeLeftRight(distance, angle, startY);
  3319. if (isDone != null) {
  3320. return isDone;
  3321. }
  3322. }
  3323. judgeUpDown(distance, angle, startX) {
  3324. let flag = Math.sin(angle * Math.PI / 180);
  3325. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3326. if (distance >= 0) {
  3327. if (flag > 0) {
  3328. if (temp < this.borderRect.x + this.borderRect.width) {
  3329. return distance;
  3330. }
  3331. }
  3332. else {
  3333. if (temp > this.borderRect.x) {
  3334. return distance;
  3335. }
  3336. }
  3337. }
  3338. }
  3339. judgeLeftRight(distance, angle, starY) {
  3340. let flag = -Math.cos(angle * Math.PI / 180);
  3341. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3342. if (distance >= 0) {
  3343. if (flag > 0) {
  3344. if (temp < this.borderRect.y + this.borderRect.height) {
  3345. return distance;
  3346. }
  3347. }
  3348. else {
  3349. if (temp > this.borderRect.y) {
  3350. return distance;
  3351. }
  3352. }
  3353. }
  3354. }
  3355. clearBallAllEft() {
  3356. let temp;
  3357. for (let index = 0; index < this.ballArr.length; index++) {
  3358. temp = this.ballArr[index];
  3359. temp.clearBallEft();
  3360. }
  3361. }
  3362. showBallRightEft() {
  3363. let gameMgr = xGame.common.gameMgr;
  3364. let temp;
  3365. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3366. if (targetArr.length <= 0)
  3367. return;
  3368. for (let index = 0; index < this.ballArr.length; index++) {
  3369. temp = this.ballArr[index];
  3370. if (targetArr.indexOf(temp.number) > -1) {
  3371. temp.showRightEft();
  3372. }
  3373. }
  3374. }
  3375. showBallWrongEft() {
  3376. let gameMgr = xGame.common.gameMgr;
  3377. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3378. if (targetArr.length <= 0)
  3379. return;
  3380. let temp;
  3381. for (let index = 0; index < this.ballArr.length; index++) {
  3382. temp = this.ballArr[index];
  3383. if (this.targetBall && this.targetBall.number == temp.number) {
  3384. if (targetArr.indexOf(temp.number) <= -1) {
  3385. temp.showWrongEft();
  3386. }
  3387. else {
  3388. temp.clearBallWrongEft();
  3389. }
  3390. }
  3391. else {
  3392. temp.clearBallWrongEft();
  3393. }
  3394. }
  3395. }
  3396. getColliPos(x, y, radius, angle) {
  3397. this.d2HelpLine.ui.x = x;
  3398. this.d2HelpLine.ui.y = y;
  3399. let dirX = x - this.rootBall.gameObj.x;
  3400. let dirY = y - this.rootBall.gameObj.y;
  3401. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3402. if (rectH <= 0)
  3403. rectH = 0;
  3404. this.d2HelpLine.ui.rect.height = 0;
  3405. this.d2HelpLine.ui.rect.height = rectH;
  3406. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3407. if (rectH < this.rootBall.gameObj.width) {
  3408. this.d2HelpLine.ui.rect.visible = false;
  3409. }
  3410. else {
  3411. this.d2HelpLine.ui.rect.visible = true;
  3412. }
  3413. this.d2HelpLine.ui.dir.visible = false;
  3414. this.d2HelpLine.ui.rootDir.visible = false;
  3415. }
  3416. getReflectLine(x, y, radius, target) {
  3417. this.d2HelpLine.ui.dir.visible = true;
  3418. let dirX = target.x - x;
  3419. let dirY = target.y - y;
  3420. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3421. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3422. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3423. this.d2HelpLine.ui.dir.height = 48;
  3424. this.d2HelpLine.ui.dir.rotation = angle;
  3425. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3426. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3427. return angle;
  3428. }
  3429. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3430. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3431. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3432. let targetX = target.gameObj.x;
  3433. let targetY = target.gameObj.y;
  3434. this.outDir.setValue(targetX - xx, targetY - yy);
  3435. this.rootDir.setValue(rtX - xx, rtY - yy);
  3436. let ver = Math.PI / 2;
  3437. let sin = Math.sin(ver);
  3438. let cos = Math.cos(ver);
  3439. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3440. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3441. this.outDir.setValue(outX, outY);
  3442. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3443. Laya.Vector2.normalize(this.outDir, this.outDir);
  3444. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3445. if (Math.abs(result) <= 0.08) {
  3446. this.d2HelpLine.ui.rootDir.visible = false;
  3447. return;
  3448. }
  3449. if (result > 0) {
  3450. angle += 90;
  3451. }
  3452. else if (result < 0) {
  3453. angle -= 90;
  3454. }
  3455. this.d2HelpLine.ui.rootDir.visible = true;
  3456. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3457. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3458. this.d2HelpLine.ui.rootDir.rotation = angle;
  3459. }
  3460. delayReflectLine(obj, angle) {
  3461. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3462. return;
  3463. }
  3464. this.isOnSameLine = false;
  3465. let startX = obj.gameObj.x;
  3466. let startY = obj.gameObj.y;
  3467. let dis = this.getBorderDot(startX, startY, angle);
  3468. if (dis == null) {
  3469. this.d2HelpLine.ui.dirDot.visible = false;
  3470. return;
  3471. }
  3472. this.d2HelpLine.ui.visible = true;
  3473. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3474. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3475. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3476. if (colliObj == null) {
  3477. this.setDelayLine(disX, disY, obj, angle);
  3478. }
  3479. else {
  3480. let radius = 16;
  3481. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3482. dis1 = Math.sqrt(dis1);
  3483. let realDis = colliObj.disHon - dis1;
  3484. let dir = colliObj.dir;
  3485. let xx = startX + dir.x * realDis;
  3486. let yy = startY + dir.y * realDis;
  3487. this.setDelayLine(xx, yy, obj, angle);
  3488. }
  3489. }
  3490. setDelayLine(x, y, obj, angle) {
  3491. let dirX = x - obj.gameObj.x;
  3492. let dirY = y - obj.gameObj.y;
  3493. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3494. if (rectH <= 0)
  3495. rectH = 0;
  3496. this.d2HelpLine.ui.dir.height = rectH;
  3497. this.d2HelpLine.ui.dirDot.visible = true;
  3498. this.d2HelpLine.ui.dirDot.x = 17;
  3499. this.d2HelpLine.ui.dirDot.y = 17;
  3500. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3501. ;
  3502. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3503. }
  3504. changePlayerView() {
  3505. if (Math.random() >= 0.7)
  3506. return;
  3507. if (!this.targetBall) {
  3508. return;
  3509. }
  3510. if (!xGame.common.gameMgr.selfTurn)
  3511. return;
  3512. switch (xGame.common.gameMode) {
  3513. case GameMode.classic:
  3514. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3515. if (this.targetBall.number != 8) {
  3516. return;
  3517. }
  3518. }
  3519. break;
  3520. case GameMode.bigMove:
  3521. return;
  3522. case GameMode.placeBall:
  3523. break;
  3524. default:
  3525. break;
  3526. }
  3527. let startX = this.targetBall.gameObj.x;
  3528. let startY = this.targetBall.gameObj.y;
  3529. let angle = this.reflectAngle;
  3530. let dis = this.getBorderDot(startX, startY, angle);
  3531. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3532. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3533. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3534. if (colliObj) {
  3535. return;
  3536. }
  3537. let offset = 40;
  3538. let posObj = xGame.common.gameMgr.posObj;
  3539. let temp;
  3540. let radius;
  3541. let tarX, tarY;
  3542. for (const key in posObj) {
  3543. temp = posObj[key];
  3544. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3545. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3546. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3547. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3548. xGame.common.showOneCamera("angle" + key);
  3549. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3550. Laya.physicsTimer.scale = 0.7;
  3551. break;
  3552. }
  3553. }
  3554. }
  3555. selectBestEnterOne(arr) {
  3556. this.aiLv = xGame.tools.random(1, 11);
  3557. this.aiLv = 10;
  3558. this.wBall = xGame.common.d2World.rootBall;
  3559. this.rootPos.x = this.wBall.gameObj.x;
  3560. this.rootPos.y = this.wBall.gameObj.y;
  3561. this.initHoleBall(arr);
  3562. return this.selectBall();
  3563. }
  3564. selectBall() {
  3565. let ball = null;
  3566. this.destRot = 0;
  3567. let ai = 110 - this.aiLv * 10;
  3568. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3569. let score = false;
  3570. if (this.scoreBall.length < 1) {
  3571. if (this.lineBall.length < 1) {
  3572. for (let i = 0; i < this.kickBall.length; i++) {
  3573. let list = [];
  3574. let bo = this.kickBall[i];
  3575. let bobj = bo.gameObj;
  3576. let rect = xGame.common.d2World.borderRect;
  3577. let mobj = this.wBall.gameObj;
  3578. let minb = bobj.y - rect.y - 20;
  3579. let minw = mobj.y - rect.y - 50;
  3580. if (minb > 0 && minw > 0) {
  3581. let dlenx = 0;
  3582. let dleny = mobj.y - rect.y;
  3583. let spx = mobj.x;
  3584. let spy = rect.y - dleny;
  3585. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3586. }
  3587. minb = rect.y + rect.height - bobj.y - 20;
  3588. minw = rect.y + rect.height - mobj.y - 50;
  3589. if (minb > 0 && minw > 0) {
  3590. let dlenx = 0;
  3591. let dleny = rect.y + rect.height - mobj.y;
  3592. let spx = mobj.x;
  3593. let spy = rect.y + rect.height + dleny;
  3594. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3595. }
  3596. minb = bobj.x - rect.x - 20;
  3597. minw = mobj.x - rect.x - 50;
  3598. if (minb > 0 && minw > 0) {
  3599. let dlenx = mobj.x - rect.x;
  3600. let dleny = 0;
  3601. let spx = rect.x - dlenx;
  3602. let spy = mobj.y;
  3603. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3604. }
  3605. minb = rect.x + rect.width - bobj.x - 20;
  3606. minw = rect.x + rect.width - mobj.x - 50;
  3607. if (minb > 0 && minw > 0) {
  3608. let dlenx = rect.x + rect.width - mobj.x;
  3609. let dleny = 0;
  3610. let spx = rect.x + rect.width + dlenx;
  3611. let spy = mobj.y;
  3612. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3613. }
  3614. list.sort(function (a, b) {
  3615. return a.order - b.order;
  3616. });
  3617. for (let i = 0; i < list.length; i++) {
  3618. let data = list[i];
  3619. let mx = mobj.x - bobj.x;
  3620. let my = mobj.y - bobj.y;
  3621. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3622. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3623. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3624. if (num > 1)
  3625. num = 1;
  3626. let cos = Math.acos(num);
  3627. if (cos > 1.57)
  3628. cos = 1.57;
  3629. else if (cos < 0.01)
  3630. cos = 0.01;
  3631. let tan = Math.tan(cos);
  3632. let dx = tan * data.dleny;
  3633. let dy = tan * data.dlenx;
  3634. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3635. if (Math.abs(bx - 667) < 40)
  3636. continue;
  3637. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3638. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3639. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3640. this.forceMax = dis * 0.08;
  3641. this.destRot += mis * 0.1;
  3642. this.setKick(bx, by);
  3643. return true;
  3644. }
  3645. }
  3646. }
  3647. }
  3648. else {
  3649. ball = xGame.common.getRandArrEle(this.lineBall);
  3650. }
  3651. }
  3652. else {
  3653. for (let i = 0; i < this.scoreBall.length; i++) {
  3654. if (i < this.scoreBall.length - 1) {
  3655. let rand = 70 + this.aiLv * 10 + i * 10;
  3656. if (xGame.tools.random(0, 100) < rand) {
  3657. ball = this.scoreBall[i];
  3658. break;
  3659. }
  3660. }
  3661. else {
  3662. ball = this.scoreBall[i];
  3663. break;
  3664. }
  3665. }
  3666. score = true;
  3667. this.selectNum++;
  3668. }
  3669. if (!ball)
  3670. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3671. let dx = ball.gameObj.x;
  3672. let dy = ball.gameObj.y;
  3673. let kickAngle = 0;
  3674. if (score) {
  3675. dx = ball.kickPos.x;
  3676. dy = ball.kickPos.y;
  3677. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3678. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3679. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3680. if (adot > 1)
  3681. adot = 1;
  3682. kickAngle = Math.acos(adot) * 57.3;
  3683. if (kickAngle > 45) {
  3684. let kdx = ball.kickPos.x - ball.gameObj.x;
  3685. let kdy = ball.kickPos.y - ball.gameObj.y;
  3686. dx = ball.kickPos.x - kdx * mis * 0.3;
  3687. dy = ball.kickPos.y - kdy * mis * 0.3;
  3688. }
  3689. else
  3690. this.destRot += mis;
  3691. }
  3692. else if (ball.poleAngle != 0) {
  3693. this.destRot += ball.poleAngle;
  3694. }
  3695. if (xGame.common.gameMode == 0) {
  3696. let af = kickAngle * 0.08;
  3697. this.forceMax = ball.hard * 0.1 + af * af;
  3698. }
  3699. this.setKick(dx, dy);
  3700. return ball;
  3701. }
  3702. initHoleBall(arr) {
  3703. this.kickBall = [];
  3704. this.lineBall = [];
  3705. this.scoreBall = [];
  3706. this.holeBall = [];
  3707. this.selectNum = 0;
  3708. this.forceNum = 0;
  3709. this.forceMax = 0;
  3710. this.turnNum = 0;
  3711. let list = arr;
  3712. let holes = xGame.common.gameMgr.holePosList;
  3713. let self = xGame.common.aiPlayer;
  3714. for (let i = 0; i < list.length; i++) {
  3715. let obj = list[i];
  3716. if (!obj)
  3717. continue;
  3718. obj.kickPos.x = 0;
  3719. obj.kickPos.y = 0;
  3720. obj.poleAngle = 0;
  3721. obj.hard = 0;
  3722. obj.borderDis = 0;
  3723. obj.kickAngle = 180;
  3724. let b = obj.gameObj;
  3725. let wbp = this.rootPos;
  3726. let bx = wbp.x - b.x;
  3727. let by = wbp.y - b.y;
  3728. obj.borderDis = xGame.tools.random(0, 100);
  3729. this.kickBall.push(obj);
  3730. if (!this.isLine(wbp, obj))
  3731. continue;
  3732. obj.kickAngle = xGame.tools.random(90, 180);
  3733. obj.kickPos.x = b.x;
  3734. obj.kickPos.y = b.y;
  3735. this.lineBall.push(obj);
  3736. let minDis = 999999;
  3737. let hole = false;
  3738. for (let j = 0; j < holes.length; j++) {
  3739. let hp = holes[j];
  3740. if (bx >= 0 && hp.x > b.x + 100)
  3741. continue;
  3742. if (bx <= 0 && hp.x < b.x - 100)
  3743. continue;
  3744. if (by < -10 && hp.y < wbp.y)
  3745. continue;
  3746. if (by > 10 && hp.y > wbp.y)
  3747. continue;
  3748. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3749. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3750. if (dis < minDis) {
  3751. let dx = b.x - this.tempDir1.x * this.ballSize;
  3752. let dy = b.y - this.tempDir1.y * this.ballSize;
  3753. this.tempDir3.x = this.tempDir1.x;
  3754. this.tempDir3.y = this.tempDir1.y;
  3755. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3756. obj.kickPos.x = dx;
  3757. obj.kickPos.y = dy;
  3758. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3759. if (num > 1)
  3760. num = 1;
  3761. obj.kickAngle = Math.acos(num) * 57.3;
  3762. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3763. dis = dis * 2;
  3764. if (Math.abs(hp.x - 600) < 100)
  3765. dis += 50;
  3766. obj.hard = dis + obj.kickAngle * 3;
  3767. hole = true;
  3768. }
  3769. }
  3770. }
  3771. }
  3772. if (hole) {
  3773. this.scoreBall.push(obj);
  3774. this.holeBall.push(obj);
  3775. }
  3776. }
  3777. this.scoreBall.sort(function (a, b) {
  3778. return a.hard - b.hard;
  3779. });
  3780. this.holeBall.sort(function (a, b) {
  3781. return a.kickAngle - b.kickAngle;
  3782. });
  3783. this.kickBall.sort(function (a, b) {
  3784. return a.borderDis - b.borderDis;
  3785. });
  3786. }
  3787. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3788. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3789. let balls = xGame.common.d2World.ballArr;
  3790. let max = xGame.tools.getDis(hx, hy, bx, by);
  3791. for (let index = 0; index < balls.length; index++) {
  3792. let obj = balls[index];
  3793. if (obj.number == 0)
  3794. continue;
  3795. if (obj.number == bn || obj.number == dn)
  3796. continue;
  3797. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3798. if (dis * dis > max)
  3799. continue;
  3800. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3801. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3802. if (num > 1)
  3803. num = 1;
  3804. if (num < 0)
  3805. continue;
  3806. let gap = Math.sin(Math.acos(num)) * dis;
  3807. if (gap < this.ballSize)
  3808. return true;
  3809. }
  3810. return false;
  3811. }
  3812. isLine(xy, ball) {
  3813. let bx = xy.x;
  3814. let by = xy.y;
  3815. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3816. let dis = ball.getDestDis(xy);
  3817. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3818. let sin = Math.sin(angle);
  3819. let cos = Math.cos(angle);
  3820. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3821. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3822. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3823. let dx = bx + this.tempDir2.x * dis;
  3824. let dy = by + this.tempDir2.y * dis;
  3825. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3826. sin = Math.sin(-angle);
  3827. cos = Math.cos(-angle);
  3828. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3829. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3830. dx = bx + this.tempDir2.x * dis;
  3831. dy = by + this.tempDir2.y * dis;
  3832. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  3833. if (isr && isl)
  3834. return false;
  3835. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  3836. }
  3837. return true;
  3838. }
  3839. setKick(dx, dy) {
  3840. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  3841. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3842. this.tempDir1.x = 0;
  3843. this.tempDir1.y = 1;
  3844. this.tempDir2.y = -this.tempDir2.y;
  3845. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3846. if (num > 1)
  3847. num = 1;
  3848. let rot = Math.acos(num) * 57.3;
  3849. if (this.tempDir2.x < 0)
  3850. rot = 360 - rot;
  3851. this.destRot += rot;
  3852. }
  3853. }
  3854. class ui_UIGame extends fgui.GComponent {
  3855. static createInstance() {
  3856. return (fgui.UIPackage.createObject("game", "UIGame"));
  3857. }
  3858. onConstruct() {
  3859. this.c1 = this.getController("c1");
  3860. this.d3Root = (this.getChild("d3Root"));
  3861. this.clickNode = (this.getChild("clickNode"));
  3862. this.d2Root = (this.getChild("d2Root"));
  3863. this.topNode = (this.getChild("topNode"));
  3864. this.n72 = (this.getChild("n72"));
  3865. this.n40 = (this.getChild("n40"));
  3866. this.rulerNode = (this.getChild("rulerNode"));
  3867. this.rulerClickNode = (this.getChild("rulerClickNode"));
  3868. this.n50 = (this.getChild("n50"));
  3869. this.keduNode = (this.getChild("keduNode"));
  3870. this.powerTxt = (this.getChild("powerTxt"));
  3871. this.powerNode = (this.getChild("powerNode"));
  3872. this.colorNode = (this.getChild("colorNode"));
  3873. this.powerEft = (this.getChild("powerEft"));
  3874. this.myPowerNode = (this.getChild("myPowerNode"));
  3875. this.ganNode = (this.getChild("ganNode"));
  3876. this.rodMethodNode = (this.getChild("rodMethodNode"));
  3877. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  3878. this.placeNormalNode = (this.getChild("placeNormalNode"));
  3879. this.skillRod = (this.getChild("skillRod"));
  3880. this.border = (this.getChild("border"));
  3881. this.bigSkillNode = (this.getChild("bigSkillNode"));
  3882. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  3883. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  3884. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  3885. this.awardSpineNode = (this.getChild("awardSpineNode"));
  3886. this.guanyuNode = (this.getChild("guanyuNode"));
  3887. this.helpBtn = (this.getChild("helpBtn"));
  3888. this.wordsBtn = (this.getChild("wordsBtn"));
  3889. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  3890. this.returnBtn = (this.getChild("returnBtn"));
  3891. this.ballNode = (this.getChild("ballNode"));
  3892. this.whiteAni = (this.getChild("whiteAni"));
  3893. this.blackAni = (this.getChild("blackAni"));
  3894. this.selfTurn = (this.getChild("selfTurn"));
  3895. this.aiTurn = (this.getChild("aiTurn"));
  3896. this.deskNode = (this.getChild("deskNode"));
  3897. this.moveNode = (this.getChild("moveNode"));
  3898. this.selfTalk = (this.getChild("selfTalk"));
  3899. this.aiTalk = (this.getChild("aiTalk"));
  3900. this.d2Node = (this.getChild("d2Node"));
  3901. this.snowNode = (this.getChild("snowNode"));
  3902. this.guide2 = (this.getChild("guide2"));
  3903. this.guide1 = (this.getChild("guide1"));
  3904. this.guide3 = (this.getChild("guide3"));
  3905. this.guideNode = (this.getChild("guideNode"));
  3906. }
  3907. }
  3908. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  3909. class ui_UIGameEnd extends fgui.GComponent {
  3910. static createInstance() {
  3911. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  3912. }
  3913. onConstruct() {
  3914. this.c1 = this.getController("c1");
  3915. this.n22 = (this.getChild("n22"));
  3916. this.n2 = (this.getChild("n2"));
  3917. this.n52 = (this.getChild("n52"));
  3918. this.n53 = (this.getChild("n53"));
  3919. this.coinNode = (this.getChild("coinNode"));
  3920. this.closeNode = (this.getChild("closeNode"));
  3921. this.moneyNode = (this.getChild("moneyNode"));
  3922. this.secretary = (this.getChild("secretary"));
  3923. this.n27 = (this.getChild("n27"));
  3924. this.n29 = (this.getChild("n29"));
  3925. this.talkNode = (this.getChild("talkNode"));
  3926. this.n38 = (this.getChild("n38"));
  3927. this.n39 = (this.getChild("n39"));
  3928. this.n40 = (this.getChild("n40"));
  3929. this.starNumNode = (this.getChild("starNumNode"));
  3930. this.awardNode = (this.getChild("awardNode"));
  3931. this.n47 = (this.getChild("n47"));
  3932. this.conditionNode = (this.getChild("conditionNode"));
  3933. this.isGetAward = (this.getChild("isGetAward"));
  3934. this.leftBtn = (this.getChild("leftBtn"));
  3935. this.rightBtn = (this.getChild("rightBtn"));
  3936. this.btnNode = (this.getChild("btnNode"));
  3937. }
  3938. }
  3939. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  3940. class ui_UIAddCoin extends fgui.GComponent {
  3941. static createInstance() {
  3942. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  3943. }
  3944. onConstruct() {
  3945. this.n11 = (this.getChild("n11"));
  3946. this.myNode = (this.getChild("myNode"));
  3947. this.t0 = this.getTransition("t0");
  3948. }
  3949. }
  3950. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  3951. class UIAddCoin extends UIBase {
  3952. constructor() {
  3953. super();
  3954. this.coinNum = 2000;
  3955. }
  3956. onConstructor() {
  3957. this.ui = ui_UIAddCoin.createInstance();
  3958. this.contentPane = this.ui;
  3959. this.isEject = false;
  3960. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  3961. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  3962. }
  3963. show() {
  3964. super.show();
  3965. this.ui.t0.play();
  3966. }
  3967. videoAddCoin() {
  3968. Moyu.showVideoAd(() => {
  3969. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  3970. this.hide();
  3971. }, EAdType.addFailCoin);
  3972. }
  3973. }
  3974. UIAddCoin.uiName = "UIAddCoin";
  3975. class ui_UIInvitation extends fgui.GComponent {
  3976. static createInstance() {
  3977. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  3978. }
  3979. onConstruct() {
  3980. this.n14 = (this.getChild("n14"));
  3981. this.myNode = (this.getChild("myNode"));
  3982. this.t0 = this.getTransition("t0");
  3983. }
  3984. }
  3985. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  3986. class UIInvitation extends UIBase {
  3987. constructor() {
  3988. super();
  3989. }
  3990. onConstructor() {
  3991. this.ui = ui_UIInvitation.createInstance();
  3992. this.contentPane = this.ui;
  3993. this.isEject = false;
  3994. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  3995. }
  3996. show() {
  3997. super.show();
  3998. }
  3999. enterGame() {
  4000. xGame.common.gameMode = GameMode.classic;
  4001. DataMgr.setChallengeTimes(1);
  4002. xGame.common.passAwardCoin = 2000;
  4003. let need = xGame.common.classicNiceNeddCoin;
  4004. if (DataMgr.coinEnough(need)) {
  4005. DataMgr.setCoin(-need);
  4006. xGame.eventMgr.event(RESTART_GAME, true);
  4007. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4008. }
  4009. else {
  4010. xGame.eventMgr.event(RESTART_GAME, true);
  4011. }
  4012. this.hide();
  4013. }
  4014. hide() {
  4015. super.hide();
  4016. }
  4017. }
  4018. UIInvitation.uiName = "UIInvitation";
  4019. class ui_UIMain extends fgui.GComponent {
  4020. static createInstance() {
  4021. return (fgui.UIPackage.createObject("game", "UIMain"));
  4022. }
  4023. onConstruct() {
  4024. this.n47 = (this.getChild("n47"));
  4025. this.n10 = (this.getChild("n10"));
  4026. this.secretary = (this.getChild("secretary"));
  4027. this.n33 = (this.getChild("n33"));
  4028. this.shopBtn = (this.getChild("shopBtn"));
  4029. this.moneyNode = (this.getChild("moneyNode"));
  4030. this.headNode = (this.getChild("headNode"));
  4031. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4032. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4033. this.classicBtn = (this.getChild("classicBtn"));
  4034. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4035. this.globalBtn = (this.getChild("globalBtn"));
  4036. this.n20 = (this.getChild("n20"));
  4037. this.n21 = (this.getChild("n21"));
  4038. this.n22 = (this.getChild("n22"));
  4039. this.n31 = (this.getChild("n31"));
  4040. this.n32 = (this.getChild("n32"));
  4041. this.n64 = (this.getChild("n64"));
  4042. this.n66 = (this.getChild("n66"));
  4043. this.n44 = (this.getChild("n44"));
  4044. this.signBtn = (this.getChild("signBtn"));
  4045. this.drawBtn = (this.getChild("drawBtn"));
  4046. this.settingNode = (this.getChild("settingNode"));
  4047. this.n45 = (this.getChild("n45"));
  4048. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4049. this.n85 = (this.getChild("n85"));
  4050. this.rankBtn = (this.getChild("rankBtn"));
  4051. this.n46 = (this.getChild("n46"));
  4052. this.liucheng1 = (this.getChild("liucheng1"));
  4053. this.rightBtn = (this.getChild("rightBtn"));
  4054. this.n75 = (this.getChild("n75"));
  4055. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4056. this.liucheng2 = (this.getChild("liucheng2"));
  4057. this.guideBtn = (this.getChild("guideBtn"));
  4058. this.n73 = (this.getChild("n73"));
  4059. this.wordsNode = (this.getChild("wordsNode"));
  4060. this.enterGuide = (this.getChild("enterGuide"));
  4061. this.talkNode = (this.getChild("talkNode"));
  4062. this.n83 = (this.getChild("n83"));
  4063. this.n84 = (this.getChild("n84"));
  4064. }
  4065. }
  4066. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4067. class ui_UIMoyu extends fgui.GComponent {
  4068. static createInstance() {
  4069. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4070. }
  4071. onConstruct() {
  4072. this.ageTip = (this.getChild("ageTip"));
  4073. this.mainBg = (this.getChild("mainBg"));
  4074. this.xyNode = (this.getChild("xyNode"));
  4075. this.rnNode = (this.getChild("rnNode"));
  4076. this.fcmNode = (this.getChild("fcmNode"));
  4077. this.ageNode = (this.getChild("ageNode"));
  4078. this.tipNode = (this.getChild("tipNode"));
  4079. this.msgNode = (this.getChild("msgNode"));
  4080. }
  4081. }
  4082. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4083. class MoyuMgr {
  4084. static initMoyu() {
  4085. this.moyuView = new MoyuView();
  4086. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4087. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4088. this.moyuView.ui.displayObject.zOrder = 1000;
  4089. this.moyuView.init();
  4090. this.moyuView.showTip(true);
  4091. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4092. window['XApk'] = this;
  4093. }
  4094. static showAge(show) {
  4095. if (this.moyuView)
  4096. this.moyuView.showAge(show);
  4097. }
  4098. static onPlatMsg(idx) {
  4099. if (!MoyuMgr.moyuView)
  4100. return;
  4101. if (idx == '0') {
  4102. MoyuMgr.moyuView.showTip(false);
  4103. }
  4104. }
  4105. static showAgree(call) {
  4106. if (this.moyuView)
  4107. this.moyuView.showAgree(call);
  4108. else
  4109. call && call();
  4110. }
  4111. static showXy(type = 1) {
  4112. if (this.moyuView)
  4113. this.moyuView.showXy(type);
  4114. }
  4115. }
  4116. MoyuMgr.isAdvise = false;
  4117. class MoyuView {
  4118. constructor() {
  4119. this.ysxyNum = 1;
  4120. this.ysJson = null;
  4121. this.ui = ui_UIMoyu.createInstance();
  4122. }
  4123. init() {
  4124. this.ui.mainBg.visible = false;
  4125. this.ui.xyNode.visible = false;
  4126. this.ui.ageNode.visible = false;
  4127. this.ui.tipNode.visible = false;
  4128. this.ui.rnNode.visible = false;
  4129. this.ui.fcmNode.visible = false;
  4130. this.ui.ageTip.visible = false;
  4131. this.ui.msgNode.visible = false;
  4132. this.ui.visible = false;
  4133. this.ui.xyNode.xyList.setVirtual();
  4134. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4135. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4136. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4137. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4138. this.ui.xyNode.btnKnown.visible = false;
  4139. this.ui.xyNode.xy1.visible = false;
  4140. this.ui.xyNode.xy2.visible = false;
  4141. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4142. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4143. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4144. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4145. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4146. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4147. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4148. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4149. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4150. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4151. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4152. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4153. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4154. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4155. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4156. this.ysxyNum = 2;
  4157. }
  4158. }
  4159. onClick(obj) {
  4160. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4161. switch (obj) {
  4162. case this.ui.ageTip:
  4163. if (Moyu.isTTApk) {
  4164. this.ui.ageNode.visible = true;
  4165. this.ui.mainBg.visible = true;
  4166. }
  4167. break;
  4168. case this.ui.tipNode:
  4169. this.showTip(false);
  4170. break;
  4171. case this.ui.ageNode.btnAge:
  4172. this.ui.ageNode.visible = false;
  4173. this.ui.mainBg.visible = false;
  4174. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4175. this.ui.visible = false;
  4176. break;
  4177. case this.ui.xyNode.btnXy3:
  4178. case this.ui.xyNode.btnXy1:
  4179. this.loadXy(1);
  4180. break;
  4181. case this.ui.xyNode.btnXy2:
  4182. this.loadXy(2);
  4183. break;
  4184. case this.ui.xyNode.btnBack:
  4185. this.ui.xyNode.xy1.visible = true;
  4186. this.ui.xyNode.xy2.visible = false;
  4187. break;
  4188. case this.ui.xyNode.btnKnown:
  4189. this.ui.xyNode.visible = false;
  4190. this.ui.mainBg.visible = false;
  4191. this.ui.visible = false;
  4192. break;
  4193. case this.ui.rnNode.btnCheck:
  4194. this.check();
  4195. break;
  4196. case this.ui.rnNode.btnExit:
  4197. case this.ui.xyNode.btnNo:
  4198. this.ysxyNum--;
  4199. if (this.ysxyNum > 0)
  4200. this.showMsg("再次拒绝退出游戏");
  4201. else {
  4202. Moyu.userAgree(false);
  4203. Moyu.exit();
  4204. }
  4205. break;
  4206. case this.ui.xyNode.btnSure:
  4207. case this.ui.xyNode.btnYes:
  4208. DataMgr.userData.isAgree = true;
  4209. DataMgr.saveUserData();
  4210. this.onAgree();
  4211. break;
  4212. case this.ui.rnNode.btnDone:
  4213. this.ui.rnNode.visible = false;
  4214. this.ui.visible = false;
  4215. break;
  4216. case this.ui.fcmNode.btnRn:
  4217. this.showRn();
  4218. break;
  4219. }
  4220. }
  4221. showTip(show) {
  4222. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4223. return;
  4224. if (show) {
  4225. MoyuMgr.isAdvise = true;
  4226. this.ui.visible = true;
  4227. this.ui.tipNode.visible = true;
  4228. this.ui.tipNode.alpha = 1;
  4229. Laya.timer.once(1000, this, this.showTip, [false]);
  4230. }
  4231. else {
  4232. this.ui.tipNode.alpha = 1;
  4233. this.ui.tipNode.visible = true;
  4234. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4235. this.ui.tipNode.visible = false;
  4236. MoyuMgr.isAdvise = false;
  4237. }), 1000);
  4238. }
  4239. }
  4240. showAge(show, px = 0, py = 0) {
  4241. if (Moyu.platType > 10 && !Moyu.isIos) {
  4242. this.ui.ageTip.x = px;
  4243. this.ui.ageTip.y = py;
  4244. this.ui.ageTip.visible = show;
  4245. if (show)
  4246. this.ui.visible = true;
  4247. }
  4248. }
  4249. showAgree(call) {
  4250. this.agreeCall = call;
  4251. this.onAgree();
  4252. return;
  4253. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4254. this.showXy(0);
  4255. }
  4256. else
  4257. this.onAgree();
  4258. }
  4259. onAgree() {
  4260. if (!this.ui.ageNode.visible)
  4261. this.ui.visible = false;
  4262. this.ui.xyNode.visible = false;
  4263. Moyu.userAgree(true);
  4264. this.showAge(false);
  4265. this.agreeCall && this.agreeCall();
  4266. this.showRn();
  4267. }
  4268. showMsg(txt) {
  4269. this.ui.msgNode.txtMsg.text = txt;
  4270. this.ui.msgNode.visible = true;
  4271. this.ui.msgNode.alpha = 1;
  4272. this.ui.visible = true;
  4273. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4274. this.ui.msgNode.visible = false;
  4275. }), 2500, true);
  4276. }
  4277. showRn() {
  4278. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4279. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4280. this.ui.rnNode.rn1.visible = true;
  4281. this.ui.rnNode.rn2.visible = false;
  4282. this.ui.rnNode.rn3.visible = false;
  4283. this.ui.rnNode.rn4.visible = false;
  4284. this.ui.rnNode.visible = true;
  4285. this.ui.mainBg.visible = true;
  4286. this.ui.rnNode.btnDone.visible = false;
  4287. this.ui.rnNode.btnExit.visible = true;
  4288. this.ui.rnNode.btnCheck.visible = true;
  4289. this.ui.fcmNode.visible = false;
  4290. this.ui.visible = true;
  4291. return;
  4292. }
  4293. }
  4294. this.showFcm();
  4295. }
  4296. showFcm() {
  4297. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4298. Moyu.initFCM(true);
  4299. if (Moyu.gameTime < 1)
  4300. this.fcmLoop();
  4301. else if (Moyu.gameTime < 999)
  4302. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4303. }
  4304. }
  4305. fcmLoop() {
  4306. if (Moyu.gameTime < 1) {
  4307. this.ui.rnNode.visible = false;
  4308. this.ui.fcmNode.visible = true;
  4309. this.ui.mainBg.visible = true;
  4310. this.ui.visible = true;
  4311. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4312. Laya.timer.clear(this.ui, this.fcmLoop);
  4313. }
  4314. }
  4315. check() {
  4316. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4317. this.ui.rnNode.rn1.visible = false;
  4318. this.ui.rnNode.rn2.visible = false;
  4319. this.ui.rnNode.rn4.visible = true;
  4320. }
  4321. else if (this.ui.rnNode.rn4.visible) {
  4322. let name = this.ui.rnNode.inputName.text;
  4323. let code = this.ui.rnNode.inputCode.text;
  4324. if (code && code.length == 18) {
  4325. this.ui.rnNode.rn1.visible = false;
  4326. this.ui.rnNode.rn4.visible = false;
  4327. Moyu.authenticate(name, code, (res) => {
  4328. this.ui.rnNode.rn2.visible = !res;
  4329. this.ui.rnNode.rn3.visible = res;
  4330. this.ui.rnNode.btnDone.visible = res;
  4331. this.ui.rnNode.btnExit.visible = !res;
  4332. this.ui.rnNode.btnCheck.visible = !res;
  4333. if (res)
  4334. this.showFcm();
  4335. });
  4336. }
  4337. else
  4338. this.showMsg("信息填写不完整");
  4339. }
  4340. }
  4341. loadXy(type = 0) {
  4342. this.ui.xyNode.xy1.visible = false;
  4343. this.ui.xyNode.xy2.visible = true;
  4344. this.ui.xyNode.xyList.scrollToView(0);
  4345. if (type == 1) {
  4346. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4347. }
  4348. else if (type == 2) {
  4349. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4350. }
  4351. }
  4352. showXy(type = 0) {
  4353. this.xyBtn();
  4354. if (type == 0) {
  4355. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4356. this.ui.xyNode.btnSure.visible = true;
  4357. }
  4358. else {
  4359. this.ui.xyNode.btnYes.visible = true;
  4360. this.ui.xyNode.btnNo.visible = true;
  4361. }
  4362. }
  4363. else {
  4364. this.ui.xyNode.btnKnown.visible = true;
  4365. this.ui.mainBg.visible = true;
  4366. }
  4367. this.ui.xyNode.xy1.visible = true;
  4368. this.ui.xyNode.xy2.visible = false;
  4369. this.ui.xyNode.visible = true;
  4370. this.ui.visible = true;
  4371. }
  4372. xyBtn() {
  4373. this.ui.xyNode.btnSure.visible = false;
  4374. this.ui.xyNode.btnYes.visible = false;
  4375. this.ui.xyNode.btnNo.visible = false;
  4376. this.ui.xyNode.btnKnown.visible = false;
  4377. {
  4378. this.ui.xyNode.btnXy3.visible = false;
  4379. this.ui.xyNode.btnXy2.visible = true;
  4380. this.ui.xyNode.btnXy1.visible = true;
  4381. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4382. }
  4383. }
  4384. createXY(json) {
  4385. this.ysJson = json.content;
  4386. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4387. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4388. this.ui.xyNode.xy2.visible = true;
  4389. }
  4390. renderListItem(idx, cell) {
  4391. let xy = this.ysJson[idx];
  4392. cell.height = xy.line * 30;
  4393. cell.xyItem.text = xy.text;
  4394. }
  4395. onDestroy() {
  4396. this.agreeCall = null;
  4397. }
  4398. }
  4399. class SettingNode {
  4400. constructor(ui) {
  4401. this.showSetting = false;
  4402. this.openSound = true;
  4403. this.openShake = true;
  4404. this.ui = ui;
  4405. this.ui.soundBtn.onClick(this, this.switchSound);
  4406. this.ui.shakeBtn.onClick(this, this.switchShake);
  4407. this.ui.xyBtn.onClick(this, this.onXy);
  4408. this.ui.clickNode.onClick(this, this.changeSetting);
  4409. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4410. }
  4411. changeSetting() {
  4412. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4413. this.showSetting = !this.showSetting;
  4414. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4415. }
  4416. switchSound() {
  4417. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4418. this.openSound = !this.openSound;
  4419. Moyu.onSetting(this.openSound, this.openShake);
  4420. xGame.soundMgr.onSetting(this.openSound);
  4421. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4422. }
  4423. switchShake() {
  4424. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4425. this.openShake = !this.openShake;
  4426. Moyu.onSetting(this.openSound, this.openShake);
  4427. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4428. }
  4429. onXy() {
  4430. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4431. MoyuMgr.showXy(1);
  4432. }
  4433. }
  4434. class ui_UILevelDisplay extends fgui.GComponent {
  4435. static createInstance() {
  4436. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4437. }
  4438. onConstruct() {
  4439. this.n9 = (this.getChild("n9"));
  4440. this.myNode = (this.getChild("myNode"));
  4441. this.closeNode = (this.getChild("closeNode"));
  4442. }
  4443. }
  4444. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4445. class ui_UILevelProp extends fgui.GComponent {
  4446. static createInstance() {
  4447. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4448. }
  4449. onConstruct() {
  4450. this.n16 = (this.getChild("n16"));
  4451. this.myNode = (this.getChild("myNode"));
  4452. this.closeBtn = (this.getChild("closeBtn"));
  4453. this.moneyNode = (this.getChild("moneyNode"));
  4454. this.t1 = this.getTransition("t1");
  4455. }
  4456. }
  4457. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4458. class ui_ShowItem extends fgui.GComponent {
  4459. static createInstance() {
  4460. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4461. }
  4462. onConstruct() {
  4463. this.myImg = (this.getChild("myImg"));
  4464. }
  4465. }
  4466. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4467. class ShowItem {
  4468. constructor() {
  4469. this.ui = ui_ShowItem.createInstance();
  4470. }
  4471. destroySelf() {
  4472. if (!this.ui.isDisposed) {
  4473. this.ui.removeFromParent();
  4474. this.ui.dispose();
  4475. }
  4476. }
  4477. setParent(parent) {
  4478. parent.addChild(this.ui);
  4479. }
  4480. setPos(x, y) {
  4481. this.ui.x = x;
  4482. this.ui.y = y;
  4483. }
  4484. setUrl(index) {
  4485. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4486. }
  4487. }
  4488. class ui_UIPower extends fgui.GComponent {
  4489. static createInstance() {
  4490. return (fgui.UIPackage.createObject("game", "UIPower"));
  4491. }
  4492. onConstruct() {
  4493. this.n11 = (this.getChild("n11"));
  4494. this.myNode = (this.getChild("myNode"));
  4495. this.t0 = this.getTransition("t0");
  4496. }
  4497. }
  4498. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4499. class UIPower extends UIBase {
  4500. constructor() {
  4501. super();
  4502. }
  4503. onConstructor() {
  4504. this.ui = ui_UIPower.createInstance();
  4505. this.contentPane = this.ui;
  4506. this.isEject = false;
  4507. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4508. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4509. }
  4510. show() {
  4511. super.show();
  4512. this.ui.t0.play();
  4513. }
  4514. videoGetPower() {
  4515. Moyu.showVideoAd(() => {
  4516. DataMgr.setPower(xGame.common.videoPower, true);
  4517. xGame.eventMgr.event(POWER_TIME);
  4518. this.hide();
  4519. }, EAdType.getPower);
  4520. }
  4521. }
  4522. UIPower.uiName = "UIPower";
  4523. class UILevelProp extends UIBase {
  4524. constructor() {
  4525. super();
  4526. this.firstPos = 385;
  4527. this.secondPos = 467;
  4528. this.showItemArr = [];
  4529. }
  4530. onConstructor() {
  4531. this.ui = ui_UILevelProp.createInstance();
  4532. this.contentPane = this.ui;
  4533. this.isEject = false;
  4534. this.addUIClick(this.ui.closeBtn, this.hide);
  4535. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4536. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4537. }
  4538. show(level) {
  4539. super.show();
  4540. this.ui.t1.play();
  4541. this.level = level;
  4542. this.data = cfgTable.placeballData[this.level];
  4543. this.updateSelf();
  4544. this.showPreView();
  4545. this.moneyNode.ui.c1.selectedIndex = 2;
  4546. this.moneyNode.checkPowerTime();
  4547. this.moneyNode.powerChange();
  4548. }
  4549. showPreView() {
  4550. let item;
  4551. let data;
  4552. for (let index = 0; index < this.showItemArr.length; index++) {
  4553. item = this.showItemArr[index];
  4554. item.destroySelf();
  4555. }
  4556. this.showItemArr = [];
  4557. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4558. for (const key in cfgData) {
  4559. data = cfgData[key];
  4560. item = new ShowItem();
  4561. item.setParent(this.ui.myNode.displayRoot);
  4562. item.setPos(data.x, data.y);
  4563. item.setUrl(data.value);
  4564. this.showItemArr.push(item);
  4565. }
  4566. }
  4567. updateSelf() {
  4568. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4569. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4570. if (this.data.ball == -1) {
  4571. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4572. }
  4573. else {
  4574. this.ui.myNode.conditionTxt.text = "奖励关卡";
  4575. }
  4576. let localData = DataMgr.getPlaceBallLevel(this.level);
  4577. let getAward = localData.getAward;
  4578. let cfg = cfgTable.placeballData[this.level];
  4579. let coin = this.data.award[0];
  4580. let diamond = this.data.award[1];
  4581. if (cfg.type == PlaceBallType.challenge) {
  4582. diamond = 0;
  4583. coin = 100;
  4584. }
  4585. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4586. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4587. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4588. if (cfg.type == PlaceBallType.challenge) {
  4589. this.ui.myNode.coinNode.numTxt.text = "";
  4590. }
  4591. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4592. if (coin > 0 && diamond > 0) {
  4593. this.ui.myNode.diamondNode.x = 385;
  4594. this.ui.myNode.coinNode.x = 467;
  4595. }
  4596. else {
  4597. this.ui.myNode.diamondNode.x = 385;
  4598. this.ui.myNode.coinNode.x = 385;
  4599. }
  4600. if (!getAward) {
  4601. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4602. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4603. }
  4604. else {
  4605. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4606. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4607. }
  4608. }
  4609. startGame() {
  4610. if (DataMgr.powerEnough()) {
  4611. this.ui.myNode.startBtn.touchable = false;
  4612. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  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. xGame.uiMgr.Show(UIPower);
  4626. }
  4627. }
  4628. hide() {
  4629. super.hide();
  4630. }
  4631. }
  4632. UILevelProp.uiName = "UILevelProp";
  4633. class PutBallLevelDisplay {
  4634. constructor(ui, index) {
  4635. this.index = 0;
  4636. this.ui = ui;
  4637. this.index = index;
  4638. this.ui.onClick(this, this.clickSelf);
  4639. this.updateSelf();
  4640. this.ui.levelTxt.text = (this.index + 1) + "";
  4641. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4642. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4643. }
  4644. updateSelf() {
  4645. let level = this.index + 1;
  4646. this.data = DataMgr.getPlaceBallLevel(level);
  4647. this.ui.starNode.c1.selectedIndex = this.data.star;
  4648. let isChallenge = cfgTable.placeballData[level].type;
  4649. if (this.data.isCur) {
  4650. if (isChallenge) {
  4651. this.ui.c1.selectedIndex = 5;
  4652. }
  4653. else {
  4654. this.ui.c1.selectedIndex = 2;
  4655. }
  4656. }
  4657. else {
  4658. if (this.data.play) {
  4659. if (this.data.star == 3) {
  4660. this.ui.c1.selectedIndex = 0;
  4661. }
  4662. else {
  4663. this.ui.c1.selectedIndex = 1;
  4664. }
  4665. }
  4666. else {
  4667. if (isChallenge) {
  4668. this.ui.c1.selectedIndex = 4;
  4669. }
  4670. else {
  4671. this.ui.c1.selectedIndex = 3;
  4672. }
  4673. }
  4674. }
  4675. }
  4676. clickSelf() {
  4677. if (!this.data.play)
  4678. return;
  4679. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4680. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4681. }
  4682. }
  4683. class UILevelDisplay extends UIBase {
  4684. constructor() {
  4685. super();
  4686. }
  4687. onConstructor() {
  4688. this.ui = ui_UILevelDisplay.createInstance();
  4689. this.contentPane = this.ui;
  4690. this.isEject = false;
  4691. this.myList = this.ui.myNode.myList;
  4692. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4693. this.levelItemArr = [];
  4694. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4695. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4696. this.myList.numItems = levelNum;
  4697. if (Moyu.isKs)
  4698. this.ui.closeNode.closeBtn.x += 100;
  4699. }
  4700. levelItemRender(index, target) {
  4701. let item = new PutBallLevelDisplay(target, index);
  4702. this.levelItemArr.push(item);
  4703. }
  4704. show() {
  4705. super.show();
  4706. this.updateLevel();
  4707. this.scrollToPlace();
  4708. }
  4709. updateLevel() {
  4710. let temp;
  4711. for (let index = 0; index < this.levelItemArr.length; index++) {
  4712. temp = this.levelItemArr[index];
  4713. temp.updateSelf();
  4714. }
  4715. }
  4716. scrollToPlace() {
  4717. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4718. let passArr = DataMgr.getPlaceBallLevelList();
  4719. let offest = passArr.length;
  4720. if (offest >= maxNum - 1)
  4721. offest = maxNum - 1;
  4722. this.myList.scrollToView(offest, true, true);
  4723. }
  4724. hide() {
  4725. super.hide();
  4726. }
  4727. }
  4728. UILevelDisplay.uiName = "UILevelDisplay";
  4729. class ui_UIMatching extends fgui.GComponent {
  4730. static createInstance() {
  4731. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4732. }
  4733. onConstruct() {
  4734. this.n5 = (this.getChild("n5"));
  4735. this.n49 = (this.getChild("n49"));
  4736. this.n51 = (this.getChild("n51"));
  4737. this.n64 = (this.getChild("n64"));
  4738. this.n2 = (this.getChild("n2"));
  4739. this.n53 = (this.getChild("n53"));
  4740. this.n54 = (this.getChild("n54"));
  4741. this.n56 = (this.getChild("n56"));
  4742. this.n58 = (this.getChild("n58"));
  4743. this.n59 = (this.getChild("n59"));
  4744. this.n57 = (this.getChild("n57"));
  4745. this.n60 = (this.getChild("n60"));
  4746. this.n62 = (this.getChild("n62"));
  4747. this.awardTxt = (this.getChild("awardTxt"));
  4748. this.n61 = (this.getChild("n61"));
  4749. this.selfHead = (this.getChild("selfHead"));
  4750. this.aiHead = (this.getChild("aiHead"));
  4751. this.n82 = (this.getChild("n82"));
  4752. this.n84 = (this.getChild("n84"));
  4753. this.n83 = (this.getChild("n83"));
  4754. this.t1 = this.getTransition("t1");
  4755. this.t2 = this.getTransition("t2");
  4756. this.t3 = this.getTransition("t3");
  4757. this.t4 = this.getTransition("t4");
  4758. }
  4759. }
  4760. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4761. class UIMatching extends UIBase {
  4762. constructor() {
  4763. super();
  4764. }
  4765. onConstructor() {
  4766. this.ui = ui_UIMatching.createInstance();
  4767. this.contentPane = this.ui;
  4768. this.isEject = false;
  4769. }
  4770. show(callback) {
  4771. super.show();
  4772. PlatMgr.showBanner(true);
  4773. this.callback = callback;
  4774. let user = Moyu.getUserInfo();
  4775. if (!this.selfPot) {
  4776. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4777. }
  4778. if (!this.aiPot) {
  4779. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4780. }
  4781. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4782. this.ui.selfHead.nameTxt.text = user.nickName;
  4783. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4784. this.ui.aiHead.nameTxt.text = "???";
  4785. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4786. this.ui.selfHead.c1.selectedIndex = 0;
  4787. this.ui.aiHead.c1.selectedIndex = 0;
  4788. this.ui.selfHead.x = this.selfPot.x;
  4789. this.ui.selfHead.y = this.selfPot.y;
  4790. this.ui.aiHead.x = this.aiPot.x;
  4791. this.ui.aiHead.y = this.aiPot.y;
  4792. switch (xGame.common.gameMode) {
  4793. case GameMode.classic:
  4794. break;
  4795. case GameMode.bigMove:
  4796. this.initSkillData();
  4797. break;
  4798. default:
  4799. break;
  4800. }
  4801. this.ui.t1.play(Laya.Handler.create(this, () => {
  4802. this.ui.t2.play(Laya.Handler.create(this, () => {
  4803. switch (xGame.common.gameMode) {
  4804. case GameMode.classic:
  4805. this.waitingPeople();
  4806. break;
  4807. case GameMode.bigMove:
  4808. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4809. break;
  4810. default:
  4811. break;
  4812. }
  4813. }));
  4814. }));
  4815. }
  4816. initSkillData() {
  4817. this.skillSelectData = [];
  4818. let skillUrl = xGame.common.skillIconList;
  4819. let skillName = xGame.common.skillNameList;
  4820. let skillLevel = DataMgr.getBigSkillList();
  4821. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4822. for (let index = 0; index < 5; index++) {
  4823. let obj = {};
  4824. obj.skillImg = skillUrl[index];
  4825. obj.skillName = skillName[index];
  4826. obj.skillType = skillType[index];
  4827. obj.skillLevel = skillLevel[index];
  4828. this.skillSelectData.push(obj);
  4829. }
  4830. }
  4831. getAISkillLevel(myLevel) {
  4832. let video = xGame.common.upSkillLevel;
  4833. let aiLevel;
  4834. let temp;
  4835. if (video) {
  4836. temp = xGame.common.randomNum(-2, -1);
  4837. }
  4838. else {
  4839. if (myLevel <= 5) {
  4840. temp = xGame.common.randomNum(1, 3);
  4841. }
  4842. else if (myLevel <= 9) {
  4843. temp = xGame.common.randomNum(-2, 1);
  4844. }
  4845. else {
  4846. temp = xGame.common.randomNum(-4, 0);
  4847. }
  4848. }
  4849. aiLevel = temp + myLevel;
  4850. if (aiLevel <= 1)
  4851. aiLevel = 1;
  4852. if (aiLevel >= 10)
  4853. aiLevel = 10;
  4854. return aiLevel;
  4855. }
  4856. getAISkillType() {
  4857. return xGame.common.randomNum(1, 4);
  4858. let successTimes = DataMgr.getSkillSuccessTimes();
  4859. let info = cfgTable.aiskillData[successTimes];
  4860. if (!info) {
  4861. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4862. info = cfgTable.aiskillData[max];
  4863. }
  4864. let dataArr = info.skillselect;
  4865. let myCfg = {};
  4866. for (let index = 0; index < dataArr.length; index++) {
  4867. let temp = dataArr[index].split('-');
  4868. myCfg[temp[0]] = {};
  4869. myCfg[temp[0]].id = parseInt(temp[0]);
  4870. myCfg[temp[0]].weight = parseInt(temp[1]);
  4871. }
  4872. let aiCfg = xGame.common.initWeight(myCfg);
  4873. let curData = xGame.common.getRandomWeightData(aiCfg);
  4874. return parseInt(curData.id);
  4875. }
  4876. getAISkillData(index) {
  4877. let myLevel = this.skillSelectData[index].skillLevel;
  4878. let aiLevel = this.getAISkillLevel(myLevel);
  4879. let aiType = this.getAISkillType() - 1;
  4880. return { aiLevel, aiType } = { aiLevel, aiType };
  4881. }
  4882. skillSelectFinish(index) {
  4883. let aiInfo = this.getAISkillData(index);
  4884. xGame.common.gameMgr.selfCurSkill = index;
  4885. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4886. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4887. this.ui.selfHead.c1.selectedIndex = 1;
  4888. this.ui.aiHead.c1.selectedIndex = 1;
  4889. let myData = this.skillSelectData[index];
  4890. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4891. let guide = DataMgr.getSkillGuide();
  4892. if (guide == 0) {
  4893. this.ui.selfHead.skillTxt.text = myData.skillName + " 满级";
  4894. }
  4895. else {
  4896. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4897. }
  4898. let aiData = this.skillSelectData[aiInfo.aiType];
  4899. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4900. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4901. this.waitingPeople();
  4902. }
  4903. waitingPeople() {
  4904. let time = xGame.common.randomNum(1000, 3000);
  4905. time += 1000;
  4906. Laya.timer.once(time, this, () => {
  4907. this.matchingSuccess();
  4908. });
  4909. }
  4910. matchingSuccess() {
  4911. let gameUI = xGame.common.gameUI;
  4912. let name = gameUI.ui.topNode.aiNameTxt.text;
  4913. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4914. this.ui.aiHead.nameTxt.text = name;
  4915. this.ui.aiHead.headImg.url = url;
  4916. name = gameUI.ui.topNode.selfNameTxt.text;
  4917. url = gameUI.ui.topNode.selfHeadLoader.url;
  4918. this.ui.selfHead.nameTxt.text = name;
  4919. this.ui.selfHead.headImg.url = url;
  4920. this.ui.t3.play(Laya.Handler.create(this, () => {
  4921. this.callback && this.callback();
  4922. this.ui.t4.play(Laya.Handler.create(this, () => {
  4923. this.destroySelf();
  4924. }));
  4925. }));
  4926. }
  4927. destroySelf() {
  4928. this.callback = null;
  4929. this.skillSelectData = null;
  4930. this.selfPot = null;
  4931. this.aiPot = null;
  4932. if (!this.ui.isDisposed) {
  4933. this.ui.removeFromParent();
  4934. this.ui.dispose();
  4935. }
  4936. xGame.uiMgr.destroyUI(this);
  4937. }
  4938. }
  4939. UIMatching.uiName = "UIMatching";
  4940. class ui_UIRanking extends fgui.GComponent {
  4941. static createInstance() {
  4942. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4943. }
  4944. onConstruct() {
  4945. this.n26 = (this.getChild("n26"));
  4946. this.myNode = (this.getChild("myNode"));
  4947. }
  4948. }
  4949. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4950. class UIRanking extends UIBase {
  4951. constructor() {
  4952. super();
  4953. this.showSelf = true;
  4954. this.rankType = 1;
  4955. this.rankList = [];
  4956. this.myIndex = 0;
  4957. this.myStar = 0;
  4958. }
  4959. onConstructor() {
  4960. this.ui = ui_UIRanking.createInstance();
  4961. this.contentPane = this.ui;
  4962. this.isEject = false;
  4963. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4964. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4965. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4966. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4967. this.ui.myNode.myList.setVirtual();
  4968. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4969. }
  4970. show() {
  4971. super.show();
  4972. this.myIndex = 51;
  4973. Moyu.getRankList({
  4974. rankId: xGame.common.curRankID,
  4975. type: MoyuRankType.total,
  4976. page: 1,
  4977. pageSize: 50,
  4978. }, this, this.updateItemData);
  4979. this.updateSelf();
  4980. let self = Moyu.getUserInfo();
  4981. if (!self.isAuth) {
  4982. Moyu.initUser(this, () => {
  4983. DataMgr.upRankData();
  4984. });
  4985. }
  4986. }
  4987. updateSelfItem() {
  4988. let self = Moyu.getUserInfo();
  4989. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4990. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4991. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4992. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "我自己";
  4993. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4994. }
  4995. updateItemData(data) {
  4996. this.myStar = xGame.common.getAllStarNum();
  4997. if (this.rankList.length < 2) {
  4998. this.rankList = data;
  4999. let self = Moyu.getUserInfo();
  5000. for (let i = 0; i < data.length; i++) {
  5001. let data = this.rankList[i];
  5002. if (data.userId == self.userId) {
  5003. this.rankList.splice(i, 1);
  5004. break;
  5005. }
  5006. }
  5007. for (let i = 0; i < data.length; i++) {
  5008. let data = this.rankList[i];
  5009. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5010. this.myIndex = i + 1;
  5011. let user = { headIcon: self.headIcon, nickName: "我自己" };
  5012. let ud = { user: user, data: {} };
  5013. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5014. if (Moyu.platType < 11) {
  5015. user.headIcon = self.headIcon;
  5016. user.nickName = self.nickName;
  5017. }
  5018. this.rankList.splice(i, 0, md);
  5019. break;
  5020. }
  5021. }
  5022. }
  5023. this.updateSelfItem();
  5024. this.ui.myNode.myList.numItems = this.rankList.length;
  5025. }
  5026. updateItemUI(index, obj) {
  5027. let data = this.rankList[index];
  5028. let userData = JSON.parse(data.userData).user;
  5029. obj.nameTxt.text = userData.nickName.toString();
  5030. obj.valueTxt.text = data.rankScore;
  5031. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5032. obj.rankTxt.text = index + 1;
  5033. switch (index) {
  5034. case 0:
  5035. this.setImg(obj, 1, 0, 0);
  5036. obj.rankTxt.color = "#FFC047";
  5037. break;
  5038. case 1:
  5039. this.setImg(obj, 0, 1, 0);
  5040. obj.rankTxt.color = "#ACACAC";
  5041. break;
  5042. case 2:
  5043. this.setImg(obj, 0, 0, 1);
  5044. obj.rankTxt.color = "#D09672";
  5045. break;
  5046. default:
  5047. this.setImg(obj, 0, 0, 0);
  5048. obj.rankTxt.color = "#496FAB";
  5049. break;
  5050. }
  5051. }
  5052. setImg(obj, a, b, c) {
  5053. obj.img1.visible = a ? true : false;
  5054. obj.img2.visible = b ? true : false;
  5055. obj.img3.visible = c ? true : false;
  5056. }
  5057. changeList(type) {
  5058. this.rankType = type;
  5059. this.updateSelf();
  5060. }
  5061. changeSelfNode() {
  5062. this.showSelf = !this.showSelf;
  5063. this.updateSelf();
  5064. }
  5065. updateSelf() {
  5066. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5067. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5068. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5069. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5070. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5071. }
  5072. }
  5073. UIRanking.uiName = "UIRanking";
  5074. class ui_UISecretary extends fgui.GComponent {
  5075. static createInstance() {
  5076. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5077. }
  5078. onConstruct() {
  5079. this.n0 = (this.getChild("n0"));
  5080. this.myNode = (this.getChild("myNode"));
  5081. this.rightBtn = (this.getChild("rightBtn"));
  5082. this.leftBtn = (this.getChild("leftBtn"));
  5083. this.closeBtn = (this.getChild("closeBtn"));
  5084. this.t0 = this.getTransition("t0");
  5085. }
  5086. }
  5087. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5088. class UISecretary extends UIBase {
  5089. constructor() {
  5090. super();
  5091. this.curIndex = 1;
  5092. }
  5093. onConstructor() {
  5094. this.ui = ui_UISecretary.createInstance();
  5095. this.contentPane = this.ui;
  5096. this.isEject = false;
  5097. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5098. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  5099. this.addUIClick(this.ui.rightBtn, this.turnRight);
  5100. this.nodeObj = { left: null, right: null, cur: null };
  5101. this.nodeObj.left = this.ui.myNode.gameNode1;
  5102. this.nodeObj.right = this.ui.myNode.gameNode2;
  5103. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5104. }
  5105. show() {
  5106. super.show();
  5107. this.ui.t0.play();
  5108. this.updateData();
  5109. }
  5110. addSecretarySpine(node, spineName) {
  5111. if (spineName == "mishu") {
  5112. if (this.secretarySpine1) {
  5113. node.displayObject.destroyChildren();
  5114. this.playWoman(this.secretarySpine1, node.displayObject);
  5115. }
  5116. else {
  5117. let spine1 = new SpineMgr("mishu", () => {
  5118. this.secretarySpine1 = spine1;
  5119. this.playWoman(this.secretarySpine1, node.displayObject);
  5120. });
  5121. }
  5122. }
  5123. else {
  5124. if (this.secretarySpine2) {
  5125. node.displayObject.destroyChildren();
  5126. this.playWoman(this.secretarySpine2, node.displayObject);
  5127. }
  5128. else {
  5129. let spine2 = new SpineMgr("xiaomishu2", () => {
  5130. this.secretarySpine2 = spine2;
  5131. this.playWoman(this.secretarySpine2, node.displayObject);
  5132. });
  5133. }
  5134. }
  5135. }
  5136. playWoman(node, parent) {
  5137. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  5138. let yy = this.ui.myNode.gameNode1.secretary.height;
  5139. let scale = 1.5;
  5140. if (node == this.secretarySpine2) {
  5141. scale = 1.2;
  5142. }
  5143. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5144. node.play(data, 1, true, parent);
  5145. }
  5146. turnLeft() {
  5147. this.curIndex--;
  5148. if (this.curIndex < 1) {
  5149. this.curIndex = 2;
  5150. }
  5151. let left = this.nodeObj.left;
  5152. let right = this.nodeObj.right;
  5153. let cur = this.nodeObj.cur;
  5154. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5155. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5156. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5157. this.updateData();
  5158. }));
  5159. this.ui.myNode.setChildIndex(right, 2);
  5160. this.nodeObj.left = cur;
  5161. this.nodeObj.right = left;
  5162. this.nodeObj.cur = right;
  5163. }
  5164. turnRight() {
  5165. this.curIndex++;
  5166. if (this.curIndex > 2) {
  5167. this.curIndex = 1;
  5168. }
  5169. let left = this.nodeObj.left;
  5170. let right = this.nodeObj.right;
  5171. let cur = this.nodeObj.cur;
  5172. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5173. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5174. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5175. this.updateData();
  5176. }));
  5177. this.ui.myNode.setChildIndex(left, 2);
  5178. this.nodeObj.left = right;
  5179. this.nodeObj.right = cur;
  5180. this.nodeObj.cur = left;
  5181. }
  5182. updateData() {
  5183. let data = cfgTable.secretaryshopData;
  5184. let children = this.ui.myNode._children;
  5185. let temp;
  5186. let curData;
  5187. for (let index = 0; index < children.length; index++) {
  5188. temp = children[index];
  5189. if (index == 2) {
  5190. curData = data[this.curIndex];
  5191. temp.purchaseBtn.touchable = true;
  5192. }
  5193. else {
  5194. temp.purchaseBtn.touchable = false;
  5195. if (this.curIndex == 1) {
  5196. curData = data[2];
  5197. }
  5198. else {
  5199. curData = data[1];
  5200. }
  5201. }
  5202. temp.heightTxt.text = curData.height;
  5203. temp.foodTxt.text = curData.food;
  5204. temp.historyTxt.text = curData.history;
  5205. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5206. this.addSecretarySpine(temp.secretary, curData.spine);
  5207. let womanIndex = curData.id - 1;
  5208. let getWoman = DataMgr.getSecretary(womanIndex);
  5209. let curUse = DataMgr.getCurSecretary();
  5210. if (getWoman) {
  5211. if (curUse == womanIndex) {
  5212. temp.purchaseBtn.c1.selectedIndex = 1;
  5213. }
  5214. else {
  5215. temp.purchaseBtn.c1.selectedIndex = 2;
  5216. }
  5217. }
  5218. else {
  5219. temp.purchaseBtn.c1.selectedIndex = 0;
  5220. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5221. }
  5222. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5223. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5224. }
  5225. }
  5226. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5227. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5228. if (getWoman) {
  5229. if (curUse != womanIndex) {
  5230. console.log();
  5231. DataMgr.setCurSecretary(womanIndex);
  5232. this.updateData();
  5233. }
  5234. }
  5235. else {
  5236. let need = needDiamond;
  5237. if (DataMgr.diamondEnough(need)) {
  5238. DataMgr.setDiamond(-need);
  5239. DataMgr.setSecretary(womanIndex, 1);
  5240. DataMgr.setCurSecretary(womanIndex);
  5241. this.updateData();
  5242. }
  5243. else {
  5244. xGame.uiMgr.Show(UIAddProp, 1);
  5245. }
  5246. }
  5247. }
  5248. closeSelf() {
  5249. this.hide();
  5250. }
  5251. }
  5252. UISecretary.uiName = "UISecretary";
  5253. class ui_UIShop extends fgui.GComponent {
  5254. static createInstance() {
  5255. return (fgui.UIPackage.createObject("game", "UIShop"));
  5256. }
  5257. onConstruct() {
  5258. this.n48 = (this.getChild("n48"));
  5259. this.n0 = (this.getChild("n0"));
  5260. this.secretary = (this.getChild("secretary"));
  5261. this.talkNode = (this.getChild("talkNode"));
  5262. this.closeNode = (this.getChild("closeNode"));
  5263. this.moneyNode = (this.getChild("moneyNode"));
  5264. this.myNode = (this.getChild("myNode"));
  5265. }
  5266. }
  5267. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5268. class BallRodDisplay {
  5269. constructor(ui, index) {
  5270. this.index = 0;
  5271. this.uiIndex = 0;
  5272. this.ui = ui;
  5273. this.index = index;
  5274. this.initData();
  5275. }
  5276. initData() {
  5277. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5278. let data = cfgTable.ballrodData[this.index + 1];
  5279. this.ui.nameTxt.text = data.name;
  5280. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5281. this.ui.levelNode.c1.selectedIndex = data.quality;
  5282. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5283. if (data.spine) {
  5284. this.mySpine = new SpineMgr(data.spine, () => {
  5285. let xx = 150;
  5286. let yy = 70;
  5287. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5288. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5289. });
  5290. }
  5291. }
  5292. updateSelf() {
  5293. let get = DataMgr.getBallRod(this.index);
  5294. if (get == null)
  5295. get = 1;
  5296. let curUse = DataMgr.getCurBallRod();
  5297. if (get) {
  5298. if (curUse == this.index) {
  5299. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5300. }
  5301. else {
  5302. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5303. }
  5304. }
  5305. else {
  5306. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5307. }
  5308. }
  5309. buyBallRod() {
  5310. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5311. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5312. switch (selectedIndex) {
  5313. case 0:
  5314. break;
  5315. case 1:
  5316. DataMgr.setCurBallRod(this.index);
  5317. let ui = xGame.uiMgr.getUI(UIShop);
  5318. ui.updateBallRod();
  5319. break;
  5320. case 2:
  5321. let data = cfgTable.ballrodData[this.index + 1];
  5322. let need = data.price;
  5323. if (DataMgr.diamondEnough(need)) {
  5324. DataMgr.setDiamond(-need);
  5325. DataMgr.setBallRod(this.index, 1);
  5326. DataMgr.setCurBallRod(this.index);
  5327. let ui = xGame.uiMgr.getUI(UIShop);
  5328. ui.updateBallRod();
  5329. }
  5330. else {
  5331. xGame.uiMgr.Show(UIAddProp, 1);
  5332. }
  5333. break;
  5334. default:
  5335. break;
  5336. }
  5337. }
  5338. }
  5339. class UIShop extends UIBase {
  5340. constructor() {
  5341. super();
  5342. this.itemNums = 0;
  5343. }
  5344. onConstructor() {
  5345. this.ui = ui_UIShop.createInstance();
  5346. this.contentPane = this.ui;
  5347. this.isEject = false;
  5348. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5349. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5350. this.addUIClick(this.ui, this.interuptSecretary);
  5351. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5352. this.ballRodArr = [];
  5353. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5354. this.ui.myNode.myList.numItems = this.itemNums;
  5355. if (Moyu.isKs)
  5356. this.ui.closeNode.closeBtn.x += 100;
  5357. }
  5358. show() {
  5359. super.show();
  5360. this.playSecretaryIdle();
  5361. this.updateBallRod();
  5362. }
  5363. updateBallRod() {
  5364. for (let index = 0; index < this.ballRodArr.length; index++) {
  5365. this.ballRodArr[index].updateSelf();
  5366. }
  5367. }
  5368. renderBallRod(sort, obj) {
  5369. let index = this.getIndexBySort(sort + 1) - 1;
  5370. let ballRod = new BallRodDisplay(obj, index);
  5371. this.ballRodArr.push(ballRod);
  5372. }
  5373. getIndexBySort(sort) {
  5374. let object = cfgTable.ballrodData;
  5375. for (const key in object) {
  5376. if (object[key].sort == sort) {
  5377. return parseInt(key);
  5378. }
  5379. }
  5380. }
  5381. playSecretaryIdle() {
  5382. let parent = this.ui.secretary.displayObject;
  5383. parent.destroyChildren();
  5384. let xx = this.ui.secretary.width / 2;
  5385. let yy = this.ui.secretary.height;
  5386. let scale = xGame.common.getSecretaryScale();
  5387. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5388. xGame.common.secretary.play(data, 1, true, parent);
  5389. }
  5390. interuptSecretary() {
  5391. Laya.timer.clearAll(this);
  5392. this.playSecretaryRandomSound();
  5393. }
  5394. playSecretaryRandomSound() {
  5395. if (this.isHide)
  5396. return;
  5397. let time = xGame.common.randomNum(45000, 60000);
  5398. Laya.timer.once(time, this, () => {
  5399. if (this.isHide)
  5400. return;
  5401. let index = xGame.common.randomNum(4, 7);
  5402. xGame.soundMgr.playSound("s_main0" + index);
  5403. let words = 1;
  5404. switch (index) {
  5405. case 4:
  5406. words = 5;
  5407. break;
  5408. case 5:
  5409. words = 3;
  5410. break;
  5411. case 6:
  5412. words = 6;
  5413. break;
  5414. case 7:
  5415. words = 7;
  5416. break;
  5417. default:
  5418. break;
  5419. }
  5420. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5421. this.playSecretaryRandomSound();
  5422. });
  5423. }
  5424. closeSelf() {
  5425. this.hide();
  5426. }
  5427. }
  5428. UIShop.uiName = "UIShop";
  5429. class ui_UISign extends fgui.GComponent {
  5430. static createInstance() {
  5431. return (fgui.UIPackage.createObject("game", "UISign"));
  5432. }
  5433. onConstruct() {
  5434. this.n6 = (this.getChild("n6"));
  5435. this.closeNode = (this.getChild("closeNode"));
  5436. this.myNode = (this.getChild("myNode"));
  5437. this.moneyNode = (this.getChild("moneyNode"));
  5438. this.secretary = (this.getChild("secretary"));
  5439. this.talkNode = (this.getChild("talkNode"));
  5440. this.tripleBtn = (this.getChild("tripleBtn"));
  5441. this.normalBtn = (this.getChild("normalBtn"));
  5442. this.tipsNode = (this.getChild("tipsNode"));
  5443. this.againBtn = (this.getChild("againBtn"));
  5444. this.t0 = this.getTransition("t0");
  5445. }
  5446. }
  5447. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5448. class SignMax {
  5449. constructor(ui) {
  5450. this.ui = ui;
  5451. }
  5452. updateSelf(index, sameDay, curDayIndex) {
  5453. let data = cfgTable.signData[index + 1];
  5454. this.ui.titleTxt.text = data.title;
  5455. let arr1 = data.award[0].split('-');
  5456. let arr2 = data.award[1].split('-');
  5457. let num1 = parseInt(arr1[1]);
  5458. let num2 = parseInt(arr2[1]);
  5459. this.ui.numTxt1.text = num1 + "";
  5460. this.ui.numTxt2.text = num2 + "";
  5461. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5462. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5463. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5464. this.ui.numTxt1.visible = false;
  5465. }
  5466. else {
  5467. this.ui.numTxt1.visible = true;
  5468. }
  5469. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5470. this.ui.numTxt2.visible = false;
  5471. }
  5472. else {
  5473. this.ui.numTxt2.visible = true;
  5474. }
  5475. if (index < curDayIndex) {
  5476. this.ui.c1.selectedIndex = 1;
  5477. }
  5478. else if (index == curDayIndex) {
  5479. if (sameDay) {
  5480. this.ui.c1.selectedIndex = 2;
  5481. }
  5482. else {
  5483. this.ui.c1.selectedIndex = 2;
  5484. }
  5485. }
  5486. else {
  5487. this.ui.c1.selectedIndex = 0;
  5488. }
  5489. }
  5490. }
  5491. class SignNormal {
  5492. constructor(ui) {
  5493. this.ui = ui;
  5494. }
  5495. updateSelf(index, sameDay, curDayIndex) {
  5496. let data = cfgTable.signData[index + 1];
  5497. this.ui.titleTxt.text = data.title;
  5498. let arr = data.award[0].split('-');
  5499. let type = parseInt(arr[0]);
  5500. let num = parseInt(arr[1]);
  5501. this.ui.numTxt.text = num + "";
  5502. if (type > 2) {
  5503. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5504. this.ui.myIcon.rotation = 0;
  5505. }
  5506. else {
  5507. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5508. this.ui.myIcon.rotation = 0;
  5509. }
  5510. if (xGame.common.signAwardContainsRod(data.award)) {
  5511. this.ui.numTxt.visible = false;
  5512. }
  5513. else {
  5514. this.ui.numTxt.visible = true;
  5515. }
  5516. if (index < curDayIndex) {
  5517. this.ui.c1.selectedIndex = 1;
  5518. }
  5519. else if (index == curDayIndex) {
  5520. if (sameDay) {
  5521. this.ui.c1.selectedIndex = 2;
  5522. }
  5523. else {
  5524. this.ui.c1.selectedIndex = 2;
  5525. }
  5526. }
  5527. else {
  5528. this.ui.c1.selectedIndex = 0;
  5529. }
  5530. }
  5531. }
  5532. class UISign extends UIBase {
  5533. constructor() {
  5534. super();
  5535. this.curDayIndex = 0;
  5536. this.starX = 0;
  5537. }
  5538. onConstructor() {
  5539. this.ui = ui_UISign.createInstance();
  5540. this.contentPane = this.ui;
  5541. this.isEject = false;
  5542. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5543. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5544. this.initSignItem();
  5545. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5546. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5547. }
  5548. show() {
  5549. super.show();
  5550. this.ui.t0.play();
  5551. this.playSecretaryIdle();
  5552. this.updateSign();
  5553. }
  5554. initSignItem() {
  5555. this.signArr = [];
  5556. for (let index = 0; index < 6; index++) {
  5557. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5558. this.signArr.push(temp);
  5559. }
  5560. this.signMax = new SignMax(this.ui.myNode.day7);
  5561. if (Moyu.isKs)
  5562. this.ui.closeNode.closeBtn.x += 100;
  5563. }
  5564. updateSign() {
  5565. let sameDay = xGame.common.judgeSameDay();
  5566. let max = 7;
  5567. this.curDayIndex = DataMgr.getSignData();
  5568. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5569. this.curDayIndex = 0;
  5570. if (!sameDay) {
  5571. this.ui.normalBtn.visible = true;
  5572. this.ui.tipsNode.visible = false;
  5573. this.ui.againBtn.visible = false;
  5574. }
  5575. else {
  5576. this.ui.normalBtn.visible = false;
  5577. let again = DataMgr.getExtraSign();
  5578. let isCurrency = false;
  5579. let index = this.curDayIndex;
  5580. if (index == 0)
  5581. index = 7;
  5582. let award = cfgTable.signData[index].award;
  5583. let num = award[0].split("-")[0];
  5584. if (num == "1" || num == "2")
  5585. isCurrency = true;
  5586. let showAgain = again == 0 && isCurrency;
  5587. this.ui.againBtn.visible = showAgain;
  5588. this.ui.tipsNode.visible = !showAgain;
  5589. }
  5590. for (let index = 0; index < this.signArr.length; index++) {
  5591. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5592. }
  5593. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5594. }
  5595. playSecretaryIdle() {
  5596. let parent = this.ui.secretary.displayObject;
  5597. parent.destroyChildren();
  5598. let xx = this.ui.secretary.width / 2;
  5599. let yy = this.ui.secretary.height;
  5600. let scale = xGame.common.getSecretaryScale();
  5601. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5602. xGame.common.secretary.play(data, 1, true, parent);
  5603. }
  5604. closeSelf() {
  5605. this.hide();
  5606. }
  5607. normalGetAward() {
  5608. let sameDay = xGame.common.judgeSameDay();
  5609. if (!sameDay) {
  5610. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5611. let temp;
  5612. let type;
  5613. let num;
  5614. let arr = [];
  5615. for (let index = 0; index < award.length; index++) {
  5616. temp = award[index].split("-");
  5617. type = parseInt(temp[0]);
  5618. num = parseInt(temp[1]);
  5619. let awardType = new AwardType();
  5620. awardType.num = num;
  5621. awardType.type = type;
  5622. arr.push(awardType);
  5623. }
  5624. xGame.common.getAward(arr, (watchVideo) => {
  5625. this.curDayIndex++;
  5626. if (this.curDayIndex > 7)
  5627. this.curDayIndex = 0;
  5628. DataMgr.setSignData(this.curDayIndex);
  5629. DataMgr.setSignTime(new Date().getTime());
  5630. if (watchVideo) {
  5631. DataMgr.setExtraSign(1);
  5632. Moyu.sendDataEvent("signIn1");
  5633. }
  5634. this.updateSign();
  5635. });
  5636. }
  5637. }
  5638. againGetAward() {
  5639. Moyu.sendDataEvent("signIn2");
  5640. Moyu.showVideoAd(() => {
  5641. let index = this.curDayIndex;
  5642. if (index == 0)
  5643. index = 7;
  5644. let award = cfgTable.signData[index].award;
  5645. let temp;
  5646. let type;
  5647. let num;
  5648. for (let index = 0; index < award.length; index++) {
  5649. temp = award[index].split("-");
  5650. type = parseInt(temp[0]);
  5651. num = parseInt(temp[1]) * 3;
  5652. xGame.common.playObjFlyAnim(num, type);
  5653. }
  5654. DataMgr.setExtraSign(1);
  5655. this.updateSign();
  5656. }, EAdType.againSign);
  5657. }
  5658. }
  5659. UISign.uiName = "UISign";
  5660. class ui_UISkill extends fgui.GComponent {
  5661. static createInstance() {
  5662. return (fgui.UIPackage.createObject("game", "UISkill"));
  5663. }
  5664. onConstruct() {
  5665. this.n48 = (this.getChild("n48"));
  5666. this.n0 = (this.getChild("n0"));
  5667. this.secretary = (this.getChild("secretary"));
  5668. this.talkNode = (this.getChild("talkNode"));
  5669. this.closeNode = (this.getChild("closeNode"));
  5670. this.moneyNode = (this.getChild("moneyNode"));
  5671. this.skillNode = (this.getChild("skillNode"));
  5672. this.guideNode = (this.getChild("guideNode"));
  5673. }
  5674. }
  5675. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5676. class SkillDisplay {
  5677. constructor(ui, data, uiIndex) {
  5678. this.starX = 0;
  5679. this.starY = 0;
  5680. this.index = 0;
  5681. this.ui = ui;
  5682. this.data = data;
  5683. this.index = uiIndex;
  5684. this.initSelf();
  5685. }
  5686. initSelf() {
  5687. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5688. this.ui.nameTxt.text = this.data.name;
  5689. this.ui.describeTxt.text = this.data.describe;
  5690. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5691. this.ui.startBtn.onClick(this, this.startGame);
  5692. this.updateSelf();
  5693. }
  5694. updateSelf() {
  5695. this.checkTry();
  5696. let level = DataMgr.getBigSkillByIndex(this.index);
  5697. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5698. }
  5699. checkTry() {
  5700. let index = this.index;
  5701. let level = DataMgr.getBigSkillByIndex(index);
  5702. if (level == null) {
  5703. DataMgr.setBigSkill(index, 1, false);
  5704. level = 1;
  5705. }
  5706. this.ui.levelTxt.text = "LV." + level;
  5707. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5708. this.ui.tryNode.visible = true;
  5709. else
  5710. this.ui.tryNode.visible = false;
  5711. }
  5712. clickAddLevel() {
  5713. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5714. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5715. Moyu.showVideoAd(() => {
  5716. DataMgr.setBigSkill(this.data.index, 1);
  5717. this.updateSelf();
  5718. xGame.common.upSkillLevel = true;
  5719. }, EAdType.upSkill);
  5720. }
  5721. startGame() {
  5722. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5723. let needCoin = xGame.common.bigMoveNeedCoin;
  5724. xGame.common.passAwardCoin = 2000;
  5725. let guide = DataMgr.getSkillGuide();
  5726. xGame.common.temSelfLevel = 0;
  5727. if (guide == 0) {
  5728. needCoin = 0;
  5729. xGame.common.temSelfLevel = 100;
  5730. }
  5731. if (DataMgr.coinEnough(needCoin)) {
  5732. DataMgr.setCoin(-needCoin);
  5733. xGame.common.curPlayerSkillType = this.index;
  5734. if (guide == 0)
  5735. xGame.common.curPlayerSkillType = 0;
  5736. xGame.uiMgr.Show(UIGame);
  5737. xGame.uiMgr.Hide(UIMain);
  5738. xGame.uiMgr.Show(UIMatching, () => {
  5739. xGame.common.gameUI.ui.alpha = 1;
  5740. xGame.common.gameUI.startGame();
  5741. xGame.uiMgr.Hide(UISkill);
  5742. });
  5743. }
  5744. else {
  5745. xGame.uiMgr.Show(UIAddProp, 0);
  5746. Moyu.sendDataEvent("AddCoinVideo");
  5747. }
  5748. }
  5749. }
  5750. class UISkill extends UIBase {
  5751. constructor() {
  5752. super();
  5753. this.skillData = [];
  5754. }
  5755. onConstructor() {
  5756. this.ui = ui_UISkill.createInstance();
  5757. this.contentPane = this.ui;
  5758. this.isEject = false;
  5759. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5760. this.initSkillData();
  5761. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5762. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5763. this.displayList = [];
  5764. this.ui.skillNode.skillList.numItems = 4;
  5765. this.addUIClick(this.ui, this.interuptSecretary);
  5766. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5767. this.ui.talkNode.visible = false;
  5768. if (Moyu.isKs)
  5769. this.ui.closeNode.closeBtn.x += 100;
  5770. }
  5771. show() {
  5772. super.show();
  5773. this.playSecretaryIdle();
  5774. this.moneyNode.ui.c1.selectedIndex = 1;
  5775. Laya.timer.clearAll(this);
  5776. xGame.soundMgr.playSound("s_start");
  5777. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5778. let guide = DataMgr.getSkillGuide();
  5779. this.ui.guideNode.visible = guide == 0;
  5780. let item = this.getSkillItemByUIIndex(0);
  5781. if (guide == 0) {
  5782. item.ui.c1.selectedIndex = 1;
  5783. }
  5784. else {
  5785. item.ui.c1.selectedIndex = 0;
  5786. }
  5787. this.ui.guideNode.guideBtn.visible = guide == 0;
  5788. for (let index = 0; index < this.displayList.length; index++) {
  5789. this.displayList[index].checkTry();
  5790. }
  5791. }
  5792. getSkillItemByUIIndex(cur) {
  5793. for (let index = 0; index < this.displayList.length; index++) {
  5794. if (this.displayList[index].index == cur) {
  5795. return this.displayList[index];
  5796. }
  5797. }
  5798. }
  5799. enterGuideLevel() {
  5800. let item = this.getSkillItemByUIIndex(0);
  5801. item.startGame();
  5802. if (DataMgr.getNewUser())
  5803. Moyu.sendDataEvent("gameStart1");
  5804. }
  5805. initSkillData() {
  5806. this.skillData = [];
  5807. let nameList = xGame.common.skillNameList;
  5808. let iconList = xGame.common.skillIconList;
  5809. let describeList = [
  5810. "跳杆击球后,球高高跃起,砸在桌面上,直接打进额外1颗球",
  5811. "普通击球后,球杆向随机方向—扫,将杆子范围内1颗可击打球扫入球袋",
  5812. "我方击球后,在场地上将随机1颗球冻结,敌方无法击打冰冻球,且其他球碰到冰冻球会弹开",
  5813. "击球后在球桌上斩出一刀,并击飞斩中的球。(球不会飞出球桌)"
  5814. ];
  5815. let data;
  5816. for (let index = 0; index < nameList.length; index++) {
  5817. data = {};
  5818. data.name = nameList[index];
  5819. data.icon = iconList[index];
  5820. data.describe = describeList[index];
  5821. data.index = index;
  5822. this.skillData.push(data);
  5823. }
  5824. }
  5825. updateSkillItem(index, target) {
  5826. if (this.displayList[index] == null) {
  5827. let uiIndex;
  5828. switch (index) {
  5829. case 0:
  5830. uiIndex = 1;
  5831. break;
  5832. case 1:
  5833. uiIndex = 0;
  5834. break;
  5835. case 2:
  5836. uiIndex = 2;
  5837. break;
  5838. case 3:
  5839. uiIndex = 3;
  5840. break;
  5841. default:
  5842. break;
  5843. }
  5844. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5845. this.displayList.push(temp);
  5846. }
  5847. }
  5848. playSecretaryIdle() {
  5849. let parent = this.ui.secretary.displayObject;
  5850. parent.destroyChildren();
  5851. let xx = this.ui.secretary.width / 2;
  5852. let yy = this.ui.secretary.height;
  5853. let scale = xGame.common.getSecretaryScale();
  5854. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5855. xGame.common.secretary.play(data, 1, true, parent);
  5856. }
  5857. returnUIMain() {
  5858. this.hide();
  5859. xGame.common.stopGirlPop(this.ui.talkNode);
  5860. xGame.uiMgr.Show(UIMain);
  5861. }
  5862. interuptSecretary() {
  5863. Laya.timer.clearAll(this);
  5864. this.playSecretaryRandomSound();
  5865. }
  5866. playSecretaryRandomSound() {
  5867. if (this.isHide)
  5868. return;
  5869. let time = xGame.common.randomNum(45000, 60000);
  5870. Laya.timer.once(time, this, () => {
  5871. if (this.isHide)
  5872. return;
  5873. let index = xGame.common.randomNum(4, 7);
  5874. xGame.soundMgr.playSound("s_main0" + index);
  5875. let words = 1;
  5876. switch (index) {
  5877. case 4:
  5878. words = 5;
  5879. break;
  5880. case 5:
  5881. words = 3;
  5882. break;
  5883. case 6:
  5884. words = 6;
  5885. break;
  5886. case 7:
  5887. words = 7;
  5888. break;
  5889. default:
  5890. break;
  5891. }
  5892. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5893. this.playSecretaryRandomSound();
  5894. });
  5895. }
  5896. }
  5897. UISkill.uiName = "UISkill";
  5898. class ui_UIMsg extends fgui.GComponent {
  5899. static createInstance() {
  5900. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5901. }
  5902. onConstruct() {
  5903. this.tipsNode = (this.getChild("tipsNode"));
  5904. }
  5905. }
  5906. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5907. class UIMsg extends UIBase {
  5908. constructor() {
  5909. super();
  5910. }
  5911. onConstructor() {
  5912. this.ui = ui_UIMsg.createInstance();
  5913. this.contentPane = this.ui;
  5914. this.isEject = false;
  5915. this.isMuti = true;
  5916. }
  5917. show(msg, callback) {
  5918. super.show();
  5919. this.ui.tipsNode.msgTxt.text = msg;
  5920. this.ui.alpha = 1;
  5921. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5922. this.hide();
  5923. callback && callback();
  5924. }), 1000);
  5925. }
  5926. }
  5927. UIMsg.uiName = "UIMsg";
  5928. class ui_UIModeSelection extends fgui.GComponent {
  5929. static createInstance() {
  5930. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5931. }
  5932. onConstruct() {
  5933. this.n19 = (this.getChild("n19"));
  5934. this.closeBtn = (this.getChild("closeBtn"));
  5935. this.myNode = (this.getChild("myNode"));
  5936. this.t0 = this.getTransition("t0");
  5937. }
  5938. }
  5939. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5940. class UIModeSelection extends UIBase {
  5941. constructor() {
  5942. super();
  5943. }
  5944. onConstructor() {
  5945. this.ui = ui_UIModeSelection.createInstance();
  5946. this.contentPane = this.ui;
  5947. this.isEject = false;
  5948. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5949. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5950. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5951. this.addUIClick(this.ui.closeBtn, this.hide);
  5952. this.peopleArr = [650, 6900, 3800];
  5953. this.peopleOffest = [50, 500, 200];
  5954. this.updateSelf();
  5955. }
  5956. show(callback) {
  5957. super.show();
  5958. this.ui.t0.play();
  5959. this.callback = callback;
  5960. }
  5961. updateSelf() {
  5962. let cfg = cfgTable.modeselectData;
  5963. for (let index = 1; index <= 3; index++) {
  5964. let node = this.ui.myNode["type" + index];
  5965. node.need.text = cfg[index].need;
  5966. node.tipsTxt.text = `最低${cfg[index].need}可入场`;
  5967. node.peopleTxt.text = this.getRandPeople(index - 1);
  5968. }
  5969. }
  5970. enterGame(type) {
  5971. xGame.common.classicRoomType = type;
  5972. let cfg = cfgTable.modeselectData[type];
  5973. let need = cfg.need;
  5974. xGame.common.passAwardCoin = cfg.award;
  5975. if (DataMgr.coinEnough(need)) {
  5976. DataMgr.setCoin(-need);
  5977. this.ui.myNode["type" + type].t0.play();
  5978. Laya.timer.once(200, this, () => {
  5979. this.callback && this.callback();
  5980. });
  5981. }
  5982. else {
  5983. Moyu.sendDataEvent("AddCoinVideo");
  5984. xGame.uiMgr.Show(UIAddProp, 0);
  5985. }
  5986. }
  5987. getRandPeople(index) {
  5988. let rand = this.peopleOffest[index];
  5989. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5990. }
  5991. }
  5992. UIModeSelection.uiName = "UIModeSelection";
  5993. class UIMain extends UIBase {
  5994. constructor() {
  5995. super();
  5996. this.firstEnter = true;
  5997. }
  5998. onConstructor() {
  5999. this.ui = ui_UIMain.createInstance();
  6000. this.contentPane = this.ui;
  6001. this.isEject = false;
  6002. this.addEvent();
  6003. this.addClickSpine();
  6004. this.settingNode = new SettingNode(this.ui.settingNode);
  6005. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6006. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6007. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6008. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6009. let curUse = DataMgr.getCurSecretary();
  6010. this.changeSecretary(curUse);
  6011. this.ui.talkNode.visible = false;
  6012. let guide = DataMgr.getSkillGuide();
  6013. if (xGame.common.isNewDay && guide == 1) {
  6014. xGame.common.isNewDay = false;
  6015. xGame.soundMgr.playSound("s_main01");
  6016. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6017. console.log("播放小秘书每天语音");
  6018. }
  6019. this.onGetUserInfo();
  6020. this.ui.n83.visible = false;
  6021. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6022. }
  6023. changeSecretary(curUse) {
  6024. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6025. xGame.common.secretary && xGame.common.secretary.dispose();
  6026. this.addSecretarySpine(name);
  6027. }
  6028. addSecretarySpine(name) {
  6029. let spine = new SpineMgr(name, () => {
  6030. this.playSecretaryIdle();
  6031. });
  6032. xGame.common.secretary = spine;
  6033. }
  6034. addClickSpine() {
  6035. let clickSpine = new SpineMgr("dianji", () => {
  6036. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6037. let parent = Laya.stage;
  6038. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6039. clickSpine.play(data, 0, false, parent, (spine) => {
  6040. spine.destroy(true);
  6041. });
  6042. });
  6043. });
  6044. }
  6045. addEvent() {
  6046. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6047. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6048. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6049. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6050. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6051. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6052. this.addUIClick(this.ui, this.interuptSecretary);
  6053. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6054. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6055. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6056. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6057. this.addUIClick(this.ui.signBtn, this.openSignView);
  6058. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6059. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6060. }
  6061. show(showFailWords) {
  6062. super.show();
  6063. this.moneyNode.ui.c1.selectedIndex = 1;
  6064. this.playSecretaryIdle();
  6065. xGame.soundMgr.playMusic("caromhall01");
  6066. Laya.timer.clearAll(this);
  6067. this.playSecretaryRandomSound();
  6068. if (showFailWords) {
  6069. setTimeout(() => {
  6070. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6071. let words = -1;
  6072. if (str == "s_main02") {
  6073. words = 2;
  6074. }
  6075. else {
  6076. words = 3;
  6077. }
  6078. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6079. xGame.soundMgr.playSound(str);
  6080. }, 300);
  6081. }
  6082. this.showGuide();
  6083. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6084. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6085. let guide = DataMgr.getSkillGuide();
  6086. if (guide == 1) {
  6087. let randTime = xGame.common.randomNum(300, 800);
  6088. if (this.firstEnter) {
  6089. this.firstEnter = false;
  6090. randTime += 900;
  6091. }
  6092. Laya.timer.once(randTime, this, () => {
  6093. xGame.common.autoPopUIView();
  6094. });
  6095. }
  6096. }
  6097. checkActive(show) {
  6098. }
  6099. showGuide() {
  6100. let guide = DataMgr.getSkillGuide();
  6101. this.ui.guideBtn.visible = guide == 0;
  6102. this.ui.enterGuide.visible = false;
  6103. this.ui.secretaryGuide.visible = guide == 0;
  6104. if (guide == 0) {
  6105. xGame.soundMgr.playSound("s_guide");
  6106. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6107. }
  6108. }
  6109. ensureSecretary() {
  6110. this.ui.secretaryGuide.visible = false;
  6111. this.ui.enterGuide.visible = true;
  6112. this.ui.wordsNode.t0.play();
  6113. if (DataMgr.getNewUser())
  6114. Moyu.sendDataEvent("gameReady");
  6115. }
  6116. playSecretaryIdle() {
  6117. let parent = this.ui.secretary.displayObject;
  6118. parent.destroyChildren();
  6119. let xx = this.ui.secretary.width / 2;
  6120. let yy = this.ui.secretary.height;
  6121. let scale = xGame.common.getSecretaryScale();
  6122. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6123. xGame.common.secretary.play(data, 1, true, parent);
  6124. }
  6125. startGame(type) {
  6126. xGame.common.gameMode = type;
  6127. Moyu.sendDataEvent("PlayGame", { type: type });
  6128. switch (xGame.common.gameMode) {
  6129. case GameMode.classic:
  6130. let challengeTimes = DataMgr.getChallengeTimes();
  6131. if (challengeTimes == 0) {
  6132. xGame.uiMgr.Show(UIInvitation);
  6133. }
  6134. else {
  6135. this.beginGame();
  6136. }
  6137. break;
  6138. case GameMode.bigMove:
  6139. this.beginGame();
  6140. if (DataMgr.getNewUser())
  6141. Moyu.sendDataEvent("gameStart0");
  6142. break;
  6143. default:
  6144. break;
  6145. }
  6146. }
  6147. beginGame(isNice = false) {
  6148. if (xGame.common.gameMode == GameMode.classic) {
  6149. if (isNice) {
  6150. this.enterClassic();
  6151. }
  6152. else {
  6153. xGame.uiMgr.Show(UIModeSelection, () => {
  6154. this.enterClassic();
  6155. });
  6156. }
  6157. }
  6158. else if (xGame.common.gameMode == GameMode.bigMove) {
  6159. this.ui.enterGuide.visible = false;
  6160. xGame.uiMgr.Show(UISkill);
  6161. }
  6162. }
  6163. enterClassic() {
  6164. xGame.uiMgr.Show(UIGame);
  6165. xGame.uiMgr.Show(UIMatching, () => {
  6166. if (!this.isHide)
  6167. this.hide();
  6168. xGame.common.gameUI.ui.alpha = 1;
  6169. xGame.common.gameUI.startGame();
  6170. xGame.uiMgr.Hide(UIGameEnd);
  6171. });
  6172. }
  6173. startGlobal() {
  6174. xGame.uiMgr.Show(UIMsg, "敬请期待~");
  6175. }
  6176. startWeekly() {
  6177. xGame.uiMgr.Show(UIMsg, "敬请期待~");
  6178. }
  6179. startPlaceBall() {
  6180. xGame.uiMgr.Show(UILevelDisplay);
  6181. }
  6182. hide() {
  6183. super.hide();
  6184. xGame.common.stopGirlPop(this.ui.talkNode);
  6185. }
  6186. onGetUserInfo(force = false) {
  6187. if (Moyu.isWx) {
  6188. let info = Moyu.getSystemInfo();
  6189. if (info)
  6190. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6191. }
  6192. else {
  6193. Moyu.initUser(this, this.freshUser, force);
  6194. }
  6195. if (!Moyu.hasUserInfo) {
  6196. let user = Moyu.getUserInfo();
  6197. user.headIcon = 'res/ty_touxiang.png';
  6198. }
  6199. this.freshUser();
  6200. }
  6201. freshUser() {
  6202. let user = Moyu.getUserInfo();
  6203. if (!user.isAuth) {
  6204. user.headIcon = 'res/ty_touxiang.png';
  6205. }
  6206. else
  6207. DataMgr.upRankData();
  6208. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6209. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6210. }
  6211. interuptSecretary() {
  6212. Laya.timer.clearAll(this);
  6213. this.playSecretaryRandomSound();
  6214. }
  6215. playSecretaryRandomSound() {
  6216. if (this.isHide)
  6217. return;
  6218. let time = xGame.common.randomNum(45000, 60000);
  6219. Laya.timer.once(time, this, () => {
  6220. if (this.isHide)
  6221. return;
  6222. let index = xGame.common.randomNum(4, 7);
  6223. xGame.soundMgr.playSound("s_main0" + index);
  6224. let words = 1;
  6225. switch (index) {
  6226. case 4:
  6227. words = 5;
  6228. break;
  6229. case 5:
  6230. words = 3;
  6231. break;
  6232. case 6:
  6233. words = 6;
  6234. break;
  6235. case 7:
  6236. words = 7;
  6237. break;
  6238. default:
  6239. break;
  6240. }
  6241. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6242. this.playSecretaryRandomSound();
  6243. });
  6244. }
  6245. openSecretaryView() {
  6246. xGame.uiMgr.Show(UISecretary);
  6247. Moyu.sendDataEvent("secretary");
  6248. }
  6249. openShopView() {
  6250. xGame.uiMgr.Show(UIShop);
  6251. }
  6252. openSignView() {
  6253. xGame.uiMgr.Show(UISign);
  6254. }
  6255. openDrawView() {
  6256. xGame.uiMgr.Show(UIDraw);
  6257. }
  6258. openRanking() {
  6259. xGame.uiMgr.Show(UIRanking);
  6260. Moyu.sendDataEvent("rankingList");
  6261. }
  6262. }
  6263. UIMain.uiName = "UIMain";
  6264. class UIGameEnd extends UIBase {
  6265. constructor() {
  6266. super();
  6267. this.success = false;
  6268. this.awardCoinNum = 1000;
  6269. this.awardDiamondNum = 10;
  6270. }
  6271. onConstructor() {
  6272. this.ui = ui_UIGameEnd.createInstance();
  6273. this.contentPane = this.ui;
  6274. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6275. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6276. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6277. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6278. this.ui.talkNode.visible = false;
  6279. if (Moyu.isKs)
  6280. this.ui.closeNode.closeBtn.x += 100;
  6281. }
  6282. updateType() {
  6283. switch (xGame.common.gameMode) {
  6284. case GameMode.classic:
  6285. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6286. this.ui.coinNode.visible = this.success;
  6287. if (!this.success) {
  6288. Laya.timer.once(500, this, () => {
  6289. xGame.uiMgr.Show(UIAddCoin);
  6290. });
  6291. }
  6292. this.ui.isGetAward.visible = false;
  6293. this.ui.leftBtn.c1.selectedIndex = 3;
  6294. this.ui.rightBtn.c1.selectedIndex = 0;
  6295. this.moneyNode.ui.c1.selectedIndex = 1;
  6296. break;
  6297. case GameMode.bigMove:
  6298. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6299. this.ui.coinNode.visible = this.success;
  6300. if (xGame.common.gameMode == GameMode.bigMove) {
  6301. if (this.success) {
  6302. DataMgr.setSkillSuccessTimes(1, true);
  6303. DataMgr.setSkillAccTimes(1);
  6304. }
  6305. else {
  6306. DataMgr.setSkillSuccessTimes(0, false);
  6307. }
  6308. }
  6309. if (!this.success) {
  6310. Laya.timer.once(500, this, () => {
  6311. xGame.uiMgr.Show(UIAddCoin);
  6312. });
  6313. }
  6314. this.ui.isGetAward.visible = false;
  6315. this.ui.leftBtn.c1.selectedIndex = 3;
  6316. this.ui.rightBtn.c1.selectedIndex = 0;
  6317. this.moneyNode.ui.c1.selectedIndex = 1;
  6318. break;
  6319. case GameMode.placeBall:
  6320. this.ui.coinNode.visible = false;
  6321. if (this.success) {
  6322. if (xGame.common.placeBallStarNum == 3) {
  6323. this.ui.c1.selectedIndex = 2;
  6324. }
  6325. else {
  6326. this.ui.c1.selectedIndex = 3;
  6327. }
  6328. }
  6329. else {
  6330. this.ui.c1.selectedIndex = 4;
  6331. }
  6332. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6333. if (cfg.type == PlaceBallType.challenge) {
  6334. this.ui.c1.selectedIndex = 2;
  6335. }
  6336. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `打进场上所有球` : `打进${cfg.ball}颗球`;
  6337. this.updatePlaceBallBtn();
  6338. this.updatePlaceBallStarNum();
  6339. this.updatePlaceBallAwardState();
  6340. this.moneyNode.ui.c1.selectedIndex = 2;
  6341. this.moneyNode.checkPowerTime();
  6342. this.moneyNode.powerChange();
  6343. DataMgr.upRankData();
  6344. break;
  6345. default:
  6346. break;
  6347. }
  6348. }
  6349. updatePlaceBallBtn() {
  6350. this.ui.leftBtn.c1.selectedIndex = 5;
  6351. if (this.success) {
  6352. this.ui.rightBtn.c1.selectedIndex = 14;
  6353. }
  6354. else {
  6355. if (xGame.common.placeBallStarNum == 3) {
  6356. this.ui.rightBtn.c1.selectedIndex = 14;
  6357. }
  6358. else {
  6359. this.ui.rightBtn.c1.selectedIndex = 1;
  6360. }
  6361. }
  6362. }
  6363. updatePlaceBallStarNum() {
  6364. let starNum = xGame.common.placeBallStarNum;
  6365. if (starNum == 0)
  6366. this.ui.starNumNode.c1.selectedIndex = 3;
  6367. else {
  6368. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6369. }
  6370. }
  6371. updatePlaceBallAwardState() {
  6372. let level = xGame.common.placeBallCurLevel;
  6373. let starNum = xGame.common.placeBallStarNum;
  6374. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6375. let data = cfgTable.placeballData[level].award;
  6376. let cfg = cfgTable.placeballData[level];
  6377. this.awardDiamondNum = data[1];
  6378. this.awardCoinNum = data[0];
  6379. if (cfg.type == PlaceBallType.challenge) {
  6380. this.awardDiamondNum = 0;
  6381. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6382. }
  6383. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6384. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6385. if (cfg.type == PlaceBallType.challenge) {
  6386. this.ui.awardNode.coinNode.visible = true;
  6387. }
  6388. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6389. this.ui.awardNode.diamondNode.x = 265;
  6390. this.ui.awardNode.coinNode.x = 354;
  6391. }
  6392. else {
  6393. this.ui.awardNode.diamondNode.x = 291;
  6394. this.ui.awardNode.coinNode.x = 291;
  6395. }
  6396. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6397. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6398. if (this.awardCoinNum == 0) {
  6399. this.ui.awardNode.coinNode.numTxt.text = "";
  6400. }
  6401. if (getAward) {
  6402. this.ui.isGetAward.visible = true;
  6403. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6404. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6405. }
  6406. else {
  6407. this.ui.isGetAward.visible = false;
  6408. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6409. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6410. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6411. }
  6412. else {
  6413. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6414. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6415. }
  6416. }
  6417. }
  6418. show(success) {
  6419. super.show();
  6420. xGame.eventMgr.event(RESET_GAME);
  6421. this.success = success;
  6422. Laya.timer.clearAll(this);
  6423. this.playSecretaryAni();
  6424. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6425. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6426. offsetTime = Math.floor(offsetTime / 1000);
  6427. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6428. this.updateType();
  6429. Laya.timer.once(200, this, () => {
  6430. this.addAward(() => {
  6431. this.updateType();
  6432. Laya.timer.once(500, this, () => {
  6433. this.showChallengeLevel();
  6434. });
  6435. });
  6436. });
  6437. if (this.success) {
  6438. xGame.soundMgr.playSound('slots_roll01');
  6439. xGame.soundMgr.playSound("s_win");
  6440. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6441. }
  6442. else {
  6443. xGame.soundMgr.playSound('matchwin01');
  6444. xGame.soundMgr.playSound("s_lose");
  6445. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6446. }
  6447. if (!Moyu.isLegal)
  6448. PlatMgr.showBanner(true);
  6449. let challengeNum = DataMgr.getChallengeTimes();
  6450. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6451. DataMgr.setChallengeTimes(1);
  6452. }
  6453. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6454. DataMgr.setClassicTimes();
  6455. }
  6456. }
  6457. showChallengeLevel() {
  6458. if (DataMgr.getChallengeTimes() != 0)
  6459. return;
  6460. let skill = DataMgr.getSkillAccTimes();
  6461. let put = DataMgr.getPlaceBallLevelList().length;
  6462. if (skill >= 3 || put >= 5) {
  6463. xGame.uiMgr.Show(UIInvitation);
  6464. this.hide();
  6465. }
  6466. }
  6467. addAward(callback) {
  6468. if (!this.success) {
  6469. callback && callback();
  6470. return;
  6471. }
  6472. switch (xGame.common.gameMode) {
  6473. case GameMode.classic:
  6474. this.awardCoinNum = xGame.common.passAwardCoin;
  6475. this.awardDiamondNum = 0;
  6476. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6477. break;
  6478. case GameMode.bigMove:
  6479. this.awardCoinNum = xGame.common.passAwardCoin;
  6480. this.awardDiamondNum = 0;
  6481. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6482. callback && callback();
  6483. break;
  6484. case GameMode.placeBall:
  6485. let level = xGame.common.placeBallCurLevel;
  6486. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6487. if (xGame.common.placeBallStarNum != 3) {
  6488. callback && callback();
  6489. return;
  6490. }
  6491. else {
  6492. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6493. if (getAward) {
  6494. callback && callback();
  6495. return;
  6496. }
  6497. }
  6498. let cfg = cfgTable.placeballData[level];
  6499. let data = cfgTable.placeballData[level].award;
  6500. this.awardCoinNum = data[0];
  6501. this.awardDiamondNum = data[1];
  6502. if (cfg.type == PlaceBallType.challenge) {
  6503. this.awardDiamondNum = 0;
  6504. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6505. }
  6506. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6507. let diamondAward;
  6508. if (this.awardDiamondNum > 0) {
  6509. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6510. xGame.common.getAward([diamondAward, coinAward], callback);
  6511. }
  6512. else {
  6513. xGame.common.getAward([coinAward], callback);
  6514. }
  6515. if (cfg.type == PlaceBallType.normal) {
  6516. DataMgr.setPlaceBallAward(level);
  6517. }
  6518. break;
  6519. default:
  6520. break;
  6521. }
  6522. }
  6523. playSecretaryAni() {
  6524. let parent = this.ui.secretary.displayObject;
  6525. parent.destroyChildren();
  6526. let xx = this.ui.secretary.width / 2;
  6527. let yy = this.ui.secretary.height;
  6528. let scale = xGame.common.getSecretaryScale();
  6529. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6530. if (this.success) {
  6531. let rand = Math.random() <= 0.5 ? 2 : 3;
  6532. xGame.common.secretary.play(data, rand, false, parent, () => {
  6533. xGame.common.secretary.play(data, 1, true, parent);
  6534. });
  6535. }
  6536. else {
  6537. xGame.common.secretary.play(data, 0, true, parent);
  6538. }
  6539. }
  6540. restartGame() {
  6541. switch (xGame.common.gameMode) {
  6542. case GameMode.classic:
  6543. xGame.eventMgr.event(RESTART_GAME);
  6544. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6545. break;
  6546. case GameMode.bigMove:
  6547. this.hide();
  6548. xGame.eventMgr.event(RESTART_GAME);
  6549. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6550. break;
  6551. default:
  6552. break;
  6553. }
  6554. }
  6555. hide() {
  6556. super.hide();
  6557. xGame.common.stopGirlPop(this.ui.talkNode);
  6558. PlatMgr.showBanner(false);
  6559. }
  6560. returnHome() {
  6561. this.hide();
  6562. let showFailWords = !this.success;
  6563. xGame.uiMgr.Show(UIMain, showFailWords);
  6564. }
  6565. clickLeftBtn() {
  6566. switch (xGame.common.gameMode) {
  6567. case GameMode.classic:
  6568. case GameMode.bigMove:
  6569. this.returnHome();
  6570. break;
  6571. case GameMode.placeBall:
  6572. let level = xGame.common.placeBallCurLevel;
  6573. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6574. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6575. break;
  6576. default:
  6577. break;
  6578. }
  6579. }
  6580. powerStartPlaceBallLevel(level, btn) {
  6581. if (DataMgr.powerEnough()) {
  6582. btn.touchable = false;
  6583. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6584. btn.touchable = true;
  6585. DataMgr.setPower(-1);
  6586. xGame.eventMgr.event(POWER_TIME);
  6587. this.startPlaceBallLevel(level);
  6588. }));
  6589. }
  6590. else {
  6591. xGame.uiMgr.Show(UIPower, 0);
  6592. }
  6593. }
  6594. clickRightBtn() {
  6595. switch (xGame.common.gameMode) {
  6596. case GameMode.classic:
  6597. case GameMode.bigMove:
  6598. this.restartGame();
  6599. break;
  6600. case GameMode.placeBall:
  6601. let level = xGame.common.placeBallCurLevel;
  6602. let data = DataMgr.getPlaceBallLevel(level);
  6603. let curPss = data.play && !data.isCur;
  6604. if (curPss) {
  6605. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6606. }
  6607. else {
  6608. Moyu.sendDataEvent("placeBallNextLevel");
  6609. Moyu.showVideoAd(() => {
  6610. DataMgr.setPlaceBallLevel(level, 1);
  6611. this.startPlaceBallLevel(level + 1);
  6612. }, xGame.define.EAdType.placeBallNextLevel);
  6613. }
  6614. break;
  6615. default:
  6616. break;
  6617. }
  6618. }
  6619. startPlaceBallLevel(level) {
  6620. xGame.common.gameMode = GameMode.placeBall;
  6621. xGame.common.placeBallCurLevel = level;
  6622. xGame.uiMgr.Show(UIGame);
  6623. this.hide();
  6624. }
  6625. }
  6626. UIGameEnd.uiName = "UIGameEnd";
  6627. class ui_UIRepentProp extends fgui.GComponent {
  6628. static createInstance() {
  6629. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6630. }
  6631. onConstruct() {
  6632. this.c1 = this.getController("c1");
  6633. this.n11 = (this.getChild("n11"));
  6634. this.regretNode = (this.getChild("regretNode"));
  6635. this.helpLineNode = (this.getChild("helpLineNode"));
  6636. this.t0 = this.getTransition("t0");
  6637. }
  6638. }
  6639. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6640. class UIRepentProp extends UIBase {
  6641. constructor() {
  6642. super();
  6643. this.viewType = 0;
  6644. this.regretType = 0;
  6645. }
  6646. onConstructor() {
  6647. this.ui = ui_UIRepentProp.createInstance();
  6648. this.contentPane = this.ui;
  6649. this.isEject = false;
  6650. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6651. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6652. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6653. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6654. }
  6655. show(viewType, regretType, callback) {
  6656. PlatMgr.showInsert(true);
  6657. this.viewType = viewType;
  6658. this.regretType = regretType;
  6659. this.callback = callback;
  6660. super.show();
  6661. this.ui.t0.play();
  6662. this.ui.c1.selectedIndex = this.viewType;
  6663. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6664. if (this.viewType == 0) {
  6665. let guide = DataMgr.getGuideHelpLine();
  6666. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6667. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6668. }
  6669. xGame.common.gameMgr.gamePause = true;
  6670. }
  6671. hideSelf() {
  6672. xGame.common.gameMgr.gamePause = false;
  6673. this.callback && this.callback(false);
  6674. this.hide();
  6675. }
  6676. videoRegret() {
  6677. Moyu.showVideoAd(() => {
  6678. this.callback && this.callback(true);
  6679. this.hideSelf();
  6680. }, EAdType.regretBall);
  6681. }
  6682. videoAddHelpLine() {
  6683. let guide = DataMgr.getGuideHelpLine();
  6684. if (guide == 0) {
  6685. this.callback && this.callback(true);
  6686. this.hideSelf();
  6687. DataMgr.setGuideHelpLine();
  6688. xGame.common.gameUI.ui.guideNode.visible = false;
  6689. }
  6690. else {
  6691. Moyu.showVideoAd(() => {
  6692. this.callback && this.callback(true);
  6693. this.hideSelf();
  6694. }, EAdType.longHelpLine);
  6695. }
  6696. }
  6697. }
  6698. UIRepentProp.uiName = "UIRepentProp";
  6699. class ui_UIVideoShare extends fgui.GComponent {
  6700. static createInstance() {
  6701. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6702. }
  6703. onConstruct() {
  6704. this.n10 = (this.getChild("n10"));
  6705. this.myNode = (this.getChild("myNode"));
  6706. this.t0 = this.getTransition("t0");
  6707. }
  6708. }
  6709. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6710. class UIVideoShare extends UIBase {
  6711. constructor() {
  6712. super();
  6713. this.success = false;
  6714. this.awardNum = 0;
  6715. this.isShared = true;
  6716. }
  6717. onConstructor() {
  6718. this.ui = ui_UIVideoShare.createInstance();
  6719. this.contentPane = this.ui;
  6720. this.isEject = false;
  6721. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6722. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6723. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6724. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6725. }
  6726. show(success) {
  6727. super.show();
  6728. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6729. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6730. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6731. this.success = success;
  6732. let time = xGame.common.randomNum(600, 1500);
  6733. Moyu.showInsertAd(time, 60000);
  6734. if (success)
  6735. xGame.soundMgr.playSound("applause");
  6736. this.ui.t0.play();
  6737. this.checkShareState();
  6738. let times = DataMgr.getDailyVideoShareTimes();
  6739. this.awardNum = times == 0 ? 2000 : 200;
  6740. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6741. }
  6742. checkShareState() {
  6743. if (PlatMgr.forceShare == 0) {
  6744. this.ui.myNode.closeBtn.visible = true;
  6745. this.ui.myNode.tipsNode.visible = false;
  6746. this.ui.myNode.closeBtn.x = 90;
  6747. this.ui.myNode.shareBtn.x = 342;
  6748. }
  6749. else if (PlatMgr.forceShare == 1) {
  6750. this.ui.myNode.closeBtn.visible = false;
  6751. this.ui.myNode.tipsNode.visible = true;
  6752. this.ui.myNode.shareBtn.x = 218;
  6753. this.isShared = true;
  6754. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6755. }
  6756. }
  6757. checkForceShare() {
  6758. this.isShared = !this.isShared;
  6759. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6760. }
  6761. videoShare() {
  6762. if (PlatMgr.forceShare == 1) {
  6763. if (this.isShared) {
  6764. this.shareGame();
  6765. }
  6766. else {
  6767. this.hideSelf();
  6768. }
  6769. }
  6770. else {
  6771. this.shareGame();
  6772. }
  6773. }
  6774. shareGame() {
  6775. Moyu.sendDataEvent("VideoShare");
  6776. if (Moyu.canShare() > 100) {
  6777. Moyu.shareGame((success) => {
  6778. if (success) {
  6779. DataMgr.setDailyVideoShareTimes(1);
  6780. DataMgr.setCoin(this.awardNum);
  6781. }
  6782. this.hideSelf();
  6783. }, this);
  6784. }
  6785. else {
  6786. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6787. this.hideSelf();
  6788. }
  6789. }
  6790. hideSelf() {
  6791. this.hide();
  6792. xGame.uiMgr.Show(UIGameEnd, this.success);
  6793. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6794. xGame.common.screenImg.destroy();
  6795. xGame.common.screenImg = null;
  6796. }
  6797. }
  6798. }
  6799. UIVideoShare.uiName = "UIVideoShare";
  6800. class ui_UITips extends fgui.GComponent {
  6801. static createInstance() {
  6802. return (fgui.UIPackage.createObject("game", "UITips"));
  6803. }
  6804. onConstruct() {
  6805. this.n0 = (this.getChild("n0"));
  6806. this.myNode = (this.getChild("myNode"));
  6807. this.t0 = this.getTransition("t0");
  6808. }
  6809. }
  6810. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6811. class UITips extends UIBase {
  6812. constructor() {
  6813. super();
  6814. this.type = 0;
  6815. }
  6816. onConstructor() {
  6817. this.ui = ui_UITips.createInstance();
  6818. this.contentPane = this.ui;
  6819. this.isEject = false;
  6820. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  6821. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  6822. }
  6823. show(tipsTxt, womanTxt, type) {
  6824. super.show();
  6825. this.ui.t0.play();
  6826. this.ui.myNode.tipsTxt.text = tipsTxt;
  6827. this.ui.myNode.womanTxt.text = womanTxt;
  6828. PlatMgr.showInsert(true);
  6829. this.ui.myNode.c1.selectedIndex = type;
  6830. this.type = type;
  6831. switch (this.type) {
  6832. case TipsType.exitGame:
  6833. xGame.common.gameMgr.gamePause = true;
  6834. break;
  6835. case TipsType.foul:
  6836. Laya.timer.once(200, this, () => {
  6837. xGame.common.gameMgr.gamePause = true;
  6838. });
  6839. break;
  6840. default:
  6841. break;
  6842. }
  6843. }
  6844. clickLeftBtn() {
  6845. this.hide();
  6846. xGame.common.gameMgr.gamePause = false;
  6847. switch (this.type) {
  6848. case TipsType.exitGame:
  6849. break;
  6850. case TipsType.foul:
  6851. break;
  6852. default:
  6853. break;
  6854. }
  6855. }
  6856. clickRightBtn() {
  6857. this.hide();
  6858. switch (this.type) {
  6859. case TipsType.exitGame:
  6860. xGame.eventMgr.event(RESET_GAME);
  6861. xGame.uiMgr.Show(UIMain);
  6862. Moyu.recordEnd(this, null);
  6863. xGame.common.longHelpLine = false;
  6864. break;
  6865. case TipsType.foul:
  6866. xGame.common.gameMgr.gamePause = false;
  6867. Laya.timer.clearAll(this);
  6868. break;
  6869. default:
  6870. break;
  6871. }
  6872. }
  6873. }
  6874. UITips.uiName = "UITips";
  6875. class GameMgr {
  6876. constructor() {
  6877. this.selfCamp = "";
  6878. this.selfFoulNum = 0;
  6879. this.selfBallArr = [];
  6880. this.selfTimer = 0;
  6881. this.selfScore = 0;
  6882. this.aiCamp = "";
  6883. this.aiFoulNum = 0;
  6884. this.aiBallArr = [];
  6885. this.aiTimer = 0;
  6886. this.aiScore = 0;
  6887. this.aiSkillLevelNum = 1;
  6888. this.targertScore = 0;
  6889. this.setTime = 30;
  6890. this.selfTurnRate = 0.5;
  6891. this.accTime = 0;
  6892. this.curFoul = "";
  6893. this.maxFoulTimes = 3;
  6894. this.isFirstInGame = true;
  6895. this.firstColliObj = null;
  6896. this.inHoleBalls = [];
  6897. this.blackNum = 8;
  6898. this.success = false;
  6899. this.holePosList = [];
  6900. this.posObj = {};
  6901. this._selfTurn = false;
  6902. this.lastRootBallPos = new Laya.Vector2(311, 430);
  6903. this.ensureBallType = false;
  6904. this.isOpenBall = true;
  6905. this.finishOneShoot = true;
  6906. this.isEnd = false;
  6907. this.isChangeTurn = false;
  6908. this.isInterrupt = false;
  6909. this.aiPlayedBreakArmy = false;
  6910. this.isTouchedBall = false;
  6911. this.finishBalls = 0;
  6912. this.needBalls = 0;
  6913. this.allBallNum = 0;
  6914. this.placeBallPosData = {};
  6915. this.curHP = 0;
  6916. this.showLongView = false;
  6917. this.firstShoot = true;
  6918. this._gamePause = false;
  6919. this.trunCount = 0;
  6920. this.isBlackInHole = false;
  6921. this.isEnter = true;
  6922. xGame.eventMgr.offAll(ALL_BALL_STOP);
  6923. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  6924. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  6925. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  6926. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  6927. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  6928. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  6929. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  6930. }
  6931. get gamePause() {
  6932. return this._gamePause;
  6933. }
  6934. set gamePause(v) {
  6935. if (v) {
  6936. Laya.physicsTimer.pause();
  6937. }
  6938. else {
  6939. Laya.physicsTimer.resume();
  6940. }
  6941. this._gamePause = v;
  6942. }
  6943. get selfTurn() {
  6944. return this._selfTurn;
  6945. }
  6946. set selfTurn(val) {
  6947. this.trunCount++;
  6948. this._selfTurn = val;
  6949. if (val) {
  6950. xGame.common.d2World.d2Gan.ui.self.visible = true;
  6951. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  6952. }
  6953. else {
  6954. xGame.common.d2World.d2Gan.ui.self.visible = false;
  6955. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  6956. if (this.trunCount > 1)
  6957. PlatMgr.openBox();
  6958. }
  6959. }
  6960. resetGame() {
  6961. this.inHoleBalls = [];
  6962. this.isFirstInGame = true;
  6963. this.firstColliObj = null;
  6964. this.aiCamp = "";
  6965. this.selfCamp = "";
  6966. this.aiFoulNum = 0;
  6967. this.selfFoulNum = 0;
  6968. this.selfBallArr = [];
  6969. this.aiBallArr = [];
  6970. this.gamePause = false;
  6971. this.ensureBallType = false;
  6972. this.isInterrupt = false;
  6973. this.updateLeftBall();
  6974. this.clearTime();
  6975. this.aiPlayedBreakArmy = false;
  6976. this.isBlackInHole = false;
  6977. this.placeBallPosData = {};
  6978. if (xGame.common.d3World.knifeRoot) {
  6979. xGame.common.d3World.knifeRoot.destroyChildren();
  6980. }
  6981. }
  6982. gameReady() {
  6983. this.trunCount = 0;
  6984. this.firstColliObj = null;
  6985. this.isFirstInGame = true;
  6986. this.selfTurn = Math.random() <= this.selfTurnRate;
  6987. let challengeNum = DataMgr.getChallengeTimes();
  6988. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6989. this.selfTurn = true;
  6990. }
  6991. if (xGame.common.gameMode == GameMode.placeBall)
  6992. this.selfTurn = true;
  6993. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  6994. this.selfTurn = true;
  6995. }
  6996. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  6997. this.checkGuide();
  6998. if (xGame.common.uiRodMethod)
  6999. xGame.common.uiRodMethod.resetRod();
  7000. xGame.common.d2World.getHelpLine();
  7001. this.isOpenBall = true;
  7002. this.isTouchedBall = false;
  7003. xGame.common.aiPlayer.stopRun();
  7004. this.setTime = 30;
  7005. let ui = xGame.common.gameUI.ui;
  7006. switch (xGame.common.gameMode) {
  7007. case GameMode.classic:
  7008. xGame.common.aiPlayer.init();
  7009. this.blackNum = 8;
  7010. this.placeRootBall();
  7011. this.peoplePlay(9, 10);
  7012. ui.wordsBtn.visible = true;
  7013. ui.aiWordsBtn.visible = true;
  7014. xGame.common.talkMgr.changeAIState(true);
  7015. DataMgr.gameData.gameCount++;
  7016. DataMgr.saveGameData();
  7017. break;
  7018. case GameMode.bigMove:
  7019. this.blackNum = -1;
  7020. this.selfScore = 0;
  7021. this.aiScore = 0;
  7022. xGame.common.aiPlayer.init();
  7023. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7024. this.updateSelfScore();
  7025. this.updateAIScore();
  7026. this.updateTargetSroce();
  7027. this.placeRootBall();
  7028. this.peoplePlay(9, 10);
  7029. ui.wordsBtn.visible = true;
  7030. ui.aiWordsBtn.visible = true;
  7031. xGame.common.talkMgr.changeAIState(true);
  7032. if (DataMgr.getSkillGuide() < 1)
  7033. DataMgr.gameData.gameCount = 0;
  7034. else {
  7035. DataMgr.gameData.gameCount++;
  7036. DataMgr.saveGameData();
  7037. PlatMgr.openTry();
  7038. }
  7039. if (xGame.common.d3World.knifeRoot) {
  7040. xGame.common.d3World.knifeRoot.destroyChildren();
  7041. }
  7042. break;
  7043. case GameMode.placeBall:
  7044. this.blackNum = -1;
  7045. this.selfTurn = true;
  7046. this.setTime = 10000;
  7047. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7048. this.curHP = this.placeBallData.hp;
  7049. if (this.placeBallData.ball == -1)
  7050. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7051. else
  7052. this.needBalls = this.placeBallData.ball;
  7053. console.log("需要的进球数目", this.needBalls);
  7054. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7055. this.finishBalls = 0;
  7056. this.placeBallPosData = {};
  7057. this.updatePlaceBallPos();
  7058. this.updatePlaceBallState();
  7059. this.finishOneShoot = true;
  7060. xGame.common.gameUI.ui.moveNode.visible = false;
  7061. this.isOpenBall = false;
  7062. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7063. ui.wordsBtn.visible = false;
  7064. ui.aiWordsBtn.visible = false;
  7065. xGame.common.talkMgr.changeAIState(false);
  7066. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7067. PlatMgr.openBox();
  7068. });
  7069. break;
  7070. default:
  7071. break;
  7072. }
  7073. this.showLongView = false;
  7074. xGame.common.wordsMgr.comboTimes = 1;
  7075. let guide = DataMgr.getSkillGuide();
  7076. if (guide)
  7077. xGame.eventMgr.event(WAIT_SHOOT);
  7078. xGame.common.upSkillLevel = false;
  7079. xGame.common.gameStartTime = new Date().getTime();
  7080. this.firstShoot = true;
  7081. }
  7082. checkGuide() {
  7083. let guide = DataMgr.getSkillGuide();
  7084. let gameUI = xGame.common.gameUI.ui;
  7085. gameUI.guide1.visible = false;
  7086. gameUI.guide2.visible = false;
  7087. gameUI.guide3.visible = false;
  7088. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7089. this.selfTurn = true;
  7090. }
  7091. else {
  7092. return;
  7093. }
  7094. let oneBall = this.getOneBall();
  7095. gameUI.guide1.visible = true;
  7096. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7097. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7098. }
  7099. getOneBall() {
  7100. let arr = xGame.common.d2World.ballArr;
  7101. for (let index = 0; index < arr.length; index++) {
  7102. if (arr[index].number == 0)
  7103. continue;
  7104. return arr[index];
  7105. }
  7106. }
  7107. updateSelfScore() {
  7108. let ui = xGame.common.gameUI.ui.topNode;
  7109. ui.selfScoreTxt.text = this.selfScore + "";
  7110. }
  7111. updateAIScore() {
  7112. let ui = xGame.common.gameUI.ui.topNode;
  7113. ui.aiScoreTxt.text = this.aiScore + "";
  7114. }
  7115. updateTargetSroce() {
  7116. let ui = xGame.common.gameUI.ui.topNode;
  7117. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7118. }
  7119. updateLeftBall() {
  7120. let topUI = xGame.common.gameUI.ui.topNode;
  7121. topUI.selfBallList.numItems = this.selfBallArr.length;
  7122. topUI.aiBallList.numItems = this.aiBallArr.length;
  7123. }
  7124. ballShoot() {
  7125. this.clearTime();
  7126. this.finishOneShoot = false;
  7127. xGame.common.gameUI.ui.moveNode.visible = false;
  7128. if (xGame.common.gameUI.ui.guideNode.visible) {
  7129. xGame.common.gameUI.ui.guideNode.visible = false;
  7130. }
  7131. if (this.firstShoot) {
  7132. this.firstShoot = false;
  7133. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7134. }
  7135. }
  7136. ensureCamp(number) {
  7137. this.ensureBallType = true;
  7138. this.isOpenBall = false;
  7139. if (xGame.common.gameMode != GameMode.classic)
  7140. return;
  7141. let full = [1, 2, 3, 4, 5, 6, 7];
  7142. let flower = [9, 10, 11, 12, 13, 14, 15];
  7143. let sayWords = "";
  7144. if (this.selfTurn) {
  7145. if (number <= 7) {
  7146. this.selfCamp = ballCamp.full;
  7147. this.selfBallArr = full;
  7148. this.aiCamp = ballCamp.flower;
  7149. this.aiBallArr = flower;
  7150. sayWords = cfgTable.wordsData[3].msg;
  7151. }
  7152. else {
  7153. this.selfCamp = ballCamp.flower;
  7154. this.selfBallArr = flower;
  7155. this.aiCamp = ballCamp.full;
  7156. this.aiBallArr = full;
  7157. sayWords = cfgTable.wordsData[4].msg;
  7158. }
  7159. }
  7160. else {
  7161. if (number <= 7) {
  7162. this.selfCamp = ballCamp.flower;
  7163. this.selfBallArr = flower;
  7164. this.aiCamp = ballCamp.full;
  7165. this.aiBallArr = full;
  7166. sayWords = cfgTable.wordsData[2].msg;
  7167. }
  7168. else {
  7169. this.selfCamp = ballCamp.full;
  7170. this.selfBallArr = full;
  7171. this.aiCamp = ballCamp.flower;
  7172. this.aiBallArr = flower;
  7173. sayWords = cfgTable.wordsData[1].msg;
  7174. }
  7175. }
  7176. this.updateLeftBall();
  7177. xGame.uiMgr.Show(UIMsg, sayWords);
  7178. }
  7179. updatePlaceBallState() {
  7180. let ui = xGame.common.gameUI.ui;
  7181. switch (this.placeBallData.type) {
  7182. case PlaceBallType.normal:
  7183. let normal = ui.placeNormalNode;
  7184. normal.hpTxt.text = this.curHP + "";
  7185. this.updatePlaceBallStar(normal);
  7186. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7187. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7188. break;
  7189. case PlaceBallType.challenge:
  7190. let challenge = ui.placeChallengeNode;
  7191. challenge.hpTxt.text = "杆数:" + this.curHP;
  7192. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7193. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7194. challenge.tipsTxt.text = `打进${this.needBalls}颗球`;
  7195. break;
  7196. default:
  7197. break;
  7198. }
  7199. }
  7200. playSubHpAni() {
  7201. let ui = xGame.common.gameUI.ui;
  7202. switch (this.placeBallData.type) {
  7203. case PlaceBallType.normal:
  7204. let normal = ui.placeNormalNode;
  7205. normal.hpTxt.visible = false;
  7206. normal.starAni.c1.selectedIndex = 1;
  7207. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7208. normal.hpTxt.visible = true;
  7209. normal.starAni.c1.selectedIndex = 0;
  7210. }));
  7211. break;
  7212. default:
  7213. break;
  7214. }
  7215. }
  7216. getEndStarNum() {
  7217. let num;
  7218. let level = xGame.common.placeBallCurLevel;
  7219. if (this.curHP == this.placeBallData.hp) {
  7220. num = 3;
  7221. }
  7222. else if (this.curHP <= 1) {
  7223. num = 1;
  7224. }
  7225. else {
  7226. num = 2;
  7227. }
  7228. if (!this.success) {
  7229. num = 0;
  7230. }
  7231. else {
  7232. DataMgr.setPlaceBallLevel(level, num);
  7233. }
  7234. let myType = cfgTable.placeballData[level].type;
  7235. if (this.success && myType == 1) {
  7236. num = 3;
  7237. }
  7238. xGame.common.placeBallStarNum = num;
  7239. }
  7240. updatePlaceBallStar(node) {
  7241. let star = 0;
  7242. if (this.curHP == this.placeBallData.hp) {
  7243. star = 3;
  7244. }
  7245. else if (this.curHP >= 2) {
  7246. star = 2;
  7247. }
  7248. else if (this.curHP == 1) {
  7249. star = 1;
  7250. }
  7251. else {
  7252. star = 0;
  7253. }
  7254. let temp;
  7255. for (let index = 1; index <= 3; index++) {
  7256. temp = node["star" + index];
  7257. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7258. }
  7259. node.myProgress.value = (star / 3) * 100;
  7260. }
  7261. openRegretView(isFoul, GoalNum, challenge = false) {
  7262. let regretType = -1;
  7263. if (isFoul) {
  7264. regretType = 1;
  7265. }
  7266. else {
  7267. if (GoalNum <= 0) {
  7268. regretType = 0;
  7269. }
  7270. }
  7271. if (challenge) {
  7272. regretType = 1;
  7273. }
  7274. if (regretType != -1) {
  7275. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7276. if (success) {
  7277. this.curHP++;
  7278. this.updatePlaceBallState();
  7279. this.setPlaceBallAllPos();
  7280. xGame.common.gameUI.ui.moveNode.visible = false;
  7281. }
  7282. else {
  7283. if (this.curHP <= 0) {
  7284. this.success = false;
  7285. this.gameEnd();
  7286. }
  7287. this.playSubHpAni();
  7288. }
  7289. this.updatePlaceBallState();
  7290. this.updatePlaceBallPos();
  7291. });
  7292. }
  7293. }
  7294. setPlaceBallAllPos() {
  7295. let allBall = xGame.common.d2World.ballArr;
  7296. let cfgArr = this.placeBallPosData;
  7297. let temp;
  7298. let obj;
  7299. for (let index = 0; index < allBall.length; index++) {
  7300. temp = allBall[index];
  7301. if (temp.destroyed)
  7302. continue;
  7303. obj = cfgArr[temp.myUNID];
  7304. if (obj && obj.src && !obj.src.destroyed) {
  7305. temp.gameObj.x = obj.posX;
  7306. temp.gameObj.y = obj.posY;
  7307. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7308. }
  7309. }
  7310. xGame.common.d2World.getHelpLine();
  7311. }
  7312. updatePlaceBallPos() {
  7313. let arr = xGame.common.d2World.ballArr;
  7314. let temp;
  7315. for (let index = 0; index < arr.length; index++) {
  7316. temp = arr[index];
  7317. if (!this.placeBallPosData[temp.myUNID]) {
  7318. this.placeBallPosData[temp.myUNID] = {
  7319. src: temp,
  7320. posX: temp.gameObj.x,
  7321. posY: temp.gameObj.y
  7322. };
  7323. }
  7324. else {
  7325. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7326. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7327. }
  7328. }
  7329. let check;
  7330. for (const key in this.placeBallPosData) {
  7331. check = this.placeBallPosData[key];
  7332. if (check.src.destroyed) {
  7333. delete this.placeBallPosData[key];
  7334. }
  7335. }
  7336. }
  7337. gameRun(type) {
  7338. if (this.gamePause)
  7339. return;
  7340. this.curFoul = this.getFoulType();
  7341. if (type) {
  7342. xGame.common.d2World.d2Gan.shoot();
  7343. xGame.common.gameUI.forceCancel();
  7344. this.curFoul = type;
  7345. }
  7346. this.isEnd = false;
  7347. this.isChangeTurn = true;
  7348. if (xGame.common.gameMode == GameMode.classic) {
  7349. this.judgeClassic(this.curFoul);
  7350. this.checkClassicWords(() => {
  7351. xGame.common.destroyClassicEmotion();
  7352. if (this.isEnd) {
  7353. if (this.isBlackInHole) {
  7354. xGame.common.gameUI.ui.blackAni.visible = true;
  7355. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7356. xGame.common.gameUI.ui.blackAni.visible = false;
  7357. this.gameEnd();
  7358. }));
  7359. }
  7360. else {
  7361. this.gameEnd();
  7362. }
  7363. }
  7364. else {
  7365. this.waitShoot();
  7366. xGame.eventMgr.event(WAIT_SHOOT);
  7367. }
  7368. });
  7369. }
  7370. else if (xGame.common.gameMode == GameMode.bigMove) {
  7371. xGame.common.aiPlayer.stopRun();
  7372. let scoreArr = this.getScore(this.curFoul);
  7373. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7374. this.isEnd = true;
  7375. }
  7376. this.checkBigSkillWords(() => {
  7377. if (this.isEnd) {
  7378. this.gameEnd();
  7379. }
  7380. else {
  7381. this.waitShoot();
  7382. xGame.eventMgr.event(WAIT_SHOOT);
  7383. }
  7384. });
  7385. }
  7386. else if (xGame.common.gameMode == GameMode.placeBall) {
  7387. xGame.common.destroyAwardSpine();
  7388. let isFoul = this.curFoul == FoulType.rootHole;
  7389. let GoalNum = this.inHoleBalls.length;
  7390. if (this.inHoleBalls.indexOf(0) > -1)
  7391. GoalNum -= 1;
  7392. if (isFoul) {
  7393. this.placeRootBall();
  7394. }
  7395. console.log("neeballs", this.needBalls);
  7396. console.log("当前完成的goalNum", GoalNum);
  7397. this.finishBalls += GoalNum;
  7398. console.log("当前完成的finishballs", this.finishBalls);
  7399. let need = this.needBalls;
  7400. if (this.placeBallData.type == PlaceBallType.challenge) {
  7401. need += 100;
  7402. }
  7403. if (this.finishBalls >= need) {
  7404. this.success = true;
  7405. this.gameEnd();
  7406. }
  7407. else {
  7408. switch (this.placeBallData.type) {
  7409. case PlaceBallType.normal:
  7410. if (!isFoul && GoalNum > 0) {
  7411. this.updatePlaceBallPos();
  7412. this.updatePlaceBallState();
  7413. }
  7414. else {
  7415. this.curHP--;
  7416. this.openRegretView(isFoul, GoalNum);
  7417. }
  7418. this.waitShoot();
  7419. xGame.eventMgr.event(WAIT_SHOOT);
  7420. break;
  7421. case PlaceBallType.challenge:
  7422. this.curHP--;
  7423. this.updatePlaceBallState();
  7424. if (isFoul) {
  7425. this.openRegretView(isFoul, GoalNum, true);
  7426. }
  7427. else {
  7428. this.updatePlaceBallPos();
  7429. if (this.curHP <= 0) {
  7430. this.success = true;
  7431. this.gameEnd();
  7432. }
  7433. }
  7434. this.waitShoot();
  7435. xGame.eventMgr.event(WAIT_SHOOT);
  7436. break;
  7437. default:
  7438. break;
  7439. }
  7440. }
  7441. }
  7442. }
  7443. checkClassicWords(callback) {
  7444. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7445. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7446. let type = this.getClassicWordsType();
  7447. if (condition && type != -1) {
  7448. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7449. xGame.soundMgr.playSound(str);
  7450. xGame.common.wordsMgr.playClassicWords(type, callback);
  7451. }
  7452. else {
  7453. Laya.timer.once(300, this, () => {
  7454. callback && callback();
  7455. });
  7456. }
  7457. }
  7458. getClassicWordsType() {
  7459. let d2world = xGame.common.d2World;
  7460. let type = -1;
  7461. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7462. type = ClassicWordsType.perfectShow;
  7463. return type;
  7464. }
  7465. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7466. type = ClassicWordsType.directShoot;
  7467. return type;
  7468. }
  7469. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7470. type = ClassicWordsType.anotherShoot;
  7471. return type;
  7472. }
  7473. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7474. type = ClassicWordsType.bigPower;
  7475. return type;
  7476. }
  7477. let minSpeed = 1;
  7478. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7479. type = ClassicWordsType.hardShoot;
  7480. return type;
  7481. }
  7482. if (this.inHoleBalls.length > 0) {
  7483. type = ClassicWordsType.directShoot;
  7484. return type;
  7485. }
  7486. return type;
  7487. }
  7488. checkBigSkillWords(callback) {
  7489. if (this.curFoul == FoulType.timeOut) {
  7490. callback && callback();
  7491. }
  7492. else {
  7493. let playSkill = false;
  7494. if (this.selfTurn) {
  7495. playSkill = true;
  7496. }
  7497. else {
  7498. if (!this.aiPlayedBreakArmy) {
  7499. this.aiPlayedBreakArmy = true;
  7500. playSkill = true;
  7501. }
  7502. if (this.aiCurSkill != SkillType.breakArmy) {
  7503. playSkill = true;
  7504. }
  7505. }
  7506. if (xGame.common.skillMgr.playedLastSkill) {
  7507. xGame.common.skillMgr.playedLastSkill = false;
  7508. playSkill = false;
  7509. }
  7510. if (playSkill) {
  7511. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7512. let selfExtra = 0;
  7513. let aiExtra = 0;
  7514. if (this.selfTurn)
  7515. selfExtra += extraScore;
  7516. else
  7517. aiExtra += extraScore;
  7518. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7519. this.isEnd = true;
  7520. }
  7521. this.playBigSkillTimes(callback);
  7522. });
  7523. }
  7524. else {
  7525. this.playBigSkillTimes(callback);
  7526. }
  7527. }
  7528. }
  7529. playBigSkillTimes(callback) {
  7530. let length = this.inHoleBalls.length;
  7531. if (this.inHoleBalls.indexOf(0) > -1) {
  7532. length = this.inHoleBalls.length - 1;
  7533. }
  7534. if (length <= 0) {
  7535. callback && callback();
  7536. return;
  7537. }
  7538. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7539. callback && callback();
  7540. });
  7541. }
  7542. playSkillTips() {
  7543. let levelNum = 0;
  7544. let curType;
  7545. if (this.selfTurn) {
  7546. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7547. curType = this.selfCurSkill;
  7548. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7549. levelNum += 5;
  7550. }
  7551. }
  7552. else {
  7553. levelNum = this.aiSkillLevelNum;
  7554. curType = this.aiCurSkill;
  7555. }
  7556. let str = ``;
  7557. switch (curType) {
  7558. case SkillType.highSpace:
  7559. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7560. break;
  7561. case SkillType.breakArmy:
  7562. str = `You pocketed ${levelNum} extra balls`;
  7563. break;
  7564. case SkillType.ice:
  7565. str = `${levelNum * 2} extra balls were frozen`;
  7566. break;
  7567. case SkillType.fireworks:
  7568. str = `${levelNum} extra balls exploded `;
  7569. break;
  7570. case SkillType.GuanYu:
  7571. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  7572. break;
  7573. default:
  7574. break;
  7575. }
  7576. xGame.uiMgr.Show(UIMsg, str);
  7577. }
  7578. getFoulType() {
  7579. let foulType = "";
  7580. if (this.firstColliObj == null) {
  7581. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7582. return FoulType.rootHole;
  7583. }
  7584. return FoulType.notTouch;
  7585. }
  7586. else {
  7587. if (this.selfTurn) {
  7588. if (this.selfBallArr.length > 0) {
  7589. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7590. foulType = FoulType.wrongTouch;
  7591. }
  7592. }
  7593. else {
  7594. if (this.ensureBallType) {
  7595. }
  7596. else {
  7597. if (this.firstColliObj == this.blackNum) {
  7598. foulType = FoulType.wrongTouch;
  7599. }
  7600. }
  7601. }
  7602. }
  7603. else {
  7604. if (this.aiBallArr.length > 0) {
  7605. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7606. foulType = FoulType.wrongTouch;
  7607. }
  7608. }
  7609. else {
  7610. if (this.ensureBallType) {
  7611. }
  7612. else {
  7613. if (this.firstColliObj == this.blackNum) {
  7614. foulType = FoulType.wrongTouch;
  7615. }
  7616. }
  7617. }
  7618. }
  7619. if (this.inHoleBalls.length <= 0) {
  7620. return foulType;
  7621. }
  7622. let temp;
  7623. if (this.inHoleBalls.indexOf(0) > -1) {
  7624. foulType = FoulType.rootHole;
  7625. }
  7626. else {
  7627. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7628. temp = this.inHoleBalls[index];
  7629. if (this.selfTurn) {
  7630. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7631. foulType = FoulType.wrongHole;
  7632. break;
  7633. }
  7634. }
  7635. else {
  7636. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7637. foulType = FoulType.wrongHole;
  7638. break;
  7639. }
  7640. }
  7641. }
  7642. }
  7643. let foo;
  7644. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7645. temp = this.inHoleBalls[index];
  7646. foo = this.selfBallArr.indexOf(temp);
  7647. if (foo > -1) {
  7648. this.selfBallArr.splice(foo, 1);
  7649. }
  7650. foo = this.aiBallArr.indexOf(temp);
  7651. if (foo > -1) {
  7652. this.aiBallArr.splice(foo, 1);
  7653. }
  7654. }
  7655. this.updateLeftBall();
  7656. }
  7657. return foulType;
  7658. }
  7659. judgeGameEndByBlack(arr) {
  7660. if (this.selfTurn) {
  7661. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7662. this.selfFoulNum = this.maxFoulTimes;
  7663. return true;
  7664. }
  7665. }
  7666. else {
  7667. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7668. this.aiFoulNum = this.maxFoulTimes;
  7669. return true;
  7670. }
  7671. }
  7672. }
  7673. judgeClassic(type) {
  7674. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7675. xGame.common.aiPlayer.stopRun();
  7676. if (this.judgeNormalSuccess()) {
  7677. this.isEnd = true;
  7678. return;
  7679. }
  7680. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7681. if (this.selfTurn) {
  7682. if (isFoul) {
  7683. this.selfFoulNum++;
  7684. }
  7685. if (this.selfFoulNum >= this.maxFoulTimes) {
  7686. this.success = false;
  7687. this.isEnd = true;
  7688. return;
  7689. }
  7690. }
  7691. else {
  7692. if (isFoul)
  7693. this.aiFoulNum++;
  7694. if (this.aiFoulNum >= this.maxFoulTimes) {
  7695. this.success = true;
  7696. this.isEnd = true;
  7697. return;
  7698. }
  7699. }
  7700. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7701. this.isChangeTurn = false;
  7702. }
  7703. else {
  7704. this.isInterrupt = true;
  7705. }
  7706. }
  7707. waitShoot() {
  7708. if (xGame.common.gameMode == GameMode.classic) {
  7709. switch (this.curFoul) {
  7710. case FoulType.timeOut:
  7711. case FoulType.rootHole:
  7712. this.selfTurn = !this.selfTurn;
  7713. this.peoplePlay(5, 6, true);
  7714. break;
  7715. case FoulType.notTouch:
  7716. this.selfTurn = !this.selfTurn;
  7717. this.peoplePlay(7, 7);
  7718. break;
  7719. case FoulType.wrongHole:
  7720. this.selfTurn = !this.selfTurn;
  7721. this.peoplePlay(11, 11);
  7722. break;
  7723. default:
  7724. if (this.inHoleBalls.length > 0) {
  7725. this.peoplePlay(0, 0, false, false);
  7726. }
  7727. else {
  7728. this.selfTurn = !this.selfTurn;
  7729. this.peoplePlay(7, 7);
  7730. }
  7731. break;
  7732. }
  7733. }
  7734. else if (xGame.common.gameMode == GameMode.bigMove) {
  7735. if (this.curFoul == FoulType.timeOut) {
  7736. this.selfTurn = !this.selfTurn;
  7737. this.peoplePlay(14, 15);
  7738. this.placeRootBall();
  7739. }
  7740. else {
  7741. this.selfTurn = !this.selfTurn;
  7742. if (this.curFoul == FoulType.rootHole) {
  7743. this.peoplePlay(12, 13);
  7744. this.placeRootBall();
  7745. }
  7746. else {
  7747. this.peoplePlay(0, 0, false, false);
  7748. }
  7749. }
  7750. }
  7751. else if (xGame.common.gameMode == GameMode.placeBall) {
  7752. this.finishOneShoot = true;
  7753. }
  7754. this.gameResult();
  7755. }
  7756. gameResult() {
  7757. this.firstColliObj = null;
  7758. this.inHoleBalls = [];
  7759. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7760. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7761. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7762. if (xGame.common.uiRodMethod)
  7763. xGame.common.uiRodMethod.resetRod();
  7764. xGame.common.d2World.rootBall.showSelf();
  7765. this.clearIceSkill();
  7766. if (this.selfTurn) {
  7767. console.log("gameResult");
  7768. PlatMgr.gameInsert();
  7769. }
  7770. xGame.common.d3World.knifeRoot.destroyChildren();
  7771. if (this.selfTurn) {
  7772. xGame.common.gameUI.showHelpLineGuide();
  7773. xGame.common.gameUI.setTurnAlpha(true);
  7774. }
  7775. else {
  7776. xGame.common.gameUI.setTurnAlpha(false);
  7777. }
  7778. }
  7779. getScore(type) {
  7780. let selfAdd = 0;
  7781. let aiAdd = 0;
  7782. if (type == FoulType.timeOut) {
  7783. if (this.selfTurn)
  7784. aiAdd += 3;
  7785. else
  7786. selfAdd += 3;
  7787. }
  7788. else {
  7789. if (this.inHoleBalls.length > 0) {
  7790. if (this.selfTurn) {
  7791. if (type == FoulType.rootHole) {
  7792. aiAdd += 3;
  7793. if (this.inHoleBalls.length - 1 > 0) {
  7794. selfAdd += this.inHoleBalls.length - 1;
  7795. }
  7796. }
  7797. else {
  7798. selfAdd += this.inHoleBalls.length;
  7799. }
  7800. }
  7801. else {
  7802. if (type == FoulType.rootHole) {
  7803. selfAdd += 3;
  7804. if (this.inHoleBalls.length - 1 > 0) {
  7805. aiAdd += this.inHoleBalls.length - 1;
  7806. }
  7807. }
  7808. else {
  7809. aiAdd += this.inHoleBalls.length;
  7810. }
  7811. }
  7812. }
  7813. }
  7814. return [selfAdd, aiAdd];
  7815. }
  7816. judgeScoreEnd(selfAdd, aiAdd) {
  7817. this.selfScore += selfAdd;
  7818. this.aiScore += aiAdd;
  7819. this.updateAIScore();
  7820. this.updateSelfScore();
  7821. if (this.selfScore >= this.targertScore) {
  7822. this.success = true;
  7823. return true;
  7824. }
  7825. if (this.aiScore >= this.targertScore) {
  7826. this.success = false;
  7827. return true;
  7828. }
  7829. let ballArr = xGame.common.d2World.ballArr;
  7830. if (ballArr.length == 1 && ballArr[0].number == 0) {
  7831. if (this.selfScore > this.aiScore) {
  7832. this.success = true;
  7833. return true;
  7834. }
  7835. else if (this.selfScore < this.aiScore) {
  7836. this.success = false;
  7837. return true;
  7838. }
  7839. else {
  7840. if (this.selfTurn) {
  7841. this.success = false;
  7842. }
  7843. else {
  7844. this.success = true;
  7845. }
  7846. return true;
  7847. }
  7848. }
  7849. }
  7850. clearIceSkill() {
  7851. let arr = xGame.common.d2World.ballArr;
  7852. let temp;
  7853. if (this.selfTurn) {
  7854. if (this.selfCurSkill == SkillType.ice) {
  7855. for (let index = 0; index < arr.length; index++) {
  7856. temp = arr[index];
  7857. if (temp.ballFunc == "ice") {
  7858. temp.setBallFunc("normal", "self");
  7859. }
  7860. }
  7861. }
  7862. }
  7863. else {
  7864. if (this.aiCurSkill == SkillType.ice) {
  7865. for (let index = 0; index < arr.length; index++) {
  7866. temp = arr[index];
  7867. if (temp.ballFunc == "ice") {
  7868. temp.setBallFunc("normal", "ai");
  7869. }
  7870. }
  7871. }
  7872. }
  7873. }
  7874. judgeNormalSuccess() {
  7875. if (this.selfTurn) {
  7876. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7877. this.success = true;
  7878. return true;
  7879. }
  7880. }
  7881. else {
  7882. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7883. this.success = false;
  7884. return true;
  7885. }
  7886. }
  7887. }
  7888. gameEnd() {
  7889. if (Moyu.isTT) {
  7890. xGame.common.screenImg = getScreenImg();
  7891. }
  7892. console.log("游戏结束", this.success);
  7893. xGame.common.aiPlayer.stopRun();
  7894. if (xGame.common.gameMode == GameMode.placeBall) {
  7895. this.getEndStarNum();
  7896. this.updatePlaceBallState();
  7897. }
  7898. this.isEnter = false;
  7899. Moyu.recordEnd(this, () => {
  7900. if (this.isEnter)
  7901. return;
  7902. this.isEnter = true;
  7903. console.log("进入录结束回调");
  7904. this.enterNext();
  7905. });
  7906. Laya.timer.once(1000, this, () => {
  7907. if (this.isEnter)
  7908. return;
  7909. this.isEnter = true;
  7910. this.enterNext();
  7911. });
  7912. xGame.common.longHelpLine = false;
  7913. }
  7914. enterNext() {
  7915. Laya.timer.clearAll(this);
  7916. if (Moyu.canShare() > 100 || Moyu.isKs) {
  7917. xGame.uiMgr.Show(UIVideoShare, this.success);
  7918. }
  7919. else {
  7920. xGame.uiMgr.Show(UIGameEnd, this.success);
  7921. }
  7922. }
  7923. aiLeave() {
  7924. let ui = xGame.common.gameUI.ui;
  7925. ui.topNode.aiNameTxt.text = "offline";
  7926. }
  7927. aiGameEnd(suc) {
  7928. this.success = suc;
  7929. xGame.common.aiPlayer.stopRun();
  7930. if (this.success) {
  7931. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  7932. Laya.timer.once(1000, this, () => {
  7933. this.clearTime();
  7934. this.gameEnd();
  7935. });
  7936. }
  7937. }
  7938. openTimer() {
  7939. let src = xGame.common.gameUI;
  7940. if (this.selfTurn) {
  7941. src.ui.topNode.selfProgress.visible = true;
  7942. src.ui.topNode.aiProgress.visible = false;
  7943. this.curTimer = src.ui.topNode.selfProgress;
  7944. }
  7945. else {
  7946. src.ui.topNode.selfProgress.visible = false;
  7947. src.ui.topNode.aiProgress.visible = true;
  7948. this.curTimer = src.ui.topNode.aiProgress;
  7949. }
  7950. this.accTime = 0;
  7951. Laya.timer.clearAll(this);
  7952. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  7953. this.curTimer.value = 100;
  7954. }
  7955. updateTime(dt) {
  7956. if (this.gamePause)
  7957. return;
  7958. this.accTime += dt;
  7959. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  7960. if (this.accTime >= this.setTime) {
  7961. this.clearTime();
  7962. console.log("时钟进入了gameRun");
  7963. this.gameRun(FoulType.timeOut);
  7964. }
  7965. }
  7966. clearTime() {
  7967. let src = xGame.common.gameUI;
  7968. src.ui.topNode.selfProgress.visible = false;
  7969. src.ui.topNode.aiProgress.visible = false;
  7970. Laya.timer.clearAll(this);
  7971. }
  7972. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  7973. let ui = xGame.common.gameUI.ui;
  7974. let selfMsg, aiMsg;
  7975. if (sayWords) {
  7976. selfMsg = cfgTable.wordsData[selfIndex].msg;
  7977. aiMsg = cfgTable.wordsData[aiIndex].msg;
  7978. if (Foul) {
  7979. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  7980. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  7981. this.placeRootBall();
  7982. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  7983. if (this.curFoul == FoulType.rootHole) {
  7984. if (!DataMgr.getRootBallFoul()) {
  7985. DataMgr.setRootBallFoul();
  7986. aiMsg = "";
  7987. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  7988. let woman = "Boss, pay attention next time~";
  7989. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7990. }
  7991. }
  7992. else if (this.curFoul == FoulType.timeOut) {
  7993. if (!DataMgr.getTimeoutFoul()) {
  7994. DataMgr.setTimeoutFoul();
  7995. aiMsg = "";
  7996. let tips = "Game timeout, 3 fouls, this game failed.";
  7997. let woman = "Boss, pay attention to the timeline~";
  7998. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7999. }
  8000. }
  8001. }
  8002. }
  8003. }
  8004. if (this.selfTurn) {
  8005. if (sayWords) {
  8006. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8007. ui.selfTurn.visible = true;
  8008. ui.aiTurn.visible = false;
  8009. ui.selfTurn.t0.play();
  8010. Moyu.vibration();
  8011. });
  8012. }
  8013. }
  8014. else {
  8015. let aiNum = xGame.tools.random(1, 11);
  8016. let challengeNum = DataMgr.getChallengeTimes();
  8017. let delay = false;
  8018. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8019. aiNum = 9;
  8020. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8021. aiNum = 3;
  8022. if (challengeNum == 3) {
  8023. if (!this.showLongView) {
  8024. this.showLongView = true;
  8025. delay = true;
  8026. }
  8027. }
  8028. }
  8029. }
  8030. if (delay) {
  8031. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8032. if (success) {
  8033. xGame.common.longHelpLine = true;
  8034. xGame.common.d2World.getHelpLine();
  8035. }
  8036. else {
  8037. aiNum = 10;
  8038. }
  8039. xGame.common.aiPlayer.setAiLevel(aiNum);
  8040. if (sayWords) {
  8041. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8042. xGame.common.aiPlayer.runAI();
  8043. ui.selfTurn.visible = false;
  8044. ui.aiTurn.visible = true;
  8045. ui.aiTurn.t0.play();
  8046. });
  8047. }
  8048. else {
  8049. xGame.common.aiPlayer.runAI();
  8050. }
  8051. this.openTimer();
  8052. this.finishOneShoot = true;
  8053. if (this.selfTurn) {
  8054. ui.topNode.selfKuang.visible = true;
  8055. ui.topNode.aiKuang.visible = false;
  8056. ui.topNode.selfTips.visible = true;
  8057. ui.topNode.aiTips.visible = false;
  8058. }
  8059. else {
  8060. ui.topNode.selfKuang.visible = false;
  8061. ui.topNode.aiKuang.visible = true;
  8062. ui.topNode.selfTips.visible = false;
  8063. ui.topNode.aiTips.visible = true;
  8064. }
  8065. });
  8066. return;
  8067. }
  8068. if (xGame.common.gameMode == GameMode.classic) {
  8069. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8070. if (cfg) {
  8071. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8072. aiNum = aiLevel;
  8073. }
  8074. }
  8075. xGame.common.aiPlayer.setAiLevel(aiNum);
  8076. if (sayWords) {
  8077. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8078. xGame.common.aiPlayer.runAI();
  8079. ui.selfTurn.visible = false;
  8080. ui.aiTurn.visible = true;
  8081. ui.aiTurn.t0.play();
  8082. });
  8083. }
  8084. else {
  8085. xGame.common.aiPlayer.runAI();
  8086. }
  8087. }
  8088. this.openTimer();
  8089. this.finishOneShoot = true;
  8090. if (this.selfTurn) {
  8091. ui.topNode.selfKuang.visible = true;
  8092. ui.topNode.aiKuang.visible = false;
  8093. ui.topNode.selfTips.visible = true;
  8094. ui.topNode.aiTips.visible = false;
  8095. }
  8096. else {
  8097. ui.topNode.selfKuang.visible = false;
  8098. ui.topNode.aiKuang.visible = true;
  8099. ui.topNode.selfTips.visible = false;
  8100. ui.topNode.aiTips.visible = true;
  8101. }
  8102. }
  8103. placeRootBall() {
  8104. let rootBall = xGame.common.d2World.rootBall;
  8105. if (!rootBall)
  8106. return;
  8107. rootBall.gameObj.x = this.lastRootBallPos.x;
  8108. rootBall.gameObj.y = this.lastRootBallPos.y;
  8109. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8110. let moveNode = xGame.common.gameUI.ui.moveNode;
  8111. moveNode.visible = true;
  8112. moveNode.x = this.lastRootBallPos.x;
  8113. moveNode.y = this.lastRootBallPos.y;
  8114. if (!this.selfTurn) {
  8115. xGame.common.aiPlayer.resetRoot();
  8116. }
  8117. }
  8118. }
  8119. class ui_guanyuAni extends fgui.GComponent {
  8120. static createInstance() {
  8121. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8122. }
  8123. onConstruct() {
  8124. this.n0 = (this.getChild("n0"));
  8125. }
  8126. }
  8127. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8128. class UIFireworks extends UIBase {
  8129. constructor() {
  8130. super();
  8131. }
  8132. onConstructor() {
  8133. this.isEject = false;
  8134. }
  8135. show(callback) {
  8136. super.show();
  8137. }
  8138. }
  8139. UIFireworks.uiName = "UIFireworks";
  8140. class ui_UIGuanYu extends fgui.GComponent {
  8141. static createInstance() {
  8142. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8143. }
  8144. onConstruct() {
  8145. this.n2 = (this.getChild("n2"));
  8146. this.n1 = (this.getChild("n1"));
  8147. this.n3 = (this.getChild("n3"));
  8148. this.n4 = (this.getChild("n4"));
  8149. this.n5 = (this.getChild("n5"));
  8150. this.n6 = (this.getChild("n6"));
  8151. this.n8 = (this.getChild("n8"));
  8152. this.n7 = (this.getChild("n7"));
  8153. this.t0 = this.getTransition("t0");
  8154. }
  8155. }
  8156. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8157. class UIGuanYu extends UIBase {
  8158. constructor() {
  8159. super();
  8160. }
  8161. onConstructor() {
  8162. this.ui = ui_UIGuanYu.createInstance();
  8163. this.contentPane = this.ui;
  8164. this.isEject = false;
  8165. }
  8166. show(callback) {
  8167. super.show();
  8168. this.ui.t0.play(Laya.Handler.create(this, () => {
  8169. callback && callback();
  8170. this.hide();
  8171. }));
  8172. }
  8173. }
  8174. UIGuanYu.uiName = "UIGuanYu";
  8175. class SkillMgr {
  8176. constructor() {
  8177. this.leveNum = 0;
  8178. this.extraScore = 0;
  8179. this.selfTurn = false;
  8180. this.playedLastSkill = false;
  8181. this.tweenArr = [];
  8182. this._finishNum = 0;
  8183. this._curFinish = 0;
  8184. this._rootX = 0;
  8185. this._rootY = 0;
  8186. this.knifeTimes = 0;
  8187. this.knifeV2 = new Laya.Vector2();
  8188. this.knifeV3 = new Laya.Vector3();
  8189. this.rtStarX = 0;
  8190. this.rtStarY = 0;
  8191. this.addBigSkillSpine();
  8192. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8193. }
  8194. addBigSkillSpine() {
  8195. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8196. console.log("extra2 success");
  8197. });
  8198. }
  8199. runBigSkill(callback) {
  8200. this.tweenArr = [];
  8201. this.callback = callback;
  8202. this.judgeSkill();
  8203. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8204. let guide = DataMgr.getSkillGuide();
  8205. if (!xGame.common.gameMgr.selfTurn) {
  8206. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8207. }
  8208. else {
  8209. if (xGame.common.temSelfLevel != 0) {
  8210. this.leveNum = xGame.common.temSelfLevel;
  8211. }
  8212. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8213. this.leveNum += 5;
  8214. }
  8215. }
  8216. if (guide == 0) {
  8217. DataMgr.setSkillGuide(1);
  8218. if (DataMgr.getNewUser()) {
  8219. Moyu.sendDataEvent("gameFirstPlay");
  8220. DataMgr.setNewUser();
  8221. }
  8222. }
  8223. this.playSpineAni(() => {
  8224. switch (this.curSkill) {
  8225. case SkillType.highSpace:
  8226. this.runHighSpace();
  8227. break;
  8228. case SkillType.breakArmy:
  8229. this.runBreakArmy();
  8230. break;
  8231. case SkillType.ice:
  8232. this.runIce();
  8233. break;
  8234. case SkillType.fireworks:
  8235. this.runFireworks();
  8236. break;
  8237. case SkillType.GuanYu:
  8238. this.runGuanYu();
  8239. break;
  8240. default:
  8241. break;
  8242. }
  8243. });
  8244. }
  8245. judgeSkill() {
  8246. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8247. let gameMgr = xGame.common.gameMgr;
  8248. let type;
  8249. for (let index = 0; index < typeArr.length; index++) {
  8250. type = typeArr[index];
  8251. if (gameMgr.selfTurn) {
  8252. if (gameMgr.selfCurSkill == type) {
  8253. this.selfTurn = true;
  8254. this.curSkill = type;
  8255. return;
  8256. }
  8257. }
  8258. else {
  8259. if (gameMgr.aiCurSkill == type) {
  8260. this.selfTurn = false;
  8261. this.curSkill = type;
  8262. return;
  8263. }
  8264. }
  8265. }
  8266. }
  8267. playSpineAni(callback) {
  8268. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8269. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8270. parent.destroyChildren();
  8271. let aniIndex = 0;
  8272. let skillSpine;
  8273. switch (this.curSkill) {
  8274. case SkillType.highSpace:
  8275. aniIndex = 1;
  8276. xGame.soundMgr.playSound("skill01");
  8277. skillSpine = this.skillSpine2;
  8278. data.scaleX = 0.5;
  8279. data.scaleY = 0.5;
  8280. skillSpine.play(data, 1, false, parent, () => {
  8281. callback && callback();
  8282. });
  8283. break;
  8284. case SkillType.breakArmy:
  8285. aniIndex = 2;
  8286. xGame.soundMgr.playSound("skill02");
  8287. skillSpine = this.skillSpine2;
  8288. data.scaleX = 0.5;
  8289. data.scaleY = 0.5;
  8290. skillSpine.play(data, 2, false, parent, () => {
  8291. callback && callback();
  8292. });
  8293. break;
  8294. case SkillType.ice:
  8295. aniIndex = 0;
  8296. xGame.soundMgr.playSound("skill03");
  8297. skillSpine = this.skillSpine2;
  8298. data.scaleX = 0.5;
  8299. data.scaleY = 0.5;
  8300. skillSpine.play(data, 0, false, parent, () => {
  8301. callback && callback();
  8302. });
  8303. break;
  8304. case SkillType.fireworks:
  8305. xGame.soundMgr.playSound("skill_04_01");
  8306. xGame.soundMgr.playSound("skill04");
  8307. xGame.uiMgr.Show(UIFireworks, callback);
  8308. break;
  8309. case SkillType.GuanYu:
  8310. xGame.soundMgr.playSound("skill05_1");
  8311. xGame.soundMgr.playSound("skill05");
  8312. xGame.uiMgr.Show(UIGuanYu, callback);
  8313. break;
  8314. default:
  8315. break;
  8316. }
  8317. }
  8318. getAllBallArr() {
  8319. let arr = xGame.common.d2World.ballArr;
  8320. let outArr = [];
  8321. for (let index = 0; index < arr.length; index++) {
  8322. if (arr[index] instanceof D2RootBallSrc)
  8323. continue;
  8324. if (arr[index].ballFunc == "ice")
  8325. continue;
  8326. if (arr[index].destroyed)
  8327. continue;
  8328. outArr.push(arr[index]);
  8329. }
  8330. return outArr;
  8331. }
  8332. getOneArr(deletObj) {
  8333. let allArr = this.getAllBallArr();
  8334. let temp;
  8335. for (let index = 0; index < allArr.length; index++) {
  8336. temp = allArr[index];
  8337. if (temp.id == deletObj.id) {
  8338. allArr.splice(index, 1);
  8339. break;
  8340. }
  8341. }
  8342. return allArr;
  8343. }
  8344. getNearBallBag(ball) {
  8345. let ui = xGame.common.gameUI.ui;
  8346. let circleArr = [];
  8347. for (let index = 1; index <= 6; index++) {
  8348. circleArr.push(ui.border["circle" + index]);
  8349. }
  8350. let outIndex = 0;
  8351. let temp;
  8352. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8353. ;
  8354. let dis = 0;
  8355. for (let index = 1; index < circleArr.length; index++) {
  8356. temp = circleArr[index];
  8357. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8358. if (dis < min) {
  8359. min = dis;
  8360. outIndex = index;
  8361. }
  8362. }
  8363. return [circleArr[outIndex], outIndex];
  8364. }
  8365. ballFlyToBag(ballArr, time = 300) {
  8366. let temp;
  8367. let hole;
  8368. this._finishNum = ballArr.length;
  8369. this._curFinish = 0;
  8370. let holeObj = {};
  8371. let holeCfg = {
  8372. "1": 0,
  8373. "2": 0,
  8374. "3": 0,
  8375. "4": 0,
  8376. "5": 0,
  8377. "6": 0
  8378. };
  8379. for (let index = 0; index < ballArr.length; index++) {
  8380. temp = ballArr[index];
  8381. temp.outColli.isSensor = true;
  8382. temp.innerColli.isSensor = true;
  8383. temp.isRunSkillAni = true;
  8384. let holeArr = this.getNearBallBag(temp);
  8385. hole = holeArr[0];
  8386. holeObj[index] = holeArr[1];
  8387. temp.d3BallSrc.scaleXYZ = 0.5;
  8388. this.tweenArr.push(temp.d3BallSrc, temp);
  8389. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8390. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8391. }));
  8392. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8393. let mIndex = holeObj[this._curFinish];
  8394. let isDone = holeCfg[mIndex];
  8395. if (isDone) {
  8396. ballArr[this._curFinish].checkWrongBall(false);
  8397. }
  8398. else {
  8399. holeCfg[mIndex] = 1;
  8400. ballArr[this._curFinish].checkWrongBall();
  8401. }
  8402. this._curFinish++;
  8403. if (this._curFinish >= this._finishNum) {
  8404. if (this.curSkill == SkillType.highSpace) {
  8405. }
  8406. else if (this.curSkill == SkillType.breakArmy) {
  8407. let rootBall = xGame.common.d2World.rootBall;
  8408. rootBall.gameObj.x = this._rootX;
  8409. rootBall.gameObj.y = this._rootY;
  8410. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8411. xGame.common.d2World.d2Gan.ui.visible = true;
  8412. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8413. xGame.common.d2World.getHelpLine();
  8414. this.callback && this.callback(this.extraScore);
  8415. }
  8416. }
  8417. }));
  8418. }
  8419. }
  8420. runHighSpace() {
  8421. let rootBall = xGame.common.d2World.rootBall;
  8422. rootBall.showSelf();
  8423. let d3Src = rootBall.d3BallSrc;
  8424. let allArr = this.getAllBallArr();
  8425. if (allArr.length <= 0) {
  8426. this.callback && this.callback(0);
  8427. return;
  8428. }
  8429. let selectBall = xGame.common.d2World.targetBall;
  8430. let wrong = selectBall && selectBall.destroyed;
  8431. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8432. selectBall = xGame.common.getRandArrEle(allArr);
  8433. }
  8434. let targetD3Src = selectBall.d3BallSrc;
  8435. xGame.common.d2World.d2Gan.ui.visible = false;
  8436. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8437. d3Src.scaleXYZ = 0.5;
  8438. this.tweenArr.push(d3Src);
  8439. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8440. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8441. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8442. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8443. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8444. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8445. let outArr = [selectBall];
  8446. let other = this.leveNum - 1;
  8447. if (other > 0) {
  8448. let nearArr = this.getOneArr(selectBall);
  8449. if (nearArr.length > 0) {
  8450. xGame.common.botherArr(nearArr);
  8451. if (other >= nearArr.length)
  8452. other = nearArr.length;
  8453. for (let index = 0; index < other; index++) {
  8454. outArr.push(nearArr[index]);
  8455. }
  8456. }
  8457. }
  8458. xGame.common.extraMoveNum = other + 1;
  8459. this.extraScore = other + 1;
  8460. this._rootX = selectBall.gameObj.x;
  8461. this._rootY = selectBall.gameObj.y;
  8462. rootBall.gameObj.x = this._rootX;
  8463. rootBall.gameObj.y = this._rootY;
  8464. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8465. Laya.Tween.clearAll(d3Src);
  8466. this.addRandomForce(outArr);
  8467. }));
  8468. }));
  8469. }
  8470. addRandomForce(outArr) {
  8471. if (outArr.length > 0) {
  8472. xGame.common.d2World.openCheckStill = true;
  8473. this.playedLastSkill = true;
  8474. }
  8475. let temp;
  8476. for (let index = 0; index < outArr.length; index++) {
  8477. let angle = xGame.common.randomNum(0, 360);
  8478. let linearPercent = xGame.common.randomNum(65, 100);
  8479. temp = outArr[index];
  8480. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8481. }
  8482. }
  8483. setLinearSpeed(angle, rigy, linearPercent) {
  8484. let sin = Math.sin(angle * Math.PI / 180);
  8485. let cos = Math.cos(angle * Math.PI / 180);
  8486. let maxSpeed = 4;
  8487. let speed = new Laya.Vector2();
  8488. speed.x = maxSpeed * linearPercent * sin;
  8489. speed.y = -maxSpeed * linearPercent * cos;
  8490. rigy.applyLinearImpulseToCenter(speed);
  8491. }
  8492. runBreakArmy() {
  8493. xGame.common.d2World.d2Gan.ui.visible = false;
  8494. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8495. let gameUI = xGame.common.gameUI.ui;
  8496. gameUI.skillRod.visible = true;
  8497. gameUI.skillRod.rotation = 110;
  8498. let outArr = this.getAllBallArr();
  8499. if (outArr.length <= 0) {
  8500. gameUI.skillRod.visible = false;
  8501. this.callback && this.callback(0);
  8502. return;
  8503. }
  8504. xGame.common.botherArr(outArr);
  8505. if (this.leveNum >= outArr.length)
  8506. this.leveNum = outArr.length;
  8507. let deleteNum = outArr.length - this.leveNum;
  8508. outArr.splice(0, deleteNum);
  8509. this.extraScore = this.leveNum;
  8510. let potX = gameUI.skillRod.x;
  8511. let potY = gameUI.skillRod.y;
  8512. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8513. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8514. let disArr = [];
  8515. for (let index = 0; index < outArr.length; index++) {
  8516. let obj = outArr[index];
  8517. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8518. dis = Math.pow(dis, 0.5);
  8519. disArr.push(dis);
  8520. }
  8521. this.tweenArr.push(gameUI.skillRod);
  8522. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8523. })).update = Laya.Handler.create(this, (e, t, c) => {
  8524. let angle = gameUI.skillRod.rotation;
  8525. let xx;
  8526. let yy;
  8527. let temp;
  8528. for (let index = 0; index < outArr.length; index++) {
  8529. temp = outArr[index];
  8530. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8531. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8532. yy -= 20;
  8533. temp.gameObj.x = xx;
  8534. temp.gameObj.y = yy;
  8535. temp.d3BallSrc.setTransPos(xx, yy);
  8536. }
  8537. if (angle <= 60) {
  8538. Laya.Tween.clearAll(gameUI.skillRod);
  8539. this.ballFlyToBag(outArr, 150);
  8540. gameUI.skillRod.visible = false;
  8541. }
  8542. }, null, false);
  8543. }
  8544. runIce() {
  8545. let ballArr = xGame.common.d2World.ballArr;
  8546. this.leveNum *= 2;
  8547. if (this.leveNum >= ballArr.length - 1)
  8548. this.leveNum = ballArr.length - 1;
  8549. let tempArr = [];
  8550. let outArr = [];
  8551. for (let index = 0; index < ballArr.length; index++) {
  8552. if (ballArr[index] instanceof D2RootBallSrc)
  8553. continue;
  8554. tempArr.push(ballArr[index]);
  8555. }
  8556. if (tempArr.length <= 0) {
  8557. this.callback && this.callback(0);
  8558. return;
  8559. }
  8560. xGame.common.botherArr(tempArr);
  8561. for (let index = 0; index < this.leveNum; index++) {
  8562. outArr.push(tempArr[index]);
  8563. }
  8564. this.extraScore = this.leveNum;
  8565. let temp;
  8566. for (let index = 0; index < outArr.length; index++) {
  8567. temp = outArr[index];
  8568. temp.d3BallSrc.playIceEft();
  8569. }
  8570. Laya.timer.once(2000, this, () => {
  8571. for (let index = 0; index < outArr.length; index++) {
  8572. temp = outArr[index];
  8573. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8574. temp.setBallFunc("ice", str);
  8575. }
  8576. this.callback && this.callback(0);
  8577. });
  8578. }
  8579. runFireworks() {
  8580. let allArr = this.getAllBallArr();
  8581. if (allArr.length <= 0) {
  8582. this.callback && this.callback(0);
  8583. return;
  8584. }
  8585. xGame.common.d2World.d2Gan.ui.visible = false;
  8586. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8587. let outArr = [];
  8588. let other = this.leveNum;
  8589. if (other > 0) {
  8590. if (allArr.length > 0) {
  8591. xGame.common.botherArr(allArr);
  8592. if (other >= allArr.length)
  8593. other = allArr.length;
  8594. for (let index = 0; index < other; index++) {
  8595. outArr.push(allArr[index]);
  8596. }
  8597. }
  8598. }
  8599. xGame.common.extraMoveNum = other;
  8600. this.extraScore = other;
  8601. this.addRandmomFireworks(outArr);
  8602. }
  8603. addRandmomFireworks(outArr) {
  8604. Laya.timer.once(1100, this, () => {
  8605. if (outArr.length > 0) {
  8606. xGame.common.d2World.openCheckStill = true;
  8607. this.playedLastSkill = true;
  8608. }
  8609. });
  8610. xGame.soundMgr.playSound("skill_04_02");
  8611. let temp;
  8612. let delay = -200;
  8613. for (let index = 0; index < outArr.length; index++) {
  8614. temp = outArr[index];
  8615. delay += 200;
  8616. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8617. let angle = xGame.common.randomNum(0, 360);
  8618. angle = this.getFireworksAngle(obj);
  8619. let linearPercent = xGame.common.randomNum(45, 80);
  8620. if (!obj.destroyed)
  8621. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8622. });
  8623. }
  8624. }
  8625. getFireworksAngle(obj) {
  8626. let rootBall = xGame.common.d2World.rootBall;
  8627. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8628. }
  8629. resetGame() {
  8630. Laya.timer.clearAll(this);
  8631. if (this.tweenArr) {
  8632. for (let index = 0; index < this.tweenArr.length; index++) {
  8633. Laya.Tween.clearAll(this.tweenArr[index]);
  8634. }
  8635. }
  8636. this.tweenArr = null;
  8637. }
  8638. runGuanYu() {
  8639. xGame.common.d2World.d2Gan.ui.visible = false;
  8640. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8641. let rootBall = xGame.common.d2World.rootBall;
  8642. if (rootBall.isInHole) {
  8643. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8644. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8645. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8646. rootBall.showSelf();
  8647. }
  8648. this.rtStarX = rootBall.gameObj.x;
  8649. this.rtStarY = rootBall.gameObj.y;
  8650. this.knifeTimes = 0;
  8651. this.playedLastSkill = true;
  8652. rootBall.forceRun = true;
  8653. rootBall.rigy.type = "static";
  8654. xGame.common.d2World.openCheckStill = true;
  8655. this.guanyuRandomKnife();
  8656. }
  8657. guanyuRandomKnife() {
  8658. let rootBall = xGame.common.d2World.rootBall;
  8659. let dir = this.getRandDir();
  8660. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8661. console.log("当前angle", angle);
  8662. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8663. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8664. let dis = 324;
  8665. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8666. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8667. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8668. this.rtStarX = rootBall.gameObj.x;
  8669. this.rtStarY = rootBall.gameObj.y;
  8670. this.knifeTimes++;
  8671. let skillLevel;
  8672. if (xGame.common.gameMgr.selfTurn) {
  8673. skillLevel = DataMgr.getBigSkillByIndex(4);
  8674. }
  8675. else {
  8676. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8677. }
  8678. if (!skillLevel)
  8679. skillLevel = 1;
  8680. skillLevel += 2;
  8681. if (this.knifeTimes < skillLevel) {
  8682. Laya.timer.once(400, this, () => {
  8683. this.guanyuRandomKnife();
  8684. });
  8685. }
  8686. else {
  8687. rootBall.forceRun = false;
  8688. rootBall.rigy.type = "dynamic";
  8689. xGame.common.extraMoveNum = skillLevel;
  8690. }
  8691. }));
  8692. }
  8693. getRandDir() {
  8694. let rootBall = xGame.common.d2World.rootBall;
  8695. let allBall = this.getAllBallArr();
  8696. let target = xGame.common.getRandArrEle(allBall);
  8697. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8698. return this.knifeV2;
  8699. }
  8700. cloneKnife(x, y, rotation) {
  8701. let parent = xGame.common.d3World.knifeRoot;
  8702. let prefab = xGame.common.d3World.knife;
  8703. let clone = prefab.clone();
  8704. parent.addChild(clone);
  8705. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8706. clone.transform.localPositionX = this.knifeV3.x;
  8707. clone.transform.localPositionY = 0;
  8708. clone.transform.localPositionZ = this.knifeV3.z;
  8709. clone.transform.localRotationEulerX = 0;
  8710. clone.transform.localRotationEulerY = rotation;
  8711. clone.transform.localRotationEulerZ = 0;
  8712. clone.active = true;
  8713. return clone;
  8714. }
  8715. cloneGuanYuEft(x, y, angle) {
  8716. return;
  8717. let parent = xGame.common.gameUI.ui.guanyuNode;
  8718. let eft = new ui_guanyuAni();
  8719. eft.parent = parent;
  8720. eft.x = x;
  8721. eft.y = y;
  8722. eft.rotation = angle;
  8723. }
  8724. }
  8725. class ui_UIWordsList extends fgui.GComponent {
  8726. static createInstance() {
  8727. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8728. }
  8729. onConstruct() {
  8730. this.c1 = this.getController("c1");
  8731. this.n74 = (this.getChild("n74"));
  8732. this.clickNode = (this.getChild("clickNode"));
  8733. this.myNode = (this.getChild("myNode"));
  8734. this.n68 = (this.getChild("n68"));
  8735. this.n66 = (this.getChild("n66"));
  8736. this.n55 = (this.getChild("n55"));
  8737. this.wordsBtn = (this.getChild("wordsBtn"));
  8738. this.emotionBtn = (this.getChild("emotionBtn"));
  8739. this.mybggg = (this.getChild("mybggg"));
  8740. this.wordsList = (this.getChild("wordsList"));
  8741. this.emotionList = (this.getChild("emotionList"));
  8742. this.myRoot = (this.getChild("myRoot"));
  8743. }
  8744. }
  8745. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8746. class EmotionDisplay {
  8747. constructor(index, ui) {
  8748. this.ui = ui;
  8749. this.index = index;
  8750. this.ui.onClick(this, this.clickSelf);
  8751. this.updateSelf();
  8752. }
  8753. updateSelf() {
  8754. let data = cfgTable.emotionData[this.index + 1];
  8755. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8756. }
  8757. clickSelf() {
  8758. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8759. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8760. xGame.common.talkMgr.closeTalkView();
  8761. }
  8762. }
  8763. class WordsDisplay {
  8764. constructor(index, ui) {
  8765. this.ui = ui;
  8766. this.index = index;
  8767. this.ui.onClick(this, this.clickSelf);
  8768. this.updateSelf();
  8769. }
  8770. updateSelf() {
  8771. let data = cfgTable.talkwordsData[this.index + 1];
  8772. this.ui.txt.text = data.msg;
  8773. }
  8774. clickSelf() {
  8775. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8776. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8777. xGame.common.talkMgr.closeTalkView();
  8778. }
  8779. }
  8780. class UIWordsList extends UIBase {
  8781. constructor() {
  8782. super();
  8783. }
  8784. onConstructor() {
  8785. this.ui = ui_UIWordsList.createInstance();
  8786. this.contentPane = this.ui;
  8787. this.isEject = false;
  8788. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8789. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8790. this.addUIClick(this.ui.clickNode, this.hide);
  8791. this.initTalkList();
  8792. this.initEmotionList();
  8793. }
  8794. show() {
  8795. super.show();
  8796. }
  8797. initTalkList() {
  8798. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8799. let data = cfgTable.talkwordsData;
  8800. let length = Object.keys(data).length;
  8801. this.ui.wordsList.numItems = length;
  8802. }
  8803. initEmotionList() {
  8804. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8805. let data = cfgTable.emotionData;
  8806. let length = Object.keys(data).length;
  8807. this.ui.emotionList.numItems = length;
  8808. }
  8809. renderTalkItem(index, obj) {
  8810. let temp = new WordsDisplay(index, obj);
  8811. }
  8812. renderEmotionItem(index, obj) {
  8813. let temp = new EmotionDisplay(index, obj);
  8814. }
  8815. openTalkList() {
  8816. this.ui.c1.selectedIndex = 0;
  8817. }
  8818. openEmotionList() {
  8819. this.ui.c1.selectedIndex = 1;
  8820. }
  8821. }
  8822. UIWordsList.uiName = "UIWordsList";
  8823. class TalkMgr {
  8824. constructor() {
  8825. this.aiSpeak = true;
  8826. this.emotionList = [];
  8827. this.talkList = [];
  8828. this.addEvent();
  8829. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8830. this.emotionList = [];
  8831. this.talkList = [];
  8832. for (let k in cfgTable.emotionData) {
  8833. this.emotionList.push(cfgTable.emotionData[k].id);
  8834. }
  8835. for (let k in cfgTable.talkwordsData) {
  8836. this.talkList.push(cfgTable.talkwordsData[k].id);
  8837. }
  8838. }
  8839. addEvent() {
  8840. let ui = xGame.common.gameUI.ui;
  8841. ui.wordsBtn.visible = true;
  8842. ui.wordsBtn.onClick(this, this.openTalkView);
  8843. ui.aiWordsBtn.visible = true;
  8844. ui.aiWordsBtn.onClick(this, this.clickAIState);
  8845. }
  8846. openTalkView() {
  8847. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8848. xGame.uiMgr.Show(UIWordsList);
  8849. }
  8850. closeTalkView() {
  8851. xGame.uiMgr.Hide(UIWordsList);
  8852. }
  8853. clickAIState() {
  8854. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8855. this.aiSpeak = !this.aiSpeak;
  8856. this.changeAIState(this.aiSpeak);
  8857. }
  8858. changeAIState(speak) {
  8859. this.aiSpeak = speak;
  8860. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  8861. if (speak) {
  8862. btn.c1.selectedIndex = 0;
  8863. }
  8864. else {
  8865. btn.c1.selectedIndex = 1;
  8866. }
  8867. }
  8868. showSelfTalk(wordsId) {
  8869. let ui = xGame.common.gameUI.ui;
  8870. ui.selfTalk.visible = true;
  8871. ui.selfTalk.myNode.c1.selectedIndex = 1;
  8872. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8873. ui.selfTalk.t0.play();
  8874. }
  8875. showSelfEmotion(emotionId) {
  8876. let ui = xGame.common.gameUI.ui;
  8877. ui.selfTalk.visible = true;
  8878. ui.selfTalk.myNode.c1.selectedIndex = 0;
  8879. this.selfSpine && this.selfSpine.dispose();
  8880. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8881. let spineData = cfgTable.emotionData[emotionId].spine;
  8882. this.selfSpine = new SpineMgr(spineData, () => {
  8883. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  8884. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  8885. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8886. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  8887. });
  8888. ui.selfTalk.t0.play();
  8889. }
  8890. showAITalk(wordsId) {
  8891. if (!this.aiSpeak)
  8892. return;
  8893. if (DataMgr.gameData.gameCount < 2)
  8894. return;
  8895. if (wordsId < 1)
  8896. wordsId = this.getRandTalk();
  8897. let ui = xGame.common.gameUI.ui;
  8898. ui.aiTalk.visible = true;
  8899. ui.aiTalk.myNode.c1.selectedIndex = 1;
  8900. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8901. ui.aiTalk.t0.play();
  8902. }
  8903. getRandTalk() {
  8904. let rand = xGame.tools.random(0, this.talkList.length);
  8905. return this.emotionList[rand];
  8906. }
  8907. getRandEmotion() {
  8908. let rand = xGame.tools.random(0, this.emotionList.length);
  8909. return this.emotionList[rand];
  8910. }
  8911. showAIEmotion(emotionId) {
  8912. if (!this.aiSpeak)
  8913. return;
  8914. if (DataMgr.gameData.gameCount < 2)
  8915. return;
  8916. if (emotionId < 1)
  8917. emotionId = this.getRandEmotion();
  8918. let ui = xGame.common.gameUI.ui;
  8919. ui.aiTalk.visible = true;
  8920. ui.aiTalk.myNode.c1.selectedIndex = 0;
  8921. this.aiSpine && this.aiSpine.dispose();
  8922. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8923. let spineData = cfgTable.emotionData[emotionId].spine;
  8924. this.aiSpine = new SpineMgr(spineData, () => {
  8925. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  8926. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  8927. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8928. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  8929. });
  8930. ui.aiTalk.t0.play();
  8931. }
  8932. resetGame() {
  8933. let ui = xGame.common.gameUI.ui;
  8934. ui.aiTalk.visible = false;
  8935. ui.selfTalk.visible = false;
  8936. this.aiSpine && this.aiSpine.dispose();
  8937. this.selfSpine && this.selfSpine.dispose();
  8938. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8939. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8940. this.closeTalkView();
  8941. }
  8942. }
  8943. class WordsMgr {
  8944. constructor() {
  8945. this.comboTimes = 1;
  8946. this.skillTimes = 0;
  8947. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  8948. this.comboSpine = new SpineMgr("yxz_liangan");
  8949. this.skillSpine = new SpineMgr("yiganxqiu");
  8950. this.scoreSpine = new SpineMgr("defen");
  8951. }
  8952. setClassicCombo(isInterrupt) {
  8953. if (isInterrupt) {
  8954. this.comboTimes = 0;
  8955. }
  8956. }
  8957. playClassicWords(type, callback) {
  8958. this.callback = callback;
  8959. let aniIndex = type;
  8960. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8961. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8962. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  8963. mySpine.destroy(true);
  8964. this.playClassicTimes();
  8965. });
  8966. }
  8967. playClassicTimes() {
  8968. this.comboTimes++;
  8969. if (this.comboTimes <= 1) {
  8970. this.callback && this.callback();
  8971. }
  8972. else {
  8973. let aniIndex = this.comboTimes - 1;
  8974. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8975. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8976. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  8977. mySpine.destroy(true);
  8978. this.callback && this.callback();
  8979. });
  8980. }
  8981. }
  8982. playBigSkillTimes(times, callback) {
  8983. if (times <= 0) {
  8984. callback && callback();
  8985. return;
  8986. }
  8987. this.callback = callback;
  8988. let pre = "sz_0";
  8989. let aniIndex = 0;
  8990. this.getWordsImg(times, pre, () => {
  8991. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8992. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  8993. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  8994. let r1 = ``;
  8995. let r2 = ``;
  8996. if (times <= 9) {
  8997. r1 = `res/d2Res/${pre}${times}.png`;
  8998. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  8999. aniIndex = 0;
  9000. }
  9001. else {
  9002. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9003. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9004. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9005. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9006. aniIndex = 1;
  9007. }
  9008. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9009. mySpine.destroy(true);
  9010. xGame.common.gameMgr.playSkillTips();
  9011. this.playScore(times);
  9012. xGame.common.playRandomMutiBallBigSkillSound();
  9013. }, mySpine);
  9014. });
  9015. }
  9016. playScore(score) {
  9017. let pre = "sz_";
  9018. let aniIndex = 0;
  9019. this.getWordsImg(score, pre, () => {
  9020. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9021. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9022. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9023. let r1 = ``;
  9024. let r2 = ``;
  9025. if (score <= 9) {
  9026. r1 = `res/d2Res/${pre}${score}.png`;
  9027. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9028. aniIndex = 0;
  9029. }
  9030. else {
  9031. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9032. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9033. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9034. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9035. aniIndex = 1;
  9036. }
  9037. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9038. mySpine.destroy(true);
  9039. this.callback && this.callback();
  9040. }, mySpine);
  9041. });
  9042. }
  9043. getWordsImg(number, pre = "", callback) {
  9044. let arr = [];
  9045. if (number <= 9) {
  9046. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9047. }
  9048. else {
  9049. 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 });
  9050. }
  9051. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9052. callback && callback();
  9053. }));
  9054. }
  9055. }
  9056. class ui_UIRodMethod extends fgui.GComponent {
  9057. static createInstance() {
  9058. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9059. }
  9060. onConstruct() {
  9061. this.n24 = (this.getChild("n24"));
  9062. this.white = (this.getChild("white"));
  9063. this.dot = (this.getChild("dot"));
  9064. this.sureBtn = (this.getChild("sureBtn"));
  9065. this.n20 = (this.getChild("n20"));
  9066. this.n21 = (this.getChild("n21"));
  9067. this.n22 = (this.getChild("n22"));
  9068. this.n23 = (this.getChild("n23"));
  9069. this.n5 = (this.getChild("n5"));
  9070. this.n14 = (this.getChild("n14"));
  9071. this.t0 = this.getTransition("t0");
  9072. }
  9073. }
  9074. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9075. class UIRodMethod extends UIBase {
  9076. constructor() {
  9077. super();
  9078. this.isPressd = false;
  9079. }
  9080. onConstructor() {
  9081. this.ui = ui_UIRodMethod.createInstance();
  9082. this.contentPane = this.ui;
  9083. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9084. this.moveDir = new Laya.Vector2();
  9085. this.moveDest = new Laya.Vector2();
  9086. this.centerPos = new Laya.Vector2();
  9087. xGame.common.uiRodMethod = this;
  9088. }
  9089. show() {
  9090. super.show();
  9091. xGame.common.gameMgr.gamePause = true;
  9092. this.openPressDotEvent();
  9093. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9094. this.centerPos.x = this.ui.white.x;
  9095. this.centerPos.y = this.ui.white.y;
  9096. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9097. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9098. this.setDot();
  9099. }
  9100. setDot() {
  9101. this.ui.dot.x = this.moveDest.x;
  9102. this.ui.dot.y = this.moveDest.y;
  9103. }
  9104. closeSelf() {
  9105. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9106. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9107. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9108. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9109. xGame.common.gameMgr.gamePause = false;
  9110. this.hide();
  9111. }
  9112. openPressDotEvent() {
  9113. this.closePressDotEvent();
  9114. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9115. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9116. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9117. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9118. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9119. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9120. }
  9121. closePressDotEvent() {
  9122. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9123. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9124. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9125. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9126. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9127. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9128. }
  9129. onDown(e) {
  9130. if (e.type == Laya.Event.MOUSE_DOWN)
  9131. this.isPressd = true;
  9132. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9133. this.isPressd = false;
  9134. if (!this.isPressd)
  9135. return;
  9136. this.moveDest.x = e.stageX;
  9137. this.moveDest.y = e.stageY;
  9138. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9139. if (dis > 6724) {
  9140. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9141. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9142. }
  9143. this.setDot();
  9144. }
  9145. resetRod() {
  9146. this.ui.dot.x = this.ui.white.x;
  9147. this.ui.dot.y = this.ui.white.y;
  9148. this.gameRod.dot.x = this.gameRod.bg.x;
  9149. this.gameRod.dot.y = this.gameRod.bg.y;
  9150. xGame.common.rodOffest.x = 0;
  9151. xGame.common.rodOffest.y = 0;
  9152. }
  9153. }
  9154. UIRodMethod.uiName = "UIRodMethod";
  9155. class UIGame extends UIBase {
  9156. constructor() {
  9157. super();
  9158. this.powerNum = 0;
  9159. this.isD3Inited = false;
  9160. this.isPrePlay = false;
  9161. this.isMoveRod = false;
  9162. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9163. this.rulerDis = 20;
  9164. this.rulerOffset = 0;
  9165. }
  9166. onConstructor() {
  9167. this.ui = ui_UIGame.createInstance();
  9168. this.contentPane = this.ui;
  9169. this.ui.x += xGame.common.sysOffestNum;
  9170. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9171. this.isEject = false;
  9172. xGame.common.gameUI = this;
  9173. this.initSelf();
  9174. }
  9175. isTurnSelf() {
  9176. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9177. return true;
  9178. }
  9179. }
  9180. initSelf() {
  9181. let topUI = this.ui.topNode;
  9182. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9183. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9184. this.barInfo = {};
  9185. this.barInfo.curY = 0;
  9186. this.barInfo.height = this.ui.powerNode.height;
  9187. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9188. this.barInfo.powerStartY = this.ui.powerNode.y;
  9189. xGame.common.aiPlayer = new AIPlayer();
  9190. xGame.common.gameMgr = new GameMgr();
  9191. xGame.common.skillMgr = new SkillMgr();
  9192. xGame.common.wordsMgr = new WordsMgr();
  9193. xGame.common.talkMgr = new TalkMgr();
  9194. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9195. console.log("加载经典模式表情文件chenggon !");
  9196. });
  9197. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9198. console.log("挑战模式奖励模式spine加载成功!");
  9199. });
  9200. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9201. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9202. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9203. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9204. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9205. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9206. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9207. }
  9208. returnHome() {
  9209. let tips = "Are you sure to exit the game?";
  9210. let woman = "Boss, why don't you play for a while longer?";
  9211. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9212. }
  9213. addRodMethodClick() {
  9214. if (this.isTurnSelf()) {
  9215. xGame.uiMgr.Show(UIRodMethod);
  9216. }
  9217. }
  9218. clickHelpLineBtn(force = false) {
  9219. if (!this.isTurnSelf())
  9220. return;
  9221. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9222. if (success) {
  9223. xGame.common.longHelpLine = true;
  9224. xGame.common.d2World.getHelpLine();
  9225. Moyu.sendDataEvent("guideNum");
  9226. }
  9227. else {
  9228. }
  9229. });
  9230. }
  9231. renderSelfDisplayBalls(index, target) {
  9232. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9233. target.myImg.url = xGame.common.getGameIconUrl(str);
  9234. }
  9235. renderAIDisplayBalls(index, target) {
  9236. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9237. target.myImg.url = xGame.common.getGameIconUrl(str);
  9238. ;
  9239. }
  9240. updateMode() {
  9241. if (xGame.common.gameMode == GameMode.classic) {
  9242. this.ui.topNode.scoreNode.visible = false;
  9243. }
  9244. else if (xGame.common.gameMode == GameMode.bigMove) {
  9245. this.ui.topNode.scoreNode.visible = true;
  9246. }
  9247. }
  9248. show() {
  9249. super.show();
  9250. console.log("zh:uigame show");
  9251. this.ui.alpha = 0;
  9252. this.updateSelf();
  9253. console.log("zh:uigame bf gamemusic01 start");
  9254. xGame.soundMgr.playMusic("gamemusic01");
  9255. console.log("zh:uigame bf gamemusic01 end");
  9256. xGame.common.gameMgr.gamePause = false;
  9257. xGame.common.gameUI.ui.blackAni.visible = false;
  9258. xGame.common.gameUI.ui.whiteAni.visible = false;
  9259. this.ui.powerEft.visible = false;
  9260. this.ui.colorNode.visible = false;
  9261. this.updateHead();
  9262. }
  9263. updateSelf() {
  9264. if (xGame.common.gameMode == GameMode.classic) {
  9265. this.ui.c1.selectedIndex = 0;
  9266. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9267. this.ui.topNode.middleNode.visible = true;
  9268. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9269. }
  9270. else if (xGame.common.gameMode == GameMode.bigMove) {
  9271. this.ui.c1.selectedIndex = 0;
  9272. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9273. this.ui.topNode.middleNode.visible = false;
  9274. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9275. let rand = xGame.common.randomNum(1, max);
  9276. let guide = DataMgr.getSkillGuide();
  9277. if (guide == 0)
  9278. rand = 1;
  9279. xGame.common.bigMoveLevelIndex = rand;
  9280. }
  9281. else if (xGame.common.gameMode == GameMode.placeBall) {
  9282. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9283. this.ui.c1.selectedIndex = 1 + data.type;
  9284. this.ui.alpha = 1;
  9285. this.startGame();
  9286. }
  9287. this.updateMode();
  9288. this.initD3world();
  9289. this.initD2world();
  9290. }
  9291. startGame() {
  9292. this.ui.snowNode.visible = Math.random() <= 0.1;
  9293. this.ui.d2Node.visible = false;
  9294. xGame.common.d3World.d3Hand.gameObj.active = false;
  9295. xGame.common.d3World.tableSrc.init();
  9296. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9297. this.cameraViewChange(() => {
  9298. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9299. switch (xGame.common.gameMode) {
  9300. case GameMode.classic:
  9301. xGame.common.d3World.d3Hand.gameObj.active = true;
  9302. this.playPutBallD3Ani();
  9303. break;
  9304. case GameMode.bigMove:
  9305. this.enterGame();
  9306. Laya.timer.once(500, this, () => {
  9307. this.ui.topNode.middleNode.visible = true;
  9308. this.ui.topNode.middleNode.t0.play();
  9309. });
  9310. break;
  9311. case GameMode.placeBall:
  9312. this.enterGame();
  9313. break;
  9314. default:
  9315. break;
  9316. }
  9317. });
  9318. PlatMgr.showBanner(false);
  9319. }
  9320. enterGame() {
  9321. this.ui.d2Node.visible = true;
  9322. xGame.common.d3World.d3Hand.gameObj.active = false;
  9323. xGame.common.showOneCamera("mainCamera");
  9324. Moyu.recordGame(30, true);
  9325. if (!this.isPrePlay) {
  9326. this.isPrePlay = true;
  9327. xGame.common.d3World.prePlayEft();
  9328. }
  9329. xGame.common.gameMgr.gameReady();
  9330. this.openAllEvent();
  9331. this.ui.snowNode.visible = false;
  9332. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9333. this.ui.helpBtn.visible = condition;
  9334. }
  9335. showHelpLineGuide() {
  9336. let longGuide = DataMgr.getGuideHelpLine();
  9337. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9338. this.ui.helpBtn.visible = true;
  9339. this.ui.guideNode.visible = true;
  9340. }
  9341. }
  9342. setTurnAlpha(alpha) {
  9343. this.ui.keduNode.alpha = alpha;
  9344. this.ui.ganNode.alpha = alpha;
  9345. this.ui.rodMethodNode.alpha = alpha;
  9346. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9347. }
  9348. cameraViewChange(callback) {
  9349. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9350. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9351. xGame.common.showOneCamera("visitAngle");
  9352. cameraSrc.localRotationEulerY = 180;
  9353. cameraSrc.localRotationEulerZ = 0;
  9354. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9355. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9356. callback && callback();
  9357. }));
  9358. }));
  9359. }
  9360. playPutBallD3Ani() {
  9361. xGame.common.showOneCamera("mainCamera");
  9362. let handSrc = xGame.common.d3World.d3Hand;
  9363. handSrc.gameObj.active = true;
  9364. handSrc.transform.localPositionZ = 3;
  9365. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9366. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9367. handSrc.gameObj.active = false;
  9368. this.enterGame();
  9369. }), 400);
  9370. }));
  9371. }
  9372. updateHead() {
  9373. let user = Moyu.getUserInfo();
  9374. this.ui.topNode.selfNameTxt.text = user.nickName;
  9375. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9376. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9377. if (DataMgr.getSkillGuide() < 1) {
  9378. this.ui.topNode.aiNameTxt.text = 'billiards';
  9379. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9380. }
  9381. else {
  9382. this.ui.topNode.aiNameTxt.text = aiData.name;
  9383. this.ui.topNode.aiHeadLoader.url = baseHeadUrl + aiData.icon;
  9384. }
  9385. }
  9386. initD2world() {
  9387. let node = this.ui.d2Root.displayObject;
  9388. let src = node.getComponent(D2World);
  9389. if (!src) {
  9390. xGame.common.d2World = node.addComponent(D2World);
  9391. }
  9392. xGame.common.d2World.initSelf();
  9393. }
  9394. initD3world() {
  9395. if (this.isD3Inited)
  9396. return;
  9397. this.isD3Inited = true;
  9398. let scene3D = xGame.common.d3Scene;
  9399. this.ui.d3Root.displayObject.addChild(scene3D);
  9400. scene3D.active = true;
  9401. xGame.common.d3World.tableSrc.setBorderPos();
  9402. }
  9403. onRootMove(e) {
  9404. let rootBall = xGame.common.d2World.rootBall;
  9405. this.ui.moveNode.x = e.x;
  9406. this.ui.moveNode.y = e.y;
  9407. rootBall.gameObj.x = e.x;
  9408. rootBall.gameObj.y = e.y;
  9409. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9410. }
  9411. aiRootMove(move) {
  9412. if (move)
  9413. this.hideBallUI();
  9414. else {
  9415. this.showBallUI();
  9416. xGame.common.d2World.getHelpLine();
  9417. }
  9418. }
  9419. aiForce(type, force = 0) {
  9420. this.pressTarget = PressType.powerNode;
  9421. if (type == 1)
  9422. this.onEventUp({ force: true });
  9423. else if (type == 2)
  9424. this.onEventMove({ stageY: force, force: true });
  9425. }
  9426. onEventPress(e) {
  9427. if (e.stopPropagation)
  9428. e.stopPropagation();
  9429. if (!this.isTurnSelf())
  9430. return;
  9431. let target = e.target;
  9432. switch (target) {
  9433. case this.ui.myPowerNode.displayObject:
  9434. this.pressTarget = PressType.powerNode;
  9435. this.barInfo.curY = e.stageY;
  9436. this.updateBarInfo();
  9437. break;
  9438. case this.ui.moveNode.displayObject:
  9439. this.pressTarget = PressType.moveNode;
  9440. this.hideBallUI();
  9441. this.eventObj.curX = this.ui.moveNode.x;
  9442. this.eventObj.curY = this.ui.moveNode.y;
  9443. this.ui.moveNode.finger.visible = false;
  9444. this.eventObj.lastX = e.stageX;
  9445. this.eventObj.lastY = e.stageY;
  9446. break;
  9447. case this.ui.rulerClickNode.displayObject:
  9448. this.pressTarget = PressType.rulerNode;
  9449. this.eventObj.lastY = e.stageY;
  9450. break;
  9451. case this.ui.d2Root.displayObject:
  9452. this.pressTarget = PressType.d2Root;
  9453. this.eventObj.lastX = e.stageX;
  9454. this.eventObj.lastY = e.stageY;
  9455. this.eventObj.starX = e.stageX;
  9456. this.eventObj.starY = e.stageY;
  9457. this.eventObj.curX = 0;
  9458. this.eventObj.curY = 0;
  9459. xGame.common.d2World.d2Gan.setGanLastInfo();
  9460. this.rulerOffset = 0;
  9461. break;
  9462. default:
  9463. break;
  9464. }
  9465. }
  9466. onEventMove(e) {
  9467. if (e.stopPropagation)
  9468. e.stopPropagation();
  9469. if (e && e.force) {
  9470. }
  9471. else {
  9472. if (!this.isTurnSelf())
  9473. return;
  9474. }
  9475. switch (this.pressTarget) {
  9476. case PressType.powerNode:
  9477. this.barInfo.curY = e.stageY;
  9478. this.updateBarInfo();
  9479. this.isMoveRod = true;
  9480. break;
  9481. case PressType.moveNode:
  9482. let rootBall = xGame.common.d2World.rootBall;
  9483. let radius = rootBall.gameObj.width / 2;
  9484. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9485. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9486. let border = xGame.common.d2World.borderRect;
  9487. if (curX <= border.x + radius)
  9488. curX = border.x + radius;
  9489. else if (curX >= border.x + border.width - radius)
  9490. curX = border.x + border.width - radius;
  9491. if (curY <= border.y + radius)
  9492. curY = border.y + radius;
  9493. else if (curY >= border.y + border.height - radius)
  9494. curY = border.y + border.height - radius;
  9495. if (xGame.common.gameMgr.isOpenBall) {
  9496. if (curX >= border.x + border.openBallW - radius)
  9497. curX = border.x + border.openBallW - radius;
  9498. }
  9499. this.ui.moveNode.x = curX;
  9500. this.ui.moveNode.y = curY;
  9501. rootBall.gameObj.x = curX;
  9502. rootBall.gameObj.y = curY;
  9503. rootBall.d3BallSrc.setTransPos(curX, curY);
  9504. this.isMoveRod = true;
  9505. break;
  9506. case PressType.rulerNode:
  9507. let yy = e.stageY - this.eventObj.lastY;
  9508. this.eventObj.lastY = e.stageY;
  9509. let ruler1 = this.ui.rulerNode.img1;
  9510. let ruler2 = this.ui.rulerNode.img2;
  9511. ruler1.y += yy;
  9512. ruler2.y += yy;
  9513. this.rulerOffset += yy;
  9514. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9515. this.rulerOffset = 0;
  9516. xGame.soundMgr.playSound("inch", 1, 10);
  9517. }
  9518. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9519. let h = ruler1.height;
  9520. this.checkGuide();
  9521. this.isMoveRod = true;
  9522. if (ruler1.y >= h) {
  9523. ruler1.y = -h;
  9524. ruler2.y = 0;
  9525. return;
  9526. }
  9527. else if (ruler1.y <= -h) {
  9528. ruler1.y = h;
  9529. ruler2.y = 0;
  9530. return;
  9531. }
  9532. if (ruler2.y >= h) {
  9533. ruler2.y = -h;
  9534. ruler1.y = 0;
  9535. return;
  9536. }
  9537. else if (ruler2.y <= -h) {
  9538. ruler2.y = h;
  9539. ruler1.y = 0;
  9540. return;
  9541. }
  9542. break;
  9543. case PressType.d2Root:
  9544. this.eventObj.curX = e.stageX;
  9545. this.eventObj.curY = e.stageY;
  9546. let offset = this.checkRodMoveDir();
  9547. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9548. this.eventObj.lastX = e.stageX;
  9549. this.eventObj.lastY = e.stageY;
  9550. break;
  9551. default:
  9552. break;
  9553. }
  9554. }
  9555. onEventUp(e) {
  9556. if (e.stopPropagation)
  9557. e.stopPropagation();
  9558. if (e && e.force) {
  9559. }
  9560. else {
  9561. if (!this.isTurnSelf())
  9562. return;
  9563. }
  9564. switch (this.pressTarget) {
  9565. case PressType.powerNode:
  9566. this.ui.powerNode.value = 0;
  9567. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9568. this.ui.powerTxt.text = "";
  9569. if (this.powerNum > 0) {
  9570. xGame.eventMgr.event(BALL_SHOOT);
  9571. xGame.common.d2World.shoot(this.powerNum);
  9572. xGame.common.d2World.d2Gan.shoot();
  9573. xGame.common.d2World.d2HelpLine.shoot();
  9574. this.finishGuide();
  9575. this.ui.powerEft.visible = false;
  9576. this.ui.colorNode.visible = false;
  9577. let ganStr = "";
  9578. if (this.powerNum <= 30) {
  9579. ganStr = "gan_30";
  9580. }
  9581. else if (this.powerNum <= 60) {
  9582. ganStr = "gan_50";
  9583. }
  9584. else {
  9585. ganStr = "gan_80";
  9586. }
  9587. xGame.soundMgr.playSound(ganStr);
  9588. }
  9589. break;
  9590. case PressType.moveNode:
  9591. let rootBall = xGame.common.d2World.rootBall;
  9592. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9593. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9594. let isIntersect = this.judgeBallIntersect();
  9595. if (isIntersect) {
  9596. this.ui.moveNode.x = lastX;
  9597. this.ui.moveNode.y = lastY;
  9598. rootBall.gameObj.x = lastX;
  9599. rootBall.gameObj.y = lastY;
  9600. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9601. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9602. }
  9603. else {
  9604. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9605. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9606. }
  9607. this.showBallUI();
  9608. this.ui.moveNode.finger.visible = true;
  9609. xGame.common.d2World.getHelpLine();
  9610. break;
  9611. case PressType.rulerNode:
  9612. break;
  9613. case PressType.d2Root:
  9614. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9615. if (dis <= 25) {
  9616. this.moveToClickDot(e);
  9617. }
  9618. break;
  9619. default:
  9620. break;
  9621. }
  9622. this.pressTarget = -1;
  9623. }
  9624. checkGuide() {
  9625. let guide = DataMgr.getSkillGuide();
  9626. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9627. xGame.common.guideStep++;
  9628. xGame.common.gameUI.ui.guide2.visible = false;
  9629. xGame.common.gameUI.ui.guide3.visible = true;
  9630. }
  9631. }
  9632. finishGuide() {
  9633. let guide = DataMgr.getSkillGuide();
  9634. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9635. xGame.common.guideStep = 10;
  9636. this.closeAllGuide();
  9637. }
  9638. }
  9639. closeAllGuide() {
  9640. xGame.common.gameUI.ui.guide1.visible = false;
  9641. xGame.common.gameUI.ui.guide2.visible = false;
  9642. xGame.common.gameUI.ui.guide3.visible = false;
  9643. }
  9644. updateBarInfo() {
  9645. let star = this.ui.powerNode.y;
  9646. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9647. if (rate >= 1)
  9648. rate = 1;
  9649. if (rate <= 0)
  9650. rate = 0;
  9651. this.powerNum = Math.ceil(rate * 100);
  9652. this.ui.powerNode.value = this.powerNum;
  9653. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9654. this.ui.colorNode.value = this.powerNum;
  9655. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9656. this.ui.powerEft.visible = this.powerNum != 0;
  9657. this.ui.colorNode.visible = this.powerNum != 0;
  9658. this.ui.powerTxt.text = this.powerNum + "";
  9659. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9660. }
  9661. forceCancel() {
  9662. this.ui.powerNode.value = 0;
  9663. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9664. this.ui.powerTxt.text = "";
  9665. }
  9666. checkRodMoveDir() {
  9667. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9668. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9669. if (tempX >= 0 && tempY <= 0) {
  9670. return this.checkDir();
  9671. }
  9672. else if (tempX < 0 && tempY < 0) {
  9673. return this.checkDir(1, -1);
  9674. }
  9675. else if (tempX < 0 && tempY > 0) {
  9676. return this.checkDir(-1, -1);
  9677. }
  9678. else {
  9679. return this.checkDir(-1, 1);
  9680. }
  9681. }
  9682. checkDir(flagX = 1, flagY = 1) {
  9683. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9684. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9685. if (offsetY == 0) {
  9686. return offsetX * flagX;
  9687. }
  9688. if (offsetX == 0) {
  9689. return offsetY * flagY;
  9690. }
  9691. let angle = offsetY / offsetX;
  9692. if (Math.abs(angle) >= 1) {
  9693. return offsetY * flagY;
  9694. }
  9695. else {
  9696. return offsetX * flagX;
  9697. }
  9698. }
  9699. judgeBallIntersect() {
  9700. let rootBall = xGame.common.d2World.rootBall;
  9701. let ballArr = xGame.common.d2World.ballArr;
  9702. let radius = rootBall.gameObj.width / 2;
  9703. let temp;
  9704. let isIntersect = false;
  9705. for (let index = 0; index < ballArr.length; index++) {
  9706. temp = ballArr[index];
  9707. if (temp.number == rootBall.number)
  9708. continue;
  9709. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9710. if (isIntersect) {
  9711. break;
  9712. }
  9713. }
  9714. return isIntersect;
  9715. }
  9716. hideBallUI() {
  9717. let d2Gan = xGame.common.d2World.d2Gan;
  9718. if (!d2Gan.ui.isDisposed)
  9719. d2Gan.ui.visible = false;
  9720. let d2Help = xGame.common.d2World.d2HelpLine;
  9721. if (!d2Help.ui.isDisposed)
  9722. d2Help.ui.visible = false;
  9723. let rootBall = xGame.common.d2World.rootBall;
  9724. if (!rootBall.destroyed) {
  9725. rootBall.gameObj.active = false;
  9726. }
  9727. }
  9728. showBallUI() {
  9729. let d2Gan = xGame.common.d2World.d2Gan;
  9730. if (!d2Gan.ui.isDisposed)
  9731. d2Gan.ui.visible = true;
  9732. let d2Help = xGame.common.d2World.d2HelpLine;
  9733. if (!d2Help.ui.isDisposed)
  9734. d2Help.ui.visible = true;
  9735. let rootBall = xGame.common.d2World.rootBall;
  9736. if (!rootBall.destroyed) {
  9737. rootBall.gameObj.active = true;
  9738. }
  9739. }
  9740. moveToClickDot(e) {
  9741. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9742. let root = xGame.common.d2World.rootBall.gameObj;
  9743. let xx = e.stageX - xGame.common.sysOffestNum;
  9744. let yy = e.stageY;
  9745. let x = xx - root.x;
  9746. let y = yy - root.y;
  9747. let angle = xGame.common.getfguiRotation(x, y);
  9748. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9749. xGame.common.d2World.getHelpLine();
  9750. }
  9751. this.isMoveRod = false;
  9752. xGame.common.clickedBall = false;
  9753. }
  9754. openAllEvent() {
  9755. this.closeAllEvent();
  9756. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9757. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9758. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9759. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9760. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9761. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9762. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9763. }
  9764. closeAllEvent() {
  9765. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9766. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9767. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9768. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9769. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9770. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9771. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9772. }
  9773. resetGame() {
  9774. this.closeAllEvent();
  9775. this.hideBallUI();
  9776. xGame.common.gameMgr.gamePause = true;
  9777. }
  9778. }
  9779. UIGame.uiName = "UIGame";
  9780. class UIAddProp extends UIBase {
  9781. constructor() {
  9782. super();
  9783. this.curType = "";
  9784. }
  9785. onConstructor() {
  9786. this.ui = ui_UIAddProp.createInstance();
  9787. this.contentPane = this.ui;
  9788. this.isEject = false;
  9789. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9790. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9791. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9792. this.updateUI();
  9793. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9794. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9795. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9796. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9797. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9798. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9799. }
  9800. show(type) {
  9801. super.show();
  9802. this.curType = type == 0 ? "coin" : "diamond";
  9803. this.switchBtn("");
  9804. this.ui.t0.play();
  9805. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9806. PlatMgr.showInsert(true);
  9807. }
  9808. closeSelf() {
  9809. this.hide();
  9810. }
  9811. updateUI() {
  9812. let data = cfgTable.moneyData;
  9813. let temp;
  9814. let obj;
  9815. for (const key in data) {
  9816. temp = data[key];
  9817. obj = this.ui.myNode["node" + key];
  9818. if (parseInt(key) <= 2) {
  9819. obj.diamondTxt.text = "+" + temp.num;
  9820. }
  9821. else {
  9822. obj.coinTxt.text = temp.num;
  9823. obj.diamondTxt.text = temp.get.split('_')[1];
  9824. }
  9825. }
  9826. this.updateDiamondShare();
  9827. }
  9828. updateDiamondShare() {
  9829. let data = DataMgr.getShareDiamondTimes();
  9830. if (data >= xGame.common.maxShareDiamondTimes) {
  9831. this.ui.myNode.node1.shareTxt.text = "明日再来";
  9832. this.ui.myNode.node1.touchable = false;
  9833. }
  9834. else {
  9835. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9836. this.ui.myNode.node1.touchable = true;
  9837. }
  9838. }
  9839. switchBtn(type) {
  9840. if (type == "")
  9841. type = this.curType;
  9842. else {
  9843. if (this.curType == type) {
  9844. return;
  9845. }
  9846. else {
  9847. this.curType = type;
  9848. }
  9849. }
  9850. if (type == "coin") {
  9851. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9852. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9853. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9854. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9855. this.ui.myNode.c1.selectedIndex = 0;
  9856. }
  9857. else {
  9858. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9859. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9860. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9861. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9862. this.ui.myNode.c1.selectedIndex = 1;
  9863. }
  9864. }
  9865. convertCoin(index) {
  9866. let data = cfgTable.moneyData[index];
  9867. let coinNum = data.num;
  9868. let str = data.get.split('_')[1];
  9869. let needDiamond = parseInt(str);
  9870. if (DataMgr.diamondEnough(needDiamond)) {
  9871. DataMgr.setDiamond(-needDiamond);
  9872. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9873. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  9874. }
  9875. else {
  9876. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  9877. this.switchBtn("diamond");
  9878. }
  9879. }
  9880. videoGetDiamond() {
  9881. let num = cfgTable.moneyData[2].num;
  9882. Moyu.showVideoAd(() => {
  9883. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9884. this.closeSelf();
  9885. }, EAdType.addDiamond);
  9886. }
  9887. videoGetCoin() {
  9888. Moyu.showVideoAd(() => {
  9889. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9890. this.closeSelf();
  9891. }, EAdType.addCoin);
  9892. }
  9893. shareGetDiamond() {
  9894. let times = DataMgr.getShareDiamondTimes();
  9895. if (times >= xGame.common.maxShareDiamondTimes) {
  9896. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  9897. }
  9898. else {
  9899. if (Moyu.isTT) {
  9900. let num = cfgTable.moneyData[1].num;
  9901. Moyu.shareVideo = '';
  9902. Moyu.shareGame((success) => {
  9903. if (success) {
  9904. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9905. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9906. DataMgr.setShareDiamondTimes(1);
  9907. this.updateDiamondShare();
  9908. }
  9909. else {
  9910. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9911. }
  9912. });
  9913. }
  9914. else {
  9915. Moyu.showVideoAd(() => {
  9916. let diamond = xGame.common.randomNum(50, 100);
  9917. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9918. DataMgr.setShareDiamondTimes(1);
  9919. this.updateDiamondShare();
  9920. }, EAdType.randomDiamond);
  9921. }
  9922. }
  9923. }
  9924. openPutBallView() {
  9925. let end = xGame.uiMgr.getUI(UIGameEnd);
  9926. let skill = xGame.uiMgr.getUI(UISkill);
  9927. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9928. let uigame = xGame.uiMgr.getUI(UIGame);
  9929. if (end && !end.isHide) {
  9930. xGame.uiMgr.Hide(UIGameEnd);
  9931. xGame.uiMgr.Show(UIMain);
  9932. }
  9933. if (skill && !skill.isHide)
  9934. xGame.uiMgr.Hide(UISkill);
  9935. if (uigame && !uigame.isHide)
  9936. xGame.uiMgr.Hide(UIGame);
  9937. if (level && !level.isHide) {
  9938. }
  9939. else {
  9940. xGame.uiMgr.Show(UILevelDisplay);
  9941. }
  9942. this.closeSelf();
  9943. }
  9944. }
  9945. UIAddProp.uiName = "UIAddProp";
  9946. class MoneyNode {
  9947. constructor(ui) {
  9948. this.leftTime = 0;
  9949. this.ui = ui;
  9950. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9951. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9952. this.ui.addPowerBtn.onClick(this, this.addPower);
  9953. this.ui.c1.selectedIndex = 1;
  9954. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9955. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9956. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9957. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  9958. this.coinChange();
  9959. this.diamondChange();
  9960. this.powerChange();
  9961. }
  9962. addPower() {
  9963. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9964. xGame.uiMgr.Show(UIPower);
  9965. }
  9966. powerChange() {
  9967. let powerNum = DataMgr.getPower();
  9968. this.ui.powerTxt.text = powerNum + "";
  9969. }
  9970. checkPowerTime() {
  9971. let cur = new Date().getTime();
  9972. let last = DataMgr.getPowerTime();
  9973. if (last == 0) {
  9974. last = cur;
  9975. DataMgr.setPowerTime(cur);
  9976. }
  9977. let power = DataMgr.getPower();
  9978. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  9979. Laya.timer.clearAll(this);
  9980. if (power >= xGame.common.natureMaxPower) {
  9981. this.ui.powerTimeTxt.text = "";
  9982. DataMgr.setPowerTime(cur);
  9983. return;
  9984. }
  9985. if (power + offset >= xGame.common.natureMaxPower) {
  9986. DataMgr.setPower(xGame.common.natureMaxPower, false);
  9987. this.ui.powerTimeTxt.text = "";
  9988. DataMgr.setPowerTime(cur);
  9989. }
  9990. else {
  9991. if (offset > 0) {
  9992. DataMgr.setPower(offset);
  9993. DataMgr.setPowerTime(cur);
  9994. }
  9995. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  9996. this.leftTime = xGame.common.powerRecoverNum - time;
  9997. if (this.leftTime <= 0)
  9998. this.leftTime = 0;
  9999. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10000. Laya.timer.loop(1000, this, this.updatePowerTime);
  10001. }
  10002. }
  10003. updatePowerTime() {
  10004. this.leftTime -= 1;
  10005. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10006. if (this.leftTime <= 0) {
  10007. this.checkPowerTime();
  10008. }
  10009. }
  10010. coinChange() {
  10011. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10012. }
  10013. diamondChange() {
  10014. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10015. }
  10016. addCoin() {
  10017. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10018. Moyu.sendDataEvent("AddCoinBtn");
  10019. xGame.uiMgr.Show(UIAddProp, 0);
  10020. }
  10021. addDiamond() {
  10022. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10023. Moyu.sendDataEvent("AddDiamondBtn");
  10024. xGame.uiMgr.Show(UIAddProp, 1);
  10025. }
  10026. }
  10027. class UIDraw extends UIBase {
  10028. constructor() {
  10029. super();
  10030. this.curKey = 0;
  10031. }
  10032. onConstructor() {
  10033. this.ui = ui_UIDraw.createInstance();
  10034. this.contentPane = this.ui;
  10035. this.isEject = false;
  10036. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10037. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10038. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10039. this.initDraw();
  10040. this.initUI();
  10041. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10042. if (Moyu.isKs)
  10043. this.ui.closeNode.closeBtn.x += 100;
  10044. }
  10045. show() {
  10046. super.show();
  10047. this.ui.t0.play();
  10048. this.playSecretaryIdle();
  10049. this.updateDraw();
  10050. this.checkFree();
  10051. if (PlatMgr.bannerDelay > 0) {
  10052. this.ui.closeNode.closeBtn.visible = false;
  10053. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10054. this.ui.closeNode.closeBtn.visible = true;
  10055. });
  10056. }
  10057. PlatMgr.showRateBanner();
  10058. }
  10059. hide() {
  10060. Laya.timer.clearAll(this);
  10061. super.hide();
  10062. }
  10063. checkFree() {
  10064. let isFree = DataMgr.getDailyfreeDrawTimes();
  10065. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10066. }
  10067. initDraw() {
  10068. this.drawObj = [];
  10069. let data = cfgTable.drawData;
  10070. let temp;
  10071. let weight = 0;
  10072. for (const key in data) {
  10073. temp = data[key];
  10074. weight += temp.weight;
  10075. this.drawObj.push(weight);
  10076. }
  10077. this.allWeight = weight;
  10078. }
  10079. initUI() {
  10080. let data = cfgTable.drawData;
  10081. let temp;
  10082. let img;
  10083. let txt;
  10084. for (const key in data) {
  10085. temp = data[key];
  10086. img = this.ui.myNode.rotNode["img" + key];
  10087. txt = this.ui.myNode.rotNode["txt" + key];
  10088. img.url = xGame.common.getGameIconUrl(temp.icon);
  10089. txt.visible = true;
  10090. if (temp.award > 2) {
  10091. img.rotation = 0;
  10092. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10093. }
  10094. else {
  10095. img.rotation = temp.rotation;
  10096. txt.text = temp.num;
  10097. }
  10098. }
  10099. }
  10100. getCurkey() {
  10101. let rand = Math.random() * this.allWeight;
  10102. let temp;
  10103. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10104. temp = this.drawObj[index];
  10105. if (index == 0) {
  10106. if (rand < temp) {
  10107. return index + 1;
  10108. }
  10109. }
  10110. else {
  10111. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10112. return index + 1;
  10113. }
  10114. }
  10115. }
  10116. return 2;
  10117. }
  10118. startDraw() {
  10119. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10120. if (freeTimes > 0) {
  10121. this.beginDraw();
  10122. DataMgr.setDailyfreeDrawTimes(0);
  10123. this.checkFree();
  10124. }
  10125. else {
  10126. Moyu.sendDataEvent("turntable");
  10127. Moyu.showVideoAd(() => {
  10128. this.beginDraw();
  10129. }, EAdType.draw);
  10130. }
  10131. }
  10132. beginDraw() {
  10133. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10134. this.ui.drawBtn.touchable = false;
  10135. this.curKey = this.getCurkey();
  10136. console.log("当前key", this.curKey);
  10137. let cell = 60;
  10138. let lap = 3;
  10139. let angle = cell * (this.curKey - 1) + lap * 360;
  10140. let target = this.ui.myNode.rotNode;
  10141. target.rotation = 0;
  10142. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10143. console.log("旋转完成");
  10144. this.ui.drawBtn.touchable = true;
  10145. this.getAward();
  10146. }));
  10147. }
  10148. getAward() {
  10149. let data = cfgTable.drawData[this.curKey];
  10150. let temp = new AwardType();
  10151. temp.type = data.award;
  10152. temp.num = data.num;
  10153. xGame.common.getAward([temp], () => {
  10154. DataMgr.setDrawTimes(1);
  10155. this.updateDraw();
  10156. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10157. });
  10158. }
  10159. updateDraw() {
  10160. let drawTimes = DataMgr.getDrawTimes();
  10161. let awardTimes = DataMgr.getDrawAwardTimes();
  10162. if (Math.floor(drawTimes / 3) > awardTimes) {
  10163. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10164. this.ui.extraNode.boxBtn.touchable = true;
  10165. this.ui.extraNode.tipsTxt.text = "3/3";
  10166. this.ui.extraNode.barNode.width = 265;
  10167. this.getExtraAward();
  10168. }
  10169. else {
  10170. this.ui.extraNode.boxBtn.t0.stop();
  10171. this.ui.extraNode.boxBtn.touchable = false;
  10172. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10173. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10174. }
  10175. let data = cfgTable.drawData[1];
  10176. if (awardTimes == 0) {
  10177. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10178. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10179. this.ui.myNode.rotNode.img1.rotation = 0;
  10180. }
  10181. else {
  10182. let award = data.nextid;
  10183. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10184. this.ui.myNode.rotNode.txt1.text = award[1];
  10185. this.ui.myNode.rotNode.img1.rotation = 0;
  10186. }
  10187. }
  10188. getExtraAward() {
  10189. let drawTimes = DataMgr.getDrawTimes();
  10190. let awardTimes = DataMgr.getDrawAwardTimes();
  10191. let data = cfgTable.drawData[1];
  10192. let award = new AwardType();
  10193. if (awardTimes == 0) {
  10194. award.num = data.num;
  10195. award.type = data.award;
  10196. xGame.common.getAward([award], () => {
  10197. let all = Math.floor(drawTimes / 3);
  10198. DataMgr.setDrawAwardTimes(all);
  10199. this.updateDraw();
  10200. });
  10201. }
  10202. else {
  10203. award.num = parseInt(data.nextid[1]);
  10204. award.type = parseInt(data.nextid[0]);
  10205. xGame.common.getAward([award], () => {
  10206. let all = Math.floor(drawTimes / 3);
  10207. DataMgr.setDrawAwardTimes(all);
  10208. this.updateDraw();
  10209. });
  10210. }
  10211. }
  10212. closeSelf() {
  10213. this.hide();
  10214. }
  10215. playSecretaryIdle() {
  10216. let parent = this.ui.secretary.displayObject;
  10217. parent.destroyChildren();
  10218. let xx = this.ui.secretary.width / 2;
  10219. let yy = this.ui.secretary.height;
  10220. let scale = xGame.common.getSecretaryScale();
  10221. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10222. xGame.common.secretary.play(data, 1, true, parent);
  10223. }
  10224. }
  10225. UIDraw.uiName = "UIDraw";
  10226. class ui_UIFlyEft extends fgui.GComponent {
  10227. static createInstance() {
  10228. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10229. }
  10230. onConstruct() {
  10231. this.n0 = (this.getChild("n0"));
  10232. this.n1 = (this.getChild("n1"));
  10233. this.n2 = (this.getChild("n2"));
  10234. this.n3 = (this.getChild("n3"));
  10235. this.n4 = (this.getChild("n4"));
  10236. this.n5 = (this.getChild("n5"));
  10237. this.n6 = (this.getChild("n6"));
  10238. this.n7 = (this.getChild("n7"));
  10239. this.iconNode = (this.getChild("iconNode"));
  10240. this.txt = (this.getChild("txt"));
  10241. this.txtNode = (this.getChild("txtNode"));
  10242. }
  10243. }
  10244. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10245. class UIFlyEft extends UIBase {
  10246. constructor() {
  10247. super();
  10248. this.max = 8;
  10249. this.delay = 0;
  10250. }
  10251. onConstructor() {
  10252. this.ui = ui_UIFlyEft.createInstance();
  10253. this.contentPane = this.ui;
  10254. this.isEject = false;
  10255. this.isMuti = true;
  10256. this.ui.x += xGame.common.sysOffestNum;
  10257. }
  10258. getArrPos() {
  10259. if (this.iconPos && this.iconPos.length > 0)
  10260. return;
  10261. this.iconPos = [];
  10262. let temp;
  10263. for (let index = 0; index < this.max; index++) {
  10264. temp = this.ui["n" + index];
  10265. this.iconPos.push([temp.x, temp.y]);
  10266. }
  10267. }
  10268. show(stPos, edPos, num, type, callback) {
  10269. super.show();
  10270. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10271. this.getArrPos();
  10272. this.updateUI(type);
  10273. this.updatePos();
  10274. this.runFly(edPos, callback);
  10275. this.runWorlds(stPos, num);
  10276. }
  10277. updateUI(type) {
  10278. let temp;
  10279. let str;
  10280. for (let index = 0; index < this.max; index++) {
  10281. temp = this.ui["n" + index];
  10282. str = this.getIconStr(type);
  10283. temp.url = xGame.common.getGameIconUrl(str);
  10284. }
  10285. }
  10286. getIconStr(type) {
  10287. switch (type) {
  10288. case Prop.diamond:
  10289. return "ty_zs";
  10290. case Prop.coin:
  10291. return "ty_jb";
  10292. default:
  10293. break;
  10294. }
  10295. }
  10296. updatePos() {
  10297. let temp;
  10298. for (let index = 0; index < this.max; index++) {
  10299. temp = this.ui["n" + index];
  10300. temp.x = this.iconPos[index][0];
  10301. temp.y = this.iconPos[index][1];
  10302. }
  10303. }
  10304. runFly(endPos, callback) {
  10305. let all = 0;
  10306. let temp;
  10307. for (let index = 0; index < this.max; index++) {
  10308. temp = this.ui["n" + index];
  10309. temp.visible = true;
  10310. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10311. temp.visible = false;
  10312. all++;
  10313. if (all >= this.max) {
  10314. callback && callback();
  10315. }
  10316. }), 20 * index);
  10317. }
  10318. }
  10319. runWorlds(stPos, num) {
  10320. let str = "+" + num;
  10321. this.ui.txt.text = str;
  10322. let starX = stPos.x;
  10323. let starY = stPos.y + 50;
  10324. this.ui.txt.x = starX;
  10325. this.ui.txt.y = starY;
  10326. this.ui.txt.visible = true;
  10327. this.ui.txt.alpha = 1;
  10328. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10329. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10330. this.ui.txt.visible = false;
  10331. this.hide();
  10332. }));
  10333. }));
  10334. }
  10335. }
  10336. UIFlyEft.uiName = "UIFlyEft";
  10337. class ui_UIGetAward extends fgui.GComponent {
  10338. static createInstance() {
  10339. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10340. }
  10341. onConstruct() {
  10342. this.n4 = (this.getChild("n4"));
  10343. this.n0 = (this.getChild("n0"));
  10344. this.myList = (this.getChild("myList"));
  10345. this.n1 = (this.getChild("n1"));
  10346. this.eftNode = (this.getChild("eftNode"));
  10347. this.btnNode = (this.getChild("btnNode"));
  10348. this.t0 = this.getTransition("t0");
  10349. }
  10350. }
  10351. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10352. class UIGetAward extends UIBase {
  10353. constructor() {
  10354. super();
  10355. this.showTriple = true;
  10356. }
  10357. onConstructor() {
  10358. this.ui = ui_UIGetAward.createInstance();
  10359. this.contentPane = this.ui;
  10360. this.isEject = false;
  10361. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10362. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10363. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10364. }
  10365. show(arr, showTriple, callback) {
  10366. super.show();
  10367. this.ui.t0.play();
  10368. this.ui.eftNode.visible = true;
  10369. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10370. this.ui.eftNode.visible = false;
  10371. }), 1, 0, 0, 0.9);
  10372. this.awardArr = arr;
  10373. this.showTriple = showTriple;
  10374. this.callback = callback;
  10375. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10376. this.ui.myList.numItems = arr.length;
  10377. xGame.soundMgr.playSound("getaward");
  10378. }
  10379. updateSelf(index, obj) {
  10380. let temp = this.awardArr[index];
  10381. let icon = this.getIcon(temp.type);
  10382. let str = icon;
  10383. if (temp.type > 2) {
  10384. str = "s" + icon;
  10385. }
  10386. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10387. obj.myIcon.rotation = 0;
  10388. obj.numTxt.text = temp.num + "";
  10389. obj.numTxt.visible = temp.type > 2 ? false : true;
  10390. obj.nameTxt.text = this.getNameStr(temp.type);
  10391. }
  10392. renderItem(index, obj) {
  10393. this.updateSelf(index, obj);
  10394. }
  10395. tripleGetAward() {
  10396. Moyu.showVideoAd(() => {
  10397. this.getAward(3);
  10398. }, EAdType.triple);
  10399. }
  10400. normalGetAward() {
  10401. if (PlatMgr.isMisVideo())
  10402. this.tripleGetAward();
  10403. else
  10404. this.getAward();
  10405. }
  10406. getAward(times = 1) {
  10407. this.hide();
  10408. for (let index = 0; index < this.awardArr.length; index++) {
  10409. this.awardArr[index].num *= times;
  10410. }
  10411. this.callback && this.callback(times != 1);
  10412. }
  10413. getIcon(type) {
  10414. switch (type) {
  10415. case Prop.diamond:
  10416. return "ty_zs";
  10417. case Prop.coin:
  10418. return "ty_jb";
  10419. case Prop.gan1:
  10420. return "qg1";
  10421. case Prop.gan2:
  10422. return "qg2";
  10423. case Prop.gan3:
  10424. return "qg3";
  10425. case Prop.gan4:
  10426. return "qg4";
  10427. default:
  10428. break;
  10429. }
  10430. }
  10431. getNameStr(type) {
  10432. switch (type) {
  10433. case Prop.diamond:
  10434. return "钻石";
  10435. case Prop.coin:
  10436. return "金币";
  10437. case Prop.gan1:
  10438. case Prop.gan2:
  10439. case Prop.gan3:
  10440. case Prop.gan4:
  10441. return cfgTable.ballrodData[type - 1].name;
  10442. default:
  10443. break;
  10444. }
  10445. }
  10446. }
  10447. UIGetAward.uiName = "UIGetAward";
  10448. class Common {
  10449. constructor() {
  10450. this.convertNum = 0.025;
  10451. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10452. this.scaleV3One = new Laya.Vector3();
  10453. this.scaleV3Two = new Laya.Vector3();
  10454. this.posV4 = new Laya.Vector4();
  10455. this.showDebug = false;
  10456. this.openGuide = true;
  10457. this.rodOffest = new Laya.Vector2(0, 0);
  10458. this.rodAngle = 0;
  10459. this.gameMode = GameMode.classic;
  10460. this.bigMoveLevelIndex = 1;
  10461. this.bigMoveNeedCoin = 1000;
  10462. this.classicNiceNeddCoin = 1000;
  10463. this.passAwardCoin = 2000;
  10464. this.classicRoomType = 1;
  10465. this.maxPower = 20;
  10466. this.natureMaxPower = 5;
  10467. this.videoPower = 2;
  10468. this.powerRecoverNum = 900;
  10469. this.curPlayerSkillType = 0;
  10470. this.isNewDay = false;
  10471. this.clickedBall = false;
  10472. this.placeBallCurLevel = 0;
  10473. this.placeBallStarNum = 0;
  10474. this.longHelpLine = false;
  10475. this.maxShareDiamondTimes = 3;
  10476. this.guideStep = 0;
  10477. this.temSelfLevel = 0;
  10478. this.extraMoveNum = 0;
  10479. this.curRankID = 0;
  10480. this.rankID = {
  10481. normalStar: 12000,
  10482. wxStar: 12001
  10483. };
  10484. this.skillNameList = ["从天而降", "横扫千军", "冰冻杆法", "关公杆法"];
  10485. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4", "gf_jn6"];
  10486. this.btnClickStr = "buttonclick";
  10487. this.maxSkillLevel = 10;
  10488. this.upSkillLevel = false;
  10489. this.gameStartTime = 0;
  10490. this._sysOffestNum = 0;
  10491. this.angleV2 = new Laya.Vector2();
  10492. this.rootV = new Laya.Vector2(0, 1);
  10493. this.tempDir1 = new Laya.Vector2();
  10494. this.tempDir2 = new Laya.Vector2();
  10495. this.ballSize = 33;
  10496. this.stPos = new Laya.Point();
  10497. this.edPos = new Laya.Point();
  10498. Common._instance = this;
  10499. window["common"] = this;
  10500. }
  10501. static getInstance() {
  10502. if (!this._instance) {
  10503. this._instance = new Common();
  10504. }
  10505. return this._instance;
  10506. }
  10507. get sysOffestNum() {
  10508. if (this._sysOffestNum == 0) {
  10509. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10510. }
  10511. return this._sysOffestNum;
  10512. }
  10513. testShader() {
  10514. let test = new LightShader();
  10515. test.texture = "res/d3Res/ballTexture/ball1.png";
  10516. Laya.stage.addChild(test);
  10517. }
  10518. playScale(node) {
  10519. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10520. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10521. }));
  10522. }));
  10523. }
  10524. setGroup(colli, ...group) {
  10525. let out = 0;
  10526. for (let index = 0; index < group.length; index++) {
  10527. if (index == 0) {
  10528. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10529. }
  10530. else {
  10531. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10532. }
  10533. }
  10534. colli.collisionGroup = out;
  10535. }
  10536. setCanGroupWith(colli, ...group) {
  10537. let out = 0;
  10538. for (let index = 0; index < group.length; index++) {
  10539. if (index == 0) {
  10540. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10541. }
  10542. else {
  10543. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10544. }
  10545. }
  10546. colli.canCollideWith = out;
  10547. }
  10548. loadPrefab(name, callback) {
  10549. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10550. let prefab = new Laya.Prefab();
  10551. prefab.json = obj;
  10552. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10553. callback && callback(img);
  10554. }));
  10555. }
  10556. pos2to3Convert(x, y, d3Pos) {
  10557. x = x + this.sysOffestNum;
  10558. d3Pos.setValue(x, y, 0);
  10559. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10560. if (success) {
  10561. }
  10562. else {
  10563. console.error("转换出错了。。。。。。。。");
  10564. }
  10565. }
  10566. scale2to3Convert(num) {
  10567. this.scaleV3One.setValue(0, 0, 0);
  10568. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10569. this.scaleV3Two.setValue(0, num, 0);
  10570. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10571. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10572. return outNum;
  10573. }
  10574. pos3to2Convert(d3Pos) {
  10575. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10576. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10577. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10578. d3Pos.x -= this.sysOffestNum;
  10579. }
  10580. scale3to2Convert(num) {
  10581. let scale = this.scale2to3Convert(1);
  10582. let d2Out = num / scale;
  10583. return d2Out;
  10584. }
  10585. getCollider(type, restitution = 0.9, density = 10) {
  10586. let colli;
  10587. if (type == "box")
  10588. colli = new Laya.BoxCollider();
  10589. else
  10590. colli = new Laya.CircleCollider();
  10591. colli.friction = 0;
  10592. colli.restitution = restitution;
  10593. colli.density = density;
  10594. return colli;
  10595. }
  10596. getRigbody() {
  10597. let rigy = new Laya.RigidBody();
  10598. rigy.bullet = true;
  10599. rigy.allowRotation = false;
  10600. rigy.allowSleep = false;
  10601. rigy.gravityScale = 0;
  10602. return rigy;
  10603. }
  10604. getfguiRotation(x, y) {
  10605. this.angleV2.setValue(x, y);
  10606. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10607. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10608. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10609. angle = -angle;
  10610. }
  10611. return 180 + angle;
  10612. }
  10613. getAngle(x, y) {
  10614. this.angleV2.setValue(x, y);
  10615. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10616. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10617. return angle;
  10618. }
  10619. randomNum(a, b) {
  10620. return a + Math.floor((b - a + 1) * Math.random());
  10621. }
  10622. getRandArrEle(arr) {
  10623. return arr[Math.floor(arr.length * Math.random())];
  10624. }
  10625. getSign(val) {
  10626. return val >= 0 ? 1 : -1;
  10627. }
  10628. botherArr(arr) {
  10629. let times = arr.length + 2;
  10630. let length = arr.length;
  10631. let a;
  10632. let b;
  10633. let temp;
  10634. for (let index = 0; index < times; index++) {
  10635. a = Math.floor(Math.random() * length);
  10636. b = Math.floor(Math.random() * length);
  10637. temp = arr[a];
  10638. arr[a] = arr[b];
  10639. arr[b] = temp;
  10640. }
  10641. }
  10642. getGameIconUrl(id) {
  10643. return "ui://game/" + id;
  10644. }
  10645. getComponentUrl(id) {
  10646. return "ui://game/" + id;
  10647. }
  10648. getAnimation() {
  10649. }
  10650. judgeSkillType(type = SkillType.highSpace) {
  10651. if (this.gameMode == GameMode.classic)
  10652. return;
  10653. let gameMgr = this.gameMgr;
  10654. if (gameMgr.selfTurn) {
  10655. if (gameMgr.selfCurSkill == type) {
  10656. return true;
  10657. }
  10658. }
  10659. else {
  10660. if (gameMgr.aiCurSkill == type) {
  10661. return true;
  10662. }
  10663. }
  10664. }
  10665. ballColliHole(collider) {
  10666. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10667. xGame.common.gameMgr.isFirstInGame = false;
  10668. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10669. }
  10670. collider.owner.mySrc.checkWrongBall();
  10671. }
  10672. getArrMaxEle(arr) {
  10673. let max = -Infinity;
  10674. for (let index = 0; index < arr.length; index++) {
  10675. max = Math.max(arr[index], max);
  10676. }
  10677. return max;
  10678. }
  10679. getArrMinEle(arr) {
  10680. let min = Infinity;
  10681. for (let index = 0; index < arr.length; index++) {
  10682. min = Math.min(arr[index], min);
  10683. }
  10684. return min;
  10685. }
  10686. playRandomMutiBallBigSkillSound() {
  10687. if (Math.random() <= 0.5)
  10688. return;
  10689. let rand = this.randomNum(1, 6);
  10690. let str = "ganfa0" + rand;
  10691. xGame.soundMgr.playSound(str);
  10692. }
  10693. showOneCamera(type) {
  10694. let object = xGame.common.d3World.cameraObj;
  10695. for (const key in object) {
  10696. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10697. object[key].init();
  10698. object[key].owner.active = key == type;
  10699. }
  10700. }
  10701. }
  10702. checkBallOverBorder(x, y) {
  10703. let radius = 17;
  10704. let condition = this._checkBorder(x + radius, y) ||
  10705. this._checkBorder(x - radius, y) ||
  10706. this._checkBorder(x, y + radius) ||
  10707. this._checkBorder(x, y - radius);
  10708. if (condition) {
  10709. return true;
  10710. }
  10711. }
  10712. _checkBorder(x, y) {
  10713. let borderRect = this.d2World.borderRect;
  10714. let xOffest = 20;
  10715. let yOffest = 20;
  10716. if (y <= borderRect.y - yOffest) {
  10717. return true;
  10718. }
  10719. if (y >= borderRect.y + borderRect.height + yOffest) {
  10720. return true;
  10721. }
  10722. if (x <= borderRect.x - xOffest) {
  10723. return true;
  10724. }
  10725. if (x >= borderRect.x + borderRect.width + xOffest) {
  10726. return true;
  10727. }
  10728. }
  10729. initWeight(cfg) {
  10730. let allCfgData = { data: {}, allWeightNum: 0 };
  10731. let weightCfg = allCfgData.data;
  10732. let weight = 0;
  10733. for (const key in cfg) {
  10734. weightCfg[key] = {};
  10735. weightCfg[key].id = cfg[key].id;
  10736. weightCfg[key].minWeight = weight;
  10737. weight += cfg[key].weight;
  10738. weightCfg[key].maxWeight = weight;
  10739. }
  10740. allCfgData.allWeightNum = weight;
  10741. return allCfgData;
  10742. }
  10743. getRandomWeightData(cfg) {
  10744. let weightCfg = cfg.data;
  10745. let allWeightNum = cfg.allWeightNum;
  10746. let rand = Math.floor(Math.random() * allWeightNum);
  10747. for (const key in weightCfg) {
  10748. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10749. return weightCfg[key];
  10750. }
  10751. }
  10752. return weightCfg[1];
  10753. }
  10754. showGirlTalkPop(wordsIndex, node, msgNode) {
  10755. node.visible = true;
  10756. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10757. node.t0.play(Laya.Handler.create(this, () => {
  10758. node.visible = false;
  10759. }));
  10760. }
  10761. stopGirlPop(node) {
  10762. node.t0.stop();
  10763. node.visible = false;
  10764. }
  10765. createHead(loader, url, size = 107) {
  10766. if (Laya.Browser.name == "Browser") {
  10767. loader.url = url;
  10768. return;
  10769. }
  10770. if (Moyu.isTT) {
  10771. let localImage = new Image();
  10772. localImage.src = url;
  10773. localImage.onload = () => {
  10774. let t2d = new Laya.Texture2D();
  10775. t2d.width = size;
  10776. t2d.height = size;
  10777. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10778. t2d.loadImageSource(localImage);
  10779. };
  10780. }
  10781. else {
  10782. loader.url = url;
  10783. }
  10784. }
  10785. addTestCoin(num) {
  10786. DataMgr.setCoin(num);
  10787. }
  10788. addTestDiamond(num) {
  10789. DataMgr.setDiamond(num);
  10790. }
  10791. addTestSkill() {
  10792. DataMgr.setBigSkill(0, 99);
  10793. DataMgr.setBigSkill(1, 99);
  10794. DataMgr.setBigSkill(2, 99);
  10795. }
  10796. playClassicEmotion(number, x, y) {
  10797. if (this.gameMode == GameMode.bigMove)
  10798. return;
  10799. let randIndex = this.randomNum(0, 2);
  10800. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10801. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10802. if (this.gameMgr.selfTurn) {
  10803. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10804. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10805. }
  10806. else {
  10807. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10808. }
  10809. else {
  10810. if (number == this.gameMgr.blackNum) {
  10811. if (this.gameMgr.selfBallArr.length == 0) {
  10812. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10813. }
  10814. else {
  10815. }
  10816. }
  10817. else {
  10818. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10819. }
  10820. }
  10821. }
  10822. }
  10823. else {
  10824. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10825. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10826. }
  10827. else {
  10828. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10829. }
  10830. else {
  10831. if (number == this.gameMgr.blackNum) {
  10832. if (this.gameMgr.aiBallArr.length == 0) {
  10833. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10834. }
  10835. else {
  10836. }
  10837. }
  10838. else {
  10839. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10840. }
  10841. }
  10842. }
  10843. }
  10844. }
  10845. playHappySound(number) {
  10846. if (this.gameMode != GameMode.classic)
  10847. return;
  10848. if (number == 8)
  10849. return;
  10850. let play = false;
  10851. if (this.gameMgr.selfTurn) {
  10852. if (this.gameMgr.ensureBallType) {
  10853. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10854. play = true;
  10855. }
  10856. }
  10857. else {
  10858. play = true;
  10859. }
  10860. }
  10861. else {
  10862. if (this.gameMgr.ensureBallType) {
  10863. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10864. play = true;
  10865. }
  10866. }
  10867. else {
  10868. play = true;
  10869. }
  10870. }
  10871. if (play)
  10872. xGame.soundMgr.playSound("applause");
  10873. }
  10874. destroyClassicEmotion() {
  10875. if (this.gameMode == GameMode.bigMove)
  10876. return;
  10877. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10878. parent.destroyChildren();
  10879. }
  10880. playAwardSpine(x, y) {
  10881. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10882. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10883. this.awardSpine.play(data, 0, false, parent);
  10884. }
  10885. destroyAwardSpine() {
  10886. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10887. parent.destroyChildren();
  10888. }
  10889. isBlock(bx, by, hx, hy, except = null) {
  10890. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10891. let balls = xGame.common.d2World.ballArr;
  10892. let outArr = [];
  10893. for (let index = 0; index < balls.length; index++) {
  10894. let obj = balls[index];
  10895. if (obj.number == 0)
  10896. continue;
  10897. if (obj == except)
  10898. continue;
  10899. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10900. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10901. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10902. if (num >= 1)
  10903. num = 1;
  10904. if (num < 0)
  10905. continue;
  10906. let gap = Math.sin(Math.acos(num)) * dis;
  10907. if (gap < this.ballSize) {
  10908. outArr.push({
  10909. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10910. disHon: Math.cos(Math.acos(num)) * dis,
  10911. disVer: Math.sin(Math.acos(num)) * dis,
  10912. src: balls[index],
  10913. dir: this.tempDir1
  10914. });
  10915. }
  10916. }
  10917. if (outArr.length > 0) {
  10918. outArr.sort((a, b) => { return a.dis - b.dis; });
  10919. return outArr[0];
  10920. }
  10921. }
  10922. AngleBetween(vector1, vector2) {
  10923. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10924. return rad * (180 / Math.PI);
  10925. }
  10926. getSecretaryScale() {
  10927. if (this.secretary.spineName == "mishu") {
  10928. return 1.28;
  10929. }
  10930. else {
  10931. return 1.024;
  10932. }
  10933. }
  10934. signAwardContainsRod(arr) {
  10935. let temp;
  10936. for (let index = 0; index < arr.length; index++) {
  10937. temp = arr[index].split('-')[0];
  10938. if (parseInt(temp) > 2) {
  10939. return true;
  10940. }
  10941. }
  10942. }
  10943. judgeSameDay() {
  10944. let lastTime = DataMgr.getSignTime();
  10945. let curTime = new Date().getTime();
  10946. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10947. return true;
  10948. }
  10949. return false;
  10950. }
  10951. getAward(arr, callback) {
  10952. let showTriple = arr[0].type <= 2;
  10953. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10954. let temp;
  10955. for (let index = 0; index < arr.length; index++) {
  10956. temp = arr[index];
  10957. switch (temp.type) {
  10958. case 1:
  10959. this.playObjFlyAnim(temp.num, temp.type);
  10960. break;
  10961. case 2:
  10962. this.playObjFlyAnim(temp.num, temp.type);
  10963. break;
  10964. case 3:
  10965. case 4:
  10966. case 5:
  10967. case 6:
  10968. DataMgr.setBallRod(temp.type - 2, 1);
  10969. DataMgr.setCurBallRod(temp.type - 2);
  10970. break;
  10971. default:
  10972. break;
  10973. }
  10974. }
  10975. callback && callback(watchVideo);
  10976. });
  10977. }
  10978. getMoneyNode() {
  10979. let moneyNode;
  10980. let sign = xGame.uiMgr.getUI(UISign);
  10981. let draw = xGame.uiMgr.getUI(UIDraw);
  10982. let end = xGame.uiMgr.getUI(UIGameEnd);
  10983. let skill = xGame.uiMgr.getUI(UISkill);
  10984. if (sign && !sign.isHide)
  10985. moneyNode = sign.ui.moneyNode;
  10986. if (draw && !draw.isHide)
  10987. moneyNode = draw.ui.moneyNode;
  10988. if (end && !end.isHide)
  10989. moneyNode = end.ui.moneyNode;
  10990. if (skill && !skill.isHide)
  10991. moneyNode = skill.ui.moneyNode;
  10992. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  10993. let main = xGame.uiMgr.getUI(UIMain);
  10994. if (condition1 && main && !main.isHide) {
  10995. moneyNode = main.ui.moneyNode;
  10996. }
  10997. return moneyNode;
  10998. }
  10999. playObjFlyAnim(num, type, callback = null) {
  11000. this.stPos.x = Laya.stage.width / 2;
  11001. this.stPos.y = Laya.stage.height / 2;
  11002. let moneyNode = this.getMoneyNode();
  11003. switch (type) {
  11004. case Prop.diamond:
  11005. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11006. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11007. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11008. this.edPos.x /= 2;
  11009. this.edPos.y /= 2;
  11010. break;
  11011. case Prop.coin:
  11012. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11013. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11014. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11015. this.edPos.x /= 2;
  11016. this.edPos.y /= 2;
  11017. break;
  11018. default:
  11019. break;
  11020. }
  11021. xGame.soundMgr.playSound("coinbag");
  11022. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11023. switch (type) {
  11024. case Prop.diamond:
  11025. DataMgr.setDiamond(num);
  11026. break;
  11027. case Prop.coin:
  11028. DataMgr.setCoin(num);
  11029. break;
  11030. default:
  11031. break;
  11032. }
  11033. callback && callback();
  11034. });
  11035. }
  11036. autoPopUIView() {
  11037. let arr = [];
  11038. let sign = this.judgeSameDay() ? false : true;
  11039. if (sign)
  11040. arr.push("sign");
  11041. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11042. if (draw)
  11043. arr.push("draw");
  11044. if (arr.length <= 0)
  11045. return;
  11046. let str = this.getRandArrEle(arr);
  11047. switch (str) {
  11048. case "sign":
  11049. xGame.uiMgr.Show(UISign);
  11050. break;
  11051. case "draw":
  11052. xGame.uiMgr.Show(UIDraw);
  11053. break;
  11054. default:
  11055. break;
  11056. }
  11057. }
  11058. getMSTime(time) {
  11059. let min = Math.floor(time / 60);
  11060. let sec = Math.floor((time - min * 60));
  11061. if (sec < 10)
  11062. sec = "0" + sec;
  11063. if (min < 10)
  11064. min = "0" + min;
  11065. return `${min}:${sec}`;
  11066. }
  11067. testPower() {
  11068. DataMgr.setPower(0, false);
  11069. }
  11070. getAllStarNum() {
  11071. let data = DataMgr.getPlaceBallLevelList();
  11072. let out = 0;
  11073. for (let index = 0; index < data.length; index++) {
  11074. out += data[index].star;
  11075. }
  11076. return out;
  11077. }
  11078. recoverCameraView() {
  11079. Laya.timer.once(900, this, () => {
  11080. xGame.common.showOneCamera("mainCamera");
  11081. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11082. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11083. xGame.common.gameUI.ui.border.alpha = 0;
  11084. if (Laya.physicsTimer.scale < 1) {
  11085. Laya.physicsTimer.scale = 1;
  11086. }
  11087. }
  11088. });
  11089. }
  11090. getClassicLevel() {
  11091. let successTimes = DataMgr.getClassicTimes();
  11092. let needKey = "";
  11093. let lastKey = "";
  11094. let cfg = cfgTable.classictimesData;
  11095. let data;
  11096. for (const key in cfg) {
  11097. data = cfg[key];
  11098. if (successTimes <= data.times) {
  11099. needKey = key;
  11100. }
  11101. lastKey = key;
  11102. }
  11103. if (needKey == "")
  11104. needKey = lastKey;
  11105. return cfg[needKey];
  11106. }
  11107. }
  11108. Common._instance = null;
  11109. class ui_Component92 extends fgui.GComponent {
  11110. static createInstance() {
  11111. return (fgui.UIPackage.createObject("game", "Component92"));
  11112. }
  11113. onConstruct() {
  11114. this.n0 = (this.getChild("n0"));
  11115. }
  11116. }
  11117. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11118. class ui_Component129 extends fgui.GProgressBar {
  11119. static createInstance() {
  11120. return (fgui.UIPackage.createObject("game", "Component129"));
  11121. }
  11122. onConstruct() {
  11123. this.bar_v = (this.getChild("bar_v"));
  11124. this.n84 = (this.getChild("n84"));
  11125. }
  11126. }
  11127. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11128. class ui_Component130 extends fgui.GComponent {
  11129. static createInstance() {
  11130. return (fgui.UIPackage.createObject("game", "Component130"));
  11131. }
  11132. onConstruct() {
  11133. this.ani = (this.getChild("ani"));
  11134. this.t0 = this.getTransition("t0");
  11135. }
  11136. }
  11137. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11138. class ui_powerEft extends fgui.GComponent {
  11139. static createInstance() {
  11140. return (fgui.UIPackage.createObject("game", "powerEft"));
  11141. }
  11142. onConstruct() {
  11143. this.ani = (this.getChild("ani"));
  11144. this.n88 = (this.getChild("n88"));
  11145. this.n89 = (this.getChild("n89"));
  11146. }
  11147. }
  11148. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11149. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11150. static createInstance() {
  11151. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11152. }
  11153. onConstruct() {
  11154. this.c1 = this.getController("c1");
  11155. this.n2 = (this.getChild("n2"));
  11156. this.n22 = (this.getChild("n22"));
  11157. this.n23 = (this.getChild("n23"));
  11158. this.n15 = (this.getChild("n15"));
  11159. this.challenge = (this.getChild("challenge"));
  11160. this.n17 = (this.getChild("n17"));
  11161. this.n3 = (this.getChild("n3"));
  11162. this.starNode = (this.getChild("starNode"));
  11163. this.levelTxt = (this.getChild("levelTxt"));
  11164. this.n14 = (this.getChild("n14"));
  11165. this.n19 = (this.getChild("n19"));
  11166. this.n20 = (this.getChild("n20"));
  11167. this.n21 = (this.getChild("n21"));
  11168. this.special = (this.getChild("special"));
  11169. }
  11170. }
  11171. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11172. class ui_Component79 extends fgui.GComponent {
  11173. static createInstance() {
  11174. return (fgui.UIPackage.createObject("game", "Component79"));
  11175. }
  11176. onConstruct() {
  11177. this.c1 = this.getController("c1");
  11178. this.n7 = (this.getChild("n7"));
  11179. this.n8 = (this.getChild("n8"));
  11180. this.n9 = (this.getChild("n9"));
  11181. this.n10 = (this.getChild("n10"));
  11182. this.n11 = (this.getChild("n11"));
  11183. this.n12 = (this.getChild("n12"));
  11184. }
  11185. }
  11186. ui_Component79.URL = "ui://isxx5ak7avag477";
  11187. class ui_Component80 extends fgui.GComponent {
  11188. static createInstance() {
  11189. return (fgui.UIPackage.createObject("game", "Component80"));
  11190. }
  11191. onConstruct() {
  11192. this.n0 = (this.getChild("n0"));
  11193. this.n1 = (this.getChild("n1"));
  11194. this.myList = (this.getChild("myList"));
  11195. this.t0 = this.getTransition("t0");
  11196. }
  11197. }
  11198. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11199. class ui_SignNormal extends fgui.GComponent {
  11200. static createInstance() {
  11201. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11202. }
  11203. onConstruct() {
  11204. this.c1 = this.getController("c1");
  11205. this.n7 = (this.getChild("n7"));
  11206. this.n15 = (this.getChild("n15"));
  11207. this.titleTxt = (this.getChild("titleTxt"));
  11208. this.n8 = (this.getChild("n8"));
  11209. this.myIcon = (this.getChild("myIcon"));
  11210. this.numTxt = (this.getChild("numTxt"));
  11211. this.n12 = (this.getChild("n12"));
  11212. this.n13 = (this.getChild("n13"));
  11213. this.n17 = (this.getChild("n17"));
  11214. this.n14 = (this.getChild("n14"));
  11215. }
  11216. }
  11217. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11218. class ui_screenNode extends fgui.GComponent {
  11219. static createInstance() {
  11220. return (fgui.UIPackage.createObject("game", "screenNode"));
  11221. }
  11222. onConstruct() {
  11223. this.n9 = (this.getChild("n9"));
  11224. this.screenImg = (this.getChild("screenImg"));
  11225. }
  11226. }
  11227. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11228. class ui_GetAwrad_com1 extends fgui.GComponent {
  11229. static createInstance() {
  11230. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11231. }
  11232. onConstruct() {
  11233. this.n38 = (this.getChild("n38"));
  11234. this.n39 = (this.getChild("n39"));
  11235. this.n40 = (this.getChild("n40"));
  11236. this.t0 = this.getTransition("t0");
  11237. this.t1 = this.getTransition("t1");
  11238. }
  11239. }
  11240. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11241. class ui_GetAwrad_com2 extends fgui.GComponent {
  11242. static createInstance() {
  11243. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11244. }
  11245. onConstruct() {
  11246. this.n39 = (this.getChild("n39"));
  11247. this.n40 = (this.getChild("n40"));
  11248. this.t0 = this.getTransition("t0");
  11249. }
  11250. }
  11251. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11252. class ui_Component128 extends fgui.GComponent {
  11253. static createInstance() {
  11254. return (fgui.UIPackage.createObject("game", "Component128"));
  11255. }
  11256. onConstruct() {
  11257. this.n38 = (this.getChild("n38"));
  11258. this.n40 = (this.getChild("n40"));
  11259. }
  11260. }
  11261. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11262. class ui_Component100_1 extends fgui.GComponent {
  11263. static createInstance() {
  11264. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11265. }
  11266. onConstruct() {
  11267. this.myNode = (this.getChild("myNode"));
  11268. this.t0 = this.getTransition("t0");
  11269. }
  11270. }
  11271. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11272. class ui_Component142 extends fgui.GComponent {
  11273. static createInstance() {
  11274. return (fgui.UIPackage.createObject("game", "Component142"));
  11275. }
  11276. onConstruct() {
  11277. this.n41 = (this.getChild("n41"));
  11278. this.n42 = (this.getChild("n42"));
  11279. }
  11280. }
  11281. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11282. class ui_main_guang extends fgui.GComponent {
  11283. static createInstance() {
  11284. return (fgui.UIPackage.createObject("game", "main_guang"));
  11285. }
  11286. onConstruct() {
  11287. this.n1 = (this.getChild("n1"));
  11288. this.n2 = (this.getChild("n2"));
  11289. this.n3 = (this.getChild("n3"));
  11290. this.n4 = (this.getChild("n4"));
  11291. this.n5 = (this.getChild("n5"));
  11292. this.n6 = (this.getChild("n6"));
  11293. this.n8 = (this.getChild("n8"));
  11294. this.t0 = this.getTransition("t0");
  11295. }
  11296. }
  11297. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11298. class ui_try_com1 extends fgui.GComponent {
  11299. static createInstance() {
  11300. return (fgui.UIPackage.createObject("game", "try_com1"));
  11301. }
  11302. onConstruct() {
  11303. this.c1 = this.getController("c1");
  11304. this.n0 = (this.getChild("n0"));
  11305. this.n2 = (this.getChild("n2"));
  11306. this.cancelBtn = (this.getChild("cancelBtn"));
  11307. this.videoBtn = (this.getChild("videoBtn"));
  11308. this.n9 = (this.getChild("n9"));
  11309. this.n24 = (this.getChild("n24"));
  11310. this.titleTxt = (this.getChild("titleTxt"));
  11311. this.n32 = (this.getChild("n32"));
  11312. this.n29 = (this.getChild("n29"));
  11313. this.n36 = (this.getChild("n36"));
  11314. this.txtTime = (this.getChild("txtTime"));
  11315. this.t0 = this.getTransition("t0");
  11316. }
  11317. }
  11318. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11319. class ui_try_com2 extends fgui.GComponent {
  11320. static createInstance() {
  11321. return (fgui.UIPackage.createObject("game", "try_com2"));
  11322. }
  11323. onConstruct() {
  11324. this.skillicon = (this.getChild("skillicon"));
  11325. this.n35 = (this.getChild("n35"));
  11326. this.n31 = (this.getChild("n31"));
  11327. this.n32 = (this.getChild("n32"));
  11328. this.n33 = (this.getChild("n33"));
  11329. this.n34 = (this.getChild("n34"));
  11330. }
  11331. }
  11332. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11333. class ui_try_com3 extends fgui.GComponent {
  11334. static createInstance() {
  11335. return (fgui.UIPackage.createObject("game", "try_com3"));
  11336. }
  11337. onConstruct() {
  11338. this.n33 = (this.getChild("n33"));
  11339. this.n34 = (this.getChild("n34"));
  11340. this.n35 = (this.getChild("n35"));
  11341. this.t0 = this.getTransition("t0");
  11342. }
  11343. }
  11344. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11345. class ui_Component121 extends fgui.GButton {
  11346. static createInstance() {
  11347. return (fgui.UIPackage.createObject("game", "Component121"));
  11348. }
  11349. onConstruct() {
  11350. this.n3 = (this.getChild("n3"));
  11351. this.t0 = this.getTransition("t0");
  11352. }
  11353. }
  11354. ui_Component121.URL = "ui://isxx5ak7cy72v4ib";
  11355. class ui_huihe1 extends fgui.GComponent {
  11356. static createInstance() {
  11357. return (fgui.UIPackage.createObject("game", "huihe1"));
  11358. }
  11359. onConstruct() {
  11360. this.n0 = (this.getChild("n0"));
  11361. this.n1 = (this.getChild("n1"));
  11362. this.t0 = this.getTransition("t0");
  11363. }
  11364. }
  11365. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11366. class ui_huihe2 extends fgui.GComponent {
  11367. static createInstance() {
  11368. return (fgui.UIPackage.createObject("game", "huihe2"));
  11369. }
  11370. onConstruct() {
  11371. this.n0 = (this.getChild("n0"));
  11372. this.n1 = (this.getChild("n1"));
  11373. this.t0 = this.getTransition("t0");
  11374. }
  11375. }
  11376. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11377. class ui_Component143 extends fgui.GComponent {
  11378. static createInstance() {
  11379. return (fgui.UIPackage.createObject("game", "Component143"));
  11380. }
  11381. onConstruct() {
  11382. this.n3 = (this.getChild("n3"));
  11383. this.n4 = (this.getChild("n4"));
  11384. this.n5 = (this.getChild("n5"));
  11385. this.n6 = (this.getChild("n6"));
  11386. this.n7 = (this.getChild("n7"));
  11387. this.n8 = (this.getChild("n8"));
  11388. this.n9 = (this.getChild("n9"));
  11389. this.n10 = (this.getChild("n10"));
  11390. this.t0 = this.getTransition("t0");
  11391. }
  11392. }
  11393. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11394. class ui_dh_jingbi2 extends fgui.GComponent {
  11395. static createInstance() {
  11396. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11397. }
  11398. onConstruct() {
  11399. this.n0 = (this.getChild("n0"));
  11400. this.n1 = (this.getChild("n1"));
  11401. this.n2 = (this.getChild("n2"));
  11402. this.n3 = (this.getChild("n3"));
  11403. this.n4 = (this.getChild("n4"));
  11404. this.n5 = (this.getChild("n5"));
  11405. this.n6 = (this.getChild("n6"));
  11406. this.n8 = (this.getChild("n8"));
  11407. this.n10 = (this.getChild("n10"));
  11408. this.t0 = this.getTransition("t0");
  11409. }
  11410. }
  11411. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11412. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11413. static createInstance() {
  11414. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11415. }
  11416. onConstruct() {
  11417. this.n1 = (this.getChild("n1"));
  11418. this.n4 = (this.getChild("n4"));
  11419. this.t0 = this.getTransition("t0");
  11420. }
  11421. }
  11422. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11423. class ui_dh_jingbi3 extends fgui.GComponent {
  11424. static createInstance() {
  11425. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11426. }
  11427. onConstruct() {
  11428. this.n0 = (this.getChild("n0"));
  11429. this.n1 = (this.getChild("n1"));
  11430. this.n2 = (this.getChild("n2"));
  11431. this.n3 = (this.getChild("n3"));
  11432. this.n4 = (this.getChild("n4"));
  11433. this.n5 = (this.getChild("n5"));
  11434. this.n6 = (this.getChild("n6"));
  11435. this.n8 = (this.getChild("n8"));
  11436. this.n10 = (this.getChild("n10"));
  11437. this.t0 = this.getTransition("t0");
  11438. }
  11439. }
  11440. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11441. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11442. static createInstance() {
  11443. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11444. }
  11445. onConstruct() {
  11446. this.n3 = (this.getChild("n3"));
  11447. this.n1 = (this.getChild("n1"));
  11448. this.t0 = this.getTransition("t0");
  11449. }
  11450. }
  11451. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11452. class ui_hb_jinbi1 extends fgui.GButton {
  11453. static createInstance() {
  11454. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11455. }
  11456. onConstruct() {
  11457. this.n20 = (this.getChild("n20"));
  11458. this.n25 = (this.getChild("n25"));
  11459. this.coinTxt = (this.getChild("coinTxt"));
  11460. this.n28 = (this.getChild("n28"));
  11461. this.n32 = (this.getChild("n32"));
  11462. this.n38 = (this.getChild("n38"));
  11463. this.n45 = (this.getChild("n45"));
  11464. this.getTips = (this.getChild("getTips"));
  11465. this.n39 = (this.getChild("n39"));
  11466. this.diamondTxt = (this.getChild("diamondTxt"));
  11467. this.n41 = (this.getChild("n41"));
  11468. this.n42 = (this.getChild("n42"));
  11469. this.n46 = (this.getChild("n46"));
  11470. this.n47 = (this.getChild("n47"));
  11471. this.n48 = (this.getChild("n48"));
  11472. this.t0 = this.getTransition("t0");
  11473. }
  11474. }
  11475. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11476. class ui_hb_jinbi2 extends fgui.GButton {
  11477. static createInstance() {
  11478. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11479. }
  11480. onConstruct() {
  11481. this.n20 = (this.getChild("n20"));
  11482. this.n25 = (this.getChild("n25"));
  11483. this.coinTxt = (this.getChild("coinTxt"));
  11484. this.n28 = (this.getChild("n28"));
  11485. this.n32 = (this.getChild("n32"));
  11486. this.n38 = (this.getChild("n38"));
  11487. this.n39 = (this.getChild("n39"));
  11488. this.diamondTxt = (this.getChild("diamondTxt"));
  11489. this.n41 = (this.getChild("n41"));
  11490. this.n42 = (this.getChild("n42"));
  11491. this.n43 = (this.getChild("n43"));
  11492. this.n44 = (this.getChild("n44"));
  11493. this.n45 = (this.getChild("n45"));
  11494. this.t0 = this.getTransition("t0");
  11495. }
  11496. }
  11497. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11498. class ui_hb_jinbi3 extends fgui.GButton {
  11499. static createInstance() {
  11500. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11501. }
  11502. onConstruct() {
  11503. this.n20 = (this.getChild("n20"));
  11504. this.n25 = (this.getChild("n25"));
  11505. this.coinTxt = (this.getChild("coinTxt"));
  11506. this.n28 = (this.getChild("n28"));
  11507. this.n32 = (this.getChild("n32"));
  11508. this.n38 = (this.getChild("n38"));
  11509. this.n39 = (this.getChild("n39"));
  11510. this.diamondTxt = (this.getChild("diamondTxt"));
  11511. this.n41 = (this.getChild("n41"));
  11512. this.n42 = (this.getChild("n42"));
  11513. this.n43 = (this.getChild("n43"));
  11514. this.n44 = (this.getChild("n44"));
  11515. this.n45 = (this.getChild("n45"));
  11516. this.t0 = this.getTransition("t0");
  11517. }
  11518. }
  11519. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11520. class ui_Component104 extends fgui.GComponent {
  11521. static createInstance() {
  11522. return (fgui.UIPackage.createObject("game", "Component104"));
  11523. }
  11524. onConstruct() {
  11525. this.c1 = this.getController("c1");
  11526. this.n12 = (this.getChild("n12"));
  11527. this.coinBtn = (this.getChild("coinBtn"));
  11528. this.diamondBtn = (this.getChild("diamondBtn"));
  11529. this.node3 = (this.getChild("node3"));
  11530. this.node4 = (this.getChild("node4"));
  11531. this.node5 = (this.getChild("node5"));
  11532. this.node1 = (this.getChild("node1"));
  11533. this.node2 = (this.getChild("node2"));
  11534. this.node6 = (this.getChild("node6"));
  11535. this.t0 = this.getTransition("t0");
  11536. }
  11537. }
  11538. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11539. class ui_Component105 extends fgui.GButton {
  11540. static createInstance() {
  11541. return (fgui.UIPackage.createObject("game", "Component105"));
  11542. }
  11543. onConstruct() {
  11544. this.c1 = this.getController("c1");
  11545. this.n49 = (this.getChild("n49"));
  11546. this.n18 = (this.getChild("n18"));
  11547. this.n46 = (this.getChild("n46"));
  11548. this.n48 = (this.getChild("n48"));
  11549. }
  11550. }
  11551. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11552. class ui_Component106 extends fgui.GButton {
  11553. static createInstance() {
  11554. return (fgui.UIPackage.createObject("game", "Component106"));
  11555. }
  11556. onConstruct() {
  11557. this.c1 = this.getController("c1");
  11558. this.n49 = (this.getChild("n49"));
  11559. this.n18 = (this.getChild("n18"));
  11560. this.n46 = (this.getChild("n46"));
  11561. this.n48 = (this.getChild("n48"));
  11562. }
  11563. }
  11564. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11565. class ui_hb_zs1 extends fgui.GButton {
  11566. static createInstance() {
  11567. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11568. }
  11569. onConstruct() {
  11570. this.c1 = this.getController("c1");
  11571. this.n20 = (this.getChild("n20"));
  11572. this.n21 = (this.getChild("n21"));
  11573. this.n26 = (this.getChild("n26"));
  11574. this.n27 = (this.getChild("n27"));
  11575. this.shareTxt = (this.getChild("shareTxt"));
  11576. this.n32 = (this.getChild("n32"));
  11577. this.n38 = (this.getChild("n38"));
  11578. this.n39 = (this.getChild("n39"));
  11579. this.n44 = (this.getChild("n44"));
  11580. this.diamondTxt = (this.getChild("diamondTxt"));
  11581. this.n41 = (this.getChild("n41"));
  11582. this.n45 = (this.getChild("n45"));
  11583. this.n47 = (this.getChild("n47"));
  11584. this.n48 = (this.getChild("n48"));
  11585. this.randTxt = (this.getChild("randTxt"));
  11586. this.n50 = (this.getChild("n50"));
  11587. this.t0 = this.getTransition("t0");
  11588. }
  11589. }
  11590. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11591. class ui_dh_zs1 extends fgui.GComponent {
  11592. static createInstance() {
  11593. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11594. }
  11595. onConstruct() {
  11596. this.n10 = (this.getChild("n10"));
  11597. this.n9 = (this.getChild("n9"));
  11598. this.n1 = (this.getChild("n1"));
  11599. this.n2 = (this.getChild("n2"));
  11600. this.n3 = (this.getChild("n3"));
  11601. this.n4 = (this.getChild("n4"));
  11602. this.n5 = (this.getChild("n5"));
  11603. this.n6 = (this.getChild("n6"));
  11604. this.n8 = (this.getChild("n8"));
  11605. this.n11 = (this.getChild("n11"));
  11606. this.t0 = this.getTransition("t0");
  11607. }
  11608. }
  11609. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11610. class ui_dh_zs1_1 extends fgui.GComponent {
  11611. static createInstance() {
  11612. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11613. }
  11614. onConstruct() {
  11615. this.n3 = (this.getChild("n3"));
  11616. this.n1 = (this.getChild("n1"));
  11617. this.t0 = this.getTransition("t0");
  11618. }
  11619. }
  11620. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11621. class ui_hb_zs2 extends fgui.GButton {
  11622. static createInstance() {
  11623. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11624. }
  11625. onConstruct() {
  11626. this.n20 = (this.getChild("n20"));
  11627. this.n21 = (this.getChild("n21"));
  11628. this.n26 = (this.getChild("n26"));
  11629. this.n27 = (this.getChild("n27"));
  11630. this.n32 = (this.getChild("n32"));
  11631. this.n38 = (this.getChild("n38"));
  11632. this.n39 = (this.getChild("n39"));
  11633. this.n44 = (this.getChild("n44"));
  11634. this.diamondTxt = (this.getChild("diamondTxt"));
  11635. this.n41 = (this.getChild("n41"));
  11636. this.n45 = (this.getChild("n45"));
  11637. this.t0 = this.getTransition("t0");
  11638. }
  11639. }
  11640. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11641. class ui_hb_zs3 extends fgui.GButton {
  11642. static createInstance() {
  11643. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11644. }
  11645. onConstruct() {
  11646. this.n20 = (this.getChild("n20"));
  11647. this.n21 = (this.getChild("n21"));
  11648. this.n26 = (this.getChild("n26"));
  11649. this.n27 = (this.getChild("n27"));
  11650. this.n32 = (this.getChild("n32"));
  11651. this.n38 = (this.getChild("n38"));
  11652. this.n47 = (this.getChild("n47"));
  11653. this.t0 = this.getTransition("t0");
  11654. }
  11655. }
  11656. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11657. class ui_dh_zs2 extends fgui.GComponent {
  11658. static createInstance() {
  11659. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11660. }
  11661. onConstruct() {
  11662. this.n10 = (this.getChild("n10"));
  11663. this.n9 = (this.getChild("n9"));
  11664. this.n1 = (this.getChild("n1"));
  11665. this.n2 = (this.getChild("n2"));
  11666. this.n3 = (this.getChild("n3"));
  11667. this.n4 = (this.getChild("n4"));
  11668. this.n5 = (this.getChild("n5"));
  11669. this.n6 = (this.getChild("n6"));
  11670. this.n8 = (this.getChild("n8"));
  11671. this.n11 = (this.getChild("n11"));
  11672. this.t0 = this.getTransition("t0");
  11673. }
  11674. }
  11675. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11676. class ui_dh_zs2_1 extends fgui.GComponent {
  11677. static createInstance() {
  11678. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11679. }
  11680. onConstruct() {
  11681. this.n3 = (this.getChild("n3"));
  11682. this.n1 = (this.getChild("n1"));
  11683. this.t0 = this.getTransition("t0");
  11684. }
  11685. }
  11686. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11687. class ui_dh_zs3 extends fgui.GComponent {
  11688. static createInstance() {
  11689. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11690. }
  11691. onConstruct() {
  11692. this.n10 = (this.getChild("n10"));
  11693. this.n9 = (this.getChild("n9"));
  11694. this.n1 = (this.getChild("n1"));
  11695. this.n2 = (this.getChild("n2"));
  11696. this.n3 = (this.getChild("n3"));
  11697. this.n4 = (this.getChild("n4"));
  11698. this.n5 = (this.getChild("n5"));
  11699. this.n6 = (this.getChild("n6"));
  11700. this.n8 = (this.getChild("n8"));
  11701. this.n11 = (this.getChild("n11"));
  11702. this.t0 = this.getTransition("t0");
  11703. }
  11704. }
  11705. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11706. class ui_dh_zs3_1 extends fgui.GComponent {
  11707. static createInstance() {
  11708. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11709. }
  11710. onConstruct() {
  11711. this.n3 = (this.getChild("n3"));
  11712. this.n1 = (this.getChild("n1"));
  11713. this.t0 = this.getTransition("t0");
  11714. }
  11715. }
  11716. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11717. class ui_Component107 extends fgui.GComponent {
  11718. static createInstance() {
  11719. return (fgui.UIPackage.createObject("game", "Component107"));
  11720. }
  11721. onConstruct() {
  11722. this.n18 = (this.getChild("n18"));
  11723. this.n19 = (this.getChild("n19"));
  11724. this.n20 = (this.getChild("n20"));
  11725. this.n21 = (this.getChild("n21"));
  11726. this.n22 = (this.getChild("n22"));
  11727. this.levelTxt = (this.getChild("levelTxt"));
  11728. this.t0 = this.getTransition("t0");
  11729. }
  11730. }
  11731. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11732. class ui_box_com1 extends fgui.GComponent {
  11733. static createInstance() {
  11734. return (fgui.UIPackage.createObject("game", "box_com1"));
  11735. }
  11736. onConstruct() {
  11737. this.n14 = (this.getChild("n14"));
  11738. this.n6 = (this.getChild("n6"));
  11739. this.t0 = this.getTransition("t0");
  11740. }
  11741. }
  11742. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11743. class ui_box_com2 extends fgui.GProgressBar {
  11744. static createInstance() {
  11745. return (fgui.UIPackage.createObject("game", "box_com2"));
  11746. }
  11747. onConstruct() {
  11748. this.bg0 = (this.getChild("bg0"));
  11749. this.bg = (this.getChild("bg"));
  11750. this.bar = (this.getChild("bar"));
  11751. this.n7 = (this.getChild("n7"));
  11752. this.n8 = (this.getChild("n8"));
  11753. this.n10 = (this.getChild("n10"));
  11754. this.n11 = (this.getChild("n11"));
  11755. this.n12 = (this.getChild("n12"));
  11756. }
  11757. }
  11758. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11759. class ui_box_com4 extends fgui.GComponent {
  11760. static createInstance() {
  11761. return (fgui.UIPackage.createObject("game", "box_com4"));
  11762. }
  11763. onConstruct() {
  11764. this.n8 = (this.getChild("n8"));
  11765. this.t0 = this.getTransition("t0");
  11766. }
  11767. }
  11768. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11769. class ui_box_com3 extends fgui.GComponent {
  11770. static createInstance() {
  11771. return (fgui.UIPackage.createObject("game", "box_com3"));
  11772. }
  11773. onConstruct() {
  11774. this.n2 = (this.getChild("n2"));
  11775. this.n3 = (this.getChild("n3"));
  11776. this.n4 = (this.getChild("n4"));
  11777. this.n5 = (this.getChild("n5"));
  11778. this.t0 = this.getTransition("t0");
  11779. this.t1 = this.getTransition("t1");
  11780. }
  11781. }
  11782. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11783. class ui_Component97 extends fgui.GComponent {
  11784. static createInstance() {
  11785. return (fgui.UIPackage.createObject("game", "Component97"));
  11786. }
  11787. onConstruct() {
  11788. this.c1 = this.getController("c1");
  11789. this.n46 = (this.getChild("n46"));
  11790. this.diamondNode = (this.getChild("diamondNode"));
  11791. this.coinNode = (this.getChild("coinNode"));
  11792. this.t0 = this.getTransition("t0");
  11793. }
  11794. }
  11795. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11796. class ui_Component98 extends fgui.GButton {
  11797. static createInstance() {
  11798. return (fgui.UIPackage.createObject("game", "Component98"));
  11799. }
  11800. onConstruct() {
  11801. this.n8 = (this.getChild("n8"));
  11802. this.n40 = (this.getChild("n40"));
  11803. }
  11804. }
  11805. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11806. class ui_Component28_11 extends fgui.GButton {
  11807. static createInstance() {
  11808. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11809. }
  11810. onConstruct() {
  11811. this.c1 = this.getController("c1");
  11812. this.n12 = (this.getChild("n12"));
  11813. this.n17 = (this.getChild("n17"));
  11814. this.n13 = (this.getChild("n13"));
  11815. this.diamondTxt = (this.getChild("diamondTxt"));
  11816. this.n15 = (this.getChild("n15"));
  11817. this.n16 = (this.getChild("n16"));
  11818. }
  11819. }
  11820. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11821. class ui_Component58_11 extends fgui.GComponent {
  11822. static createInstance() {
  11823. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11824. }
  11825. onConstruct() {
  11826. this.n23 = (this.getChild("n23"));
  11827. this.n41 = (this.getChild("n41"));
  11828. this.myList = (this.getChild("myList"));
  11829. this.n45 = (this.getChild("n45"));
  11830. this.n44 = (this.getChild("n44"));
  11831. this.t0 = this.getTransition("t0");
  11832. }
  11833. }
  11834. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11835. class ui_Component100 extends fgui.GComponent {
  11836. static createInstance() {
  11837. return (fgui.UIPackage.createObject("game", "Component100"));
  11838. }
  11839. onConstruct() {
  11840. this.c1 = this.getController("c1");
  11841. this.n75 = (this.getChild("n75"));
  11842. this.n76 = (this.getChild("n76"));
  11843. this.n80 = (this.getChild("n80"));
  11844. this.txt = (this.getChild("txt"));
  11845. this.spineRoot = (this.getChild("spineRoot"));
  11846. }
  11847. }
  11848. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11849. class ui_Component101 extends fgui.GComponent {
  11850. static createInstance() {
  11851. return (fgui.UIPackage.createObject("game", "Component101"));
  11852. }
  11853. onConstruct() {
  11854. this.c1 = this.getController("c1");
  11855. this.n36 = (this.getChild("n36"));
  11856. this.n35 = (this.getChild("n35"));
  11857. this.n33 = (this.getChild("n33"));
  11858. this.n34 = (this.getChild("n34"));
  11859. }
  11860. }
  11861. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11862. class ui_Component53 extends fgui.GComponent {
  11863. static createInstance() {
  11864. return (fgui.UIPackage.createObject("game", "Component53"));
  11865. }
  11866. onConstruct() {
  11867. this.n0 = (this.getChild("n0"));
  11868. this.n1 = (this.getChild("n1"));
  11869. this.n2 = (this.getChild("n2"));
  11870. this.n3 = (this.getChild("n3"));
  11871. this.n4 = (this.getChild("n4"));
  11872. this.n5 = (this.getChild("n5"));
  11873. this.n6 = (this.getChild("n6"));
  11874. this.n7 = (this.getChild("n7"));
  11875. this.n8 = (this.getChild("n8"));
  11876. this.n9 = (this.getChild("n9"));
  11877. this.n10 = (this.getChild("n10"));
  11878. this.n11 = (this.getChild("n11"));
  11879. this.n12 = (this.getChild("n12"));
  11880. this.n13 = (this.getChild("n13"));
  11881. this.n14 = (this.getChild("n14"));
  11882. this.n15 = (this.getChild("n15"));
  11883. this.n16 = (this.getChild("n16"));
  11884. this.n19 = (this.getChild("n19"));
  11885. this.n20 = (this.getChild("n20"));
  11886. this.n21 = (this.getChild("n21"));
  11887. this.n22 = (this.getChild("n22"));
  11888. this.n23 = (this.getChild("n23"));
  11889. this.n24 = (this.getChild("n24"));
  11890. this.n25 = (this.getChild("n25"));
  11891. this.n26 = (this.getChild("n26"));
  11892. this.n27 = (this.getChild("n27"));
  11893. this.n28 = (this.getChild("n28"));
  11894. this.n29 = (this.getChild("n29"));
  11895. this.n30 = (this.getChild("n30"));
  11896. this.n31 = (this.getChild("n31"));
  11897. this.n32 = (this.getChild("n32"));
  11898. this.n33 = (this.getChild("n33"));
  11899. this.n34 = (this.getChild("n34"));
  11900. this.n35 = (this.getChild("n35"));
  11901. this.t0 = this.getTransition("t0");
  11902. }
  11903. }
  11904. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11905. class ui_Component58 extends fgui.GComponent {
  11906. static createInstance() {
  11907. return (fgui.UIPackage.createObject("game", "Component58"));
  11908. }
  11909. onConstruct() {
  11910. this.n23 = (this.getChild("n23"));
  11911. this.n41 = (this.getChild("n41"));
  11912. this.n8 = (this.getChild("n8"));
  11913. this.skillList = (this.getChild("skillList"));
  11914. this.t0 = this.getTransition("t0");
  11915. }
  11916. }
  11917. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11918. class ui_Component59 extends fgui.GComponent {
  11919. static createInstance() {
  11920. return (fgui.UIPackage.createObject("game", "Component59"));
  11921. }
  11922. onConstruct() {
  11923. this.n3 = (this.getChild("n3"));
  11924. this.msgTxt = (this.getChild("msgTxt"));
  11925. this.t0 = this.getTransition("t0");
  11926. }
  11927. }
  11928. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11929. class ui_RulerNode extends fgui.GComponent {
  11930. static createInstance() {
  11931. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11932. }
  11933. onConstruct() {
  11934. this.n6 = (this.getChild("n6"));
  11935. this.n4 = (this.getChild("n4"));
  11936. this.img1 = (this.getChild("img1"));
  11937. this.img2 = (this.getChild("img2"));
  11938. }
  11939. }
  11940. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11941. class ui_Component108 extends fgui.GComponent {
  11942. static createInstance() {
  11943. return (fgui.UIPackage.createObject("game", "Component108"));
  11944. }
  11945. onConstruct() {
  11946. this.n19 = (this.getChild("n19"));
  11947. this.t0 = this.getTransition("t0");
  11948. }
  11949. }
  11950. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11951. class ui_Component63 extends fgui.GComponent {
  11952. static createInstance() {
  11953. return (fgui.UIPackage.createObject("game", "Component63"));
  11954. }
  11955. onConstruct() {
  11956. this.n66 = (this.getChild("n66"));
  11957. this.n56 = (this.getChild("n56"));
  11958. this.n63 = (this.getChild("n63"));
  11959. this.n65 = (this.getChild("n65"));
  11960. this.t0 = this.getTransition("t0");
  11961. }
  11962. }
  11963. ui_Component63.URL = "ui://isxx5ak7h657452";
  11964. class ui_topNode extends fgui.GComponent {
  11965. static createInstance() {
  11966. return (fgui.UIPackage.createObject("game", "topNode"));
  11967. }
  11968. onConstruct() {
  11969. this.selfProgress = (this.getChild("selfProgress"));
  11970. this.aiProgress = (this.getChild("aiProgress"));
  11971. this.selfKuang = (this.getChild("selfKuang"));
  11972. this.aiKuang = (this.getChild("aiKuang"));
  11973. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  11974. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  11975. this.n33 = (this.getChild("n33"));
  11976. this.n34 = (this.getChild("n34"));
  11977. this.selfNameTxt = (this.getChild("selfNameTxt"));
  11978. this.aiNameTxt = (this.getChild("aiNameTxt"));
  11979. this.selfBallList = (this.getChild("selfBallList"));
  11980. this.aiBallList = (this.getChild("aiBallList"));
  11981. this.middleNode = (this.getChild("middleNode"));
  11982. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  11983. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  11984. this.scoreNode = (this.getChild("scoreNode"));
  11985. this.selfTips = (this.getChild("selfTips"));
  11986. this.aiTips = (this.getChild("aiTips"));
  11987. }
  11988. }
  11989. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  11990. class ui_selfProgress extends fgui.GProgressBar {
  11991. static createInstance() {
  11992. return (fgui.UIPackage.createObject("game", "selfProgress"));
  11993. }
  11994. onConstruct() {
  11995. this.n3 = (this.getChild("n3"));
  11996. this.bar = (this.getChild("bar"));
  11997. }
  11998. }
  11999. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12000. class ui_aiProgress extends fgui.GProgressBar {
  12001. static createInstance() {
  12002. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12003. }
  12004. onConstruct() {
  12005. this.n3 = (this.getChild("n3"));
  12006. this.bar = (this.getChild("bar"));
  12007. }
  12008. }
  12009. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12010. class ui_ballDisplay extends fgui.GComponent {
  12011. static createInstance() {
  12012. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12013. }
  12014. onConstruct() {
  12015. this.myImg = (this.getChild("myImg"));
  12016. }
  12017. }
  12018. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12019. class ui_moveNode extends fgui.GComponent {
  12020. static createInstance() {
  12021. return (fgui.UIPackage.createObject("game", "moveNode"));
  12022. }
  12023. onConstruct() {
  12024. this.n8 = (this.getChild("n8"));
  12025. this.finger = (this.getChild("finger"));
  12026. }
  12027. }
  12028. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12029. class ui_cancelBtn extends fgui.GButton {
  12030. static createInstance() {
  12031. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12032. }
  12033. onConstruct() {
  12034. this.c1 = this.getController("c1");
  12035. this.n0 = (this.getChild("n0"));
  12036. this.n1 = (this.getChild("n1"));
  12037. }
  12038. }
  12039. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12040. class ui_shareBtn extends fgui.GButton {
  12041. static createInstance() {
  12042. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12043. }
  12044. onConstruct() {
  12045. this.c1 = this.getController("c1");
  12046. this.n2 = (this.getChild("n2"));
  12047. this.n1 = (this.getChild("n1"));
  12048. this.n3 = (this.getChild("n3"));
  12049. this.n4 = (this.getChild("n4"));
  12050. this.n5 = (this.getChild("n5"));
  12051. this.n6 = (this.getChild("n6"));
  12052. }
  12053. }
  12054. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12055. class ui_share2Btn extends fgui.GButton {
  12056. static createInstance() {
  12057. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12058. }
  12059. onConstruct() {
  12060. this.n3 = (this.getChild("n3"));
  12061. }
  12062. }
  12063. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12064. class ui_rodMethodNode extends fgui.GComponent {
  12065. static createInstance() {
  12066. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12067. }
  12068. onConstruct() {
  12069. this.bg = (this.getChild("bg"));
  12070. this.dot = (this.getChild("dot"));
  12071. }
  12072. }
  12073. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12074. class ui_sureBtn extends fgui.GButton {
  12075. static createInstance() {
  12076. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12077. }
  12078. onConstruct() {
  12079. this.n2 = (this.getChild("n2"));
  12080. this.n1 = (this.getChild("n1"));
  12081. }
  12082. }
  12083. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12084. class ui_Component18 extends fgui.GComponent {
  12085. static createInstance() {
  12086. return (fgui.UIPackage.createObject("game", "Component18"));
  12087. }
  12088. onConstruct() {
  12089. this.c1 = this.getController("c1");
  12090. this.nameTxt = (this.getChild("nameTxt"));
  12091. this.headImg = (this.getChild("headImg"));
  12092. this.n24 = (this.getChild("n24"));
  12093. this.skillImg = (this.getChild("skillImg"));
  12094. this.skillTxt = (this.getChild("skillTxt"));
  12095. }
  12096. }
  12097. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12098. class ui_Component45 extends fgui.GComponent {
  12099. static createInstance() {
  12100. return (fgui.UIPackage.createObject("game", "Component45"));
  12101. }
  12102. onConstruct() {
  12103. this.c1 = this.getController("c1");
  12104. this.n40 = (this.getChild("n40"));
  12105. this.n41 = (this.getChild("n41"));
  12106. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12107. this.n42 = (this.getChild("n42"));
  12108. this.awardTxt = (this.getChild("awardTxt"));
  12109. this.n44 = (this.getChild("n44"));
  12110. this.t0 = this.getTransition("t0");
  12111. }
  12112. }
  12113. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12114. class ui_emotionDisplay extends fgui.GButton {
  12115. static createInstance() {
  12116. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12117. }
  12118. onConstruct() {
  12119. this.myIcon = (this.getChild("myIcon"));
  12120. }
  12121. }
  12122. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12123. class ui_Component49 extends fgui.GButton {
  12124. static createInstance() {
  12125. return (fgui.UIPackage.createObject("game", "Component49"));
  12126. }
  12127. onConstruct() {
  12128. this.n69 = (this.getChild("n69"));
  12129. this.n56 = (this.getChild("n56"));
  12130. }
  12131. }
  12132. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12133. class ui_Component50 extends fgui.GButton {
  12134. static createInstance() {
  12135. return (fgui.UIPackage.createObject("game", "Component50"));
  12136. }
  12137. onConstruct() {
  12138. this.n54 = (this.getChild("n54"));
  12139. this.n65 = (this.getChild("n65"));
  12140. }
  12141. }
  12142. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12143. class ui_Component51 extends fgui.GButton {
  12144. static createInstance() {
  12145. return (fgui.UIPackage.createObject("game", "Component51"));
  12146. }
  12147. onConstruct() {
  12148. this.c1 = this.getController("c1");
  12149. this.n51 = (this.getChild("n51"));
  12150. this.n54 = (this.getChild("n54"));
  12151. }
  12152. }
  12153. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12154. class ui_Button5 extends fgui.GButton {
  12155. static createInstance() {
  12156. return (fgui.UIPackage.createObject("game", "Button5"));
  12157. }
  12158. onConstruct() {
  12159. this.c1 = this.getController("c1");
  12160. this.n0 = (this.getChild("n0"));
  12161. this.n2 = (this.getChild("n2"));
  12162. }
  12163. }
  12164. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12165. class ui_Component124 extends fgui.GComponent {
  12166. static createInstance() {
  12167. return (fgui.UIPackage.createObject("game", "Component124"));
  12168. }
  12169. onConstruct() {
  12170. this.n22 = (this.getChild("n22"));
  12171. this.shareNode = (this.getChild("shareNode"));
  12172. }
  12173. }
  12174. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12175. class ui_Component125 extends fgui.GComponent {
  12176. static createInstance() {
  12177. return (fgui.UIPackage.createObject("game", "Component125"));
  12178. }
  12179. onConstruct() {
  12180. this.n29 = (this.getChild("n29"));
  12181. this.coinTxt = (this.getChild("coinTxt"));
  12182. }
  12183. }
  12184. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12185. class ui_Component52 extends fgui.GButton {
  12186. static createInstance() {
  12187. return (fgui.UIPackage.createObject("game", "Component52"));
  12188. }
  12189. onConstruct() {
  12190. this.n35 = (this.getChild("n35"));
  12191. this.n36 = (this.getChild("n36"));
  12192. }
  12193. }
  12194. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12195. class ui_drawBtn extends fgui.GButton {
  12196. static createInstance() {
  12197. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12198. }
  12199. onConstruct() {
  12200. this.c1 = this.getController("c1");
  12201. this.n2 = (this.getChild("n2"));
  12202. this.n1 = (this.getChild("n1"));
  12203. this.n5 = (this.getChild("n5"));
  12204. }
  12205. }
  12206. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12207. class ui_Component43 extends fgui.GButton {
  12208. static createInstance() {
  12209. return (fgui.UIPackage.createObject("game", "Component43"));
  12210. }
  12211. onConstruct() {
  12212. this.n49 = (this.getChild("n49"));
  12213. }
  12214. }
  12215. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12216. class ui_wordsDisplay extends fgui.GComponent {
  12217. static createInstance() {
  12218. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12219. }
  12220. onConstruct() {
  12221. this.txt = (this.getChild("txt"));
  12222. this.n63 = (this.getChild("n63"));
  12223. }
  12224. }
  12225. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12226. class ui_Component3 extends fgui.GComponent {
  12227. static createInstance() {
  12228. return (fgui.UIPackage.createObject("game", "Component3"));
  12229. }
  12230. onConstruct() {
  12231. this.n26 = (this.getChild("n26"));
  12232. this.n24 = (this.getChild("n24"));
  12233. this.nameTxt = (this.getChild("nameTxt"));
  12234. this.headRoot = (this.getChild("headRoot"));
  12235. }
  12236. }
  12237. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12238. class ui_Component4 extends fgui.GComponent {
  12239. static createInstance() {
  12240. return (fgui.UIPackage.createObject("game", "Component4"));
  12241. }
  12242. onConstruct() {
  12243. this.n44 = (this.getChild("n44"));
  12244. this.headImg = (this.getChild("headImg"));
  12245. }
  12246. }
  12247. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12248. class ui_Component7 extends fgui.GButton {
  12249. static createInstance() {
  12250. return (fgui.UIPackage.createObject("game", "Component7"));
  12251. }
  12252. onConstruct() {
  12253. this.n17 = (this.getChild("n17"));
  12254. }
  12255. }
  12256. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12257. class ui_Component8 extends fgui.GButton {
  12258. static createInstance() {
  12259. return (fgui.UIPackage.createObject("game", "Component8"));
  12260. }
  12261. onConstruct() {
  12262. this.n19 = (this.getChild("n19"));
  12263. this.n20 = (this.getChild("n20"));
  12264. this.n21 = (this.getChild("n21"));
  12265. }
  12266. }
  12267. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12268. class ui_Component9 extends fgui.GButton {
  12269. static createInstance() {
  12270. return (fgui.UIPackage.createObject("game", "Component9"));
  12271. }
  12272. onConstruct() {
  12273. this.n18 = (this.getChild("n18"));
  12274. this.n19 = (this.getChild("n19"));
  12275. this.n20 = (this.getChild("n20"));
  12276. }
  12277. }
  12278. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12279. class ui_Component10 extends fgui.GButton {
  12280. static createInstance() {
  12281. return (fgui.UIPackage.createObject("game", "Component10"));
  12282. }
  12283. onConstruct() {
  12284. this.c1 = this.getController("c1");
  12285. this.n40 = (this.getChild("n40"));
  12286. this.n41 = (this.getChild("n41"));
  12287. }
  12288. }
  12289. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12290. class ui_Component11 extends fgui.GButton {
  12291. static createInstance() {
  12292. return (fgui.UIPackage.createObject("game", "Component11"));
  12293. }
  12294. onConstruct() {
  12295. this.n34 = (this.getChild("n34"));
  12296. this.n42 = (this.getChild("n42"));
  12297. }
  12298. }
  12299. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12300. class ui_Component12 extends fgui.GButton {
  12301. static createInstance() {
  12302. return (fgui.UIPackage.createObject("game", "Component12"));
  12303. }
  12304. onConstruct() {
  12305. this.n35 = (this.getChild("n35"));
  12306. this.n43 = (this.getChild("n43"));
  12307. this.t0 = this.getTransition("t0");
  12308. }
  12309. }
  12310. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12311. class ui_Component13 extends fgui.GButton {
  12312. static createInstance() {
  12313. return (fgui.UIPackage.createObject("game", "Component13"));
  12314. }
  12315. onConstruct() {
  12316. this.n27 = (this.getChild("n27"));
  12317. this.n36 = (this.getChild("n36"));
  12318. }
  12319. }
  12320. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12321. class ui_Component16 extends fgui.GButton {
  12322. static createInstance() {
  12323. return (fgui.UIPackage.createObject("game", "Component16"));
  12324. }
  12325. onConstruct() {
  12326. this.n30 = (this.getChild("n30"));
  12327. this.n39 = (this.getChild("n39"));
  12328. }
  12329. }
  12330. ui_Component16.URL = "ui://isxx5ak7ixm43xz";
  12331. class ui_dh_js_tuowei extends fgui.GComponent {
  12332. static createInstance() {
  12333. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12334. }
  12335. onConstruct() {
  12336. this.n19 = (this.getChild("n19"));
  12337. this.n18 = (this.getChild("n18"));
  12338. this.n0 = (this.getChild("n0"));
  12339. this.n3 = (this.getChild("n3"));
  12340. this.n4 = (this.getChild("n4"));
  12341. this.n5 = (this.getChild("n5"));
  12342. this.n6 = (this.getChild("n6"));
  12343. this.n8 = (this.getChild("n8"));
  12344. this.n9 = (this.getChild("n9"));
  12345. this.n10 = (this.getChild("n10"));
  12346. this.n11 = (this.getChild("n11"));
  12347. this.n12 = (this.getChild("n12"));
  12348. this.n13 = (this.getChild("n13"));
  12349. this.n14 = (this.getChild("n14"));
  12350. this.n15 = (this.getChild("n15"));
  12351. this.n20 = (this.getChild("n20"));
  12352. this.t0 = this.getTransition("t0");
  12353. this.t1 = this.getTransition("t1");
  12354. }
  12355. }
  12356. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12357. class ui_dh_js_tw_g extends fgui.GComponent {
  12358. static createInstance() {
  12359. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12360. }
  12361. onConstruct() {
  12362. this.n0 = (this.getChild("n0"));
  12363. this.n1 = (this.getChild("n1"));
  12364. this.t0 = this.getTransition("t0");
  12365. }
  12366. }
  12367. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12368. class ui_dh_js_xingxing extends fgui.GComponent {
  12369. static createInstance() {
  12370. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12371. }
  12372. onConstruct() {
  12373. this.n1 = (this.getChild("n1"));
  12374. this.n2 = (this.getChild("n2"));
  12375. this.n3 = (this.getChild("n3"));
  12376. this.n4 = (this.getChild("n4"));
  12377. this.n0 = (this.getChild("n0"));
  12378. this.t2 = this.getTransition("t2");
  12379. this.t1 = this.getTransition("t1");
  12380. }
  12381. }
  12382. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12383. class ui_dh_zy_jiazai extends fgui.GComponent {
  12384. static createInstance() {
  12385. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12386. }
  12387. onConstruct() {
  12388. this.c1 = this.getController("c1");
  12389. this.n0 = (this.getChild("n0"));
  12390. this.n1 = (this.getChild("n1"));
  12391. this.n2 = (this.getChild("n2"));
  12392. this.n4 = (this.getChild("n4"));
  12393. this.n5 = (this.getChild("n5"));
  12394. this.n6 = (this.getChild("n6"));
  12395. this.n8 = (this.getChild("n8"));
  12396. this.n7 = (this.getChild("n7"));
  12397. this.t0 = this.getTransition("t0");
  12398. }
  12399. }
  12400. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12401. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12402. static createInstance() {
  12403. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12404. }
  12405. onConstruct() {
  12406. this.c1 = this.getController("c1");
  12407. this.n3 = (this.getChild("n3"));
  12408. this.n5 = (this.getChild("n5"));
  12409. this.n4 = (this.getChild("n4"));
  12410. this.n0 = (this.getChild("n0"));
  12411. this.n1 = (this.getChild("n1"));
  12412. this.n2 = (this.getChild("n2"));
  12413. }
  12414. }
  12415. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12416. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12417. static createInstance() {
  12418. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12419. }
  12420. onConstruct() {
  12421. this.n19 = (this.getChild("n19"));
  12422. this.n21 = (this.getChild("n21"));
  12423. this.n0 = (this.getChild("n0"));
  12424. this.n3 = (this.getChild("n3"));
  12425. this.n4 = (this.getChild("n4"));
  12426. this.n5 = (this.getChild("n5"));
  12427. this.n6 = (this.getChild("n6"));
  12428. this.n8 = (this.getChild("n8"));
  12429. this.n9 = (this.getChild("n9"));
  12430. this.n10 = (this.getChild("n10"));
  12431. this.n11 = (this.getChild("n11"));
  12432. this.n12 = (this.getChild("n12"));
  12433. this.n13 = (this.getChild("n13"));
  12434. this.n14 = (this.getChild("n14"));
  12435. this.n15 = (this.getChild("n15"));
  12436. this.n23 = (this.getChild("n23"));
  12437. this.t0 = this.getTransition("t0");
  12438. this.t1 = this.getTransition("t1");
  12439. }
  12440. }
  12441. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12442. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12443. static createInstance() {
  12444. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12445. }
  12446. onConstruct() {
  12447. this.n1 = (this.getChild("n1"));
  12448. this.n2 = (this.getChild("n2"));
  12449. this.t0 = this.getTransition("t0");
  12450. }
  12451. }
  12452. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12453. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12454. static createInstance() {
  12455. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12456. }
  12457. onConstruct() {
  12458. this.n4 = (this.getChild("n4"));
  12459. this.n2 = (this.getChild("n2"));
  12460. this.n3 = (this.getChild("n3"));
  12461. this.idle = this.getTransition("idle");
  12462. this.attack = this.getTransition("attack");
  12463. }
  12464. }
  12465. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12466. class ui_special extends fgui.GComponent {
  12467. static createInstance() {
  12468. return (fgui.UIPackage.createObject("game", "special"));
  12469. }
  12470. onConstruct() {
  12471. this.n18 = (this.getChild("n18"));
  12472. this.n19 = (this.getChild("n19"));
  12473. this.n20 = (this.getChild("n20"));
  12474. this.n21 = (this.getChild("n21"));
  12475. this.n22 = (this.getChild("n22"));
  12476. this.levelTxt = (this.getChild("levelTxt"));
  12477. this.n24 = (this.getChild("n24"));
  12478. this.n25 = (this.getChild("n25"));
  12479. this.t0 = this.getTransition("t0");
  12480. }
  12481. }
  12482. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12483. class ui_Component145 extends fgui.GComponent {
  12484. static createInstance() {
  12485. return (fgui.UIPackage.createObject("game", "Component145"));
  12486. }
  12487. onConstruct() {
  12488. this.guanyuNode = (this.getChild("guanyuNode"));
  12489. }
  12490. }
  12491. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12492. class ui_longBtn extends fgui.GButton {
  12493. static createInstance() {
  12494. return (fgui.UIPackage.createObject("game", "longBtn"));
  12495. }
  12496. onConstruct() {
  12497. this.c1 = this.getController("c1");
  12498. this.n2 = (this.getChild("n2"));
  12499. this.n1 = (this.getChild("n1"));
  12500. this.n4 = (this.getChild("n4"));
  12501. }
  12502. }
  12503. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12504. class ui_Component146 extends fgui.GComponent {
  12505. static createInstance() {
  12506. return (fgui.UIPackage.createObject("game", "Component146"));
  12507. }
  12508. onConstruct() {
  12509. this.n89 = (this.getChild("n89"));
  12510. this.n90 = (this.getChild("n90"));
  12511. this.guideBtn = (this.getChild("guideBtn"));
  12512. }
  12513. }
  12514. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12515. class ui_Component146_11 extends fgui.GComponent {
  12516. static createInstance() {
  12517. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12518. }
  12519. onConstruct() {
  12520. this.n89 = (this.getChild("n89"));
  12521. this.n90 = (this.getChild("n90"));
  12522. this.guideBtn = (this.getChild("guideBtn"));
  12523. }
  12524. }
  12525. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12526. class ui_Component111_1 extends fgui.GComponent {
  12527. static createInstance() {
  12528. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12529. }
  12530. onConstruct() {
  12531. this.n68 = (this.getChild("n68"));
  12532. this.myMask = (this.getChild("myMask"));
  12533. }
  12534. }
  12535. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12536. class ui_Component64_1 extends fgui.GComponent {
  12537. static createInstance() {
  12538. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12539. }
  12540. onConstruct() {
  12541. this.n57 = (this.getChild("n57"));
  12542. this.n54 = (this.getChild("n54"));
  12543. this.n55 = (this.getChild("n55"));
  12544. this.n56 = (this.getChild("n56"));
  12545. this.t1 = this.getTransition("t1");
  12546. }
  12547. }
  12548. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12549. class ui_ModeSelection_com123 extends fgui.GComponent {
  12550. static createInstance() {
  12551. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12552. }
  12553. onConstruct() {
  12554. this.type1 = (this.getChild("type1"));
  12555. this.type2 = (this.getChild("type2"));
  12556. this.type3 = (this.getChild("type3"));
  12557. this.n38 = (this.getChild("n38"));
  12558. this.t0 = this.getTransition("t0");
  12559. }
  12560. }
  12561. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12562. class ui_Component132_2 extends fgui.GComponent {
  12563. static createInstance() {
  12564. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12565. }
  12566. onConstruct() {
  12567. this.n25 = (this.getChild("n25"));
  12568. this.n26 = (this.getChild("n26"));
  12569. this.n27 = (this.getChild("n27"));
  12570. this.t0 = this.getTransition("t0");
  12571. }
  12572. }
  12573. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12574. class ui_UIPower$1 extends fgui.GComponent {
  12575. static createInstance() {
  12576. return (fgui.UIPackage.createObject("game", "UIPower"));
  12577. }
  12578. onConstruct() {
  12579. this.n11 = (this.getChild("n11"));
  12580. this.myNode = (this.getChild("myNode"));
  12581. this.t0 = this.getTransition("t0");
  12582. }
  12583. }
  12584. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12585. class ui_Component133 extends fgui.GComponent {
  12586. static createInstance() {
  12587. return (fgui.UIPackage.createObject("game", "Component133"));
  12588. }
  12589. onConstruct() {
  12590. this.n29 = (this.getChild("n29"));
  12591. this.n30 = (this.getChild("n30"));
  12592. }
  12593. }
  12594. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12595. class ui_Component134 extends fgui.GComponent {
  12596. static createInstance() {
  12597. return (fgui.UIPackage.createObject("game", "Component134"));
  12598. }
  12599. onConstruct() {
  12600. this.n30 = (this.getChild("n30"));
  12601. this.n31 = (this.getChild("n31"));
  12602. this.t0 = this.getTransition("t0");
  12603. }
  12604. }
  12605. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12606. class ui_Component135 extends fgui.GComponent {
  12607. static createInstance() {
  12608. return (fgui.UIPackage.createObject("game", "Component135"));
  12609. }
  12610. onConstruct() {
  12611. this.n30 = (this.getChild("n30"));
  12612. this.t0 = this.getTransition("t0");
  12613. }
  12614. }
  12615. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12616. class ui_Component137 extends fgui.GComponent {
  12617. static createInstance() {
  12618. return (fgui.UIPackage.createObject("game", "Component137"));
  12619. }
  12620. onConstruct() {
  12621. this.n28 = (this.getChild("n28"));
  12622. this.n29 = (this.getChild("n29"));
  12623. this.n30 = (this.getChild("n30"));
  12624. this.n32 = (this.getChild("n32"));
  12625. }
  12626. }
  12627. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12628. class ui_dh_zuanshi extends fgui.GButton {
  12629. static createInstance() {
  12630. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12631. }
  12632. onConstruct() {
  12633. this.n1 = (this.getChild("n1"));
  12634. this.n2 = (this.getChild("n2"));
  12635. this.n0 = (this.getChild("n0"));
  12636. this.n3 = (this.getChild("n3"));
  12637. this.n4 = (this.getChild("n4"));
  12638. }
  12639. }
  12640. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12641. class ui_Component138 extends fgui.GComponent {
  12642. static createInstance() {
  12643. return (fgui.UIPackage.createObject("game", "Component138"));
  12644. }
  12645. onConstruct() {
  12646. this.n1 = (this.getChild("n1"));
  12647. this.n2 = (this.getChild("n2"));
  12648. this.t0 = this.getTransition("t0");
  12649. }
  12650. }
  12651. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12652. class ui_Component139 extends fgui.GComponent {
  12653. static createInstance() {
  12654. return (fgui.UIPackage.createObject("game", "Component139"));
  12655. }
  12656. onConstruct() {
  12657. this.n0 = (this.getChild("n0"));
  12658. this.t0 = this.getTransition("t0");
  12659. }
  12660. }
  12661. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12662. class ui_Component140 extends fgui.GComponent {
  12663. static createInstance() {
  12664. return (fgui.UIPackage.createObject("game", "Component140"));
  12665. }
  12666. onConstruct() {
  12667. this.n2 = (this.getChild("n2"));
  12668. this.n3 = (this.getChild("n3"));
  12669. this.t0 = this.getTransition("t0");
  12670. }
  12671. }
  12672. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12673. class ui_Component141 extends fgui.GComponent {
  12674. static createInstance() {
  12675. return (fgui.UIPackage.createObject("game", "Component141"));
  12676. }
  12677. onConstruct() {
  12678. this.n0 = (this.getChild("n0"));
  12679. this.t0 = this.getTransition("t0");
  12680. }
  12681. }
  12682. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12683. class ui_powerNode extends fgui.GProgressBar {
  12684. static createInstance() {
  12685. return (fgui.UIPackage.createObject("game", "powerNode"));
  12686. }
  12687. onConstruct() {
  12688. this.n2 = (this.getChild("n2"));
  12689. this.bar_v = (this.getChild("bar_v"));
  12690. this.showImg = (this.getChild("showImg"));
  12691. this.n12 = (this.getChild("n12"));
  12692. }
  12693. }
  12694. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12695. class ui_dh_jingbi1 extends fgui.GComponent {
  12696. static createInstance() {
  12697. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12698. }
  12699. onConstruct() {
  12700. this.n0 = (this.getChild("n0"));
  12701. this.n1 = (this.getChild("n1"));
  12702. this.n2 = (this.getChild("n2"));
  12703. this.n3 = (this.getChild("n3"));
  12704. this.n4 = (this.getChild("n4"));
  12705. this.n5 = (this.getChild("n5"));
  12706. this.n6 = (this.getChild("n6"));
  12707. this.n8 = (this.getChild("n8"));
  12708. this.t0 = this.getTransition("t0");
  12709. }
  12710. }
  12711. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12712. class ui_Component94 extends fgui.GButton {
  12713. static createInstance() {
  12714. return (fgui.UIPackage.createObject("game", "Component94"));
  12715. }
  12716. onConstruct() {
  12717. this.n77 = (this.getChild("n77"));
  12718. }
  12719. }
  12720. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12721. class ui_Component95 extends fgui.GButton {
  12722. static createInstance() {
  12723. return (fgui.UIPackage.createObject("game", "Component95"));
  12724. }
  12725. onConstruct() {
  12726. this.n77 = (this.getChild("n77"));
  12727. }
  12728. }
  12729. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12730. class ui_Component126 extends fgui.GComponent {
  12731. static createInstance() {
  12732. return (fgui.UIPackage.createObject("game", "Component126"));
  12733. }
  12734. onConstruct() {
  12735. this.c1 = this.getController("c1");
  12736. this.normalBtn = (this.getChild("normalBtn"));
  12737. this.tripleBtn = (this.getChild("tripleBtn"));
  12738. }
  12739. }
  12740. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12741. class ui_Component60 extends fgui.GComponent {
  12742. static createInstance() {
  12743. return (fgui.UIPackage.createObject("game", "Component60"));
  12744. }
  12745. onConstruct() {
  12746. this.c1 = this.getController("c1");
  12747. this.n48 = (this.getChild("n48"));
  12748. this.womanTxt = (this.getChild("womanTxt"));
  12749. this.t0 = this.getTransition("t0");
  12750. }
  12751. }
  12752. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12753. class ui_Component98_3 extends fgui.GButton {
  12754. static createInstance() {
  12755. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12756. }
  12757. onConstruct() {
  12758. this.c1 = this.getController("c1");
  12759. this.n8 = (this.getChild("n8"));
  12760. this.n41 = (this.getChild("n41"));
  12761. this.n40 = (this.getChild("n40"));
  12762. }
  12763. }
  12764. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12765. class ui_ModeSelection_com1 extends fgui.GButton {
  12766. static createInstance() {
  12767. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12768. }
  12769. onConstruct() {
  12770. this.n34 = (this.getChild("n34"));
  12771. this.n36 = (this.getChild("n36"));
  12772. this.n22 = (this.getChild("n22"));
  12773. this.n20 = (this.getChild("n20"));
  12774. this.n23 = (this.getChild("n23"));
  12775. this.n24 = (this.getChild("n24"));
  12776. this.n26 = (this.getChild("n26"));
  12777. this.n33 = (this.getChild("n33"));
  12778. this.coinImg = (this.getChild("coinImg"));
  12779. this.need = (this.getChild("need"));
  12780. this.n35 = (this.getChild("n35"));
  12781. this.n29 = (this.getChild("n29"));
  12782. this.tipsTxt = (this.getChild("tipsTxt"));
  12783. this.n30 = (this.getChild("n30"));
  12784. this.peopleTxt = (this.getChild("peopleTxt"));
  12785. this.t0 = this.getTransition("t0");
  12786. }
  12787. }
  12788. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12789. class ui_ModeSelection_com2 extends fgui.GButton {
  12790. static createInstance() {
  12791. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12792. }
  12793. onConstruct() {
  12794. this.n36 = (this.getChild("n36"));
  12795. this.n34 = (this.getChild("n34"));
  12796. this.n22 = (this.getChild("n22"));
  12797. this.n20 = (this.getChild("n20"));
  12798. this.n23 = (this.getChild("n23"));
  12799. this.n24 = (this.getChild("n24"));
  12800. this.n26 = (this.getChild("n26"));
  12801. this.n33 = (this.getChild("n33"));
  12802. this.coinImg = (this.getChild("coinImg"));
  12803. this.need = (this.getChild("need"));
  12804. this.n35 = (this.getChild("n35"));
  12805. this.n29 = (this.getChild("n29"));
  12806. this.tipsTxt = (this.getChild("tipsTxt"));
  12807. this.n30 = (this.getChild("n30"));
  12808. this.peopleTxt = (this.getChild("peopleTxt"));
  12809. this.t0 = this.getTransition("t0");
  12810. }
  12811. }
  12812. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12813. class ui_ModeSelection_com3 extends fgui.GButton {
  12814. static createInstance() {
  12815. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12816. }
  12817. onConstruct() {
  12818. this.n34 = (this.getChild("n34"));
  12819. this.n36 = (this.getChild("n36"));
  12820. this.n22 = (this.getChild("n22"));
  12821. this.n20 = (this.getChild("n20"));
  12822. this.n23 = (this.getChild("n23"));
  12823. this.n24 = (this.getChild("n24"));
  12824. this.n26 = (this.getChild("n26"));
  12825. this.n33 = (this.getChild("n33"));
  12826. this.coinImg = (this.getChild("coinImg"));
  12827. this.need = (this.getChild("need"));
  12828. this.n35 = (this.getChild("n35"));
  12829. this.n29 = (this.getChild("n29"));
  12830. this.tipsTxt = (this.getChild("tipsTxt"));
  12831. this.n30 = (this.getChild("n30"));
  12832. this.peopleTxt = (this.getChild("peopleTxt"));
  12833. this.t0 = this.getTransition("t0");
  12834. }
  12835. }
  12836. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12837. class ui_Invitation_com1 extends fgui.GComponent {
  12838. static createInstance() {
  12839. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12840. }
  12841. onConstruct() {
  12842. this.n14 = (this.getChild("n14"));
  12843. this.n13 = (this.getChild("n13"));
  12844. this.n3 = (this.getChild("n3"));
  12845. this.n1 = (this.getChild("n1"));
  12846. this.n6 = (this.getChild("n6"));
  12847. this.n7 = (this.getChild("n7"));
  12848. this.enterBtn = (this.getChild("enterBtn"));
  12849. this.n11 = (this.getChild("n11"));
  12850. this.n12 = (this.getChild("n12"));
  12851. this.n15 = (this.getChild("n15"));
  12852. this.t0 = this.getTransition("t0");
  12853. this.t1 = this.getTransition("t1");
  12854. }
  12855. }
  12856. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12857. class ui_Component87_1 extends fgui.GComponent {
  12858. static createInstance() {
  12859. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12860. }
  12861. onConstruct() {
  12862. this.n74 = (this.getChild("n74"));
  12863. this.n73 = (this.getChild("n73"));
  12864. this.ballTxt = (this.getChild("ballTxt"));
  12865. this.n76 = (this.getChild("n76"));
  12866. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12867. this.levelTxt = (this.getChild("levelTxt"));
  12868. this.n87 = (this.getChild("n87"));
  12869. this.n84 = (this.getChild("n84"));
  12870. this.hpTxt = (this.getChild("hpTxt"));
  12871. this.n89 = (this.getChild("n89"));
  12872. this.tipsTxt = (this.getChild("tipsTxt"));
  12873. }
  12874. }
  12875. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12876. class ui_sqg1 extends fgui.GComponent {
  12877. static createInstance() {
  12878. return (fgui.UIPackage.createObject("game", "sqg1"));
  12879. }
  12880. onConstruct() {
  12881. this.n1 = (this.getChild("n1"));
  12882. this.n0 = (this.getChild("n0"));
  12883. }
  12884. }
  12885. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12886. class ui_sqg2 extends fgui.GComponent {
  12887. static createInstance() {
  12888. return (fgui.UIPackage.createObject("game", "sqg2"));
  12889. }
  12890. onConstruct() {
  12891. this.n1 = (this.getChild("n1"));
  12892. this.n0 = (this.getChild("n0"));
  12893. }
  12894. }
  12895. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12896. class ui_sqg3 extends fgui.GComponent {
  12897. static createInstance() {
  12898. return (fgui.UIPackage.createObject("game", "sqg3"));
  12899. }
  12900. onConstruct() {
  12901. this.n1 = (this.getChild("n1"));
  12902. this.n0 = (this.getChild("n0"));
  12903. }
  12904. }
  12905. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12906. class ui_sqg4 extends fgui.GComponent {
  12907. static createInstance() {
  12908. return (fgui.UIPackage.createObject("game", "sqg4"));
  12909. }
  12910. onConstruct() {
  12911. this.n1 = (this.getChild("n1"));
  12912. this.n0 = (this.getChild("n0"));
  12913. }
  12914. }
  12915. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12916. class ui_Component36 extends fgui.GButton {
  12917. static createInstance() {
  12918. return (fgui.UIPackage.createObject("game", "Component36"));
  12919. }
  12920. onConstruct() {
  12921. this.c1 = this.getController("c1");
  12922. this.n53 = (this.getChild("n53"));
  12923. this.n56 = (this.getChild("n56"));
  12924. }
  12925. }
  12926. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12927. class ui_Component37 extends fgui.GButton {
  12928. static createInstance() {
  12929. return (fgui.UIPackage.createObject("game", "Component37"));
  12930. }
  12931. onConstruct() {
  12932. this.c1 = this.getController("c1");
  12933. this.n52 = (this.getChild("n52"));
  12934. this.n54 = (this.getChild("n54"));
  12935. }
  12936. }
  12937. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12938. class ui_UISetting extends fgui.GComponent {
  12939. static createInstance() {
  12940. return (fgui.UIPackage.createObject("game", "UISetting"));
  12941. }
  12942. onConstruct() {
  12943. this.c1 = this.getController("c1");
  12944. this.n4 = (this.getChild("n4"));
  12945. this.soundBtn = (this.getChild("soundBtn"));
  12946. this.shakeBtn = (this.getChild("shakeBtn"));
  12947. this.clickNode = (this.getChild("clickNode"));
  12948. this.xyBtn = (this.getChild("xyBtn"));
  12949. }
  12950. }
  12951. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12952. class ui_Component39 extends fgui.GComponent {
  12953. static createInstance() {
  12954. return (fgui.UIPackage.createObject("game", "Component39"));
  12955. }
  12956. onConstruct() {
  12957. this.n5 = (this.getChild("n5"));
  12958. this.n6 = (this.getChild("n6"));
  12959. this.n7 = (this.getChild("n7"));
  12960. this.t0 = this.getTransition("t0");
  12961. }
  12962. }
  12963. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12964. class ui_Component40 extends fgui.GButton {
  12965. static createInstance() {
  12966. return (fgui.UIPackage.createObject("game", "Component40"));
  12967. }
  12968. onConstruct() {
  12969. this.n46 = (this.getChild("n46"));
  12970. this.n47 = (this.getChild("n47"));
  12971. }
  12972. }
  12973. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  12974. class ui_Component41 extends fgui.GComponent {
  12975. static createInstance() {
  12976. return (fgui.UIPackage.createObject("game", "Component41"));
  12977. }
  12978. onConstruct() {
  12979. this.c1 = this.getController("c1");
  12980. this.n0 = (this.getChild("n0"));
  12981. this.titleTxt = (this.getChild("titleTxt"));
  12982. this.n2 = (this.getChild("n2"));
  12983. this.msgTips = (this.getChild("msgTips"));
  12984. this.numTxt = (this.getChild("numTxt"));
  12985. this.n18 = (this.getChild("n18"));
  12986. this.cancelBtn = (this.getChild("cancelBtn"));
  12987. this.videoBtn = (this.getChild("videoBtn"));
  12988. this.n10 = (this.getChild("n10"));
  12989. }
  12990. }
  12991. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  12992. class ui_Component42 extends fgui.GComponent {
  12993. static createInstance() {
  12994. return (fgui.UIPackage.createObject("game", "Component42"));
  12995. }
  12996. onConstruct() {
  12997. this.c1 = this.getController("c1");
  12998. this.n1 = (this.getChild("n1"));
  12999. this.n2 = (this.getChild("n2"));
  13000. this.n3 = (this.getChild("n3"));
  13001. this.tipsTxt = (this.getChild("tipsTxt"));
  13002. this.cancelBtn = (this.getChild("cancelBtn"));
  13003. this.sureBtn = (this.getChild("sureBtn"));
  13004. this.n11 = (this.getChild("n11"));
  13005. this.n13 = (this.getChild("n13"));
  13006. this.n14 = (this.getChild("n14"));
  13007. this.womanTxt = (this.getChild("womanTxt"));
  13008. this.t0 = this.getTransition("t0");
  13009. }
  13010. }
  13011. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13012. class ui_dh_js_shengli extends fgui.GComponent {
  13013. static createInstance() {
  13014. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13015. }
  13016. onConstruct() {
  13017. this.n3 = (this.getChild("n3"));
  13018. this.n4 = (this.getChild("n4"));
  13019. this.n1 = (this.getChild("n1"));
  13020. this.n2 = (this.getChild("n2"));
  13021. this.n5 = (this.getChild("n5"));
  13022. this.n6 = (this.getChild("n6"));
  13023. this.n7 = (this.getChild("n7"));
  13024. this.n8 = (this.getChild("n8"));
  13025. this.attack = this.getTransition("attack");
  13026. this.idle = this.getTransition("idle");
  13027. }
  13028. }
  13029. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13030. class ui_dh_js_shengli_g extends fgui.GComponent {
  13031. static createInstance() {
  13032. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13033. }
  13034. onConstruct() {
  13035. this.n3 = (this.getChild("n3"));
  13036. this.n1 = (this.getChild("n1"));
  13037. this.t0 = this.getTransition("t0");
  13038. }
  13039. }
  13040. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13041. class ui_dh_js_shibai extends fgui.GComponent {
  13042. static createInstance() {
  13043. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13044. }
  13045. onConstruct() {
  13046. this.n0 = (this.getChild("n0"));
  13047. this.n1 = (this.getChild("n1"));
  13048. this.n2 = (this.getChild("n2"));
  13049. this.n3 = (this.getChild("n3"));
  13050. this.idle = this.getTransition("idle");
  13051. this.attack = this.getTransition("attack");
  13052. }
  13053. }
  13054. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13055. class ui_dh_zy_ganfa extends fgui.GButton {
  13056. static createInstance() {
  13057. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13058. }
  13059. onConstruct() {
  13060. this.n27 = (this.getChild("n27"));
  13061. this.n0 = (this.getChild("n0"));
  13062. this.n1 = (this.getChild("n1"));
  13063. this.n13 = (this.getChild("n13"));
  13064. this.n14 = (this.getChild("n14"));
  13065. this.n15 = (this.getChild("n15"));
  13066. this.n3 = (this.getChild("n3"));
  13067. this.n4 = (this.getChild("n4"));
  13068. this.n5 = (this.getChild("n5"));
  13069. this.n6 = (this.getChild("n6"));
  13070. this.n7 = (this.getChild("n7"));
  13071. this.n8 = (this.getChild("n8"));
  13072. this.n9 = (this.getChild("n9"));
  13073. this.n10 = (this.getChild("n10"));
  13074. this.n12 = (this.getChild("n12"));
  13075. this.n11 = (this.getChild("n11"));
  13076. this.n16 = (this.getChild("n16"));
  13077. this.n17 = (this.getChild("n17"));
  13078. this.n18 = (this.getChild("n18"));
  13079. this.n19 = (this.getChild("n19"));
  13080. this.n20 = (this.getChild("n20"));
  13081. this.n21 = (this.getChild("n21"));
  13082. this.n28 = (this.getChild("n28"));
  13083. this.n29 = (this.getChild("n29"));
  13084. this.t0 = this.getTransition("t0");
  13085. }
  13086. }
  13087. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13088. class ui_dh_zy_ganzi extends fgui.GComponent {
  13089. static createInstance() {
  13090. return (fgui.UIPackage.createObject("game", "dh_zy_ganzi"));
  13091. }
  13092. onConstruct() {
  13093. this.n3 = (this.getChild("n3"));
  13094. this.n2 = (this.getChild("n2"));
  13095. this.t0 = this.getTransition("t0");
  13096. }
  13097. }
  13098. ui_dh_zy_ganzi.URL = "ui://isxx5ak7n43d3vm";
  13099. class ui_dh_zy_sc_guang extends fgui.GButton {
  13100. static createInstance() {
  13101. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13102. }
  13103. onConstruct() {
  13104. this.n1 = (this.getChild("n1"));
  13105. this.n3 = (this.getChild("n3"));
  13106. this.n0 = (this.getChild("n0"));
  13107. this.n2 = (this.getChild("n2"));
  13108. this.n4 = (this.getChild("n4"));
  13109. this.t0 = this.getTransition("t0");
  13110. this.t1 = this.getTransition("t1");
  13111. }
  13112. }
  13113. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13114. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13115. static createInstance() {
  13116. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13117. }
  13118. onConstruct() {
  13119. this.n0 = (this.getChild("n0"));
  13120. this.n3 = (this.getChild("n3"));
  13121. this.t0 = this.getTransition("t0");
  13122. }
  13123. }
  13124. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13125. class ui_dh_zy_wanfa extends fgui.GButton {
  13126. static createInstance() {
  13127. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13128. }
  13129. onConstruct() {
  13130. this.n0 = (this.getChild("n0"));
  13131. this.n2 = (this.getChild("n2"));
  13132. this.n1 = (this.getChild("n1"));
  13133. this.n3 = (this.getChild("n3"));
  13134. this.n8 = (this.getChild("n8"));
  13135. this.t0 = this.getTransition("t0");
  13136. }
  13137. }
  13138. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13139. class ui_Component53_1 extends fgui.GComponent {
  13140. static createInstance() {
  13141. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13142. }
  13143. onConstruct() {
  13144. this.n0 = (this.getChild("n0"));
  13145. this.n1 = (this.getChild("n1"));
  13146. this.n2 = (this.getChild("n2"));
  13147. this.n3 = (this.getChild("n3"));
  13148. this.n4 = (this.getChild("n4"));
  13149. this.n5 = (this.getChild("n5"));
  13150. this.n6 = (this.getChild("n6"));
  13151. this.n7 = (this.getChild("n7"));
  13152. this.n8 = (this.getChild("n8"));
  13153. this.n9 = (this.getChild("n9"));
  13154. this.n10 = (this.getChild("n10"));
  13155. this.n11 = (this.getChild("n11"));
  13156. this.n12 = (this.getChild("n12"));
  13157. this.n13 = (this.getChild("n13"));
  13158. this.n14 = (this.getChild("n14"));
  13159. this.n15 = (this.getChild("n15"));
  13160. this.n16 = (this.getChild("n16"));
  13161. this.n19 = (this.getChild("n19"));
  13162. this.n20 = (this.getChild("n20"));
  13163. this.n21 = (this.getChild("n21"));
  13164. this.n22 = (this.getChild("n22"));
  13165. this.n23 = (this.getChild("n23"));
  13166. this.n24 = (this.getChild("n24"));
  13167. this.n25 = (this.getChild("n25"));
  13168. this.n26 = (this.getChild("n26"));
  13169. this.n27 = (this.getChild("n27"));
  13170. this.n28 = (this.getChild("n28"));
  13171. this.n29 = (this.getChild("n29"));
  13172. this.n30 = (this.getChild("n30"));
  13173. this.n31 = (this.getChild("n31"));
  13174. this.n32 = (this.getChild("n32"));
  13175. this.n33 = (this.getChild("n33"));
  13176. this.n34 = (this.getChild("n34"));
  13177. this.n35 = (this.getChild("n35"));
  13178. this.t0 = this.getTransition("t0");
  13179. }
  13180. }
  13181. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13182. class ui_Component30 extends fgui.GComponent {
  13183. static createInstance() {
  13184. return (fgui.UIPackage.createObject("game", "Component30"));
  13185. }
  13186. onConstruct() {
  13187. this.c1 = this.getController("c1");
  13188. this.n46 = (this.getChild("n46"));
  13189. this.n47 = (this.getChild("n47"));
  13190. this.numTxt = (this.getChild("numTxt"));
  13191. this.n50 = (this.getChild("n50"));
  13192. this.n53 = (this.getChild("n53"));
  13193. this.n54 = (this.getChild("n54"));
  13194. this.n55 = (this.getChild("n55"));
  13195. this.n56 = (this.getChild("n56"));
  13196. }
  13197. }
  13198. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13199. class ui_Component30_1 extends fgui.GComponent {
  13200. static createInstance() {
  13201. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13202. }
  13203. onConstruct() {
  13204. this.c1 = this.getController("c1");
  13205. this.n46 = (this.getChild("n46"));
  13206. this.n47 = (this.getChild("n47"));
  13207. this.numTxt = (this.getChild("numTxt"));
  13208. this.n50 = (this.getChild("n50"));
  13209. this.n51 = (this.getChild("n51"));
  13210. this.n52 = (this.getChild("n52"));
  13211. this.n53 = (this.getChild("n53"));
  13212. this.n54 = (this.getChild("n54"));
  13213. }
  13214. }
  13215. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13216. class ui_Component31 extends fgui.GComponent {
  13217. static createInstance() {
  13218. return (fgui.UIPackage.createObject("game", "Component31"));
  13219. }
  13220. onConstruct() {
  13221. this.n55 = (this.getChild("n55"));
  13222. this.n54 = (this.getChild("n54"));
  13223. this.conditionTxt = (this.getChild("conditionTxt"));
  13224. this.n57 = (this.getChild("n57"));
  13225. this.t0 = this.getTransition("t0");
  13226. }
  13227. }
  13228. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13229. class ui_Component32 extends fgui.GComponent {
  13230. static createInstance() {
  13231. return (fgui.UIPackage.createObject("game", "Component32"));
  13232. }
  13233. onConstruct() {
  13234. this.n5 = (this.getChild("n5"));
  13235. this.n6 = (this.getChild("n6"));
  13236. this.n7 = (this.getChild("n7"));
  13237. this.t0 = this.getTransition("t0");
  13238. }
  13239. }
  13240. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13241. class ui_AwardItem extends fgui.GComponent {
  13242. static createInstance() {
  13243. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13244. }
  13245. onConstruct() {
  13246. this.n9 = (this.getChild("n9"));
  13247. this.myIcon = (this.getChild("myIcon"));
  13248. this.numTxt = (this.getChild("numTxt"));
  13249. this.nameTxt = (this.getChild("nameTxt"));
  13250. this.n16 = (this.getChild("n16"));
  13251. this.n17 = (this.getChild("n17"));
  13252. }
  13253. }
  13254. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13255. class ui_ranking_com1 extends fgui.GButton {
  13256. static createInstance() {
  13257. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13258. }
  13259. onConstruct() {
  13260. this.c1 = this.getController("c1");
  13261. this.n49 = (this.getChild("n49"));
  13262. this.n18 = (this.getChild("n18"));
  13263. this.n46 = (this.getChild("n46"));
  13264. this.n48 = (this.getChild("n48"));
  13265. this.n50 = (this.getChild("n50"));
  13266. }
  13267. }
  13268. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13269. class ui_ranking_com2 extends fgui.GButton {
  13270. static createInstance() {
  13271. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13272. }
  13273. onConstruct() {
  13274. this.c1 = this.getController("c1");
  13275. this.n49 = (this.getChild("n49"));
  13276. this.n18 = (this.getChild("n18"));
  13277. this.n46 = (this.getChild("n46"));
  13278. this.n48 = (this.getChild("n48"));
  13279. this.n50 = (this.getChild("n50"));
  13280. }
  13281. }
  13282. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13283. class ui_ranking_com3 extends fgui.GComponent {
  13284. static createInstance() {
  13285. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13286. }
  13287. onConstruct() {
  13288. this.n17 = (this.getChild("n17"));
  13289. this.myIcon = (this.getChild("myIcon"));
  13290. }
  13291. }
  13292. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13293. class ui_ranking_com4 extends fgui.GComponent {
  13294. static createInstance() {
  13295. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13296. }
  13297. onConstruct() {
  13298. this.n16 = (this.getChild("n16"));
  13299. this.head = (this.getChild("head"));
  13300. }
  13301. }
  13302. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13303. class ui_ranking_com5 extends fgui.GComponent {
  13304. static createInstance() {
  13305. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13306. }
  13307. onConstruct() {
  13308. this.c1 = this.getController("c1");
  13309. this.c2 = this.getController("c2");
  13310. this.n2 = (this.getChild("n2"));
  13311. this.n3 = (this.getChild("n3"));
  13312. this.levelBtn = (this.getChild("levelBtn"));
  13313. this.starBtn = (this.getChild("starBtn"));
  13314. this.n23 = (this.getChild("n23"));
  13315. this.n24 = (this.getChild("n24"));
  13316. this.n25 = (this.getChild("n25"));
  13317. this.myList = (this.getChild("myList"));
  13318. this.selfNode = (this.getChild("selfNode"));
  13319. this.n9 = (this.getChild("n9"));
  13320. this.n12 = (this.getChild("n12"));
  13321. this.n13 = (this.getChild("n13"));
  13322. this.n14 = (this.getChild("n14"));
  13323. this.n39 = (this.getChild("n39"));
  13324. this.n41 = (this.getChild("n41"));
  13325. this.n42 = (this.getChild("n42"));
  13326. this.n45 = (this.getChild("n45"));
  13327. this.changeBtn = (this.getChild("changeBtn"));
  13328. this.closeBtn = (this.getChild("closeBtn"));
  13329. this.t0 = this.getTransition("t0");
  13330. }
  13331. }
  13332. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13333. class ui_RankItem extends fgui.GComponent {
  13334. static createInstance() {
  13335. return (fgui.UIPackage.createObject("game", "RankItem"));
  13336. }
  13337. onConstruct() {
  13338. this.n10 = (this.getChild("n10"));
  13339. this.n11 = (this.getChild("n11"));
  13340. this.rankTxt = (this.getChild("rankTxt"));
  13341. this.headNode = (this.getChild("headNode"));
  13342. this.nameTxt = (this.getChild("nameTxt"));
  13343. this.n19 = (this.getChild("n19"));
  13344. this.valueTxt = (this.getChild("valueTxt"));
  13345. this.img1 = (this.getChild("img1"));
  13346. this.img2 = (this.getChild("img2"));
  13347. this.img3 = (this.getChild("img3"));
  13348. }
  13349. }
  13350. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13351. class ui_ranking_com9 extends fgui.GComponent {
  13352. static createInstance() {
  13353. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13354. }
  13355. onConstruct() {
  13356. this.c1 = this.getController("c1");
  13357. this.n27 = (this.getChild("n27"));
  13358. this.n28 = (this.getChild("n28"));
  13359. this.headNode = (this.getChild("headNode"));
  13360. this.rankTxt = (this.getChild("rankTxt"));
  13361. this.nameTxt = (this.getChild("nameTxt"));
  13362. this.n34 = (this.getChild("n34"));
  13363. this.valueTxt = (this.getChild("valueTxt"));
  13364. this.n36 = (this.getChild("n36"));
  13365. this.n37 = (this.getChild("n37"));
  13366. this.n38 = (this.getChild("n38"));
  13367. this.n39 = (this.getChild("n39"));
  13368. this.n40 = (this.getChild("n40"));
  13369. }
  13370. }
  13371. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13372. class ui_ranking_com10 extends fgui.GComponent {
  13373. static createInstance() {
  13374. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13375. }
  13376. onConstruct() {
  13377. this.n23 = (this.getChild("n23"));
  13378. this.n24 = (this.getChild("n24"));
  13379. }
  13380. }
  13381. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13382. class ui_ranking_com11 extends fgui.GComponent {
  13383. static createInstance() {
  13384. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13385. }
  13386. onConstruct() {
  13387. this.n24 = (this.getChild("n24"));
  13388. this.n25 = (this.getChild("n25"));
  13389. this.t0 = this.getTransition("t0");
  13390. }
  13391. }
  13392. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13393. class ui_ranking_com13 extends fgui.GButton {
  13394. static createInstance() {
  13395. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13396. }
  13397. onConstruct() {
  13398. this.c1 = this.getController("c1");
  13399. this.n44 = (this.getChild("n44"));
  13400. this.n45 = (this.getChild("n45"));
  13401. this.n46 = (this.getChild("n46"));
  13402. }
  13403. }
  13404. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13405. class ui_Component122 extends fgui.GComponent {
  13406. static createInstance() {
  13407. return (fgui.UIPackage.createObject("game", "Component122"));
  13408. }
  13409. onConstruct() {
  13410. this.gameNode1 = (this.getChild("gameNode1"));
  13411. this.gameNode2 = (this.getChild("gameNode2"));
  13412. this.gameNode3 = (this.getChild("gameNode3"));
  13413. }
  13414. }
  13415. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13416. class ui_skillItem extends fgui.GComponent {
  13417. static createInstance() {
  13418. return (fgui.UIPackage.createObject("game", "skillItem"));
  13419. }
  13420. onConstruct() {
  13421. this.c1 = this.getController("c1");
  13422. this.n31 = (this.getChild("n31"));
  13423. this.n6 = (this.getChild("n6"));
  13424. this.skillImg = (this.getChild("skillImg"));
  13425. this.nameTxt = (this.getChild("nameTxt"));
  13426. this.levelTxt = (this.getChild("levelTxt"));
  13427. this.n28 = (this.getChild("n28"));
  13428. this.describeTxt = (this.getChild("describeTxt"));
  13429. this.n32 = (this.getChild("n32"));
  13430. this.mutiBtn = (this.getChild("mutiBtn"));
  13431. this.tryNode = (this.getChild("tryNode"));
  13432. this.normalBtn = (this.getChild("normalBtn"));
  13433. this.startBtn = (this.getChild("startBtn"));
  13434. this.n42 = (this.getChild("n42"));
  13435. this.n43 = (this.getChild("n43"));
  13436. this.n44 = (this.getChild("n44"));
  13437. }
  13438. }
  13439. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13440. class ui_Component26 extends fgui.GButton {
  13441. static createInstance() {
  13442. return (fgui.UIPackage.createObject("game", "Component26"));
  13443. }
  13444. onConstruct() {
  13445. this.n11 = (this.getChild("n11"));
  13446. this.n30 = (this.getChild("n30"));
  13447. this.n34 = (this.getChild("n34"));
  13448. }
  13449. }
  13450. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13451. class ui_Component28 extends fgui.GButton {
  13452. static createInstance() {
  13453. return (fgui.UIPackage.createObject("game", "Component28"));
  13454. }
  13455. onConstruct() {
  13456. this.n12 = (this.getChild("n12"));
  13457. this.n31 = (this.getChild("n31"));
  13458. this.curTxt = (this.getChild("curTxt"));
  13459. this.n33 = (this.getChild("n33"));
  13460. }
  13461. }
  13462. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13463. class ui_Component113 extends fgui.GComponent {
  13464. static createInstance() {
  13465. return (fgui.UIPackage.createObject("game", "Component113"));
  13466. }
  13467. onConstruct() {
  13468. this.n85 = (this.getChild("n85"));
  13469. this.n86 = (this.getChild("n86"));
  13470. this.n77 = (this.getChild("n77"));
  13471. this.n79 = (this.getChild("n79"));
  13472. this.n80 = (this.getChild("n80"));
  13473. this.n81 = (this.getChild("n81"));
  13474. this.n82 = (this.getChild("n82"));
  13475. this.n84 = (this.getChild("n84"));
  13476. this.n87 = (this.getChild("n87"));
  13477. this.t0 = this.getTransition("t0");
  13478. }
  13479. }
  13480. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13481. class ui_Component114 extends fgui.GComponent {
  13482. static createInstance() {
  13483. return (fgui.UIPackage.createObject("game", "Component114"));
  13484. }
  13485. onConstruct() {
  13486. this.n77 = (this.getChild("n77"));
  13487. this.t0 = this.getTransition("t0");
  13488. }
  13489. }
  13490. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13491. class ui_Component115 extends fgui.GComponent {
  13492. static createInstance() {
  13493. return (fgui.UIPackage.createObject("game", "Component115"));
  13494. }
  13495. onConstruct() {
  13496. this.n83 = (this.getChild("n83"));
  13497. this.fingerNode = (this.getChild("fingerNode"));
  13498. this.n84 = (this.getChild("n84"));
  13499. }
  13500. }
  13501. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13502. class ui_Component117 extends fgui.GComponent {
  13503. static createInstance() {
  13504. return (fgui.UIPackage.createObject("game", "Component117"));
  13505. }
  13506. onConstruct() {
  13507. this.n87 = (this.getChild("n87"));
  13508. this.n88 = (this.getChild("n88"));
  13509. this.n84 = (this.getChild("n84"));
  13510. this.n85 = (this.getChild("n85"));
  13511. this.n86 = (this.getChild("n86"));
  13512. this.t0 = this.getTransition("t0");
  13513. }
  13514. }
  13515. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13516. class ui_Component98_1 extends fgui.GButton {
  13517. static createInstance() {
  13518. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13519. }
  13520. onConstruct() {
  13521. this.c1 = this.getController("c1");
  13522. this.n8 = (this.getChild("n8"));
  13523. this.n41 = (this.getChild("n41"));
  13524. this.n40 = (this.getChild("n40"));
  13525. }
  13526. }
  13527. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13528. class ui_Component61 extends fgui.GComponent {
  13529. static createInstance() {
  13530. return (fgui.UIPackage.createObject("game", "Component61"));
  13531. }
  13532. onConstruct() {
  13533. this.n14 = (this.getChild("n14"));
  13534. this.n6 = (this.getChild("n6"));
  13535. this.t0 = this.getTransition("t0");
  13536. }
  13537. }
  13538. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13539. class ui_Component62 extends fgui.GComponent {
  13540. static createInstance() {
  13541. return (fgui.UIPackage.createObject("game", "Component62"));
  13542. }
  13543. onConstruct() {
  13544. this.n66 = (this.getChild("n66"));
  13545. this.n56 = (this.getChild("n56"));
  13546. this.n63 = (this.getChild("n63"));
  13547. this.n65 = (this.getChild("n65"));
  13548. this.t0 = this.getTransition("t0");
  13549. }
  13550. }
  13551. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13552. class ui_d3Root extends fgui.GComponent {
  13553. static createInstance() {
  13554. return (fgui.UIPackage.createObject("game", "d3Root"));
  13555. }
  13556. onConstruct() {
  13557. }
  13558. }
  13559. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13560. class ui_d2Root extends fgui.GComponent {
  13561. static createInstance() {
  13562. return (fgui.UIPackage.createObject("game", "d2Root"));
  13563. }
  13564. onConstruct() {
  13565. }
  13566. }
  13567. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13568. class ui_ballNode extends fgui.GComponent {
  13569. static createInstance() {
  13570. return (fgui.UIPackage.createObject("game", "ballNode"));
  13571. }
  13572. onConstruct() {
  13573. }
  13574. }
  13575. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13576. class ui_border extends fgui.GComponent {
  13577. static createInstance() {
  13578. return (fgui.UIPackage.createObject("game", "border"));
  13579. }
  13580. onConstruct() {
  13581. this.bar1 = (this.getChild("bar1"));
  13582. this.bar2 = (this.getChild("bar2"));
  13583. this.bar3 = (this.getChild("bar3"));
  13584. this.bar4 = (this.getChild("bar4"));
  13585. this.bar5 = (this.getChild("bar5"));
  13586. this.bar6 = (this.getChild("bar6"));
  13587. this.circle1 = (this.getChild("circle1"));
  13588. this.circle2 = (this.getChild("circle2"));
  13589. this.circle3 = (this.getChild("circle3"));
  13590. this.circle4 = (this.getChild("circle4"));
  13591. this.circle5 = (this.getChild("circle5"));
  13592. this.circle6 = (this.getChild("circle6"));
  13593. this.n28 = (this.getChild("n28"));
  13594. }
  13595. }
  13596. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13597. class ui_Component41_2 extends fgui.GComponent {
  13598. static createInstance() {
  13599. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13600. }
  13601. onConstruct() {
  13602. this.c1 = this.getController("c1");
  13603. this.n0 = (this.getChild("n0"));
  13604. this.n2 = (this.getChild("n2"));
  13605. this.n19 = (this.getChild("n19"));
  13606. this.cancelBtn = (this.getChild("cancelBtn"));
  13607. this.videoBtn = (this.getChild("videoBtn"));
  13608. this.n9 = (this.getChild("n9"));
  13609. this.n22 = (this.getChild("n22"));
  13610. this.tipsTxt = (this.getChild("tipsTxt"));
  13611. this.n23 = (this.getChild("n23"));
  13612. this.n24 = (this.getChild("n24"));
  13613. this.n26 = (this.getChild("n26"));
  13614. this.n27 = (this.getChild("n27"));
  13615. this.titleTxt = (this.getChild("titleTxt"));
  13616. }
  13617. }
  13618. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13619. class ui_Component41_1 extends fgui.GComponent {
  13620. static createInstance() {
  13621. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13622. }
  13623. onConstruct() {
  13624. this.c1 = this.getController("c1");
  13625. this.n0 = (this.getChild("n0"));
  13626. this.n2 = (this.getChild("n2"));
  13627. this.cancelBtn = (this.getChild("cancelBtn"));
  13628. this.videoBtn = (this.getChild("videoBtn"));
  13629. this.n27 = (this.getChild("n27"));
  13630. this.n30 = (this.getChild("n30"));
  13631. this.n31 = (this.getChild("n31"));
  13632. this.n32 = (this.getChild("n32"));
  13633. this.n33 = (this.getChild("n33"));
  13634. this.n34 = (this.getChild("n34"));
  13635. this.n35 = (this.getChild("n35"));
  13636. this.n36 = (this.getChild("n36"));
  13637. this.n1 = (this.getChild("n1"));
  13638. this.n37 = (this.getChild("n37"));
  13639. this.t0 = this.getTransition("t0");
  13640. this.t1 = this.getTransition("t1");
  13641. this.t2 = this.getTransition("t2");
  13642. this.t3 = this.getTransition("t3");
  13643. }
  13644. }
  13645. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13646. class ui_againBtn extends fgui.GButton {
  13647. static createInstance() {
  13648. return (fgui.UIPackage.createObject("game", "againBtn"));
  13649. }
  13650. onConstruct() {
  13651. this.n2 = (this.getChild("n2"));
  13652. this.n1 = (this.getChild("n1"));
  13653. this.n5 = (this.getChild("n5"));
  13654. }
  13655. }
  13656. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13657. class ui_Component118 extends fgui.GButton {
  13658. static createInstance() {
  13659. return (fgui.UIPackage.createObject("game", "Component118"));
  13660. }
  13661. onConstruct() {
  13662. this.c1 = this.getController("c1");
  13663. this.n14 = (this.getChild("n14"));
  13664. this.n9 = (this.getChild("n9"));
  13665. this.n10 = (this.getChild("n10"));
  13666. this.diamondTxt = (this.getChild("diamondTxt"));
  13667. this.n13 = (this.getChild("n13"));
  13668. this.n15 = (this.getChild("n15"));
  13669. }
  13670. }
  13671. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13672. class ui_Component119 extends fgui.GComponent {
  13673. static createInstance() {
  13674. return (fgui.UIPackage.createObject("game", "Component119"));
  13675. }
  13676. onConstruct() {
  13677. this.n1 = (this.getChild("n1"));
  13678. this.n2 = (this.getChild("n2"));
  13679. this.n13 = (this.getChild("n13"));
  13680. this.n6 = (this.getChild("n6"));
  13681. this.screenNode = (this.getChild("screenNode"));
  13682. this.n15 = (this.getChild("n15"));
  13683. this.closeBtn = (this.getChild("closeBtn"));
  13684. this.share2Btn = (this.getChild("share2Btn"));
  13685. this.shareBtn = (this.getChild("shareBtn"));
  13686. this.tipsNode = (this.getChild("tipsNode"));
  13687. this.awardNode = (this.getChild("awardNode"));
  13688. }
  13689. }
  13690. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13691. class ui_Component132_1 extends fgui.GComponent {
  13692. static createInstance() {
  13693. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13694. }
  13695. onConstruct() {
  13696. this.n25 = (this.getChild("n25"));
  13697. this.n26 = (this.getChild("n26"));
  13698. this.n27 = (this.getChild("n27"));
  13699. this.t0 = this.getTransition("t0");
  13700. }
  13701. }
  13702. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13703. class ui_SecretaryDisplay extends fgui.GComponent {
  13704. static createInstance() {
  13705. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13706. }
  13707. onConstruct() {
  13708. this.n2 = (this.getChild("n2"));
  13709. this.levelTxt = (this.getChild("levelTxt"));
  13710. this.n4 = (this.getChild("n4"));
  13711. this.secretary = (this.getChild("secretary"));
  13712. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13713. this.n16 = (this.getChild("n16"));
  13714. this.n37 = (this.getChild("n37"));
  13715. this.n41 = (this.getChild("n41"));
  13716. this.n14 = (this.getChild("n14"));
  13717. this.n17 = (this.getChild("n17"));
  13718. this.heightTxt = (this.getChild("heightTxt"));
  13719. this.n46 = (this.getChild("n46"));
  13720. this.n36 = (this.getChild("n36"));
  13721. this.n38 = (this.getChild("n38"));
  13722. this.foodTxt = (this.getChild("foodTxt"));
  13723. this.n47 = (this.getChild("n47"));
  13724. this.n40 = (this.getChild("n40"));
  13725. this.n42 = (this.getChild("n42"));
  13726. this.historyTxt = (this.getChild("historyTxt"));
  13727. this.n48 = (this.getChild("n48"));
  13728. this.nameImg = (this.getChild("nameImg"));
  13729. this.n12 = (this.getChild("n12"));
  13730. this.n49 = (this.getChild("n49"));
  13731. this.t0 = this.getTransition("t0");
  13732. }
  13733. }
  13734. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13735. class ui_BallRodDisplay extends fgui.GComponent {
  13736. static createInstance() {
  13737. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13738. }
  13739. onConstruct() {
  13740. this.c1 = this.getController("c1");
  13741. this.n31 = (this.getChild("n31"));
  13742. this.n6 = (this.getChild("n6"));
  13743. this.nameTxt = (this.getChild("nameTxt"));
  13744. this.rodImg = (this.getChild("rodImg"));
  13745. this.levelNode = (this.getChild("levelNode"));
  13746. this.eftRod = (this.getChild("eftRod"));
  13747. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13748. }
  13749. }
  13750. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13751. class ui_Component109 extends fgui.GComponent {
  13752. static createInstance() {
  13753. return (fgui.UIPackage.createObject("game", "Component109"));
  13754. }
  13755. onConstruct() {
  13756. this.n65 = (this.getChild("n65"));
  13757. this.n64 = (this.getChild("n64"));
  13758. this.n62 = (this.getChild("n62"));
  13759. this.n63 = (this.getChild("n63"));
  13760. this.t0 = this.getTransition("t0");
  13761. }
  13762. }
  13763. ui_Component109.URL = "ui://isxx5ak7vhzhv4hi";
  13764. class ui_Component110 extends fgui.GComponent {
  13765. static createInstance() {
  13766. return (fgui.UIPackage.createObject("game", "Component110"));
  13767. }
  13768. onConstruct() {
  13769. this.n65 = (this.getChild("n65"));
  13770. this.n64 = (this.getChild("n64"));
  13771. this.n62 = (this.getChild("n62"));
  13772. this.n63 = (this.getChild("n63"));
  13773. this.t0 = this.getTransition("t0");
  13774. }
  13775. }
  13776. ui_Component110.URL = "ui://isxx5ak7vhzhv4hj";
  13777. class ui_Component111_11 extends fgui.GComponent {
  13778. static createInstance() {
  13779. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13780. }
  13781. onConstruct() {
  13782. this.n68 = (this.getChild("n68"));
  13783. this.n69 = (this.getChild("n69"));
  13784. }
  13785. }
  13786. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13787. class ui_Component112 extends fgui.GComponent {
  13788. static createInstance() {
  13789. return (fgui.UIPackage.createObject("game", "Component112"));
  13790. }
  13791. onConstruct() {
  13792. this.n68 = (this.getChild("n68"));
  13793. this.n70 = (this.getChild("n70"));
  13794. this.myMask = (this.getChild("myMask"));
  13795. }
  13796. }
  13797. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13798. class ui_Component111 extends fgui.GComponent {
  13799. static createInstance() {
  13800. return (fgui.UIPackage.createObject("game", "Component111"));
  13801. }
  13802. onConstruct() {
  13803. this.n68 = (this.getChild("n68"));
  13804. this.myMask = (this.getChild("myMask"));
  13805. }
  13806. }
  13807. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13808. class ui_Component144 extends fgui.GButton {
  13809. static createInstance() {
  13810. return (fgui.UIPackage.createObject("game", "Component144"));
  13811. }
  13812. onConstruct() {
  13813. this.n8 = (this.getChild("n8"));
  13814. }
  13815. }
  13816. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13817. class ui_Sign_com2 extends fgui.GComponent {
  13818. static createInstance() {
  13819. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13820. }
  13821. onConstruct() {
  13822. this.n0 = (this.getChild("n0"));
  13823. this.n1 = (this.getChild("n1"));
  13824. this.t0 = this.getTransition("t0");
  13825. }
  13826. }
  13827. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13828. class ui_Sign_guang extends fgui.GComponent {
  13829. static createInstance() {
  13830. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13831. }
  13832. onConstruct() {
  13833. this.n1 = (this.getChild("n1"));
  13834. this.n2 = (this.getChild("n2"));
  13835. this.n3 = (this.getChild("n3"));
  13836. this.n4 = (this.getChild("n4"));
  13837. this.n5 = (this.getChild("n5"));
  13838. this.n6 = (this.getChild("n6"));
  13839. this.n8 = (this.getChild("n8"));
  13840. this.t0 = this.getTransition("t0");
  13841. }
  13842. }
  13843. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13844. class ui_SignMax extends fgui.GComponent {
  13845. static createInstance() {
  13846. return (fgui.UIPackage.createObject("game", "SignMax"));
  13847. }
  13848. onConstruct() {
  13849. this.c1 = this.getController("c1");
  13850. this.n7 = (this.getChild("n7"));
  13851. this.n15 = (this.getChild("n15"));
  13852. this.n8 = (this.getChild("n8"));
  13853. this.titleTxt = (this.getChild("titleTxt"));
  13854. this.myIcon1 = (this.getChild("myIcon1"));
  13855. this.numTxt1 = (this.getChild("numTxt1"));
  13856. this.myIcon2 = (this.getChild("myIcon2"));
  13857. this.n20 = (this.getChild("n20"));
  13858. this.n17 = (this.getChild("n17"));
  13859. this.numTxt2 = (this.getChild("numTxt2"));
  13860. this.n12 = (this.getChild("n12"));
  13861. this.n13 = (this.getChild("n13"));
  13862. this.n21 = (this.getChild("n21"));
  13863. this.n14 = (this.getChild("n14"));
  13864. }
  13865. }
  13866. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13867. class ui_Sign_com2_1 extends fgui.GComponent {
  13868. static createInstance() {
  13869. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13870. }
  13871. onConstruct() {
  13872. this.n0 = (this.getChild("n0"));
  13873. this.n1 = (this.getChild("n1"));
  13874. this.t0 = this.getTransition("t0");
  13875. }
  13876. }
  13877. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13878. class ui_Sign_com5 extends fgui.GComponent {
  13879. static createInstance() {
  13880. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13881. }
  13882. onConstruct() {
  13883. this.n3 = (this.getChild("n3"));
  13884. this.n29 = (this.getChild("n29"));
  13885. this.n4 = (this.getChild("n4"));
  13886. this.day1 = (this.getChild("day1"));
  13887. this.day2 = (this.getChild("day2"));
  13888. this.day3 = (this.getChild("day3"));
  13889. this.day4 = (this.getChild("day4"));
  13890. this.day5 = (this.getChild("day5"));
  13891. this.day6 = (this.getChild("day6"));
  13892. this.day7 = (this.getChild("day7"));
  13893. this.t0 = this.getTransition("t0");
  13894. }
  13895. }
  13896. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13897. class ui_Sign_com8 extends fgui.GComponent {
  13898. static createInstance() {
  13899. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13900. }
  13901. onConstruct() {
  13902. this.n48 = (this.getChild("n48"));
  13903. this.womanTxt = (this.getChild("womanTxt"));
  13904. this.t0 = this.getTransition("t0");
  13905. }
  13906. }
  13907. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13908. class ui_Sign_com6 extends fgui.GComponent {
  13909. static createInstance() {
  13910. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13911. }
  13912. onConstruct() {
  13913. this.n2 = (this.getChild("n2"));
  13914. this.n3 = (this.getChild("n3"));
  13915. this.t0 = this.getTransition("t0");
  13916. }
  13917. }
  13918. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13919. class ui_Sign_com7 extends fgui.GComponent {
  13920. static createInstance() {
  13921. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13922. }
  13923. onConstruct() {
  13924. this.n29 = (this.getChild("n29"));
  13925. this.n2 = (this.getChild("n2"));
  13926. }
  13927. }
  13928. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13929. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13930. static createInstance() {
  13931. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13932. }
  13933. onConstruct() {
  13934. this.n5 = (this.getChild("n5"));
  13935. this.n4 = (this.getChild("n4"));
  13936. this.t0 = this.getTransition("t0");
  13937. }
  13938. }
  13939. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13940. class ui_UITurntable_com2 extends fgui.GComponent {
  13941. static createInstance() {
  13942. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13943. }
  13944. onConstruct() {
  13945. this.c1 = this.getController("c1");
  13946. this.n4 = (this.getChild("n4"));
  13947. this.n6 = (this.getChild("n6"));
  13948. this.n10 = (this.getChild("n10"));
  13949. this.n11 = (this.getChild("n11"));
  13950. this.n12 = (this.getChild("n12"));
  13951. this.n13 = (this.getChild("n13"));
  13952. this.n14 = (this.getChild("n14"));
  13953. this.n15 = (this.getChild("n15"));
  13954. this.n16 = (this.getChild("n16"));
  13955. this.n17 = (this.getChild("n17"));
  13956. this.n18 = (this.getChild("n18"));
  13957. this.n19 = (this.getChild("n19"));
  13958. this.n20 = (this.getChild("n20"));
  13959. this.n21 = (this.getChild("n21"));
  13960. this.n22 = (this.getChild("n22"));
  13961. this.n23 = (this.getChild("n23"));
  13962. this.n24 = (this.getChild("n24"));
  13963. this.n25 = (this.getChild("n25"));
  13964. this.n26 = (this.getChild("n26"));
  13965. this.n27 = (this.getChild("n27"));
  13966. this.n28 = (this.getChild("n28"));
  13967. this.n29 = (this.getChild("n29"));
  13968. this.n30 = (this.getChild("n30"));
  13969. this.n31 = (this.getChild("n31"));
  13970. this.n32 = (this.getChild("n32"));
  13971. this.n33 = (this.getChild("n33"));
  13972. }
  13973. }
  13974. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13975. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13976. static createInstance() {
  13977. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13978. }
  13979. onConstruct() {
  13980. this.n5 = (this.getChild("n5"));
  13981. this.n4 = (this.getChild("n4"));
  13982. this.t0 = this.getTransition("t0");
  13983. }
  13984. }
  13985. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13986. class ui_UITurntable_com5 extends fgui.GComponent {
  13987. static createInstance() {
  13988. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13989. }
  13990. onConstruct() {
  13991. this.flashNode = (this.getChild("flashNode"));
  13992. this.rotNode = (this.getChild("rotNode"));
  13993. this.n3 = (this.getChild("n3"));
  13994. this.n21 = (this.getChild("n21"));
  13995. this.t0 = this.getTransition("t0");
  13996. }
  13997. }
  13998. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  13999. class ui_UITurntable_com7 extends fgui.GComponent {
  14000. static createInstance() {
  14001. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14002. }
  14003. onConstruct() {
  14004. this.n2 = (this.getChild("n2"));
  14005. this.n35 = (this.getChild("n35"));
  14006. this.img1 = (this.getChild("img1"));
  14007. this.img2 = (this.getChild("img2"));
  14008. this.img3 = (this.getChild("img3"));
  14009. this.img4 = (this.getChild("img4"));
  14010. this.img6 = (this.getChild("img6"));
  14011. this.img5 = (this.getChild("img5"));
  14012. this.txt1 = (this.getChild("txt1"));
  14013. this.txt2 = (this.getChild("txt2"));
  14014. this.txt3 = (this.getChild("txt3"));
  14015. this.txt4 = (this.getChild("txt4"));
  14016. this.txt5 = (this.getChild("txt5"));
  14017. this.txt6 = (this.getChild("txt6"));
  14018. }
  14019. }
  14020. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14021. class ui_UITurntable_com9 extends fgui.GComponent {
  14022. static createInstance() {
  14023. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14024. }
  14025. onConstruct() {
  14026. this.n38 = (this.getChild("n38"));
  14027. this.n39 = (this.getChild("n39"));
  14028. }
  14029. }
  14030. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14031. class ui_UITurntable_com10 extends fgui.GComponent {
  14032. static createInstance() {
  14033. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14034. }
  14035. onConstruct() {
  14036. this.n39 = (this.getChild("n39"));
  14037. this.n40 = (this.getChild("n40"));
  14038. this.t0 = this.getTransition("t0");
  14039. }
  14040. }
  14041. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14042. class ui_UITurntable_com11 extends fgui.GComponent {
  14043. static createInstance() {
  14044. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14045. }
  14046. onConstruct() {
  14047. this.n38 = (this.getChild("n38"));
  14048. this.n39 = (this.getChild("n39"));
  14049. this.n40 = (this.getChild("n40"));
  14050. this.t0 = this.getTransition("t0");
  14051. }
  14052. }
  14053. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14054. class ui_UITurntable_com12 extends fgui.GComponent {
  14055. static createInstance() {
  14056. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14057. }
  14058. onConstruct() {
  14059. this.n43 = (this.getChild("n43"));
  14060. this.barNode = (this.getChild("barNode"));
  14061. this.tipsTxt = (this.getChild("tipsTxt"));
  14062. this.n45 = (this.getChild("n45"));
  14063. this.boxBtn = (this.getChild("boxBtn"));
  14064. }
  14065. }
  14066. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14067. class ui_UITurntable_com1 extends fgui.GButton {
  14068. static createInstance() {
  14069. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14070. }
  14071. onConstruct() {
  14072. this.n41 = (this.getChild("n41"));
  14073. this.n42 = (this.getChild("n42"));
  14074. this.t0 = this.getTransition("t0");
  14075. }
  14076. }
  14077. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14078. class ui_UITurntable_com3 extends fgui.GComponent {
  14079. static createInstance() {
  14080. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14081. }
  14082. onConstruct() {
  14083. this.n48 = (this.getChild("n48"));
  14084. this.womanTxt = (this.getChild("womanTxt"));
  14085. this.t0 = this.getTransition("t0");
  14086. }
  14087. }
  14088. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14089. class ui_cancelBtn2 extends fgui.GButton {
  14090. static createInstance() {
  14091. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14092. }
  14093. onConstruct() {
  14094. this.c1 = this.getController("c1");
  14095. this.n0 = (this.getChild("n0"));
  14096. this.n1 = (this.getChild("n1"));
  14097. this.n2 = (this.getChild("n2"));
  14098. this.n3 = (this.getChild("n3"));
  14099. this.n4 = (this.getChild("n4"));
  14100. this.n5 = (this.getChild("n5"));
  14101. this.n6 = (this.getChild("n6"));
  14102. this.n7 = (this.getChild("n7"));
  14103. this.n8 = (this.getChild("n8"));
  14104. this.powerEft = (this.getChild("powerEft"));
  14105. }
  14106. }
  14107. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14108. class ui_shareBtn2 extends fgui.GButton {
  14109. static createInstance() {
  14110. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14111. }
  14112. onConstruct() {
  14113. this.c1 = this.getController("c1");
  14114. this.n2 = (this.getChild("n2"));
  14115. this.n24 = (this.getChild("n24"));
  14116. this.n1 = (this.getChild("n1"));
  14117. this.n3 = (this.getChild("n3"));
  14118. this.n23 = (this.getChild("n23"));
  14119. this.n4 = (this.getChild("n4"));
  14120. this.n5 = (this.getChild("n5"));
  14121. this.n6 = (this.getChild("n6"));
  14122. this.n20 = (this.getChild("n20"));
  14123. this.n21 = (this.getChild("n21"));
  14124. this.n22 = (this.getChild("n22"));
  14125. this.powerEft = (this.getChild("powerEft"));
  14126. }
  14127. }
  14128. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14129. class ui_UIMoney extends fgui.GComponent {
  14130. static createInstance() {
  14131. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14132. }
  14133. onConstruct() {
  14134. this.c1 = this.getController("c1");
  14135. this.n4 = (this.getChild("n4"));
  14136. this.coinImg = (this.getChild("coinImg"));
  14137. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14138. this.coinTxt = (this.getChild("coinTxt"));
  14139. this.n7 = (this.getChild("n7"));
  14140. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14141. this.diamondTxt = (this.getChild("diamondTxt"));
  14142. this.diamondImg = (this.getChild("diamondImg"));
  14143. this.n12 = (this.getChild("n12"));
  14144. this.powerImg = (this.getChild("powerImg"));
  14145. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14146. this.powerTxt = (this.getChild("powerTxt"));
  14147. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14148. }
  14149. }
  14150. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14151. class ui_backBtn extends fgui.GButton {
  14152. static createInstance() {
  14153. return (fgui.UIPackage.createObject("game", "backBtn"));
  14154. }
  14155. onConstruct() {
  14156. this.n0 = (this.getChild("n0"));
  14157. this.t0 = this.getTransition("t0");
  14158. this.t1 = this.getTransition("t1");
  14159. }
  14160. }
  14161. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14162. class ui_MoneyBtn extends fgui.GButton {
  14163. static createInstance() {
  14164. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14165. }
  14166. onConstruct() {
  14167. this.button = this.getController("button");
  14168. this.n0 = (this.getChild("n0"));
  14169. }
  14170. }
  14171. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14172. class ui_UIMoneyBtn extends fgui.GComponent {
  14173. static createInstance() {
  14174. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14175. }
  14176. onConstruct() {
  14177. this.n1 = (this.getChild("n1"));
  14178. this.closeBtn = (this.getChild("closeBtn"));
  14179. }
  14180. }
  14181. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14182. class ui_Component64 extends fgui.GComponent {
  14183. static createInstance() {
  14184. return (fgui.UIPackage.createObject("game", "Component64"));
  14185. }
  14186. onConstruct() {
  14187. this.n57 = (this.getChild("n57"));
  14188. this.n54 = (this.getChild("n54"));
  14189. this.n55 = (this.getChild("n55"));
  14190. this.n56 = (this.getChild("n56"));
  14191. this.t1 = this.getTransition("t1");
  14192. }
  14193. }
  14194. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14195. class ui_Component41_3 extends fgui.GComponent {
  14196. static createInstance() {
  14197. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14198. }
  14199. onConstruct() {
  14200. this.c1 = this.getController("c1");
  14201. this.n0 = (this.getChild("n0"));
  14202. this.n2 = (this.getChild("n2"));
  14203. this.cancelBtn = (this.getChild("cancelBtn"));
  14204. this.videoBtn = (this.getChild("videoBtn"));
  14205. this.n9 = (this.getChild("n9"));
  14206. this.n24 = (this.getChild("n24"));
  14207. this.n27 = (this.getChild("n27"));
  14208. this.titleTxt = (this.getChild("titleTxt"));
  14209. this.n28 = (this.getChild("n28"));
  14210. this.t0 = this.getTransition("t0");
  14211. }
  14212. }
  14213. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14214. class ui_dh_zs_4 extends fgui.GComponent {
  14215. static createInstance() {
  14216. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14217. }
  14218. onConstruct() {
  14219. this.n1 = (this.getChild("n1"));
  14220. this.n2 = (this.getChild("n2"));
  14221. this.n3 = (this.getChild("n3"));
  14222. this.n4 = (this.getChild("n4"));
  14223. this.n5 = (this.getChild("n5"));
  14224. this.n6 = (this.getChild("n6"));
  14225. this.n8 = (this.getChild("n8"));
  14226. this.t0 = this.getTransition("t0");
  14227. }
  14228. }
  14229. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14230. class ui_Component71_1 extends fgui.GButton {
  14231. static createInstance() {
  14232. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14233. }
  14234. onConstruct() {
  14235. this.n17 = (this.getChild("n17"));
  14236. this.t0 = this.getTransition("t0");
  14237. }
  14238. }
  14239. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14240. class ui_Component83 extends fgui.GComponent {
  14241. static createInstance() {
  14242. return (fgui.UIPackage.createObject("game", "Component83"));
  14243. }
  14244. onConstruct() {
  14245. this.c1 = this.getController("c1");
  14246. this.n17 = (this.getChild("n17"));
  14247. this.n19 = (this.getChild("n19"));
  14248. this.n20 = (this.getChild("n20"));
  14249. }
  14250. }
  14251. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14252. class ui_Component84 extends fgui.GComponent {
  14253. static createInstance() {
  14254. return (fgui.UIPackage.createObject("game", "Component84"));
  14255. }
  14256. onConstruct() {
  14257. this.c1 = this.getController("c1");
  14258. this.n4 = (this.getChild("n4"));
  14259. this.n22 = (this.getChild("n22"));
  14260. this.n23 = (this.getChild("n23"));
  14261. this.numTxt = (this.getChild("numTxt"));
  14262. this.n25 = (this.getChild("n25"));
  14263. this.n26 = (this.getChild("n26"));
  14264. }
  14265. }
  14266. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14267. class ui_Component84_1 extends fgui.GComponent {
  14268. static createInstance() {
  14269. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14270. }
  14271. onConstruct() {
  14272. this.c1 = this.getController("c1");
  14273. this.n4 = (this.getChild("n4"));
  14274. this.n22 = (this.getChild("n22"));
  14275. this.n23 = (this.getChild("n23"));
  14276. this.numTxt = (this.getChild("numTxt"));
  14277. this.n25 = (this.getChild("n25"));
  14278. this.n26 = (this.getChild("n26"));
  14279. }
  14280. }
  14281. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14282. class ui_Component85 extends fgui.GComponent {
  14283. static createInstance() {
  14284. return (fgui.UIPackage.createObject("game", "Component85"));
  14285. }
  14286. onConstruct() {
  14287. this.n1 = (this.getChild("n1"));
  14288. this.n6 = (this.getChild("n6"));
  14289. this.n2 = (this.getChild("n2"));
  14290. this.n3 = (this.getChild("n3"));
  14291. this.levelTxt = (this.getChild("levelTxt"));
  14292. this.n10 = (this.getChild("n10"));
  14293. this.n11 = (this.getChild("n11"));
  14294. this.n12 = (this.getChild("n12"));
  14295. this.n13 = (this.getChild("n13"));
  14296. this.n14 = (this.getChild("n14"));
  14297. this.modeNode = (this.getChild("modeNode"));
  14298. this.n18 = (this.getChild("n18"));
  14299. this.conditionTxt = (this.getChild("conditionTxt"));
  14300. this.diamondNode = (this.getChild("diamondNode"));
  14301. this.coinNode = (this.getChild("coinNode"));
  14302. this.startBtn = (this.getChild("startBtn"));
  14303. this.n28 = (this.getChild("n28"));
  14304. this.displayRoot = (this.getChild("displayRoot"));
  14305. this.t0 = this.getTransition("t0");
  14306. }
  14307. }
  14308. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14309. class ui_Component86 extends fgui.GButton {
  14310. static createInstance() {
  14311. return (fgui.UIPackage.createObject("game", "Component86"));
  14312. }
  14313. onConstruct() {
  14314. this.n15 = (this.getChild("n15"));
  14315. this.t0 = this.getTransition("t0");
  14316. }
  14317. }
  14318. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14319. class ui_Component87 extends fgui.GComponent {
  14320. static createInstance() {
  14321. return (fgui.UIPackage.createObject("game", "Component87"));
  14322. }
  14323. onConstruct() {
  14324. this.n66 = (this.getChild("n66"));
  14325. this.myProgress = (this.getChild("myProgress"));
  14326. this.starAni = (this.getChild("starAni"));
  14327. this.hpTxt = (this.getChild("hpTxt"));
  14328. this.n74 = (this.getChild("n74"));
  14329. this.n73 = (this.getChild("n73"));
  14330. this.ballTxt = (this.getChild("ballTxt"));
  14331. this.n76 = (this.getChild("n76"));
  14332. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14333. this.levelTxt = (this.getChild("levelTxt"));
  14334. this.star1 = (this.getChild("star1"));
  14335. this.star2 = (this.getChild("star2"));
  14336. this.star3 = (this.getChild("star3"));
  14337. }
  14338. }
  14339. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14340. class ui_Component88 extends fgui.GProgressBar {
  14341. static createInstance() {
  14342. return (fgui.UIPackage.createObject("game", "Component88"));
  14343. }
  14344. onConstruct() {
  14345. this.n68 = (this.getChild("n68"));
  14346. this.bar = (this.getChild("bar"));
  14347. }
  14348. }
  14349. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14350. class ui_Component89 extends fgui.GComponent {
  14351. static createInstance() {
  14352. return (fgui.UIPackage.createObject("game", "Component89"));
  14353. }
  14354. onConstruct() {
  14355. this.c1 = this.getController("c1");
  14356. this.n71 = (this.getChild("n71"));
  14357. this.n72 = (this.getChild("n72"));
  14358. }
  14359. }
  14360. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14361. class ui_Component90 extends fgui.GComponent {
  14362. static createInstance() {
  14363. return (fgui.UIPackage.createObject("game", "Component90"));
  14364. }
  14365. onConstruct() {
  14366. this.c1 = this.getController("c1");
  14367. this.n64 = (this.getChild("n64"));
  14368. this.n65 = (this.getChild("n65"));
  14369. this.n66 = (this.getChild("n66"));
  14370. this.t0 = this.getTransition("t0");
  14371. }
  14372. }
  14373. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14374. class ui_Component127 extends fgui.GButton {
  14375. static createInstance() {
  14376. return (fgui.UIPackage.createObject("game", "Component127"));
  14377. }
  14378. onConstruct() {
  14379. this.n5 = (this.getChild("n5"));
  14380. }
  14381. }
  14382. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14383. class gameBinder {
  14384. static bindAll() {
  14385. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14386. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14387. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14388. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14389. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14390. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14391. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14392. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14393. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14394. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14395. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14396. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14397. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14398. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14399. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14400. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14401. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14402. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14403. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14404. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14405. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14406. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14407. fgui.UIObjectFactory.setExtension(ui_Component121.URL, ui_Component121);
  14408. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14409. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14410. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14411. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14412. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14413. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14414. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14415. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14416. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14417. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14418. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14419. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14420. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14421. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14422. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14423. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14424. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14425. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14426. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14427. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14428. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14429. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14430. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14431. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14432. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14433. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14434. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14435. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14436. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14437. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14438. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14439. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14440. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14441. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14442. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14443. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14444. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14445. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14446. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14447. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14448. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14449. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14450. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14451. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14452. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14453. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14454. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14455. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14456. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14457. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14458. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14459. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14460. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14461. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14462. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14463. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14464. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14465. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14466. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14467. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14468. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14469. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14470. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14471. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14472. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14473. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14474. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14475. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14476. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14477. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14478. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14479. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14480. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14481. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14482. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14483. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14484. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14485. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14486. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14487. fgui.UIObjectFactory.setExtension(ui_Component16.URL, ui_Component16);
  14488. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14489. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14490. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14491. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14492. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14493. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14494. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14495. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14496. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14497. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14498. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14499. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14500. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14501. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14502. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14503. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14504. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14505. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14506. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14507. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14508. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14509. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14510. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14511. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14512. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14513. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14514. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14515. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14516. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14517. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14518. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14519. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14520. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14521. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14522. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14523. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14524. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14525. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14526. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14527. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14528. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14529. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14530. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14531. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14532. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14533. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14534. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14535. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14536. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14537. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14538. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14539. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14540. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14541. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14542. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14543. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14544. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14545. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14546. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14547. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14548. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14549. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14550. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14551. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganzi.URL, ui_dh_zy_ganzi);
  14552. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14553. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14554. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14555. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14556. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14557. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14558. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14559. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14560. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14561. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14562. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14563. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14564. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14565. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14566. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14567. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14568. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14569. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14570. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14571. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14572. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14573. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14574. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14575. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14576. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14577. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14578. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14579. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14580. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14581. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14582. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14583. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14584. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14585. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14586. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14587. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14588. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14589. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14590. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14591. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14592. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14593. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14594. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14595. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14596. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14597. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14598. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14599. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14600. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14601. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14602. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14603. fgui.UIObjectFactory.setExtension(ui_Component109.URL, ui_Component109);
  14604. fgui.UIObjectFactory.setExtension(ui_Component110.URL, ui_Component110);
  14605. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14606. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14607. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14608. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14609. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14610. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14611. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14612. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14613. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14614. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14615. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14616. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14617. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14618. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14619. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14620. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14621. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14622. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14623. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14624. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14625. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14626. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14627. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14628. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14629. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14630. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14631. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14632. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14633. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14634. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14635. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14636. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14637. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14638. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14639. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14640. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14641. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14642. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14643. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14644. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14645. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14646. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14647. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14648. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14649. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14650. }
  14651. }
  14652. class ui_btn6 extends fgui.GButton {
  14653. static createInstance() {
  14654. return (fgui.UIPackage.createObject("loading", "btn6"));
  14655. }
  14656. onConstruct() {
  14657. this.n6 = (this.getChild("n6"));
  14658. this.n1 = (this.getChild("n1"));
  14659. }
  14660. }
  14661. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14662. class ui_xyItem extends fgui.GComponent {
  14663. static createInstance() {
  14664. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14665. }
  14666. onConstruct() {
  14667. this.xyItem = (this.getChild("xyItem"));
  14668. }
  14669. }
  14670. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14671. class ui_loadinfo extends fgui.GProgressBar {
  14672. static createInstance() {
  14673. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14674. }
  14675. onConstruct() {
  14676. this.bg = (this.getChild("bg"));
  14677. this.bar = (this.getChild("bar"));
  14678. this.title = (this.getChild("title"));
  14679. this.ani = (this.getChild("ani"));
  14680. }
  14681. }
  14682. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14683. class ui_xyNode extends fgui.GComponent {
  14684. static createInstance() {
  14685. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14686. }
  14687. onConstruct() {
  14688. this.n0 = (this.getChild("n0"));
  14689. this.btnYes = (this.getChild("btnYes"));
  14690. this.btnNo = (this.getChild("btnNo"));
  14691. this.btnKnown = (this.getChild("btnKnown"));
  14692. this.btnSure = (this.getChild("btnSure"));
  14693. this.txtWelcom = (this.getChild("txtWelcom"));
  14694. this.txtXy = (this.getChild("txtXy"));
  14695. this.n75 = (this.getChild("n75"));
  14696. this.btnXy1 = (this.getChild("btnXy1"));
  14697. this.btnXy3 = (this.getChild("btnXy3"));
  14698. this.btnXy2 = (this.getChild("btnXy2"));
  14699. this.n74 = (this.getChild("n74"));
  14700. this.xy1 = (this.getChild("xy1"));
  14701. this.txtTitle = (this.getChild("txtTitle"));
  14702. this.btnBack = (this.getChild("btnBack"));
  14703. this.xyList = (this.getChild("xyList"));
  14704. this.xy2 = (this.getChild("xy2"));
  14705. this.xyNode = (this.getChild("xyNode"));
  14706. }
  14707. }
  14708. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14709. class ui_ageNode extends fgui.GComponent {
  14710. static createInstance() {
  14711. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14712. }
  14713. onConstruct() {
  14714. this.n3 = (this.getChild("n3"));
  14715. this.n7 = (this.getChild("n7"));
  14716. this.n4 = (this.getChild("n4"));
  14717. this.btnAge = (this.getChild("btnAge"));
  14718. this.ageNode = (this.getChild("ageNode"));
  14719. }
  14720. }
  14721. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14722. class ui_rnNode extends fgui.GComponent {
  14723. static createInstance() {
  14724. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14725. }
  14726. onConstruct() {
  14727. this.n28 = (this.getChild("n28"));
  14728. this.n30 = (this.getChild("n30"));
  14729. this.n33 = (this.getChild("n33"));
  14730. this.rn1 = (this.getChild("rn1"));
  14731. this.n40 = (this.getChild("n40"));
  14732. this.n41 = (this.getChild("n41"));
  14733. this.rn3 = (this.getChild("rn3"));
  14734. this.n37 = (this.getChild("n37"));
  14735. this.n39 = (this.getChild("n39"));
  14736. this.rn2 = (this.getChild("rn2"));
  14737. this.n47 = (this.getChild("n47"));
  14738. this.n49 = (this.getChild("n49"));
  14739. this.n44 = (this.getChild("n44"));
  14740. this.inputCode = (this.getChild("inputCode"));
  14741. this.inputName = (this.getChild("inputName"));
  14742. this.n48 = (this.getChild("n48"));
  14743. this.n50 = (this.getChild("n50"));
  14744. this.rn4 = (this.getChild("rn4"));
  14745. this.btnCheck = (this.getChild("btnCheck"));
  14746. this.btnExit = (this.getChild("btnExit"));
  14747. this.btnDone = (this.getChild("btnDone"));
  14748. this.rnNode = (this.getChild("rnNode"));
  14749. }
  14750. }
  14751. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14752. class ui_tipNode extends fgui.GComponent {
  14753. static createInstance() {
  14754. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14755. }
  14756. onConstruct() {
  14757. this.bg = (this.getChild("bg"));
  14758. this.n55 = (this.getChild("n55"));
  14759. this.n56 = (this.getChild("n56"));
  14760. this.tipNode = (this.getChild("tipNode"));
  14761. }
  14762. }
  14763. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14764. class ui_fcmNode extends fgui.GComponent {
  14765. static createInstance() {
  14766. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14767. }
  14768. onConstruct() {
  14769. this.n63 = (this.getChild("n63"));
  14770. this.n62 = (this.getChild("n62"));
  14771. this.btnRn = (this.getChild("btnRn"));
  14772. this.n61 = (this.getChild("n61"));
  14773. this.n58 = (this.getChild("n58"));
  14774. this.fcmNode = (this.getChild("fcmNode"));
  14775. }
  14776. }
  14777. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14778. class ui_msgNode extends fgui.GComponent {
  14779. static createInstance() {
  14780. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14781. }
  14782. onConstruct() {
  14783. this.n69 = (this.getChild("n69"));
  14784. this.txtMsg = (this.getChild("txtMsg"));
  14785. this.msgNode = (this.getChild("msgNode"));
  14786. }
  14787. }
  14788. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14789. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14790. static createInstance() {
  14791. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14792. }
  14793. onConstruct() {
  14794. this.n1 = (this.getChild("n1"));
  14795. this.n13 = (this.getChild("n13"));
  14796. this.n14 = (this.getChild("n14"));
  14797. this.n15 = (this.getChild("n15"));
  14798. this.n3 = (this.getChild("n3"));
  14799. this.n4 = (this.getChild("n4"));
  14800. this.n5 = (this.getChild("n5"));
  14801. this.n6 = (this.getChild("n6"));
  14802. this.n7 = (this.getChild("n7"));
  14803. this.n8 = (this.getChild("n8"));
  14804. this.n9 = (this.getChild("n9"));
  14805. this.n10 = (this.getChild("n10"));
  14806. this.n12 = (this.getChild("n12"));
  14807. this.n11 = (this.getChild("n11"));
  14808. this.n16 = (this.getChild("n16"));
  14809. this.n17 = (this.getChild("n17"));
  14810. this.n18 = (this.getChild("n18"));
  14811. this.n20 = (this.getChild("n20"));
  14812. this.n21 = (this.getChild("n21"));
  14813. this.t0 = this.getTransition("t0");
  14814. }
  14815. }
  14816. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14817. class ui_btn5 extends fgui.GButton {
  14818. static createInstance() {
  14819. return (fgui.UIPackage.createObject("loading", "btn5"));
  14820. }
  14821. onConstruct() {
  14822. this.n9 = (this.getChild("n9"));
  14823. this.n1 = (this.getChild("n1"));
  14824. }
  14825. }
  14826. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14827. class ui_UILoading extends fgui.GComponent {
  14828. static createInstance() {
  14829. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14830. }
  14831. onConstruct() {
  14832. this.n12 = (this.getChild("n12"));
  14833. this.loadinfo = (this.getChild("loadinfo"));
  14834. this.n13 = (this.getChild("n13"));
  14835. this.txtLoad = (this.getChild("txtLoad"));
  14836. this.n19 = (this.getChild("n19"));
  14837. this.n20 = (this.getChild("n20"));
  14838. this.t_d = (this.getChild("t_d"));
  14839. this.n18 = (this.getChild("n18"));
  14840. }
  14841. }
  14842. ui_UILoading.URL = "ui://37nctnhwphc33";
  14843. class ui_AgeItem extends fgui.GComponent {
  14844. static createInstance() {
  14845. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14846. }
  14847. onConstruct() {
  14848. this.txtAge = (this.getChild("txtAge"));
  14849. }
  14850. }
  14851. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14852. class ui_btn1 extends fgui.GButton {
  14853. static createInstance() {
  14854. return (fgui.UIPackage.createObject("loading", "btn1"));
  14855. }
  14856. onConstruct() {
  14857. this.n6 = (this.getChild("n6"));
  14858. this.n1 = (this.getChild("n1"));
  14859. }
  14860. }
  14861. ui_btn1.URL = "ui://37nctnhwxe622p";
  14862. class ui_btn3 extends fgui.GButton {
  14863. static createInstance() {
  14864. return (fgui.UIPackage.createObject("loading", "btn3"));
  14865. }
  14866. onConstruct() {
  14867. this.n9 = (this.getChild("n9"));
  14868. this.n1 = (this.getChild("n1"));
  14869. }
  14870. }
  14871. ui_btn3.URL = "ui://37nctnhwxe622s";
  14872. class ui_btn2 extends fgui.GButton {
  14873. static createInstance() {
  14874. return (fgui.UIPackage.createObject("loading", "btn2"));
  14875. }
  14876. onConstruct() {
  14877. this.n6 = (this.getChild("n6"));
  14878. this.n1 = (this.getChild("n1"));
  14879. }
  14880. }
  14881. ui_btn2.URL = "ui://37nctnhwxe622t";
  14882. class ui_btnBack extends fgui.GButton {
  14883. static createInstance() {
  14884. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14885. }
  14886. onConstruct() {
  14887. this.n6 = (this.getChild("n6"));
  14888. this.n7 = (this.getChild("n7"));
  14889. }
  14890. }
  14891. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14892. class ui_btnXy1 extends fgui.GButton {
  14893. static createInstance() {
  14894. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14895. }
  14896. onConstruct() {
  14897. this.n1 = (this.getChild("n1"));
  14898. }
  14899. }
  14900. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14901. class ui_btnXy2 extends fgui.GButton {
  14902. static createInstance() {
  14903. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14904. }
  14905. onConstruct() {
  14906. this.n1 = (this.getChild("n1"));
  14907. }
  14908. }
  14909. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14910. class ui_btnXy3 extends fgui.GButton {
  14911. static createInstance() {
  14912. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14913. }
  14914. onConstruct() {
  14915. this.n1 = (this.getChild("n1"));
  14916. }
  14917. }
  14918. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14919. class ui_btn4 extends fgui.GButton {
  14920. static createInstance() {
  14921. return (fgui.UIPackage.createObject("loading", "btn4"));
  14922. }
  14923. onConstruct() {
  14924. this.n9 = (this.getChild("n9"));
  14925. this.n1 = (this.getChild("n1"));
  14926. }
  14927. }
  14928. ui_btn4.URL = "ui://37nctnhwxe622z";
  14929. class loadingBinder {
  14930. static bindAll() {
  14931. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14932. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14933. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14934. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14935. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14936. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14937. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14938. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14939. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14940. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14941. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14942. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14943. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14944. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14945. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14946. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14947. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14948. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14949. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14950. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14951. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14952. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14953. }
  14954. }
  14955. class UIMgr {
  14956. constructor() {
  14957. this._stage = null;
  14958. this._uiList = [];
  14959. this._showList = [];
  14960. this._bindPkgList = [];
  14961. this.uiIndex = 0;
  14962. }
  14963. static get inst() {
  14964. if (UIMgr._inst == null) {
  14965. UIMgr._inst = new UIMgr();
  14966. }
  14967. return UIMgr._inst;
  14968. }
  14969. setStage(s) {
  14970. if (this._stage) {
  14971. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14972. return;
  14973. }
  14974. this._stage = s;
  14975. }
  14976. init() {
  14977. this.setStage(Laya.stage);
  14978. fairygui.UIConfig.defaultFont = "微软雅黑";
  14979. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14980. fairygui.UIConfig.packageFileExtension = "obj";
  14981. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14982. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14983. fairygui.GRoot.inst.width = Laya.stage.width;
  14984. fairygui.GRoot.inst.height = Laya.stage.height;
  14985. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14986. }
  14987. addAllUpdate() {
  14988. this.uiIndex = 0;
  14989. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14990. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14991. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14992. }
  14993. }
  14994. }
  14995. bindFUI(pkgname) {
  14996. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  14997. return;
  14998. }
  14999. switch (pkgname) {
  15000. case fguiRes.loading:
  15001. fairygui.UIPackage.addPackage(pkgname);
  15002. loadingBinder.bindAll();
  15003. this._bindPkgList.push(pkgname);
  15004. break;
  15005. case fguiRes.game:
  15006. fairygui.UIPackage.addPackage(pkgname);
  15007. gameBinder.bindAll();
  15008. this._bindPkgList.push(pkgname);
  15009. break;
  15010. default:
  15011. break;
  15012. }
  15013. }
  15014. Show(cls, ...param) {
  15015. let nameStr = cls.uiName;
  15016. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15017. let temp = this._uiList[i];
  15018. let str = temp.className;
  15019. if (str == nameStr) {
  15020. if (temp.isMuti) {
  15021. if (temp.isHide) {
  15022. temp.show(...param);
  15023. this._uiList.splice(i, 1);
  15024. this._uiList.push(temp);
  15025. return temp;
  15026. }
  15027. }
  15028. else {
  15029. temp.show(...param);
  15030. this._uiList.splice(i, 1);
  15031. this._uiList.push(temp);
  15032. return temp;
  15033. }
  15034. }
  15035. }
  15036. let ui = new cls();
  15037. ui.className = nameStr;
  15038. this._showUI(ui, param);
  15039. return ui;
  15040. }
  15041. destroyUI(ui) {
  15042. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15043. let temp = this._uiList[i].className;
  15044. if (temp == ui.className) {
  15045. this._uiList.splice(i, 1);
  15046. break;
  15047. }
  15048. }
  15049. this.checkUIState();
  15050. }
  15051. _showUI(ui, param) {
  15052. this._uiList.push(ui);
  15053. ui.show(...param);
  15054. }
  15055. Hide(uiClass) {
  15056. let ui = this.getUI(uiClass);
  15057. if (ui && !ui.isHide) {
  15058. ui.hide();
  15059. }
  15060. }
  15061. getUI(ui) {
  15062. let nameStr = ui.uiName;
  15063. for (let index = 0; index < this._uiList.length; index++) {
  15064. let temp = this._uiList[index];
  15065. if (temp.className == nameStr) {
  15066. return temp;
  15067. }
  15068. }
  15069. return null;
  15070. }
  15071. isShow(cls) {
  15072. for (var i of this._uiList) {
  15073. if (i instanceof cls) {
  15074. return i.isShowing;
  15075. }
  15076. }
  15077. return false;
  15078. }
  15079. showUINum() {
  15080. let num = 0;
  15081. for (var i of this._uiList) {
  15082. if (i.isShowing) {
  15083. num++;
  15084. }
  15085. }
  15086. return num;
  15087. }
  15088. checkUIState() {
  15089. Laya.timer.clear(this, this._uiCheck);
  15090. Laya.timer.once(400, this, this._uiCheck);
  15091. }
  15092. _uiCheck() {
  15093. let showList = [];
  15094. for (var i of this._uiList) {
  15095. if (!i.isHide) {
  15096. showList.push(i);
  15097. }
  15098. }
  15099. for (let index = 0; index < showList.length; index++) {
  15100. if (index == showList.length - 1) {
  15101. showList[index].checkActive(true);
  15102. }
  15103. else {
  15104. showList[index].checkActive(false);
  15105. }
  15106. }
  15107. }
  15108. showTip(msg, time = 600, size = 30) {
  15109. }
  15110. }
  15111. class UIShowList {
  15112. }
  15113. class SoundMgr {
  15114. constructor() {
  15115. this.soundMax = 4;
  15116. this.isLoad = false;
  15117. this.soundMap = {};
  15118. this.isSound = true;
  15119. this.openShake = true;
  15120. SoundMgr._instance = this;
  15121. }
  15122. static getInstance() {
  15123. if (!this._instance) {
  15124. this._instance = new SoundMgr();
  15125. }
  15126. return this._instance;
  15127. }
  15128. init() {
  15129. console.log('zh:sm init 1');
  15130. Laya.SoundManager.autoReleaseSound = true;
  15131. Laya.SoundManager.autoStopMusic = true;
  15132. Laya.SoundManager.musicVolume = 0.3;
  15133. Laya.SoundManager.soundVolume = 0.5;
  15134. this.musicPlayed = false;
  15135. this.audioUrl = "asset/sound/ogg/";
  15136. console.log('zh:sm init 2');
  15137. console.log('zh:dev type ');
  15138. if (Laya.Browser.onAndroid) {
  15139. console.log('zh:dev type android');
  15140. this.audioUrl = "asset/sound/ogg/";
  15141. this.isLoad = true;
  15142. }
  15143. else {
  15144. console.log('zh:dev type not android');
  15145. this.audioUrl = "asset/sound/mp3/";
  15146. this.isLoad = true;
  15147. }
  15148. }
  15149. onSetting(isS) {
  15150. this.isSound = isS;
  15151. this.mute(!this.isSound);
  15152. }
  15153. clearCount() {
  15154. for (var key in this.soundMap) {
  15155. delete this.soundMap[key];
  15156. }
  15157. }
  15158. playMusic(path, loop = 0) {
  15159. console.log('zh:playMusic 1 PATH=' + path);
  15160. this.musicPath = path;
  15161. if (!this.isLoad)
  15162. console.log('zh:playMusic 2');
  15163. return;
  15164. if (!path || path == "")
  15165. console.log('zh:playMusic 3');
  15166. return;
  15167. if (!this.isSound)
  15168. console.log('zh:playMusic 4');
  15169. return;
  15170. this.musicPlayed = true;
  15171. console.log('zh:playMusic 5');
  15172. let url = this.getUrl(path);
  15173. console.log('zh:playMusic 6' + url);
  15174. if (Laya.Browser.onPC) {
  15175. console.log('zh:playMusic 7');
  15176. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15177. console.log('zh:playMusic 8');
  15178. this.play(url, loop);
  15179. }));
  15180. }
  15181. else
  15182. this.play(url, loop);
  15183. }
  15184. play(url, loop) {
  15185. Laya.SoundManager.playMusic(url, loop);
  15186. }
  15187. getUrl(path) {
  15188. let url = this.audioUrl + path;
  15189. if (Laya.Browser.onAndroid) {
  15190. url += ".ogg";
  15191. }
  15192. else {
  15193. url += ".mp3";
  15194. }
  15195. return url;
  15196. }
  15197. pauseMusic(pause) {
  15198. if (pause) {
  15199. this.mute(true);
  15200. }
  15201. else if (this.isSound)
  15202. this.mute(false);
  15203. }
  15204. stopMusic() {
  15205. Laya.SoundManager.stopMusic();
  15206. if (Moyu.isNeedPlatAudio) {
  15207. Moyu.stopMusic();
  15208. }
  15209. }
  15210. mute(mute) {
  15211. if (Moyu.isNeedPlatAudio) {
  15212. Moyu.pauseMusic(mute);
  15213. }
  15214. else {
  15215. Laya.SoundManager.musicMuted = mute;
  15216. if (!mute && !this.musicPlayed && this.musicPath) {
  15217. this.playMusic(this.musicPath);
  15218. }
  15219. }
  15220. }
  15221. stopSound(path) {
  15222. let url = this.getUrl(path);
  15223. Laya.SoundManager.stopSound(url);
  15224. }
  15225. playSound(path, loop = 1, soundMax = this.soundMax) {
  15226. if (!this.isLoad)
  15227. return;
  15228. if (!this.isSound)
  15229. return;
  15230. if (!path || path == "")
  15231. return;
  15232. let url = this.getUrl(path);
  15233. if (Moyu.isNeedPlatAudio) {
  15234. Moyu.playSound(path, loop == 0);
  15235. }
  15236. else {
  15237. let count = 1;
  15238. if (this.soundMap[path])
  15239. count = this.soundMap[path] + 1;
  15240. if (count > soundMax)
  15241. return;
  15242. this.soundMap[path] = count;
  15243. Laya.SoundManager.playSound(url, loop);
  15244. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15245. }
  15246. }
  15247. removePath(path) {
  15248. if (this.soundMap[path]) {
  15249. let count = this.soundMap[path];
  15250. count--;
  15251. if (count < 1)
  15252. delete this.soundMap[path];
  15253. else
  15254. this.soundMap[path] = count;
  15255. }
  15256. }
  15257. playBtnSound() {
  15258. this.playSound("btn");
  15259. }
  15260. playGetSound() {
  15261. }
  15262. playCloseUISound() {
  15263. }
  15264. }
  15265. SoundMgr._instance = null;
  15266. var Handler$1 = Laya.Handler;
  15267. var EResType;
  15268. (function (EResType) {
  15269. EResType[EResType["none"] = 0] = "none";
  15270. EResType[EResType["nromal"] = 1] = "nromal";
  15271. EResType[EResType["td"] = 2] = "td";
  15272. EResType[EResType["sk"] = 3] = "sk";
  15273. })(EResType || (EResType = {}));
  15274. class CResLoader {
  15275. constructor(doneCall, proCall) {
  15276. this.completrCall = doneCall;
  15277. this.progressCall = proCall;
  15278. this.progressHander = new Handler$1(this, this.onProgress);
  15279. this.tdResMap = {};
  15280. }
  15281. load(resList) {
  15282. this.resCount = 0;
  15283. this.loadCount = 0;
  15284. for (let i = 0; i < resList.length; i++) {
  15285. let path = resList[i];
  15286. if (!path)
  15287. continue;
  15288. this.resCount++;
  15289. let type = this.getResType(path);
  15290. if (type == EResType.nromal)
  15291. this.loadNromal(path);
  15292. else if (type == EResType.td)
  15293. this.loadTd(path);
  15294. }
  15295. }
  15296. getRes(path) {
  15297. let type = this.getResType(path);
  15298. if (type == EResType.nromal)
  15299. return Laya.loader.getRes(path);
  15300. else if (type == EResType.td) {
  15301. let res = this.tdResMap[path];
  15302. if (res)
  15303. return res.clone();
  15304. return null;
  15305. }
  15306. }
  15307. destroy() {
  15308. this.progressHander.clear();
  15309. this.progressHander = null;
  15310. }
  15311. clearRes(path) {
  15312. let type = this.getResType(path);
  15313. if (type == EResType.nromal)
  15314. Laya.loader.clearRes(path);
  15315. else if (type == EResType.td) {
  15316. let obj = this.tdResMap[path];
  15317. if (obj)
  15318. obj.destroy();
  15319. delete this.tdResMap[path];
  15320. }
  15321. }
  15322. getResType(path) {
  15323. let exs = this.getExtension(path);
  15324. if (exs == "sk")
  15325. return EResType.sk;
  15326. if (exs == "ls" || exs == "lh" || exs == "lm")
  15327. return EResType.td;
  15328. else
  15329. return EResType.nromal;
  15330. }
  15331. getExtension(res) {
  15332. var index = res.lastIndexOf(".");
  15333. return res.substr(index + 1);
  15334. }
  15335. loadNromal(path) {
  15336. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15337. if (res) {
  15338. this.onLoad();
  15339. }
  15340. else
  15341. console.log("load res fail:" + path);
  15342. }), this.progressHander);
  15343. }
  15344. loadSk() {
  15345. }
  15346. loadTd(path) {
  15347. if (this.tdResMap[path]) {
  15348. this.onLoad();
  15349. return;
  15350. }
  15351. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15352. if (res) {
  15353. this.tdResMap[path] = res;
  15354. this.onLoad();
  15355. }
  15356. else
  15357. console.log("load res fail:" + path);
  15358. }));
  15359. }
  15360. onLoad() {
  15361. this.loadCount++;
  15362. this.onProgress(1);
  15363. if (this.loadCount >= this.resCount) {
  15364. this.completrCall.run();
  15365. }
  15366. }
  15367. onProgress(pro) {
  15368. let progress = (this.loadCount + pro) / this.resCount;
  15369. this.progressCall.runWith(progress);
  15370. }
  15371. }
  15372. var Handler$2 = Laya.Handler;
  15373. class ResInfo {
  15374. constructor() {
  15375. this.index = 0;
  15376. }
  15377. }
  15378. class ResMgr {
  15379. constructor() {
  15380. this.resList = [];
  15381. this.doneList = [];
  15382. this.resMap = {};
  15383. this.currentLoad = null;
  15384. this.completeHandler = new Handler$2(this, this.onComplete);
  15385. this.progressHandler = new Handler$2(this, this.onProgress);
  15386. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15387. }
  15388. static getInstance() {
  15389. if (ResMgr._instance == null) {
  15390. ResMgr._instance = new ResMgr();
  15391. }
  15392. return ResMgr._instance;
  15393. }
  15394. loadList(list, completeHandler, progressHandler) {
  15395. if (list.length < 1) {
  15396. completeHandler.run();
  15397. return;
  15398. }
  15399. let info = this.getResInfo();
  15400. info.resList = list;
  15401. info.completeHandler = completeHandler;
  15402. info.progressHandler = progressHandler;
  15403. this.resList.push(info);
  15404. this.startLoad();
  15405. }
  15406. loadFguiRes(list, completeHandler, progressHandler) {
  15407. Laya.loader.load(list, completeHandler, progressHandler);
  15408. }
  15409. loadAny(list, completeHandler, progressHandler) {
  15410. Laya.loader.load(list, completeHandler, progressHandler);
  15411. }
  15412. load(path, completeHandler, progressHandler) {
  15413. let count = this.resMap[path];
  15414. if (count && count > 0) {
  15415. if (completeHandler)
  15416. completeHandler.run();
  15417. }
  15418. else
  15419. this.loadList([path], completeHandler, progressHandler);
  15420. }
  15421. getRes(path) {
  15422. let res = this.resMap[path];
  15423. if (!res)
  15424. this.showLog("资源不存在:" + path);
  15425. else
  15426. return this.loader.getRes(path);
  15427. }
  15428. clearList(list, force = false) {
  15429. if (!list || list.length < 1)
  15430. return;
  15431. let cr = () => {
  15432. for (const k in list) {
  15433. let v = list[k];
  15434. if (!v)
  15435. continue;
  15436. if (force) {
  15437. this.loader.clearRes(v);
  15438. delete this.resMap[v];
  15439. }
  15440. else {
  15441. let count = this.resMap[v];
  15442. if (count && count > 1) {
  15443. count--;
  15444. this.resMap[v] = count;
  15445. }
  15446. else {
  15447. this.loader.clearRes(v);
  15448. delete this.resMap[v];
  15449. }
  15450. }
  15451. }
  15452. if (!window.hasOwnProperty("ks"))
  15453. Laya.Resource.destroyUnusedResources();
  15454. };
  15455. Laya.timer.clearAll(this);
  15456. Laya.timer.once(2000, this, cr);
  15457. }
  15458. clear3D() {
  15459. for (const k in this.loader.tdResMap) {
  15460. this.loader.clearRes(k);
  15461. if (this.resMap[k])
  15462. delete this.resMap[k];
  15463. }
  15464. if (!window.hasOwnProperty("ks"))
  15465. Laya.Resource.destroyUnusedResources();
  15466. }
  15467. clear(path, force = false) {
  15468. this.clearList([path], force);
  15469. }
  15470. getResInfo() {
  15471. if (this.doneList.length > 0)
  15472. return this.doneList.pop();
  15473. else
  15474. return new ResInfo();
  15475. }
  15476. startLoad() {
  15477. if (this.currentLoad)
  15478. return;
  15479. this.currentLoad = this.resList.pop();
  15480. if (this.currentLoad) {
  15481. this.loader.load(this.currentLoad.resList);
  15482. }
  15483. }
  15484. onComplete() {
  15485. if (!this.currentLoad)
  15486. return;
  15487. for (const k in this.currentLoad.resList) {
  15488. let v = this.currentLoad.resList[k];
  15489. let count = this.resMap[v];
  15490. if (count)
  15491. count++;
  15492. else
  15493. count = 1;
  15494. this.resMap[v] = count;
  15495. }
  15496. if (this.currentLoad.completeHandler)
  15497. this.currentLoad.completeHandler.run();
  15498. this.doneList.push(this.currentLoad);
  15499. this.currentLoad = null;
  15500. this.startLoad();
  15501. }
  15502. onProgress(pro) {
  15503. if (!this.currentLoad)
  15504. return;
  15505. if (this.currentLoad.progressHandler)
  15506. this.currentLoad.progressHandler.runWith(pro);
  15507. }
  15508. showLog(str, ...args) {
  15509. console.log("[ResLoader] " + str);
  15510. }
  15511. }
  15512. ResMgr._instance = null;
  15513. class EventMgr extends Laya.EventDispatcher {
  15514. }
  15515. let eventMgr = new EventMgr();
  15516. class ConfigMgr {
  15517. static getInstance() {
  15518. if (!this._instance) {
  15519. this._instance = new ConfigMgr();
  15520. }
  15521. return this._instance;
  15522. }
  15523. init() {
  15524. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15525. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15526. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15527. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15528. }
  15529. getUserInfoByIndex(index) {
  15530. return this.npcJson[index];
  15531. }
  15532. getRandomUserInfo() {
  15533. let index = xGame.tools.random(0, this.npcJson.length);
  15534. return this.npcJson[index];
  15535. }
  15536. getMaxBigMoveLength() {
  15537. return Object.keys(this.levelCfg).length;
  15538. }
  15539. getBigMoveLevelByIndex(index) {
  15540. let cfg = this.levelCfg;
  15541. cfg = cfg[index];
  15542. return cfg;
  15543. }
  15544. getRandomClassicLevel() {
  15545. let cfg = this.classicCfg;
  15546. let num = Object.keys(cfg).length;
  15547. let rand = xGame.common.randomNum(1, num);
  15548. return cfg[rand];
  15549. }
  15550. getPlaceBallByLevel(level) {
  15551. return this.placeBallCfg[level];
  15552. }
  15553. getMaxPlaceBall() {
  15554. return Object.keys(this.placeBallCfg).length;
  15555. }
  15556. }
  15557. class PoolD3Mgr {
  15558. constructor() {
  15559. this.pool = {};
  15560. }
  15561. static get ins() {
  15562. return this._ins || (this._ins = new PoolD3Mgr);
  15563. }
  15564. createList(key, prefab, parent) {
  15565. if (!this.pool[key]) {
  15566. this.pool[key] = {};
  15567. this.pool[key].prefab = prefab;
  15568. this.pool[key].list = [];
  15569. this.pool[key].parent = parent;
  15570. }
  15571. }
  15572. getItem(key) {
  15573. if (!this.pool[key]) {
  15574. return;
  15575. }
  15576. let temp;
  15577. if (this.pool[key].list.length > 0) {
  15578. temp = this.pool[key].list.pop();
  15579. }
  15580. else {
  15581. temp = this.pool[key].prefab.clone();
  15582. if (this.pool[key].parent) {
  15583. this.pool[key].parent.addChild(temp);
  15584. }
  15585. }
  15586. temp.active = true;
  15587. return temp;
  15588. }
  15589. putItem(key, obj) {
  15590. if (!this.pool[key]) {
  15591. return;
  15592. }
  15593. obj.active = false;
  15594. this.pool[key].list.push(obj);
  15595. }
  15596. }
  15597. let context$1 = context;
  15598. let uiMgr = UIMgr.inst;
  15599. let soundMgr = SoundMgr.getInstance();
  15600. let resMgr = ResMgr.getInstance();
  15601. let httpMgr = HttpMgr.getInstance();
  15602. let common = Common.getInstance();
  15603. let cfgMgr = ConfigMgr.getInstance();
  15604. let poolD3Mgr = PoolD3Mgr.ins;
  15605. let d3TexUrl = "res/d3Res/";
  15606. let d3ModeUrl = "res/unityRes/";
  15607. function setStageSize(view) {
  15608. if (view.width) {
  15609. view.width = Laya.stage.width;
  15610. view.height = Laya.stage.height;
  15611. }
  15612. }
  15613. function filledBg(view) {
  15614. let wh = Laya.stage.height / Laya.stage.width;
  15615. if (wh > 16 / 9) {
  15616. view.height = Laya.stage.height;
  15617. view.width = Laya.stage.height / 1334 * 750;
  15618. }
  15619. else {
  15620. view.width = Laya.stage.width;
  15621. view.height = Laya.stage.width / 750 * 1334;
  15622. }
  15623. }
  15624. function setNotch(view) {
  15625. if (view.height) {
  15626. view.y += context$1.notchHeight;
  15627. }
  15628. }
  15629. function showTip(str) {
  15630. uiMgr.Show(UIMsg, str);
  15631. }
  15632. function log(...args) {
  15633. console.log(args);
  15634. }
  15635. let xGame = {
  15636. context: context$1,
  15637. eventMgr,
  15638. resMgr,
  15639. uiMgr,
  15640. soundMgr,
  15641. define,
  15642. tools,
  15643. httpMgr,
  15644. d3TexUrl,
  15645. d3ModeUrl,
  15646. common,
  15647. cfgMgr,
  15648. poolD3Mgr,
  15649. setStageSize,
  15650. filledBg,
  15651. setNotch,
  15652. showTip,
  15653. log,
  15654. };
  15655. window["xGame"] = xGame;
  15656. let dataName = 'tBall_';
  15657. class UserData {
  15658. constructor() {
  15659. this.userId = "";
  15660. this.isAgree = false;
  15661. this.coinNum = 0;
  15662. this.gemNum = 0;
  15663. this.sound = true;
  15664. this.vibration = true;
  15665. this.currentDate = 0;
  15666. this.createTime = 0;
  15667. this.awardTime = 0;
  15668. this.roleId = 1;
  15669. this.roleList = [];
  15670. this.roleAds = [];
  15671. this.dressId = 101;
  15672. this.itemId = 201;
  15673. this.bigSkills = [1, 1, 1, 1, 1];
  15674. this.coin = 4000;
  15675. this.diamond = 0;
  15676. this.skillSuccessTimes = 0;
  15677. this.skillGuide = 0;
  15678. this.skillAccTimes = 0;
  15679. this.placeBallData = [];
  15680. this.shareDiamondTimes = 0;
  15681. this.dailyVideoShareTimes = 0;
  15682. this.secretary = [1, 0];
  15683. this.curSecretary = 0;
  15684. this.ballRod = [1, 0, 0, 0, 0, 1];
  15685. this.curBallRod = 5;
  15686. this.signData = 0;
  15687. this.signTime = 0;
  15688. this.drawTimes = 0;
  15689. this.drawAwardTimes = 0;
  15690. this.dailyfreeDrawTimes = 1;
  15691. this.power = 5;
  15692. this.powerTime = 0;
  15693. this.challengeTimes = 0;
  15694. this.extraSign = 0;
  15695. this.classicTimes = 0;
  15696. this.guideHelpLine = 0;
  15697. this.newUser = true;
  15698. this.rootBallFoul = 0;
  15699. this.timeoutFoul = 0;
  15700. this.roleList = [1];
  15701. }
  15702. saveData() {
  15703. let data = {};
  15704. for (let k in this) {
  15705. data[k.toString()] = this[k];
  15706. }
  15707. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15708. }
  15709. getData() {
  15710. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15711. if (ld) {
  15712. let localData = JSON.parse(ld);
  15713. if (localData) {
  15714. for (let k in this) {
  15715. let key = k.toString();
  15716. let data = localData[key];
  15717. if (data != undefined) {
  15718. this[k] = data;
  15719. }
  15720. }
  15721. }
  15722. }
  15723. }
  15724. }
  15725. class ItemData {
  15726. constructor() {
  15727. this.itemList = {};
  15728. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15729. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15730. }
  15731. saveData() {
  15732. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15733. }
  15734. getData() {
  15735. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15736. if (ld) {
  15737. let localData = JSON.parse(ld);
  15738. if (localData) {
  15739. this.itemList = localData;
  15740. }
  15741. }
  15742. }
  15743. }
  15744. class GameData {
  15745. constructor() {
  15746. this.curLevel = 0;
  15747. this.gameType = 1;
  15748. this.signIdx = 0;
  15749. this.signMax = 0;
  15750. this.rotaryTime = 0;
  15751. this.rotaryCount = 0;
  15752. this.rotaryList = [];
  15753. this.diyCount = 3;
  15754. this.awardIdx = 0;
  15755. this.shareNum = 2;
  15756. this.rankWeek = 0;
  15757. this.rankScore = 0;
  15758. this.gameCount = 0;
  15759. this.trySkill = -1;
  15760. this.tryTime = 0;
  15761. }
  15762. saveData() {
  15763. let data = {};
  15764. for (let k in this) {
  15765. data[k.toString()] = this[k];
  15766. }
  15767. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15768. }
  15769. getData() {
  15770. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15771. if (ld) {
  15772. let localData = JSON.parse(ld);
  15773. if (localData) {
  15774. for (let k in this) {
  15775. let key = k.toString();
  15776. let data = localData[key];
  15777. if (data != undefined) {
  15778. this[k] = data;
  15779. }
  15780. }
  15781. }
  15782. }
  15783. }
  15784. }
  15785. class DataMgr {
  15786. static Init() {
  15787. this.userData = new UserData();
  15788. this.gameData = new GameData();
  15789. this.itemData = new ItemData();
  15790. this.userData.getData();
  15791. this.gameData.getData();
  15792. this.itemData.getData();
  15793. this.roleId = this.userData.roleId;
  15794. this.resetUse();
  15795. }
  15796. static isNewDay() {
  15797. Moyu.isNewDay(this, (isnew) => {
  15798. xGame.common.isNewDay = isnew;
  15799. if (!isnew)
  15800. return;
  15801. DataMgr.setShareDiamondTimes(0, false);
  15802. DataMgr.setDailyVideoShareTimes(0, false);
  15803. DataMgr.setDailyfreeDrawTimes(1);
  15804. DataMgr.setExtraSign(0);
  15805. });
  15806. }
  15807. static deletData() {
  15808. Laya.LocalStorage.clear();
  15809. }
  15810. static upRankData() {
  15811. let num = xGame.common.getAllStarNum();
  15812. if (num > 0)
  15813. Moyu.upRankData(xGame.common.curRankID, num);
  15814. }
  15815. static addItem(id, count = 1) {
  15816. let v = this.itemData.itemList[id];
  15817. if (!v)
  15818. v = { id: id, count: count, adnum: 0, active: true };
  15819. else {
  15820. if (v.active) {
  15821. v.count += count;
  15822. }
  15823. else {
  15824. v.count = count;
  15825. v.active = true;
  15826. }
  15827. }
  15828. this.itemData.itemList[id] = v;
  15829. xGame.soundMgr.playGetSound();
  15830. this.saveItemData();
  15831. }
  15832. static hasItem(id) {
  15833. let v = this.itemData.itemList[id];
  15834. if (v && v.active)
  15835. return true;
  15836. return false;
  15837. }
  15838. static getItem(id) {
  15839. let v = this.itemData.itemList[id];
  15840. return v;
  15841. }
  15842. static getItemCount(id) {
  15843. let v = this.itemData.itemList[id];
  15844. if (v && v.active)
  15845. return v.count;
  15846. return 0;
  15847. }
  15848. static getItemAd(id) {
  15849. let v = this.itemData.itemList[id];
  15850. if (v) {
  15851. return v.adnum;
  15852. }
  15853. return 0;
  15854. }
  15855. static onItemAd(id, num = 1) {
  15856. let v = this.itemData.itemList[id];
  15857. if (!v)
  15858. v = { id: id, count: 1, adnum: num, active: false };
  15859. else
  15860. v.adnum += num;
  15861. this.itemData.itemList[id] = v;
  15862. this.saveItemData();
  15863. }
  15864. static costItem(id, count) {
  15865. let v = this.itemData.itemList[id];
  15866. if (v && v.active) {
  15867. if (v.count < count)
  15868. return false;
  15869. else {
  15870. v.count -= count;
  15871. this.itemData.itemList[id] = v;
  15872. return true;
  15873. }
  15874. }
  15875. return false;
  15876. }
  15877. static resetUse() {
  15878. this.dressId = this.userData.dressId;
  15879. this.itemId = this.userData.itemId;
  15880. }
  15881. static passLevel() {
  15882. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15883. this.gameData.curLevel++;
  15884. this.curLevel = this.gameData.curLevel;
  15885. this.saveGameData();
  15886. }
  15887. static useRole(id) {
  15888. this.roleId = id;
  15889. if (this.hasRole(id)) {
  15890. this.userData.roleId = id;
  15891. this.saveUserData();
  15892. }
  15893. }
  15894. static addRole(id) {
  15895. if (this.hasRole(id))
  15896. return;
  15897. this.userData.roleList.push(id);
  15898. this.saveUserData();
  15899. }
  15900. static hasRole(id) {
  15901. return this.userData.roleList.indexOf(id) >= 0;
  15902. }
  15903. static gemEnough(num) {
  15904. return this.userData.gemNum >= num;
  15905. }
  15906. static roleHasAd(id) {
  15907. let count = this.userData.roleAds[id];
  15908. if (count != undefined && count >= 0)
  15909. return true;
  15910. else
  15911. return false;
  15912. }
  15913. static saveUserData(time = 1000, event, arg) {
  15914. if (this.userSaving)
  15915. return;
  15916. this.userSaving = true;
  15917. Laya.timer.once(time, this, () => {
  15918. this.userSaving = false;
  15919. this.userData.saveData();
  15920. if (event)
  15921. xGame.eventMgr.event(event, arg);
  15922. });
  15923. }
  15924. static saveGameData() {
  15925. if (this.gameSaving)
  15926. return;
  15927. this.gameSaving = true;
  15928. Laya.timer.once(1000, this, () => {
  15929. this.gameSaving = false;
  15930. this.gameData.saveData();
  15931. });
  15932. }
  15933. static saveItemData() {
  15934. let fun = () => {
  15935. this.itemData.saveData();
  15936. };
  15937. Laya.timer.clear(this, fun);
  15938. Laya.timer.once(500, this, fun);
  15939. }
  15940. static saveData() {
  15941. this.saveUserData();
  15942. this.saveGameData();
  15943. }
  15944. static getBigSkillList() {
  15945. return this.userData.bigSkills;
  15946. }
  15947. static getBigSkillByIndex(index) {
  15948. return this.userData.bigSkills[index];
  15949. }
  15950. static setBigSkill(index, val, addUp = true) {
  15951. if (addUp) {
  15952. this.userData.bigSkills[index] += val;
  15953. }
  15954. else {
  15955. this.userData.bigSkills[index] = val;
  15956. }
  15957. this.saveUserData();
  15958. }
  15959. static coinEnough(need) {
  15960. if (typeof need != "number") {
  15961. console.error("金币格式错误");
  15962. return;
  15963. }
  15964. return this.userData.coin >= need;
  15965. }
  15966. static setCoin(val) {
  15967. if (typeof val != "number") {
  15968. return;
  15969. }
  15970. this.userData.coin += val;
  15971. this.saveUserData();
  15972. xGame.eventMgr.event(COIN_CHANGE);
  15973. }
  15974. static getCoin() {
  15975. return this.userData.coin;
  15976. }
  15977. static diamondEnough(need) {
  15978. if (typeof need != "number") {
  15979. console.error("金币格式错误");
  15980. return;
  15981. }
  15982. return this.userData.diamond >= need;
  15983. }
  15984. static setDiamond(val) {
  15985. if (typeof val != "number") {
  15986. return;
  15987. }
  15988. this.userData.diamond += val;
  15989. this.saveUserData();
  15990. xGame.eventMgr.event(DIAMOND_CHANGE);
  15991. }
  15992. static getDiamond() {
  15993. return this.userData.diamond;
  15994. }
  15995. static getSkillSuccessTimes() {
  15996. return this.userData.skillSuccessTimes;
  15997. }
  15998. static setSkillSuccessTimes(val, addUp = true) {
  15999. if (addUp)
  16000. this.userData.skillSuccessTimes += val;
  16001. else
  16002. this.userData.skillSuccessTimes = val;
  16003. this.saveUserData();
  16004. }
  16005. static getSkillAccTimes() {
  16006. return this.userData.skillAccTimes;
  16007. }
  16008. static setSkillAccTimes(val) {
  16009. this.userData.skillAccTimes += val;
  16010. this.saveUserData();
  16011. }
  16012. static getSkillGuide() {
  16013. if (!xGame.common.openGuide) {
  16014. return 1;
  16015. }
  16016. return this.userData.skillGuide;
  16017. }
  16018. static setSkillGuide(val) {
  16019. this.userData.skillGuide = val;
  16020. this.saveUserData();
  16021. }
  16022. static getPlaceBallLevelList() {
  16023. return this.userData.placeBallData;
  16024. }
  16025. static getPlaceBallLevel(level) {
  16026. let arr = this.userData.placeBallData;
  16027. let index = level - 1;
  16028. let out;
  16029. if (arr[index]) {
  16030. out = arr[index];
  16031. }
  16032. else {
  16033. let max = arr.length;
  16034. if (max == index) {
  16035. out = {
  16036. star: 0,
  16037. play: true,
  16038. isCur: true,
  16039. getAward: false
  16040. };
  16041. }
  16042. else {
  16043. out = {
  16044. star: 0,
  16045. play: false,
  16046. getAward: false
  16047. };
  16048. }
  16049. }
  16050. return out;
  16051. }
  16052. static setPlaceBallLevel(level, star) {
  16053. let arr = this.userData.placeBallData;
  16054. let index = level - 1;
  16055. if (arr[index]) {
  16056. arr[index].star = Math.max(arr[index].star, star);
  16057. }
  16058. else {
  16059. let max = arr.length;
  16060. if (max == index) {
  16061. arr.push({
  16062. star: star,
  16063. play: true,
  16064. getAward: false
  16065. });
  16066. }
  16067. else {
  16068. console.error("关卡存储出错");
  16069. }
  16070. }
  16071. this.saveUserData();
  16072. }
  16073. static setPlaceBallAward(level) {
  16074. let arr = this.userData.placeBallData;
  16075. let index = level - 1;
  16076. if (arr[index]) {
  16077. arr[index].getAward = true;
  16078. }
  16079. this.saveUserData();
  16080. }
  16081. static getShareDiamondTimes() {
  16082. return this.userData.shareDiamondTimes;
  16083. }
  16084. static setShareDiamondTimes(val, addUp = true) {
  16085. if (addUp) {
  16086. this.userData.shareDiamondTimes += val;
  16087. }
  16088. else {
  16089. this.userData.shareDiamondTimes = val;
  16090. }
  16091. this.saveUserData();
  16092. }
  16093. static getDailyVideoShareTimes() {
  16094. return this.userData.dailyVideoShareTimes;
  16095. }
  16096. static setDailyVideoShareTimes(val, addUp = true) {
  16097. if (addUp) {
  16098. this.userData.dailyVideoShareTimes += val;
  16099. }
  16100. else {
  16101. this.userData.dailyVideoShareTimes = val;
  16102. }
  16103. this.saveUserData();
  16104. }
  16105. static getSecretary(index) {
  16106. return this.userData.secretary[index];
  16107. }
  16108. static setSecretary(index, val) {
  16109. this.userData.secretary[index] = val;
  16110. this.saveUserData();
  16111. }
  16112. static getCurSecretary() {
  16113. return this.userData.curSecretary;
  16114. }
  16115. static setCurSecretary(index) {
  16116. this.userData.curSecretary = index;
  16117. this.saveUserData();
  16118. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16119. }
  16120. static getBallRod(index) {
  16121. return this.userData.ballRod[index];
  16122. }
  16123. static setBallRod(index, val) {
  16124. this.userData.ballRod[index] = val;
  16125. this.saveUserData();
  16126. }
  16127. static getCurBallRod() {
  16128. return this.userData.curBallRod;
  16129. }
  16130. static setCurBallRod(index) {
  16131. this.userData.curBallRod = index;
  16132. this.saveUserData();
  16133. }
  16134. static setSignData(val) {
  16135. this.userData.signData = val;
  16136. this.saveUserData();
  16137. }
  16138. static getSignData() {
  16139. return this.userData.signData;
  16140. }
  16141. static setSignTime(val) {
  16142. this.userData.signTime = val;
  16143. this.saveUserData();
  16144. }
  16145. static getSignTime() {
  16146. return this.userData.signTime;
  16147. }
  16148. static getDrawTimes() {
  16149. return this.userData.drawTimes;
  16150. }
  16151. static setDrawTimes(val, addUp = true) {
  16152. if (addUp) {
  16153. this.userData.drawTimes += val;
  16154. }
  16155. else {
  16156. this.userData.drawTimes = val;
  16157. }
  16158. this.saveUserData();
  16159. }
  16160. static getDrawAwardTimes() {
  16161. return this.userData.drawAwardTimes;
  16162. }
  16163. static setDrawAwardTimes(val) {
  16164. this.userData.drawAwardTimes = val;
  16165. this.saveUserData();
  16166. }
  16167. static getDailyfreeDrawTimes() {
  16168. return this.userData.dailyfreeDrawTimes;
  16169. }
  16170. static setDailyfreeDrawTimes(val) {
  16171. this.userData.dailyfreeDrawTimes = val;
  16172. this.saveUserData();
  16173. }
  16174. static setPower(val, addUp = true) {
  16175. if (addUp)
  16176. this.userData.power += val;
  16177. else
  16178. this.userData.power = val;
  16179. if (this.userData.power >= xGame.common.maxPower) {
  16180. this.userData.power = xGame.common.maxPower;
  16181. }
  16182. xGame.eventMgr.event(POWER_CHANGE, val);
  16183. this.saveUserData();
  16184. }
  16185. static getPower() {
  16186. return this.userData.power;
  16187. }
  16188. static setPowerTime(val) {
  16189. this.userData.powerTime = val;
  16190. this.saveUserData();
  16191. }
  16192. static getPowerTime() {
  16193. return this.userData.powerTime;
  16194. }
  16195. static powerEnough() {
  16196. return this.getPower() > 0;
  16197. }
  16198. static getChallengeTimes() {
  16199. return this.userData.challengeTimes;
  16200. }
  16201. static setChallengeTimes(val) {
  16202. this.userData.challengeTimes += val;
  16203. this.saveUserData();
  16204. }
  16205. static getExtraSign() {
  16206. return this.userData.extraSign;
  16207. }
  16208. static setExtraSign(val) {
  16209. this.userData.extraSign = val;
  16210. this.saveUserData();
  16211. }
  16212. static getClassicTimes() {
  16213. return this.userData.classicTimes;
  16214. }
  16215. static setClassicTimes() {
  16216. this.userData.classicTimes += 1;
  16217. this.saveUserData();
  16218. }
  16219. static getGuideHelpLine() {
  16220. return this.userData.guideHelpLine;
  16221. }
  16222. static setGuideHelpLine() {
  16223. this.userData.guideHelpLine = 1;
  16224. this.saveUserData();
  16225. }
  16226. static getNewUser() {
  16227. return this.userData.newUser;
  16228. }
  16229. static setNewUser() {
  16230. this.userData.newUser = false;
  16231. this.saveUserData();
  16232. }
  16233. static getRootBallFoul() {
  16234. return this.userData.rootBallFoul;
  16235. }
  16236. static setRootBallFoul() {
  16237. this.userData.rootBallFoul = 1;
  16238. this.saveUserData();
  16239. }
  16240. static getTimeoutFoul() {
  16241. return this.userData.timeoutFoul;
  16242. }
  16243. static setTimeoutFoul() {
  16244. this.userData.timeoutFoul = 1;
  16245. this.saveUserData();
  16246. }
  16247. }
  16248. DataMgr.isNewUser = false;
  16249. DataMgr.fristEnter = true;
  16250. DataMgr.levelType = 0;
  16251. DataMgr.awardId = 0;
  16252. DataMgr.awardCoin = 0;
  16253. DataMgr.sceneId = -1;
  16254. DataMgr.tryId = 0;
  16255. DataMgr.curLevel = 1;
  16256. DataMgr.vipLevel = 0;
  16257. DataMgr.maxLevel = 0;
  16258. DataMgr.awardRatio = 1;
  16259. DataMgr.gameList = [];
  16260. DataMgr.rankList = [];
  16261. DataMgr.recoverTime = 480000;
  16262. DataMgr.minScore = 0;
  16263. DataMgr.rankDis = 0;
  16264. DataMgr.userSaving = false;
  16265. DataMgr.gameSaving = false;
  16266. class D3Tween extends Laya.Script3D {
  16267. constructor() {
  16268. super();
  16269. this.isInited = false;
  16270. }
  16271. ;
  16272. init() {
  16273. if (this.isInited)
  16274. return;
  16275. this.isInited = true;
  16276. this.gameObj = this.owner;
  16277. this.transform = this.gameObj.transform;
  16278. }
  16279. get rotX() {
  16280. return this.transform.localRotationEulerX;
  16281. }
  16282. set rotX(v) {
  16283. this.transform.localRotationEulerX = v;
  16284. }
  16285. get rotY() {
  16286. return this.transform.localRotationEulerY;
  16287. }
  16288. set rotY(v) {
  16289. this.transform.localRotationEulerY = v;
  16290. }
  16291. get rotZ() {
  16292. return this.transform.localRotationEulerZ;
  16293. }
  16294. set rotZ(v) {
  16295. this.transform.localRotationEulerZ = v;
  16296. }
  16297. get posX() {
  16298. return this.transform.localPositionX;
  16299. }
  16300. set posX(v) {
  16301. this.transform.localPositionX = v;
  16302. }
  16303. get posY() {
  16304. return this.transform.localPositionY;
  16305. }
  16306. set posY(v) {
  16307. this.transform.localPositionY = v;
  16308. }
  16309. get posZ() {
  16310. return this.transform.localPositionZ;
  16311. }
  16312. set posZ(v) {
  16313. this.transform.localPositionZ = v;
  16314. }
  16315. get rotation() {
  16316. return this.transform.localRotation;
  16317. }
  16318. set rotation(v) {
  16319. this.transform.localRotation = v;
  16320. }
  16321. }
  16322. class D2Hole extends Laya.Script {
  16323. constructor() { super(); }
  16324. onTriggerEnter(collider) {
  16325. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16326. return;
  16327. }
  16328. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16329. if (collider.owner["mySrc"].isRunSkillAni) {
  16330. return;
  16331. }
  16332. if (collider.owner["mySrc"].number != 0) {
  16333. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16334. }
  16335. xGame.common.ballColliHole(collider);
  16336. xGame.common.recoverCameraView();
  16337. }
  16338. }
  16339. }
  16340. class Table extends Laya.Script3D {
  16341. constructor() {
  16342. super();
  16343. this.isSetBorder = false;
  16344. this.inited = false;
  16345. }
  16346. ;
  16347. onAwake() {
  16348. this.init();
  16349. }
  16350. init() {
  16351. if (this.inited)
  16352. return;
  16353. this.inited = true;
  16354. this.gameObj = this.owner;
  16355. this.border = this.gameObj.getChildByName("border");
  16356. }
  16357. setBorderPos() {
  16358. if (this.isSetBorder)
  16359. return;
  16360. this.isSetBorder = true;
  16361. let ui = xGame.common.gameUI.ui;
  16362. let bar1 = this.border.getChildByName("bar1");
  16363. let bar2 = this.border.getChildByName("bar2");
  16364. let bar3 = this.border.getChildByName("bar3");
  16365. let bar4 = this.border.getChildByName("bar4");
  16366. let bar5 = this.border.getChildByName("bar5");
  16367. let bar6 = this.border.getChildByName("bar6");
  16368. this.setInfo(bar1, ui.border.bar1, "box");
  16369. this.setInfo(bar2, ui.border.bar2, "box");
  16370. this.setInfo(bar3, ui.border.bar3, "box");
  16371. this.setInfo(bar4, ui.border.bar4, "box");
  16372. this.setInfo(bar5, ui.border.bar5, "box");
  16373. this.setInfo(bar6, ui.border.bar6, "box");
  16374. let circle1 = this.border.getChildByName("circle1");
  16375. let circle2 = this.border.getChildByName("circle2");
  16376. let circle3 = this.border.getChildByName("circle3");
  16377. let circle4 = this.border.getChildByName("circle4");
  16378. let circle5 = this.border.getChildByName("circle5");
  16379. let circle6 = this.border.getChildByName("circle6");
  16380. this.setInfo(circle1, ui.border.circle1, "circle");
  16381. this.setInfo(circle2, ui.border.circle2, "circle");
  16382. this.setInfo(circle3, ui.border.circle3, "circle");
  16383. this.setInfo(circle4, ui.border.circle4, "circle");
  16384. this.setInfo(circle5, ui.border.circle5, "circle");
  16385. this.setInfo(circle6, ui.border.circle6, "circle");
  16386. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16387. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16388. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16389. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16390. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16391. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16392. let arr = xGame.common.gameMgr.holePosList;
  16393. xGame.common.gameMgr.posObj = {
  16394. "1": arr[0],
  16395. "3": arr[2],
  16396. "4": arr[3],
  16397. "6": arr[5]
  16398. };
  16399. }
  16400. initHolePos(x, y) {
  16401. if (x < 300)
  16402. x += 25;
  16403. else if (x > 1000)
  16404. x -= 25;
  16405. else if (y > 200)
  16406. y -= 10;
  16407. else
  16408. y += 10;
  16409. if (y < 200)
  16410. y += 30;
  16411. else if (y > 500)
  16412. y -= 30;
  16413. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16414. }
  16415. setInfo(d3Obj, d2Obj, type) {
  16416. let ui = xGame.common.gameUI.ui;
  16417. let sprite = new Laya.Sprite();
  16418. ui.border.displayObject.addChild(sprite);
  16419. let colli = xGame.common.getCollider(type);
  16420. sprite.addComponentIntance(colli);
  16421. let rigy = xGame.common.getRigbody();
  16422. rigy.type = "static";
  16423. sprite.addComponentIntance(rigy);
  16424. let d3Pos = d3Obj.transform.position;
  16425. xGame.common.pos3to2Convert(d3Pos);
  16426. let scaleX = d3Obj.transform.localScaleX;
  16427. let scaleZ = d3Obj.transform.localScaleZ;
  16428. let width = xGame.common.scale3to2Convert(scaleZ);
  16429. let height = xGame.common.scale3to2Convert(scaleX);
  16430. sprite.pivotX = width / 2;
  16431. sprite.pivotY = height / 2;
  16432. sprite.x = d3Pos.x;
  16433. sprite.y = d3Pos.y;
  16434. sprite.width = width;
  16435. sprite.height = height;
  16436. d2Obj.x = d3Pos.x;
  16437. d2Obj.y = d3Pos.y;
  16438. d2Obj.width = width;
  16439. d2Obj.height = height;
  16440. if (type == "box") {
  16441. colli.width = width;
  16442. colli.height = height;
  16443. colli.isSensor = false;
  16444. colli.label = "border";
  16445. }
  16446. else {
  16447. colli.radius = width / 2;
  16448. colli.isSensor = true;
  16449. colli.label = "hole";
  16450. sprite.addComponent(D2Hole);
  16451. }
  16452. }
  16453. }
  16454. class D3World extends Laya.Script3D {
  16455. constructor() {
  16456. super();
  16457. this.loadNum = 0;
  16458. this.setLoadNum = 7;
  16459. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16460. }
  16461. onAwake() {
  16462. }
  16463. loadScene() {
  16464. this.scene = this.owner;
  16465. let url = `res/unityRes/root.lh`;
  16466. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16467. this.scene.addChild(prefab);
  16468. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16469. this.putCameraInfo();
  16470. this.camera.enableHDR = false;
  16471. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16472. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16473. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16474. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16475. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16476. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16477. this.knife.active = false;
  16478. this.loadD3Obj();
  16479. }));
  16480. }
  16481. putCameraInfo() {
  16482. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16483. this.cameraObj = new cameraType();
  16484. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16485. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16486. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16487. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16488. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16489. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16490. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16491. this.visitAngleChild.init();
  16492. this.visitRootObj.posX = this.visitAngleChild.posX;
  16493. this.visitRootObj.posY = this.visitAngleChild.posY;
  16494. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16495. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16496. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16497. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16498. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16499. xGame.common.showOneCamera("mainCamera");
  16500. }
  16501. loadD3Obj() {
  16502. this.loadTable();
  16503. this.loadRoom();
  16504. this.loadInHoleParticial();
  16505. this.loadIceParticial();
  16506. this.loadHitParticial();
  16507. this.loadFireworksParticial();
  16508. this.loadBall();
  16509. }
  16510. loadInHoleParticial() {
  16511. this.loadD3Res("inHoleEft", "", (prefab) => {
  16512. prefab.addComponent(Partical);
  16513. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16514. });
  16515. }
  16516. loadIceParticial() {
  16517. this.loadD3Res("iceEft", "", (prefab) => {
  16518. prefab.addComponent(Partical);
  16519. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16520. });
  16521. }
  16522. loadHitParticial() {
  16523. this.loadD3Res("hitEft", "", (prefab) => {
  16524. prefab.addComponent(Partical);
  16525. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16526. });
  16527. }
  16528. loadFireworksParticial() {
  16529. this.loadD3Res("fireworksEft", "", (prefab) => {
  16530. prefab.addComponent(Partical);
  16531. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16532. });
  16533. }
  16534. loadBall(index = 1) {
  16535. this.loadD3Res("ball", index, (prefab) => {
  16536. this.ballPrefab = prefab;
  16537. this.ballPrefab.addComponent(Ball);
  16538. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16539. });
  16540. }
  16541. loadTable(index = 1) {
  16542. this.loadD3Res("table", index, (prefab) => {
  16543. this.tableSrc = prefab.addComponent(Table);
  16544. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16545. this.d3Hand.init();
  16546. this.tableRoot.addChild(prefab);
  16547. });
  16548. }
  16549. loadRoom(index = 1) {
  16550. this.loadD3Res("room", index, (prefab) => {
  16551. this.roomRoot.addChild(prefab);
  16552. });
  16553. }
  16554. loadD3Res(type, index, callback) {
  16555. let url = `res/unityRes/${type}${index}.lh`;
  16556. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16557. callback && callback(prefab);
  16558. this.checkResLoad();
  16559. }));
  16560. }
  16561. checkResLoad() {
  16562. this.loadNum++;
  16563. if (this.loadNum >= this.setLoadNum) {
  16564. xGame.eventMgr.event(D3RES_LOADED);
  16565. }
  16566. }
  16567. prePlayEft() {
  16568. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16569. eft.transform.localPositionX = 0;
  16570. eft.transform.localPositionY = -5;
  16571. eft.transform.localPositionZ = 0;
  16572. eft.active = true;
  16573. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16574. ice.transform.localPositionX = 0;
  16575. ice.transform.localPositionY = -5;
  16576. ice.transform.localPositionZ = 0;
  16577. ice.active = true;
  16578. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16579. hit.transform.localPositionX = 0;
  16580. hit.transform.localPositionY = -5;
  16581. hit.transform.localPositionZ = 0;
  16582. hit.active = true;
  16583. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16584. fireworks.transform.localPositionX = 0;
  16585. fireworks.transform.localPositionY = -5;
  16586. fireworks.transform.localPositionZ = 0;
  16587. fireworks.active = true;
  16588. }
  16589. }
  16590. class cameraType {
  16591. }
  16592. class MoyuMgr$1 {
  16593. static initMoyu() {
  16594. this.moyuView = new MoyuView$1();
  16595. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16596. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16597. this.moyuView.ui.displayObject.zOrder = 1000;
  16598. this.moyuView.init();
  16599. this.moyuView.showTip(true);
  16600. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16601. window['XApk'] = this;
  16602. }
  16603. static showAge(show) {
  16604. if (this.moyuView)
  16605. this.moyuView.showAge(show);
  16606. }
  16607. static onPlatMsg(idx) {
  16608. if (!MoyuMgr$1.moyuView)
  16609. return;
  16610. if (idx == '0') {
  16611. MoyuMgr$1.moyuView.showTip(false);
  16612. }
  16613. }
  16614. static showAgree(call) {
  16615. if (this.moyuView)
  16616. this.moyuView.showAgree(call);
  16617. else
  16618. call && call();
  16619. }
  16620. static showXy(type = 1) {
  16621. if (this.moyuView)
  16622. this.moyuView.showXy(type);
  16623. }
  16624. }
  16625. MoyuMgr$1.isAdvise = false;
  16626. class MoyuView$1 {
  16627. constructor() {
  16628. this.ysxyNum = 1;
  16629. this.ysJson = null;
  16630. this.ui = ui_UIMoyu.createInstance();
  16631. }
  16632. init() {
  16633. this.ui.mainBg.visible = false;
  16634. this.ui.xyNode.visible = false;
  16635. this.ui.ageNode.visible = false;
  16636. this.ui.tipNode.visible = false;
  16637. this.ui.rnNode.visible = false;
  16638. this.ui.fcmNode.visible = false;
  16639. this.ui.ageTip.visible = false;
  16640. this.ui.msgNode.visible = false;
  16641. this.ui.visible = false;
  16642. this.ui.xyNode.xyList.setVirtual();
  16643. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16644. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16645. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16646. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16647. this.ui.xyNode.btnKnown.visible = false;
  16648. this.ui.xyNode.xy1.visible = false;
  16649. this.ui.xyNode.xy2.visible = false;
  16650. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16651. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16652. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16653. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16654. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16655. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16656. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16657. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16658. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16659. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16660. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16661. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16662. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16663. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16664. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16665. this.ysxyNum = 2;
  16666. }
  16667. }
  16668. onClick(obj) {
  16669. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16670. switch (obj) {
  16671. case this.ui.ageTip:
  16672. if (Moyu.isTTApk) {
  16673. this.ui.ageNode.visible = true;
  16674. this.ui.mainBg.visible = true;
  16675. }
  16676. break;
  16677. case this.ui.tipNode:
  16678. this.showTip(false);
  16679. break;
  16680. case this.ui.ageNode.btnAge:
  16681. this.ui.ageNode.visible = false;
  16682. this.ui.mainBg.visible = false;
  16683. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16684. this.ui.visible = false;
  16685. break;
  16686. case this.ui.xyNode.btnXy3:
  16687. case this.ui.xyNode.btnXy1:
  16688. this.loadXy(1);
  16689. break;
  16690. case this.ui.xyNode.btnXy2:
  16691. this.loadXy(2);
  16692. break;
  16693. case this.ui.xyNode.btnBack:
  16694. this.ui.xyNode.xy1.visible = true;
  16695. this.ui.xyNode.xy2.visible = false;
  16696. break;
  16697. case this.ui.xyNode.btnKnown:
  16698. this.ui.xyNode.visible = false;
  16699. this.ui.mainBg.visible = false;
  16700. this.ui.visible = false;
  16701. break;
  16702. case this.ui.rnNode.btnCheck:
  16703. this.check();
  16704. break;
  16705. case this.ui.rnNode.btnExit:
  16706. case this.ui.xyNode.btnNo:
  16707. this.ysxyNum--;
  16708. if (this.ysxyNum > 0)
  16709. this.showMsg("再次拒绝退出游戏");
  16710. else {
  16711. Moyu.userAgree(false);
  16712. Moyu.exit();
  16713. }
  16714. break;
  16715. case this.ui.xyNode.btnSure:
  16716. case this.ui.xyNode.btnYes:
  16717. DataMgr.userData.isAgree = true;
  16718. DataMgr.saveUserData();
  16719. this.onAgree();
  16720. break;
  16721. case this.ui.rnNode.btnDone:
  16722. this.ui.rnNode.visible = false;
  16723. this.ui.visible = false;
  16724. break;
  16725. case this.ui.fcmNode.btnRn:
  16726. this.showRn();
  16727. break;
  16728. }
  16729. }
  16730. showTip(show) {
  16731. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16732. return;
  16733. if (show) {
  16734. MoyuMgr$1.isAdvise = true;
  16735. this.ui.visible = true;
  16736. this.ui.tipNode.visible = true;
  16737. this.ui.tipNode.alpha = 1;
  16738. Laya.timer.once(1000, this, this.showTip, [false]);
  16739. }
  16740. else {
  16741. this.ui.tipNode.alpha = 1;
  16742. this.ui.tipNode.visible = true;
  16743. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16744. this.ui.tipNode.visible = false;
  16745. MoyuMgr$1.isAdvise = false;
  16746. }), 1000);
  16747. }
  16748. }
  16749. showAge(show, px = 0, py = 0) {
  16750. if (Moyu.platType > 10 && !Moyu.isIos) {
  16751. this.ui.ageTip.x = px;
  16752. this.ui.ageTip.y = py;
  16753. this.ui.ageTip.visible = show;
  16754. if (show)
  16755. this.ui.visible = true;
  16756. }
  16757. }
  16758. showAgree(call) {
  16759. this.agreeCall = call;
  16760. this.onAgree();
  16761. return;
  16762. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16763. this.showXy(0);
  16764. }
  16765. else
  16766. this.onAgree();
  16767. }
  16768. onAgree() {
  16769. if (!this.ui.ageNode.visible)
  16770. this.ui.visible = false;
  16771. this.ui.xyNode.visible = false;
  16772. Moyu.userAgree(true);
  16773. this.showAge(false);
  16774. this.agreeCall && this.agreeCall();
  16775. this.showRn();
  16776. }
  16777. showMsg(txt) {
  16778. this.ui.msgNode.txtMsg.text = txt;
  16779. this.ui.msgNode.visible = true;
  16780. this.ui.msgNode.alpha = 1;
  16781. this.ui.visible = true;
  16782. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16783. this.ui.msgNode.visible = false;
  16784. }), 2500, true);
  16785. }
  16786. showRn() {
  16787. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16788. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16789. this.ui.rnNode.rn1.visible = true;
  16790. this.ui.rnNode.rn2.visible = false;
  16791. this.ui.rnNode.rn3.visible = false;
  16792. this.ui.rnNode.rn4.visible = false;
  16793. this.ui.rnNode.visible = true;
  16794. this.ui.mainBg.visible = true;
  16795. this.ui.rnNode.btnDone.visible = false;
  16796. this.ui.rnNode.btnExit.visible = true;
  16797. this.ui.rnNode.btnCheck.visible = true;
  16798. this.ui.fcmNode.visible = false;
  16799. this.ui.visible = true;
  16800. return;
  16801. }
  16802. }
  16803. this.showFcm();
  16804. }
  16805. showFcm() {
  16806. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16807. Moyu.initFCM(true);
  16808. if (Moyu.gameTime < 1)
  16809. this.fcmLoop();
  16810. else if (Moyu.gameTime < 999)
  16811. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16812. }
  16813. }
  16814. fcmLoop() {
  16815. if (Moyu.gameTime < 1) {
  16816. this.ui.rnNode.visible = false;
  16817. this.ui.fcmNode.visible = true;
  16818. this.ui.mainBg.visible = true;
  16819. this.ui.visible = true;
  16820. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16821. Laya.timer.clear(this.ui, this.fcmLoop);
  16822. }
  16823. }
  16824. check() {
  16825. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16826. this.ui.rnNode.rn1.visible = false;
  16827. this.ui.rnNode.rn2.visible = false;
  16828. this.ui.rnNode.rn4.visible = true;
  16829. }
  16830. else if (this.ui.rnNode.rn4.visible) {
  16831. let name = this.ui.rnNode.inputName.text;
  16832. let code = this.ui.rnNode.inputCode.text;
  16833. if (code && code.length == 18) {
  16834. this.ui.rnNode.rn1.visible = false;
  16835. this.ui.rnNode.rn4.visible = false;
  16836. Moyu.authenticate(name, code, (res) => {
  16837. this.ui.rnNode.rn2.visible = !res;
  16838. this.ui.rnNode.rn3.visible = res;
  16839. this.ui.rnNode.btnDone.visible = res;
  16840. this.ui.rnNode.btnExit.visible = !res;
  16841. this.ui.rnNode.btnCheck.visible = !res;
  16842. if (res)
  16843. this.showFcm();
  16844. });
  16845. }
  16846. else
  16847. this.showMsg("信息填写不完整");
  16848. }
  16849. }
  16850. loadXy(type = 0) {
  16851. this.ui.xyNode.xy1.visible = false;
  16852. this.ui.xyNode.xy2.visible = true;
  16853. this.ui.xyNode.xyList.scrollToView(0);
  16854. if (type == 1) {
  16855. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16856. }
  16857. else if (type == 2) {
  16858. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16859. }
  16860. }
  16861. showXy(type = 0) {
  16862. this.xyBtn();
  16863. if (type == 0) {
  16864. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16865. this.ui.xyNode.btnSure.visible = true;
  16866. }
  16867. else {
  16868. this.ui.xyNode.btnYes.visible = true;
  16869. this.ui.xyNode.btnNo.visible = true;
  16870. }
  16871. }
  16872. else {
  16873. this.ui.xyNode.btnKnown.visible = true;
  16874. this.ui.mainBg.visible = true;
  16875. }
  16876. this.ui.xyNode.xy1.visible = true;
  16877. this.ui.xyNode.xy2.visible = false;
  16878. this.ui.xyNode.visible = true;
  16879. this.ui.visible = true;
  16880. }
  16881. xyBtn() {
  16882. this.ui.xyNode.btnSure.visible = false;
  16883. this.ui.xyNode.btnYes.visible = false;
  16884. this.ui.xyNode.btnNo.visible = false;
  16885. this.ui.xyNode.btnKnown.visible = false;
  16886. {
  16887. this.ui.xyNode.btnXy3.visible = false;
  16888. this.ui.xyNode.btnXy2.visible = true;
  16889. this.ui.xyNode.btnXy1.visible = true;
  16890. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16891. }
  16892. }
  16893. createXY(json) {
  16894. this.ysJson = json.content;
  16895. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16896. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16897. this.ui.xyNode.xy2.visible = true;
  16898. }
  16899. renderListItem(idx, cell) {
  16900. let xy = this.ysJson[idx];
  16901. cell.height = xy.line * 30;
  16902. cell.xyItem.text = xy.text;
  16903. }
  16904. onDestroy() {
  16905. this.agreeCall = null;
  16906. }
  16907. }
  16908. class UILoading extends UIBase {
  16909. constructor() {
  16910. super();
  16911. this.accTime = 0;
  16912. this.curNum = 0;
  16913. this.rate = 1;
  16914. this.loadSubOk = false;
  16915. this.loadResOK = false;
  16916. this.openLoading = true;
  16917. this.beginLoadRes = false;
  16918. this.finishD2 = false;
  16919. this.finishD3 = false;
  16920. }
  16921. onConstructor() {
  16922. this.ui = ui_UILoading.createInstance();
  16923. this.contentPane = this.ui;
  16924. this.isEject = false;
  16925. this._initUI();
  16926. this._addEvent();
  16927. }
  16928. _initUI() {
  16929. MoyuMgr$1.initMoyu();
  16930. }
  16931. _addEvent() {
  16932. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16933. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16934. }
  16935. show() {
  16936. super.show();
  16937. console.log('zh:加载分包资源');
  16938. loadSubRes(this.subResProgress.bind(this));
  16939. this.ui.txtLoad.text = "Loading...";
  16940. }
  16941. subResProgress(pro, finish) {
  16942. this.curNum = pro;
  16943. if (finish) {
  16944. this.curNum = 1;
  16945. this.loadSubOk = true;
  16946. }
  16947. }
  16948. laodD3Res() {
  16949. let scene3D = new Laya.Scene3D();
  16950. xGame.common.d3Scene = scene3D;
  16951. xGame.common.d3World = scene3D.addComponent(D3World);
  16952. xGame.common.d3World.loadScene();
  16953. }
  16954. loadD2Res() {
  16955. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16956. this.finishD2 = true;
  16957. this.checkLoadAll();
  16958. this.curNum = 1;
  16959. }), Laya.Handler.create(this, (pro) => {
  16960. this.curNum = pro;
  16961. }, null, false));
  16962. }
  16963. d3ResFinish() {
  16964. this.finishD3 = true;
  16965. this.checkLoadAll();
  16966. }
  16967. checkLoadAll() {
  16968. if (this.finishD2 && this.finishD3) {
  16969. this.loadResOK = true;
  16970. }
  16971. }
  16972. loadRes() {
  16973. this.laodD3Res();
  16974. this.loadD2Res();
  16975. }
  16976. myUpdate(dt) {
  16977. if (!this.openLoading)
  16978. return;
  16979. this.accTime += dt * this.rate;
  16980. if (this.accTime >= this.curNum)
  16981. this.accTime = this.curNum;
  16982. this.ui.loadinfo.value = this.accTime * 100;
  16983. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16984. if (!this.beginLoadRes) {
  16985. this.beginLoadRes = true;
  16986. this.ui.txtLoad.text = "Loading...";
  16987. this.curNum = 0;
  16988. this.accTime = 0;
  16989. this.loadRes();
  16990. }
  16991. if (this.loadResOK) {
  16992. this.openLoading = false;
  16993. Laya.timer.once(300, this, () => {
  16994. xGame.common.d3Scene.active = false;
  16995. MoyuMgr$1.showAgree(enterGame);
  16996. });
  16997. }
  16998. }
  16999. }
  17000. release() {
  17001. }
  17002. hide() {
  17003. super.hide();
  17004. this.release();
  17005. }
  17006. onClose() {
  17007. this.hide();
  17008. }
  17009. }
  17010. UILoading.uiName = "UILoading";
  17011. class UIRepentProp$1 extends UIBase {
  17012. constructor() {
  17013. super();
  17014. this.viewType = 0;
  17015. this.regretType = 0;
  17016. }
  17017. onConstructor() {
  17018. this.ui = ui_UIRepentProp.createInstance();
  17019. this.contentPane = this.ui;
  17020. this.isEject = false;
  17021. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17022. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17023. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17024. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17025. }
  17026. show(viewType, regretType, callback) {
  17027. PlatMgr.showInsert(true);
  17028. this.viewType = viewType;
  17029. this.regretType = regretType;
  17030. this.callback = callback;
  17031. super.show();
  17032. this.ui.t0.play();
  17033. this.ui.c1.selectedIndex = this.viewType;
  17034. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17035. if (this.viewType == 0) {
  17036. let guide = DataMgr.getGuideHelpLine();
  17037. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17038. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17039. }
  17040. xGame.common.gameMgr.gamePause = true;
  17041. }
  17042. hideSelf() {
  17043. xGame.common.gameMgr.gamePause = false;
  17044. this.callback && this.callback(false);
  17045. this.hide();
  17046. }
  17047. videoRegret() {
  17048. Moyu.showVideoAd(() => {
  17049. this.callback && this.callback(true);
  17050. this.hideSelf();
  17051. }, EAdType.regretBall);
  17052. }
  17053. videoAddHelpLine() {
  17054. let guide = DataMgr.getGuideHelpLine();
  17055. if (guide == 0) {
  17056. this.callback && this.callback(true);
  17057. this.hideSelf();
  17058. DataMgr.setGuideHelpLine();
  17059. xGame.common.gameUI.ui.guideNode.visible = false;
  17060. }
  17061. else {
  17062. Moyu.showVideoAd(() => {
  17063. this.callback && this.callback(true);
  17064. this.hideSelf();
  17065. }, EAdType.longHelpLine);
  17066. }
  17067. }
  17068. }
  17069. UIRepentProp$1.uiName = "UIRepentProp";
  17070. class UIRodMethod$1 extends UIBase {
  17071. constructor() {
  17072. super();
  17073. this.isPressd = false;
  17074. }
  17075. onConstructor() {
  17076. this.ui = ui_UIRodMethod.createInstance();
  17077. this.contentPane = this.ui;
  17078. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17079. this.moveDir = new Laya.Vector2();
  17080. this.moveDest = new Laya.Vector2();
  17081. this.centerPos = new Laya.Vector2();
  17082. xGame.common.uiRodMethod = this;
  17083. }
  17084. show() {
  17085. super.show();
  17086. xGame.common.gameMgr.gamePause = true;
  17087. this.openPressDotEvent();
  17088. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17089. this.centerPos.x = this.ui.white.x;
  17090. this.centerPos.y = this.ui.white.y;
  17091. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17092. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17093. this.setDot();
  17094. }
  17095. setDot() {
  17096. this.ui.dot.x = this.moveDest.x;
  17097. this.ui.dot.y = this.moveDest.y;
  17098. }
  17099. closeSelf() {
  17100. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17101. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17102. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17103. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17104. xGame.common.gameMgr.gamePause = false;
  17105. this.hide();
  17106. }
  17107. openPressDotEvent() {
  17108. this.closePressDotEvent();
  17109. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17110. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17111. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17112. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17113. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17114. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17115. }
  17116. closePressDotEvent() {
  17117. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17118. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17119. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17120. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17121. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17122. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17123. }
  17124. onDown(e) {
  17125. if (e.type == Laya.Event.MOUSE_DOWN)
  17126. this.isPressd = true;
  17127. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17128. this.isPressd = false;
  17129. if (!this.isPressd)
  17130. return;
  17131. this.moveDest.x = e.stageX;
  17132. this.moveDest.y = e.stageY;
  17133. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17134. if (dis > 6724) {
  17135. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17136. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17137. }
  17138. this.setDot();
  17139. }
  17140. resetRod() {
  17141. this.ui.dot.x = this.ui.white.x;
  17142. this.ui.dot.y = this.ui.white.y;
  17143. this.gameRod.dot.x = this.gameRod.bg.x;
  17144. this.gameRod.dot.y = this.gameRod.bg.y;
  17145. xGame.common.rodOffest.x = 0;
  17146. xGame.common.rodOffest.y = 0;
  17147. }
  17148. }
  17149. UIRodMethod$1.uiName = "UIRodMethod";
  17150. class UIMsg$1 extends UIBase {
  17151. constructor() {
  17152. super();
  17153. }
  17154. onConstructor() {
  17155. this.ui = ui_UIMsg.createInstance();
  17156. this.contentPane = this.ui;
  17157. this.isEject = false;
  17158. this.isMuti = true;
  17159. }
  17160. show(msg, callback) {
  17161. super.show();
  17162. this.ui.tipsNode.msgTxt.text = msg;
  17163. this.ui.alpha = 1;
  17164. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17165. this.hide();
  17166. callback && callback();
  17167. }), 1000);
  17168. }
  17169. }
  17170. UIMsg$1.uiName = "UIMsg";
  17171. class UITips$1 extends UIBase {
  17172. constructor() {
  17173. super();
  17174. this.type = 0;
  17175. }
  17176. onConstructor() {
  17177. this.ui = ui_UITips.createInstance();
  17178. this.contentPane = this.ui;
  17179. this.isEject = false;
  17180. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17181. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17182. }
  17183. show(tipsTxt, womanTxt, type) {
  17184. super.show();
  17185. this.ui.t0.play();
  17186. this.ui.myNode.tipsTxt.text = tipsTxt;
  17187. this.ui.myNode.womanTxt.text = womanTxt;
  17188. PlatMgr.showInsert(true);
  17189. this.ui.myNode.c1.selectedIndex = type;
  17190. this.type = type;
  17191. switch (this.type) {
  17192. case TipsType.exitGame:
  17193. xGame.common.gameMgr.gamePause = true;
  17194. break;
  17195. case TipsType.foul:
  17196. Laya.timer.once(200, this, () => {
  17197. xGame.common.gameMgr.gamePause = true;
  17198. });
  17199. break;
  17200. default:
  17201. break;
  17202. }
  17203. }
  17204. clickLeftBtn() {
  17205. this.hide();
  17206. xGame.common.gameMgr.gamePause = false;
  17207. switch (this.type) {
  17208. case TipsType.exitGame:
  17209. break;
  17210. case TipsType.foul:
  17211. break;
  17212. default:
  17213. break;
  17214. }
  17215. }
  17216. clickRightBtn() {
  17217. this.hide();
  17218. switch (this.type) {
  17219. case TipsType.exitGame:
  17220. xGame.eventMgr.event(RESET_GAME);
  17221. xGame.uiMgr.Show(UIMain$1);
  17222. Moyu.recordEnd(this, null);
  17223. xGame.common.longHelpLine = false;
  17224. break;
  17225. case TipsType.foul:
  17226. xGame.common.gameMgr.gamePause = false;
  17227. Laya.timer.clearAll(this);
  17228. break;
  17229. default:
  17230. break;
  17231. }
  17232. }
  17233. }
  17234. UITips$1.uiName = "UITips";
  17235. class UIGame$1 extends UIBase {
  17236. constructor() {
  17237. super();
  17238. this.powerNum = 0;
  17239. this.isD3Inited = false;
  17240. this.isPrePlay = false;
  17241. this.isMoveRod = false;
  17242. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17243. this.rulerDis = 20;
  17244. this.rulerOffset = 0;
  17245. }
  17246. onConstructor() {
  17247. this.ui = ui_UIGame.createInstance();
  17248. this.contentPane = this.ui;
  17249. this.ui.x += xGame.common.sysOffestNum;
  17250. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17251. this.isEject = false;
  17252. xGame.common.gameUI = this;
  17253. this.initSelf();
  17254. }
  17255. isTurnSelf() {
  17256. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17257. return true;
  17258. }
  17259. }
  17260. initSelf() {
  17261. let topUI = this.ui.topNode;
  17262. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17263. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17264. this.barInfo = {};
  17265. this.barInfo.curY = 0;
  17266. this.barInfo.height = this.ui.powerNode.height;
  17267. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17268. this.barInfo.powerStartY = this.ui.powerNode.y;
  17269. xGame.common.aiPlayer = new AIPlayer();
  17270. xGame.common.gameMgr = new GameMgr();
  17271. xGame.common.skillMgr = new SkillMgr();
  17272. xGame.common.wordsMgr = new WordsMgr();
  17273. xGame.common.talkMgr = new TalkMgr();
  17274. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17275. console.log("加载经典模式表情文件chenggon !");
  17276. });
  17277. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17278. console.log("挑战模式奖励模式spine加载成功!");
  17279. });
  17280. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17281. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17282. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17283. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17284. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17285. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17286. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17287. }
  17288. returnHome() {
  17289. let tips = "Are you sure to exit the game?";
  17290. let woman = "Boss, why don't you play for a while longer?";
  17291. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17292. }
  17293. addRodMethodClick() {
  17294. if (this.isTurnSelf()) {
  17295. xGame.uiMgr.Show(UIRodMethod$1);
  17296. }
  17297. }
  17298. clickHelpLineBtn(force = false) {
  17299. if (!this.isTurnSelf())
  17300. return;
  17301. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17302. if (success) {
  17303. xGame.common.longHelpLine = true;
  17304. xGame.common.d2World.getHelpLine();
  17305. Moyu.sendDataEvent("guideNum");
  17306. }
  17307. else {
  17308. }
  17309. });
  17310. }
  17311. renderSelfDisplayBalls(index, target) {
  17312. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17313. target.myImg.url = xGame.common.getGameIconUrl(str);
  17314. }
  17315. renderAIDisplayBalls(index, target) {
  17316. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17317. target.myImg.url = xGame.common.getGameIconUrl(str);
  17318. ;
  17319. }
  17320. updateMode() {
  17321. if (xGame.common.gameMode == GameMode.classic) {
  17322. this.ui.topNode.scoreNode.visible = false;
  17323. }
  17324. else if (xGame.common.gameMode == GameMode.bigMove) {
  17325. this.ui.topNode.scoreNode.visible = true;
  17326. }
  17327. }
  17328. show() {
  17329. super.show();
  17330. console.log("zh:uigame show");
  17331. this.ui.alpha = 0;
  17332. this.updateSelf();
  17333. console.log("zh:uigame bf gamemusic01 start");
  17334. xGame.soundMgr.playMusic("gamemusic01");
  17335. console.log("zh:uigame bf gamemusic01 end");
  17336. xGame.common.gameMgr.gamePause = false;
  17337. xGame.common.gameUI.ui.blackAni.visible = false;
  17338. xGame.common.gameUI.ui.whiteAni.visible = false;
  17339. this.ui.powerEft.visible = false;
  17340. this.ui.colorNode.visible = false;
  17341. this.updateHead();
  17342. }
  17343. updateSelf() {
  17344. if (xGame.common.gameMode == GameMode.classic) {
  17345. this.ui.c1.selectedIndex = 0;
  17346. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17347. this.ui.topNode.middleNode.visible = true;
  17348. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17349. }
  17350. else if (xGame.common.gameMode == GameMode.bigMove) {
  17351. this.ui.c1.selectedIndex = 0;
  17352. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17353. this.ui.topNode.middleNode.visible = false;
  17354. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17355. let rand = xGame.common.randomNum(1, max);
  17356. let guide = DataMgr.getSkillGuide();
  17357. if (guide == 0)
  17358. rand = 1;
  17359. xGame.common.bigMoveLevelIndex = rand;
  17360. }
  17361. else if (xGame.common.gameMode == GameMode.placeBall) {
  17362. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17363. this.ui.c1.selectedIndex = 1 + data.type;
  17364. this.ui.alpha = 1;
  17365. this.startGame();
  17366. }
  17367. this.updateMode();
  17368. this.initD3world();
  17369. this.initD2world();
  17370. }
  17371. startGame() {
  17372. this.ui.snowNode.visible = Math.random() <= 0.1;
  17373. this.ui.d2Node.visible = false;
  17374. xGame.common.d3World.d3Hand.gameObj.active = false;
  17375. xGame.common.d3World.tableSrc.init();
  17376. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17377. this.cameraViewChange(() => {
  17378. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17379. switch (xGame.common.gameMode) {
  17380. case GameMode.classic:
  17381. xGame.common.d3World.d3Hand.gameObj.active = true;
  17382. this.playPutBallD3Ani();
  17383. break;
  17384. case GameMode.bigMove:
  17385. this.enterGame();
  17386. Laya.timer.once(500, this, () => {
  17387. this.ui.topNode.middleNode.visible = true;
  17388. this.ui.topNode.middleNode.t0.play();
  17389. });
  17390. break;
  17391. case GameMode.placeBall:
  17392. this.enterGame();
  17393. break;
  17394. default:
  17395. break;
  17396. }
  17397. });
  17398. PlatMgr.showBanner(false);
  17399. }
  17400. enterGame() {
  17401. this.ui.d2Node.visible = true;
  17402. xGame.common.d3World.d3Hand.gameObj.active = false;
  17403. xGame.common.showOneCamera("mainCamera");
  17404. Moyu.recordGame(30, true);
  17405. if (!this.isPrePlay) {
  17406. this.isPrePlay = true;
  17407. xGame.common.d3World.prePlayEft();
  17408. }
  17409. xGame.common.gameMgr.gameReady();
  17410. this.openAllEvent();
  17411. this.ui.snowNode.visible = false;
  17412. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17413. this.ui.helpBtn.visible = condition;
  17414. }
  17415. showHelpLineGuide() {
  17416. let longGuide = DataMgr.getGuideHelpLine();
  17417. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17418. this.ui.helpBtn.visible = true;
  17419. this.ui.guideNode.visible = true;
  17420. }
  17421. }
  17422. setTurnAlpha(alpha) {
  17423. this.ui.keduNode.alpha = alpha;
  17424. this.ui.ganNode.alpha = alpha;
  17425. this.ui.rodMethodNode.alpha = alpha;
  17426. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17427. }
  17428. cameraViewChange(callback) {
  17429. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17430. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17431. xGame.common.showOneCamera("visitAngle");
  17432. cameraSrc.localRotationEulerY = 180;
  17433. cameraSrc.localRotationEulerZ = 0;
  17434. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17435. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17436. callback && callback();
  17437. }));
  17438. }));
  17439. }
  17440. playPutBallD3Ani() {
  17441. xGame.common.showOneCamera("mainCamera");
  17442. let handSrc = xGame.common.d3World.d3Hand;
  17443. handSrc.gameObj.active = true;
  17444. handSrc.transform.localPositionZ = 3;
  17445. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17446. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17447. handSrc.gameObj.active = false;
  17448. this.enterGame();
  17449. }), 400);
  17450. }));
  17451. }
  17452. updateHead() {
  17453. let user = Moyu.getUserInfo();
  17454. this.ui.topNode.selfNameTxt.text = user.nickName;
  17455. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17456. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17457. if (DataMgr.getSkillGuide() < 1) {
  17458. this.ui.topNode.aiNameTxt.text = 'billiards';
  17459. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17460. }
  17461. else {
  17462. this.ui.topNode.aiNameTxt.text = aiData.name;
  17463. this.ui.topNode.aiHeadLoader.url = baseHeadUrl + aiData.icon;
  17464. }
  17465. }
  17466. initD2world() {
  17467. let node = this.ui.d2Root.displayObject;
  17468. let src = node.getComponent(D2World);
  17469. if (!src) {
  17470. xGame.common.d2World = node.addComponent(D2World);
  17471. }
  17472. xGame.common.d2World.initSelf();
  17473. }
  17474. initD3world() {
  17475. if (this.isD3Inited)
  17476. return;
  17477. this.isD3Inited = true;
  17478. let scene3D = xGame.common.d3Scene;
  17479. this.ui.d3Root.displayObject.addChild(scene3D);
  17480. scene3D.active = true;
  17481. xGame.common.d3World.tableSrc.setBorderPos();
  17482. }
  17483. onRootMove(e) {
  17484. let rootBall = xGame.common.d2World.rootBall;
  17485. this.ui.moveNode.x = e.x;
  17486. this.ui.moveNode.y = e.y;
  17487. rootBall.gameObj.x = e.x;
  17488. rootBall.gameObj.y = e.y;
  17489. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17490. }
  17491. aiRootMove(move) {
  17492. if (move)
  17493. this.hideBallUI();
  17494. else {
  17495. this.showBallUI();
  17496. xGame.common.d2World.getHelpLine();
  17497. }
  17498. }
  17499. aiForce(type, force = 0) {
  17500. this.pressTarget = PressType.powerNode;
  17501. if (type == 1)
  17502. this.onEventUp({ force: true });
  17503. else if (type == 2)
  17504. this.onEventMove({ stageY: force, force: true });
  17505. }
  17506. onEventPress(e) {
  17507. if (e.stopPropagation)
  17508. e.stopPropagation();
  17509. if (!this.isTurnSelf())
  17510. return;
  17511. let target = e.target;
  17512. switch (target) {
  17513. case this.ui.myPowerNode.displayObject:
  17514. this.pressTarget = PressType.powerNode;
  17515. this.barInfo.curY = e.stageY;
  17516. this.updateBarInfo();
  17517. break;
  17518. case this.ui.moveNode.displayObject:
  17519. this.pressTarget = PressType.moveNode;
  17520. this.hideBallUI();
  17521. this.eventObj.curX = this.ui.moveNode.x;
  17522. this.eventObj.curY = this.ui.moveNode.y;
  17523. this.ui.moveNode.finger.visible = false;
  17524. this.eventObj.lastX = e.stageX;
  17525. this.eventObj.lastY = e.stageY;
  17526. break;
  17527. case this.ui.rulerClickNode.displayObject:
  17528. this.pressTarget = PressType.rulerNode;
  17529. this.eventObj.lastY = e.stageY;
  17530. break;
  17531. case this.ui.d2Root.displayObject:
  17532. this.pressTarget = PressType.d2Root;
  17533. this.eventObj.lastX = e.stageX;
  17534. this.eventObj.lastY = e.stageY;
  17535. this.eventObj.starX = e.stageX;
  17536. this.eventObj.starY = e.stageY;
  17537. this.eventObj.curX = 0;
  17538. this.eventObj.curY = 0;
  17539. xGame.common.d2World.d2Gan.setGanLastInfo();
  17540. this.rulerOffset = 0;
  17541. break;
  17542. default:
  17543. break;
  17544. }
  17545. }
  17546. onEventMove(e) {
  17547. if (e.stopPropagation)
  17548. e.stopPropagation();
  17549. if (e && e.force) {
  17550. }
  17551. else {
  17552. if (!this.isTurnSelf())
  17553. return;
  17554. }
  17555. switch (this.pressTarget) {
  17556. case PressType.powerNode:
  17557. this.barInfo.curY = e.stageY;
  17558. this.updateBarInfo();
  17559. this.isMoveRod = true;
  17560. break;
  17561. case PressType.moveNode:
  17562. let rootBall = xGame.common.d2World.rootBall;
  17563. let radius = rootBall.gameObj.width / 2;
  17564. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17565. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17566. let border = xGame.common.d2World.borderRect;
  17567. if (curX <= border.x + radius)
  17568. curX = border.x + radius;
  17569. else if (curX >= border.x + border.width - radius)
  17570. curX = border.x + border.width - radius;
  17571. if (curY <= border.y + radius)
  17572. curY = border.y + radius;
  17573. else if (curY >= border.y + border.height - radius)
  17574. curY = border.y + border.height - radius;
  17575. if (xGame.common.gameMgr.isOpenBall) {
  17576. if (curX >= border.x + border.openBallW - radius)
  17577. curX = border.x + border.openBallW - radius;
  17578. }
  17579. this.ui.moveNode.x = curX;
  17580. this.ui.moveNode.y = curY;
  17581. rootBall.gameObj.x = curX;
  17582. rootBall.gameObj.y = curY;
  17583. rootBall.d3BallSrc.setTransPos(curX, curY);
  17584. this.isMoveRod = true;
  17585. break;
  17586. case PressType.rulerNode:
  17587. let yy = e.stageY - this.eventObj.lastY;
  17588. this.eventObj.lastY = e.stageY;
  17589. let ruler1 = this.ui.rulerNode.img1;
  17590. let ruler2 = this.ui.rulerNode.img2;
  17591. ruler1.y += yy;
  17592. ruler2.y += yy;
  17593. this.rulerOffset += yy;
  17594. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17595. this.rulerOffset = 0;
  17596. xGame.soundMgr.playSound("inch", 1, 10);
  17597. }
  17598. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17599. let h = ruler1.height;
  17600. this.checkGuide();
  17601. this.isMoveRod = true;
  17602. if (ruler1.y >= h) {
  17603. ruler1.y = -h;
  17604. ruler2.y = 0;
  17605. return;
  17606. }
  17607. else if (ruler1.y <= -h) {
  17608. ruler1.y = h;
  17609. ruler2.y = 0;
  17610. return;
  17611. }
  17612. if (ruler2.y >= h) {
  17613. ruler2.y = -h;
  17614. ruler1.y = 0;
  17615. return;
  17616. }
  17617. else if (ruler2.y <= -h) {
  17618. ruler2.y = h;
  17619. ruler1.y = 0;
  17620. return;
  17621. }
  17622. break;
  17623. case PressType.d2Root:
  17624. this.eventObj.curX = e.stageX;
  17625. this.eventObj.curY = e.stageY;
  17626. let offset = this.checkRodMoveDir();
  17627. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17628. this.eventObj.lastX = e.stageX;
  17629. this.eventObj.lastY = e.stageY;
  17630. break;
  17631. default:
  17632. break;
  17633. }
  17634. }
  17635. onEventUp(e) {
  17636. if (e.stopPropagation)
  17637. e.stopPropagation();
  17638. if (e && e.force) {
  17639. }
  17640. else {
  17641. if (!this.isTurnSelf())
  17642. return;
  17643. }
  17644. switch (this.pressTarget) {
  17645. case PressType.powerNode:
  17646. this.ui.powerNode.value = 0;
  17647. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17648. this.ui.powerTxt.text = "";
  17649. if (this.powerNum > 0) {
  17650. xGame.eventMgr.event(BALL_SHOOT);
  17651. xGame.common.d2World.shoot(this.powerNum);
  17652. xGame.common.d2World.d2Gan.shoot();
  17653. xGame.common.d2World.d2HelpLine.shoot();
  17654. this.finishGuide();
  17655. this.ui.powerEft.visible = false;
  17656. this.ui.colorNode.visible = false;
  17657. let ganStr = "";
  17658. if (this.powerNum <= 30) {
  17659. ganStr = "gan_30";
  17660. }
  17661. else if (this.powerNum <= 60) {
  17662. ganStr = "gan_50";
  17663. }
  17664. else {
  17665. ganStr = "gan_80";
  17666. }
  17667. xGame.soundMgr.playSound(ganStr);
  17668. }
  17669. break;
  17670. case PressType.moveNode:
  17671. let rootBall = xGame.common.d2World.rootBall;
  17672. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17673. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17674. let isIntersect = this.judgeBallIntersect();
  17675. if (isIntersect) {
  17676. this.ui.moveNode.x = lastX;
  17677. this.ui.moveNode.y = lastY;
  17678. rootBall.gameObj.x = lastX;
  17679. rootBall.gameObj.y = lastY;
  17680. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17681. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17682. }
  17683. else {
  17684. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17685. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17686. }
  17687. this.showBallUI();
  17688. this.ui.moveNode.finger.visible = true;
  17689. xGame.common.d2World.getHelpLine();
  17690. break;
  17691. case PressType.rulerNode:
  17692. break;
  17693. case PressType.d2Root:
  17694. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17695. if (dis <= 25) {
  17696. this.moveToClickDot(e);
  17697. }
  17698. break;
  17699. default:
  17700. break;
  17701. }
  17702. this.pressTarget = -1;
  17703. }
  17704. checkGuide() {
  17705. let guide = DataMgr.getSkillGuide();
  17706. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17707. xGame.common.guideStep++;
  17708. xGame.common.gameUI.ui.guide2.visible = false;
  17709. xGame.common.gameUI.ui.guide3.visible = true;
  17710. }
  17711. }
  17712. finishGuide() {
  17713. let guide = DataMgr.getSkillGuide();
  17714. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17715. xGame.common.guideStep = 10;
  17716. this.closeAllGuide();
  17717. }
  17718. }
  17719. closeAllGuide() {
  17720. xGame.common.gameUI.ui.guide1.visible = false;
  17721. xGame.common.gameUI.ui.guide2.visible = false;
  17722. xGame.common.gameUI.ui.guide3.visible = false;
  17723. }
  17724. updateBarInfo() {
  17725. let star = this.ui.powerNode.y;
  17726. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17727. if (rate >= 1)
  17728. rate = 1;
  17729. if (rate <= 0)
  17730. rate = 0;
  17731. this.powerNum = Math.ceil(rate * 100);
  17732. this.ui.powerNode.value = this.powerNum;
  17733. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17734. this.ui.colorNode.value = this.powerNum;
  17735. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17736. this.ui.powerEft.visible = this.powerNum != 0;
  17737. this.ui.colorNode.visible = this.powerNum != 0;
  17738. this.ui.powerTxt.text = this.powerNum + "";
  17739. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17740. }
  17741. forceCancel() {
  17742. this.ui.powerNode.value = 0;
  17743. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17744. this.ui.powerTxt.text = "";
  17745. }
  17746. checkRodMoveDir() {
  17747. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17748. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17749. if (tempX >= 0 && tempY <= 0) {
  17750. return this.checkDir();
  17751. }
  17752. else if (tempX < 0 && tempY < 0) {
  17753. return this.checkDir(1, -1);
  17754. }
  17755. else if (tempX < 0 && tempY > 0) {
  17756. return this.checkDir(-1, -1);
  17757. }
  17758. else {
  17759. return this.checkDir(-1, 1);
  17760. }
  17761. }
  17762. checkDir(flagX = 1, flagY = 1) {
  17763. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17764. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17765. if (offsetY == 0) {
  17766. return offsetX * flagX;
  17767. }
  17768. if (offsetX == 0) {
  17769. return offsetY * flagY;
  17770. }
  17771. let angle = offsetY / offsetX;
  17772. if (Math.abs(angle) >= 1) {
  17773. return offsetY * flagY;
  17774. }
  17775. else {
  17776. return offsetX * flagX;
  17777. }
  17778. }
  17779. judgeBallIntersect() {
  17780. let rootBall = xGame.common.d2World.rootBall;
  17781. let ballArr = xGame.common.d2World.ballArr;
  17782. let radius = rootBall.gameObj.width / 2;
  17783. let temp;
  17784. let isIntersect = false;
  17785. for (let index = 0; index < ballArr.length; index++) {
  17786. temp = ballArr[index];
  17787. if (temp.number == rootBall.number)
  17788. continue;
  17789. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17790. if (isIntersect) {
  17791. break;
  17792. }
  17793. }
  17794. return isIntersect;
  17795. }
  17796. hideBallUI() {
  17797. let d2Gan = xGame.common.d2World.d2Gan;
  17798. if (!d2Gan.ui.isDisposed)
  17799. d2Gan.ui.visible = false;
  17800. let d2Help = xGame.common.d2World.d2HelpLine;
  17801. if (!d2Help.ui.isDisposed)
  17802. d2Help.ui.visible = false;
  17803. let rootBall = xGame.common.d2World.rootBall;
  17804. if (!rootBall.destroyed) {
  17805. rootBall.gameObj.active = false;
  17806. }
  17807. }
  17808. showBallUI() {
  17809. let d2Gan = xGame.common.d2World.d2Gan;
  17810. if (!d2Gan.ui.isDisposed)
  17811. d2Gan.ui.visible = true;
  17812. let d2Help = xGame.common.d2World.d2HelpLine;
  17813. if (!d2Help.ui.isDisposed)
  17814. d2Help.ui.visible = true;
  17815. let rootBall = xGame.common.d2World.rootBall;
  17816. if (!rootBall.destroyed) {
  17817. rootBall.gameObj.active = true;
  17818. }
  17819. }
  17820. moveToClickDot(e) {
  17821. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17822. let root = xGame.common.d2World.rootBall.gameObj;
  17823. let xx = e.stageX - xGame.common.sysOffestNum;
  17824. let yy = e.stageY;
  17825. let x = xx - root.x;
  17826. let y = yy - root.y;
  17827. let angle = xGame.common.getfguiRotation(x, y);
  17828. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17829. xGame.common.d2World.getHelpLine();
  17830. }
  17831. this.isMoveRod = false;
  17832. xGame.common.clickedBall = false;
  17833. }
  17834. openAllEvent() {
  17835. this.closeAllEvent();
  17836. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17837. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17838. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17839. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17840. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17841. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17842. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17843. }
  17844. closeAllEvent() {
  17845. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17846. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17847. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17848. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17849. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17850. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17851. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17852. }
  17853. resetGame() {
  17854. this.closeAllEvent();
  17855. this.hideBallUI();
  17856. xGame.common.gameMgr.gamePause = true;
  17857. }
  17858. }
  17859. UIGame$1.uiName = "UIGame";
  17860. class UIAddCoin$1 extends UIBase {
  17861. constructor() {
  17862. super();
  17863. this.coinNum = 2000;
  17864. }
  17865. onConstructor() {
  17866. this.ui = ui_UIAddCoin.createInstance();
  17867. this.contentPane = this.ui;
  17868. this.isEject = false;
  17869. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17870. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17871. }
  17872. show() {
  17873. super.show();
  17874. this.ui.t0.play();
  17875. }
  17876. videoAddCoin() {
  17877. Moyu.showVideoAd(() => {
  17878. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17879. this.hide();
  17880. }, EAdType.addFailCoin);
  17881. }
  17882. }
  17883. UIAddCoin$1.uiName = "UIAddCoin";
  17884. class UIInvitation$1 extends UIBase {
  17885. constructor() {
  17886. super();
  17887. }
  17888. onConstructor() {
  17889. this.ui = ui_UIInvitation.createInstance();
  17890. this.contentPane = this.ui;
  17891. this.isEject = false;
  17892. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17893. }
  17894. show() {
  17895. super.show();
  17896. }
  17897. enterGame() {
  17898. xGame.common.gameMode = GameMode.classic;
  17899. DataMgr.setChallengeTimes(1);
  17900. xGame.common.passAwardCoin = 2000;
  17901. let need = xGame.common.classicNiceNeddCoin;
  17902. if (DataMgr.coinEnough(need)) {
  17903. DataMgr.setCoin(-need);
  17904. xGame.eventMgr.event(RESTART_GAME, true);
  17905. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17906. }
  17907. else {
  17908. xGame.eventMgr.event(RESTART_GAME, true);
  17909. }
  17910. this.hide();
  17911. }
  17912. hide() {
  17913. super.hide();
  17914. }
  17915. }
  17916. UIInvitation$1.uiName = "UIInvitation";
  17917. class UIPower$1 extends UIBase {
  17918. constructor() {
  17919. super();
  17920. }
  17921. onConstructor() {
  17922. this.ui = ui_UIPower.createInstance();
  17923. this.contentPane = this.ui;
  17924. this.isEject = false;
  17925. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17926. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17927. }
  17928. show() {
  17929. super.show();
  17930. this.ui.t0.play();
  17931. }
  17932. videoGetPower() {
  17933. Moyu.showVideoAd(() => {
  17934. DataMgr.setPower(xGame.common.videoPower, true);
  17935. xGame.eventMgr.event(POWER_TIME);
  17936. this.hide();
  17937. }, EAdType.getPower);
  17938. }
  17939. }
  17940. UIPower$1.uiName = "UIPower";
  17941. class UIGameEnd$1 extends UIBase {
  17942. constructor() {
  17943. super();
  17944. this.success = false;
  17945. this.awardCoinNum = 1000;
  17946. this.awardDiamondNum = 10;
  17947. }
  17948. onConstructor() {
  17949. this.ui = ui_UIGameEnd.createInstance();
  17950. this.contentPane = this.ui;
  17951. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17952. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17953. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17954. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17955. this.ui.talkNode.visible = false;
  17956. if (Moyu.isKs)
  17957. this.ui.closeNode.closeBtn.x += 100;
  17958. }
  17959. updateType() {
  17960. switch (xGame.common.gameMode) {
  17961. case GameMode.classic:
  17962. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17963. this.ui.coinNode.visible = this.success;
  17964. if (!this.success) {
  17965. Laya.timer.once(500, this, () => {
  17966. xGame.uiMgr.Show(UIAddCoin$1);
  17967. });
  17968. }
  17969. this.ui.isGetAward.visible = false;
  17970. this.ui.leftBtn.c1.selectedIndex = 3;
  17971. this.ui.rightBtn.c1.selectedIndex = 0;
  17972. this.moneyNode.ui.c1.selectedIndex = 1;
  17973. break;
  17974. case GameMode.bigMove:
  17975. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17976. this.ui.coinNode.visible = this.success;
  17977. if (xGame.common.gameMode == GameMode.bigMove) {
  17978. if (this.success) {
  17979. DataMgr.setSkillSuccessTimes(1, true);
  17980. DataMgr.setSkillAccTimes(1);
  17981. }
  17982. else {
  17983. DataMgr.setSkillSuccessTimes(0, false);
  17984. }
  17985. }
  17986. if (!this.success) {
  17987. Laya.timer.once(500, this, () => {
  17988. xGame.uiMgr.Show(UIAddCoin$1);
  17989. });
  17990. }
  17991. this.ui.isGetAward.visible = false;
  17992. this.ui.leftBtn.c1.selectedIndex = 3;
  17993. this.ui.rightBtn.c1.selectedIndex = 0;
  17994. this.moneyNode.ui.c1.selectedIndex = 1;
  17995. break;
  17996. case GameMode.placeBall:
  17997. this.ui.coinNode.visible = false;
  17998. if (this.success) {
  17999. if (xGame.common.placeBallStarNum == 3) {
  18000. this.ui.c1.selectedIndex = 2;
  18001. }
  18002. else {
  18003. this.ui.c1.selectedIndex = 3;
  18004. }
  18005. }
  18006. else {
  18007. this.ui.c1.selectedIndex = 4;
  18008. }
  18009. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18010. if (cfg.type == PlaceBallType.challenge) {
  18011. this.ui.c1.selectedIndex = 2;
  18012. }
  18013. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `打进场上所有球` : `打进${cfg.ball}颗球`;
  18014. this.updatePlaceBallBtn();
  18015. this.updatePlaceBallStarNum();
  18016. this.updatePlaceBallAwardState();
  18017. this.moneyNode.ui.c1.selectedIndex = 2;
  18018. this.moneyNode.checkPowerTime();
  18019. this.moneyNode.powerChange();
  18020. DataMgr.upRankData();
  18021. break;
  18022. default:
  18023. break;
  18024. }
  18025. }
  18026. updatePlaceBallBtn() {
  18027. this.ui.leftBtn.c1.selectedIndex = 5;
  18028. if (this.success) {
  18029. this.ui.rightBtn.c1.selectedIndex = 14;
  18030. }
  18031. else {
  18032. if (xGame.common.placeBallStarNum == 3) {
  18033. this.ui.rightBtn.c1.selectedIndex = 14;
  18034. }
  18035. else {
  18036. this.ui.rightBtn.c1.selectedIndex = 1;
  18037. }
  18038. }
  18039. }
  18040. updatePlaceBallStarNum() {
  18041. let starNum = xGame.common.placeBallStarNum;
  18042. if (starNum == 0)
  18043. this.ui.starNumNode.c1.selectedIndex = 3;
  18044. else {
  18045. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18046. }
  18047. }
  18048. updatePlaceBallAwardState() {
  18049. let level = xGame.common.placeBallCurLevel;
  18050. let starNum = xGame.common.placeBallStarNum;
  18051. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18052. let data = cfgTable.placeballData[level].award;
  18053. let cfg = cfgTable.placeballData[level];
  18054. this.awardDiamondNum = data[1];
  18055. this.awardCoinNum = data[0];
  18056. if (cfg.type == PlaceBallType.challenge) {
  18057. this.awardDiamondNum = 0;
  18058. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18059. }
  18060. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18061. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18062. if (cfg.type == PlaceBallType.challenge) {
  18063. this.ui.awardNode.coinNode.visible = true;
  18064. }
  18065. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18066. this.ui.awardNode.diamondNode.x = 265;
  18067. this.ui.awardNode.coinNode.x = 354;
  18068. }
  18069. else {
  18070. this.ui.awardNode.diamondNode.x = 291;
  18071. this.ui.awardNode.coinNode.x = 291;
  18072. }
  18073. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18074. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18075. if (this.awardCoinNum == 0) {
  18076. this.ui.awardNode.coinNode.numTxt.text = "";
  18077. }
  18078. if (getAward) {
  18079. this.ui.isGetAward.visible = true;
  18080. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18081. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18082. }
  18083. else {
  18084. this.ui.isGetAward.visible = false;
  18085. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18086. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18087. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18088. }
  18089. else {
  18090. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18091. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18092. }
  18093. }
  18094. }
  18095. show(success) {
  18096. super.show();
  18097. xGame.eventMgr.event(RESET_GAME);
  18098. this.success = success;
  18099. Laya.timer.clearAll(this);
  18100. this.playSecretaryAni();
  18101. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18102. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18103. offsetTime = Math.floor(offsetTime / 1000);
  18104. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18105. this.updateType();
  18106. Laya.timer.once(200, this, () => {
  18107. this.addAward(() => {
  18108. this.updateType();
  18109. Laya.timer.once(500, this, () => {
  18110. this.showChallengeLevel();
  18111. });
  18112. });
  18113. });
  18114. if (this.success) {
  18115. xGame.soundMgr.playSound('slots_roll01');
  18116. xGame.soundMgr.playSound("s_win");
  18117. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18118. }
  18119. else {
  18120. xGame.soundMgr.playSound('matchwin01');
  18121. xGame.soundMgr.playSound("s_lose");
  18122. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18123. }
  18124. if (!Moyu.isLegal)
  18125. PlatMgr.showBanner(true);
  18126. let challengeNum = DataMgr.getChallengeTimes();
  18127. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18128. DataMgr.setChallengeTimes(1);
  18129. }
  18130. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18131. DataMgr.setClassicTimes();
  18132. }
  18133. }
  18134. showChallengeLevel() {
  18135. if (DataMgr.getChallengeTimes() != 0)
  18136. return;
  18137. let skill = DataMgr.getSkillAccTimes();
  18138. let put = DataMgr.getPlaceBallLevelList().length;
  18139. if (skill >= 3 || put >= 5) {
  18140. xGame.uiMgr.Show(UIInvitation$1);
  18141. this.hide();
  18142. }
  18143. }
  18144. addAward(callback) {
  18145. if (!this.success) {
  18146. callback && callback();
  18147. return;
  18148. }
  18149. switch (xGame.common.gameMode) {
  18150. case GameMode.classic:
  18151. this.awardCoinNum = xGame.common.passAwardCoin;
  18152. this.awardDiamondNum = 0;
  18153. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18154. break;
  18155. case GameMode.bigMove:
  18156. this.awardCoinNum = xGame.common.passAwardCoin;
  18157. this.awardDiamondNum = 0;
  18158. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18159. callback && callback();
  18160. break;
  18161. case GameMode.placeBall:
  18162. let level = xGame.common.placeBallCurLevel;
  18163. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18164. if (xGame.common.placeBallStarNum != 3) {
  18165. callback && callback();
  18166. return;
  18167. }
  18168. else {
  18169. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18170. if (getAward) {
  18171. callback && callback();
  18172. return;
  18173. }
  18174. }
  18175. let cfg = cfgTable.placeballData[level];
  18176. let data = cfgTable.placeballData[level].award;
  18177. this.awardCoinNum = data[0];
  18178. this.awardDiamondNum = data[1];
  18179. if (cfg.type == PlaceBallType.challenge) {
  18180. this.awardDiamondNum = 0;
  18181. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18182. }
  18183. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18184. let diamondAward;
  18185. if (this.awardDiamondNum > 0) {
  18186. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18187. xGame.common.getAward([diamondAward, coinAward], callback);
  18188. }
  18189. else {
  18190. xGame.common.getAward([coinAward], callback);
  18191. }
  18192. if (cfg.type == PlaceBallType.normal) {
  18193. DataMgr.setPlaceBallAward(level);
  18194. }
  18195. break;
  18196. default:
  18197. break;
  18198. }
  18199. }
  18200. playSecretaryAni() {
  18201. let parent = this.ui.secretary.displayObject;
  18202. parent.destroyChildren();
  18203. let xx = this.ui.secretary.width / 2;
  18204. let yy = this.ui.secretary.height;
  18205. let scale = xGame.common.getSecretaryScale();
  18206. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18207. if (this.success) {
  18208. let rand = Math.random() <= 0.5 ? 2 : 3;
  18209. xGame.common.secretary.play(data, rand, false, parent, () => {
  18210. xGame.common.secretary.play(data, 1, true, parent);
  18211. });
  18212. }
  18213. else {
  18214. xGame.common.secretary.play(data, 0, true, parent);
  18215. }
  18216. }
  18217. restartGame() {
  18218. switch (xGame.common.gameMode) {
  18219. case GameMode.classic:
  18220. xGame.eventMgr.event(RESTART_GAME);
  18221. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18222. break;
  18223. case GameMode.bigMove:
  18224. this.hide();
  18225. xGame.eventMgr.event(RESTART_GAME);
  18226. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18227. break;
  18228. default:
  18229. break;
  18230. }
  18231. }
  18232. hide() {
  18233. super.hide();
  18234. xGame.common.stopGirlPop(this.ui.talkNode);
  18235. PlatMgr.showBanner(false);
  18236. }
  18237. returnHome() {
  18238. this.hide();
  18239. let showFailWords = !this.success;
  18240. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18241. }
  18242. clickLeftBtn() {
  18243. switch (xGame.common.gameMode) {
  18244. case GameMode.classic:
  18245. case GameMode.bigMove:
  18246. this.returnHome();
  18247. break;
  18248. case GameMode.placeBall:
  18249. let level = xGame.common.placeBallCurLevel;
  18250. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18251. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18252. break;
  18253. default:
  18254. break;
  18255. }
  18256. }
  18257. powerStartPlaceBallLevel(level, btn) {
  18258. if (DataMgr.powerEnough()) {
  18259. btn.touchable = false;
  18260. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18261. btn.touchable = true;
  18262. DataMgr.setPower(-1);
  18263. xGame.eventMgr.event(POWER_TIME);
  18264. this.startPlaceBallLevel(level);
  18265. }));
  18266. }
  18267. else {
  18268. xGame.uiMgr.Show(UIPower$1, 0);
  18269. }
  18270. }
  18271. clickRightBtn() {
  18272. switch (xGame.common.gameMode) {
  18273. case GameMode.classic:
  18274. case GameMode.bigMove:
  18275. this.restartGame();
  18276. break;
  18277. case GameMode.placeBall:
  18278. let level = xGame.common.placeBallCurLevel;
  18279. let data = DataMgr.getPlaceBallLevel(level);
  18280. let curPss = data.play && !data.isCur;
  18281. if (curPss) {
  18282. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18283. }
  18284. else {
  18285. Moyu.sendDataEvent("placeBallNextLevel");
  18286. Moyu.showVideoAd(() => {
  18287. DataMgr.setPlaceBallLevel(level, 1);
  18288. this.startPlaceBallLevel(level + 1);
  18289. }, xGame.define.EAdType.placeBallNextLevel);
  18290. }
  18291. break;
  18292. default:
  18293. break;
  18294. }
  18295. }
  18296. startPlaceBallLevel(level) {
  18297. xGame.common.gameMode = GameMode.placeBall;
  18298. xGame.common.placeBallCurLevel = level;
  18299. xGame.uiMgr.Show(UIGame$1);
  18300. this.hide();
  18301. }
  18302. }
  18303. UIGameEnd$1.uiName = "UIGameEnd";
  18304. class ShowItem$1 {
  18305. constructor() {
  18306. this.ui = ui_ShowItem.createInstance();
  18307. }
  18308. destroySelf() {
  18309. if (!this.ui.isDisposed) {
  18310. this.ui.removeFromParent();
  18311. this.ui.dispose();
  18312. }
  18313. }
  18314. setParent(parent) {
  18315. parent.addChild(this.ui);
  18316. }
  18317. setPos(x, y) {
  18318. this.ui.x = x;
  18319. this.ui.y = y;
  18320. }
  18321. setUrl(index) {
  18322. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18323. }
  18324. }
  18325. class UILevelProp$1 extends UIBase {
  18326. constructor() {
  18327. super();
  18328. this.firstPos = 385;
  18329. this.secondPos = 467;
  18330. this.showItemArr = [];
  18331. }
  18332. onConstructor() {
  18333. this.ui = ui_UILevelProp.createInstance();
  18334. this.contentPane = this.ui;
  18335. this.isEject = false;
  18336. this.addUIClick(this.ui.closeBtn, this.hide);
  18337. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18338. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18339. }
  18340. show(level) {
  18341. super.show();
  18342. this.ui.t1.play();
  18343. this.level = level;
  18344. this.data = cfgTable.placeballData[this.level];
  18345. this.updateSelf();
  18346. this.showPreView();
  18347. this.moneyNode.ui.c1.selectedIndex = 2;
  18348. this.moneyNode.checkPowerTime();
  18349. this.moneyNode.powerChange();
  18350. }
  18351. showPreView() {
  18352. let item;
  18353. let data;
  18354. for (let index = 0; index < this.showItemArr.length; index++) {
  18355. item = this.showItemArr[index];
  18356. item.destroySelf();
  18357. }
  18358. this.showItemArr = [];
  18359. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18360. for (const key in cfgData) {
  18361. data = cfgData[key];
  18362. item = new ShowItem$1();
  18363. item.setParent(this.ui.myNode.displayRoot);
  18364. item.setPos(data.x, data.y);
  18365. item.setUrl(data.value);
  18366. this.showItemArr.push(item);
  18367. }
  18368. }
  18369. updateSelf() {
  18370. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18371. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18372. if (this.data.ball == -1) {
  18373. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18374. }
  18375. else {
  18376. this.ui.myNode.conditionTxt.text = "奖励关卡";
  18377. }
  18378. let localData = DataMgr.getPlaceBallLevel(this.level);
  18379. let getAward = localData.getAward;
  18380. let cfg = cfgTable.placeballData[this.level];
  18381. let coin = this.data.award[0];
  18382. let diamond = this.data.award[1];
  18383. if (cfg.type == PlaceBallType.challenge) {
  18384. diamond = 0;
  18385. coin = 100;
  18386. }
  18387. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18388. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18389. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18390. if (cfg.type == PlaceBallType.challenge) {
  18391. this.ui.myNode.coinNode.numTxt.text = "";
  18392. }
  18393. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18394. if (coin > 0 && diamond > 0) {
  18395. this.ui.myNode.diamondNode.x = 385;
  18396. this.ui.myNode.coinNode.x = 467;
  18397. }
  18398. else {
  18399. this.ui.myNode.diamondNode.x = 385;
  18400. this.ui.myNode.coinNode.x = 385;
  18401. }
  18402. if (!getAward) {
  18403. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18404. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18405. }
  18406. else {
  18407. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18408. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18409. }
  18410. }
  18411. startGame() {
  18412. if (DataMgr.powerEnough()) {
  18413. this.ui.myNode.startBtn.touchable = false;
  18414. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18415. this.ui.myNode.startBtn.touchable = true;
  18416. DataMgr.setPower(-1);
  18417. xGame.eventMgr.event(POWER_TIME);
  18418. xGame.common.gameMode = GameMode.placeBall;
  18419. xGame.common.placeBallCurLevel = this.level;
  18420. xGame.uiMgr.Show(UIGame$1);
  18421. xGame.uiMgr.Hide(UILevelDisplay$1);
  18422. xGame.uiMgr.Hide(UIMain$1);
  18423. this.hide();
  18424. }));
  18425. }
  18426. else {
  18427. xGame.uiMgr.Show(UIPower$1);
  18428. }
  18429. }
  18430. hide() {
  18431. super.hide();
  18432. }
  18433. }
  18434. UILevelProp$1.uiName = "UILevelProp";
  18435. class PutBallLevelDisplay$1 {
  18436. constructor(ui, index) {
  18437. this.index = 0;
  18438. this.ui = ui;
  18439. this.index = index;
  18440. this.ui.onClick(this, this.clickSelf);
  18441. this.updateSelf();
  18442. this.ui.levelTxt.text = (this.index + 1) + "";
  18443. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18444. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18445. }
  18446. updateSelf() {
  18447. let level = this.index + 1;
  18448. this.data = DataMgr.getPlaceBallLevel(level);
  18449. this.ui.starNode.c1.selectedIndex = this.data.star;
  18450. let isChallenge = cfgTable.placeballData[level].type;
  18451. if (this.data.isCur) {
  18452. if (isChallenge) {
  18453. this.ui.c1.selectedIndex = 5;
  18454. }
  18455. else {
  18456. this.ui.c1.selectedIndex = 2;
  18457. }
  18458. }
  18459. else {
  18460. if (this.data.play) {
  18461. if (this.data.star == 3) {
  18462. this.ui.c1.selectedIndex = 0;
  18463. }
  18464. else {
  18465. this.ui.c1.selectedIndex = 1;
  18466. }
  18467. }
  18468. else {
  18469. if (isChallenge) {
  18470. this.ui.c1.selectedIndex = 4;
  18471. }
  18472. else {
  18473. this.ui.c1.selectedIndex = 3;
  18474. }
  18475. }
  18476. }
  18477. }
  18478. clickSelf() {
  18479. if (!this.data.play)
  18480. return;
  18481. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18482. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18483. }
  18484. }
  18485. class UILevelDisplay$1 extends UIBase {
  18486. constructor() {
  18487. super();
  18488. }
  18489. onConstructor() {
  18490. this.ui = ui_UILevelDisplay.createInstance();
  18491. this.contentPane = this.ui;
  18492. this.isEject = false;
  18493. this.myList = this.ui.myNode.myList;
  18494. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18495. this.levelItemArr = [];
  18496. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18497. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18498. this.myList.numItems = levelNum;
  18499. if (Moyu.isKs)
  18500. this.ui.closeNode.closeBtn.x += 100;
  18501. }
  18502. levelItemRender(index, target) {
  18503. let item = new PutBallLevelDisplay$1(target, index);
  18504. this.levelItemArr.push(item);
  18505. }
  18506. show() {
  18507. super.show();
  18508. this.updateLevel();
  18509. this.scrollToPlace();
  18510. }
  18511. updateLevel() {
  18512. let temp;
  18513. for (let index = 0; index < this.levelItemArr.length; index++) {
  18514. temp = this.levelItemArr[index];
  18515. temp.updateSelf();
  18516. }
  18517. }
  18518. scrollToPlace() {
  18519. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18520. let passArr = DataMgr.getPlaceBallLevelList();
  18521. let offest = passArr.length;
  18522. if (offest >= maxNum - 1)
  18523. offest = maxNum - 1;
  18524. this.myList.scrollToView(offest, true, true);
  18525. }
  18526. hide() {
  18527. super.hide();
  18528. }
  18529. }
  18530. UILevelDisplay$1.uiName = "UILevelDisplay";
  18531. class UIMatching$1 extends UIBase {
  18532. constructor() {
  18533. super();
  18534. }
  18535. onConstructor() {
  18536. this.ui = ui_UIMatching.createInstance();
  18537. this.contentPane = this.ui;
  18538. this.isEject = false;
  18539. }
  18540. show(callback) {
  18541. super.show();
  18542. PlatMgr.showBanner(true);
  18543. this.callback = callback;
  18544. let user = Moyu.getUserInfo();
  18545. if (!this.selfPot) {
  18546. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18547. }
  18548. if (!this.aiPot) {
  18549. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18550. }
  18551. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18552. this.ui.selfHead.nameTxt.text = user.nickName;
  18553. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18554. this.ui.aiHead.nameTxt.text = "???";
  18555. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18556. this.ui.selfHead.c1.selectedIndex = 0;
  18557. this.ui.aiHead.c1.selectedIndex = 0;
  18558. this.ui.selfHead.x = this.selfPot.x;
  18559. this.ui.selfHead.y = this.selfPot.y;
  18560. this.ui.aiHead.x = this.aiPot.x;
  18561. this.ui.aiHead.y = this.aiPot.y;
  18562. switch (xGame.common.gameMode) {
  18563. case GameMode.classic:
  18564. break;
  18565. case GameMode.bigMove:
  18566. this.initSkillData();
  18567. break;
  18568. default:
  18569. break;
  18570. }
  18571. this.ui.t1.play(Laya.Handler.create(this, () => {
  18572. this.ui.t2.play(Laya.Handler.create(this, () => {
  18573. switch (xGame.common.gameMode) {
  18574. case GameMode.classic:
  18575. this.waitingPeople();
  18576. break;
  18577. case GameMode.bigMove:
  18578. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18579. break;
  18580. default:
  18581. break;
  18582. }
  18583. }));
  18584. }));
  18585. }
  18586. initSkillData() {
  18587. this.skillSelectData = [];
  18588. let skillUrl = xGame.common.skillIconList;
  18589. let skillName = xGame.common.skillNameList;
  18590. let skillLevel = DataMgr.getBigSkillList();
  18591. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18592. for (let index = 0; index < 5; index++) {
  18593. let obj = {};
  18594. obj.skillImg = skillUrl[index];
  18595. obj.skillName = skillName[index];
  18596. obj.skillType = skillType[index];
  18597. obj.skillLevel = skillLevel[index];
  18598. this.skillSelectData.push(obj);
  18599. }
  18600. }
  18601. getAISkillLevel(myLevel) {
  18602. let video = xGame.common.upSkillLevel;
  18603. let aiLevel;
  18604. let temp;
  18605. if (video) {
  18606. temp = xGame.common.randomNum(-2, -1);
  18607. }
  18608. else {
  18609. if (myLevel <= 5) {
  18610. temp = xGame.common.randomNum(1, 3);
  18611. }
  18612. else if (myLevel <= 9) {
  18613. temp = xGame.common.randomNum(-2, 1);
  18614. }
  18615. else {
  18616. temp = xGame.common.randomNum(-4, 0);
  18617. }
  18618. }
  18619. aiLevel = temp + myLevel;
  18620. if (aiLevel <= 1)
  18621. aiLevel = 1;
  18622. if (aiLevel >= 10)
  18623. aiLevel = 10;
  18624. return aiLevel;
  18625. }
  18626. getAISkillType() {
  18627. return xGame.common.randomNum(1, 4);
  18628. let successTimes = DataMgr.getSkillSuccessTimes();
  18629. let info = cfgTable.aiskillData[successTimes];
  18630. if (!info) {
  18631. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18632. info = cfgTable.aiskillData[max];
  18633. }
  18634. let dataArr = info.skillselect;
  18635. let myCfg = {};
  18636. for (let index = 0; index < dataArr.length; index++) {
  18637. let temp = dataArr[index].split('-');
  18638. myCfg[temp[0]] = {};
  18639. myCfg[temp[0]].id = parseInt(temp[0]);
  18640. myCfg[temp[0]].weight = parseInt(temp[1]);
  18641. }
  18642. let aiCfg = xGame.common.initWeight(myCfg);
  18643. let curData = xGame.common.getRandomWeightData(aiCfg);
  18644. return parseInt(curData.id);
  18645. }
  18646. getAISkillData(index) {
  18647. let myLevel = this.skillSelectData[index].skillLevel;
  18648. let aiLevel = this.getAISkillLevel(myLevel);
  18649. let aiType = this.getAISkillType() - 1;
  18650. return { aiLevel, aiType } = { aiLevel, aiType };
  18651. }
  18652. skillSelectFinish(index) {
  18653. let aiInfo = this.getAISkillData(index);
  18654. xGame.common.gameMgr.selfCurSkill = index;
  18655. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18656. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18657. this.ui.selfHead.c1.selectedIndex = 1;
  18658. this.ui.aiHead.c1.selectedIndex = 1;
  18659. let myData = this.skillSelectData[index];
  18660. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18661. let guide = DataMgr.getSkillGuide();
  18662. if (guide == 0) {
  18663. this.ui.selfHead.skillTxt.text = myData.skillName + " 满级";
  18664. }
  18665. else {
  18666. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18667. }
  18668. let aiData = this.skillSelectData[aiInfo.aiType];
  18669. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18670. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18671. this.waitingPeople();
  18672. }
  18673. waitingPeople() {
  18674. let time = xGame.common.randomNum(1000, 3000);
  18675. time += 1000;
  18676. Laya.timer.once(time, this, () => {
  18677. this.matchingSuccess();
  18678. });
  18679. }
  18680. matchingSuccess() {
  18681. let gameUI = xGame.common.gameUI;
  18682. let name = gameUI.ui.topNode.aiNameTxt.text;
  18683. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18684. this.ui.aiHead.nameTxt.text = name;
  18685. this.ui.aiHead.headImg.url = url;
  18686. name = gameUI.ui.topNode.selfNameTxt.text;
  18687. url = gameUI.ui.topNode.selfHeadLoader.url;
  18688. this.ui.selfHead.nameTxt.text = name;
  18689. this.ui.selfHead.headImg.url = url;
  18690. this.ui.t3.play(Laya.Handler.create(this, () => {
  18691. this.callback && this.callback();
  18692. this.ui.t4.play(Laya.Handler.create(this, () => {
  18693. this.destroySelf();
  18694. }));
  18695. }));
  18696. }
  18697. destroySelf() {
  18698. this.callback = null;
  18699. this.skillSelectData = null;
  18700. this.selfPot = null;
  18701. this.aiPot = null;
  18702. if (!this.ui.isDisposed) {
  18703. this.ui.removeFromParent();
  18704. this.ui.dispose();
  18705. }
  18706. xGame.uiMgr.destroyUI(this);
  18707. }
  18708. }
  18709. UIMatching$1.uiName = "UIMatching";
  18710. class SkillDisplay$1 {
  18711. constructor(ui, data, uiIndex) {
  18712. this.starX = 0;
  18713. this.starY = 0;
  18714. this.index = 0;
  18715. this.ui = ui;
  18716. this.data = data;
  18717. this.index = uiIndex;
  18718. this.initSelf();
  18719. }
  18720. initSelf() {
  18721. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18722. this.ui.nameTxt.text = this.data.name;
  18723. this.ui.describeTxt.text = this.data.describe;
  18724. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18725. this.ui.startBtn.onClick(this, this.startGame);
  18726. this.updateSelf();
  18727. }
  18728. updateSelf() {
  18729. this.checkTry();
  18730. let level = DataMgr.getBigSkillByIndex(this.index);
  18731. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18732. }
  18733. checkTry() {
  18734. let index = this.index;
  18735. let level = DataMgr.getBigSkillByIndex(index);
  18736. if (level == null) {
  18737. DataMgr.setBigSkill(index, 1, false);
  18738. level = 1;
  18739. }
  18740. this.ui.levelTxt.text = "LV." + level;
  18741. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18742. this.ui.tryNode.visible = true;
  18743. else
  18744. this.ui.tryNode.visible = false;
  18745. }
  18746. clickAddLevel() {
  18747. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18748. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18749. Moyu.showVideoAd(() => {
  18750. DataMgr.setBigSkill(this.data.index, 1);
  18751. this.updateSelf();
  18752. xGame.common.upSkillLevel = true;
  18753. }, EAdType.upSkill);
  18754. }
  18755. startGame() {
  18756. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18757. let needCoin = xGame.common.bigMoveNeedCoin;
  18758. xGame.common.passAwardCoin = 2000;
  18759. let guide = DataMgr.getSkillGuide();
  18760. xGame.common.temSelfLevel = 0;
  18761. if (guide == 0) {
  18762. needCoin = 0;
  18763. xGame.common.temSelfLevel = 100;
  18764. }
  18765. if (DataMgr.coinEnough(needCoin)) {
  18766. DataMgr.setCoin(-needCoin);
  18767. xGame.common.curPlayerSkillType = this.index;
  18768. if (guide == 0)
  18769. xGame.common.curPlayerSkillType = 0;
  18770. xGame.uiMgr.Show(UIGame$1);
  18771. xGame.uiMgr.Hide(UIMain$1);
  18772. xGame.uiMgr.Show(UIMatching$1, () => {
  18773. xGame.common.gameUI.ui.alpha = 1;
  18774. xGame.common.gameUI.startGame();
  18775. xGame.uiMgr.Hide(UISkill$1);
  18776. });
  18777. }
  18778. else {
  18779. xGame.uiMgr.Show(UIAddProp$1, 0);
  18780. Moyu.sendDataEvent("AddCoinVideo");
  18781. }
  18782. }
  18783. }
  18784. class UISkill$1 extends UIBase {
  18785. constructor() {
  18786. super();
  18787. this.skillData = [];
  18788. }
  18789. onConstructor() {
  18790. this.ui = ui_UISkill.createInstance();
  18791. this.contentPane = this.ui;
  18792. this.isEject = false;
  18793. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18794. this.initSkillData();
  18795. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18796. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18797. this.displayList = [];
  18798. this.ui.skillNode.skillList.numItems = 4;
  18799. this.addUIClick(this.ui, this.interuptSecretary);
  18800. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18801. this.ui.talkNode.visible = false;
  18802. if (Moyu.isKs)
  18803. this.ui.closeNode.closeBtn.x += 100;
  18804. }
  18805. show() {
  18806. super.show();
  18807. this.playSecretaryIdle();
  18808. this.moneyNode.ui.c1.selectedIndex = 1;
  18809. Laya.timer.clearAll(this);
  18810. xGame.soundMgr.playSound("s_start");
  18811. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18812. let guide = DataMgr.getSkillGuide();
  18813. this.ui.guideNode.visible = guide == 0;
  18814. let item = this.getSkillItemByUIIndex(0);
  18815. if (guide == 0) {
  18816. item.ui.c1.selectedIndex = 1;
  18817. }
  18818. else {
  18819. item.ui.c1.selectedIndex = 0;
  18820. }
  18821. this.ui.guideNode.guideBtn.visible = guide == 0;
  18822. for (let index = 0; index < this.displayList.length; index++) {
  18823. this.displayList[index].checkTry();
  18824. }
  18825. }
  18826. getSkillItemByUIIndex(cur) {
  18827. for (let index = 0; index < this.displayList.length; index++) {
  18828. if (this.displayList[index].index == cur) {
  18829. return this.displayList[index];
  18830. }
  18831. }
  18832. }
  18833. enterGuideLevel() {
  18834. let item = this.getSkillItemByUIIndex(0);
  18835. item.startGame();
  18836. if (DataMgr.getNewUser())
  18837. Moyu.sendDataEvent("gameStart1");
  18838. }
  18839. initSkillData() {
  18840. this.skillData = [];
  18841. let nameList = xGame.common.skillNameList;
  18842. let iconList = xGame.common.skillIconList;
  18843. let describeList = [
  18844. "跳杆击球后,球高高跃起,砸在桌面上,直接打进额外1颗球",
  18845. "普通击球后,球杆向随机方向—扫,将杆子范围内1颗可击打球扫入球袋",
  18846. "我方击球后,在场地上将随机1颗球冻结,敌方无法击打冰冻球,且其他球碰到冰冻球会弹开",
  18847. "击球后在球桌上斩出一刀,并击飞斩中的球。(球不会飞出球桌)"
  18848. ];
  18849. let data;
  18850. for (let index = 0; index < nameList.length; index++) {
  18851. data = {};
  18852. data.name = nameList[index];
  18853. data.icon = iconList[index];
  18854. data.describe = describeList[index];
  18855. data.index = index;
  18856. this.skillData.push(data);
  18857. }
  18858. }
  18859. updateSkillItem(index, target) {
  18860. if (this.displayList[index] == null) {
  18861. let uiIndex;
  18862. switch (index) {
  18863. case 0:
  18864. uiIndex = 1;
  18865. break;
  18866. case 1:
  18867. uiIndex = 0;
  18868. break;
  18869. case 2:
  18870. uiIndex = 2;
  18871. break;
  18872. case 3:
  18873. uiIndex = 3;
  18874. break;
  18875. default:
  18876. break;
  18877. }
  18878. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18879. this.displayList.push(temp);
  18880. }
  18881. }
  18882. playSecretaryIdle() {
  18883. let parent = this.ui.secretary.displayObject;
  18884. parent.destroyChildren();
  18885. let xx = this.ui.secretary.width / 2;
  18886. let yy = this.ui.secretary.height;
  18887. let scale = xGame.common.getSecretaryScale();
  18888. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18889. xGame.common.secretary.play(data, 1, true, parent);
  18890. }
  18891. returnUIMain() {
  18892. this.hide();
  18893. xGame.common.stopGirlPop(this.ui.talkNode);
  18894. xGame.uiMgr.Show(UIMain$1);
  18895. }
  18896. interuptSecretary() {
  18897. Laya.timer.clearAll(this);
  18898. this.playSecretaryRandomSound();
  18899. }
  18900. playSecretaryRandomSound() {
  18901. if (this.isHide)
  18902. return;
  18903. let time = xGame.common.randomNum(45000, 60000);
  18904. Laya.timer.once(time, this, () => {
  18905. if (this.isHide)
  18906. return;
  18907. let index = xGame.common.randomNum(4, 7);
  18908. xGame.soundMgr.playSound("s_main0" + index);
  18909. let words = 1;
  18910. switch (index) {
  18911. case 4:
  18912. words = 5;
  18913. break;
  18914. case 5:
  18915. words = 3;
  18916. break;
  18917. case 6:
  18918. words = 6;
  18919. break;
  18920. case 7:
  18921. words = 7;
  18922. break;
  18923. default:
  18924. break;
  18925. }
  18926. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18927. this.playSecretaryRandomSound();
  18928. });
  18929. }
  18930. }
  18931. UISkill$1.uiName = "UISkill";
  18932. class UIAddProp$1 extends UIBase {
  18933. constructor() {
  18934. super();
  18935. this.curType = "";
  18936. }
  18937. onConstructor() {
  18938. this.ui = ui_UIAddProp.createInstance();
  18939. this.contentPane = this.ui;
  18940. this.isEject = false;
  18941. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18942. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18943. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18944. this.updateUI();
  18945. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18946. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18947. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18948. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18949. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18950. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18951. }
  18952. show(type) {
  18953. super.show();
  18954. this.curType = type == 0 ? "coin" : "diamond";
  18955. this.switchBtn("");
  18956. this.ui.t0.play();
  18957. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18958. PlatMgr.showInsert(true);
  18959. }
  18960. closeSelf() {
  18961. this.hide();
  18962. }
  18963. updateUI() {
  18964. let data = cfgTable.moneyData;
  18965. let temp;
  18966. let obj;
  18967. for (const key in data) {
  18968. temp = data[key];
  18969. obj = this.ui.myNode["node" + key];
  18970. if (parseInt(key) <= 2) {
  18971. obj.diamondTxt.text = "+" + temp.num;
  18972. }
  18973. else {
  18974. obj.coinTxt.text = temp.num;
  18975. obj.diamondTxt.text = temp.get.split('_')[1];
  18976. }
  18977. }
  18978. this.updateDiamondShare();
  18979. }
  18980. updateDiamondShare() {
  18981. let data = DataMgr.getShareDiamondTimes();
  18982. if (data >= xGame.common.maxShareDiamondTimes) {
  18983. this.ui.myNode.node1.shareTxt.text = "明日再来";
  18984. this.ui.myNode.node1.touchable = false;
  18985. }
  18986. else {
  18987. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  18988. this.ui.myNode.node1.touchable = true;
  18989. }
  18990. }
  18991. switchBtn(type) {
  18992. if (type == "")
  18993. type = this.curType;
  18994. else {
  18995. if (this.curType == type) {
  18996. return;
  18997. }
  18998. else {
  18999. this.curType = type;
  19000. }
  19001. }
  19002. if (type == "coin") {
  19003. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19004. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19005. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19006. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19007. this.ui.myNode.c1.selectedIndex = 0;
  19008. }
  19009. else {
  19010. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19011. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19012. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19013. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19014. this.ui.myNode.c1.selectedIndex = 1;
  19015. }
  19016. }
  19017. convertCoin(index) {
  19018. let data = cfgTable.moneyData[index];
  19019. let coinNum = data.num;
  19020. let str = data.get.split('_')[1];
  19021. let needDiamond = parseInt(str);
  19022. if (DataMgr.diamondEnough(needDiamond)) {
  19023. DataMgr.setDiamond(-needDiamond);
  19024. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19025. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19026. }
  19027. else {
  19028. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19029. this.switchBtn("diamond");
  19030. }
  19031. }
  19032. videoGetDiamond() {
  19033. let num = cfgTable.moneyData[2].num;
  19034. Moyu.showVideoAd(() => {
  19035. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19036. this.closeSelf();
  19037. }, EAdType.addDiamond);
  19038. }
  19039. videoGetCoin() {
  19040. Moyu.showVideoAd(() => {
  19041. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19042. this.closeSelf();
  19043. }, EAdType.addCoin);
  19044. }
  19045. shareGetDiamond() {
  19046. let times = DataMgr.getShareDiamondTimes();
  19047. if (times >= xGame.common.maxShareDiamondTimes) {
  19048. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19049. }
  19050. else {
  19051. if (Moyu.isTT) {
  19052. let num = cfgTable.moneyData[1].num;
  19053. Moyu.shareVideo = '';
  19054. Moyu.shareGame((success) => {
  19055. if (success) {
  19056. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19057. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19058. DataMgr.setShareDiamondTimes(1);
  19059. this.updateDiamondShare();
  19060. }
  19061. else {
  19062. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19063. }
  19064. });
  19065. }
  19066. else {
  19067. Moyu.showVideoAd(() => {
  19068. let diamond = xGame.common.randomNum(50, 100);
  19069. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19070. DataMgr.setShareDiamondTimes(1);
  19071. this.updateDiamondShare();
  19072. }, EAdType.randomDiamond);
  19073. }
  19074. }
  19075. }
  19076. openPutBallView() {
  19077. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19078. let skill = xGame.uiMgr.getUI(UISkill$1);
  19079. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19080. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19081. if (end && !end.isHide) {
  19082. xGame.uiMgr.Hide(UIGameEnd$1);
  19083. xGame.uiMgr.Show(UIMain$1);
  19084. }
  19085. if (skill && !skill.isHide)
  19086. xGame.uiMgr.Hide(UISkill$1);
  19087. if (uigame && !uigame.isHide)
  19088. xGame.uiMgr.Hide(UIGame$1);
  19089. if (level && !level.isHide) {
  19090. }
  19091. else {
  19092. xGame.uiMgr.Show(UILevelDisplay$1);
  19093. }
  19094. this.closeSelf();
  19095. }
  19096. }
  19097. UIAddProp$1.uiName = "UIAddProp";
  19098. class MoneyNode$1 {
  19099. constructor(ui) {
  19100. this.leftTime = 0;
  19101. this.ui = ui;
  19102. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19103. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19104. this.ui.addPowerBtn.onClick(this, this.addPower);
  19105. this.ui.c1.selectedIndex = 1;
  19106. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19107. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19108. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19109. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19110. this.coinChange();
  19111. this.diamondChange();
  19112. this.powerChange();
  19113. }
  19114. addPower() {
  19115. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19116. xGame.uiMgr.Show(UIPower$1);
  19117. }
  19118. powerChange() {
  19119. let powerNum = DataMgr.getPower();
  19120. this.ui.powerTxt.text = powerNum + "";
  19121. }
  19122. checkPowerTime() {
  19123. let cur = new Date().getTime();
  19124. let last = DataMgr.getPowerTime();
  19125. if (last == 0) {
  19126. last = cur;
  19127. DataMgr.setPowerTime(cur);
  19128. }
  19129. let power = DataMgr.getPower();
  19130. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19131. Laya.timer.clearAll(this);
  19132. if (power >= xGame.common.natureMaxPower) {
  19133. this.ui.powerTimeTxt.text = "";
  19134. DataMgr.setPowerTime(cur);
  19135. return;
  19136. }
  19137. if (power + offset >= xGame.common.natureMaxPower) {
  19138. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19139. this.ui.powerTimeTxt.text = "";
  19140. DataMgr.setPowerTime(cur);
  19141. }
  19142. else {
  19143. if (offset > 0) {
  19144. DataMgr.setPower(offset);
  19145. DataMgr.setPowerTime(cur);
  19146. }
  19147. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19148. this.leftTime = xGame.common.powerRecoverNum - time;
  19149. if (this.leftTime <= 0)
  19150. this.leftTime = 0;
  19151. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19152. Laya.timer.loop(1000, this, this.updatePowerTime);
  19153. }
  19154. }
  19155. updatePowerTime() {
  19156. this.leftTime -= 1;
  19157. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19158. if (this.leftTime <= 0) {
  19159. this.checkPowerTime();
  19160. }
  19161. }
  19162. coinChange() {
  19163. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19164. }
  19165. diamondChange() {
  19166. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19167. }
  19168. addCoin() {
  19169. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19170. Moyu.sendDataEvent("AddCoinBtn");
  19171. xGame.uiMgr.Show(UIAddProp$1, 0);
  19172. }
  19173. addDiamond() {
  19174. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19175. Moyu.sendDataEvent("AddDiamondBtn");
  19176. xGame.uiMgr.Show(UIAddProp$1, 1);
  19177. }
  19178. }
  19179. class SettingNode$1 {
  19180. constructor(ui) {
  19181. this.showSetting = false;
  19182. this.openSound = true;
  19183. this.openShake = true;
  19184. this.ui = ui;
  19185. this.ui.soundBtn.onClick(this, this.switchSound);
  19186. this.ui.shakeBtn.onClick(this, this.switchShake);
  19187. this.ui.xyBtn.onClick(this, this.onXy);
  19188. this.ui.clickNode.onClick(this, this.changeSetting);
  19189. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19190. }
  19191. changeSetting() {
  19192. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19193. this.showSetting = !this.showSetting;
  19194. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19195. }
  19196. switchSound() {
  19197. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19198. this.openSound = !this.openSound;
  19199. Moyu.onSetting(this.openSound, this.openShake);
  19200. xGame.soundMgr.onSetting(this.openSound);
  19201. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19202. }
  19203. switchShake() {
  19204. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19205. this.openShake = !this.openShake;
  19206. Moyu.onSetting(this.openSound, this.openShake);
  19207. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19208. }
  19209. onXy() {
  19210. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19211. MoyuMgr$1.showXy(1);
  19212. }
  19213. }
  19214. class UIDraw$1 extends UIBase {
  19215. constructor() {
  19216. super();
  19217. this.curKey = 0;
  19218. }
  19219. onConstructor() {
  19220. this.ui = ui_UIDraw.createInstance();
  19221. this.contentPane = this.ui;
  19222. this.isEject = false;
  19223. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19224. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19225. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19226. this.initDraw();
  19227. this.initUI();
  19228. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19229. if (Moyu.isKs)
  19230. this.ui.closeNode.closeBtn.x += 100;
  19231. }
  19232. show() {
  19233. super.show();
  19234. this.ui.t0.play();
  19235. this.playSecretaryIdle();
  19236. this.updateDraw();
  19237. this.checkFree();
  19238. if (PlatMgr.bannerDelay > 0) {
  19239. this.ui.closeNode.closeBtn.visible = false;
  19240. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19241. this.ui.closeNode.closeBtn.visible = true;
  19242. });
  19243. }
  19244. PlatMgr.showRateBanner();
  19245. }
  19246. hide() {
  19247. Laya.timer.clearAll(this);
  19248. super.hide();
  19249. }
  19250. checkFree() {
  19251. let isFree = DataMgr.getDailyfreeDrawTimes();
  19252. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19253. }
  19254. initDraw() {
  19255. this.drawObj = [];
  19256. let data = cfgTable.drawData;
  19257. let temp;
  19258. let weight = 0;
  19259. for (const key in data) {
  19260. temp = data[key];
  19261. weight += temp.weight;
  19262. this.drawObj.push(weight);
  19263. }
  19264. this.allWeight = weight;
  19265. }
  19266. initUI() {
  19267. let data = cfgTable.drawData;
  19268. let temp;
  19269. let img;
  19270. let txt;
  19271. for (const key in data) {
  19272. temp = data[key];
  19273. img = this.ui.myNode.rotNode["img" + key];
  19274. txt = this.ui.myNode.rotNode["txt" + key];
  19275. img.url = xGame.common.getGameIconUrl(temp.icon);
  19276. txt.visible = true;
  19277. if (temp.award > 2) {
  19278. img.rotation = 0;
  19279. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19280. }
  19281. else {
  19282. img.rotation = temp.rotation;
  19283. txt.text = temp.num;
  19284. }
  19285. }
  19286. }
  19287. getCurkey() {
  19288. let rand = Math.random() * this.allWeight;
  19289. let temp;
  19290. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19291. temp = this.drawObj[index];
  19292. if (index == 0) {
  19293. if (rand < temp) {
  19294. return index + 1;
  19295. }
  19296. }
  19297. else {
  19298. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19299. return index + 1;
  19300. }
  19301. }
  19302. }
  19303. return 2;
  19304. }
  19305. startDraw() {
  19306. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19307. if (freeTimes > 0) {
  19308. this.beginDraw();
  19309. DataMgr.setDailyfreeDrawTimes(0);
  19310. this.checkFree();
  19311. }
  19312. else {
  19313. Moyu.sendDataEvent("turntable");
  19314. Moyu.showVideoAd(() => {
  19315. this.beginDraw();
  19316. }, EAdType.draw);
  19317. }
  19318. }
  19319. beginDraw() {
  19320. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19321. this.ui.drawBtn.touchable = false;
  19322. this.curKey = this.getCurkey();
  19323. console.log("当前key", this.curKey);
  19324. let cell = 60;
  19325. let lap = 3;
  19326. let angle = cell * (this.curKey - 1) + lap * 360;
  19327. let target = this.ui.myNode.rotNode;
  19328. target.rotation = 0;
  19329. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19330. console.log("旋转完成");
  19331. this.ui.drawBtn.touchable = true;
  19332. this.getAward();
  19333. }));
  19334. }
  19335. getAward() {
  19336. let data = cfgTable.drawData[this.curKey];
  19337. let temp = new AwardType();
  19338. temp.type = data.award;
  19339. temp.num = data.num;
  19340. xGame.common.getAward([temp], () => {
  19341. DataMgr.setDrawTimes(1);
  19342. this.updateDraw();
  19343. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19344. });
  19345. }
  19346. updateDraw() {
  19347. let drawTimes = DataMgr.getDrawTimes();
  19348. let awardTimes = DataMgr.getDrawAwardTimes();
  19349. if (Math.floor(drawTimes / 3) > awardTimes) {
  19350. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19351. this.ui.extraNode.boxBtn.touchable = true;
  19352. this.ui.extraNode.tipsTxt.text = "3/3";
  19353. this.ui.extraNode.barNode.width = 265;
  19354. this.getExtraAward();
  19355. }
  19356. else {
  19357. this.ui.extraNode.boxBtn.t0.stop();
  19358. this.ui.extraNode.boxBtn.touchable = false;
  19359. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19360. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19361. }
  19362. let data = cfgTable.drawData[1];
  19363. if (awardTimes == 0) {
  19364. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19365. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19366. this.ui.myNode.rotNode.img1.rotation = 0;
  19367. }
  19368. else {
  19369. let award = data.nextid;
  19370. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19371. this.ui.myNode.rotNode.txt1.text = award[1];
  19372. this.ui.myNode.rotNode.img1.rotation = 0;
  19373. }
  19374. }
  19375. getExtraAward() {
  19376. let drawTimes = DataMgr.getDrawTimes();
  19377. let awardTimes = DataMgr.getDrawAwardTimes();
  19378. let data = cfgTable.drawData[1];
  19379. let award = new AwardType();
  19380. if (awardTimes == 0) {
  19381. award.num = data.num;
  19382. award.type = data.award;
  19383. xGame.common.getAward([award], () => {
  19384. let all = Math.floor(drawTimes / 3);
  19385. DataMgr.setDrawAwardTimes(all);
  19386. this.updateDraw();
  19387. });
  19388. }
  19389. else {
  19390. award.num = parseInt(data.nextid[1]);
  19391. award.type = parseInt(data.nextid[0]);
  19392. xGame.common.getAward([award], () => {
  19393. let all = Math.floor(drawTimes / 3);
  19394. DataMgr.setDrawAwardTimes(all);
  19395. this.updateDraw();
  19396. });
  19397. }
  19398. }
  19399. closeSelf() {
  19400. this.hide();
  19401. }
  19402. playSecretaryIdle() {
  19403. let parent = this.ui.secretary.displayObject;
  19404. parent.destroyChildren();
  19405. let xx = this.ui.secretary.width / 2;
  19406. let yy = this.ui.secretary.height;
  19407. let scale = xGame.common.getSecretaryScale();
  19408. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19409. xGame.common.secretary.play(data, 1, true, parent);
  19410. }
  19411. }
  19412. UIDraw$1.uiName = "UIDraw";
  19413. class UIRanking$1 extends UIBase {
  19414. constructor() {
  19415. super();
  19416. this.showSelf = true;
  19417. this.rankType = 1;
  19418. this.rankList = [];
  19419. this.myIndex = 0;
  19420. this.myStar = 0;
  19421. }
  19422. onConstructor() {
  19423. this.ui = ui_UIRanking.createInstance();
  19424. this.contentPane = this.ui;
  19425. this.isEject = false;
  19426. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19427. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19428. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19429. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19430. this.ui.myNode.myList.setVirtual();
  19431. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19432. }
  19433. show() {
  19434. super.show();
  19435. this.myIndex = 51;
  19436. Moyu.getRankList({
  19437. rankId: xGame.common.curRankID,
  19438. type: MoyuRankType.total,
  19439. page: 1,
  19440. pageSize: 50,
  19441. }, this, this.updateItemData);
  19442. this.updateSelf();
  19443. let self = Moyu.getUserInfo();
  19444. if (!self.isAuth) {
  19445. Moyu.initUser(this, () => {
  19446. DataMgr.upRankData();
  19447. });
  19448. }
  19449. }
  19450. updateSelfItem() {
  19451. let self = Moyu.getUserInfo();
  19452. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19453. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19454. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19455. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "我自己";
  19456. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19457. }
  19458. updateItemData(data) {
  19459. this.myStar = xGame.common.getAllStarNum();
  19460. if (this.rankList.length < 2) {
  19461. this.rankList = data;
  19462. let self = Moyu.getUserInfo();
  19463. for (let i = 0; i < data.length; i++) {
  19464. let data = this.rankList[i];
  19465. if (data.userId == self.userId) {
  19466. this.rankList.splice(i, 1);
  19467. break;
  19468. }
  19469. }
  19470. for (let i = 0; i < data.length; i++) {
  19471. let data = this.rankList[i];
  19472. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19473. this.myIndex = i + 1;
  19474. let user = { headIcon: self.headIcon, nickName: "我自己" };
  19475. let ud = { user: user, data: {} };
  19476. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19477. if (Moyu.platType < 11) {
  19478. user.headIcon = self.headIcon;
  19479. user.nickName = self.nickName;
  19480. }
  19481. this.rankList.splice(i, 0, md);
  19482. break;
  19483. }
  19484. }
  19485. }
  19486. this.updateSelfItem();
  19487. this.ui.myNode.myList.numItems = this.rankList.length;
  19488. }
  19489. updateItemUI(index, obj) {
  19490. let data = this.rankList[index];
  19491. let userData = JSON.parse(data.userData).user;
  19492. obj.nameTxt.text = userData.nickName.toString();
  19493. obj.valueTxt.text = data.rankScore;
  19494. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19495. obj.rankTxt.text = index + 1;
  19496. switch (index) {
  19497. case 0:
  19498. this.setImg(obj, 1, 0, 0);
  19499. obj.rankTxt.color = "#FFC047";
  19500. break;
  19501. case 1:
  19502. this.setImg(obj, 0, 1, 0);
  19503. obj.rankTxt.color = "#ACACAC";
  19504. break;
  19505. case 2:
  19506. this.setImg(obj, 0, 0, 1);
  19507. obj.rankTxt.color = "#D09672";
  19508. break;
  19509. default:
  19510. this.setImg(obj, 0, 0, 0);
  19511. obj.rankTxt.color = "#496FAB";
  19512. break;
  19513. }
  19514. }
  19515. setImg(obj, a, b, c) {
  19516. obj.img1.visible = a ? true : false;
  19517. obj.img2.visible = b ? true : false;
  19518. obj.img3.visible = c ? true : false;
  19519. }
  19520. changeList(type) {
  19521. this.rankType = type;
  19522. this.updateSelf();
  19523. }
  19524. changeSelfNode() {
  19525. this.showSelf = !this.showSelf;
  19526. this.updateSelf();
  19527. }
  19528. updateSelf() {
  19529. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19530. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19531. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19532. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19533. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19534. }
  19535. }
  19536. UIRanking$1.uiName = "UIRanking";
  19537. class UISecretary$1 extends UIBase {
  19538. constructor() {
  19539. super();
  19540. this.curIndex = 1;
  19541. }
  19542. onConstructor() {
  19543. this.ui = ui_UISecretary.createInstance();
  19544. this.contentPane = this.ui;
  19545. this.isEject = false;
  19546. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19547. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  19548. this.addUIClick(this.ui.rightBtn, this.turnRight);
  19549. this.nodeObj = { left: null, right: null, cur: null };
  19550. this.nodeObj.left = this.ui.myNode.gameNode1;
  19551. this.nodeObj.right = this.ui.myNode.gameNode2;
  19552. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19553. }
  19554. show() {
  19555. super.show();
  19556. this.ui.t0.play();
  19557. this.updateData();
  19558. }
  19559. addSecretarySpine(node, spineName) {
  19560. if (spineName == "mishu") {
  19561. if (this.secretarySpine1) {
  19562. node.displayObject.destroyChildren();
  19563. this.playWoman(this.secretarySpine1, node.displayObject);
  19564. }
  19565. else {
  19566. let spine1 = new SpineMgr("mishu", () => {
  19567. this.secretarySpine1 = spine1;
  19568. this.playWoman(this.secretarySpine1, node.displayObject);
  19569. });
  19570. }
  19571. }
  19572. else {
  19573. if (this.secretarySpine2) {
  19574. node.displayObject.destroyChildren();
  19575. this.playWoman(this.secretarySpine2, node.displayObject);
  19576. }
  19577. else {
  19578. let spine2 = new SpineMgr("xiaomishu2", () => {
  19579. this.secretarySpine2 = spine2;
  19580. this.playWoman(this.secretarySpine2, node.displayObject);
  19581. });
  19582. }
  19583. }
  19584. }
  19585. playWoman(node, parent) {
  19586. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  19587. let yy = this.ui.myNode.gameNode1.secretary.height;
  19588. let scale = 1.5;
  19589. if (node == this.secretarySpine2) {
  19590. scale = 1.2;
  19591. }
  19592. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19593. node.play(data, 1, true, parent);
  19594. }
  19595. turnLeft() {
  19596. this.curIndex--;
  19597. if (this.curIndex < 1) {
  19598. this.curIndex = 2;
  19599. }
  19600. let left = this.nodeObj.left;
  19601. let right = this.nodeObj.right;
  19602. let cur = this.nodeObj.cur;
  19603. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19604. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19605. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19606. this.updateData();
  19607. }));
  19608. this.ui.myNode.setChildIndex(right, 2);
  19609. this.nodeObj.left = cur;
  19610. this.nodeObj.right = left;
  19611. this.nodeObj.cur = right;
  19612. }
  19613. turnRight() {
  19614. this.curIndex++;
  19615. if (this.curIndex > 2) {
  19616. this.curIndex = 1;
  19617. }
  19618. let left = this.nodeObj.left;
  19619. let right = this.nodeObj.right;
  19620. let cur = this.nodeObj.cur;
  19621. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19622. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19623. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19624. this.updateData();
  19625. }));
  19626. this.ui.myNode.setChildIndex(left, 2);
  19627. this.nodeObj.left = right;
  19628. this.nodeObj.right = cur;
  19629. this.nodeObj.cur = left;
  19630. }
  19631. updateData() {
  19632. let data = cfgTable.secretaryshopData;
  19633. let children = this.ui.myNode._children;
  19634. let temp;
  19635. let curData;
  19636. for (let index = 0; index < children.length; index++) {
  19637. temp = children[index];
  19638. if (index == 2) {
  19639. curData = data[this.curIndex];
  19640. temp.purchaseBtn.touchable = true;
  19641. }
  19642. else {
  19643. temp.purchaseBtn.touchable = false;
  19644. if (this.curIndex == 1) {
  19645. curData = data[2];
  19646. }
  19647. else {
  19648. curData = data[1];
  19649. }
  19650. }
  19651. temp.heightTxt.text = curData.height;
  19652. temp.foodTxt.text = curData.food;
  19653. temp.historyTxt.text = curData.history;
  19654. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19655. this.addSecretarySpine(temp.secretary, curData.spine);
  19656. let womanIndex = curData.id - 1;
  19657. let getWoman = DataMgr.getSecretary(womanIndex);
  19658. let curUse = DataMgr.getCurSecretary();
  19659. if (getWoman) {
  19660. if (curUse == womanIndex) {
  19661. temp.purchaseBtn.c1.selectedIndex = 1;
  19662. }
  19663. else {
  19664. temp.purchaseBtn.c1.selectedIndex = 2;
  19665. }
  19666. }
  19667. else {
  19668. temp.purchaseBtn.c1.selectedIndex = 0;
  19669. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19670. }
  19671. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19672. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19673. }
  19674. }
  19675. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19676. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19677. if (getWoman) {
  19678. if (curUse != womanIndex) {
  19679. console.log();
  19680. DataMgr.setCurSecretary(womanIndex);
  19681. this.updateData();
  19682. }
  19683. }
  19684. else {
  19685. let need = needDiamond;
  19686. if (DataMgr.diamondEnough(need)) {
  19687. DataMgr.setDiamond(-need);
  19688. DataMgr.setSecretary(womanIndex, 1);
  19689. DataMgr.setCurSecretary(womanIndex);
  19690. this.updateData();
  19691. }
  19692. else {
  19693. xGame.uiMgr.Show(UIAddProp$1, 1);
  19694. }
  19695. }
  19696. }
  19697. closeSelf() {
  19698. this.hide();
  19699. }
  19700. }
  19701. UISecretary$1.uiName = "UISecretary";
  19702. class BallRodDisplay$1 {
  19703. constructor(ui, index) {
  19704. this.index = 0;
  19705. this.uiIndex = 0;
  19706. this.ui = ui;
  19707. this.index = index;
  19708. this.initData();
  19709. }
  19710. initData() {
  19711. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19712. let data = cfgTable.ballrodData[this.index + 1];
  19713. this.ui.nameTxt.text = data.name;
  19714. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19715. this.ui.levelNode.c1.selectedIndex = data.quality;
  19716. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19717. if (data.spine) {
  19718. this.mySpine = new SpineMgr(data.spine, () => {
  19719. let xx = 150;
  19720. let yy = 70;
  19721. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19722. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19723. });
  19724. }
  19725. }
  19726. updateSelf() {
  19727. let get = DataMgr.getBallRod(this.index);
  19728. if (get == null)
  19729. get = 1;
  19730. let curUse = DataMgr.getCurBallRod();
  19731. if (get) {
  19732. if (curUse == this.index) {
  19733. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19734. }
  19735. else {
  19736. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19737. }
  19738. }
  19739. else {
  19740. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19741. }
  19742. }
  19743. buyBallRod() {
  19744. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19745. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19746. switch (selectedIndex) {
  19747. case 0:
  19748. break;
  19749. case 1:
  19750. DataMgr.setCurBallRod(this.index);
  19751. let ui = xGame.uiMgr.getUI(UIShop$1);
  19752. ui.updateBallRod();
  19753. break;
  19754. case 2:
  19755. let data = cfgTable.ballrodData[this.index + 1];
  19756. let need = data.price;
  19757. if (DataMgr.diamondEnough(need)) {
  19758. DataMgr.setDiamond(-need);
  19759. DataMgr.setBallRod(this.index, 1);
  19760. DataMgr.setCurBallRod(this.index);
  19761. let ui = xGame.uiMgr.getUI(UIShop$1);
  19762. ui.updateBallRod();
  19763. }
  19764. else {
  19765. xGame.uiMgr.Show(UIAddProp$1, 1);
  19766. }
  19767. break;
  19768. default:
  19769. break;
  19770. }
  19771. }
  19772. }
  19773. class UIShop$1 extends UIBase {
  19774. constructor() {
  19775. super();
  19776. this.itemNums = 0;
  19777. }
  19778. onConstructor() {
  19779. this.ui = ui_UIShop.createInstance();
  19780. this.contentPane = this.ui;
  19781. this.isEject = false;
  19782. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19783. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19784. this.addUIClick(this.ui, this.interuptSecretary);
  19785. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19786. this.ballRodArr = [];
  19787. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19788. this.ui.myNode.myList.numItems = this.itemNums;
  19789. if (Moyu.isKs)
  19790. this.ui.closeNode.closeBtn.x += 100;
  19791. }
  19792. show() {
  19793. super.show();
  19794. this.playSecretaryIdle();
  19795. this.updateBallRod();
  19796. }
  19797. updateBallRod() {
  19798. for (let index = 0; index < this.ballRodArr.length; index++) {
  19799. this.ballRodArr[index].updateSelf();
  19800. }
  19801. }
  19802. renderBallRod(sort, obj) {
  19803. let index = this.getIndexBySort(sort + 1) - 1;
  19804. let ballRod = new BallRodDisplay$1(obj, index);
  19805. this.ballRodArr.push(ballRod);
  19806. }
  19807. getIndexBySort(sort) {
  19808. let object = cfgTable.ballrodData;
  19809. for (const key in object) {
  19810. if (object[key].sort == sort) {
  19811. return parseInt(key);
  19812. }
  19813. }
  19814. }
  19815. playSecretaryIdle() {
  19816. let parent = this.ui.secretary.displayObject;
  19817. parent.destroyChildren();
  19818. let xx = this.ui.secretary.width / 2;
  19819. let yy = this.ui.secretary.height;
  19820. let scale = xGame.common.getSecretaryScale();
  19821. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19822. xGame.common.secretary.play(data, 1, true, parent);
  19823. }
  19824. interuptSecretary() {
  19825. Laya.timer.clearAll(this);
  19826. this.playSecretaryRandomSound();
  19827. }
  19828. playSecretaryRandomSound() {
  19829. if (this.isHide)
  19830. return;
  19831. let time = xGame.common.randomNum(45000, 60000);
  19832. Laya.timer.once(time, this, () => {
  19833. if (this.isHide)
  19834. return;
  19835. let index = xGame.common.randomNum(4, 7);
  19836. xGame.soundMgr.playSound("s_main0" + index);
  19837. let words = 1;
  19838. switch (index) {
  19839. case 4:
  19840. words = 5;
  19841. break;
  19842. case 5:
  19843. words = 3;
  19844. break;
  19845. case 6:
  19846. words = 6;
  19847. break;
  19848. case 7:
  19849. words = 7;
  19850. break;
  19851. default:
  19852. break;
  19853. }
  19854. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19855. this.playSecretaryRandomSound();
  19856. });
  19857. }
  19858. closeSelf() {
  19859. this.hide();
  19860. }
  19861. }
  19862. UIShop$1.uiName = "UIShop";
  19863. class SignMax$1 {
  19864. constructor(ui) {
  19865. this.ui = ui;
  19866. }
  19867. updateSelf(index, sameDay, curDayIndex) {
  19868. let data = cfgTable.signData[index + 1];
  19869. this.ui.titleTxt.text = data.title;
  19870. let arr1 = data.award[0].split('-');
  19871. let arr2 = data.award[1].split('-');
  19872. let num1 = parseInt(arr1[1]);
  19873. let num2 = parseInt(arr2[1]);
  19874. this.ui.numTxt1.text = num1 + "";
  19875. this.ui.numTxt2.text = num2 + "";
  19876. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19877. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19878. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19879. this.ui.numTxt1.visible = false;
  19880. }
  19881. else {
  19882. this.ui.numTxt1.visible = true;
  19883. }
  19884. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19885. this.ui.numTxt2.visible = false;
  19886. }
  19887. else {
  19888. this.ui.numTxt2.visible = true;
  19889. }
  19890. if (index < curDayIndex) {
  19891. this.ui.c1.selectedIndex = 1;
  19892. }
  19893. else if (index == curDayIndex) {
  19894. if (sameDay) {
  19895. this.ui.c1.selectedIndex = 2;
  19896. }
  19897. else {
  19898. this.ui.c1.selectedIndex = 2;
  19899. }
  19900. }
  19901. else {
  19902. this.ui.c1.selectedIndex = 0;
  19903. }
  19904. }
  19905. }
  19906. class SignNormal$1 {
  19907. constructor(ui) {
  19908. this.ui = ui;
  19909. }
  19910. updateSelf(index, sameDay, curDayIndex) {
  19911. let data = cfgTable.signData[index + 1];
  19912. this.ui.titleTxt.text = data.title;
  19913. let arr = data.award[0].split('-');
  19914. let type = parseInt(arr[0]);
  19915. let num = parseInt(arr[1]);
  19916. this.ui.numTxt.text = num + "";
  19917. if (type > 2) {
  19918. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19919. this.ui.myIcon.rotation = 0;
  19920. }
  19921. else {
  19922. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19923. this.ui.myIcon.rotation = 0;
  19924. }
  19925. if (xGame.common.signAwardContainsRod(data.award)) {
  19926. this.ui.numTxt.visible = false;
  19927. }
  19928. else {
  19929. this.ui.numTxt.visible = true;
  19930. }
  19931. if (index < curDayIndex) {
  19932. this.ui.c1.selectedIndex = 1;
  19933. }
  19934. else if (index == curDayIndex) {
  19935. if (sameDay) {
  19936. this.ui.c1.selectedIndex = 2;
  19937. }
  19938. else {
  19939. this.ui.c1.selectedIndex = 2;
  19940. }
  19941. }
  19942. else {
  19943. this.ui.c1.selectedIndex = 0;
  19944. }
  19945. }
  19946. }
  19947. class UISign$1 extends UIBase {
  19948. constructor() {
  19949. super();
  19950. this.curDayIndex = 0;
  19951. this.starX = 0;
  19952. }
  19953. onConstructor() {
  19954. this.ui = ui_UISign.createInstance();
  19955. this.contentPane = this.ui;
  19956. this.isEject = false;
  19957. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19958. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19959. this.initSignItem();
  19960. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19961. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19962. }
  19963. show() {
  19964. super.show();
  19965. this.ui.t0.play();
  19966. this.playSecretaryIdle();
  19967. this.updateSign();
  19968. }
  19969. initSignItem() {
  19970. this.signArr = [];
  19971. for (let index = 0; index < 6; index++) {
  19972. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19973. this.signArr.push(temp);
  19974. }
  19975. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19976. if (Moyu.isKs)
  19977. this.ui.closeNode.closeBtn.x += 100;
  19978. }
  19979. updateSign() {
  19980. let sameDay = xGame.common.judgeSameDay();
  19981. let max = 7;
  19982. this.curDayIndex = DataMgr.getSignData();
  19983. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19984. this.curDayIndex = 0;
  19985. if (!sameDay) {
  19986. this.ui.normalBtn.visible = true;
  19987. this.ui.tipsNode.visible = false;
  19988. this.ui.againBtn.visible = false;
  19989. }
  19990. else {
  19991. this.ui.normalBtn.visible = false;
  19992. let again = DataMgr.getExtraSign();
  19993. let isCurrency = false;
  19994. let index = this.curDayIndex;
  19995. if (index == 0)
  19996. index = 7;
  19997. let award = cfgTable.signData[index].award;
  19998. let num = award[0].split("-")[0];
  19999. if (num == "1" || num == "2")
  20000. isCurrency = true;
  20001. let showAgain = again == 0 && isCurrency;
  20002. this.ui.againBtn.visible = showAgain;
  20003. this.ui.tipsNode.visible = !showAgain;
  20004. }
  20005. for (let index = 0; index < this.signArr.length; index++) {
  20006. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20007. }
  20008. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20009. }
  20010. playSecretaryIdle() {
  20011. let parent = this.ui.secretary.displayObject;
  20012. parent.destroyChildren();
  20013. let xx = this.ui.secretary.width / 2;
  20014. let yy = this.ui.secretary.height;
  20015. let scale = xGame.common.getSecretaryScale();
  20016. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20017. xGame.common.secretary.play(data, 1, true, parent);
  20018. }
  20019. closeSelf() {
  20020. this.hide();
  20021. }
  20022. normalGetAward() {
  20023. let sameDay = xGame.common.judgeSameDay();
  20024. if (!sameDay) {
  20025. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20026. let temp;
  20027. let type;
  20028. let num;
  20029. let arr = [];
  20030. for (let index = 0; index < award.length; index++) {
  20031. temp = award[index].split("-");
  20032. type = parseInt(temp[0]);
  20033. num = parseInt(temp[1]);
  20034. let awardType = new AwardType();
  20035. awardType.num = num;
  20036. awardType.type = type;
  20037. arr.push(awardType);
  20038. }
  20039. xGame.common.getAward(arr, (watchVideo) => {
  20040. this.curDayIndex++;
  20041. if (this.curDayIndex > 7)
  20042. this.curDayIndex = 0;
  20043. DataMgr.setSignData(this.curDayIndex);
  20044. DataMgr.setSignTime(new Date().getTime());
  20045. if (watchVideo) {
  20046. DataMgr.setExtraSign(1);
  20047. Moyu.sendDataEvent("signIn1");
  20048. }
  20049. this.updateSign();
  20050. });
  20051. }
  20052. }
  20053. againGetAward() {
  20054. Moyu.sendDataEvent("signIn2");
  20055. Moyu.showVideoAd(() => {
  20056. let index = this.curDayIndex;
  20057. if (index == 0)
  20058. index = 7;
  20059. let award = cfgTable.signData[index].award;
  20060. let temp;
  20061. let type;
  20062. let num;
  20063. for (let index = 0; index < award.length; index++) {
  20064. temp = award[index].split("-");
  20065. type = parseInt(temp[0]);
  20066. num = parseInt(temp[1]) * 3;
  20067. xGame.common.playObjFlyAnim(num, type);
  20068. }
  20069. DataMgr.setExtraSign(1);
  20070. this.updateSign();
  20071. }, EAdType.againSign);
  20072. }
  20073. }
  20074. UISign$1.uiName = "UISign";
  20075. class UIModeSelection$1 extends UIBase {
  20076. constructor() {
  20077. super();
  20078. }
  20079. onConstructor() {
  20080. this.ui = ui_UIModeSelection.createInstance();
  20081. this.contentPane = this.ui;
  20082. this.isEject = false;
  20083. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20084. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20085. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20086. this.addUIClick(this.ui.closeBtn, this.hide);
  20087. this.peopleArr = [650, 6900, 3800];
  20088. this.peopleOffest = [50, 500, 200];
  20089. this.updateSelf();
  20090. }
  20091. show(callback) {
  20092. super.show();
  20093. this.ui.t0.play();
  20094. this.callback = callback;
  20095. }
  20096. updateSelf() {
  20097. let cfg = cfgTable.modeselectData;
  20098. for (let index = 1; index <= 3; index++) {
  20099. let node = this.ui.myNode["type" + index];
  20100. node.need.text = cfg[index].need;
  20101. node.tipsTxt.text = `最低${cfg[index].need}可入场`;
  20102. node.peopleTxt.text = this.getRandPeople(index - 1);
  20103. }
  20104. }
  20105. enterGame(type) {
  20106. xGame.common.classicRoomType = type;
  20107. let cfg = cfgTable.modeselectData[type];
  20108. let need = cfg.need;
  20109. xGame.common.passAwardCoin = cfg.award;
  20110. if (DataMgr.coinEnough(need)) {
  20111. DataMgr.setCoin(-need);
  20112. this.ui.myNode["type" + type].t0.play();
  20113. Laya.timer.once(200, this, () => {
  20114. this.callback && this.callback();
  20115. });
  20116. }
  20117. else {
  20118. Moyu.sendDataEvent("AddCoinVideo");
  20119. xGame.uiMgr.Show(UIAddProp$1, 0);
  20120. }
  20121. }
  20122. getRandPeople(index) {
  20123. let rand = this.peopleOffest[index];
  20124. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20125. }
  20126. }
  20127. UIModeSelection$1.uiName = "UIModeSelection";
  20128. class UIMain$1 extends UIBase {
  20129. constructor() {
  20130. super();
  20131. this.firstEnter = true;
  20132. }
  20133. onConstructor() {
  20134. this.ui = ui_UIMain.createInstance();
  20135. this.contentPane = this.ui;
  20136. this.isEject = false;
  20137. this.addEvent();
  20138. this.addClickSpine();
  20139. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20140. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20141. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20142. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20143. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20144. let curUse = DataMgr.getCurSecretary();
  20145. this.changeSecretary(curUse);
  20146. this.ui.talkNode.visible = false;
  20147. let guide = DataMgr.getSkillGuide();
  20148. if (xGame.common.isNewDay && guide == 1) {
  20149. xGame.common.isNewDay = false;
  20150. xGame.soundMgr.playSound("s_main01");
  20151. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20152. console.log("播放小秘书每天语音");
  20153. }
  20154. this.onGetUserInfo();
  20155. this.ui.n83.visible = false;
  20156. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20157. }
  20158. changeSecretary(curUse) {
  20159. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20160. xGame.common.secretary && xGame.common.secretary.dispose();
  20161. this.addSecretarySpine(name);
  20162. }
  20163. addSecretarySpine(name) {
  20164. let spine = new SpineMgr(name, () => {
  20165. this.playSecretaryIdle();
  20166. });
  20167. xGame.common.secretary = spine;
  20168. }
  20169. addClickSpine() {
  20170. let clickSpine = new SpineMgr("dianji", () => {
  20171. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20172. let parent = Laya.stage;
  20173. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20174. clickSpine.play(data, 0, false, parent, (spine) => {
  20175. spine.destroy(true);
  20176. });
  20177. });
  20178. });
  20179. }
  20180. addEvent() {
  20181. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20182. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20183. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20184. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20185. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20186. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20187. this.addUIClick(this.ui, this.interuptSecretary);
  20188. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20189. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20190. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20191. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20192. this.addUIClick(this.ui.signBtn, this.openSignView);
  20193. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20194. this.addUIClick(this.ui.rankBtn, this.openRanking);
  20195. }
  20196. show(showFailWords) {
  20197. super.show();
  20198. this.moneyNode.ui.c1.selectedIndex = 1;
  20199. this.playSecretaryIdle();
  20200. xGame.soundMgr.playMusic("caromhall01");
  20201. Laya.timer.clearAll(this);
  20202. this.playSecretaryRandomSound();
  20203. if (showFailWords) {
  20204. setTimeout(() => {
  20205. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20206. let words = -1;
  20207. if (str == "s_main02") {
  20208. words = 2;
  20209. }
  20210. else {
  20211. words = 3;
  20212. }
  20213. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20214. xGame.soundMgr.playSound(str);
  20215. }, 300);
  20216. }
  20217. this.showGuide();
  20218. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20219. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20220. let guide = DataMgr.getSkillGuide();
  20221. if (guide == 1) {
  20222. let randTime = xGame.common.randomNum(300, 800);
  20223. if (this.firstEnter) {
  20224. this.firstEnter = false;
  20225. randTime += 900;
  20226. }
  20227. Laya.timer.once(randTime, this, () => {
  20228. xGame.common.autoPopUIView();
  20229. });
  20230. }
  20231. }
  20232. checkActive(show) {
  20233. }
  20234. showGuide() {
  20235. let guide = DataMgr.getSkillGuide();
  20236. this.ui.guideBtn.visible = guide == 0;
  20237. this.ui.enterGuide.visible = false;
  20238. this.ui.secretaryGuide.visible = guide == 0;
  20239. if (guide == 0) {
  20240. xGame.soundMgr.playSound("s_guide");
  20241. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20242. }
  20243. }
  20244. ensureSecretary() {
  20245. this.ui.secretaryGuide.visible = false;
  20246. this.ui.enterGuide.visible = true;
  20247. this.ui.wordsNode.t0.play();
  20248. if (DataMgr.getNewUser())
  20249. Moyu.sendDataEvent("gameReady");
  20250. }
  20251. playSecretaryIdle() {
  20252. let parent = this.ui.secretary.displayObject;
  20253. parent.destroyChildren();
  20254. let xx = this.ui.secretary.width / 2;
  20255. let yy = this.ui.secretary.height;
  20256. let scale = xGame.common.getSecretaryScale();
  20257. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20258. xGame.common.secretary.play(data, 1, true, parent);
  20259. }
  20260. startGame(type) {
  20261. xGame.common.gameMode = type;
  20262. Moyu.sendDataEvent("PlayGame", { type: type });
  20263. switch (xGame.common.gameMode) {
  20264. case GameMode.classic:
  20265. let challengeTimes = DataMgr.getChallengeTimes();
  20266. if (challengeTimes == 0) {
  20267. xGame.uiMgr.Show(UIInvitation$1);
  20268. }
  20269. else {
  20270. this.beginGame();
  20271. }
  20272. break;
  20273. case GameMode.bigMove:
  20274. this.beginGame();
  20275. if (DataMgr.getNewUser())
  20276. Moyu.sendDataEvent("gameStart0");
  20277. break;
  20278. default:
  20279. break;
  20280. }
  20281. }
  20282. beginGame(isNice = false) {
  20283. if (xGame.common.gameMode == GameMode.classic) {
  20284. if (isNice) {
  20285. this.enterClassic();
  20286. }
  20287. else {
  20288. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20289. this.enterClassic();
  20290. });
  20291. }
  20292. }
  20293. else if (xGame.common.gameMode == GameMode.bigMove) {
  20294. this.ui.enterGuide.visible = false;
  20295. xGame.uiMgr.Show(UISkill$1);
  20296. }
  20297. }
  20298. enterClassic() {
  20299. xGame.uiMgr.Show(UIGame$1);
  20300. xGame.uiMgr.Show(UIMatching$1, () => {
  20301. if (!this.isHide)
  20302. this.hide();
  20303. xGame.common.gameUI.ui.alpha = 1;
  20304. xGame.common.gameUI.startGame();
  20305. xGame.uiMgr.Hide(UIGameEnd$1);
  20306. });
  20307. }
  20308. startGlobal() {
  20309. xGame.uiMgr.Show(UIMsg$1, "敬请期待~");
  20310. }
  20311. startWeekly() {
  20312. xGame.uiMgr.Show(UIMsg$1, "敬请期待~");
  20313. }
  20314. startPlaceBall() {
  20315. xGame.uiMgr.Show(UILevelDisplay$1);
  20316. }
  20317. hide() {
  20318. super.hide();
  20319. xGame.common.stopGirlPop(this.ui.talkNode);
  20320. }
  20321. onGetUserInfo(force = false) {
  20322. if (Moyu.isWx) {
  20323. let info = Moyu.getSystemInfo();
  20324. if (info)
  20325. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20326. }
  20327. else {
  20328. Moyu.initUser(this, this.freshUser, force);
  20329. }
  20330. if (!Moyu.hasUserInfo) {
  20331. let user = Moyu.getUserInfo();
  20332. user.headIcon = 'res/ty_touxiang.png';
  20333. }
  20334. this.freshUser();
  20335. }
  20336. freshUser() {
  20337. let user = Moyu.getUserInfo();
  20338. if (!user.isAuth) {
  20339. user.headIcon = 'res/ty_touxiang.png';
  20340. }
  20341. else
  20342. DataMgr.upRankData();
  20343. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20344. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20345. }
  20346. interuptSecretary() {
  20347. Laya.timer.clearAll(this);
  20348. this.playSecretaryRandomSound();
  20349. }
  20350. playSecretaryRandomSound() {
  20351. if (this.isHide)
  20352. return;
  20353. let time = xGame.common.randomNum(45000, 60000);
  20354. Laya.timer.once(time, this, () => {
  20355. if (this.isHide)
  20356. return;
  20357. let index = xGame.common.randomNum(4, 7);
  20358. xGame.soundMgr.playSound("s_main0" + index);
  20359. let words = 1;
  20360. switch (index) {
  20361. case 4:
  20362. words = 5;
  20363. break;
  20364. case 5:
  20365. words = 3;
  20366. break;
  20367. case 6:
  20368. words = 6;
  20369. break;
  20370. case 7:
  20371. words = 7;
  20372. break;
  20373. default:
  20374. break;
  20375. }
  20376. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20377. this.playSecretaryRandomSound();
  20378. });
  20379. }
  20380. openSecretaryView() {
  20381. xGame.uiMgr.Show(UISecretary$1);
  20382. Moyu.sendDataEvent("secretary");
  20383. }
  20384. openShopView() {
  20385. xGame.uiMgr.Show(UIShop$1);
  20386. }
  20387. openSignView() {
  20388. xGame.uiMgr.Show(UISign$1);
  20389. }
  20390. openDrawView() {
  20391. xGame.uiMgr.Show(UIDraw$1);
  20392. }
  20393. openRanking() {
  20394. xGame.uiMgr.Show(UIRanking$1);
  20395. Moyu.sendDataEvent("rankingList");
  20396. }
  20397. }
  20398. UIMain$1.uiName = "UIMain";
  20399. function InitShader() {
  20400. }
  20401. function appInit() {
  20402. xGame.context.init(getLoadingResList(), initCallback);
  20403. }
  20404. function getLoadingResList() {
  20405. return [
  20406. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20407. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20408. ];
  20409. }
  20410. function getGameResList() {
  20411. return [
  20412. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20413. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20414. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20415. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20416. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20417. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20418. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20419. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20420. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20421. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20422. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20423. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20424. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20425. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20426. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20427. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20428. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20429. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20430. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20431. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20432. ];
  20433. }
  20434. function initCallback() {
  20435. window["DataMgr"] = DataMgr;
  20436. DataMgr.Init();
  20437. Moyu.init(getPlat(), this, () => {
  20438. DataMgr.isNewDay();
  20439. PlatMgr.initConfig();
  20440. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20441. }, true);
  20442. console.log('zh:开始sm init1 start');
  20443. xGame.soundMgr.init();
  20444. console.log('zh:开始sm init1 end');
  20445. xGame.uiMgr.init();
  20446. xGame.uiMgr.bindFUI(fguiRes.loading);
  20447. xGame.uiMgr.Show(UILoading);
  20448. }
  20449. function loadSubRes(callback) {
  20450. var tab = ["asset", "res", "spine"];
  20451. let subDone = 0;
  20452. for (var i = 0; i < tab.length; i++) {
  20453. let sub = tab[i];
  20454. Moyu.loadSubRes(sub, (pro) => {
  20455. callback && callback(pro, false);
  20456. }).then(() => {
  20457. subDone++;
  20458. if (subDone >= tab.length)
  20459. callback && callback(1, true);
  20460. });
  20461. }
  20462. }
  20463. function enterGame() {
  20464. xGame.cfgMgr.init();
  20465. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20466. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20467. xGame.uiMgr.Hide(UILoading);
  20468. fgui.UIPackage.removePackage(fguiRes.loading);
  20469. xGame.uiMgr.bindFUI(fguiRes.game);
  20470. xGame.uiMgr.Show(UIMain$1);
  20471. if (DataMgr.getNewUser())
  20472. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20473. }
  20474. function getPlat() {
  20475. let cfg = new MoyuCfg();
  20476. cfg.plat = MoyuPlat.web;
  20477. cfg.myId = 120;
  20478. cfg.myKey = '8848a885774230a4';
  20479. cfg.version = 0;
  20480. if (window.hasOwnProperty("gamebox")) {
  20481. cfg.plat = MoyuPlat.f399;
  20482. cfg.version = 0;
  20483. }
  20484. else if (window.hasOwnProperty("ks")) {
  20485. cfg.plat = MoyuPlat.ks;
  20486. cfg.version = 0;
  20487. cfg.ads.ksVideoId = '2300002254_01';
  20488. cfg.ads.ksInsertId = '2300002254_02';
  20489. }
  20490. else if (Laya.Browser.onTTMiniGame) {
  20491. cfg.plat = MoyuPlat.tt;
  20492. cfg.version = 0;
  20493. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20494. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20495. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20496. }
  20497. else if (Laya.Browser.onMiniGame) {
  20498. cfg.plat = MoyuPlat.wx;
  20499. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20500. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20501. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20502. }
  20503. else if (Laya.Browser.onQQMiniGame) {
  20504. cfg.plat = MoyuPlat.qq;
  20505. }
  20506. else if (Laya.Browser.onQGMiniGame) {
  20507. cfg.plat = MoyuPlat.op;
  20508. cfg.ads.opVideoId = '455502';
  20509. cfg.ads.opBannerId = '455507';
  20510. }
  20511. else if (Laya.Browser.onVVMiniGame) {
  20512. cfg.plat = MoyuPlat.vv;
  20513. cfg.version = 0;
  20514. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20515. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20516. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20517. }
  20518. else if (Laya.Browser.onHWMiniGame) {
  20519. cfg.plat = MoyuPlat.hw;
  20520. }
  20521. else if (window["mz"]) {
  20522. cfg.plat = MoyuPlat.mz;
  20523. }
  20524. else {
  20525. let cfg = window['conchConfig'];
  20526. if (cfg) {
  20527. var os = cfg.getOS();
  20528. if (os == "Conch-ios") {
  20529. cfg.plat = MoyuPlat.ios;
  20530. }
  20531. else if (os == "Conch-android") {
  20532. }
  20533. }
  20534. }
  20535. return cfg;
  20536. }
  20537. class Main {
  20538. constructor() {
  20539. if (window["Laya3D"])
  20540. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20541. else {
  20542. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20543. this.initMain();
  20544. }
  20545. }
  20546. initMain() {
  20547. Laya["Physics"] && Laya["Physics"].enable();
  20548. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20549. Laya.stage.scaleMode = GameConfig.scaleMode;
  20550. Laya.stage.screenMode = GameConfig.screenMode;
  20551. Laya.stage.alignV = GameConfig.alignV;
  20552. Laya.stage.alignH = GameConfig.alignH;
  20553. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20554. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20555. Laya.enableDebugPanel();
  20556. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20557. Laya["PhysicsDebugDraw"].enable();
  20558. if (GameConfig.stat)
  20559. Laya.Stat.show();
  20560. Laya.alertGlobalError(true);
  20561. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20562. }
  20563. onVersionLoaded() {
  20564. appInit();
  20565. }
  20566. }
  20567. new Main();
  20568. }());
  20569. //# sourceMappingURL=bundle.js.map