bundle.js 799 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977
  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.test_zh = (this.getChild("test_zh"));
  4052. this.n46 = (this.getChild("n46"));
  4053. this.liucheng1 = (this.getChild("liucheng1"));
  4054. this.rightBtn = (this.getChild("rightBtn"));
  4055. this.n75 = (this.getChild("n75"));
  4056. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4057. this.liucheng2 = (this.getChild("liucheng2"));
  4058. this.guideBtn = (this.getChild("guideBtn"));
  4059. this.n73 = (this.getChild("n73"));
  4060. this.wordsNode = (this.getChild("wordsNode"));
  4061. this.enterGuide = (this.getChild("enterGuide"));
  4062. this.talkNode = (this.getChild("talkNode"));
  4063. this.n83 = (this.getChild("n83"));
  4064. this.n84 = (this.getChild("n84"));
  4065. }
  4066. }
  4067. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4068. class ui_UIMoyu extends fgui.GComponent {
  4069. static createInstance() {
  4070. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4071. }
  4072. onConstruct() {
  4073. this.ageTip = (this.getChild("ageTip"));
  4074. this.mainBg = (this.getChild("mainBg"));
  4075. this.xyNode = (this.getChild("xyNode"));
  4076. this.rnNode = (this.getChild("rnNode"));
  4077. this.fcmNode = (this.getChild("fcmNode"));
  4078. this.ageNode = (this.getChild("ageNode"));
  4079. this.tipNode = (this.getChild("tipNode"));
  4080. this.msgNode = (this.getChild("msgNode"));
  4081. }
  4082. }
  4083. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4084. class MoyuMgr {
  4085. static initMoyu() {
  4086. this.moyuView = new MoyuView();
  4087. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4088. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4089. this.moyuView.ui.displayObject.zOrder = 1000;
  4090. this.moyuView.init();
  4091. this.moyuView.showTip(true);
  4092. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4093. window['XApk'] = this;
  4094. }
  4095. static showAge(show) {
  4096. if (this.moyuView)
  4097. this.moyuView.showAge(show);
  4098. }
  4099. static onPlatMsg(idx) {
  4100. if (!MoyuMgr.moyuView)
  4101. return;
  4102. if (idx == '0') {
  4103. MoyuMgr.moyuView.showTip(false);
  4104. }
  4105. }
  4106. static showAgree(call) {
  4107. if (this.moyuView)
  4108. this.moyuView.showAgree(call);
  4109. else
  4110. call && call();
  4111. }
  4112. static showXy(type = 1) {
  4113. if (this.moyuView)
  4114. this.moyuView.showXy(type);
  4115. }
  4116. }
  4117. MoyuMgr.isAdvise = false;
  4118. class MoyuView {
  4119. constructor() {
  4120. this.ysxyNum = 1;
  4121. this.ysJson = null;
  4122. this.ui = ui_UIMoyu.createInstance();
  4123. }
  4124. init() {
  4125. this.ui.mainBg.visible = false;
  4126. this.ui.xyNode.visible = false;
  4127. this.ui.ageNode.visible = false;
  4128. this.ui.tipNode.visible = false;
  4129. this.ui.rnNode.visible = false;
  4130. this.ui.fcmNode.visible = false;
  4131. this.ui.ageTip.visible = false;
  4132. this.ui.msgNode.visible = false;
  4133. this.ui.visible = false;
  4134. this.ui.xyNode.xyList.setVirtual();
  4135. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4136. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4137. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4138. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4139. this.ui.xyNode.btnKnown.visible = false;
  4140. this.ui.xyNode.xy1.visible = false;
  4141. this.ui.xyNode.xy2.visible = false;
  4142. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4143. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4144. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4145. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4146. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4147. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4148. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4149. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4150. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4151. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4152. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4153. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4154. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4155. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4156. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4157. this.ysxyNum = 2;
  4158. }
  4159. }
  4160. onClick(obj) {
  4161. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4162. switch (obj) {
  4163. case this.ui.ageTip:
  4164. if (Moyu.isTTApk) {
  4165. this.ui.ageNode.visible = true;
  4166. this.ui.mainBg.visible = true;
  4167. }
  4168. break;
  4169. case this.ui.tipNode:
  4170. this.showTip(false);
  4171. break;
  4172. case this.ui.ageNode.btnAge:
  4173. this.ui.ageNode.visible = false;
  4174. this.ui.mainBg.visible = false;
  4175. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4176. this.ui.visible = false;
  4177. break;
  4178. case this.ui.xyNode.btnXy3:
  4179. case this.ui.xyNode.btnXy1:
  4180. this.loadXy(1);
  4181. break;
  4182. case this.ui.xyNode.btnXy2:
  4183. this.loadXy(2);
  4184. break;
  4185. case this.ui.xyNode.btnBack:
  4186. this.ui.xyNode.xy1.visible = true;
  4187. this.ui.xyNode.xy2.visible = false;
  4188. break;
  4189. case this.ui.xyNode.btnKnown:
  4190. this.ui.xyNode.visible = false;
  4191. this.ui.mainBg.visible = false;
  4192. this.ui.visible = false;
  4193. break;
  4194. case this.ui.rnNode.btnCheck:
  4195. this.check();
  4196. break;
  4197. case this.ui.rnNode.btnExit:
  4198. case this.ui.xyNode.btnNo:
  4199. this.ysxyNum--;
  4200. if (this.ysxyNum > 0)
  4201. this.showMsg("再次拒绝退出游戏");
  4202. else {
  4203. Moyu.userAgree(false);
  4204. Moyu.exit();
  4205. }
  4206. break;
  4207. case this.ui.xyNode.btnSure:
  4208. case this.ui.xyNode.btnYes:
  4209. DataMgr.userData.isAgree = true;
  4210. DataMgr.saveUserData();
  4211. this.onAgree();
  4212. break;
  4213. case this.ui.rnNode.btnDone:
  4214. this.ui.rnNode.visible = false;
  4215. this.ui.visible = false;
  4216. break;
  4217. case this.ui.fcmNode.btnRn:
  4218. this.showRn();
  4219. break;
  4220. }
  4221. }
  4222. showTip(show) {
  4223. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4224. return;
  4225. if (show) {
  4226. MoyuMgr.isAdvise = true;
  4227. this.ui.visible = true;
  4228. this.ui.tipNode.visible = true;
  4229. this.ui.tipNode.alpha = 1;
  4230. Laya.timer.once(1000, this, this.showTip, [false]);
  4231. }
  4232. else {
  4233. this.ui.tipNode.alpha = 1;
  4234. this.ui.tipNode.visible = true;
  4235. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4236. this.ui.tipNode.visible = false;
  4237. MoyuMgr.isAdvise = false;
  4238. }), 1000);
  4239. }
  4240. }
  4241. showAge(show, px = 0, py = 0) {
  4242. if (Moyu.platType > 10 && !Moyu.isIos) {
  4243. this.ui.ageTip.x = px;
  4244. this.ui.ageTip.y = py;
  4245. this.ui.ageTip.visible = show;
  4246. if (show)
  4247. this.ui.visible = true;
  4248. }
  4249. }
  4250. showAgree(call) {
  4251. this.agreeCall = call;
  4252. this.onAgree();
  4253. return;
  4254. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4255. this.showXy(0);
  4256. }
  4257. else
  4258. this.onAgree();
  4259. }
  4260. onAgree() {
  4261. if (!this.ui.ageNode.visible)
  4262. this.ui.visible = false;
  4263. this.ui.xyNode.visible = false;
  4264. Moyu.userAgree(true);
  4265. this.showAge(false);
  4266. this.agreeCall && this.agreeCall();
  4267. this.showRn();
  4268. }
  4269. showMsg(txt) {
  4270. this.ui.msgNode.txtMsg.text = txt;
  4271. this.ui.msgNode.visible = true;
  4272. this.ui.msgNode.alpha = 1;
  4273. this.ui.visible = true;
  4274. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4275. this.ui.msgNode.visible = false;
  4276. }), 2500, true);
  4277. }
  4278. showRn() {
  4279. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4280. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4281. this.ui.rnNode.rn1.visible = true;
  4282. this.ui.rnNode.rn2.visible = false;
  4283. this.ui.rnNode.rn3.visible = false;
  4284. this.ui.rnNode.rn4.visible = false;
  4285. this.ui.rnNode.visible = true;
  4286. this.ui.mainBg.visible = true;
  4287. this.ui.rnNode.btnDone.visible = false;
  4288. this.ui.rnNode.btnExit.visible = true;
  4289. this.ui.rnNode.btnCheck.visible = true;
  4290. this.ui.fcmNode.visible = false;
  4291. this.ui.visible = true;
  4292. return;
  4293. }
  4294. }
  4295. this.showFcm();
  4296. }
  4297. showFcm() {
  4298. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4299. Moyu.initFCM(true);
  4300. if (Moyu.gameTime < 1)
  4301. this.fcmLoop();
  4302. else if (Moyu.gameTime < 999)
  4303. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4304. }
  4305. }
  4306. fcmLoop() {
  4307. if (Moyu.gameTime < 1) {
  4308. this.ui.rnNode.visible = false;
  4309. this.ui.fcmNode.visible = true;
  4310. this.ui.mainBg.visible = true;
  4311. this.ui.visible = true;
  4312. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4313. Laya.timer.clear(this.ui, this.fcmLoop);
  4314. }
  4315. }
  4316. check() {
  4317. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4318. this.ui.rnNode.rn1.visible = false;
  4319. this.ui.rnNode.rn2.visible = false;
  4320. this.ui.rnNode.rn4.visible = true;
  4321. }
  4322. else if (this.ui.rnNode.rn4.visible) {
  4323. let name = this.ui.rnNode.inputName.text;
  4324. let code = this.ui.rnNode.inputCode.text;
  4325. if (code && code.length == 18) {
  4326. this.ui.rnNode.rn1.visible = false;
  4327. this.ui.rnNode.rn4.visible = false;
  4328. Moyu.authenticate(name, code, (res) => {
  4329. this.ui.rnNode.rn2.visible = !res;
  4330. this.ui.rnNode.rn3.visible = res;
  4331. this.ui.rnNode.btnDone.visible = res;
  4332. this.ui.rnNode.btnExit.visible = !res;
  4333. this.ui.rnNode.btnCheck.visible = !res;
  4334. if (res)
  4335. this.showFcm();
  4336. });
  4337. }
  4338. else
  4339. this.showMsg("信息填写不完整");
  4340. }
  4341. }
  4342. loadXy(type = 0) {
  4343. this.ui.xyNode.xy1.visible = false;
  4344. this.ui.xyNode.xy2.visible = true;
  4345. this.ui.xyNode.xyList.scrollToView(0);
  4346. if (type == 1) {
  4347. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4348. }
  4349. else if (type == 2) {
  4350. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4351. }
  4352. }
  4353. showXy(type = 0) {
  4354. this.xyBtn();
  4355. if (type == 0) {
  4356. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4357. this.ui.xyNode.btnSure.visible = true;
  4358. }
  4359. else {
  4360. this.ui.xyNode.btnYes.visible = true;
  4361. this.ui.xyNode.btnNo.visible = true;
  4362. }
  4363. }
  4364. else {
  4365. this.ui.xyNode.btnKnown.visible = true;
  4366. this.ui.mainBg.visible = true;
  4367. }
  4368. this.ui.xyNode.xy1.visible = true;
  4369. this.ui.xyNode.xy2.visible = false;
  4370. this.ui.xyNode.visible = true;
  4371. this.ui.visible = true;
  4372. }
  4373. xyBtn() {
  4374. this.ui.xyNode.btnSure.visible = false;
  4375. this.ui.xyNode.btnYes.visible = false;
  4376. this.ui.xyNode.btnNo.visible = false;
  4377. this.ui.xyNode.btnKnown.visible = false;
  4378. {
  4379. this.ui.xyNode.btnXy3.visible = false;
  4380. this.ui.xyNode.btnXy2.visible = true;
  4381. this.ui.xyNode.btnXy1.visible = true;
  4382. this.ui.xyNode.xy1.text = "欢迎来到《万宁台球》";
  4383. }
  4384. }
  4385. createXY(json) {
  4386. this.ysJson = json.content;
  4387. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "万宁台球");
  4388. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4389. this.ui.xyNode.xy2.visible = true;
  4390. }
  4391. renderListItem(idx, cell) {
  4392. let xy = this.ysJson[idx];
  4393. cell.height = xy.line * 30;
  4394. cell.xyItem.text = xy.text;
  4395. }
  4396. onDestroy() {
  4397. this.agreeCall = null;
  4398. }
  4399. }
  4400. class SettingNode {
  4401. constructor(ui) {
  4402. this.showSetting = false;
  4403. this.openSound = true;
  4404. this.openShake = true;
  4405. this.ui = ui;
  4406. this.ui.soundBtn.onClick(this, this.switchSound);
  4407. this.ui.shakeBtn.onClick(this, this.switchShake);
  4408. this.ui.xyBtn.onClick(this, this.onXy);
  4409. this.ui.clickNode.onClick(this, this.changeSetting);
  4410. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4411. }
  4412. changeSetting() {
  4413. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4414. this.showSetting = !this.showSetting;
  4415. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4416. }
  4417. switchSound() {
  4418. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4419. this.openSound = !this.openSound;
  4420. Moyu.onSetting(this.openSound, this.openShake);
  4421. xGame.soundMgr.onSetting(this.openSound);
  4422. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4423. }
  4424. switchShake() {
  4425. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4426. this.openShake = !this.openShake;
  4427. Moyu.onSetting(this.openSound, this.openShake);
  4428. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4429. }
  4430. onXy() {
  4431. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4432. MoyuMgr.showXy(1);
  4433. }
  4434. }
  4435. class ui_UILevelDisplay extends fgui.GComponent {
  4436. static createInstance() {
  4437. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4438. }
  4439. onConstruct() {
  4440. this.n9 = (this.getChild("n9"));
  4441. this.myNode = (this.getChild("myNode"));
  4442. this.closeNode = (this.getChild("closeNode"));
  4443. }
  4444. }
  4445. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4446. class ui_UILevelProp extends fgui.GComponent {
  4447. static createInstance() {
  4448. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4449. }
  4450. onConstruct() {
  4451. this.n16 = (this.getChild("n16"));
  4452. this.myNode = (this.getChild("myNode"));
  4453. this.closeBtn = (this.getChild("closeBtn"));
  4454. this.moneyNode = (this.getChild("moneyNode"));
  4455. this.t1 = this.getTransition("t1");
  4456. }
  4457. }
  4458. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4459. class ui_ShowItem extends fgui.GComponent {
  4460. static createInstance() {
  4461. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4462. }
  4463. onConstruct() {
  4464. this.myImg = (this.getChild("myImg"));
  4465. }
  4466. }
  4467. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4468. class ShowItem {
  4469. constructor() {
  4470. this.ui = ui_ShowItem.createInstance();
  4471. }
  4472. destroySelf() {
  4473. if (!this.ui.isDisposed) {
  4474. this.ui.removeFromParent();
  4475. this.ui.dispose();
  4476. }
  4477. }
  4478. setParent(parent) {
  4479. parent.addChild(this.ui);
  4480. }
  4481. setPos(x, y) {
  4482. this.ui.x = x;
  4483. this.ui.y = y;
  4484. }
  4485. setUrl(index) {
  4486. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4487. }
  4488. }
  4489. class ui_UIPower extends fgui.GComponent {
  4490. static createInstance() {
  4491. return (fgui.UIPackage.createObject("game", "UIPower"));
  4492. }
  4493. onConstruct() {
  4494. this.n11 = (this.getChild("n11"));
  4495. this.myNode = (this.getChild("myNode"));
  4496. this.t0 = this.getTransition("t0");
  4497. }
  4498. }
  4499. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4500. class UIPower extends UIBase {
  4501. constructor() {
  4502. super();
  4503. }
  4504. onConstructor() {
  4505. this.ui = ui_UIPower.createInstance();
  4506. this.contentPane = this.ui;
  4507. this.isEject = false;
  4508. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4509. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4510. }
  4511. show() {
  4512. super.show();
  4513. this.ui.t0.play();
  4514. }
  4515. videoGetPower() {
  4516. Moyu.showVideoAd(() => {
  4517. DataMgr.setPower(xGame.common.videoPower, true);
  4518. xGame.eventMgr.event(POWER_TIME);
  4519. this.hide();
  4520. }, EAdType.getPower);
  4521. }
  4522. }
  4523. UIPower.uiName = "UIPower";
  4524. class UILevelProp extends UIBase {
  4525. constructor() {
  4526. super();
  4527. this.firstPos = 385;
  4528. this.secondPos = 467;
  4529. this.showItemArr = [];
  4530. }
  4531. onConstructor() {
  4532. this.ui = ui_UILevelProp.createInstance();
  4533. this.contentPane = this.ui;
  4534. this.isEject = false;
  4535. this.addUIClick(this.ui.closeBtn, this.hide);
  4536. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4537. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4538. }
  4539. show(level) {
  4540. super.show();
  4541. this.ui.t1.play();
  4542. this.level = level;
  4543. this.data = cfgTable.placeballData[this.level];
  4544. this.updateSelf();
  4545. this.showPreView();
  4546. this.moneyNode.ui.c1.selectedIndex = 2;
  4547. this.moneyNode.checkPowerTime();
  4548. this.moneyNode.powerChange();
  4549. }
  4550. showPreView() {
  4551. let item;
  4552. let data;
  4553. for (let index = 0; index < this.showItemArr.length; index++) {
  4554. item = this.showItemArr[index];
  4555. item.destroySelf();
  4556. }
  4557. this.showItemArr = [];
  4558. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4559. for (const key in cfgData) {
  4560. data = cfgData[key];
  4561. item = new ShowItem();
  4562. item.setParent(this.ui.myNode.displayRoot);
  4563. item.setPos(data.x, data.y);
  4564. item.setUrl(data.value);
  4565. this.showItemArr.push(item);
  4566. }
  4567. }
  4568. updateSelf() {
  4569. this.ui.myNode.levelTxt.text = `第${this.level}关`;
  4570. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4571. if (this.data.ball == -1) {
  4572. this.ui.myNode.conditionTxt.text = "打进场上所有球";
  4573. }
  4574. else {
  4575. this.ui.myNode.conditionTxt.text = "奖励关卡";
  4576. }
  4577. let localData = DataMgr.getPlaceBallLevel(this.level);
  4578. let getAward = localData.getAward;
  4579. let cfg = cfgTable.placeballData[this.level];
  4580. let coin = this.data.award[0];
  4581. let diamond = this.data.award[1];
  4582. if (cfg.type == PlaceBallType.challenge) {
  4583. diamond = 0;
  4584. coin = 100;
  4585. }
  4586. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4587. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4588. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4589. if (cfg.type == PlaceBallType.challenge) {
  4590. this.ui.myNode.coinNode.numTxt.text = "";
  4591. }
  4592. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4593. if (coin > 0 && diamond > 0) {
  4594. this.ui.myNode.diamondNode.x = 385;
  4595. this.ui.myNode.coinNode.x = 467;
  4596. }
  4597. else {
  4598. this.ui.myNode.diamondNode.x = 385;
  4599. this.ui.myNode.coinNode.x = 385;
  4600. }
  4601. if (!getAward) {
  4602. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4603. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4604. }
  4605. else {
  4606. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4607. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4608. }
  4609. }
  4610. startGame() {
  4611. if (DataMgr.powerEnough()) {
  4612. this.ui.myNode.startBtn.touchable = false;
  4613. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4614. this.ui.myNode.startBtn.touchable = true;
  4615. DataMgr.setPower(-1);
  4616. xGame.eventMgr.event(POWER_TIME);
  4617. xGame.common.gameMode = GameMode.placeBall;
  4618. xGame.common.placeBallCurLevel = this.level;
  4619. xGame.uiMgr.Show(UIGame);
  4620. xGame.uiMgr.Hide(UILevelDisplay);
  4621. xGame.uiMgr.Hide(UIMain);
  4622. this.hide();
  4623. }));
  4624. }
  4625. else {
  4626. xGame.uiMgr.Show(UIPower);
  4627. }
  4628. }
  4629. hide() {
  4630. super.hide();
  4631. }
  4632. }
  4633. UILevelProp.uiName = "UILevelProp";
  4634. class PutBallLevelDisplay {
  4635. constructor(ui, index) {
  4636. this.index = 0;
  4637. this.ui = ui;
  4638. this.index = index;
  4639. this.ui.onClick(this, this.clickSelf);
  4640. this.updateSelf();
  4641. this.ui.levelTxt.text = (this.index + 1) + "";
  4642. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4643. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4644. }
  4645. updateSelf() {
  4646. let level = this.index + 1;
  4647. this.data = DataMgr.getPlaceBallLevel(level);
  4648. this.ui.starNode.c1.selectedIndex = this.data.star;
  4649. let isChallenge = cfgTable.placeballData[level].type;
  4650. if (this.data.isCur) {
  4651. if (isChallenge) {
  4652. this.ui.c1.selectedIndex = 5;
  4653. }
  4654. else {
  4655. this.ui.c1.selectedIndex = 2;
  4656. }
  4657. }
  4658. else {
  4659. if (this.data.play) {
  4660. if (this.data.star == 3) {
  4661. this.ui.c1.selectedIndex = 0;
  4662. }
  4663. else {
  4664. this.ui.c1.selectedIndex = 1;
  4665. }
  4666. }
  4667. else {
  4668. if (isChallenge) {
  4669. this.ui.c1.selectedIndex = 4;
  4670. }
  4671. else {
  4672. this.ui.c1.selectedIndex = 3;
  4673. }
  4674. }
  4675. }
  4676. }
  4677. clickSelf() {
  4678. if (!this.data.play)
  4679. return;
  4680. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4681. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4682. }
  4683. }
  4684. class UILevelDisplay extends UIBase {
  4685. constructor() {
  4686. super();
  4687. }
  4688. onConstructor() {
  4689. this.ui = ui_UILevelDisplay.createInstance();
  4690. this.contentPane = this.ui;
  4691. this.isEject = false;
  4692. this.myList = this.ui.myNode.myList;
  4693. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4694. this.levelItemArr = [];
  4695. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4696. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4697. this.myList.numItems = levelNum;
  4698. if (Moyu.isKs)
  4699. this.ui.closeNode.closeBtn.x += 100;
  4700. }
  4701. levelItemRender(index, target) {
  4702. let item = new PutBallLevelDisplay(target, index);
  4703. this.levelItemArr.push(item);
  4704. }
  4705. show() {
  4706. super.show();
  4707. this.updateLevel();
  4708. this.scrollToPlace();
  4709. }
  4710. updateLevel() {
  4711. let temp;
  4712. for (let index = 0; index < this.levelItemArr.length; index++) {
  4713. temp = this.levelItemArr[index];
  4714. temp.updateSelf();
  4715. }
  4716. }
  4717. scrollToPlace() {
  4718. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4719. let passArr = DataMgr.getPlaceBallLevelList();
  4720. let offest = passArr.length;
  4721. if (offest >= maxNum - 1)
  4722. offest = maxNum - 1;
  4723. this.myList.scrollToView(offest, true, true);
  4724. }
  4725. hide() {
  4726. super.hide();
  4727. }
  4728. }
  4729. UILevelDisplay.uiName = "UILevelDisplay";
  4730. class ui_UIMatching extends fgui.GComponent {
  4731. static createInstance() {
  4732. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4733. }
  4734. onConstruct() {
  4735. this.n5 = (this.getChild("n5"));
  4736. this.n49 = (this.getChild("n49"));
  4737. this.n51 = (this.getChild("n51"));
  4738. this.n64 = (this.getChild("n64"));
  4739. this.n2 = (this.getChild("n2"));
  4740. this.n53 = (this.getChild("n53"));
  4741. this.n54 = (this.getChild("n54"));
  4742. this.n56 = (this.getChild("n56"));
  4743. this.n58 = (this.getChild("n58"));
  4744. this.n59 = (this.getChild("n59"));
  4745. this.n57 = (this.getChild("n57"));
  4746. this.n60 = (this.getChild("n60"));
  4747. this.n62 = (this.getChild("n62"));
  4748. this.awardTxt = (this.getChild("awardTxt"));
  4749. this.n61 = (this.getChild("n61"));
  4750. this.selfHead = (this.getChild("selfHead"));
  4751. this.aiHead = (this.getChild("aiHead"));
  4752. this.n82 = (this.getChild("n82"));
  4753. this.n84 = (this.getChild("n84"));
  4754. this.n83 = (this.getChild("n83"));
  4755. this.t1 = this.getTransition("t1");
  4756. this.t2 = this.getTransition("t2");
  4757. this.t3 = this.getTransition("t3");
  4758. this.t4 = this.getTransition("t4");
  4759. }
  4760. }
  4761. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4762. class UIMatching extends UIBase {
  4763. constructor() {
  4764. super();
  4765. }
  4766. onConstructor() {
  4767. this.ui = ui_UIMatching.createInstance();
  4768. this.contentPane = this.ui;
  4769. this.isEject = false;
  4770. }
  4771. show(callback) {
  4772. super.show();
  4773. PlatMgr.showBanner(true);
  4774. this.callback = callback;
  4775. let user = Moyu.getUserInfo();
  4776. if (!this.selfPot) {
  4777. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4778. }
  4779. if (!this.aiPot) {
  4780. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4781. }
  4782. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4783. this.ui.selfHead.nameTxt.text = user.nickName;
  4784. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4785. this.ui.aiHead.nameTxt.text = "???";
  4786. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4787. this.ui.selfHead.c1.selectedIndex = 0;
  4788. this.ui.aiHead.c1.selectedIndex = 0;
  4789. this.ui.selfHead.x = this.selfPot.x;
  4790. this.ui.selfHead.y = this.selfPot.y;
  4791. this.ui.aiHead.x = this.aiPot.x;
  4792. this.ui.aiHead.y = this.aiPot.y;
  4793. switch (xGame.common.gameMode) {
  4794. case GameMode.classic:
  4795. break;
  4796. case GameMode.bigMove:
  4797. this.initSkillData();
  4798. break;
  4799. default:
  4800. break;
  4801. }
  4802. this.ui.t1.play(Laya.Handler.create(this, () => {
  4803. this.ui.t2.play(Laya.Handler.create(this, () => {
  4804. switch (xGame.common.gameMode) {
  4805. case GameMode.classic:
  4806. this.waitingPeople();
  4807. break;
  4808. case GameMode.bigMove:
  4809. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4810. break;
  4811. default:
  4812. break;
  4813. }
  4814. }));
  4815. }));
  4816. }
  4817. initSkillData() {
  4818. this.skillSelectData = [];
  4819. let skillUrl = xGame.common.skillIconList;
  4820. let skillName = xGame.common.skillNameList;
  4821. let skillLevel = DataMgr.getBigSkillList();
  4822. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4823. for (let index = 0; index < 5; index++) {
  4824. let obj = {};
  4825. obj.skillImg = skillUrl[index];
  4826. obj.skillName = skillName[index];
  4827. obj.skillType = skillType[index];
  4828. obj.skillLevel = skillLevel[index];
  4829. this.skillSelectData.push(obj);
  4830. }
  4831. }
  4832. getAISkillLevel(myLevel) {
  4833. let video = xGame.common.upSkillLevel;
  4834. let aiLevel;
  4835. let temp;
  4836. if (video) {
  4837. temp = xGame.common.randomNum(-2, -1);
  4838. }
  4839. else {
  4840. if (myLevel <= 5) {
  4841. temp = xGame.common.randomNum(1, 3);
  4842. }
  4843. else if (myLevel <= 9) {
  4844. temp = xGame.common.randomNum(-2, 1);
  4845. }
  4846. else {
  4847. temp = xGame.common.randomNum(-4, 0);
  4848. }
  4849. }
  4850. aiLevel = temp + myLevel;
  4851. if (aiLevel <= 1)
  4852. aiLevel = 1;
  4853. if (aiLevel >= 10)
  4854. aiLevel = 10;
  4855. return aiLevel;
  4856. }
  4857. getAISkillType() {
  4858. return xGame.common.randomNum(1, 4);
  4859. let successTimes = DataMgr.getSkillSuccessTimes();
  4860. let info = cfgTable.aiskillData[successTimes];
  4861. if (!info) {
  4862. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4863. info = cfgTable.aiskillData[max];
  4864. }
  4865. let dataArr = info.skillselect;
  4866. let myCfg = {};
  4867. for (let index = 0; index < dataArr.length; index++) {
  4868. let temp = dataArr[index].split('-');
  4869. myCfg[temp[0]] = {};
  4870. myCfg[temp[0]].id = parseInt(temp[0]);
  4871. myCfg[temp[0]].weight = parseInt(temp[1]);
  4872. }
  4873. let aiCfg = xGame.common.initWeight(myCfg);
  4874. let curData = xGame.common.getRandomWeightData(aiCfg);
  4875. return parseInt(curData.id);
  4876. }
  4877. getAISkillData(index) {
  4878. let myLevel = this.skillSelectData[index].skillLevel;
  4879. let aiLevel = this.getAISkillLevel(myLevel);
  4880. let aiType = this.getAISkillType() - 1;
  4881. return { aiLevel, aiType } = { aiLevel, aiType };
  4882. }
  4883. skillSelectFinish(index) {
  4884. let aiInfo = this.getAISkillData(index);
  4885. xGame.common.gameMgr.selfCurSkill = index;
  4886. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4887. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4888. this.ui.selfHead.c1.selectedIndex = 1;
  4889. this.ui.aiHead.c1.selectedIndex = 1;
  4890. let myData = this.skillSelectData[index];
  4891. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4892. let guide = DataMgr.getSkillGuide();
  4893. if (guide == 0) {
  4894. this.ui.selfHead.skillTxt.text = myData.skillName + " 满级";
  4895. }
  4896. else {
  4897. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4898. }
  4899. let aiData = this.skillSelectData[aiInfo.aiType];
  4900. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4901. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4902. this.waitingPeople();
  4903. }
  4904. waitingPeople() {
  4905. let time = xGame.common.randomNum(1000, 3000);
  4906. time += 1000;
  4907. Laya.timer.once(time, this, () => {
  4908. this.matchingSuccess();
  4909. });
  4910. }
  4911. matchingSuccess() {
  4912. let gameUI = xGame.common.gameUI;
  4913. let name = gameUI.ui.topNode.aiNameTxt.text;
  4914. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4915. this.ui.aiHead.nameTxt.text = name;
  4916. this.ui.aiHead.headImg.url = url;
  4917. name = gameUI.ui.topNode.selfNameTxt.text;
  4918. url = gameUI.ui.topNode.selfHeadLoader.url;
  4919. this.ui.selfHead.nameTxt.text = name;
  4920. this.ui.selfHead.headImg.url = url;
  4921. this.ui.t3.play(Laya.Handler.create(this, () => {
  4922. this.callback && this.callback();
  4923. this.ui.t4.play(Laya.Handler.create(this, () => {
  4924. this.destroySelf();
  4925. }));
  4926. }));
  4927. }
  4928. destroySelf() {
  4929. this.callback = null;
  4930. this.skillSelectData = null;
  4931. this.selfPot = null;
  4932. this.aiPot = null;
  4933. if (!this.ui.isDisposed) {
  4934. this.ui.removeFromParent();
  4935. this.ui.dispose();
  4936. }
  4937. xGame.uiMgr.destroyUI(this);
  4938. }
  4939. }
  4940. UIMatching.uiName = "UIMatching";
  4941. class ui_UIRanking extends fgui.GComponent {
  4942. static createInstance() {
  4943. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4944. }
  4945. onConstruct() {
  4946. this.n26 = (this.getChild("n26"));
  4947. this.myNode = (this.getChild("myNode"));
  4948. }
  4949. }
  4950. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4951. class UIRanking extends UIBase {
  4952. constructor() {
  4953. super();
  4954. this.showSelf = true;
  4955. this.rankType = 1;
  4956. this.rankList = [];
  4957. this.myIndex = 0;
  4958. this.myStar = 0;
  4959. }
  4960. onConstructor() {
  4961. this.ui = ui_UIRanking.createInstance();
  4962. this.contentPane = this.ui;
  4963. this.isEject = false;
  4964. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4965. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4966. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4967. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4968. this.ui.myNode.myList.setVirtual();
  4969. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4970. }
  4971. show() {
  4972. super.show();
  4973. this.myIndex = 51;
  4974. Moyu.getRankList({
  4975. rankId: xGame.common.curRankID,
  4976. type: MoyuRankType.total,
  4977. page: 1,
  4978. pageSize: 50,
  4979. }, this, this.updateItemData);
  4980. this.updateSelf();
  4981. let self = Moyu.getUserInfo();
  4982. if (!self.isAuth) {
  4983. Moyu.initUser(this, () => {
  4984. DataMgr.upRankData();
  4985. });
  4986. }
  4987. }
  4988. updateSelfItem() {
  4989. let self = Moyu.getUserInfo();
  4990. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4991. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4992. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4993. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "我自己";
  4994. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4995. }
  4996. updateItemData(data) {
  4997. this.myStar = xGame.common.getAllStarNum();
  4998. if (this.rankList.length < 2) {
  4999. this.rankList = data;
  5000. let self = Moyu.getUserInfo();
  5001. for (let i = 0; i < data.length; i++) {
  5002. let data = this.rankList[i];
  5003. if (data.userId == self.userId) {
  5004. this.rankList.splice(i, 1);
  5005. break;
  5006. }
  5007. }
  5008. for (let i = 0; i < data.length; i++) {
  5009. let data = this.rankList[i];
  5010. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5011. this.myIndex = i + 1;
  5012. let user = { headIcon: self.headIcon, nickName: "我自己" };
  5013. let ud = { user: user, data: {} };
  5014. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5015. if (Moyu.platType < 11) {
  5016. user.headIcon = self.headIcon;
  5017. user.nickName = self.nickName;
  5018. }
  5019. this.rankList.splice(i, 0, md);
  5020. break;
  5021. }
  5022. }
  5023. }
  5024. this.updateSelfItem();
  5025. this.ui.myNode.myList.numItems = this.rankList.length;
  5026. }
  5027. updateItemUI(index, obj) {
  5028. let data = this.rankList[index];
  5029. let userData = JSON.parse(data.userData).user;
  5030. obj.nameTxt.text = userData.nickName.toString();
  5031. obj.valueTxt.text = data.rankScore;
  5032. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5033. obj.rankTxt.text = index + 1;
  5034. switch (index) {
  5035. case 0:
  5036. this.setImg(obj, 1, 0, 0);
  5037. obj.rankTxt.color = "#FFC047";
  5038. break;
  5039. case 1:
  5040. this.setImg(obj, 0, 1, 0);
  5041. obj.rankTxt.color = "#ACACAC";
  5042. break;
  5043. case 2:
  5044. this.setImg(obj, 0, 0, 1);
  5045. obj.rankTxt.color = "#D09672";
  5046. break;
  5047. default:
  5048. this.setImg(obj, 0, 0, 0);
  5049. obj.rankTxt.color = "#496FAB";
  5050. break;
  5051. }
  5052. }
  5053. setImg(obj, a, b, c) {
  5054. obj.img1.visible = a ? true : false;
  5055. obj.img2.visible = b ? true : false;
  5056. obj.img3.visible = c ? true : false;
  5057. }
  5058. changeList(type) {
  5059. this.rankType = type;
  5060. this.updateSelf();
  5061. }
  5062. changeSelfNode() {
  5063. this.showSelf = !this.showSelf;
  5064. this.updateSelf();
  5065. }
  5066. updateSelf() {
  5067. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5068. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5069. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5070. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5071. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5072. }
  5073. }
  5074. UIRanking.uiName = "UIRanking";
  5075. class ui_UISecretary extends fgui.GComponent {
  5076. static createInstance() {
  5077. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5078. }
  5079. onConstruct() {
  5080. this.n0 = (this.getChild("n0"));
  5081. this.myNode = (this.getChild("myNode"));
  5082. this.rightBtn = (this.getChild("rightBtn"));
  5083. this.leftBtn = (this.getChild("leftBtn"));
  5084. this.closeBtn = (this.getChild("closeBtn"));
  5085. this.t0 = this.getTransition("t0");
  5086. }
  5087. }
  5088. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5089. class UISecretary extends UIBase {
  5090. constructor() {
  5091. super();
  5092. this.curIndex = 1;
  5093. }
  5094. onConstructor() {
  5095. this.ui = ui_UISecretary.createInstance();
  5096. this.contentPane = this.ui;
  5097. this.isEject = false;
  5098. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5099. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  5100. this.addUIClick(this.ui.rightBtn, this.turnRight);
  5101. this.nodeObj = { left: null, right: null, cur: null };
  5102. this.nodeObj.left = this.ui.myNode.gameNode1;
  5103. this.nodeObj.right = this.ui.myNode.gameNode2;
  5104. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5105. }
  5106. show() {
  5107. super.show();
  5108. this.ui.t0.play();
  5109. this.updateData();
  5110. }
  5111. addSecretarySpine(node, spineName) {
  5112. if (spineName == "mishu") {
  5113. if (this.secretarySpine1) {
  5114. node.displayObject.destroyChildren();
  5115. this.playWoman(this.secretarySpine1, node.displayObject);
  5116. }
  5117. else {
  5118. let spine1 = new SpineMgr("mishu", () => {
  5119. this.secretarySpine1 = spine1;
  5120. this.playWoman(this.secretarySpine1, node.displayObject);
  5121. });
  5122. }
  5123. }
  5124. else {
  5125. if (this.secretarySpine2) {
  5126. node.displayObject.destroyChildren();
  5127. this.playWoman(this.secretarySpine2, node.displayObject);
  5128. }
  5129. else {
  5130. let spine2 = new SpineMgr("xiaomishu2", () => {
  5131. this.secretarySpine2 = spine2;
  5132. this.playWoman(this.secretarySpine2, node.displayObject);
  5133. });
  5134. }
  5135. }
  5136. }
  5137. playWoman(node, parent) {
  5138. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  5139. let yy = this.ui.myNode.gameNode1.secretary.height;
  5140. let scale = 1.5;
  5141. if (node == this.secretarySpine2) {
  5142. scale = 1.2;
  5143. }
  5144. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5145. node.play(data, 1, true, parent);
  5146. }
  5147. turnLeft() {
  5148. this.curIndex--;
  5149. if (this.curIndex < 1) {
  5150. this.curIndex = 2;
  5151. }
  5152. let left = this.nodeObj.left;
  5153. let right = this.nodeObj.right;
  5154. let cur = this.nodeObj.cur;
  5155. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5156. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5157. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5158. this.updateData();
  5159. }));
  5160. this.ui.myNode.setChildIndex(right, 2);
  5161. this.nodeObj.left = cur;
  5162. this.nodeObj.right = left;
  5163. this.nodeObj.cur = right;
  5164. }
  5165. turnRight() {
  5166. this.curIndex++;
  5167. if (this.curIndex > 2) {
  5168. this.curIndex = 1;
  5169. }
  5170. let left = this.nodeObj.left;
  5171. let right = this.nodeObj.right;
  5172. let cur = this.nodeObj.cur;
  5173. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5174. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5175. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5176. this.updateData();
  5177. }));
  5178. this.ui.myNode.setChildIndex(left, 2);
  5179. this.nodeObj.left = right;
  5180. this.nodeObj.right = cur;
  5181. this.nodeObj.cur = left;
  5182. }
  5183. updateData() {
  5184. let data = cfgTable.secretaryshopData;
  5185. let children = this.ui.myNode._children;
  5186. let temp;
  5187. let curData;
  5188. for (let index = 0; index < children.length; index++) {
  5189. temp = children[index];
  5190. if (index == 2) {
  5191. curData = data[this.curIndex];
  5192. temp.purchaseBtn.touchable = true;
  5193. }
  5194. else {
  5195. temp.purchaseBtn.touchable = false;
  5196. if (this.curIndex == 1) {
  5197. curData = data[2];
  5198. }
  5199. else {
  5200. curData = data[1];
  5201. }
  5202. }
  5203. temp.heightTxt.text = curData.height;
  5204. temp.foodTxt.text = curData.food;
  5205. temp.historyTxt.text = curData.history;
  5206. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5207. this.addSecretarySpine(temp.secretary, curData.spine);
  5208. let womanIndex = curData.id - 1;
  5209. let getWoman = DataMgr.getSecretary(womanIndex);
  5210. let curUse = DataMgr.getCurSecretary();
  5211. if (getWoman) {
  5212. if (curUse == womanIndex) {
  5213. temp.purchaseBtn.c1.selectedIndex = 1;
  5214. }
  5215. else {
  5216. temp.purchaseBtn.c1.selectedIndex = 2;
  5217. }
  5218. }
  5219. else {
  5220. temp.purchaseBtn.c1.selectedIndex = 0;
  5221. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5222. }
  5223. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5224. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5225. }
  5226. }
  5227. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5228. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5229. if (getWoman) {
  5230. if (curUse != womanIndex) {
  5231. console.log();
  5232. DataMgr.setCurSecretary(womanIndex);
  5233. this.updateData();
  5234. }
  5235. }
  5236. else {
  5237. let need = needDiamond;
  5238. if (DataMgr.diamondEnough(need)) {
  5239. DataMgr.setDiamond(-need);
  5240. DataMgr.setSecretary(womanIndex, 1);
  5241. DataMgr.setCurSecretary(womanIndex);
  5242. this.updateData();
  5243. }
  5244. else {
  5245. xGame.uiMgr.Show(UIAddProp, 1);
  5246. }
  5247. }
  5248. }
  5249. closeSelf() {
  5250. this.hide();
  5251. }
  5252. }
  5253. UISecretary.uiName = "UISecretary";
  5254. class ui_UIShop extends fgui.GComponent {
  5255. static createInstance() {
  5256. return (fgui.UIPackage.createObject("game", "UIShop"));
  5257. }
  5258. onConstruct() {
  5259. this.n48 = (this.getChild("n48"));
  5260. this.n0 = (this.getChild("n0"));
  5261. this.secretary = (this.getChild("secretary"));
  5262. this.talkNode = (this.getChild("talkNode"));
  5263. this.closeNode = (this.getChild("closeNode"));
  5264. this.moneyNode = (this.getChild("moneyNode"));
  5265. this.myNode = (this.getChild("myNode"));
  5266. }
  5267. }
  5268. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5269. class BallRodDisplay {
  5270. constructor(ui, index) {
  5271. this.index = 0;
  5272. this.uiIndex = 0;
  5273. this.ui = ui;
  5274. this.index = index;
  5275. this.initData();
  5276. }
  5277. initData() {
  5278. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5279. let data = cfgTable.ballrodData[this.index + 1];
  5280. this.ui.nameTxt.text = data.name;
  5281. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5282. this.ui.levelNode.c1.selectedIndex = data.quality;
  5283. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5284. if (data.spine) {
  5285. this.mySpine = new SpineMgr(data.spine, () => {
  5286. let xx = 150;
  5287. let yy = 70;
  5288. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5289. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5290. });
  5291. }
  5292. }
  5293. updateSelf() {
  5294. let get = DataMgr.getBallRod(this.index);
  5295. if (get == null)
  5296. get = 1;
  5297. let curUse = DataMgr.getCurBallRod();
  5298. if (get) {
  5299. if (curUse == this.index) {
  5300. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5301. }
  5302. else {
  5303. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5304. }
  5305. }
  5306. else {
  5307. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5308. }
  5309. }
  5310. buyBallRod() {
  5311. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5312. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5313. switch (selectedIndex) {
  5314. case 0:
  5315. break;
  5316. case 1:
  5317. DataMgr.setCurBallRod(this.index);
  5318. let ui = xGame.uiMgr.getUI(UIShop);
  5319. ui.updateBallRod();
  5320. break;
  5321. case 2:
  5322. let data = cfgTable.ballrodData[this.index + 1];
  5323. let need = data.price;
  5324. if (DataMgr.diamondEnough(need)) {
  5325. DataMgr.setDiamond(-need);
  5326. DataMgr.setBallRod(this.index, 1);
  5327. DataMgr.setCurBallRod(this.index);
  5328. let ui = xGame.uiMgr.getUI(UIShop);
  5329. ui.updateBallRod();
  5330. }
  5331. else {
  5332. xGame.uiMgr.Show(UIAddProp, 1);
  5333. }
  5334. break;
  5335. default:
  5336. break;
  5337. }
  5338. }
  5339. }
  5340. class UIShop extends UIBase {
  5341. constructor() {
  5342. super();
  5343. this.itemNums = 0;
  5344. }
  5345. onConstructor() {
  5346. this.ui = ui_UIShop.createInstance();
  5347. this.contentPane = this.ui;
  5348. this.isEject = false;
  5349. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5350. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5351. this.addUIClick(this.ui, this.interuptSecretary);
  5352. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5353. this.ballRodArr = [];
  5354. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5355. this.ui.myNode.myList.numItems = this.itemNums;
  5356. if (Moyu.isKs)
  5357. this.ui.closeNode.closeBtn.x += 100;
  5358. }
  5359. show() {
  5360. super.show();
  5361. this.playSecretaryIdle();
  5362. this.updateBallRod();
  5363. }
  5364. updateBallRod() {
  5365. for (let index = 0; index < this.ballRodArr.length; index++) {
  5366. this.ballRodArr[index].updateSelf();
  5367. }
  5368. }
  5369. renderBallRod(sort, obj) {
  5370. let index = this.getIndexBySort(sort + 1) - 1;
  5371. let ballRod = new BallRodDisplay(obj, index);
  5372. this.ballRodArr.push(ballRod);
  5373. }
  5374. getIndexBySort(sort) {
  5375. let object = cfgTable.ballrodData;
  5376. for (const key in object) {
  5377. if (object[key].sort == sort) {
  5378. return parseInt(key);
  5379. }
  5380. }
  5381. }
  5382. playSecretaryIdle() {
  5383. let parent = this.ui.secretary.displayObject;
  5384. parent.destroyChildren();
  5385. let xx = this.ui.secretary.width / 2;
  5386. let yy = this.ui.secretary.height;
  5387. let scale = xGame.common.getSecretaryScale();
  5388. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5389. xGame.common.secretary.play(data, 1, true, parent);
  5390. }
  5391. interuptSecretary() {
  5392. Laya.timer.clearAll(this);
  5393. this.playSecretaryRandomSound();
  5394. }
  5395. playSecretaryRandomSound() {
  5396. if (this.isHide)
  5397. return;
  5398. let time = xGame.common.randomNum(45000, 60000);
  5399. Laya.timer.once(time, this, () => {
  5400. if (this.isHide)
  5401. return;
  5402. let index = xGame.common.randomNum(4, 7);
  5403. xGame.soundMgr.playSound("s_main0" + index);
  5404. let words = 1;
  5405. switch (index) {
  5406. case 4:
  5407. words = 5;
  5408. break;
  5409. case 5:
  5410. words = 3;
  5411. break;
  5412. case 6:
  5413. words = 6;
  5414. break;
  5415. case 7:
  5416. words = 7;
  5417. break;
  5418. default:
  5419. break;
  5420. }
  5421. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5422. this.playSecretaryRandomSound();
  5423. });
  5424. }
  5425. closeSelf() {
  5426. this.hide();
  5427. }
  5428. }
  5429. UIShop.uiName = "UIShop";
  5430. class ui_UISign extends fgui.GComponent {
  5431. static createInstance() {
  5432. return (fgui.UIPackage.createObject("game", "UISign"));
  5433. }
  5434. onConstruct() {
  5435. this.n6 = (this.getChild("n6"));
  5436. this.closeNode = (this.getChild("closeNode"));
  5437. this.myNode = (this.getChild("myNode"));
  5438. this.moneyNode = (this.getChild("moneyNode"));
  5439. this.secretary = (this.getChild("secretary"));
  5440. this.talkNode = (this.getChild("talkNode"));
  5441. this.tripleBtn = (this.getChild("tripleBtn"));
  5442. this.normalBtn = (this.getChild("normalBtn"));
  5443. this.tipsNode = (this.getChild("tipsNode"));
  5444. this.againBtn = (this.getChild("againBtn"));
  5445. this.t0 = this.getTransition("t0");
  5446. }
  5447. }
  5448. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5449. class SignMax {
  5450. constructor(ui) {
  5451. this.ui = ui;
  5452. }
  5453. updateSelf(index, sameDay, curDayIndex) {
  5454. let data = cfgTable.signData[index + 1];
  5455. this.ui.titleTxt.text = data.title;
  5456. let arr1 = data.award[0].split('-');
  5457. let arr2 = data.award[1].split('-');
  5458. let num1 = parseInt(arr1[1]);
  5459. let num2 = parseInt(arr2[1]);
  5460. this.ui.numTxt1.text = num1 + "";
  5461. this.ui.numTxt2.text = num2 + "";
  5462. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5463. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5464. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5465. this.ui.numTxt1.visible = false;
  5466. }
  5467. else {
  5468. this.ui.numTxt1.visible = true;
  5469. }
  5470. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5471. this.ui.numTxt2.visible = false;
  5472. }
  5473. else {
  5474. this.ui.numTxt2.visible = true;
  5475. }
  5476. if (index < curDayIndex) {
  5477. this.ui.c1.selectedIndex = 1;
  5478. }
  5479. else if (index == curDayIndex) {
  5480. if (sameDay) {
  5481. this.ui.c1.selectedIndex = 2;
  5482. }
  5483. else {
  5484. this.ui.c1.selectedIndex = 2;
  5485. }
  5486. }
  5487. else {
  5488. this.ui.c1.selectedIndex = 0;
  5489. }
  5490. }
  5491. }
  5492. class SignNormal {
  5493. constructor(ui) {
  5494. this.ui = ui;
  5495. }
  5496. updateSelf(index, sameDay, curDayIndex) {
  5497. let data = cfgTable.signData[index + 1];
  5498. this.ui.titleTxt.text = data.title;
  5499. let arr = data.award[0].split('-');
  5500. let type = parseInt(arr[0]);
  5501. let num = parseInt(arr[1]);
  5502. this.ui.numTxt.text = num + "";
  5503. if (type > 2) {
  5504. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5505. this.ui.myIcon.rotation = 0;
  5506. }
  5507. else {
  5508. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5509. this.ui.myIcon.rotation = 0;
  5510. }
  5511. if (xGame.common.signAwardContainsRod(data.award)) {
  5512. this.ui.numTxt.visible = false;
  5513. }
  5514. else {
  5515. this.ui.numTxt.visible = true;
  5516. }
  5517. if (index < curDayIndex) {
  5518. this.ui.c1.selectedIndex = 1;
  5519. }
  5520. else if (index == curDayIndex) {
  5521. if (sameDay) {
  5522. this.ui.c1.selectedIndex = 2;
  5523. }
  5524. else {
  5525. this.ui.c1.selectedIndex = 2;
  5526. }
  5527. }
  5528. else {
  5529. this.ui.c1.selectedIndex = 0;
  5530. }
  5531. }
  5532. }
  5533. class UISign extends UIBase {
  5534. constructor() {
  5535. super();
  5536. this.curDayIndex = 0;
  5537. this.starX = 0;
  5538. }
  5539. onConstructor() {
  5540. this.ui = ui_UISign.createInstance();
  5541. this.contentPane = this.ui;
  5542. this.isEject = false;
  5543. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5544. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5545. this.initSignItem();
  5546. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5547. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5548. }
  5549. show() {
  5550. super.show();
  5551. this.ui.t0.play();
  5552. this.playSecretaryIdle();
  5553. this.updateSign();
  5554. }
  5555. initSignItem() {
  5556. this.signArr = [];
  5557. for (let index = 0; index < 6; index++) {
  5558. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5559. this.signArr.push(temp);
  5560. }
  5561. this.signMax = new SignMax(this.ui.myNode.day7);
  5562. if (Moyu.isKs)
  5563. this.ui.closeNode.closeBtn.x += 100;
  5564. }
  5565. updateSign() {
  5566. let sameDay = xGame.common.judgeSameDay();
  5567. let max = 7;
  5568. this.curDayIndex = DataMgr.getSignData();
  5569. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5570. this.curDayIndex = 0;
  5571. if (!sameDay) {
  5572. this.ui.normalBtn.visible = true;
  5573. this.ui.tipsNode.visible = false;
  5574. this.ui.againBtn.visible = false;
  5575. }
  5576. else {
  5577. this.ui.normalBtn.visible = false;
  5578. let again = DataMgr.getExtraSign();
  5579. let isCurrency = false;
  5580. let index = this.curDayIndex;
  5581. if (index == 0)
  5582. index = 7;
  5583. let award = cfgTable.signData[index].award;
  5584. let num = award[0].split("-")[0];
  5585. if (num == "1" || num == "2")
  5586. isCurrency = true;
  5587. let showAgain = again == 0 && isCurrency;
  5588. this.ui.againBtn.visible = showAgain;
  5589. this.ui.tipsNode.visible = !showAgain;
  5590. }
  5591. for (let index = 0; index < this.signArr.length; index++) {
  5592. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5593. }
  5594. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5595. }
  5596. playSecretaryIdle() {
  5597. let parent = this.ui.secretary.displayObject;
  5598. parent.destroyChildren();
  5599. let xx = this.ui.secretary.width / 2;
  5600. let yy = this.ui.secretary.height;
  5601. let scale = xGame.common.getSecretaryScale();
  5602. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5603. xGame.common.secretary.play(data, 1, true, parent);
  5604. }
  5605. closeSelf() {
  5606. this.hide();
  5607. }
  5608. normalGetAward() {
  5609. let sameDay = xGame.common.judgeSameDay();
  5610. if (!sameDay) {
  5611. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5612. let temp;
  5613. let type;
  5614. let num;
  5615. let arr = [];
  5616. for (let index = 0; index < award.length; index++) {
  5617. temp = award[index].split("-");
  5618. type = parseInt(temp[0]);
  5619. num = parseInt(temp[1]);
  5620. let awardType = new AwardType();
  5621. awardType.num = num;
  5622. awardType.type = type;
  5623. arr.push(awardType);
  5624. }
  5625. xGame.common.getAward(arr, (watchVideo) => {
  5626. this.curDayIndex++;
  5627. if (this.curDayIndex > 7)
  5628. this.curDayIndex = 0;
  5629. DataMgr.setSignData(this.curDayIndex);
  5630. DataMgr.setSignTime(new Date().getTime());
  5631. if (watchVideo) {
  5632. DataMgr.setExtraSign(1);
  5633. Moyu.sendDataEvent("signIn1");
  5634. }
  5635. this.updateSign();
  5636. });
  5637. }
  5638. }
  5639. againGetAward() {
  5640. Moyu.sendDataEvent("signIn2");
  5641. Moyu.showVideoAd(() => {
  5642. let index = this.curDayIndex;
  5643. if (index == 0)
  5644. index = 7;
  5645. let award = cfgTable.signData[index].award;
  5646. let temp;
  5647. let type;
  5648. let num;
  5649. for (let index = 0; index < award.length; index++) {
  5650. temp = award[index].split("-");
  5651. type = parseInt(temp[0]);
  5652. num = parseInt(temp[1]) * 3;
  5653. xGame.common.playObjFlyAnim(num, type);
  5654. }
  5655. DataMgr.setExtraSign(1);
  5656. this.updateSign();
  5657. }, EAdType.againSign);
  5658. }
  5659. }
  5660. UISign.uiName = "UISign";
  5661. class ui_UISkill extends fgui.GComponent {
  5662. static createInstance() {
  5663. return (fgui.UIPackage.createObject("game", "UISkill"));
  5664. }
  5665. onConstruct() {
  5666. this.n48 = (this.getChild("n48"));
  5667. this.n0 = (this.getChild("n0"));
  5668. this.secretary = (this.getChild("secretary"));
  5669. this.talkNode = (this.getChild("talkNode"));
  5670. this.closeNode = (this.getChild("closeNode"));
  5671. this.moneyNode = (this.getChild("moneyNode"));
  5672. this.skillNode = (this.getChild("skillNode"));
  5673. this.guideNode = (this.getChild("guideNode"));
  5674. }
  5675. }
  5676. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5677. class SkillDisplay {
  5678. constructor(ui, data, uiIndex) {
  5679. this.starX = 0;
  5680. this.starY = 0;
  5681. this.index = 0;
  5682. this.ui = ui;
  5683. this.data = data;
  5684. this.index = uiIndex;
  5685. this.initSelf();
  5686. }
  5687. initSelf() {
  5688. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5689. this.ui.nameTxt.text = this.data.name;
  5690. this.ui.describeTxt.text = this.data.describe;
  5691. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5692. this.ui.startBtn.onClick(this, this.startGame);
  5693. this.updateSelf();
  5694. }
  5695. updateSelf() {
  5696. this.checkTry();
  5697. let level = DataMgr.getBigSkillByIndex(this.index);
  5698. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5699. }
  5700. checkTry() {
  5701. let index = this.index;
  5702. let level = DataMgr.getBigSkillByIndex(index);
  5703. if (level == null) {
  5704. DataMgr.setBigSkill(index, 1, false);
  5705. level = 1;
  5706. }
  5707. this.ui.levelTxt.text = "LV." + level;
  5708. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5709. this.ui.tryNode.visible = true;
  5710. else
  5711. this.ui.tryNode.visible = false;
  5712. }
  5713. clickAddLevel() {
  5714. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5715. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5716. Moyu.showVideoAd(() => {
  5717. DataMgr.setBigSkill(this.data.index, 1);
  5718. this.updateSelf();
  5719. xGame.common.upSkillLevel = true;
  5720. }, EAdType.upSkill);
  5721. }
  5722. startGame() {
  5723. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5724. let needCoin = xGame.common.bigMoveNeedCoin;
  5725. xGame.common.passAwardCoin = 2000;
  5726. let guide = DataMgr.getSkillGuide();
  5727. xGame.common.temSelfLevel = 0;
  5728. if (guide == 0) {
  5729. needCoin = 0;
  5730. xGame.common.temSelfLevel = 100;
  5731. }
  5732. if (DataMgr.coinEnough(needCoin)) {
  5733. DataMgr.setCoin(-needCoin);
  5734. xGame.common.curPlayerSkillType = this.index;
  5735. if (guide == 0)
  5736. xGame.common.curPlayerSkillType = 0;
  5737. xGame.uiMgr.Show(UIGame);
  5738. xGame.uiMgr.Hide(UIMain);
  5739. xGame.uiMgr.Show(UIMatching, () => {
  5740. xGame.common.gameUI.ui.alpha = 1;
  5741. xGame.common.gameUI.startGame();
  5742. xGame.uiMgr.Hide(UISkill);
  5743. });
  5744. }
  5745. else {
  5746. xGame.uiMgr.Show(UIAddProp, 0);
  5747. Moyu.sendDataEvent("AddCoinVideo");
  5748. }
  5749. }
  5750. }
  5751. class UISkill extends UIBase {
  5752. constructor() {
  5753. super();
  5754. this.skillData = [];
  5755. }
  5756. onConstructor() {
  5757. this.ui = ui_UISkill.createInstance();
  5758. this.contentPane = this.ui;
  5759. this.isEject = false;
  5760. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5761. this.initSkillData();
  5762. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5763. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5764. this.displayList = [];
  5765. this.ui.skillNode.skillList.numItems = 4;
  5766. this.addUIClick(this.ui, this.interuptSecretary);
  5767. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5768. this.ui.talkNode.visible = false;
  5769. if (Moyu.isKs)
  5770. this.ui.closeNode.closeBtn.x += 100;
  5771. }
  5772. show() {
  5773. super.show();
  5774. this.playSecretaryIdle();
  5775. this.moneyNode.ui.c1.selectedIndex = 1;
  5776. Laya.timer.clearAll(this);
  5777. xGame.soundMgr.playSound("s_start");
  5778. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5779. let guide = DataMgr.getSkillGuide();
  5780. this.ui.guideNode.visible = guide == 0;
  5781. let item = this.getSkillItemByUIIndex(0);
  5782. if (guide == 0) {
  5783. item.ui.c1.selectedIndex = 1;
  5784. }
  5785. else {
  5786. item.ui.c1.selectedIndex = 0;
  5787. }
  5788. this.ui.guideNode.guideBtn.visible = guide == 0;
  5789. for (let index = 0; index < this.displayList.length; index++) {
  5790. this.displayList[index].checkTry();
  5791. }
  5792. }
  5793. getSkillItemByUIIndex(cur) {
  5794. for (let index = 0; index < this.displayList.length; index++) {
  5795. if (this.displayList[index].index == cur) {
  5796. return this.displayList[index];
  5797. }
  5798. }
  5799. }
  5800. enterGuideLevel() {
  5801. let item = this.getSkillItemByUIIndex(0);
  5802. item.startGame();
  5803. if (DataMgr.getNewUser())
  5804. Moyu.sendDataEvent("gameStart1");
  5805. }
  5806. initSkillData() {
  5807. this.skillData = [];
  5808. let nameList = xGame.common.skillNameList;
  5809. let iconList = xGame.common.skillIconList;
  5810. let describeList = [
  5811. "跳杆击球后,球高高跃起,砸在桌面上,直接打进额外1颗球",
  5812. "普通击球后,球杆向随机方向—扫,将杆子范围内1颗可击打球扫入球袋",
  5813. "我方击球后,在场地上将随机1颗球冻结,敌方无法击打冰冻球,且其他球碰到冰冻球会弹开",
  5814. "击球后在球桌上斩出一刀,并击飞斩中的球。(球不会飞出球桌)"
  5815. ];
  5816. let data;
  5817. for (let index = 0; index < nameList.length; index++) {
  5818. data = {};
  5819. data.name = nameList[index];
  5820. data.icon = iconList[index];
  5821. data.describe = describeList[index];
  5822. data.index = index;
  5823. this.skillData.push(data);
  5824. }
  5825. }
  5826. updateSkillItem(index, target) {
  5827. if (this.displayList[index] == null) {
  5828. let uiIndex;
  5829. switch (index) {
  5830. case 0:
  5831. uiIndex = 1;
  5832. break;
  5833. case 1:
  5834. uiIndex = 0;
  5835. break;
  5836. case 2:
  5837. uiIndex = 2;
  5838. break;
  5839. case 3:
  5840. uiIndex = 3;
  5841. break;
  5842. default:
  5843. break;
  5844. }
  5845. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5846. this.displayList.push(temp);
  5847. }
  5848. }
  5849. playSecretaryIdle() {
  5850. let parent = this.ui.secretary.displayObject;
  5851. parent.destroyChildren();
  5852. let xx = this.ui.secretary.width / 2;
  5853. let yy = this.ui.secretary.height;
  5854. let scale = xGame.common.getSecretaryScale();
  5855. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5856. xGame.common.secretary.play(data, 1, true, parent);
  5857. }
  5858. returnUIMain() {
  5859. this.hide();
  5860. xGame.common.stopGirlPop(this.ui.talkNode);
  5861. xGame.uiMgr.Show(UIMain);
  5862. }
  5863. interuptSecretary() {
  5864. Laya.timer.clearAll(this);
  5865. this.playSecretaryRandomSound();
  5866. }
  5867. playSecretaryRandomSound() {
  5868. if (this.isHide)
  5869. return;
  5870. let time = xGame.common.randomNum(45000, 60000);
  5871. Laya.timer.once(time, this, () => {
  5872. if (this.isHide)
  5873. return;
  5874. let index = xGame.common.randomNum(4, 7);
  5875. xGame.soundMgr.playSound("s_main0" + index);
  5876. let words = 1;
  5877. switch (index) {
  5878. case 4:
  5879. words = 5;
  5880. break;
  5881. case 5:
  5882. words = 3;
  5883. break;
  5884. case 6:
  5885. words = 6;
  5886. break;
  5887. case 7:
  5888. words = 7;
  5889. break;
  5890. default:
  5891. break;
  5892. }
  5893. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5894. this.playSecretaryRandomSound();
  5895. });
  5896. }
  5897. }
  5898. UISkill.uiName = "UISkill";
  5899. class ui_UIMsg extends fgui.GComponent {
  5900. static createInstance() {
  5901. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5902. }
  5903. onConstruct() {
  5904. this.tipsNode = (this.getChild("tipsNode"));
  5905. }
  5906. }
  5907. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5908. class UIMsg extends UIBase {
  5909. constructor() {
  5910. super();
  5911. }
  5912. onConstructor() {
  5913. this.ui = ui_UIMsg.createInstance();
  5914. this.contentPane = this.ui;
  5915. this.isEject = false;
  5916. this.isMuti = true;
  5917. }
  5918. show(msg, callback) {
  5919. super.show();
  5920. this.ui.tipsNode.msgTxt.text = msg;
  5921. this.ui.alpha = 1;
  5922. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5923. this.hide();
  5924. callback && callback();
  5925. }), 1000);
  5926. }
  5927. }
  5928. UIMsg.uiName = "UIMsg";
  5929. class ui_UIModeSelection extends fgui.GComponent {
  5930. static createInstance() {
  5931. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5932. }
  5933. onConstruct() {
  5934. this.n19 = (this.getChild("n19"));
  5935. this.closeBtn = (this.getChild("closeBtn"));
  5936. this.myNode = (this.getChild("myNode"));
  5937. this.t0 = this.getTransition("t0");
  5938. }
  5939. }
  5940. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5941. class UIModeSelection extends UIBase {
  5942. constructor() {
  5943. super();
  5944. }
  5945. onConstructor() {
  5946. this.ui = ui_UIModeSelection.createInstance();
  5947. this.contentPane = this.ui;
  5948. this.isEject = false;
  5949. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5950. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5951. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5952. this.addUIClick(this.ui.closeBtn, this.hide);
  5953. this.peopleArr = [650, 6900, 3800];
  5954. this.peopleOffest = [50, 500, 200];
  5955. this.updateSelf();
  5956. }
  5957. show(callback) {
  5958. super.show();
  5959. this.ui.t0.play();
  5960. this.callback = callback;
  5961. }
  5962. updateSelf() {
  5963. let cfg = cfgTable.modeselectData;
  5964. for (let index = 1; index <= 3; index++) {
  5965. let node = this.ui.myNode["type" + index];
  5966. node.need.text = cfg[index].need;
  5967. node.tipsTxt.text = `最低${cfg[index].need}可入场`;
  5968. node.peopleTxt.text = this.getRandPeople(index - 1);
  5969. }
  5970. }
  5971. enterGame(type) {
  5972. xGame.common.classicRoomType = type;
  5973. let cfg = cfgTable.modeselectData[type];
  5974. let need = cfg.need;
  5975. xGame.common.passAwardCoin = cfg.award;
  5976. if (DataMgr.coinEnough(need)) {
  5977. DataMgr.setCoin(-need);
  5978. this.ui.myNode["type" + type].t0.play();
  5979. Laya.timer.once(200, this, () => {
  5980. this.callback && this.callback();
  5981. });
  5982. }
  5983. else {
  5984. Moyu.sendDataEvent("AddCoinVideo");
  5985. xGame.uiMgr.Show(UIAddProp, 0);
  5986. }
  5987. }
  5988. getRandPeople(index) {
  5989. let rand = this.peopleOffest[index];
  5990. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5991. }
  5992. }
  5993. UIModeSelection.uiName = "UIModeSelection";
  5994. class UIMain extends UIBase {
  5995. constructor() {
  5996. super();
  5997. this.firstEnter = true;
  5998. }
  5999. onConstructor() {
  6000. this.ui = ui_UIMain.createInstance();
  6001. this.contentPane = this.ui;
  6002. this.isEject = false;
  6003. this.addEvent();
  6004. this.addClickSpine();
  6005. this.settingNode = new SettingNode(this.ui.settingNode);
  6006. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6007. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6008. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6009. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6010. let curUse = DataMgr.getCurSecretary();
  6011. this.changeSecretary(curUse);
  6012. this.ui.talkNode.visible = false;
  6013. let guide = DataMgr.getSkillGuide();
  6014. if (xGame.common.isNewDay && guide == 1) {
  6015. xGame.common.isNewDay = false;
  6016. xGame.soundMgr.playSound("s_main01");
  6017. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6018. console.log("播放小秘书每天语音");
  6019. }
  6020. this.onGetUserInfo();
  6021. this.ui.n83.visible = false;
  6022. Moyu.setShareInfo("万宁台球", ["台球", "万宁", "桌球"], '2300002254');
  6023. }
  6024. changeSecretary(curUse) {
  6025. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6026. xGame.common.secretary && xGame.common.secretary.dispose();
  6027. this.addSecretarySpine(name);
  6028. }
  6029. addSecretarySpine(name) {
  6030. let spine = new SpineMgr(name, () => {
  6031. this.playSecretaryIdle();
  6032. });
  6033. xGame.common.secretary = spine;
  6034. }
  6035. addClickSpine() {
  6036. let clickSpine = new SpineMgr("dianji", () => {
  6037. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6038. let parent = Laya.stage;
  6039. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6040. clickSpine.play(data, 0, false, parent, (spine) => {
  6041. spine.destroy(true);
  6042. });
  6043. });
  6044. });
  6045. }
  6046. addEvent() {
  6047. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6048. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6049. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6050. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6051. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6052. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6053. this.addUIClick(this.ui, this.interuptSecretary);
  6054. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6055. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6056. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6057. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6058. this.addUIClick(this.ui.signBtn, this.openSignView);
  6059. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6060. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6061. }
  6062. show(showFailWords) {
  6063. super.show();
  6064. this.moneyNode.ui.c1.selectedIndex = 1;
  6065. this.playSecretaryIdle();
  6066. xGame.soundMgr.playMusic("caromhall01");
  6067. Laya.timer.clearAll(this);
  6068. this.playSecretaryRandomSound();
  6069. if (showFailWords) {
  6070. setTimeout(() => {
  6071. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6072. let words = -1;
  6073. if (str == "s_main02") {
  6074. words = 2;
  6075. }
  6076. else {
  6077. words = 3;
  6078. }
  6079. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6080. xGame.soundMgr.playSound(str);
  6081. }, 300);
  6082. }
  6083. this.showGuide();
  6084. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6085. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6086. let guide = DataMgr.getSkillGuide();
  6087. if (guide == 1) {
  6088. let randTime = xGame.common.randomNum(300, 800);
  6089. if (this.firstEnter) {
  6090. this.firstEnter = false;
  6091. randTime += 900;
  6092. }
  6093. Laya.timer.once(randTime, this, () => {
  6094. xGame.common.autoPopUIView();
  6095. });
  6096. }
  6097. }
  6098. checkActive(show) {
  6099. }
  6100. showGuide() {
  6101. let guide = DataMgr.getSkillGuide();
  6102. this.ui.guideBtn.visible = guide == 0;
  6103. this.ui.enterGuide.visible = false;
  6104. this.ui.secretaryGuide.visible = guide == 0;
  6105. if (guide == 0) {
  6106. xGame.soundMgr.playSound("s_guide");
  6107. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6108. }
  6109. }
  6110. ensureSecretary() {
  6111. this.ui.secretaryGuide.visible = false;
  6112. this.ui.enterGuide.visible = true;
  6113. this.ui.wordsNode.t0.play();
  6114. if (DataMgr.getNewUser())
  6115. Moyu.sendDataEvent("gameReady");
  6116. }
  6117. playSecretaryIdle() {
  6118. let parent = this.ui.secretary.displayObject;
  6119. parent.destroyChildren();
  6120. let xx = this.ui.secretary.width / 2;
  6121. let yy = this.ui.secretary.height;
  6122. let scale = xGame.common.getSecretaryScale();
  6123. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6124. xGame.common.secretary.play(data, 1, true, parent);
  6125. }
  6126. startGame(type) {
  6127. xGame.common.gameMode = type;
  6128. Moyu.sendDataEvent("PlayGame", { type: type });
  6129. switch (xGame.common.gameMode) {
  6130. case GameMode.classic:
  6131. let challengeTimes = DataMgr.getChallengeTimes();
  6132. if (challengeTimes == 0) {
  6133. xGame.uiMgr.Show(UIInvitation);
  6134. }
  6135. else {
  6136. this.beginGame();
  6137. }
  6138. break;
  6139. case GameMode.bigMove:
  6140. this.beginGame();
  6141. if (DataMgr.getNewUser())
  6142. Moyu.sendDataEvent("gameStart0");
  6143. break;
  6144. default:
  6145. break;
  6146. }
  6147. }
  6148. beginGame(isNice = false) {
  6149. if (xGame.common.gameMode == GameMode.classic) {
  6150. if (isNice) {
  6151. this.enterClassic();
  6152. }
  6153. else {
  6154. xGame.uiMgr.Show(UIModeSelection, () => {
  6155. this.enterClassic();
  6156. });
  6157. }
  6158. }
  6159. else if (xGame.common.gameMode == GameMode.bigMove) {
  6160. this.ui.enterGuide.visible = false;
  6161. xGame.uiMgr.Show(UISkill);
  6162. }
  6163. }
  6164. enterClassic() {
  6165. xGame.uiMgr.Show(UIGame);
  6166. xGame.uiMgr.Show(UIMatching, () => {
  6167. if (!this.isHide)
  6168. this.hide();
  6169. xGame.common.gameUI.ui.alpha = 1;
  6170. xGame.common.gameUI.startGame();
  6171. xGame.uiMgr.Hide(UIGameEnd);
  6172. });
  6173. }
  6174. startGlobal() {
  6175. xGame.uiMgr.Show(UIMsg, "敬请期待~");
  6176. }
  6177. startWeekly() {
  6178. xGame.uiMgr.Show(UIMsg, "敬请期待~");
  6179. }
  6180. startPlaceBall() {
  6181. xGame.uiMgr.Show(UILevelDisplay);
  6182. }
  6183. hide() {
  6184. super.hide();
  6185. xGame.common.stopGirlPop(this.ui.talkNode);
  6186. }
  6187. onGetUserInfo(force = false) {
  6188. if (Moyu.isWx) {
  6189. let info = Moyu.getSystemInfo();
  6190. if (info)
  6191. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6192. }
  6193. else {
  6194. Moyu.initUser(this, this.freshUser, force);
  6195. }
  6196. if (!Moyu.hasUserInfo) {
  6197. let user = Moyu.getUserInfo();
  6198. user.headIcon = 'res/ty_touxiang.png';
  6199. }
  6200. this.freshUser();
  6201. }
  6202. freshUser() {
  6203. let user = Moyu.getUserInfo();
  6204. if (!user.isAuth) {
  6205. user.headIcon = 'res/ty_touxiang.png';
  6206. }
  6207. else
  6208. DataMgr.upRankData();
  6209. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6210. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6211. }
  6212. interuptSecretary() {
  6213. Laya.timer.clearAll(this);
  6214. this.playSecretaryRandomSound();
  6215. }
  6216. playSecretaryRandomSound() {
  6217. if (this.isHide)
  6218. return;
  6219. let time = xGame.common.randomNum(45000, 60000);
  6220. Laya.timer.once(time, this, () => {
  6221. if (this.isHide)
  6222. return;
  6223. let index = xGame.common.randomNum(4, 7);
  6224. xGame.soundMgr.playSound("s_main0" + index);
  6225. let words = 1;
  6226. switch (index) {
  6227. case 4:
  6228. words = 5;
  6229. break;
  6230. case 5:
  6231. words = 3;
  6232. break;
  6233. case 6:
  6234. words = 6;
  6235. break;
  6236. case 7:
  6237. words = 7;
  6238. break;
  6239. default:
  6240. break;
  6241. }
  6242. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6243. this.playSecretaryRandomSound();
  6244. });
  6245. }
  6246. openSecretaryView() {
  6247. xGame.uiMgr.Show(UISecretary);
  6248. Moyu.sendDataEvent("secretary");
  6249. }
  6250. openShopView() {
  6251. xGame.uiMgr.Show(UIShop);
  6252. }
  6253. openSignView() {
  6254. xGame.uiMgr.Show(UISign);
  6255. }
  6256. openDrawView() {
  6257. xGame.uiMgr.Show(UIDraw);
  6258. }
  6259. openRanking() {
  6260. xGame.uiMgr.Show(UIRanking);
  6261. Moyu.sendDataEvent("rankingList");
  6262. }
  6263. }
  6264. UIMain.uiName = "UIMain";
  6265. class UIGameEnd extends UIBase {
  6266. constructor() {
  6267. super();
  6268. this.success = false;
  6269. this.awardCoinNum = 1000;
  6270. this.awardDiamondNum = 10;
  6271. }
  6272. onConstructor() {
  6273. this.ui = ui_UIGameEnd.createInstance();
  6274. this.contentPane = this.ui;
  6275. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6276. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6277. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6278. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6279. this.ui.talkNode.visible = false;
  6280. if (Moyu.isKs)
  6281. this.ui.closeNode.closeBtn.x += 100;
  6282. }
  6283. updateType() {
  6284. switch (xGame.common.gameMode) {
  6285. case GameMode.classic:
  6286. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6287. this.ui.coinNode.visible = this.success;
  6288. if (!this.success) {
  6289. Laya.timer.once(500, this, () => {
  6290. xGame.uiMgr.Show(UIAddCoin);
  6291. });
  6292. }
  6293. this.ui.isGetAward.visible = false;
  6294. this.ui.leftBtn.c1.selectedIndex = 3;
  6295. this.ui.rightBtn.c1.selectedIndex = 0;
  6296. this.moneyNode.ui.c1.selectedIndex = 1;
  6297. break;
  6298. case GameMode.bigMove:
  6299. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6300. this.ui.coinNode.visible = this.success;
  6301. if (xGame.common.gameMode == GameMode.bigMove) {
  6302. if (this.success) {
  6303. DataMgr.setSkillSuccessTimes(1, true);
  6304. DataMgr.setSkillAccTimes(1);
  6305. }
  6306. else {
  6307. DataMgr.setSkillSuccessTimes(0, false);
  6308. }
  6309. }
  6310. if (!this.success) {
  6311. Laya.timer.once(500, this, () => {
  6312. xGame.uiMgr.Show(UIAddCoin);
  6313. });
  6314. }
  6315. this.ui.isGetAward.visible = false;
  6316. this.ui.leftBtn.c1.selectedIndex = 3;
  6317. this.ui.rightBtn.c1.selectedIndex = 0;
  6318. this.moneyNode.ui.c1.selectedIndex = 1;
  6319. break;
  6320. case GameMode.placeBall:
  6321. this.ui.coinNode.visible = false;
  6322. if (this.success) {
  6323. if (xGame.common.placeBallStarNum == 3) {
  6324. this.ui.c1.selectedIndex = 2;
  6325. }
  6326. else {
  6327. this.ui.c1.selectedIndex = 3;
  6328. }
  6329. }
  6330. else {
  6331. this.ui.c1.selectedIndex = 4;
  6332. }
  6333. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6334. if (cfg.type == PlaceBallType.challenge) {
  6335. this.ui.c1.selectedIndex = 2;
  6336. }
  6337. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `打进场上所有球` : `打进${cfg.ball}颗球`;
  6338. this.updatePlaceBallBtn();
  6339. this.updatePlaceBallStarNum();
  6340. this.updatePlaceBallAwardState();
  6341. this.moneyNode.ui.c1.selectedIndex = 2;
  6342. this.moneyNode.checkPowerTime();
  6343. this.moneyNode.powerChange();
  6344. DataMgr.upRankData();
  6345. break;
  6346. default:
  6347. break;
  6348. }
  6349. }
  6350. updatePlaceBallBtn() {
  6351. this.ui.leftBtn.c1.selectedIndex = 5;
  6352. if (this.success) {
  6353. this.ui.rightBtn.c1.selectedIndex = 14;
  6354. }
  6355. else {
  6356. if (xGame.common.placeBallStarNum == 3) {
  6357. this.ui.rightBtn.c1.selectedIndex = 14;
  6358. }
  6359. else {
  6360. this.ui.rightBtn.c1.selectedIndex = 1;
  6361. }
  6362. }
  6363. }
  6364. updatePlaceBallStarNum() {
  6365. let starNum = xGame.common.placeBallStarNum;
  6366. if (starNum == 0)
  6367. this.ui.starNumNode.c1.selectedIndex = 3;
  6368. else {
  6369. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6370. }
  6371. }
  6372. updatePlaceBallAwardState() {
  6373. let level = xGame.common.placeBallCurLevel;
  6374. let starNum = xGame.common.placeBallStarNum;
  6375. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6376. let data = cfgTable.placeballData[level].award;
  6377. let cfg = cfgTable.placeballData[level];
  6378. this.awardDiamondNum = data[1];
  6379. this.awardCoinNum = data[0];
  6380. if (cfg.type == PlaceBallType.challenge) {
  6381. this.awardDiamondNum = 0;
  6382. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6383. }
  6384. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6385. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6386. if (cfg.type == PlaceBallType.challenge) {
  6387. this.ui.awardNode.coinNode.visible = true;
  6388. }
  6389. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6390. this.ui.awardNode.diamondNode.x = 265;
  6391. this.ui.awardNode.coinNode.x = 354;
  6392. }
  6393. else {
  6394. this.ui.awardNode.diamondNode.x = 291;
  6395. this.ui.awardNode.coinNode.x = 291;
  6396. }
  6397. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6398. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6399. if (this.awardCoinNum == 0) {
  6400. this.ui.awardNode.coinNode.numTxt.text = "";
  6401. }
  6402. if (getAward) {
  6403. this.ui.isGetAward.visible = true;
  6404. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6405. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6406. }
  6407. else {
  6408. this.ui.isGetAward.visible = false;
  6409. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6410. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6411. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6412. }
  6413. else {
  6414. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6415. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6416. }
  6417. }
  6418. }
  6419. show(success) {
  6420. super.show();
  6421. xGame.eventMgr.event(RESET_GAME);
  6422. this.success = success;
  6423. Laya.timer.clearAll(this);
  6424. this.playSecretaryAni();
  6425. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6426. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6427. offsetTime = Math.floor(offsetTime / 1000);
  6428. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6429. this.updateType();
  6430. Laya.timer.once(200, this, () => {
  6431. this.addAward(() => {
  6432. this.updateType();
  6433. Laya.timer.once(500, this, () => {
  6434. this.showChallengeLevel();
  6435. });
  6436. });
  6437. });
  6438. if (this.success) {
  6439. xGame.soundMgr.playSound('slots_roll01');
  6440. xGame.soundMgr.playSound("s_win");
  6441. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6442. }
  6443. else {
  6444. xGame.soundMgr.playSound('matchwin01');
  6445. xGame.soundMgr.playSound("s_lose");
  6446. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6447. }
  6448. if (!Moyu.isLegal)
  6449. PlatMgr.showBanner(true);
  6450. let challengeNum = DataMgr.getChallengeTimes();
  6451. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6452. DataMgr.setChallengeTimes(1);
  6453. }
  6454. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6455. DataMgr.setClassicTimes();
  6456. }
  6457. }
  6458. showChallengeLevel() {
  6459. if (DataMgr.getChallengeTimes() != 0)
  6460. return;
  6461. let skill = DataMgr.getSkillAccTimes();
  6462. let put = DataMgr.getPlaceBallLevelList().length;
  6463. if (skill >= 3 || put >= 5) {
  6464. xGame.uiMgr.Show(UIInvitation);
  6465. this.hide();
  6466. }
  6467. }
  6468. addAward(callback) {
  6469. if (!this.success) {
  6470. callback && callback();
  6471. return;
  6472. }
  6473. switch (xGame.common.gameMode) {
  6474. case GameMode.classic:
  6475. this.awardCoinNum = xGame.common.passAwardCoin;
  6476. this.awardDiamondNum = 0;
  6477. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6478. break;
  6479. case GameMode.bigMove:
  6480. this.awardCoinNum = xGame.common.passAwardCoin;
  6481. this.awardDiamondNum = 0;
  6482. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6483. callback && callback();
  6484. break;
  6485. case GameMode.placeBall:
  6486. let level = xGame.common.placeBallCurLevel;
  6487. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6488. if (xGame.common.placeBallStarNum != 3) {
  6489. callback && callback();
  6490. return;
  6491. }
  6492. else {
  6493. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6494. if (getAward) {
  6495. callback && callback();
  6496. return;
  6497. }
  6498. }
  6499. let cfg = cfgTable.placeballData[level];
  6500. let data = cfgTable.placeballData[level].award;
  6501. this.awardCoinNum = data[0];
  6502. this.awardDiamondNum = data[1];
  6503. if (cfg.type == PlaceBallType.challenge) {
  6504. this.awardDiamondNum = 0;
  6505. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6506. }
  6507. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6508. let diamondAward;
  6509. if (this.awardDiamondNum > 0) {
  6510. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6511. xGame.common.getAward([diamondAward, coinAward], callback);
  6512. }
  6513. else {
  6514. xGame.common.getAward([coinAward], callback);
  6515. }
  6516. if (cfg.type == PlaceBallType.normal) {
  6517. DataMgr.setPlaceBallAward(level);
  6518. }
  6519. break;
  6520. default:
  6521. break;
  6522. }
  6523. }
  6524. playSecretaryAni() {
  6525. let parent = this.ui.secretary.displayObject;
  6526. parent.destroyChildren();
  6527. let xx = this.ui.secretary.width / 2;
  6528. let yy = this.ui.secretary.height;
  6529. let scale = xGame.common.getSecretaryScale();
  6530. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6531. if (this.success) {
  6532. let rand = Math.random() <= 0.5 ? 2 : 3;
  6533. xGame.common.secretary.play(data, rand, false, parent, () => {
  6534. xGame.common.secretary.play(data, 1, true, parent);
  6535. });
  6536. }
  6537. else {
  6538. xGame.common.secretary.play(data, 0, true, parent);
  6539. }
  6540. }
  6541. restartGame() {
  6542. switch (xGame.common.gameMode) {
  6543. case GameMode.classic:
  6544. xGame.eventMgr.event(RESTART_GAME);
  6545. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6546. break;
  6547. case GameMode.bigMove:
  6548. this.hide();
  6549. xGame.eventMgr.event(RESTART_GAME);
  6550. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6551. break;
  6552. default:
  6553. break;
  6554. }
  6555. }
  6556. hide() {
  6557. super.hide();
  6558. xGame.common.stopGirlPop(this.ui.talkNode);
  6559. PlatMgr.showBanner(false);
  6560. }
  6561. returnHome() {
  6562. this.hide();
  6563. let showFailWords = !this.success;
  6564. xGame.uiMgr.Show(UIMain, showFailWords);
  6565. }
  6566. clickLeftBtn() {
  6567. switch (xGame.common.gameMode) {
  6568. case GameMode.classic:
  6569. case GameMode.bigMove:
  6570. this.returnHome();
  6571. break;
  6572. case GameMode.placeBall:
  6573. let level = xGame.common.placeBallCurLevel;
  6574. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6575. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6576. break;
  6577. default:
  6578. break;
  6579. }
  6580. }
  6581. powerStartPlaceBallLevel(level, btn) {
  6582. if (DataMgr.powerEnough()) {
  6583. btn.touchable = false;
  6584. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6585. btn.touchable = true;
  6586. DataMgr.setPower(-1);
  6587. xGame.eventMgr.event(POWER_TIME);
  6588. this.startPlaceBallLevel(level);
  6589. }));
  6590. }
  6591. else {
  6592. xGame.uiMgr.Show(UIPower, 0);
  6593. }
  6594. }
  6595. clickRightBtn() {
  6596. switch (xGame.common.gameMode) {
  6597. case GameMode.classic:
  6598. case GameMode.bigMove:
  6599. this.restartGame();
  6600. break;
  6601. case GameMode.placeBall:
  6602. let level = xGame.common.placeBallCurLevel;
  6603. let data = DataMgr.getPlaceBallLevel(level);
  6604. let curPss = data.play && !data.isCur;
  6605. if (curPss) {
  6606. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6607. }
  6608. else {
  6609. Moyu.sendDataEvent("placeBallNextLevel");
  6610. Moyu.showVideoAd(() => {
  6611. DataMgr.setPlaceBallLevel(level, 1);
  6612. this.startPlaceBallLevel(level + 1);
  6613. }, xGame.define.EAdType.placeBallNextLevel);
  6614. }
  6615. break;
  6616. default:
  6617. break;
  6618. }
  6619. }
  6620. startPlaceBallLevel(level) {
  6621. xGame.common.gameMode = GameMode.placeBall;
  6622. xGame.common.placeBallCurLevel = level;
  6623. xGame.uiMgr.Show(UIGame);
  6624. this.hide();
  6625. }
  6626. }
  6627. UIGameEnd.uiName = "UIGameEnd";
  6628. class ui_UIRepentProp extends fgui.GComponent {
  6629. static createInstance() {
  6630. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6631. }
  6632. onConstruct() {
  6633. this.c1 = this.getController("c1");
  6634. this.n11 = (this.getChild("n11"));
  6635. this.regretNode = (this.getChild("regretNode"));
  6636. this.helpLineNode = (this.getChild("helpLineNode"));
  6637. this.t0 = this.getTransition("t0");
  6638. }
  6639. }
  6640. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6641. class UIRepentProp extends UIBase {
  6642. constructor() {
  6643. super();
  6644. this.viewType = 0;
  6645. this.regretType = 0;
  6646. }
  6647. onConstructor() {
  6648. this.ui = ui_UIRepentProp.createInstance();
  6649. this.contentPane = this.ui;
  6650. this.isEject = false;
  6651. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6652. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6653. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6654. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6655. }
  6656. show(viewType, regretType, callback) {
  6657. PlatMgr.showInsert(true);
  6658. this.viewType = viewType;
  6659. this.regretType = regretType;
  6660. this.callback = callback;
  6661. super.show();
  6662. this.ui.t0.play();
  6663. this.ui.c1.selectedIndex = this.viewType;
  6664. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "未打进目标球" : "白球进洞";
  6665. if (this.viewType == 0) {
  6666. let guide = DataMgr.getGuideHelpLine();
  6667. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6668. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6669. }
  6670. xGame.common.gameMgr.gamePause = true;
  6671. }
  6672. hideSelf() {
  6673. xGame.common.gameMgr.gamePause = false;
  6674. this.callback && this.callback(false);
  6675. this.hide();
  6676. }
  6677. videoRegret() {
  6678. Moyu.showVideoAd(() => {
  6679. this.callback && this.callback(true);
  6680. this.hideSelf();
  6681. }, EAdType.regretBall);
  6682. }
  6683. videoAddHelpLine() {
  6684. let guide = DataMgr.getGuideHelpLine();
  6685. if (guide == 0) {
  6686. this.callback && this.callback(true);
  6687. this.hideSelf();
  6688. DataMgr.setGuideHelpLine();
  6689. xGame.common.gameUI.ui.guideNode.visible = false;
  6690. }
  6691. else {
  6692. Moyu.showVideoAd(() => {
  6693. this.callback && this.callback(true);
  6694. this.hideSelf();
  6695. }, EAdType.longHelpLine);
  6696. }
  6697. }
  6698. }
  6699. UIRepentProp.uiName = "UIRepentProp";
  6700. class ui_UIVideoShare extends fgui.GComponent {
  6701. static createInstance() {
  6702. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6703. }
  6704. onConstruct() {
  6705. this.n10 = (this.getChild("n10"));
  6706. this.myNode = (this.getChild("myNode"));
  6707. this.t0 = this.getTransition("t0");
  6708. }
  6709. }
  6710. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6711. class UIVideoShare extends UIBase {
  6712. constructor() {
  6713. super();
  6714. this.success = false;
  6715. this.awardNum = 0;
  6716. this.isShared = true;
  6717. }
  6718. onConstructor() {
  6719. this.ui = ui_UIVideoShare.createInstance();
  6720. this.contentPane = this.ui;
  6721. this.isEject = false;
  6722. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6723. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6724. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6725. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6726. }
  6727. show(success) {
  6728. super.show();
  6729. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6730. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6731. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6732. this.success = success;
  6733. let time = xGame.common.randomNum(600, 1500);
  6734. Moyu.showInsertAd(time, 60000);
  6735. if (success)
  6736. xGame.soundMgr.playSound("applause");
  6737. this.ui.t0.play();
  6738. this.checkShareState();
  6739. let times = DataMgr.getDailyVideoShareTimes();
  6740. this.awardNum = times == 0 ? 2000 : 200;
  6741. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6742. }
  6743. checkShareState() {
  6744. if (PlatMgr.forceShare == 0) {
  6745. this.ui.myNode.closeBtn.visible = true;
  6746. this.ui.myNode.tipsNode.visible = false;
  6747. this.ui.myNode.closeBtn.x = 90;
  6748. this.ui.myNode.shareBtn.x = 342;
  6749. }
  6750. else if (PlatMgr.forceShare == 1) {
  6751. this.ui.myNode.closeBtn.visible = false;
  6752. this.ui.myNode.tipsNode.visible = true;
  6753. this.ui.myNode.shareBtn.x = 218;
  6754. this.isShared = true;
  6755. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6756. }
  6757. }
  6758. checkForceShare() {
  6759. this.isShared = !this.isShared;
  6760. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6761. }
  6762. videoShare() {
  6763. if (PlatMgr.forceShare == 1) {
  6764. if (this.isShared) {
  6765. this.shareGame();
  6766. }
  6767. else {
  6768. this.hideSelf();
  6769. }
  6770. }
  6771. else {
  6772. this.shareGame();
  6773. }
  6774. }
  6775. shareGame() {
  6776. Moyu.sendDataEvent("VideoShare");
  6777. if (Moyu.canShare() > 100) {
  6778. Moyu.shareGame((success) => {
  6779. if (success) {
  6780. DataMgr.setDailyVideoShareTimes(1);
  6781. DataMgr.setCoin(this.awardNum);
  6782. }
  6783. this.hideSelf();
  6784. }, this);
  6785. }
  6786. else {
  6787. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6788. this.hideSelf();
  6789. }
  6790. }
  6791. hideSelf() {
  6792. this.hide();
  6793. xGame.uiMgr.Show(UIGameEnd, this.success);
  6794. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6795. xGame.common.screenImg.destroy();
  6796. xGame.common.screenImg = null;
  6797. }
  6798. }
  6799. }
  6800. UIVideoShare.uiName = "UIVideoShare";
  6801. class ui_UITips extends fgui.GComponent {
  6802. static createInstance() {
  6803. return (fgui.UIPackage.createObject("game", "UITips"));
  6804. }
  6805. onConstruct() {
  6806. this.n0 = (this.getChild("n0"));
  6807. this.myNode = (this.getChild("myNode"));
  6808. this.t0 = this.getTransition("t0");
  6809. }
  6810. }
  6811. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6812. class UITips extends UIBase {
  6813. constructor() {
  6814. super();
  6815. this.type = 0;
  6816. }
  6817. onConstructor() {
  6818. this.ui = ui_UITips.createInstance();
  6819. this.contentPane = this.ui;
  6820. this.isEject = false;
  6821. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  6822. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  6823. }
  6824. show(tipsTxt, womanTxt, type) {
  6825. super.show();
  6826. this.ui.t0.play();
  6827. this.ui.myNode.tipsTxt.text = tipsTxt;
  6828. this.ui.myNode.womanTxt.text = womanTxt;
  6829. PlatMgr.showInsert(true);
  6830. this.ui.myNode.c1.selectedIndex = type;
  6831. this.type = type;
  6832. switch (this.type) {
  6833. case TipsType.exitGame:
  6834. xGame.common.gameMgr.gamePause = true;
  6835. break;
  6836. case TipsType.foul:
  6837. Laya.timer.once(200, this, () => {
  6838. xGame.common.gameMgr.gamePause = true;
  6839. });
  6840. break;
  6841. default:
  6842. break;
  6843. }
  6844. }
  6845. clickLeftBtn() {
  6846. this.hide();
  6847. xGame.common.gameMgr.gamePause = false;
  6848. switch (this.type) {
  6849. case TipsType.exitGame:
  6850. break;
  6851. case TipsType.foul:
  6852. break;
  6853. default:
  6854. break;
  6855. }
  6856. }
  6857. clickRightBtn() {
  6858. this.hide();
  6859. switch (this.type) {
  6860. case TipsType.exitGame:
  6861. xGame.eventMgr.event(RESET_GAME);
  6862. xGame.uiMgr.Show(UIMain);
  6863. Moyu.recordEnd(this, null);
  6864. xGame.common.longHelpLine = false;
  6865. break;
  6866. case TipsType.foul:
  6867. xGame.common.gameMgr.gamePause = false;
  6868. Laya.timer.clearAll(this);
  6869. break;
  6870. default:
  6871. break;
  6872. }
  6873. }
  6874. }
  6875. UITips.uiName = "UITips";
  6876. class GameMgr {
  6877. constructor() {
  6878. this.selfCamp = "";
  6879. this.selfFoulNum = 0;
  6880. this.selfBallArr = [];
  6881. this.selfTimer = 0;
  6882. this.selfScore = 0;
  6883. this.aiCamp = "";
  6884. this.aiFoulNum = 0;
  6885. this.aiBallArr = [];
  6886. this.aiTimer = 0;
  6887. this.aiScore = 0;
  6888. this.aiSkillLevelNum = 1;
  6889. this.targertScore = 0;
  6890. this.setTime = 30;
  6891. this.selfTurnRate = 0.5;
  6892. this.accTime = 0;
  6893. this.curFoul = "";
  6894. this.maxFoulTimes = 3;
  6895. this.isFirstInGame = true;
  6896. this.firstColliObj = null;
  6897. this.inHoleBalls = [];
  6898. this.blackNum = 8;
  6899. this.success = false;
  6900. this.holePosList = [];
  6901. this.posObj = {};
  6902. this._selfTurn = false;
  6903. this.lastRootBallPos = new Laya.Vector2(311, 430);
  6904. this.ensureBallType = false;
  6905. this.isOpenBall = true;
  6906. this.finishOneShoot = true;
  6907. this.isEnd = false;
  6908. this.isChangeTurn = false;
  6909. this.isInterrupt = false;
  6910. this.aiPlayedBreakArmy = false;
  6911. this.isTouchedBall = false;
  6912. this.finishBalls = 0;
  6913. this.needBalls = 0;
  6914. this.allBallNum = 0;
  6915. this.placeBallPosData = {};
  6916. this.curHP = 0;
  6917. this.showLongView = false;
  6918. this.firstShoot = true;
  6919. this._gamePause = false;
  6920. this.trunCount = 0;
  6921. this.isBlackInHole = false;
  6922. this.isEnter = true;
  6923. xGame.eventMgr.offAll(ALL_BALL_STOP);
  6924. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  6925. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  6926. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  6927. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  6928. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  6929. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  6930. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  6931. }
  6932. get gamePause() {
  6933. return this._gamePause;
  6934. }
  6935. set gamePause(v) {
  6936. if (v) {
  6937. Laya.physicsTimer.pause();
  6938. }
  6939. else {
  6940. Laya.physicsTimer.resume();
  6941. }
  6942. this._gamePause = v;
  6943. }
  6944. get selfTurn() {
  6945. return this._selfTurn;
  6946. }
  6947. set selfTurn(val) {
  6948. this.trunCount++;
  6949. this._selfTurn = val;
  6950. if (val) {
  6951. xGame.common.d2World.d2Gan.ui.self.visible = true;
  6952. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  6953. }
  6954. else {
  6955. xGame.common.d2World.d2Gan.ui.self.visible = false;
  6956. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  6957. if (this.trunCount > 1)
  6958. PlatMgr.openBox();
  6959. }
  6960. }
  6961. resetGame() {
  6962. this.inHoleBalls = [];
  6963. this.isFirstInGame = true;
  6964. this.firstColliObj = null;
  6965. this.aiCamp = "";
  6966. this.selfCamp = "";
  6967. this.aiFoulNum = 0;
  6968. this.selfFoulNum = 0;
  6969. this.selfBallArr = [];
  6970. this.aiBallArr = [];
  6971. this.gamePause = false;
  6972. this.ensureBallType = false;
  6973. this.isInterrupt = false;
  6974. this.updateLeftBall();
  6975. this.clearTime();
  6976. this.aiPlayedBreakArmy = false;
  6977. this.isBlackInHole = false;
  6978. this.placeBallPosData = {};
  6979. if (xGame.common.d3World.knifeRoot) {
  6980. xGame.common.d3World.knifeRoot.destroyChildren();
  6981. }
  6982. }
  6983. gameReady() {
  6984. this.trunCount = 0;
  6985. this.firstColliObj = null;
  6986. this.isFirstInGame = true;
  6987. this.selfTurn = Math.random() <= this.selfTurnRate;
  6988. let challengeNum = DataMgr.getChallengeTimes();
  6989. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6990. this.selfTurn = true;
  6991. }
  6992. if (xGame.common.gameMode == GameMode.placeBall)
  6993. this.selfTurn = true;
  6994. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  6995. this.selfTurn = true;
  6996. }
  6997. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  6998. this.checkGuide();
  6999. if (xGame.common.uiRodMethod)
  7000. xGame.common.uiRodMethod.resetRod();
  7001. xGame.common.d2World.getHelpLine();
  7002. this.isOpenBall = true;
  7003. this.isTouchedBall = false;
  7004. xGame.common.aiPlayer.stopRun();
  7005. this.setTime = 30;
  7006. let ui = xGame.common.gameUI.ui;
  7007. switch (xGame.common.gameMode) {
  7008. case GameMode.classic:
  7009. xGame.common.aiPlayer.init();
  7010. this.blackNum = 8;
  7011. this.placeRootBall();
  7012. this.peoplePlay(9, 10);
  7013. ui.wordsBtn.visible = true;
  7014. ui.aiWordsBtn.visible = true;
  7015. xGame.common.talkMgr.changeAIState(true);
  7016. DataMgr.gameData.gameCount++;
  7017. DataMgr.saveGameData();
  7018. break;
  7019. case GameMode.bigMove:
  7020. this.blackNum = -1;
  7021. this.selfScore = 0;
  7022. this.aiScore = 0;
  7023. xGame.common.aiPlayer.init();
  7024. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7025. this.updateSelfScore();
  7026. this.updateAIScore();
  7027. this.updateTargetSroce();
  7028. this.placeRootBall();
  7029. this.peoplePlay(9, 10);
  7030. ui.wordsBtn.visible = true;
  7031. ui.aiWordsBtn.visible = true;
  7032. xGame.common.talkMgr.changeAIState(true);
  7033. if (DataMgr.getSkillGuide() < 1)
  7034. DataMgr.gameData.gameCount = 0;
  7035. else {
  7036. DataMgr.gameData.gameCount++;
  7037. DataMgr.saveGameData();
  7038. PlatMgr.openTry();
  7039. }
  7040. if (xGame.common.d3World.knifeRoot) {
  7041. xGame.common.d3World.knifeRoot.destroyChildren();
  7042. }
  7043. break;
  7044. case GameMode.placeBall:
  7045. this.blackNum = -1;
  7046. this.selfTurn = true;
  7047. this.setTime = 10000;
  7048. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7049. this.curHP = this.placeBallData.hp;
  7050. if (this.placeBallData.ball == -1)
  7051. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7052. else
  7053. this.needBalls = this.placeBallData.ball;
  7054. console.log("需要的进球数目", this.needBalls);
  7055. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7056. this.finishBalls = 0;
  7057. this.placeBallPosData = {};
  7058. this.updatePlaceBallPos();
  7059. this.updatePlaceBallState();
  7060. this.finishOneShoot = true;
  7061. xGame.common.gameUI.ui.moveNode.visible = false;
  7062. this.isOpenBall = false;
  7063. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7064. ui.wordsBtn.visible = false;
  7065. ui.aiWordsBtn.visible = false;
  7066. xGame.common.talkMgr.changeAIState(false);
  7067. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7068. PlatMgr.openBox();
  7069. });
  7070. break;
  7071. default:
  7072. break;
  7073. }
  7074. this.showLongView = false;
  7075. xGame.common.wordsMgr.comboTimes = 1;
  7076. let guide = DataMgr.getSkillGuide();
  7077. if (guide)
  7078. xGame.eventMgr.event(WAIT_SHOOT);
  7079. xGame.common.upSkillLevel = false;
  7080. xGame.common.gameStartTime = new Date().getTime();
  7081. this.firstShoot = true;
  7082. }
  7083. checkGuide() {
  7084. let guide = DataMgr.getSkillGuide();
  7085. let gameUI = xGame.common.gameUI.ui;
  7086. gameUI.guide1.visible = false;
  7087. gameUI.guide2.visible = false;
  7088. gameUI.guide3.visible = false;
  7089. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7090. this.selfTurn = true;
  7091. }
  7092. else {
  7093. return;
  7094. }
  7095. let oneBall = this.getOneBall();
  7096. gameUI.guide1.visible = true;
  7097. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7098. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7099. }
  7100. getOneBall() {
  7101. let arr = xGame.common.d2World.ballArr;
  7102. for (let index = 0; index < arr.length; index++) {
  7103. if (arr[index].number == 0)
  7104. continue;
  7105. return arr[index];
  7106. }
  7107. }
  7108. updateSelfScore() {
  7109. let ui = xGame.common.gameUI.ui.topNode;
  7110. ui.selfScoreTxt.text = this.selfScore + "";
  7111. }
  7112. updateAIScore() {
  7113. let ui = xGame.common.gameUI.ui.topNode;
  7114. ui.aiScoreTxt.text = this.aiScore + "";
  7115. }
  7116. updateTargetSroce() {
  7117. let ui = xGame.common.gameUI.ui.topNode;
  7118. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7119. }
  7120. updateLeftBall() {
  7121. let topUI = xGame.common.gameUI.ui.topNode;
  7122. topUI.selfBallList.numItems = this.selfBallArr.length;
  7123. topUI.aiBallList.numItems = this.aiBallArr.length;
  7124. }
  7125. ballShoot() {
  7126. this.clearTime();
  7127. this.finishOneShoot = false;
  7128. xGame.common.gameUI.ui.moveNode.visible = false;
  7129. if (xGame.common.gameUI.ui.guideNode.visible) {
  7130. xGame.common.gameUI.ui.guideNode.visible = false;
  7131. }
  7132. if (this.firstShoot) {
  7133. this.firstShoot = false;
  7134. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7135. }
  7136. }
  7137. ensureCamp(number) {
  7138. this.ensureBallType = true;
  7139. this.isOpenBall = false;
  7140. if (xGame.common.gameMode != GameMode.classic)
  7141. return;
  7142. let full = [1, 2, 3, 4, 5, 6, 7];
  7143. let flower = [9, 10, 11, 12, 13, 14, 15];
  7144. let sayWords = "";
  7145. if (this.selfTurn) {
  7146. if (number <= 7) {
  7147. this.selfCamp = ballCamp.full;
  7148. this.selfBallArr = full;
  7149. this.aiCamp = ballCamp.flower;
  7150. this.aiBallArr = flower;
  7151. sayWords = cfgTable.wordsData[3].msg;
  7152. }
  7153. else {
  7154. this.selfCamp = ballCamp.flower;
  7155. this.selfBallArr = flower;
  7156. this.aiCamp = ballCamp.full;
  7157. this.aiBallArr = full;
  7158. sayWords = cfgTable.wordsData[4].msg;
  7159. }
  7160. }
  7161. else {
  7162. if (number <= 7) {
  7163. this.selfCamp = ballCamp.flower;
  7164. this.selfBallArr = flower;
  7165. this.aiCamp = ballCamp.full;
  7166. this.aiBallArr = full;
  7167. sayWords = cfgTable.wordsData[2].msg;
  7168. }
  7169. else {
  7170. this.selfCamp = ballCamp.full;
  7171. this.selfBallArr = full;
  7172. this.aiCamp = ballCamp.flower;
  7173. this.aiBallArr = flower;
  7174. sayWords = cfgTable.wordsData[1].msg;
  7175. }
  7176. }
  7177. this.updateLeftBall();
  7178. xGame.uiMgr.Show(UIMsg, sayWords);
  7179. }
  7180. updatePlaceBallState() {
  7181. let ui = xGame.common.gameUI.ui;
  7182. switch (this.placeBallData.type) {
  7183. case PlaceBallType.normal:
  7184. let normal = ui.placeNormalNode;
  7185. normal.hpTxt.text = this.curHP + "";
  7186. this.updatePlaceBallStar(normal);
  7187. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7188. normal.levelTxt.text = `第${xGame.common.placeBallCurLevel}关`;
  7189. break;
  7190. case PlaceBallType.challenge:
  7191. let challenge = ui.placeChallengeNode;
  7192. challenge.hpTxt.text = "杆数:" + this.curHP;
  7193. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7194. challenge.levelTxt.text = `第${xGame.common.placeBallCurLevel}关`;
  7195. challenge.tipsTxt.text = `打进${this.needBalls}颗球`;
  7196. break;
  7197. default:
  7198. break;
  7199. }
  7200. }
  7201. playSubHpAni() {
  7202. let ui = xGame.common.gameUI.ui;
  7203. switch (this.placeBallData.type) {
  7204. case PlaceBallType.normal:
  7205. let normal = ui.placeNormalNode;
  7206. normal.hpTxt.visible = false;
  7207. normal.starAni.c1.selectedIndex = 1;
  7208. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7209. normal.hpTxt.visible = true;
  7210. normal.starAni.c1.selectedIndex = 0;
  7211. }));
  7212. break;
  7213. default:
  7214. break;
  7215. }
  7216. }
  7217. getEndStarNum() {
  7218. let num;
  7219. let level = xGame.common.placeBallCurLevel;
  7220. if (this.curHP == this.placeBallData.hp) {
  7221. num = 3;
  7222. }
  7223. else if (this.curHP <= 1) {
  7224. num = 1;
  7225. }
  7226. else {
  7227. num = 2;
  7228. }
  7229. if (!this.success) {
  7230. num = 0;
  7231. }
  7232. else {
  7233. DataMgr.setPlaceBallLevel(level, num);
  7234. }
  7235. let myType = cfgTable.placeballData[level].type;
  7236. if (this.success && myType == 1) {
  7237. num = 3;
  7238. }
  7239. xGame.common.placeBallStarNum = num;
  7240. }
  7241. updatePlaceBallStar(node) {
  7242. let star = 0;
  7243. if (this.curHP == this.placeBallData.hp) {
  7244. star = 3;
  7245. }
  7246. else if (this.curHP >= 2) {
  7247. star = 2;
  7248. }
  7249. else if (this.curHP == 1) {
  7250. star = 1;
  7251. }
  7252. else {
  7253. star = 0;
  7254. }
  7255. let temp;
  7256. for (let index = 1; index <= 3; index++) {
  7257. temp = node["star" + index];
  7258. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7259. }
  7260. node.myProgress.value = (star / 3) * 100;
  7261. }
  7262. openRegretView(isFoul, GoalNum, challenge = false) {
  7263. let regretType = -1;
  7264. if (isFoul) {
  7265. regretType = 1;
  7266. }
  7267. else {
  7268. if (GoalNum <= 0) {
  7269. regretType = 0;
  7270. }
  7271. }
  7272. if (challenge) {
  7273. regretType = 1;
  7274. }
  7275. if (regretType != -1) {
  7276. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7277. if (success) {
  7278. this.curHP++;
  7279. this.updatePlaceBallState();
  7280. this.setPlaceBallAllPos();
  7281. xGame.common.gameUI.ui.moveNode.visible = false;
  7282. }
  7283. else {
  7284. if (this.curHP <= 0) {
  7285. this.success = false;
  7286. this.gameEnd();
  7287. }
  7288. this.playSubHpAni();
  7289. }
  7290. this.updatePlaceBallState();
  7291. this.updatePlaceBallPos();
  7292. });
  7293. }
  7294. }
  7295. setPlaceBallAllPos() {
  7296. let allBall = xGame.common.d2World.ballArr;
  7297. let cfgArr = this.placeBallPosData;
  7298. let temp;
  7299. let obj;
  7300. for (let index = 0; index < allBall.length; index++) {
  7301. temp = allBall[index];
  7302. if (temp.destroyed)
  7303. continue;
  7304. obj = cfgArr[temp.myUNID];
  7305. if (obj && obj.src && !obj.src.destroyed) {
  7306. temp.gameObj.x = obj.posX;
  7307. temp.gameObj.y = obj.posY;
  7308. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7309. }
  7310. }
  7311. xGame.common.d2World.getHelpLine();
  7312. }
  7313. updatePlaceBallPos() {
  7314. let arr = xGame.common.d2World.ballArr;
  7315. let temp;
  7316. for (let index = 0; index < arr.length; index++) {
  7317. temp = arr[index];
  7318. if (!this.placeBallPosData[temp.myUNID]) {
  7319. this.placeBallPosData[temp.myUNID] = {
  7320. src: temp,
  7321. posX: temp.gameObj.x,
  7322. posY: temp.gameObj.y
  7323. };
  7324. }
  7325. else {
  7326. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7327. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7328. }
  7329. }
  7330. let check;
  7331. for (const key in this.placeBallPosData) {
  7332. check = this.placeBallPosData[key];
  7333. if (check.src.destroyed) {
  7334. delete this.placeBallPosData[key];
  7335. }
  7336. }
  7337. }
  7338. gameRun(type) {
  7339. if (this.gamePause)
  7340. return;
  7341. this.curFoul = this.getFoulType();
  7342. if (type) {
  7343. xGame.common.d2World.d2Gan.shoot();
  7344. xGame.common.gameUI.forceCancel();
  7345. this.curFoul = type;
  7346. }
  7347. this.isEnd = false;
  7348. this.isChangeTurn = true;
  7349. if (xGame.common.gameMode == GameMode.classic) {
  7350. this.judgeClassic(this.curFoul);
  7351. this.checkClassicWords(() => {
  7352. xGame.common.destroyClassicEmotion();
  7353. if (this.isEnd) {
  7354. if (this.isBlackInHole) {
  7355. xGame.common.gameUI.ui.blackAni.visible = true;
  7356. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7357. xGame.common.gameUI.ui.blackAni.visible = false;
  7358. this.gameEnd();
  7359. }));
  7360. }
  7361. else {
  7362. this.gameEnd();
  7363. }
  7364. }
  7365. else {
  7366. this.waitShoot();
  7367. xGame.eventMgr.event(WAIT_SHOOT);
  7368. }
  7369. });
  7370. }
  7371. else if (xGame.common.gameMode == GameMode.bigMove) {
  7372. xGame.common.aiPlayer.stopRun();
  7373. let scoreArr = this.getScore(this.curFoul);
  7374. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7375. this.isEnd = true;
  7376. }
  7377. this.checkBigSkillWords(() => {
  7378. if (this.isEnd) {
  7379. this.gameEnd();
  7380. }
  7381. else {
  7382. this.waitShoot();
  7383. xGame.eventMgr.event(WAIT_SHOOT);
  7384. }
  7385. });
  7386. }
  7387. else if (xGame.common.gameMode == GameMode.placeBall) {
  7388. xGame.common.destroyAwardSpine();
  7389. let isFoul = this.curFoul == FoulType.rootHole;
  7390. let GoalNum = this.inHoleBalls.length;
  7391. if (this.inHoleBalls.indexOf(0) > -1)
  7392. GoalNum -= 1;
  7393. if (isFoul) {
  7394. this.placeRootBall();
  7395. }
  7396. console.log("neeballs", this.needBalls);
  7397. console.log("当前完成的goalNum", GoalNum);
  7398. this.finishBalls += GoalNum;
  7399. console.log("当前完成的finishballs", this.finishBalls);
  7400. let need = this.needBalls;
  7401. if (this.placeBallData.type == PlaceBallType.challenge) {
  7402. need += 100;
  7403. }
  7404. if (this.finishBalls >= need) {
  7405. this.success = true;
  7406. this.gameEnd();
  7407. }
  7408. else {
  7409. switch (this.placeBallData.type) {
  7410. case PlaceBallType.normal:
  7411. if (!isFoul && GoalNum > 0) {
  7412. this.updatePlaceBallPos();
  7413. this.updatePlaceBallState();
  7414. }
  7415. else {
  7416. this.curHP--;
  7417. this.openRegretView(isFoul, GoalNum);
  7418. }
  7419. this.waitShoot();
  7420. xGame.eventMgr.event(WAIT_SHOOT);
  7421. break;
  7422. case PlaceBallType.challenge:
  7423. this.curHP--;
  7424. this.updatePlaceBallState();
  7425. if (isFoul) {
  7426. this.openRegretView(isFoul, GoalNum, true);
  7427. }
  7428. else {
  7429. this.updatePlaceBallPos();
  7430. if (this.curHP <= 0) {
  7431. this.success = true;
  7432. this.gameEnd();
  7433. }
  7434. }
  7435. this.waitShoot();
  7436. xGame.eventMgr.event(WAIT_SHOOT);
  7437. break;
  7438. default:
  7439. break;
  7440. }
  7441. }
  7442. }
  7443. }
  7444. checkClassicWords(callback) {
  7445. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7446. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7447. let type = this.getClassicWordsType();
  7448. if (condition && type != -1) {
  7449. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7450. xGame.soundMgr.playSound(str);
  7451. xGame.common.wordsMgr.playClassicWords(type, callback);
  7452. }
  7453. else {
  7454. Laya.timer.once(300, this, () => {
  7455. callback && callback();
  7456. });
  7457. }
  7458. }
  7459. getClassicWordsType() {
  7460. let d2world = xGame.common.d2World;
  7461. let type = -1;
  7462. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7463. type = ClassicWordsType.perfectShow;
  7464. return type;
  7465. }
  7466. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7467. type = ClassicWordsType.directShoot;
  7468. return type;
  7469. }
  7470. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7471. type = ClassicWordsType.anotherShoot;
  7472. return type;
  7473. }
  7474. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7475. type = ClassicWordsType.bigPower;
  7476. return type;
  7477. }
  7478. let minSpeed = 1;
  7479. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7480. type = ClassicWordsType.hardShoot;
  7481. return type;
  7482. }
  7483. if (this.inHoleBalls.length > 0) {
  7484. type = ClassicWordsType.directShoot;
  7485. return type;
  7486. }
  7487. return type;
  7488. }
  7489. checkBigSkillWords(callback) {
  7490. if (this.curFoul == FoulType.timeOut) {
  7491. callback && callback();
  7492. }
  7493. else {
  7494. let playSkill = false;
  7495. if (this.selfTurn) {
  7496. playSkill = true;
  7497. }
  7498. else {
  7499. if (!this.aiPlayedBreakArmy) {
  7500. this.aiPlayedBreakArmy = true;
  7501. playSkill = true;
  7502. }
  7503. if (this.aiCurSkill != SkillType.breakArmy) {
  7504. playSkill = true;
  7505. }
  7506. }
  7507. if (xGame.common.skillMgr.playedLastSkill) {
  7508. xGame.common.skillMgr.playedLastSkill = false;
  7509. playSkill = false;
  7510. }
  7511. if (playSkill) {
  7512. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7513. let selfExtra = 0;
  7514. let aiExtra = 0;
  7515. if (this.selfTurn)
  7516. selfExtra += extraScore;
  7517. else
  7518. aiExtra += extraScore;
  7519. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7520. this.isEnd = true;
  7521. }
  7522. this.playBigSkillTimes(callback);
  7523. });
  7524. }
  7525. else {
  7526. this.playBigSkillTimes(callback);
  7527. }
  7528. }
  7529. }
  7530. playBigSkillTimes(callback) {
  7531. let length = this.inHoleBalls.length;
  7532. if (this.inHoleBalls.indexOf(0) > -1) {
  7533. length = this.inHoleBalls.length - 1;
  7534. }
  7535. if (length <= 0) {
  7536. callback && callback();
  7537. return;
  7538. }
  7539. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7540. callback && callback();
  7541. });
  7542. }
  7543. playSkillTips() {
  7544. let levelNum = 0;
  7545. let curType;
  7546. if (this.selfTurn) {
  7547. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7548. curType = this.selfCurSkill;
  7549. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7550. levelNum += 5;
  7551. }
  7552. }
  7553. else {
  7554. levelNum = this.aiSkillLevelNum;
  7555. curType = this.aiCurSkill;
  7556. }
  7557. let str = ``;
  7558. switch (curType) {
  7559. case SkillType.highSpace:
  7560. str = `额外移动了${xGame.common.extraMoveNum}颗球`;
  7561. break;
  7562. case SkillType.breakArmy:
  7563. str = `额外打进了${levelNum}颗球`;
  7564. break;
  7565. case SkillType.ice:
  7566. str = `额外冻住了${levelNum * 2}颗球`;
  7567. break;
  7568. case SkillType.fireworks:
  7569. str = `额外爆炸了${levelNum}颗球`;
  7570. break;
  7571. case SkillType.GuanYu:
  7572. str = `进行了${xGame.common.extraMoveNum}段位移`;
  7573. break;
  7574. default:
  7575. break;
  7576. }
  7577. xGame.uiMgr.Show(UIMsg, str);
  7578. }
  7579. getFoulType() {
  7580. let foulType = "";
  7581. if (this.firstColliObj == null) {
  7582. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7583. return FoulType.rootHole;
  7584. }
  7585. return FoulType.notTouch;
  7586. }
  7587. else {
  7588. if (this.selfTurn) {
  7589. if (this.selfBallArr.length > 0) {
  7590. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7591. foulType = FoulType.wrongTouch;
  7592. }
  7593. }
  7594. else {
  7595. if (this.ensureBallType) {
  7596. }
  7597. else {
  7598. if (this.firstColliObj == this.blackNum) {
  7599. foulType = FoulType.wrongTouch;
  7600. }
  7601. }
  7602. }
  7603. }
  7604. else {
  7605. if (this.aiBallArr.length > 0) {
  7606. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7607. foulType = FoulType.wrongTouch;
  7608. }
  7609. }
  7610. else {
  7611. if (this.ensureBallType) {
  7612. }
  7613. else {
  7614. if (this.firstColliObj == this.blackNum) {
  7615. foulType = FoulType.wrongTouch;
  7616. }
  7617. }
  7618. }
  7619. }
  7620. if (this.inHoleBalls.length <= 0) {
  7621. return foulType;
  7622. }
  7623. let temp;
  7624. if (this.inHoleBalls.indexOf(0) > -1) {
  7625. foulType = FoulType.rootHole;
  7626. }
  7627. else {
  7628. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7629. temp = this.inHoleBalls[index];
  7630. if (this.selfTurn) {
  7631. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7632. foulType = FoulType.wrongHole;
  7633. break;
  7634. }
  7635. }
  7636. else {
  7637. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7638. foulType = FoulType.wrongHole;
  7639. break;
  7640. }
  7641. }
  7642. }
  7643. }
  7644. let foo;
  7645. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7646. temp = this.inHoleBalls[index];
  7647. foo = this.selfBallArr.indexOf(temp);
  7648. if (foo > -1) {
  7649. this.selfBallArr.splice(foo, 1);
  7650. }
  7651. foo = this.aiBallArr.indexOf(temp);
  7652. if (foo > -1) {
  7653. this.aiBallArr.splice(foo, 1);
  7654. }
  7655. }
  7656. this.updateLeftBall();
  7657. }
  7658. return foulType;
  7659. }
  7660. judgeGameEndByBlack(arr) {
  7661. if (this.selfTurn) {
  7662. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7663. this.selfFoulNum = this.maxFoulTimes;
  7664. return true;
  7665. }
  7666. }
  7667. else {
  7668. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7669. this.aiFoulNum = this.maxFoulTimes;
  7670. return true;
  7671. }
  7672. }
  7673. }
  7674. judgeClassic(type) {
  7675. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7676. xGame.common.aiPlayer.stopRun();
  7677. if (this.judgeNormalSuccess()) {
  7678. this.isEnd = true;
  7679. return;
  7680. }
  7681. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7682. if (this.selfTurn) {
  7683. if (isFoul) {
  7684. this.selfFoulNum++;
  7685. }
  7686. if (this.selfFoulNum >= this.maxFoulTimes) {
  7687. this.success = false;
  7688. this.isEnd = true;
  7689. return;
  7690. }
  7691. }
  7692. else {
  7693. if (isFoul)
  7694. this.aiFoulNum++;
  7695. if (this.aiFoulNum >= this.maxFoulTimes) {
  7696. this.success = true;
  7697. this.isEnd = true;
  7698. return;
  7699. }
  7700. }
  7701. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7702. this.isChangeTurn = false;
  7703. }
  7704. else {
  7705. this.isInterrupt = true;
  7706. }
  7707. }
  7708. waitShoot() {
  7709. if (xGame.common.gameMode == GameMode.classic) {
  7710. switch (this.curFoul) {
  7711. case FoulType.timeOut:
  7712. case FoulType.rootHole:
  7713. this.selfTurn = !this.selfTurn;
  7714. this.peoplePlay(5, 6, true);
  7715. break;
  7716. case FoulType.notTouch:
  7717. this.selfTurn = !this.selfTurn;
  7718. this.peoplePlay(7, 7);
  7719. break;
  7720. case FoulType.wrongHole:
  7721. this.selfTurn = !this.selfTurn;
  7722. this.peoplePlay(11, 11);
  7723. break;
  7724. default:
  7725. if (this.inHoleBalls.length > 0) {
  7726. this.peoplePlay(0, 0, false, false);
  7727. }
  7728. else {
  7729. this.selfTurn = !this.selfTurn;
  7730. this.peoplePlay(7, 7);
  7731. }
  7732. break;
  7733. }
  7734. }
  7735. else if (xGame.common.gameMode == GameMode.bigMove) {
  7736. if (this.curFoul == FoulType.timeOut) {
  7737. this.selfTurn = !this.selfTurn;
  7738. this.peoplePlay(14, 15);
  7739. this.placeRootBall();
  7740. }
  7741. else {
  7742. this.selfTurn = !this.selfTurn;
  7743. if (this.curFoul == FoulType.rootHole) {
  7744. this.peoplePlay(12, 13);
  7745. this.placeRootBall();
  7746. }
  7747. else {
  7748. this.peoplePlay(0, 0, false, false);
  7749. }
  7750. }
  7751. }
  7752. else if (xGame.common.gameMode == GameMode.placeBall) {
  7753. this.finishOneShoot = true;
  7754. }
  7755. this.gameResult();
  7756. }
  7757. gameResult() {
  7758. this.firstColliObj = null;
  7759. this.inHoleBalls = [];
  7760. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7761. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7762. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7763. if (xGame.common.uiRodMethod)
  7764. xGame.common.uiRodMethod.resetRod();
  7765. xGame.common.d2World.rootBall.showSelf();
  7766. this.clearIceSkill();
  7767. if (this.selfTurn) {
  7768. console.log("gameResult");
  7769. PlatMgr.gameInsert();
  7770. }
  7771. xGame.common.d3World.knifeRoot.destroyChildren();
  7772. if (this.selfTurn) {
  7773. xGame.common.gameUI.showHelpLineGuide();
  7774. xGame.common.gameUI.setTurnAlpha(true);
  7775. }
  7776. else {
  7777. xGame.common.gameUI.setTurnAlpha(false);
  7778. }
  7779. }
  7780. getScore(type) {
  7781. let selfAdd = 0;
  7782. let aiAdd = 0;
  7783. if (type == FoulType.timeOut) {
  7784. if (this.selfTurn)
  7785. aiAdd += 3;
  7786. else
  7787. selfAdd += 3;
  7788. }
  7789. else {
  7790. if (this.inHoleBalls.length > 0) {
  7791. if (this.selfTurn) {
  7792. if (type == FoulType.rootHole) {
  7793. aiAdd += 3;
  7794. if (this.inHoleBalls.length - 1 > 0) {
  7795. selfAdd += this.inHoleBalls.length - 1;
  7796. }
  7797. }
  7798. else {
  7799. selfAdd += this.inHoleBalls.length;
  7800. }
  7801. }
  7802. else {
  7803. if (type == FoulType.rootHole) {
  7804. selfAdd += 3;
  7805. if (this.inHoleBalls.length - 1 > 0) {
  7806. aiAdd += this.inHoleBalls.length - 1;
  7807. }
  7808. }
  7809. else {
  7810. aiAdd += this.inHoleBalls.length;
  7811. }
  7812. }
  7813. }
  7814. }
  7815. return [selfAdd, aiAdd];
  7816. }
  7817. judgeScoreEnd(selfAdd, aiAdd) {
  7818. this.selfScore += selfAdd;
  7819. this.aiScore += aiAdd;
  7820. this.updateAIScore();
  7821. this.updateSelfScore();
  7822. if (this.selfScore >= this.targertScore) {
  7823. this.success = true;
  7824. return true;
  7825. }
  7826. if (this.aiScore >= this.targertScore) {
  7827. this.success = false;
  7828. return true;
  7829. }
  7830. let ballArr = xGame.common.d2World.ballArr;
  7831. if (ballArr.length == 1 && ballArr[0].number == 0) {
  7832. if (this.selfScore > this.aiScore) {
  7833. this.success = true;
  7834. return true;
  7835. }
  7836. else if (this.selfScore < this.aiScore) {
  7837. this.success = false;
  7838. return true;
  7839. }
  7840. else {
  7841. if (this.selfTurn) {
  7842. this.success = false;
  7843. }
  7844. else {
  7845. this.success = true;
  7846. }
  7847. return true;
  7848. }
  7849. }
  7850. }
  7851. clearIceSkill() {
  7852. let arr = xGame.common.d2World.ballArr;
  7853. let temp;
  7854. if (this.selfTurn) {
  7855. if (this.selfCurSkill == SkillType.ice) {
  7856. for (let index = 0; index < arr.length; index++) {
  7857. temp = arr[index];
  7858. if (temp.ballFunc == "ice") {
  7859. temp.setBallFunc("normal", "self");
  7860. }
  7861. }
  7862. }
  7863. }
  7864. else {
  7865. if (this.aiCurSkill == SkillType.ice) {
  7866. for (let index = 0; index < arr.length; index++) {
  7867. temp = arr[index];
  7868. if (temp.ballFunc == "ice") {
  7869. temp.setBallFunc("normal", "ai");
  7870. }
  7871. }
  7872. }
  7873. }
  7874. }
  7875. judgeNormalSuccess() {
  7876. if (this.selfTurn) {
  7877. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7878. this.success = true;
  7879. return true;
  7880. }
  7881. }
  7882. else {
  7883. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  7884. this.success = false;
  7885. return true;
  7886. }
  7887. }
  7888. }
  7889. gameEnd() {
  7890. if (Moyu.isTT) {
  7891. xGame.common.screenImg = getScreenImg();
  7892. }
  7893. console.log("游戏结束", this.success);
  7894. xGame.common.aiPlayer.stopRun();
  7895. if (xGame.common.gameMode == GameMode.placeBall) {
  7896. this.getEndStarNum();
  7897. this.updatePlaceBallState();
  7898. }
  7899. this.isEnter = false;
  7900. Moyu.recordEnd(this, () => {
  7901. if (this.isEnter)
  7902. return;
  7903. this.isEnter = true;
  7904. console.log("进入录结束回调");
  7905. this.enterNext();
  7906. });
  7907. Laya.timer.once(1000, this, () => {
  7908. if (this.isEnter)
  7909. return;
  7910. this.isEnter = true;
  7911. this.enterNext();
  7912. });
  7913. xGame.common.longHelpLine = false;
  7914. }
  7915. enterNext() {
  7916. Laya.timer.clearAll(this);
  7917. if (Moyu.canShare() > 100 || Moyu.isKs) {
  7918. xGame.uiMgr.Show(UIVideoShare, this.success);
  7919. }
  7920. else {
  7921. xGame.uiMgr.Show(UIGameEnd, this.success);
  7922. }
  7923. }
  7924. aiLeave() {
  7925. let ui = xGame.common.gameUI.ui;
  7926. ui.topNode.aiNameTxt.text = "离线";
  7927. }
  7928. aiGameEnd(suc) {
  7929. this.success = suc;
  7930. xGame.common.aiPlayer.stopRun();
  7931. if (this.success) {
  7932. xGame.uiMgr.Show(UIMsg, "对手已逃跑!");
  7933. Laya.timer.once(1000, this, () => {
  7934. this.clearTime();
  7935. this.gameEnd();
  7936. });
  7937. }
  7938. }
  7939. openTimer() {
  7940. let src = xGame.common.gameUI;
  7941. if (this.selfTurn) {
  7942. src.ui.topNode.selfProgress.visible = true;
  7943. src.ui.topNode.aiProgress.visible = false;
  7944. this.curTimer = src.ui.topNode.selfProgress;
  7945. }
  7946. else {
  7947. src.ui.topNode.selfProgress.visible = false;
  7948. src.ui.topNode.aiProgress.visible = true;
  7949. this.curTimer = src.ui.topNode.aiProgress;
  7950. }
  7951. this.accTime = 0;
  7952. Laya.timer.clearAll(this);
  7953. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  7954. this.curTimer.value = 100;
  7955. }
  7956. updateTime(dt) {
  7957. if (this.gamePause)
  7958. return;
  7959. this.accTime += dt;
  7960. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  7961. if (this.accTime >= this.setTime) {
  7962. this.clearTime();
  7963. console.log("时钟进入了gameRun");
  7964. this.gameRun(FoulType.timeOut);
  7965. }
  7966. }
  7967. clearTime() {
  7968. let src = xGame.common.gameUI;
  7969. src.ui.topNode.selfProgress.visible = false;
  7970. src.ui.topNode.aiProgress.visible = false;
  7971. Laya.timer.clearAll(this);
  7972. }
  7973. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  7974. let ui = xGame.common.gameUI.ui;
  7975. let selfMsg, aiMsg;
  7976. if (sayWords) {
  7977. selfMsg = cfgTable.wordsData[selfIndex].msg;
  7978. aiMsg = cfgTable.wordsData[aiIndex].msg;
  7979. if (Foul) {
  7980. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  7981. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  7982. this.placeRootBall();
  7983. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  7984. if (this.curFoul == FoulType.rootHole) {
  7985. if (!DataMgr.getRootBallFoul()) {
  7986. DataMgr.setRootBallFoul();
  7987. aiMsg = "";
  7988. let tips = "白球进洞了,3次犯规本局游戏失败。";
  7989. let woman = "老板,下次注意啦~";
  7990. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7991. }
  7992. }
  7993. else if (this.curFoul == FoulType.timeOut) {
  7994. if (!DataMgr.getTimeoutFoul()) {
  7995. DataMgr.setTimeoutFoul();
  7996. aiMsg = "";
  7997. let tips = "游戏超时,3次犯规本局游戏失败。";
  7998. let woman = "老板,注意时间楼~";
  7999. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8000. }
  8001. }
  8002. }
  8003. }
  8004. }
  8005. if (this.selfTurn) {
  8006. if (sayWords) {
  8007. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8008. ui.selfTurn.visible = true;
  8009. ui.aiTurn.visible = false;
  8010. ui.selfTurn.t0.play();
  8011. Moyu.vibration();
  8012. });
  8013. }
  8014. }
  8015. else {
  8016. let aiNum = xGame.tools.random(1, 11);
  8017. let challengeNum = DataMgr.getChallengeTimes();
  8018. let delay = false;
  8019. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8020. aiNum = 9;
  8021. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8022. aiNum = 3;
  8023. if (challengeNum == 3) {
  8024. if (!this.showLongView) {
  8025. this.showLongView = true;
  8026. delay = true;
  8027. }
  8028. }
  8029. }
  8030. }
  8031. if (delay) {
  8032. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8033. if (success) {
  8034. xGame.common.longHelpLine = true;
  8035. xGame.common.d2World.getHelpLine();
  8036. }
  8037. else {
  8038. aiNum = 10;
  8039. }
  8040. xGame.common.aiPlayer.setAiLevel(aiNum);
  8041. if (sayWords) {
  8042. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8043. xGame.common.aiPlayer.runAI();
  8044. ui.selfTurn.visible = false;
  8045. ui.aiTurn.visible = true;
  8046. ui.aiTurn.t0.play();
  8047. });
  8048. }
  8049. else {
  8050. xGame.common.aiPlayer.runAI();
  8051. }
  8052. this.openTimer();
  8053. this.finishOneShoot = true;
  8054. if (this.selfTurn) {
  8055. ui.topNode.selfKuang.visible = true;
  8056. ui.topNode.aiKuang.visible = false;
  8057. ui.topNode.selfTips.visible = true;
  8058. ui.topNode.aiTips.visible = false;
  8059. }
  8060. else {
  8061. ui.topNode.selfKuang.visible = false;
  8062. ui.topNode.aiKuang.visible = true;
  8063. ui.topNode.selfTips.visible = false;
  8064. ui.topNode.aiTips.visible = true;
  8065. }
  8066. });
  8067. return;
  8068. }
  8069. if (xGame.common.gameMode == GameMode.classic) {
  8070. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8071. if (cfg) {
  8072. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8073. aiNum = aiLevel;
  8074. }
  8075. }
  8076. xGame.common.aiPlayer.setAiLevel(aiNum);
  8077. if (sayWords) {
  8078. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8079. xGame.common.aiPlayer.runAI();
  8080. ui.selfTurn.visible = false;
  8081. ui.aiTurn.visible = true;
  8082. ui.aiTurn.t0.play();
  8083. });
  8084. }
  8085. else {
  8086. xGame.common.aiPlayer.runAI();
  8087. }
  8088. }
  8089. this.openTimer();
  8090. this.finishOneShoot = true;
  8091. if (this.selfTurn) {
  8092. ui.topNode.selfKuang.visible = true;
  8093. ui.topNode.aiKuang.visible = false;
  8094. ui.topNode.selfTips.visible = true;
  8095. ui.topNode.aiTips.visible = false;
  8096. }
  8097. else {
  8098. ui.topNode.selfKuang.visible = false;
  8099. ui.topNode.aiKuang.visible = true;
  8100. ui.topNode.selfTips.visible = false;
  8101. ui.topNode.aiTips.visible = true;
  8102. }
  8103. }
  8104. placeRootBall() {
  8105. let rootBall = xGame.common.d2World.rootBall;
  8106. if (!rootBall)
  8107. return;
  8108. rootBall.gameObj.x = this.lastRootBallPos.x;
  8109. rootBall.gameObj.y = this.lastRootBallPos.y;
  8110. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8111. let moveNode = xGame.common.gameUI.ui.moveNode;
  8112. moveNode.visible = true;
  8113. moveNode.x = this.lastRootBallPos.x;
  8114. moveNode.y = this.lastRootBallPos.y;
  8115. if (!this.selfTurn) {
  8116. xGame.common.aiPlayer.resetRoot();
  8117. }
  8118. }
  8119. }
  8120. class ui_guanyuAni extends fgui.GComponent {
  8121. static createInstance() {
  8122. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8123. }
  8124. onConstruct() {
  8125. this.n0 = (this.getChild("n0"));
  8126. }
  8127. }
  8128. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8129. class UIFireworks extends UIBase {
  8130. constructor() {
  8131. super();
  8132. }
  8133. onConstructor() {
  8134. this.isEject = false;
  8135. }
  8136. show(callback) {
  8137. super.show();
  8138. }
  8139. }
  8140. UIFireworks.uiName = "UIFireworks";
  8141. class ui_UIGuanYu extends fgui.GComponent {
  8142. static createInstance() {
  8143. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8144. }
  8145. onConstruct() {
  8146. this.n2 = (this.getChild("n2"));
  8147. this.n1 = (this.getChild("n1"));
  8148. this.n3 = (this.getChild("n3"));
  8149. this.n4 = (this.getChild("n4"));
  8150. this.n5 = (this.getChild("n5"));
  8151. this.n6 = (this.getChild("n6"));
  8152. this.n8 = (this.getChild("n8"));
  8153. this.n7 = (this.getChild("n7"));
  8154. this.t0 = this.getTransition("t0");
  8155. }
  8156. }
  8157. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8158. class UIGuanYu extends UIBase {
  8159. constructor() {
  8160. super();
  8161. }
  8162. onConstructor() {
  8163. this.ui = ui_UIGuanYu.createInstance();
  8164. this.contentPane = this.ui;
  8165. this.isEject = false;
  8166. }
  8167. show(callback) {
  8168. super.show();
  8169. this.ui.t0.play(Laya.Handler.create(this, () => {
  8170. callback && callback();
  8171. this.hide();
  8172. }));
  8173. }
  8174. }
  8175. UIGuanYu.uiName = "UIGuanYu";
  8176. class SkillMgr {
  8177. constructor() {
  8178. this.leveNum = 0;
  8179. this.extraScore = 0;
  8180. this.selfTurn = false;
  8181. this.playedLastSkill = false;
  8182. this.tweenArr = [];
  8183. this._finishNum = 0;
  8184. this._curFinish = 0;
  8185. this._rootX = 0;
  8186. this._rootY = 0;
  8187. this.knifeTimes = 0;
  8188. this.knifeV2 = new Laya.Vector2();
  8189. this.knifeV3 = new Laya.Vector3();
  8190. this.rtStarX = 0;
  8191. this.rtStarY = 0;
  8192. this.addBigSkillSpine();
  8193. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8194. }
  8195. addBigSkillSpine() {
  8196. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8197. console.log("extra2 success");
  8198. });
  8199. }
  8200. runBigSkill(callback) {
  8201. this.tweenArr = [];
  8202. this.callback = callback;
  8203. this.judgeSkill();
  8204. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8205. let guide = DataMgr.getSkillGuide();
  8206. if (!xGame.common.gameMgr.selfTurn) {
  8207. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8208. }
  8209. else {
  8210. if (xGame.common.temSelfLevel != 0) {
  8211. this.leveNum = xGame.common.temSelfLevel;
  8212. }
  8213. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8214. this.leveNum += 5;
  8215. }
  8216. }
  8217. if (guide == 0) {
  8218. DataMgr.setSkillGuide(1);
  8219. if (DataMgr.getNewUser()) {
  8220. Moyu.sendDataEvent("gameFirstPlay");
  8221. DataMgr.setNewUser();
  8222. }
  8223. }
  8224. this.playSpineAni(() => {
  8225. switch (this.curSkill) {
  8226. case SkillType.highSpace:
  8227. this.runHighSpace();
  8228. break;
  8229. case SkillType.breakArmy:
  8230. this.runBreakArmy();
  8231. break;
  8232. case SkillType.ice:
  8233. this.runIce();
  8234. break;
  8235. case SkillType.fireworks:
  8236. this.runFireworks();
  8237. break;
  8238. case SkillType.GuanYu:
  8239. this.runGuanYu();
  8240. break;
  8241. default:
  8242. break;
  8243. }
  8244. });
  8245. }
  8246. judgeSkill() {
  8247. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8248. let gameMgr = xGame.common.gameMgr;
  8249. let type;
  8250. for (let index = 0; index < typeArr.length; index++) {
  8251. type = typeArr[index];
  8252. if (gameMgr.selfTurn) {
  8253. if (gameMgr.selfCurSkill == type) {
  8254. this.selfTurn = true;
  8255. this.curSkill = type;
  8256. return;
  8257. }
  8258. }
  8259. else {
  8260. if (gameMgr.aiCurSkill == type) {
  8261. this.selfTurn = false;
  8262. this.curSkill = type;
  8263. return;
  8264. }
  8265. }
  8266. }
  8267. }
  8268. playSpineAni(callback) {
  8269. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8270. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8271. parent.destroyChildren();
  8272. let aniIndex = 0;
  8273. let skillSpine;
  8274. switch (this.curSkill) {
  8275. case SkillType.highSpace:
  8276. aniIndex = 1;
  8277. xGame.soundMgr.playSound("skill01");
  8278. skillSpine = this.skillSpine2;
  8279. data.scaleX = 0.5;
  8280. data.scaleY = 0.5;
  8281. skillSpine.play(data, 1, false, parent, () => {
  8282. callback && callback();
  8283. });
  8284. break;
  8285. case SkillType.breakArmy:
  8286. aniIndex = 2;
  8287. xGame.soundMgr.playSound("skill02");
  8288. skillSpine = this.skillSpine2;
  8289. data.scaleX = 0.5;
  8290. data.scaleY = 0.5;
  8291. skillSpine.play(data, 2, false, parent, () => {
  8292. callback && callback();
  8293. });
  8294. break;
  8295. case SkillType.ice:
  8296. aniIndex = 0;
  8297. xGame.soundMgr.playSound("skill03");
  8298. skillSpine = this.skillSpine2;
  8299. data.scaleX = 0.5;
  8300. data.scaleY = 0.5;
  8301. skillSpine.play(data, 0, false, parent, () => {
  8302. callback && callback();
  8303. });
  8304. break;
  8305. case SkillType.fireworks:
  8306. xGame.soundMgr.playSound("skill_04_01");
  8307. xGame.soundMgr.playSound("skill04");
  8308. xGame.uiMgr.Show(UIFireworks, callback);
  8309. break;
  8310. case SkillType.GuanYu:
  8311. xGame.soundMgr.playSound("skill05_1");
  8312. xGame.soundMgr.playSound("skill05");
  8313. xGame.uiMgr.Show(UIGuanYu, callback);
  8314. break;
  8315. default:
  8316. break;
  8317. }
  8318. }
  8319. getAllBallArr() {
  8320. let arr = xGame.common.d2World.ballArr;
  8321. let outArr = [];
  8322. for (let index = 0; index < arr.length; index++) {
  8323. if (arr[index] instanceof D2RootBallSrc)
  8324. continue;
  8325. if (arr[index].ballFunc == "ice")
  8326. continue;
  8327. if (arr[index].destroyed)
  8328. continue;
  8329. outArr.push(arr[index]);
  8330. }
  8331. return outArr;
  8332. }
  8333. getOneArr(deletObj) {
  8334. let allArr = this.getAllBallArr();
  8335. let temp;
  8336. for (let index = 0; index < allArr.length; index++) {
  8337. temp = allArr[index];
  8338. if (temp.id == deletObj.id) {
  8339. allArr.splice(index, 1);
  8340. break;
  8341. }
  8342. }
  8343. return allArr;
  8344. }
  8345. getNearBallBag(ball) {
  8346. let ui = xGame.common.gameUI.ui;
  8347. let circleArr = [];
  8348. for (let index = 1; index <= 6; index++) {
  8349. circleArr.push(ui.border["circle" + index]);
  8350. }
  8351. let outIndex = 0;
  8352. let temp;
  8353. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8354. ;
  8355. let dis = 0;
  8356. for (let index = 1; index < circleArr.length; index++) {
  8357. temp = circleArr[index];
  8358. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8359. if (dis < min) {
  8360. min = dis;
  8361. outIndex = index;
  8362. }
  8363. }
  8364. return [circleArr[outIndex], outIndex];
  8365. }
  8366. ballFlyToBag(ballArr, time = 300) {
  8367. let temp;
  8368. let hole;
  8369. this._finishNum = ballArr.length;
  8370. this._curFinish = 0;
  8371. let holeObj = {};
  8372. let holeCfg = {
  8373. "1": 0,
  8374. "2": 0,
  8375. "3": 0,
  8376. "4": 0,
  8377. "5": 0,
  8378. "6": 0
  8379. };
  8380. for (let index = 0; index < ballArr.length; index++) {
  8381. temp = ballArr[index];
  8382. temp.outColli.isSensor = true;
  8383. temp.innerColli.isSensor = true;
  8384. temp.isRunSkillAni = true;
  8385. let holeArr = this.getNearBallBag(temp);
  8386. hole = holeArr[0];
  8387. holeObj[index] = holeArr[1];
  8388. temp.d3BallSrc.scaleXYZ = 0.5;
  8389. this.tweenArr.push(temp.d3BallSrc, temp);
  8390. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8391. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8392. }));
  8393. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8394. let mIndex = holeObj[this._curFinish];
  8395. let isDone = holeCfg[mIndex];
  8396. if (isDone) {
  8397. ballArr[this._curFinish].checkWrongBall(false);
  8398. }
  8399. else {
  8400. holeCfg[mIndex] = 1;
  8401. ballArr[this._curFinish].checkWrongBall();
  8402. }
  8403. this._curFinish++;
  8404. if (this._curFinish >= this._finishNum) {
  8405. if (this.curSkill == SkillType.highSpace) {
  8406. }
  8407. else if (this.curSkill == SkillType.breakArmy) {
  8408. let rootBall = xGame.common.d2World.rootBall;
  8409. rootBall.gameObj.x = this._rootX;
  8410. rootBall.gameObj.y = this._rootY;
  8411. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8412. xGame.common.d2World.d2Gan.ui.visible = true;
  8413. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8414. xGame.common.d2World.getHelpLine();
  8415. this.callback && this.callback(this.extraScore);
  8416. }
  8417. }
  8418. }));
  8419. }
  8420. }
  8421. runHighSpace() {
  8422. let rootBall = xGame.common.d2World.rootBall;
  8423. rootBall.showSelf();
  8424. let d3Src = rootBall.d3BallSrc;
  8425. let allArr = this.getAllBallArr();
  8426. if (allArr.length <= 0) {
  8427. this.callback && this.callback(0);
  8428. return;
  8429. }
  8430. let selectBall = xGame.common.d2World.targetBall;
  8431. let wrong = selectBall && selectBall.destroyed;
  8432. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8433. selectBall = xGame.common.getRandArrEle(allArr);
  8434. }
  8435. let targetD3Src = selectBall.d3BallSrc;
  8436. xGame.common.d2World.d2Gan.ui.visible = false;
  8437. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8438. d3Src.scaleXYZ = 0.5;
  8439. this.tweenArr.push(d3Src);
  8440. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8441. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8442. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8443. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8444. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8445. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8446. let outArr = [selectBall];
  8447. let other = this.leveNum - 1;
  8448. if (other > 0) {
  8449. let nearArr = this.getOneArr(selectBall);
  8450. if (nearArr.length > 0) {
  8451. xGame.common.botherArr(nearArr);
  8452. if (other >= nearArr.length)
  8453. other = nearArr.length;
  8454. for (let index = 0; index < other; index++) {
  8455. outArr.push(nearArr[index]);
  8456. }
  8457. }
  8458. }
  8459. xGame.common.extraMoveNum = other + 1;
  8460. this.extraScore = other + 1;
  8461. this._rootX = selectBall.gameObj.x;
  8462. this._rootY = selectBall.gameObj.y;
  8463. rootBall.gameObj.x = this._rootX;
  8464. rootBall.gameObj.y = this._rootY;
  8465. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8466. Laya.Tween.clearAll(d3Src);
  8467. this.addRandomForce(outArr);
  8468. }));
  8469. }));
  8470. }
  8471. addRandomForce(outArr) {
  8472. if (outArr.length > 0) {
  8473. xGame.common.d2World.openCheckStill = true;
  8474. this.playedLastSkill = true;
  8475. }
  8476. let temp;
  8477. for (let index = 0; index < outArr.length; index++) {
  8478. let angle = xGame.common.randomNum(0, 360);
  8479. let linearPercent = xGame.common.randomNum(65, 100);
  8480. temp = outArr[index];
  8481. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8482. }
  8483. }
  8484. setLinearSpeed(angle, rigy, linearPercent) {
  8485. let sin = Math.sin(angle * Math.PI / 180);
  8486. let cos = Math.cos(angle * Math.PI / 180);
  8487. let maxSpeed = 4;
  8488. let speed = new Laya.Vector2();
  8489. speed.x = maxSpeed * linearPercent * sin;
  8490. speed.y = -maxSpeed * linearPercent * cos;
  8491. rigy.applyLinearImpulseToCenter(speed);
  8492. }
  8493. runBreakArmy() {
  8494. xGame.common.d2World.d2Gan.ui.visible = false;
  8495. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8496. let gameUI = xGame.common.gameUI.ui;
  8497. gameUI.skillRod.visible = true;
  8498. gameUI.skillRod.rotation = 110;
  8499. let outArr = this.getAllBallArr();
  8500. if (outArr.length <= 0) {
  8501. gameUI.skillRod.visible = false;
  8502. this.callback && this.callback(0);
  8503. return;
  8504. }
  8505. xGame.common.botherArr(outArr);
  8506. if (this.leveNum >= outArr.length)
  8507. this.leveNum = outArr.length;
  8508. let deleteNum = outArr.length - this.leveNum;
  8509. outArr.splice(0, deleteNum);
  8510. this.extraScore = this.leveNum;
  8511. let potX = gameUI.skillRod.x;
  8512. let potY = gameUI.skillRod.y;
  8513. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8514. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8515. let disArr = [];
  8516. for (let index = 0; index < outArr.length; index++) {
  8517. let obj = outArr[index];
  8518. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8519. dis = Math.pow(dis, 0.5);
  8520. disArr.push(dis);
  8521. }
  8522. this.tweenArr.push(gameUI.skillRod);
  8523. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8524. })).update = Laya.Handler.create(this, (e, t, c) => {
  8525. let angle = gameUI.skillRod.rotation;
  8526. let xx;
  8527. let yy;
  8528. let temp;
  8529. for (let index = 0; index < outArr.length; index++) {
  8530. temp = outArr[index];
  8531. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8532. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8533. yy -= 20;
  8534. temp.gameObj.x = xx;
  8535. temp.gameObj.y = yy;
  8536. temp.d3BallSrc.setTransPos(xx, yy);
  8537. }
  8538. if (angle <= 60) {
  8539. Laya.Tween.clearAll(gameUI.skillRod);
  8540. this.ballFlyToBag(outArr, 150);
  8541. gameUI.skillRod.visible = false;
  8542. }
  8543. }, null, false);
  8544. }
  8545. runIce() {
  8546. let ballArr = xGame.common.d2World.ballArr;
  8547. this.leveNum *= 2;
  8548. if (this.leveNum >= ballArr.length - 1)
  8549. this.leveNum = ballArr.length - 1;
  8550. let tempArr = [];
  8551. let outArr = [];
  8552. for (let index = 0; index < ballArr.length; index++) {
  8553. if (ballArr[index] instanceof D2RootBallSrc)
  8554. continue;
  8555. tempArr.push(ballArr[index]);
  8556. }
  8557. if (tempArr.length <= 0) {
  8558. this.callback && this.callback(0);
  8559. return;
  8560. }
  8561. xGame.common.botherArr(tempArr);
  8562. for (let index = 0; index < this.leveNum; index++) {
  8563. outArr.push(tempArr[index]);
  8564. }
  8565. this.extraScore = this.leveNum;
  8566. let temp;
  8567. for (let index = 0; index < outArr.length; index++) {
  8568. temp = outArr[index];
  8569. temp.d3BallSrc.playIceEft();
  8570. }
  8571. Laya.timer.once(2000, this, () => {
  8572. for (let index = 0; index < outArr.length; index++) {
  8573. temp = outArr[index];
  8574. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8575. temp.setBallFunc("ice", str);
  8576. }
  8577. this.callback && this.callback(0);
  8578. });
  8579. }
  8580. runFireworks() {
  8581. let allArr = this.getAllBallArr();
  8582. if (allArr.length <= 0) {
  8583. this.callback && this.callback(0);
  8584. return;
  8585. }
  8586. xGame.common.d2World.d2Gan.ui.visible = false;
  8587. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8588. let outArr = [];
  8589. let other = this.leveNum;
  8590. if (other > 0) {
  8591. if (allArr.length > 0) {
  8592. xGame.common.botherArr(allArr);
  8593. if (other >= allArr.length)
  8594. other = allArr.length;
  8595. for (let index = 0; index < other; index++) {
  8596. outArr.push(allArr[index]);
  8597. }
  8598. }
  8599. }
  8600. xGame.common.extraMoveNum = other;
  8601. this.extraScore = other;
  8602. this.addRandmomFireworks(outArr);
  8603. }
  8604. addRandmomFireworks(outArr) {
  8605. Laya.timer.once(1100, this, () => {
  8606. if (outArr.length > 0) {
  8607. xGame.common.d2World.openCheckStill = true;
  8608. this.playedLastSkill = true;
  8609. }
  8610. });
  8611. xGame.soundMgr.playSound("skill_04_02");
  8612. let temp;
  8613. let delay = -200;
  8614. for (let index = 0; index < outArr.length; index++) {
  8615. temp = outArr[index];
  8616. delay += 200;
  8617. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8618. let angle = xGame.common.randomNum(0, 360);
  8619. angle = this.getFireworksAngle(obj);
  8620. let linearPercent = xGame.common.randomNum(45, 80);
  8621. if (!obj.destroyed)
  8622. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8623. });
  8624. }
  8625. }
  8626. getFireworksAngle(obj) {
  8627. let rootBall = xGame.common.d2World.rootBall;
  8628. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8629. }
  8630. resetGame() {
  8631. Laya.timer.clearAll(this);
  8632. if (this.tweenArr) {
  8633. for (let index = 0; index < this.tweenArr.length; index++) {
  8634. Laya.Tween.clearAll(this.tweenArr[index]);
  8635. }
  8636. }
  8637. this.tweenArr = null;
  8638. }
  8639. runGuanYu() {
  8640. xGame.common.d2World.d2Gan.ui.visible = false;
  8641. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8642. let rootBall = xGame.common.d2World.rootBall;
  8643. if (rootBall.isInHole) {
  8644. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8645. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8646. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8647. rootBall.showSelf();
  8648. }
  8649. this.rtStarX = rootBall.gameObj.x;
  8650. this.rtStarY = rootBall.gameObj.y;
  8651. this.knifeTimes = 0;
  8652. this.playedLastSkill = true;
  8653. rootBall.forceRun = true;
  8654. rootBall.rigy.type = "static";
  8655. xGame.common.d2World.openCheckStill = true;
  8656. this.guanyuRandomKnife();
  8657. }
  8658. guanyuRandomKnife() {
  8659. let rootBall = xGame.common.d2World.rootBall;
  8660. let dir = this.getRandDir();
  8661. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8662. console.log("当前angle", angle);
  8663. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8664. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8665. let dis = 324;
  8666. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8667. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8668. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8669. this.rtStarX = rootBall.gameObj.x;
  8670. this.rtStarY = rootBall.gameObj.y;
  8671. this.knifeTimes++;
  8672. let skillLevel;
  8673. if (xGame.common.gameMgr.selfTurn) {
  8674. skillLevel = DataMgr.getBigSkillByIndex(4);
  8675. }
  8676. else {
  8677. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8678. }
  8679. if (!skillLevel)
  8680. skillLevel = 1;
  8681. skillLevel += 2;
  8682. if (this.knifeTimes < skillLevel) {
  8683. Laya.timer.once(400, this, () => {
  8684. this.guanyuRandomKnife();
  8685. });
  8686. }
  8687. else {
  8688. rootBall.forceRun = false;
  8689. rootBall.rigy.type = "dynamic";
  8690. xGame.common.extraMoveNum = skillLevel;
  8691. }
  8692. }));
  8693. }
  8694. getRandDir() {
  8695. let rootBall = xGame.common.d2World.rootBall;
  8696. let allBall = this.getAllBallArr();
  8697. let target = xGame.common.getRandArrEle(allBall);
  8698. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8699. return this.knifeV2;
  8700. }
  8701. cloneKnife(x, y, rotation) {
  8702. let parent = xGame.common.d3World.knifeRoot;
  8703. let prefab = xGame.common.d3World.knife;
  8704. let clone = prefab.clone();
  8705. parent.addChild(clone);
  8706. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8707. clone.transform.localPositionX = this.knifeV3.x;
  8708. clone.transform.localPositionY = 0;
  8709. clone.transform.localPositionZ = this.knifeV3.z;
  8710. clone.transform.localRotationEulerX = 0;
  8711. clone.transform.localRotationEulerY = rotation;
  8712. clone.transform.localRotationEulerZ = 0;
  8713. clone.active = true;
  8714. return clone;
  8715. }
  8716. cloneGuanYuEft(x, y, angle) {
  8717. return;
  8718. let parent = xGame.common.gameUI.ui.guanyuNode;
  8719. let eft = new ui_guanyuAni();
  8720. eft.parent = parent;
  8721. eft.x = x;
  8722. eft.y = y;
  8723. eft.rotation = angle;
  8724. }
  8725. }
  8726. class ui_UIWordsList extends fgui.GComponent {
  8727. static createInstance() {
  8728. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8729. }
  8730. onConstruct() {
  8731. this.c1 = this.getController("c1");
  8732. this.n74 = (this.getChild("n74"));
  8733. this.clickNode = (this.getChild("clickNode"));
  8734. this.myNode = (this.getChild("myNode"));
  8735. this.n68 = (this.getChild("n68"));
  8736. this.n66 = (this.getChild("n66"));
  8737. this.n55 = (this.getChild("n55"));
  8738. this.wordsBtn = (this.getChild("wordsBtn"));
  8739. this.emotionBtn = (this.getChild("emotionBtn"));
  8740. this.mybggg = (this.getChild("mybggg"));
  8741. this.wordsList = (this.getChild("wordsList"));
  8742. this.emotionList = (this.getChild("emotionList"));
  8743. this.myRoot = (this.getChild("myRoot"));
  8744. }
  8745. }
  8746. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8747. class EmotionDisplay {
  8748. constructor(index, ui) {
  8749. this.ui = ui;
  8750. this.index = index;
  8751. this.ui.onClick(this, this.clickSelf);
  8752. this.updateSelf();
  8753. }
  8754. updateSelf() {
  8755. let data = cfgTable.emotionData[this.index + 1];
  8756. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8757. }
  8758. clickSelf() {
  8759. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8760. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8761. xGame.common.talkMgr.closeTalkView();
  8762. }
  8763. }
  8764. class WordsDisplay {
  8765. constructor(index, ui) {
  8766. this.ui = ui;
  8767. this.index = index;
  8768. this.ui.onClick(this, this.clickSelf);
  8769. this.updateSelf();
  8770. }
  8771. updateSelf() {
  8772. let data = cfgTable.talkwordsData[this.index + 1];
  8773. this.ui.txt.text = data.msg;
  8774. }
  8775. clickSelf() {
  8776. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8777. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8778. xGame.common.talkMgr.closeTalkView();
  8779. }
  8780. }
  8781. class UIWordsList extends UIBase {
  8782. constructor() {
  8783. super();
  8784. }
  8785. onConstructor() {
  8786. this.ui = ui_UIWordsList.createInstance();
  8787. this.contentPane = this.ui;
  8788. this.isEject = false;
  8789. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8790. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8791. this.addUIClick(this.ui.clickNode, this.hide);
  8792. this.initTalkList();
  8793. this.initEmotionList();
  8794. }
  8795. show() {
  8796. super.show();
  8797. }
  8798. initTalkList() {
  8799. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8800. let data = cfgTable.talkwordsData;
  8801. let length = Object.keys(data).length;
  8802. this.ui.wordsList.numItems = length;
  8803. }
  8804. initEmotionList() {
  8805. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8806. let data = cfgTable.emotionData;
  8807. let length = Object.keys(data).length;
  8808. this.ui.emotionList.numItems = length;
  8809. }
  8810. renderTalkItem(index, obj) {
  8811. let temp = new WordsDisplay(index, obj);
  8812. }
  8813. renderEmotionItem(index, obj) {
  8814. let temp = new EmotionDisplay(index, obj);
  8815. }
  8816. openTalkList() {
  8817. this.ui.c1.selectedIndex = 0;
  8818. }
  8819. openEmotionList() {
  8820. this.ui.c1.selectedIndex = 1;
  8821. }
  8822. }
  8823. UIWordsList.uiName = "UIWordsList";
  8824. class TalkMgr {
  8825. constructor() {
  8826. this.aiSpeak = true;
  8827. this.emotionList = [];
  8828. this.talkList = [];
  8829. this.addEvent();
  8830. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8831. this.emotionList = [];
  8832. this.talkList = [];
  8833. for (let k in cfgTable.emotionData) {
  8834. this.emotionList.push(cfgTable.emotionData[k].id);
  8835. }
  8836. for (let k in cfgTable.talkwordsData) {
  8837. this.talkList.push(cfgTable.talkwordsData[k].id);
  8838. }
  8839. }
  8840. addEvent() {
  8841. let ui = xGame.common.gameUI.ui;
  8842. ui.wordsBtn.visible = true;
  8843. ui.wordsBtn.onClick(this, this.openTalkView);
  8844. ui.aiWordsBtn.visible = true;
  8845. ui.aiWordsBtn.onClick(this, this.clickAIState);
  8846. }
  8847. openTalkView() {
  8848. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8849. xGame.uiMgr.Show(UIWordsList);
  8850. }
  8851. closeTalkView() {
  8852. xGame.uiMgr.Hide(UIWordsList);
  8853. }
  8854. clickAIState() {
  8855. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8856. this.aiSpeak = !this.aiSpeak;
  8857. this.changeAIState(this.aiSpeak);
  8858. }
  8859. changeAIState(speak) {
  8860. this.aiSpeak = speak;
  8861. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  8862. if (speak) {
  8863. btn.c1.selectedIndex = 0;
  8864. }
  8865. else {
  8866. btn.c1.selectedIndex = 1;
  8867. }
  8868. }
  8869. showSelfTalk(wordsId) {
  8870. let ui = xGame.common.gameUI.ui;
  8871. ui.selfTalk.visible = true;
  8872. ui.selfTalk.myNode.c1.selectedIndex = 1;
  8873. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8874. ui.selfTalk.t0.play();
  8875. }
  8876. showSelfEmotion(emotionId) {
  8877. let ui = xGame.common.gameUI.ui;
  8878. ui.selfTalk.visible = true;
  8879. ui.selfTalk.myNode.c1.selectedIndex = 0;
  8880. this.selfSpine && this.selfSpine.dispose();
  8881. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8882. let spineData = cfgTable.emotionData[emotionId].spine;
  8883. this.selfSpine = new SpineMgr(spineData, () => {
  8884. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  8885. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  8886. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8887. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  8888. });
  8889. ui.selfTalk.t0.play();
  8890. }
  8891. showAITalk(wordsId) {
  8892. if (!this.aiSpeak)
  8893. return;
  8894. if (DataMgr.gameData.gameCount < 2)
  8895. return;
  8896. if (wordsId < 1)
  8897. wordsId = this.getRandTalk();
  8898. let ui = xGame.common.gameUI.ui;
  8899. ui.aiTalk.visible = true;
  8900. ui.aiTalk.myNode.c1.selectedIndex = 1;
  8901. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  8902. ui.aiTalk.t0.play();
  8903. }
  8904. getRandTalk() {
  8905. let rand = xGame.tools.random(0, this.talkList.length);
  8906. return this.emotionList[rand];
  8907. }
  8908. getRandEmotion() {
  8909. let rand = xGame.tools.random(0, this.emotionList.length);
  8910. return this.emotionList[rand];
  8911. }
  8912. showAIEmotion(emotionId) {
  8913. if (!this.aiSpeak)
  8914. return;
  8915. if (DataMgr.gameData.gameCount < 2)
  8916. return;
  8917. if (emotionId < 1)
  8918. emotionId = this.getRandEmotion();
  8919. let ui = xGame.common.gameUI.ui;
  8920. ui.aiTalk.visible = true;
  8921. ui.aiTalk.myNode.c1.selectedIndex = 0;
  8922. this.aiSpine && this.aiSpine.dispose();
  8923. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8924. let spineData = cfgTable.emotionData[emotionId].spine;
  8925. this.aiSpine = new SpineMgr(spineData, () => {
  8926. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  8927. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  8928. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  8929. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  8930. });
  8931. ui.aiTalk.t0.play();
  8932. }
  8933. resetGame() {
  8934. let ui = xGame.common.gameUI.ui;
  8935. ui.aiTalk.visible = false;
  8936. ui.selfTalk.visible = false;
  8937. this.aiSpine && this.aiSpine.dispose();
  8938. this.selfSpine && this.selfSpine.dispose();
  8939. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  8940. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  8941. this.closeTalkView();
  8942. }
  8943. }
  8944. class WordsMgr {
  8945. constructor() {
  8946. this.comboTimes = 1;
  8947. this.skillTimes = 0;
  8948. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  8949. this.comboSpine = new SpineMgr("yxz_liangan");
  8950. this.skillSpine = new SpineMgr("yiganxqiu");
  8951. this.scoreSpine = new SpineMgr("defen");
  8952. }
  8953. setClassicCombo(isInterrupt) {
  8954. if (isInterrupt) {
  8955. this.comboTimes = 0;
  8956. }
  8957. }
  8958. playClassicWords(type, callback) {
  8959. this.callback = callback;
  8960. let aniIndex = type;
  8961. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8962. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8963. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  8964. mySpine.destroy(true);
  8965. this.playClassicTimes();
  8966. });
  8967. }
  8968. playClassicTimes() {
  8969. this.comboTimes++;
  8970. if (this.comboTimes <= 1) {
  8971. this.callback && this.callback();
  8972. }
  8973. else {
  8974. let aniIndex = this.comboTimes - 1;
  8975. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8976. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  8977. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  8978. mySpine.destroy(true);
  8979. this.callback && this.callback();
  8980. });
  8981. }
  8982. }
  8983. playBigSkillTimes(times, callback) {
  8984. if (times <= 0) {
  8985. callback && callback();
  8986. return;
  8987. }
  8988. this.callback = callback;
  8989. let pre = "sz_0";
  8990. let aniIndex = 0;
  8991. this.getWordsImg(times, pre, () => {
  8992. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  8993. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  8994. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  8995. let r1 = ``;
  8996. let r2 = ``;
  8997. if (times <= 9) {
  8998. r1 = `res/d2Res/${pre}${times}.png`;
  8999. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9000. aniIndex = 0;
  9001. }
  9002. else {
  9003. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9004. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9005. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9006. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9007. aniIndex = 1;
  9008. }
  9009. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9010. mySpine.destroy(true);
  9011. xGame.common.gameMgr.playSkillTips();
  9012. this.playScore(times);
  9013. xGame.common.playRandomMutiBallBigSkillSound();
  9014. }, mySpine);
  9015. });
  9016. }
  9017. playScore(score) {
  9018. let pre = "sz_";
  9019. let aniIndex = 0;
  9020. this.getWordsImg(score, pre, () => {
  9021. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9022. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9023. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9024. let r1 = ``;
  9025. let r2 = ``;
  9026. if (score <= 9) {
  9027. r1 = `res/d2Res/${pre}${score}.png`;
  9028. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9029. aniIndex = 0;
  9030. }
  9031. else {
  9032. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9033. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9034. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9035. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9036. aniIndex = 1;
  9037. }
  9038. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9039. mySpine.destroy(true);
  9040. this.callback && this.callback();
  9041. }, mySpine);
  9042. });
  9043. }
  9044. getWordsImg(number, pre = "", callback) {
  9045. let arr = [];
  9046. if (number <= 9) {
  9047. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9048. }
  9049. else {
  9050. 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 });
  9051. }
  9052. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9053. callback && callback();
  9054. }));
  9055. }
  9056. }
  9057. class ui_UIRodMethod extends fgui.GComponent {
  9058. static createInstance() {
  9059. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9060. }
  9061. onConstruct() {
  9062. this.n24 = (this.getChild("n24"));
  9063. this.white = (this.getChild("white"));
  9064. this.dot = (this.getChild("dot"));
  9065. this.sureBtn = (this.getChild("sureBtn"));
  9066. this.n20 = (this.getChild("n20"));
  9067. this.n21 = (this.getChild("n21"));
  9068. this.n22 = (this.getChild("n22"));
  9069. this.n23 = (this.getChild("n23"));
  9070. this.n5 = (this.getChild("n5"));
  9071. this.n14 = (this.getChild("n14"));
  9072. this.t0 = this.getTransition("t0");
  9073. }
  9074. }
  9075. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9076. class UIRodMethod extends UIBase {
  9077. constructor() {
  9078. super();
  9079. this.isPressd = false;
  9080. }
  9081. onConstructor() {
  9082. this.ui = ui_UIRodMethod.createInstance();
  9083. this.contentPane = this.ui;
  9084. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9085. this.moveDir = new Laya.Vector2();
  9086. this.moveDest = new Laya.Vector2();
  9087. this.centerPos = new Laya.Vector2();
  9088. xGame.common.uiRodMethod = this;
  9089. }
  9090. show() {
  9091. super.show();
  9092. xGame.common.gameMgr.gamePause = true;
  9093. this.openPressDotEvent();
  9094. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9095. this.centerPos.x = this.ui.white.x;
  9096. this.centerPos.y = this.ui.white.y;
  9097. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9098. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9099. this.setDot();
  9100. }
  9101. setDot() {
  9102. this.ui.dot.x = this.moveDest.x;
  9103. this.ui.dot.y = this.moveDest.y;
  9104. }
  9105. closeSelf() {
  9106. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9107. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9108. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9109. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9110. xGame.common.gameMgr.gamePause = false;
  9111. this.hide();
  9112. }
  9113. openPressDotEvent() {
  9114. this.closePressDotEvent();
  9115. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9116. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9117. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9118. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9119. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9120. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9121. }
  9122. closePressDotEvent() {
  9123. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9124. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9125. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9126. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9127. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9128. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9129. }
  9130. onDown(e) {
  9131. if (e.type == Laya.Event.MOUSE_DOWN)
  9132. this.isPressd = true;
  9133. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9134. this.isPressd = false;
  9135. if (!this.isPressd)
  9136. return;
  9137. this.moveDest.x = e.stageX;
  9138. this.moveDest.y = e.stageY;
  9139. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9140. if (dis > 6724) {
  9141. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9142. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9143. }
  9144. this.setDot();
  9145. }
  9146. resetRod() {
  9147. this.ui.dot.x = this.ui.white.x;
  9148. this.ui.dot.y = this.ui.white.y;
  9149. this.gameRod.dot.x = this.gameRod.bg.x;
  9150. this.gameRod.dot.y = this.gameRod.bg.y;
  9151. xGame.common.rodOffest.x = 0;
  9152. xGame.common.rodOffest.y = 0;
  9153. }
  9154. }
  9155. UIRodMethod.uiName = "UIRodMethod";
  9156. class UIGame extends UIBase {
  9157. constructor() {
  9158. super();
  9159. this.powerNum = 0;
  9160. this.isD3Inited = false;
  9161. this.isPrePlay = false;
  9162. this.isMoveRod = false;
  9163. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9164. this.rulerDis = 20;
  9165. this.rulerOffset = 0;
  9166. }
  9167. onConstructor() {
  9168. this.ui = ui_UIGame.createInstance();
  9169. this.contentPane = this.ui;
  9170. this.ui.x += xGame.common.sysOffestNum;
  9171. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9172. this.isEject = false;
  9173. xGame.common.gameUI = this;
  9174. this.initSelf();
  9175. }
  9176. isTurnSelf() {
  9177. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9178. return true;
  9179. }
  9180. }
  9181. initSelf() {
  9182. let topUI = this.ui.topNode;
  9183. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9184. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9185. this.barInfo = {};
  9186. this.barInfo.curY = 0;
  9187. this.barInfo.height = this.ui.powerNode.height;
  9188. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9189. this.barInfo.powerStartY = this.ui.powerNode.y;
  9190. xGame.common.aiPlayer = new AIPlayer();
  9191. xGame.common.gameMgr = new GameMgr();
  9192. xGame.common.skillMgr = new SkillMgr();
  9193. xGame.common.wordsMgr = new WordsMgr();
  9194. xGame.common.talkMgr = new TalkMgr();
  9195. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9196. console.log("加载经典模式表情文件chenggon !");
  9197. });
  9198. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9199. console.log("挑战模式奖励模式spine加载成功!");
  9200. });
  9201. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9202. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9203. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9204. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9205. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9206. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9207. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9208. }
  9209. returnHome() {
  9210. let tips = "确定退出游戏吗?";
  9211. let woman = "老板,要不您再玩会儿?";
  9212. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9213. }
  9214. addRodMethodClick() {
  9215. if (this.isTurnSelf()) {
  9216. xGame.uiMgr.Show(UIRodMethod);
  9217. }
  9218. }
  9219. clickHelpLineBtn(force = false) {
  9220. if (!this.isTurnSelf())
  9221. return;
  9222. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9223. if (success) {
  9224. xGame.common.longHelpLine = true;
  9225. xGame.common.d2World.getHelpLine();
  9226. Moyu.sendDataEvent("guideNum");
  9227. }
  9228. else {
  9229. }
  9230. });
  9231. }
  9232. renderSelfDisplayBalls(index, target) {
  9233. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9234. target.myImg.url = xGame.common.getGameIconUrl(str);
  9235. }
  9236. renderAIDisplayBalls(index, target) {
  9237. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9238. target.myImg.url = xGame.common.getGameIconUrl(str);
  9239. ;
  9240. }
  9241. updateMode() {
  9242. if (xGame.common.gameMode == GameMode.classic) {
  9243. this.ui.topNode.scoreNode.visible = false;
  9244. }
  9245. else if (xGame.common.gameMode == GameMode.bigMove) {
  9246. this.ui.topNode.scoreNode.visible = true;
  9247. }
  9248. }
  9249. show() {
  9250. super.show();
  9251. console.log("zh:uigame show");
  9252. this.ui.alpha = 0;
  9253. this.updateSelf();
  9254. console.log("zh:uigame bf gamemusic01 start");
  9255. xGame.soundMgr.playMusic("gamemusic01");
  9256. console.log("zh:uigame bf gamemusic01 end");
  9257. xGame.common.gameMgr.gamePause = false;
  9258. xGame.common.gameUI.ui.blackAni.visible = false;
  9259. xGame.common.gameUI.ui.whiteAni.visible = false;
  9260. this.ui.powerEft.visible = false;
  9261. this.ui.colorNode.visible = false;
  9262. this.updateHead();
  9263. }
  9264. updateSelf() {
  9265. if (xGame.common.gameMode == GameMode.classic) {
  9266. this.ui.c1.selectedIndex = 0;
  9267. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9268. this.ui.topNode.middleNode.visible = true;
  9269. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9270. }
  9271. else if (xGame.common.gameMode == GameMode.bigMove) {
  9272. this.ui.c1.selectedIndex = 0;
  9273. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9274. this.ui.topNode.middleNode.visible = false;
  9275. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9276. let rand = xGame.common.randomNum(1, max);
  9277. let guide = DataMgr.getSkillGuide();
  9278. if (guide == 0)
  9279. rand = 1;
  9280. xGame.common.bigMoveLevelIndex = rand;
  9281. }
  9282. else if (xGame.common.gameMode == GameMode.placeBall) {
  9283. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9284. this.ui.c1.selectedIndex = 1 + data.type;
  9285. this.ui.alpha = 1;
  9286. this.startGame();
  9287. }
  9288. this.updateMode();
  9289. this.initD3world();
  9290. this.initD2world();
  9291. }
  9292. startGame() {
  9293. this.ui.snowNode.visible = Math.random() <= 0.1;
  9294. this.ui.d2Node.visible = false;
  9295. xGame.common.d3World.d3Hand.gameObj.active = false;
  9296. xGame.common.d3World.tableSrc.init();
  9297. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9298. this.cameraViewChange(() => {
  9299. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9300. switch (xGame.common.gameMode) {
  9301. case GameMode.classic:
  9302. xGame.common.d3World.d3Hand.gameObj.active = true;
  9303. this.playPutBallD3Ani();
  9304. break;
  9305. case GameMode.bigMove:
  9306. this.enterGame();
  9307. Laya.timer.once(500, this, () => {
  9308. this.ui.topNode.middleNode.visible = true;
  9309. this.ui.topNode.middleNode.t0.play();
  9310. });
  9311. break;
  9312. case GameMode.placeBall:
  9313. this.enterGame();
  9314. break;
  9315. default:
  9316. break;
  9317. }
  9318. });
  9319. PlatMgr.showBanner(false);
  9320. }
  9321. enterGame() {
  9322. this.ui.d2Node.visible = true;
  9323. xGame.common.d3World.d3Hand.gameObj.active = false;
  9324. xGame.common.showOneCamera("mainCamera");
  9325. Moyu.recordGame(30, true);
  9326. if (!this.isPrePlay) {
  9327. this.isPrePlay = true;
  9328. xGame.common.d3World.prePlayEft();
  9329. }
  9330. xGame.common.gameMgr.gameReady();
  9331. this.openAllEvent();
  9332. this.ui.snowNode.visible = false;
  9333. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9334. this.ui.helpBtn.visible = condition;
  9335. }
  9336. showHelpLineGuide() {
  9337. let longGuide = DataMgr.getGuideHelpLine();
  9338. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9339. this.ui.helpBtn.visible = true;
  9340. this.ui.guideNode.visible = true;
  9341. }
  9342. }
  9343. setTurnAlpha(alpha) {
  9344. this.ui.keduNode.alpha = alpha;
  9345. this.ui.ganNode.alpha = alpha;
  9346. this.ui.rodMethodNode.alpha = alpha;
  9347. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9348. }
  9349. cameraViewChange(callback) {
  9350. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9351. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9352. xGame.common.showOneCamera("visitAngle");
  9353. cameraSrc.localRotationEulerY = 180;
  9354. cameraSrc.localRotationEulerZ = 0;
  9355. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9356. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9357. callback && callback();
  9358. }));
  9359. }));
  9360. }
  9361. playPutBallD3Ani() {
  9362. xGame.common.showOneCamera("mainCamera");
  9363. let handSrc = xGame.common.d3World.d3Hand;
  9364. handSrc.gameObj.active = true;
  9365. handSrc.transform.localPositionZ = 3;
  9366. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9367. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9368. handSrc.gameObj.active = false;
  9369. this.enterGame();
  9370. }), 400);
  9371. }));
  9372. }
  9373. updateHead() {
  9374. let user = Moyu.getUserInfo();
  9375. this.ui.topNode.selfNameTxt.text = user.nickName;
  9376. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9377. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9378. if (DataMgr.getSkillGuide() < 1) {
  9379. this.ui.topNode.aiNameTxt.text = '万宁台球';
  9380. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9381. }
  9382. else {
  9383. this.ui.topNode.aiNameTxt.text = aiData.name;
  9384. this.ui.topNode.aiHeadLoader.url = baseHeadUrl + aiData.icon;
  9385. }
  9386. }
  9387. initD2world() {
  9388. let node = this.ui.d2Root.displayObject;
  9389. let src = node.getComponent(D2World);
  9390. if (!src) {
  9391. xGame.common.d2World = node.addComponent(D2World);
  9392. }
  9393. xGame.common.d2World.initSelf();
  9394. }
  9395. initD3world() {
  9396. if (this.isD3Inited)
  9397. return;
  9398. this.isD3Inited = true;
  9399. let scene3D = xGame.common.d3Scene;
  9400. this.ui.d3Root.displayObject.addChild(scene3D);
  9401. scene3D.active = true;
  9402. xGame.common.d3World.tableSrc.setBorderPos();
  9403. }
  9404. onRootMove(e) {
  9405. let rootBall = xGame.common.d2World.rootBall;
  9406. this.ui.moveNode.x = e.x;
  9407. this.ui.moveNode.y = e.y;
  9408. rootBall.gameObj.x = e.x;
  9409. rootBall.gameObj.y = e.y;
  9410. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9411. }
  9412. aiRootMove(move) {
  9413. if (move)
  9414. this.hideBallUI();
  9415. else {
  9416. this.showBallUI();
  9417. xGame.common.d2World.getHelpLine();
  9418. }
  9419. }
  9420. aiForce(type, force = 0) {
  9421. this.pressTarget = PressType.powerNode;
  9422. if (type == 1)
  9423. this.onEventUp({ force: true });
  9424. else if (type == 2)
  9425. this.onEventMove({ stageY: force, force: true });
  9426. }
  9427. onEventPress(e) {
  9428. if (e.stopPropagation)
  9429. e.stopPropagation();
  9430. if (!this.isTurnSelf())
  9431. return;
  9432. let target = e.target;
  9433. switch (target) {
  9434. case this.ui.myPowerNode.displayObject:
  9435. this.pressTarget = PressType.powerNode;
  9436. this.barInfo.curY = e.stageY;
  9437. this.updateBarInfo();
  9438. break;
  9439. case this.ui.moveNode.displayObject:
  9440. this.pressTarget = PressType.moveNode;
  9441. this.hideBallUI();
  9442. this.eventObj.curX = this.ui.moveNode.x;
  9443. this.eventObj.curY = this.ui.moveNode.y;
  9444. this.ui.moveNode.finger.visible = false;
  9445. this.eventObj.lastX = e.stageX;
  9446. this.eventObj.lastY = e.stageY;
  9447. break;
  9448. case this.ui.rulerClickNode.displayObject:
  9449. this.pressTarget = PressType.rulerNode;
  9450. this.eventObj.lastY = e.stageY;
  9451. break;
  9452. case this.ui.d2Root.displayObject:
  9453. this.pressTarget = PressType.d2Root;
  9454. this.eventObj.lastX = e.stageX;
  9455. this.eventObj.lastY = e.stageY;
  9456. this.eventObj.starX = e.stageX;
  9457. this.eventObj.starY = e.stageY;
  9458. this.eventObj.curX = 0;
  9459. this.eventObj.curY = 0;
  9460. xGame.common.d2World.d2Gan.setGanLastInfo();
  9461. this.rulerOffset = 0;
  9462. break;
  9463. default:
  9464. break;
  9465. }
  9466. }
  9467. onEventMove(e) {
  9468. if (e.stopPropagation)
  9469. e.stopPropagation();
  9470. if (e && e.force) {
  9471. }
  9472. else {
  9473. if (!this.isTurnSelf())
  9474. return;
  9475. }
  9476. switch (this.pressTarget) {
  9477. case PressType.powerNode:
  9478. this.barInfo.curY = e.stageY;
  9479. this.updateBarInfo();
  9480. this.isMoveRod = true;
  9481. break;
  9482. case PressType.moveNode:
  9483. let rootBall = xGame.common.d2World.rootBall;
  9484. let radius = rootBall.gameObj.width / 2;
  9485. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9486. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9487. let border = xGame.common.d2World.borderRect;
  9488. if (curX <= border.x + radius)
  9489. curX = border.x + radius;
  9490. else if (curX >= border.x + border.width - radius)
  9491. curX = border.x + border.width - radius;
  9492. if (curY <= border.y + radius)
  9493. curY = border.y + radius;
  9494. else if (curY >= border.y + border.height - radius)
  9495. curY = border.y + border.height - radius;
  9496. if (xGame.common.gameMgr.isOpenBall) {
  9497. if (curX >= border.x + border.openBallW - radius)
  9498. curX = border.x + border.openBallW - radius;
  9499. }
  9500. this.ui.moveNode.x = curX;
  9501. this.ui.moveNode.y = curY;
  9502. rootBall.gameObj.x = curX;
  9503. rootBall.gameObj.y = curY;
  9504. rootBall.d3BallSrc.setTransPos(curX, curY);
  9505. this.isMoveRod = true;
  9506. break;
  9507. case PressType.rulerNode:
  9508. let yy = e.stageY - this.eventObj.lastY;
  9509. this.eventObj.lastY = e.stageY;
  9510. let ruler1 = this.ui.rulerNode.img1;
  9511. let ruler2 = this.ui.rulerNode.img2;
  9512. ruler1.y += yy;
  9513. ruler2.y += yy;
  9514. this.rulerOffset += yy;
  9515. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9516. this.rulerOffset = 0;
  9517. xGame.soundMgr.playSound("inch", 1, 10);
  9518. }
  9519. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9520. let h = ruler1.height;
  9521. this.checkGuide();
  9522. this.isMoveRod = true;
  9523. if (ruler1.y >= h) {
  9524. ruler1.y = -h;
  9525. ruler2.y = 0;
  9526. return;
  9527. }
  9528. else if (ruler1.y <= -h) {
  9529. ruler1.y = h;
  9530. ruler2.y = 0;
  9531. return;
  9532. }
  9533. if (ruler2.y >= h) {
  9534. ruler2.y = -h;
  9535. ruler1.y = 0;
  9536. return;
  9537. }
  9538. else if (ruler2.y <= -h) {
  9539. ruler2.y = h;
  9540. ruler1.y = 0;
  9541. return;
  9542. }
  9543. break;
  9544. case PressType.d2Root:
  9545. this.eventObj.curX = e.stageX;
  9546. this.eventObj.curY = e.stageY;
  9547. let offset = this.checkRodMoveDir();
  9548. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9549. this.eventObj.lastX = e.stageX;
  9550. this.eventObj.lastY = e.stageY;
  9551. break;
  9552. default:
  9553. break;
  9554. }
  9555. }
  9556. onEventUp(e) {
  9557. if (e.stopPropagation)
  9558. e.stopPropagation();
  9559. if (e && e.force) {
  9560. }
  9561. else {
  9562. if (!this.isTurnSelf())
  9563. return;
  9564. }
  9565. switch (this.pressTarget) {
  9566. case PressType.powerNode:
  9567. this.ui.powerNode.value = 0;
  9568. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9569. this.ui.powerTxt.text = "";
  9570. if (this.powerNum > 0) {
  9571. xGame.eventMgr.event(BALL_SHOOT);
  9572. xGame.common.d2World.shoot(this.powerNum);
  9573. xGame.common.d2World.d2Gan.shoot();
  9574. xGame.common.d2World.d2HelpLine.shoot();
  9575. this.finishGuide();
  9576. this.ui.powerEft.visible = false;
  9577. this.ui.colorNode.visible = false;
  9578. let ganStr = "";
  9579. if (this.powerNum <= 30) {
  9580. ganStr = "gan_30";
  9581. }
  9582. else if (this.powerNum <= 60) {
  9583. ganStr = "gan_50";
  9584. }
  9585. else {
  9586. ganStr = "gan_80";
  9587. }
  9588. xGame.soundMgr.playSound(ganStr);
  9589. }
  9590. break;
  9591. case PressType.moveNode:
  9592. let rootBall = xGame.common.d2World.rootBall;
  9593. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9594. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9595. let isIntersect = this.judgeBallIntersect();
  9596. if (isIntersect) {
  9597. this.ui.moveNode.x = lastX;
  9598. this.ui.moveNode.y = lastY;
  9599. rootBall.gameObj.x = lastX;
  9600. rootBall.gameObj.y = lastY;
  9601. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9602. xGame.uiMgr.Show(UIMsg, "错误的放置位置");
  9603. }
  9604. else {
  9605. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9606. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9607. }
  9608. this.showBallUI();
  9609. this.ui.moveNode.finger.visible = true;
  9610. xGame.common.d2World.getHelpLine();
  9611. break;
  9612. case PressType.rulerNode:
  9613. break;
  9614. case PressType.d2Root:
  9615. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9616. if (dis <= 25) {
  9617. this.moveToClickDot(e);
  9618. }
  9619. break;
  9620. default:
  9621. break;
  9622. }
  9623. this.pressTarget = -1;
  9624. }
  9625. checkGuide() {
  9626. let guide = DataMgr.getSkillGuide();
  9627. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9628. xGame.common.guideStep++;
  9629. xGame.common.gameUI.ui.guide2.visible = false;
  9630. xGame.common.gameUI.ui.guide3.visible = true;
  9631. }
  9632. }
  9633. finishGuide() {
  9634. let guide = DataMgr.getSkillGuide();
  9635. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9636. xGame.common.guideStep = 10;
  9637. this.closeAllGuide();
  9638. }
  9639. }
  9640. closeAllGuide() {
  9641. xGame.common.gameUI.ui.guide1.visible = false;
  9642. xGame.common.gameUI.ui.guide2.visible = false;
  9643. xGame.common.gameUI.ui.guide3.visible = false;
  9644. }
  9645. updateBarInfo() {
  9646. let star = this.ui.powerNode.y;
  9647. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9648. if (rate >= 1)
  9649. rate = 1;
  9650. if (rate <= 0)
  9651. rate = 0;
  9652. this.powerNum = Math.ceil(rate * 100);
  9653. this.ui.powerNode.value = this.powerNum;
  9654. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9655. this.ui.colorNode.value = this.powerNum;
  9656. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9657. this.ui.powerEft.visible = this.powerNum != 0;
  9658. this.ui.colorNode.visible = this.powerNum != 0;
  9659. this.ui.powerTxt.text = this.powerNum + "";
  9660. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9661. }
  9662. forceCancel() {
  9663. this.ui.powerNode.value = 0;
  9664. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9665. this.ui.powerTxt.text = "";
  9666. }
  9667. checkRodMoveDir() {
  9668. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9669. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9670. if (tempX >= 0 && tempY <= 0) {
  9671. return this.checkDir();
  9672. }
  9673. else if (tempX < 0 && tempY < 0) {
  9674. return this.checkDir(1, -1);
  9675. }
  9676. else if (tempX < 0 && tempY > 0) {
  9677. return this.checkDir(-1, -1);
  9678. }
  9679. else {
  9680. return this.checkDir(-1, 1);
  9681. }
  9682. }
  9683. checkDir(flagX = 1, flagY = 1) {
  9684. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9685. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9686. if (offsetY == 0) {
  9687. return offsetX * flagX;
  9688. }
  9689. if (offsetX == 0) {
  9690. return offsetY * flagY;
  9691. }
  9692. let angle = offsetY / offsetX;
  9693. if (Math.abs(angle) >= 1) {
  9694. return offsetY * flagY;
  9695. }
  9696. else {
  9697. return offsetX * flagX;
  9698. }
  9699. }
  9700. judgeBallIntersect() {
  9701. let rootBall = xGame.common.d2World.rootBall;
  9702. let ballArr = xGame.common.d2World.ballArr;
  9703. let radius = rootBall.gameObj.width / 2;
  9704. let temp;
  9705. let isIntersect = false;
  9706. for (let index = 0; index < ballArr.length; index++) {
  9707. temp = ballArr[index];
  9708. if (temp.number == rootBall.number)
  9709. continue;
  9710. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9711. if (isIntersect) {
  9712. break;
  9713. }
  9714. }
  9715. return isIntersect;
  9716. }
  9717. hideBallUI() {
  9718. let d2Gan = xGame.common.d2World.d2Gan;
  9719. if (!d2Gan.ui.isDisposed)
  9720. d2Gan.ui.visible = false;
  9721. let d2Help = xGame.common.d2World.d2HelpLine;
  9722. if (!d2Help.ui.isDisposed)
  9723. d2Help.ui.visible = false;
  9724. let rootBall = xGame.common.d2World.rootBall;
  9725. if (!rootBall.destroyed) {
  9726. rootBall.gameObj.active = false;
  9727. }
  9728. }
  9729. showBallUI() {
  9730. let d2Gan = xGame.common.d2World.d2Gan;
  9731. if (!d2Gan.ui.isDisposed)
  9732. d2Gan.ui.visible = true;
  9733. let d2Help = xGame.common.d2World.d2HelpLine;
  9734. if (!d2Help.ui.isDisposed)
  9735. d2Help.ui.visible = true;
  9736. let rootBall = xGame.common.d2World.rootBall;
  9737. if (!rootBall.destroyed) {
  9738. rootBall.gameObj.active = true;
  9739. }
  9740. }
  9741. moveToClickDot(e) {
  9742. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9743. let root = xGame.common.d2World.rootBall.gameObj;
  9744. let xx = e.stageX - xGame.common.sysOffestNum;
  9745. let yy = e.stageY;
  9746. let x = xx - root.x;
  9747. let y = yy - root.y;
  9748. let angle = xGame.common.getfguiRotation(x, y);
  9749. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9750. xGame.common.d2World.getHelpLine();
  9751. }
  9752. this.isMoveRod = false;
  9753. xGame.common.clickedBall = false;
  9754. }
  9755. openAllEvent() {
  9756. this.closeAllEvent();
  9757. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9758. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9759. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9760. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9761. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9762. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9763. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9764. }
  9765. closeAllEvent() {
  9766. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9767. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9768. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9769. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9770. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9771. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9772. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9773. }
  9774. resetGame() {
  9775. this.closeAllEvent();
  9776. this.hideBallUI();
  9777. xGame.common.gameMgr.gamePause = true;
  9778. }
  9779. }
  9780. UIGame.uiName = "UIGame";
  9781. class UIAddProp extends UIBase {
  9782. constructor() {
  9783. super();
  9784. this.curType = "";
  9785. }
  9786. onConstructor() {
  9787. this.ui = ui_UIAddProp.createInstance();
  9788. this.contentPane = this.ui;
  9789. this.isEject = false;
  9790. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9791. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9792. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9793. this.updateUI();
  9794. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9795. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9796. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9797. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9798. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9799. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9800. }
  9801. show(type) {
  9802. super.show();
  9803. this.curType = type == 0 ? "coin" : "diamond";
  9804. this.switchBtn("");
  9805. this.ui.t0.play();
  9806. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9807. PlatMgr.showInsert(true);
  9808. }
  9809. closeSelf() {
  9810. this.hide();
  9811. }
  9812. updateUI() {
  9813. let data = cfgTable.moneyData;
  9814. let temp;
  9815. let obj;
  9816. for (const key in data) {
  9817. temp = data[key];
  9818. obj = this.ui.myNode["node" + key];
  9819. if (parseInt(key) <= 2) {
  9820. obj.diamondTxt.text = "+" + temp.num;
  9821. }
  9822. else {
  9823. obj.coinTxt.text = temp.num;
  9824. obj.diamondTxt.text = temp.get.split('_')[1];
  9825. }
  9826. }
  9827. this.updateDiamondShare();
  9828. }
  9829. updateDiamondShare() {
  9830. let data = DataMgr.getShareDiamondTimes();
  9831. if (data >= xGame.common.maxShareDiamondTimes) {
  9832. this.ui.myNode.node1.shareTxt.text = "明日再来";
  9833. this.ui.myNode.node1.touchable = false;
  9834. }
  9835. else {
  9836. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  9837. this.ui.myNode.node1.touchable = true;
  9838. }
  9839. }
  9840. switchBtn(type) {
  9841. if (type == "")
  9842. type = this.curType;
  9843. else {
  9844. if (this.curType == type) {
  9845. return;
  9846. }
  9847. else {
  9848. this.curType = type;
  9849. }
  9850. }
  9851. if (type == "coin") {
  9852. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  9853. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  9854. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  9855. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  9856. this.ui.myNode.c1.selectedIndex = 0;
  9857. }
  9858. else {
  9859. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  9860. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  9861. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  9862. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  9863. this.ui.myNode.c1.selectedIndex = 1;
  9864. }
  9865. }
  9866. convertCoin(index) {
  9867. let data = cfgTable.moneyData[index];
  9868. let coinNum = data.num;
  9869. let str = data.get.split('_')[1];
  9870. let needDiamond = parseInt(str);
  9871. if (DataMgr.diamondEnough(needDiamond)) {
  9872. DataMgr.setDiamond(-needDiamond);
  9873. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  9874. xGame.uiMgr.Show(UIMsg, "兑换成功!");
  9875. }
  9876. else {
  9877. xGame.uiMgr.Show(UIMsg, "钻石不足~");
  9878. this.switchBtn("diamond");
  9879. }
  9880. }
  9881. videoGetDiamond() {
  9882. let num = cfgTable.moneyData[2].num;
  9883. Moyu.showVideoAd(() => {
  9884. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9885. this.closeSelf();
  9886. }, EAdType.addDiamond);
  9887. }
  9888. videoGetCoin() {
  9889. Moyu.showVideoAd(() => {
  9890. xGame.common.playObjFlyAnim(2000, Prop.coin);
  9891. this.closeSelf();
  9892. }, EAdType.addCoin);
  9893. }
  9894. shareGetDiamond() {
  9895. let times = DataMgr.getShareDiamondTimes();
  9896. if (times >= xGame.common.maxShareDiamondTimes) {
  9897. xGame.uiMgr.Show(UIMsg, "明日再来~");
  9898. }
  9899. else {
  9900. if (Moyu.isTT) {
  9901. let num = cfgTable.moneyData[1].num;
  9902. Moyu.shareVideo = '';
  9903. Moyu.shareGame((success) => {
  9904. if (success) {
  9905. xGame.uiMgr.Show(UIMsg, "分享成功!");
  9906. xGame.common.playObjFlyAnim(num, Prop.diamond);
  9907. DataMgr.setShareDiamondTimes(1);
  9908. this.updateDiamondShare();
  9909. }
  9910. else {
  9911. xGame.uiMgr.Show(UIMsg, "分享失败!");
  9912. }
  9913. });
  9914. }
  9915. else {
  9916. Moyu.showVideoAd(() => {
  9917. let diamond = xGame.common.randomNum(50, 100);
  9918. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  9919. DataMgr.setShareDiamondTimes(1);
  9920. this.updateDiamondShare();
  9921. }, EAdType.randomDiamond);
  9922. }
  9923. }
  9924. }
  9925. openPutBallView() {
  9926. let end = xGame.uiMgr.getUI(UIGameEnd);
  9927. let skill = xGame.uiMgr.getUI(UISkill);
  9928. let level = xGame.uiMgr.getUI(UILevelDisplay);
  9929. let uigame = xGame.uiMgr.getUI(UIGame);
  9930. if (end && !end.isHide) {
  9931. xGame.uiMgr.Hide(UIGameEnd);
  9932. xGame.uiMgr.Show(UIMain);
  9933. }
  9934. if (skill && !skill.isHide)
  9935. xGame.uiMgr.Hide(UISkill);
  9936. if (uigame && !uigame.isHide)
  9937. xGame.uiMgr.Hide(UIGame);
  9938. if (level && !level.isHide) {
  9939. }
  9940. else {
  9941. xGame.uiMgr.Show(UILevelDisplay);
  9942. }
  9943. this.closeSelf();
  9944. }
  9945. }
  9946. UIAddProp.uiName = "UIAddProp";
  9947. class MoneyNode {
  9948. constructor(ui) {
  9949. this.leftTime = 0;
  9950. this.ui = ui;
  9951. this.ui.addCoinBtn.onClick(this, this.addCoin);
  9952. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  9953. this.ui.addPowerBtn.onClick(this, this.addPower);
  9954. this.ui.c1.selectedIndex = 1;
  9955. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  9956. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  9957. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  9958. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  9959. this.coinChange();
  9960. this.diamondChange();
  9961. this.powerChange();
  9962. }
  9963. addPower() {
  9964. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9965. xGame.uiMgr.Show(UIPower);
  9966. }
  9967. powerChange() {
  9968. let powerNum = DataMgr.getPower();
  9969. this.ui.powerTxt.text = powerNum + "";
  9970. }
  9971. checkPowerTime() {
  9972. let cur = new Date().getTime();
  9973. let last = DataMgr.getPowerTime();
  9974. if (last == 0) {
  9975. last = cur;
  9976. DataMgr.setPowerTime(cur);
  9977. }
  9978. let power = DataMgr.getPower();
  9979. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  9980. Laya.timer.clearAll(this);
  9981. if (power >= xGame.common.natureMaxPower) {
  9982. this.ui.powerTimeTxt.text = "";
  9983. DataMgr.setPowerTime(cur);
  9984. return;
  9985. }
  9986. if (power + offset >= xGame.common.natureMaxPower) {
  9987. DataMgr.setPower(xGame.common.natureMaxPower, false);
  9988. this.ui.powerTimeTxt.text = "";
  9989. DataMgr.setPowerTime(cur);
  9990. }
  9991. else {
  9992. if (offset > 0) {
  9993. DataMgr.setPower(offset);
  9994. DataMgr.setPowerTime(cur);
  9995. }
  9996. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  9997. this.leftTime = xGame.common.powerRecoverNum - time;
  9998. if (this.leftTime <= 0)
  9999. this.leftTime = 0;
  10000. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10001. Laya.timer.loop(1000, this, this.updatePowerTime);
  10002. }
  10003. }
  10004. updatePowerTime() {
  10005. this.leftTime -= 1;
  10006. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10007. if (this.leftTime <= 0) {
  10008. this.checkPowerTime();
  10009. }
  10010. }
  10011. coinChange() {
  10012. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10013. }
  10014. diamondChange() {
  10015. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10016. }
  10017. addCoin() {
  10018. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10019. Moyu.sendDataEvent("AddCoinBtn");
  10020. xGame.uiMgr.Show(UIAddProp, 0);
  10021. }
  10022. addDiamond() {
  10023. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10024. Moyu.sendDataEvent("AddDiamondBtn");
  10025. xGame.uiMgr.Show(UIAddProp, 1);
  10026. }
  10027. }
  10028. class UIDraw extends UIBase {
  10029. constructor() {
  10030. super();
  10031. this.curKey = 0;
  10032. }
  10033. onConstructor() {
  10034. this.ui = ui_UIDraw.createInstance();
  10035. this.contentPane = this.ui;
  10036. this.isEject = false;
  10037. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10038. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10039. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10040. this.initDraw();
  10041. this.initUI();
  10042. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10043. if (Moyu.isKs)
  10044. this.ui.closeNode.closeBtn.x += 100;
  10045. }
  10046. show() {
  10047. super.show();
  10048. this.ui.t0.play();
  10049. this.playSecretaryIdle();
  10050. this.updateDraw();
  10051. this.checkFree();
  10052. if (PlatMgr.bannerDelay > 0) {
  10053. this.ui.closeNode.closeBtn.visible = false;
  10054. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10055. this.ui.closeNode.closeBtn.visible = true;
  10056. });
  10057. }
  10058. PlatMgr.showRateBanner();
  10059. }
  10060. hide() {
  10061. Laya.timer.clearAll(this);
  10062. super.hide();
  10063. }
  10064. checkFree() {
  10065. let isFree = DataMgr.getDailyfreeDrawTimes();
  10066. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10067. }
  10068. initDraw() {
  10069. this.drawObj = [];
  10070. let data = cfgTable.drawData;
  10071. let temp;
  10072. let weight = 0;
  10073. for (const key in data) {
  10074. temp = data[key];
  10075. weight += temp.weight;
  10076. this.drawObj.push(weight);
  10077. }
  10078. this.allWeight = weight;
  10079. }
  10080. initUI() {
  10081. let data = cfgTable.drawData;
  10082. let temp;
  10083. let img;
  10084. let txt;
  10085. for (const key in data) {
  10086. temp = data[key];
  10087. img = this.ui.myNode.rotNode["img" + key];
  10088. txt = this.ui.myNode.rotNode["txt" + key];
  10089. img.url = xGame.common.getGameIconUrl(temp.icon);
  10090. txt.visible = true;
  10091. if (temp.award > 2) {
  10092. img.rotation = 0;
  10093. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10094. }
  10095. else {
  10096. img.rotation = temp.rotation;
  10097. txt.text = temp.num;
  10098. }
  10099. }
  10100. }
  10101. getCurkey() {
  10102. let rand = Math.random() * this.allWeight;
  10103. let temp;
  10104. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10105. temp = this.drawObj[index];
  10106. if (index == 0) {
  10107. if (rand < temp) {
  10108. return index + 1;
  10109. }
  10110. }
  10111. else {
  10112. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10113. return index + 1;
  10114. }
  10115. }
  10116. }
  10117. return 2;
  10118. }
  10119. startDraw() {
  10120. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10121. if (freeTimes > 0) {
  10122. this.beginDraw();
  10123. DataMgr.setDailyfreeDrawTimes(0);
  10124. this.checkFree();
  10125. }
  10126. else {
  10127. Moyu.sendDataEvent("turntable");
  10128. Moyu.showVideoAd(() => {
  10129. this.beginDraw();
  10130. }, EAdType.draw);
  10131. }
  10132. }
  10133. beginDraw() {
  10134. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10135. this.ui.drawBtn.touchable = false;
  10136. this.curKey = this.getCurkey();
  10137. console.log("当前key", this.curKey);
  10138. let cell = 60;
  10139. let lap = 3;
  10140. let angle = cell * (this.curKey - 1) + lap * 360;
  10141. let target = this.ui.myNode.rotNode;
  10142. target.rotation = 0;
  10143. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10144. console.log("旋转完成");
  10145. this.ui.drawBtn.touchable = true;
  10146. this.getAward();
  10147. }));
  10148. }
  10149. getAward() {
  10150. let data = cfgTable.drawData[this.curKey];
  10151. let temp = new AwardType();
  10152. temp.type = data.award;
  10153. temp.num = data.num;
  10154. xGame.common.getAward([temp], () => {
  10155. DataMgr.setDrawTimes(1);
  10156. this.updateDraw();
  10157. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10158. });
  10159. }
  10160. updateDraw() {
  10161. let drawTimes = DataMgr.getDrawTimes();
  10162. let awardTimes = DataMgr.getDrawAwardTimes();
  10163. if (Math.floor(drawTimes / 3) > awardTimes) {
  10164. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10165. this.ui.extraNode.boxBtn.touchable = true;
  10166. this.ui.extraNode.tipsTxt.text = "3/3";
  10167. this.ui.extraNode.barNode.width = 265;
  10168. this.getExtraAward();
  10169. }
  10170. else {
  10171. this.ui.extraNode.boxBtn.t0.stop();
  10172. this.ui.extraNode.boxBtn.touchable = false;
  10173. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10174. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10175. }
  10176. let data = cfgTable.drawData[1];
  10177. if (awardTimes == 0) {
  10178. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10179. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10180. this.ui.myNode.rotNode.img1.rotation = 0;
  10181. }
  10182. else {
  10183. let award = data.nextid;
  10184. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10185. this.ui.myNode.rotNode.txt1.text = award[1];
  10186. this.ui.myNode.rotNode.img1.rotation = 0;
  10187. }
  10188. }
  10189. getExtraAward() {
  10190. let drawTimes = DataMgr.getDrawTimes();
  10191. let awardTimes = DataMgr.getDrawAwardTimes();
  10192. let data = cfgTable.drawData[1];
  10193. let award = new AwardType();
  10194. if (awardTimes == 0) {
  10195. award.num = data.num;
  10196. award.type = data.award;
  10197. xGame.common.getAward([award], () => {
  10198. let all = Math.floor(drawTimes / 3);
  10199. DataMgr.setDrawAwardTimes(all);
  10200. this.updateDraw();
  10201. });
  10202. }
  10203. else {
  10204. award.num = parseInt(data.nextid[1]);
  10205. award.type = parseInt(data.nextid[0]);
  10206. xGame.common.getAward([award], () => {
  10207. let all = Math.floor(drawTimes / 3);
  10208. DataMgr.setDrawAwardTimes(all);
  10209. this.updateDraw();
  10210. });
  10211. }
  10212. }
  10213. closeSelf() {
  10214. this.hide();
  10215. }
  10216. playSecretaryIdle() {
  10217. let parent = this.ui.secretary.displayObject;
  10218. parent.destroyChildren();
  10219. let xx = this.ui.secretary.width / 2;
  10220. let yy = this.ui.secretary.height;
  10221. let scale = xGame.common.getSecretaryScale();
  10222. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10223. xGame.common.secretary.play(data, 1, true, parent);
  10224. }
  10225. }
  10226. UIDraw.uiName = "UIDraw";
  10227. class ui_UIFlyEft extends fgui.GComponent {
  10228. static createInstance() {
  10229. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10230. }
  10231. onConstruct() {
  10232. this.n0 = (this.getChild("n0"));
  10233. this.n1 = (this.getChild("n1"));
  10234. this.n2 = (this.getChild("n2"));
  10235. this.n3 = (this.getChild("n3"));
  10236. this.n4 = (this.getChild("n4"));
  10237. this.n5 = (this.getChild("n5"));
  10238. this.n6 = (this.getChild("n6"));
  10239. this.n7 = (this.getChild("n7"));
  10240. this.iconNode = (this.getChild("iconNode"));
  10241. this.txt = (this.getChild("txt"));
  10242. this.txtNode = (this.getChild("txtNode"));
  10243. }
  10244. }
  10245. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10246. class UIFlyEft extends UIBase {
  10247. constructor() {
  10248. super();
  10249. this.max = 8;
  10250. this.delay = 0;
  10251. }
  10252. onConstructor() {
  10253. this.ui = ui_UIFlyEft.createInstance();
  10254. this.contentPane = this.ui;
  10255. this.isEject = false;
  10256. this.isMuti = true;
  10257. this.ui.x += xGame.common.sysOffestNum;
  10258. }
  10259. getArrPos() {
  10260. if (this.iconPos && this.iconPos.length > 0)
  10261. return;
  10262. this.iconPos = [];
  10263. let temp;
  10264. for (let index = 0; index < this.max; index++) {
  10265. temp = this.ui["n" + index];
  10266. this.iconPos.push([temp.x, temp.y]);
  10267. }
  10268. }
  10269. show(stPos, edPos, num, type, callback) {
  10270. super.show();
  10271. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10272. this.getArrPos();
  10273. this.updateUI(type);
  10274. this.updatePos();
  10275. this.runFly(edPos, callback);
  10276. this.runWorlds(stPos, num);
  10277. }
  10278. updateUI(type) {
  10279. let temp;
  10280. let str;
  10281. for (let index = 0; index < this.max; index++) {
  10282. temp = this.ui["n" + index];
  10283. str = this.getIconStr(type);
  10284. temp.url = xGame.common.getGameIconUrl(str);
  10285. }
  10286. }
  10287. getIconStr(type) {
  10288. switch (type) {
  10289. case Prop.diamond:
  10290. return "ty_zs";
  10291. case Prop.coin:
  10292. return "ty_jb";
  10293. default:
  10294. break;
  10295. }
  10296. }
  10297. updatePos() {
  10298. let temp;
  10299. for (let index = 0; index < this.max; index++) {
  10300. temp = this.ui["n" + index];
  10301. temp.x = this.iconPos[index][0];
  10302. temp.y = this.iconPos[index][1];
  10303. }
  10304. }
  10305. runFly(endPos, callback) {
  10306. let all = 0;
  10307. let temp;
  10308. for (let index = 0; index < this.max; index++) {
  10309. temp = this.ui["n" + index];
  10310. temp.visible = true;
  10311. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10312. temp.visible = false;
  10313. all++;
  10314. if (all >= this.max) {
  10315. callback && callback();
  10316. }
  10317. }), 20 * index);
  10318. }
  10319. }
  10320. runWorlds(stPos, num) {
  10321. let str = "+" + num;
  10322. this.ui.txt.text = str;
  10323. let starX = stPos.x;
  10324. let starY = stPos.y + 50;
  10325. this.ui.txt.x = starX;
  10326. this.ui.txt.y = starY;
  10327. this.ui.txt.visible = true;
  10328. this.ui.txt.alpha = 1;
  10329. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10330. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10331. this.ui.txt.visible = false;
  10332. this.hide();
  10333. }));
  10334. }));
  10335. }
  10336. }
  10337. UIFlyEft.uiName = "UIFlyEft";
  10338. class ui_UIGetAward extends fgui.GComponent {
  10339. static createInstance() {
  10340. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10341. }
  10342. onConstruct() {
  10343. this.n4 = (this.getChild("n4"));
  10344. this.n0 = (this.getChild("n0"));
  10345. this.myList = (this.getChild("myList"));
  10346. this.n1 = (this.getChild("n1"));
  10347. this.eftNode = (this.getChild("eftNode"));
  10348. this.btnNode = (this.getChild("btnNode"));
  10349. this.t0 = this.getTransition("t0");
  10350. }
  10351. }
  10352. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10353. class UIGetAward extends UIBase {
  10354. constructor() {
  10355. super();
  10356. this.showTriple = true;
  10357. }
  10358. onConstructor() {
  10359. this.ui = ui_UIGetAward.createInstance();
  10360. this.contentPane = this.ui;
  10361. this.isEject = false;
  10362. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10363. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10364. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10365. }
  10366. show(arr, showTriple, callback) {
  10367. super.show();
  10368. this.ui.t0.play();
  10369. this.ui.eftNode.visible = true;
  10370. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10371. this.ui.eftNode.visible = false;
  10372. }), 1, 0, 0, 0.9);
  10373. this.awardArr = arr;
  10374. this.showTriple = showTriple;
  10375. this.callback = callback;
  10376. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10377. this.ui.myList.numItems = arr.length;
  10378. xGame.soundMgr.playSound("getaward");
  10379. }
  10380. updateSelf(index, obj) {
  10381. let temp = this.awardArr[index];
  10382. let icon = this.getIcon(temp.type);
  10383. let str = icon;
  10384. if (temp.type > 2) {
  10385. str = "s" + icon;
  10386. }
  10387. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10388. obj.myIcon.rotation = 0;
  10389. obj.numTxt.text = temp.num + "";
  10390. obj.numTxt.visible = temp.type > 2 ? false : true;
  10391. obj.nameTxt.text = this.getNameStr(temp.type);
  10392. }
  10393. renderItem(index, obj) {
  10394. this.updateSelf(index, obj);
  10395. }
  10396. tripleGetAward() {
  10397. Moyu.showVideoAd(() => {
  10398. this.getAward(3);
  10399. }, EAdType.triple);
  10400. }
  10401. normalGetAward() {
  10402. if (PlatMgr.isMisVideo())
  10403. this.tripleGetAward();
  10404. else
  10405. this.getAward();
  10406. }
  10407. getAward(times = 1) {
  10408. this.hide();
  10409. for (let index = 0; index < this.awardArr.length; index++) {
  10410. this.awardArr[index].num *= times;
  10411. }
  10412. this.callback && this.callback(times != 1);
  10413. }
  10414. getIcon(type) {
  10415. switch (type) {
  10416. case Prop.diamond:
  10417. return "ty_zs";
  10418. case Prop.coin:
  10419. return "ty_jb";
  10420. case Prop.gan1:
  10421. return "qg1";
  10422. case Prop.gan2:
  10423. return "qg2";
  10424. case Prop.gan3:
  10425. return "qg3";
  10426. case Prop.gan4:
  10427. return "qg4";
  10428. default:
  10429. break;
  10430. }
  10431. }
  10432. getNameStr(type) {
  10433. switch (type) {
  10434. case Prop.diamond:
  10435. return "钻石";
  10436. case Prop.coin:
  10437. return "金币";
  10438. case Prop.gan1:
  10439. case Prop.gan2:
  10440. case Prop.gan3:
  10441. case Prop.gan4:
  10442. return cfgTable.ballrodData[type - 1].name;
  10443. default:
  10444. break;
  10445. }
  10446. }
  10447. }
  10448. UIGetAward.uiName = "UIGetAward";
  10449. class Common {
  10450. constructor() {
  10451. this.convertNum = 0.025;
  10452. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10453. this.scaleV3One = new Laya.Vector3();
  10454. this.scaleV3Two = new Laya.Vector3();
  10455. this.posV4 = new Laya.Vector4();
  10456. this.showDebug = false;
  10457. this.openGuide = true;
  10458. this.rodOffest = new Laya.Vector2(0, 0);
  10459. this.rodAngle = 0;
  10460. this.gameMode = GameMode.classic;
  10461. this.bigMoveLevelIndex = 1;
  10462. this.bigMoveNeedCoin = 1000;
  10463. this.classicNiceNeddCoin = 1000;
  10464. this.passAwardCoin = 2000;
  10465. this.classicRoomType = 1;
  10466. this.maxPower = 20;
  10467. this.natureMaxPower = 5;
  10468. this.videoPower = 2;
  10469. this.powerRecoverNum = 900;
  10470. this.curPlayerSkillType = 0;
  10471. this.isNewDay = false;
  10472. this.clickedBall = false;
  10473. this.placeBallCurLevel = 0;
  10474. this.placeBallStarNum = 0;
  10475. this.longHelpLine = false;
  10476. this.maxShareDiamondTimes = 3;
  10477. this.guideStep = 0;
  10478. this.temSelfLevel = 0;
  10479. this.extraMoveNum = 0;
  10480. this.curRankID = 0;
  10481. this.rankID = {
  10482. normalStar: 12000,
  10483. wxStar: 12001
  10484. };
  10485. this.skillNameList = ["从天而降", "横扫千军", "冰冻杆法", "关公杆法"];
  10486. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4", "gf_jn6"];
  10487. this.btnClickStr = "buttonclick";
  10488. this.maxSkillLevel = 10;
  10489. this.upSkillLevel = false;
  10490. this.gameStartTime = 0;
  10491. this._sysOffestNum = 0;
  10492. this.angleV2 = new Laya.Vector2();
  10493. this.rootV = new Laya.Vector2(0, 1);
  10494. this.tempDir1 = new Laya.Vector2();
  10495. this.tempDir2 = new Laya.Vector2();
  10496. this.ballSize = 33;
  10497. this.stPos = new Laya.Point();
  10498. this.edPos = new Laya.Point();
  10499. Common._instance = this;
  10500. window["common"] = this;
  10501. }
  10502. static getInstance() {
  10503. if (!this._instance) {
  10504. this._instance = new Common();
  10505. }
  10506. return this._instance;
  10507. }
  10508. get sysOffestNum() {
  10509. if (this._sysOffestNum == 0) {
  10510. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10511. }
  10512. return this._sysOffestNum;
  10513. }
  10514. testShader() {
  10515. let test = new LightShader();
  10516. test.texture = "res/d3Res/ballTexture/ball1.png";
  10517. Laya.stage.addChild(test);
  10518. }
  10519. playScale(node) {
  10520. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10521. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10522. }));
  10523. }));
  10524. }
  10525. setGroup(colli, ...group) {
  10526. let out = 0;
  10527. for (let index = 0; index < group.length; index++) {
  10528. if (index == 0) {
  10529. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10530. }
  10531. else {
  10532. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10533. }
  10534. }
  10535. colli.collisionGroup = out;
  10536. }
  10537. setCanGroupWith(colli, ...group) {
  10538. let out = 0;
  10539. for (let index = 0; index < group.length; index++) {
  10540. if (index == 0) {
  10541. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10542. }
  10543. else {
  10544. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10545. }
  10546. }
  10547. colli.canCollideWith = out;
  10548. }
  10549. loadPrefab(name, callback) {
  10550. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10551. let prefab = new Laya.Prefab();
  10552. prefab.json = obj;
  10553. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10554. callback && callback(img);
  10555. }));
  10556. }
  10557. pos2to3Convert(x, y, d3Pos) {
  10558. x = x + this.sysOffestNum;
  10559. d3Pos.setValue(x, y, 0);
  10560. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10561. if (success) {
  10562. }
  10563. else {
  10564. console.error("转换出错了。。。。。。。。");
  10565. }
  10566. }
  10567. scale2to3Convert(num) {
  10568. this.scaleV3One.setValue(0, 0, 0);
  10569. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10570. this.scaleV3Two.setValue(0, num, 0);
  10571. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10572. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10573. return outNum;
  10574. }
  10575. pos3to2Convert(d3Pos) {
  10576. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10577. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10578. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10579. d3Pos.x -= this.sysOffestNum;
  10580. }
  10581. scale3to2Convert(num) {
  10582. let scale = this.scale2to3Convert(1);
  10583. let d2Out = num / scale;
  10584. return d2Out;
  10585. }
  10586. getCollider(type, restitution = 0.9, density = 10) {
  10587. let colli;
  10588. if (type == "box")
  10589. colli = new Laya.BoxCollider();
  10590. else
  10591. colli = new Laya.CircleCollider();
  10592. colli.friction = 0;
  10593. colli.restitution = restitution;
  10594. colli.density = density;
  10595. return colli;
  10596. }
  10597. getRigbody() {
  10598. let rigy = new Laya.RigidBody();
  10599. rigy.bullet = true;
  10600. rigy.allowRotation = false;
  10601. rigy.allowSleep = false;
  10602. rigy.gravityScale = 0;
  10603. return rigy;
  10604. }
  10605. getfguiRotation(x, y) {
  10606. this.angleV2.setValue(x, y);
  10607. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10608. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10609. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10610. angle = -angle;
  10611. }
  10612. return 180 + angle;
  10613. }
  10614. getAngle(x, y) {
  10615. this.angleV2.setValue(x, y);
  10616. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10617. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10618. return angle;
  10619. }
  10620. randomNum(a, b) {
  10621. return a + Math.floor((b - a + 1) * Math.random());
  10622. }
  10623. getRandArrEle(arr) {
  10624. return arr[Math.floor(arr.length * Math.random())];
  10625. }
  10626. getSign(val) {
  10627. return val >= 0 ? 1 : -1;
  10628. }
  10629. botherArr(arr) {
  10630. let times = arr.length + 2;
  10631. let length = arr.length;
  10632. let a;
  10633. let b;
  10634. let temp;
  10635. for (let index = 0; index < times; index++) {
  10636. a = Math.floor(Math.random() * length);
  10637. b = Math.floor(Math.random() * length);
  10638. temp = arr[a];
  10639. arr[a] = arr[b];
  10640. arr[b] = temp;
  10641. }
  10642. }
  10643. getGameIconUrl(id) {
  10644. return "ui://game/" + id;
  10645. }
  10646. getComponentUrl(id) {
  10647. return "ui://game/" + id;
  10648. }
  10649. getAnimation() {
  10650. }
  10651. judgeSkillType(type = SkillType.highSpace) {
  10652. if (this.gameMode == GameMode.classic)
  10653. return;
  10654. let gameMgr = this.gameMgr;
  10655. if (gameMgr.selfTurn) {
  10656. if (gameMgr.selfCurSkill == type) {
  10657. return true;
  10658. }
  10659. }
  10660. else {
  10661. if (gameMgr.aiCurSkill == type) {
  10662. return true;
  10663. }
  10664. }
  10665. }
  10666. ballColliHole(collider) {
  10667. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10668. xGame.common.gameMgr.isFirstInGame = false;
  10669. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10670. }
  10671. collider.owner.mySrc.checkWrongBall();
  10672. }
  10673. getArrMaxEle(arr) {
  10674. let max = -Infinity;
  10675. for (let index = 0; index < arr.length; index++) {
  10676. max = Math.max(arr[index], max);
  10677. }
  10678. return max;
  10679. }
  10680. getArrMinEle(arr) {
  10681. let min = Infinity;
  10682. for (let index = 0; index < arr.length; index++) {
  10683. min = Math.min(arr[index], min);
  10684. }
  10685. return min;
  10686. }
  10687. playRandomMutiBallBigSkillSound() {
  10688. if (Math.random() <= 0.5)
  10689. return;
  10690. let rand = this.randomNum(1, 6);
  10691. let str = "ganfa0" + rand;
  10692. xGame.soundMgr.playSound(str);
  10693. }
  10694. showOneCamera(type) {
  10695. let object = xGame.common.d3World.cameraObj;
  10696. for (const key in object) {
  10697. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10698. object[key].init();
  10699. object[key].owner.active = key == type;
  10700. }
  10701. }
  10702. }
  10703. checkBallOverBorder(x, y) {
  10704. let radius = 17;
  10705. let condition = this._checkBorder(x + radius, y) ||
  10706. this._checkBorder(x - radius, y) ||
  10707. this._checkBorder(x, y + radius) ||
  10708. this._checkBorder(x, y - radius);
  10709. if (condition) {
  10710. return true;
  10711. }
  10712. }
  10713. _checkBorder(x, y) {
  10714. let borderRect = this.d2World.borderRect;
  10715. let xOffest = 20;
  10716. let yOffest = 20;
  10717. if (y <= borderRect.y - yOffest) {
  10718. return true;
  10719. }
  10720. if (y >= borderRect.y + borderRect.height + yOffest) {
  10721. return true;
  10722. }
  10723. if (x <= borderRect.x - xOffest) {
  10724. return true;
  10725. }
  10726. if (x >= borderRect.x + borderRect.width + xOffest) {
  10727. return true;
  10728. }
  10729. }
  10730. initWeight(cfg) {
  10731. let allCfgData = { data: {}, allWeightNum: 0 };
  10732. let weightCfg = allCfgData.data;
  10733. let weight = 0;
  10734. for (const key in cfg) {
  10735. weightCfg[key] = {};
  10736. weightCfg[key].id = cfg[key].id;
  10737. weightCfg[key].minWeight = weight;
  10738. weight += cfg[key].weight;
  10739. weightCfg[key].maxWeight = weight;
  10740. }
  10741. allCfgData.allWeightNum = weight;
  10742. return allCfgData;
  10743. }
  10744. getRandomWeightData(cfg) {
  10745. let weightCfg = cfg.data;
  10746. let allWeightNum = cfg.allWeightNum;
  10747. let rand = Math.floor(Math.random() * allWeightNum);
  10748. for (const key in weightCfg) {
  10749. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10750. return weightCfg[key];
  10751. }
  10752. }
  10753. return weightCfg[1];
  10754. }
  10755. showGirlTalkPop(wordsIndex, node, msgNode) {
  10756. node.visible = true;
  10757. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10758. node.t0.play(Laya.Handler.create(this, () => {
  10759. node.visible = false;
  10760. }));
  10761. }
  10762. stopGirlPop(node) {
  10763. node.t0.stop();
  10764. node.visible = false;
  10765. }
  10766. createHead(loader, url, size = 107) {
  10767. if (Laya.Browser.name == "Browser") {
  10768. loader.url = url;
  10769. return;
  10770. }
  10771. if (Moyu.isTT) {
  10772. let localImage = new Image();
  10773. localImage.src = url;
  10774. localImage.onload = () => {
  10775. let t2d = new Laya.Texture2D();
  10776. t2d.width = size;
  10777. t2d.height = size;
  10778. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10779. t2d.loadImageSource(localImage);
  10780. };
  10781. }
  10782. else {
  10783. loader.url = url;
  10784. }
  10785. }
  10786. addTestCoin(num) {
  10787. DataMgr.setCoin(num);
  10788. }
  10789. addTestDiamond(num) {
  10790. DataMgr.setDiamond(num);
  10791. }
  10792. addTestSkill() {
  10793. DataMgr.setBigSkill(0, 99);
  10794. DataMgr.setBigSkill(1, 99);
  10795. DataMgr.setBigSkill(2, 99);
  10796. }
  10797. playClassicEmotion(number, x, y) {
  10798. if (this.gameMode == GameMode.bigMove)
  10799. return;
  10800. let randIndex = this.randomNum(0, 2);
  10801. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10802. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10803. if (this.gameMgr.selfTurn) {
  10804. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10805. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10806. }
  10807. else {
  10808. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10809. }
  10810. else {
  10811. if (number == this.gameMgr.blackNum) {
  10812. if (this.gameMgr.selfBallArr.length == 0) {
  10813. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10814. }
  10815. else {
  10816. }
  10817. }
  10818. else {
  10819. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10820. }
  10821. }
  10822. }
  10823. }
  10824. else {
  10825. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10826. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10827. }
  10828. else {
  10829. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10830. }
  10831. else {
  10832. if (number == this.gameMgr.blackNum) {
  10833. if (this.gameMgr.aiBallArr.length == 0) {
  10834. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10835. }
  10836. else {
  10837. }
  10838. }
  10839. else {
  10840. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10841. }
  10842. }
  10843. }
  10844. }
  10845. }
  10846. playHappySound(number) {
  10847. if (this.gameMode != GameMode.classic)
  10848. return;
  10849. if (number == 8)
  10850. return;
  10851. let play = false;
  10852. if (this.gameMgr.selfTurn) {
  10853. if (this.gameMgr.ensureBallType) {
  10854. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10855. play = true;
  10856. }
  10857. }
  10858. else {
  10859. play = true;
  10860. }
  10861. }
  10862. else {
  10863. if (this.gameMgr.ensureBallType) {
  10864. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10865. play = true;
  10866. }
  10867. }
  10868. else {
  10869. play = true;
  10870. }
  10871. }
  10872. if (play)
  10873. xGame.soundMgr.playSound("applause");
  10874. }
  10875. destroyClassicEmotion() {
  10876. if (this.gameMode == GameMode.bigMove)
  10877. return;
  10878. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10879. parent.destroyChildren();
  10880. }
  10881. playAwardSpine(x, y) {
  10882. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10883. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10884. this.awardSpine.play(data, 0, false, parent);
  10885. }
  10886. destroyAwardSpine() {
  10887. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  10888. parent.destroyChildren();
  10889. }
  10890. isBlock(bx, by, hx, hy, except = null) {
  10891. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  10892. let balls = xGame.common.d2World.ballArr;
  10893. let outArr = [];
  10894. for (let index = 0; index < balls.length; index++) {
  10895. let obj = balls[index];
  10896. if (obj.number == 0)
  10897. continue;
  10898. if (obj == except)
  10899. continue;
  10900. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  10901. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  10902. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  10903. if (num >= 1)
  10904. num = 1;
  10905. if (num < 0)
  10906. continue;
  10907. let gap = Math.sin(Math.acos(num)) * dis;
  10908. if (gap < this.ballSize) {
  10909. outArr.push({
  10910. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  10911. disHon: Math.cos(Math.acos(num)) * dis,
  10912. disVer: Math.sin(Math.acos(num)) * dis,
  10913. src: balls[index],
  10914. dir: this.tempDir1
  10915. });
  10916. }
  10917. }
  10918. if (outArr.length > 0) {
  10919. outArr.sort((a, b) => { return a.dis - b.dis; });
  10920. return outArr[0];
  10921. }
  10922. }
  10923. AngleBetween(vector1, vector2) {
  10924. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  10925. return rad * (180 / Math.PI);
  10926. }
  10927. getSecretaryScale() {
  10928. if (this.secretary.spineName == "mishu") {
  10929. return 1.28;
  10930. }
  10931. else {
  10932. return 1.024;
  10933. }
  10934. }
  10935. signAwardContainsRod(arr) {
  10936. let temp;
  10937. for (let index = 0; index < arr.length; index++) {
  10938. temp = arr[index].split('-')[0];
  10939. if (parseInt(temp) > 2) {
  10940. return true;
  10941. }
  10942. }
  10943. }
  10944. judgeSameDay() {
  10945. let lastTime = DataMgr.getSignTime();
  10946. let curTime = new Date().getTime();
  10947. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  10948. return true;
  10949. }
  10950. return false;
  10951. }
  10952. getAward(arr, callback) {
  10953. let showTriple = arr[0].type <= 2;
  10954. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  10955. let temp;
  10956. for (let index = 0; index < arr.length; index++) {
  10957. temp = arr[index];
  10958. switch (temp.type) {
  10959. case 1:
  10960. this.playObjFlyAnim(temp.num, temp.type);
  10961. break;
  10962. case 2:
  10963. this.playObjFlyAnim(temp.num, temp.type);
  10964. break;
  10965. case 3:
  10966. case 4:
  10967. case 5:
  10968. case 6:
  10969. DataMgr.setBallRod(temp.type - 2, 1);
  10970. DataMgr.setCurBallRod(temp.type - 2);
  10971. break;
  10972. default:
  10973. break;
  10974. }
  10975. }
  10976. callback && callback(watchVideo);
  10977. });
  10978. }
  10979. getMoneyNode() {
  10980. let moneyNode;
  10981. let sign = xGame.uiMgr.getUI(UISign);
  10982. let draw = xGame.uiMgr.getUI(UIDraw);
  10983. let end = xGame.uiMgr.getUI(UIGameEnd);
  10984. let skill = xGame.uiMgr.getUI(UISkill);
  10985. if (sign && !sign.isHide)
  10986. moneyNode = sign.ui.moneyNode;
  10987. if (draw && !draw.isHide)
  10988. moneyNode = draw.ui.moneyNode;
  10989. if (end && !end.isHide)
  10990. moneyNode = end.ui.moneyNode;
  10991. if (skill && !skill.isHide)
  10992. moneyNode = skill.ui.moneyNode;
  10993. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  10994. let main = xGame.uiMgr.getUI(UIMain);
  10995. if (condition1 && main && !main.isHide) {
  10996. moneyNode = main.ui.moneyNode;
  10997. }
  10998. return moneyNode;
  10999. }
  11000. playObjFlyAnim(num, type, callback = null) {
  11001. this.stPos.x = Laya.stage.width / 2;
  11002. this.stPos.y = Laya.stage.height / 2;
  11003. let moneyNode = this.getMoneyNode();
  11004. switch (type) {
  11005. case Prop.diamond:
  11006. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11007. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11008. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11009. this.edPos.x /= 2;
  11010. this.edPos.y /= 2;
  11011. break;
  11012. case Prop.coin:
  11013. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11014. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11015. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11016. this.edPos.x /= 2;
  11017. this.edPos.y /= 2;
  11018. break;
  11019. default:
  11020. break;
  11021. }
  11022. xGame.soundMgr.playSound("coinbag");
  11023. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11024. switch (type) {
  11025. case Prop.diamond:
  11026. DataMgr.setDiamond(num);
  11027. break;
  11028. case Prop.coin:
  11029. DataMgr.setCoin(num);
  11030. break;
  11031. default:
  11032. break;
  11033. }
  11034. callback && callback();
  11035. });
  11036. }
  11037. autoPopUIView() {
  11038. let arr = [];
  11039. let sign = this.judgeSameDay() ? false : true;
  11040. if (sign)
  11041. arr.push("sign");
  11042. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11043. if (draw)
  11044. arr.push("draw");
  11045. if (arr.length <= 0)
  11046. return;
  11047. let str = this.getRandArrEle(arr);
  11048. switch (str) {
  11049. case "sign":
  11050. xGame.uiMgr.Show(UISign);
  11051. break;
  11052. case "draw":
  11053. xGame.uiMgr.Show(UIDraw);
  11054. break;
  11055. default:
  11056. break;
  11057. }
  11058. }
  11059. getMSTime(time) {
  11060. let min = Math.floor(time / 60);
  11061. let sec = Math.floor((time - min * 60));
  11062. if (sec < 10)
  11063. sec = "0" + sec;
  11064. if (min < 10)
  11065. min = "0" + min;
  11066. return `${min}:${sec}`;
  11067. }
  11068. testPower() {
  11069. DataMgr.setPower(0, false);
  11070. }
  11071. getAllStarNum() {
  11072. let data = DataMgr.getPlaceBallLevelList();
  11073. let out = 0;
  11074. for (let index = 0; index < data.length; index++) {
  11075. out += data[index].star;
  11076. }
  11077. return out;
  11078. }
  11079. recoverCameraView() {
  11080. Laya.timer.once(900, this, () => {
  11081. xGame.common.showOneCamera("mainCamera");
  11082. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11083. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11084. xGame.common.gameUI.ui.border.alpha = 0;
  11085. if (Laya.physicsTimer.scale < 1) {
  11086. Laya.physicsTimer.scale = 1;
  11087. }
  11088. }
  11089. });
  11090. }
  11091. getClassicLevel() {
  11092. let successTimes = DataMgr.getClassicTimes();
  11093. let needKey = "";
  11094. let lastKey = "";
  11095. let cfg = cfgTable.classictimesData;
  11096. let data;
  11097. for (const key in cfg) {
  11098. data = cfg[key];
  11099. if (successTimes <= data.times) {
  11100. needKey = key;
  11101. }
  11102. lastKey = key;
  11103. }
  11104. if (needKey == "")
  11105. needKey = lastKey;
  11106. return cfg[needKey];
  11107. }
  11108. }
  11109. Common._instance = null;
  11110. class ui_Component92 extends fgui.GComponent {
  11111. static createInstance() {
  11112. return (fgui.UIPackage.createObject("game", "Component92"));
  11113. }
  11114. onConstruct() {
  11115. this.n0 = (this.getChild("n0"));
  11116. }
  11117. }
  11118. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11119. class ui_Component129 extends fgui.GProgressBar {
  11120. static createInstance() {
  11121. return (fgui.UIPackage.createObject("game", "Component129"));
  11122. }
  11123. onConstruct() {
  11124. this.bar_v = (this.getChild("bar_v"));
  11125. this.n84 = (this.getChild("n84"));
  11126. }
  11127. }
  11128. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11129. class ui_Component130 extends fgui.GComponent {
  11130. static createInstance() {
  11131. return (fgui.UIPackage.createObject("game", "Component130"));
  11132. }
  11133. onConstruct() {
  11134. this.ani = (this.getChild("ani"));
  11135. this.t0 = this.getTransition("t0");
  11136. }
  11137. }
  11138. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11139. class ui_powerEft extends fgui.GComponent {
  11140. static createInstance() {
  11141. return (fgui.UIPackage.createObject("game", "powerEft"));
  11142. }
  11143. onConstruct() {
  11144. this.ani = (this.getChild("ani"));
  11145. this.n88 = (this.getChild("n88"));
  11146. this.n89 = (this.getChild("n89"));
  11147. }
  11148. }
  11149. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11150. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11151. static createInstance() {
  11152. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11153. }
  11154. onConstruct() {
  11155. this.c1 = this.getController("c1");
  11156. this.n2 = (this.getChild("n2"));
  11157. this.n22 = (this.getChild("n22"));
  11158. this.n23 = (this.getChild("n23"));
  11159. this.n15 = (this.getChild("n15"));
  11160. this.challenge = (this.getChild("challenge"));
  11161. this.n17 = (this.getChild("n17"));
  11162. this.n3 = (this.getChild("n3"));
  11163. this.starNode = (this.getChild("starNode"));
  11164. this.levelTxt = (this.getChild("levelTxt"));
  11165. this.n14 = (this.getChild("n14"));
  11166. this.n19 = (this.getChild("n19"));
  11167. this.n20 = (this.getChild("n20"));
  11168. this.n21 = (this.getChild("n21"));
  11169. this.special = (this.getChild("special"));
  11170. }
  11171. }
  11172. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11173. class ui_Component79 extends fgui.GComponent {
  11174. static createInstance() {
  11175. return (fgui.UIPackage.createObject("game", "Component79"));
  11176. }
  11177. onConstruct() {
  11178. this.c1 = this.getController("c1");
  11179. this.n7 = (this.getChild("n7"));
  11180. this.n8 = (this.getChild("n8"));
  11181. this.n9 = (this.getChild("n9"));
  11182. this.n10 = (this.getChild("n10"));
  11183. this.n11 = (this.getChild("n11"));
  11184. this.n12 = (this.getChild("n12"));
  11185. }
  11186. }
  11187. ui_Component79.URL = "ui://isxx5ak7avag477";
  11188. class ui_Component80 extends fgui.GComponent {
  11189. static createInstance() {
  11190. return (fgui.UIPackage.createObject("game", "Component80"));
  11191. }
  11192. onConstruct() {
  11193. this.n0 = (this.getChild("n0"));
  11194. this.n1 = (this.getChild("n1"));
  11195. this.myList = (this.getChild("myList"));
  11196. this.t0 = this.getTransition("t0");
  11197. }
  11198. }
  11199. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11200. class ui_SignNormal extends fgui.GComponent {
  11201. static createInstance() {
  11202. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11203. }
  11204. onConstruct() {
  11205. this.c1 = this.getController("c1");
  11206. this.n7 = (this.getChild("n7"));
  11207. this.n15 = (this.getChild("n15"));
  11208. this.titleTxt = (this.getChild("titleTxt"));
  11209. this.n8 = (this.getChild("n8"));
  11210. this.myIcon = (this.getChild("myIcon"));
  11211. this.numTxt = (this.getChild("numTxt"));
  11212. this.n12 = (this.getChild("n12"));
  11213. this.n13 = (this.getChild("n13"));
  11214. this.n17 = (this.getChild("n17"));
  11215. this.n14 = (this.getChild("n14"));
  11216. }
  11217. }
  11218. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11219. class ui_screenNode extends fgui.GComponent {
  11220. static createInstance() {
  11221. return (fgui.UIPackage.createObject("game", "screenNode"));
  11222. }
  11223. onConstruct() {
  11224. this.n9 = (this.getChild("n9"));
  11225. this.screenImg = (this.getChild("screenImg"));
  11226. }
  11227. }
  11228. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11229. class ui_GetAwrad_com1 extends fgui.GComponent {
  11230. static createInstance() {
  11231. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11232. }
  11233. onConstruct() {
  11234. this.n38 = (this.getChild("n38"));
  11235. this.n39 = (this.getChild("n39"));
  11236. this.n40 = (this.getChild("n40"));
  11237. this.t0 = this.getTransition("t0");
  11238. this.t1 = this.getTransition("t1");
  11239. }
  11240. }
  11241. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11242. class ui_GetAwrad_com2 extends fgui.GComponent {
  11243. static createInstance() {
  11244. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11245. }
  11246. onConstruct() {
  11247. this.n39 = (this.getChild("n39"));
  11248. this.n40 = (this.getChild("n40"));
  11249. this.t0 = this.getTransition("t0");
  11250. }
  11251. }
  11252. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11253. class ui_Component128 extends fgui.GComponent {
  11254. static createInstance() {
  11255. return (fgui.UIPackage.createObject("game", "Component128"));
  11256. }
  11257. onConstruct() {
  11258. this.n38 = (this.getChild("n38"));
  11259. this.n40 = (this.getChild("n40"));
  11260. }
  11261. }
  11262. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11263. class ui_Component100_1 extends fgui.GComponent {
  11264. static createInstance() {
  11265. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11266. }
  11267. onConstruct() {
  11268. this.myNode = (this.getChild("myNode"));
  11269. this.t0 = this.getTransition("t0");
  11270. }
  11271. }
  11272. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11273. class ui_Component142 extends fgui.GComponent {
  11274. static createInstance() {
  11275. return (fgui.UIPackage.createObject("game", "Component142"));
  11276. }
  11277. onConstruct() {
  11278. this.n41 = (this.getChild("n41"));
  11279. this.n42 = (this.getChild("n42"));
  11280. }
  11281. }
  11282. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11283. class ui_main_guang extends fgui.GComponent {
  11284. static createInstance() {
  11285. return (fgui.UIPackage.createObject("game", "main_guang"));
  11286. }
  11287. onConstruct() {
  11288. this.n1 = (this.getChild("n1"));
  11289. this.n2 = (this.getChild("n2"));
  11290. this.n3 = (this.getChild("n3"));
  11291. this.n4 = (this.getChild("n4"));
  11292. this.n5 = (this.getChild("n5"));
  11293. this.n6 = (this.getChild("n6"));
  11294. this.n8 = (this.getChild("n8"));
  11295. this.t0 = this.getTransition("t0");
  11296. }
  11297. }
  11298. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11299. class ui_try_com1 extends fgui.GComponent {
  11300. static createInstance() {
  11301. return (fgui.UIPackage.createObject("game", "try_com1"));
  11302. }
  11303. onConstruct() {
  11304. this.c1 = this.getController("c1");
  11305. this.n0 = (this.getChild("n0"));
  11306. this.n2 = (this.getChild("n2"));
  11307. this.cancelBtn = (this.getChild("cancelBtn"));
  11308. this.videoBtn = (this.getChild("videoBtn"));
  11309. this.n9 = (this.getChild("n9"));
  11310. this.n24 = (this.getChild("n24"));
  11311. this.titleTxt = (this.getChild("titleTxt"));
  11312. this.n32 = (this.getChild("n32"));
  11313. this.n29 = (this.getChild("n29"));
  11314. this.n36 = (this.getChild("n36"));
  11315. this.txtTime = (this.getChild("txtTime"));
  11316. this.t0 = this.getTransition("t0");
  11317. }
  11318. }
  11319. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11320. class ui_try_com2 extends fgui.GComponent {
  11321. static createInstance() {
  11322. return (fgui.UIPackage.createObject("game", "try_com2"));
  11323. }
  11324. onConstruct() {
  11325. this.skillicon = (this.getChild("skillicon"));
  11326. this.n35 = (this.getChild("n35"));
  11327. this.n31 = (this.getChild("n31"));
  11328. this.n32 = (this.getChild("n32"));
  11329. this.n33 = (this.getChild("n33"));
  11330. this.n34 = (this.getChild("n34"));
  11331. }
  11332. }
  11333. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11334. class ui_try_com3 extends fgui.GComponent {
  11335. static createInstance() {
  11336. return (fgui.UIPackage.createObject("game", "try_com3"));
  11337. }
  11338. onConstruct() {
  11339. this.n33 = (this.getChild("n33"));
  11340. this.n34 = (this.getChild("n34"));
  11341. this.n35 = (this.getChild("n35"));
  11342. this.t0 = this.getTransition("t0");
  11343. }
  11344. }
  11345. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11346. class ui_Component121 extends fgui.GButton {
  11347. static createInstance() {
  11348. return (fgui.UIPackage.createObject("game", "Component121"));
  11349. }
  11350. onConstruct() {
  11351. this.n3 = (this.getChild("n3"));
  11352. this.t0 = this.getTransition("t0");
  11353. }
  11354. }
  11355. ui_Component121.URL = "ui://isxx5ak7cy72v4ib";
  11356. class ui_huihe1 extends fgui.GComponent {
  11357. static createInstance() {
  11358. return (fgui.UIPackage.createObject("game", "huihe1"));
  11359. }
  11360. onConstruct() {
  11361. this.n0 = (this.getChild("n0"));
  11362. this.n1 = (this.getChild("n1"));
  11363. this.t0 = this.getTransition("t0");
  11364. }
  11365. }
  11366. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11367. class ui_huihe2 extends fgui.GComponent {
  11368. static createInstance() {
  11369. return (fgui.UIPackage.createObject("game", "huihe2"));
  11370. }
  11371. onConstruct() {
  11372. this.n0 = (this.getChild("n0"));
  11373. this.n1 = (this.getChild("n1"));
  11374. this.t0 = this.getTransition("t0");
  11375. }
  11376. }
  11377. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11378. class ui_Component143 extends fgui.GComponent {
  11379. static createInstance() {
  11380. return (fgui.UIPackage.createObject("game", "Component143"));
  11381. }
  11382. onConstruct() {
  11383. this.n3 = (this.getChild("n3"));
  11384. this.n4 = (this.getChild("n4"));
  11385. this.n5 = (this.getChild("n5"));
  11386. this.n6 = (this.getChild("n6"));
  11387. this.n7 = (this.getChild("n7"));
  11388. this.n8 = (this.getChild("n8"));
  11389. this.n9 = (this.getChild("n9"));
  11390. this.n10 = (this.getChild("n10"));
  11391. this.t0 = this.getTransition("t0");
  11392. }
  11393. }
  11394. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11395. class ui_dh_jingbi2 extends fgui.GComponent {
  11396. static createInstance() {
  11397. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11398. }
  11399. onConstruct() {
  11400. this.n0 = (this.getChild("n0"));
  11401. this.n1 = (this.getChild("n1"));
  11402. this.n2 = (this.getChild("n2"));
  11403. this.n3 = (this.getChild("n3"));
  11404. this.n4 = (this.getChild("n4"));
  11405. this.n5 = (this.getChild("n5"));
  11406. this.n6 = (this.getChild("n6"));
  11407. this.n8 = (this.getChild("n8"));
  11408. this.n10 = (this.getChild("n10"));
  11409. this.t0 = this.getTransition("t0");
  11410. }
  11411. }
  11412. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11413. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11414. static createInstance() {
  11415. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11416. }
  11417. onConstruct() {
  11418. this.n1 = (this.getChild("n1"));
  11419. this.n4 = (this.getChild("n4"));
  11420. this.t0 = this.getTransition("t0");
  11421. }
  11422. }
  11423. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11424. class ui_dh_jingbi3 extends fgui.GComponent {
  11425. static createInstance() {
  11426. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11427. }
  11428. onConstruct() {
  11429. this.n0 = (this.getChild("n0"));
  11430. this.n1 = (this.getChild("n1"));
  11431. this.n2 = (this.getChild("n2"));
  11432. this.n3 = (this.getChild("n3"));
  11433. this.n4 = (this.getChild("n4"));
  11434. this.n5 = (this.getChild("n5"));
  11435. this.n6 = (this.getChild("n6"));
  11436. this.n8 = (this.getChild("n8"));
  11437. this.n10 = (this.getChild("n10"));
  11438. this.t0 = this.getTransition("t0");
  11439. }
  11440. }
  11441. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11442. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11443. static createInstance() {
  11444. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11445. }
  11446. onConstruct() {
  11447. this.n3 = (this.getChild("n3"));
  11448. this.n1 = (this.getChild("n1"));
  11449. this.t0 = this.getTransition("t0");
  11450. }
  11451. }
  11452. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11453. class ui_hb_jinbi1 extends fgui.GButton {
  11454. static createInstance() {
  11455. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11456. }
  11457. onConstruct() {
  11458. this.n20 = (this.getChild("n20"));
  11459. this.n25 = (this.getChild("n25"));
  11460. this.coinTxt = (this.getChild("coinTxt"));
  11461. this.n28 = (this.getChild("n28"));
  11462. this.n32 = (this.getChild("n32"));
  11463. this.n38 = (this.getChild("n38"));
  11464. this.n45 = (this.getChild("n45"));
  11465. this.getTips = (this.getChild("getTips"));
  11466. this.n39 = (this.getChild("n39"));
  11467. this.diamondTxt = (this.getChild("diamondTxt"));
  11468. this.n41 = (this.getChild("n41"));
  11469. this.n42 = (this.getChild("n42"));
  11470. this.n46 = (this.getChild("n46"));
  11471. this.n47 = (this.getChild("n47"));
  11472. this.n48 = (this.getChild("n48"));
  11473. this.t0 = this.getTransition("t0");
  11474. }
  11475. }
  11476. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11477. class ui_hb_jinbi2 extends fgui.GButton {
  11478. static createInstance() {
  11479. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11480. }
  11481. onConstruct() {
  11482. this.n20 = (this.getChild("n20"));
  11483. this.n25 = (this.getChild("n25"));
  11484. this.coinTxt = (this.getChild("coinTxt"));
  11485. this.n28 = (this.getChild("n28"));
  11486. this.n32 = (this.getChild("n32"));
  11487. this.n38 = (this.getChild("n38"));
  11488. this.n39 = (this.getChild("n39"));
  11489. this.diamondTxt = (this.getChild("diamondTxt"));
  11490. this.n41 = (this.getChild("n41"));
  11491. this.n42 = (this.getChild("n42"));
  11492. this.n43 = (this.getChild("n43"));
  11493. this.n44 = (this.getChild("n44"));
  11494. this.n45 = (this.getChild("n45"));
  11495. this.t0 = this.getTransition("t0");
  11496. }
  11497. }
  11498. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11499. class ui_hb_jinbi3 extends fgui.GButton {
  11500. static createInstance() {
  11501. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11502. }
  11503. onConstruct() {
  11504. this.n20 = (this.getChild("n20"));
  11505. this.n25 = (this.getChild("n25"));
  11506. this.coinTxt = (this.getChild("coinTxt"));
  11507. this.n28 = (this.getChild("n28"));
  11508. this.n32 = (this.getChild("n32"));
  11509. this.n38 = (this.getChild("n38"));
  11510. this.n39 = (this.getChild("n39"));
  11511. this.diamondTxt = (this.getChild("diamondTxt"));
  11512. this.n41 = (this.getChild("n41"));
  11513. this.n42 = (this.getChild("n42"));
  11514. this.n43 = (this.getChild("n43"));
  11515. this.n44 = (this.getChild("n44"));
  11516. this.n45 = (this.getChild("n45"));
  11517. this.t0 = this.getTransition("t0");
  11518. }
  11519. }
  11520. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11521. class ui_Component104 extends fgui.GComponent {
  11522. static createInstance() {
  11523. return (fgui.UIPackage.createObject("game", "Component104"));
  11524. }
  11525. onConstruct() {
  11526. this.c1 = this.getController("c1");
  11527. this.n12 = (this.getChild("n12"));
  11528. this.coinBtn = (this.getChild("coinBtn"));
  11529. this.diamondBtn = (this.getChild("diamondBtn"));
  11530. this.node3 = (this.getChild("node3"));
  11531. this.node4 = (this.getChild("node4"));
  11532. this.node5 = (this.getChild("node5"));
  11533. this.node1 = (this.getChild("node1"));
  11534. this.node2 = (this.getChild("node2"));
  11535. this.node6 = (this.getChild("node6"));
  11536. this.t0 = this.getTransition("t0");
  11537. }
  11538. }
  11539. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11540. class ui_Component105 extends fgui.GButton {
  11541. static createInstance() {
  11542. return (fgui.UIPackage.createObject("game", "Component105"));
  11543. }
  11544. onConstruct() {
  11545. this.c1 = this.getController("c1");
  11546. this.n49 = (this.getChild("n49"));
  11547. this.n18 = (this.getChild("n18"));
  11548. this.n46 = (this.getChild("n46"));
  11549. this.n48 = (this.getChild("n48"));
  11550. }
  11551. }
  11552. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11553. class ui_Component106 extends fgui.GButton {
  11554. static createInstance() {
  11555. return (fgui.UIPackage.createObject("game", "Component106"));
  11556. }
  11557. onConstruct() {
  11558. this.c1 = this.getController("c1");
  11559. this.n49 = (this.getChild("n49"));
  11560. this.n18 = (this.getChild("n18"));
  11561. this.n46 = (this.getChild("n46"));
  11562. this.n48 = (this.getChild("n48"));
  11563. }
  11564. }
  11565. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11566. class ui_hb_zs1 extends fgui.GButton {
  11567. static createInstance() {
  11568. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11569. }
  11570. onConstruct() {
  11571. this.c1 = this.getController("c1");
  11572. this.n20 = (this.getChild("n20"));
  11573. this.n21 = (this.getChild("n21"));
  11574. this.n26 = (this.getChild("n26"));
  11575. this.n27 = (this.getChild("n27"));
  11576. this.shareTxt = (this.getChild("shareTxt"));
  11577. this.n32 = (this.getChild("n32"));
  11578. this.n38 = (this.getChild("n38"));
  11579. this.n39 = (this.getChild("n39"));
  11580. this.n44 = (this.getChild("n44"));
  11581. this.diamondTxt = (this.getChild("diamondTxt"));
  11582. this.n41 = (this.getChild("n41"));
  11583. this.n45 = (this.getChild("n45"));
  11584. this.n47 = (this.getChild("n47"));
  11585. this.n48 = (this.getChild("n48"));
  11586. this.randTxt = (this.getChild("randTxt"));
  11587. this.n50 = (this.getChild("n50"));
  11588. this.t0 = this.getTransition("t0");
  11589. }
  11590. }
  11591. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11592. class ui_dh_zs1 extends fgui.GComponent {
  11593. static createInstance() {
  11594. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11595. }
  11596. onConstruct() {
  11597. this.n10 = (this.getChild("n10"));
  11598. this.n9 = (this.getChild("n9"));
  11599. this.n1 = (this.getChild("n1"));
  11600. this.n2 = (this.getChild("n2"));
  11601. this.n3 = (this.getChild("n3"));
  11602. this.n4 = (this.getChild("n4"));
  11603. this.n5 = (this.getChild("n5"));
  11604. this.n6 = (this.getChild("n6"));
  11605. this.n8 = (this.getChild("n8"));
  11606. this.n11 = (this.getChild("n11"));
  11607. this.t0 = this.getTransition("t0");
  11608. }
  11609. }
  11610. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11611. class ui_dh_zs1_1 extends fgui.GComponent {
  11612. static createInstance() {
  11613. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11614. }
  11615. onConstruct() {
  11616. this.n3 = (this.getChild("n3"));
  11617. this.n1 = (this.getChild("n1"));
  11618. this.t0 = this.getTransition("t0");
  11619. }
  11620. }
  11621. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11622. class ui_hb_zs2 extends fgui.GButton {
  11623. static createInstance() {
  11624. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11625. }
  11626. onConstruct() {
  11627. this.n20 = (this.getChild("n20"));
  11628. this.n21 = (this.getChild("n21"));
  11629. this.n26 = (this.getChild("n26"));
  11630. this.n27 = (this.getChild("n27"));
  11631. this.n32 = (this.getChild("n32"));
  11632. this.n38 = (this.getChild("n38"));
  11633. this.n39 = (this.getChild("n39"));
  11634. this.n44 = (this.getChild("n44"));
  11635. this.diamondTxt = (this.getChild("diamondTxt"));
  11636. this.n41 = (this.getChild("n41"));
  11637. this.n45 = (this.getChild("n45"));
  11638. this.t0 = this.getTransition("t0");
  11639. }
  11640. }
  11641. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11642. class ui_hb_zs3 extends fgui.GButton {
  11643. static createInstance() {
  11644. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11645. }
  11646. onConstruct() {
  11647. this.n20 = (this.getChild("n20"));
  11648. this.n21 = (this.getChild("n21"));
  11649. this.n26 = (this.getChild("n26"));
  11650. this.n27 = (this.getChild("n27"));
  11651. this.n32 = (this.getChild("n32"));
  11652. this.n38 = (this.getChild("n38"));
  11653. this.n47 = (this.getChild("n47"));
  11654. this.t0 = this.getTransition("t0");
  11655. }
  11656. }
  11657. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11658. class ui_dh_zs2 extends fgui.GComponent {
  11659. static createInstance() {
  11660. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11661. }
  11662. onConstruct() {
  11663. this.n10 = (this.getChild("n10"));
  11664. this.n9 = (this.getChild("n9"));
  11665. this.n1 = (this.getChild("n1"));
  11666. this.n2 = (this.getChild("n2"));
  11667. this.n3 = (this.getChild("n3"));
  11668. this.n4 = (this.getChild("n4"));
  11669. this.n5 = (this.getChild("n5"));
  11670. this.n6 = (this.getChild("n6"));
  11671. this.n8 = (this.getChild("n8"));
  11672. this.n11 = (this.getChild("n11"));
  11673. this.t0 = this.getTransition("t0");
  11674. }
  11675. }
  11676. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11677. class ui_dh_zs2_1 extends fgui.GComponent {
  11678. static createInstance() {
  11679. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11680. }
  11681. onConstruct() {
  11682. this.n3 = (this.getChild("n3"));
  11683. this.n1 = (this.getChild("n1"));
  11684. this.t0 = this.getTransition("t0");
  11685. }
  11686. }
  11687. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11688. class ui_dh_zs3 extends fgui.GComponent {
  11689. static createInstance() {
  11690. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11691. }
  11692. onConstruct() {
  11693. this.n10 = (this.getChild("n10"));
  11694. this.n9 = (this.getChild("n9"));
  11695. this.n1 = (this.getChild("n1"));
  11696. this.n2 = (this.getChild("n2"));
  11697. this.n3 = (this.getChild("n3"));
  11698. this.n4 = (this.getChild("n4"));
  11699. this.n5 = (this.getChild("n5"));
  11700. this.n6 = (this.getChild("n6"));
  11701. this.n8 = (this.getChild("n8"));
  11702. this.n11 = (this.getChild("n11"));
  11703. this.t0 = this.getTransition("t0");
  11704. }
  11705. }
  11706. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11707. class ui_dh_zs3_1 extends fgui.GComponent {
  11708. static createInstance() {
  11709. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11710. }
  11711. onConstruct() {
  11712. this.n3 = (this.getChild("n3"));
  11713. this.n1 = (this.getChild("n1"));
  11714. this.t0 = this.getTransition("t0");
  11715. }
  11716. }
  11717. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11718. class ui_Component107 extends fgui.GComponent {
  11719. static createInstance() {
  11720. return (fgui.UIPackage.createObject("game", "Component107"));
  11721. }
  11722. onConstruct() {
  11723. this.n18 = (this.getChild("n18"));
  11724. this.n19 = (this.getChild("n19"));
  11725. this.n20 = (this.getChild("n20"));
  11726. this.n21 = (this.getChild("n21"));
  11727. this.n22 = (this.getChild("n22"));
  11728. this.levelTxt = (this.getChild("levelTxt"));
  11729. this.t0 = this.getTransition("t0");
  11730. }
  11731. }
  11732. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11733. class ui_box_com1 extends fgui.GComponent {
  11734. static createInstance() {
  11735. return (fgui.UIPackage.createObject("game", "box_com1"));
  11736. }
  11737. onConstruct() {
  11738. this.n14 = (this.getChild("n14"));
  11739. this.n6 = (this.getChild("n6"));
  11740. this.t0 = this.getTransition("t0");
  11741. }
  11742. }
  11743. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11744. class ui_box_com2 extends fgui.GProgressBar {
  11745. static createInstance() {
  11746. return (fgui.UIPackage.createObject("game", "box_com2"));
  11747. }
  11748. onConstruct() {
  11749. this.bg0 = (this.getChild("bg0"));
  11750. this.bg = (this.getChild("bg"));
  11751. this.bar = (this.getChild("bar"));
  11752. this.n7 = (this.getChild("n7"));
  11753. this.n8 = (this.getChild("n8"));
  11754. this.n10 = (this.getChild("n10"));
  11755. this.n11 = (this.getChild("n11"));
  11756. this.n12 = (this.getChild("n12"));
  11757. }
  11758. }
  11759. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11760. class ui_box_com4 extends fgui.GComponent {
  11761. static createInstance() {
  11762. return (fgui.UIPackage.createObject("game", "box_com4"));
  11763. }
  11764. onConstruct() {
  11765. this.n8 = (this.getChild("n8"));
  11766. this.t0 = this.getTransition("t0");
  11767. }
  11768. }
  11769. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11770. class ui_box_com3 extends fgui.GComponent {
  11771. static createInstance() {
  11772. return (fgui.UIPackage.createObject("game", "box_com3"));
  11773. }
  11774. onConstruct() {
  11775. this.n2 = (this.getChild("n2"));
  11776. this.n3 = (this.getChild("n3"));
  11777. this.n4 = (this.getChild("n4"));
  11778. this.n5 = (this.getChild("n5"));
  11779. this.t0 = this.getTransition("t0");
  11780. this.t1 = this.getTransition("t1");
  11781. }
  11782. }
  11783. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11784. class ui_Component97 extends fgui.GComponent {
  11785. static createInstance() {
  11786. return (fgui.UIPackage.createObject("game", "Component97"));
  11787. }
  11788. onConstruct() {
  11789. this.c1 = this.getController("c1");
  11790. this.n46 = (this.getChild("n46"));
  11791. this.diamondNode = (this.getChild("diamondNode"));
  11792. this.coinNode = (this.getChild("coinNode"));
  11793. this.t0 = this.getTransition("t0");
  11794. }
  11795. }
  11796. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11797. class ui_Component98 extends fgui.GButton {
  11798. static createInstance() {
  11799. return (fgui.UIPackage.createObject("game", "Component98"));
  11800. }
  11801. onConstruct() {
  11802. this.n8 = (this.getChild("n8"));
  11803. this.n40 = (this.getChild("n40"));
  11804. }
  11805. }
  11806. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11807. class ui_Component28_11 extends fgui.GButton {
  11808. static createInstance() {
  11809. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11810. }
  11811. onConstruct() {
  11812. this.c1 = this.getController("c1");
  11813. this.n12 = (this.getChild("n12"));
  11814. this.n17 = (this.getChild("n17"));
  11815. this.n13 = (this.getChild("n13"));
  11816. this.diamondTxt = (this.getChild("diamondTxt"));
  11817. this.n15 = (this.getChild("n15"));
  11818. this.n16 = (this.getChild("n16"));
  11819. }
  11820. }
  11821. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  11822. class ui_Component58_11 extends fgui.GComponent {
  11823. static createInstance() {
  11824. return (fgui.UIPackage.createObject("game", "Component58_11"));
  11825. }
  11826. onConstruct() {
  11827. this.n23 = (this.getChild("n23"));
  11828. this.n41 = (this.getChild("n41"));
  11829. this.myList = (this.getChild("myList"));
  11830. this.n45 = (this.getChild("n45"));
  11831. this.n44 = (this.getChild("n44"));
  11832. this.t0 = this.getTransition("t0");
  11833. }
  11834. }
  11835. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  11836. class ui_Component100 extends fgui.GComponent {
  11837. static createInstance() {
  11838. return (fgui.UIPackage.createObject("game", "Component100"));
  11839. }
  11840. onConstruct() {
  11841. this.c1 = this.getController("c1");
  11842. this.n75 = (this.getChild("n75"));
  11843. this.n76 = (this.getChild("n76"));
  11844. this.n80 = (this.getChild("n80"));
  11845. this.txt = (this.getChild("txt"));
  11846. this.spineRoot = (this.getChild("spineRoot"));
  11847. }
  11848. }
  11849. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  11850. class ui_Component101 extends fgui.GComponent {
  11851. static createInstance() {
  11852. return (fgui.UIPackage.createObject("game", "Component101"));
  11853. }
  11854. onConstruct() {
  11855. this.c1 = this.getController("c1");
  11856. this.n36 = (this.getChild("n36"));
  11857. this.n35 = (this.getChild("n35"));
  11858. this.n33 = (this.getChild("n33"));
  11859. this.n34 = (this.getChild("n34"));
  11860. }
  11861. }
  11862. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  11863. class ui_Component53 extends fgui.GComponent {
  11864. static createInstance() {
  11865. return (fgui.UIPackage.createObject("game", "Component53"));
  11866. }
  11867. onConstruct() {
  11868. this.n0 = (this.getChild("n0"));
  11869. this.n1 = (this.getChild("n1"));
  11870. this.n2 = (this.getChild("n2"));
  11871. this.n3 = (this.getChild("n3"));
  11872. this.n4 = (this.getChild("n4"));
  11873. this.n5 = (this.getChild("n5"));
  11874. this.n6 = (this.getChild("n6"));
  11875. this.n7 = (this.getChild("n7"));
  11876. this.n8 = (this.getChild("n8"));
  11877. this.n9 = (this.getChild("n9"));
  11878. this.n10 = (this.getChild("n10"));
  11879. this.n11 = (this.getChild("n11"));
  11880. this.n12 = (this.getChild("n12"));
  11881. this.n13 = (this.getChild("n13"));
  11882. this.n14 = (this.getChild("n14"));
  11883. this.n15 = (this.getChild("n15"));
  11884. this.n16 = (this.getChild("n16"));
  11885. this.n19 = (this.getChild("n19"));
  11886. this.n20 = (this.getChild("n20"));
  11887. this.n21 = (this.getChild("n21"));
  11888. this.n22 = (this.getChild("n22"));
  11889. this.n23 = (this.getChild("n23"));
  11890. this.n24 = (this.getChild("n24"));
  11891. this.n25 = (this.getChild("n25"));
  11892. this.n26 = (this.getChild("n26"));
  11893. this.n27 = (this.getChild("n27"));
  11894. this.n28 = (this.getChild("n28"));
  11895. this.n29 = (this.getChild("n29"));
  11896. this.n30 = (this.getChild("n30"));
  11897. this.n31 = (this.getChild("n31"));
  11898. this.n32 = (this.getChild("n32"));
  11899. this.n33 = (this.getChild("n33"));
  11900. this.n34 = (this.getChild("n34"));
  11901. this.n35 = (this.getChild("n35"));
  11902. this.t0 = this.getTransition("t0");
  11903. }
  11904. }
  11905. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  11906. class ui_Component58 extends fgui.GComponent {
  11907. static createInstance() {
  11908. return (fgui.UIPackage.createObject("game", "Component58"));
  11909. }
  11910. onConstruct() {
  11911. this.n23 = (this.getChild("n23"));
  11912. this.n41 = (this.getChild("n41"));
  11913. this.n8 = (this.getChild("n8"));
  11914. this.skillList = (this.getChild("skillList"));
  11915. this.t0 = this.getTransition("t0");
  11916. }
  11917. }
  11918. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  11919. class ui_Component59 extends fgui.GComponent {
  11920. static createInstance() {
  11921. return (fgui.UIPackage.createObject("game", "Component59"));
  11922. }
  11923. onConstruct() {
  11924. this.n3 = (this.getChild("n3"));
  11925. this.msgTxt = (this.getChild("msgTxt"));
  11926. this.t0 = this.getTransition("t0");
  11927. }
  11928. }
  11929. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  11930. class ui_RulerNode extends fgui.GComponent {
  11931. static createInstance() {
  11932. return (fgui.UIPackage.createObject("game", "RulerNode"));
  11933. }
  11934. onConstruct() {
  11935. this.n6 = (this.getChild("n6"));
  11936. this.n4 = (this.getChild("n4"));
  11937. this.img1 = (this.getChild("img1"));
  11938. this.img2 = (this.getChild("img2"));
  11939. }
  11940. }
  11941. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  11942. class ui_Component108 extends fgui.GComponent {
  11943. static createInstance() {
  11944. return (fgui.UIPackage.createObject("game", "Component108"));
  11945. }
  11946. onConstruct() {
  11947. this.n19 = (this.getChild("n19"));
  11948. this.t0 = this.getTransition("t0");
  11949. }
  11950. }
  11951. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  11952. class ui_Component63 extends fgui.GComponent {
  11953. static createInstance() {
  11954. return (fgui.UIPackage.createObject("game", "Component63"));
  11955. }
  11956. onConstruct() {
  11957. this.n66 = (this.getChild("n66"));
  11958. this.n56 = (this.getChild("n56"));
  11959. this.n63 = (this.getChild("n63"));
  11960. this.n65 = (this.getChild("n65"));
  11961. this.t0 = this.getTransition("t0");
  11962. }
  11963. }
  11964. ui_Component63.URL = "ui://isxx5ak7h657452";
  11965. class ui_topNode extends fgui.GComponent {
  11966. static createInstance() {
  11967. return (fgui.UIPackage.createObject("game", "topNode"));
  11968. }
  11969. onConstruct() {
  11970. this.selfProgress = (this.getChild("selfProgress"));
  11971. this.aiProgress = (this.getChild("aiProgress"));
  11972. this.selfKuang = (this.getChild("selfKuang"));
  11973. this.aiKuang = (this.getChild("aiKuang"));
  11974. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  11975. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  11976. this.n33 = (this.getChild("n33"));
  11977. this.n34 = (this.getChild("n34"));
  11978. this.selfNameTxt = (this.getChild("selfNameTxt"));
  11979. this.aiNameTxt = (this.getChild("aiNameTxt"));
  11980. this.selfBallList = (this.getChild("selfBallList"));
  11981. this.aiBallList = (this.getChild("aiBallList"));
  11982. this.middleNode = (this.getChild("middleNode"));
  11983. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  11984. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  11985. this.scoreNode = (this.getChild("scoreNode"));
  11986. this.selfTips = (this.getChild("selfTips"));
  11987. this.aiTips = (this.getChild("aiTips"));
  11988. }
  11989. }
  11990. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  11991. class ui_selfProgress extends fgui.GProgressBar {
  11992. static createInstance() {
  11993. return (fgui.UIPackage.createObject("game", "selfProgress"));
  11994. }
  11995. onConstruct() {
  11996. this.n3 = (this.getChild("n3"));
  11997. this.bar = (this.getChild("bar"));
  11998. }
  11999. }
  12000. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12001. class ui_aiProgress extends fgui.GProgressBar {
  12002. static createInstance() {
  12003. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12004. }
  12005. onConstruct() {
  12006. this.n3 = (this.getChild("n3"));
  12007. this.bar = (this.getChild("bar"));
  12008. }
  12009. }
  12010. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12011. class ui_ballDisplay extends fgui.GComponent {
  12012. static createInstance() {
  12013. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12014. }
  12015. onConstruct() {
  12016. this.myImg = (this.getChild("myImg"));
  12017. }
  12018. }
  12019. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12020. class ui_moveNode extends fgui.GComponent {
  12021. static createInstance() {
  12022. return (fgui.UIPackage.createObject("game", "moveNode"));
  12023. }
  12024. onConstruct() {
  12025. this.n8 = (this.getChild("n8"));
  12026. this.finger = (this.getChild("finger"));
  12027. }
  12028. }
  12029. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12030. class ui_cancelBtn extends fgui.GButton {
  12031. static createInstance() {
  12032. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12033. }
  12034. onConstruct() {
  12035. this.c1 = this.getController("c1");
  12036. this.n0 = (this.getChild("n0"));
  12037. this.n1 = (this.getChild("n1"));
  12038. }
  12039. }
  12040. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12041. class ui_shareBtn extends fgui.GButton {
  12042. static createInstance() {
  12043. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12044. }
  12045. onConstruct() {
  12046. this.c1 = this.getController("c1");
  12047. this.n2 = (this.getChild("n2"));
  12048. this.n1 = (this.getChild("n1"));
  12049. this.n3 = (this.getChild("n3"));
  12050. this.n4 = (this.getChild("n4"));
  12051. this.n5 = (this.getChild("n5"));
  12052. this.n6 = (this.getChild("n6"));
  12053. }
  12054. }
  12055. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12056. class ui_share2Btn extends fgui.GButton {
  12057. static createInstance() {
  12058. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12059. }
  12060. onConstruct() {
  12061. this.n3 = (this.getChild("n3"));
  12062. }
  12063. }
  12064. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12065. class ui_rodMethodNode extends fgui.GComponent {
  12066. static createInstance() {
  12067. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12068. }
  12069. onConstruct() {
  12070. this.bg = (this.getChild("bg"));
  12071. this.dot = (this.getChild("dot"));
  12072. }
  12073. }
  12074. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12075. class ui_sureBtn extends fgui.GButton {
  12076. static createInstance() {
  12077. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12078. }
  12079. onConstruct() {
  12080. this.n2 = (this.getChild("n2"));
  12081. this.n1 = (this.getChild("n1"));
  12082. }
  12083. }
  12084. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12085. class ui_Component18 extends fgui.GComponent {
  12086. static createInstance() {
  12087. return (fgui.UIPackage.createObject("game", "Component18"));
  12088. }
  12089. onConstruct() {
  12090. this.c1 = this.getController("c1");
  12091. this.nameTxt = (this.getChild("nameTxt"));
  12092. this.headImg = (this.getChild("headImg"));
  12093. this.n24 = (this.getChild("n24"));
  12094. this.skillImg = (this.getChild("skillImg"));
  12095. this.skillTxt = (this.getChild("skillTxt"));
  12096. }
  12097. }
  12098. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12099. class ui_Component45 extends fgui.GComponent {
  12100. static createInstance() {
  12101. return (fgui.UIPackage.createObject("game", "Component45"));
  12102. }
  12103. onConstruct() {
  12104. this.c1 = this.getController("c1");
  12105. this.n40 = (this.getChild("n40"));
  12106. this.n41 = (this.getChild("n41"));
  12107. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12108. this.n42 = (this.getChild("n42"));
  12109. this.awardTxt = (this.getChild("awardTxt"));
  12110. this.n44 = (this.getChild("n44"));
  12111. this.t0 = this.getTransition("t0");
  12112. }
  12113. }
  12114. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12115. class ui_emotionDisplay extends fgui.GButton {
  12116. static createInstance() {
  12117. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12118. }
  12119. onConstruct() {
  12120. this.myIcon = (this.getChild("myIcon"));
  12121. }
  12122. }
  12123. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12124. class ui_Component49 extends fgui.GButton {
  12125. static createInstance() {
  12126. return (fgui.UIPackage.createObject("game", "Component49"));
  12127. }
  12128. onConstruct() {
  12129. this.n69 = (this.getChild("n69"));
  12130. this.n56 = (this.getChild("n56"));
  12131. }
  12132. }
  12133. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12134. class ui_Component50 extends fgui.GButton {
  12135. static createInstance() {
  12136. return (fgui.UIPackage.createObject("game", "Component50"));
  12137. }
  12138. onConstruct() {
  12139. this.n54 = (this.getChild("n54"));
  12140. this.n65 = (this.getChild("n65"));
  12141. }
  12142. }
  12143. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12144. class ui_Component51 extends fgui.GButton {
  12145. static createInstance() {
  12146. return (fgui.UIPackage.createObject("game", "Component51"));
  12147. }
  12148. onConstruct() {
  12149. this.c1 = this.getController("c1");
  12150. this.n51 = (this.getChild("n51"));
  12151. this.n54 = (this.getChild("n54"));
  12152. }
  12153. }
  12154. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12155. class ui_Button5 extends fgui.GButton {
  12156. static createInstance() {
  12157. return (fgui.UIPackage.createObject("game", "Button5"));
  12158. }
  12159. onConstruct() {
  12160. this.c1 = this.getController("c1");
  12161. this.n0 = (this.getChild("n0"));
  12162. this.n2 = (this.getChild("n2"));
  12163. }
  12164. }
  12165. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12166. class ui_Component124 extends fgui.GComponent {
  12167. static createInstance() {
  12168. return (fgui.UIPackage.createObject("game", "Component124"));
  12169. }
  12170. onConstruct() {
  12171. this.n22 = (this.getChild("n22"));
  12172. this.shareNode = (this.getChild("shareNode"));
  12173. }
  12174. }
  12175. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12176. class ui_Component125 extends fgui.GComponent {
  12177. static createInstance() {
  12178. return (fgui.UIPackage.createObject("game", "Component125"));
  12179. }
  12180. onConstruct() {
  12181. this.n29 = (this.getChild("n29"));
  12182. this.coinTxt = (this.getChild("coinTxt"));
  12183. }
  12184. }
  12185. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12186. class ui_Component52 extends fgui.GButton {
  12187. static createInstance() {
  12188. return (fgui.UIPackage.createObject("game", "Component52"));
  12189. }
  12190. onConstruct() {
  12191. this.n35 = (this.getChild("n35"));
  12192. this.n36 = (this.getChild("n36"));
  12193. }
  12194. }
  12195. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12196. class ui_drawBtn extends fgui.GButton {
  12197. static createInstance() {
  12198. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12199. }
  12200. onConstruct() {
  12201. this.c1 = this.getController("c1");
  12202. this.n2 = (this.getChild("n2"));
  12203. this.n1 = (this.getChild("n1"));
  12204. this.n5 = (this.getChild("n5"));
  12205. }
  12206. }
  12207. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12208. class ui_Component43 extends fgui.GButton {
  12209. static createInstance() {
  12210. return (fgui.UIPackage.createObject("game", "Component43"));
  12211. }
  12212. onConstruct() {
  12213. this.n49 = (this.getChild("n49"));
  12214. }
  12215. }
  12216. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12217. class ui_wordsDisplay extends fgui.GComponent {
  12218. static createInstance() {
  12219. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12220. }
  12221. onConstruct() {
  12222. this.txt = (this.getChild("txt"));
  12223. this.n63 = (this.getChild("n63"));
  12224. }
  12225. }
  12226. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12227. class ui_Component3 extends fgui.GComponent {
  12228. static createInstance() {
  12229. return (fgui.UIPackage.createObject("game", "Component3"));
  12230. }
  12231. onConstruct() {
  12232. this.n26 = (this.getChild("n26"));
  12233. this.n24 = (this.getChild("n24"));
  12234. this.nameTxt = (this.getChild("nameTxt"));
  12235. this.headRoot = (this.getChild("headRoot"));
  12236. }
  12237. }
  12238. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12239. class ui_Component4 extends fgui.GComponent {
  12240. static createInstance() {
  12241. return (fgui.UIPackage.createObject("game", "Component4"));
  12242. }
  12243. onConstruct() {
  12244. this.n44 = (this.getChild("n44"));
  12245. this.headImg = (this.getChild("headImg"));
  12246. }
  12247. }
  12248. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12249. class ui_Component7 extends fgui.GButton {
  12250. static createInstance() {
  12251. return (fgui.UIPackage.createObject("game", "Component7"));
  12252. }
  12253. onConstruct() {
  12254. this.n17 = (this.getChild("n17"));
  12255. }
  12256. }
  12257. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12258. class ui_Component8 extends fgui.GButton {
  12259. static createInstance() {
  12260. return (fgui.UIPackage.createObject("game", "Component8"));
  12261. }
  12262. onConstruct() {
  12263. this.n19 = (this.getChild("n19"));
  12264. this.n20 = (this.getChild("n20"));
  12265. this.n21 = (this.getChild("n21"));
  12266. }
  12267. }
  12268. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12269. class ui_Component9 extends fgui.GButton {
  12270. static createInstance() {
  12271. return (fgui.UIPackage.createObject("game", "Component9"));
  12272. }
  12273. onConstruct() {
  12274. this.n18 = (this.getChild("n18"));
  12275. this.n19 = (this.getChild("n19"));
  12276. this.n20 = (this.getChild("n20"));
  12277. }
  12278. }
  12279. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12280. class ui_Component10 extends fgui.GButton {
  12281. static createInstance() {
  12282. return (fgui.UIPackage.createObject("game", "Component10"));
  12283. }
  12284. onConstruct() {
  12285. this.c1 = this.getController("c1");
  12286. this.n40 = (this.getChild("n40"));
  12287. this.n41 = (this.getChild("n41"));
  12288. }
  12289. }
  12290. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12291. class ui_Component11 extends fgui.GButton {
  12292. static createInstance() {
  12293. return (fgui.UIPackage.createObject("game", "Component11"));
  12294. }
  12295. onConstruct() {
  12296. this.n34 = (this.getChild("n34"));
  12297. this.n42 = (this.getChild("n42"));
  12298. }
  12299. }
  12300. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12301. class ui_Component12 extends fgui.GButton {
  12302. static createInstance() {
  12303. return (fgui.UIPackage.createObject("game", "Component12"));
  12304. }
  12305. onConstruct() {
  12306. this.n35 = (this.getChild("n35"));
  12307. this.n43 = (this.getChild("n43"));
  12308. this.t0 = this.getTransition("t0");
  12309. }
  12310. }
  12311. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12312. class ui_Component13 extends fgui.GButton {
  12313. static createInstance() {
  12314. return (fgui.UIPackage.createObject("game", "Component13"));
  12315. }
  12316. onConstruct() {
  12317. this.n27 = (this.getChild("n27"));
  12318. this.n36 = (this.getChild("n36"));
  12319. }
  12320. }
  12321. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12322. class ui_Component16 extends fgui.GButton {
  12323. static createInstance() {
  12324. return (fgui.UIPackage.createObject("game", "Component16"));
  12325. }
  12326. onConstruct() {
  12327. this.n30 = (this.getChild("n30"));
  12328. this.n39 = (this.getChild("n39"));
  12329. }
  12330. }
  12331. ui_Component16.URL = "ui://isxx5ak7ixm43xz";
  12332. class ui_dh_js_tuowei extends fgui.GComponent {
  12333. static createInstance() {
  12334. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12335. }
  12336. onConstruct() {
  12337. this.n19 = (this.getChild("n19"));
  12338. this.n18 = (this.getChild("n18"));
  12339. this.n0 = (this.getChild("n0"));
  12340. this.n3 = (this.getChild("n3"));
  12341. this.n4 = (this.getChild("n4"));
  12342. this.n5 = (this.getChild("n5"));
  12343. this.n6 = (this.getChild("n6"));
  12344. this.n8 = (this.getChild("n8"));
  12345. this.n9 = (this.getChild("n9"));
  12346. this.n10 = (this.getChild("n10"));
  12347. this.n11 = (this.getChild("n11"));
  12348. this.n12 = (this.getChild("n12"));
  12349. this.n13 = (this.getChild("n13"));
  12350. this.n14 = (this.getChild("n14"));
  12351. this.n15 = (this.getChild("n15"));
  12352. this.n20 = (this.getChild("n20"));
  12353. this.t0 = this.getTransition("t0");
  12354. this.t1 = this.getTransition("t1");
  12355. }
  12356. }
  12357. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12358. class ui_dh_js_tw_g extends fgui.GComponent {
  12359. static createInstance() {
  12360. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12361. }
  12362. onConstruct() {
  12363. this.n0 = (this.getChild("n0"));
  12364. this.n1 = (this.getChild("n1"));
  12365. this.t0 = this.getTransition("t0");
  12366. }
  12367. }
  12368. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12369. class ui_dh_js_xingxing extends fgui.GComponent {
  12370. static createInstance() {
  12371. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12372. }
  12373. onConstruct() {
  12374. this.n1 = (this.getChild("n1"));
  12375. this.n2 = (this.getChild("n2"));
  12376. this.n3 = (this.getChild("n3"));
  12377. this.n4 = (this.getChild("n4"));
  12378. this.n0 = (this.getChild("n0"));
  12379. this.t2 = this.getTransition("t2");
  12380. this.t1 = this.getTransition("t1");
  12381. }
  12382. }
  12383. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12384. class ui_dh_zy_jiazai extends fgui.GComponent {
  12385. static createInstance() {
  12386. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12387. }
  12388. onConstruct() {
  12389. this.c1 = this.getController("c1");
  12390. this.n0 = (this.getChild("n0"));
  12391. this.n1 = (this.getChild("n1"));
  12392. this.n2 = (this.getChild("n2"));
  12393. this.n4 = (this.getChild("n4"));
  12394. this.n5 = (this.getChild("n5"));
  12395. this.n6 = (this.getChild("n6"));
  12396. this.n8 = (this.getChild("n8"));
  12397. this.n7 = (this.getChild("n7"));
  12398. this.t0 = this.getTransition("t0");
  12399. }
  12400. }
  12401. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12402. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12403. static createInstance() {
  12404. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12405. }
  12406. onConstruct() {
  12407. this.c1 = this.getController("c1");
  12408. this.n3 = (this.getChild("n3"));
  12409. this.n5 = (this.getChild("n5"));
  12410. this.n4 = (this.getChild("n4"));
  12411. this.n0 = (this.getChild("n0"));
  12412. this.n1 = (this.getChild("n1"));
  12413. this.n2 = (this.getChild("n2"));
  12414. }
  12415. }
  12416. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12417. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12418. static createInstance() {
  12419. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12420. }
  12421. onConstruct() {
  12422. this.n19 = (this.getChild("n19"));
  12423. this.n21 = (this.getChild("n21"));
  12424. this.n0 = (this.getChild("n0"));
  12425. this.n3 = (this.getChild("n3"));
  12426. this.n4 = (this.getChild("n4"));
  12427. this.n5 = (this.getChild("n5"));
  12428. this.n6 = (this.getChild("n6"));
  12429. this.n8 = (this.getChild("n8"));
  12430. this.n9 = (this.getChild("n9"));
  12431. this.n10 = (this.getChild("n10"));
  12432. this.n11 = (this.getChild("n11"));
  12433. this.n12 = (this.getChild("n12"));
  12434. this.n13 = (this.getChild("n13"));
  12435. this.n14 = (this.getChild("n14"));
  12436. this.n15 = (this.getChild("n15"));
  12437. this.n23 = (this.getChild("n23"));
  12438. this.t0 = this.getTransition("t0");
  12439. this.t1 = this.getTransition("t1");
  12440. }
  12441. }
  12442. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12443. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12444. static createInstance() {
  12445. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12446. }
  12447. onConstruct() {
  12448. this.n1 = (this.getChild("n1"));
  12449. this.n2 = (this.getChild("n2"));
  12450. this.t0 = this.getTransition("t0");
  12451. }
  12452. }
  12453. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12454. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12455. static createInstance() {
  12456. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12457. }
  12458. onConstruct() {
  12459. this.n4 = (this.getChild("n4"));
  12460. this.n2 = (this.getChild("n2"));
  12461. this.n3 = (this.getChild("n3"));
  12462. this.idle = this.getTransition("idle");
  12463. this.attack = this.getTransition("attack");
  12464. }
  12465. }
  12466. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12467. class ui_special extends fgui.GComponent {
  12468. static createInstance() {
  12469. return (fgui.UIPackage.createObject("game", "special"));
  12470. }
  12471. onConstruct() {
  12472. this.n18 = (this.getChild("n18"));
  12473. this.n19 = (this.getChild("n19"));
  12474. this.n20 = (this.getChild("n20"));
  12475. this.n21 = (this.getChild("n21"));
  12476. this.n22 = (this.getChild("n22"));
  12477. this.levelTxt = (this.getChild("levelTxt"));
  12478. this.n24 = (this.getChild("n24"));
  12479. this.n25 = (this.getChild("n25"));
  12480. this.t0 = this.getTransition("t0");
  12481. }
  12482. }
  12483. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12484. class ui_Component145 extends fgui.GComponent {
  12485. static createInstance() {
  12486. return (fgui.UIPackage.createObject("game", "Component145"));
  12487. }
  12488. onConstruct() {
  12489. this.guanyuNode = (this.getChild("guanyuNode"));
  12490. }
  12491. }
  12492. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12493. class ui_longBtn extends fgui.GButton {
  12494. static createInstance() {
  12495. return (fgui.UIPackage.createObject("game", "longBtn"));
  12496. }
  12497. onConstruct() {
  12498. this.c1 = this.getController("c1");
  12499. this.n2 = (this.getChild("n2"));
  12500. this.n1 = (this.getChild("n1"));
  12501. this.n4 = (this.getChild("n4"));
  12502. }
  12503. }
  12504. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12505. class ui_Component146 extends fgui.GComponent {
  12506. static createInstance() {
  12507. return (fgui.UIPackage.createObject("game", "Component146"));
  12508. }
  12509. onConstruct() {
  12510. this.n89 = (this.getChild("n89"));
  12511. this.n90 = (this.getChild("n90"));
  12512. this.guideBtn = (this.getChild("guideBtn"));
  12513. }
  12514. }
  12515. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12516. class ui_Component146_11 extends fgui.GComponent {
  12517. static createInstance() {
  12518. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12519. }
  12520. onConstruct() {
  12521. this.n89 = (this.getChild("n89"));
  12522. this.n90 = (this.getChild("n90"));
  12523. this.guideBtn = (this.getChild("guideBtn"));
  12524. }
  12525. }
  12526. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12527. class ui_Component111_1 extends fgui.GComponent {
  12528. static createInstance() {
  12529. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12530. }
  12531. onConstruct() {
  12532. this.n68 = (this.getChild("n68"));
  12533. this.myMask = (this.getChild("myMask"));
  12534. }
  12535. }
  12536. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12537. class ui_Component64_1 extends fgui.GComponent {
  12538. static createInstance() {
  12539. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12540. }
  12541. onConstruct() {
  12542. this.n57 = (this.getChild("n57"));
  12543. this.n54 = (this.getChild("n54"));
  12544. this.n55 = (this.getChild("n55"));
  12545. this.n56 = (this.getChild("n56"));
  12546. this.t1 = this.getTransition("t1");
  12547. }
  12548. }
  12549. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12550. class ui_ModeSelection_com123 extends fgui.GComponent {
  12551. static createInstance() {
  12552. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12553. }
  12554. onConstruct() {
  12555. this.type1 = (this.getChild("type1"));
  12556. this.type2 = (this.getChild("type2"));
  12557. this.type3 = (this.getChild("type3"));
  12558. this.n38 = (this.getChild("n38"));
  12559. this.t0 = this.getTransition("t0");
  12560. }
  12561. }
  12562. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12563. class ui_Component132_2 extends fgui.GComponent {
  12564. static createInstance() {
  12565. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12566. }
  12567. onConstruct() {
  12568. this.n25 = (this.getChild("n25"));
  12569. this.n26 = (this.getChild("n26"));
  12570. this.n27 = (this.getChild("n27"));
  12571. this.t0 = this.getTransition("t0");
  12572. }
  12573. }
  12574. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12575. class ui_UIPower$1 extends fgui.GComponent {
  12576. static createInstance() {
  12577. return (fgui.UIPackage.createObject("game", "UIPower"));
  12578. }
  12579. onConstruct() {
  12580. this.n11 = (this.getChild("n11"));
  12581. this.myNode = (this.getChild("myNode"));
  12582. this.t0 = this.getTransition("t0");
  12583. }
  12584. }
  12585. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12586. class ui_Component133 extends fgui.GComponent {
  12587. static createInstance() {
  12588. return (fgui.UIPackage.createObject("game", "Component133"));
  12589. }
  12590. onConstruct() {
  12591. this.n29 = (this.getChild("n29"));
  12592. this.n30 = (this.getChild("n30"));
  12593. }
  12594. }
  12595. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12596. class ui_Component134 extends fgui.GComponent {
  12597. static createInstance() {
  12598. return (fgui.UIPackage.createObject("game", "Component134"));
  12599. }
  12600. onConstruct() {
  12601. this.n30 = (this.getChild("n30"));
  12602. this.n31 = (this.getChild("n31"));
  12603. this.t0 = this.getTransition("t0");
  12604. }
  12605. }
  12606. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12607. class ui_Component135 extends fgui.GComponent {
  12608. static createInstance() {
  12609. return (fgui.UIPackage.createObject("game", "Component135"));
  12610. }
  12611. onConstruct() {
  12612. this.n30 = (this.getChild("n30"));
  12613. this.t0 = this.getTransition("t0");
  12614. }
  12615. }
  12616. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12617. class ui_Component137 extends fgui.GComponent {
  12618. static createInstance() {
  12619. return (fgui.UIPackage.createObject("game", "Component137"));
  12620. }
  12621. onConstruct() {
  12622. this.n28 = (this.getChild("n28"));
  12623. this.n29 = (this.getChild("n29"));
  12624. this.n30 = (this.getChild("n30"));
  12625. this.n32 = (this.getChild("n32"));
  12626. }
  12627. }
  12628. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12629. class ui_dh_zuanshi extends fgui.GButton {
  12630. static createInstance() {
  12631. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12632. }
  12633. onConstruct() {
  12634. this.n1 = (this.getChild("n1"));
  12635. this.n2 = (this.getChild("n2"));
  12636. this.n0 = (this.getChild("n0"));
  12637. this.n3 = (this.getChild("n3"));
  12638. this.n4 = (this.getChild("n4"));
  12639. }
  12640. }
  12641. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12642. class ui_Component138 extends fgui.GComponent {
  12643. static createInstance() {
  12644. return (fgui.UIPackage.createObject("game", "Component138"));
  12645. }
  12646. onConstruct() {
  12647. this.n1 = (this.getChild("n1"));
  12648. this.n2 = (this.getChild("n2"));
  12649. this.t0 = this.getTransition("t0");
  12650. }
  12651. }
  12652. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12653. class ui_Component139 extends fgui.GComponent {
  12654. static createInstance() {
  12655. return (fgui.UIPackage.createObject("game", "Component139"));
  12656. }
  12657. onConstruct() {
  12658. this.n0 = (this.getChild("n0"));
  12659. this.t0 = this.getTransition("t0");
  12660. }
  12661. }
  12662. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12663. class ui_Component140 extends fgui.GComponent {
  12664. static createInstance() {
  12665. return (fgui.UIPackage.createObject("game", "Component140"));
  12666. }
  12667. onConstruct() {
  12668. this.n2 = (this.getChild("n2"));
  12669. this.n3 = (this.getChild("n3"));
  12670. this.t0 = this.getTransition("t0");
  12671. }
  12672. }
  12673. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12674. class ui_Component141 extends fgui.GComponent {
  12675. static createInstance() {
  12676. return (fgui.UIPackage.createObject("game", "Component141"));
  12677. }
  12678. onConstruct() {
  12679. this.n0 = (this.getChild("n0"));
  12680. this.t0 = this.getTransition("t0");
  12681. }
  12682. }
  12683. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12684. class ui_powerNode extends fgui.GProgressBar {
  12685. static createInstance() {
  12686. return (fgui.UIPackage.createObject("game", "powerNode"));
  12687. }
  12688. onConstruct() {
  12689. this.n2 = (this.getChild("n2"));
  12690. this.bar_v = (this.getChild("bar_v"));
  12691. this.showImg = (this.getChild("showImg"));
  12692. this.n12 = (this.getChild("n12"));
  12693. }
  12694. }
  12695. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12696. class ui_dh_jingbi1 extends fgui.GComponent {
  12697. static createInstance() {
  12698. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12699. }
  12700. onConstruct() {
  12701. this.n0 = (this.getChild("n0"));
  12702. this.n1 = (this.getChild("n1"));
  12703. this.n2 = (this.getChild("n2"));
  12704. this.n3 = (this.getChild("n3"));
  12705. this.n4 = (this.getChild("n4"));
  12706. this.n5 = (this.getChild("n5"));
  12707. this.n6 = (this.getChild("n6"));
  12708. this.n8 = (this.getChild("n8"));
  12709. this.t0 = this.getTransition("t0");
  12710. }
  12711. }
  12712. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12713. class ui_Component94 extends fgui.GButton {
  12714. static createInstance() {
  12715. return (fgui.UIPackage.createObject("game", "Component94"));
  12716. }
  12717. onConstruct() {
  12718. this.n77 = (this.getChild("n77"));
  12719. }
  12720. }
  12721. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12722. class ui_Component95 extends fgui.GButton {
  12723. static createInstance() {
  12724. return (fgui.UIPackage.createObject("game", "Component95"));
  12725. }
  12726. onConstruct() {
  12727. this.n77 = (this.getChild("n77"));
  12728. }
  12729. }
  12730. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12731. class ui_Component126 extends fgui.GComponent {
  12732. static createInstance() {
  12733. return (fgui.UIPackage.createObject("game", "Component126"));
  12734. }
  12735. onConstruct() {
  12736. this.c1 = this.getController("c1");
  12737. this.normalBtn = (this.getChild("normalBtn"));
  12738. this.tripleBtn = (this.getChild("tripleBtn"));
  12739. }
  12740. }
  12741. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12742. class ui_Component60 extends fgui.GComponent {
  12743. static createInstance() {
  12744. return (fgui.UIPackage.createObject("game", "Component60"));
  12745. }
  12746. onConstruct() {
  12747. this.c1 = this.getController("c1");
  12748. this.n48 = (this.getChild("n48"));
  12749. this.womanTxt = (this.getChild("womanTxt"));
  12750. this.t0 = this.getTransition("t0");
  12751. }
  12752. }
  12753. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12754. class ui_Component98_3 extends fgui.GButton {
  12755. static createInstance() {
  12756. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12757. }
  12758. onConstruct() {
  12759. this.c1 = this.getController("c1");
  12760. this.n8 = (this.getChild("n8"));
  12761. this.n41 = (this.getChild("n41"));
  12762. this.n40 = (this.getChild("n40"));
  12763. }
  12764. }
  12765. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12766. class ui_ModeSelection_com1 extends fgui.GButton {
  12767. static createInstance() {
  12768. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12769. }
  12770. onConstruct() {
  12771. this.n34 = (this.getChild("n34"));
  12772. this.n36 = (this.getChild("n36"));
  12773. this.n22 = (this.getChild("n22"));
  12774. this.n20 = (this.getChild("n20"));
  12775. this.n23 = (this.getChild("n23"));
  12776. this.n24 = (this.getChild("n24"));
  12777. this.n26 = (this.getChild("n26"));
  12778. this.n33 = (this.getChild("n33"));
  12779. this.coinImg = (this.getChild("coinImg"));
  12780. this.need = (this.getChild("need"));
  12781. this.n35 = (this.getChild("n35"));
  12782. this.n29 = (this.getChild("n29"));
  12783. this.tipsTxt = (this.getChild("tipsTxt"));
  12784. this.n30 = (this.getChild("n30"));
  12785. this.peopleTxt = (this.getChild("peopleTxt"));
  12786. this.t0 = this.getTransition("t0");
  12787. }
  12788. }
  12789. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12790. class ui_ModeSelection_com2 extends fgui.GButton {
  12791. static createInstance() {
  12792. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12793. }
  12794. onConstruct() {
  12795. this.n36 = (this.getChild("n36"));
  12796. this.n34 = (this.getChild("n34"));
  12797. this.n22 = (this.getChild("n22"));
  12798. this.n20 = (this.getChild("n20"));
  12799. this.n23 = (this.getChild("n23"));
  12800. this.n24 = (this.getChild("n24"));
  12801. this.n26 = (this.getChild("n26"));
  12802. this.n33 = (this.getChild("n33"));
  12803. this.coinImg = (this.getChild("coinImg"));
  12804. this.need = (this.getChild("need"));
  12805. this.n35 = (this.getChild("n35"));
  12806. this.n29 = (this.getChild("n29"));
  12807. this.tipsTxt = (this.getChild("tipsTxt"));
  12808. this.n30 = (this.getChild("n30"));
  12809. this.peopleTxt = (this.getChild("peopleTxt"));
  12810. this.t0 = this.getTransition("t0");
  12811. }
  12812. }
  12813. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12814. class ui_ModeSelection_com3 extends fgui.GButton {
  12815. static createInstance() {
  12816. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12817. }
  12818. onConstruct() {
  12819. this.n34 = (this.getChild("n34"));
  12820. this.n36 = (this.getChild("n36"));
  12821. this.n22 = (this.getChild("n22"));
  12822. this.n20 = (this.getChild("n20"));
  12823. this.n23 = (this.getChild("n23"));
  12824. this.n24 = (this.getChild("n24"));
  12825. this.n26 = (this.getChild("n26"));
  12826. this.n33 = (this.getChild("n33"));
  12827. this.coinImg = (this.getChild("coinImg"));
  12828. this.need = (this.getChild("need"));
  12829. this.n35 = (this.getChild("n35"));
  12830. this.n29 = (this.getChild("n29"));
  12831. this.tipsTxt = (this.getChild("tipsTxt"));
  12832. this.n30 = (this.getChild("n30"));
  12833. this.peopleTxt = (this.getChild("peopleTxt"));
  12834. this.t0 = this.getTransition("t0");
  12835. }
  12836. }
  12837. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12838. class ui_Invitation_com1 extends fgui.GComponent {
  12839. static createInstance() {
  12840. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  12841. }
  12842. onConstruct() {
  12843. this.n14 = (this.getChild("n14"));
  12844. this.n13 = (this.getChild("n13"));
  12845. this.n3 = (this.getChild("n3"));
  12846. this.n1 = (this.getChild("n1"));
  12847. this.n6 = (this.getChild("n6"));
  12848. this.n7 = (this.getChild("n7"));
  12849. this.enterBtn = (this.getChild("enterBtn"));
  12850. this.n11 = (this.getChild("n11"));
  12851. this.n12 = (this.getChild("n12"));
  12852. this.n15 = (this.getChild("n15"));
  12853. this.t0 = this.getTransition("t0");
  12854. this.t1 = this.getTransition("t1");
  12855. }
  12856. }
  12857. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  12858. class ui_Component87_1 extends fgui.GComponent {
  12859. static createInstance() {
  12860. return (fgui.UIPackage.createObject("game", "Component87_1"));
  12861. }
  12862. onConstruct() {
  12863. this.n74 = (this.getChild("n74"));
  12864. this.n73 = (this.getChild("n73"));
  12865. this.ballTxt = (this.getChild("ballTxt"));
  12866. this.n76 = (this.getChild("n76"));
  12867. this.helpLineBtn = (this.getChild("helpLineBtn"));
  12868. this.levelTxt = (this.getChild("levelTxt"));
  12869. this.n87 = (this.getChild("n87"));
  12870. this.n84 = (this.getChild("n84"));
  12871. this.hpTxt = (this.getChild("hpTxt"));
  12872. this.n89 = (this.getChild("n89"));
  12873. this.tipsTxt = (this.getChild("tipsTxt"));
  12874. }
  12875. }
  12876. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  12877. class ui_sqg1 extends fgui.GComponent {
  12878. static createInstance() {
  12879. return (fgui.UIPackage.createObject("game", "sqg1"));
  12880. }
  12881. onConstruct() {
  12882. this.n1 = (this.getChild("n1"));
  12883. this.n0 = (this.getChild("n0"));
  12884. }
  12885. }
  12886. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  12887. class ui_sqg2 extends fgui.GComponent {
  12888. static createInstance() {
  12889. return (fgui.UIPackage.createObject("game", "sqg2"));
  12890. }
  12891. onConstruct() {
  12892. this.n1 = (this.getChild("n1"));
  12893. this.n0 = (this.getChild("n0"));
  12894. }
  12895. }
  12896. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  12897. class ui_sqg3 extends fgui.GComponent {
  12898. static createInstance() {
  12899. return (fgui.UIPackage.createObject("game", "sqg3"));
  12900. }
  12901. onConstruct() {
  12902. this.n1 = (this.getChild("n1"));
  12903. this.n0 = (this.getChild("n0"));
  12904. }
  12905. }
  12906. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  12907. class ui_sqg4 extends fgui.GComponent {
  12908. static createInstance() {
  12909. return (fgui.UIPackage.createObject("game", "sqg4"));
  12910. }
  12911. onConstruct() {
  12912. this.n1 = (this.getChild("n1"));
  12913. this.n0 = (this.getChild("n0"));
  12914. }
  12915. }
  12916. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  12917. class ui_Component36 extends fgui.GButton {
  12918. static createInstance() {
  12919. return (fgui.UIPackage.createObject("game", "Component36"));
  12920. }
  12921. onConstruct() {
  12922. this.c1 = this.getController("c1");
  12923. this.n53 = (this.getChild("n53"));
  12924. this.n56 = (this.getChild("n56"));
  12925. }
  12926. }
  12927. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  12928. class ui_Component37 extends fgui.GButton {
  12929. static createInstance() {
  12930. return (fgui.UIPackage.createObject("game", "Component37"));
  12931. }
  12932. onConstruct() {
  12933. this.c1 = this.getController("c1");
  12934. this.n52 = (this.getChild("n52"));
  12935. this.n54 = (this.getChild("n54"));
  12936. }
  12937. }
  12938. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  12939. class ui_UISetting extends fgui.GComponent {
  12940. static createInstance() {
  12941. return (fgui.UIPackage.createObject("game", "UISetting"));
  12942. }
  12943. onConstruct() {
  12944. this.c1 = this.getController("c1");
  12945. this.n4 = (this.getChild("n4"));
  12946. this.soundBtn = (this.getChild("soundBtn"));
  12947. this.shakeBtn = (this.getChild("shakeBtn"));
  12948. this.clickNode = (this.getChild("clickNode"));
  12949. this.xyBtn = (this.getChild("xyBtn"));
  12950. }
  12951. }
  12952. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  12953. class ui_Component39 extends fgui.GComponent {
  12954. static createInstance() {
  12955. return (fgui.UIPackage.createObject("game", "Component39"));
  12956. }
  12957. onConstruct() {
  12958. this.n5 = (this.getChild("n5"));
  12959. this.n6 = (this.getChild("n6"));
  12960. this.n7 = (this.getChild("n7"));
  12961. this.t0 = this.getTransition("t0");
  12962. }
  12963. }
  12964. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  12965. class ui_Component40 extends fgui.GButton {
  12966. static createInstance() {
  12967. return (fgui.UIPackage.createObject("game", "Component40"));
  12968. }
  12969. onConstruct() {
  12970. this.n46 = (this.getChild("n46"));
  12971. this.n47 = (this.getChild("n47"));
  12972. }
  12973. }
  12974. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  12975. class ui_Component41 extends fgui.GComponent {
  12976. static createInstance() {
  12977. return (fgui.UIPackage.createObject("game", "Component41"));
  12978. }
  12979. onConstruct() {
  12980. this.c1 = this.getController("c1");
  12981. this.n0 = (this.getChild("n0"));
  12982. this.titleTxt = (this.getChild("titleTxt"));
  12983. this.n2 = (this.getChild("n2"));
  12984. this.msgTips = (this.getChild("msgTips"));
  12985. this.numTxt = (this.getChild("numTxt"));
  12986. this.n18 = (this.getChild("n18"));
  12987. this.cancelBtn = (this.getChild("cancelBtn"));
  12988. this.videoBtn = (this.getChild("videoBtn"));
  12989. this.n10 = (this.getChild("n10"));
  12990. }
  12991. }
  12992. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  12993. class ui_Component42 extends fgui.GComponent {
  12994. static createInstance() {
  12995. return (fgui.UIPackage.createObject("game", "Component42"));
  12996. }
  12997. onConstruct() {
  12998. this.c1 = this.getController("c1");
  12999. this.n1 = (this.getChild("n1"));
  13000. this.n2 = (this.getChild("n2"));
  13001. this.n3 = (this.getChild("n3"));
  13002. this.tipsTxt = (this.getChild("tipsTxt"));
  13003. this.cancelBtn = (this.getChild("cancelBtn"));
  13004. this.sureBtn = (this.getChild("sureBtn"));
  13005. this.n11 = (this.getChild("n11"));
  13006. this.n13 = (this.getChild("n13"));
  13007. this.n14 = (this.getChild("n14"));
  13008. this.womanTxt = (this.getChild("womanTxt"));
  13009. this.t0 = this.getTransition("t0");
  13010. }
  13011. }
  13012. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13013. class ui_dh_js_shengli extends fgui.GComponent {
  13014. static createInstance() {
  13015. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13016. }
  13017. onConstruct() {
  13018. this.n3 = (this.getChild("n3"));
  13019. this.n4 = (this.getChild("n4"));
  13020. this.n1 = (this.getChild("n1"));
  13021. this.n2 = (this.getChild("n2"));
  13022. this.n5 = (this.getChild("n5"));
  13023. this.n6 = (this.getChild("n6"));
  13024. this.n7 = (this.getChild("n7"));
  13025. this.n8 = (this.getChild("n8"));
  13026. this.attack = this.getTransition("attack");
  13027. this.idle = this.getTransition("idle");
  13028. }
  13029. }
  13030. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13031. class ui_dh_js_shengli_g extends fgui.GComponent {
  13032. static createInstance() {
  13033. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13034. }
  13035. onConstruct() {
  13036. this.n3 = (this.getChild("n3"));
  13037. this.n1 = (this.getChild("n1"));
  13038. this.t0 = this.getTransition("t0");
  13039. }
  13040. }
  13041. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13042. class ui_dh_js_shibai extends fgui.GComponent {
  13043. static createInstance() {
  13044. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13045. }
  13046. onConstruct() {
  13047. this.n0 = (this.getChild("n0"));
  13048. this.n1 = (this.getChild("n1"));
  13049. this.n2 = (this.getChild("n2"));
  13050. this.n3 = (this.getChild("n3"));
  13051. this.idle = this.getTransition("idle");
  13052. this.attack = this.getTransition("attack");
  13053. }
  13054. }
  13055. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13056. class ui_dh_zy_ganfa extends fgui.GButton {
  13057. static createInstance() {
  13058. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13059. }
  13060. onConstruct() {
  13061. this.n27 = (this.getChild("n27"));
  13062. this.n0 = (this.getChild("n0"));
  13063. this.n1 = (this.getChild("n1"));
  13064. this.n13 = (this.getChild("n13"));
  13065. this.n14 = (this.getChild("n14"));
  13066. this.n15 = (this.getChild("n15"));
  13067. this.n3 = (this.getChild("n3"));
  13068. this.n4 = (this.getChild("n4"));
  13069. this.n5 = (this.getChild("n5"));
  13070. this.n6 = (this.getChild("n6"));
  13071. this.n7 = (this.getChild("n7"));
  13072. this.n8 = (this.getChild("n8"));
  13073. this.n9 = (this.getChild("n9"));
  13074. this.n10 = (this.getChild("n10"));
  13075. this.n12 = (this.getChild("n12"));
  13076. this.n11 = (this.getChild("n11"));
  13077. this.n16 = (this.getChild("n16"));
  13078. this.n17 = (this.getChild("n17"));
  13079. this.n18 = (this.getChild("n18"));
  13080. this.n19 = (this.getChild("n19"));
  13081. this.n20 = (this.getChild("n20"));
  13082. this.n21 = (this.getChild("n21"));
  13083. this.n28 = (this.getChild("n28"));
  13084. this.n29 = (this.getChild("n29"));
  13085. this.t0 = this.getTransition("t0");
  13086. }
  13087. }
  13088. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13089. class ui_dh_zy_ganzi extends fgui.GComponent {
  13090. static createInstance() {
  13091. return (fgui.UIPackage.createObject("game", "dh_zy_ganzi"));
  13092. }
  13093. onConstruct() {
  13094. this.n3 = (this.getChild("n3"));
  13095. this.n2 = (this.getChild("n2"));
  13096. this.t0 = this.getTransition("t0");
  13097. }
  13098. }
  13099. ui_dh_zy_ganzi.URL = "ui://isxx5ak7n43d3vm";
  13100. class ui_dh_zy_sc_guang extends fgui.GButton {
  13101. static createInstance() {
  13102. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13103. }
  13104. onConstruct() {
  13105. this.n1 = (this.getChild("n1"));
  13106. this.n3 = (this.getChild("n3"));
  13107. this.n0 = (this.getChild("n0"));
  13108. this.n2 = (this.getChild("n2"));
  13109. this.n4 = (this.getChild("n4"));
  13110. this.t0 = this.getTransition("t0");
  13111. this.t1 = this.getTransition("t1");
  13112. }
  13113. }
  13114. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13115. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13116. static createInstance() {
  13117. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13118. }
  13119. onConstruct() {
  13120. this.n0 = (this.getChild("n0"));
  13121. this.n3 = (this.getChild("n3"));
  13122. this.t0 = this.getTransition("t0");
  13123. }
  13124. }
  13125. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13126. class ui_dh_zy_wanfa extends fgui.GButton {
  13127. static createInstance() {
  13128. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13129. }
  13130. onConstruct() {
  13131. this.n0 = (this.getChild("n0"));
  13132. this.n2 = (this.getChild("n2"));
  13133. this.n1 = (this.getChild("n1"));
  13134. this.n3 = (this.getChild("n3"));
  13135. this.n8 = (this.getChild("n8"));
  13136. this.t0 = this.getTransition("t0");
  13137. }
  13138. }
  13139. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13140. class ui_Component53_1 extends fgui.GComponent {
  13141. static createInstance() {
  13142. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13143. }
  13144. onConstruct() {
  13145. this.n0 = (this.getChild("n0"));
  13146. this.n1 = (this.getChild("n1"));
  13147. this.n2 = (this.getChild("n2"));
  13148. this.n3 = (this.getChild("n3"));
  13149. this.n4 = (this.getChild("n4"));
  13150. this.n5 = (this.getChild("n5"));
  13151. this.n6 = (this.getChild("n6"));
  13152. this.n7 = (this.getChild("n7"));
  13153. this.n8 = (this.getChild("n8"));
  13154. this.n9 = (this.getChild("n9"));
  13155. this.n10 = (this.getChild("n10"));
  13156. this.n11 = (this.getChild("n11"));
  13157. this.n12 = (this.getChild("n12"));
  13158. this.n13 = (this.getChild("n13"));
  13159. this.n14 = (this.getChild("n14"));
  13160. this.n15 = (this.getChild("n15"));
  13161. this.n16 = (this.getChild("n16"));
  13162. this.n19 = (this.getChild("n19"));
  13163. this.n20 = (this.getChild("n20"));
  13164. this.n21 = (this.getChild("n21"));
  13165. this.n22 = (this.getChild("n22"));
  13166. this.n23 = (this.getChild("n23"));
  13167. this.n24 = (this.getChild("n24"));
  13168. this.n25 = (this.getChild("n25"));
  13169. this.n26 = (this.getChild("n26"));
  13170. this.n27 = (this.getChild("n27"));
  13171. this.n28 = (this.getChild("n28"));
  13172. this.n29 = (this.getChild("n29"));
  13173. this.n30 = (this.getChild("n30"));
  13174. this.n31 = (this.getChild("n31"));
  13175. this.n32 = (this.getChild("n32"));
  13176. this.n33 = (this.getChild("n33"));
  13177. this.n34 = (this.getChild("n34"));
  13178. this.n35 = (this.getChild("n35"));
  13179. this.t0 = this.getTransition("t0");
  13180. }
  13181. }
  13182. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13183. class ui_Component30 extends fgui.GComponent {
  13184. static createInstance() {
  13185. return (fgui.UIPackage.createObject("game", "Component30"));
  13186. }
  13187. onConstruct() {
  13188. this.c1 = this.getController("c1");
  13189. this.n46 = (this.getChild("n46"));
  13190. this.n47 = (this.getChild("n47"));
  13191. this.numTxt = (this.getChild("numTxt"));
  13192. this.n50 = (this.getChild("n50"));
  13193. this.n53 = (this.getChild("n53"));
  13194. this.n54 = (this.getChild("n54"));
  13195. this.n55 = (this.getChild("n55"));
  13196. this.n56 = (this.getChild("n56"));
  13197. }
  13198. }
  13199. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13200. class ui_Component30_1 extends fgui.GComponent {
  13201. static createInstance() {
  13202. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13203. }
  13204. onConstruct() {
  13205. this.c1 = this.getController("c1");
  13206. this.n46 = (this.getChild("n46"));
  13207. this.n47 = (this.getChild("n47"));
  13208. this.numTxt = (this.getChild("numTxt"));
  13209. this.n50 = (this.getChild("n50"));
  13210. this.n51 = (this.getChild("n51"));
  13211. this.n52 = (this.getChild("n52"));
  13212. this.n53 = (this.getChild("n53"));
  13213. this.n54 = (this.getChild("n54"));
  13214. }
  13215. }
  13216. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13217. class ui_Component31 extends fgui.GComponent {
  13218. static createInstance() {
  13219. return (fgui.UIPackage.createObject("game", "Component31"));
  13220. }
  13221. onConstruct() {
  13222. this.n55 = (this.getChild("n55"));
  13223. this.n54 = (this.getChild("n54"));
  13224. this.conditionTxt = (this.getChild("conditionTxt"));
  13225. this.n57 = (this.getChild("n57"));
  13226. this.t0 = this.getTransition("t0");
  13227. }
  13228. }
  13229. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13230. class ui_Component32 extends fgui.GComponent {
  13231. static createInstance() {
  13232. return (fgui.UIPackage.createObject("game", "Component32"));
  13233. }
  13234. onConstruct() {
  13235. this.n5 = (this.getChild("n5"));
  13236. this.n6 = (this.getChild("n6"));
  13237. this.n7 = (this.getChild("n7"));
  13238. this.t0 = this.getTransition("t0");
  13239. }
  13240. }
  13241. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13242. class ui_AwardItem extends fgui.GComponent {
  13243. static createInstance() {
  13244. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13245. }
  13246. onConstruct() {
  13247. this.n9 = (this.getChild("n9"));
  13248. this.myIcon = (this.getChild("myIcon"));
  13249. this.numTxt = (this.getChild("numTxt"));
  13250. this.nameTxt = (this.getChild("nameTxt"));
  13251. this.n16 = (this.getChild("n16"));
  13252. this.n17 = (this.getChild("n17"));
  13253. }
  13254. }
  13255. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13256. class ui_ranking_com1 extends fgui.GButton {
  13257. static createInstance() {
  13258. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13259. }
  13260. onConstruct() {
  13261. this.c1 = this.getController("c1");
  13262. this.n49 = (this.getChild("n49"));
  13263. this.n18 = (this.getChild("n18"));
  13264. this.n46 = (this.getChild("n46"));
  13265. this.n48 = (this.getChild("n48"));
  13266. this.n50 = (this.getChild("n50"));
  13267. }
  13268. }
  13269. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13270. class ui_ranking_com2 extends fgui.GButton {
  13271. static createInstance() {
  13272. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13273. }
  13274. onConstruct() {
  13275. this.c1 = this.getController("c1");
  13276. this.n49 = (this.getChild("n49"));
  13277. this.n18 = (this.getChild("n18"));
  13278. this.n46 = (this.getChild("n46"));
  13279. this.n48 = (this.getChild("n48"));
  13280. this.n50 = (this.getChild("n50"));
  13281. }
  13282. }
  13283. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13284. class ui_ranking_com3 extends fgui.GComponent {
  13285. static createInstance() {
  13286. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13287. }
  13288. onConstruct() {
  13289. this.n17 = (this.getChild("n17"));
  13290. this.myIcon = (this.getChild("myIcon"));
  13291. }
  13292. }
  13293. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13294. class ui_ranking_com4 extends fgui.GComponent {
  13295. static createInstance() {
  13296. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13297. }
  13298. onConstruct() {
  13299. this.n16 = (this.getChild("n16"));
  13300. this.head = (this.getChild("head"));
  13301. }
  13302. }
  13303. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13304. class ui_ranking_com5 extends fgui.GComponent {
  13305. static createInstance() {
  13306. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13307. }
  13308. onConstruct() {
  13309. this.c1 = this.getController("c1");
  13310. this.c2 = this.getController("c2");
  13311. this.n2 = (this.getChild("n2"));
  13312. this.n3 = (this.getChild("n3"));
  13313. this.levelBtn = (this.getChild("levelBtn"));
  13314. this.starBtn = (this.getChild("starBtn"));
  13315. this.n23 = (this.getChild("n23"));
  13316. this.n24 = (this.getChild("n24"));
  13317. this.n25 = (this.getChild("n25"));
  13318. this.myList = (this.getChild("myList"));
  13319. this.selfNode = (this.getChild("selfNode"));
  13320. this.n9 = (this.getChild("n9"));
  13321. this.n12 = (this.getChild("n12"));
  13322. this.n13 = (this.getChild("n13"));
  13323. this.n14 = (this.getChild("n14"));
  13324. this.n39 = (this.getChild("n39"));
  13325. this.n41 = (this.getChild("n41"));
  13326. this.n42 = (this.getChild("n42"));
  13327. this.n45 = (this.getChild("n45"));
  13328. this.changeBtn = (this.getChild("changeBtn"));
  13329. this.closeBtn = (this.getChild("closeBtn"));
  13330. this.t0 = this.getTransition("t0");
  13331. }
  13332. }
  13333. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13334. class ui_RankItem extends fgui.GComponent {
  13335. static createInstance() {
  13336. return (fgui.UIPackage.createObject("game", "RankItem"));
  13337. }
  13338. onConstruct() {
  13339. this.n10 = (this.getChild("n10"));
  13340. this.n11 = (this.getChild("n11"));
  13341. this.rankTxt = (this.getChild("rankTxt"));
  13342. this.headNode = (this.getChild("headNode"));
  13343. this.nameTxt = (this.getChild("nameTxt"));
  13344. this.n19 = (this.getChild("n19"));
  13345. this.valueTxt = (this.getChild("valueTxt"));
  13346. this.img1 = (this.getChild("img1"));
  13347. this.img2 = (this.getChild("img2"));
  13348. this.img3 = (this.getChild("img3"));
  13349. }
  13350. }
  13351. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13352. class ui_ranking_com9 extends fgui.GComponent {
  13353. static createInstance() {
  13354. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13355. }
  13356. onConstruct() {
  13357. this.c1 = this.getController("c1");
  13358. this.n27 = (this.getChild("n27"));
  13359. this.n28 = (this.getChild("n28"));
  13360. this.headNode = (this.getChild("headNode"));
  13361. this.rankTxt = (this.getChild("rankTxt"));
  13362. this.nameTxt = (this.getChild("nameTxt"));
  13363. this.n34 = (this.getChild("n34"));
  13364. this.valueTxt = (this.getChild("valueTxt"));
  13365. this.n36 = (this.getChild("n36"));
  13366. this.n37 = (this.getChild("n37"));
  13367. this.n38 = (this.getChild("n38"));
  13368. this.n39 = (this.getChild("n39"));
  13369. this.n40 = (this.getChild("n40"));
  13370. }
  13371. }
  13372. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13373. class ui_ranking_com10 extends fgui.GComponent {
  13374. static createInstance() {
  13375. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13376. }
  13377. onConstruct() {
  13378. this.n23 = (this.getChild("n23"));
  13379. this.n24 = (this.getChild("n24"));
  13380. }
  13381. }
  13382. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13383. class ui_ranking_com11 extends fgui.GComponent {
  13384. static createInstance() {
  13385. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13386. }
  13387. onConstruct() {
  13388. this.n24 = (this.getChild("n24"));
  13389. this.n25 = (this.getChild("n25"));
  13390. this.t0 = this.getTransition("t0");
  13391. }
  13392. }
  13393. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13394. class ui_ranking_com13 extends fgui.GButton {
  13395. static createInstance() {
  13396. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13397. }
  13398. onConstruct() {
  13399. this.c1 = this.getController("c1");
  13400. this.n44 = (this.getChild("n44"));
  13401. this.n45 = (this.getChild("n45"));
  13402. this.n46 = (this.getChild("n46"));
  13403. }
  13404. }
  13405. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13406. class ui_Component122 extends fgui.GComponent {
  13407. static createInstance() {
  13408. return (fgui.UIPackage.createObject("game", "Component122"));
  13409. }
  13410. onConstruct() {
  13411. this.gameNode1 = (this.getChild("gameNode1"));
  13412. this.gameNode2 = (this.getChild("gameNode2"));
  13413. this.gameNode3 = (this.getChild("gameNode3"));
  13414. }
  13415. }
  13416. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13417. class ui_skillItem extends fgui.GComponent {
  13418. static createInstance() {
  13419. return (fgui.UIPackage.createObject("game", "skillItem"));
  13420. }
  13421. onConstruct() {
  13422. this.c1 = this.getController("c1");
  13423. this.n31 = (this.getChild("n31"));
  13424. this.n6 = (this.getChild("n6"));
  13425. this.skillImg = (this.getChild("skillImg"));
  13426. this.nameTxt = (this.getChild("nameTxt"));
  13427. this.levelTxt = (this.getChild("levelTxt"));
  13428. this.n28 = (this.getChild("n28"));
  13429. this.describeTxt = (this.getChild("describeTxt"));
  13430. this.n32 = (this.getChild("n32"));
  13431. this.mutiBtn = (this.getChild("mutiBtn"));
  13432. this.tryNode = (this.getChild("tryNode"));
  13433. this.normalBtn = (this.getChild("normalBtn"));
  13434. this.startBtn = (this.getChild("startBtn"));
  13435. this.n42 = (this.getChild("n42"));
  13436. this.n43 = (this.getChild("n43"));
  13437. this.n44 = (this.getChild("n44"));
  13438. }
  13439. }
  13440. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13441. class ui_Component26 extends fgui.GButton {
  13442. static createInstance() {
  13443. return (fgui.UIPackage.createObject("game", "Component26"));
  13444. }
  13445. onConstruct() {
  13446. this.n11 = (this.getChild("n11"));
  13447. this.n30 = (this.getChild("n30"));
  13448. this.n34 = (this.getChild("n34"));
  13449. }
  13450. }
  13451. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13452. class ui_Component28 extends fgui.GButton {
  13453. static createInstance() {
  13454. return (fgui.UIPackage.createObject("game", "Component28"));
  13455. }
  13456. onConstruct() {
  13457. this.n12 = (this.getChild("n12"));
  13458. this.n31 = (this.getChild("n31"));
  13459. this.curTxt = (this.getChild("curTxt"));
  13460. this.n33 = (this.getChild("n33"));
  13461. }
  13462. }
  13463. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13464. class ui_Component113 extends fgui.GComponent {
  13465. static createInstance() {
  13466. return (fgui.UIPackage.createObject("game", "Component113"));
  13467. }
  13468. onConstruct() {
  13469. this.n85 = (this.getChild("n85"));
  13470. this.n86 = (this.getChild("n86"));
  13471. this.n77 = (this.getChild("n77"));
  13472. this.n79 = (this.getChild("n79"));
  13473. this.n80 = (this.getChild("n80"));
  13474. this.n81 = (this.getChild("n81"));
  13475. this.n82 = (this.getChild("n82"));
  13476. this.n84 = (this.getChild("n84"));
  13477. this.n87 = (this.getChild("n87"));
  13478. this.t0 = this.getTransition("t0");
  13479. }
  13480. }
  13481. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13482. class ui_Component114 extends fgui.GComponent {
  13483. static createInstance() {
  13484. return (fgui.UIPackage.createObject("game", "Component114"));
  13485. }
  13486. onConstruct() {
  13487. this.n77 = (this.getChild("n77"));
  13488. this.t0 = this.getTransition("t0");
  13489. }
  13490. }
  13491. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13492. class ui_Component115 extends fgui.GComponent {
  13493. static createInstance() {
  13494. return (fgui.UIPackage.createObject("game", "Component115"));
  13495. }
  13496. onConstruct() {
  13497. this.n83 = (this.getChild("n83"));
  13498. this.fingerNode = (this.getChild("fingerNode"));
  13499. this.n84 = (this.getChild("n84"));
  13500. }
  13501. }
  13502. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13503. class ui_Component117 extends fgui.GComponent {
  13504. static createInstance() {
  13505. return (fgui.UIPackage.createObject("game", "Component117"));
  13506. }
  13507. onConstruct() {
  13508. this.n87 = (this.getChild("n87"));
  13509. this.n88 = (this.getChild("n88"));
  13510. this.n84 = (this.getChild("n84"));
  13511. this.n85 = (this.getChild("n85"));
  13512. this.n86 = (this.getChild("n86"));
  13513. this.t0 = this.getTransition("t0");
  13514. }
  13515. }
  13516. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13517. class ui_Component98_1 extends fgui.GButton {
  13518. static createInstance() {
  13519. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13520. }
  13521. onConstruct() {
  13522. this.c1 = this.getController("c1");
  13523. this.n8 = (this.getChild("n8"));
  13524. this.n41 = (this.getChild("n41"));
  13525. this.n40 = (this.getChild("n40"));
  13526. }
  13527. }
  13528. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13529. class ui_Component61 extends fgui.GComponent {
  13530. static createInstance() {
  13531. return (fgui.UIPackage.createObject("game", "Component61"));
  13532. }
  13533. onConstruct() {
  13534. this.n14 = (this.getChild("n14"));
  13535. this.n6 = (this.getChild("n6"));
  13536. this.t0 = this.getTransition("t0");
  13537. }
  13538. }
  13539. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13540. class ui_Component62 extends fgui.GComponent {
  13541. static createInstance() {
  13542. return (fgui.UIPackage.createObject("game", "Component62"));
  13543. }
  13544. onConstruct() {
  13545. this.n66 = (this.getChild("n66"));
  13546. this.n56 = (this.getChild("n56"));
  13547. this.n63 = (this.getChild("n63"));
  13548. this.n65 = (this.getChild("n65"));
  13549. this.t0 = this.getTransition("t0");
  13550. }
  13551. }
  13552. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13553. class ui_d3Root extends fgui.GComponent {
  13554. static createInstance() {
  13555. return (fgui.UIPackage.createObject("game", "d3Root"));
  13556. }
  13557. onConstruct() {
  13558. }
  13559. }
  13560. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13561. class ui_d2Root extends fgui.GComponent {
  13562. static createInstance() {
  13563. return (fgui.UIPackage.createObject("game", "d2Root"));
  13564. }
  13565. onConstruct() {
  13566. }
  13567. }
  13568. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13569. class ui_ballNode extends fgui.GComponent {
  13570. static createInstance() {
  13571. return (fgui.UIPackage.createObject("game", "ballNode"));
  13572. }
  13573. onConstruct() {
  13574. }
  13575. }
  13576. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13577. class ui_border extends fgui.GComponent {
  13578. static createInstance() {
  13579. return (fgui.UIPackage.createObject("game", "border"));
  13580. }
  13581. onConstruct() {
  13582. this.bar1 = (this.getChild("bar1"));
  13583. this.bar2 = (this.getChild("bar2"));
  13584. this.bar3 = (this.getChild("bar3"));
  13585. this.bar4 = (this.getChild("bar4"));
  13586. this.bar5 = (this.getChild("bar5"));
  13587. this.bar6 = (this.getChild("bar6"));
  13588. this.circle1 = (this.getChild("circle1"));
  13589. this.circle2 = (this.getChild("circle2"));
  13590. this.circle3 = (this.getChild("circle3"));
  13591. this.circle4 = (this.getChild("circle4"));
  13592. this.circle5 = (this.getChild("circle5"));
  13593. this.circle6 = (this.getChild("circle6"));
  13594. this.n28 = (this.getChild("n28"));
  13595. }
  13596. }
  13597. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13598. class ui_Component41_2 extends fgui.GComponent {
  13599. static createInstance() {
  13600. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13601. }
  13602. onConstruct() {
  13603. this.c1 = this.getController("c1");
  13604. this.n0 = (this.getChild("n0"));
  13605. this.n2 = (this.getChild("n2"));
  13606. this.n19 = (this.getChild("n19"));
  13607. this.cancelBtn = (this.getChild("cancelBtn"));
  13608. this.videoBtn = (this.getChild("videoBtn"));
  13609. this.n9 = (this.getChild("n9"));
  13610. this.n22 = (this.getChild("n22"));
  13611. this.tipsTxt = (this.getChild("tipsTxt"));
  13612. this.n23 = (this.getChild("n23"));
  13613. this.n24 = (this.getChild("n24"));
  13614. this.n26 = (this.getChild("n26"));
  13615. this.n27 = (this.getChild("n27"));
  13616. this.titleTxt = (this.getChild("titleTxt"));
  13617. }
  13618. }
  13619. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13620. class ui_Component41_1 extends fgui.GComponent {
  13621. static createInstance() {
  13622. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13623. }
  13624. onConstruct() {
  13625. this.c1 = this.getController("c1");
  13626. this.n0 = (this.getChild("n0"));
  13627. this.n2 = (this.getChild("n2"));
  13628. this.cancelBtn = (this.getChild("cancelBtn"));
  13629. this.videoBtn = (this.getChild("videoBtn"));
  13630. this.n27 = (this.getChild("n27"));
  13631. this.n30 = (this.getChild("n30"));
  13632. this.n31 = (this.getChild("n31"));
  13633. this.n32 = (this.getChild("n32"));
  13634. this.n33 = (this.getChild("n33"));
  13635. this.n34 = (this.getChild("n34"));
  13636. this.n35 = (this.getChild("n35"));
  13637. this.n36 = (this.getChild("n36"));
  13638. this.n1 = (this.getChild("n1"));
  13639. this.n37 = (this.getChild("n37"));
  13640. this.t0 = this.getTransition("t0");
  13641. this.t1 = this.getTransition("t1");
  13642. this.t2 = this.getTransition("t2");
  13643. this.t3 = this.getTransition("t3");
  13644. }
  13645. }
  13646. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13647. class ui_againBtn extends fgui.GButton {
  13648. static createInstance() {
  13649. return (fgui.UIPackage.createObject("game", "againBtn"));
  13650. }
  13651. onConstruct() {
  13652. this.n2 = (this.getChild("n2"));
  13653. this.n1 = (this.getChild("n1"));
  13654. this.n5 = (this.getChild("n5"));
  13655. }
  13656. }
  13657. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13658. class ui_Component118 extends fgui.GButton {
  13659. static createInstance() {
  13660. return (fgui.UIPackage.createObject("game", "Component118"));
  13661. }
  13662. onConstruct() {
  13663. this.c1 = this.getController("c1");
  13664. this.n14 = (this.getChild("n14"));
  13665. this.n9 = (this.getChild("n9"));
  13666. this.n10 = (this.getChild("n10"));
  13667. this.diamondTxt = (this.getChild("diamondTxt"));
  13668. this.n13 = (this.getChild("n13"));
  13669. this.n15 = (this.getChild("n15"));
  13670. }
  13671. }
  13672. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13673. class ui_Component119 extends fgui.GComponent {
  13674. static createInstance() {
  13675. return (fgui.UIPackage.createObject("game", "Component119"));
  13676. }
  13677. onConstruct() {
  13678. this.n1 = (this.getChild("n1"));
  13679. this.n2 = (this.getChild("n2"));
  13680. this.n13 = (this.getChild("n13"));
  13681. this.n6 = (this.getChild("n6"));
  13682. this.screenNode = (this.getChild("screenNode"));
  13683. this.n15 = (this.getChild("n15"));
  13684. this.closeBtn = (this.getChild("closeBtn"));
  13685. this.share2Btn = (this.getChild("share2Btn"));
  13686. this.shareBtn = (this.getChild("shareBtn"));
  13687. this.tipsNode = (this.getChild("tipsNode"));
  13688. this.awardNode = (this.getChild("awardNode"));
  13689. }
  13690. }
  13691. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13692. class ui_Component132_1 extends fgui.GComponent {
  13693. static createInstance() {
  13694. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13695. }
  13696. onConstruct() {
  13697. this.n25 = (this.getChild("n25"));
  13698. this.n26 = (this.getChild("n26"));
  13699. this.n27 = (this.getChild("n27"));
  13700. this.t0 = this.getTransition("t0");
  13701. }
  13702. }
  13703. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13704. class ui_SecretaryDisplay extends fgui.GComponent {
  13705. static createInstance() {
  13706. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13707. }
  13708. onConstruct() {
  13709. this.n2 = (this.getChild("n2"));
  13710. this.levelTxt = (this.getChild("levelTxt"));
  13711. this.n4 = (this.getChild("n4"));
  13712. this.secretary = (this.getChild("secretary"));
  13713. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13714. this.n16 = (this.getChild("n16"));
  13715. this.n37 = (this.getChild("n37"));
  13716. this.n41 = (this.getChild("n41"));
  13717. this.n14 = (this.getChild("n14"));
  13718. this.n17 = (this.getChild("n17"));
  13719. this.heightTxt = (this.getChild("heightTxt"));
  13720. this.n46 = (this.getChild("n46"));
  13721. this.n36 = (this.getChild("n36"));
  13722. this.n38 = (this.getChild("n38"));
  13723. this.foodTxt = (this.getChild("foodTxt"));
  13724. this.n47 = (this.getChild("n47"));
  13725. this.n40 = (this.getChild("n40"));
  13726. this.n42 = (this.getChild("n42"));
  13727. this.historyTxt = (this.getChild("historyTxt"));
  13728. this.n48 = (this.getChild("n48"));
  13729. this.nameImg = (this.getChild("nameImg"));
  13730. this.n12 = (this.getChild("n12"));
  13731. this.n49 = (this.getChild("n49"));
  13732. this.t0 = this.getTransition("t0");
  13733. }
  13734. }
  13735. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13736. class ui_BallRodDisplay extends fgui.GComponent {
  13737. static createInstance() {
  13738. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13739. }
  13740. onConstruct() {
  13741. this.c1 = this.getController("c1");
  13742. this.n31 = (this.getChild("n31"));
  13743. this.n6 = (this.getChild("n6"));
  13744. this.nameTxt = (this.getChild("nameTxt"));
  13745. this.rodImg = (this.getChild("rodImg"));
  13746. this.levelNode = (this.getChild("levelNode"));
  13747. this.eftRod = (this.getChild("eftRod"));
  13748. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13749. }
  13750. }
  13751. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13752. class ui_Component109 extends fgui.GComponent {
  13753. static createInstance() {
  13754. return (fgui.UIPackage.createObject("game", "Component109"));
  13755. }
  13756. onConstruct() {
  13757. this.n65 = (this.getChild("n65"));
  13758. this.n64 = (this.getChild("n64"));
  13759. this.n62 = (this.getChild("n62"));
  13760. this.n63 = (this.getChild("n63"));
  13761. this.t0 = this.getTransition("t0");
  13762. }
  13763. }
  13764. ui_Component109.URL = "ui://isxx5ak7vhzhv4hi";
  13765. class ui_Component110 extends fgui.GComponent {
  13766. static createInstance() {
  13767. return (fgui.UIPackage.createObject("game", "Component110"));
  13768. }
  13769. onConstruct() {
  13770. this.n65 = (this.getChild("n65"));
  13771. this.n64 = (this.getChild("n64"));
  13772. this.n62 = (this.getChild("n62"));
  13773. this.n63 = (this.getChild("n63"));
  13774. this.t0 = this.getTransition("t0");
  13775. }
  13776. }
  13777. ui_Component110.URL = "ui://isxx5ak7vhzhv4hj";
  13778. class ui_Component111_11 extends fgui.GComponent {
  13779. static createInstance() {
  13780. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13781. }
  13782. onConstruct() {
  13783. this.n68 = (this.getChild("n68"));
  13784. this.n69 = (this.getChild("n69"));
  13785. }
  13786. }
  13787. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13788. class ui_Component112 extends fgui.GComponent {
  13789. static createInstance() {
  13790. return (fgui.UIPackage.createObject("game", "Component112"));
  13791. }
  13792. onConstruct() {
  13793. this.n68 = (this.getChild("n68"));
  13794. this.n70 = (this.getChild("n70"));
  13795. this.myMask = (this.getChild("myMask"));
  13796. }
  13797. }
  13798. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13799. class ui_Component111 extends fgui.GComponent {
  13800. static createInstance() {
  13801. return (fgui.UIPackage.createObject("game", "Component111"));
  13802. }
  13803. onConstruct() {
  13804. this.n68 = (this.getChild("n68"));
  13805. this.myMask = (this.getChild("myMask"));
  13806. }
  13807. }
  13808. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13809. class ui_Component144 extends fgui.GButton {
  13810. static createInstance() {
  13811. return (fgui.UIPackage.createObject("game", "Component144"));
  13812. }
  13813. onConstruct() {
  13814. this.n8 = (this.getChild("n8"));
  13815. }
  13816. }
  13817. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13818. class ui_Sign_com2 extends fgui.GComponent {
  13819. static createInstance() {
  13820. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13821. }
  13822. onConstruct() {
  13823. this.n0 = (this.getChild("n0"));
  13824. this.n1 = (this.getChild("n1"));
  13825. this.t0 = this.getTransition("t0");
  13826. }
  13827. }
  13828. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13829. class ui_Sign_guang extends fgui.GComponent {
  13830. static createInstance() {
  13831. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13832. }
  13833. onConstruct() {
  13834. this.n1 = (this.getChild("n1"));
  13835. this.n2 = (this.getChild("n2"));
  13836. this.n3 = (this.getChild("n3"));
  13837. this.n4 = (this.getChild("n4"));
  13838. this.n5 = (this.getChild("n5"));
  13839. this.n6 = (this.getChild("n6"));
  13840. this.n8 = (this.getChild("n8"));
  13841. this.t0 = this.getTransition("t0");
  13842. }
  13843. }
  13844. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13845. class ui_SignMax extends fgui.GComponent {
  13846. static createInstance() {
  13847. return (fgui.UIPackage.createObject("game", "SignMax"));
  13848. }
  13849. onConstruct() {
  13850. this.c1 = this.getController("c1");
  13851. this.n7 = (this.getChild("n7"));
  13852. this.n15 = (this.getChild("n15"));
  13853. this.n8 = (this.getChild("n8"));
  13854. this.titleTxt = (this.getChild("titleTxt"));
  13855. this.myIcon1 = (this.getChild("myIcon1"));
  13856. this.numTxt1 = (this.getChild("numTxt1"));
  13857. this.myIcon2 = (this.getChild("myIcon2"));
  13858. this.n20 = (this.getChild("n20"));
  13859. this.n17 = (this.getChild("n17"));
  13860. this.numTxt2 = (this.getChild("numTxt2"));
  13861. this.n12 = (this.getChild("n12"));
  13862. this.n13 = (this.getChild("n13"));
  13863. this.n21 = (this.getChild("n21"));
  13864. this.n14 = (this.getChild("n14"));
  13865. }
  13866. }
  13867. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13868. class ui_Sign_com2_1 extends fgui.GComponent {
  13869. static createInstance() {
  13870. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13871. }
  13872. onConstruct() {
  13873. this.n0 = (this.getChild("n0"));
  13874. this.n1 = (this.getChild("n1"));
  13875. this.t0 = this.getTransition("t0");
  13876. }
  13877. }
  13878. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13879. class ui_Sign_com5 extends fgui.GComponent {
  13880. static createInstance() {
  13881. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13882. }
  13883. onConstruct() {
  13884. this.n3 = (this.getChild("n3"));
  13885. this.n29 = (this.getChild("n29"));
  13886. this.n4 = (this.getChild("n4"));
  13887. this.day1 = (this.getChild("day1"));
  13888. this.day2 = (this.getChild("day2"));
  13889. this.day3 = (this.getChild("day3"));
  13890. this.day4 = (this.getChild("day4"));
  13891. this.day5 = (this.getChild("day5"));
  13892. this.day6 = (this.getChild("day6"));
  13893. this.day7 = (this.getChild("day7"));
  13894. this.t0 = this.getTransition("t0");
  13895. }
  13896. }
  13897. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13898. class ui_Sign_com8 extends fgui.GComponent {
  13899. static createInstance() {
  13900. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13901. }
  13902. onConstruct() {
  13903. this.n48 = (this.getChild("n48"));
  13904. this.womanTxt = (this.getChild("womanTxt"));
  13905. this.t0 = this.getTransition("t0");
  13906. }
  13907. }
  13908. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  13909. class ui_Sign_com6 extends fgui.GComponent {
  13910. static createInstance() {
  13911. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  13912. }
  13913. onConstruct() {
  13914. this.n2 = (this.getChild("n2"));
  13915. this.n3 = (this.getChild("n3"));
  13916. this.t0 = this.getTransition("t0");
  13917. }
  13918. }
  13919. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  13920. class ui_Sign_com7 extends fgui.GComponent {
  13921. static createInstance() {
  13922. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  13923. }
  13924. onConstruct() {
  13925. this.n29 = (this.getChild("n29"));
  13926. this.n2 = (this.getChild("n2"));
  13927. }
  13928. }
  13929. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  13930. class ui_UITurntable_com1_2 extends fgui.GComponent {
  13931. static createInstance() {
  13932. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  13933. }
  13934. onConstruct() {
  13935. this.n5 = (this.getChild("n5"));
  13936. this.n4 = (this.getChild("n4"));
  13937. this.t0 = this.getTransition("t0");
  13938. }
  13939. }
  13940. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  13941. class ui_UITurntable_com2 extends fgui.GComponent {
  13942. static createInstance() {
  13943. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  13944. }
  13945. onConstruct() {
  13946. this.c1 = this.getController("c1");
  13947. this.n4 = (this.getChild("n4"));
  13948. this.n6 = (this.getChild("n6"));
  13949. this.n10 = (this.getChild("n10"));
  13950. this.n11 = (this.getChild("n11"));
  13951. this.n12 = (this.getChild("n12"));
  13952. this.n13 = (this.getChild("n13"));
  13953. this.n14 = (this.getChild("n14"));
  13954. this.n15 = (this.getChild("n15"));
  13955. this.n16 = (this.getChild("n16"));
  13956. this.n17 = (this.getChild("n17"));
  13957. this.n18 = (this.getChild("n18"));
  13958. this.n19 = (this.getChild("n19"));
  13959. this.n20 = (this.getChild("n20"));
  13960. this.n21 = (this.getChild("n21"));
  13961. this.n22 = (this.getChild("n22"));
  13962. this.n23 = (this.getChild("n23"));
  13963. this.n24 = (this.getChild("n24"));
  13964. this.n25 = (this.getChild("n25"));
  13965. this.n26 = (this.getChild("n26"));
  13966. this.n27 = (this.getChild("n27"));
  13967. this.n28 = (this.getChild("n28"));
  13968. this.n29 = (this.getChild("n29"));
  13969. this.n30 = (this.getChild("n30"));
  13970. this.n31 = (this.getChild("n31"));
  13971. this.n32 = (this.getChild("n32"));
  13972. this.n33 = (this.getChild("n33"));
  13973. }
  13974. }
  13975. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  13976. class ui_UITurntable_com1_1 extends fgui.GComponent {
  13977. static createInstance() {
  13978. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  13979. }
  13980. onConstruct() {
  13981. this.n5 = (this.getChild("n5"));
  13982. this.n4 = (this.getChild("n4"));
  13983. this.t0 = this.getTransition("t0");
  13984. }
  13985. }
  13986. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  13987. class ui_UITurntable_com5 extends fgui.GComponent {
  13988. static createInstance() {
  13989. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  13990. }
  13991. onConstruct() {
  13992. this.flashNode = (this.getChild("flashNode"));
  13993. this.rotNode = (this.getChild("rotNode"));
  13994. this.n3 = (this.getChild("n3"));
  13995. this.n21 = (this.getChild("n21"));
  13996. this.t0 = this.getTransition("t0");
  13997. }
  13998. }
  13999. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14000. class ui_UITurntable_com7 extends fgui.GComponent {
  14001. static createInstance() {
  14002. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14003. }
  14004. onConstruct() {
  14005. this.n2 = (this.getChild("n2"));
  14006. this.n35 = (this.getChild("n35"));
  14007. this.img1 = (this.getChild("img1"));
  14008. this.img2 = (this.getChild("img2"));
  14009. this.img3 = (this.getChild("img3"));
  14010. this.img4 = (this.getChild("img4"));
  14011. this.img6 = (this.getChild("img6"));
  14012. this.img5 = (this.getChild("img5"));
  14013. this.txt1 = (this.getChild("txt1"));
  14014. this.txt2 = (this.getChild("txt2"));
  14015. this.txt3 = (this.getChild("txt3"));
  14016. this.txt4 = (this.getChild("txt4"));
  14017. this.txt5 = (this.getChild("txt5"));
  14018. this.txt6 = (this.getChild("txt6"));
  14019. }
  14020. }
  14021. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14022. class ui_UITurntable_com9 extends fgui.GComponent {
  14023. static createInstance() {
  14024. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14025. }
  14026. onConstruct() {
  14027. this.n38 = (this.getChild("n38"));
  14028. this.n39 = (this.getChild("n39"));
  14029. }
  14030. }
  14031. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14032. class ui_UITurntable_com10 extends fgui.GComponent {
  14033. static createInstance() {
  14034. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14035. }
  14036. onConstruct() {
  14037. this.n39 = (this.getChild("n39"));
  14038. this.n40 = (this.getChild("n40"));
  14039. this.t0 = this.getTransition("t0");
  14040. }
  14041. }
  14042. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14043. class ui_UITurntable_com11 extends fgui.GComponent {
  14044. static createInstance() {
  14045. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14046. }
  14047. onConstruct() {
  14048. this.n38 = (this.getChild("n38"));
  14049. this.n39 = (this.getChild("n39"));
  14050. this.n40 = (this.getChild("n40"));
  14051. this.t0 = this.getTransition("t0");
  14052. }
  14053. }
  14054. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14055. class ui_UITurntable_com12 extends fgui.GComponent {
  14056. static createInstance() {
  14057. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14058. }
  14059. onConstruct() {
  14060. this.n43 = (this.getChild("n43"));
  14061. this.barNode = (this.getChild("barNode"));
  14062. this.tipsTxt = (this.getChild("tipsTxt"));
  14063. this.n45 = (this.getChild("n45"));
  14064. this.boxBtn = (this.getChild("boxBtn"));
  14065. }
  14066. }
  14067. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14068. class ui_UITurntable_com1 extends fgui.GButton {
  14069. static createInstance() {
  14070. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14071. }
  14072. onConstruct() {
  14073. this.n41 = (this.getChild("n41"));
  14074. this.n42 = (this.getChild("n42"));
  14075. this.t0 = this.getTransition("t0");
  14076. }
  14077. }
  14078. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14079. class ui_UITurntable_com3 extends fgui.GComponent {
  14080. static createInstance() {
  14081. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14082. }
  14083. onConstruct() {
  14084. this.n48 = (this.getChild("n48"));
  14085. this.womanTxt = (this.getChild("womanTxt"));
  14086. this.t0 = this.getTransition("t0");
  14087. }
  14088. }
  14089. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14090. class ui_cancelBtn2 extends fgui.GButton {
  14091. static createInstance() {
  14092. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14093. }
  14094. onConstruct() {
  14095. this.c1 = this.getController("c1");
  14096. this.n0 = (this.getChild("n0"));
  14097. this.n1 = (this.getChild("n1"));
  14098. this.n2 = (this.getChild("n2"));
  14099. this.n3 = (this.getChild("n3"));
  14100. this.n4 = (this.getChild("n4"));
  14101. this.n5 = (this.getChild("n5"));
  14102. this.n6 = (this.getChild("n6"));
  14103. this.n7 = (this.getChild("n7"));
  14104. this.n8 = (this.getChild("n8"));
  14105. this.powerEft = (this.getChild("powerEft"));
  14106. }
  14107. }
  14108. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14109. class ui_shareBtn2 extends fgui.GButton {
  14110. static createInstance() {
  14111. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14112. }
  14113. onConstruct() {
  14114. this.c1 = this.getController("c1");
  14115. this.n2 = (this.getChild("n2"));
  14116. this.n24 = (this.getChild("n24"));
  14117. this.n1 = (this.getChild("n1"));
  14118. this.n3 = (this.getChild("n3"));
  14119. this.n23 = (this.getChild("n23"));
  14120. this.n4 = (this.getChild("n4"));
  14121. this.n5 = (this.getChild("n5"));
  14122. this.n6 = (this.getChild("n6"));
  14123. this.n20 = (this.getChild("n20"));
  14124. this.n21 = (this.getChild("n21"));
  14125. this.n22 = (this.getChild("n22"));
  14126. this.powerEft = (this.getChild("powerEft"));
  14127. }
  14128. }
  14129. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14130. class ui_UIMoney extends fgui.GComponent {
  14131. static createInstance() {
  14132. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14133. }
  14134. onConstruct() {
  14135. this.c1 = this.getController("c1");
  14136. this.n4 = (this.getChild("n4"));
  14137. this.coinImg = (this.getChild("coinImg"));
  14138. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14139. this.coinTxt = (this.getChild("coinTxt"));
  14140. this.n7 = (this.getChild("n7"));
  14141. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14142. this.diamondTxt = (this.getChild("diamondTxt"));
  14143. this.diamondImg = (this.getChild("diamondImg"));
  14144. this.n12 = (this.getChild("n12"));
  14145. this.powerImg = (this.getChild("powerImg"));
  14146. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14147. this.powerTxt = (this.getChild("powerTxt"));
  14148. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14149. }
  14150. }
  14151. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14152. class ui_backBtn extends fgui.GButton {
  14153. static createInstance() {
  14154. return (fgui.UIPackage.createObject("game", "backBtn"));
  14155. }
  14156. onConstruct() {
  14157. this.n0 = (this.getChild("n0"));
  14158. this.t0 = this.getTransition("t0");
  14159. this.t1 = this.getTransition("t1");
  14160. }
  14161. }
  14162. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14163. class ui_MoneyBtn extends fgui.GButton {
  14164. static createInstance() {
  14165. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14166. }
  14167. onConstruct() {
  14168. this.button = this.getController("button");
  14169. this.n0 = (this.getChild("n0"));
  14170. }
  14171. }
  14172. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14173. class ui_UIMoneyBtn extends fgui.GComponent {
  14174. static createInstance() {
  14175. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14176. }
  14177. onConstruct() {
  14178. this.n1 = (this.getChild("n1"));
  14179. this.closeBtn = (this.getChild("closeBtn"));
  14180. }
  14181. }
  14182. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14183. class ui_Component64 extends fgui.GComponent {
  14184. static createInstance() {
  14185. return (fgui.UIPackage.createObject("game", "Component64"));
  14186. }
  14187. onConstruct() {
  14188. this.n57 = (this.getChild("n57"));
  14189. this.n54 = (this.getChild("n54"));
  14190. this.n55 = (this.getChild("n55"));
  14191. this.n56 = (this.getChild("n56"));
  14192. this.t1 = this.getTransition("t1");
  14193. }
  14194. }
  14195. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14196. class ui_Component41_3 extends fgui.GComponent {
  14197. static createInstance() {
  14198. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14199. }
  14200. onConstruct() {
  14201. this.c1 = this.getController("c1");
  14202. this.n0 = (this.getChild("n0"));
  14203. this.n2 = (this.getChild("n2"));
  14204. this.cancelBtn = (this.getChild("cancelBtn"));
  14205. this.videoBtn = (this.getChild("videoBtn"));
  14206. this.n9 = (this.getChild("n9"));
  14207. this.n24 = (this.getChild("n24"));
  14208. this.n27 = (this.getChild("n27"));
  14209. this.titleTxt = (this.getChild("titleTxt"));
  14210. this.n28 = (this.getChild("n28"));
  14211. this.t0 = this.getTransition("t0");
  14212. }
  14213. }
  14214. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14215. class ui_dh_zs_4 extends fgui.GComponent {
  14216. static createInstance() {
  14217. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14218. }
  14219. onConstruct() {
  14220. this.n1 = (this.getChild("n1"));
  14221. this.n2 = (this.getChild("n2"));
  14222. this.n3 = (this.getChild("n3"));
  14223. this.n4 = (this.getChild("n4"));
  14224. this.n5 = (this.getChild("n5"));
  14225. this.n6 = (this.getChild("n6"));
  14226. this.n8 = (this.getChild("n8"));
  14227. this.t0 = this.getTransition("t0");
  14228. }
  14229. }
  14230. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14231. class ui_Component71_1 extends fgui.GButton {
  14232. static createInstance() {
  14233. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14234. }
  14235. onConstruct() {
  14236. this.n17 = (this.getChild("n17"));
  14237. this.t0 = this.getTransition("t0");
  14238. }
  14239. }
  14240. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14241. class ui_Component83 extends fgui.GComponent {
  14242. static createInstance() {
  14243. return (fgui.UIPackage.createObject("game", "Component83"));
  14244. }
  14245. onConstruct() {
  14246. this.c1 = this.getController("c1");
  14247. this.n17 = (this.getChild("n17"));
  14248. this.n19 = (this.getChild("n19"));
  14249. this.n20 = (this.getChild("n20"));
  14250. }
  14251. }
  14252. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14253. class ui_Component84 extends fgui.GComponent {
  14254. static createInstance() {
  14255. return (fgui.UIPackage.createObject("game", "Component84"));
  14256. }
  14257. onConstruct() {
  14258. this.c1 = this.getController("c1");
  14259. this.n4 = (this.getChild("n4"));
  14260. this.n22 = (this.getChild("n22"));
  14261. this.n23 = (this.getChild("n23"));
  14262. this.numTxt = (this.getChild("numTxt"));
  14263. this.n25 = (this.getChild("n25"));
  14264. this.n26 = (this.getChild("n26"));
  14265. }
  14266. }
  14267. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14268. class ui_Component84_1 extends fgui.GComponent {
  14269. static createInstance() {
  14270. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14271. }
  14272. onConstruct() {
  14273. this.c1 = this.getController("c1");
  14274. this.n4 = (this.getChild("n4"));
  14275. this.n22 = (this.getChild("n22"));
  14276. this.n23 = (this.getChild("n23"));
  14277. this.numTxt = (this.getChild("numTxt"));
  14278. this.n25 = (this.getChild("n25"));
  14279. this.n26 = (this.getChild("n26"));
  14280. }
  14281. }
  14282. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14283. class ui_Component85 extends fgui.GComponent {
  14284. static createInstance() {
  14285. return (fgui.UIPackage.createObject("game", "Component85"));
  14286. }
  14287. onConstruct() {
  14288. this.n1 = (this.getChild("n1"));
  14289. this.n6 = (this.getChild("n6"));
  14290. this.n2 = (this.getChild("n2"));
  14291. this.n3 = (this.getChild("n3"));
  14292. this.levelTxt = (this.getChild("levelTxt"));
  14293. this.n10 = (this.getChild("n10"));
  14294. this.n11 = (this.getChild("n11"));
  14295. this.n12 = (this.getChild("n12"));
  14296. this.n13 = (this.getChild("n13"));
  14297. this.n14 = (this.getChild("n14"));
  14298. this.modeNode = (this.getChild("modeNode"));
  14299. this.n18 = (this.getChild("n18"));
  14300. this.conditionTxt = (this.getChild("conditionTxt"));
  14301. this.diamondNode = (this.getChild("diamondNode"));
  14302. this.coinNode = (this.getChild("coinNode"));
  14303. this.startBtn = (this.getChild("startBtn"));
  14304. this.n28 = (this.getChild("n28"));
  14305. this.displayRoot = (this.getChild("displayRoot"));
  14306. this.t0 = this.getTransition("t0");
  14307. }
  14308. }
  14309. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14310. class ui_Component86 extends fgui.GButton {
  14311. static createInstance() {
  14312. return (fgui.UIPackage.createObject("game", "Component86"));
  14313. }
  14314. onConstruct() {
  14315. this.n15 = (this.getChild("n15"));
  14316. this.t0 = this.getTransition("t0");
  14317. }
  14318. }
  14319. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14320. class ui_Component87 extends fgui.GComponent {
  14321. static createInstance() {
  14322. return (fgui.UIPackage.createObject("game", "Component87"));
  14323. }
  14324. onConstruct() {
  14325. this.n66 = (this.getChild("n66"));
  14326. this.myProgress = (this.getChild("myProgress"));
  14327. this.starAni = (this.getChild("starAni"));
  14328. this.hpTxt = (this.getChild("hpTxt"));
  14329. this.n74 = (this.getChild("n74"));
  14330. this.n73 = (this.getChild("n73"));
  14331. this.ballTxt = (this.getChild("ballTxt"));
  14332. this.n76 = (this.getChild("n76"));
  14333. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14334. this.levelTxt = (this.getChild("levelTxt"));
  14335. this.star1 = (this.getChild("star1"));
  14336. this.star2 = (this.getChild("star2"));
  14337. this.star3 = (this.getChild("star3"));
  14338. }
  14339. }
  14340. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14341. class ui_Component88 extends fgui.GProgressBar {
  14342. static createInstance() {
  14343. return (fgui.UIPackage.createObject("game", "Component88"));
  14344. }
  14345. onConstruct() {
  14346. this.n68 = (this.getChild("n68"));
  14347. this.bar = (this.getChild("bar"));
  14348. }
  14349. }
  14350. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14351. class ui_Component89 extends fgui.GComponent {
  14352. static createInstance() {
  14353. return (fgui.UIPackage.createObject("game", "Component89"));
  14354. }
  14355. onConstruct() {
  14356. this.c1 = this.getController("c1");
  14357. this.n71 = (this.getChild("n71"));
  14358. this.n72 = (this.getChild("n72"));
  14359. }
  14360. }
  14361. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14362. class ui_Component90 extends fgui.GComponent {
  14363. static createInstance() {
  14364. return (fgui.UIPackage.createObject("game", "Component90"));
  14365. }
  14366. onConstruct() {
  14367. this.c1 = this.getController("c1");
  14368. this.n64 = (this.getChild("n64"));
  14369. this.n65 = (this.getChild("n65"));
  14370. this.n66 = (this.getChild("n66"));
  14371. this.t0 = this.getTransition("t0");
  14372. }
  14373. }
  14374. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14375. class ui_Component127 extends fgui.GButton {
  14376. static createInstance() {
  14377. return (fgui.UIPackage.createObject("game", "Component127"));
  14378. }
  14379. onConstruct() {
  14380. this.n5 = (this.getChild("n5"));
  14381. }
  14382. }
  14383. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14384. class gameBinder {
  14385. static bindAll() {
  14386. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14387. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14388. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14389. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14390. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14391. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14392. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14393. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14394. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14395. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14396. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14397. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14398. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14399. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14400. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14401. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14402. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14403. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14404. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14405. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14406. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14407. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14408. fgui.UIObjectFactory.setExtension(ui_Component121.URL, ui_Component121);
  14409. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14410. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14411. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14412. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14413. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14414. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14415. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14416. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14417. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14418. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14419. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14420. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14421. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14422. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14423. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14424. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14425. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14426. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14427. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14428. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14429. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14430. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14431. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14432. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14433. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14434. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14435. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14436. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14437. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14438. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14439. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14440. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14441. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14442. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14443. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14444. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14445. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14446. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14447. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14448. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14449. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14450. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14451. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14452. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14453. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14454. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14455. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14456. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14457. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14458. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14459. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14460. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14461. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14462. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14463. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14464. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14465. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14466. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14467. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14468. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14469. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14470. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14471. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14472. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14473. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14474. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14475. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14476. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14477. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14478. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14479. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14480. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14481. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14482. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14483. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14484. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14485. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14486. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14487. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14488. fgui.UIObjectFactory.setExtension(ui_Component16.URL, ui_Component16);
  14489. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14490. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14491. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14492. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14493. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14494. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14495. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14496. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14497. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14498. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14499. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14500. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14501. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14502. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14503. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14504. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14505. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14506. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14507. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14508. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14509. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14510. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14511. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14512. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14513. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14514. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14515. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14516. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14517. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14518. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14519. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14520. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14521. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14522. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14523. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14524. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14525. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14526. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14527. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14528. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14529. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14530. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14531. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14532. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14533. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14534. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14535. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14536. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14537. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14538. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14539. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14540. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14541. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14542. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14543. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14544. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14545. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14546. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14547. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14548. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14549. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14550. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14551. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14552. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganzi.URL, ui_dh_zy_ganzi);
  14553. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14554. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14555. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14556. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14557. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14558. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14559. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14560. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14561. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14562. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14563. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14564. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14565. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14566. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14567. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14568. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14569. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14570. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14571. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14572. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14573. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14574. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14575. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14576. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14577. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14578. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14579. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14580. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14581. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14582. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14583. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14584. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14585. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14586. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14587. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14588. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14589. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14590. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14591. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14592. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14593. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14594. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14595. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14596. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14597. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14598. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14599. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14600. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14601. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14602. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14603. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14604. fgui.UIObjectFactory.setExtension(ui_Component109.URL, ui_Component109);
  14605. fgui.UIObjectFactory.setExtension(ui_Component110.URL, ui_Component110);
  14606. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14607. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14608. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14609. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14610. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14611. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14612. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14613. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14614. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14615. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14616. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14617. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14618. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14619. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14620. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14621. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14622. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14623. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14624. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14625. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14626. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14627. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14628. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14629. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14630. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14631. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14632. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14633. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14634. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14635. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14636. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14637. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14638. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14639. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14640. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14641. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14642. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14643. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14644. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14645. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14646. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14647. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14648. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14649. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14650. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14651. }
  14652. }
  14653. class ui_btn6 extends fgui.GButton {
  14654. static createInstance() {
  14655. return (fgui.UIPackage.createObject("loading", "btn6"));
  14656. }
  14657. onConstruct() {
  14658. this.n6 = (this.getChild("n6"));
  14659. this.n1 = (this.getChild("n1"));
  14660. }
  14661. }
  14662. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14663. class ui_xyItem extends fgui.GComponent {
  14664. static createInstance() {
  14665. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14666. }
  14667. onConstruct() {
  14668. this.xyItem = (this.getChild("xyItem"));
  14669. }
  14670. }
  14671. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14672. class ui_loadinfo extends fgui.GProgressBar {
  14673. static createInstance() {
  14674. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14675. }
  14676. onConstruct() {
  14677. this.bg = (this.getChild("bg"));
  14678. this.bar = (this.getChild("bar"));
  14679. this.title = (this.getChild("title"));
  14680. this.ani = (this.getChild("ani"));
  14681. }
  14682. }
  14683. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14684. class ui_xyNode extends fgui.GComponent {
  14685. static createInstance() {
  14686. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14687. }
  14688. onConstruct() {
  14689. this.n0 = (this.getChild("n0"));
  14690. this.btnYes = (this.getChild("btnYes"));
  14691. this.btnNo = (this.getChild("btnNo"));
  14692. this.btnKnown = (this.getChild("btnKnown"));
  14693. this.btnSure = (this.getChild("btnSure"));
  14694. this.txtWelcom = (this.getChild("txtWelcom"));
  14695. this.txtXy = (this.getChild("txtXy"));
  14696. this.n75 = (this.getChild("n75"));
  14697. this.btnXy1 = (this.getChild("btnXy1"));
  14698. this.btnXy3 = (this.getChild("btnXy3"));
  14699. this.btnXy2 = (this.getChild("btnXy2"));
  14700. this.n74 = (this.getChild("n74"));
  14701. this.xy1 = (this.getChild("xy1"));
  14702. this.txtTitle = (this.getChild("txtTitle"));
  14703. this.btnBack = (this.getChild("btnBack"));
  14704. this.xyList = (this.getChild("xyList"));
  14705. this.xy2 = (this.getChild("xy2"));
  14706. this.xyNode = (this.getChild("xyNode"));
  14707. }
  14708. }
  14709. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14710. class ui_ageNode extends fgui.GComponent {
  14711. static createInstance() {
  14712. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14713. }
  14714. onConstruct() {
  14715. this.n3 = (this.getChild("n3"));
  14716. this.n7 = (this.getChild("n7"));
  14717. this.n4 = (this.getChild("n4"));
  14718. this.btnAge = (this.getChild("btnAge"));
  14719. this.ageNode = (this.getChild("ageNode"));
  14720. }
  14721. }
  14722. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14723. class ui_rnNode extends fgui.GComponent {
  14724. static createInstance() {
  14725. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14726. }
  14727. onConstruct() {
  14728. this.n28 = (this.getChild("n28"));
  14729. this.n30 = (this.getChild("n30"));
  14730. this.n33 = (this.getChild("n33"));
  14731. this.rn1 = (this.getChild("rn1"));
  14732. this.n40 = (this.getChild("n40"));
  14733. this.n41 = (this.getChild("n41"));
  14734. this.rn3 = (this.getChild("rn3"));
  14735. this.n37 = (this.getChild("n37"));
  14736. this.n39 = (this.getChild("n39"));
  14737. this.rn2 = (this.getChild("rn2"));
  14738. this.n47 = (this.getChild("n47"));
  14739. this.n49 = (this.getChild("n49"));
  14740. this.n44 = (this.getChild("n44"));
  14741. this.inputCode = (this.getChild("inputCode"));
  14742. this.inputName = (this.getChild("inputName"));
  14743. this.n48 = (this.getChild("n48"));
  14744. this.n50 = (this.getChild("n50"));
  14745. this.rn4 = (this.getChild("rn4"));
  14746. this.btnCheck = (this.getChild("btnCheck"));
  14747. this.btnExit = (this.getChild("btnExit"));
  14748. this.btnDone = (this.getChild("btnDone"));
  14749. this.rnNode = (this.getChild("rnNode"));
  14750. }
  14751. }
  14752. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14753. class ui_tipNode extends fgui.GComponent {
  14754. static createInstance() {
  14755. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14756. }
  14757. onConstruct() {
  14758. this.bg = (this.getChild("bg"));
  14759. this.n55 = (this.getChild("n55"));
  14760. this.n56 = (this.getChild("n56"));
  14761. this.tipNode = (this.getChild("tipNode"));
  14762. }
  14763. }
  14764. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14765. class ui_fcmNode extends fgui.GComponent {
  14766. static createInstance() {
  14767. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14768. }
  14769. onConstruct() {
  14770. this.n63 = (this.getChild("n63"));
  14771. this.n62 = (this.getChild("n62"));
  14772. this.btnRn = (this.getChild("btnRn"));
  14773. this.n61 = (this.getChild("n61"));
  14774. this.n58 = (this.getChild("n58"));
  14775. this.fcmNode = (this.getChild("fcmNode"));
  14776. }
  14777. }
  14778. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14779. class ui_msgNode extends fgui.GComponent {
  14780. static createInstance() {
  14781. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14782. }
  14783. onConstruct() {
  14784. this.n69 = (this.getChild("n69"));
  14785. this.txtMsg = (this.getChild("txtMsg"));
  14786. this.msgNode = (this.getChild("msgNode"));
  14787. }
  14788. }
  14789. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14790. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14791. static createInstance() {
  14792. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14793. }
  14794. onConstruct() {
  14795. this.n1 = (this.getChild("n1"));
  14796. this.n13 = (this.getChild("n13"));
  14797. this.n14 = (this.getChild("n14"));
  14798. this.n15 = (this.getChild("n15"));
  14799. this.n3 = (this.getChild("n3"));
  14800. this.n4 = (this.getChild("n4"));
  14801. this.n5 = (this.getChild("n5"));
  14802. this.n6 = (this.getChild("n6"));
  14803. this.n7 = (this.getChild("n7"));
  14804. this.n8 = (this.getChild("n8"));
  14805. this.n9 = (this.getChild("n9"));
  14806. this.n10 = (this.getChild("n10"));
  14807. this.n12 = (this.getChild("n12"));
  14808. this.n11 = (this.getChild("n11"));
  14809. this.n16 = (this.getChild("n16"));
  14810. this.n17 = (this.getChild("n17"));
  14811. this.n18 = (this.getChild("n18"));
  14812. this.n20 = (this.getChild("n20"));
  14813. this.n21 = (this.getChild("n21"));
  14814. this.t0 = this.getTransition("t0");
  14815. }
  14816. }
  14817. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14818. class ui_btn5 extends fgui.GButton {
  14819. static createInstance() {
  14820. return (fgui.UIPackage.createObject("loading", "btn5"));
  14821. }
  14822. onConstruct() {
  14823. this.n9 = (this.getChild("n9"));
  14824. this.n1 = (this.getChild("n1"));
  14825. }
  14826. }
  14827. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14828. class ui_UILoading extends fgui.GComponent {
  14829. static createInstance() {
  14830. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14831. }
  14832. onConstruct() {
  14833. this.n12 = (this.getChild("n12"));
  14834. this.loadinfo = (this.getChild("loadinfo"));
  14835. this.n13 = (this.getChild("n13"));
  14836. this.txtLoad = (this.getChild("txtLoad"));
  14837. this.n19 = (this.getChild("n19"));
  14838. this.n20 = (this.getChild("n20"));
  14839. this.t_d = (this.getChild("t_d"));
  14840. this.n18 = (this.getChild("n18"));
  14841. }
  14842. }
  14843. ui_UILoading.URL = "ui://37nctnhwphc33";
  14844. class ui_AgeItem extends fgui.GComponent {
  14845. static createInstance() {
  14846. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14847. }
  14848. onConstruct() {
  14849. this.txtAge = (this.getChild("txtAge"));
  14850. }
  14851. }
  14852. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14853. class ui_btn1 extends fgui.GButton {
  14854. static createInstance() {
  14855. return (fgui.UIPackage.createObject("loading", "btn1"));
  14856. }
  14857. onConstruct() {
  14858. this.n6 = (this.getChild("n6"));
  14859. this.n1 = (this.getChild("n1"));
  14860. }
  14861. }
  14862. ui_btn1.URL = "ui://37nctnhwxe622p";
  14863. class ui_btn3 extends fgui.GButton {
  14864. static createInstance() {
  14865. return (fgui.UIPackage.createObject("loading", "btn3"));
  14866. }
  14867. onConstruct() {
  14868. this.n9 = (this.getChild("n9"));
  14869. this.n1 = (this.getChild("n1"));
  14870. }
  14871. }
  14872. ui_btn3.URL = "ui://37nctnhwxe622s";
  14873. class ui_btn2 extends fgui.GButton {
  14874. static createInstance() {
  14875. return (fgui.UIPackage.createObject("loading", "btn2"));
  14876. }
  14877. onConstruct() {
  14878. this.n6 = (this.getChild("n6"));
  14879. this.n1 = (this.getChild("n1"));
  14880. }
  14881. }
  14882. ui_btn2.URL = "ui://37nctnhwxe622t";
  14883. class ui_btnBack extends fgui.GButton {
  14884. static createInstance() {
  14885. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14886. }
  14887. onConstruct() {
  14888. this.n6 = (this.getChild("n6"));
  14889. this.n7 = (this.getChild("n7"));
  14890. }
  14891. }
  14892. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14893. class ui_btnXy1 extends fgui.GButton {
  14894. static createInstance() {
  14895. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14896. }
  14897. onConstruct() {
  14898. this.n1 = (this.getChild("n1"));
  14899. }
  14900. }
  14901. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14902. class ui_btnXy2 extends fgui.GButton {
  14903. static createInstance() {
  14904. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14905. }
  14906. onConstruct() {
  14907. this.n1 = (this.getChild("n1"));
  14908. }
  14909. }
  14910. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14911. class ui_btnXy3 extends fgui.GButton {
  14912. static createInstance() {
  14913. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  14914. }
  14915. onConstruct() {
  14916. this.n1 = (this.getChild("n1"));
  14917. }
  14918. }
  14919. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  14920. class ui_btn4 extends fgui.GButton {
  14921. static createInstance() {
  14922. return (fgui.UIPackage.createObject("loading", "btn4"));
  14923. }
  14924. onConstruct() {
  14925. this.n9 = (this.getChild("n9"));
  14926. this.n1 = (this.getChild("n1"));
  14927. }
  14928. }
  14929. ui_btn4.URL = "ui://37nctnhwxe622z";
  14930. class loadingBinder {
  14931. static bindAll() {
  14932. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  14933. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  14934. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  14935. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  14936. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  14937. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  14938. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  14939. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  14940. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  14941. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  14942. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  14943. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  14944. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  14945. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  14946. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  14947. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  14948. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  14949. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  14950. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  14951. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  14952. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  14953. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  14954. }
  14955. }
  14956. class UIMgr {
  14957. constructor() {
  14958. this._stage = null;
  14959. this._uiList = [];
  14960. this._showList = [];
  14961. this._bindPkgList = [];
  14962. this.uiIndex = 0;
  14963. }
  14964. static get inst() {
  14965. if (UIMgr._inst == null) {
  14966. UIMgr._inst = new UIMgr();
  14967. }
  14968. return UIMgr._inst;
  14969. }
  14970. setStage(s) {
  14971. if (this._stage) {
  14972. console.log("ViewMgr::Stage->舞台不可赋值两次");
  14973. return;
  14974. }
  14975. this._stage = s;
  14976. }
  14977. init() {
  14978. this.setStage(Laya.stage);
  14979. fairygui.UIConfig.defaultFont = "微软雅黑";
  14980. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  14981. fairygui.UIConfig.packageFileExtension = "obj";
  14982. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  14983. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  14984. fairygui.GRoot.inst.width = Laya.stage.width;
  14985. fairygui.GRoot.inst.height = Laya.stage.height;
  14986. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  14987. }
  14988. addAllUpdate() {
  14989. this.uiIndex = 0;
  14990. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  14991. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  14992. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  14993. }
  14994. }
  14995. }
  14996. bindFUI(pkgname) {
  14997. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  14998. return;
  14999. }
  15000. switch (pkgname) {
  15001. case fguiRes.loading:
  15002. fairygui.UIPackage.addPackage(pkgname);
  15003. loadingBinder.bindAll();
  15004. this._bindPkgList.push(pkgname);
  15005. break;
  15006. case fguiRes.game:
  15007. fairygui.UIPackage.addPackage(pkgname);
  15008. gameBinder.bindAll();
  15009. this._bindPkgList.push(pkgname);
  15010. break;
  15011. default:
  15012. break;
  15013. }
  15014. }
  15015. Show(cls, ...param) {
  15016. let nameStr = cls.uiName;
  15017. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15018. let temp = this._uiList[i];
  15019. let str = temp.className;
  15020. if (str == nameStr) {
  15021. if (temp.isMuti) {
  15022. if (temp.isHide) {
  15023. temp.show(...param);
  15024. this._uiList.splice(i, 1);
  15025. this._uiList.push(temp);
  15026. return temp;
  15027. }
  15028. }
  15029. else {
  15030. temp.show(...param);
  15031. this._uiList.splice(i, 1);
  15032. this._uiList.push(temp);
  15033. return temp;
  15034. }
  15035. }
  15036. }
  15037. let ui = new cls();
  15038. ui.className = nameStr;
  15039. this._showUI(ui, param);
  15040. return ui;
  15041. }
  15042. destroyUI(ui) {
  15043. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15044. let temp = this._uiList[i].className;
  15045. if (temp == ui.className) {
  15046. this._uiList.splice(i, 1);
  15047. break;
  15048. }
  15049. }
  15050. this.checkUIState();
  15051. }
  15052. _showUI(ui, param) {
  15053. this._uiList.push(ui);
  15054. ui.show(...param);
  15055. }
  15056. Hide(uiClass) {
  15057. let ui = this.getUI(uiClass);
  15058. if (ui && !ui.isHide) {
  15059. ui.hide();
  15060. }
  15061. }
  15062. getUI(ui) {
  15063. let nameStr = ui.uiName;
  15064. for (let index = 0; index < this._uiList.length; index++) {
  15065. let temp = this._uiList[index];
  15066. if (temp.className == nameStr) {
  15067. return temp;
  15068. }
  15069. }
  15070. return null;
  15071. }
  15072. isShow(cls) {
  15073. for (var i of this._uiList) {
  15074. if (i instanceof cls) {
  15075. return i.isShowing;
  15076. }
  15077. }
  15078. return false;
  15079. }
  15080. showUINum() {
  15081. let num = 0;
  15082. for (var i of this._uiList) {
  15083. if (i.isShowing) {
  15084. num++;
  15085. }
  15086. }
  15087. return num;
  15088. }
  15089. checkUIState() {
  15090. Laya.timer.clear(this, this._uiCheck);
  15091. Laya.timer.once(400, this, this._uiCheck);
  15092. }
  15093. _uiCheck() {
  15094. let showList = [];
  15095. for (var i of this._uiList) {
  15096. if (!i.isHide) {
  15097. showList.push(i);
  15098. }
  15099. }
  15100. for (let index = 0; index < showList.length; index++) {
  15101. if (index == showList.length - 1) {
  15102. showList[index].checkActive(true);
  15103. }
  15104. else {
  15105. showList[index].checkActive(false);
  15106. }
  15107. }
  15108. }
  15109. showTip(msg, time = 600, size = 30) {
  15110. }
  15111. }
  15112. class UIShowList {
  15113. }
  15114. class SoundMgr {
  15115. constructor() {
  15116. this.soundMax = 4;
  15117. this.isLoad = false;
  15118. this.soundMap = {};
  15119. this.isSound = true;
  15120. this.openShake = true;
  15121. SoundMgr._instance = this;
  15122. }
  15123. static getInstance() {
  15124. if (!this._instance) {
  15125. this._instance = new SoundMgr();
  15126. }
  15127. return this._instance;
  15128. }
  15129. init() {
  15130. console.log('zh:sm init 1');
  15131. Laya.SoundManager.autoReleaseSound = true;
  15132. Laya.SoundManager.autoStopMusic = true;
  15133. Laya.SoundManager.musicVolume = 0.3;
  15134. Laya.SoundManager.soundVolume = 0.5;
  15135. this.musicPlayed = false;
  15136. this.audioUrl = "asset/sound/ogg/";
  15137. console.log('zh:sm init 2');
  15138. console.log('zh:dev type ');
  15139. if (Laya.Browser.onAndroid) {
  15140. console.log('zh:dev type android');
  15141. this.audioUrl = "asset/sound/ogg/";
  15142. this.isLoad = true;
  15143. }
  15144. else {
  15145. console.log('zh:dev type not android');
  15146. this.audioUrl = "asset/sound/mp3/";
  15147. this.isLoad = true;
  15148. }
  15149. }
  15150. onSetting(isS) {
  15151. this.isSound = isS;
  15152. this.mute(!this.isSound);
  15153. }
  15154. clearCount() {
  15155. for (var key in this.soundMap) {
  15156. delete this.soundMap[key];
  15157. }
  15158. }
  15159. playMusic(path, loop = 0) {
  15160. console.log('zh:playMusic 1 PATH=' + path);
  15161. this.musicPath = path;
  15162. if (!this.isLoad)
  15163. console.log('zh:playMusic 2');
  15164. return;
  15165. if (!path || path == "")
  15166. console.log('zh:playMusic 3');
  15167. return;
  15168. if (!this.isSound)
  15169. console.log('zh:playMusic 4');
  15170. return;
  15171. this.musicPlayed = true;
  15172. console.log('zh:playMusic 5');
  15173. let url = this.getUrl(path);
  15174. console.log('zh:playMusic 6' + url);
  15175. if (Laya.Browser.onPC) {
  15176. console.log('zh:playMusic 7');
  15177. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15178. console.log('zh:playMusic 8');
  15179. this.play(url, loop);
  15180. }));
  15181. }
  15182. else
  15183. this.play(url, loop);
  15184. }
  15185. play(url, loop) {
  15186. Laya.SoundManager.playMusic(url, loop);
  15187. }
  15188. getUrl(path) {
  15189. let url = this.audioUrl + path;
  15190. console.log('zh:getUrl ....');
  15191. if (Laya.Browser.onAndroid) {
  15192. url += ".ogg";
  15193. }
  15194. else {
  15195. url += ".mp3";
  15196. }
  15197. return url;
  15198. }
  15199. pauseMusic(pause) {
  15200. if (pause) {
  15201. this.mute(true);
  15202. }
  15203. else if (this.isSound)
  15204. this.mute(false);
  15205. }
  15206. stopMusic() {
  15207. Laya.SoundManager.stopMusic();
  15208. if (Moyu.isNeedPlatAudio) {
  15209. Moyu.stopMusic();
  15210. }
  15211. }
  15212. mute(mute) {
  15213. if (Moyu.isNeedPlatAudio) {
  15214. Moyu.pauseMusic(mute);
  15215. }
  15216. else {
  15217. Laya.SoundManager.musicMuted = mute;
  15218. if (!mute && !this.musicPlayed && this.musicPath) {
  15219. this.playMusic(this.musicPath);
  15220. }
  15221. }
  15222. }
  15223. stopSound(path) {
  15224. let url = this.getUrl(path);
  15225. Laya.SoundManager.stopSound(url);
  15226. }
  15227. playSound(path, loop = 1, soundMax = this.soundMax) {
  15228. if (!this.isLoad)
  15229. return;
  15230. if (!this.isSound)
  15231. return;
  15232. if (!path || path == "")
  15233. return;
  15234. let url = this.getUrl(path);
  15235. if (Moyu.isNeedPlatAudio) {
  15236. Moyu.playSound(path, loop == 0);
  15237. }
  15238. else {
  15239. let count = 1;
  15240. if (this.soundMap[path])
  15241. count = this.soundMap[path] + 1;
  15242. if (count > soundMax)
  15243. return;
  15244. this.soundMap[path] = count;
  15245. Laya.SoundManager.playSound(url, loop);
  15246. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15247. }
  15248. }
  15249. removePath(path) {
  15250. if (this.soundMap[path]) {
  15251. let count = this.soundMap[path];
  15252. count--;
  15253. if (count < 1)
  15254. delete this.soundMap[path];
  15255. else
  15256. this.soundMap[path] = count;
  15257. }
  15258. }
  15259. playBtnSound() {
  15260. this.playSound("btn");
  15261. }
  15262. playGetSound() {
  15263. }
  15264. playCloseUISound() {
  15265. }
  15266. }
  15267. SoundMgr._instance = null;
  15268. var Handler$1 = Laya.Handler;
  15269. var EResType;
  15270. (function (EResType) {
  15271. EResType[EResType["none"] = 0] = "none";
  15272. EResType[EResType["nromal"] = 1] = "nromal";
  15273. EResType[EResType["td"] = 2] = "td";
  15274. EResType[EResType["sk"] = 3] = "sk";
  15275. })(EResType || (EResType = {}));
  15276. class CResLoader {
  15277. constructor(doneCall, proCall) {
  15278. this.completrCall = doneCall;
  15279. this.progressCall = proCall;
  15280. this.progressHander = new Handler$1(this, this.onProgress);
  15281. this.tdResMap = {};
  15282. }
  15283. load(resList) {
  15284. this.resCount = 0;
  15285. this.loadCount = 0;
  15286. for (let i = 0; i < resList.length; i++) {
  15287. let path = resList[i];
  15288. if (!path)
  15289. continue;
  15290. this.resCount++;
  15291. let type = this.getResType(path);
  15292. if (type == EResType.nromal)
  15293. this.loadNromal(path);
  15294. else if (type == EResType.td)
  15295. this.loadTd(path);
  15296. }
  15297. }
  15298. getRes(path) {
  15299. let type = this.getResType(path);
  15300. if (type == EResType.nromal)
  15301. return Laya.loader.getRes(path);
  15302. else if (type == EResType.td) {
  15303. let res = this.tdResMap[path];
  15304. if (res)
  15305. return res.clone();
  15306. return null;
  15307. }
  15308. }
  15309. destroy() {
  15310. this.progressHander.clear();
  15311. this.progressHander = null;
  15312. }
  15313. clearRes(path) {
  15314. let type = this.getResType(path);
  15315. if (type == EResType.nromal)
  15316. Laya.loader.clearRes(path);
  15317. else if (type == EResType.td) {
  15318. let obj = this.tdResMap[path];
  15319. if (obj)
  15320. obj.destroy();
  15321. delete this.tdResMap[path];
  15322. }
  15323. }
  15324. getResType(path) {
  15325. let exs = this.getExtension(path);
  15326. if (exs == "sk")
  15327. return EResType.sk;
  15328. if (exs == "ls" || exs == "lh" || exs == "lm")
  15329. return EResType.td;
  15330. else
  15331. return EResType.nromal;
  15332. }
  15333. getExtension(res) {
  15334. var index = res.lastIndexOf(".");
  15335. return res.substr(index + 1);
  15336. }
  15337. loadNromal(path) {
  15338. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15339. if (res) {
  15340. this.onLoad();
  15341. }
  15342. else
  15343. console.log("load res fail:" + path);
  15344. }), this.progressHander);
  15345. }
  15346. loadSk() {
  15347. }
  15348. loadTd(path) {
  15349. if (this.tdResMap[path]) {
  15350. this.onLoad();
  15351. return;
  15352. }
  15353. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15354. if (res) {
  15355. this.tdResMap[path] = res;
  15356. this.onLoad();
  15357. }
  15358. else
  15359. console.log("load res fail:" + path);
  15360. }));
  15361. }
  15362. onLoad() {
  15363. this.loadCount++;
  15364. this.onProgress(1);
  15365. if (this.loadCount >= this.resCount) {
  15366. this.completrCall.run();
  15367. }
  15368. }
  15369. onProgress(pro) {
  15370. let progress = (this.loadCount + pro) / this.resCount;
  15371. this.progressCall.runWith(progress);
  15372. }
  15373. }
  15374. var Handler$2 = Laya.Handler;
  15375. class ResInfo {
  15376. constructor() {
  15377. this.index = 0;
  15378. }
  15379. }
  15380. class ResMgr {
  15381. constructor() {
  15382. this.resList = [];
  15383. this.doneList = [];
  15384. this.resMap = {};
  15385. this.currentLoad = null;
  15386. this.completeHandler = new Handler$2(this, this.onComplete);
  15387. this.progressHandler = new Handler$2(this, this.onProgress);
  15388. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15389. }
  15390. static getInstance() {
  15391. if (ResMgr._instance == null) {
  15392. ResMgr._instance = new ResMgr();
  15393. }
  15394. return ResMgr._instance;
  15395. }
  15396. loadList(list, completeHandler, progressHandler) {
  15397. if (list.length < 1) {
  15398. completeHandler.run();
  15399. return;
  15400. }
  15401. let info = this.getResInfo();
  15402. info.resList = list;
  15403. info.completeHandler = completeHandler;
  15404. info.progressHandler = progressHandler;
  15405. this.resList.push(info);
  15406. this.startLoad();
  15407. }
  15408. loadFguiRes(list, completeHandler, progressHandler) {
  15409. Laya.loader.load(list, completeHandler, progressHandler);
  15410. }
  15411. loadAny(list, completeHandler, progressHandler) {
  15412. Laya.loader.load(list, completeHandler, progressHandler);
  15413. }
  15414. load(path, completeHandler, progressHandler) {
  15415. let count = this.resMap[path];
  15416. if (count && count > 0) {
  15417. if (completeHandler)
  15418. completeHandler.run();
  15419. }
  15420. else
  15421. this.loadList([path], completeHandler, progressHandler);
  15422. }
  15423. getRes(path) {
  15424. let res = this.resMap[path];
  15425. if (!res)
  15426. this.showLog("资源不存在:" + path);
  15427. else
  15428. return this.loader.getRes(path);
  15429. }
  15430. clearList(list, force = false) {
  15431. if (!list || list.length < 1)
  15432. return;
  15433. let cr = () => {
  15434. for (const k in list) {
  15435. let v = list[k];
  15436. if (!v)
  15437. continue;
  15438. if (force) {
  15439. this.loader.clearRes(v);
  15440. delete this.resMap[v];
  15441. }
  15442. else {
  15443. let count = this.resMap[v];
  15444. if (count && count > 1) {
  15445. count--;
  15446. this.resMap[v] = count;
  15447. }
  15448. else {
  15449. this.loader.clearRes(v);
  15450. delete this.resMap[v];
  15451. }
  15452. }
  15453. }
  15454. if (!window.hasOwnProperty("ks"))
  15455. Laya.Resource.destroyUnusedResources();
  15456. };
  15457. Laya.timer.clearAll(this);
  15458. Laya.timer.once(2000, this, cr);
  15459. }
  15460. clear3D() {
  15461. for (const k in this.loader.tdResMap) {
  15462. this.loader.clearRes(k);
  15463. if (this.resMap[k])
  15464. delete this.resMap[k];
  15465. }
  15466. if (!window.hasOwnProperty("ks"))
  15467. Laya.Resource.destroyUnusedResources();
  15468. }
  15469. clear(path, force = false) {
  15470. this.clearList([path], force);
  15471. }
  15472. getResInfo() {
  15473. if (this.doneList.length > 0)
  15474. return this.doneList.pop();
  15475. else
  15476. return new ResInfo();
  15477. }
  15478. startLoad() {
  15479. if (this.currentLoad)
  15480. return;
  15481. this.currentLoad = this.resList.pop();
  15482. if (this.currentLoad) {
  15483. this.loader.load(this.currentLoad.resList);
  15484. }
  15485. }
  15486. onComplete() {
  15487. if (!this.currentLoad)
  15488. return;
  15489. for (const k in this.currentLoad.resList) {
  15490. let v = this.currentLoad.resList[k];
  15491. let count = this.resMap[v];
  15492. if (count)
  15493. count++;
  15494. else
  15495. count = 1;
  15496. this.resMap[v] = count;
  15497. }
  15498. if (this.currentLoad.completeHandler)
  15499. this.currentLoad.completeHandler.run();
  15500. this.doneList.push(this.currentLoad);
  15501. this.currentLoad = null;
  15502. this.startLoad();
  15503. }
  15504. onProgress(pro) {
  15505. if (!this.currentLoad)
  15506. return;
  15507. if (this.currentLoad.progressHandler)
  15508. this.currentLoad.progressHandler.runWith(pro);
  15509. }
  15510. showLog(str, ...args) {
  15511. console.log("[ResLoader] " + str);
  15512. }
  15513. }
  15514. ResMgr._instance = null;
  15515. class EventMgr extends Laya.EventDispatcher {
  15516. }
  15517. let eventMgr = new EventMgr();
  15518. class ConfigMgr {
  15519. static getInstance() {
  15520. if (!this._instance) {
  15521. this._instance = new ConfigMgr();
  15522. }
  15523. return this._instance;
  15524. }
  15525. init() {
  15526. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15527. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15528. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15529. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15530. }
  15531. getUserInfoByIndex(index) {
  15532. return this.npcJson[index];
  15533. }
  15534. getRandomUserInfo() {
  15535. let index = xGame.tools.random(0, this.npcJson.length);
  15536. return this.npcJson[index];
  15537. }
  15538. getMaxBigMoveLength() {
  15539. return Object.keys(this.levelCfg).length;
  15540. }
  15541. getBigMoveLevelByIndex(index) {
  15542. let cfg = this.levelCfg;
  15543. cfg = cfg[index];
  15544. return cfg;
  15545. }
  15546. getRandomClassicLevel() {
  15547. let cfg = this.classicCfg;
  15548. let num = Object.keys(cfg).length;
  15549. let rand = xGame.common.randomNum(1, num);
  15550. return cfg[rand];
  15551. }
  15552. getPlaceBallByLevel(level) {
  15553. return this.placeBallCfg[level];
  15554. }
  15555. getMaxPlaceBall() {
  15556. return Object.keys(this.placeBallCfg).length;
  15557. }
  15558. }
  15559. class PoolD3Mgr {
  15560. constructor() {
  15561. this.pool = {};
  15562. }
  15563. static get ins() {
  15564. return this._ins || (this._ins = new PoolD3Mgr);
  15565. }
  15566. createList(key, prefab, parent) {
  15567. if (!this.pool[key]) {
  15568. this.pool[key] = {};
  15569. this.pool[key].prefab = prefab;
  15570. this.pool[key].list = [];
  15571. this.pool[key].parent = parent;
  15572. }
  15573. }
  15574. getItem(key) {
  15575. if (!this.pool[key]) {
  15576. return;
  15577. }
  15578. let temp;
  15579. if (this.pool[key].list.length > 0) {
  15580. temp = this.pool[key].list.pop();
  15581. }
  15582. else {
  15583. temp = this.pool[key].prefab.clone();
  15584. if (this.pool[key].parent) {
  15585. this.pool[key].parent.addChild(temp);
  15586. }
  15587. }
  15588. temp.active = true;
  15589. return temp;
  15590. }
  15591. putItem(key, obj) {
  15592. if (!this.pool[key]) {
  15593. return;
  15594. }
  15595. obj.active = false;
  15596. this.pool[key].list.push(obj);
  15597. }
  15598. }
  15599. let context$1 = context;
  15600. let uiMgr = UIMgr.inst;
  15601. let soundMgr = SoundMgr.getInstance();
  15602. let resMgr = ResMgr.getInstance();
  15603. let httpMgr = HttpMgr.getInstance();
  15604. let common = Common.getInstance();
  15605. let cfgMgr = ConfigMgr.getInstance();
  15606. let poolD3Mgr = PoolD3Mgr.ins;
  15607. let d3TexUrl = "res/d3Res/";
  15608. let d3ModeUrl = "res/unityRes/";
  15609. function setStageSize(view) {
  15610. if (view.width) {
  15611. view.width = Laya.stage.width;
  15612. view.height = Laya.stage.height;
  15613. }
  15614. }
  15615. function filledBg(view) {
  15616. let wh = Laya.stage.height / Laya.stage.width;
  15617. if (wh > 16 / 9) {
  15618. view.height = Laya.stage.height;
  15619. view.width = Laya.stage.height / 1334 * 750;
  15620. }
  15621. else {
  15622. view.width = Laya.stage.width;
  15623. view.height = Laya.stage.width / 750 * 1334;
  15624. }
  15625. }
  15626. function setNotch(view) {
  15627. if (view.height) {
  15628. view.y += context$1.notchHeight;
  15629. }
  15630. }
  15631. function showTip(str) {
  15632. uiMgr.Show(UIMsg, str);
  15633. }
  15634. function log(...args) {
  15635. console.log(args);
  15636. }
  15637. let xGame = {
  15638. context: context$1,
  15639. eventMgr,
  15640. resMgr,
  15641. uiMgr,
  15642. soundMgr,
  15643. define,
  15644. tools,
  15645. httpMgr,
  15646. d3TexUrl,
  15647. d3ModeUrl,
  15648. common,
  15649. cfgMgr,
  15650. poolD3Mgr,
  15651. setStageSize,
  15652. filledBg,
  15653. setNotch,
  15654. showTip,
  15655. log,
  15656. };
  15657. window["xGame"] = xGame;
  15658. let dataName = 'tBall_';
  15659. class UserData {
  15660. constructor() {
  15661. this.userId = "";
  15662. this.isAgree = false;
  15663. this.coinNum = 0;
  15664. this.gemNum = 0;
  15665. this.sound = true;
  15666. this.vibration = true;
  15667. this.currentDate = 0;
  15668. this.createTime = 0;
  15669. this.awardTime = 0;
  15670. this.roleId = 1;
  15671. this.roleList = [];
  15672. this.roleAds = [];
  15673. this.dressId = 101;
  15674. this.itemId = 201;
  15675. this.bigSkills = [1, 1, 1, 1, 1];
  15676. this.coin = 4000;
  15677. this.diamond = 0;
  15678. this.skillSuccessTimes = 0;
  15679. this.skillGuide = 0;
  15680. this.skillAccTimes = 0;
  15681. this.placeBallData = [];
  15682. this.shareDiamondTimes = 0;
  15683. this.dailyVideoShareTimes = 0;
  15684. this.secretary = [1, 0];
  15685. this.curSecretary = 0;
  15686. this.ballRod = [1, 0, 0, 0, 0, 1];
  15687. this.curBallRod = 5;
  15688. this.signData = 0;
  15689. this.signTime = 0;
  15690. this.drawTimes = 0;
  15691. this.drawAwardTimes = 0;
  15692. this.dailyfreeDrawTimes = 1;
  15693. this.power = 5;
  15694. this.powerTime = 0;
  15695. this.challengeTimes = 0;
  15696. this.extraSign = 0;
  15697. this.classicTimes = 0;
  15698. this.guideHelpLine = 0;
  15699. this.newUser = true;
  15700. this.rootBallFoul = 0;
  15701. this.timeoutFoul = 0;
  15702. this.roleList = [1];
  15703. }
  15704. saveData() {
  15705. let data = {};
  15706. for (let k in this) {
  15707. data[k.toString()] = this[k];
  15708. }
  15709. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15710. }
  15711. getData() {
  15712. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15713. if (ld) {
  15714. let localData = JSON.parse(ld);
  15715. if (localData) {
  15716. for (let k in this) {
  15717. let key = k.toString();
  15718. let data = localData[key];
  15719. if (data != undefined) {
  15720. this[k] = data;
  15721. }
  15722. }
  15723. }
  15724. }
  15725. }
  15726. }
  15727. class ItemData {
  15728. constructor() {
  15729. this.itemList = {};
  15730. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15731. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15732. }
  15733. saveData() {
  15734. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15735. }
  15736. getData() {
  15737. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15738. if (ld) {
  15739. let localData = JSON.parse(ld);
  15740. if (localData) {
  15741. this.itemList = localData;
  15742. }
  15743. }
  15744. }
  15745. }
  15746. class GameData {
  15747. constructor() {
  15748. this.curLevel = 0;
  15749. this.gameType = 1;
  15750. this.signIdx = 0;
  15751. this.signMax = 0;
  15752. this.rotaryTime = 0;
  15753. this.rotaryCount = 0;
  15754. this.rotaryList = [];
  15755. this.diyCount = 3;
  15756. this.awardIdx = 0;
  15757. this.shareNum = 2;
  15758. this.rankWeek = 0;
  15759. this.rankScore = 0;
  15760. this.gameCount = 0;
  15761. this.trySkill = -1;
  15762. this.tryTime = 0;
  15763. }
  15764. saveData() {
  15765. let data = {};
  15766. for (let k in this) {
  15767. data[k.toString()] = this[k];
  15768. }
  15769. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15770. }
  15771. getData() {
  15772. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15773. if (ld) {
  15774. let localData = JSON.parse(ld);
  15775. if (localData) {
  15776. for (let k in this) {
  15777. let key = k.toString();
  15778. let data = localData[key];
  15779. if (data != undefined) {
  15780. this[k] = data;
  15781. }
  15782. }
  15783. }
  15784. }
  15785. }
  15786. }
  15787. class DataMgr {
  15788. static Init() {
  15789. this.userData = new UserData();
  15790. this.gameData = new GameData();
  15791. this.itemData = new ItemData();
  15792. this.userData.getData();
  15793. this.gameData.getData();
  15794. this.itemData.getData();
  15795. this.roleId = this.userData.roleId;
  15796. this.resetUse();
  15797. }
  15798. static isNewDay() {
  15799. Moyu.isNewDay(this, (isnew) => {
  15800. xGame.common.isNewDay = isnew;
  15801. if (!isnew)
  15802. return;
  15803. DataMgr.setShareDiamondTimes(0, false);
  15804. DataMgr.setDailyVideoShareTimes(0, false);
  15805. DataMgr.setDailyfreeDrawTimes(1);
  15806. DataMgr.setExtraSign(0);
  15807. });
  15808. }
  15809. static deletData() {
  15810. Laya.LocalStorage.clear();
  15811. }
  15812. static upRankData() {
  15813. let num = xGame.common.getAllStarNum();
  15814. if (num > 0)
  15815. Moyu.upRankData(xGame.common.curRankID, num);
  15816. }
  15817. static addItem(id, count = 1) {
  15818. let v = this.itemData.itemList[id];
  15819. if (!v)
  15820. v = { id: id, count: count, adnum: 0, active: true };
  15821. else {
  15822. if (v.active) {
  15823. v.count += count;
  15824. }
  15825. else {
  15826. v.count = count;
  15827. v.active = true;
  15828. }
  15829. }
  15830. this.itemData.itemList[id] = v;
  15831. xGame.soundMgr.playGetSound();
  15832. this.saveItemData();
  15833. }
  15834. static hasItem(id) {
  15835. let v = this.itemData.itemList[id];
  15836. if (v && v.active)
  15837. return true;
  15838. return false;
  15839. }
  15840. static getItem(id) {
  15841. let v = this.itemData.itemList[id];
  15842. return v;
  15843. }
  15844. static getItemCount(id) {
  15845. let v = this.itemData.itemList[id];
  15846. if (v && v.active)
  15847. return v.count;
  15848. return 0;
  15849. }
  15850. static getItemAd(id) {
  15851. let v = this.itemData.itemList[id];
  15852. if (v) {
  15853. return v.adnum;
  15854. }
  15855. return 0;
  15856. }
  15857. static onItemAd(id, num = 1) {
  15858. let v = this.itemData.itemList[id];
  15859. if (!v)
  15860. v = { id: id, count: 1, adnum: num, active: false };
  15861. else
  15862. v.adnum += num;
  15863. this.itemData.itemList[id] = v;
  15864. this.saveItemData();
  15865. }
  15866. static costItem(id, count) {
  15867. let v = this.itemData.itemList[id];
  15868. if (v && v.active) {
  15869. if (v.count < count)
  15870. return false;
  15871. else {
  15872. v.count -= count;
  15873. this.itemData.itemList[id] = v;
  15874. return true;
  15875. }
  15876. }
  15877. return false;
  15878. }
  15879. static resetUse() {
  15880. this.dressId = this.userData.dressId;
  15881. this.itemId = this.userData.itemId;
  15882. }
  15883. static passLevel() {
  15884. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15885. this.gameData.curLevel++;
  15886. this.curLevel = this.gameData.curLevel;
  15887. this.saveGameData();
  15888. }
  15889. static useRole(id) {
  15890. this.roleId = id;
  15891. if (this.hasRole(id)) {
  15892. this.userData.roleId = id;
  15893. this.saveUserData();
  15894. }
  15895. }
  15896. static addRole(id) {
  15897. if (this.hasRole(id))
  15898. return;
  15899. this.userData.roleList.push(id);
  15900. this.saveUserData();
  15901. }
  15902. static hasRole(id) {
  15903. return this.userData.roleList.indexOf(id) >= 0;
  15904. }
  15905. static gemEnough(num) {
  15906. return this.userData.gemNum >= num;
  15907. }
  15908. static roleHasAd(id) {
  15909. let count = this.userData.roleAds[id];
  15910. if (count != undefined && count >= 0)
  15911. return true;
  15912. else
  15913. return false;
  15914. }
  15915. static saveUserData(time = 1000, event, arg) {
  15916. if (this.userSaving)
  15917. return;
  15918. this.userSaving = true;
  15919. Laya.timer.once(time, this, () => {
  15920. this.userSaving = false;
  15921. this.userData.saveData();
  15922. if (event)
  15923. xGame.eventMgr.event(event, arg);
  15924. });
  15925. }
  15926. static saveGameData() {
  15927. if (this.gameSaving)
  15928. return;
  15929. this.gameSaving = true;
  15930. Laya.timer.once(1000, this, () => {
  15931. this.gameSaving = false;
  15932. this.gameData.saveData();
  15933. });
  15934. }
  15935. static saveItemData() {
  15936. let fun = () => {
  15937. this.itemData.saveData();
  15938. };
  15939. Laya.timer.clear(this, fun);
  15940. Laya.timer.once(500, this, fun);
  15941. }
  15942. static saveData() {
  15943. this.saveUserData();
  15944. this.saveGameData();
  15945. }
  15946. static getBigSkillList() {
  15947. return this.userData.bigSkills;
  15948. }
  15949. static getBigSkillByIndex(index) {
  15950. return this.userData.bigSkills[index];
  15951. }
  15952. static setBigSkill(index, val, addUp = true) {
  15953. if (addUp) {
  15954. this.userData.bigSkills[index] += val;
  15955. }
  15956. else {
  15957. this.userData.bigSkills[index] = val;
  15958. }
  15959. this.saveUserData();
  15960. }
  15961. static coinEnough(need) {
  15962. if (typeof need != "number") {
  15963. console.error("金币格式错误");
  15964. return;
  15965. }
  15966. return this.userData.coin >= need;
  15967. }
  15968. static setCoin(val) {
  15969. if (typeof val != "number") {
  15970. return;
  15971. }
  15972. this.userData.coin += val;
  15973. this.saveUserData();
  15974. xGame.eventMgr.event(COIN_CHANGE);
  15975. }
  15976. static getCoin() {
  15977. return this.userData.coin;
  15978. }
  15979. static diamondEnough(need) {
  15980. if (typeof need != "number") {
  15981. console.error("金币格式错误");
  15982. return;
  15983. }
  15984. return this.userData.diamond >= need;
  15985. }
  15986. static setDiamond(val) {
  15987. if (typeof val != "number") {
  15988. return;
  15989. }
  15990. this.userData.diamond += val;
  15991. this.saveUserData();
  15992. xGame.eventMgr.event(DIAMOND_CHANGE);
  15993. }
  15994. static getDiamond() {
  15995. return this.userData.diamond;
  15996. }
  15997. static getSkillSuccessTimes() {
  15998. return this.userData.skillSuccessTimes;
  15999. }
  16000. static setSkillSuccessTimes(val, addUp = true) {
  16001. if (addUp)
  16002. this.userData.skillSuccessTimes += val;
  16003. else
  16004. this.userData.skillSuccessTimes = val;
  16005. this.saveUserData();
  16006. }
  16007. static getSkillAccTimes() {
  16008. return this.userData.skillAccTimes;
  16009. }
  16010. static setSkillAccTimes(val) {
  16011. this.userData.skillAccTimes += val;
  16012. this.saveUserData();
  16013. }
  16014. static getSkillGuide() {
  16015. if (!xGame.common.openGuide) {
  16016. return 1;
  16017. }
  16018. return this.userData.skillGuide;
  16019. }
  16020. static setSkillGuide(val) {
  16021. this.userData.skillGuide = val;
  16022. this.saveUserData();
  16023. }
  16024. static getPlaceBallLevelList() {
  16025. return this.userData.placeBallData;
  16026. }
  16027. static getPlaceBallLevel(level) {
  16028. let arr = this.userData.placeBallData;
  16029. let index = level - 1;
  16030. let out;
  16031. if (arr[index]) {
  16032. out = arr[index];
  16033. }
  16034. else {
  16035. let max = arr.length;
  16036. if (max == index) {
  16037. out = {
  16038. star: 0,
  16039. play: true,
  16040. isCur: true,
  16041. getAward: false
  16042. };
  16043. }
  16044. else {
  16045. out = {
  16046. star: 0,
  16047. play: false,
  16048. getAward: false
  16049. };
  16050. }
  16051. }
  16052. return out;
  16053. }
  16054. static setPlaceBallLevel(level, star) {
  16055. let arr = this.userData.placeBallData;
  16056. let index = level - 1;
  16057. if (arr[index]) {
  16058. arr[index].star = Math.max(arr[index].star, star);
  16059. }
  16060. else {
  16061. let max = arr.length;
  16062. if (max == index) {
  16063. arr.push({
  16064. star: star,
  16065. play: true,
  16066. getAward: false
  16067. });
  16068. }
  16069. else {
  16070. console.error("关卡存储出错");
  16071. }
  16072. }
  16073. this.saveUserData();
  16074. }
  16075. static setPlaceBallAward(level) {
  16076. let arr = this.userData.placeBallData;
  16077. let index = level - 1;
  16078. if (arr[index]) {
  16079. arr[index].getAward = true;
  16080. }
  16081. this.saveUserData();
  16082. }
  16083. static getShareDiamondTimes() {
  16084. return this.userData.shareDiamondTimes;
  16085. }
  16086. static setShareDiamondTimes(val, addUp = true) {
  16087. if (addUp) {
  16088. this.userData.shareDiamondTimes += val;
  16089. }
  16090. else {
  16091. this.userData.shareDiamondTimes = val;
  16092. }
  16093. this.saveUserData();
  16094. }
  16095. static getDailyVideoShareTimes() {
  16096. return this.userData.dailyVideoShareTimes;
  16097. }
  16098. static setDailyVideoShareTimes(val, addUp = true) {
  16099. if (addUp) {
  16100. this.userData.dailyVideoShareTimes += val;
  16101. }
  16102. else {
  16103. this.userData.dailyVideoShareTimes = val;
  16104. }
  16105. this.saveUserData();
  16106. }
  16107. static getSecretary(index) {
  16108. return this.userData.secretary[index];
  16109. }
  16110. static setSecretary(index, val) {
  16111. this.userData.secretary[index] = val;
  16112. this.saveUserData();
  16113. }
  16114. static getCurSecretary() {
  16115. return this.userData.curSecretary;
  16116. }
  16117. static setCurSecretary(index) {
  16118. this.userData.curSecretary = index;
  16119. this.saveUserData();
  16120. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16121. }
  16122. static getBallRod(index) {
  16123. return this.userData.ballRod[index];
  16124. }
  16125. static setBallRod(index, val) {
  16126. this.userData.ballRod[index] = val;
  16127. this.saveUserData();
  16128. }
  16129. static getCurBallRod() {
  16130. return this.userData.curBallRod;
  16131. }
  16132. static setCurBallRod(index) {
  16133. this.userData.curBallRod = index;
  16134. this.saveUserData();
  16135. }
  16136. static setSignData(val) {
  16137. this.userData.signData = val;
  16138. this.saveUserData();
  16139. }
  16140. static getSignData() {
  16141. return this.userData.signData;
  16142. }
  16143. static setSignTime(val) {
  16144. this.userData.signTime = val;
  16145. this.saveUserData();
  16146. }
  16147. static getSignTime() {
  16148. return this.userData.signTime;
  16149. }
  16150. static getDrawTimes() {
  16151. return this.userData.drawTimes;
  16152. }
  16153. static setDrawTimes(val, addUp = true) {
  16154. if (addUp) {
  16155. this.userData.drawTimes += val;
  16156. }
  16157. else {
  16158. this.userData.drawTimes = val;
  16159. }
  16160. this.saveUserData();
  16161. }
  16162. static getDrawAwardTimes() {
  16163. return this.userData.drawAwardTimes;
  16164. }
  16165. static setDrawAwardTimes(val) {
  16166. this.userData.drawAwardTimes = val;
  16167. this.saveUserData();
  16168. }
  16169. static getDailyfreeDrawTimes() {
  16170. return this.userData.dailyfreeDrawTimes;
  16171. }
  16172. static setDailyfreeDrawTimes(val) {
  16173. this.userData.dailyfreeDrawTimes = val;
  16174. this.saveUserData();
  16175. }
  16176. static setPower(val, addUp = true) {
  16177. if (addUp)
  16178. this.userData.power += val;
  16179. else
  16180. this.userData.power = val;
  16181. if (this.userData.power >= xGame.common.maxPower) {
  16182. this.userData.power = xGame.common.maxPower;
  16183. }
  16184. xGame.eventMgr.event(POWER_CHANGE, val);
  16185. this.saveUserData();
  16186. }
  16187. static getPower() {
  16188. return this.userData.power;
  16189. }
  16190. static setPowerTime(val) {
  16191. this.userData.powerTime = val;
  16192. this.saveUserData();
  16193. }
  16194. static getPowerTime() {
  16195. return this.userData.powerTime;
  16196. }
  16197. static powerEnough() {
  16198. return this.getPower() > 0;
  16199. }
  16200. static getChallengeTimes() {
  16201. return this.userData.challengeTimes;
  16202. }
  16203. static setChallengeTimes(val) {
  16204. this.userData.challengeTimes += val;
  16205. this.saveUserData();
  16206. }
  16207. static getExtraSign() {
  16208. return this.userData.extraSign;
  16209. }
  16210. static setExtraSign(val) {
  16211. this.userData.extraSign = val;
  16212. this.saveUserData();
  16213. }
  16214. static getClassicTimes() {
  16215. return this.userData.classicTimes;
  16216. }
  16217. static setClassicTimes() {
  16218. this.userData.classicTimes += 1;
  16219. this.saveUserData();
  16220. }
  16221. static getGuideHelpLine() {
  16222. return this.userData.guideHelpLine;
  16223. }
  16224. static setGuideHelpLine() {
  16225. this.userData.guideHelpLine = 1;
  16226. this.saveUserData();
  16227. }
  16228. static getNewUser() {
  16229. return this.userData.newUser;
  16230. }
  16231. static setNewUser() {
  16232. this.userData.newUser = false;
  16233. this.saveUserData();
  16234. }
  16235. static getRootBallFoul() {
  16236. return this.userData.rootBallFoul;
  16237. }
  16238. static setRootBallFoul() {
  16239. this.userData.rootBallFoul = 1;
  16240. this.saveUserData();
  16241. }
  16242. static getTimeoutFoul() {
  16243. return this.userData.timeoutFoul;
  16244. }
  16245. static setTimeoutFoul() {
  16246. this.userData.timeoutFoul = 1;
  16247. this.saveUserData();
  16248. }
  16249. }
  16250. DataMgr.isNewUser = false;
  16251. DataMgr.fristEnter = true;
  16252. DataMgr.levelType = 0;
  16253. DataMgr.awardId = 0;
  16254. DataMgr.awardCoin = 0;
  16255. DataMgr.sceneId = -1;
  16256. DataMgr.tryId = 0;
  16257. DataMgr.curLevel = 1;
  16258. DataMgr.vipLevel = 0;
  16259. DataMgr.maxLevel = 0;
  16260. DataMgr.awardRatio = 1;
  16261. DataMgr.gameList = [];
  16262. DataMgr.rankList = [];
  16263. DataMgr.recoverTime = 480000;
  16264. DataMgr.minScore = 0;
  16265. DataMgr.rankDis = 0;
  16266. DataMgr.userSaving = false;
  16267. DataMgr.gameSaving = false;
  16268. class D3Tween extends Laya.Script3D {
  16269. constructor() {
  16270. super();
  16271. this.isInited = false;
  16272. }
  16273. ;
  16274. init() {
  16275. if (this.isInited)
  16276. return;
  16277. this.isInited = true;
  16278. this.gameObj = this.owner;
  16279. this.transform = this.gameObj.transform;
  16280. }
  16281. get rotX() {
  16282. return this.transform.localRotationEulerX;
  16283. }
  16284. set rotX(v) {
  16285. this.transform.localRotationEulerX = v;
  16286. }
  16287. get rotY() {
  16288. return this.transform.localRotationEulerY;
  16289. }
  16290. set rotY(v) {
  16291. this.transform.localRotationEulerY = v;
  16292. }
  16293. get rotZ() {
  16294. return this.transform.localRotationEulerZ;
  16295. }
  16296. set rotZ(v) {
  16297. this.transform.localRotationEulerZ = v;
  16298. }
  16299. get posX() {
  16300. return this.transform.localPositionX;
  16301. }
  16302. set posX(v) {
  16303. this.transform.localPositionX = v;
  16304. }
  16305. get posY() {
  16306. return this.transform.localPositionY;
  16307. }
  16308. set posY(v) {
  16309. this.transform.localPositionY = v;
  16310. }
  16311. get posZ() {
  16312. return this.transform.localPositionZ;
  16313. }
  16314. set posZ(v) {
  16315. this.transform.localPositionZ = v;
  16316. }
  16317. get rotation() {
  16318. return this.transform.localRotation;
  16319. }
  16320. set rotation(v) {
  16321. this.transform.localRotation = v;
  16322. }
  16323. }
  16324. class D2Hole extends Laya.Script {
  16325. constructor() { super(); }
  16326. onTriggerEnter(collider) {
  16327. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16328. return;
  16329. }
  16330. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16331. if (collider.owner["mySrc"].isRunSkillAni) {
  16332. return;
  16333. }
  16334. if (collider.owner["mySrc"].number != 0) {
  16335. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16336. }
  16337. xGame.common.ballColliHole(collider);
  16338. xGame.common.recoverCameraView();
  16339. }
  16340. }
  16341. }
  16342. class Table extends Laya.Script3D {
  16343. constructor() {
  16344. super();
  16345. this.isSetBorder = false;
  16346. this.inited = false;
  16347. }
  16348. ;
  16349. onAwake() {
  16350. this.init();
  16351. }
  16352. init() {
  16353. if (this.inited)
  16354. return;
  16355. this.inited = true;
  16356. this.gameObj = this.owner;
  16357. this.border = this.gameObj.getChildByName("border");
  16358. }
  16359. setBorderPos() {
  16360. if (this.isSetBorder)
  16361. return;
  16362. this.isSetBorder = true;
  16363. let ui = xGame.common.gameUI.ui;
  16364. let bar1 = this.border.getChildByName("bar1");
  16365. let bar2 = this.border.getChildByName("bar2");
  16366. let bar3 = this.border.getChildByName("bar3");
  16367. let bar4 = this.border.getChildByName("bar4");
  16368. let bar5 = this.border.getChildByName("bar5");
  16369. let bar6 = this.border.getChildByName("bar6");
  16370. this.setInfo(bar1, ui.border.bar1, "box");
  16371. this.setInfo(bar2, ui.border.bar2, "box");
  16372. this.setInfo(bar3, ui.border.bar3, "box");
  16373. this.setInfo(bar4, ui.border.bar4, "box");
  16374. this.setInfo(bar5, ui.border.bar5, "box");
  16375. this.setInfo(bar6, ui.border.bar6, "box");
  16376. let circle1 = this.border.getChildByName("circle1");
  16377. let circle2 = this.border.getChildByName("circle2");
  16378. let circle3 = this.border.getChildByName("circle3");
  16379. let circle4 = this.border.getChildByName("circle4");
  16380. let circle5 = this.border.getChildByName("circle5");
  16381. let circle6 = this.border.getChildByName("circle6");
  16382. this.setInfo(circle1, ui.border.circle1, "circle");
  16383. this.setInfo(circle2, ui.border.circle2, "circle");
  16384. this.setInfo(circle3, ui.border.circle3, "circle");
  16385. this.setInfo(circle4, ui.border.circle4, "circle");
  16386. this.setInfo(circle5, ui.border.circle5, "circle");
  16387. this.setInfo(circle6, ui.border.circle6, "circle");
  16388. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16389. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16390. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16391. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16392. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16393. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16394. let arr = xGame.common.gameMgr.holePosList;
  16395. xGame.common.gameMgr.posObj = {
  16396. "1": arr[0],
  16397. "3": arr[2],
  16398. "4": arr[3],
  16399. "6": arr[5]
  16400. };
  16401. }
  16402. initHolePos(x, y) {
  16403. if (x < 300)
  16404. x += 25;
  16405. else if (x > 1000)
  16406. x -= 25;
  16407. else if (y > 200)
  16408. y -= 10;
  16409. else
  16410. y += 10;
  16411. if (y < 200)
  16412. y += 30;
  16413. else if (y > 500)
  16414. y -= 30;
  16415. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16416. }
  16417. setInfo(d3Obj, d2Obj, type) {
  16418. let ui = xGame.common.gameUI.ui;
  16419. let sprite = new Laya.Sprite();
  16420. ui.border.displayObject.addChild(sprite);
  16421. let colli = xGame.common.getCollider(type);
  16422. sprite.addComponentIntance(colli);
  16423. let rigy = xGame.common.getRigbody();
  16424. rigy.type = "static";
  16425. sprite.addComponentIntance(rigy);
  16426. let d3Pos = d3Obj.transform.position;
  16427. xGame.common.pos3to2Convert(d3Pos);
  16428. let scaleX = d3Obj.transform.localScaleX;
  16429. let scaleZ = d3Obj.transform.localScaleZ;
  16430. let width = xGame.common.scale3to2Convert(scaleZ);
  16431. let height = xGame.common.scale3to2Convert(scaleX);
  16432. sprite.pivotX = width / 2;
  16433. sprite.pivotY = height / 2;
  16434. sprite.x = d3Pos.x;
  16435. sprite.y = d3Pos.y;
  16436. sprite.width = width;
  16437. sprite.height = height;
  16438. d2Obj.x = d3Pos.x;
  16439. d2Obj.y = d3Pos.y;
  16440. d2Obj.width = width;
  16441. d2Obj.height = height;
  16442. if (type == "box") {
  16443. colli.width = width;
  16444. colli.height = height;
  16445. colli.isSensor = false;
  16446. colli.label = "border";
  16447. }
  16448. else {
  16449. colli.radius = width / 2;
  16450. colli.isSensor = true;
  16451. colli.label = "hole";
  16452. sprite.addComponent(D2Hole);
  16453. }
  16454. }
  16455. }
  16456. class D3World extends Laya.Script3D {
  16457. constructor() {
  16458. super();
  16459. this.loadNum = 0;
  16460. this.setLoadNum = 7;
  16461. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16462. }
  16463. onAwake() {
  16464. }
  16465. loadScene() {
  16466. this.scene = this.owner;
  16467. let url = `res/unityRes/root.lh`;
  16468. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16469. this.scene.addChild(prefab);
  16470. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16471. this.putCameraInfo();
  16472. this.camera.enableHDR = false;
  16473. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16474. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16475. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16476. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16477. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16478. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16479. this.knife.active = false;
  16480. this.loadD3Obj();
  16481. }));
  16482. }
  16483. putCameraInfo() {
  16484. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16485. this.cameraObj = new cameraType();
  16486. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16487. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16488. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16489. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16490. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16491. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16492. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16493. this.visitAngleChild.init();
  16494. this.visitRootObj.posX = this.visitAngleChild.posX;
  16495. this.visitRootObj.posY = this.visitAngleChild.posY;
  16496. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16497. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16498. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16499. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16500. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16501. xGame.common.showOneCamera("mainCamera");
  16502. }
  16503. loadD3Obj() {
  16504. this.loadTable();
  16505. this.loadRoom();
  16506. this.loadInHoleParticial();
  16507. this.loadIceParticial();
  16508. this.loadHitParticial();
  16509. this.loadFireworksParticial();
  16510. this.loadBall();
  16511. }
  16512. loadInHoleParticial() {
  16513. this.loadD3Res("inHoleEft", "", (prefab) => {
  16514. prefab.addComponent(Partical);
  16515. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16516. });
  16517. }
  16518. loadIceParticial() {
  16519. this.loadD3Res("iceEft", "", (prefab) => {
  16520. prefab.addComponent(Partical);
  16521. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16522. });
  16523. }
  16524. loadHitParticial() {
  16525. this.loadD3Res("hitEft", "", (prefab) => {
  16526. prefab.addComponent(Partical);
  16527. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16528. });
  16529. }
  16530. loadFireworksParticial() {
  16531. this.loadD3Res("fireworksEft", "", (prefab) => {
  16532. prefab.addComponent(Partical);
  16533. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16534. });
  16535. }
  16536. loadBall(index = 1) {
  16537. this.loadD3Res("ball", index, (prefab) => {
  16538. this.ballPrefab = prefab;
  16539. this.ballPrefab.addComponent(Ball);
  16540. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16541. });
  16542. }
  16543. loadTable(index = 1) {
  16544. this.loadD3Res("table", index, (prefab) => {
  16545. this.tableSrc = prefab.addComponent(Table);
  16546. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16547. this.d3Hand.init();
  16548. this.tableRoot.addChild(prefab);
  16549. });
  16550. }
  16551. loadRoom(index = 1) {
  16552. this.loadD3Res("room", index, (prefab) => {
  16553. this.roomRoot.addChild(prefab);
  16554. });
  16555. }
  16556. loadD3Res(type, index, callback) {
  16557. let url = `res/unityRes/${type}${index}.lh`;
  16558. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16559. callback && callback(prefab);
  16560. this.checkResLoad();
  16561. }));
  16562. }
  16563. checkResLoad() {
  16564. this.loadNum++;
  16565. if (this.loadNum >= this.setLoadNum) {
  16566. xGame.eventMgr.event(D3RES_LOADED);
  16567. }
  16568. }
  16569. prePlayEft() {
  16570. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16571. eft.transform.localPositionX = 0;
  16572. eft.transform.localPositionY = -5;
  16573. eft.transform.localPositionZ = 0;
  16574. eft.active = true;
  16575. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16576. ice.transform.localPositionX = 0;
  16577. ice.transform.localPositionY = -5;
  16578. ice.transform.localPositionZ = 0;
  16579. ice.active = true;
  16580. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16581. hit.transform.localPositionX = 0;
  16582. hit.transform.localPositionY = -5;
  16583. hit.transform.localPositionZ = 0;
  16584. hit.active = true;
  16585. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16586. fireworks.transform.localPositionX = 0;
  16587. fireworks.transform.localPositionY = -5;
  16588. fireworks.transform.localPositionZ = 0;
  16589. fireworks.active = true;
  16590. }
  16591. }
  16592. class cameraType {
  16593. }
  16594. class MoyuMgr$1 {
  16595. static initMoyu() {
  16596. this.moyuView = new MoyuView$1();
  16597. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16598. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16599. this.moyuView.ui.displayObject.zOrder = 1000;
  16600. this.moyuView.init();
  16601. this.moyuView.showTip(true);
  16602. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16603. window['XApk'] = this;
  16604. }
  16605. static showAge(show) {
  16606. if (this.moyuView)
  16607. this.moyuView.showAge(show);
  16608. }
  16609. static onPlatMsg(idx) {
  16610. if (!MoyuMgr$1.moyuView)
  16611. return;
  16612. if (idx == '0') {
  16613. MoyuMgr$1.moyuView.showTip(false);
  16614. }
  16615. }
  16616. static showAgree(call) {
  16617. if (this.moyuView)
  16618. this.moyuView.showAgree(call);
  16619. else
  16620. call && call();
  16621. }
  16622. static showXy(type = 1) {
  16623. if (this.moyuView)
  16624. this.moyuView.showXy(type);
  16625. }
  16626. }
  16627. MoyuMgr$1.isAdvise = false;
  16628. class MoyuView$1 {
  16629. constructor() {
  16630. this.ysxyNum = 1;
  16631. this.ysJson = null;
  16632. this.ui = ui_UIMoyu.createInstance();
  16633. }
  16634. init() {
  16635. this.ui.mainBg.visible = false;
  16636. this.ui.xyNode.visible = false;
  16637. this.ui.ageNode.visible = false;
  16638. this.ui.tipNode.visible = false;
  16639. this.ui.rnNode.visible = false;
  16640. this.ui.fcmNode.visible = false;
  16641. this.ui.ageTip.visible = false;
  16642. this.ui.msgNode.visible = false;
  16643. this.ui.visible = false;
  16644. this.ui.xyNode.xyList.setVirtual();
  16645. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16646. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16647. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16648. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16649. this.ui.xyNode.btnKnown.visible = false;
  16650. this.ui.xyNode.xy1.visible = false;
  16651. this.ui.xyNode.xy2.visible = false;
  16652. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16653. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16654. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16655. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16656. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16657. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16658. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16659. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16660. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16661. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16662. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16663. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16664. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16665. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16666. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16667. this.ysxyNum = 2;
  16668. }
  16669. }
  16670. onClick(obj) {
  16671. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16672. switch (obj) {
  16673. case this.ui.ageTip:
  16674. if (Moyu.isTTApk) {
  16675. this.ui.ageNode.visible = true;
  16676. this.ui.mainBg.visible = true;
  16677. }
  16678. break;
  16679. case this.ui.tipNode:
  16680. this.showTip(false);
  16681. break;
  16682. case this.ui.ageNode.btnAge:
  16683. this.ui.ageNode.visible = false;
  16684. this.ui.mainBg.visible = false;
  16685. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16686. this.ui.visible = false;
  16687. break;
  16688. case this.ui.xyNode.btnXy3:
  16689. case this.ui.xyNode.btnXy1:
  16690. this.loadXy(1);
  16691. break;
  16692. case this.ui.xyNode.btnXy2:
  16693. this.loadXy(2);
  16694. break;
  16695. case this.ui.xyNode.btnBack:
  16696. this.ui.xyNode.xy1.visible = true;
  16697. this.ui.xyNode.xy2.visible = false;
  16698. break;
  16699. case this.ui.xyNode.btnKnown:
  16700. this.ui.xyNode.visible = false;
  16701. this.ui.mainBg.visible = false;
  16702. this.ui.visible = false;
  16703. break;
  16704. case this.ui.rnNode.btnCheck:
  16705. this.check();
  16706. break;
  16707. case this.ui.rnNode.btnExit:
  16708. case this.ui.xyNode.btnNo:
  16709. this.ysxyNum--;
  16710. if (this.ysxyNum > 0)
  16711. this.showMsg("再次拒绝退出游戏");
  16712. else {
  16713. Moyu.userAgree(false);
  16714. Moyu.exit();
  16715. }
  16716. break;
  16717. case this.ui.xyNode.btnSure:
  16718. case this.ui.xyNode.btnYes:
  16719. DataMgr.userData.isAgree = true;
  16720. DataMgr.saveUserData();
  16721. this.onAgree();
  16722. break;
  16723. case this.ui.rnNode.btnDone:
  16724. this.ui.rnNode.visible = false;
  16725. this.ui.visible = false;
  16726. break;
  16727. case this.ui.fcmNode.btnRn:
  16728. this.showRn();
  16729. break;
  16730. }
  16731. }
  16732. showTip(show) {
  16733. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16734. return;
  16735. if (show) {
  16736. MoyuMgr$1.isAdvise = true;
  16737. this.ui.visible = true;
  16738. this.ui.tipNode.visible = true;
  16739. this.ui.tipNode.alpha = 1;
  16740. Laya.timer.once(1000, this, this.showTip, [false]);
  16741. }
  16742. else {
  16743. this.ui.tipNode.alpha = 1;
  16744. this.ui.tipNode.visible = true;
  16745. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16746. this.ui.tipNode.visible = false;
  16747. MoyuMgr$1.isAdvise = false;
  16748. }), 1000);
  16749. }
  16750. }
  16751. showAge(show, px = 0, py = 0) {
  16752. if (Moyu.platType > 10 && !Moyu.isIos) {
  16753. this.ui.ageTip.x = px;
  16754. this.ui.ageTip.y = py;
  16755. this.ui.ageTip.visible = show;
  16756. if (show)
  16757. this.ui.visible = true;
  16758. }
  16759. }
  16760. showAgree(call) {
  16761. this.agreeCall = call;
  16762. this.onAgree();
  16763. return;
  16764. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16765. this.showXy(0);
  16766. }
  16767. else
  16768. this.onAgree();
  16769. }
  16770. onAgree() {
  16771. if (!this.ui.ageNode.visible)
  16772. this.ui.visible = false;
  16773. this.ui.xyNode.visible = false;
  16774. Moyu.userAgree(true);
  16775. this.showAge(false);
  16776. this.agreeCall && this.agreeCall();
  16777. this.showRn();
  16778. }
  16779. showMsg(txt) {
  16780. this.ui.msgNode.txtMsg.text = txt;
  16781. this.ui.msgNode.visible = true;
  16782. this.ui.msgNode.alpha = 1;
  16783. this.ui.visible = true;
  16784. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16785. this.ui.msgNode.visible = false;
  16786. }), 2500, true);
  16787. }
  16788. showRn() {
  16789. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16790. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16791. this.ui.rnNode.rn1.visible = true;
  16792. this.ui.rnNode.rn2.visible = false;
  16793. this.ui.rnNode.rn3.visible = false;
  16794. this.ui.rnNode.rn4.visible = false;
  16795. this.ui.rnNode.visible = true;
  16796. this.ui.mainBg.visible = true;
  16797. this.ui.rnNode.btnDone.visible = false;
  16798. this.ui.rnNode.btnExit.visible = true;
  16799. this.ui.rnNode.btnCheck.visible = true;
  16800. this.ui.fcmNode.visible = false;
  16801. this.ui.visible = true;
  16802. return;
  16803. }
  16804. }
  16805. this.showFcm();
  16806. }
  16807. showFcm() {
  16808. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16809. Moyu.initFCM(true);
  16810. if (Moyu.gameTime < 1)
  16811. this.fcmLoop();
  16812. else if (Moyu.gameTime < 999)
  16813. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16814. }
  16815. }
  16816. fcmLoop() {
  16817. if (Moyu.gameTime < 1) {
  16818. this.ui.rnNode.visible = false;
  16819. this.ui.fcmNode.visible = true;
  16820. this.ui.mainBg.visible = true;
  16821. this.ui.visible = true;
  16822. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16823. Laya.timer.clear(this.ui, this.fcmLoop);
  16824. }
  16825. }
  16826. check() {
  16827. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16828. this.ui.rnNode.rn1.visible = false;
  16829. this.ui.rnNode.rn2.visible = false;
  16830. this.ui.rnNode.rn4.visible = true;
  16831. }
  16832. else if (this.ui.rnNode.rn4.visible) {
  16833. let name = this.ui.rnNode.inputName.text;
  16834. let code = this.ui.rnNode.inputCode.text;
  16835. if (code && code.length == 18) {
  16836. this.ui.rnNode.rn1.visible = false;
  16837. this.ui.rnNode.rn4.visible = false;
  16838. Moyu.authenticate(name, code, (res) => {
  16839. this.ui.rnNode.rn2.visible = !res;
  16840. this.ui.rnNode.rn3.visible = res;
  16841. this.ui.rnNode.btnDone.visible = res;
  16842. this.ui.rnNode.btnExit.visible = !res;
  16843. this.ui.rnNode.btnCheck.visible = !res;
  16844. if (res)
  16845. this.showFcm();
  16846. });
  16847. }
  16848. else
  16849. this.showMsg("信息填写不完整");
  16850. }
  16851. }
  16852. loadXy(type = 0) {
  16853. this.ui.xyNode.xy1.visible = false;
  16854. this.ui.xyNode.xy2.visible = true;
  16855. this.ui.xyNode.xyList.scrollToView(0);
  16856. if (type == 1) {
  16857. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16858. }
  16859. else if (type == 2) {
  16860. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16861. }
  16862. }
  16863. showXy(type = 0) {
  16864. this.xyBtn();
  16865. if (type == 0) {
  16866. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16867. this.ui.xyNode.btnSure.visible = true;
  16868. }
  16869. else {
  16870. this.ui.xyNode.btnYes.visible = true;
  16871. this.ui.xyNode.btnNo.visible = true;
  16872. }
  16873. }
  16874. else {
  16875. this.ui.xyNode.btnKnown.visible = true;
  16876. this.ui.mainBg.visible = true;
  16877. }
  16878. this.ui.xyNode.xy1.visible = true;
  16879. this.ui.xyNode.xy2.visible = false;
  16880. this.ui.xyNode.visible = true;
  16881. this.ui.visible = true;
  16882. }
  16883. xyBtn() {
  16884. this.ui.xyNode.btnSure.visible = false;
  16885. this.ui.xyNode.btnYes.visible = false;
  16886. this.ui.xyNode.btnNo.visible = false;
  16887. this.ui.xyNode.btnKnown.visible = false;
  16888. {
  16889. this.ui.xyNode.btnXy3.visible = false;
  16890. this.ui.xyNode.btnXy2.visible = true;
  16891. this.ui.xyNode.btnXy1.visible = true;
  16892. this.ui.xyNode.xy1.text = "欢迎来到《万宁台球》";
  16893. }
  16894. }
  16895. createXY(json) {
  16896. this.ysJson = json.content;
  16897. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "万宁台球");
  16898. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16899. this.ui.xyNode.xy2.visible = true;
  16900. }
  16901. renderListItem(idx, cell) {
  16902. let xy = this.ysJson[idx];
  16903. cell.height = xy.line * 30;
  16904. cell.xyItem.text = xy.text;
  16905. }
  16906. onDestroy() {
  16907. this.agreeCall = null;
  16908. }
  16909. }
  16910. class UILoading extends UIBase {
  16911. constructor() {
  16912. super();
  16913. this.accTime = 0;
  16914. this.curNum = 0;
  16915. this.rate = 1;
  16916. this.loadSubOk = false;
  16917. this.loadResOK = false;
  16918. this.openLoading = true;
  16919. this.beginLoadRes = false;
  16920. this.finishD2 = false;
  16921. this.finishD3 = false;
  16922. }
  16923. onConstructor() {
  16924. this.ui = ui_UILoading.createInstance();
  16925. this.contentPane = this.ui;
  16926. this.isEject = false;
  16927. this._initUI();
  16928. this._addEvent();
  16929. }
  16930. _initUI() {
  16931. MoyuMgr$1.initMoyu();
  16932. }
  16933. _addEvent() {
  16934. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  16935. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  16936. }
  16937. show() {
  16938. super.show();
  16939. loadSubRes(this.subResProgress.bind(this));
  16940. this.ui.txtLoad.text = "加载分包中...";
  16941. }
  16942. subResProgress(pro, finish) {
  16943. this.curNum = pro;
  16944. if (finish) {
  16945. this.curNum = 1;
  16946. this.loadSubOk = true;
  16947. }
  16948. }
  16949. laodD3Res() {
  16950. let scene3D = new Laya.Scene3D();
  16951. xGame.common.d3Scene = scene3D;
  16952. xGame.common.d3World = scene3D.addComponent(D3World);
  16953. xGame.common.d3World.loadScene();
  16954. }
  16955. loadD2Res() {
  16956. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  16957. this.finishD2 = true;
  16958. this.checkLoadAll();
  16959. this.curNum = 1;
  16960. }), Laya.Handler.create(this, (pro) => {
  16961. this.curNum = pro;
  16962. }, null, false));
  16963. }
  16964. d3ResFinish() {
  16965. this.finishD3 = true;
  16966. this.checkLoadAll();
  16967. }
  16968. checkLoadAll() {
  16969. if (this.finishD2 && this.finishD3) {
  16970. this.loadResOK = true;
  16971. }
  16972. }
  16973. loadRes() {
  16974. this.laodD3Res();
  16975. this.loadD2Res();
  16976. }
  16977. myUpdate(dt) {
  16978. if (!this.openLoading)
  16979. return;
  16980. this.accTime += dt * this.rate;
  16981. if (this.accTime >= this.curNum)
  16982. this.accTime = this.curNum;
  16983. this.ui.loadinfo.value = this.accTime * 100;
  16984. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  16985. if (!this.beginLoadRes) {
  16986. this.beginLoadRes = true;
  16987. this.ui.txtLoad.text = "加载资源中...";
  16988. this.curNum = 0;
  16989. this.accTime = 0;
  16990. this.loadRes();
  16991. }
  16992. if (this.loadResOK) {
  16993. this.openLoading = false;
  16994. Laya.timer.once(300, this, () => {
  16995. xGame.common.d3Scene.active = false;
  16996. MoyuMgr$1.showAgree(enterGame);
  16997. });
  16998. }
  16999. }
  17000. }
  17001. release() {
  17002. }
  17003. hide() {
  17004. super.hide();
  17005. this.release();
  17006. }
  17007. onClose() {
  17008. this.hide();
  17009. }
  17010. }
  17011. UILoading.uiName = "UILoading";
  17012. class UIRepentProp$1 extends UIBase {
  17013. constructor() {
  17014. super();
  17015. this.viewType = 0;
  17016. this.regretType = 0;
  17017. }
  17018. onConstructor() {
  17019. this.ui = ui_UIRepentProp.createInstance();
  17020. this.contentPane = this.ui;
  17021. this.isEject = false;
  17022. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17023. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17024. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17025. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17026. }
  17027. show(viewType, regretType, callback) {
  17028. PlatMgr.showInsert(true);
  17029. this.viewType = viewType;
  17030. this.regretType = regretType;
  17031. this.callback = callback;
  17032. super.show();
  17033. this.ui.t0.play();
  17034. this.ui.c1.selectedIndex = this.viewType;
  17035. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "未打进目标球" : "白球进洞";
  17036. if (this.viewType == 0) {
  17037. let guide = DataMgr.getGuideHelpLine();
  17038. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17039. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17040. }
  17041. xGame.common.gameMgr.gamePause = true;
  17042. }
  17043. hideSelf() {
  17044. xGame.common.gameMgr.gamePause = false;
  17045. this.callback && this.callback(false);
  17046. this.hide();
  17047. }
  17048. videoRegret() {
  17049. Moyu.showVideoAd(() => {
  17050. this.callback && this.callback(true);
  17051. this.hideSelf();
  17052. }, EAdType.regretBall);
  17053. }
  17054. videoAddHelpLine() {
  17055. let guide = DataMgr.getGuideHelpLine();
  17056. if (guide == 0) {
  17057. this.callback && this.callback(true);
  17058. this.hideSelf();
  17059. DataMgr.setGuideHelpLine();
  17060. xGame.common.gameUI.ui.guideNode.visible = false;
  17061. }
  17062. else {
  17063. Moyu.showVideoAd(() => {
  17064. this.callback && this.callback(true);
  17065. this.hideSelf();
  17066. }, EAdType.longHelpLine);
  17067. }
  17068. }
  17069. }
  17070. UIRepentProp$1.uiName = "UIRepentProp";
  17071. class UIRodMethod$1 extends UIBase {
  17072. constructor() {
  17073. super();
  17074. this.isPressd = false;
  17075. }
  17076. onConstructor() {
  17077. this.ui = ui_UIRodMethod.createInstance();
  17078. this.contentPane = this.ui;
  17079. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17080. this.moveDir = new Laya.Vector2();
  17081. this.moveDest = new Laya.Vector2();
  17082. this.centerPos = new Laya.Vector2();
  17083. xGame.common.uiRodMethod = this;
  17084. }
  17085. show() {
  17086. super.show();
  17087. xGame.common.gameMgr.gamePause = true;
  17088. this.openPressDotEvent();
  17089. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17090. this.centerPos.x = this.ui.white.x;
  17091. this.centerPos.y = this.ui.white.y;
  17092. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17093. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17094. this.setDot();
  17095. }
  17096. setDot() {
  17097. this.ui.dot.x = this.moveDest.x;
  17098. this.ui.dot.y = this.moveDest.y;
  17099. }
  17100. closeSelf() {
  17101. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17102. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17103. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17104. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17105. xGame.common.gameMgr.gamePause = false;
  17106. this.hide();
  17107. }
  17108. openPressDotEvent() {
  17109. this.closePressDotEvent();
  17110. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17111. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17112. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17113. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17114. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17115. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17116. }
  17117. closePressDotEvent() {
  17118. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17119. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17120. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17121. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17122. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17123. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17124. }
  17125. onDown(e) {
  17126. if (e.type == Laya.Event.MOUSE_DOWN)
  17127. this.isPressd = true;
  17128. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17129. this.isPressd = false;
  17130. if (!this.isPressd)
  17131. return;
  17132. this.moveDest.x = e.stageX;
  17133. this.moveDest.y = e.stageY;
  17134. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17135. if (dis > 6724) {
  17136. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17137. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17138. }
  17139. this.setDot();
  17140. }
  17141. resetRod() {
  17142. this.ui.dot.x = this.ui.white.x;
  17143. this.ui.dot.y = this.ui.white.y;
  17144. this.gameRod.dot.x = this.gameRod.bg.x;
  17145. this.gameRod.dot.y = this.gameRod.bg.y;
  17146. xGame.common.rodOffest.x = 0;
  17147. xGame.common.rodOffest.y = 0;
  17148. }
  17149. }
  17150. UIRodMethod$1.uiName = "UIRodMethod";
  17151. class UIMsg$1 extends UIBase {
  17152. constructor() {
  17153. super();
  17154. }
  17155. onConstructor() {
  17156. this.ui = ui_UIMsg.createInstance();
  17157. this.contentPane = this.ui;
  17158. this.isEject = false;
  17159. this.isMuti = true;
  17160. }
  17161. show(msg, callback) {
  17162. super.show();
  17163. this.ui.tipsNode.msgTxt.text = msg;
  17164. this.ui.alpha = 1;
  17165. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17166. this.hide();
  17167. callback && callback();
  17168. }), 1000);
  17169. }
  17170. }
  17171. UIMsg$1.uiName = "UIMsg";
  17172. class UITips$1 extends UIBase {
  17173. constructor() {
  17174. super();
  17175. this.type = 0;
  17176. }
  17177. onConstructor() {
  17178. this.ui = ui_UITips.createInstance();
  17179. this.contentPane = this.ui;
  17180. this.isEject = false;
  17181. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17182. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17183. }
  17184. show(tipsTxt, womanTxt, type) {
  17185. super.show();
  17186. this.ui.t0.play();
  17187. this.ui.myNode.tipsTxt.text = tipsTxt;
  17188. this.ui.myNode.womanTxt.text = womanTxt;
  17189. PlatMgr.showInsert(true);
  17190. this.ui.myNode.c1.selectedIndex = type;
  17191. this.type = type;
  17192. switch (this.type) {
  17193. case TipsType.exitGame:
  17194. xGame.common.gameMgr.gamePause = true;
  17195. break;
  17196. case TipsType.foul:
  17197. Laya.timer.once(200, this, () => {
  17198. xGame.common.gameMgr.gamePause = true;
  17199. });
  17200. break;
  17201. default:
  17202. break;
  17203. }
  17204. }
  17205. clickLeftBtn() {
  17206. this.hide();
  17207. xGame.common.gameMgr.gamePause = false;
  17208. switch (this.type) {
  17209. case TipsType.exitGame:
  17210. break;
  17211. case TipsType.foul:
  17212. break;
  17213. default:
  17214. break;
  17215. }
  17216. }
  17217. clickRightBtn() {
  17218. this.hide();
  17219. switch (this.type) {
  17220. case TipsType.exitGame:
  17221. xGame.eventMgr.event(RESET_GAME);
  17222. xGame.uiMgr.Show(UIMain$1);
  17223. Moyu.recordEnd(this, null);
  17224. xGame.common.longHelpLine = false;
  17225. break;
  17226. case TipsType.foul:
  17227. xGame.common.gameMgr.gamePause = false;
  17228. Laya.timer.clearAll(this);
  17229. break;
  17230. default:
  17231. break;
  17232. }
  17233. }
  17234. }
  17235. UITips$1.uiName = "UITips";
  17236. class UIGame$1 extends UIBase {
  17237. constructor() {
  17238. super();
  17239. this.powerNum = 0;
  17240. this.isD3Inited = false;
  17241. this.isPrePlay = false;
  17242. this.isMoveRod = false;
  17243. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17244. this.rulerDis = 20;
  17245. this.rulerOffset = 0;
  17246. }
  17247. onConstructor() {
  17248. this.ui = ui_UIGame.createInstance();
  17249. this.contentPane = this.ui;
  17250. this.ui.x += xGame.common.sysOffestNum;
  17251. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17252. this.isEject = false;
  17253. xGame.common.gameUI = this;
  17254. this.initSelf();
  17255. }
  17256. isTurnSelf() {
  17257. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17258. return true;
  17259. }
  17260. }
  17261. initSelf() {
  17262. let topUI = this.ui.topNode;
  17263. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17264. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17265. this.barInfo = {};
  17266. this.barInfo.curY = 0;
  17267. this.barInfo.height = this.ui.powerNode.height;
  17268. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17269. this.barInfo.powerStartY = this.ui.powerNode.y;
  17270. xGame.common.aiPlayer = new AIPlayer();
  17271. xGame.common.gameMgr = new GameMgr();
  17272. xGame.common.skillMgr = new SkillMgr();
  17273. xGame.common.wordsMgr = new WordsMgr();
  17274. xGame.common.talkMgr = new TalkMgr();
  17275. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17276. console.log("加载经典模式表情文件chenggon !");
  17277. });
  17278. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17279. console.log("挑战模式奖励模式spine加载成功!");
  17280. });
  17281. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17282. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17283. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17284. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17285. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17286. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17287. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17288. }
  17289. returnHome() {
  17290. let tips = "确定退出游戏吗?";
  17291. let woman = "老板,要不您再玩会儿?";
  17292. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17293. }
  17294. addRodMethodClick() {
  17295. if (this.isTurnSelf()) {
  17296. xGame.uiMgr.Show(UIRodMethod$1);
  17297. }
  17298. }
  17299. clickHelpLineBtn(force = false) {
  17300. if (!this.isTurnSelf())
  17301. return;
  17302. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17303. if (success) {
  17304. xGame.common.longHelpLine = true;
  17305. xGame.common.d2World.getHelpLine();
  17306. Moyu.sendDataEvent("guideNum");
  17307. }
  17308. else {
  17309. }
  17310. });
  17311. }
  17312. renderSelfDisplayBalls(index, target) {
  17313. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17314. target.myImg.url = xGame.common.getGameIconUrl(str);
  17315. }
  17316. renderAIDisplayBalls(index, target) {
  17317. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17318. target.myImg.url = xGame.common.getGameIconUrl(str);
  17319. ;
  17320. }
  17321. updateMode() {
  17322. if (xGame.common.gameMode == GameMode.classic) {
  17323. this.ui.topNode.scoreNode.visible = false;
  17324. }
  17325. else if (xGame.common.gameMode == GameMode.bigMove) {
  17326. this.ui.topNode.scoreNode.visible = true;
  17327. }
  17328. }
  17329. show() {
  17330. super.show();
  17331. console.log("zh:uigame show");
  17332. this.ui.alpha = 0;
  17333. this.updateSelf();
  17334. console.log("zh:uigame bf gamemusic01 start");
  17335. xGame.soundMgr.playMusic("gamemusic01");
  17336. console.log("zh:uigame bf gamemusic01 end");
  17337. xGame.common.gameMgr.gamePause = false;
  17338. xGame.common.gameUI.ui.blackAni.visible = false;
  17339. xGame.common.gameUI.ui.whiteAni.visible = false;
  17340. this.ui.powerEft.visible = false;
  17341. this.ui.colorNode.visible = false;
  17342. this.updateHead();
  17343. }
  17344. updateSelf() {
  17345. if (xGame.common.gameMode == GameMode.classic) {
  17346. this.ui.c1.selectedIndex = 0;
  17347. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17348. this.ui.topNode.middleNode.visible = true;
  17349. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17350. }
  17351. else if (xGame.common.gameMode == GameMode.bigMove) {
  17352. this.ui.c1.selectedIndex = 0;
  17353. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17354. this.ui.topNode.middleNode.visible = false;
  17355. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17356. let rand = xGame.common.randomNum(1, max);
  17357. let guide = DataMgr.getSkillGuide();
  17358. if (guide == 0)
  17359. rand = 1;
  17360. xGame.common.bigMoveLevelIndex = rand;
  17361. }
  17362. else if (xGame.common.gameMode == GameMode.placeBall) {
  17363. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17364. this.ui.c1.selectedIndex = 1 + data.type;
  17365. this.ui.alpha = 1;
  17366. this.startGame();
  17367. }
  17368. this.updateMode();
  17369. this.initD3world();
  17370. this.initD2world();
  17371. }
  17372. startGame() {
  17373. this.ui.snowNode.visible = Math.random() <= 0.1;
  17374. this.ui.d2Node.visible = false;
  17375. xGame.common.d3World.d3Hand.gameObj.active = false;
  17376. xGame.common.d3World.tableSrc.init();
  17377. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17378. this.cameraViewChange(() => {
  17379. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17380. switch (xGame.common.gameMode) {
  17381. case GameMode.classic:
  17382. xGame.common.d3World.d3Hand.gameObj.active = true;
  17383. this.playPutBallD3Ani();
  17384. break;
  17385. case GameMode.bigMove:
  17386. this.enterGame();
  17387. Laya.timer.once(500, this, () => {
  17388. this.ui.topNode.middleNode.visible = true;
  17389. this.ui.topNode.middleNode.t0.play();
  17390. });
  17391. break;
  17392. case GameMode.placeBall:
  17393. this.enterGame();
  17394. break;
  17395. default:
  17396. break;
  17397. }
  17398. });
  17399. PlatMgr.showBanner(false);
  17400. }
  17401. enterGame() {
  17402. this.ui.d2Node.visible = true;
  17403. xGame.common.d3World.d3Hand.gameObj.active = false;
  17404. xGame.common.showOneCamera("mainCamera");
  17405. Moyu.recordGame(30, true);
  17406. if (!this.isPrePlay) {
  17407. this.isPrePlay = true;
  17408. xGame.common.d3World.prePlayEft();
  17409. }
  17410. xGame.common.gameMgr.gameReady();
  17411. this.openAllEvent();
  17412. this.ui.snowNode.visible = false;
  17413. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17414. this.ui.helpBtn.visible = condition;
  17415. }
  17416. showHelpLineGuide() {
  17417. let longGuide = DataMgr.getGuideHelpLine();
  17418. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17419. this.ui.helpBtn.visible = true;
  17420. this.ui.guideNode.visible = true;
  17421. }
  17422. }
  17423. setTurnAlpha(alpha) {
  17424. this.ui.keduNode.alpha = alpha;
  17425. this.ui.ganNode.alpha = alpha;
  17426. this.ui.rodMethodNode.alpha = alpha;
  17427. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17428. }
  17429. cameraViewChange(callback) {
  17430. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17431. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17432. xGame.common.showOneCamera("visitAngle");
  17433. cameraSrc.localRotationEulerY = 180;
  17434. cameraSrc.localRotationEulerZ = 0;
  17435. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17436. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17437. callback && callback();
  17438. }));
  17439. }));
  17440. }
  17441. playPutBallD3Ani() {
  17442. xGame.common.showOneCamera("mainCamera");
  17443. let handSrc = xGame.common.d3World.d3Hand;
  17444. handSrc.gameObj.active = true;
  17445. handSrc.transform.localPositionZ = 3;
  17446. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17447. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17448. handSrc.gameObj.active = false;
  17449. this.enterGame();
  17450. }), 400);
  17451. }));
  17452. }
  17453. updateHead() {
  17454. let user = Moyu.getUserInfo();
  17455. this.ui.topNode.selfNameTxt.text = user.nickName;
  17456. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17457. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17458. if (DataMgr.getSkillGuide() < 1) {
  17459. this.ui.topNode.aiNameTxt.text = '万宁台球';
  17460. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17461. }
  17462. else {
  17463. this.ui.topNode.aiNameTxt.text = aiData.name;
  17464. this.ui.topNode.aiHeadLoader.url = baseHeadUrl + aiData.icon;
  17465. }
  17466. }
  17467. initD2world() {
  17468. let node = this.ui.d2Root.displayObject;
  17469. let src = node.getComponent(D2World);
  17470. if (!src) {
  17471. xGame.common.d2World = node.addComponent(D2World);
  17472. }
  17473. xGame.common.d2World.initSelf();
  17474. }
  17475. initD3world() {
  17476. if (this.isD3Inited)
  17477. return;
  17478. this.isD3Inited = true;
  17479. let scene3D = xGame.common.d3Scene;
  17480. this.ui.d3Root.displayObject.addChild(scene3D);
  17481. scene3D.active = true;
  17482. xGame.common.d3World.tableSrc.setBorderPos();
  17483. }
  17484. onRootMove(e) {
  17485. let rootBall = xGame.common.d2World.rootBall;
  17486. this.ui.moveNode.x = e.x;
  17487. this.ui.moveNode.y = e.y;
  17488. rootBall.gameObj.x = e.x;
  17489. rootBall.gameObj.y = e.y;
  17490. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17491. }
  17492. aiRootMove(move) {
  17493. if (move)
  17494. this.hideBallUI();
  17495. else {
  17496. this.showBallUI();
  17497. xGame.common.d2World.getHelpLine();
  17498. }
  17499. }
  17500. aiForce(type, force = 0) {
  17501. this.pressTarget = PressType.powerNode;
  17502. if (type == 1)
  17503. this.onEventUp({ force: true });
  17504. else if (type == 2)
  17505. this.onEventMove({ stageY: force, force: true });
  17506. }
  17507. onEventPress(e) {
  17508. if (e.stopPropagation)
  17509. e.stopPropagation();
  17510. if (!this.isTurnSelf())
  17511. return;
  17512. let target = e.target;
  17513. switch (target) {
  17514. case this.ui.myPowerNode.displayObject:
  17515. this.pressTarget = PressType.powerNode;
  17516. this.barInfo.curY = e.stageY;
  17517. this.updateBarInfo();
  17518. break;
  17519. case this.ui.moveNode.displayObject:
  17520. this.pressTarget = PressType.moveNode;
  17521. this.hideBallUI();
  17522. this.eventObj.curX = this.ui.moveNode.x;
  17523. this.eventObj.curY = this.ui.moveNode.y;
  17524. this.ui.moveNode.finger.visible = false;
  17525. this.eventObj.lastX = e.stageX;
  17526. this.eventObj.lastY = e.stageY;
  17527. break;
  17528. case this.ui.rulerClickNode.displayObject:
  17529. this.pressTarget = PressType.rulerNode;
  17530. this.eventObj.lastY = e.stageY;
  17531. break;
  17532. case this.ui.d2Root.displayObject:
  17533. this.pressTarget = PressType.d2Root;
  17534. this.eventObj.lastX = e.stageX;
  17535. this.eventObj.lastY = e.stageY;
  17536. this.eventObj.starX = e.stageX;
  17537. this.eventObj.starY = e.stageY;
  17538. this.eventObj.curX = 0;
  17539. this.eventObj.curY = 0;
  17540. xGame.common.d2World.d2Gan.setGanLastInfo();
  17541. this.rulerOffset = 0;
  17542. break;
  17543. default:
  17544. break;
  17545. }
  17546. }
  17547. onEventMove(e) {
  17548. if (e.stopPropagation)
  17549. e.stopPropagation();
  17550. if (e && e.force) {
  17551. }
  17552. else {
  17553. if (!this.isTurnSelf())
  17554. return;
  17555. }
  17556. switch (this.pressTarget) {
  17557. case PressType.powerNode:
  17558. this.barInfo.curY = e.stageY;
  17559. this.updateBarInfo();
  17560. this.isMoveRod = true;
  17561. break;
  17562. case PressType.moveNode:
  17563. let rootBall = xGame.common.d2World.rootBall;
  17564. let radius = rootBall.gameObj.width / 2;
  17565. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17566. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17567. let border = xGame.common.d2World.borderRect;
  17568. if (curX <= border.x + radius)
  17569. curX = border.x + radius;
  17570. else if (curX >= border.x + border.width - radius)
  17571. curX = border.x + border.width - radius;
  17572. if (curY <= border.y + radius)
  17573. curY = border.y + radius;
  17574. else if (curY >= border.y + border.height - radius)
  17575. curY = border.y + border.height - radius;
  17576. if (xGame.common.gameMgr.isOpenBall) {
  17577. if (curX >= border.x + border.openBallW - radius)
  17578. curX = border.x + border.openBallW - radius;
  17579. }
  17580. this.ui.moveNode.x = curX;
  17581. this.ui.moveNode.y = curY;
  17582. rootBall.gameObj.x = curX;
  17583. rootBall.gameObj.y = curY;
  17584. rootBall.d3BallSrc.setTransPos(curX, curY);
  17585. this.isMoveRod = true;
  17586. break;
  17587. case PressType.rulerNode:
  17588. let yy = e.stageY - this.eventObj.lastY;
  17589. this.eventObj.lastY = e.stageY;
  17590. let ruler1 = this.ui.rulerNode.img1;
  17591. let ruler2 = this.ui.rulerNode.img2;
  17592. ruler1.y += yy;
  17593. ruler2.y += yy;
  17594. this.rulerOffset += yy;
  17595. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17596. this.rulerOffset = 0;
  17597. xGame.soundMgr.playSound("inch", 1, 10);
  17598. }
  17599. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17600. let h = ruler1.height;
  17601. this.checkGuide();
  17602. this.isMoveRod = true;
  17603. if (ruler1.y >= h) {
  17604. ruler1.y = -h;
  17605. ruler2.y = 0;
  17606. return;
  17607. }
  17608. else if (ruler1.y <= -h) {
  17609. ruler1.y = h;
  17610. ruler2.y = 0;
  17611. return;
  17612. }
  17613. if (ruler2.y >= h) {
  17614. ruler2.y = -h;
  17615. ruler1.y = 0;
  17616. return;
  17617. }
  17618. else if (ruler2.y <= -h) {
  17619. ruler2.y = h;
  17620. ruler1.y = 0;
  17621. return;
  17622. }
  17623. break;
  17624. case PressType.d2Root:
  17625. this.eventObj.curX = e.stageX;
  17626. this.eventObj.curY = e.stageY;
  17627. let offset = this.checkRodMoveDir();
  17628. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17629. this.eventObj.lastX = e.stageX;
  17630. this.eventObj.lastY = e.stageY;
  17631. break;
  17632. default:
  17633. break;
  17634. }
  17635. }
  17636. onEventUp(e) {
  17637. if (e.stopPropagation)
  17638. e.stopPropagation();
  17639. if (e && e.force) {
  17640. }
  17641. else {
  17642. if (!this.isTurnSelf())
  17643. return;
  17644. }
  17645. switch (this.pressTarget) {
  17646. case PressType.powerNode:
  17647. this.ui.powerNode.value = 0;
  17648. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17649. this.ui.powerTxt.text = "";
  17650. if (this.powerNum > 0) {
  17651. xGame.eventMgr.event(BALL_SHOOT);
  17652. xGame.common.d2World.shoot(this.powerNum);
  17653. xGame.common.d2World.d2Gan.shoot();
  17654. xGame.common.d2World.d2HelpLine.shoot();
  17655. this.finishGuide();
  17656. this.ui.powerEft.visible = false;
  17657. this.ui.colorNode.visible = false;
  17658. let ganStr = "";
  17659. if (this.powerNum <= 30) {
  17660. ganStr = "gan_30";
  17661. }
  17662. else if (this.powerNum <= 60) {
  17663. ganStr = "gan_50";
  17664. }
  17665. else {
  17666. ganStr = "gan_80";
  17667. }
  17668. xGame.soundMgr.playSound(ganStr);
  17669. }
  17670. break;
  17671. case PressType.moveNode:
  17672. let rootBall = xGame.common.d2World.rootBall;
  17673. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17674. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17675. let isIntersect = this.judgeBallIntersect();
  17676. if (isIntersect) {
  17677. this.ui.moveNode.x = lastX;
  17678. this.ui.moveNode.y = lastY;
  17679. rootBall.gameObj.x = lastX;
  17680. rootBall.gameObj.y = lastY;
  17681. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17682. xGame.uiMgr.Show(UIMsg$1, "错误的放置位置");
  17683. }
  17684. else {
  17685. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17686. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17687. }
  17688. this.showBallUI();
  17689. this.ui.moveNode.finger.visible = true;
  17690. xGame.common.d2World.getHelpLine();
  17691. break;
  17692. case PressType.rulerNode:
  17693. break;
  17694. case PressType.d2Root:
  17695. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17696. if (dis <= 25) {
  17697. this.moveToClickDot(e);
  17698. }
  17699. break;
  17700. default:
  17701. break;
  17702. }
  17703. this.pressTarget = -1;
  17704. }
  17705. checkGuide() {
  17706. let guide = DataMgr.getSkillGuide();
  17707. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17708. xGame.common.guideStep++;
  17709. xGame.common.gameUI.ui.guide2.visible = false;
  17710. xGame.common.gameUI.ui.guide3.visible = true;
  17711. }
  17712. }
  17713. finishGuide() {
  17714. let guide = DataMgr.getSkillGuide();
  17715. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17716. xGame.common.guideStep = 10;
  17717. this.closeAllGuide();
  17718. }
  17719. }
  17720. closeAllGuide() {
  17721. xGame.common.gameUI.ui.guide1.visible = false;
  17722. xGame.common.gameUI.ui.guide2.visible = false;
  17723. xGame.common.gameUI.ui.guide3.visible = false;
  17724. }
  17725. updateBarInfo() {
  17726. let star = this.ui.powerNode.y;
  17727. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17728. if (rate >= 1)
  17729. rate = 1;
  17730. if (rate <= 0)
  17731. rate = 0;
  17732. this.powerNum = Math.ceil(rate * 100);
  17733. this.ui.powerNode.value = this.powerNum;
  17734. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17735. this.ui.colorNode.value = this.powerNum;
  17736. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17737. this.ui.powerEft.visible = this.powerNum != 0;
  17738. this.ui.colorNode.visible = this.powerNum != 0;
  17739. this.ui.powerTxt.text = this.powerNum + "";
  17740. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17741. }
  17742. forceCancel() {
  17743. this.ui.powerNode.value = 0;
  17744. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17745. this.ui.powerTxt.text = "";
  17746. }
  17747. checkRodMoveDir() {
  17748. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17749. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17750. if (tempX >= 0 && tempY <= 0) {
  17751. return this.checkDir();
  17752. }
  17753. else if (tempX < 0 && tempY < 0) {
  17754. return this.checkDir(1, -1);
  17755. }
  17756. else if (tempX < 0 && tempY > 0) {
  17757. return this.checkDir(-1, -1);
  17758. }
  17759. else {
  17760. return this.checkDir(-1, 1);
  17761. }
  17762. }
  17763. checkDir(flagX = 1, flagY = 1) {
  17764. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17765. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17766. if (offsetY == 0) {
  17767. return offsetX * flagX;
  17768. }
  17769. if (offsetX == 0) {
  17770. return offsetY * flagY;
  17771. }
  17772. let angle = offsetY / offsetX;
  17773. if (Math.abs(angle) >= 1) {
  17774. return offsetY * flagY;
  17775. }
  17776. else {
  17777. return offsetX * flagX;
  17778. }
  17779. }
  17780. judgeBallIntersect() {
  17781. let rootBall = xGame.common.d2World.rootBall;
  17782. let ballArr = xGame.common.d2World.ballArr;
  17783. let radius = rootBall.gameObj.width / 2;
  17784. let temp;
  17785. let isIntersect = false;
  17786. for (let index = 0; index < ballArr.length; index++) {
  17787. temp = ballArr[index];
  17788. if (temp.number == rootBall.number)
  17789. continue;
  17790. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17791. if (isIntersect) {
  17792. break;
  17793. }
  17794. }
  17795. return isIntersect;
  17796. }
  17797. hideBallUI() {
  17798. let d2Gan = xGame.common.d2World.d2Gan;
  17799. if (!d2Gan.ui.isDisposed)
  17800. d2Gan.ui.visible = false;
  17801. let d2Help = xGame.common.d2World.d2HelpLine;
  17802. if (!d2Help.ui.isDisposed)
  17803. d2Help.ui.visible = false;
  17804. let rootBall = xGame.common.d2World.rootBall;
  17805. if (!rootBall.destroyed) {
  17806. rootBall.gameObj.active = false;
  17807. }
  17808. }
  17809. showBallUI() {
  17810. let d2Gan = xGame.common.d2World.d2Gan;
  17811. if (!d2Gan.ui.isDisposed)
  17812. d2Gan.ui.visible = true;
  17813. let d2Help = xGame.common.d2World.d2HelpLine;
  17814. if (!d2Help.ui.isDisposed)
  17815. d2Help.ui.visible = true;
  17816. let rootBall = xGame.common.d2World.rootBall;
  17817. if (!rootBall.destroyed) {
  17818. rootBall.gameObj.active = true;
  17819. }
  17820. }
  17821. moveToClickDot(e) {
  17822. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17823. let root = xGame.common.d2World.rootBall.gameObj;
  17824. let xx = e.stageX - xGame.common.sysOffestNum;
  17825. let yy = e.stageY;
  17826. let x = xx - root.x;
  17827. let y = yy - root.y;
  17828. let angle = xGame.common.getfguiRotation(x, y);
  17829. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17830. xGame.common.d2World.getHelpLine();
  17831. }
  17832. this.isMoveRod = false;
  17833. xGame.common.clickedBall = false;
  17834. }
  17835. openAllEvent() {
  17836. this.closeAllEvent();
  17837. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17838. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17839. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17840. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17841. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17842. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17843. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17844. }
  17845. closeAllEvent() {
  17846. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17847. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17848. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17849. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17850. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17851. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17852. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17853. }
  17854. resetGame() {
  17855. this.closeAllEvent();
  17856. this.hideBallUI();
  17857. xGame.common.gameMgr.gamePause = true;
  17858. }
  17859. }
  17860. UIGame$1.uiName = "UIGame";
  17861. class UIAddCoin$1 extends UIBase {
  17862. constructor() {
  17863. super();
  17864. this.coinNum = 2000;
  17865. }
  17866. onConstructor() {
  17867. this.ui = ui_UIAddCoin.createInstance();
  17868. this.contentPane = this.ui;
  17869. this.isEject = false;
  17870. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17871. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17872. }
  17873. show() {
  17874. super.show();
  17875. this.ui.t0.play();
  17876. }
  17877. videoAddCoin() {
  17878. Moyu.showVideoAd(() => {
  17879. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17880. this.hide();
  17881. }, EAdType.addFailCoin);
  17882. }
  17883. }
  17884. UIAddCoin$1.uiName = "UIAddCoin";
  17885. class UIInvitation$1 extends UIBase {
  17886. constructor() {
  17887. super();
  17888. }
  17889. onConstructor() {
  17890. this.ui = ui_UIInvitation.createInstance();
  17891. this.contentPane = this.ui;
  17892. this.isEject = false;
  17893. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17894. }
  17895. show() {
  17896. super.show();
  17897. }
  17898. enterGame() {
  17899. xGame.common.gameMode = GameMode.classic;
  17900. DataMgr.setChallengeTimes(1);
  17901. xGame.common.passAwardCoin = 2000;
  17902. let need = xGame.common.classicNiceNeddCoin;
  17903. if (DataMgr.coinEnough(need)) {
  17904. DataMgr.setCoin(-need);
  17905. xGame.eventMgr.event(RESTART_GAME, true);
  17906. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17907. }
  17908. else {
  17909. xGame.eventMgr.event(RESTART_GAME, true);
  17910. }
  17911. this.hide();
  17912. }
  17913. hide() {
  17914. super.hide();
  17915. }
  17916. }
  17917. UIInvitation$1.uiName = "UIInvitation";
  17918. class UIPower$1 extends UIBase {
  17919. constructor() {
  17920. super();
  17921. }
  17922. onConstructor() {
  17923. this.ui = ui_UIPower.createInstance();
  17924. this.contentPane = this.ui;
  17925. this.isEject = false;
  17926. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17927. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  17928. }
  17929. show() {
  17930. super.show();
  17931. this.ui.t0.play();
  17932. }
  17933. videoGetPower() {
  17934. Moyu.showVideoAd(() => {
  17935. DataMgr.setPower(xGame.common.videoPower, true);
  17936. xGame.eventMgr.event(POWER_TIME);
  17937. this.hide();
  17938. }, EAdType.getPower);
  17939. }
  17940. }
  17941. UIPower$1.uiName = "UIPower";
  17942. class UIGameEnd$1 extends UIBase {
  17943. constructor() {
  17944. super();
  17945. this.success = false;
  17946. this.awardCoinNum = 1000;
  17947. this.awardDiamondNum = 10;
  17948. }
  17949. onConstructor() {
  17950. this.ui = ui_UIGameEnd.createInstance();
  17951. this.contentPane = this.ui;
  17952. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  17953. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  17954. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  17955. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  17956. this.ui.talkNode.visible = false;
  17957. if (Moyu.isKs)
  17958. this.ui.closeNode.closeBtn.x += 100;
  17959. }
  17960. updateType() {
  17961. switch (xGame.common.gameMode) {
  17962. case GameMode.classic:
  17963. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17964. this.ui.coinNode.visible = this.success;
  17965. if (!this.success) {
  17966. Laya.timer.once(500, this, () => {
  17967. xGame.uiMgr.Show(UIAddCoin$1);
  17968. });
  17969. }
  17970. this.ui.isGetAward.visible = false;
  17971. this.ui.leftBtn.c1.selectedIndex = 3;
  17972. this.ui.rightBtn.c1.selectedIndex = 0;
  17973. this.moneyNode.ui.c1.selectedIndex = 1;
  17974. break;
  17975. case GameMode.bigMove:
  17976. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  17977. this.ui.coinNode.visible = this.success;
  17978. if (xGame.common.gameMode == GameMode.bigMove) {
  17979. if (this.success) {
  17980. DataMgr.setSkillSuccessTimes(1, true);
  17981. DataMgr.setSkillAccTimes(1);
  17982. }
  17983. else {
  17984. DataMgr.setSkillSuccessTimes(0, false);
  17985. }
  17986. }
  17987. if (!this.success) {
  17988. Laya.timer.once(500, this, () => {
  17989. xGame.uiMgr.Show(UIAddCoin$1);
  17990. });
  17991. }
  17992. this.ui.isGetAward.visible = false;
  17993. this.ui.leftBtn.c1.selectedIndex = 3;
  17994. this.ui.rightBtn.c1.selectedIndex = 0;
  17995. this.moneyNode.ui.c1.selectedIndex = 1;
  17996. break;
  17997. case GameMode.placeBall:
  17998. this.ui.coinNode.visible = false;
  17999. if (this.success) {
  18000. if (xGame.common.placeBallStarNum == 3) {
  18001. this.ui.c1.selectedIndex = 2;
  18002. }
  18003. else {
  18004. this.ui.c1.selectedIndex = 3;
  18005. }
  18006. }
  18007. else {
  18008. this.ui.c1.selectedIndex = 4;
  18009. }
  18010. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18011. if (cfg.type == PlaceBallType.challenge) {
  18012. this.ui.c1.selectedIndex = 2;
  18013. }
  18014. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `打进场上所有球` : `打进${cfg.ball}颗球`;
  18015. this.updatePlaceBallBtn();
  18016. this.updatePlaceBallStarNum();
  18017. this.updatePlaceBallAwardState();
  18018. this.moneyNode.ui.c1.selectedIndex = 2;
  18019. this.moneyNode.checkPowerTime();
  18020. this.moneyNode.powerChange();
  18021. DataMgr.upRankData();
  18022. break;
  18023. default:
  18024. break;
  18025. }
  18026. }
  18027. updatePlaceBallBtn() {
  18028. this.ui.leftBtn.c1.selectedIndex = 5;
  18029. if (this.success) {
  18030. this.ui.rightBtn.c1.selectedIndex = 14;
  18031. }
  18032. else {
  18033. if (xGame.common.placeBallStarNum == 3) {
  18034. this.ui.rightBtn.c1.selectedIndex = 14;
  18035. }
  18036. else {
  18037. this.ui.rightBtn.c1.selectedIndex = 1;
  18038. }
  18039. }
  18040. }
  18041. updatePlaceBallStarNum() {
  18042. let starNum = xGame.common.placeBallStarNum;
  18043. if (starNum == 0)
  18044. this.ui.starNumNode.c1.selectedIndex = 3;
  18045. else {
  18046. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18047. }
  18048. }
  18049. updatePlaceBallAwardState() {
  18050. let level = xGame.common.placeBallCurLevel;
  18051. let starNum = xGame.common.placeBallStarNum;
  18052. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18053. let data = cfgTable.placeballData[level].award;
  18054. let cfg = cfgTable.placeballData[level];
  18055. this.awardDiamondNum = data[1];
  18056. this.awardCoinNum = data[0];
  18057. if (cfg.type == PlaceBallType.challenge) {
  18058. this.awardDiamondNum = 0;
  18059. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18060. }
  18061. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18062. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18063. if (cfg.type == PlaceBallType.challenge) {
  18064. this.ui.awardNode.coinNode.visible = true;
  18065. }
  18066. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18067. this.ui.awardNode.diamondNode.x = 265;
  18068. this.ui.awardNode.coinNode.x = 354;
  18069. }
  18070. else {
  18071. this.ui.awardNode.diamondNode.x = 291;
  18072. this.ui.awardNode.coinNode.x = 291;
  18073. }
  18074. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18075. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18076. if (this.awardCoinNum == 0) {
  18077. this.ui.awardNode.coinNode.numTxt.text = "";
  18078. }
  18079. if (getAward) {
  18080. this.ui.isGetAward.visible = true;
  18081. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18082. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18083. }
  18084. else {
  18085. this.ui.isGetAward.visible = false;
  18086. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18087. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18088. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18089. }
  18090. else {
  18091. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18092. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18093. }
  18094. }
  18095. }
  18096. show(success) {
  18097. super.show();
  18098. xGame.eventMgr.event(RESET_GAME);
  18099. this.success = success;
  18100. Laya.timer.clearAll(this);
  18101. this.playSecretaryAni();
  18102. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18103. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18104. offsetTime = Math.floor(offsetTime / 1000);
  18105. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18106. this.updateType();
  18107. Laya.timer.once(200, this, () => {
  18108. this.addAward(() => {
  18109. this.updateType();
  18110. Laya.timer.once(500, this, () => {
  18111. this.showChallengeLevel();
  18112. });
  18113. });
  18114. });
  18115. if (this.success) {
  18116. xGame.soundMgr.playSound('slots_roll01');
  18117. xGame.soundMgr.playSound("s_win");
  18118. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18119. }
  18120. else {
  18121. xGame.soundMgr.playSound('matchwin01');
  18122. xGame.soundMgr.playSound("s_lose");
  18123. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18124. }
  18125. if (!Moyu.isLegal)
  18126. PlatMgr.showBanner(true);
  18127. let challengeNum = DataMgr.getChallengeTimes();
  18128. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18129. DataMgr.setChallengeTimes(1);
  18130. }
  18131. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18132. DataMgr.setClassicTimes();
  18133. }
  18134. }
  18135. showChallengeLevel() {
  18136. if (DataMgr.getChallengeTimes() != 0)
  18137. return;
  18138. let skill = DataMgr.getSkillAccTimes();
  18139. let put = DataMgr.getPlaceBallLevelList().length;
  18140. if (skill >= 3 || put >= 5) {
  18141. xGame.uiMgr.Show(UIInvitation$1);
  18142. this.hide();
  18143. }
  18144. }
  18145. addAward(callback) {
  18146. if (!this.success) {
  18147. callback && callback();
  18148. return;
  18149. }
  18150. switch (xGame.common.gameMode) {
  18151. case GameMode.classic:
  18152. this.awardCoinNum = xGame.common.passAwardCoin;
  18153. this.awardDiamondNum = 0;
  18154. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18155. break;
  18156. case GameMode.bigMove:
  18157. this.awardCoinNum = xGame.common.passAwardCoin;
  18158. this.awardDiamondNum = 0;
  18159. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18160. callback && callback();
  18161. break;
  18162. case GameMode.placeBall:
  18163. let level = xGame.common.placeBallCurLevel;
  18164. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18165. if (xGame.common.placeBallStarNum != 3) {
  18166. callback && callback();
  18167. return;
  18168. }
  18169. else {
  18170. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18171. if (getAward) {
  18172. callback && callback();
  18173. return;
  18174. }
  18175. }
  18176. let cfg = cfgTable.placeballData[level];
  18177. let data = cfgTable.placeballData[level].award;
  18178. this.awardCoinNum = data[0];
  18179. this.awardDiamondNum = data[1];
  18180. if (cfg.type == PlaceBallType.challenge) {
  18181. this.awardDiamondNum = 0;
  18182. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18183. }
  18184. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18185. let diamondAward;
  18186. if (this.awardDiamondNum > 0) {
  18187. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18188. xGame.common.getAward([diamondAward, coinAward], callback);
  18189. }
  18190. else {
  18191. xGame.common.getAward([coinAward], callback);
  18192. }
  18193. if (cfg.type == PlaceBallType.normal) {
  18194. DataMgr.setPlaceBallAward(level);
  18195. }
  18196. break;
  18197. default:
  18198. break;
  18199. }
  18200. }
  18201. playSecretaryAni() {
  18202. let parent = this.ui.secretary.displayObject;
  18203. parent.destroyChildren();
  18204. let xx = this.ui.secretary.width / 2;
  18205. let yy = this.ui.secretary.height;
  18206. let scale = xGame.common.getSecretaryScale();
  18207. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18208. if (this.success) {
  18209. let rand = Math.random() <= 0.5 ? 2 : 3;
  18210. xGame.common.secretary.play(data, rand, false, parent, () => {
  18211. xGame.common.secretary.play(data, 1, true, parent);
  18212. });
  18213. }
  18214. else {
  18215. xGame.common.secretary.play(data, 0, true, parent);
  18216. }
  18217. }
  18218. restartGame() {
  18219. switch (xGame.common.gameMode) {
  18220. case GameMode.classic:
  18221. xGame.eventMgr.event(RESTART_GAME);
  18222. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18223. break;
  18224. case GameMode.bigMove:
  18225. this.hide();
  18226. xGame.eventMgr.event(RESTART_GAME);
  18227. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18228. break;
  18229. default:
  18230. break;
  18231. }
  18232. }
  18233. hide() {
  18234. super.hide();
  18235. xGame.common.stopGirlPop(this.ui.talkNode);
  18236. PlatMgr.showBanner(false);
  18237. }
  18238. returnHome() {
  18239. this.hide();
  18240. let showFailWords = !this.success;
  18241. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18242. }
  18243. clickLeftBtn() {
  18244. switch (xGame.common.gameMode) {
  18245. case GameMode.classic:
  18246. case GameMode.bigMove:
  18247. this.returnHome();
  18248. break;
  18249. case GameMode.placeBall:
  18250. let level = xGame.common.placeBallCurLevel;
  18251. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18252. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18253. break;
  18254. default:
  18255. break;
  18256. }
  18257. }
  18258. powerStartPlaceBallLevel(level, btn) {
  18259. if (DataMgr.powerEnough()) {
  18260. btn.touchable = false;
  18261. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18262. btn.touchable = true;
  18263. DataMgr.setPower(-1);
  18264. xGame.eventMgr.event(POWER_TIME);
  18265. this.startPlaceBallLevel(level);
  18266. }));
  18267. }
  18268. else {
  18269. xGame.uiMgr.Show(UIPower$1, 0);
  18270. }
  18271. }
  18272. clickRightBtn() {
  18273. switch (xGame.common.gameMode) {
  18274. case GameMode.classic:
  18275. case GameMode.bigMove:
  18276. this.restartGame();
  18277. break;
  18278. case GameMode.placeBall:
  18279. let level = xGame.common.placeBallCurLevel;
  18280. let data = DataMgr.getPlaceBallLevel(level);
  18281. let curPss = data.play && !data.isCur;
  18282. if (curPss) {
  18283. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18284. }
  18285. else {
  18286. Moyu.sendDataEvent("placeBallNextLevel");
  18287. Moyu.showVideoAd(() => {
  18288. DataMgr.setPlaceBallLevel(level, 1);
  18289. this.startPlaceBallLevel(level + 1);
  18290. }, xGame.define.EAdType.placeBallNextLevel);
  18291. }
  18292. break;
  18293. default:
  18294. break;
  18295. }
  18296. }
  18297. startPlaceBallLevel(level) {
  18298. xGame.common.gameMode = GameMode.placeBall;
  18299. xGame.common.placeBallCurLevel = level;
  18300. xGame.uiMgr.Show(UIGame$1);
  18301. this.hide();
  18302. }
  18303. }
  18304. UIGameEnd$1.uiName = "UIGameEnd";
  18305. class ShowItem$1 {
  18306. constructor() {
  18307. this.ui = ui_ShowItem.createInstance();
  18308. }
  18309. destroySelf() {
  18310. if (!this.ui.isDisposed) {
  18311. this.ui.removeFromParent();
  18312. this.ui.dispose();
  18313. }
  18314. }
  18315. setParent(parent) {
  18316. parent.addChild(this.ui);
  18317. }
  18318. setPos(x, y) {
  18319. this.ui.x = x;
  18320. this.ui.y = y;
  18321. }
  18322. setUrl(index) {
  18323. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18324. }
  18325. }
  18326. class UILevelProp$1 extends UIBase {
  18327. constructor() {
  18328. super();
  18329. this.firstPos = 385;
  18330. this.secondPos = 467;
  18331. this.showItemArr = [];
  18332. }
  18333. onConstructor() {
  18334. this.ui = ui_UILevelProp.createInstance();
  18335. this.contentPane = this.ui;
  18336. this.isEject = false;
  18337. this.addUIClick(this.ui.closeBtn, this.hide);
  18338. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18339. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18340. }
  18341. show(level) {
  18342. super.show();
  18343. this.ui.t1.play();
  18344. this.level = level;
  18345. this.data = cfgTable.placeballData[this.level];
  18346. this.updateSelf();
  18347. this.showPreView();
  18348. this.moneyNode.ui.c1.selectedIndex = 2;
  18349. this.moneyNode.checkPowerTime();
  18350. this.moneyNode.powerChange();
  18351. }
  18352. showPreView() {
  18353. let item;
  18354. let data;
  18355. for (let index = 0; index < this.showItemArr.length; index++) {
  18356. item = this.showItemArr[index];
  18357. item.destroySelf();
  18358. }
  18359. this.showItemArr = [];
  18360. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18361. for (const key in cfgData) {
  18362. data = cfgData[key];
  18363. item = new ShowItem$1();
  18364. item.setParent(this.ui.myNode.displayRoot);
  18365. item.setPos(data.x, data.y);
  18366. item.setUrl(data.value);
  18367. this.showItemArr.push(item);
  18368. }
  18369. }
  18370. updateSelf() {
  18371. this.ui.myNode.levelTxt.text = `第${this.level}关`;
  18372. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18373. if (this.data.ball == -1) {
  18374. this.ui.myNode.conditionTxt.text = "打进场上所有球";
  18375. }
  18376. else {
  18377. this.ui.myNode.conditionTxt.text = "奖励关卡";
  18378. }
  18379. let localData = DataMgr.getPlaceBallLevel(this.level);
  18380. let getAward = localData.getAward;
  18381. let cfg = cfgTable.placeballData[this.level];
  18382. let coin = this.data.award[0];
  18383. let diamond = this.data.award[1];
  18384. if (cfg.type == PlaceBallType.challenge) {
  18385. diamond = 0;
  18386. coin = 100;
  18387. }
  18388. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18389. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18390. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18391. if (cfg.type == PlaceBallType.challenge) {
  18392. this.ui.myNode.coinNode.numTxt.text = "";
  18393. }
  18394. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18395. if (coin > 0 && diamond > 0) {
  18396. this.ui.myNode.diamondNode.x = 385;
  18397. this.ui.myNode.coinNode.x = 467;
  18398. }
  18399. else {
  18400. this.ui.myNode.diamondNode.x = 385;
  18401. this.ui.myNode.coinNode.x = 385;
  18402. }
  18403. if (!getAward) {
  18404. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18405. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18406. }
  18407. else {
  18408. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18409. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18410. }
  18411. }
  18412. startGame() {
  18413. if (DataMgr.powerEnough()) {
  18414. this.ui.myNode.startBtn.touchable = false;
  18415. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18416. this.ui.myNode.startBtn.touchable = true;
  18417. DataMgr.setPower(-1);
  18418. xGame.eventMgr.event(POWER_TIME);
  18419. xGame.common.gameMode = GameMode.placeBall;
  18420. xGame.common.placeBallCurLevel = this.level;
  18421. xGame.uiMgr.Show(UIGame$1);
  18422. xGame.uiMgr.Hide(UILevelDisplay$1);
  18423. xGame.uiMgr.Hide(UIMain$1);
  18424. this.hide();
  18425. }));
  18426. }
  18427. else {
  18428. xGame.uiMgr.Show(UIPower$1);
  18429. }
  18430. }
  18431. hide() {
  18432. super.hide();
  18433. }
  18434. }
  18435. UILevelProp$1.uiName = "UILevelProp";
  18436. class PutBallLevelDisplay$1 {
  18437. constructor(ui, index) {
  18438. this.index = 0;
  18439. this.ui = ui;
  18440. this.index = index;
  18441. this.ui.onClick(this, this.clickSelf);
  18442. this.updateSelf();
  18443. this.ui.levelTxt.text = (this.index + 1) + "";
  18444. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18445. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18446. }
  18447. updateSelf() {
  18448. let level = this.index + 1;
  18449. this.data = DataMgr.getPlaceBallLevel(level);
  18450. this.ui.starNode.c1.selectedIndex = this.data.star;
  18451. let isChallenge = cfgTable.placeballData[level].type;
  18452. if (this.data.isCur) {
  18453. if (isChallenge) {
  18454. this.ui.c1.selectedIndex = 5;
  18455. }
  18456. else {
  18457. this.ui.c1.selectedIndex = 2;
  18458. }
  18459. }
  18460. else {
  18461. if (this.data.play) {
  18462. if (this.data.star == 3) {
  18463. this.ui.c1.selectedIndex = 0;
  18464. }
  18465. else {
  18466. this.ui.c1.selectedIndex = 1;
  18467. }
  18468. }
  18469. else {
  18470. if (isChallenge) {
  18471. this.ui.c1.selectedIndex = 4;
  18472. }
  18473. else {
  18474. this.ui.c1.selectedIndex = 3;
  18475. }
  18476. }
  18477. }
  18478. }
  18479. clickSelf() {
  18480. if (!this.data.play)
  18481. return;
  18482. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18483. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18484. }
  18485. }
  18486. class UILevelDisplay$1 extends UIBase {
  18487. constructor() {
  18488. super();
  18489. }
  18490. onConstructor() {
  18491. this.ui = ui_UILevelDisplay.createInstance();
  18492. this.contentPane = this.ui;
  18493. this.isEject = false;
  18494. this.myList = this.ui.myNode.myList;
  18495. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18496. this.levelItemArr = [];
  18497. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18498. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18499. this.myList.numItems = levelNum;
  18500. if (Moyu.isKs)
  18501. this.ui.closeNode.closeBtn.x += 100;
  18502. }
  18503. levelItemRender(index, target) {
  18504. let item = new PutBallLevelDisplay$1(target, index);
  18505. this.levelItemArr.push(item);
  18506. }
  18507. show() {
  18508. super.show();
  18509. this.updateLevel();
  18510. this.scrollToPlace();
  18511. }
  18512. updateLevel() {
  18513. let temp;
  18514. for (let index = 0; index < this.levelItemArr.length; index++) {
  18515. temp = this.levelItemArr[index];
  18516. temp.updateSelf();
  18517. }
  18518. }
  18519. scrollToPlace() {
  18520. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18521. let passArr = DataMgr.getPlaceBallLevelList();
  18522. let offest = passArr.length;
  18523. if (offest >= maxNum - 1)
  18524. offest = maxNum - 1;
  18525. this.myList.scrollToView(offest, true, true);
  18526. }
  18527. hide() {
  18528. super.hide();
  18529. }
  18530. }
  18531. UILevelDisplay$1.uiName = "UILevelDisplay";
  18532. class UIMatching$1 extends UIBase {
  18533. constructor() {
  18534. super();
  18535. }
  18536. onConstructor() {
  18537. this.ui = ui_UIMatching.createInstance();
  18538. this.contentPane = this.ui;
  18539. this.isEject = false;
  18540. }
  18541. show(callback) {
  18542. super.show();
  18543. PlatMgr.showBanner(true);
  18544. this.callback = callback;
  18545. let user = Moyu.getUserInfo();
  18546. if (!this.selfPot) {
  18547. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18548. }
  18549. if (!this.aiPot) {
  18550. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18551. }
  18552. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18553. this.ui.selfHead.nameTxt.text = user.nickName;
  18554. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18555. this.ui.aiHead.nameTxt.text = "???";
  18556. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18557. this.ui.selfHead.c1.selectedIndex = 0;
  18558. this.ui.aiHead.c1.selectedIndex = 0;
  18559. this.ui.selfHead.x = this.selfPot.x;
  18560. this.ui.selfHead.y = this.selfPot.y;
  18561. this.ui.aiHead.x = this.aiPot.x;
  18562. this.ui.aiHead.y = this.aiPot.y;
  18563. switch (xGame.common.gameMode) {
  18564. case GameMode.classic:
  18565. break;
  18566. case GameMode.bigMove:
  18567. this.initSkillData();
  18568. break;
  18569. default:
  18570. break;
  18571. }
  18572. this.ui.t1.play(Laya.Handler.create(this, () => {
  18573. this.ui.t2.play(Laya.Handler.create(this, () => {
  18574. switch (xGame.common.gameMode) {
  18575. case GameMode.classic:
  18576. this.waitingPeople();
  18577. break;
  18578. case GameMode.bigMove:
  18579. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18580. break;
  18581. default:
  18582. break;
  18583. }
  18584. }));
  18585. }));
  18586. }
  18587. initSkillData() {
  18588. this.skillSelectData = [];
  18589. let skillUrl = xGame.common.skillIconList;
  18590. let skillName = xGame.common.skillNameList;
  18591. let skillLevel = DataMgr.getBigSkillList();
  18592. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18593. for (let index = 0; index < 5; index++) {
  18594. let obj = {};
  18595. obj.skillImg = skillUrl[index];
  18596. obj.skillName = skillName[index];
  18597. obj.skillType = skillType[index];
  18598. obj.skillLevel = skillLevel[index];
  18599. this.skillSelectData.push(obj);
  18600. }
  18601. }
  18602. getAISkillLevel(myLevel) {
  18603. let video = xGame.common.upSkillLevel;
  18604. let aiLevel;
  18605. let temp;
  18606. if (video) {
  18607. temp = xGame.common.randomNum(-2, -1);
  18608. }
  18609. else {
  18610. if (myLevel <= 5) {
  18611. temp = xGame.common.randomNum(1, 3);
  18612. }
  18613. else if (myLevel <= 9) {
  18614. temp = xGame.common.randomNum(-2, 1);
  18615. }
  18616. else {
  18617. temp = xGame.common.randomNum(-4, 0);
  18618. }
  18619. }
  18620. aiLevel = temp + myLevel;
  18621. if (aiLevel <= 1)
  18622. aiLevel = 1;
  18623. if (aiLevel >= 10)
  18624. aiLevel = 10;
  18625. return aiLevel;
  18626. }
  18627. getAISkillType() {
  18628. return xGame.common.randomNum(1, 4);
  18629. let successTimes = DataMgr.getSkillSuccessTimes();
  18630. let info = cfgTable.aiskillData[successTimes];
  18631. if (!info) {
  18632. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18633. info = cfgTable.aiskillData[max];
  18634. }
  18635. let dataArr = info.skillselect;
  18636. let myCfg = {};
  18637. for (let index = 0; index < dataArr.length; index++) {
  18638. let temp = dataArr[index].split('-');
  18639. myCfg[temp[0]] = {};
  18640. myCfg[temp[0]].id = parseInt(temp[0]);
  18641. myCfg[temp[0]].weight = parseInt(temp[1]);
  18642. }
  18643. let aiCfg = xGame.common.initWeight(myCfg);
  18644. let curData = xGame.common.getRandomWeightData(aiCfg);
  18645. return parseInt(curData.id);
  18646. }
  18647. getAISkillData(index) {
  18648. let myLevel = this.skillSelectData[index].skillLevel;
  18649. let aiLevel = this.getAISkillLevel(myLevel);
  18650. let aiType = this.getAISkillType() - 1;
  18651. return { aiLevel, aiType } = { aiLevel, aiType };
  18652. }
  18653. skillSelectFinish(index) {
  18654. let aiInfo = this.getAISkillData(index);
  18655. xGame.common.gameMgr.selfCurSkill = index;
  18656. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18657. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18658. this.ui.selfHead.c1.selectedIndex = 1;
  18659. this.ui.aiHead.c1.selectedIndex = 1;
  18660. let myData = this.skillSelectData[index];
  18661. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18662. let guide = DataMgr.getSkillGuide();
  18663. if (guide == 0) {
  18664. this.ui.selfHead.skillTxt.text = myData.skillName + " 满级";
  18665. }
  18666. else {
  18667. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18668. }
  18669. let aiData = this.skillSelectData[aiInfo.aiType];
  18670. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18671. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18672. this.waitingPeople();
  18673. }
  18674. waitingPeople() {
  18675. let time = xGame.common.randomNum(1000, 3000);
  18676. time += 1000;
  18677. Laya.timer.once(time, this, () => {
  18678. this.matchingSuccess();
  18679. });
  18680. }
  18681. matchingSuccess() {
  18682. let gameUI = xGame.common.gameUI;
  18683. let name = gameUI.ui.topNode.aiNameTxt.text;
  18684. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18685. this.ui.aiHead.nameTxt.text = name;
  18686. this.ui.aiHead.headImg.url = url;
  18687. name = gameUI.ui.topNode.selfNameTxt.text;
  18688. url = gameUI.ui.topNode.selfHeadLoader.url;
  18689. this.ui.selfHead.nameTxt.text = name;
  18690. this.ui.selfHead.headImg.url = url;
  18691. this.ui.t3.play(Laya.Handler.create(this, () => {
  18692. this.callback && this.callback();
  18693. this.ui.t4.play(Laya.Handler.create(this, () => {
  18694. this.destroySelf();
  18695. }));
  18696. }));
  18697. }
  18698. destroySelf() {
  18699. this.callback = null;
  18700. this.skillSelectData = null;
  18701. this.selfPot = null;
  18702. this.aiPot = null;
  18703. if (!this.ui.isDisposed) {
  18704. this.ui.removeFromParent();
  18705. this.ui.dispose();
  18706. }
  18707. xGame.uiMgr.destroyUI(this);
  18708. }
  18709. }
  18710. UIMatching$1.uiName = "UIMatching";
  18711. class SkillDisplay$1 {
  18712. constructor(ui, data, uiIndex) {
  18713. this.starX = 0;
  18714. this.starY = 0;
  18715. this.index = 0;
  18716. this.ui = ui;
  18717. this.data = data;
  18718. this.index = uiIndex;
  18719. this.initSelf();
  18720. }
  18721. initSelf() {
  18722. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18723. this.ui.nameTxt.text = this.data.name;
  18724. this.ui.describeTxt.text = this.data.describe;
  18725. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18726. this.ui.startBtn.onClick(this, this.startGame);
  18727. this.updateSelf();
  18728. }
  18729. updateSelf() {
  18730. this.checkTry();
  18731. let level = DataMgr.getBigSkillByIndex(this.index);
  18732. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18733. }
  18734. checkTry() {
  18735. let index = this.index;
  18736. let level = DataMgr.getBigSkillByIndex(index);
  18737. if (level == null) {
  18738. DataMgr.setBigSkill(index, 1, false);
  18739. level = 1;
  18740. }
  18741. this.ui.levelTxt.text = "LV." + level;
  18742. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18743. this.ui.tryNode.visible = true;
  18744. else
  18745. this.ui.tryNode.visible = false;
  18746. }
  18747. clickAddLevel() {
  18748. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18749. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18750. Moyu.showVideoAd(() => {
  18751. DataMgr.setBigSkill(this.data.index, 1);
  18752. this.updateSelf();
  18753. xGame.common.upSkillLevel = true;
  18754. }, EAdType.upSkill);
  18755. }
  18756. startGame() {
  18757. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18758. let needCoin = xGame.common.bigMoveNeedCoin;
  18759. xGame.common.passAwardCoin = 2000;
  18760. let guide = DataMgr.getSkillGuide();
  18761. xGame.common.temSelfLevel = 0;
  18762. if (guide == 0) {
  18763. needCoin = 0;
  18764. xGame.common.temSelfLevel = 100;
  18765. }
  18766. if (DataMgr.coinEnough(needCoin)) {
  18767. DataMgr.setCoin(-needCoin);
  18768. xGame.common.curPlayerSkillType = this.index;
  18769. if (guide == 0)
  18770. xGame.common.curPlayerSkillType = 0;
  18771. xGame.uiMgr.Show(UIGame$1);
  18772. xGame.uiMgr.Hide(UIMain$1);
  18773. xGame.uiMgr.Show(UIMatching$1, () => {
  18774. xGame.common.gameUI.ui.alpha = 1;
  18775. xGame.common.gameUI.startGame();
  18776. xGame.uiMgr.Hide(UISkill$1);
  18777. });
  18778. }
  18779. else {
  18780. xGame.uiMgr.Show(UIAddProp$1, 0);
  18781. Moyu.sendDataEvent("AddCoinVideo");
  18782. }
  18783. }
  18784. }
  18785. class UISkill$1 extends UIBase {
  18786. constructor() {
  18787. super();
  18788. this.skillData = [];
  18789. }
  18790. onConstructor() {
  18791. this.ui = ui_UISkill.createInstance();
  18792. this.contentPane = this.ui;
  18793. this.isEject = false;
  18794. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18795. this.initSkillData();
  18796. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18797. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18798. this.displayList = [];
  18799. this.ui.skillNode.skillList.numItems = 4;
  18800. this.addUIClick(this.ui, this.interuptSecretary);
  18801. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18802. this.ui.talkNode.visible = false;
  18803. if (Moyu.isKs)
  18804. this.ui.closeNode.closeBtn.x += 100;
  18805. }
  18806. show() {
  18807. super.show();
  18808. this.playSecretaryIdle();
  18809. this.moneyNode.ui.c1.selectedIndex = 1;
  18810. Laya.timer.clearAll(this);
  18811. xGame.soundMgr.playSound("s_start");
  18812. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18813. let guide = DataMgr.getSkillGuide();
  18814. this.ui.guideNode.visible = guide == 0;
  18815. let item = this.getSkillItemByUIIndex(0);
  18816. if (guide == 0) {
  18817. item.ui.c1.selectedIndex = 1;
  18818. }
  18819. else {
  18820. item.ui.c1.selectedIndex = 0;
  18821. }
  18822. this.ui.guideNode.guideBtn.visible = guide == 0;
  18823. for (let index = 0; index < this.displayList.length; index++) {
  18824. this.displayList[index].checkTry();
  18825. }
  18826. }
  18827. getSkillItemByUIIndex(cur) {
  18828. for (let index = 0; index < this.displayList.length; index++) {
  18829. if (this.displayList[index].index == cur) {
  18830. return this.displayList[index];
  18831. }
  18832. }
  18833. }
  18834. enterGuideLevel() {
  18835. let item = this.getSkillItemByUIIndex(0);
  18836. item.startGame();
  18837. if (DataMgr.getNewUser())
  18838. Moyu.sendDataEvent("gameStart1");
  18839. }
  18840. initSkillData() {
  18841. this.skillData = [];
  18842. let nameList = xGame.common.skillNameList;
  18843. let iconList = xGame.common.skillIconList;
  18844. let describeList = [
  18845. "跳杆击球后,球高高跃起,砸在桌面上,直接打进额外1颗球",
  18846. "普通击球后,球杆向随机方向—扫,将杆子范围内1颗可击打球扫入球袋",
  18847. "我方击球后,在场地上将随机1颗球冻结,敌方无法击打冰冻球,且其他球碰到冰冻球会弹开",
  18848. "击球后在球桌上斩出一刀,并击飞斩中的球。(球不会飞出球桌)"
  18849. ];
  18850. let data;
  18851. for (let index = 0; index < nameList.length; index++) {
  18852. data = {};
  18853. data.name = nameList[index];
  18854. data.icon = iconList[index];
  18855. data.describe = describeList[index];
  18856. data.index = index;
  18857. this.skillData.push(data);
  18858. }
  18859. }
  18860. updateSkillItem(index, target) {
  18861. if (this.displayList[index] == null) {
  18862. let uiIndex;
  18863. switch (index) {
  18864. case 0:
  18865. uiIndex = 1;
  18866. break;
  18867. case 1:
  18868. uiIndex = 0;
  18869. break;
  18870. case 2:
  18871. uiIndex = 2;
  18872. break;
  18873. case 3:
  18874. uiIndex = 3;
  18875. break;
  18876. default:
  18877. break;
  18878. }
  18879. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  18880. this.displayList.push(temp);
  18881. }
  18882. }
  18883. playSecretaryIdle() {
  18884. let parent = this.ui.secretary.displayObject;
  18885. parent.destroyChildren();
  18886. let xx = this.ui.secretary.width / 2;
  18887. let yy = this.ui.secretary.height;
  18888. let scale = xGame.common.getSecretaryScale();
  18889. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18890. xGame.common.secretary.play(data, 1, true, parent);
  18891. }
  18892. returnUIMain() {
  18893. this.hide();
  18894. xGame.common.stopGirlPop(this.ui.talkNode);
  18895. xGame.uiMgr.Show(UIMain$1);
  18896. }
  18897. interuptSecretary() {
  18898. Laya.timer.clearAll(this);
  18899. this.playSecretaryRandomSound();
  18900. }
  18901. playSecretaryRandomSound() {
  18902. if (this.isHide)
  18903. return;
  18904. let time = xGame.common.randomNum(45000, 60000);
  18905. Laya.timer.once(time, this, () => {
  18906. if (this.isHide)
  18907. return;
  18908. let index = xGame.common.randomNum(4, 7);
  18909. xGame.soundMgr.playSound("s_main0" + index);
  18910. let words = 1;
  18911. switch (index) {
  18912. case 4:
  18913. words = 5;
  18914. break;
  18915. case 5:
  18916. words = 3;
  18917. break;
  18918. case 6:
  18919. words = 6;
  18920. break;
  18921. case 7:
  18922. words = 7;
  18923. break;
  18924. default:
  18925. break;
  18926. }
  18927. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18928. this.playSecretaryRandomSound();
  18929. });
  18930. }
  18931. }
  18932. UISkill$1.uiName = "UISkill";
  18933. class UIAddProp$1 extends UIBase {
  18934. constructor() {
  18935. super();
  18936. this.curType = "";
  18937. }
  18938. onConstructor() {
  18939. this.ui = ui_UIAddProp.createInstance();
  18940. this.contentPane = this.ui;
  18941. this.isEject = false;
  18942. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  18943. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  18944. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  18945. this.updateUI();
  18946. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  18947. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  18948. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  18949. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  18950. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  18951. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  18952. }
  18953. show(type) {
  18954. super.show();
  18955. this.curType = type == 0 ? "coin" : "diamond";
  18956. this.switchBtn("");
  18957. this.ui.t0.play();
  18958. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  18959. PlatMgr.showInsert(true);
  18960. }
  18961. closeSelf() {
  18962. this.hide();
  18963. }
  18964. updateUI() {
  18965. let data = cfgTable.moneyData;
  18966. let temp;
  18967. let obj;
  18968. for (const key in data) {
  18969. temp = data[key];
  18970. obj = this.ui.myNode["node" + key];
  18971. if (parseInt(key) <= 2) {
  18972. obj.diamondTxt.text = "+" + temp.num;
  18973. }
  18974. else {
  18975. obj.coinTxt.text = temp.num;
  18976. obj.diamondTxt.text = temp.get.split('_')[1];
  18977. }
  18978. }
  18979. this.updateDiamondShare();
  18980. }
  18981. updateDiamondShare() {
  18982. let data = DataMgr.getShareDiamondTimes();
  18983. if (data >= xGame.common.maxShareDiamondTimes) {
  18984. this.ui.myNode.node1.shareTxt.text = "明日再来";
  18985. this.ui.myNode.node1.touchable = false;
  18986. }
  18987. else {
  18988. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  18989. this.ui.myNode.node1.touchable = true;
  18990. }
  18991. }
  18992. switchBtn(type) {
  18993. if (type == "")
  18994. type = this.curType;
  18995. else {
  18996. if (this.curType == type) {
  18997. return;
  18998. }
  18999. else {
  19000. this.curType = type;
  19001. }
  19002. }
  19003. if (type == "coin") {
  19004. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19005. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19006. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19007. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19008. this.ui.myNode.c1.selectedIndex = 0;
  19009. }
  19010. else {
  19011. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19012. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19013. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19014. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19015. this.ui.myNode.c1.selectedIndex = 1;
  19016. }
  19017. }
  19018. convertCoin(index) {
  19019. let data = cfgTable.moneyData[index];
  19020. let coinNum = data.num;
  19021. let str = data.get.split('_')[1];
  19022. let needDiamond = parseInt(str);
  19023. if (DataMgr.diamondEnough(needDiamond)) {
  19024. DataMgr.setDiamond(-needDiamond);
  19025. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19026. xGame.uiMgr.Show(UIMsg$1, "兑换成功!");
  19027. }
  19028. else {
  19029. xGame.uiMgr.Show(UIMsg$1, "钻石不足~");
  19030. this.switchBtn("diamond");
  19031. }
  19032. }
  19033. videoGetDiamond() {
  19034. let num = cfgTable.moneyData[2].num;
  19035. Moyu.showVideoAd(() => {
  19036. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19037. this.closeSelf();
  19038. }, EAdType.addDiamond);
  19039. }
  19040. videoGetCoin() {
  19041. Moyu.showVideoAd(() => {
  19042. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19043. this.closeSelf();
  19044. }, EAdType.addCoin);
  19045. }
  19046. shareGetDiamond() {
  19047. let times = DataMgr.getShareDiamondTimes();
  19048. if (times >= xGame.common.maxShareDiamondTimes) {
  19049. xGame.uiMgr.Show(UIMsg$1, "明日再来~");
  19050. }
  19051. else {
  19052. if (Moyu.isTT) {
  19053. let num = cfgTable.moneyData[1].num;
  19054. Moyu.shareVideo = '';
  19055. Moyu.shareGame((success) => {
  19056. if (success) {
  19057. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19058. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19059. DataMgr.setShareDiamondTimes(1);
  19060. this.updateDiamondShare();
  19061. }
  19062. else {
  19063. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19064. }
  19065. });
  19066. }
  19067. else {
  19068. Moyu.showVideoAd(() => {
  19069. let diamond = xGame.common.randomNum(50, 100);
  19070. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19071. DataMgr.setShareDiamondTimes(1);
  19072. this.updateDiamondShare();
  19073. }, EAdType.randomDiamond);
  19074. }
  19075. }
  19076. }
  19077. openPutBallView() {
  19078. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19079. let skill = xGame.uiMgr.getUI(UISkill$1);
  19080. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19081. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19082. if (end && !end.isHide) {
  19083. xGame.uiMgr.Hide(UIGameEnd$1);
  19084. xGame.uiMgr.Show(UIMain$1);
  19085. }
  19086. if (skill && !skill.isHide)
  19087. xGame.uiMgr.Hide(UISkill$1);
  19088. if (uigame && !uigame.isHide)
  19089. xGame.uiMgr.Hide(UIGame$1);
  19090. if (level && !level.isHide) {
  19091. }
  19092. else {
  19093. xGame.uiMgr.Show(UILevelDisplay$1);
  19094. }
  19095. this.closeSelf();
  19096. }
  19097. }
  19098. UIAddProp$1.uiName = "UIAddProp";
  19099. class MoneyNode$1 {
  19100. constructor(ui) {
  19101. this.leftTime = 0;
  19102. this.ui = ui;
  19103. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19104. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19105. this.ui.addPowerBtn.onClick(this, this.addPower);
  19106. this.ui.c1.selectedIndex = 1;
  19107. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19108. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19109. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19110. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19111. this.coinChange();
  19112. this.diamondChange();
  19113. this.powerChange();
  19114. }
  19115. addPower() {
  19116. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19117. xGame.uiMgr.Show(UIPower$1);
  19118. }
  19119. powerChange() {
  19120. let powerNum = DataMgr.getPower();
  19121. this.ui.powerTxt.text = powerNum + "";
  19122. }
  19123. checkPowerTime() {
  19124. let cur = new Date().getTime();
  19125. let last = DataMgr.getPowerTime();
  19126. if (last == 0) {
  19127. last = cur;
  19128. DataMgr.setPowerTime(cur);
  19129. }
  19130. let power = DataMgr.getPower();
  19131. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19132. Laya.timer.clearAll(this);
  19133. if (power >= xGame.common.natureMaxPower) {
  19134. this.ui.powerTimeTxt.text = "";
  19135. DataMgr.setPowerTime(cur);
  19136. return;
  19137. }
  19138. if (power + offset >= xGame.common.natureMaxPower) {
  19139. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19140. this.ui.powerTimeTxt.text = "";
  19141. DataMgr.setPowerTime(cur);
  19142. }
  19143. else {
  19144. if (offset > 0) {
  19145. DataMgr.setPower(offset);
  19146. DataMgr.setPowerTime(cur);
  19147. }
  19148. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19149. this.leftTime = xGame.common.powerRecoverNum - time;
  19150. if (this.leftTime <= 0)
  19151. this.leftTime = 0;
  19152. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19153. Laya.timer.loop(1000, this, this.updatePowerTime);
  19154. }
  19155. }
  19156. updatePowerTime() {
  19157. this.leftTime -= 1;
  19158. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19159. if (this.leftTime <= 0) {
  19160. this.checkPowerTime();
  19161. }
  19162. }
  19163. coinChange() {
  19164. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19165. }
  19166. diamondChange() {
  19167. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19168. }
  19169. addCoin() {
  19170. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19171. Moyu.sendDataEvent("AddCoinBtn");
  19172. xGame.uiMgr.Show(UIAddProp$1, 0);
  19173. }
  19174. addDiamond() {
  19175. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19176. Moyu.sendDataEvent("AddDiamondBtn");
  19177. xGame.uiMgr.Show(UIAddProp$1, 1);
  19178. }
  19179. }
  19180. class SettingNode$1 {
  19181. constructor(ui) {
  19182. this.showSetting = false;
  19183. this.openSound = true;
  19184. this.openShake = true;
  19185. this.ui = ui;
  19186. this.ui.soundBtn.onClick(this, this.switchSound);
  19187. this.ui.shakeBtn.onClick(this, this.switchShake);
  19188. this.ui.xyBtn.onClick(this, this.onXy);
  19189. this.ui.clickNode.onClick(this, this.changeSetting);
  19190. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19191. }
  19192. changeSetting() {
  19193. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19194. this.showSetting = !this.showSetting;
  19195. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19196. }
  19197. switchSound() {
  19198. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19199. this.openSound = !this.openSound;
  19200. Moyu.onSetting(this.openSound, this.openShake);
  19201. xGame.soundMgr.onSetting(this.openSound);
  19202. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19203. }
  19204. switchShake() {
  19205. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19206. this.openShake = !this.openShake;
  19207. Moyu.onSetting(this.openSound, this.openShake);
  19208. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19209. }
  19210. onXy() {
  19211. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19212. MoyuMgr$1.showXy(1);
  19213. }
  19214. }
  19215. class UIDraw$1 extends UIBase {
  19216. constructor() {
  19217. super();
  19218. this.curKey = 0;
  19219. }
  19220. onConstructor() {
  19221. this.ui = ui_UIDraw.createInstance();
  19222. this.contentPane = this.ui;
  19223. this.isEject = false;
  19224. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19225. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19226. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19227. this.initDraw();
  19228. this.initUI();
  19229. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19230. if (Moyu.isKs)
  19231. this.ui.closeNode.closeBtn.x += 100;
  19232. }
  19233. show() {
  19234. super.show();
  19235. this.ui.t0.play();
  19236. this.playSecretaryIdle();
  19237. this.updateDraw();
  19238. this.checkFree();
  19239. if (PlatMgr.bannerDelay > 0) {
  19240. this.ui.closeNode.closeBtn.visible = false;
  19241. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19242. this.ui.closeNode.closeBtn.visible = true;
  19243. });
  19244. }
  19245. PlatMgr.showRateBanner();
  19246. }
  19247. hide() {
  19248. Laya.timer.clearAll(this);
  19249. super.hide();
  19250. }
  19251. checkFree() {
  19252. let isFree = DataMgr.getDailyfreeDrawTimes();
  19253. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19254. }
  19255. initDraw() {
  19256. this.drawObj = [];
  19257. let data = cfgTable.drawData;
  19258. let temp;
  19259. let weight = 0;
  19260. for (const key in data) {
  19261. temp = data[key];
  19262. weight += temp.weight;
  19263. this.drawObj.push(weight);
  19264. }
  19265. this.allWeight = weight;
  19266. }
  19267. initUI() {
  19268. let data = cfgTable.drawData;
  19269. let temp;
  19270. let img;
  19271. let txt;
  19272. for (const key in data) {
  19273. temp = data[key];
  19274. img = this.ui.myNode.rotNode["img" + key];
  19275. txt = this.ui.myNode.rotNode["txt" + key];
  19276. img.url = xGame.common.getGameIconUrl(temp.icon);
  19277. txt.visible = true;
  19278. if (temp.award > 2) {
  19279. img.rotation = 0;
  19280. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19281. }
  19282. else {
  19283. img.rotation = temp.rotation;
  19284. txt.text = temp.num;
  19285. }
  19286. }
  19287. }
  19288. getCurkey() {
  19289. let rand = Math.random() * this.allWeight;
  19290. let temp;
  19291. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19292. temp = this.drawObj[index];
  19293. if (index == 0) {
  19294. if (rand < temp) {
  19295. return index + 1;
  19296. }
  19297. }
  19298. else {
  19299. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19300. return index + 1;
  19301. }
  19302. }
  19303. }
  19304. return 2;
  19305. }
  19306. startDraw() {
  19307. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19308. if (freeTimes > 0) {
  19309. this.beginDraw();
  19310. DataMgr.setDailyfreeDrawTimes(0);
  19311. this.checkFree();
  19312. }
  19313. else {
  19314. Moyu.sendDataEvent("turntable");
  19315. Moyu.showVideoAd(() => {
  19316. this.beginDraw();
  19317. }, EAdType.draw);
  19318. }
  19319. }
  19320. beginDraw() {
  19321. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19322. this.ui.drawBtn.touchable = false;
  19323. this.curKey = this.getCurkey();
  19324. console.log("当前key", this.curKey);
  19325. let cell = 60;
  19326. let lap = 3;
  19327. let angle = cell * (this.curKey - 1) + lap * 360;
  19328. let target = this.ui.myNode.rotNode;
  19329. target.rotation = 0;
  19330. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19331. console.log("旋转完成");
  19332. this.ui.drawBtn.touchable = true;
  19333. this.getAward();
  19334. }));
  19335. }
  19336. getAward() {
  19337. let data = cfgTable.drawData[this.curKey];
  19338. let temp = new AwardType();
  19339. temp.type = data.award;
  19340. temp.num = data.num;
  19341. xGame.common.getAward([temp], () => {
  19342. DataMgr.setDrawTimes(1);
  19343. this.updateDraw();
  19344. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19345. });
  19346. }
  19347. updateDraw() {
  19348. let drawTimes = DataMgr.getDrawTimes();
  19349. let awardTimes = DataMgr.getDrawAwardTimes();
  19350. if (Math.floor(drawTimes / 3) > awardTimes) {
  19351. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19352. this.ui.extraNode.boxBtn.touchable = true;
  19353. this.ui.extraNode.tipsTxt.text = "3/3";
  19354. this.ui.extraNode.barNode.width = 265;
  19355. this.getExtraAward();
  19356. }
  19357. else {
  19358. this.ui.extraNode.boxBtn.t0.stop();
  19359. this.ui.extraNode.boxBtn.touchable = false;
  19360. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19361. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19362. }
  19363. let data = cfgTable.drawData[1];
  19364. if (awardTimes == 0) {
  19365. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19366. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19367. this.ui.myNode.rotNode.img1.rotation = 0;
  19368. }
  19369. else {
  19370. let award = data.nextid;
  19371. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19372. this.ui.myNode.rotNode.txt1.text = award[1];
  19373. this.ui.myNode.rotNode.img1.rotation = 0;
  19374. }
  19375. }
  19376. getExtraAward() {
  19377. let drawTimes = DataMgr.getDrawTimes();
  19378. let awardTimes = DataMgr.getDrawAwardTimes();
  19379. let data = cfgTable.drawData[1];
  19380. let award = new AwardType();
  19381. if (awardTimes == 0) {
  19382. award.num = data.num;
  19383. award.type = data.award;
  19384. xGame.common.getAward([award], () => {
  19385. let all = Math.floor(drawTimes / 3);
  19386. DataMgr.setDrawAwardTimes(all);
  19387. this.updateDraw();
  19388. });
  19389. }
  19390. else {
  19391. award.num = parseInt(data.nextid[1]);
  19392. award.type = parseInt(data.nextid[0]);
  19393. xGame.common.getAward([award], () => {
  19394. let all = Math.floor(drawTimes / 3);
  19395. DataMgr.setDrawAwardTimes(all);
  19396. this.updateDraw();
  19397. });
  19398. }
  19399. }
  19400. closeSelf() {
  19401. this.hide();
  19402. }
  19403. playSecretaryIdle() {
  19404. let parent = this.ui.secretary.displayObject;
  19405. parent.destroyChildren();
  19406. let xx = this.ui.secretary.width / 2;
  19407. let yy = this.ui.secretary.height;
  19408. let scale = xGame.common.getSecretaryScale();
  19409. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19410. xGame.common.secretary.play(data, 1, true, parent);
  19411. }
  19412. }
  19413. UIDraw$1.uiName = "UIDraw";
  19414. class UIRanking$1 extends UIBase {
  19415. constructor() {
  19416. super();
  19417. this.showSelf = true;
  19418. this.rankType = 1;
  19419. this.rankList = [];
  19420. this.myIndex = 0;
  19421. this.myStar = 0;
  19422. }
  19423. onConstructor() {
  19424. this.ui = ui_UIRanking.createInstance();
  19425. this.contentPane = this.ui;
  19426. this.isEject = false;
  19427. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19428. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19429. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19430. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19431. this.ui.myNode.myList.setVirtual();
  19432. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19433. }
  19434. show() {
  19435. super.show();
  19436. this.myIndex = 51;
  19437. Moyu.getRankList({
  19438. rankId: xGame.common.curRankID,
  19439. type: MoyuRankType.total,
  19440. page: 1,
  19441. pageSize: 50,
  19442. }, this, this.updateItemData);
  19443. this.updateSelf();
  19444. let self = Moyu.getUserInfo();
  19445. if (!self.isAuth) {
  19446. Moyu.initUser(this, () => {
  19447. DataMgr.upRankData();
  19448. });
  19449. }
  19450. }
  19451. updateSelfItem() {
  19452. let self = Moyu.getUserInfo();
  19453. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19454. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19455. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19456. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "我自己";
  19457. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19458. }
  19459. updateItemData(data) {
  19460. this.myStar = xGame.common.getAllStarNum();
  19461. if (this.rankList.length < 2) {
  19462. this.rankList = data;
  19463. let self = Moyu.getUserInfo();
  19464. for (let i = 0; i < data.length; i++) {
  19465. let data = this.rankList[i];
  19466. if (data.userId == self.userId) {
  19467. this.rankList.splice(i, 1);
  19468. break;
  19469. }
  19470. }
  19471. for (let i = 0; i < data.length; i++) {
  19472. let data = this.rankList[i];
  19473. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19474. this.myIndex = i + 1;
  19475. let user = { headIcon: self.headIcon, nickName: "我自己" };
  19476. let ud = { user: user, data: {} };
  19477. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19478. if (Moyu.platType < 11) {
  19479. user.headIcon = self.headIcon;
  19480. user.nickName = self.nickName;
  19481. }
  19482. this.rankList.splice(i, 0, md);
  19483. break;
  19484. }
  19485. }
  19486. }
  19487. this.updateSelfItem();
  19488. this.ui.myNode.myList.numItems = this.rankList.length;
  19489. }
  19490. updateItemUI(index, obj) {
  19491. let data = this.rankList[index];
  19492. let userData = JSON.parse(data.userData).user;
  19493. obj.nameTxt.text = userData.nickName.toString();
  19494. obj.valueTxt.text = data.rankScore;
  19495. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19496. obj.rankTxt.text = index + 1;
  19497. switch (index) {
  19498. case 0:
  19499. this.setImg(obj, 1, 0, 0);
  19500. obj.rankTxt.color = "#FFC047";
  19501. break;
  19502. case 1:
  19503. this.setImg(obj, 0, 1, 0);
  19504. obj.rankTxt.color = "#ACACAC";
  19505. break;
  19506. case 2:
  19507. this.setImg(obj, 0, 0, 1);
  19508. obj.rankTxt.color = "#D09672";
  19509. break;
  19510. default:
  19511. this.setImg(obj, 0, 0, 0);
  19512. obj.rankTxt.color = "#496FAB";
  19513. break;
  19514. }
  19515. }
  19516. setImg(obj, a, b, c) {
  19517. obj.img1.visible = a ? true : false;
  19518. obj.img2.visible = b ? true : false;
  19519. obj.img3.visible = c ? true : false;
  19520. }
  19521. changeList(type) {
  19522. this.rankType = type;
  19523. this.updateSelf();
  19524. }
  19525. changeSelfNode() {
  19526. this.showSelf = !this.showSelf;
  19527. this.updateSelf();
  19528. }
  19529. updateSelf() {
  19530. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19531. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19532. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19533. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19534. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19535. }
  19536. }
  19537. UIRanking$1.uiName = "UIRanking";
  19538. class UISecretary$1 extends UIBase {
  19539. constructor() {
  19540. super();
  19541. this.curIndex = 1;
  19542. }
  19543. onConstructor() {
  19544. this.ui = ui_UISecretary.createInstance();
  19545. this.contentPane = this.ui;
  19546. this.isEject = false;
  19547. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19548. this.addUIClick(this.ui.leftBtn, this.turnLeft);
  19549. this.addUIClick(this.ui.rightBtn, this.turnRight);
  19550. this.nodeObj = { left: null, right: null, cur: null };
  19551. this.nodeObj.left = this.ui.myNode.gameNode1;
  19552. this.nodeObj.right = this.ui.myNode.gameNode2;
  19553. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19554. }
  19555. show() {
  19556. super.show();
  19557. this.ui.t0.play();
  19558. this.updateData();
  19559. }
  19560. addSecretarySpine(node, spineName) {
  19561. if (spineName == "mishu") {
  19562. if (this.secretarySpine1) {
  19563. node.displayObject.destroyChildren();
  19564. this.playWoman(this.secretarySpine1, node.displayObject);
  19565. }
  19566. else {
  19567. let spine1 = new SpineMgr("mishu", () => {
  19568. this.secretarySpine1 = spine1;
  19569. this.playWoman(this.secretarySpine1, node.displayObject);
  19570. });
  19571. }
  19572. }
  19573. else {
  19574. if (this.secretarySpine2) {
  19575. node.displayObject.destroyChildren();
  19576. this.playWoman(this.secretarySpine2, node.displayObject);
  19577. }
  19578. else {
  19579. let spine2 = new SpineMgr("xiaomishu2", () => {
  19580. this.secretarySpine2 = spine2;
  19581. this.playWoman(this.secretarySpine2, node.displayObject);
  19582. });
  19583. }
  19584. }
  19585. }
  19586. playWoman(node, parent) {
  19587. let xx = this.ui.myNode.gameNode1.secretary.width / 2;
  19588. let yy = this.ui.myNode.gameNode1.secretary.height;
  19589. let scale = 1.5;
  19590. if (node == this.secretarySpine2) {
  19591. scale = 1.2;
  19592. }
  19593. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19594. node.play(data, 1, true, parent);
  19595. }
  19596. turnLeft() {
  19597. this.curIndex--;
  19598. if (this.curIndex < 1) {
  19599. this.curIndex = 2;
  19600. }
  19601. let left = this.nodeObj.left;
  19602. let right = this.nodeObj.right;
  19603. let cur = this.nodeObj.cur;
  19604. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19605. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19606. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19607. this.updateData();
  19608. }));
  19609. this.ui.myNode.setChildIndex(right, 2);
  19610. this.nodeObj.left = cur;
  19611. this.nodeObj.right = left;
  19612. this.nodeObj.cur = right;
  19613. }
  19614. turnRight() {
  19615. this.curIndex++;
  19616. if (this.curIndex > 2) {
  19617. this.curIndex = 1;
  19618. }
  19619. let left = this.nodeObj.left;
  19620. let right = this.nodeObj.right;
  19621. let cur = this.nodeObj.cur;
  19622. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19623. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19624. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19625. this.updateData();
  19626. }));
  19627. this.ui.myNode.setChildIndex(left, 2);
  19628. this.nodeObj.left = right;
  19629. this.nodeObj.right = cur;
  19630. this.nodeObj.cur = left;
  19631. }
  19632. updateData() {
  19633. let data = cfgTable.secretaryshopData;
  19634. let children = this.ui.myNode._children;
  19635. let temp;
  19636. let curData;
  19637. for (let index = 0; index < children.length; index++) {
  19638. temp = children[index];
  19639. if (index == 2) {
  19640. curData = data[this.curIndex];
  19641. temp.purchaseBtn.touchable = true;
  19642. }
  19643. else {
  19644. temp.purchaseBtn.touchable = false;
  19645. if (this.curIndex == 1) {
  19646. curData = data[2];
  19647. }
  19648. else {
  19649. curData = data[1];
  19650. }
  19651. }
  19652. temp.heightTxt.text = curData.height;
  19653. temp.foodTxt.text = curData.food;
  19654. temp.historyTxt.text = curData.history;
  19655. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19656. this.addSecretarySpine(temp.secretary, curData.spine);
  19657. let womanIndex = curData.id - 1;
  19658. let getWoman = DataMgr.getSecretary(womanIndex);
  19659. let curUse = DataMgr.getCurSecretary();
  19660. if (getWoman) {
  19661. if (curUse == womanIndex) {
  19662. temp.purchaseBtn.c1.selectedIndex = 1;
  19663. }
  19664. else {
  19665. temp.purchaseBtn.c1.selectedIndex = 2;
  19666. }
  19667. }
  19668. else {
  19669. temp.purchaseBtn.c1.selectedIndex = 0;
  19670. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19671. }
  19672. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19673. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19674. }
  19675. }
  19676. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19677. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19678. if (getWoman) {
  19679. if (curUse != womanIndex) {
  19680. console.log();
  19681. DataMgr.setCurSecretary(womanIndex);
  19682. this.updateData();
  19683. }
  19684. }
  19685. else {
  19686. let need = needDiamond;
  19687. if (DataMgr.diamondEnough(need)) {
  19688. DataMgr.setDiamond(-need);
  19689. DataMgr.setSecretary(womanIndex, 1);
  19690. DataMgr.setCurSecretary(womanIndex);
  19691. this.updateData();
  19692. }
  19693. else {
  19694. xGame.uiMgr.Show(UIAddProp$1, 1);
  19695. }
  19696. }
  19697. }
  19698. closeSelf() {
  19699. this.hide();
  19700. }
  19701. }
  19702. UISecretary$1.uiName = "UISecretary";
  19703. class BallRodDisplay$1 {
  19704. constructor(ui, index) {
  19705. this.index = 0;
  19706. this.uiIndex = 0;
  19707. this.ui = ui;
  19708. this.index = index;
  19709. this.initData();
  19710. }
  19711. initData() {
  19712. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19713. let data = cfgTable.ballrodData[this.index + 1];
  19714. this.ui.nameTxt.text = data.name;
  19715. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19716. this.ui.levelNode.c1.selectedIndex = data.quality;
  19717. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19718. if (data.spine) {
  19719. this.mySpine = new SpineMgr(data.spine, () => {
  19720. let xx = 150;
  19721. let yy = 70;
  19722. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19723. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19724. });
  19725. }
  19726. }
  19727. updateSelf() {
  19728. let get = DataMgr.getBallRod(this.index);
  19729. if (get == null)
  19730. get = 1;
  19731. let curUse = DataMgr.getCurBallRod();
  19732. if (get) {
  19733. if (curUse == this.index) {
  19734. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19735. }
  19736. else {
  19737. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19738. }
  19739. }
  19740. else {
  19741. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19742. }
  19743. }
  19744. buyBallRod() {
  19745. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19746. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19747. switch (selectedIndex) {
  19748. case 0:
  19749. break;
  19750. case 1:
  19751. DataMgr.setCurBallRod(this.index);
  19752. let ui = xGame.uiMgr.getUI(UIShop$1);
  19753. ui.updateBallRod();
  19754. break;
  19755. case 2:
  19756. let data = cfgTable.ballrodData[this.index + 1];
  19757. let need = data.price;
  19758. if (DataMgr.diamondEnough(need)) {
  19759. DataMgr.setDiamond(-need);
  19760. DataMgr.setBallRod(this.index, 1);
  19761. DataMgr.setCurBallRod(this.index);
  19762. let ui = xGame.uiMgr.getUI(UIShop$1);
  19763. ui.updateBallRod();
  19764. }
  19765. else {
  19766. xGame.uiMgr.Show(UIAddProp$1, 1);
  19767. }
  19768. break;
  19769. default:
  19770. break;
  19771. }
  19772. }
  19773. }
  19774. class UIShop$1 extends UIBase {
  19775. constructor() {
  19776. super();
  19777. this.itemNums = 0;
  19778. }
  19779. onConstructor() {
  19780. this.ui = ui_UIShop.createInstance();
  19781. this.contentPane = this.ui;
  19782. this.isEject = false;
  19783. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19784. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19785. this.addUIClick(this.ui, this.interuptSecretary);
  19786. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19787. this.ballRodArr = [];
  19788. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19789. this.ui.myNode.myList.numItems = this.itemNums;
  19790. if (Moyu.isKs)
  19791. this.ui.closeNode.closeBtn.x += 100;
  19792. }
  19793. show() {
  19794. super.show();
  19795. this.playSecretaryIdle();
  19796. this.updateBallRod();
  19797. }
  19798. updateBallRod() {
  19799. for (let index = 0; index < this.ballRodArr.length; index++) {
  19800. this.ballRodArr[index].updateSelf();
  19801. }
  19802. }
  19803. renderBallRod(sort, obj) {
  19804. let index = this.getIndexBySort(sort + 1) - 1;
  19805. let ballRod = new BallRodDisplay$1(obj, index);
  19806. this.ballRodArr.push(ballRod);
  19807. }
  19808. getIndexBySort(sort) {
  19809. let object = cfgTable.ballrodData;
  19810. for (const key in object) {
  19811. if (object[key].sort == sort) {
  19812. return parseInt(key);
  19813. }
  19814. }
  19815. }
  19816. playSecretaryIdle() {
  19817. let parent = this.ui.secretary.displayObject;
  19818. parent.destroyChildren();
  19819. let xx = this.ui.secretary.width / 2;
  19820. let yy = this.ui.secretary.height;
  19821. let scale = xGame.common.getSecretaryScale();
  19822. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19823. xGame.common.secretary.play(data, 1, true, parent);
  19824. }
  19825. interuptSecretary() {
  19826. Laya.timer.clearAll(this);
  19827. this.playSecretaryRandomSound();
  19828. }
  19829. playSecretaryRandomSound() {
  19830. if (this.isHide)
  19831. return;
  19832. let time = xGame.common.randomNum(45000, 60000);
  19833. Laya.timer.once(time, this, () => {
  19834. if (this.isHide)
  19835. return;
  19836. let index = xGame.common.randomNum(4, 7);
  19837. xGame.soundMgr.playSound("s_main0" + index);
  19838. let words = 1;
  19839. switch (index) {
  19840. case 4:
  19841. words = 5;
  19842. break;
  19843. case 5:
  19844. words = 3;
  19845. break;
  19846. case 6:
  19847. words = 6;
  19848. break;
  19849. case 7:
  19850. words = 7;
  19851. break;
  19852. default:
  19853. break;
  19854. }
  19855. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19856. this.playSecretaryRandomSound();
  19857. });
  19858. }
  19859. closeSelf() {
  19860. this.hide();
  19861. }
  19862. }
  19863. UIShop$1.uiName = "UIShop";
  19864. class SignMax$1 {
  19865. constructor(ui) {
  19866. this.ui = ui;
  19867. }
  19868. updateSelf(index, sameDay, curDayIndex) {
  19869. let data = cfgTable.signData[index + 1];
  19870. this.ui.titleTxt.text = data.title;
  19871. let arr1 = data.award[0].split('-');
  19872. let arr2 = data.award[1].split('-');
  19873. let num1 = parseInt(arr1[1]);
  19874. let num2 = parseInt(arr2[1]);
  19875. this.ui.numTxt1.text = num1 + "";
  19876. this.ui.numTxt2.text = num2 + "";
  19877. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19878. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  19879. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  19880. this.ui.numTxt1.visible = false;
  19881. }
  19882. else {
  19883. this.ui.numTxt1.visible = true;
  19884. }
  19885. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  19886. this.ui.numTxt2.visible = false;
  19887. }
  19888. else {
  19889. this.ui.numTxt2.visible = true;
  19890. }
  19891. if (index < curDayIndex) {
  19892. this.ui.c1.selectedIndex = 1;
  19893. }
  19894. else if (index == curDayIndex) {
  19895. if (sameDay) {
  19896. this.ui.c1.selectedIndex = 2;
  19897. }
  19898. else {
  19899. this.ui.c1.selectedIndex = 2;
  19900. }
  19901. }
  19902. else {
  19903. this.ui.c1.selectedIndex = 0;
  19904. }
  19905. }
  19906. }
  19907. class SignNormal$1 {
  19908. constructor(ui) {
  19909. this.ui = ui;
  19910. }
  19911. updateSelf(index, sameDay, curDayIndex) {
  19912. let data = cfgTable.signData[index + 1];
  19913. this.ui.titleTxt.text = data.title;
  19914. let arr = data.award[0].split('-');
  19915. let type = parseInt(arr[0]);
  19916. let num = parseInt(arr[1]);
  19917. this.ui.numTxt.text = num + "";
  19918. if (type > 2) {
  19919. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  19920. this.ui.myIcon.rotation = 0;
  19921. }
  19922. else {
  19923. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  19924. this.ui.myIcon.rotation = 0;
  19925. }
  19926. if (xGame.common.signAwardContainsRod(data.award)) {
  19927. this.ui.numTxt.visible = false;
  19928. }
  19929. else {
  19930. this.ui.numTxt.visible = true;
  19931. }
  19932. if (index < curDayIndex) {
  19933. this.ui.c1.selectedIndex = 1;
  19934. }
  19935. else if (index == curDayIndex) {
  19936. if (sameDay) {
  19937. this.ui.c1.selectedIndex = 2;
  19938. }
  19939. else {
  19940. this.ui.c1.selectedIndex = 2;
  19941. }
  19942. }
  19943. else {
  19944. this.ui.c1.selectedIndex = 0;
  19945. }
  19946. }
  19947. }
  19948. class UISign$1 extends UIBase {
  19949. constructor() {
  19950. super();
  19951. this.curDayIndex = 0;
  19952. this.starX = 0;
  19953. }
  19954. onConstructor() {
  19955. this.ui = ui_UISign.createInstance();
  19956. this.contentPane = this.ui;
  19957. this.isEject = false;
  19958. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19959. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19960. this.initSignItem();
  19961. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  19962. this.addUIClick(this.ui.againBtn, this.againGetAward);
  19963. }
  19964. show() {
  19965. super.show();
  19966. this.ui.t0.play();
  19967. this.playSecretaryIdle();
  19968. this.updateSign();
  19969. }
  19970. initSignItem() {
  19971. this.signArr = [];
  19972. for (let index = 0; index < 6; index++) {
  19973. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  19974. this.signArr.push(temp);
  19975. }
  19976. this.signMax = new SignMax$1(this.ui.myNode.day7);
  19977. if (Moyu.isKs)
  19978. this.ui.closeNode.closeBtn.x += 100;
  19979. }
  19980. updateSign() {
  19981. let sameDay = xGame.common.judgeSameDay();
  19982. let max = 7;
  19983. this.curDayIndex = DataMgr.getSignData();
  19984. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  19985. this.curDayIndex = 0;
  19986. if (!sameDay) {
  19987. this.ui.normalBtn.visible = true;
  19988. this.ui.tipsNode.visible = false;
  19989. this.ui.againBtn.visible = false;
  19990. }
  19991. else {
  19992. this.ui.normalBtn.visible = false;
  19993. let again = DataMgr.getExtraSign();
  19994. let isCurrency = false;
  19995. let index = this.curDayIndex;
  19996. if (index == 0)
  19997. index = 7;
  19998. let award = cfgTable.signData[index].award;
  19999. let num = award[0].split("-")[0];
  20000. if (num == "1" || num == "2")
  20001. isCurrency = true;
  20002. let showAgain = again == 0 && isCurrency;
  20003. this.ui.againBtn.visible = showAgain;
  20004. this.ui.tipsNode.visible = !showAgain;
  20005. }
  20006. for (let index = 0; index < this.signArr.length; index++) {
  20007. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20008. }
  20009. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20010. }
  20011. playSecretaryIdle() {
  20012. let parent = this.ui.secretary.displayObject;
  20013. parent.destroyChildren();
  20014. let xx = this.ui.secretary.width / 2;
  20015. let yy = this.ui.secretary.height;
  20016. let scale = xGame.common.getSecretaryScale();
  20017. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20018. xGame.common.secretary.play(data, 1, true, parent);
  20019. }
  20020. closeSelf() {
  20021. this.hide();
  20022. }
  20023. normalGetAward() {
  20024. let sameDay = xGame.common.judgeSameDay();
  20025. if (!sameDay) {
  20026. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20027. let temp;
  20028. let type;
  20029. let num;
  20030. let arr = [];
  20031. for (let index = 0; index < award.length; index++) {
  20032. temp = award[index].split("-");
  20033. type = parseInt(temp[0]);
  20034. num = parseInt(temp[1]);
  20035. let awardType = new AwardType();
  20036. awardType.num = num;
  20037. awardType.type = type;
  20038. arr.push(awardType);
  20039. }
  20040. xGame.common.getAward(arr, (watchVideo) => {
  20041. this.curDayIndex++;
  20042. if (this.curDayIndex > 7)
  20043. this.curDayIndex = 0;
  20044. DataMgr.setSignData(this.curDayIndex);
  20045. DataMgr.setSignTime(new Date().getTime());
  20046. if (watchVideo) {
  20047. DataMgr.setExtraSign(1);
  20048. Moyu.sendDataEvent("signIn1");
  20049. }
  20050. this.updateSign();
  20051. });
  20052. }
  20053. }
  20054. againGetAward() {
  20055. Moyu.sendDataEvent("signIn2");
  20056. Moyu.showVideoAd(() => {
  20057. let index = this.curDayIndex;
  20058. if (index == 0)
  20059. index = 7;
  20060. let award = cfgTable.signData[index].award;
  20061. let temp;
  20062. let type;
  20063. let num;
  20064. for (let index = 0; index < award.length; index++) {
  20065. temp = award[index].split("-");
  20066. type = parseInt(temp[0]);
  20067. num = parseInt(temp[1]) * 3;
  20068. xGame.common.playObjFlyAnim(num, type);
  20069. }
  20070. DataMgr.setExtraSign(1);
  20071. this.updateSign();
  20072. }, EAdType.againSign);
  20073. }
  20074. }
  20075. UISign$1.uiName = "UISign";
  20076. class UIModeSelection$1 extends UIBase {
  20077. constructor() {
  20078. super();
  20079. }
  20080. onConstructor() {
  20081. this.ui = ui_UIModeSelection.createInstance();
  20082. this.contentPane = this.ui;
  20083. this.isEject = false;
  20084. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20085. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20086. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20087. this.addUIClick(this.ui.closeBtn, this.hide);
  20088. this.peopleArr = [650, 6900, 3800];
  20089. this.peopleOffest = [50, 500, 200];
  20090. this.updateSelf();
  20091. }
  20092. show(callback) {
  20093. super.show();
  20094. this.ui.t0.play();
  20095. this.callback = callback;
  20096. }
  20097. updateSelf() {
  20098. let cfg = cfgTable.modeselectData;
  20099. for (let index = 1; index <= 3; index++) {
  20100. let node = this.ui.myNode["type" + index];
  20101. node.need.text = cfg[index].need;
  20102. node.tipsTxt.text = `最低${cfg[index].need}可入场`;
  20103. node.peopleTxt.text = this.getRandPeople(index - 1);
  20104. }
  20105. }
  20106. enterGame(type) {
  20107. xGame.common.classicRoomType = type;
  20108. let cfg = cfgTable.modeselectData[type];
  20109. let need = cfg.need;
  20110. xGame.common.passAwardCoin = cfg.award;
  20111. if (DataMgr.coinEnough(need)) {
  20112. DataMgr.setCoin(-need);
  20113. this.ui.myNode["type" + type].t0.play();
  20114. Laya.timer.once(200, this, () => {
  20115. this.callback && this.callback();
  20116. });
  20117. }
  20118. else {
  20119. Moyu.sendDataEvent("AddCoinVideo");
  20120. xGame.uiMgr.Show(UIAddProp$1, 0);
  20121. }
  20122. }
  20123. getRandPeople(index) {
  20124. let rand = this.peopleOffest[index];
  20125. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20126. }
  20127. }
  20128. UIModeSelection$1.uiName = "UIModeSelection";
  20129. class UIMain$1 extends UIBase {
  20130. constructor() {
  20131. super();
  20132. this.firstEnter = true;
  20133. }
  20134. onConstructor() {
  20135. this.ui = ui_UIMain.createInstance();
  20136. this.contentPane = this.ui;
  20137. this.isEject = false;
  20138. this.addEvent();
  20139. this.addClickSpine();
  20140. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20141. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20142. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20143. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20144. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20145. let curUse = DataMgr.getCurSecretary();
  20146. this.changeSecretary(curUse);
  20147. this.ui.talkNode.visible = false;
  20148. let guide = DataMgr.getSkillGuide();
  20149. if (xGame.common.isNewDay && guide == 1) {
  20150. xGame.common.isNewDay = false;
  20151. xGame.soundMgr.playSound("s_main01");
  20152. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20153. console.log("播放小秘书每天语音");
  20154. }
  20155. this.onGetUserInfo();
  20156. this.ui.n83.visible = false;
  20157. Moyu.setShareInfo("万宁台球", ["台球", "万宁", "桌球"], '2300002254');
  20158. }
  20159. changeSecretary(curUse) {
  20160. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20161. xGame.common.secretary && xGame.common.secretary.dispose();
  20162. this.addSecretarySpine(name);
  20163. }
  20164. addSecretarySpine(name) {
  20165. let spine = new SpineMgr(name, () => {
  20166. this.playSecretaryIdle();
  20167. });
  20168. xGame.common.secretary = spine;
  20169. }
  20170. addClickSpine() {
  20171. let clickSpine = new SpineMgr("dianji", () => {
  20172. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20173. let parent = Laya.stage;
  20174. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20175. clickSpine.play(data, 0, false, parent, (spine) => {
  20176. spine.destroy(true);
  20177. });
  20178. });
  20179. });
  20180. }
  20181. addEvent() {
  20182. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20183. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20184. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20185. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20186. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20187. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20188. this.addUIClick(this.ui, this.interuptSecretary);
  20189. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20190. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20191. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20192. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20193. this.addUIClick(this.ui.signBtn, this.openSignView);
  20194. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20195. this.addUIClick(this.ui.rankBtn, this.openRanking);
  20196. }
  20197. show(showFailWords) {
  20198. super.show();
  20199. this.moneyNode.ui.c1.selectedIndex = 1;
  20200. this.playSecretaryIdle();
  20201. xGame.soundMgr.playMusic("caromhall01");
  20202. Laya.timer.clearAll(this);
  20203. this.playSecretaryRandomSound();
  20204. if (showFailWords) {
  20205. setTimeout(() => {
  20206. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20207. let words = -1;
  20208. if (str == "s_main02") {
  20209. words = 2;
  20210. }
  20211. else {
  20212. words = 3;
  20213. }
  20214. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20215. xGame.soundMgr.playSound(str);
  20216. }, 300);
  20217. }
  20218. this.showGuide();
  20219. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20220. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20221. let guide = DataMgr.getSkillGuide();
  20222. if (guide == 1) {
  20223. let randTime = xGame.common.randomNum(300, 800);
  20224. if (this.firstEnter) {
  20225. this.firstEnter = false;
  20226. randTime += 900;
  20227. }
  20228. Laya.timer.once(randTime, this, () => {
  20229. xGame.common.autoPopUIView();
  20230. });
  20231. }
  20232. }
  20233. checkActive(show) {
  20234. }
  20235. showGuide() {
  20236. let guide = DataMgr.getSkillGuide();
  20237. this.ui.guideBtn.visible = guide == 0;
  20238. this.ui.enterGuide.visible = false;
  20239. this.ui.secretaryGuide.visible = guide == 0;
  20240. if (guide == 0) {
  20241. xGame.soundMgr.playSound("s_guide");
  20242. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20243. }
  20244. }
  20245. ensureSecretary() {
  20246. this.ui.secretaryGuide.visible = false;
  20247. this.ui.enterGuide.visible = true;
  20248. this.ui.wordsNode.t0.play();
  20249. if (DataMgr.getNewUser())
  20250. Moyu.sendDataEvent("gameReady");
  20251. }
  20252. playSecretaryIdle() {
  20253. let parent = this.ui.secretary.displayObject;
  20254. parent.destroyChildren();
  20255. let xx = this.ui.secretary.width / 2;
  20256. let yy = this.ui.secretary.height;
  20257. let scale = xGame.common.getSecretaryScale();
  20258. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20259. xGame.common.secretary.play(data, 1, true, parent);
  20260. }
  20261. startGame(type) {
  20262. xGame.common.gameMode = type;
  20263. Moyu.sendDataEvent("PlayGame", { type: type });
  20264. switch (xGame.common.gameMode) {
  20265. case GameMode.classic:
  20266. let challengeTimes = DataMgr.getChallengeTimes();
  20267. if (challengeTimes == 0) {
  20268. xGame.uiMgr.Show(UIInvitation$1);
  20269. }
  20270. else {
  20271. this.beginGame();
  20272. }
  20273. break;
  20274. case GameMode.bigMove:
  20275. this.beginGame();
  20276. if (DataMgr.getNewUser())
  20277. Moyu.sendDataEvent("gameStart0");
  20278. break;
  20279. default:
  20280. break;
  20281. }
  20282. }
  20283. beginGame(isNice = false) {
  20284. if (xGame.common.gameMode == GameMode.classic) {
  20285. if (isNice) {
  20286. this.enterClassic();
  20287. }
  20288. else {
  20289. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20290. this.enterClassic();
  20291. });
  20292. }
  20293. }
  20294. else if (xGame.common.gameMode == GameMode.bigMove) {
  20295. this.ui.enterGuide.visible = false;
  20296. xGame.uiMgr.Show(UISkill$1);
  20297. }
  20298. }
  20299. enterClassic() {
  20300. xGame.uiMgr.Show(UIGame$1);
  20301. xGame.uiMgr.Show(UIMatching$1, () => {
  20302. if (!this.isHide)
  20303. this.hide();
  20304. xGame.common.gameUI.ui.alpha = 1;
  20305. xGame.common.gameUI.startGame();
  20306. xGame.uiMgr.Hide(UIGameEnd$1);
  20307. });
  20308. }
  20309. startGlobal() {
  20310. xGame.uiMgr.Show(UIMsg$1, "敬请期待~");
  20311. }
  20312. startWeekly() {
  20313. xGame.uiMgr.Show(UIMsg$1, "敬请期待~");
  20314. }
  20315. startPlaceBall() {
  20316. xGame.uiMgr.Show(UILevelDisplay$1);
  20317. }
  20318. hide() {
  20319. super.hide();
  20320. xGame.common.stopGirlPop(this.ui.talkNode);
  20321. }
  20322. onGetUserInfo(force = false) {
  20323. if (Moyu.isWx) {
  20324. let info = Moyu.getSystemInfo();
  20325. if (info)
  20326. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20327. }
  20328. else {
  20329. Moyu.initUser(this, this.freshUser, force);
  20330. }
  20331. if (!Moyu.hasUserInfo) {
  20332. let user = Moyu.getUserInfo();
  20333. user.headIcon = 'res/ty_touxiang.png';
  20334. }
  20335. this.freshUser();
  20336. }
  20337. freshUser() {
  20338. let user = Moyu.getUserInfo();
  20339. if (!user.isAuth) {
  20340. user.headIcon = 'res/ty_touxiang.png';
  20341. }
  20342. else
  20343. DataMgr.upRankData();
  20344. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20345. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20346. }
  20347. interuptSecretary() {
  20348. Laya.timer.clearAll(this);
  20349. this.playSecretaryRandomSound();
  20350. }
  20351. playSecretaryRandomSound() {
  20352. if (this.isHide)
  20353. return;
  20354. let time = xGame.common.randomNum(45000, 60000);
  20355. Laya.timer.once(time, this, () => {
  20356. if (this.isHide)
  20357. return;
  20358. let index = xGame.common.randomNum(4, 7);
  20359. xGame.soundMgr.playSound("s_main0" + index);
  20360. let words = 1;
  20361. switch (index) {
  20362. case 4:
  20363. words = 5;
  20364. break;
  20365. case 5:
  20366. words = 3;
  20367. break;
  20368. case 6:
  20369. words = 6;
  20370. break;
  20371. case 7:
  20372. words = 7;
  20373. break;
  20374. default:
  20375. break;
  20376. }
  20377. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20378. this.playSecretaryRandomSound();
  20379. });
  20380. }
  20381. openSecretaryView() {
  20382. xGame.uiMgr.Show(UISecretary$1);
  20383. Moyu.sendDataEvent("secretary");
  20384. }
  20385. openShopView() {
  20386. xGame.uiMgr.Show(UIShop$1);
  20387. }
  20388. openSignView() {
  20389. xGame.uiMgr.Show(UISign$1);
  20390. }
  20391. openDrawView() {
  20392. xGame.uiMgr.Show(UIDraw$1);
  20393. }
  20394. openRanking() {
  20395. xGame.uiMgr.Show(UIRanking$1);
  20396. Moyu.sendDataEvent("rankingList");
  20397. }
  20398. }
  20399. UIMain$1.uiName = "UIMain";
  20400. function InitShader() {
  20401. }
  20402. function appInit() {
  20403. xGame.context.init(getLoadingResList(), initCallback);
  20404. }
  20405. function getLoadingResList() {
  20406. return [
  20407. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20408. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20409. ];
  20410. }
  20411. function getGameResList() {
  20412. return [
  20413. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20414. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20415. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20416. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20417. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20418. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20419. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20420. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20421. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20422. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20423. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20424. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20425. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20426. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20427. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20428. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20429. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20430. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20431. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20432. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20433. ];
  20434. }
  20435. function initCallback() {
  20436. window["DataMgr"] = DataMgr;
  20437. DataMgr.Init();
  20438. Moyu.init(getPlat(), this, () => {
  20439. DataMgr.isNewDay();
  20440. PlatMgr.initConfig();
  20441. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20442. }, true);
  20443. console.log('zh:开始sm init1 start');
  20444. xGame.soundMgr.init();
  20445. console.log('zh:开始sm init1 end');
  20446. xGame.uiMgr.init();
  20447. xGame.uiMgr.bindFUI(fguiRes.loading);
  20448. xGame.uiMgr.Show(UILoading);
  20449. }
  20450. function loadSubRes(callback) {
  20451. var tab = ["asset", "res", "spine"];
  20452. let subDone = 0;
  20453. for (var i = 0; i < tab.length; i++) {
  20454. let sub = tab[i];
  20455. Moyu.loadSubRes(sub, (pro) => {
  20456. callback && callback(pro, false);
  20457. }).then(() => {
  20458. subDone++;
  20459. if (subDone >= tab.length)
  20460. callback && callback(1, true);
  20461. });
  20462. }
  20463. }
  20464. function enterGame() {
  20465. xGame.cfgMgr.init();
  20466. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20467. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20468. xGame.uiMgr.Hide(UILoading);
  20469. fgui.UIPackage.removePackage(fguiRes.loading);
  20470. xGame.uiMgr.bindFUI(fguiRes.game);
  20471. xGame.uiMgr.Show(UIMain$1);
  20472. if (DataMgr.getNewUser())
  20473. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20474. }
  20475. function getPlat() {
  20476. let cfg = new MoyuCfg();
  20477. cfg.plat = MoyuPlat.web;
  20478. cfg.myId = 120;
  20479. cfg.myKey = '8848a885774230a4';
  20480. cfg.version = 0;
  20481. if (window.hasOwnProperty("gamebox")) {
  20482. cfg.plat = MoyuPlat.f399;
  20483. cfg.version = 0;
  20484. }
  20485. else if (window.hasOwnProperty("ks")) {
  20486. cfg.plat = MoyuPlat.ks;
  20487. cfg.version = 0;
  20488. cfg.ads.ksVideoId = '2300002254_01';
  20489. cfg.ads.ksInsertId = '2300002254_02';
  20490. }
  20491. else if (Laya.Browser.onTTMiniGame) {
  20492. cfg.plat = MoyuPlat.tt;
  20493. cfg.version = 0;
  20494. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20495. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20496. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20497. }
  20498. else if (Laya.Browser.onMiniGame) {
  20499. cfg.plat = MoyuPlat.wx;
  20500. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20501. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20502. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20503. }
  20504. else if (Laya.Browser.onQQMiniGame) {
  20505. cfg.plat = MoyuPlat.qq;
  20506. }
  20507. else if (Laya.Browser.onQGMiniGame) {
  20508. cfg.plat = MoyuPlat.op;
  20509. cfg.ads.opVideoId = '455502';
  20510. cfg.ads.opBannerId = '455507';
  20511. }
  20512. else if (Laya.Browser.onVVMiniGame) {
  20513. cfg.plat = MoyuPlat.vv;
  20514. cfg.version = 0;
  20515. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20516. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20517. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20518. }
  20519. else if (Laya.Browser.onHWMiniGame) {
  20520. cfg.plat = MoyuPlat.hw;
  20521. }
  20522. else if (window["mz"]) {
  20523. cfg.plat = MoyuPlat.mz;
  20524. }
  20525. else {
  20526. let cfg = window['conchConfig'];
  20527. if (cfg) {
  20528. var os = cfg.getOS();
  20529. if (os == "Conch-ios") {
  20530. cfg.plat = MoyuPlat.ios;
  20531. }
  20532. else if (os == "Conch-android") {
  20533. }
  20534. }
  20535. }
  20536. return cfg;
  20537. }
  20538. class Main {
  20539. constructor() {
  20540. if (window["Laya3D"])
  20541. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20542. else {
  20543. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20544. this.initMain();
  20545. }
  20546. }
  20547. initMain() {
  20548. Laya["Physics"] && Laya["Physics"].enable();
  20549. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20550. Laya.stage.scaleMode = GameConfig.scaleMode;
  20551. Laya.stage.screenMode = GameConfig.screenMode;
  20552. Laya.stage.alignV = GameConfig.alignV;
  20553. Laya.stage.alignH = GameConfig.alignH;
  20554. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20555. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20556. Laya.enableDebugPanel();
  20557. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20558. Laya["PhysicsDebugDraw"].enable();
  20559. if (GameConfig.stat)
  20560. Laya.Stat.show();
  20561. Laya.alertGlobalError(true);
  20562. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20563. }
  20564. onVersionLoaded() {
  20565. appInit();
  20566. }
  20567. }
  20568. new Main();
  20569. }());
  20570. //# sourceMappingURL=bundle.js.map