bundle.js 804 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class UIBox extends UIBase {
  1062. constructor() {
  1063. super();
  1064. this.boxNum = 0;
  1065. this.boxMax = 10;
  1066. this.inAd = false;
  1067. this.isClose = false;
  1068. }
  1069. onConstructor() {
  1070. this.ui = ui_UIBox.createInstance();
  1071. this.contentPane = this.ui;
  1072. this.isEject = false;
  1073. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1074. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1075. Laya.timer.loop(1000, this, this.update);
  1076. }
  1077. update() {
  1078. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1079. this.boxNum -= 1;
  1080. this.upBar();
  1081. }
  1082. }
  1083. upBar() {
  1084. if (this.boxNum > this.boxMax)
  1085. this.boxNum = this.boxMax;
  1086. this.ui.bar.value = this.boxNum * 10;
  1087. }
  1088. show() {
  1089. super.show();
  1090. this.isClose = false;
  1091. this.boxNum = 0;
  1092. this.inAd = false;
  1093. this.upBar();
  1094. this.ui.t0.play();
  1095. this.ui.closeBtn.visible = false;
  1096. Laya.timer.once(3000, this, () => {
  1097. this.ui.closeBtn.visible = true;
  1098. this.ui.bar.alpha = 1;
  1099. });
  1100. Laya.timer.once(500, this, () => {
  1101. this.ui.t1.play();
  1102. });
  1103. }
  1104. hide() {
  1105. Laya.timer.clearAll(this);
  1106. Moyu.showBannerAd(false);
  1107. super.hide();
  1108. }
  1109. onOpenBox() {
  1110. this.boxNum++;
  1111. if (this.boxNum < this.boxMax) {
  1112. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1113. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1114. }
  1115. else if (this.boxNum == this.boxMax) {
  1116. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1117. this.ui.openBtn.c1.selectedIndex = 13;
  1118. this.inAd = true;
  1119. }
  1120. else
  1121. this.getAward();
  1122. }
  1123. else if (this.inAd) {
  1124. Moyu.showVideoAd(() => {
  1125. this.getAward();
  1126. }, EAdType.box);
  1127. }
  1128. this.upBar();
  1129. }
  1130. onCloseBox() {
  1131. if (this.isClose)
  1132. this.hide();
  1133. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1134. this.isClose = true;
  1135. PlatMgr.showBanner(true, 0, 3000);
  1136. }
  1137. else
  1138. this.hide();
  1139. }
  1140. getAward() {
  1141. let str = "";
  1142. if (Math.random() < 0.5) {
  1143. let max = Moyu.isLegal ? 500 : 2500;
  1144. let num = xGame.tools.random(max, 500 + max);
  1145. DataMgr.setCoin(num);
  1146. str = "金币x" + num;
  1147. }
  1148. else {
  1149. let max = Moyu.isLegal ? 10 : 30;
  1150. let num = xGame.tools.random(max, 30 + max);
  1151. DataMgr.setDiamond(num);
  1152. str = "钻石x" + num;
  1153. }
  1154. xGame.showTip("恭喜获得-" + str);
  1155. this.hide();
  1156. }
  1157. }
  1158. UIBox.uiName = "UIBox";
  1159. class ui_UITry extends fgui.GComponent {
  1160. static createInstance() {
  1161. return (fgui.UIPackage.createObject("game", "UITry"));
  1162. }
  1163. onConstruct() {
  1164. this.n11 = (this.getChild("n11"));
  1165. this.myNode = (this.getChild("myNode"));
  1166. this.t0 = this.getTransition("t0");
  1167. }
  1168. }
  1169. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1170. class UITry extends UIBase {
  1171. constructor() {
  1172. super();
  1173. this.closeTime = 0;
  1174. this.closeNum = 0;
  1175. this.skillUrl = xGame.common.skillIconList;
  1176. }
  1177. onConstructor() {
  1178. this.ui = ui_UITry.createInstance();
  1179. this.contentPane = this.ui;
  1180. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1181. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1182. }
  1183. show() {
  1184. super.show();
  1185. this.closeNum = 0;
  1186. this.closeTime = 15;
  1187. this.ui.t0.play();
  1188. PlatMgr.showRateBanner();
  1189. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1190. Laya.timer.loop(1000, this, this.updateTime);
  1191. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1192. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1193. xGame.common.gameMgr.gamePause = true;
  1194. }
  1195. updateTime() {
  1196. if (this.closeTime > 1) {
  1197. this.closeTime--;
  1198. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1199. }
  1200. else
  1201. this.hide();
  1202. }
  1203. hide() {
  1204. Laya.timer.clearAll(this);
  1205. Moyu.showBannerAd(false);
  1206. super.hide();
  1207. xGame.common.gameMgr.gamePause = false;
  1208. }
  1209. onTry() {
  1210. Moyu.showVideoAd(() => {
  1211. let select = xGame.common.curPlayerSkillType;
  1212. DataMgr.gameData.trySkill = select;
  1213. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1214. DataMgr.saveGameData();
  1215. DataMgr.setBigSkill(select, 1);
  1216. xGame.showTip("Trial Successful");
  1217. this.hide();
  1218. }, EAdType.try);
  1219. }
  1220. onCancel() {
  1221. if (this.closeNum > 0) {
  1222. this.closeNum--;
  1223. if (this.closeNum < 2)
  1224. this.hide();
  1225. return;
  1226. }
  1227. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1228. this.onTry();
  1229. }
  1230. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1231. this.closeNum = 3;
  1232. }
  1233. else
  1234. this.hide();
  1235. }
  1236. }
  1237. UITry.uiName = "UITry";
  1238. class PlatMgr {
  1239. static initConfig() {
  1240. this.lastVt = 0;
  1241. if (!Moyu.platConfig)
  1242. return;
  1243. for (let k in Moyu.platConfig) {
  1244. let pd = this[k];
  1245. let pc = Moyu.platConfig[k];
  1246. if (pd != undefined && pc != undefined)
  1247. this[k] = pc;
  1248. }
  1249. Moyu.setBannerPos(0.5, 1);
  1250. }
  1251. static rand100(num) {
  1252. return xGame.tools.random(0, 100) < num;
  1253. }
  1254. static isMisVideo() {
  1255. let dt = Laya.timer.currTimer - this.lastVt;
  1256. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1257. this.lastVt = Laya.timer.currTimer;
  1258. return true;
  1259. }
  1260. else {
  1261. if (this.rand100(this.fullVideoRate))
  1262. Moyu.showInsertAd(0, 0, 'full');
  1263. return false;
  1264. }
  1265. }
  1266. static showVideo(call, type) {
  1267. Moyu.showVideoAd(() => {
  1268. this.lastVt = Laya.timer.currTimer;
  1269. call && call();
  1270. }, type);
  1271. }
  1272. static showInsert(delay = false) {
  1273. if (this.getRand() < this.insertRate) {
  1274. let dt = delay ? this.insertDelay : 0;
  1275. Moyu.showInsertAd(dt, this.insertGap);
  1276. }
  1277. }
  1278. static gameInsert() {
  1279. if (this.getRand() < this.gameInsertRate) {
  1280. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1281. }
  1282. }
  1283. static showRateBanner() {
  1284. if (this.getRand() < this.bannerRate)
  1285. this.showBanner(true, this.bannerDelay, 3000);
  1286. }
  1287. static showBanner(show, delay = 0, hide = 0) {
  1288. if (!show)
  1289. Moyu.showBannerAd(false);
  1290. else {
  1291. Laya.timer.clear(this, this.bannerShow);
  1292. if (delay > 0)
  1293. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1294. else
  1295. this.bannerShow(true);
  1296. if (hide > 0)
  1297. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1298. }
  1299. }
  1300. static bannerShow(show) {
  1301. Moyu.showBannerAd(show);
  1302. console.log("showBanner" + show);
  1303. }
  1304. static getRand() {
  1305. return xGame.tools.random(0, 100);
  1306. }
  1307. static openBox() {
  1308. if (this.getRand() < this.boxRate)
  1309. xGame.uiMgr.Show(UIBox);
  1310. }
  1311. static openTry() {
  1312. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1313. return;
  1314. if (this.getRand() < this.tryRate)
  1315. xGame.uiMgr.Show(UITry);
  1316. else if (DataMgr.gameData.gameCount == 1)
  1317. xGame.uiMgr.Show(UITry);
  1318. }
  1319. }
  1320. PlatMgr.forceShare = 0;
  1321. PlatMgr.signAdRate = 0;
  1322. PlatMgr.forceVideoRate = 0;
  1323. PlatMgr.forceVideoGap = 0;
  1324. PlatMgr.fullVideoRate = 0;
  1325. PlatMgr.gameInsertRate = 0;
  1326. PlatMgr.insertGap = 0;
  1327. PlatMgr.insertDelay = 0;
  1328. PlatMgr.insertRate = 0;
  1329. PlatMgr.boxRate = 0;
  1330. PlatMgr.boxVideoRate = 0;
  1331. PlatMgr.boxInsertRate = 0;
  1332. PlatMgr.boxBannerRate = 0;
  1333. PlatMgr.tryRate = 0;
  1334. PlatMgr.tryClose3Rate = 0;
  1335. PlatMgr.tryVideoRate = 0;
  1336. PlatMgr.bannerRate = 0;
  1337. PlatMgr.lastVt = 0;
  1338. class ui_UIAddProp extends fgui.GComponent {
  1339. static createInstance() {
  1340. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1341. }
  1342. onConstruct() {
  1343. this.n11 = (this.getChild("n11"));
  1344. this.myNode = (this.getChild("myNode"));
  1345. this.closeBtn = (this.getChild("closeBtn"));
  1346. this.t0 = this.getTransition("t0");
  1347. }
  1348. }
  1349. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1350. class SpineMgr {
  1351. constructor(name, loadCb = null) {
  1352. this.loaded = false;
  1353. this.spineName = '';
  1354. this.loadedCallback = loadCb;
  1355. this.templet = new Laya.Templet();
  1356. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1357. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1358. if (name === 'mishu') {
  1359. this.templet.loadAni('spine/nvmishu.sk');
  1360. }
  1361. else {
  1362. this.templet.loadAni(`spine/${name}.sk`);
  1363. }
  1364. this.templet.lock = true;
  1365. this.spineName = name;
  1366. }
  1367. onError() {
  1368. console.log("zh:spine加载出错");
  1369. }
  1370. parseComplete() {
  1371. this.loaded = true;
  1372. this.loadedCallback && this.loadedCallback();
  1373. }
  1374. dispose() {
  1375. if (this.templet && !this.templet.destroyed) {
  1376. this.templet.destroy();
  1377. }
  1378. this.templet = null;
  1379. }
  1380. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1381. if (!this.loaded) {
  1382. return;
  1383. }
  1384. let spine;
  1385. if (mySpine) {
  1386. spine = mySpine;
  1387. }
  1388. else {
  1389. spine = this.createSpine(data, parent);
  1390. }
  1391. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1392. if (!isLoop) {
  1393. spine.on(Laya.Event.STOPPED, this, () => {
  1394. spine.offAll(Laya.Event.STOPPED);
  1395. callback && callback(spine);
  1396. });
  1397. }
  1398. return spine;
  1399. }
  1400. createSpine(data, parent, type = 1) {
  1401. let spine;
  1402. spine = this.templet.buildArmature(type);
  1403. spine.showSkinByIndex(0);
  1404. parent.addChild(spine);
  1405. spine.pos(data.x, data.y);
  1406. spine.scale(data.scaleX, data.scaleY, true);
  1407. return spine;
  1408. }
  1409. }
  1410. var AIState;
  1411. (function (AIState) {
  1412. AIState[AIState["none"] = 0] = "none";
  1413. AIState[AIState["idle"] = 1] = "idle";
  1414. AIState[AIState["reset"] = 2] = "reset";
  1415. AIState[AIState["move"] = 3] = "move";
  1416. AIState[AIState["wait"] = 4] = "wait";
  1417. AIState[AIState["select"] = 5] = "select";
  1418. AIState[AIState["turn"] = 6] = "turn";
  1419. AIState[AIState["shoot"] = 7] = "shoot";
  1420. AIState[AIState["leave"] = 8] = "leave";
  1421. })(AIState || (AIState = {}));
  1422. class AIPlayer {
  1423. constructor() {
  1424. this.dtime = 30;
  1425. this.awayTime = 0;
  1426. this.awayNum = 0;
  1427. this.hideTime = 0;
  1428. this.rootMoveTime = 0;
  1429. this.isGuide = false;
  1430. this.state = AIState.none;
  1431. this.waitTime = 0;
  1432. this.forceNum = 0;
  1433. this.forceMax = 0;
  1434. this.ballSize = 33;
  1435. this.selectNum = 0;
  1436. this.destRot = 0;
  1437. this.aiLv = 10;
  1438. this.kickBall = [];
  1439. this.lineBall = [];
  1440. this.scoreBall = [];
  1441. this.holeBall = [];
  1442. this.turnNum = 0;
  1443. this.setNum = 0;
  1444. this.setMax = 0;
  1445. this.setRate = 0;
  1446. this.rectL = 0;
  1447. this.rectR = 0;
  1448. this.rectT = 0;
  1449. this.rectB = 0;
  1450. this.rootPos = { x: 0, y: 0 };
  1451. this.bestForce = 0;
  1452. this.bestAngle = 180;
  1453. this.bestPos = { x: 0, y: 0 };
  1454. this.bestKick = { x: 0, y: 0 };
  1455. this.posList = [];
  1456. this.posIdx = 0;
  1457. this.chatTime = 3000;
  1458. this.tempDir1 = new Laya.Vector2();
  1459. this.tempDir2 = new Laya.Vector2();
  1460. this.tempDir3 = new Laya.Vector2();
  1461. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1462. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1463. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1464. this.gameSrc = xGame.common.gameUI;
  1465. this.hideTime = Laya.timer.currTimer;
  1466. Moyu.setOnTipCall((id) => {
  1467. if (id == 20012)
  1468. this.hideTime = Laya.timer.currTimer;
  1469. else
  1470. (id == 20011);
  1471. {
  1472. let dt = Laya.timer.currTimer - this.hideTime;
  1473. console.log("onshow" + dt);
  1474. if (dt > 30000 && this.state > AIState.none)
  1475. xGame.common.gameMgr.aiGameEnd(false);
  1476. }
  1477. }, this);
  1478. }
  1479. init() {
  1480. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1481. this.awayTime = xGame.tools.random(5000, 10000);
  1482. this.awayNum = 0;
  1483. this.hideTime = Laya.timer.currTimer;
  1484. let rect = xGame.common.d2World.borderRect;
  1485. this.rectL = Math.ceil(rect.x) + 17;
  1486. this.rectT = Math.ceil(rect.y) + 17;
  1487. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1488. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1489. this.wBall = xGame.common.d2World.rootBall;
  1490. this.ballSize = this.wBall.gameObj.width - 1;
  1491. if (this.posList.length < 1) {
  1492. let dp = 40;
  1493. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1494. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1495. let dx = i < this.rectR ? i : this.rectR;
  1496. let dy = j < this.rectB ? j : this.rectB;
  1497. let order = xGame.tools.random(0, 1000);
  1498. this.posList.push({ x: dx, y: dy, order: order });
  1499. }
  1500. }
  1501. this.posList.sort(function (a, b) {
  1502. return a.order - b.order;
  1503. });
  1504. this.setMax = this.posList.length;
  1505. }
  1506. this.state = AIState.idle;
  1507. }
  1508. setAiLevel(num) {
  1509. this.aiLv = num;
  1510. }
  1511. initBall() {
  1512. this.rootPos.x = this.wBall.gameObj.x;
  1513. this.rootPos.y = this.wBall.gameObj.y;
  1514. this.initHoleBall();
  1515. }
  1516. initHoleBall() {
  1517. this.kickBall = [];
  1518. this.lineBall = [];
  1519. this.scoreBall = [];
  1520. this.holeBall = [];
  1521. this.selectNum = 0;
  1522. this.forceNum = 0;
  1523. this.forceMax = 0;
  1524. this.turnNum = 0;
  1525. let list = xGame.common.d2World.ballArr;
  1526. if (list.length < 20 && !this.isGuide) {
  1527. let holes = xGame.common.gameMgr.holePosList;
  1528. for (let i = 0; i < list.length; i++) {
  1529. let obj = list[i];
  1530. if (!obj)
  1531. continue;
  1532. obj.kickPos.x = 0;
  1533. obj.kickPos.y = 0;
  1534. obj.poleAngle = 0;
  1535. obj.hard = 0;
  1536. obj.borderDis = 0;
  1537. obj.kickAngle = 180;
  1538. if (obj.number == 0)
  1539. continue;
  1540. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1541. continue;
  1542. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1543. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1544. continue;
  1545. }
  1546. let b = obj.gameObj;
  1547. let wbp = this.rootPos;
  1548. let bx = wbp.x - b.x;
  1549. let by = wbp.y - b.y;
  1550. obj.borderDis = xGame.tools.random(0, 100);
  1551. this.kickBall.push(obj);
  1552. if (!this.isLine(wbp, obj))
  1553. continue;
  1554. obj.kickAngle = xGame.tools.random(90, 180);
  1555. obj.kickPos.x = b.x;
  1556. obj.kickPos.y = b.y;
  1557. this.lineBall.push(obj);
  1558. let minDis = 999999;
  1559. let hole = false;
  1560. for (let j = 0; j < holes.length; j++) {
  1561. let hp = holes[j];
  1562. if (bx >= 0 && hp.x > b.x + 100)
  1563. continue;
  1564. if (bx <= 0 && hp.x < b.x - 100)
  1565. continue;
  1566. if (by < -10 && hp.y < wbp.y)
  1567. continue;
  1568. if (by > 10 && hp.y > wbp.y)
  1569. continue;
  1570. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1571. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1572. if (dis < minDis) {
  1573. let dx = b.x - this.tempDir1.x * this.ballSize;
  1574. let dy = b.y - this.tempDir1.y * this.ballSize;
  1575. this.tempDir3.x = this.tempDir1.x;
  1576. this.tempDir3.y = this.tempDir1.y;
  1577. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1578. obj.kickPos.x = dx;
  1579. obj.kickPos.y = dy;
  1580. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1581. if (num > 1)
  1582. num = 1;
  1583. obj.kickAngle = Math.acos(num) * 57.3;
  1584. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1585. dis = dis * 2;
  1586. if (Math.abs(hp.x - 600) < 100)
  1587. dis += 50;
  1588. obj.hard = dis + obj.kickAngle * 3;
  1589. hole = true;
  1590. }
  1591. }
  1592. }
  1593. }
  1594. if (hole) {
  1595. this.scoreBall.push(obj);
  1596. this.holeBall.push(obj);
  1597. }
  1598. }
  1599. this.scoreBall.sort(function (a, b) {
  1600. return a.hard - b.hard;
  1601. });
  1602. this.holeBall.sort(function (a, b) {
  1603. return a.kickAngle - b.kickAngle;
  1604. });
  1605. this.kickBall.sort(function (a, b) {
  1606. return a.borderDis - b.borderDis;
  1607. });
  1608. }
  1609. else {
  1610. let max = list.length - 1;
  1611. let i = xGame.tools.random(0, max);
  1612. for (i; i <= max; i++) {
  1613. let idx = i >= max ? i -= max : i;
  1614. let obj = list[idx];
  1615. if (obj && obj.number != 0) {
  1616. obj.kickAngle = xGame.tools.random(90, 180);
  1617. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1618. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1619. this.lineBall.push(obj);
  1620. break;
  1621. }
  1622. }
  1623. }
  1624. }
  1625. selectBall() {
  1626. let ball = null;
  1627. this.destRot = 0;
  1628. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1629. let ai = 110 - this.aiLv * 10;
  1630. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1631. let score = false;
  1632. if (this.scoreBall.length < 1) {
  1633. if (this.lineBall.length < 1) {
  1634. for (let i = 0; i < this.kickBall.length; i++) {
  1635. let list = [];
  1636. let bo = this.kickBall[i];
  1637. let bobj = bo.gameObj;
  1638. let rect = xGame.common.d2World.borderRect;
  1639. let mobj = this.wBall.gameObj;
  1640. let minb = bobj.y - rect.y - 20;
  1641. let minw = mobj.y - rect.y - 50;
  1642. if (minb > 0 && minw > 0) {
  1643. let dlenx = 0;
  1644. let dleny = mobj.y - rect.y;
  1645. let spx = mobj.x;
  1646. let spy = rect.y - dleny;
  1647. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1648. }
  1649. minb = rect.y + rect.height - bobj.y - 20;
  1650. minw = rect.y + rect.height - mobj.y - 50;
  1651. if (minb > 0 && minw > 0) {
  1652. let dlenx = 0;
  1653. let dleny = rect.y + rect.height - mobj.y;
  1654. let spx = mobj.x;
  1655. let spy = rect.y + rect.height + dleny;
  1656. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1657. }
  1658. minb = bobj.x - rect.x - 20;
  1659. minw = mobj.x - rect.x - 50;
  1660. if (minb > 0 && minw > 0) {
  1661. let dlenx = mobj.x - rect.x;
  1662. let dleny = 0;
  1663. let spx = rect.x - dlenx;
  1664. let spy = mobj.y;
  1665. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1666. }
  1667. minb = rect.x + rect.width - bobj.x - 20;
  1668. minw = rect.x + rect.width - mobj.x - 50;
  1669. if (minb > 0 && minw > 0) {
  1670. let dlenx = rect.x + rect.width - mobj.x;
  1671. let dleny = 0;
  1672. let spx = rect.x + rect.width + dlenx;
  1673. let spy = mobj.y;
  1674. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1675. }
  1676. list.sort(function (a, b) {
  1677. return a.order - b.order;
  1678. });
  1679. for (let i = 0; i < list.length; i++) {
  1680. let data = list[i];
  1681. let mx = mobj.x - bobj.x;
  1682. let my = mobj.y - bobj.y;
  1683. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1684. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1685. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1686. if (num > 1)
  1687. num = 1;
  1688. let cos = Math.acos(num);
  1689. if (cos > 1.57)
  1690. cos = 1.57;
  1691. else if (cos < 0.01)
  1692. cos = 0.01;
  1693. let tan = Math.tan(cos);
  1694. let dx = tan * data.dleny;
  1695. let dy = tan * data.dlenx;
  1696. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1697. if (Math.abs(bx - 667) < 40)
  1698. continue;
  1699. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1700. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1701. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1702. this.forceMax = dis * 0.08;
  1703. this.destRot += mis * 0.1;
  1704. this.setKick(bx, by);
  1705. return true;
  1706. }
  1707. }
  1708. }
  1709. }
  1710. else {
  1711. ball = xGame.common.getRandArrEle(this.lineBall);
  1712. }
  1713. }
  1714. else {
  1715. for (let i = 0; i < this.scoreBall.length; i++) {
  1716. if (i < this.scoreBall.length - 1) {
  1717. let rand = 70 + this.aiLv * 10 + i * 10;
  1718. if (xGame.tools.random(0, 100) < rand) {
  1719. ball = this.scoreBall[i];
  1720. break;
  1721. }
  1722. }
  1723. else {
  1724. ball = this.scoreBall[i];
  1725. break;
  1726. }
  1727. }
  1728. score = true;
  1729. this.selectNum++;
  1730. }
  1731. if (!ball)
  1732. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1733. if (this.selectNum >= max) {
  1734. let dx = ball.gameObj.x;
  1735. let dy = ball.gameObj.y;
  1736. let kickAngle = 0;
  1737. if (score) {
  1738. dx = ball.kickPos.x;
  1739. dy = ball.kickPos.y;
  1740. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1741. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1742. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1743. if (adot > 1)
  1744. adot = 1;
  1745. kickAngle = Math.acos(adot) * 57.3;
  1746. if (kickAngle > 45) {
  1747. let kdx = ball.kickPos.x - ball.gameObj.x;
  1748. let kdy = ball.kickPos.y - ball.gameObj.y;
  1749. dx = ball.kickPos.x - kdx * mis * 0.3;
  1750. dy = ball.kickPos.y - kdy * mis * 0.3;
  1751. }
  1752. else
  1753. this.destRot += mis;
  1754. }
  1755. else if (ball.poleAngle != 0) {
  1756. this.destRot += ball.poleAngle;
  1757. }
  1758. if (xGame.common.gameMode == 0) {
  1759. let af = kickAngle * 0.08;
  1760. this.forceMax = ball.hard * 0.1 + af * af;
  1761. }
  1762. this.setKick(dx, dy);
  1763. }
  1764. else {
  1765. let rand = this.aiLv * 5 + 40;
  1766. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1767. ball = xGame.common.getRandArrEle(this.scoreBall);
  1768. else
  1769. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1770. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1771. if (xGame.tools.random(0, 100) > rand) {
  1772. this.selectNum = max;
  1773. }
  1774. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1775. this.selectNum++;
  1776. }
  1777. ball.onClick(0, true);
  1778. }
  1779. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1780. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1781. let balls = xGame.common.d2World.ballArr;
  1782. let max = xGame.tools.getDis(hx, hy, bx, by);
  1783. for (let index = 0; index < balls.length; index++) {
  1784. let obj = balls[index];
  1785. if (obj.number == 0)
  1786. continue;
  1787. if (obj.number == bn || obj.number == dn)
  1788. continue;
  1789. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1790. if (dis * dis > max)
  1791. continue;
  1792. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1793. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1794. if (num > 1)
  1795. num = 1;
  1796. if (num < 0)
  1797. continue;
  1798. let gap = Math.sin(Math.acos(num)) * dis;
  1799. if (gap < this.ballSize)
  1800. return true;
  1801. }
  1802. return false;
  1803. }
  1804. isLine(xy, ball) {
  1805. let bx = xy.x;
  1806. let by = xy.y;
  1807. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1808. let dis = ball.getDestDis(xy);
  1809. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1810. let sin = Math.sin(angle);
  1811. let cos = Math.cos(angle);
  1812. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1813. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1814. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1815. let dx = bx + this.tempDir2.x * dis;
  1816. let dy = by + this.tempDir2.y * dis;
  1817. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1818. sin = Math.sin(-angle);
  1819. cos = Math.cos(-angle);
  1820. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1821. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1822. dx = bx + this.tempDir2.x * dis;
  1823. dy = by + this.tempDir2.y * dis;
  1824. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1825. if (isr && isl)
  1826. return false;
  1827. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1828. }
  1829. return true;
  1830. }
  1831. turnPole() {
  1832. this.turnNum++;
  1833. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1834. let dr = rot - this.destRot;
  1835. let abs = Math.abs(dr) % 360;
  1836. if (abs > 180) {
  1837. if (rot > 180)
  1838. rot -= 360;
  1839. if (this.destRot > 180)
  1840. this.destRot -= 360;
  1841. }
  1842. let max = this.turnNum * 5 + this.aiLv * 5;
  1843. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  1844. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  1845. let at = xGame.tools.random(1000, 2000);
  1846. if (!this.onAway(3))
  1847. at += xGame.tools.random(10000, 15000);
  1848. this.setState(AIState.shoot, at);
  1849. }
  1850. else {
  1851. let mr = 0;
  1852. if (abs > 3)
  1853. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  1854. else if (Math.random() > 0.6)
  1855. mr = xGame.tools.random(1, 10) * 0.1;
  1856. mr = dr > 0 ? -mr : mr;
  1857. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  1858. }
  1859. }
  1860. setKick(dx, dy) {
  1861. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  1862. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1863. this.tempDir1.x = 0;
  1864. this.tempDir1.y = 1;
  1865. this.tempDir2.y = -this.tempDir2.y;
  1866. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1867. if (num > 1)
  1868. num = 1;
  1869. let rot = Math.acos(num) * 57.3;
  1870. if (this.tempDir2.x < 0)
  1871. rot = 360 - rot;
  1872. this.destRot += rot;
  1873. if (!xGame.common.gameMgr.finishOneShoot) {
  1874. this.forceMax += xGame.tools.random(10, 50);
  1875. this.forceMax -= this.aiLv * 2;
  1876. if (this.forceMax < 20)
  1877. this.forceMax = 20;
  1878. }
  1879. if (this.forceMax > 100)
  1880. this.forceMax = 101;
  1881. else if (this.forceMax < 10)
  1882. this.forceMax += xGame.tools.random(0, 10);
  1883. if (xGame.common.gameMode == 1)
  1884. this.forceMax = xGame.tools.random(80, 100);
  1885. else
  1886. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  1887. let max = 2000 - this.aiLv * 100;
  1888. if (Math.random() > 0.8)
  1889. max += xGame.tools.random(100, 2000);
  1890. this.setState(AIState.turn, xGame.tools.random(500, max));
  1891. }
  1892. shoot() {
  1893. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  1894. if (Math.random() > 0.8) {
  1895. this.gameSrc.aiForce(1);
  1896. this.setState(AIState.wait);
  1897. }
  1898. }
  1899. else {
  1900. let df = xGame.tools.random(3, 8);
  1901. if (this.forceNum < this.forceMax)
  1902. this.forceNum += df;
  1903. else
  1904. this.forceNum -= df;
  1905. let startY = this.gameSrc.ui.powerNode.y;
  1906. let height = this.gameSrc.ui.powerNode.height;
  1907. let force = startY + height * this.forceNum * 0.01;
  1908. this.gameSrc.aiForce(2, force);
  1909. }
  1910. }
  1911. reset() {
  1912. for (let i = 0; i < 4; i++) {
  1913. this.setRate--;
  1914. this.setNum++;
  1915. let pos = this.posList[this.posIdx];
  1916. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  1917. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  1918. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  1919. this.rootPos.x = 387;
  1920. if (this.rootPos.x < this.rectL)
  1921. this.rootPos.x = this.rectL;
  1922. else if (this.rootPos.x > this.rectR)
  1923. this.rootPos.x = this.rectR;
  1924. if (this.rootPos.y < this.rectT)
  1925. this.rootPos.y = this.rectT;
  1926. else if (this.rootPos.y > this.rectB)
  1927. this.rootPos.y = this.rectB;
  1928. this.posIdx++;
  1929. let max = this.posList.length;
  1930. if (this.posIdx >= max)
  1931. this.posIdx -= max;
  1932. this.initHoleBall();
  1933. let ball = null;
  1934. if (this.scoreBall.length > 0)
  1935. ball = this.scoreBall[0];
  1936. else if (this.lineBall.length > 0)
  1937. ball = xGame.common.getRandArrEle(this.lineBall);
  1938. if (ball && ball.kickAngle < this.bestAngle) {
  1939. this.bestAngle = ball.kickAngle;
  1940. this.bestKick.x = ball.kickPos.x;
  1941. this.bestKick.y = ball.kickPos.y;
  1942. this.bestPos.x = this.rootPos.x;
  1943. this.bestPos.y = this.rootPos.y;
  1944. this.bestForce = ball.hard * 0.08;
  1945. }
  1946. }
  1947. if (this.setNum >= this.setMax)
  1948. this.setMax = 0;
  1949. if (this.setRate < 1) {
  1950. this.setState(AIState.move, 0);
  1951. this.rootMoveTime = Laya.timer.currTimer;
  1952. this.gameSrc.aiRootMove(true);
  1953. }
  1954. }
  1955. delayLine() {
  1956. this.gameSrc.aiRootMove(false);
  1957. }
  1958. move() {
  1959. if (this.bestPos.x < 1)
  1960. this.bestPos = this.rootPos;
  1961. let wObj = this.wBall.gameObj;
  1962. let destx = wObj.x;
  1963. let desty = wObj.y;
  1964. let dx = Math.abs(destx - this.bestPos.x);
  1965. let dy = Math.abs(desty - this.bestPos.y);
  1966. let mx = 3 + dx * 0.03;
  1967. let my = 3 + dy * 0.03;
  1968. if (dx < 4 && dy < 4) {
  1969. let dt = Laya.timer.currTimer - this.rootMoveTime;
  1970. dt = dt < 1000 ? 1000 - dt : 0;
  1971. if (this.setMax > 0) {
  1972. let min = this.setMax * 0.3 + this.aiLv * 5;
  1973. this.setRate = xGame.tools.random(min, this.setMax);
  1974. this.setState(AIState.reset, 0);
  1975. }
  1976. else {
  1977. this.destRot = 0;
  1978. this.forceMax = this.bestForce;
  1979. this.setKick(this.bestKick.x, this.bestKick.y);
  1980. }
  1981. if (dt > 100) {
  1982. Laya.timer.clear(this, this.delayLine);
  1983. Laya.timer.once(dt, this, this.delayLine);
  1984. }
  1985. else
  1986. this.gameSrc.aiRootMove(false);
  1987. }
  1988. else {
  1989. if (dx > 4)
  1990. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  1991. if (dy > 4)
  1992. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  1993. this.gameSrc.onRootMove({ x: destx, y: desty });
  1994. }
  1995. }
  1996. resetRoot() {
  1997. this.bestAngle = 180;
  1998. this.bestForce = 0;
  1999. this.setMax = this.posList.length;
  2000. this.posIdx = xGame.tools.random(0, this.setMax);
  2001. let min = this.setMax * 0.3 + this.aiLv * 5;
  2002. this.setRate = xGame.tools.random(min, this.setMax);
  2003. let max = 2000 - this.aiLv * 100;
  2004. if (Math.random() > 0.8)
  2005. max += xGame.tools.random(100, 1000);
  2006. if (this.isGuide)
  2007. this.setState(AIState.select, 500);
  2008. else if (this.onAway(2))
  2009. this.setState(AIState.reset, xGame.tools.random(400, max));
  2010. else
  2011. this.setState(AIState.none);
  2012. if (xGame.common.gameMgr.finishOneShoot)
  2013. this.chat();
  2014. }
  2015. runAI() {
  2016. if (this.state > AIState.idle)
  2017. return;
  2018. this.initBall();
  2019. this.onGame(2500);
  2020. if (Math.random() > 0.6)
  2021. this.chat();
  2022. }
  2023. stopRun() {
  2024. this.setState(AIState.idle);
  2025. }
  2026. onGame(base) {
  2027. let max = base - this.aiLv * 100;
  2028. if (Math.random() > 0.8)
  2029. max += xGame.tools.random(100, 1000);
  2030. if (this.onAway(2))
  2031. this.setState(AIState.select, xGame.tools.random(500, max));
  2032. else
  2033. this.setState(AIState.none);
  2034. }
  2035. setState(sta, wt = 0) {
  2036. if (this.state == AIState.none)
  2037. return;
  2038. this.state = sta;
  2039. this.waitTime = wt;
  2040. }
  2041. onUpdate() {
  2042. if (this.state == AIState.none)
  2043. return;
  2044. this.awayTime -= this.dtime;
  2045. if (this.awayTime < 1) {
  2046. this.awayTime = xGame.tools.random(6000, 10000);
  2047. this.awayNum += (11 - this.aiLv);
  2048. this.onAway(1);
  2049. }
  2050. if (this.waitTime >= 0) {
  2051. this.waitTime -= this.dtime;
  2052. return;
  2053. }
  2054. switch (this.state) {
  2055. case AIState.idle:
  2056. this.chat();
  2057. break;
  2058. case AIState.reset:
  2059. this.reset();
  2060. break;
  2061. case AIState.move:
  2062. this.move();
  2063. break;
  2064. case AIState.leave:
  2065. this.state = AIState.none;
  2066. xGame.common.gameMgr.aiGameEnd(true);
  2067. break;
  2068. case AIState.select:
  2069. this.selectBall();
  2070. break;
  2071. case AIState.turn:
  2072. this.turnPole();
  2073. break;
  2074. case AIState.shoot:
  2075. this.shoot();
  2076. break;
  2077. }
  2078. }
  2079. onAway(type) {
  2080. if (type == 1) {
  2081. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2082. let num = this.awayNum + db * 20;
  2083. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2084. xGame.common.gameMgr.aiLeave();
  2085. this.setState(AIState.leave, 6666);
  2086. }
  2087. }
  2088. else if (type == 2) {
  2089. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2090. let num = this.awayNum + db * 30;
  2091. if (xGame.tools.random(0, 10000) < num)
  2092. return false;
  2093. }
  2094. else if (type == 3) {
  2095. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2096. let num = this.awayNum + db * 10;
  2097. if (xGame.tools.random(0, 4000) < num)
  2098. return false;
  2099. }
  2100. return true;
  2101. }
  2102. chat() {
  2103. if (this.chatTime > 0) {
  2104. this.chatTime -= this.dtime;
  2105. return;
  2106. }
  2107. this.chatTime = xGame.tools.random(2000, 10000);
  2108. let rand = xGame.tools.random(0, 100);
  2109. if (rand < 15)
  2110. this.talk();
  2111. else if (rand < 35)
  2112. this.emotion();
  2113. }
  2114. talk() {
  2115. xGame.common.talkMgr.showAITalk(0);
  2116. }
  2117. emotion() {
  2118. xGame.common.talkMgr.showAIEmotion(0);
  2119. }
  2120. resetAI() {
  2121. this.stopRun();
  2122. this.state = AIState.none;
  2123. }
  2124. }
  2125. class Partical extends Laya.Script3D {
  2126. constructor() {
  2127. super();
  2128. this.duration = 2000;
  2129. }
  2130. ;
  2131. onAwake() {
  2132. this.gameObj = this.owner;
  2133. }
  2134. onEnable() {
  2135. this.openTimer();
  2136. }
  2137. openTimer() {
  2138. Laya.timer.once(this.duration, this, this.disappear);
  2139. }
  2140. setCallback(obj, callback) {
  2141. this.obj = obj;
  2142. this.callback = callback;
  2143. Laya.timer.clearAll(this);
  2144. Laya.timer.once(this.duration, this, this.disappear);
  2145. }
  2146. disappear() {
  2147. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2148. this.callback && this.callback(this.obj);
  2149. }
  2150. }
  2151. class Ball extends Laya.Script3D {
  2152. constructor() {
  2153. super();
  2154. this.posV3 = new Laya.Vector3();
  2155. this.rotRate = 2.1;
  2156. this.rotSpeed = new Laya.Vector3();
  2157. this.myIndex = 0;
  2158. }
  2159. onAwake() {
  2160. this.gameObj = this.owner;
  2161. this.transform = this.gameObj.transform;
  2162. this.ballNode = this.gameObj.getChildByName("Ball");
  2163. this.shadowNode = this.gameObj.getChildByName("shadow");
  2164. }
  2165. initSelf(index, x, y, owner) {
  2166. this.d2BallSrc = owner;
  2167. this.myIndex = index;
  2168. this.setAlbedoTexture();
  2169. this.setTransPos(x, y);
  2170. this.setScale();
  2171. this.ballNode.transform.localRotationEulerX = 90;
  2172. if (index == 0) {
  2173. }
  2174. }
  2175. setAlbedoTexture(isIce = false) {
  2176. let url;
  2177. if (isIce) {
  2178. url = `res/d3Res/ballTexture/ice.jpg`;
  2179. }
  2180. else {
  2181. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2182. }
  2183. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2184. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2185. }));
  2186. }
  2187. runFireworks(obj, delay, callback) {
  2188. Laya.timer.clearAll(this);
  2189. Laya.timer.once(delay + 1, this, () => {
  2190. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2191. fire.transform.localPositionX = this.transform.localPositionX;
  2192. fire.transform.localPositionY = this.transform.localPositionY;
  2193. fire.transform.localPositionZ = this.transform.localPositionZ;
  2194. let src = fire.getComponent(Partical);
  2195. src.duration = 1000;
  2196. src.setCallback(obj, callback);
  2197. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2198. eft.transform.localPositionX = this.transform.localPositionX;
  2199. eft.transform.localPositionY = this.transform.localPositionY;
  2200. eft.transform.localPositionZ = this.transform.localPositionZ;
  2201. });
  2202. }
  2203. setTransPos(x, y) {
  2204. this.setRotation();
  2205. xGame.common.pos2to3Convert(x, y, this.posV3);
  2206. this.transform.localPositionX = this.posV3.x;
  2207. this.transform.localPositionY = 0;
  2208. this.transform.localPositionZ = this.posV3.z;
  2209. this.transform.localRotationEulerX = 0;
  2210. this.transform.localRotationEulerY = 0;
  2211. this.transform.localRotationEulerZ = 0;
  2212. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2213. this.shadowNode.transform.localPositionY = 0.1;
  2214. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2215. }
  2216. setRotation() {
  2217. if (this.d2BallSrc.canRot) {
  2218. let speed = this.d2BallSrc.rigy.linearVelocity;
  2219. this.rotSpeed.x = speed.x * this.rotRate;
  2220. this.rotSpeed.z = speed.y * this.rotRate;
  2221. this.rotSpeed.y = this.d2BallSrc.rotY;
  2222. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2223. }
  2224. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2225. this.rotSpeed.x = this.rotSpeed.y = 0;
  2226. this.rotSpeed.y = this.d2BallSrc.rotY;
  2227. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2228. }
  2229. }
  2230. setScale() {
  2231. let radius = xGame.common.d2World.rootBall.ui.width;
  2232. let scale = xGame.common.scale2to3Convert(radius);
  2233. this.transform.localScaleX = scale;
  2234. this.transform.localScaleY = scale;
  2235. this.transform.localScaleZ = scale;
  2236. }
  2237. playInHoleEft() {
  2238. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2239. eft.transform.position = this.transform.position;
  2240. }
  2241. playIceEft() {
  2242. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2243. eft.transform.position = this.transform.position;
  2244. }
  2245. get scaleXYZ() {
  2246. return this.transform.localScaleX;
  2247. }
  2248. set scaleXYZ(val) {
  2249. this.transform.localScaleX = val;
  2250. this.transform.localScaleY = val;
  2251. this.transform.localScaleZ = val;
  2252. }
  2253. get posX() {
  2254. return this.transform.localPositionX;
  2255. }
  2256. set posX(val) {
  2257. this.transform.localPositionX = val;
  2258. }
  2259. get posY() {
  2260. return this.transform.localPositionY;
  2261. }
  2262. set posY(val) {
  2263. this.transform.localPositionY = val;
  2264. }
  2265. get posZ() {
  2266. return this.transform.localPositionZ;
  2267. }
  2268. set posZ(val) {
  2269. this.transform.localPositionZ = val;
  2270. }
  2271. destroySelf() {
  2272. this.posV3 = null;
  2273. this.rotSpeed = null;
  2274. this.d2BallSrc = null;
  2275. this.ballNode = null;
  2276. this.gameObj.destroy(true);
  2277. this.transform = null;
  2278. this.destroy();
  2279. }
  2280. }
  2281. class ui_D2Ball extends fgui.GComponent {
  2282. static createInstance() {
  2283. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2284. }
  2285. onConstruct() {
  2286. this.myIcon = (this.getChild("myIcon"));
  2287. this.inner = (this.getChild("inner"));
  2288. this.n8 = (this.getChild("n8"));
  2289. this.n4 = (this.getChild("n4"));
  2290. this.wrongTips = (this.getChild("wrongTips"));
  2291. this.rightTips = (this.getChild("rightTips"));
  2292. this.breathAni = this.getTransition("breathAni");
  2293. }
  2294. }
  2295. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2296. class D2BallSrc extends Laya.Script {
  2297. constructor() {
  2298. super();
  2299. this.number = 0;
  2300. this.startX = 0;
  2301. this.startY = 0;
  2302. this.angleV2 = new Laya.Vector2();
  2303. this.isRootBall = false;
  2304. this.isBlackBall = false;
  2305. this.ballType = "";
  2306. this.canRot = true;
  2307. this.rotY = 0;
  2308. this.poleAngle = 0;
  2309. this.kickPos = { x: 0, y: 0 };
  2310. this.hard = 0;
  2311. this.kickAngle = 0;
  2312. this.borderDis = 0;
  2313. this.speedP10 = 5.6;
  2314. this.lastSpeed = { x: 0, y: 0 };
  2315. this.stillSpeed = 0.12;
  2316. this.ballFunc = "normal";
  2317. this.isRunSkillAni = false;
  2318. this.isInHole = false;
  2319. this.iceOwner = "";
  2320. this.forceRun = false;
  2321. this.myUNID = "";
  2322. this.rectL = 0;
  2323. this.rectR = 0;
  2324. this.rectT = 0;
  2325. this.rectB = 0;
  2326. this.forceVec = new Laya.Vector2();
  2327. this.lastDis = 0;
  2328. this.helpOut = { type: "", x: 0, y: 0 };
  2329. }
  2330. initSelf(number, x, y, d3Ball) {
  2331. if (!this.gameObj)
  2332. this.gameObj = this.owner;
  2333. this.number = number;
  2334. this.startX = x;
  2335. this.startY = y;
  2336. this.d3Ball = d3Ball;
  2337. this.isRootBall = false;
  2338. this.isBlackBall = false;
  2339. this.ballType = "";
  2340. if (number == 0) {
  2341. this.isRootBall = true;
  2342. }
  2343. else if (number == 8) {
  2344. this.isBlackBall = true;
  2345. }
  2346. else {
  2347. if (number <= 7) {
  2348. this.ballType = ballCamp.full;
  2349. }
  2350. else {
  2351. this.ballType = ballCamp.flower;
  2352. }
  2353. }
  2354. this.setInfo();
  2355. this.setD3Ball();
  2356. this.owner["mySrc"] = this;
  2357. this.rigy.linearDamping = 1;
  2358. D2BallSrc._unid++;
  2359. this.myUNID = "d2ball" + D2BallSrc._unid;
  2360. let rect = xGame.common.d2World.borderRect;
  2361. this.rectL = Math.ceil(rect.x) + 20;
  2362. this.rectT = Math.ceil(rect.y) + 20;
  2363. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2364. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2365. }
  2366. setInfo() {
  2367. this.gameObj.x = this.startX;
  2368. this.gameObj.y = this.startY;
  2369. let radius = this.ui.width / 2;
  2370. this.gameObj.width = radius * 2;
  2371. this.gameObj.height = radius * 2;
  2372. if (xGame.common.showDebug) {
  2373. this.ui.myIcon.alpha = 1;
  2374. this.ui.inner.alpha = 1;
  2375. }
  2376. else {
  2377. this.ui.myIcon.alpha = 0;
  2378. this.ui.inner.alpha = 0;
  2379. }
  2380. }
  2381. setD3Ball() {
  2382. this.d3Ball = this.d3Ball;
  2383. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2384. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2385. }
  2386. onUpdate() {
  2387. if (xGame.common.gameMgr.gamePause)
  2388. return;
  2389. if (this.isInHole)
  2390. return;
  2391. if (!xGame.common.d2World.openCheckStill)
  2392. return;
  2393. this.runBall();
  2394. }
  2395. runBall() {
  2396. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2397. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2398. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2399. this.judgeBorder();
  2400. }
  2401. getDestDis(dest) {
  2402. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2403. }
  2404. setmyXY(x, y) {
  2405. this.d3BallSrc.setTransPos(x, y);
  2406. }
  2407. getSpeed() {
  2408. let speed = this.rigy.linearVelocity;
  2409. return speed.x * speed.x + speed.y * speed.y;
  2410. }
  2411. onTriggerEnter(collider) {
  2412. if (!collider || !collider.owner)
  2413. return;
  2414. let coll = "collide";
  2415. let speed = this.getSpeed();
  2416. let sv2 = this.speedP10 * this.speedP10;
  2417. if (collider.label == "ball") {
  2418. if (speed < 9 && this.number != 0)
  2419. coll = "";
  2420. else if (speed < sv2)
  2421. coll = "collide_4";
  2422. else if (speed < sv2 * 6.2)
  2423. coll = "collide_3";
  2424. else if (speed < sv2 * 25)
  2425. coll = "collide_2";
  2426. else if (speed < sv2 * 56)
  2427. coll = "collide_1";
  2428. xGame.soundMgr.playSound(coll);
  2429. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2430. if (collider.owner) {
  2431. let rig = collider.owner.getComponent(D2BallSrc);
  2432. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2433. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2434. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2435. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2436. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2437. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2438. let rx = 0;
  2439. let ry = 0;
  2440. if (this.gameObj.x < this.rectL)
  2441. rx = vx;
  2442. else if (this.gameObj.x > this.rectR)
  2443. rx = -vx;
  2444. else if (this.gameObj.y < this.rectT)
  2445. ry = vy;
  2446. else if (this.gameObj.y > this.rectB)
  2447. ry = -vy;
  2448. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2449. }
  2450. }
  2451. if (this.number != 0) {
  2452. return;
  2453. }
  2454. else {
  2455. if (this.forceRun) {
  2456. console.log("randon force");
  2457. this.applyForce(collider);
  2458. }
  2459. }
  2460. if (xGame.common.d2World.isOnSameLine) {
  2461. xGame.common.d2World.isOnSameLine = false;
  2462. this.rigy.linearVelocity = { x: 0, y: 0 };
  2463. }
  2464. if (xGame.common.gameMgr.firstColliObj == null) {
  2465. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2466. xGame.common.gameMgr.isTouchedBall = true;
  2467. }
  2468. }
  2469. else {
  2470. xGame.common.recoverCameraView();
  2471. let wallStr = "";
  2472. if (speed < 9) { }
  2473. else if (speed < sv2) { }
  2474. else if (speed < sv2 * 6.2)
  2475. wallStr = "wall_30";
  2476. else if (speed < sv2 * 25)
  2477. wallStr = "wall_50";
  2478. else if (speed < sv2 * 56)
  2479. wallStr = "wall_80";
  2480. xGame.soundMgr.playSound(wallStr);
  2481. }
  2482. }
  2483. applyForce(collider) {
  2484. let src = collider.owner.mySrc;
  2485. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2486. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2487. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2488. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2489. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2490. }
  2491. checkWrongBall(playEft = true) {
  2492. if (this.isInHole)
  2493. return;
  2494. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2495. if (this.number != 0 && playEft)
  2496. this.d3BallSrc.playInHoleEft();
  2497. let coll = "inpocket_1";
  2498. let speed = this.getSpeed();
  2499. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2500. if (speed < 9 && this.number != 0)
  2501. coll = "";
  2502. else if (speed < sv2 * 6.2)
  2503. coll = "inpocket_4";
  2504. else if (speed < sv2 * 25)
  2505. coll = "collide_3";
  2506. else if (speed < sv2 * 56)
  2507. coll = "collide_2";
  2508. xGame.soundMgr.playSound(coll);
  2509. this.isInHole = true;
  2510. if (this.number == 0) {
  2511. console.log("白球进了。。");
  2512. this.reset();
  2513. this.rigy.linearVelocity = { x: 0, y: 0 };
  2514. this.hideSelf();
  2515. xGame.common.gameUI.ui.whiteAni.visible = true;
  2516. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2517. xGame.common.gameUI.ui.whiteAni.visible = false;
  2518. }));
  2519. }
  2520. else {
  2521. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2522. xGame.common.d2World.removeOneBall(this);
  2523. this.destroySelf();
  2524. xGame.common.playHappySound(this.number);
  2525. this.runFlyEft();
  2526. }
  2527. }
  2528. runFlyEft() {
  2529. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2530. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2531. }
  2532. }
  2533. hideSelf() {
  2534. if (this.d3Ball)
  2535. this.d3Ball.active = false;
  2536. }
  2537. showSelf() {
  2538. this.isInHole = false;
  2539. if (this.d3Ball && !this.d3Ball.active)
  2540. this.d3Ball.active = true;
  2541. }
  2542. isStill() {
  2543. let speed = this.rigy.linearVelocity;
  2544. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2545. this.rigy.linearVelocity = { x: 0, y: 0 };
  2546. return true;
  2547. }
  2548. return false;
  2549. }
  2550. reset() {
  2551. }
  2552. destroySelf() {
  2553. this.d3BallSrc.destroySelf();
  2554. if (!this.ui.isDisposed) {
  2555. this.ui.removeFromParent();
  2556. this.ui.dispose();
  2557. this.ui = null;
  2558. }
  2559. this.outColli = null;
  2560. this.innerColli = null;
  2561. this.rigy = null;
  2562. this.d3Ball = null;
  2563. this.d3BallSrc = null;
  2564. this.angleV2 = null;
  2565. this.gameObj.destroy(true);
  2566. this.destroy();
  2567. }
  2568. judgeBorder() {
  2569. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2570. return;
  2571. }
  2572. if (this.destroyed)
  2573. return;
  2574. if (xGame.common.gameMode == GameMode.classic)
  2575. return;
  2576. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2577. if (isOver) {
  2578. this.checkWrongBall();
  2579. }
  2580. }
  2581. onClick(e, force = false) {
  2582. if (this.number == 0)
  2583. return;
  2584. if (force) {
  2585. }
  2586. else {
  2587. if (xGame.common.d2World.openCheckStill)
  2588. return;
  2589. if (!xGame.common.gameMgr.selfTurn) {
  2590. return;
  2591. }
  2592. }
  2593. if (!xGame.common.gameMgr.finishOneShoot)
  2594. return;
  2595. let root = xGame.common.d2World.rootBall.gameObj;
  2596. let x = this.gameObj.x - root.x;
  2597. let y = this.gameObj.y - root.y;
  2598. let angle = xGame.common.getfguiRotation(x, y);
  2599. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2600. xGame.common.d2World.getHelpLine();
  2601. xGame.common.clickedBall = true;
  2602. this.checkGuide();
  2603. }
  2604. checkGuide() {
  2605. let guide = DataMgr.getSkillGuide();
  2606. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2607. xGame.common.guideStep++;
  2608. xGame.common.gameUI.ui.guide1.visible = false;
  2609. xGame.common.gameUI.ui.guide2.visible = true;
  2610. }
  2611. }
  2612. checkDistance(disX, disY, angle) {
  2613. let diameter = this.gameObj.width - 1;
  2614. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2615. if (!this.lastDis)
  2616. this.lastDis = dis;
  2617. else {
  2618. if (dis > this.lastDis) {
  2619. this.helpOut.type = "remove";
  2620. return this.helpOut;
  2621. }
  2622. }
  2623. if (dis <= Math.pow(diameter, 2)) {
  2624. let del = 0.01;
  2625. let offest = 0;
  2626. let realX = disX - this.gameObj.x;
  2627. let realY = disY - this.gameObj.y;
  2628. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2629. offest += del;
  2630. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2631. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2632. }
  2633. this.helpOut.type = "ok";
  2634. this.helpOut.x = realX + this.gameObj.x;
  2635. this.helpOut.y = realY + this.gameObj.y;
  2636. return this.helpOut;
  2637. }
  2638. else {
  2639. this.helpOut.type = "no";
  2640. return this.helpOut;
  2641. }
  2642. }
  2643. clearBallEft() {
  2644. this.clearBallRightEft();
  2645. this.clearBallWrongEft();
  2646. }
  2647. clearBallRightEft() {
  2648. this.ui.breathAni.stop();
  2649. this.ui.rightTips.visible = false;
  2650. }
  2651. clearBallWrongEft() {
  2652. this.ui.wrongTips.visible = false;
  2653. }
  2654. showWrongEft() {
  2655. if (!xGame.common.gameMgr.selfTurn)
  2656. return;
  2657. this.ui.wrongTips.visible = true;
  2658. }
  2659. showRightEft() {
  2660. if (!xGame.common.gameMgr.selfTurn)
  2661. return;
  2662. this.ui.rightTips.visible = true;
  2663. this.ui.rightTips.scaleX = 1;
  2664. this.ui.rightTips.scaleY = 1;
  2665. this.ui.breathAni.play();
  2666. }
  2667. setBallFunc(type, owner) {
  2668. if (type == "ice") {
  2669. this.ballFunc = type;
  2670. this.d3BallSrc.setAlbedoTexture(true);
  2671. this.rigy.type = "static";
  2672. this.iceOwner = owner;
  2673. }
  2674. else {
  2675. if (owner == this.iceOwner) {
  2676. this.ballFunc = type;
  2677. this.d3BallSrc.setAlbedoTexture(false);
  2678. this.rigy.type = "dynamic";
  2679. }
  2680. }
  2681. }
  2682. }
  2683. D2BallSrc._unid = 0;
  2684. class D2RootBallSrc extends D2BallSrc {
  2685. constructor() {
  2686. super();
  2687. this.maxSpeed = 0;
  2688. this.classicMaxSpeed = 2.2;
  2689. this.bigSkillMaxSpeed = 4;
  2690. this.angle = 0;
  2691. this.allPercent = 0;
  2692. this.linearPercent = 0;
  2693. this.anglePercent = 0;
  2694. this.maxAngleRate = 0.6;
  2695. this.baseRot = 7;
  2696. this.angleMax = 0;
  2697. this.speed = new Laya.Vector2();
  2698. this.rotSpeed = new Laya.Vector2();
  2699. }
  2700. isStill() {
  2701. let speed = this.rigy.linearVelocity;
  2702. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2703. if (this.anglePercent <= 0.1) {
  2704. this.rigy.linearVelocity = { x: 0, y: 0 };
  2705. return true;
  2706. }
  2707. }
  2708. return false;
  2709. }
  2710. reset() {
  2711. this.linearPercent = 0;
  2712. this.anglePercent = 0;
  2713. }
  2714. setSpeed(percent, angle) {
  2715. this.allPercent = percent;
  2716. this.angle = angle;
  2717. this.setAngleSpeed();
  2718. this.setLinearSpeed();
  2719. let hit = "hit";
  2720. if (percent < 25)
  2721. hit = "hit03";
  2722. else if (percent < 50)
  2723. hit = "hit02";
  2724. else if (percent < 75)
  2725. hit = "hit01";
  2726. xGame.soundMgr.playSound(hit);
  2727. }
  2728. setAngleSpeed() {
  2729. let offest = xGame.common.rodOffest;
  2730. let radius = 82;
  2731. let rate = Math.abs(offest.y / radius) * 0.5;
  2732. if (offest.y > 0)
  2733. this.angleMax = -this.baseRot * 2;
  2734. else
  2735. this.angleMax = this.baseRot;
  2736. this.rotY = -offest.x / radius * 100;
  2737. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2738. this.linearPercent = this.allPercent - this.anglePercent;
  2739. }
  2740. setLinearSpeed() {
  2741. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2742. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2743. if (!xGame.common.longHelpLine) {
  2744. let offset = -150 + xGame.common.randomNum(0, 300);
  2745. offset /= 100;
  2746. this.angle += offset;
  2747. }
  2748. }
  2749. }
  2750. let sin = Math.sin(this.angle * Math.PI / 180);
  2751. let cos = Math.cos(this.angle * Math.PI / 180);
  2752. switch (xGame.common.gameMode) {
  2753. case GameMode.classic:
  2754. this.maxSpeed = this.classicMaxSpeed;
  2755. break;
  2756. case GameMode.bigMove:
  2757. this.maxSpeed = this.bigSkillMaxSpeed;
  2758. break;
  2759. case GameMode.placeBall:
  2760. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2761. if (data.type == 1) {
  2762. this.maxSpeed = this.bigSkillMaxSpeed;
  2763. }
  2764. else {
  2765. this.maxSpeed = this.classicMaxSpeed;
  2766. }
  2767. break;
  2768. default:
  2769. break;
  2770. }
  2771. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2772. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2773. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2774. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2775. this.rigy.applyLinearImpulseToCenter(this.speed);
  2776. }
  2777. onUpdate() {
  2778. if (this.anglePercent > 0.1) {
  2779. this.anglePercent *= 0.97;
  2780. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2781. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2782. this.rigy.applyForceToCenter(this.rotSpeed);
  2783. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2784. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2785. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2786. if (num > 0.9)
  2787. this.canRot = true;
  2788. }
  2789. else
  2790. this.canRot = true;
  2791. if (Math.abs(this.rotY) > 0.1)
  2792. this.rotY *= 0.98;
  2793. super.onUpdate();
  2794. }
  2795. destroySelf() {
  2796. super.destroySelf();
  2797. this.speed = null;
  2798. }
  2799. }
  2800. class D2Ball extends Laya.Sprite {
  2801. constructor(isRootBall = false) {
  2802. super();
  2803. this.ui = ui_D2Ball.createInstance();
  2804. this.pivotX = this.ui.width / 2;
  2805. this.pivotY = this.ui.width / 2;
  2806. this.x = 0;
  2807. this.y = 0;
  2808. this.addChild(this.ui.displayObject);
  2809. this.ui.displayObject.x += this.ui.width / 2;
  2810. this.ui.displayObject.y += this.ui.width / 2;
  2811. if (isRootBall) {
  2812. this.d2Src = this.addComponent(D2RootBallSrc);
  2813. }
  2814. else {
  2815. this.d2Src = this.addComponent(D2BallSrc);
  2816. }
  2817. this.d2Src.ui = this.ui;
  2818. this.addCircleCollider();
  2819. this.addInnerCircleCollider();
  2820. this.addRigyBody();
  2821. }
  2822. addCircleCollider() {
  2823. let colli = xGame.common.getCollider("circle");
  2824. colli.radius = this.ui.width / 2;
  2825. this.addComponentIntance(colli);
  2826. this.d2Src.outColli = colli;
  2827. colli.label = "ball";
  2828. }
  2829. addInnerCircleCollider() {
  2830. let colli = xGame.common.getCollider("circle");
  2831. colli.radius = this.ui.inner.width / 2;
  2832. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2833. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2834. this.addComponentIntance(colli);
  2835. this.d2Src.innerColli = colli;
  2836. colli.label = "inner";
  2837. }
  2838. addRigyBody() {
  2839. let rigy = xGame.common.getRigbody();
  2840. rigy.type = "dynamic";
  2841. this.addComponentIntance(rigy);
  2842. this.d2Src.rigy = rigy;
  2843. }
  2844. disposeSelf() {
  2845. if (!this.ui.isDisposed) {
  2846. this.ui.dispose();
  2847. this.ui.removeFromParent();
  2848. this.ui = null;
  2849. }
  2850. }
  2851. }
  2852. class ui_D2Gan extends fgui.GComponent {
  2853. static createInstance() {
  2854. return (fgui.UIPackage.createObject("game", "D2Gan"));
  2855. }
  2856. onConstruct() {
  2857. this.myIcon = (this.getChild("myIcon"));
  2858. this.selfRodIcon = (this.getChild("selfRodIcon"));
  2859. this.selfEftRoot = (this.getChild("selfEftRoot"));
  2860. this.self = (this.getChild("self"));
  2861. this.aiRodIcon = (this.getChild("aiRodIcon"));
  2862. this.aiEftRoot = (this.getChild("aiEftRoot"));
  2863. this.ai = (this.getChild("ai"));
  2864. }
  2865. }
  2866. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  2867. class D2Gan {
  2868. constructor() {
  2869. this.offset = 0.15;
  2870. this.cell = 1.5;
  2871. this.onBallCell = 0.4;
  2872. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  2873. this.moveNum = 70;
  2874. this.rulerRate = 0.1;
  2875. this.ui = ui_D2Gan.createInstance();
  2876. this.changeSelfRod();
  2877. this.changeAIRod();
  2878. }
  2879. changeSelfRod() {
  2880. let index = DataMgr.getCurBallRod();
  2881. let data = cfgTable.ballrodData[index + 1];
  2882. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2883. this.selfMySpine && this.selfMySpine.dispose();
  2884. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2885. if (data.spine) {
  2886. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2887. this.selfMySpine = new SpineMgr(data.spine, () => {
  2888. let xx = this.ui.selfEftRoot.width / 2;
  2889. let yy = this.ui.selfEftRoot.height / 2;
  2890. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2891. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  2892. outSpine.rotation = -90;
  2893. });
  2894. }
  2895. }
  2896. changeAIRod() {
  2897. let length = Object.keys(cfgTable.ballrodData).length;
  2898. let rand = Math.floor(length * Math.random()) + 1;
  2899. let data = cfgTable.ballrodData[rand];
  2900. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2901. this.aiMySpine && this.aiMySpine.dispose();
  2902. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  2903. if (data.spine) {
  2904. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  2905. this.aiMySpine = new SpineMgr(data.spine, () => {
  2906. let xx = this.ui.aiEftRoot.width / 2;
  2907. let yy = this.ui.aiEftRoot.height / 2;
  2908. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  2909. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  2910. outSpine.rotation = -90;
  2911. });
  2912. }
  2913. }
  2914. setGanLastInfo() {
  2915. this.lastInfo.rotation = this.ui.rotation;
  2916. this.lastInfo.x = this.ui.x;
  2917. this.lastInfo.y = this.ui.y;
  2918. }
  2919. rotateSelf(flag, isRuler = false) {
  2920. let angle;
  2921. flag = flag * this.offset;
  2922. if (xGame.common.d2World.isHelpLineOnBall) {
  2923. angle = flag * this.onBallCell;
  2924. }
  2925. else {
  2926. angle = flag * this.cell;
  2927. }
  2928. if (isRuler) {
  2929. angle *= this.rulerRate;
  2930. }
  2931. this.ui.rotation += angle;
  2932. xGame.common.d2World.getHelpLine();
  2933. }
  2934. checkDistance() {
  2935. let target = xGame.common.d2World.targetBall;
  2936. let root = xGame.common.d2World.rootBall;
  2937. if (target == null) {
  2938. return 1;
  2939. }
  2940. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  2941. if (dis <= 2500) {
  2942. return 5;
  2943. }
  2944. return 1;
  2945. }
  2946. rotDest(rot) {
  2947. this.ui.rotation = rot;
  2948. xGame.common.d2World.getHelpLine();
  2949. }
  2950. storagePower(powerNum) {
  2951. let pos = (powerNum / 100) * this.moveNum;
  2952. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  2953. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  2954. this.ui.x = this.lastInfo.x + xx;
  2955. this.ui.y = this.lastInfo.y + yy;
  2956. }
  2957. shoot() {
  2958. this.storagePower(0);
  2959. this.ui.visible = false;
  2960. }
  2961. destroySelf() {
  2962. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  2963. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  2964. this.selfMySpine && this.selfMySpine.dispose();
  2965. this.aiMySpine && this.aiMySpine.dispose();
  2966. this.lastInfo = null;
  2967. if (!this.ui.isDisposed) {
  2968. this.ui.removeFromParent();
  2969. this.ui.dispose();
  2970. }
  2971. }
  2972. }
  2973. class ui_HelpLine extends fgui.GComponent {
  2974. static createInstance() {
  2975. return (fgui.UIPackage.createObject("game", "HelpLine"));
  2976. }
  2977. onConstruct() {
  2978. this.n10 = (this.getChild("n10"));
  2979. this.rect = (this.getChild("rect"));
  2980. this.dir11 = (this.getChild("dir11"));
  2981. this.dir = (this.getChild("dir"));
  2982. this.rootDir = (this.getChild("rootDir"));
  2983. this.dirDot = (this.getChild("dirDot"));
  2984. }
  2985. }
  2986. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  2987. class D2HelpLine {
  2988. constructor() {
  2989. this.starX = 0;
  2990. this.starY = 0;
  2991. this.ui = ui_HelpLine.createInstance();
  2992. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  2993. this.starX = this.ui.rect.x;
  2994. this.starY = this.ui.rect.y;
  2995. }
  2996. shoot() {
  2997. this.ui.visible = false;
  2998. }
  2999. destroySelf() {
  3000. if (this.ui.isDisposed) {
  3001. this.ui.removeFromParent();
  3002. this.ui.dispose();
  3003. }
  3004. }
  3005. }
  3006. class D2World extends Laya.Script {
  3007. constructor() {
  3008. super();
  3009. this.ballArr = [];
  3010. this.openCheckStill = false;
  3011. this.checkArr = [];
  3012. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3013. this.isHelpLineOnBall = false;
  3014. this.isOnSameLine = false;
  3015. this.reflectAngle = 0;
  3016. this.powerPercent = 0;
  3017. this.inHolesSpeed = [];
  3018. this.outDir = new Laya.Vector2();
  3019. this.rootDir = new Laya.Vector2();
  3020. this.aiLv = 0;
  3021. this.rootPos = new Laya.Vector2();
  3022. this.tempDir1 = new Laya.Vector2();
  3023. this.tempDir2 = new Laya.Vector2();
  3024. this.tempDir3 = new Laya.Vector2();
  3025. this.ballSize = 33;
  3026. this.destRot = 0;
  3027. }
  3028. initSelf() {
  3029. this.createBalls();
  3030. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3031. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3032. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3033. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3034. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3035. }
  3036. setBorderRect() {
  3037. let ui = xGame.common.gameUI.ui;
  3038. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3039. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3040. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3041. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3042. this.borderRect.x = starX;
  3043. this.borderRect.y = starY;
  3044. this.borderRect.width = width;
  3045. this.borderRect.height = height;
  3046. }
  3047. resetGame() {
  3048. this.openCheckStill = false;
  3049. let temp;
  3050. for (let index = 0; index < this.ballArr.length; index++) {
  3051. temp = this.ballArr[index];
  3052. temp.destroySelf();
  3053. }
  3054. xGame.common.d3World.ballRoot.destroyChildren();
  3055. xGame.common.gameUI.ui.ballNode.removeChildren();
  3056. console.log("进入摧毁逻辑");
  3057. this.d2Gan.destroySelf();
  3058. this.d2HelpLine.destroySelf();
  3059. this.ballArr = [];
  3060. }
  3061. setD2Gan() {
  3062. let ballNode = this.rootBall.ui;
  3063. let d2Gan = new D2Gan();
  3064. this.d2Gan = d2Gan;
  3065. let ganNode = d2Gan.ui;
  3066. ballNode.addChild(ganNode);
  3067. ganNode.pivotX = ganNode.pivotX;
  3068. ganNode.pivotY = ganNode.pivotY;
  3069. ganNode.x = ganNode.myIcon.width / 2;
  3070. ganNode.y = this.rootBall.gameObj.width;
  3071. d2Gan.setGanLastInfo();
  3072. }
  3073. setHelpLine() {
  3074. let d2Help = new D2HelpLine();
  3075. this.d2HelpLine = d2Help;
  3076. }
  3077. createBalls() {
  3078. let cfg;
  3079. switch (xGame.common.gameMode) {
  3080. case GameMode.classic:
  3081. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3082. break;
  3083. case GameMode.bigMove:
  3084. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3085. break;
  3086. case GameMode.placeBall:
  3087. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3088. break;
  3089. default:
  3090. break;
  3091. }
  3092. cfg = JSON.parse(JSON.stringify(cfg));
  3093. for (const key in cfg) {
  3094. if (cfg[key].value == 0) {
  3095. this.createRootBall(cfg[key]);
  3096. delete cfg[key];
  3097. break;
  3098. }
  3099. }
  3100. this.createOtherBalls(cfg);
  3101. }
  3102. createRootBall(data) {
  3103. let root = new D2Ball(true);
  3104. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3105. this.rootBall = root.d2Src;
  3106. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3107. let d3BallSrc = d3Ball.getComponent(Ball);
  3108. xGame.common.d3World.rootBall = d3Ball;
  3109. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3110. let xx = data.x;
  3111. let yy = data.y;
  3112. let numer = data.value;
  3113. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3114. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3115. this.ballArr.push(this.rootBall);
  3116. this.setD2Gan();
  3117. this.setHelpLine();
  3118. }
  3119. createOtherBalls(cfg) {
  3120. let temp;
  3121. let src;
  3122. let data;
  3123. for (const key in cfg) {
  3124. data = cfg[key];
  3125. temp = new D2Ball();
  3126. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3127. src = temp.d2Src;
  3128. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3129. src.initSelf(data.value, data.x, data.y, d3Ball);
  3130. this.ballArr.push(src);
  3131. }
  3132. }
  3133. shoot(percent) {
  3134. this.powerPercent = percent;
  3135. this.openCheckStill = true;
  3136. let d2Angle = this.d2Gan.ui.rotation;
  3137. this.rootBall.setSpeed(percent, d2Angle);
  3138. this.clearBallAllEft();
  3139. this.changePlayerView();
  3140. }
  3141. onUpdate() {
  3142. if (!this.openCheckStill)
  3143. return;
  3144. this.checkStill();
  3145. }
  3146. checkStill() {
  3147. for (let index = 0; index < this.ballArr.length; index++) {
  3148. if (!this.ballArr[index].isStill()) {
  3149. return;
  3150. }
  3151. }
  3152. xGame.eventMgr.event(ALL_BALL_STOP);
  3153. }
  3154. allBallStop() {
  3155. this.openCheckStill = false;
  3156. xGame.common.recoverCameraView();
  3157. }
  3158. waitShoot() {
  3159. if (!this.d2Gan.ui.isDisposed) {
  3160. this.d2Gan.ui.visible = true;
  3161. }
  3162. if (!this.d2HelpLine.ui.isDisposed) {
  3163. this.d2HelpLine.ui.visible = true;
  3164. }
  3165. this.clearBallAllEft();
  3166. this.showBallRightEft();
  3167. this.getHelpLine();
  3168. this.inHolesSpeed = [];
  3169. this.selectOneBall();
  3170. }
  3171. _getAllBallArr() {
  3172. let arr = this.ballArr;
  3173. let outArr = [];
  3174. for (let index = 0; index < arr.length; index++) {
  3175. if (arr[index] instanceof D2RootBallSrc)
  3176. continue;
  3177. if (arr[index].ballFunc == "ice")
  3178. continue;
  3179. if (arr[index].destroyed)
  3180. continue;
  3181. outArr.push(arr[index]);
  3182. }
  3183. return outArr;
  3184. }
  3185. _getBlackObj() {
  3186. let arr = this.ballArr;
  3187. for (let index = 0; index < arr.length; index++) {
  3188. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3189. return arr[index];
  3190. }
  3191. }
  3192. }
  3193. selectOneBall() {
  3194. let all = this._getAllBallArr();
  3195. let target;
  3196. switch (xGame.common.gameMode) {
  3197. case GameMode.classic:
  3198. if (xGame.common.gameMgr.selfTurn) {
  3199. let self = xGame.common.gameMgr.selfBallArr;
  3200. let black = this._getBlackObj();
  3201. if (xGame.common.gameMgr.ensureBallType) {
  3202. if (self.length > 0) {
  3203. let out = [];
  3204. for (let j = 0; j < all.length; j++) {
  3205. if (self.indexOf(all[j].number) > -1) {
  3206. out.push(all[j]);
  3207. }
  3208. }
  3209. target = this.selectBestEnterOne(out);
  3210. }
  3211. else {
  3212. target = this.selectBestEnterOne([black]);
  3213. }
  3214. }
  3215. else {
  3216. target = this.selectBestEnterOne(all);
  3217. }
  3218. }
  3219. else {
  3220. target = this.selectBestEnterOne(all);
  3221. }
  3222. break;
  3223. case GameMode.bigMove:
  3224. target = this.selectBestEnterOne(all);
  3225. break;
  3226. case GameMode.placeBall:
  3227. if (all.length > 0) {
  3228. target = this.selectBestEnterOne(all);
  3229. }
  3230. break;
  3231. default:
  3232. break;
  3233. }
  3234. if (target && !target.destroyed && target.onClick) {
  3235. target.onClick(0, true);
  3236. let num = -200 + xGame.common.randomNum(0, 400);
  3237. num /= 150;
  3238. if (xGame.common.longHelpLine) {
  3239. num = 0;
  3240. }
  3241. this.destRot += num;
  3242. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3243. }
  3244. }
  3245. removeOneBall(ball) {
  3246. for (let index = 0; index < this.ballArr.length; index++) {
  3247. if (this.ballArr[index].id == ball.id) {
  3248. this.ballArr.splice(index, 1);
  3249. break;
  3250. }
  3251. }
  3252. }
  3253. getHelpLine() {
  3254. this.d2HelpLine.ui.dirDot.visible = false;
  3255. this.isOnSameLine = false;
  3256. let startX = this.rootBall.gameObj.x;
  3257. let startY = this.rootBall.gameObj.y;
  3258. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3259. if (dis == null) {
  3260. this.d2HelpLine.ui.visible = false;
  3261. console.error("辅助线异常");
  3262. return;
  3263. }
  3264. this.d2HelpLine.ui.visible = true;
  3265. let angle = this.d2Gan.ui.rotation;
  3266. let radius = 16.5;
  3267. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3268. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3269. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3270. if (colliObj == null) {
  3271. this.getColliPos(disX, disY, radius, angle);
  3272. xGame.common.d2World.isHelpLineOnBall = false;
  3273. this.targetBall = null;
  3274. this.reflectAngle = 0;
  3275. this.showBallWrongEft();
  3276. }
  3277. else {
  3278. let target = colliObj.src;
  3279. let radius = 16.5;
  3280. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3281. dis1 = Math.sqrt(dis1);
  3282. let realDis = colliObj.disHon - dis1;
  3283. let dir = colliObj.dir;
  3284. let xx = startX + dir.x * realDis;
  3285. let yy = startY + dir.y * realDis;
  3286. this.getColliPos(xx, yy, radius, angle);
  3287. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3288. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3289. let offset = xGame.common.rodOffest;
  3290. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3291. this.isOnSameLine = true;
  3292. }
  3293. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3294. xGame.common.d2World.isHelpLineOnBall = true;
  3295. this.targetBall = target;
  3296. this.reflectAngle = reflectAngle;
  3297. this.showBallWrongEft();
  3298. if (xGame.common.longHelpLine) {
  3299. this.delayReflectLine(target, reflectAngle);
  3300. }
  3301. }
  3302. }
  3303. getBorderDot(startX, startY, angle) {
  3304. let radius = 17;
  3305. let distance;
  3306. let isDone;
  3307. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3308. isDone = this.judgeUpDown(distance, angle, startX);
  3309. if (isDone != null) {
  3310. return isDone;
  3311. }
  3312. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3313. isDone = this.judgeUpDown(distance, angle, startX);
  3314. if (isDone != null) {
  3315. return isDone;
  3316. }
  3317. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3318. isDone = this.judgeLeftRight(distance, angle, startY);
  3319. if (isDone != null) {
  3320. return isDone;
  3321. }
  3322. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3323. isDone = this.judgeLeftRight(distance, angle, startY);
  3324. if (isDone != null) {
  3325. return isDone;
  3326. }
  3327. }
  3328. judgeUpDown(distance, angle, startX) {
  3329. let flag = Math.sin(angle * Math.PI / 180);
  3330. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3331. if (distance >= 0) {
  3332. if (flag > 0) {
  3333. if (temp < this.borderRect.x + this.borderRect.width) {
  3334. return distance;
  3335. }
  3336. }
  3337. else {
  3338. if (temp > this.borderRect.x) {
  3339. return distance;
  3340. }
  3341. }
  3342. }
  3343. }
  3344. judgeLeftRight(distance, angle, starY) {
  3345. let flag = -Math.cos(angle * Math.PI / 180);
  3346. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3347. if (distance >= 0) {
  3348. if (flag > 0) {
  3349. if (temp < this.borderRect.y + this.borderRect.height) {
  3350. return distance;
  3351. }
  3352. }
  3353. else {
  3354. if (temp > this.borderRect.y) {
  3355. return distance;
  3356. }
  3357. }
  3358. }
  3359. }
  3360. clearBallAllEft() {
  3361. let temp;
  3362. for (let index = 0; index < this.ballArr.length; index++) {
  3363. temp = this.ballArr[index];
  3364. temp.clearBallEft();
  3365. }
  3366. }
  3367. showBallRightEft() {
  3368. let gameMgr = xGame.common.gameMgr;
  3369. let temp;
  3370. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3371. if (targetArr.length <= 0)
  3372. return;
  3373. for (let index = 0; index < this.ballArr.length; index++) {
  3374. temp = this.ballArr[index];
  3375. if (targetArr.indexOf(temp.number) > -1) {
  3376. temp.showRightEft();
  3377. }
  3378. }
  3379. }
  3380. showBallWrongEft() {
  3381. let gameMgr = xGame.common.gameMgr;
  3382. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3383. if (targetArr.length <= 0)
  3384. return;
  3385. let temp;
  3386. for (let index = 0; index < this.ballArr.length; index++) {
  3387. temp = this.ballArr[index];
  3388. if (this.targetBall && this.targetBall.number == temp.number) {
  3389. if (targetArr.indexOf(temp.number) <= -1) {
  3390. temp.showWrongEft();
  3391. }
  3392. else {
  3393. temp.clearBallWrongEft();
  3394. }
  3395. }
  3396. else {
  3397. temp.clearBallWrongEft();
  3398. }
  3399. }
  3400. }
  3401. getColliPos(x, y, radius, angle) {
  3402. this.d2HelpLine.ui.x = x;
  3403. this.d2HelpLine.ui.y = y;
  3404. let dirX = x - this.rootBall.gameObj.x;
  3405. let dirY = y - this.rootBall.gameObj.y;
  3406. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3407. if (rectH <= 0)
  3408. rectH = 0;
  3409. this.d2HelpLine.ui.rect.height = 0;
  3410. this.d2HelpLine.ui.rect.height = rectH;
  3411. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3412. if (rectH < this.rootBall.gameObj.width) {
  3413. this.d2HelpLine.ui.rect.visible = false;
  3414. }
  3415. else {
  3416. this.d2HelpLine.ui.rect.visible = true;
  3417. }
  3418. this.d2HelpLine.ui.dir.visible = false;
  3419. this.d2HelpLine.ui.rootDir.visible = false;
  3420. }
  3421. getReflectLine(x, y, radius, target) {
  3422. this.d2HelpLine.ui.dir.visible = true;
  3423. let dirX = target.x - x;
  3424. let dirY = target.y - y;
  3425. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3426. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3427. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3428. this.d2HelpLine.ui.dir.height = 48;
  3429. this.d2HelpLine.ui.dir.rotation = angle;
  3430. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3431. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3432. return angle;
  3433. }
  3434. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3435. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3436. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3437. let targetX = target.gameObj.x;
  3438. let targetY = target.gameObj.y;
  3439. this.outDir.setValue(targetX - xx, targetY - yy);
  3440. this.rootDir.setValue(rtX - xx, rtY - yy);
  3441. let ver = Math.PI / 2;
  3442. let sin = Math.sin(ver);
  3443. let cos = Math.cos(ver);
  3444. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3445. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3446. this.outDir.setValue(outX, outY);
  3447. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3448. Laya.Vector2.normalize(this.outDir, this.outDir);
  3449. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3450. if (Math.abs(result) <= 0.08) {
  3451. this.d2HelpLine.ui.rootDir.visible = false;
  3452. return;
  3453. }
  3454. if (result > 0) {
  3455. angle += 90;
  3456. }
  3457. else if (result < 0) {
  3458. angle -= 90;
  3459. }
  3460. this.d2HelpLine.ui.rootDir.visible = true;
  3461. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3462. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3463. this.d2HelpLine.ui.rootDir.rotation = angle;
  3464. }
  3465. delayReflectLine(obj, angle) {
  3466. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3467. return;
  3468. }
  3469. this.isOnSameLine = false;
  3470. let startX = obj.gameObj.x;
  3471. let startY = obj.gameObj.y;
  3472. let dis = this.getBorderDot(startX, startY, angle);
  3473. if (dis == null) {
  3474. this.d2HelpLine.ui.dirDot.visible = false;
  3475. return;
  3476. }
  3477. this.d2HelpLine.ui.visible = true;
  3478. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3479. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3480. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3481. if (colliObj == null) {
  3482. this.setDelayLine(disX, disY, obj, angle);
  3483. }
  3484. else {
  3485. let radius = 16;
  3486. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3487. dis1 = Math.sqrt(dis1);
  3488. let realDis = colliObj.disHon - dis1;
  3489. let dir = colliObj.dir;
  3490. let xx = startX + dir.x * realDis;
  3491. let yy = startY + dir.y * realDis;
  3492. this.setDelayLine(xx, yy, obj, angle);
  3493. }
  3494. }
  3495. setDelayLine(x, y, obj, angle) {
  3496. let dirX = x - obj.gameObj.x;
  3497. let dirY = y - obj.gameObj.y;
  3498. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3499. if (rectH <= 0)
  3500. rectH = 0;
  3501. this.d2HelpLine.ui.dir.height = rectH;
  3502. this.d2HelpLine.ui.dirDot.visible = true;
  3503. this.d2HelpLine.ui.dirDot.x = 17;
  3504. this.d2HelpLine.ui.dirDot.y = 17;
  3505. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3506. ;
  3507. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3508. }
  3509. changePlayerView() {
  3510. if (Math.random() >= 0.7)
  3511. return;
  3512. if (!this.targetBall) {
  3513. return;
  3514. }
  3515. if (!xGame.common.gameMgr.selfTurn)
  3516. return;
  3517. switch (xGame.common.gameMode) {
  3518. case GameMode.classic:
  3519. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3520. if (this.targetBall.number != 8) {
  3521. return;
  3522. }
  3523. }
  3524. break;
  3525. case GameMode.bigMove:
  3526. return;
  3527. case GameMode.placeBall:
  3528. break;
  3529. default:
  3530. break;
  3531. }
  3532. let startX = this.targetBall.gameObj.x;
  3533. let startY = this.targetBall.gameObj.y;
  3534. let angle = this.reflectAngle;
  3535. let dis = this.getBorderDot(startX, startY, angle);
  3536. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3537. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3538. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3539. if (colliObj) {
  3540. return;
  3541. }
  3542. let offset = 40;
  3543. let posObj = xGame.common.gameMgr.posObj;
  3544. let temp;
  3545. let radius;
  3546. let tarX, tarY;
  3547. for (const key in posObj) {
  3548. temp = posObj[key];
  3549. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3550. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3551. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3552. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3553. xGame.common.showOneCamera("angle" + key);
  3554. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3555. Laya.physicsTimer.scale = 0.7;
  3556. break;
  3557. }
  3558. }
  3559. }
  3560. selectBestEnterOne(arr) {
  3561. this.aiLv = xGame.tools.random(1, 11);
  3562. this.aiLv = 10;
  3563. this.wBall = xGame.common.d2World.rootBall;
  3564. this.rootPos.x = this.wBall.gameObj.x;
  3565. this.rootPos.y = this.wBall.gameObj.y;
  3566. this.initHoleBall(arr);
  3567. return this.selectBall();
  3568. }
  3569. selectBall() {
  3570. let ball = null;
  3571. this.destRot = 0;
  3572. let ai = 110 - this.aiLv * 10;
  3573. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3574. let score = false;
  3575. if (this.scoreBall.length < 1) {
  3576. if (this.lineBall.length < 1) {
  3577. for (let i = 0; i < this.kickBall.length; i++) {
  3578. let list = [];
  3579. let bo = this.kickBall[i];
  3580. let bobj = bo.gameObj;
  3581. let rect = xGame.common.d2World.borderRect;
  3582. let mobj = this.wBall.gameObj;
  3583. let minb = bobj.y - rect.y - 20;
  3584. let minw = mobj.y - rect.y - 50;
  3585. if (minb > 0 && minw > 0) {
  3586. let dlenx = 0;
  3587. let dleny = mobj.y - rect.y;
  3588. let spx = mobj.x;
  3589. let spy = rect.y - dleny;
  3590. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3591. }
  3592. minb = rect.y + rect.height - bobj.y - 20;
  3593. minw = rect.y + rect.height - mobj.y - 50;
  3594. if (minb > 0 && minw > 0) {
  3595. let dlenx = 0;
  3596. let dleny = rect.y + rect.height - mobj.y;
  3597. let spx = mobj.x;
  3598. let spy = rect.y + rect.height + dleny;
  3599. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3600. }
  3601. minb = bobj.x - rect.x - 20;
  3602. minw = mobj.x - rect.x - 50;
  3603. if (minb > 0 && minw > 0) {
  3604. let dlenx = mobj.x - rect.x;
  3605. let dleny = 0;
  3606. let spx = rect.x - dlenx;
  3607. let spy = mobj.y;
  3608. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3609. }
  3610. minb = rect.x + rect.width - bobj.x - 20;
  3611. minw = rect.x + rect.width - mobj.x - 50;
  3612. if (minb > 0 && minw > 0) {
  3613. let dlenx = rect.x + rect.width - mobj.x;
  3614. let dleny = 0;
  3615. let spx = rect.x + rect.width + dlenx;
  3616. let spy = mobj.y;
  3617. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3618. }
  3619. list.sort(function (a, b) {
  3620. return a.order - b.order;
  3621. });
  3622. for (let i = 0; i < list.length; i++) {
  3623. let data = list[i];
  3624. let mx = mobj.x - bobj.x;
  3625. let my = mobj.y - bobj.y;
  3626. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3627. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3628. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3629. if (num > 1)
  3630. num = 1;
  3631. let cos = Math.acos(num);
  3632. if (cos > 1.57)
  3633. cos = 1.57;
  3634. else if (cos < 0.01)
  3635. cos = 0.01;
  3636. let tan = Math.tan(cos);
  3637. let dx = tan * data.dleny;
  3638. let dy = tan * data.dlenx;
  3639. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3640. if (Math.abs(bx - 667) < 40)
  3641. continue;
  3642. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3643. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3644. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3645. this.forceMax = dis * 0.08;
  3646. this.destRot += mis * 0.1;
  3647. this.setKick(bx, by);
  3648. return true;
  3649. }
  3650. }
  3651. }
  3652. }
  3653. else {
  3654. ball = xGame.common.getRandArrEle(this.lineBall);
  3655. }
  3656. }
  3657. else {
  3658. for (let i = 0; i < this.scoreBall.length; i++) {
  3659. if (i < this.scoreBall.length - 1) {
  3660. let rand = 70 + this.aiLv * 10 + i * 10;
  3661. if (xGame.tools.random(0, 100) < rand) {
  3662. ball = this.scoreBall[i];
  3663. break;
  3664. }
  3665. }
  3666. else {
  3667. ball = this.scoreBall[i];
  3668. break;
  3669. }
  3670. }
  3671. score = true;
  3672. this.selectNum++;
  3673. }
  3674. if (!ball)
  3675. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3676. let dx = ball.gameObj.x;
  3677. let dy = ball.gameObj.y;
  3678. let kickAngle = 0;
  3679. if (score) {
  3680. dx = ball.kickPos.x;
  3681. dy = ball.kickPos.y;
  3682. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3683. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3684. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3685. if (adot > 1)
  3686. adot = 1;
  3687. kickAngle = Math.acos(adot) * 57.3;
  3688. if (kickAngle > 45) {
  3689. let kdx = ball.kickPos.x - ball.gameObj.x;
  3690. let kdy = ball.kickPos.y - ball.gameObj.y;
  3691. dx = ball.kickPos.x - kdx * mis * 0.3;
  3692. dy = ball.kickPos.y - kdy * mis * 0.3;
  3693. }
  3694. else
  3695. this.destRot += mis;
  3696. }
  3697. else if (ball.poleAngle != 0) {
  3698. this.destRot += ball.poleAngle;
  3699. }
  3700. if (xGame.common.gameMode == 0) {
  3701. let af = kickAngle * 0.08;
  3702. this.forceMax = ball.hard * 0.1 + af * af;
  3703. }
  3704. this.setKick(dx, dy);
  3705. return ball;
  3706. }
  3707. initHoleBall(arr) {
  3708. this.kickBall = [];
  3709. this.lineBall = [];
  3710. this.scoreBall = [];
  3711. this.holeBall = [];
  3712. this.selectNum = 0;
  3713. this.forceNum = 0;
  3714. this.forceMax = 0;
  3715. this.turnNum = 0;
  3716. let list = arr;
  3717. let holes = xGame.common.gameMgr.holePosList;
  3718. let self = xGame.common.aiPlayer;
  3719. for (let i = 0; i < list.length; i++) {
  3720. let obj = list[i];
  3721. if (!obj)
  3722. continue;
  3723. obj.kickPos.x = 0;
  3724. obj.kickPos.y = 0;
  3725. obj.poleAngle = 0;
  3726. obj.hard = 0;
  3727. obj.borderDis = 0;
  3728. obj.kickAngle = 180;
  3729. let b = obj.gameObj;
  3730. let wbp = this.rootPos;
  3731. let bx = wbp.x - b.x;
  3732. let by = wbp.y - b.y;
  3733. obj.borderDis = xGame.tools.random(0, 100);
  3734. this.kickBall.push(obj);
  3735. if (!this.isLine(wbp, obj))
  3736. continue;
  3737. obj.kickAngle = xGame.tools.random(90, 180);
  3738. obj.kickPos.x = b.x;
  3739. obj.kickPos.y = b.y;
  3740. this.lineBall.push(obj);
  3741. let minDis = 999999;
  3742. let hole = false;
  3743. for (let j = 0; j < holes.length; j++) {
  3744. let hp = holes[j];
  3745. if (bx >= 0 && hp.x > b.x + 100)
  3746. continue;
  3747. if (bx <= 0 && hp.x < b.x - 100)
  3748. continue;
  3749. if (by < -10 && hp.y < wbp.y)
  3750. continue;
  3751. if (by > 10 && hp.y > wbp.y)
  3752. continue;
  3753. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3754. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3755. if (dis < minDis) {
  3756. let dx = b.x - this.tempDir1.x * this.ballSize;
  3757. let dy = b.y - this.tempDir1.y * this.ballSize;
  3758. this.tempDir3.x = this.tempDir1.x;
  3759. this.tempDir3.y = this.tempDir1.y;
  3760. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3761. obj.kickPos.x = dx;
  3762. obj.kickPos.y = dy;
  3763. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3764. if (num > 1)
  3765. num = 1;
  3766. obj.kickAngle = Math.acos(num) * 57.3;
  3767. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3768. dis = dis * 2;
  3769. if (Math.abs(hp.x - 600) < 100)
  3770. dis += 50;
  3771. obj.hard = dis + obj.kickAngle * 3;
  3772. hole = true;
  3773. }
  3774. }
  3775. }
  3776. }
  3777. if (hole) {
  3778. this.scoreBall.push(obj);
  3779. this.holeBall.push(obj);
  3780. }
  3781. }
  3782. this.scoreBall.sort(function (a, b) {
  3783. return a.hard - b.hard;
  3784. });
  3785. this.holeBall.sort(function (a, b) {
  3786. return a.kickAngle - b.kickAngle;
  3787. });
  3788. this.kickBall.sort(function (a, b) {
  3789. return a.borderDis - b.borderDis;
  3790. });
  3791. }
  3792. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3793. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3794. let balls = xGame.common.d2World.ballArr;
  3795. let max = xGame.tools.getDis(hx, hy, bx, by);
  3796. for (let index = 0; index < balls.length; index++) {
  3797. let obj = balls[index];
  3798. if (obj.number == 0)
  3799. continue;
  3800. if (obj.number == bn || obj.number == dn)
  3801. continue;
  3802. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3803. if (dis * dis > max)
  3804. continue;
  3805. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3806. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3807. if (num > 1)
  3808. num = 1;
  3809. if (num < 0)
  3810. continue;
  3811. let gap = Math.sin(Math.acos(num)) * dis;
  3812. if (gap < this.ballSize)
  3813. return true;
  3814. }
  3815. return false;
  3816. }
  3817. isLine(xy, ball) {
  3818. let bx = xy.x;
  3819. let by = xy.y;
  3820. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3821. let dis = ball.getDestDis(xy);
  3822. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3823. let sin = Math.sin(angle);
  3824. let cos = Math.cos(angle);
  3825. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3826. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3827. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3828. let dx = bx + this.tempDir2.x * dis;
  3829. let dy = by + this.tempDir2.y * dis;
  3830. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3831. sin = Math.sin(-angle);
  3832. cos = Math.cos(-angle);
  3833. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3834. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3835. dx = bx + this.tempDir2.x * dis;
  3836. dy = by + this.tempDir2.y * dis;
  3837. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  3838. if (isr && isl)
  3839. return false;
  3840. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  3841. }
  3842. return true;
  3843. }
  3844. setKick(dx, dy) {
  3845. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  3846. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3847. this.tempDir1.x = 0;
  3848. this.tempDir1.y = 1;
  3849. this.tempDir2.y = -this.tempDir2.y;
  3850. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3851. if (num > 1)
  3852. num = 1;
  3853. let rot = Math.acos(num) * 57.3;
  3854. if (this.tempDir2.x < 0)
  3855. rot = 360 - rot;
  3856. this.destRot += rot;
  3857. }
  3858. }
  3859. class ui_UIGame extends fgui.GComponent {
  3860. static createInstance() {
  3861. return (fgui.UIPackage.createObject("game", "UIGame"));
  3862. }
  3863. onConstruct() {
  3864. this.c1 = this.getController("c1");
  3865. this.d3Root = (this.getChild("d3Root"));
  3866. this.clickNode = (this.getChild("clickNode"));
  3867. this.d2Root = (this.getChild("d2Root"));
  3868. this.topNode = (this.getChild("topNode"));
  3869. this.n72 = (this.getChild("n72"));
  3870. this.n40 = (this.getChild("n40"));
  3871. this.rulerNode = (this.getChild("rulerNode"));
  3872. this.rulerClickNode = (this.getChild("rulerClickNode"));
  3873. this.n50 = (this.getChild("n50"));
  3874. this.keduNode = (this.getChild("keduNode"));
  3875. this.powerTxt = (this.getChild("powerTxt"));
  3876. this.powerNode = (this.getChild("powerNode"));
  3877. this.colorNode = (this.getChild("colorNode"));
  3878. this.powerEft = (this.getChild("powerEft"));
  3879. this.myPowerNode = (this.getChild("myPowerNode"));
  3880. this.ganNode = (this.getChild("ganNode"));
  3881. this.rodMethodNode = (this.getChild("rodMethodNode"));
  3882. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  3883. this.placeNormalNode = (this.getChild("placeNormalNode"));
  3884. this.skillRod = (this.getChild("skillRod"));
  3885. this.border = (this.getChild("border"));
  3886. this.bigSkillNode = (this.getChild("bigSkillNode"));
  3887. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  3888. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  3889. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  3890. this.awardSpineNode = (this.getChild("awardSpineNode"));
  3891. this.guanyuNode = (this.getChild("guanyuNode"));
  3892. this.helpBtn = (this.getChild("helpBtn"));
  3893. this.wordsBtn = (this.getChild("wordsBtn"));
  3894. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  3895. this.returnBtn = (this.getChild("returnBtn"));
  3896. this.ballNode = (this.getChild("ballNode"));
  3897. this.whiteAni = (this.getChild("whiteAni"));
  3898. this.blackAni = (this.getChild("blackAni"));
  3899. this.selfTurn = (this.getChild("selfTurn"));
  3900. this.aiTurn = (this.getChild("aiTurn"));
  3901. this.deskNode = (this.getChild("deskNode"));
  3902. this.moveNode = (this.getChild("moveNode"));
  3903. this.selfTalk = (this.getChild("selfTalk"));
  3904. this.aiTalk = (this.getChild("aiTalk"));
  3905. this.d2Node = (this.getChild("d2Node"));
  3906. this.snowNode = (this.getChild("snowNode"));
  3907. this.guide2 = (this.getChild("guide2"));
  3908. this.guide1 = (this.getChild("guide1"));
  3909. this.guide3 = (this.getChild("guide3"));
  3910. this.guideNode = (this.getChild("guideNode"));
  3911. }
  3912. }
  3913. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  3914. class ui_UIGameEnd extends fgui.GComponent {
  3915. static createInstance() {
  3916. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  3917. }
  3918. onConstruct() {
  3919. this.c1 = this.getController("c1");
  3920. this.n22 = (this.getChild("n22"));
  3921. this.n2 = (this.getChild("n2"));
  3922. this.n52 = (this.getChild("n52"));
  3923. this.n53 = (this.getChild("n53"));
  3924. this.coinNode = (this.getChild("coinNode"));
  3925. this.closeNode = (this.getChild("closeNode"));
  3926. this.moneyNode = (this.getChild("moneyNode"));
  3927. this.secretary = (this.getChild("secretary"));
  3928. this.n27 = (this.getChild("n27"));
  3929. this.n29 = (this.getChild("n29"));
  3930. this.talkNode = (this.getChild("talkNode"));
  3931. this.n38 = (this.getChild("n38"));
  3932. this.n39 = (this.getChild("n39"));
  3933. this.n40 = (this.getChild("n40"));
  3934. this.awardNode = (this.getChild("awardNode"));
  3935. this.starNumNode = (this.getChild("starNumNode"));
  3936. this.n47 = (this.getChild("n47"));
  3937. this.conditionNode = (this.getChild("conditionNode"));
  3938. this.isGetAward = (this.getChild("isGetAward"));
  3939. this.leftBtn = (this.getChild("leftBtn"));
  3940. this.rightBtn = (this.getChild("rightBtn"));
  3941. this.btnNode = (this.getChild("btnNode"));
  3942. }
  3943. }
  3944. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  3945. class ui_UIAddCoin extends fgui.GComponent {
  3946. static createInstance() {
  3947. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  3948. }
  3949. onConstruct() {
  3950. this.n11 = (this.getChild("n11"));
  3951. this.myNode = (this.getChild("myNode"));
  3952. this.t0 = this.getTransition("t0");
  3953. }
  3954. }
  3955. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  3956. class UIAddCoin extends UIBase {
  3957. constructor() {
  3958. super();
  3959. this.coinNum = 2000;
  3960. }
  3961. onConstructor() {
  3962. this.ui = ui_UIAddCoin.createInstance();
  3963. this.contentPane = this.ui;
  3964. this.isEject = false;
  3965. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  3966. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  3967. }
  3968. show() {
  3969. super.show();
  3970. this.ui.t0.play();
  3971. }
  3972. videoAddCoin() {
  3973. Moyu.showVideoAd(() => {
  3974. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  3975. this.hide();
  3976. }, EAdType.addFailCoin);
  3977. }
  3978. }
  3979. UIAddCoin.uiName = "UIAddCoin";
  3980. class ui_UIInvitation extends fgui.GComponent {
  3981. static createInstance() {
  3982. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  3983. }
  3984. onConstruct() {
  3985. this.n14 = (this.getChild("n14"));
  3986. this.myNode = (this.getChild("myNode"));
  3987. this.t0 = this.getTransition("t0");
  3988. }
  3989. }
  3990. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  3991. class UIInvitation extends UIBase {
  3992. constructor() {
  3993. super();
  3994. }
  3995. onConstructor() {
  3996. this.ui = ui_UIInvitation.createInstance();
  3997. this.contentPane = this.ui;
  3998. this.isEject = false;
  3999. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4000. }
  4001. show() {
  4002. super.show();
  4003. }
  4004. enterGame() {
  4005. xGame.common.gameMode = GameMode.classic;
  4006. DataMgr.setChallengeTimes(1);
  4007. xGame.common.passAwardCoin = 2000;
  4008. let need = xGame.common.classicNiceNeddCoin;
  4009. if (DataMgr.coinEnough(need)) {
  4010. DataMgr.setCoin(-need);
  4011. xGame.eventMgr.event(RESTART_GAME, true);
  4012. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4013. }
  4014. else {
  4015. xGame.eventMgr.event(RESTART_GAME, true);
  4016. }
  4017. this.hide();
  4018. }
  4019. hide() {
  4020. super.hide();
  4021. }
  4022. }
  4023. UIInvitation.uiName = "UIInvitation";
  4024. class ui_UIMain extends fgui.GComponent {
  4025. static createInstance() {
  4026. return (fgui.UIPackage.createObject("game", "UIMain"));
  4027. }
  4028. onConstruct() {
  4029. this.n47 = (this.getChild("n47"));
  4030. this.n10 = (this.getChild("n10"));
  4031. this.secretary = (this.getChild("secretary"));
  4032. this.n33 = (this.getChild("n33"));
  4033. this.shopBtn = (this.getChild("shopBtn"));
  4034. this.moneyNode = (this.getChild("moneyNode"));
  4035. this.headNode = (this.getChild("headNode"));
  4036. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4037. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4038. this.classicBtn = (this.getChild("classicBtn"));
  4039. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4040. this.globalBtn = (this.getChild("globalBtn"));
  4041. this.n44 = (this.getChild("n44"));
  4042. this.signBtn = (this.getChild("signBtn"));
  4043. this.drawBtn = (this.getChild("drawBtn"));
  4044. this.settingNode = (this.getChild("settingNode"));
  4045. this.n45 = (this.getChild("n45"));
  4046. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4047. this.n46 = (this.getChild("n46"));
  4048. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4049. this.liucheng1 = (this.getChild("liucheng1"));
  4050. this.rightBtn = (this.getChild("rightBtn"));
  4051. this.n75 = (this.getChild("n75"));
  4052. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4053. this.liucheng2 = (this.getChild("liucheng2"));
  4054. this.guideBtn = (this.getChild("guideBtn"));
  4055. this.n73 = (this.getChild("n73"));
  4056. this.wordsNode = (this.getChild("wordsNode"));
  4057. this.enterGuide = (this.getChild("enterGuide"));
  4058. this.talkNode = (this.getChild("talkNode"));
  4059. this.n83 = (this.getChild("n83"));
  4060. this.n84 = (this.getChild("n84"));
  4061. }
  4062. }
  4063. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4064. class ui_UIMoyu extends fgui.GComponent {
  4065. static createInstance() {
  4066. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4067. }
  4068. onConstruct() {
  4069. this.ageTip = (this.getChild("ageTip"));
  4070. this.mainBg = (this.getChild("mainBg"));
  4071. this.xyNode = (this.getChild("xyNode"));
  4072. this.rnNode = (this.getChild("rnNode"));
  4073. this.fcmNode = (this.getChild("fcmNode"));
  4074. this.ageNode = (this.getChild("ageNode"));
  4075. this.tipNode = (this.getChild("tipNode"));
  4076. this.msgNode = (this.getChild("msgNode"));
  4077. }
  4078. }
  4079. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4080. class MoyuMgr {
  4081. static initMoyu() {
  4082. this.moyuView = new MoyuView();
  4083. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4084. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4085. this.moyuView.ui.displayObject.zOrder = 1000;
  4086. this.moyuView.init();
  4087. this.moyuView.showTip(true);
  4088. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4089. window['XApk'] = this;
  4090. }
  4091. static showAge(show) {
  4092. if (this.moyuView)
  4093. this.moyuView.showAge(show);
  4094. }
  4095. static onPlatMsg(idx) {
  4096. if (!MoyuMgr.moyuView)
  4097. return;
  4098. if (idx == '0') {
  4099. MoyuMgr.moyuView.showTip(false);
  4100. }
  4101. }
  4102. static showAgree(call) {
  4103. if (this.moyuView)
  4104. this.moyuView.showAgree(call);
  4105. else
  4106. call && call();
  4107. }
  4108. static showXy(type = 1) {
  4109. if (this.moyuView)
  4110. this.moyuView.showXy(type);
  4111. }
  4112. }
  4113. MoyuMgr.isAdvise = false;
  4114. class MoyuView {
  4115. constructor() {
  4116. this.ysxyNum = 1;
  4117. this.ysJson = null;
  4118. this.ui = ui_UIMoyu.createInstance();
  4119. }
  4120. init() {
  4121. this.ui.mainBg.visible = false;
  4122. this.ui.xyNode.visible = false;
  4123. this.ui.ageNode.visible = false;
  4124. this.ui.tipNode.visible = false;
  4125. this.ui.rnNode.visible = false;
  4126. this.ui.fcmNode.visible = false;
  4127. this.ui.ageTip.visible = false;
  4128. this.ui.msgNode.visible = false;
  4129. this.ui.visible = false;
  4130. this.ui.xyNode.xyList.setVirtual();
  4131. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4132. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4133. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4134. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4135. this.ui.xyNode.btnKnown.visible = false;
  4136. this.ui.xyNode.xy1.visible = false;
  4137. this.ui.xyNode.xy2.visible = false;
  4138. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4139. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4140. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4141. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4142. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4143. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4144. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4145. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4146. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4147. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4148. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4149. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4150. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4151. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4152. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4153. this.ysxyNum = 2;
  4154. }
  4155. }
  4156. onClick(obj) {
  4157. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4158. switch (obj) {
  4159. case this.ui.ageTip:
  4160. if (Moyu.isTTApk) {
  4161. this.ui.ageNode.visible = true;
  4162. this.ui.mainBg.visible = true;
  4163. }
  4164. break;
  4165. case this.ui.tipNode:
  4166. this.showTip(false);
  4167. break;
  4168. case this.ui.ageNode.btnAge:
  4169. this.ui.ageNode.visible = false;
  4170. this.ui.mainBg.visible = false;
  4171. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4172. this.ui.visible = false;
  4173. break;
  4174. case this.ui.xyNode.btnXy3:
  4175. case this.ui.xyNode.btnXy1:
  4176. this.loadXy(1);
  4177. break;
  4178. case this.ui.xyNode.btnXy2:
  4179. this.loadXy(2);
  4180. break;
  4181. case this.ui.xyNode.btnBack:
  4182. this.ui.xyNode.xy1.visible = true;
  4183. this.ui.xyNode.xy2.visible = false;
  4184. break;
  4185. case this.ui.xyNode.btnKnown:
  4186. this.ui.xyNode.visible = false;
  4187. this.ui.mainBg.visible = false;
  4188. this.ui.visible = false;
  4189. break;
  4190. case this.ui.rnNode.btnCheck:
  4191. this.check();
  4192. break;
  4193. case this.ui.rnNode.btnExit:
  4194. case this.ui.xyNode.btnNo:
  4195. this.ysxyNum--;
  4196. if (this.ysxyNum > 0)
  4197. this.showMsg("Refuse to quit the game once again");
  4198. else {
  4199. Moyu.userAgree(false);
  4200. Moyu.exit();
  4201. }
  4202. break;
  4203. case this.ui.xyNode.btnSure:
  4204. case this.ui.xyNode.btnYes:
  4205. DataMgr.userData.isAgree = true;
  4206. DataMgr.saveUserData();
  4207. this.onAgree();
  4208. break;
  4209. case this.ui.rnNode.btnDone:
  4210. this.ui.rnNode.visible = false;
  4211. this.ui.visible = false;
  4212. break;
  4213. case this.ui.fcmNode.btnRn:
  4214. this.showRn();
  4215. break;
  4216. }
  4217. }
  4218. showTip(show) {
  4219. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4220. return;
  4221. if (show) {
  4222. MoyuMgr.isAdvise = true;
  4223. this.ui.visible = true;
  4224. this.ui.tipNode.visible = true;
  4225. this.ui.tipNode.alpha = 1;
  4226. Laya.timer.once(1000, this, this.showTip, [false]);
  4227. }
  4228. else {
  4229. this.ui.tipNode.alpha = 1;
  4230. this.ui.tipNode.visible = true;
  4231. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4232. this.ui.tipNode.visible = false;
  4233. MoyuMgr.isAdvise = false;
  4234. }), 1000);
  4235. }
  4236. }
  4237. showAge(show, px = 0, py = 0) {
  4238. if (Moyu.platType > 10 && !Moyu.isIos) {
  4239. this.ui.ageTip.x = px;
  4240. this.ui.ageTip.y = py;
  4241. this.ui.ageTip.visible = show;
  4242. if (show)
  4243. this.ui.visible = true;
  4244. }
  4245. }
  4246. showAgree(call) {
  4247. this.agreeCall = call;
  4248. this.onAgree();
  4249. return;
  4250. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4251. this.showXy(0);
  4252. }
  4253. else
  4254. this.onAgree();
  4255. }
  4256. onAgree() {
  4257. if (!this.ui.ageNode.visible)
  4258. this.ui.visible = false;
  4259. this.ui.xyNode.visible = false;
  4260. Moyu.userAgree(true);
  4261. this.showAge(false);
  4262. this.agreeCall && this.agreeCall();
  4263. this.showRn();
  4264. }
  4265. showMsg(txt) {
  4266. this.ui.msgNode.txtMsg.text = txt;
  4267. this.ui.msgNode.visible = true;
  4268. this.ui.msgNode.alpha = 1;
  4269. this.ui.visible = true;
  4270. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4271. this.ui.msgNode.visible = false;
  4272. }), 2500, true);
  4273. }
  4274. showRn() {
  4275. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4276. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4277. this.ui.rnNode.rn1.visible = true;
  4278. this.ui.rnNode.rn2.visible = false;
  4279. this.ui.rnNode.rn3.visible = false;
  4280. this.ui.rnNode.rn4.visible = false;
  4281. this.ui.rnNode.visible = true;
  4282. this.ui.mainBg.visible = true;
  4283. this.ui.rnNode.btnDone.visible = false;
  4284. this.ui.rnNode.btnExit.visible = true;
  4285. this.ui.rnNode.btnCheck.visible = true;
  4286. this.ui.fcmNode.visible = false;
  4287. this.ui.visible = true;
  4288. return;
  4289. }
  4290. }
  4291. this.showFcm();
  4292. }
  4293. showFcm() {
  4294. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4295. Moyu.initFCM(true);
  4296. if (Moyu.gameTime < 1)
  4297. this.fcmLoop();
  4298. else if (Moyu.gameTime < 999)
  4299. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4300. }
  4301. }
  4302. fcmLoop() {
  4303. if (Moyu.gameTime < 1) {
  4304. this.ui.rnNode.visible = false;
  4305. this.ui.fcmNode.visible = true;
  4306. this.ui.mainBg.visible = true;
  4307. this.ui.visible = true;
  4308. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4309. Laya.timer.clear(this.ui, this.fcmLoop);
  4310. }
  4311. }
  4312. check() {
  4313. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4314. this.ui.rnNode.rn1.visible = false;
  4315. this.ui.rnNode.rn2.visible = false;
  4316. this.ui.rnNode.rn4.visible = true;
  4317. }
  4318. else if (this.ui.rnNode.rn4.visible) {
  4319. let name = this.ui.rnNode.inputName.text;
  4320. let code = this.ui.rnNode.inputCode.text;
  4321. if (code && code.length == 18) {
  4322. this.ui.rnNode.rn1.visible = false;
  4323. this.ui.rnNode.rn4.visible = false;
  4324. Moyu.authenticate(name, code, (res) => {
  4325. this.ui.rnNode.rn2.visible = !res;
  4326. this.ui.rnNode.rn3.visible = res;
  4327. this.ui.rnNode.btnDone.visible = res;
  4328. this.ui.rnNode.btnExit.visible = !res;
  4329. this.ui.rnNode.btnCheck.visible = !res;
  4330. if (res)
  4331. this.showFcm();
  4332. });
  4333. }
  4334. else
  4335. this.showMsg("信息填写不完整");
  4336. }
  4337. }
  4338. loadXy(type = 0) {
  4339. this.ui.xyNode.xy1.visible = false;
  4340. this.ui.xyNode.xy2.visible = true;
  4341. this.ui.xyNode.xyList.scrollToView(0);
  4342. if (type == 1) {
  4343. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4344. }
  4345. else if (type == 2) {
  4346. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4347. }
  4348. }
  4349. showXy(type = 0) {
  4350. this.xyBtn();
  4351. if (type == 0) {
  4352. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4353. this.ui.xyNode.btnSure.visible = true;
  4354. }
  4355. else {
  4356. this.ui.xyNode.btnYes.visible = true;
  4357. this.ui.xyNode.btnNo.visible = true;
  4358. }
  4359. }
  4360. else {
  4361. this.ui.xyNode.btnKnown.visible = true;
  4362. this.ui.mainBg.visible = true;
  4363. }
  4364. this.ui.xyNode.xy1.visible = true;
  4365. this.ui.xyNode.xy2.visible = false;
  4366. this.ui.xyNode.visible = true;
  4367. this.ui.visible = true;
  4368. }
  4369. xyBtn() {
  4370. this.ui.xyNode.btnSure.visible = false;
  4371. this.ui.xyNode.btnYes.visible = false;
  4372. this.ui.xyNode.btnNo.visible = false;
  4373. this.ui.xyNode.btnKnown.visible = false;
  4374. {
  4375. this.ui.xyNode.btnXy3.visible = false;
  4376. this.ui.xyNode.btnXy2.visible = true;
  4377. this.ui.xyNode.btnXy1.visible = true;
  4378. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4379. }
  4380. }
  4381. createXY(json) {
  4382. this.ysJson = json.content;
  4383. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4384. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4385. this.ui.xyNode.xy2.visible = true;
  4386. }
  4387. renderListItem(idx, cell) {
  4388. let xy = this.ysJson[idx];
  4389. cell.height = xy.line * 30;
  4390. cell.xyItem.text = xy.text;
  4391. }
  4392. onDestroy() {
  4393. this.agreeCall = null;
  4394. }
  4395. }
  4396. class SettingNode {
  4397. constructor(ui) {
  4398. this.showSetting = false;
  4399. this.openSound = true;
  4400. this.openShake = true;
  4401. this.ui = ui;
  4402. this.ui.soundBtn.onClick(this, this.switchSound);
  4403. this.ui.shakeBtn.onClick(this, this.switchShake);
  4404. this.ui.xyBtn.onClick(this, this.onXy);
  4405. this.ui.clickNode.onClick(this, this.changeSetting);
  4406. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4407. this.ui.xyBtn.visible = false;
  4408. this.ui.shakeBtn.visible = false;
  4409. }
  4410. changeSetting() {
  4411. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4412. this.showSetting = !this.showSetting;
  4413. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4414. }
  4415. switchSound() {
  4416. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4417. this.openSound = !this.openSound;
  4418. Moyu.onSetting(this.openSound, this.openShake);
  4419. xGame.soundMgr.onSetting(this.openSound);
  4420. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4421. }
  4422. switchShake() {
  4423. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4424. this.openShake = !this.openShake;
  4425. Moyu.onSetting(this.openSound, this.openShake);
  4426. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4427. }
  4428. onXy() {
  4429. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4430. MoyuMgr.showXy(1);
  4431. }
  4432. }
  4433. class ui_UILevelDisplay extends fgui.GComponent {
  4434. static createInstance() {
  4435. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4436. }
  4437. onConstruct() {
  4438. this.n9 = (this.getChild("n9"));
  4439. this.myNode = (this.getChild("myNode"));
  4440. this.closeNode = (this.getChild("closeNode"));
  4441. }
  4442. }
  4443. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4444. class ui_UILevelProp extends fgui.GComponent {
  4445. static createInstance() {
  4446. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4447. }
  4448. onConstruct() {
  4449. this.n16 = (this.getChild("n16"));
  4450. this.myNode = (this.getChild("myNode"));
  4451. this.closeBtn = (this.getChild("closeBtn"));
  4452. this.moneyNode = (this.getChild("moneyNode"));
  4453. this.t1 = this.getTransition("t1");
  4454. }
  4455. }
  4456. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4457. class ui_ShowItem extends fgui.GComponent {
  4458. static createInstance() {
  4459. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4460. }
  4461. onConstruct() {
  4462. this.myImg = (this.getChild("myImg"));
  4463. }
  4464. }
  4465. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4466. class ShowItem {
  4467. constructor() {
  4468. this.ui = ui_ShowItem.createInstance();
  4469. }
  4470. destroySelf() {
  4471. if (!this.ui.isDisposed) {
  4472. this.ui.removeFromParent();
  4473. this.ui.dispose();
  4474. }
  4475. }
  4476. setParent(parent) {
  4477. parent.addChild(this.ui);
  4478. }
  4479. setPos(x, y) {
  4480. this.ui.x = x;
  4481. this.ui.y = y;
  4482. }
  4483. setUrl(index) {
  4484. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4485. }
  4486. }
  4487. class ui_UIPower extends fgui.GComponent {
  4488. static createInstance() {
  4489. return (fgui.UIPackage.createObject("game", "UIPower"));
  4490. }
  4491. onConstruct() {
  4492. this.n11 = (this.getChild("n11"));
  4493. this.myNode = (this.getChild("myNode"));
  4494. this.t0 = this.getTransition("t0");
  4495. }
  4496. }
  4497. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4498. class UIPower extends UIBase {
  4499. constructor() {
  4500. super();
  4501. }
  4502. onConstructor() {
  4503. this.ui = ui_UIPower.createInstance();
  4504. this.contentPane = this.ui;
  4505. this.isEject = false;
  4506. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4507. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4508. }
  4509. show() {
  4510. super.show();
  4511. this.ui.t0.play();
  4512. }
  4513. videoGetPower() {
  4514. Moyu.showVideoAd(() => {
  4515. DataMgr.setPower(xGame.common.videoPower, true);
  4516. xGame.eventMgr.event(POWER_TIME);
  4517. this.hide();
  4518. }, EAdType.getPower);
  4519. }
  4520. }
  4521. UIPower.uiName = "UIPower";
  4522. class UILevelProp extends UIBase {
  4523. constructor() {
  4524. super();
  4525. this.firstPos = 385;
  4526. this.secondPos = 467;
  4527. this.showItemArr = [];
  4528. }
  4529. onConstructor() {
  4530. this.ui = ui_UILevelProp.createInstance();
  4531. this.contentPane = this.ui;
  4532. this.isEject = false;
  4533. this.addUIClick(this.ui.closeBtn, this.hide);
  4534. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4535. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4536. }
  4537. show(level) {
  4538. super.show();
  4539. this.ui.t1.play();
  4540. this.level = level;
  4541. this.data = cfgTable.placeballData[this.level];
  4542. this.updateSelf();
  4543. this.showPreView();
  4544. this.moneyNode.ui.c1.selectedIndex = 2;
  4545. this.moneyNode.checkPowerTime();
  4546. this.moneyNode.powerChange();
  4547. }
  4548. showPreView() {
  4549. let item;
  4550. let data;
  4551. for (let index = 0; index < this.showItemArr.length; index++) {
  4552. item = this.showItemArr[index];
  4553. item.destroySelf();
  4554. }
  4555. this.showItemArr = [];
  4556. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4557. for (const key in cfgData) {
  4558. data = cfgData[key];
  4559. item = new ShowItem();
  4560. item.setParent(this.ui.myNode.displayRoot);
  4561. item.setPos(data.x, data.y);
  4562. item.setUrl(data.value);
  4563. this.showItemArr.push(item);
  4564. }
  4565. }
  4566. updateSelf() {
  4567. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4568. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4569. if (this.data.ball == -1) {
  4570. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4571. }
  4572. else {
  4573. this.ui.myNode.conditionTxt.text = "Reward";
  4574. }
  4575. let localData = DataMgr.getPlaceBallLevel(this.level);
  4576. let getAward = localData.getAward;
  4577. let cfg = cfgTable.placeballData[this.level];
  4578. let coin = this.data.award[0];
  4579. let diamond = this.data.award[1];
  4580. if (cfg.type == PlaceBallType.challenge) {
  4581. diamond = 0;
  4582. coin = 100;
  4583. }
  4584. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4585. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4586. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4587. if (cfg.type == PlaceBallType.challenge) {
  4588. this.ui.myNode.coinNode.numTxt.text = "";
  4589. }
  4590. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4591. if (coin > 0 && diamond > 0) {
  4592. this.ui.myNode.diamondNode.x = 385;
  4593. this.ui.myNode.coinNode.x = 467;
  4594. }
  4595. else {
  4596. this.ui.myNode.diamondNode.x = 385;
  4597. this.ui.myNode.coinNode.x = 385;
  4598. }
  4599. if (!getAward) {
  4600. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4601. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4602. }
  4603. else {
  4604. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4605. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4606. }
  4607. }
  4608. startGame() {
  4609. if (DataMgr.powerEnough()) {
  4610. this.ui.myNode.startBtn.touchable = false;
  4611. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4612. console.log('zh:startGame ');
  4613. this.ui.myNode.startBtn.touchable = true;
  4614. DataMgr.setPower(-1);
  4615. xGame.eventMgr.event(POWER_TIME);
  4616. xGame.common.gameMode = GameMode.placeBall;
  4617. xGame.common.placeBallCurLevel = this.level;
  4618. xGame.uiMgr.Show(UIGame);
  4619. xGame.uiMgr.Hide(UILevelDisplay);
  4620. xGame.uiMgr.Hide(UIMain);
  4621. this.hide();
  4622. }));
  4623. }
  4624. else {
  4625. console.log('zh:startGame no power');
  4626. xGame.uiMgr.Show(UIPower);
  4627. }
  4628. }
  4629. hide() {
  4630. super.hide();
  4631. }
  4632. }
  4633. UILevelProp.uiName = "UILevelProp";
  4634. class PutBallLevelDisplay {
  4635. constructor(ui, index) {
  4636. this.index = 0;
  4637. this.ui = ui;
  4638. this.index = index;
  4639. this.ui.onClick(this, this.clickSelf);
  4640. this.updateSelf();
  4641. this.ui.levelTxt.text = (this.index + 1) + "";
  4642. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4643. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4644. }
  4645. updateSelf() {
  4646. let level = this.index + 1;
  4647. this.data = DataMgr.getPlaceBallLevel(level);
  4648. this.ui.starNode.c1.selectedIndex = this.data.star;
  4649. let isChallenge = cfgTable.placeballData[level].type;
  4650. if (this.data.isCur) {
  4651. if (isChallenge) {
  4652. this.ui.c1.selectedIndex = 5;
  4653. }
  4654. else {
  4655. this.ui.c1.selectedIndex = 2;
  4656. }
  4657. }
  4658. else {
  4659. if (this.data.play) {
  4660. if (this.data.star == 3) {
  4661. this.ui.c1.selectedIndex = 0;
  4662. }
  4663. else {
  4664. this.ui.c1.selectedIndex = 1;
  4665. }
  4666. }
  4667. else {
  4668. if (isChallenge) {
  4669. this.ui.c1.selectedIndex = 4;
  4670. }
  4671. else {
  4672. this.ui.c1.selectedIndex = 3;
  4673. }
  4674. }
  4675. }
  4676. }
  4677. clickSelf() {
  4678. if (!this.data.play)
  4679. return;
  4680. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4681. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4682. }
  4683. }
  4684. class UILevelDisplay extends UIBase {
  4685. constructor() {
  4686. super();
  4687. }
  4688. onConstructor() {
  4689. this.ui = ui_UILevelDisplay.createInstance();
  4690. this.contentPane = this.ui;
  4691. this.isEject = false;
  4692. this.myList = this.ui.myNode.myList;
  4693. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4694. this.levelItemArr = [];
  4695. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4696. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4697. this.myList.numItems = levelNum;
  4698. if (Moyu.isKs)
  4699. this.ui.closeNode.closeBtn.x += 100;
  4700. }
  4701. levelItemRender(index, target) {
  4702. let item = new PutBallLevelDisplay(target, index);
  4703. this.levelItemArr.push(item);
  4704. }
  4705. show() {
  4706. super.show();
  4707. this.updateLevel();
  4708. this.scrollToPlace();
  4709. }
  4710. updateLevel() {
  4711. let temp;
  4712. for (let index = 0; index < this.levelItemArr.length; index++) {
  4713. temp = this.levelItemArr[index];
  4714. temp.updateSelf();
  4715. }
  4716. }
  4717. scrollToPlace() {
  4718. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4719. let passArr = DataMgr.getPlaceBallLevelList();
  4720. let offest = passArr.length;
  4721. if (offest >= maxNum - 1)
  4722. offest = maxNum - 1;
  4723. this.myList.scrollToView(offest, true, true);
  4724. }
  4725. hide() {
  4726. super.hide();
  4727. }
  4728. }
  4729. UILevelDisplay.uiName = "UILevelDisplay";
  4730. class ui_UIMatching extends fgui.GComponent {
  4731. static createInstance() {
  4732. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4733. }
  4734. onConstruct() {
  4735. this.n5 = (this.getChild("n5"));
  4736. this.n49 = (this.getChild("n49"));
  4737. this.n51 = (this.getChild("n51"));
  4738. this.n64 = (this.getChild("n64"));
  4739. this.n2 = (this.getChild("n2"));
  4740. this.n53 = (this.getChild("n53"));
  4741. this.n54 = (this.getChild("n54"));
  4742. this.n56 = (this.getChild("n56"));
  4743. this.n58 = (this.getChild("n58"));
  4744. this.n59 = (this.getChild("n59"));
  4745. this.n57 = (this.getChild("n57"));
  4746. this.n60 = (this.getChild("n60"));
  4747. this.n62 = (this.getChild("n62"));
  4748. this.awardTxt = (this.getChild("awardTxt"));
  4749. this.n61 = (this.getChild("n61"));
  4750. this.selfHead = (this.getChild("selfHead"));
  4751. this.aiHead = (this.getChild("aiHead"));
  4752. this.n82 = (this.getChild("n82"));
  4753. this.n84 = (this.getChild("n84"));
  4754. this.n83 = (this.getChild("n83"));
  4755. this.t1 = this.getTransition("t1");
  4756. this.t2 = this.getTransition("t2");
  4757. this.t3 = this.getTransition("t3");
  4758. this.t4 = this.getTransition("t4");
  4759. }
  4760. }
  4761. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4762. class UIMatching extends UIBase {
  4763. constructor() {
  4764. super();
  4765. }
  4766. onConstructor() {
  4767. this.ui = ui_UIMatching.createInstance();
  4768. this.contentPane = this.ui;
  4769. this.isEject = false;
  4770. }
  4771. show(callback) {
  4772. super.show();
  4773. PlatMgr.showBanner(true);
  4774. this.callback = callback;
  4775. let user = Moyu.getUserInfo();
  4776. if (!this.selfPot) {
  4777. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4778. }
  4779. if (!this.aiPot) {
  4780. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4781. }
  4782. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4783. this.ui.selfHead.nameTxt.text = user.nickName;
  4784. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4785. this.ui.aiHead.nameTxt.text = "???";
  4786. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4787. this.ui.selfHead.c1.selectedIndex = 0;
  4788. this.ui.aiHead.c1.selectedIndex = 0;
  4789. this.ui.selfHead.x = this.selfPot.x;
  4790. this.ui.selfHead.y = this.selfPot.y;
  4791. this.ui.aiHead.x = this.aiPot.x;
  4792. this.ui.aiHead.y = this.aiPot.y;
  4793. switch (xGame.common.gameMode) {
  4794. case GameMode.classic:
  4795. break;
  4796. case GameMode.bigMove:
  4797. this.initSkillData();
  4798. break;
  4799. default:
  4800. break;
  4801. }
  4802. this.ui.t1.play(Laya.Handler.create(this, () => {
  4803. this.ui.t2.play(Laya.Handler.create(this, () => {
  4804. switch (xGame.common.gameMode) {
  4805. case GameMode.classic:
  4806. this.waitingPeople();
  4807. break;
  4808. case GameMode.bigMove:
  4809. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4810. break;
  4811. default:
  4812. break;
  4813. }
  4814. }));
  4815. }));
  4816. }
  4817. initSkillData() {
  4818. this.skillSelectData = [];
  4819. let skillUrl = xGame.common.skillIconList;
  4820. let skillName = xGame.common.skillNameList;
  4821. let skillLevel = DataMgr.getBigSkillList();
  4822. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  4823. for (let index = 0; index < 5; index++) {
  4824. let obj = {};
  4825. obj.skillImg = skillUrl[index];
  4826. obj.skillName = skillName[index];
  4827. obj.skillType = skillType[index];
  4828. obj.skillLevel = skillLevel[index];
  4829. this.skillSelectData.push(obj);
  4830. }
  4831. }
  4832. getAISkillLevel(myLevel) {
  4833. let video = xGame.common.upSkillLevel;
  4834. let aiLevel;
  4835. let temp;
  4836. if (video) {
  4837. temp = xGame.common.randomNum(-2, -1);
  4838. }
  4839. else {
  4840. if (myLevel <= 5) {
  4841. temp = xGame.common.randomNum(1, 3);
  4842. }
  4843. else if (myLevel <= 9) {
  4844. temp = xGame.common.randomNum(-2, 1);
  4845. }
  4846. else {
  4847. temp = xGame.common.randomNum(-4, 0);
  4848. }
  4849. }
  4850. aiLevel = temp + myLevel;
  4851. if (aiLevel <= 1)
  4852. aiLevel = 1;
  4853. if (aiLevel >= 10)
  4854. aiLevel = 10;
  4855. return aiLevel;
  4856. }
  4857. getAISkillType() {
  4858. return xGame.common.randomNum(1, 4);
  4859. let successTimes = DataMgr.getSkillSuccessTimes();
  4860. let info = cfgTable.aiskillData[successTimes];
  4861. if (!info) {
  4862. let max = Object.keys(cfgTable.aiskillData).length - 1;
  4863. info = cfgTable.aiskillData[max];
  4864. }
  4865. let dataArr = info.skillselect;
  4866. let myCfg = {};
  4867. for (let index = 0; index < dataArr.length; index++) {
  4868. let temp = dataArr[index].split('-');
  4869. myCfg[temp[0]] = {};
  4870. myCfg[temp[0]].id = parseInt(temp[0]);
  4871. myCfg[temp[0]].weight = parseInt(temp[1]);
  4872. }
  4873. let aiCfg = xGame.common.initWeight(myCfg);
  4874. let curData = xGame.common.getRandomWeightData(aiCfg);
  4875. return parseInt(curData.id);
  4876. }
  4877. getAISkillData(index) {
  4878. let myLevel = this.skillSelectData[index].skillLevel;
  4879. let aiLevel = this.getAISkillLevel(myLevel);
  4880. let aiType = this.getAISkillType() - 1;
  4881. return { aiLevel, aiType } = { aiLevel, aiType };
  4882. }
  4883. skillSelectFinish(index) {
  4884. let aiInfo = this.getAISkillData(index);
  4885. xGame.common.gameMgr.selfCurSkill = index;
  4886. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  4887. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  4888. this.ui.selfHead.c1.selectedIndex = 1;
  4889. this.ui.aiHead.c1.selectedIndex = 1;
  4890. let myData = this.skillSelectData[index];
  4891. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  4892. let guide = DataMgr.getSkillGuide();
  4893. if (guide == 0) {
  4894. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  4895. }
  4896. else {
  4897. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  4898. }
  4899. let aiData = this.skillSelectData[aiInfo.aiType];
  4900. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  4901. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  4902. this.waitingPeople();
  4903. }
  4904. waitingPeople() {
  4905. let time = xGame.common.randomNum(1000, 3000);
  4906. time += 1000;
  4907. Laya.timer.once(time, this, () => {
  4908. this.matchingSuccess();
  4909. });
  4910. }
  4911. matchingSuccess() {
  4912. let gameUI = xGame.common.gameUI;
  4913. let name = gameUI.ui.topNode.aiNameTxt.text;
  4914. let url = gameUI.ui.topNode.aiHeadLoader.url;
  4915. this.ui.aiHead.nameTxt.text = name;
  4916. this.ui.aiHead.headImg.url = url;
  4917. name = gameUI.ui.topNode.selfNameTxt.text;
  4918. url = gameUI.ui.topNode.selfHeadLoader.url;
  4919. this.ui.selfHead.nameTxt.text = name;
  4920. this.ui.selfHead.headImg.url = url;
  4921. this.ui.t3.play(Laya.Handler.create(this, () => {
  4922. this.callback && this.callback();
  4923. this.ui.t4.play(Laya.Handler.create(this, () => {
  4924. this.destroySelf();
  4925. }));
  4926. }));
  4927. }
  4928. destroySelf() {
  4929. this.callback = null;
  4930. this.skillSelectData = null;
  4931. this.selfPot = null;
  4932. this.aiPot = null;
  4933. if (!this.ui.isDisposed) {
  4934. this.ui.removeFromParent();
  4935. this.ui.dispose();
  4936. }
  4937. xGame.uiMgr.destroyUI(this);
  4938. }
  4939. }
  4940. UIMatching.uiName = "UIMatching";
  4941. class ui_UIRanking extends fgui.GComponent {
  4942. static createInstance() {
  4943. return (fgui.UIPackage.createObject("game", "UIRanking"));
  4944. }
  4945. onConstruct() {
  4946. this.n26 = (this.getChild("n26"));
  4947. this.myNode = (this.getChild("myNode"));
  4948. }
  4949. }
  4950. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  4951. class UIRanking extends UIBase {
  4952. constructor() {
  4953. super();
  4954. this.showSelf = true;
  4955. this.rankType = 1;
  4956. this.rankList = [];
  4957. this.myIndex = 0;
  4958. this.myStar = 0;
  4959. }
  4960. onConstructor() {
  4961. this.ui = ui_UIRanking.createInstance();
  4962. this.contentPane = this.ui;
  4963. this.isEject = false;
  4964. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  4965. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  4966. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  4967. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  4968. this.ui.myNode.myList.setVirtual();
  4969. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  4970. }
  4971. show() {
  4972. super.show();
  4973. this.myIndex = 51;
  4974. Moyu.getRankList({
  4975. rankId: xGame.common.curRankID,
  4976. type: MoyuRankType.total,
  4977. page: 1,
  4978. pageSize: 50,
  4979. }, this, this.updateItemData);
  4980. this.updateSelf();
  4981. let self = Moyu.getUserInfo();
  4982. if (!self.isAuth) {
  4983. Moyu.initUser(this, () => {
  4984. DataMgr.upRankData();
  4985. });
  4986. }
  4987. }
  4988. updateSelfItem() {
  4989. let self = Moyu.getUserInfo();
  4990. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  4991. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  4992. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  4993. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  4994. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  4995. }
  4996. updateItemData(data) {
  4997. this.myStar = xGame.common.getAllStarNum();
  4998. if (this.rankList.length < 2) {
  4999. this.rankList = data;
  5000. let self = Moyu.getUserInfo();
  5001. for (let i = 0; i < data.length; i++) {
  5002. let data = this.rankList[i];
  5003. if (data.userId == self.userId) {
  5004. this.rankList.splice(i, 1);
  5005. break;
  5006. }
  5007. }
  5008. for (let i = 0; i < data.length; i++) {
  5009. let data = this.rankList[i];
  5010. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5011. this.myIndex = i + 1;
  5012. let user = { headIcon: self.headIcon, nickName: "myself" };
  5013. let ud = { user: user, data: {} };
  5014. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5015. if (Moyu.platType < 11) {
  5016. user.headIcon = self.headIcon;
  5017. user.nickName = self.nickName;
  5018. }
  5019. this.rankList.splice(i, 0, md);
  5020. break;
  5021. }
  5022. }
  5023. }
  5024. this.updateSelfItem();
  5025. this.ui.myNode.myList.numItems = this.rankList.length;
  5026. }
  5027. updateItemUI(index, obj) {
  5028. let data = this.rankList[index];
  5029. let userData = JSON.parse(data.userData).user;
  5030. obj.nameTxt.text = userData.nickName.toString();
  5031. obj.valueTxt.text = data.rankScore;
  5032. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5033. obj.rankTxt.text = index + 1;
  5034. switch (index) {
  5035. case 0:
  5036. this.setImg(obj, 1, 0, 0);
  5037. obj.rankTxt.color = "#FFC047";
  5038. break;
  5039. case 1:
  5040. this.setImg(obj, 0, 1, 0);
  5041. obj.rankTxt.color = "#ACACAC";
  5042. break;
  5043. case 2:
  5044. this.setImg(obj, 0, 0, 1);
  5045. obj.rankTxt.color = "#D09672";
  5046. break;
  5047. default:
  5048. this.setImg(obj, 0, 0, 0);
  5049. obj.rankTxt.color = "#496FAB";
  5050. break;
  5051. }
  5052. }
  5053. setImg(obj, a, b, c) {
  5054. obj.img1.visible = a ? true : false;
  5055. obj.img2.visible = b ? true : false;
  5056. obj.img3.visible = c ? true : false;
  5057. }
  5058. changeList(type) {
  5059. this.rankType = type;
  5060. this.updateSelf();
  5061. }
  5062. changeSelfNode() {
  5063. this.showSelf = !this.showSelf;
  5064. this.updateSelf();
  5065. }
  5066. updateSelf() {
  5067. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5068. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5069. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5070. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5071. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5072. }
  5073. }
  5074. UIRanking.uiName = "UIRanking";
  5075. class ui_UISecretary extends fgui.GComponent {
  5076. static createInstance() {
  5077. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5078. }
  5079. onConstruct() {
  5080. this.n0 = (this.getChild("n0"));
  5081. this.myNode = (this.getChild("myNode"));
  5082. this.closeBtn = (this.getChild("closeBtn"));
  5083. this.t0 = this.getTransition("t0");
  5084. }
  5085. }
  5086. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5087. class UISecretary extends UIBase {
  5088. constructor() {
  5089. super();
  5090. this.curIndex = 1;
  5091. }
  5092. onConstructor() {
  5093. this.ui = ui_UISecretary.createInstance();
  5094. this.contentPane = this.ui;
  5095. this.isEject = false;
  5096. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5097. this.nodeObj = { left: null, right: null, cur: null };
  5098. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5099. }
  5100. show() {
  5101. super.show();
  5102. this.ui.t0.play();
  5103. this.updateData();
  5104. }
  5105. addSecretarySpine(node, spineName) {
  5106. if (spineName == "mishu") {
  5107. if (this.secretarySpine1) {
  5108. node.displayObject.destroyChildren();
  5109. this.playWoman(this.secretarySpine1, node.displayObject);
  5110. }
  5111. else {
  5112. let spine1 = new SpineMgr("mishu", () => {
  5113. this.secretarySpine1 = spine1;
  5114. this.playWoman(this.secretarySpine1, node.displayObject);
  5115. });
  5116. }
  5117. }
  5118. else {
  5119. if (this.secretarySpine2) {
  5120. node.displayObject.destroyChildren();
  5121. this.playWoman(this.secretarySpine2, node.displayObject);
  5122. }
  5123. else {
  5124. let spine2 = new SpineMgr("xiaomishu2", () => {
  5125. this.secretarySpine2 = spine2;
  5126. this.playWoman(this.secretarySpine2, node.displayObject);
  5127. });
  5128. }
  5129. }
  5130. }
  5131. playWoman(node, parent) {
  5132. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5133. let yy = this.ui.myNode.gameNode3.secretary.height;
  5134. let scale = 1.5;
  5135. if (node == this.secretarySpine2) {
  5136. scale = 1.2;
  5137. }
  5138. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5139. node.play(data, 0, true, parent);
  5140. }
  5141. turnLeft() {
  5142. this.curIndex--;
  5143. if (this.curIndex < 1) {
  5144. this.curIndex = 2;
  5145. }
  5146. let left = this.nodeObj.left;
  5147. let right = this.nodeObj.right;
  5148. let cur = this.nodeObj.cur;
  5149. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5150. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5151. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5152. this.updateData();
  5153. }));
  5154. this.ui.myNode.setChildIndex(right, 2);
  5155. this.nodeObj.left = cur;
  5156. this.nodeObj.right = left;
  5157. this.nodeObj.cur = right;
  5158. }
  5159. turnRight() {
  5160. this.curIndex++;
  5161. if (this.curIndex > 2) {
  5162. this.curIndex = 1;
  5163. }
  5164. let left = this.nodeObj.left;
  5165. let right = this.nodeObj.right;
  5166. let cur = this.nodeObj.cur;
  5167. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5168. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5169. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5170. this.updateData();
  5171. }));
  5172. this.ui.myNode.setChildIndex(left, 2);
  5173. this.nodeObj.left = right;
  5174. this.nodeObj.right = cur;
  5175. this.nodeObj.cur = left;
  5176. }
  5177. updateData() {
  5178. let data = cfgTable.secretaryshopData;
  5179. let children = this.ui.myNode._children;
  5180. let temp;
  5181. let curData;
  5182. for (let index = 0; index < children.length; index++) {
  5183. temp = children[index];
  5184. curData = data[1];
  5185. temp.heightTxt.text = curData.height;
  5186. temp.foodTxt.text = curData.food;
  5187. temp.historyTxt.text = curData.history;
  5188. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5189. this.addSecretarySpine(temp.secretary, curData.spine);
  5190. let womanIndex = curData.id - 1;
  5191. let getWoman = DataMgr.getSecretary(womanIndex);
  5192. let curUse = DataMgr.getCurSecretary();
  5193. if (getWoman) {
  5194. if (curUse == womanIndex) {
  5195. temp.purchaseBtn.c1.selectedIndex = 1;
  5196. }
  5197. else {
  5198. temp.purchaseBtn.c1.selectedIndex = 2;
  5199. }
  5200. }
  5201. else {
  5202. temp.purchaseBtn.c1.selectedIndex = 0;
  5203. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5204. }
  5205. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5206. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5207. }
  5208. }
  5209. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5210. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5211. if (getWoman) {
  5212. if (curUse != womanIndex) {
  5213. console.log();
  5214. DataMgr.setCurSecretary(womanIndex);
  5215. this.updateData();
  5216. }
  5217. }
  5218. else {
  5219. let need = needDiamond;
  5220. if (DataMgr.diamondEnough(need)) {
  5221. DataMgr.setDiamond(-need);
  5222. DataMgr.setSecretary(womanIndex, 1);
  5223. DataMgr.setCurSecretary(womanIndex);
  5224. this.updateData();
  5225. }
  5226. else {
  5227. xGame.uiMgr.Show(UIAddProp, 1);
  5228. }
  5229. }
  5230. }
  5231. closeSelf() {
  5232. this.hide();
  5233. }
  5234. }
  5235. UISecretary.uiName = "UISecretary";
  5236. class ui_UIShop extends fgui.GComponent {
  5237. static createInstance() {
  5238. return (fgui.UIPackage.createObject("game", "UIShop"));
  5239. }
  5240. onConstruct() {
  5241. this.n48 = (this.getChild("n48"));
  5242. this.n0 = (this.getChild("n0"));
  5243. this.secretary = (this.getChild("secretary"));
  5244. this.talkNode = (this.getChild("talkNode"));
  5245. this.closeNode = (this.getChild("closeNode"));
  5246. this.moneyNode = (this.getChild("moneyNode"));
  5247. this.myNode = (this.getChild("myNode"));
  5248. }
  5249. }
  5250. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5251. class BallRodDisplay {
  5252. constructor(ui, index) {
  5253. this.index = 0;
  5254. this.uiIndex = 0;
  5255. this.ui = ui;
  5256. this.index = index;
  5257. this.initData();
  5258. }
  5259. initData() {
  5260. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5261. let data = cfgTable.ballrodData[this.index + 1];
  5262. this.ui.nameTxt.text = data.name;
  5263. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5264. this.ui.levelNode.c1.selectedIndex = data.quality;
  5265. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5266. if (data.spine) {
  5267. this.mySpine = new SpineMgr(data.spine, () => {
  5268. let xx = 150;
  5269. let yy = 70;
  5270. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5271. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5272. });
  5273. }
  5274. }
  5275. updateSelf() {
  5276. let get = DataMgr.getBallRod(this.index);
  5277. if (get == null)
  5278. get = 1;
  5279. let curUse = DataMgr.getCurBallRod();
  5280. if (get) {
  5281. if (curUse == this.index) {
  5282. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5283. }
  5284. else {
  5285. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5286. }
  5287. }
  5288. else {
  5289. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5290. }
  5291. }
  5292. buyBallRod() {
  5293. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5294. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5295. switch (selectedIndex) {
  5296. case 0:
  5297. break;
  5298. case 1:
  5299. DataMgr.setCurBallRod(this.index);
  5300. let ui = xGame.uiMgr.getUI(UIShop);
  5301. ui.updateBallRod();
  5302. break;
  5303. case 2:
  5304. let data = cfgTable.ballrodData[this.index + 1];
  5305. let need = data.price;
  5306. if (DataMgr.diamondEnough(need)) {
  5307. DataMgr.setDiamond(-need);
  5308. DataMgr.setBallRod(this.index, 1);
  5309. DataMgr.setCurBallRod(this.index);
  5310. let ui = xGame.uiMgr.getUI(UIShop);
  5311. ui.updateBallRod();
  5312. }
  5313. else {
  5314. xGame.uiMgr.Show(UIAddProp, 1);
  5315. }
  5316. break;
  5317. default:
  5318. break;
  5319. }
  5320. }
  5321. }
  5322. class UIShop extends UIBase {
  5323. constructor() {
  5324. super();
  5325. this.itemNums = 0;
  5326. }
  5327. onConstructor() {
  5328. this.ui = ui_UIShop.createInstance();
  5329. this.contentPane = this.ui;
  5330. this.isEject = false;
  5331. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5332. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5333. this.addUIClick(this.ui, this.interuptSecretary);
  5334. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5335. this.ballRodArr = [];
  5336. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5337. this.ui.myNode.myList.numItems = this.itemNums;
  5338. if (Moyu.isKs)
  5339. this.ui.closeNode.closeBtn.x += 100;
  5340. }
  5341. show() {
  5342. super.show();
  5343. this.playSecretaryIdle();
  5344. this.updateBallRod();
  5345. }
  5346. updateBallRod() {
  5347. for (let index = 0; index < this.ballRodArr.length; index++) {
  5348. this.ballRodArr[index].updateSelf();
  5349. }
  5350. }
  5351. renderBallRod(sort, obj) {
  5352. let index = this.getIndexBySort(sort + 1) - 1;
  5353. let ballRod = new BallRodDisplay(obj, index);
  5354. this.ballRodArr.push(ballRod);
  5355. }
  5356. getIndexBySort(sort) {
  5357. let object = cfgTable.ballrodData;
  5358. for (const key in object) {
  5359. if (object[key].sort == sort) {
  5360. return parseInt(key);
  5361. }
  5362. }
  5363. }
  5364. playSecretaryIdle() {
  5365. let parent = this.ui.secretary.displayObject;
  5366. parent.destroyChildren();
  5367. let xx = this.ui.secretary.width / 2;
  5368. let yy = this.ui.secretary.height;
  5369. let scale = xGame.common.getSecretaryScale();
  5370. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5371. xGame.common.secretary.play(data, 0, true, parent);
  5372. }
  5373. interuptSecretary() {
  5374. Laya.timer.clearAll(this);
  5375. this.playSecretaryRandomSound();
  5376. }
  5377. playSecretaryRandomSound() {
  5378. if (this.isHide)
  5379. return;
  5380. let time = xGame.common.randomNum(45000, 60000);
  5381. Laya.timer.once(time, this, () => {
  5382. if (this.isHide)
  5383. return;
  5384. let index = xGame.common.randomNum(4, 7);
  5385. xGame.soundMgr.playSound("s_main0" + index);
  5386. let words = 1;
  5387. switch (index) {
  5388. case 4:
  5389. words = 5;
  5390. break;
  5391. case 5:
  5392. words = 3;
  5393. break;
  5394. case 6:
  5395. words = 6;
  5396. break;
  5397. case 7:
  5398. words = 7;
  5399. break;
  5400. default:
  5401. break;
  5402. }
  5403. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5404. this.playSecretaryRandomSound();
  5405. });
  5406. }
  5407. closeSelf() {
  5408. this.hide();
  5409. }
  5410. }
  5411. UIShop.uiName = "UIShop";
  5412. class ui_UISign extends fgui.GComponent {
  5413. static createInstance() {
  5414. return (fgui.UIPackage.createObject("game", "UISign"));
  5415. }
  5416. onConstruct() {
  5417. this.n6 = (this.getChild("n6"));
  5418. this.closeNode = (this.getChild("closeNode"));
  5419. this.myNode = (this.getChild("myNode"));
  5420. this.moneyNode = (this.getChild("moneyNode"));
  5421. this.secretary = (this.getChild("secretary"));
  5422. this.talkNode = (this.getChild("talkNode"));
  5423. this.tripleBtn = (this.getChild("tripleBtn"));
  5424. this.normalBtn = (this.getChild("normalBtn"));
  5425. this.tipsNode = (this.getChild("tipsNode"));
  5426. this.againBtn = (this.getChild("againBtn"));
  5427. this.t0 = this.getTransition("t0");
  5428. }
  5429. }
  5430. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5431. class SignMax {
  5432. constructor(ui) {
  5433. this.ui = ui;
  5434. }
  5435. updateSelf(index, sameDay, curDayIndex) {
  5436. let data = cfgTable.signData[index + 1];
  5437. this.ui.titleTxt.text = data.title;
  5438. let arr1 = data.award[0].split('-');
  5439. let arr2 = data.award[1].split('-');
  5440. let num1 = parseInt(arr1[1]);
  5441. let num2 = parseInt(arr2[1]);
  5442. this.ui.numTxt1.text = num1 + "";
  5443. this.ui.numTxt2.text = num2 + "";
  5444. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5445. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5446. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5447. this.ui.numTxt1.visible = false;
  5448. }
  5449. else {
  5450. this.ui.numTxt1.visible = true;
  5451. }
  5452. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5453. this.ui.numTxt2.visible = false;
  5454. }
  5455. else {
  5456. this.ui.numTxt2.visible = true;
  5457. }
  5458. if (index < curDayIndex) {
  5459. this.ui.c1.selectedIndex = 1;
  5460. }
  5461. else if (index == curDayIndex) {
  5462. if (sameDay) {
  5463. this.ui.c1.selectedIndex = 2;
  5464. }
  5465. else {
  5466. this.ui.c1.selectedIndex = 2;
  5467. }
  5468. }
  5469. else {
  5470. this.ui.c1.selectedIndex = 0;
  5471. }
  5472. }
  5473. }
  5474. class SignNormal {
  5475. constructor(ui) {
  5476. this.ui = ui;
  5477. }
  5478. updateSelf(index, sameDay, curDayIndex) {
  5479. let data = cfgTable.signData[index + 1];
  5480. this.ui.titleTxt.text = data.title;
  5481. let arr = data.award[0].split('-');
  5482. let type = parseInt(arr[0]);
  5483. let num = parseInt(arr[1]);
  5484. this.ui.numTxt.text = num + "";
  5485. if (type > 2) {
  5486. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5487. this.ui.myIcon.rotation = 0;
  5488. }
  5489. else {
  5490. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5491. this.ui.myIcon.rotation = 0;
  5492. }
  5493. if (xGame.common.signAwardContainsRod(data.award)) {
  5494. this.ui.numTxt.visible = false;
  5495. }
  5496. else {
  5497. this.ui.numTxt.visible = true;
  5498. }
  5499. if (index < curDayIndex) {
  5500. this.ui.c1.selectedIndex = 1;
  5501. }
  5502. else if (index == curDayIndex) {
  5503. if (sameDay) {
  5504. this.ui.c1.selectedIndex = 2;
  5505. }
  5506. else {
  5507. this.ui.c1.selectedIndex = 2;
  5508. }
  5509. }
  5510. else {
  5511. this.ui.c1.selectedIndex = 0;
  5512. }
  5513. }
  5514. }
  5515. class UISign extends UIBase {
  5516. constructor() {
  5517. super();
  5518. this.curDayIndex = 0;
  5519. this.starX = 0;
  5520. }
  5521. onConstructor() {
  5522. this.ui = ui_UISign.createInstance();
  5523. this.contentPane = this.ui;
  5524. this.isEject = false;
  5525. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5526. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5527. this.initSignItem();
  5528. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5529. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5530. }
  5531. show() {
  5532. super.show();
  5533. this.ui.t0.play();
  5534. this.playSecretaryIdle();
  5535. this.updateSign();
  5536. }
  5537. initSignItem() {
  5538. this.signArr = [];
  5539. for (let index = 0; index < 6; index++) {
  5540. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5541. this.signArr.push(temp);
  5542. }
  5543. this.signMax = new SignMax(this.ui.myNode.day7);
  5544. if (Moyu.isKs)
  5545. this.ui.closeNode.closeBtn.x += 100;
  5546. }
  5547. updateSign() {
  5548. let sameDay = xGame.common.judgeSameDay();
  5549. let max = 7;
  5550. this.curDayIndex = DataMgr.getSignData();
  5551. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5552. this.curDayIndex = 0;
  5553. if (!sameDay) {
  5554. this.ui.normalBtn.visible = true;
  5555. this.ui.tipsNode.visible = false;
  5556. this.ui.againBtn.visible = false;
  5557. }
  5558. else {
  5559. this.ui.normalBtn.visible = false;
  5560. let again = DataMgr.getExtraSign();
  5561. let isCurrency = false;
  5562. let index = this.curDayIndex;
  5563. if (index == 0)
  5564. index = 7;
  5565. let award = cfgTable.signData[index].award;
  5566. let num = award[0].split("-")[0];
  5567. if (num == "1" || num == "2")
  5568. isCurrency = true;
  5569. let showAgain = again == 0 && isCurrency;
  5570. this.ui.againBtn.visible = showAgain;
  5571. this.ui.tipsNode.visible = !showAgain;
  5572. }
  5573. for (let index = 0; index < this.signArr.length; index++) {
  5574. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5575. }
  5576. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5577. }
  5578. playSecretaryIdle() {
  5579. let parent = this.ui.secretary.displayObject;
  5580. parent.destroyChildren();
  5581. let xx = this.ui.secretary.width / 2;
  5582. let yy = this.ui.secretary.height;
  5583. let scale = xGame.common.getSecretaryScale();
  5584. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5585. xGame.common.secretary.play(data, 0, true, parent);
  5586. }
  5587. closeSelf() {
  5588. this.hide();
  5589. }
  5590. normalGetAward() {
  5591. let sameDay = xGame.common.judgeSameDay();
  5592. if (!sameDay) {
  5593. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5594. let temp;
  5595. let type;
  5596. let num;
  5597. let arr = [];
  5598. for (let index = 0; index < award.length; index++) {
  5599. temp = award[index].split("-");
  5600. type = parseInt(temp[0]);
  5601. num = parseInt(temp[1]);
  5602. let awardType = new AwardType();
  5603. awardType.num = num;
  5604. awardType.type = type;
  5605. arr.push(awardType);
  5606. }
  5607. xGame.common.getAward(arr, (watchVideo) => {
  5608. this.curDayIndex++;
  5609. if (this.curDayIndex > 7)
  5610. this.curDayIndex = 0;
  5611. DataMgr.setSignData(this.curDayIndex);
  5612. DataMgr.setSignTime(new Date().getTime());
  5613. if (watchVideo) {
  5614. DataMgr.setExtraSign(1);
  5615. Moyu.sendDataEvent("signIn1");
  5616. }
  5617. this.updateSign();
  5618. });
  5619. }
  5620. }
  5621. againGetAward() {
  5622. Moyu.sendDataEvent("signIn2");
  5623. Moyu.showVideoAd(() => {
  5624. let index = this.curDayIndex;
  5625. if (index == 0)
  5626. index = 7;
  5627. let award = cfgTable.signData[index].award;
  5628. let temp;
  5629. let type;
  5630. let num;
  5631. for (let index = 0; index < award.length; index++) {
  5632. temp = award[index].split("-");
  5633. type = parseInt(temp[0]);
  5634. num = parseInt(temp[1]) * 3;
  5635. xGame.common.playObjFlyAnim(num, type);
  5636. }
  5637. DataMgr.setExtraSign(1);
  5638. this.updateSign();
  5639. }, EAdType.againSign);
  5640. }
  5641. }
  5642. UISign.uiName = "UISign";
  5643. class ui_UISkill extends fgui.GComponent {
  5644. static createInstance() {
  5645. return (fgui.UIPackage.createObject("game", "UISkill"));
  5646. }
  5647. onConstruct() {
  5648. this.n48 = (this.getChild("n48"));
  5649. this.n0 = (this.getChild("n0"));
  5650. this.secretary = (this.getChild("secretary"));
  5651. this.talkNode = (this.getChild("talkNode"));
  5652. this.closeNode = (this.getChild("closeNode"));
  5653. this.moneyNode = (this.getChild("moneyNode"));
  5654. this.skillNode = (this.getChild("skillNode"));
  5655. this.guideNode = (this.getChild("guideNode"));
  5656. }
  5657. }
  5658. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5659. class SkillDisplay {
  5660. constructor(ui, data, uiIndex) {
  5661. this.starX = 0;
  5662. this.starY = 0;
  5663. this.index = 0;
  5664. this.ui = ui;
  5665. this.data = data;
  5666. this.index = uiIndex;
  5667. this.initSelf();
  5668. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5669. }
  5670. initSelf() {
  5671. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5672. this.ui.nameTxt.text = this.data.name;
  5673. this.ui.describeTxt.text = this.data.describe;
  5674. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5675. this.ui.startBtn.onClick(this, this.startGame);
  5676. this.updateSelf();
  5677. }
  5678. updateSelf() {
  5679. this.checkTry();
  5680. let level = DataMgr.getBigSkillByIndex(this.index);
  5681. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5682. }
  5683. checkTry() {
  5684. let index = this.index;
  5685. let level = DataMgr.getBigSkillByIndex(index);
  5686. if (level == null) {
  5687. DataMgr.setBigSkill(index, 1, false);
  5688. level = 1;
  5689. }
  5690. this.ui.levelTxt.text = "LV." + level;
  5691. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5692. this.ui.tryNode.visible = true;
  5693. else
  5694. this.ui.tryNode.visible = false;
  5695. }
  5696. clickAddLevel() {
  5697. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5698. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5699. Moyu.showVideoAd(() => {
  5700. DataMgr.setBigSkill(this.data.index, 1);
  5701. this.updateSelf();
  5702. xGame.common.upSkillLevel = true;
  5703. }, EAdType.upSkill);
  5704. }
  5705. startGame() {
  5706. if (this.data.index == 3) {
  5707. alert('Coming soon!');
  5708. return;
  5709. }
  5710. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5711. let needCoin = xGame.common.bigMoveNeedCoin;
  5712. xGame.common.passAwardCoin = 2000;
  5713. let guide = DataMgr.getSkillGuide();
  5714. console.log('zh:startGame guide=' + guide);
  5715. xGame.common.temSelfLevel = 0;
  5716. if (guide == 0) {
  5717. needCoin = 0;
  5718. xGame.common.temSelfLevel = 100;
  5719. }
  5720. if (DataMgr.coinEnough(needCoin)) {
  5721. DataMgr.setCoin(-needCoin);
  5722. xGame.common.curPlayerSkillType = this.index;
  5723. if (guide == 0)
  5724. xGame.common.curPlayerSkillType = 0;
  5725. xGame.uiMgr.Show(UIGame);
  5726. xGame.uiMgr.Hide(UIMain);
  5727. xGame.uiMgr.Show(UIMatching, () => {
  5728. xGame.common.gameUI.ui.alpha = 1;
  5729. xGame.common.gameUI.startGame();
  5730. xGame.uiMgr.Hide(UISkill);
  5731. });
  5732. }
  5733. else {
  5734. xGame.uiMgr.Show(UIAddProp, 0);
  5735. Moyu.sendDataEvent("AddCoinVideo");
  5736. }
  5737. }
  5738. }
  5739. class UISkill extends UIBase {
  5740. constructor() {
  5741. super();
  5742. this.skillData = [];
  5743. }
  5744. onConstructor() {
  5745. this.ui = ui_UISkill.createInstance();
  5746. this.contentPane = this.ui;
  5747. this.isEject = false;
  5748. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5749. this.initSkillData();
  5750. console.log('zh:aaaaaa1111111111');
  5751. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5752. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5753. console.log('zh:aaaaaa22222222');
  5754. this.displayList = [];
  5755. this.ui.skillNode.skillList.numItems = 3;
  5756. this.addUIClick(this.ui, this.interuptSecretary);
  5757. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5758. this.ui.talkNode.visible = false;
  5759. if (Moyu.isKs)
  5760. this.ui.closeNode.closeBtn.x += 100;
  5761. }
  5762. show() {
  5763. super.show();
  5764. this.playSecretaryIdle();
  5765. this.moneyNode.ui.c1.selectedIndex = 1;
  5766. Laya.timer.clearAll(this);
  5767. xGame.soundMgr.playSound("s_start");
  5768. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5769. let guide = DataMgr.getSkillGuide();
  5770. this.ui.guideNode.visible = guide == 0;
  5771. let item = this.getSkillItemByUIIndex(0);
  5772. if (guide == 0) {
  5773. item.ui.c1.selectedIndex = 1;
  5774. }
  5775. else {
  5776. item.ui.c1.selectedIndex = 0;
  5777. }
  5778. this.ui.guideNode.guideBtn.visible = guide == 0;
  5779. for (let index = 0; index < this.displayList.length; index++) {
  5780. this.displayList[index].checkTry();
  5781. }
  5782. }
  5783. getSkillItemByUIIndex(cur) {
  5784. for (let index = 0; index < this.displayList.length; index++) {
  5785. if (this.displayList[index].index == cur) {
  5786. return this.displayList[index];
  5787. }
  5788. }
  5789. }
  5790. enterGuideLevel() {
  5791. let item = this.getSkillItemByUIIndex(0);
  5792. item.startGame();
  5793. if (DataMgr.getNewUser())
  5794. Moyu.sendDataEvent("gameStart1");
  5795. }
  5796. initSkillData() {
  5797. this.skillData = [];
  5798. let nameList = xGame.common.skillNameList;
  5799. let iconList = xGame.common.skillIconList;
  5800. let describeList = [
  5801. "Jump shot executed — ball bounced and pocketed an extra one!",
  5802. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5803. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5804. ];
  5805. console.log('zh:initSkillData 111111111');
  5806. let data;
  5807. for (let index = 0; index < nameList.length; index++) {
  5808. data = {};
  5809. data.name = nameList[index];
  5810. data.icon = iconList[index];
  5811. data.describe = describeList[index];
  5812. data.index = index;
  5813. this.skillData.push(data);
  5814. }
  5815. }
  5816. updateSkillItem(index, target) {
  5817. if (this.displayList[index] == null) {
  5818. let uiIndex;
  5819. switch (index) {
  5820. case 0:
  5821. uiIndex = 1;
  5822. break;
  5823. case 1:
  5824. uiIndex = 0;
  5825. break;
  5826. case 2:
  5827. uiIndex = 2;
  5828. break;
  5829. case 3:
  5830. uiIndex = 3;
  5831. break;
  5832. default:
  5833. break;
  5834. }
  5835. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  5836. this.displayList.push(temp);
  5837. }
  5838. }
  5839. playSecretaryIdle() {
  5840. let parent = this.ui.secretary.displayObject;
  5841. parent.destroyChildren();
  5842. let xx = this.ui.secretary.width / 2;
  5843. let yy = this.ui.secretary.height;
  5844. let scale = xGame.common.getSecretaryScale();
  5845. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5846. xGame.common.secretary.play(data, 0, true, parent);
  5847. }
  5848. returnUIMain() {
  5849. this.hide();
  5850. xGame.common.stopGirlPop(this.ui.talkNode);
  5851. xGame.uiMgr.Show(UIMain);
  5852. }
  5853. interuptSecretary() {
  5854. Laya.timer.clearAll(this);
  5855. this.playSecretaryRandomSound();
  5856. }
  5857. playSecretaryRandomSound() {
  5858. if (this.isHide)
  5859. return;
  5860. let time = xGame.common.randomNum(45000, 60000);
  5861. Laya.timer.once(time, this, () => {
  5862. if (this.isHide)
  5863. return;
  5864. let index = xGame.common.randomNum(4, 7);
  5865. xGame.soundMgr.playSound("s_main0" + index);
  5866. let words = 1;
  5867. switch (index) {
  5868. case 4:
  5869. words = 5;
  5870. break;
  5871. case 5:
  5872. words = 3;
  5873. break;
  5874. case 6:
  5875. words = 6;
  5876. break;
  5877. case 7:
  5878. words = 7;
  5879. break;
  5880. default:
  5881. break;
  5882. }
  5883. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5884. this.playSecretaryRandomSound();
  5885. });
  5886. }
  5887. }
  5888. UISkill.uiName = "UISkill";
  5889. class ui_UIMsg extends fgui.GComponent {
  5890. static createInstance() {
  5891. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5892. }
  5893. onConstruct() {
  5894. this.tipsNode = (this.getChild("tipsNode"));
  5895. }
  5896. }
  5897. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5898. class UIMsg extends UIBase {
  5899. constructor() {
  5900. super();
  5901. }
  5902. onConstructor() {
  5903. this.ui = ui_UIMsg.createInstance();
  5904. this.contentPane = this.ui;
  5905. this.isEject = false;
  5906. this.isMuti = true;
  5907. }
  5908. show(msg, callback) {
  5909. super.show();
  5910. this.ui.tipsNode.msgTxt.text = msg;
  5911. this.ui.alpha = 1;
  5912. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5913. this.hide();
  5914. callback && callback();
  5915. }), 1000);
  5916. }
  5917. }
  5918. UIMsg.uiName = "UIMsg";
  5919. class ui_UIModeSelection extends fgui.GComponent {
  5920. static createInstance() {
  5921. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  5922. }
  5923. onConstruct() {
  5924. this.n19 = (this.getChild("n19"));
  5925. this.closeBtn = (this.getChild("closeBtn"));
  5926. this.myNode = (this.getChild("myNode"));
  5927. this.t0 = this.getTransition("t0");
  5928. }
  5929. }
  5930. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  5931. class UIModeSelection extends UIBase {
  5932. constructor() {
  5933. super();
  5934. }
  5935. onConstructor() {
  5936. this.ui = ui_UIModeSelection.createInstance();
  5937. this.contentPane = this.ui;
  5938. this.isEject = false;
  5939. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  5940. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  5941. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  5942. this.addUIClick(this.ui.closeBtn, this.hide);
  5943. this.peopleArr = [650, 6900, 3800];
  5944. this.peopleOffest = [50, 500, 200];
  5945. this.updateSelf();
  5946. }
  5947. show(callback) {
  5948. super.show();
  5949. this.ui.t0.play();
  5950. this.callback = callback;
  5951. }
  5952. updateSelf() {
  5953. let cfg = cfgTable.modeselectData;
  5954. for (let index = 1; index <= 3; index++) {
  5955. let node = this.ui.myNode["type" + index];
  5956. node.need.text = cfg[index].need;
  5957. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  5958. node.peopleTxt.text = this.getRandPeople(index - 1);
  5959. }
  5960. }
  5961. enterGame(type) {
  5962. xGame.common.classicRoomType = type;
  5963. let cfg = cfgTable.modeselectData[type];
  5964. let need = cfg.need;
  5965. xGame.common.passAwardCoin = cfg.award;
  5966. if (DataMgr.coinEnough(need)) {
  5967. DataMgr.setCoin(-need);
  5968. this.ui.myNode["type" + type].t0.play();
  5969. Laya.timer.once(200, this, () => {
  5970. this.callback && this.callback();
  5971. });
  5972. }
  5973. else {
  5974. Moyu.sendDataEvent("AddCoinVideo");
  5975. xGame.uiMgr.Show(UIAddProp, 0);
  5976. }
  5977. }
  5978. getRandPeople(index) {
  5979. let rand = this.peopleOffest[index];
  5980. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  5981. }
  5982. }
  5983. UIModeSelection.uiName = "UIModeSelection";
  5984. class GlobalManager {
  5985. constructor() {
  5986. }
  5987. registerMethod(name, method) {
  5988. console.log('zh: 注册全局方法', name);
  5989. this[name] = method;
  5990. }
  5991. callMethod(name, ...args) {
  5992. console.log('zh: 调用全局方法', name);
  5993. if (this[name]) {
  5994. return this[name](...args);
  5995. }
  5996. else {
  5997. console.error(`zh: 全局方法 Method ${name} not found`);
  5998. }
  5999. }
  6000. }
  6001. GlobalManager.instance = new GlobalManager();
  6002. class JSBridgeUtils {
  6003. constructor() { }
  6004. static get instance() {
  6005. if (!this._instance) {
  6006. this._instance = new JSBridgeUtils();
  6007. }
  6008. return this._instance;
  6009. }
  6010. initBridge() {
  6011. if (!Laya.Browser.onAndroid) {
  6012. console.log('zh:非android dev');
  6013. return;
  6014. }
  6015. let cfg = window['conchConfig'];
  6016. if (cfg) {
  6017. var os = cfg.getOS();
  6018. if (os == "Conch-android") {
  6019. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  6020. if (this.bridge) {
  6021. return true;
  6022. }
  6023. else {
  6024. return false;
  6025. }
  6026. }
  6027. else {
  6028. return false;
  6029. }
  6030. }
  6031. else {
  6032. return false;
  6033. }
  6034. }
  6035. testAd1() {
  6036. if (!Laya.Browser.onAndroid) {
  6037. console.log('zh:非android dev');
  6038. return;
  6039. }
  6040. if (!this.initBridge()) {
  6041. return;
  6042. }
  6043. let rs = this.bridge.call("testString", "hello");
  6044. console.log('zh:testString rs=' + rs);
  6045. }
  6046. testAdCallBack() {
  6047. if (!this.initBridge()) {
  6048. return;
  6049. }
  6050. console.log("zh:testAdCallBack start");
  6051. const defaultObj = { code: 200, msg: "req update Ui" };
  6052. const reqObj = { code: 300, msg: "hello java ui" };
  6053. this.bridge.callWithBack((rsStr) => {
  6054. const rsObj = JSON.parse(rsStr);
  6055. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  6056. }, "testAsyncCallback", JSON.stringify(reqObj));
  6057. }
  6058. showInternAd(mark) {
  6059. if (!Laya.Browser.onAndroid) {
  6060. console.log('zh:非android dev');
  6061. return;
  6062. }
  6063. if (!this.initBridge()) {
  6064. return;
  6065. }
  6066. let rs = this.bridge.call("showInternAd", mark);
  6067. console.log('zh:showInternAd rs= ' + rs + ' ,mark=' + mark);
  6068. try {
  6069. const result = JSON.parse(rs);
  6070. if (result.code === 200) {
  6071. console.log("zh:广告显示成功");
  6072. }
  6073. else {
  6074. console.warn("zh:广告显示失败:", result.msg);
  6075. }
  6076. }
  6077. catch (e) {
  6078. console.error("zh:解析桥接返回值失败:", e);
  6079. }
  6080. }
  6081. showRewardAd(mark) {
  6082. if (!Laya.Browser.onAndroid) {
  6083. console.log('zh:非android dev');
  6084. return false;
  6085. }
  6086. if (!this.initBridge()) {
  6087. return false;
  6088. }
  6089. let rs = this.bridge.call("showRewardAd", mark);
  6090. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  6091. try {
  6092. const result = JSON.parse(rs);
  6093. if (result.code === 200) {
  6094. console.log("zh:广告显示成功");
  6095. return true;
  6096. }
  6097. else {
  6098. console.warn("zh:广告显示失败:", result.msg);
  6099. return false;
  6100. }
  6101. }
  6102. catch (e) {
  6103. console.error("zh:解析桥接返回值失败:", e);
  6104. return false;
  6105. }
  6106. }
  6107. nativeCallJs(msg) {
  6108. console.log("zh:nativeCallJs received data: 1111", msg);
  6109. if (msg === 'Ad1') {
  6110. GlobalManager.instance.callMethod('Ad1');
  6111. console.log("zh: Ad1 奖励发送成功");
  6112. }
  6113. else if (msg === 'Ad2') {
  6114. GlobalManager.instance.callMethod('Ad2');
  6115. console.log("zh: Ad2 奖励发送成功");
  6116. }
  6117. else if (msg === 'Ad3') {
  6118. GlobalManager.instance.callMethod('Ad3');
  6119. console.log("zh: Ad3 奖励发送成功");
  6120. }
  6121. else if (msg === 'Ad4') {
  6122. GlobalManager.instance.callMethod('Ad4');
  6123. console.log("zh: Ad4 奖励发送成功");
  6124. }
  6125. else if (msg === 'Ad5') {
  6126. console.log("zh: Ad5 奖励发送成功");
  6127. GlobalManager.instance.callMethod('Ad5');
  6128. }
  6129. }
  6130. }
  6131. class UIMain extends UIBase {
  6132. constructor() {
  6133. super();
  6134. this.firstEnter = true;
  6135. }
  6136. nativeCallJs(msg) {
  6137. let t = msg;
  6138. console.log("zh:ts 奖励开始发放-", t);
  6139. GlobalManager.instance.callMethod(msg);
  6140. }
  6141. onConstructor() {
  6142. this.ui = ui_UIMain.createInstance();
  6143. this.contentPane = this.ui;
  6144. this.isEject = false;
  6145. this.addEvent();
  6146. this.addClickSpine();
  6147. this.settingNode = new SettingNode(this.ui.settingNode);
  6148. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6149. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6150. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6151. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6152. let curUse = DataMgr.getCurSecretary();
  6153. this.changeSecretary(curUse);
  6154. this.ui.talkNode.visible = false;
  6155. let guide = DataMgr.getSkillGuide();
  6156. if (xGame.common.isNewDay && guide == 1) {
  6157. xGame.common.isNewDay = false;
  6158. xGame.soundMgr.playSound("s_main01");
  6159. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6160. console.log("播放小秘书每天语音");
  6161. }
  6162. this.onGetUserInfo();
  6163. this.ui.n83.visible = false;
  6164. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6165. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6166. }
  6167. changeSecretary(curUse) {
  6168. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6169. xGame.common.secretary && xGame.common.secretary.dispose();
  6170. this.addSecretarySpine(name);
  6171. }
  6172. addSecretarySpine(name) {
  6173. let spine = new SpineMgr(name, () => {
  6174. this.playSecretaryIdle();
  6175. });
  6176. xGame.common.secretary = spine;
  6177. }
  6178. addClickSpine() {
  6179. let clickSpine = new SpineMgr("dianji", () => {
  6180. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6181. let parent = Laya.stage;
  6182. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6183. clickSpine.play(data, 0, false, parent, (spine) => {
  6184. spine.destroy(true);
  6185. });
  6186. });
  6187. });
  6188. }
  6189. addEvent() {
  6190. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6191. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6192. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6193. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6194. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6195. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6196. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6197. this.addUIClick(this.ui, this.interuptSecretary);
  6198. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6199. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6200. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6201. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6202. this.addUIClick(this.ui.signBtn, this.openSignView);
  6203. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6204. }
  6205. show(showFailWords) {
  6206. super.show();
  6207. this.moneyNode.ui.c1.selectedIndex = 1;
  6208. this.playSecretaryIdle();
  6209. xGame.soundMgr.playMusic("caromhall01");
  6210. Laya.timer.clearAll(this);
  6211. this.playSecretaryRandomSound();
  6212. if (showFailWords) {
  6213. setTimeout(() => {
  6214. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6215. let words = -1;
  6216. if (str == "s_main02") {
  6217. words = 2;
  6218. }
  6219. else {
  6220. words = 3;
  6221. }
  6222. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6223. xGame.soundMgr.playSound(str);
  6224. }, 300);
  6225. }
  6226. this.showGuide();
  6227. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6228. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6229. let guide = DataMgr.getSkillGuide();
  6230. if (guide == 1) {
  6231. let randTime = xGame.common.randomNum(300, 800);
  6232. if (this.firstEnter) {
  6233. this.firstEnter = false;
  6234. randTime += 900;
  6235. }
  6236. Laya.timer.once(randTime, this, () => {
  6237. xGame.common.autoPopUIView();
  6238. });
  6239. }
  6240. }
  6241. checkActive(show) {
  6242. }
  6243. showGuide() {
  6244. let guide = DataMgr.getSkillGuide();
  6245. this.ui.guideBtn.visible = guide == 0;
  6246. this.ui.enterGuide.visible = false;
  6247. this.ui.secretaryGuide.visible = guide == 0;
  6248. if (guide == 0) {
  6249. xGame.soundMgr.playSound("s_guide");
  6250. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6251. }
  6252. }
  6253. ensureSecretary() {
  6254. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6255. this.ui.secretaryGuide.visible = false;
  6256. this.ui.enterGuide.visible = true;
  6257. this.ui.wordsNode.t0.play();
  6258. if (DataMgr.getNewUser())
  6259. Moyu.sendDataEvent("gameReady");
  6260. }
  6261. playSecretaryIdle() {
  6262. let parent = this.ui.secretary.displayObject;
  6263. parent.destroyChildren();
  6264. let xx = this.ui.secretary.width / 2;
  6265. let yy = this.ui.secretary.height;
  6266. let scale = xGame.common.getSecretaryScale();
  6267. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6268. console.log("zh:playSecretaryIdle", data);
  6269. xGame.common.secretary.play(data, 0, true, parent);
  6270. }
  6271. startGame(type) {
  6272. xGame.common.gameMode = type;
  6273. Moyu.sendDataEvent("PlayGame", { type: type });
  6274. switch (xGame.common.gameMode) {
  6275. case GameMode.classic:
  6276. let challengeTimes = DataMgr.getChallengeTimes();
  6277. if (challengeTimes == 0) {
  6278. xGame.uiMgr.Show(UIInvitation);
  6279. }
  6280. else {
  6281. this.beginGame();
  6282. }
  6283. break;
  6284. case GameMode.bigMove:
  6285. this.beginGame();
  6286. if (DataMgr.getNewUser())
  6287. Moyu.sendDataEvent("gameStart0");
  6288. break;
  6289. default:
  6290. break;
  6291. }
  6292. }
  6293. beginGame(isNice = false) {
  6294. if (xGame.common.gameMode == GameMode.classic) {
  6295. if (isNice) {
  6296. this.enterClassic();
  6297. }
  6298. else {
  6299. xGame.uiMgr.Show(UIModeSelection, () => {
  6300. this.enterClassic();
  6301. });
  6302. }
  6303. }
  6304. else if (xGame.common.gameMode == GameMode.bigMove) {
  6305. this.ui.enterGuide.visible = false;
  6306. xGame.uiMgr.Show(UISkill);
  6307. }
  6308. }
  6309. enterClassic() {
  6310. xGame.uiMgr.Show(UIGame);
  6311. xGame.uiMgr.Show(UIMatching, () => {
  6312. if (!this.isHide)
  6313. this.hide();
  6314. xGame.common.gameUI.ui.alpha = 1;
  6315. xGame.common.gameUI.startGame();
  6316. xGame.uiMgr.Hide(UIGameEnd);
  6317. });
  6318. }
  6319. startGlobal() {
  6320. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6321. JSBridgeUtils.instance.showInternAd('全球');
  6322. }
  6323. startWeekly() {
  6324. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6325. GlobalManager.instance.registerMethod('zhouSaiMonth', this.zhouSaiMonth);
  6326. JSBridgeUtils.instance.showRewardAd('zhouSaiMonth');
  6327. }
  6328. zhouSaiMonth() {
  6329. console.log('zh: zhouSaiMonth 被调用');
  6330. }
  6331. startPlaceBall() {
  6332. xGame.uiMgr.Show(UILevelDisplay);
  6333. }
  6334. hide() {
  6335. super.hide();
  6336. xGame.common.stopGirlPop(this.ui.talkNode);
  6337. }
  6338. onGetUserInfo(force = false) {
  6339. if (Moyu.isWx) {
  6340. let info = Moyu.getSystemInfo();
  6341. if (info)
  6342. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6343. }
  6344. else {
  6345. Moyu.initUser(this, this.freshUser, force);
  6346. }
  6347. if (!Moyu.hasUserInfo) {
  6348. let user = Moyu.getUserInfo();
  6349. user.headIcon = 'res/ty_touxiang.png';
  6350. }
  6351. this.freshUser();
  6352. }
  6353. freshUser() {
  6354. let user = Moyu.getUserInfo();
  6355. if (!user.isAuth) {
  6356. user.headIcon = 'res/ty_touxiang.png';
  6357. }
  6358. else
  6359. DataMgr.upRankData();
  6360. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6361. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6362. }
  6363. interuptSecretary() {
  6364. Laya.timer.clearAll(this);
  6365. this.playSecretaryRandomSound();
  6366. }
  6367. playSecretaryRandomSound() {
  6368. if (this.isHide)
  6369. return;
  6370. let time = xGame.common.randomNum(45000, 60000);
  6371. Laya.timer.once(time, this, () => {
  6372. if (this.isHide)
  6373. return;
  6374. let index = xGame.common.randomNum(4, 7);
  6375. xGame.soundMgr.playSound("s_main0" + index);
  6376. let words = 1;
  6377. switch (index) {
  6378. case 4:
  6379. words = 5;
  6380. break;
  6381. case 5:
  6382. words = 3;
  6383. break;
  6384. case 6:
  6385. words = 6;
  6386. break;
  6387. case 7:
  6388. words = 7;
  6389. break;
  6390. default:
  6391. break;
  6392. }
  6393. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6394. this.playSecretaryRandomSound();
  6395. });
  6396. }
  6397. openSecretaryView() {
  6398. xGame.uiMgr.Show(UISecretary);
  6399. Moyu.sendDataEvent("secretary");
  6400. }
  6401. openShopView() {
  6402. xGame.uiMgr.Show(UIShop);
  6403. }
  6404. openSignView() {
  6405. xGame.uiMgr.Show(UISign);
  6406. }
  6407. openDrawView() {
  6408. xGame.uiMgr.Show(UIDraw);
  6409. }
  6410. openRanking() {
  6411. xGame.uiMgr.Show(UIRanking);
  6412. Moyu.sendDataEvent("rankingList");
  6413. }
  6414. }
  6415. UIMain.uiName = "UIMain";
  6416. class UIGameEnd extends UIBase {
  6417. constructor() {
  6418. super();
  6419. this.success = false;
  6420. this.awardCoinNum = 1000;
  6421. this.awardDiamondNum = 10;
  6422. }
  6423. onConstructor() {
  6424. this.ui = ui_UIGameEnd.createInstance();
  6425. this.contentPane = this.ui;
  6426. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6427. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6428. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6429. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6430. this.ui.talkNode.visible = false;
  6431. if (Moyu.isKs)
  6432. this.ui.closeNode.closeBtn.x += 100;
  6433. }
  6434. updateType() {
  6435. switch (xGame.common.gameMode) {
  6436. case GameMode.classic:
  6437. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6438. this.ui.coinNode.visible = this.success;
  6439. if (!this.success) {
  6440. Laya.timer.once(500, this, () => {
  6441. xGame.uiMgr.Show(UIAddCoin);
  6442. });
  6443. }
  6444. this.ui.isGetAward.visible = false;
  6445. this.ui.leftBtn.c1.selectedIndex = 3;
  6446. this.ui.rightBtn.c1.selectedIndex = 0;
  6447. this.moneyNode.ui.c1.selectedIndex = 1;
  6448. break;
  6449. case GameMode.bigMove:
  6450. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6451. this.ui.coinNode.visible = this.success;
  6452. if (xGame.common.gameMode == GameMode.bigMove) {
  6453. if (this.success) {
  6454. DataMgr.setSkillSuccessTimes(1, true);
  6455. DataMgr.setSkillAccTimes(1);
  6456. }
  6457. else {
  6458. DataMgr.setSkillSuccessTimes(0, false);
  6459. }
  6460. }
  6461. if (!this.success) {
  6462. Laya.timer.once(500, this, () => {
  6463. xGame.uiMgr.Show(UIAddCoin);
  6464. });
  6465. }
  6466. this.ui.isGetAward.visible = false;
  6467. this.ui.leftBtn.c1.selectedIndex = 3;
  6468. this.ui.rightBtn.c1.selectedIndex = 0;
  6469. this.moneyNode.ui.c1.selectedIndex = 1;
  6470. break;
  6471. case GameMode.placeBall:
  6472. this.ui.coinNode.visible = false;
  6473. if (this.success) {
  6474. if (xGame.common.placeBallStarNum == 3) {
  6475. this.ui.c1.selectedIndex = 2;
  6476. }
  6477. else {
  6478. this.ui.c1.selectedIndex = 3;
  6479. }
  6480. }
  6481. else {
  6482. this.ui.c1.selectedIndex = 4;
  6483. }
  6484. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6485. if (cfg.type == PlaceBallType.challenge) {
  6486. this.ui.c1.selectedIndex = 2;
  6487. }
  6488. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6489. this.updatePlaceBallBtn();
  6490. this.updatePlaceBallStarNum();
  6491. this.updatePlaceBallAwardState();
  6492. this.moneyNode.ui.c1.selectedIndex = 2;
  6493. this.moneyNode.checkPowerTime();
  6494. this.moneyNode.powerChange();
  6495. DataMgr.upRankData();
  6496. break;
  6497. default:
  6498. break;
  6499. }
  6500. }
  6501. updatePlaceBallBtn() {
  6502. this.ui.leftBtn.c1.selectedIndex = 5;
  6503. if (this.success) {
  6504. this.ui.rightBtn.c1.selectedIndex = 14;
  6505. }
  6506. else {
  6507. if (xGame.common.placeBallStarNum == 3) {
  6508. this.ui.rightBtn.c1.selectedIndex = 14;
  6509. }
  6510. else {
  6511. this.ui.rightBtn.c1.selectedIndex = 1;
  6512. }
  6513. }
  6514. }
  6515. updatePlaceBallStarNum() {
  6516. let starNum = xGame.common.placeBallStarNum;
  6517. if (starNum == 0)
  6518. this.ui.starNumNode.c1.selectedIndex = 3;
  6519. else {
  6520. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6521. }
  6522. }
  6523. updatePlaceBallAwardState() {
  6524. let level = xGame.common.placeBallCurLevel;
  6525. let starNum = xGame.common.placeBallStarNum;
  6526. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6527. let data = cfgTable.placeballData[level].award;
  6528. let cfg = cfgTable.placeballData[level];
  6529. this.awardDiamondNum = data[1];
  6530. this.awardCoinNum = data[0];
  6531. if (cfg.type == PlaceBallType.challenge) {
  6532. this.awardDiamondNum = 0;
  6533. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6534. }
  6535. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6536. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6537. if (cfg.type == PlaceBallType.challenge) {
  6538. this.ui.awardNode.coinNode.visible = true;
  6539. }
  6540. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6541. this.ui.awardNode.diamondNode.x = 265;
  6542. this.ui.awardNode.coinNode.x = 354;
  6543. }
  6544. else {
  6545. this.ui.awardNode.diamondNode.x = 291;
  6546. this.ui.awardNode.coinNode.x = 291;
  6547. }
  6548. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6549. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6550. if (this.awardCoinNum == 0) {
  6551. this.ui.awardNode.coinNode.numTxt.text = "";
  6552. }
  6553. if (getAward) {
  6554. this.ui.isGetAward.visible = true;
  6555. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6556. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6557. }
  6558. else {
  6559. this.ui.isGetAward.visible = false;
  6560. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6561. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6562. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6563. }
  6564. else {
  6565. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6566. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6567. }
  6568. }
  6569. }
  6570. show(success) {
  6571. super.show();
  6572. xGame.eventMgr.event(RESET_GAME);
  6573. this.success = success;
  6574. Laya.timer.clearAll(this);
  6575. this.playSecretaryAni();
  6576. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6577. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6578. offsetTime = Math.floor(offsetTime / 1000);
  6579. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6580. this.updateType();
  6581. Laya.timer.once(200, this, () => {
  6582. this.addAward(() => {
  6583. this.updateType();
  6584. Laya.timer.once(500, this, () => {
  6585. this.showChallengeLevel();
  6586. });
  6587. });
  6588. });
  6589. if (this.success) {
  6590. xGame.soundMgr.playSound('slots_roll01');
  6591. xGame.soundMgr.playSound("s_win");
  6592. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6593. }
  6594. else {
  6595. xGame.soundMgr.playSound('matchwin01');
  6596. xGame.soundMgr.playSound("s_lose");
  6597. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6598. }
  6599. if (!Moyu.isLegal)
  6600. PlatMgr.showBanner(true);
  6601. let challengeNum = DataMgr.getChallengeTimes();
  6602. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6603. DataMgr.setChallengeTimes(1);
  6604. }
  6605. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6606. DataMgr.setClassicTimes();
  6607. }
  6608. }
  6609. showChallengeLevel() {
  6610. if (DataMgr.getChallengeTimes() != 0)
  6611. return;
  6612. let skill = DataMgr.getSkillAccTimes();
  6613. let put = DataMgr.getPlaceBallLevelList().length;
  6614. if (skill >= 3 || put >= 5) {
  6615. xGame.uiMgr.Show(UIInvitation);
  6616. this.hide();
  6617. }
  6618. }
  6619. addAward(callback) {
  6620. if (!this.success) {
  6621. callback && callback();
  6622. return;
  6623. }
  6624. switch (xGame.common.gameMode) {
  6625. case GameMode.classic:
  6626. this.awardCoinNum = xGame.common.passAwardCoin;
  6627. this.awardDiamondNum = 0;
  6628. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6629. break;
  6630. case GameMode.bigMove:
  6631. this.awardCoinNum = xGame.common.passAwardCoin;
  6632. this.awardDiamondNum = 0;
  6633. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6634. callback && callback();
  6635. break;
  6636. case GameMode.placeBall:
  6637. let level = xGame.common.placeBallCurLevel;
  6638. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6639. if (xGame.common.placeBallStarNum != 3) {
  6640. callback && callback();
  6641. return;
  6642. }
  6643. else {
  6644. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6645. if (getAward) {
  6646. callback && callback();
  6647. return;
  6648. }
  6649. }
  6650. let cfg = cfgTable.placeballData[level];
  6651. let data = cfgTable.placeballData[level].award;
  6652. this.awardCoinNum = data[0];
  6653. this.awardDiamondNum = data[1];
  6654. if (cfg.type == PlaceBallType.challenge) {
  6655. this.awardDiamondNum = 0;
  6656. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6657. }
  6658. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6659. let diamondAward;
  6660. if (this.awardDiamondNum > 0) {
  6661. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6662. xGame.common.getAward([diamondAward, coinAward], callback);
  6663. }
  6664. else {
  6665. xGame.common.getAward([coinAward], callback);
  6666. }
  6667. if (cfg.type == PlaceBallType.normal) {
  6668. DataMgr.setPlaceBallAward(level);
  6669. }
  6670. break;
  6671. default:
  6672. break;
  6673. }
  6674. }
  6675. playSecretaryAni_old() {
  6676. let parent = this.ui.secretary.displayObject;
  6677. parent.destroyChildren();
  6678. let xx = this.ui.secretary.width / 2;
  6679. let yy = this.ui.secretary.height;
  6680. let scale = xGame.common.getSecretaryScale();
  6681. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6682. if (this.success) {
  6683. let rand = Math.random() <= 0.5 ? 2 : 3;
  6684. xGame.common.secretary.play(data, rand, false, parent, () => {
  6685. xGame.common.secretary.play(data, 1, true, parent);
  6686. });
  6687. }
  6688. else {
  6689. xGame.common.secretary.play(data, 0, true, parent);
  6690. }
  6691. }
  6692. playSecretaryAni() {
  6693. let parent = this.ui.secretary.displayObject;
  6694. parent.destroyChildren();
  6695. let xx = this.ui.secretary.width / 2;
  6696. let yy = this.ui.secretary.height;
  6697. let scale = xGame.common.getSecretaryScale();
  6698. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6699. if (this.success) {
  6700. let rand = 0;
  6701. xGame.common.secretary.play(data, 0, true, parent);
  6702. }
  6703. else {
  6704. xGame.common.secretary.play(data, 0, true, parent);
  6705. }
  6706. }
  6707. restartGame() {
  6708. switch (xGame.common.gameMode) {
  6709. case GameMode.classic:
  6710. xGame.eventMgr.event(RESTART_GAME);
  6711. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6712. break;
  6713. case GameMode.bigMove:
  6714. this.hide();
  6715. xGame.eventMgr.event(RESTART_GAME);
  6716. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6717. break;
  6718. default:
  6719. break;
  6720. }
  6721. }
  6722. hide() {
  6723. super.hide();
  6724. xGame.common.stopGirlPop(this.ui.talkNode);
  6725. PlatMgr.showBanner(false);
  6726. }
  6727. returnHome() {
  6728. this.hide();
  6729. let showFailWords = !this.success;
  6730. xGame.uiMgr.Show(UIMain, showFailWords);
  6731. }
  6732. clickLeftBtn() {
  6733. switch (xGame.common.gameMode) {
  6734. case GameMode.classic:
  6735. case GameMode.bigMove:
  6736. this.returnHome();
  6737. break;
  6738. case GameMode.placeBall:
  6739. let level = xGame.common.placeBallCurLevel;
  6740. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  6741. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  6742. break;
  6743. default:
  6744. break;
  6745. }
  6746. }
  6747. powerStartPlaceBallLevel(level, btn) {
  6748. if (DataMgr.powerEnough()) {
  6749. btn.touchable = false;
  6750. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  6751. btn.touchable = true;
  6752. DataMgr.setPower(-1);
  6753. xGame.eventMgr.event(POWER_TIME);
  6754. this.startPlaceBallLevel(level);
  6755. }));
  6756. }
  6757. else {
  6758. xGame.uiMgr.Show(UIPower, 0);
  6759. }
  6760. }
  6761. clickRightBtn() {
  6762. switch (xGame.common.gameMode) {
  6763. case GameMode.classic:
  6764. console.log('zh:clickRightBtn 111');
  6765. case GameMode.bigMove:
  6766. console.log('zh:clickRightBtn 222');
  6767. this.restartGame();
  6768. break;
  6769. case GameMode.placeBall:
  6770. console.log('zh:clickRightBtn 333');
  6771. let level = xGame.common.placeBallCurLevel;
  6772. let data = DataMgr.getPlaceBallLevel(level);
  6773. let curPss = data.play && !data.isCur;
  6774. if (curPss) {
  6775. console.log('zh:clickRightBtn 333-111');
  6776. console.log('zh:当前LV=' + level);
  6777. if (level == 60) {
  6778. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  6779. Laya.timer.once(3000, this, () => {
  6780. this.returnHome();
  6781. });
  6782. }
  6783. else {
  6784. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  6785. }
  6786. }
  6787. else {
  6788. console.log('zh:clickRightBtn 333-000');
  6789. Moyu.sendDataEvent("placeBallNextLevel");
  6790. Moyu.showVideoAd(() => {
  6791. DataMgr.setPlaceBallLevel(level, 1);
  6792. this.startPlaceBallLevel(level + 1);
  6793. }, xGame.define.EAdType.placeBallNextLevel);
  6794. }
  6795. break;
  6796. default:
  6797. console.log('zh:clickRightBtn 444');
  6798. break;
  6799. }
  6800. }
  6801. startPlaceBallLevel(level) {
  6802. xGame.common.gameMode = GameMode.placeBall;
  6803. xGame.common.placeBallCurLevel = level;
  6804. xGame.uiMgr.Show(UIGame);
  6805. this.hide();
  6806. }
  6807. }
  6808. UIGameEnd.uiName = "UIGameEnd";
  6809. class ui_UIRepentProp extends fgui.GComponent {
  6810. static createInstance() {
  6811. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6812. }
  6813. onConstruct() {
  6814. this.c1 = this.getController("c1");
  6815. this.n11 = (this.getChild("n11"));
  6816. this.regretNode = (this.getChild("regretNode"));
  6817. this.helpLineNode = (this.getChild("helpLineNode"));
  6818. this.t0 = this.getTransition("t0");
  6819. }
  6820. }
  6821. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6822. class UIRepentProp extends UIBase {
  6823. constructor() {
  6824. super();
  6825. this.viewType = 0;
  6826. this.regretType = 0;
  6827. }
  6828. onConstructor() {
  6829. this.ui = ui_UIRepentProp.createInstance();
  6830. this.contentPane = this.ui;
  6831. this.isEject = false;
  6832. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6833. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6834. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6835. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6836. }
  6837. show(viewType, regretType, callback) {
  6838. PlatMgr.showInsert(true);
  6839. this.viewType = viewType;
  6840. this.regretType = regretType;
  6841. this.callback = callback;
  6842. super.show();
  6843. this.ui.t0.play();
  6844. this.ui.c1.selectedIndex = this.viewType;
  6845. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6846. if (this.viewType == 0) {
  6847. let guide = DataMgr.getGuideHelpLine();
  6848. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6849. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6850. }
  6851. xGame.common.gameMgr.gamePause = true;
  6852. }
  6853. hideSelf() {
  6854. xGame.common.gameMgr.gamePause = false;
  6855. this.callback && this.callback(false);
  6856. this.hide();
  6857. }
  6858. videoRegret() {
  6859. Moyu.showVideoAd(() => {
  6860. this.callback && this.callback(true);
  6861. this.hideSelf();
  6862. }, EAdType.regretBall);
  6863. }
  6864. videoAddHelpLine() {
  6865. let guide = DataMgr.getGuideHelpLine();
  6866. if (guide == 0) {
  6867. this.callback && this.callback(true);
  6868. this.hideSelf();
  6869. DataMgr.setGuideHelpLine();
  6870. xGame.common.gameUI.ui.guideNode.visible = false;
  6871. }
  6872. else {
  6873. Moyu.showVideoAd(() => {
  6874. this.callback && this.callback(true);
  6875. this.hideSelf();
  6876. }, EAdType.longHelpLine);
  6877. }
  6878. }
  6879. }
  6880. UIRepentProp.uiName = "UIRepentProp";
  6881. class ui_UIVideoShare extends fgui.GComponent {
  6882. static createInstance() {
  6883. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  6884. }
  6885. onConstruct() {
  6886. this.n10 = (this.getChild("n10"));
  6887. this.myNode = (this.getChild("myNode"));
  6888. this.t0 = this.getTransition("t0");
  6889. }
  6890. }
  6891. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  6892. class UIVideoShare extends UIBase {
  6893. constructor() {
  6894. super();
  6895. this.success = false;
  6896. this.awardNum = 0;
  6897. this.isShared = true;
  6898. }
  6899. onConstructor() {
  6900. this.ui = ui_UIVideoShare.createInstance();
  6901. this.contentPane = this.ui;
  6902. this.isEject = false;
  6903. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  6904. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  6905. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  6906. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  6907. }
  6908. show(success) {
  6909. super.show();
  6910. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  6911. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  6912. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  6913. this.success = success;
  6914. let time = xGame.common.randomNum(600, 1500);
  6915. Moyu.showInsertAd(time, 60000);
  6916. if (success)
  6917. xGame.soundMgr.playSound("applause");
  6918. this.ui.t0.play();
  6919. this.checkShareState();
  6920. let times = DataMgr.getDailyVideoShareTimes();
  6921. this.awardNum = times == 0 ? 2000 : 200;
  6922. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  6923. }
  6924. checkShareState() {
  6925. if (PlatMgr.forceShare == 0) {
  6926. this.ui.myNode.closeBtn.visible = true;
  6927. this.ui.myNode.tipsNode.visible = false;
  6928. this.ui.myNode.closeBtn.x = 90;
  6929. this.ui.myNode.shareBtn.x = 342;
  6930. }
  6931. else if (PlatMgr.forceShare == 1) {
  6932. this.ui.myNode.closeBtn.visible = false;
  6933. this.ui.myNode.tipsNode.visible = true;
  6934. this.ui.myNode.shareBtn.x = 218;
  6935. this.isShared = true;
  6936. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6937. }
  6938. }
  6939. checkForceShare() {
  6940. this.isShared = !this.isShared;
  6941. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  6942. }
  6943. videoShare() {
  6944. if (PlatMgr.forceShare == 1) {
  6945. if (this.isShared) {
  6946. this.shareGame();
  6947. }
  6948. else {
  6949. this.hideSelf();
  6950. }
  6951. }
  6952. else {
  6953. this.shareGame();
  6954. }
  6955. }
  6956. shareGame() {
  6957. Moyu.sendDataEvent("VideoShare");
  6958. if (Moyu.canShare() > 100) {
  6959. Moyu.shareGame((success) => {
  6960. if (success) {
  6961. DataMgr.setDailyVideoShareTimes(1);
  6962. DataMgr.setCoin(this.awardNum);
  6963. }
  6964. this.hideSelf();
  6965. }, this);
  6966. }
  6967. else {
  6968. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  6969. this.hideSelf();
  6970. }
  6971. }
  6972. hideSelf() {
  6973. this.hide();
  6974. xGame.uiMgr.Show(UIGameEnd, this.success);
  6975. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  6976. xGame.common.screenImg.destroy();
  6977. xGame.common.screenImg = null;
  6978. }
  6979. }
  6980. }
  6981. UIVideoShare.uiName = "UIVideoShare";
  6982. class ui_UITips extends fgui.GComponent {
  6983. static createInstance() {
  6984. return (fgui.UIPackage.createObject("game", "UITips"));
  6985. }
  6986. onConstruct() {
  6987. this.n0 = (this.getChild("n0"));
  6988. this.myNode = (this.getChild("myNode"));
  6989. this.t0 = this.getTransition("t0");
  6990. }
  6991. }
  6992. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  6993. class UITips extends UIBase {
  6994. constructor() {
  6995. super();
  6996. this.type = 0;
  6997. }
  6998. onConstructor() {
  6999. this.ui = ui_UITips.createInstance();
  7000. this.contentPane = this.ui;
  7001. this.isEject = false;
  7002. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7003. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7004. }
  7005. show(tipsTxt, womanTxt, type) {
  7006. super.show();
  7007. this.ui.t0.play();
  7008. this.ui.myNode.tipsTxt.text = tipsTxt;
  7009. this.ui.myNode.womanTxt.text = womanTxt;
  7010. PlatMgr.showInsert(true);
  7011. this.ui.myNode.c1.selectedIndex = type;
  7012. this.type = type;
  7013. switch (this.type) {
  7014. case TipsType.exitGame:
  7015. xGame.common.gameMgr.gamePause = true;
  7016. break;
  7017. case TipsType.foul:
  7018. Laya.timer.once(200, this, () => {
  7019. xGame.common.gameMgr.gamePause = true;
  7020. });
  7021. break;
  7022. default:
  7023. break;
  7024. }
  7025. }
  7026. clickLeftBtn() {
  7027. this.hide();
  7028. xGame.common.gameMgr.gamePause = false;
  7029. switch (this.type) {
  7030. case TipsType.exitGame:
  7031. break;
  7032. case TipsType.foul:
  7033. break;
  7034. default:
  7035. break;
  7036. }
  7037. }
  7038. clickRightBtn() {
  7039. this.hide();
  7040. switch (this.type) {
  7041. case TipsType.exitGame:
  7042. xGame.eventMgr.event(RESET_GAME);
  7043. xGame.uiMgr.Show(UIMain);
  7044. Moyu.recordEnd(this, null);
  7045. xGame.common.longHelpLine = false;
  7046. break;
  7047. case TipsType.foul:
  7048. xGame.common.gameMgr.gamePause = false;
  7049. Laya.timer.clearAll(this);
  7050. break;
  7051. default:
  7052. break;
  7053. }
  7054. }
  7055. }
  7056. UITips.uiName = "UITips";
  7057. class GameMgr {
  7058. constructor() {
  7059. this.selfCamp = "";
  7060. this.selfFoulNum = 0;
  7061. this.selfBallArr = [];
  7062. this.selfTimer = 0;
  7063. this.selfScore = 0;
  7064. this.aiCamp = "";
  7065. this.aiFoulNum = 0;
  7066. this.aiBallArr = [];
  7067. this.aiTimer = 0;
  7068. this.aiScore = 0;
  7069. this.aiSkillLevelNum = 1;
  7070. this.targertScore = 0;
  7071. this.setTime = 30;
  7072. this.selfTurnRate = 0.5;
  7073. this.accTime = 0;
  7074. this.curFoul = "";
  7075. this.maxFoulTimes = 3;
  7076. this.isFirstInGame = true;
  7077. this.firstColliObj = null;
  7078. this.inHoleBalls = [];
  7079. this.blackNum = 8;
  7080. this.success = false;
  7081. this.holePosList = [];
  7082. this.posObj = {};
  7083. this._selfTurn = false;
  7084. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7085. this.ensureBallType = false;
  7086. this.isOpenBall = true;
  7087. this.finishOneShoot = true;
  7088. this.isEnd = false;
  7089. this.isChangeTurn = false;
  7090. this.isInterrupt = false;
  7091. this.aiPlayedBreakArmy = false;
  7092. this.isTouchedBall = false;
  7093. this.finishBalls = 0;
  7094. this.needBalls = 0;
  7095. this.allBallNum = 0;
  7096. this.placeBallPosData = {};
  7097. this.curHP = 0;
  7098. this.showLongView = false;
  7099. this.firstShoot = true;
  7100. this._gamePause = false;
  7101. this.trunCount = 0;
  7102. this.isBlackInHole = false;
  7103. this.isEnter = true;
  7104. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7105. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7106. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7107. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7108. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7109. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7110. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7111. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7112. }
  7113. get gamePause() {
  7114. return this._gamePause;
  7115. }
  7116. set gamePause(v) {
  7117. if (v) {
  7118. Laya.physicsTimer.pause();
  7119. }
  7120. else {
  7121. Laya.physicsTimer.resume();
  7122. }
  7123. this._gamePause = v;
  7124. }
  7125. get selfTurn() {
  7126. return this._selfTurn;
  7127. }
  7128. set selfTurn(val) {
  7129. this.trunCount++;
  7130. this._selfTurn = val;
  7131. if (val) {
  7132. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7133. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7134. }
  7135. else {
  7136. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7137. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7138. if (this.trunCount > 1)
  7139. PlatMgr.openBox();
  7140. }
  7141. }
  7142. resetGame() {
  7143. this.inHoleBalls = [];
  7144. this.isFirstInGame = true;
  7145. this.firstColliObj = null;
  7146. this.aiCamp = "";
  7147. this.selfCamp = "";
  7148. this.aiFoulNum = 0;
  7149. this.selfFoulNum = 0;
  7150. this.selfBallArr = [];
  7151. this.aiBallArr = [];
  7152. this.gamePause = false;
  7153. this.ensureBallType = false;
  7154. this.isInterrupt = false;
  7155. this.updateLeftBall();
  7156. this.clearTime();
  7157. this.aiPlayedBreakArmy = false;
  7158. this.isBlackInHole = false;
  7159. this.placeBallPosData = {};
  7160. if (xGame.common.d3World.knifeRoot) {
  7161. xGame.common.d3World.knifeRoot.destroyChildren();
  7162. }
  7163. }
  7164. gameReady() {
  7165. this.trunCount = 0;
  7166. this.firstColliObj = null;
  7167. this.isFirstInGame = true;
  7168. this.selfTurn = Math.random() <= this.selfTurnRate;
  7169. let challengeNum = DataMgr.getChallengeTimes();
  7170. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7171. this.selfTurn = true;
  7172. }
  7173. if (xGame.common.gameMode == GameMode.placeBall)
  7174. this.selfTurn = true;
  7175. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7176. this.selfTurn = true;
  7177. }
  7178. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7179. this.checkGuide();
  7180. if (xGame.common.uiRodMethod)
  7181. xGame.common.uiRodMethod.resetRod();
  7182. xGame.common.d2World.getHelpLine();
  7183. this.isOpenBall = true;
  7184. this.isTouchedBall = false;
  7185. xGame.common.aiPlayer.stopRun();
  7186. this.setTime = 30;
  7187. let ui = xGame.common.gameUI.ui;
  7188. switch (xGame.common.gameMode) {
  7189. case GameMode.classic:
  7190. xGame.common.aiPlayer.init();
  7191. this.blackNum = 8;
  7192. this.placeRootBall();
  7193. this.peoplePlay(9, 10);
  7194. ui.wordsBtn.visible = true;
  7195. ui.aiWordsBtn.visible = true;
  7196. xGame.common.talkMgr.changeAIState(true);
  7197. DataMgr.gameData.gameCount++;
  7198. DataMgr.saveGameData();
  7199. break;
  7200. case GameMode.bigMove:
  7201. this.blackNum = -1;
  7202. this.selfScore = 0;
  7203. this.aiScore = 0;
  7204. xGame.common.aiPlayer.init();
  7205. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7206. this.updateSelfScore();
  7207. this.updateAIScore();
  7208. this.updateTargetSroce();
  7209. this.placeRootBall();
  7210. this.peoplePlay(9, 10);
  7211. ui.wordsBtn.visible = true;
  7212. ui.aiWordsBtn.visible = true;
  7213. xGame.common.talkMgr.changeAIState(true);
  7214. if (DataMgr.getSkillGuide() < 1)
  7215. DataMgr.gameData.gameCount = 0;
  7216. else {
  7217. DataMgr.gameData.gameCount++;
  7218. DataMgr.saveGameData();
  7219. PlatMgr.openTry();
  7220. }
  7221. if (xGame.common.d3World.knifeRoot) {
  7222. xGame.common.d3World.knifeRoot.destroyChildren();
  7223. }
  7224. break;
  7225. case GameMode.placeBall:
  7226. this.blackNum = -1;
  7227. this.selfTurn = true;
  7228. this.setTime = 10000;
  7229. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7230. this.curHP = this.placeBallData.hp;
  7231. if (this.placeBallData.ball == -1)
  7232. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7233. else
  7234. this.needBalls = this.placeBallData.ball;
  7235. console.log("需要的进球数目", this.needBalls);
  7236. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7237. this.finishBalls = 0;
  7238. this.placeBallPosData = {};
  7239. this.updatePlaceBallPos();
  7240. this.updatePlaceBallState();
  7241. this.finishOneShoot = true;
  7242. xGame.common.gameUI.ui.moveNode.visible = false;
  7243. this.isOpenBall = false;
  7244. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7245. ui.wordsBtn.visible = false;
  7246. ui.aiWordsBtn.visible = false;
  7247. xGame.common.talkMgr.changeAIState(false);
  7248. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7249. PlatMgr.openBox();
  7250. });
  7251. break;
  7252. default:
  7253. break;
  7254. }
  7255. this.showLongView = false;
  7256. xGame.common.wordsMgr.comboTimes = 1;
  7257. let guide = DataMgr.getSkillGuide();
  7258. if (guide)
  7259. xGame.eventMgr.event(WAIT_SHOOT);
  7260. xGame.common.upSkillLevel = false;
  7261. xGame.common.gameStartTime = new Date().getTime();
  7262. this.firstShoot = true;
  7263. }
  7264. checkGuide() {
  7265. let guide = DataMgr.getSkillGuide();
  7266. let gameUI = xGame.common.gameUI.ui;
  7267. gameUI.guide1.visible = false;
  7268. gameUI.guide2.visible = false;
  7269. gameUI.guide3.visible = false;
  7270. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7271. this.selfTurn = true;
  7272. }
  7273. else {
  7274. return;
  7275. }
  7276. let oneBall = this.getOneBall();
  7277. gameUI.guide1.visible = true;
  7278. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7279. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7280. }
  7281. getOneBall() {
  7282. let arr = xGame.common.d2World.ballArr;
  7283. for (let index = 0; index < arr.length; index++) {
  7284. if (arr[index].number == 0)
  7285. continue;
  7286. return arr[index];
  7287. }
  7288. }
  7289. updateSelfScore() {
  7290. let ui = xGame.common.gameUI.ui.topNode;
  7291. ui.selfScoreTxt.text = this.selfScore + "";
  7292. }
  7293. updateAIScore() {
  7294. let ui = xGame.common.gameUI.ui.topNode;
  7295. ui.aiScoreTxt.text = this.aiScore + "";
  7296. }
  7297. updateTargetSroce() {
  7298. let ui = xGame.common.gameUI.ui.topNode;
  7299. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7300. }
  7301. updateLeftBall() {
  7302. let topUI = xGame.common.gameUI.ui.topNode;
  7303. topUI.selfBallList.numItems = this.selfBallArr.length;
  7304. topUI.aiBallList.numItems = this.aiBallArr.length;
  7305. }
  7306. ballShoot() {
  7307. this.clearTime();
  7308. this.finishOneShoot = false;
  7309. xGame.common.gameUI.ui.moveNode.visible = false;
  7310. if (xGame.common.gameUI.ui.guideNode.visible) {
  7311. xGame.common.gameUI.ui.guideNode.visible = false;
  7312. }
  7313. if (this.firstShoot) {
  7314. this.firstShoot = false;
  7315. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7316. }
  7317. }
  7318. ensureCamp(number) {
  7319. this.ensureBallType = true;
  7320. this.isOpenBall = false;
  7321. if (xGame.common.gameMode != GameMode.classic)
  7322. return;
  7323. let full = [1, 2, 3, 4, 5, 6, 7];
  7324. let flower = [9, 10, 11, 12, 13, 14, 15];
  7325. let sayWords = "";
  7326. if (this.selfTurn) {
  7327. if (number <= 7) {
  7328. this.selfCamp = ballCamp.full;
  7329. this.selfBallArr = full;
  7330. this.aiCamp = ballCamp.flower;
  7331. this.aiBallArr = flower;
  7332. sayWords = cfgTable.wordsData[3].msg;
  7333. }
  7334. else {
  7335. this.selfCamp = ballCamp.flower;
  7336. this.selfBallArr = flower;
  7337. this.aiCamp = ballCamp.full;
  7338. this.aiBallArr = full;
  7339. sayWords = cfgTable.wordsData[4].msg;
  7340. }
  7341. }
  7342. else {
  7343. if (number <= 7) {
  7344. this.selfCamp = ballCamp.flower;
  7345. this.selfBallArr = flower;
  7346. this.aiCamp = ballCamp.full;
  7347. this.aiBallArr = full;
  7348. sayWords = cfgTable.wordsData[2].msg;
  7349. }
  7350. else {
  7351. this.selfCamp = ballCamp.full;
  7352. this.selfBallArr = full;
  7353. this.aiCamp = ballCamp.flower;
  7354. this.aiBallArr = flower;
  7355. sayWords = cfgTable.wordsData[1].msg;
  7356. }
  7357. }
  7358. this.updateLeftBall();
  7359. xGame.uiMgr.Show(UIMsg, sayWords);
  7360. }
  7361. updatePlaceBallState() {
  7362. let ui = xGame.common.gameUI.ui;
  7363. switch (this.placeBallData.type) {
  7364. case PlaceBallType.normal:
  7365. let normal = ui.placeNormalNode;
  7366. normal.hpTxt.text = this.curHP + "";
  7367. this.updatePlaceBallStar(normal);
  7368. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7369. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7370. break;
  7371. case PlaceBallType.challenge:
  7372. let challenge = ui.placeChallengeNode;
  7373. challenge.hpTxt.text = "Shots:" + this.curHP;
  7374. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7375. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7376. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7377. break;
  7378. default:
  7379. break;
  7380. }
  7381. }
  7382. playSubHpAni() {
  7383. let ui = xGame.common.gameUI.ui;
  7384. switch (this.placeBallData.type) {
  7385. case PlaceBallType.normal:
  7386. let normal = ui.placeNormalNode;
  7387. normal.hpTxt.visible = false;
  7388. normal.starAni.c1.selectedIndex = 1;
  7389. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7390. normal.hpTxt.visible = true;
  7391. normal.starAni.c1.selectedIndex = 0;
  7392. }));
  7393. break;
  7394. default:
  7395. break;
  7396. }
  7397. }
  7398. getEndStarNum() {
  7399. let num;
  7400. let level = xGame.common.placeBallCurLevel;
  7401. if (this.curHP == this.placeBallData.hp) {
  7402. num = 3;
  7403. }
  7404. else if (this.curHP <= 1) {
  7405. num = 1;
  7406. }
  7407. else {
  7408. num = 2;
  7409. }
  7410. if (!this.success) {
  7411. num = 0;
  7412. }
  7413. else {
  7414. DataMgr.setPlaceBallLevel(level, num);
  7415. }
  7416. let myType = cfgTable.placeballData[level].type;
  7417. if (this.success && myType == 1) {
  7418. num = 3;
  7419. }
  7420. xGame.common.placeBallStarNum = num;
  7421. }
  7422. updatePlaceBallStar(node) {
  7423. let star = 0;
  7424. if (this.curHP == this.placeBallData.hp) {
  7425. star = 3;
  7426. }
  7427. else if (this.curHP >= 2) {
  7428. star = 2;
  7429. }
  7430. else if (this.curHP == 1) {
  7431. star = 1;
  7432. }
  7433. else {
  7434. star = 0;
  7435. }
  7436. let temp;
  7437. for (let index = 1; index <= 3; index++) {
  7438. temp = node["star" + index];
  7439. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7440. }
  7441. node.myProgress.value = (star / 3) * 100;
  7442. }
  7443. openRegretView(isFoul, GoalNum, challenge = false) {
  7444. let regretType = -1;
  7445. if (isFoul) {
  7446. regretType = 1;
  7447. }
  7448. else {
  7449. if (GoalNum <= 0) {
  7450. regretType = 0;
  7451. }
  7452. }
  7453. if (challenge) {
  7454. regretType = 1;
  7455. }
  7456. if (regretType != -1) {
  7457. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7458. if (success) {
  7459. this.curHP++;
  7460. this.updatePlaceBallState();
  7461. this.setPlaceBallAllPos();
  7462. xGame.common.gameUI.ui.moveNode.visible = false;
  7463. }
  7464. else {
  7465. if (this.curHP <= 0) {
  7466. this.success = false;
  7467. this.gameEnd();
  7468. }
  7469. this.playSubHpAni();
  7470. }
  7471. this.updatePlaceBallState();
  7472. this.updatePlaceBallPos();
  7473. });
  7474. }
  7475. }
  7476. setPlaceBallAllPos() {
  7477. let allBall = xGame.common.d2World.ballArr;
  7478. let cfgArr = this.placeBallPosData;
  7479. let temp;
  7480. let obj;
  7481. for (let index = 0; index < allBall.length; index++) {
  7482. temp = allBall[index];
  7483. if (temp.destroyed)
  7484. continue;
  7485. obj = cfgArr[temp.myUNID];
  7486. if (obj && obj.src && !obj.src.destroyed) {
  7487. temp.gameObj.x = obj.posX;
  7488. temp.gameObj.y = obj.posY;
  7489. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7490. }
  7491. }
  7492. xGame.common.d2World.getHelpLine();
  7493. }
  7494. updatePlaceBallPos() {
  7495. let arr = xGame.common.d2World.ballArr;
  7496. let temp;
  7497. for (let index = 0; index < arr.length; index++) {
  7498. temp = arr[index];
  7499. if (!this.placeBallPosData[temp.myUNID]) {
  7500. this.placeBallPosData[temp.myUNID] = {
  7501. src: temp,
  7502. posX: temp.gameObj.x,
  7503. posY: temp.gameObj.y
  7504. };
  7505. }
  7506. else {
  7507. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7508. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7509. }
  7510. }
  7511. let check;
  7512. for (const key in this.placeBallPosData) {
  7513. check = this.placeBallPosData[key];
  7514. if (check.src.destroyed) {
  7515. delete this.placeBallPosData[key];
  7516. }
  7517. }
  7518. }
  7519. gameRun(type) {
  7520. if (this.gamePause)
  7521. return;
  7522. this.curFoul = this.getFoulType();
  7523. if (type) {
  7524. xGame.common.d2World.d2Gan.shoot();
  7525. xGame.common.gameUI.forceCancel();
  7526. this.curFoul = type;
  7527. }
  7528. this.isEnd = false;
  7529. this.isChangeTurn = true;
  7530. if (xGame.common.gameMode == GameMode.classic) {
  7531. this.judgeClassic(this.curFoul);
  7532. this.checkClassicWords(() => {
  7533. xGame.common.destroyClassicEmotion();
  7534. if (this.isEnd) {
  7535. if (this.isBlackInHole) {
  7536. xGame.common.gameUI.ui.blackAni.visible = true;
  7537. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7538. xGame.common.gameUI.ui.blackAni.visible = false;
  7539. this.gameEnd();
  7540. }));
  7541. }
  7542. else {
  7543. this.gameEnd();
  7544. }
  7545. }
  7546. else {
  7547. this.waitShoot();
  7548. xGame.eventMgr.event(WAIT_SHOOT);
  7549. }
  7550. });
  7551. }
  7552. else if (xGame.common.gameMode == GameMode.bigMove) {
  7553. xGame.common.aiPlayer.stopRun();
  7554. let scoreArr = this.getScore(this.curFoul);
  7555. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7556. this.isEnd = true;
  7557. }
  7558. this.checkBigSkillWords(() => {
  7559. if (this.isEnd) {
  7560. this.gameEnd();
  7561. }
  7562. else {
  7563. this.waitShoot();
  7564. xGame.eventMgr.event(WAIT_SHOOT);
  7565. }
  7566. });
  7567. }
  7568. else if (xGame.common.gameMode == GameMode.placeBall) {
  7569. xGame.common.destroyAwardSpine();
  7570. let isFoul = this.curFoul == FoulType.rootHole;
  7571. let GoalNum = this.inHoleBalls.length;
  7572. if (this.inHoleBalls.indexOf(0) > -1)
  7573. GoalNum -= 1;
  7574. if (isFoul) {
  7575. this.placeRootBall();
  7576. }
  7577. console.log("neeballs", this.needBalls);
  7578. console.log("当前完成的goalNum", GoalNum);
  7579. this.finishBalls += GoalNum;
  7580. console.log("当前完成的finishballs", this.finishBalls);
  7581. let need = this.needBalls;
  7582. if (this.placeBallData.type == PlaceBallType.challenge) {
  7583. need += 100;
  7584. }
  7585. if (this.finishBalls >= need) {
  7586. this.success = true;
  7587. this.gameEnd();
  7588. }
  7589. else {
  7590. switch (this.placeBallData.type) {
  7591. case PlaceBallType.normal:
  7592. if (!isFoul && GoalNum > 0) {
  7593. this.updatePlaceBallPos();
  7594. this.updatePlaceBallState();
  7595. }
  7596. else {
  7597. this.curHP--;
  7598. this.openRegretView(isFoul, GoalNum);
  7599. }
  7600. this.waitShoot();
  7601. xGame.eventMgr.event(WAIT_SHOOT);
  7602. break;
  7603. case PlaceBallType.challenge:
  7604. this.curHP--;
  7605. this.updatePlaceBallState();
  7606. if (isFoul) {
  7607. this.openRegretView(isFoul, GoalNum, true);
  7608. }
  7609. else {
  7610. this.updatePlaceBallPos();
  7611. if (this.curHP <= 0) {
  7612. this.success = true;
  7613. this.gameEnd();
  7614. }
  7615. }
  7616. this.waitShoot();
  7617. xGame.eventMgr.event(WAIT_SHOOT);
  7618. break;
  7619. default:
  7620. break;
  7621. }
  7622. }
  7623. }
  7624. }
  7625. checkClassicWords(callback) {
  7626. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7627. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7628. let type = this.getClassicWordsType();
  7629. if (condition && type != -1) {
  7630. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7631. xGame.soundMgr.playSound(str);
  7632. xGame.common.wordsMgr.playClassicWords(type, callback);
  7633. }
  7634. else {
  7635. Laya.timer.once(300, this, () => {
  7636. callback && callback();
  7637. });
  7638. }
  7639. }
  7640. getClassicWordsType() {
  7641. let d2world = xGame.common.d2World;
  7642. let type = -1;
  7643. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7644. type = ClassicWordsType.perfectShow;
  7645. return type;
  7646. }
  7647. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7648. type = ClassicWordsType.directShoot;
  7649. return type;
  7650. }
  7651. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7652. type = ClassicWordsType.anotherShoot;
  7653. return type;
  7654. }
  7655. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7656. type = ClassicWordsType.bigPower;
  7657. return type;
  7658. }
  7659. let minSpeed = 1;
  7660. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7661. type = ClassicWordsType.hardShoot;
  7662. return type;
  7663. }
  7664. if (this.inHoleBalls.length > 0) {
  7665. type = ClassicWordsType.directShoot;
  7666. return type;
  7667. }
  7668. return type;
  7669. }
  7670. checkBigSkillWords(callback) {
  7671. if (this.curFoul == FoulType.timeOut) {
  7672. callback && callback();
  7673. }
  7674. else {
  7675. let playSkill = false;
  7676. if (this.selfTurn) {
  7677. playSkill = true;
  7678. }
  7679. else {
  7680. if (!this.aiPlayedBreakArmy) {
  7681. this.aiPlayedBreakArmy = true;
  7682. playSkill = true;
  7683. }
  7684. if (this.aiCurSkill != SkillType.breakArmy) {
  7685. playSkill = true;
  7686. }
  7687. }
  7688. if (xGame.common.skillMgr.playedLastSkill) {
  7689. xGame.common.skillMgr.playedLastSkill = false;
  7690. playSkill = false;
  7691. }
  7692. if (playSkill) {
  7693. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7694. let selfExtra = 0;
  7695. let aiExtra = 0;
  7696. if (this.selfTurn)
  7697. selfExtra += extraScore;
  7698. else
  7699. aiExtra += extraScore;
  7700. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7701. this.isEnd = true;
  7702. }
  7703. this.playBigSkillTimes(callback);
  7704. });
  7705. }
  7706. else {
  7707. this.playBigSkillTimes(callback);
  7708. }
  7709. }
  7710. }
  7711. playBigSkillTimes(callback) {
  7712. let length = this.inHoleBalls.length;
  7713. if (this.inHoleBalls.indexOf(0) > -1) {
  7714. length = this.inHoleBalls.length - 1;
  7715. }
  7716. if (length <= 0) {
  7717. callback && callback();
  7718. return;
  7719. }
  7720. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7721. callback && callback();
  7722. });
  7723. }
  7724. playSkillTips() {
  7725. let levelNum = 0;
  7726. let curType;
  7727. if (this.selfTurn) {
  7728. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7729. curType = this.selfCurSkill;
  7730. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7731. levelNum += 5;
  7732. }
  7733. }
  7734. else {
  7735. levelNum = this.aiSkillLevelNum;
  7736. curType = this.aiCurSkill;
  7737. }
  7738. let str = ``;
  7739. switch (curType) {
  7740. case SkillType.highSpace:
  7741. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7742. break;
  7743. case SkillType.breakArmy:
  7744. str = `You pocketed ${levelNum} extra balls`;
  7745. break;
  7746. case SkillType.ice:
  7747. str = `${levelNum * 2} extra balls were frozen`;
  7748. break;
  7749. case SkillType.fireworks:
  7750. str = `${levelNum} extra balls exploded `;
  7751. break;
  7752. case SkillType.GuanYu:
  7753. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  7754. break;
  7755. default:
  7756. break;
  7757. }
  7758. xGame.uiMgr.Show(UIMsg, str);
  7759. }
  7760. getFoulType() {
  7761. let foulType = "";
  7762. if (this.firstColliObj == null) {
  7763. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  7764. return FoulType.rootHole;
  7765. }
  7766. return FoulType.notTouch;
  7767. }
  7768. else {
  7769. if (this.selfTurn) {
  7770. if (this.selfBallArr.length > 0) {
  7771. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  7772. foulType = FoulType.wrongTouch;
  7773. }
  7774. }
  7775. else {
  7776. if (this.ensureBallType) {
  7777. }
  7778. else {
  7779. if (this.firstColliObj == this.blackNum) {
  7780. foulType = FoulType.wrongTouch;
  7781. }
  7782. }
  7783. }
  7784. }
  7785. else {
  7786. if (this.aiBallArr.length > 0) {
  7787. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  7788. foulType = FoulType.wrongTouch;
  7789. }
  7790. }
  7791. else {
  7792. if (this.ensureBallType) {
  7793. }
  7794. else {
  7795. if (this.firstColliObj == this.blackNum) {
  7796. foulType = FoulType.wrongTouch;
  7797. }
  7798. }
  7799. }
  7800. }
  7801. if (this.inHoleBalls.length <= 0) {
  7802. return foulType;
  7803. }
  7804. let temp;
  7805. if (this.inHoleBalls.indexOf(0) > -1) {
  7806. foulType = FoulType.rootHole;
  7807. }
  7808. else {
  7809. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7810. temp = this.inHoleBalls[index];
  7811. if (this.selfTurn) {
  7812. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7813. foulType = FoulType.wrongHole;
  7814. break;
  7815. }
  7816. }
  7817. else {
  7818. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  7819. foulType = FoulType.wrongHole;
  7820. break;
  7821. }
  7822. }
  7823. }
  7824. }
  7825. let foo;
  7826. for (let index = 0; index < this.inHoleBalls.length; index++) {
  7827. temp = this.inHoleBalls[index];
  7828. foo = this.selfBallArr.indexOf(temp);
  7829. if (foo > -1) {
  7830. this.selfBallArr.splice(foo, 1);
  7831. }
  7832. foo = this.aiBallArr.indexOf(temp);
  7833. if (foo > -1) {
  7834. this.aiBallArr.splice(foo, 1);
  7835. }
  7836. }
  7837. this.updateLeftBall();
  7838. }
  7839. return foulType;
  7840. }
  7841. judgeGameEndByBlack(arr) {
  7842. if (this.selfTurn) {
  7843. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7844. this.selfFoulNum = this.maxFoulTimes;
  7845. return true;
  7846. }
  7847. }
  7848. else {
  7849. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  7850. this.aiFoulNum = this.maxFoulTimes;
  7851. return true;
  7852. }
  7853. }
  7854. }
  7855. judgeClassic(type) {
  7856. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  7857. xGame.common.aiPlayer.stopRun();
  7858. if (this.judgeNormalSuccess()) {
  7859. this.isEnd = true;
  7860. return;
  7861. }
  7862. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  7863. if (this.selfTurn) {
  7864. if (isFoul) {
  7865. this.selfFoulNum++;
  7866. }
  7867. if (this.selfFoulNum >= this.maxFoulTimes) {
  7868. this.success = false;
  7869. this.isEnd = true;
  7870. return;
  7871. }
  7872. }
  7873. else {
  7874. if (isFoul)
  7875. this.aiFoulNum++;
  7876. if (this.aiFoulNum >= this.maxFoulTimes) {
  7877. this.success = true;
  7878. this.isEnd = true;
  7879. return;
  7880. }
  7881. }
  7882. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  7883. this.isChangeTurn = false;
  7884. }
  7885. else {
  7886. this.isInterrupt = true;
  7887. }
  7888. }
  7889. waitShoot() {
  7890. if (xGame.common.gameMode == GameMode.classic) {
  7891. switch (this.curFoul) {
  7892. case FoulType.timeOut:
  7893. case FoulType.rootHole:
  7894. this.selfTurn = !this.selfTurn;
  7895. this.peoplePlay(5, 6, true);
  7896. break;
  7897. case FoulType.notTouch:
  7898. this.selfTurn = !this.selfTurn;
  7899. this.peoplePlay(7, 7);
  7900. break;
  7901. case FoulType.wrongHole:
  7902. this.selfTurn = !this.selfTurn;
  7903. this.peoplePlay(11, 11);
  7904. break;
  7905. default:
  7906. if (this.inHoleBalls.length > 0) {
  7907. this.peoplePlay(0, 0, false, false);
  7908. }
  7909. else {
  7910. this.selfTurn = !this.selfTurn;
  7911. this.peoplePlay(7, 7);
  7912. }
  7913. break;
  7914. }
  7915. }
  7916. else if (xGame.common.gameMode == GameMode.bigMove) {
  7917. if (this.curFoul == FoulType.timeOut) {
  7918. this.selfTurn = !this.selfTurn;
  7919. this.peoplePlay(14, 15);
  7920. this.placeRootBall();
  7921. }
  7922. else {
  7923. this.selfTurn = !this.selfTurn;
  7924. if (this.curFoul == FoulType.rootHole) {
  7925. this.peoplePlay(12, 13);
  7926. this.placeRootBall();
  7927. }
  7928. else {
  7929. this.peoplePlay(0, 0, false, false);
  7930. }
  7931. }
  7932. }
  7933. else if (xGame.common.gameMode == GameMode.placeBall) {
  7934. this.finishOneShoot = true;
  7935. }
  7936. this.gameResult();
  7937. }
  7938. gameResult() {
  7939. this.firstColliObj = null;
  7940. this.inHoleBalls = [];
  7941. let curX = xGame.common.d2World.rootBall.gameObj.x;
  7942. let curY = xGame.common.d2World.rootBall.gameObj.y;
  7943. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  7944. if (xGame.common.uiRodMethod)
  7945. xGame.common.uiRodMethod.resetRod();
  7946. xGame.common.d2World.rootBall.showSelf();
  7947. this.clearIceSkill();
  7948. if (this.selfTurn) {
  7949. console.log("gameResult");
  7950. PlatMgr.gameInsert();
  7951. }
  7952. xGame.common.d3World.knifeRoot.destroyChildren();
  7953. if (this.selfTurn) {
  7954. xGame.common.gameUI.showHelpLineGuide();
  7955. xGame.common.gameUI.setTurnAlpha(true);
  7956. }
  7957. else {
  7958. xGame.common.gameUI.setTurnAlpha(false);
  7959. }
  7960. }
  7961. getScore(type) {
  7962. let selfAdd = 0;
  7963. let aiAdd = 0;
  7964. if (type == FoulType.timeOut) {
  7965. if (this.selfTurn)
  7966. aiAdd += 3;
  7967. else
  7968. selfAdd += 3;
  7969. }
  7970. else {
  7971. if (this.inHoleBalls.length > 0) {
  7972. if (this.selfTurn) {
  7973. if (type == FoulType.rootHole) {
  7974. aiAdd += 3;
  7975. if (this.inHoleBalls.length - 1 > 0) {
  7976. selfAdd += this.inHoleBalls.length - 1;
  7977. }
  7978. }
  7979. else {
  7980. selfAdd += this.inHoleBalls.length;
  7981. }
  7982. }
  7983. else {
  7984. if (type == FoulType.rootHole) {
  7985. selfAdd += 3;
  7986. if (this.inHoleBalls.length - 1 > 0) {
  7987. aiAdd += this.inHoleBalls.length - 1;
  7988. }
  7989. }
  7990. else {
  7991. aiAdd += this.inHoleBalls.length;
  7992. }
  7993. }
  7994. }
  7995. }
  7996. return [selfAdd, aiAdd];
  7997. }
  7998. judgeScoreEnd(selfAdd, aiAdd) {
  7999. this.selfScore += selfAdd;
  8000. this.aiScore += aiAdd;
  8001. this.updateAIScore();
  8002. this.updateSelfScore();
  8003. if (this.selfScore >= this.targertScore) {
  8004. this.success = true;
  8005. return true;
  8006. }
  8007. if (this.aiScore >= this.targertScore) {
  8008. this.success = false;
  8009. return true;
  8010. }
  8011. let ballArr = xGame.common.d2World.ballArr;
  8012. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8013. if (this.selfScore > this.aiScore) {
  8014. this.success = true;
  8015. return true;
  8016. }
  8017. else if (this.selfScore < this.aiScore) {
  8018. this.success = false;
  8019. return true;
  8020. }
  8021. else {
  8022. if (this.selfTurn) {
  8023. this.success = false;
  8024. }
  8025. else {
  8026. this.success = true;
  8027. }
  8028. return true;
  8029. }
  8030. }
  8031. }
  8032. clearIceSkill() {
  8033. let arr = xGame.common.d2World.ballArr;
  8034. let temp;
  8035. if (this.selfTurn) {
  8036. if (this.selfCurSkill == SkillType.ice) {
  8037. for (let index = 0; index < arr.length; index++) {
  8038. temp = arr[index];
  8039. if (temp.ballFunc == "ice") {
  8040. temp.setBallFunc("normal", "self");
  8041. }
  8042. }
  8043. }
  8044. }
  8045. else {
  8046. if (this.aiCurSkill == SkillType.ice) {
  8047. for (let index = 0; index < arr.length; index++) {
  8048. temp = arr[index];
  8049. if (temp.ballFunc == "ice") {
  8050. temp.setBallFunc("normal", "ai");
  8051. }
  8052. }
  8053. }
  8054. }
  8055. }
  8056. judgeNormalSuccess() {
  8057. if (this.selfTurn) {
  8058. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8059. this.success = true;
  8060. return true;
  8061. }
  8062. }
  8063. else {
  8064. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8065. this.success = false;
  8066. return true;
  8067. }
  8068. }
  8069. }
  8070. gameEnd() {
  8071. if (Moyu.isTT) {
  8072. xGame.common.screenImg = getScreenImg();
  8073. }
  8074. console.log("游戏结束", this.success);
  8075. xGame.common.aiPlayer.stopRun();
  8076. if (xGame.common.gameMode == GameMode.placeBall) {
  8077. this.getEndStarNum();
  8078. this.updatePlaceBallState();
  8079. }
  8080. this.isEnter = false;
  8081. Moyu.recordEnd(this, () => {
  8082. if (this.isEnter)
  8083. return;
  8084. this.isEnter = true;
  8085. console.log("进入录结束回调");
  8086. this.enterNext();
  8087. });
  8088. Laya.timer.once(1000, this, () => {
  8089. if (this.isEnter)
  8090. return;
  8091. this.isEnter = true;
  8092. this.enterNext();
  8093. });
  8094. xGame.common.longHelpLine = false;
  8095. }
  8096. enterNext() {
  8097. Laya.timer.clearAll(this);
  8098. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8099. xGame.uiMgr.Show(UIVideoShare, this.success);
  8100. }
  8101. else {
  8102. xGame.uiMgr.Show(UIGameEnd, this.success);
  8103. }
  8104. }
  8105. aiLeave() {
  8106. let ui = xGame.common.gameUI.ui;
  8107. ui.topNode.aiNameTxt.text = "offline";
  8108. }
  8109. aiGameEnd(suc) {
  8110. this.success = suc;
  8111. xGame.common.aiPlayer.stopRun();
  8112. if (this.success) {
  8113. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8114. Laya.timer.once(1000, this, () => {
  8115. this.clearTime();
  8116. this.gameEnd();
  8117. });
  8118. }
  8119. }
  8120. openTimer() {
  8121. let src = xGame.common.gameUI;
  8122. if (this.selfTurn) {
  8123. src.ui.topNode.selfProgress.visible = true;
  8124. src.ui.topNode.aiProgress.visible = false;
  8125. this.curTimer = src.ui.topNode.selfProgress;
  8126. }
  8127. else {
  8128. src.ui.topNode.selfProgress.visible = false;
  8129. src.ui.topNode.aiProgress.visible = true;
  8130. this.curTimer = src.ui.topNode.aiProgress;
  8131. }
  8132. this.accTime = 0;
  8133. Laya.timer.clearAll(this);
  8134. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8135. this.curTimer.value = 100;
  8136. }
  8137. updateTime(dt) {
  8138. if (this.gamePause)
  8139. return;
  8140. this.accTime += dt;
  8141. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8142. if (this.accTime >= this.setTime) {
  8143. this.clearTime();
  8144. console.log("时钟进入了gameRun");
  8145. this.gameRun(FoulType.timeOut);
  8146. }
  8147. }
  8148. clearTime() {
  8149. let src = xGame.common.gameUI;
  8150. src.ui.topNode.selfProgress.visible = false;
  8151. src.ui.topNode.aiProgress.visible = false;
  8152. Laya.timer.clearAll(this);
  8153. }
  8154. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8155. let ui = xGame.common.gameUI.ui;
  8156. let selfMsg, aiMsg;
  8157. if (sayWords) {
  8158. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8159. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8160. if (Foul) {
  8161. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8162. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8163. this.placeRootBall();
  8164. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8165. if (this.curFoul == FoulType.rootHole) {
  8166. if (!DataMgr.getRootBallFoul()) {
  8167. DataMgr.setRootBallFoul();
  8168. aiMsg = "";
  8169. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8170. let woman = "Boss, pay attention next time~";
  8171. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8172. }
  8173. }
  8174. else if (this.curFoul == FoulType.timeOut) {
  8175. if (!DataMgr.getTimeoutFoul()) {
  8176. DataMgr.setTimeoutFoul();
  8177. aiMsg = "";
  8178. let tips = "Game timeout, 3 fouls, this game failed.";
  8179. let woman = "Boss, pay attention to the timeline~";
  8180. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8181. }
  8182. }
  8183. }
  8184. }
  8185. }
  8186. if (this.selfTurn) {
  8187. if (sayWords) {
  8188. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8189. ui.selfTurn.visible = true;
  8190. ui.aiTurn.visible = false;
  8191. ui.selfTurn.t0.play();
  8192. Moyu.vibration();
  8193. });
  8194. }
  8195. }
  8196. else {
  8197. let aiNum = xGame.tools.random(1, 11);
  8198. let challengeNum = DataMgr.getChallengeTimes();
  8199. let delay = false;
  8200. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8201. aiNum = 9;
  8202. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8203. aiNum = 3;
  8204. if (challengeNum == 3) {
  8205. if (!this.showLongView) {
  8206. this.showLongView = true;
  8207. delay = true;
  8208. }
  8209. }
  8210. }
  8211. }
  8212. if (delay) {
  8213. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8214. if (success) {
  8215. xGame.common.longHelpLine = true;
  8216. xGame.common.d2World.getHelpLine();
  8217. }
  8218. else {
  8219. aiNum = 10;
  8220. }
  8221. xGame.common.aiPlayer.setAiLevel(aiNum);
  8222. if (sayWords) {
  8223. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8224. xGame.common.aiPlayer.runAI();
  8225. ui.selfTurn.visible = false;
  8226. ui.aiTurn.visible = true;
  8227. ui.aiTurn.t0.play();
  8228. });
  8229. }
  8230. else {
  8231. xGame.common.aiPlayer.runAI();
  8232. }
  8233. this.openTimer();
  8234. this.finishOneShoot = true;
  8235. if (this.selfTurn) {
  8236. ui.topNode.selfKuang.visible = true;
  8237. ui.topNode.aiKuang.visible = false;
  8238. ui.topNode.selfTips.visible = true;
  8239. ui.topNode.aiTips.visible = false;
  8240. }
  8241. else {
  8242. ui.topNode.selfKuang.visible = false;
  8243. ui.topNode.aiKuang.visible = true;
  8244. ui.topNode.selfTips.visible = false;
  8245. ui.topNode.aiTips.visible = true;
  8246. }
  8247. });
  8248. return;
  8249. }
  8250. if (xGame.common.gameMode == GameMode.classic) {
  8251. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8252. if (cfg) {
  8253. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8254. aiNum = aiLevel;
  8255. }
  8256. }
  8257. xGame.common.aiPlayer.setAiLevel(aiNum);
  8258. if (sayWords) {
  8259. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8260. xGame.common.aiPlayer.runAI();
  8261. ui.selfTurn.visible = false;
  8262. ui.aiTurn.visible = true;
  8263. ui.aiTurn.t0.play();
  8264. });
  8265. }
  8266. else {
  8267. xGame.common.aiPlayer.runAI();
  8268. }
  8269. }
  8270. this.openTimer();
  8271. this.finishOneShoot = true;
  8272. if (this.selfTurn) {
  8273. ui.topNode.selfKuang.visible = true;
  8274. ui.topNode.aiKuang.visible = false;
  8275. ui.topNode.selfTips.visible = true;
  8276. ui.topNode.aiTips.visible = false;
  8277. }
  8278. else {
  8279. ui.topNode.selfKuang.visible = false;
  8280. ui.topNode.aiKuang.visible = true;
  8281. ui.topNode.selfTips.visible = false;
  8282. ui.topNode.aiTips.visible = true;
  8283. }
  8284. }
  8285. placeRootBall() {
  8286. let rootBall = xGame.common.d2World.rootBall;
  8287. if (!rootBall)
  8288. return;
  8289. rootBall.gameObj.x = this.lastRootBallPos.x;
  8290. rootBall.gameObj.y = this.lastRootBallPos.y;
  8291. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8292. let moveNode = xGame.common.gameUI.ui.moveNode;
  8293. moveNode.visible = true;
  8294. moveNode.x = this.lastRootBallPos.x;
  8295. moveNode.y = this.lastRootBallPos.y;
  8296. if (!this.selfTurn) {
  8297. xGame.common.aiPlayer.resetRoot();
  8298. }
  8299. }
  8300. }
  8301. class ui_guanyuAni extends fgui.GComponent {
  8302. static createInstance() {
  8303. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8304. }
  8305. onConstruct() {
  8306. this.n0 = (this.getChild("n0"));
  8307. }
  8308. }
  8309. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8310. class UIFireworks extends UIBase {
  8311. constructor() {
  8312. super();
  8313. }
  8314. onConstructor() {
  8315. this.isEject = false;
  8316. }
  8317. show(callback) {
  8318. super.show();
  8319. }
  8320. }
  8321. UIFireworks.uiName = "UIFireworks";
  8322. class ui_UIGuanYu extends fgui.GComponent {
  8323. static createInstance() {
  8324. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8325. }
  8326. onConstruct() {
  8327. this.n2 = (this.getChild("n2"));
  8328. this.n1 = (this.getChild("n1"));
  8329. this.n3 = (this.getChild("n3"));
  8330. this.n4 = (this.getChild("n4"));
  8331. this.n5 = (this.getChild("n5"));
  8332. this.n6 = (this.getChild("n6"));
  8333. this.n8 = (this.getChild("n8"));
  8334. this.n7 = (this.getChild("n7"));
  8335. this.t0 = this.getTransition("t0");
  8336. }
  8337. }
  8338. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8339. class UIGuanYu extends UIBase {
  8340. constructor() {
  8341. super();
  8342. }
  8343. onConstructor() {
  8344. this.ui = ui_UIGuanYu.createInstance();
  8345. this.contentPane = this.ui;
  8346. this.isEject = false;
  8347. }
  8348. show(callback) {
  8349. super.show();
  8350. this.ui.t0.play(Laya.Handler.create(this, () => {
  8351. callback && callback();
  8352. this.hide();
  8353. }));
  8354. }
  8355. }
  8356. UIGuanYu.uiName = "UIGuanYu";
  8357. class SkillMgr {
  8358. constructor() {
  8359. this.leveNum = 0;
  8360. this.extraScore = 0;
  8361. this.selfTurn = false;
  8362. this.playedLastSkill = false;
  8363. this.tweenArr = [];
  8364. this._finishNum = 0;
  8365. this._curFinish = 0;
  8366. this._rootX = 0;
  8367. this._rootY = 0;
  8368. this.knifeTimes = 0;
  8369. this.knifeV2 = new Laya.Vector2();
  8370. this.knifeV3 = new Laya.Vector3();
  8371. this.rtStarX = 0;
  8372. this.rtStarY = 0;
  8373. this.addBigSkillSpine();
  8374. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8375. }
  8376. addBigSkillSpine() {
  8377. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8378. console.log("extra2 success");
  8379. });
  8380. }
  8381. runBigSkill(callback) {
  8382. this.tweenArr = [];
  8383. this.callback = callback;
  8384. this.judgeSkill();
  8385. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8386. let guide = DataMgr.getSkillGuide();
  8387. if (!xGame.common.gameMgr.selfTurn) {
  8388. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8389. }
  8390. else {
  8391. if (xGame.common.temSelfLevel != 0) {
  8392. this.leveNum = xGame.common.temSelfLevel;
  8393. }
  8394. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8395. this.leveNum += 5;
  8396. }
  8397. }
  8398. if (guide == 0) {
  8399. DataMgr.setSkillGuide(1);
  8400. if (DataMgr.getNewUser()) {
  8401. Moyu.sendDataEvent("gameFirstPlay");
  8402. DataMgr.setNewUser();
  8403. }
  8404. }
  8405. this.playSpineAni(() => {
  8406. switch (this.curSkill) {
  8407. case SkillType.highSpace:
  8408. this.runHighSpace();
  8409. break;
  8410. case SkillType.breakArmy:
  8411. this.runBreakArmy();
  8412. break;
  8413. case SkillType.ice:
  8414. this.runIce();
  8415. break;
  8416. case SkillType.fireworks:
  8417. this.runFireworks();
  8418. break;
  8419. case SkillType.GuanYu:
  8420. this.runGuanYu();
  8421. break;
  8422. default:
  8423. break;
  8424. }
  8425. });
  8426. }
  8427. judgeSkill() {
  8428. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8429. let gameMgr = xGame.common.gameMgr;
  8430. let type;
  8431. for (let index = 0; index < typeArr.length; index++) {
  8432. type = typeArr[index];
  8433. if (gameMgr.selfTurn) {
  8434. if (gameMgr.selfCurSkill == type) {
  8435. this.selfTurn = true;
  8436. this.curSkill = type;
  8437. return;
  8438. }
  8439. }
  8440. else {
  8441. if (gameMgr.aiCurSkill == type) {
  8442. this.selfTurn = false;
  8443. this.curSkill = type;
  8444. return;
  8445. }
  8446. }
  8447. }
  8448. }
  8449. playSpineAni(callback) {
  8450. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8451. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8452. parent.destroyChildren();
  8453. let aniIndex = 0;
  8454. let skillSpine;
  8455. switch (this.curSkill) {
  8456. case SkillType.highSpace:
  8457. aniIndex = 1;
  8458. xGame.soundMgr.playSound("skill01");
  8459. skillSpine = this.skillSpine2;
  8460. data.scaleX = 0.5;
  8461. data.scaleY = 0.5;
  8462. skillSpine.play(data, 1, false, parent, () => {
  8463. callback && callback();
  8464. });
  8465. break;
  8466. case SkillType.breakArmy:
  8467. aniIndex = 2;
  8468. xGame.soundMgr.playSound("skill02");
  8469. skillSpine = this.skillSpine2;
  8470. data.scaleX = 0.5;
  8471. data.scaleY = 0.5;
  8472. skillSpine.play(data, 2, false, parent, () => {
  8473. callback && callback();
  8474. });
  8475. break;
  8476. case SkillType.ice:
  8477. aniIndex = 0;
  8478. xGame.soundMgr.playSound("skill03");
  8479. skillSpine = this.skillSpine2;
  8480. data.scaleX = 0.5;
  8481. data.scaleY = 0.5;
  8482. skillSpine.play(data, 0, false, parent, () => {
  8483. callback && callback();
  8484. });
  8485. break;
  8486. case SkillType.fireworks:
  8487. xGame.soundMgr.playSound("skill_04_01");
  8488. xGame.soundMgr.playSound("skill04");
  8489. xGame.uiMgr.Show(UIFireworks, callback);
  8490. break;
  8491. case SkillType.GuanYu:
  8492. xGame.soundMgr.playSound("skill05_1");
  8493. xGame.soundMgr.playSound("skill05");
  8494. xGame.uiMgr.Show(UIGuanYu, callback);
  8495. break;
  8496. default:
  8497. break;
  8498. }
  8499. }
  8500. getAllBallArr() {
  8501. let arr = xGame.common.d2World.ballArr;
  8502. let outArr = [];
  8503. for (let index = 0; index < arr.length; index++) {
  8504. if (arr[index] instanceof D2RootBallSrc)
  8505. continue;
  8506. if (arr[index].ballFunc == "ice")
  8507. continue;
  8508. if (arr[index].destroyed)
  8509. continue;
  8510. outArr.push(arr[index]);
  8511. }
  8512. return outArr;
  8513. }
  8514. getOneArr(deletObj) {
  8515. let allArr = this.getAllBallArr();
  8516. let temp;
  8517. for (let index = 0; index < allArr.length; index++) {
  8518. temp = allArr[index];
  8519. if (temp.id == deletObj.id) {
  8520. allArr.splice(index, 1);
  8521. break;
  8522. }
  8523. }
  8524. return allArr;
  8525. }
  8526. getNearBallBag(ball) {
  8527. let ui = xGame.common.gameUI.ui;
  8528. let circleArr = [];
  8529. for (let index = 1; index <= 6; index++) {
  8530. circleArr.push(ui.border["circle" + index]);
  8531. }
  8532. let outIndex = 0;
  8533. let temp;
  8534. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8535. ;
  8536. let dis = 0;
  8537. for (let index = 1; index < circleArr.length; index++) {
  8538. temp = circleArr[index];
  8539. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8540. if (dis < min) {
  8541. min = dis;
  8542. outIndex = index;
  8543. }
  8544. }
  8545. return [circleArr[outIndex], outIndex];
  8546. }
  8547. ballFlyToBag(ballArr, time = 300) {
  8548. let temp;
  8549. let hole;
  8550. this._finishNum = ballArr.length;
  8551. this._curFinish = 0;
  8552. let holeObj = {};
  8553. let holeCfg = {
  8554. "1": 0,
  8555. "2": 0,
  8556. "3": 0,
  8557. "4": 0,
  8558. "5": 0,
  8559. "6": 0
  8560. };
  8561. for (let index = 0; index < ballArr.length; index++) {
  8562. temp = ballArr[index];
  8563. temp.outColli.isSensor = true;
  8564. temp.innerColli.isSensor = true;
  8565. temp.isRunSkillAni = true;
  8566. let holeArr = this.getNearBallBag(temp);
  8567. hole = holeArr[0];
  8568. holeObj[index] = holeArr[1];
  8569. temp.d3BallSrc.scaleXYZ = 0.5;
  8570. this.tweenArr.push(temp.d3BallSrc, temp);
  8571. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8572. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8573. }));
  8574. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8575. let mIndex = holeObj[this._curFinish];
  8576. let isDone = holeCfg[mIndex];
  8577. if (isDone) {
  8578. ballArr[this._curFinish].checkWrongBall(false);
  8579. }
  8580. else {
  8581. holeCfg[mIndex] = 1;
  8582. ballArr[this._curFinish].checkWrongBall();
  8583. }
  8584. this._curFinish++;
  8585. if (this._curFinish >= this._finishNum) {
  8586. if (this.curSkill == SkillType.highSpace) {
  8587. }
  8588. else if (this.curSkill == SkillType.breakArmy) {
  8589. let rootBall = xGame.common.d2World.rootBall;
  8590. rootBall.gameObj.x = this._rootX;
  8591. rootBall.gameObj.y = this._rootY;
  8592. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8593. xGame.common.d2World.d2Gan.ui.visible = true;
  8594. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8595. xGame.common.d2World.getHelpLine();
  8596. this.callback && this.callback(this.extraScore);
  8597. }
  8598. }
  8599. }));
  8600. }
  8601. }
  8602. runHighSpace() {
  8603. let rootBall = xGame.common.d2World.rootBall;
  8604. rootBall.showSelf();
  8605. let d3Src = rootBall.d3BallSrc;
  8606. let allArr = this.getAllBallArr();
  8607. if (allArr.length <= 0) {
  8608. this.callback && this.callback(0);
  8609. return;
  8610. }
  8611. let selectBall = xGame.common.d2World.targetBall;
  8612. let wrong = selectBall && selectBall.destroyed;
  8613. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8614. selectBall = xGame.common.getRandArrEle(allArr);
  8615. }
  8616. let targetD3Src = selectBall.d3BallSrc;
  8617. xGame.common.d2World.d2Gan.ui.visible = false;
  8618. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8619. d3Src.scaleXYZ = 0.5;
  8620. this.tweenArr.push(d3Src);
  8621. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8622. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8623. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8624. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8625. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8626. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8627. let outArr = [selectBall];
  8628. let other = this.leveNum - 1;
  8629. if (other > 0) {
  8630. let nearArr = this.getOneArr(selectBall);
  8631. if (nearArr.length > 0) {
  8632. xGame.common.botherArr(nearArr);
  8633. if (other >= nearArr.length)
  8634. other = nearArr.length;
  8635. for (let index = 0; index < other; index++) {
  8636. outArr.push(nearArr[index]);
  8637. }
  8638. }
  8639. }
  8640. xGame.common.extraMoveNum = other + 1;
  8641. this.extraScore = other + 1;
  8642. this._rootX = selectBall.gameObj.x;
  8643. this._rootY = selectBall.gameObj.y;
  8644. rootBall.gameObj.x = this._rootX;
  8645. rootBall.gameObj.y = this._rootY;
  8646. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8647. Laya.Tween.clearAll(d3Src);
  8648. this.addRandomForce(outArr);
  8649. }));
  8650. }));
  8651. }
  8652. addRandomForce(outArr) {
  8653. if (outArr.length > 0) {
  8654. xGame.common.d2World.openCheckStill = true;
  8655. this.playedLastSkill = true;
  8656. }
  8657. let temp;
  8658. for (let index = 0; index < outArr.length; index++) {
  8659. let angle = xGame.common.randomNum(0, 360);
  8660. let linearPercent = xGame.common.randomNum(65, 100);
  8661. temp = outArr[index];
  8662. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8663. }
  8664. }
  8665. setLinearSpeed(angle, rigy, linearPercent) {
  8666. let sin = Math.sin(angle * Math.PI / 180);
  8667. let cos = Math.cos(angle * Math.PI / 180);
  8668. let maxSpeed = 4;
  8669. let speed = new Laya.Vector2();
  8670. speed.x = maxSpeed * linearPercent * sin;
  8671. speed.y = -maxSpeed * linearPercent * cos;
  8672. rigy.applyLinearImpulseToCenter(speed);
  8673. }
  8674. runBreakArmy() {
  8675. xGame.common.d2World.d2Gan.ui.visible = false;
  8676. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8677. let gameUI = xGame.common.gameUI.ui;
  8678. gameUI.skillRod.visible = true;
  8679. gameUI.skillRod.rotation = 110;
  8680. let outArr = this.getAllBallArr();
  8681. if (outArr.length <= 0) {
  8682. gameUI.skillRod.visible = false;
  8683. this.callback && this.callback(0);
  8684. return;
  8685. }
  8686. xGame.common.botherArr(outArr);
  8687. if (this.leveNum >= outArr.length)
  8688. this.leveNum = outArr.length;
  8689. let deleteNum = outArr.length - this.leveNum;
  8690. outArr.splice(0, deleteNum);
  8691. this.extraScore = this.leveNum;
  8692. let potX = gameUI.skillRod.x;
  8693. let potY = gameUI.skillRod.y;
  8694. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8695. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8696. let disArr = [];
  8697. for (let index = 0; index < outArr.length; index++) {
  8698. let obj = outArr[index];
  8699. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8700. dis = Math.pow(dis, 0.5);
  8701. disArr.push(dis);
  8702. }
  8703. this.tweenArr.push(gameUI.skillRod);
  8704. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8705. })).update = Laya.Handler.create(this, (e, t, c) => {
  8706. let angle = gameUI.skillRod.rotation;
  8707. let xx;
  8708. let yy;
  8709. let temp;
  8710. for (let index = 0; index < outArr.length; index++) {
  8711. temp = outArr[index];
  8712. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8713. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8714. yy -= 20;
  8715. temp.gameObj.x = xx;
  8716. temp.gameObj.y = yy;
  8717. temp.d3BallSrc.setTransPos(xx, yy);
  8718. }
  8719. if (angle <= 60) {
  8720. Laya.Tween.clearAll(gameUI.skillRod);
  8721. this.ballFlyToBag(outArr, 150);
  8722. gameUI.skillRod.visible = false;
  8723. }
  8724. }, null, false);
  8725. }
  8726. runIce() {
  8727. let ballArr = xGame.common.d2World.ballArr;
  8728. this.leveNum *= 2;
  8729. if (this.leveNum >= ballArr.length - 1)
  8730. this.leveNum = ballArr.length - 1;
  8731. let tempArr = [];
  8732. let outArr = [];
  8733. for (let index = 0; index < ballArr.length; index++) {
  8734. if (ballArr[index] instanceof D2RootBallSrc)
  8735. continue;
  8736. tempArr.push(ballArr[index]);
  8737. }
  8738. if (tempArr.length <= 0) {
  8739. this.callback && this.callback(0);
  8740. return;
  8741. }
  8742. xGame.common.botherArr(tempArr);
  8743. for (let index = 0; index < this.leveNum; index++) {
  8744. outArr.push(tempArr[index]);
  8745. }
  8746. this.extraScore = this.leveNum;
  8747. let temp;
  8748. for (let index = 0; index < outArr.length; index++) {
  8749. temp = outArr[index];
  8750. temp.d3BallSrc.playIceEft();
  8751. }
  8752. Laya.timer.once(2000, this, () => {
  8753. for (let index = 0; index < outArr.length; index++) {
  8754. temp = outArr[index];
  8755. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  8756. temp.setBallFunc("ice", str);
  8757. }
  8758. this.callback && this.callback(0);
  8759. });
  8760. }
  8761. runFireworks() {
  8762. let allArr = this.getAllBallArr();
  8763. if (allArr.length <= 0) {
  8764. this.callback && this.callback(0);
  8765. return;
  8766. }
  8767. xGame.common.d2World.d2Gan.ui.visible = false;
  8768. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8769. let outArr = [];
  8770. let other = this.leveNum;
  8771. if (other > 0) {
  8772. if (allArr.length > 0) {
  8773. xGame.common.botherArr(allArr);
  8774. if (other >= allArr.length)
  8775. other = allArr.length;
  8776. for (let index = 0; index < other; index++) {
  8777. outArr.push(allArr[index]);
  8778. }
  8779. }
  8780. }
  8781. xGame.common.extraMoveNum = other;
  8782. this.extraScore = other;
  8783. this.addRandmomFireworks(outArr);
  8784. }
  8785. addRandmomFireworks(outArr) {
  8786. Laya.timer.once(1100, this, () => {
  8787. if (outArr.length > 0) {
  8788. xGame.common.d2World.openCheckStill = true;
  8789. this.playedLastSkill = true;
  8790. }
  8791. });
  8792. xGame.soundMgr.playSound("skill_04_02");
  8793. let temp;
  8794. let delay = -200;
  8795. for (let index = 0; index < outArr.length; index++) {
  8796. temp = outArr[index];
  8797. delay += 200;
  8798. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  8799. let angle = xGame.common.randomNum(0, 360);
  8800. angle = this.getFireworksAngle(obj);
  8801. let linearPercent = xGame.common.randomNum(45, 80);
  8802. if (!obj.destroyed)
  8803. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  8804. });
  8805. }
  8806. }
  8807. getFireworksAngle(obj) {
  8808. let rootBall = xGame.common.d2World.rootBall;
  8809. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  8810. }
  8811. resetGame() {
  8812. Laya.timer.clearAll(this);
  8813. if (this.tweenArr) {
  8814. for (let index = 0; index < this.tweenArr.length; index++) {
  8815. Laya.Tween.clearAll(this.tweenArr[index]);
  8816. }
  8817. }
  8818. this.tweenArr = null;
  8819. }
  8820. runGuanYu() {
  8821. xGame.common.d2World.d2Gan.ui.visible = false;
  8822. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8823. let rootBall = xGame.common.d2World.rootBall;
  8824. if (rootBall.isInHole) {
  8825. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  8826. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  8827. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  8828. rootBall.showSelf();
  8829. }
  8830. this.rtStarX = rootBall.gameObj.x;
  8831. this.rtStarY = rootBall.gameObj.y;
  8832. this.knifeTimes = 0;
  8833. this.playedLastSkill = true;
  8834. rootBall.forceRun = true;
  8835. rootBall.rigy.type = "static";
  8836. xGame.common.d2World.openCheckStill = true;
  8837. this.guanyuRandomKnife();
  8838. }
  8839. guanyuRandomKnife() {
  8840. let rootBall = xGame.common.d2World.rootBall;
  8841. let dir = this.getRandDir();
  8842. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  8843. console.log("当前angle", angle);
  8844. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  8845. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  8846. let dis = 324;
  8847. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  8848. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  8849. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  8850. this.rtStarX = rootBall.gameObj.x;
  8851. this.rtStarY = rootBall.gameObj.y;
  8852. this.knifeTimes++;
  8853. let skillLevel;
  8854. if (xGame.common.gameMgr.selfTurn) {
  8855. skillLevel = DataMgr.getBigSkillByIndex(4);
  8856. }
  8857. else {
  8858. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  8859. }
  8860. if (!skillLevel)
  8861. skillLevel = 1;
  8862. skillLevel += 2;
  8863. if (this.knifeTimes < skillLevel) {
  8864. Laya.timer.once(400, this, () => {
  8865. this.guanyuRandomKnife();
  8866. });
  8867. }
  8868. else {
  8869. rootBall.forceRun = false;
  8870. rootBall.rigy.type = "dynamic";
  8871. xGame.common.extraMoveNum = skillLevel;
  8872. }
  8873. }));
  8874. }
  8875. getRandDir() {
  8876. let rootBall = xGame.common.d2World.rootBall;
  8877. let allBall = this.getAllBallArr();
  8878. let target = xGame.common.getRandArrEle(allBall);
  8879. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  8880. return this.knifeV2;
  8881. }
  8882. cloneKnife(x, y, rotation) {
  8883. let parent = xGame.common.d3World.knifeRoot;
  8884. let prefab = xGame.common.d3World.knife;
  8885. let clone = prefab.clone();
  8886. parent.addChild(clone);
  8887. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  8888. clone.transform.localPositionX = this.knifeV3.x;
  8889. clone.transform.localPositionY = 0;
  8890. clone.transform.localPositionZ = this.knifeV3.z;
  8891. clone.transform.localRotationEulerX = 0;
  8892. clone.transform.localRotationEulerY = rotation;
  8893. clone.transform.localRotationEulerZ = 0;
  8894. clone.active = true;
  8895. return clone;
  8896. }
  8897. cloneGuanYuEft(x, y, angle) {
  8898. return;
  8899. let parent = xGame.common.gameUI.ui.guanyuNode;
  8900. let eft = new ui_guanyuAni();
  8901. eft.parent = parent;
  8902. eft.x = x;
  8903. eft.y = y;
  8904. eft.rotation = angle;
  8905. }
  8906. }
  8907. class ui_UIWordsList extends fgui.GComponent {
  8908. static createInstance() {
  8909. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  8910. }
  8911. onConstruct() {
  8912. this.c1 = this.getController("c1");
  8913. this.n74 = (this.getChild("n74"));
  8914. this.clickNode = (this.getChild("clickNode"));
  8915. this.myNode = (this.getChild("myNode"));
  8916. this.n68 = (this.getChild("n68"));
  8917. this.n66 = (this.getChild("n66"));
  8918. this.n55 = (this.getChild("n55"));
  8919. this.wordsBtn = (this.getChild("wordsBtn"));
  8920. this.emotionBtn = (this.getChild("emotionBtn"));
  8921. this.mybggg = (this.getChild("mybggg"));
  8922. this.wordsList = (this.getChild("wordsList"));
  8923. this.emotionList = (this.getChild("emotionList"));
  8924. this.myRoot = (this.getChild("myRoot"));
  8925. }
  8926. }
  8927. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  8928. class EmotionDisplay {
  8929. constructor(index, ui) {
  8930. this.ui = ui;
  8931. this.index = index;
  8932. this.ui.onClick(this, this.clickSelf);
  8933. this.updateSelf();
  8934. }
  8935. updateSelf() {
  8936. let data = cfgTable.emotionData[this.index + 1];
  8937. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  8938. }
  8939. clickSelf() {
  8940. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8941. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  8942. xGame.common.talkMgr.closeTalkView();
  8943. }
  8944. }
  8945. class WordsDisplay {
  8946. constructor(index, ui) {
  8947. this.ui = ui;
  8948. this.index = index;
  8949. this.ui.onClick(this, this.clickSelf);
  8950. this.updateSelf();
  8951. }
  8952. updateSelf() {
  8953. let data = cfgTable.talkwordsData[this.index + 1];
  8954. this.ui.txt.text = data.msg;
  8955. }
  8956. clickSelf() {
  8957. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  8958. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  8959. xGame.common.talkMgr.closeTalkView();
  8960. }
  8961. }
  8962. class UIWordsList extends UIBase {
  8963. constructor() {
  8964. super();
  8965. }
  8966. onConstructor() {
  8967. this.ui = ui_UIWordsList.createInstance();
  8968. this.contentPane = this.ui;
  8969. this.isEject = false;
  8970. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  8971. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  8972. this.addUIClick(this.ui.clickNode, this.hide);
  8973. this.initTalkList();
  8974. this.initEmotionList();
  8975. }
  8976. show() {
  8977. super.show();
  8978. }
  8979. initTalkList() {
  8980. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  8981. let data = cfgTable.talkwordsData;
  8982. let length = Object.keys(data).length;
  8983. this.ui.wordsList.numItems = length;
  8984. }
  8985. initEmotionList() {
  8986. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  8987. let data = cfgTable.emotionData;
  8988. let length = Object.keys(data).length;
  8989. this.ui.emotionList.numItems = length;
  8990. }
  8991. renderTalkItem(index, obj) {
  8992. let temp = new WordsDisplay(index, obj);
  8993. }
  8994. renderEmotionItem(index, obj) {
  8995. let temp = new EmotionDisplay(index, obj);
  8996. }
  8997. openTalkList() {
  8998. this.ui.c1.selectedIndex = 0;
  8999. }
  9000. openEmotionList() {
  9001. this.ui.c1.selectedIndex = 1;
  9002. }
  9003. }
  9004. UIWordsList.uiName = "UIWordsList";
  9005. class TalkMgr {
  9006. constructor() {
  9007. this.aiSpeak = true;
  9008. this.emotionList = [];
  9009. this.talkList = [];
  9010. this.addEvent();
  9011. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9012. this.emotionList = [];
  9013. this.talkList = [];
  9014. for (let k in cfgTable.emotionData) {
  9015. this.emotionList.push(cfgTable.emotionData[k].id);
  9016. }
  9017. for (let k in cfgTable.talkwordsData) {
  9018. this.talkList.push(cfgTable.talkwordsData[k].id);
  9019. }
  9020. }
  9021. addEvent() {
  9022. let ui = xGame.common.gameUI.ui;
  9023. ui.wordsBtn.visible = true;
  9024. ui.wordsBtn.onClick(this, this.openTalkView);
  9025. ui.aiWordsBtn.visible = true;
  9026. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9027. }
  9028. openTalkView() {
  9029. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9030. xGame.uiMgr.Show(UIWordsList);
  9031. }
  9032. closeTalkView() {
  9033. xGame.uiMgr.Hide(UIWordsList);
  9034. }
  9035. clickAIState() {
  9036. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9037. this.aiSpeak = !this.aiSpeak;
  9038. this.changeAIState(this.aiSpeak);
  9039. }
  9040. changeAIState(speak) {
  9041. this.aiSpeak = speak;
  9042. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9043. if (speak) {
  9044. btn.c1.selectedIndex = 0;
  9045. }
  9046. else {
  9047. btn.c1.selectedIndex = 1;
  9048. }
  9049. }
  9050. showSelfTalk(wordsId) {
  9051. let ui = xGame.common.gameUI.ui;
  9052. ui.selfTalk.visible = true;
  9053. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9054. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9055. ui.selfTalk.t0.play();
  9056. }
  9057. showSelfEmotion(emotionId) {
  9058. let ui = xGame.common.gameUI.ui;
  9059. ui.selfTalk.visible = true;
  9060. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9061. this.selfSpine && this.selfSpine.dispose();
  9062. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9063. let spineData = cfgTable.emotionData[emotionId].spine;
  9064. this.selfSpine = new SpineMgr(spineData, () => {
  9065. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9066. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9067. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9068. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9069. });
  9070. ui.selfTalk.t0.play();
  9071. }
  9072. showAITalk(wordsId) {
  9073. if (!this.aiSpeak)
  9074. return;
  9075. if (DataMgr.gameData.gameCount < 2)
  9076. return;
  9077. if (wordsId < 1)
  9078. wordsId = this.getRandTalk();
  9079. let ui = xGame.common.gameUI.ui;
  9080. ui.aiTalk.visible = true;
  9081. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9082. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9083. ui.aiTalk.t0.play();
  9084. }
  9085. getRandTalk() {
  9086. let rand = xGame.tools.random(0, this.talkList.length);
  9087. return this.emotionList[rand];
  9088. }
  9089. getRandEmotion() {
  9090. let rand = xGame.tools.random(0, this.emotionList.length);
  9091. return this.emotionList[rand];
  9092. }
  9093. showAIEmotion(emotionId) {
  9094. if (!this.aiSpeak)
  9095. return;
  9096. if (DataMgr.gameData.gameCount < 2)
  9097. return;
  9098. if (emotionId < 1)
  9099. emotionId = this.getRandEmotion();
  9100. let ui = xGame.common.gameUI.ui;
  9101. ui.aiTalk.visible = true;
  9102. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9103. this.aiSpine && this.aiSpine.dispose();
  9104. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9105. let spineData = cfgTable.emotionData[emotionId].spine;
  9106. this.aiSpine = new SpineMgr(spineData, () => {
  9107. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9108. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9109. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9110. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9111. });
  9112. ui.aiTalk.t0.play();
  9113. }
  9114. resetGame() {
  9115. let ui = xGame.common.gameUI.ui;
  9116. ui.aiTalk.visible = false;
  9117. ui.selfTalk.visible = false;
  9118. this.aiSpine && this.aiSpine.dispose();
  9119. this.selfSpine && this.selfSpine.dispose();
  9120. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9121. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9122. this.closeTalkView();
  9123. }
  9124. }
  9125. class WordsMgr {
  9126. constructor() {
  9127. this.comboTimes = 1;
  9128. this.skillTimes = 0;
  9129. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9130. this.comboSpine = new SpineMgr("yxz_liangan");
  9131. this.skillSpine = new SpineMgr("yiganxqiu");
  9132. this.scoreSpine = new SpineMgr("defen");
  9133. }
  9134. setClassicCombo(isInterrupt) {
  9135. if (isInterrupt) {
  9136. this.comboTimes = 0;
  9137. }
  9138. }
  9139. playClassicWords(type, callback) {
  9140. this.callback = callback;
  9141. let aniIndex = type;
  9142. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9143. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9144. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9145. mySpine.destroy(true);
  9146. this.playClassicTimes();
  9147. });
  9148. }
  9149. playClassicTimes() {
  9150. this.comboTimes++;
  9151. if (this.comboTimes <= 1) {
  9152. this.callback && this.callback();
  9153. }
  9154. else {
  9155. let aniIndex = this.comboTimes - 1;
  9156. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9157. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9158. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9159. mySpine.destroy(true);
  9160. this.callback && this.callback();
  9161. });
  9162. }
  9163. }
  9164. playBigSkillTimes(times, callback) {
  9165. if (times <= 0) {
  9166. callback && callback();
  9167. return;
  9168. }
  9169. this.callback = callback;
  9170. let pre = "sz_0";
  9171. let aniIndex = 0;
  9172. this.getWordsImg(times, pre, () => {
  9173. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9174. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9175. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9176. let r1 = ``;
  9177. let r2 = ``;
  9178. if (times <= 9) {
  9179. r1 = `res/d2Res/${pre}${times}.png`;
  9180. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9181. aniIndex = 0;
  9182. }
  9183. else {
  9184. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9185. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9186. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9187. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9188. aniIndex = 1;
  9189. }
  9190. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9191. mySpine.destroy(true);
  9192. xGame.common.gameMgr.playSkillTips();
  9193. this.playScore(times);
  9194. xGame.common.playRandomMutiBallBigSkillSound();
  9195. }, mySpine);
  9196. });
  9197. }
  9198. playScore(score) {
  9199. let pre = "sz_";
  9200. let aniIndex = 0;
  9201. this.getWordsImg(score, pre, () => {
  9202. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9203. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9204. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9205. let r1 = ``;
  9206. let r2 = ``;
  9207. if (score <= 9) {
  9208. r1 = `res/d2Res/${pre}${score}.png`;
  9209. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9210. aniIndex = 0;
  9211. }
  9212. else {
  9213. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9214. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9215. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9216. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9217. aniIndex = 1;
  9218. }
  9219. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9220. mySpine.destroy(true);
  9221. this.callback && this.callback();
  9222. }, mySpine);
  9223. });
  9224. }
  9225. getWordsImg(number, pre = "", callback) {
  9226. let arr = [];
  9227. if (number <= 9) {
  9228. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9229. }
  9230. else {
  9231. 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 });
  9232. }
  9233. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9234. callback && callback();
  9235. }));
  9236. }
  9237. }
  9238. class ui_UIRodMethod extends fgui.GComponent {
  9239. static createInstance() {
  9240. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9241. }
  9242. onConstruct() {
  9243. this.n24 = (this.getChild("n24"));
  9244. this.white = (this.getChild("white"));
  9245. this.dot = (this.getChild("dot"));
  9246. this.sureBtn = (this.getChild("sureBtn"));
  9247. this.n20 = (this.getChild("n20"));
  9248. this.n21 = (this.getChild("n21"));
  9249. this.n22 = (this.getChild("n22"));
  9250. this.n23 = (this.getChild("n23"));
  9251. this.n5 = (this.getChild("n5"));
  9252. this.n14 = (this.getChild("n14"));
  9253. this.t0 = this.getTransition("t0");
  9254. }
  9255. }
  9256. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9257. class UIRodMethod extends UIBase {
  9258. constructor() {
  9259. super();
  9260. this.isPressd = false;
  9261. }
  9262. onConstructor() {
  9263. this.ui = ui_UIRodMethod.createInstance();
  9264. this.contentPane = this.ui;
  9265. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9266. this.moveDir = new Laya.Vector2();
  9267. this.moveDest = new Laya.Vector2();
  9268. this.centerPos = new Laya.Vector2();
  9269. xGame.common.uiRodMethod = this;
  9270. }
  9271. show() {
  9272. super.show();
  9273. xGame.common.gameMgr.gamePause = true;
  9274. this.openPressDotEvent();
  9275. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9276. this.centerPos.x = this.ui.white.x;
  9277. this.centerPos.y = this.ui.white.y;
  9278. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9279. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9280. this.setDot();
  9281. }
  9282. setDot() {
  9283. this.ui.dot.x = this.moveDest.x;
  9284. this.ui.dot.y = this.moveDest.y;
  9285. }
  9286. closeSelf() {
  9287. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9288. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9289. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9290. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9291. xGame.common.gameMgr.gamePause = false;
  9292. this.hide();
  9293. }
  9294. openPressDotEvent() {
  9295. this.closePressDotEvent();
  9296. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9297. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9298. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9299. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9300. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9301. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9302. }
  9303. closePressDotEvent() {
  9304. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9305. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9306. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9307. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9308. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9309. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9310. }
  9311. onDown(e) {
  9312. if (e.type == Laya.Event.MOUSE_DOWN)
  9313. this.isPressd = true;
  9314. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9315. this.isPressd = false;
  9316. if (!this.isPressd)
  9317. return;
  9318. this.moveDest.x = e.stageX;
  9319. this.moveDest.y = e.stageY;
  9320. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9321. if (dis > 6724) {
  9322. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9323. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9324. }
  9325. this.setDot();
  9326. }
  9327. resetRod() {
  9328. this.ui.dot.x = this.ui.white.x;
  9329. this.ui.dot.y = this.ui.white.y;
  9330. this.gameRod.dot.x = this.gameRod.bg.x;
  9331. this.gameRod.dot.y = this.gameRod.bg.y;
  9332. xGame.common.rodOffest.x = 0;
  9333. xGame.common.rodOffest.y = 0;
  9334. }
  9335. }
  9336. UIRodMethod.uiName = "UIRodMethod";
  9337. class UIGame extends UIBase {
  9338. constructor() {
  9339. super();
  9340. this.powerNum = 0;
  9341. this.isD3Inited = false;
  9342. this.isPrePlay = false;
  9343. this.isMoveRod = false;
  9344. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9345. this.rulerDis = 20;
  9346. this.rulerOffset = 0;
  9347. }
  9348. onConstructor() {
  9349. this.ui = ui_UIGame.createInstance();
  9350. this.contentPane = this.ui;
  9351. this.ui.x += xGame.common.sysOffestNum;
  9352. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9353. this.isEject = false;
  9354. xGame.common.gameUI = this;
  9355. this.initSelf();
  9356. }
  9357. isTurnSelf() {
  9358. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9359. return true;
  9360. }
  9361. }
  9362. initSelf() {
  9363. let topUI = this.ui.topNode;
  9364. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9365. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9366. this.barInfo = {};
  9367. this.barInfo.curY = 0;
  9368. this.barInfo.height = this.ui.powerNode.height;
  9369. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9370. this.barInfo.powerStartY = this.ui.powerNode.y;
  9371. xGame.common.aiPlayer = new AIPlayer();
  9372. xGame.common.gameMgr = new GameMgr();
  9373. xGame.common.skillMgr = new SkillMgr();
  9374. xGame.common.wordsMgr = new WordsMgr();
  9375. xGame.common.talkMgr = new TalkMgr();
  9376. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9377. console.log("加载经典模式表情文件chenggon !");
  9378. });
  9379. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9380. console.log("挑战模式奖励模式spine加载成功!");
  9381. });
  9382. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9383. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9384. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9385. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9386. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9387. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9388. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9389. }
  9390. returnHome() {
  9391. let tips = "Are you sure to exit the game?";
  9392. let woman = "Boss, why don't you play for a while longer?";
  9393. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9394. }
  9395. addRodMethodClick() {
  9396. if (this.isTurnSelf()) {
  9397. xGame.uiMgr.Show(UIRodMethod);
  9398. }
  9399. }
  9400. clickHelpLineBtn(force = false) {
  9401. if (!this.isTurnSelf())
  9402. return;
  9403. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9404. if (success) {
  9405. xGame.common.longHelpLine = true;
  9406. xGame.common.d2World.getHelpLine();
  9407. Moyu.sendDataEvent("guideNum");
  9408. }
  9409. else {
  9410. }
  9411. });
  9412. }
  9413. renderSelfDisplayBalls(index, target) {
  9414. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9415. target.myImg.url = xGame.common.getGameIconUrl(str);
  9416. }
  9417. renderAIDisplayBalls(index, target) {
  9418. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9419. target.myImg.url = xGame.common.getGameIconUrl(str);
  9420. ;
  9421. }
  9422. updateMode() {
  9423. if (xGame.common.gameMode == GameMode.classic) {
  9424. this.ui.topNode.scoreNode.visible = false;
  9425. }
  9426. else if (xGame.common.gameMode == GameMode.bigMove) {
  9427. this.ui.topNode.scoreNode.visible = true;
  9428. }
  9429. }
  9430. show() {
  9431. super.show();
  9432. console.log("zh:uigame show");
  9433. this.ui.alpha = 0;
  9434. this.updateSelf();
  9435. console.log("zh:uigame bf gamemusic01 start");
  9436. xGame.soundMgr.playMusic("gamemusic01");
  9437. console.log("zh:uigame bf gamemusic01 end");
  9438. xGame.common.gameMgr.gamePause = false;
  9439. xGame.common.gameUI.ui.blackAni.visible = false;
  9440. xGame.common.gameUI.ui.whiteAni.visible = false;
  9441. this.ui.powerEft.visible = false;
  9442. this.ui.colorNode.visible = false;
  9443. this.updateHead();
  9444. }
  9445. updateSelf() {
  9446. if (xGame.common.gameMode == GameMode.classic) {
  9447. this.ui.c1.selectedIndex = 0;
  9448. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9449. this.ui.topNode.middleNode.visible = true;
  9450. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9451. }
  9452. else if (xGame.common.gameMode == GameMode.bigMove) {
  9453. this.ui.c1.selectedIndex = 0;
  9454. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9455. this.ui.topNode.middleNode.visible = false;
  9456. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9457. let rand = xGame.common.randomNum(1, max);
  9458. let guide = DataMgr.getSkillGuide();
  9459. if (guide == 0)
  9460. rand = 1;
  9461. xGame.common.bigMoveLevelIndex = rand;
  9462. }
  9463. else if (xGame.common.gameMode == GameMode.placeBall) {
  9464. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9465. this.ui.c1.selectedIndex = 1 + data.type;
  9466. this.ui.alpha = 1;
  9467. this.startGame();
  9468. }
  9469. this.updateMode();
  9470. this.initD3world();
  9471. this.initD2world();
  9472. }
  9473. startGame() {
  9474. this.ui.snowNode.visible = Math.random() <= 0.1;
  9475. this.ui.d2Node.visible = false;
  9476. xGame.common.d3World.d3Hand.gameObj.active = false;
  9477. xGame.common.d3World.tableSrc.init();
  9478. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9479. this.cameraViewChange(() => {
  9480. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9481. switch (xGame.common.gameMode) {
  9482. case GameMode.classic:
  9483. xGame.common.d3World.d3Hand.gameObj.active = true;
  9484. this.playPutBallD3Ani();
  9485. break;
  9486. case GameMode.bigMove:
  9487. this.enterGame();
  9488. Laya.timer.once(500, this, () => {
  9489. this.ui.topNode.middleNode.visible = true;
  9490. this.ui.topNode.middleNode.t0.play();
  9491. });
  9492. break;
  9493. case GameMode.placeBall:
  9494. this.enterGame();
  9495. break;
  9496. default:
  9497. break;
  9498. }
  9499. });
  9500. PlatMgr.showBanner(false);
  9501. }
  9502. enterGame() {
  9503. this.ui.d2Node.visible = true;
  9504. xGame.common.d3World.d3Hand.gameObj.active = false;
  9505. xGame.common.showOneCamera("mainCamera");
  9506. Moyu.recordGame(30, true);
  9507. if (!this.isPrePlay) {
  9508. this.isPrePlay = true;
  9509. xGame.common.d3World.prePlayEft();
  9510. }
  9511. xGame.common.gameMgr.gameReady();
  9512. this.openAllEvent();
  9513. this.ui.snowNode.visible = false;
  9514. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9515. this.ui.helpBtn.visible = condition;
  9516. }
  9517. showHelpLineGuide() {
  9518. let longGuide = DataMgr.getGuideHelpLine();
  9519. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9520. this.ui.helpBtn.visible = true;
  9521. this.ui.guideNode.visible = true;
  9522. }
  9523. }
  9524. setTurnAlpha(alpha) {
  9525. this.ui.keduNode.alpha = alpha;
  9526. this.ui.ganNode.alpha = alpha;
  9527. this.ui.rodMethodNode.alpha = alpha;
  9528. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9529. }
  9530. cameraViewChange(callback) {
  9531. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9532. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9533. xGame.common.showOneCamera("visitAngle");
  9534. cameraSrc.localRotationEulerY = 180;
  9535. cameraSrc.localRotationEulerZ = 0;
  9536. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9537. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9538. callback && callback();
  9539. }));
  9540. }));
  9541. }
  9542. playPutBallD3Ani() {
  9543. xGame.common.showOneCamera("mainCamera");
  9544. let handSrc = xGame.common.d3World.d3Hand;
  9545. handSrc.gameObj.active = true;
  9546. handSrc.transform.localPositionZ = 3;
  9547. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9548. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9549. handSrc.gameObj.active = false;
  9550. this.enterGame();
  9551. }), 400);
  9552. }));
  9553. }
  9554. updateHead() {
  9555. let user = Moyu.getUserInfo();
  9556. this.ui.topNode.selfNameTxt.text = user.nickName;
  9557. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9558. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9559. if (DataMgr.getSkillGuide() < 1) {
  9560. this.ui.topNode.aiNameTxt.text = 'billiards';
  9561. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9562. }
  9563. else {
  9564. this.ui.topNode.aiNameTxt.text = aiData.name;
  9565. let randNo = Math.floor(Math.random() * 10) + 1;
  9566. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9567. }
  9568. }
  9569. initD2world() {
  9570. let node = this.ui.d2Root.displayObject;
  9571. let src = node.getComponent(D2World);
  9572. if (!src) {
  9573. xGame.common.d2World = node.addComponent(D2World);
  9574. }
  9575. xGame.common.d2World.initSelf();
  9576. }
  9577. initD3world() {
  9578. if (this.isD3Inited)
  9579. return;
  9580. this.isD3Inited = true;
  9581. let scene3D = xGame.common.d3Scene;
  9582. this.ui.d3Root.displayObject.addChild(scene3D);
  9583. scene3D.active = true;
  9584. xGame.common.d3World.tableSrc.setBorderPos();
  9585. }
  9586. onRootMove(e) {
  9587. let rootBall = xGame.common.d2World.rootBall;
  9588. this.ui.moveNode.x = e.x;
  9589. this.ui.moveNode.y = e.y;
  9590. rootBall.gameObj.x = e.x;
  9591. rootBall.gameObj.y = e.y;
  9592. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9593. }
  9594. aiRootMove(move) {
  9595. if (move)
  9596. this.hideBallUI();
  9597. else {
  9598. this.showBallUI();
  9599. xGame.common.d2World.getHelpLine();
  9600. }
  9601. }
  9602. aiForce(type, force = 0) {
  9603. this.pressTarget = PressType.powerNode;
  9604. if (type == 1)
  9605. this.onEventUp({ force: true });
  9606. else if (type == 2)
  9607. this.onEventMove({ stageY: force, force: true });
  9608. }
  9609. onEventPress(e) {
  9610. if (e.stopPropagation)
  9611. e.stopPropagation();
  9612. if (!this.isTurnSelf())
  9613. return;
  9614. let target = e.target;
  9615. switch (target) {
  9616. case this.ui.myPowerNode.displayObject:
  9617. this.pressTarget = PressType.powerNode;
  9618. this.barInfo.curY = e.stageY;
  9619. this.updateBarInfo();
  9620. break;
  9621. case this.ui.moveNode.displayObject:
  9622. this.pressTarget = PressType.moveNode;
  9623. this.hideBallUI();
  9624. this.eventObj.curX = this.ui.moveNode.x;
  9625. this.eventObj.curY = this.ui.moveNode.y;
  9626. this.ui.moveNode.finger.visible = false;
  9627. this.eventObj.lastX = e.stageX;
  9628. this.eventObj.lastY = e.stageY;
  9629. break;
  9630. case this.ui.rulerClickNode.displayObject:
  9631. this.pressTarget = PressType.rulerNode;
  9632. this.eventObj.lastY = e.stageY;
  9633. break;
  9634. case this.ui.d2Root.displayObject:
  9635. this.pressTarget = PressType.d2Root;
  9636. this.eventObj.lastX = e.stageX;
  9637. this.eventObj.lastY = e.stageY;
  9638. this.eventObj.starX = e.stageX;
  9639. this.eventObj.starY = e.stageY;
  9640. this.eventObj.curX = 0;
  9641. this.eventObj.curY = 0;
  9642. xGame.common.d2World.d2Gan.setGanLastInfo();
  9643. this.rulerOffset = 0;
  9644. break;
  9645. default:
  9646. break;
  9647. }
  9648. }
  9649. onEventMove(e) {
  9650. if (e.stopPropagation)
  9651. e.stopPropagation();
  9652. if (e && e.force) {
  9653. }
  9654. else {
  9655. if (!this.isTurnSelf())
  9656. return;
  9657. }
  9658. switch (this.pressTarget) {
  9659. case PressType.powerNode:
  9660. this.barInfo.curY = e.stageY;
  9661. this.updateBarInfo();
  9662. this.isMoveRod = true;
  9663. break;
  9664. case PressType.moveNode:
  9665. let rootBall = xGame.common.d2World.rootBall;
  9666. let radius = rootBall.gameObj.width / 2;
  9667. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9668. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9669. let border = xGame.common.d2World.borderRect;
  9670. if (curX <= border.x + radius)
  9671. curX = border.x + radius;
  9672. else if (curX >= border.x + border.width - radius)
  9673. curX = border.x + border.width - radius;
  9674. if (curY <= border.y + radius)
  9675. curY = border.y + radius;
  9676. else if (curY >= border.y + border.height - radius)
  9677. curY = border.y + border.height - radius;
  9678. if (xGame.common.gameMgr.isOpenBall) {
  9679. if (curX >= border.x + border.openBallW - radius)
  9680. curX = border.x + border.openBallW - radius;
  9681. }
  9682. this.ui.moveNode.x = curX;
  9683. this.ui.moveNode.y = curY;
  9684. rootBall.gameObj.x = curX;
  9685. rootBall.gameObj.y = curY;
  9686. rootBall.d3BallSrc.setTransPos(curX, curY);
  9687. this.isMoveRod = true;
  9688. break;
  9689. case PressType.rulerNode:
  9690. let yy = e.stageY - this.eventObj.lastY;
  9691. this.eventObj.lastY = e.stageY;
  9692. let ruler1 = this.ui.rulerNode.img1;
  9693. let ruler2 = this.ui.rulerNode.img2;
  9694. ruler1.y += yy;
  9695. ruler2.y += yy;
  9696. this.rulerOffset += yy;
  9697. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9698. this.rulerOffset = 0;
  9699. xGame.soundMgr.playSound("inch", 1, 10);
  9700. }
  9701. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9702. let h = ruler1.height;
  9703. this.checkGuide();
  9704. this.isMoveRod = true;
  9705. if (ruler1.y >= h) {
  9706. ruler1.y = -h;
  9707. ruler2.y = 0;
  9708. return;
  9709. }
  9710. else if (ruler1.y <= -h) {
  9711. ruler1.y = h;
  9712. ruler2.y = 0;
  9713. return;
  9714. }
  9715. if (ruler2.y >= h) {
  9716. ruler2.y = -h;
  9717. ruler1.y = 0;
  9718. return;
  9719. }
  9720. else if (ruler2.y <= -h) {
  9721. ruler2.y = h;
  9722. ruler1.y = 0;
  9723. return;
  9724. }
  9725. break;
  9726. case PressType.d2Root:
  9727. this.eventObj.curX = e.stageX;
  9728. this.eventObj.curY = e.stageY;
  9729. let offset = this.checkRodMoveDir();
  9730. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9731. this.eventObj.lastX = e.stageX;
  9732. this.eventObj.lastY = e.stageY;
  9733. break;
  9734. default:
  9735. break;
  9736. }
  9737. }
  9738. onEventUp(e) {
  9739. if (e.stopPropagation)
  9740. e.stopPropagation();
  9741. if (e && e.force) {
  9742. }
  9743. else {
  9744. if (!this.isTurnSelf())
  9745. return;
  9746. }
  9747. switch (this.pressTarget) {
  9748. case PressType.powerNode:
  9749. this.ui.powerNode.value = 0;
  9750. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9751. this.ui.powerTxt.text = "";
  9752. if (this.powerNum > 0) {
  9753. xGame.eventMgr.event(BALL_SHOOT);
  9754. xGame.common.d2World.shoot(this.powerNum);
  9755. xGame.common.d2World.d2Gan.shoot();
  9756. xGame.common.d2World.d2HelpLine.shoot();
  9757. this.finishGuide();
  9758. this.ui.powerEft.visible = false;
  9759. this.ui.colorNode.visible = false;
  9760. let ganStr = "";
  9761. if (this.powerNum <= 30) {
  9762. ganStr = "gan_30";
  9763. }
  9764. else if (this.powerNum <= 60) {
  9765. ganStr = "gan_50";
  9766. }
  9767. else {
  9768. ganStr = "gan_80";
  9769. }
  9770. xGame.soundMgr.playSound(ganStr);
  9771. }
  9772. break;
  9773. case PressType.moveNode:
  9774. let rootBall = xGame.common.d2World.rootBall;
  9775. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  9776. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  9777. let isIntersect = this.judgeBallIntersect();
  9778. if (isIntersect) {
  9779. this.ui.moveNode.x = lastX;
  9780. this.ui.moveNode.y = lastY;
  9781. rootBall.gameObj.x = lastX;
  9782. rootBall.gameObj.y = lastY;
  9783. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  9784. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  9785. }
  9786. else {
  9787. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  9788. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  9789. }
  9790. this.showBallUI();
  9791. this.ui.moveNode.finger.visible = true;
  9792. xGame.common.d2World.getHelpLine();
  9793. break;
  9794. case PressType.rulerNode:
  9795. break;
  9796. case PressType.d2Root:
  9797. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  9798. if (dis <= 25) {
  9799. this.moveToClickDot(e);
  9800. }
  9801. break;
  9802. default:
  9803. break;
  9804. }
  9805. this.pressTarget = -1;
  9806. }
  9807. checkGuide() {
  9808. let guide = DataMgr.getSkillGuide();
  9809. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  9810. xGame.common.guideStep++;
  9811. xGame.common.gameUI.ui.guide2.visible = false;
  9812. xGame.common.gameUI.ui.guide3.visible = true;
  9813. }
  9814. }
  9815. finishGuide() {
  9816. let guide = DataMgr.getSkillGuide();
  9817. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9818. xGame.common.guideStep = 10;
  9819. this.closeAllGuide();
  9820. }
  9821. }
  9822. closeAllGuide() {
  9823. xGame.common.gameUI.ui.guide1.visible = false;
  9824. xGame.common.gameUI.ui.guide2.visible = false;
  9825. xGame.common.gameUI.ui.guide3.visible = false;
  9826. }
  9827. updateBarInfo() {
  9828. let star = this.ui.powerNode.y;
  9829. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  9830. if (rate >= 1)
  9831. rate = 1;
  9832. if (rate <= 0)
  9833. rate = 0;
  9834. this.powerNum = Math.ceil(rate * 100);
  9835. this.ui.powerNode.value = this.powerNum;
  9836. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  9837. this.ui.colorNode.value = this.powerNum;
  9838. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  9839. this.ui.powerEft.visible = this.powerNum != 0;
  9840. this.ui.colorNode.visible = this.powerNum != 0;
  9841. this.ui.powerTxt.text = this.powerNum + "";
  9842. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  9843. }
  9844. forceCancel() {
  9845. this.ui.powerNode.value = 0;
  9846. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  9847. this.ui.powerTxt.text = "";
  9848. }
  9849. checkRodMoveDir() {
  9850. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  9851. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  9852. if (tempX >= 0 && tempY <= 0) {
  9853. return this.checkDir();
  9854. }
  9855. else if (tempX < 0 && tempY < 0) {
  9856. return this.checkDir(1, -1);
  9857. }
  9858. else if (tempX < 0 && tempY > 0) {
  9859. return this.checkDir(-1, -1);
  9860. }
  9861. else {
  9862. return this.checkDir(-1, 1);
  9863. }
  9864. }
  9865. checkDir(flagX = 1, flagY = 1) {
  9866. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  9867. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  9868. if (offsetY == 0) {
  9869. return offsetX * flagX;
  9870. }
  9871. if (offsetX == 0) {
  9872. return offsetY * flagY;
  9873. }
  9874. let angle = offsetY / offsetX;
  9875. if (Math.abs(angle) >= 1) {
  9876. return offsetY * flagY;
  9877. }
  9878. else {
  9879. return offsetX * flagX;
  9880. }
  9881. }
  9882. judgeBallIntersect() {
  9883. let rootBall = xGame.common.d2World.rootBall;
  9884. let ballArr = xGame.common.d2World.ballArr;
  9885. let radius = rootBall.gameObj.width / 2;
  9886. let temp;
  9887. let isIntersect = false;
  9888. for (let index = 0; index < ballArr.length; index++) {
  9889. temp = ballArr[index];
  9890. if (temp.number == rootBall.number)
  9891. continue;
  9892. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  9893. if (isIntersect) {
  9894. break;
  9895. }
  9896. }
  9897. return isIntersect;
  9898. }
  9899. hideBallUI() {
  9900. let d2Gan = xGame.common.d2World.d2Gan;
  9901. if (!d2Gan.ui.isDisposed)
  9902. d2Gan.ui.visible = false;
  9903. let d2Help = xGame.common.d2World.d2HelpLine;
  9904. if (!d2Help.ui.isDisposed)
  9905. d2Help.ui.visible = false;
  9906. let rootBall = xGame.common.d2World.rootBall;
  9907. if (!rootBall.destroyed) {
  9908. rootBall.gameObj.active = false;
  9909. }
  9910. }
  9911. showBallUI() {
  9912. let d2Gan = xGame.common.d2World.d2Gan;
  9913. if (!d2Gan.ui.isDisposed)
  9914. d2Gan.ui.visible = true;
  9915. let d2Help = xGame.common.d2World.d2HelpLine;
  9916. if (!d2Help.ui.isDisposed)
  9917. d2Help.ui.visible = true;
  9918. let rootBall = xGame.common.d2World.rootBall;
  9919. if (!rootBall.destroyed) {
  9920. rootBall.gameObj.active = true;
  9921. }
  9922. }
  9923. moveToClickDot(e) {
  9924. if (!this.isMoveRod && !xGame.common.clickedBall) {
  9925. let root = xGame.common.d2World.rootBall.gameObj;
  9926. let xx = e.stageX - xGame.common.sysOffestNum;
  9927. let yy = e.stageY;
  9928. let x = xx - root.x;
  9929. let y = yy - root.y;
  9930. let angle = xGame.common.getfguiRotation(x, y);
  9931. xGame.common.d2World.d2Gan.ui.rotation = angle;
  9932. xGame.common.d2World.getHelpLine();
  9933. }
  9934. this.isMoveRod = false;
  9935. xGame.common.clickedBall = false;
  9936. }
  9937. openAllEvent() {
  9938. this.closeAllEvent();
  9939. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9940. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9941. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9942. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9943. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9944. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9945. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9946. }
  9947. closeAllEvent() {
  9948. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9949. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9950. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9951. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  9952. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  9953. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  9954. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  9955. }
  9956. resetGame() {
  9957. this.closeAllEvent();
  9958. this.hideBallUI();
  9959. xGame.common.gameMgr.gamePause = true;
  9960. }
  9961. }
  9962. UIGame.uiName = "UIGame";
  9963. class UIAddProp extends UIBase {
  9964. constructor() {
  9965. super();
  9966. this.curType = "";
  9967. }
  9968. onConstructor() {
  9969. this.ui = ui_UIAddProp.createInstance();
  9970. this.contentPane = this.ui;
  9971. this.isEject = false;
  9972. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  9973. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  9974. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  9975. this.updateUI();
  9976. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  9977. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  9978. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  9979. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  9980. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  9981. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  9982. }
  9983. show(type) {
  9984. super.show();
  9985. this.curType = type == 0 ? "coin" : "diamond";
  9986. this.switchBtn("");
  9987. this.ui.t0.play();
  9988. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  9989. PlatMgr.showInsert(true);
  9990. }
  9991. closeSelf() {
  9992. this.hide();
  9993. }
  9994. updateUI() {
  9995. let data = cfgTable.moneyData;
  9996. let temp;
  9997. let obj;
  9998. for (const key in data) {
  9999. temp = data[key];
  10000. obj = this.ui.myNode["node" + key];
  10001. if (parseInt(key) <= 2) {
  10002. obj.diamondTxt.text = "+" + temp.num;
  10003. }
  10004. else {
  10005. obj.coinTxt.text = temp.num;
  10006. obj.diamondTxt.text = temp.get.split('_')[1];
  10007. }
  10008. }
  10009. this.updateDiamondShare();
  10010. }
  10011. updateDiamondShare() {
  10012. let data = DataMgr.getShareDiamondTimes();
  10013. if (data >= xGame.common.maxShareDiamondTimes) {
  10014. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10015. this.ui.myNode.node1.touchable = false;
  10016. }
  10017. else {
  10018. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10019. this.ui.myNode.node1.touchable = true;
  10020. }
  10021. }
  10022. switchBtn(type) {
  10023. if (type == "")
  10024. type = this.curType;
  10025. else {
  10026. if (this.curType == type) {
  10027. return;
  10028. }
  10029. else {
  10030. this.curType = type;
  10031. }
  10032. }
  10033. if (type == "coin") {
  10034. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10035. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10036. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10037. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10038. this.ui.myNode.c1.selectedIndex = 0;
  10039. }
  10040. else {
  10041. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10042. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10043. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10044. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10045. this.ui.myNode.c1.selectedIndex = 1;
  10046. }
  10047. }
  10048. convertCoin(index) {
  10049. let data = cfgTable.moneyData[index];
  10050. let coinNum = data.num;
  10051. let str = data.get.split('_')[1];
  10052. let needDiamond = parseInt(str);
  10053. if (DataMgr.diamondEnough(needDiamond)) {
  10054. DataMgr.setDiamond(-needDiamond);
  10055. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10056. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10057. }
  10058. else {
  10059. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10060. this.switchBtn("diamond");
  10061. }
  10062. }
  10063. videoGetDiamond() {
  10064. let num = cfgTable.moneyData[2].num;
  10065. Moyu.showVideoAd(() => {
  10066. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10067. this.closeSelf();
  10068. }, EAdType.addDiamond);
  10069. }
  10070. videoGetCoin() {
  10071. Moyu.showVideoAd(() => {
  10072. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10073. this.closeSelf();
  10074. }, EAdType.addCoin);
  10075. }
  10076. shareGetDiamond() {
  10077. let times = DataMgr.getShareDiamondTimes();
  10078. if (times >= xGame.common.maxShareDiamondTimes) {
  10079. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10080. }
  10081. else {
  10082. if (Moyu.isTT) {
  10083. let num = cfgTable.moneyData[1].num;
  10084. Moyu.shareVideo = '';
  10085. Moyu.shareGame((success) => {
  10086. if (success) {
  10087. xGame.uiMgr.Show(UIMsg, "分享成功!");
  10088. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10089. DataMgr.setShareDiamondTimes(1);
  10090. this.updateDiamondShare();
  10091. }
  10092. else {
  10093. xGame.uiMgr.Show(UIMsg, "分享失败!");
  10094. }
  10095. });
  10096. }
  10097. else {
  10098. Moyu.showVideoAd(() => {
  10099. let diamond = xGame.common.randomNum(50, 100);
  10100. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10101. DataMgr.setShareDiamondTimes(1);
  10102. this.updateDiamondShare();
  10103. }, EAdType.randomDiamond);
  10104. }
  10105. }
  10106. }
  10107. openPutBallView() {
  10108. let end = xGame.uiMgr.getUI(UIGameEnd);
  10109. let skill = xGame.uiMgr.getUI(UISkill);
  10110. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10111. let uigame = xGame.uiMgr.getUI(UIGame);
  10112. if (end && !end.isHide) {
  10113. xGame.uiMgr.Hide(UIGameEnd);
  10114. xGame.uiMgr.Show(UIMain);
  10115. }
  10116. if (skill && !skill.isHide)
  10117. xGame.uiMgr.Hide(UISkill);
  10118. if (uigame && !uigame.isHide)
  10119. xGame.uiMgr.Hide(UIGame);
  10120. if (level && !level.isHide) {
  10121. }
  10122. else {
  10123. xGame.uiMgr.Show(UILevelDisplay);
  10124. }
  10125. this.closeSelf();
  10126. }
  10127. }
  10128. UIAddProp.uiName = "UIAddProp";
  10129. class MoneyNode {
  10130. constructor(ui) {
  10131. this.leftTime = 0;
  10132. this.ui = ui;
  10133. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10134. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10135. this.ui.addPowerBtn.onClick(this, this.addPower);
  10136. this.ui.c1.selectedIndex = 1;
  10137. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10138. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10139. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10140. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10141. this.coinChange();
  10142. this.diamondChange();
  10143. this.powerChange();
  10144. }
  10145. addPower() {
  10146. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10147. xGame.uiMgr.Show(UIPower);
  10148. }
  10149. powerChange() {
  10150. let powerNum = DataMgr.getPower();
  10151. this.ui.powerTxt.text = powerNum + "";
  10152. }
  10153. checkPowerTime() {
  10154. let cur = new Date().getTime();
  10155. let last = DataMgr.getPowerTime();
  10156. if (last == 0) {
  10157. last = cur;
  10158. DataMgr.setPowerTime(cur);
  10159. }
  10160. let power = DataMgr.getPower();
  10161. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10162. Laya.timer.clearAll(this);
  10163. if (power >= xGame.common.natureMaxPower) {
  10164. this.ui.powerTimeTxt.text = "";
  10165. DataMgr.setPowerTime(cur);
  10166. return;
  10167. }
  10168. if (power + offset >= xGame.common.natureMaxPower) {
  10169. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10170. this.ui.powerTimeTxt.text = "";
  10171. DataMgr.setPowerTime(cur);
  10172. }
  10173. else {
  10174. if (offset > 0) {
  10175. DataMgr.setPower(offset);
  10176. DataMgr.setPowerTime(cur);
  10177. }
  10178. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10179. this.leftTime = xGame.common.powerRecoverNum - time;
  10180. if (this.leftTime <= 0)
  10181. this.leftTime = 0;
  10182. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10183. Laya.timer.loop(1000, this, this.updatePowerTime);
  10184. }
  10185. }
  10186. updatePowerTime() {
  10187. this.leftTime -= 1;
  10188. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10189. if (this.leftTime <= 0) {
  10190. this.checkPowerTime();
  10191. }
  10192. }
  10193. coinChange() {
  10194. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10195. }
  10196. diamondChange() {
  10197. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10198. }
  10199. addCoin() {
  10200. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10201. Moyu.sendDataEvent("AddCoinBtn");
  10202. xGame.uiMgr.Show(UIAddProp, 0);
  10203. }
  10204. addDiamond() {
  10205. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10206. Moyu.sendDataEvent("AddDiamondBtn");
  10207. xGame.uiMgr.Show(UIAddProp, 1);
  10208. }
  10209. }
  10210. class UIDraw extends UIBase {
  10211. constructor() {
  10212. super();
  10213. this.curKey = 0;
  10214. }
  10215. onConstructor() {
  10216. this.ui = ui_UIDraw.createInstance();
  10217. this.contentPane = this.ui;
  10218. this.isEject = false;
  10219. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10220. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10221. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10222. this.initDraw();
  10223. this.initUI();
  10224. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10225. if (Moyu.isKs)
  10226. this.ui.closeNode.closeBtn.x += 100;
  10227. }
  10228. show() {
  10229. super.show();
  10230. this.ui.t0.play();
  10231. this.playSecretaryIdle();
  10232. this.updateDraw();
  10233. this.checkFree();
  10234. if (PlatMgr.bannerDelay > 0) {
  10235. this.ui.closeNode.closeBtn.visible = false;
  10236. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10237. this.ui.closeNode.closeBtn.visible = true;
  10238. });
  10239. }
  10240. PlatMgr.showRateBanner();
  10241. }
  10242. hide() {
  10243. Laya.timer.clearAll(this);
  10244. super.hide();
  10245. }
  10246. checkFree() {
  10247. let isFree = DataMgr.getDailyfreeDrawTimes();
  10248. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10249. }
  10250. initDraw() {
  10251. this.drawObj = [];
  10252. let data = cfgTable.drawData;
  10253. let temp;
  10254. let weight = 0;
  10255. for (const key in data) {
  10256. temp = data[key];
  10257. weight += temp.weight;
  10258. this.drawObj.push(weight);
  10259. }
  10260. this.allWeight = weight;
  10261. }
  10262. initUI() {
  10263. let data = cfgTable.drawData;
  10264. let temp;
  10265. let img;
  10266. let txt;
  10267. for (const key in data) {
  10268. temp = data[key];
  10269. img = this.ui.myNode.rotNode["img" + key];
  10270. txt = this.ui.myNode.rotNode["txt" + key];
  10271. img.url = xGame.common.getGameIconUrl(temp.icon);
  10272. txt.visible = true;
  10273. if (temp.award > 2) {
  10274. img.rotation = 0;
  10275. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10276. }
  10277. else {
  10278. img.rotation = temp.rotation;
  10279. txt.text = temp.num;
  10280. }
  10281. }
  10282. }
  10283. getCurkey() {
  10284. let rand = Math.random() * this.allWeight;
  10285. let temp;
  10286. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10287. temp = this.drawObj[index];
  10288. if (index == 0) {
  10289. if (rand < temp) {
  10290. return index + 1;
  10291. }
  10292. }
  10293. else {
  10294. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10295. return index + 1;
  10296. }
  10297. }
  10298. }
  10299. return 2;
  10300. }
  10301. startDraw() {
  10302. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10303. if (freeTimes > 0) {
  10304. this.beginDraw();
  10305. DataMgr.setDailyfreeDrawTimes(0);
  10306. this.checkFree();
  10307. }
  10308. else {
  10309. GlobalManager.instance.registerMethod('qjff_chouJiang', this.qjff_chouJiang);
  10310. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10311. }
  10312. else {
  10313. console.log('zh:AD 失败,直接发放奖励');
  10314. this.qjff_chouJiang;
  10315. }
  10316. }
  10317. }
  10318. qjff_chouJiang() {
  10319. this.beginDraw();
  10320. }
  10321. beginDraw() {
  10322. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10323. this.ui.drawBtn.touchable = false;
  10324. this.curKey = this.getCurkey();
  10325. console.log("当前key", this.curKey);
  10326. let cell = 60;
  10327. let lap = 3;
  10328. let angle = cell * (this.curKey - 1) + lap * 360;
  10329. let target = this.ui.myNode.rotNode;
  10330. target.rotation = 0;
  10331. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10332. console.log("旋转完成");
  10333. this.ui.drawBtn.touchable = true;
  10334. this.getAward();
  10335. }));
  10336. }
  10337. getAward() {
  10338. let data = cfgTable.drawData[this.curKey];
  10339. let temp = new AwardType();
  10340. temp.type = data.award;
  10341. temp.num = data.num;
  10342. xGame.common.getAward([temp], () => {
  10343. DataMgr.setDrawTimes(1);
  10344. this.updateDraw();
  10345. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10346. });
  10347. }
  10348. updateDraw() {
  10349. let drawTimes = DataMgr.getDrawTimes();
  10350. let awardTimes = DataMgr.getDrawAwardTimes();
  10351. if (Math.floor(drawTimes / 3) > awardTimes) {
  10352. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10353. this.ui.extraNode.boxBtn.touchable = true;
  10354. this.ui.extraNode.tipsTxt.text = "3/3";
  10355. this.ui.extraNode.barNode.width = 265;
  10356. this.getExtraAward();
  10357. }
  10358. else {
  10359. this.ui.extraNode.boxBtn.t0.stop();
  10360. this.ui.extraNode.boxBtn.touchable = false;
  10361. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10362. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10363. }
  10364. let data = cfgTable.drawData[1];
  10365. if (awardTimes == 0) {
  10366. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10367. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10368. this.ui.myNode.rotNode.img1.rotation = 0;
  10369. }
  10370. else {
  10371. let award = data.nextid;
  10372. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10373. this.ui.myNode.rotNode.txt1.text = award[1];
  10374. this.ui.myNode.rotNode.img1.rotation = 0;
  10375. }
  10376. }
  10377. getExtraAward() {
  10378. let drawTimes = DataMgr.getDrawTimes();
  10379. let awardTimes = DataMgr.getDrawAwardTimes();
  10380. let data = cfgTable.drawData[1];
  10381. let award = new AwardType();
  10382. if (awardTimes == 0) {
  10383. award.num = data.num;
  10384. award.type = data.award;
  10385. xGame.common.getAward([award], () => {
  10386. let all = Math.floor(drawTimes / 3);
  10387. DataMgr.setDrawAwardTimes(all);
  10388. this.updateDraw();
  10389. });
  10390. }
  10391. else {
  10392. award.num = parseInt(data.nextid[1]);
  10393. award.type = parseInt(data.nextid[0]);
  10394. xGame.common.getAward([award], () => {
  10395. let all = Math.floor(drawTimes / 3);
  10396. DataMgr.setDrawAwardTimes(all);
  10397. this.updateDraw();
  10398. });
  10399. }
  10400. }
  10401. closeSelf() {
  10402. this.hide();
  10403. }
  10404. playSecretaryIdle() {
  10405. let parent = this.ui.secretary.displayObject;
  10406. parent.destroyChildren();
  10407. let xx = this.ui.secretary.width / 2;
  10408. let yy = this.ui.secretary.height;
  10409. let scale = xGame.common.getSecretaryScale();
  10410. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10411. xGame.common.secretary.play(data, 0, true, parent);
  10412. }
  10413. }
  10414. UIDraw.uiName = "UIDraw";
  10415. class ui_UIFlyEft extends fgui.GComponent {
  10416. static createInstance() {
  10417. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10418. }
  10419. onConstruct() {
  10420. this.n0 = (this.getChild("n0"));
  10421. this.n1 = (this.getChild("n1"));
  10422. this.n2 = (this.getChild("n2"));
  10423. this.n3 = (this.getChild("n3"));
  10424. this.n4 = (this.getChild("n4"));
  10425. this.n5 = (this.getChild("n5"));
  10426. this.n6 = (this.getChild("n6"));
  10427. this.n7 = (this.getChild("n7"));
  10428. this.iconNode = (this.getChild("iconNode"));
  10429. this.txt = (this.getChild("txt"));
  10430. this.txtNode = (this.getChild("txtNode"));
  10431. }
  10432. }
  10433. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10434. class UIFlyEft extends UIBase {
  10435. constructor() {
  10436. super();
  10437. this.max = 8;
  10438. this.delay = 0;
  10439. }
  10440. onConstructor() {
  10441. this.ui = ui_UIFlyEft.createInstance();
  10442. this.contentPane = this.ui;
  10443. this.isEject = false;
  10444. this.isMuti = true;
  10445. this.ui.x += xGame.common.sysOffestNum;
  10446. }
  10447. getArrPos() {
  10448. if (this.iconPos && this.iconPos.length > 0)
  10449. return;
  10450. this.iconPos = [];
  10451. let temp;
  10452. for (let index = 0; index < this.max; index++) {
  10453. temp = this.ui["n" + index];
  10454. this.iconPos.push([temp.x, temp.y]);
  10455. }
  10456. }
  10457. show(stPos, edPos, num, type, callback) {
  10458. super.show();
  10459. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10460. this.getArrPos();
  10461. this.updateUI(type);
  10462. this.updatePos();
  10463. this.runFly(edPos, callback);
  10464. this.runWorlds(stPos, num);
  10465. }
  10466. updateUI(type) {
  10467. let temp;
  10468. let str;
  10469. for (let index = 0; index < this.max; index++) {
  10470. temp = this.ui["n" + index];
  10471. str = this.getIconStr(type);
  10472. temp.url = xGame.common.getGameIconUrl(str);
  10473. }
  10474. }
  10475. getIconStr(type) {
  10476. switch (type) {
  10477. case Prop.diamond:
  10478. return "ty_zs";
  10479. case Prop.coin:
  10480. return "ty_jb";
  10481. default:
  10482. break;
  10483. }
  10484. }
  10485. updatePos() {
  10486. let temp;
  10487. for (let index = 0; index < this.max; index++) {
  10488. temp = this.ui["n" + index];
  10489. temp.x = this.iconPos[index][0];
  10490. temp.y = this.iconPos[index][1];
  10491. }
  10492. }
  10493. runFly(endPos, callback) {
  10494. let all = 0;
  10495. let temp;
  10496. for (let index = 0; index < this.max; index++) {
  10497. temp = this.ui["n" + index];
  10498. temp.visible = true;
  10499. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10500. temp.visible = false;
  10501. all++;
  10502. if (all >= this.max) {
  10503. callback && callback();
  10504. }
  10505. }), 20 * index);
  10506. }
  10507. }
  10508. runWorlds(stPos, num) {
  10509. let str = "+" + num;
  10510. this.ui.txt.text = str;
  10511. let starX = stPos.x;
  10512. let starY = stPos.y + 50;
  10513. this.ui.txt.x = starX;
  10514. this.ui.txt.y = starY;
  10515. this.ui.txt.visible = true;
  10516. this.ui.txt.alpha = 1;
  10517. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10518. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10519. this.ui.txt.visible = false;
  10520. this.hide();
  10521. }));
  10522. }));
  10523. }
  10524. }
  10525. UIFlyEft.uiName = "UIFlyEft";
  10526. class ui_UIGetAward extends fgui.GComponent {
  10527. static createInstance() {
  10528. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  10529. }
  10530. onConstruct() {
  10531. this.n4 = (this.getChild("n4"));
  10532. this.n0 = (this.getChild("n0"));
  10533. this.myList = (this.getChild("myList"));
  10534. this.n1 = (this.getChild("n1"));
  10535. this.eftNode = (this.getChild("eftNode"));
  10536. this.btnNode = (this.getChild("btnNode"));
  10537. this.t0 = this.getTransition("t0");
  10538. }
  10539. }
  10540. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  10541. class UIGetAward extends UIBase {
  10542. constructor() {
  10543. super();
  10544. this.showTriple = true;
  10545. }
  10546. onConstructor() {
  10547. this.ui = ui_UIGetAward.createInstance();
  10548. this.contentPane = this.ui;
  10549. this.isEject = false;
  10550. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  10551. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  10552. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  10553. }
  10554. show(arr, showTriple, callback) {
  10555. super.show();
  10556. this.ui.t0.play();
  10557. this.ui.eftNode.visible = true;
  10558. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  10559. this.ui.eftNode.visible = false;
  10560. }), 1, 0, 0, 0.9);
  10561. this.awardArr = arr;
  10562. this.showTriple = showTriple;
  10563. this.callback = callback;
  10564. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  10565. this.ui.myList.numItems = arr.length;
  10566. xGame.soundMgr.playSound("getaward");
  10567. }
  10568. updateSelf(index, obj) {
  10569. let temp = this.awardArr[index];
  10570. let icon = this.getIcon(temp.type);
  10571. let str = icon;
  10572. if (temp.type > 2) {
  10573. str = "s" + icon;
  10574. }
  10575. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  10576. obj.myIcon.rotation = 0;
  10577. obj.numTxt.text = temp.num + "";
  10578. obj.numTxt.visible = temp.type > 2 ? false : true;
  10579. obj.nameTxt.text = this.getNameStr(temp.type);
  10580. }
  10581. renderItem(index, obj) {
  10582. this.updateSelf(index, obj);
  10583. }
  10584. tripleGetAward() {
  10585. Moyu.showVideoAd(() => {
  10586. this.getAward(3);
  10587. }, EAdType.triple);
  10588. }
  10589. normalGetAward() {
  10590. if (PlatMgr.isMisVideo())
  10591. this.tripleGetAward();
  10592. else
  10593. this.getAward();
  10594. }
  10595. getAward(times = 1) {
  10596. this.hide();
  10597. for (let index = 0; index < this.awardArr.length; index++) {
  10598. this.awardArr[index].num *= times;
  10599. }
  10600. this.callback && this.callback(times != 1);
  10601. }
  10602. getIcon(type) {
  10603. switch (type) {
  10604. case Prop.diamond:
  10605. return "ty_zs";
  10606. case Prop.coin:
  10607. return "ty_jb";
  10608. case Prop.gan1:
  10609. return "qg1";
  10610. case Prop.gan2:
  10611. return "qg2";
  10612. case Prop.gan3:
  10613. return "qg3";
  10614. case Prop.gan4:
  10615. return "qg4";
  10616. default:
  10617. break;
  10618. }
  10619. }
  10620. getNameStr(type) {
  10621. switch (type) {
  10622. case Prop.diamond:
  10623. return "Diamond";
  10624. case Prop.coin:
  10625. return "Coins";
  10626. case Prop.gan1:
  10627. case Prop.gan2:
  10628. case Prop.gan3:
  10629. case Prop.gan4:
  10630. return cfgTable.ballrodData[type - 1].name;
  10631. default:
  10632. break;
  10633. }
  10634. }
  10635. }
  10636. UIGetAward.uiName = "UIGetAward";
  10637. class Common {
  10638. constructor() {
  10639. this.convertNum = 0.025;
  10640. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10641. this.scaleV3One = new Laya.Vector3();
  10642. this.scaleV3Two = new Laya.Vector3();
  10643. this.posV4 = new Laya.Vector4();
  10644. this.showDebug = false;
  10645. this.openGuide = true;
  10646. this.rodOffest = new Laya.Vector2(0, 0);
  10647. this.rodAngle = 0;
  10648. this.gameMode = GameMode.classic;
  10649. this.bigMoveLevelIndex = 1;
  10650. this.bigMoveNeedCoin = 1000;
  10651. this.classicNiceNeddCoin = 1000;
  10652. this.passAwardCoin = 2000;
  10653. this.classicRoomType = 1;
  10654. this.maxPower = 20;
  10655. this.natureMaxPower = 5;
  10656. this.videoPower = 2;
  10657. this.powerRecoverNum = 900;
  10658. this.curPlayerSkillType = 0;
  10659. this.isNewDay = false;
  10660. this.clickedBall = false;
  10661. this.placeBallCurLevel = 0;
  10662. this.placeBallStarNum = 0;
  10663. this.longHelpLine = false;
  10664. this.maxShareDiamondTimes = 3;
  10665. this.guideStep = 0;
  10666. this.temSelfLevel = 0;
  10667. this.extraMoveNum = 0;
  10668. this.curRankID = 0;
  10669. this.rankID = {
  10670. normalStar: 12000,
  10671. wxStar: 12001
  10672. };
  10673. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10674. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10675. this.btnClickStr = "buttonclick";
  10676. this.maxSkillLevel = 10;
  10677. this.upSkillLevel = false;
  10678. this.gameStartTime = 0;
  10679. this._sysOffestNum = 0;
  10680. this.angleV2 = new Laya.Vector2();
  10681. this.rootV = new Laya.Vector2(0, 1);
  10682. this.tempDir1 = new Laya.Vector2();
  10683. this.tempDir2 = new Laya.Vector2();
  10684. this.ballSize = 33;
  10685. this.stPos = new Laya.Point();
  10686. this.edPos = new Laya.Point();
  10687. Common._instance = this;
  10688. window["common"] = this;
  10689. }
  10690. static getInstance() {
  10691. if (!this._instance) {
  10692. this._instance = new Common();
  10693. }
  10694. return this._instance;
  10695. }
  10696. get sysOffestNum() {
  10697. if (this._sysOffestNum == 0) {
  10698. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10699. }
  10700. return this._sysOffestNum;
  10701. }
  10702. testShader() {
  10703. let test = new LightShader();
  10704. test.texture = "res/d3Res/ballTexture/ball1.png";
  10705. Laya.stage.addChild(test);
  10706. }
  10707. playScale(node) {
  10708. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10709. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10710. }));
  10711. }));
  10712. }
  10713. setGroup(colli, ...group) {
  10714. let out = 0;
  10715. for (let index = 0; index < group.length; index++) {
  10716. if (index == 0) {
  10717. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10718. }
  10719. else {
  10720. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10721. }
  10722. }
  10723. colli.collisionGroup = out;
  10724. }
  10725. setCanGroupWith(colli, ...group) {
  10726. let out = 0;
  10727. for (let index = 0; index < group.length; index++) {
  10728. if (index == 0) {
  10729. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10730. }
  10731. else {
  10732. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10733. }
  10734. }
  10735. colli.canCollideWith = out;
  10736. }
  10737. loadPrefab(name, callback) {
  10738. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10739. let prefab = new Laya.Prefab();
  10740. prefab.json = obj;
  10741. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10742. callback && callback(img);
  10743. }));
  10744. }
  10745. pos2to3Convert(x, y, d3Pos) {
  10746. x = x + this.sysOffestNum;
  10747. d3Pos.setValue(x, y, 0);
  10748. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10749. if (success) {
  10750. }
  10751. else {
  10752. console.error("转换出错了。。。。。。。。");
  10753. }
  10754. }
  10755. scale2to3Convert(num) {
  10756. this.scaleV3One.setValue(0, 0, 0);
  10757. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10758. this.scaleV3Two.setValue(0, num, 0);
  10759. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10760. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10761. return outNum;
  10762. }
  10763. pos3to2Convert(d3Pos) {
  10764. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10765. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10766. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10767. d3Pos.x -= this.sysOffestNum;
  10768. }
  10769. scale3to2Convert(num) {
  10770. let scale = this.scale2to3Convert(1);
  10771. let d2Out = num / scale;
  10772. return d2Out;
  10773. }
  10774. getCollider(type, restitution = 0.9, density = 10) {
  10775. let colli;
  10776. if (type == "box")
  10777. colli = new Laya.BoxCollider();
  10778. else
  10779. colli = new Laya.CircleCollider();
  10780. colli.friction = 0;
  10781. colli.restitution = restitution;
  10782. colli.density = density;
  10783. return colli;
  10784. }
  10785. getRigbody() {
  10786. let rigy = new Laya.RigidBody();
  10787. rigy.bullet = true;
  10788. rigy.allowRotation = false;
  10789. rigy.allowSleep = false;
  10790. rigy.gravityScale = 0;
  10791. return rigy;
  10792. }
  10793. getfguiRotation(x, y) {
  10794. this.angleV2.setValue(x, y);
  10795. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10796. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10797. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10798. angle = -angle;
  10799. }
  10800. return 180 + angle;
  10801. }
  10802. getAngle(x, y) {
  10803. this.angleV2.setValue(x, y);
  10804. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10805. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10806. return angle;
  10807. }
  10808. randomNum(a, b) {
  10809. return a + Math.floor((b - a + 1) * Math.random());
  10810. }
  10811. getRandArrEle(arr) {
  10812. return arr[Math.floor(arr.length * Math.random())];
  10813. }
  10814. getSign(val) {
  10815. return val >= 0 ? 1 : -1;
  10816. }
  10817. botherArr(arr) {
  10818. let times = arr.length + 2;
  10819. let length = arr.length;
  10820. let a;
  10821. let b;
  10822. let temp;
  10823. for (let index = 0; index < times; index++) {
  10824. a = Math.floor(Math.random() * length);
  10825. b = Math.floor(Math.random() * length);
  10826. temp = arr[a];
  10827. arr[a] = arr[b];
  10828. arr[b] = temp;
  10829. }
  10830. }
  10831. getGameIconUrl(id) {
  10832. return "ui://game/" + id;
  10833. }
  10834. getComponentUrl(id) {
  10835. return "ui://game/" + id;
  10836. }
  10837. getAnimation() {
  10838. }
  10839. judgeSkillType(type = SkillType.highSpace) {
  10840. if (this.gameMode == GameMode.classic)
  10841. return;
  10842. let gameMgr = this.gameMgr;
  10843. if (gameMgr.selfTurn) {
  10844. if (gameMgr.selfCurSkill == type) {
  10845. return true;
  10846. }
  10847. }
  10848. else {
  10849. if (gameMgr.aiCurSkill == type) {
  10850. return true;
  10851. }
  10852. }
  10853. }
  10854. ballColliHole(collider) {
  10855. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  10856. xGame.common.gameMgr.isFirstInGame = false;
  10857. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  10858. }
  10859. collider.owner.mySrc.checkWrongBall();
  10860. }
  10861. getArrMaxEle(arr) {
  10862. let max = -Infinity;
  10863. for (let index = 0; index < arr.length; index++) {
  10864. max = Math.max(arr[index], max);
  10865. }
  10866. return max;
  10867. }
  10868. getArrMinEle(arr) {
  10869. let min = Infinity;
  10870. for (let index = 0; index < arr.length; index++) {
  10871. min = Math.min(arr[index], min);
  10872. }
  10873. return min;
  10874. }
  10875. playRandomMutiBallBigSkillSound() {
  10876. if (Math.random() <= 0.5)
  10877. return;
  10878. let rand = this.randomNum(1, 6);
  10879. let str = "ganfa0" + rand;
  10880. xGame.soundMgr.playSound(str);
  10881. }
  10882. showOneCamera(type) {
  10883. let object = xGame.common.d3World.cameraObj;
  10884. for (const key in object) {
  10885. if (Object.prototype.hasOwnProperty.call(object, key)) {
  10886. object[key].init();
  10887. object[key].owner.active = key == type;
  10888. }
  10889. }
  10890. }
  10891. checkBallOverBorder(x, y) {
  10892. let radius = 17;
  10893. let condition = this._checkBorder(x + radius, y) ||
  10894. this._checkBorder(x - radius, y) ||
  10895. this._checkBorder(x, y + radius) ||
  10896. this._checkBorder(x, y - radius);
  10897. if (condition) {
  10898. return true;
  10899. }
  10900. }
  10901. _checkBorder(x, y) {
  10902. let borderRect = this.d2World.borderRect;
  10903. let xOffest = 20;
  10904. let yOffest = 20;
  10905. if (y <= borderRect.y - yOffest) {
  10906. return true;
  10907. }
  10908. if (y >= borderRect.y + borderRect.height + yOffest) {
  10909. return true;
  10910. }
  10911. if (x <= borderRect.x - xOffest) {
  10912. return true;
  10913. }
  10914. if (x >= borderRect.x + borderRect.width + xOffest) {
  10915. return true;
  10916. }
  10917. }
  10918. initWeight(cfg) {
  10919. let allCfgData = { data: {}, allWeightNum: 0 };
  10920. let weightCfg = allCfgData.data;
  10921. let weight = 0;
  10922. for (const key in cfg) {
  10923. weightCfg[key] = {};
  10924. weightCfg[key].id = cfg[key].id;
  10925. weightCfg[key].minWeight = weight;
  10926. weight += cfg[key].weight;
  10927. weightCfg[key].maxWeight = weight;
  10928. }
  10929. allCfgData.allWeightNum = weight;
  10930. return allCfgData;
  10931. }
  10932. getRandomWeightData(cfg) {
  10933. let weightCfg = cfg.data;
  10934. let allWeightNum = cfg.allWeightNum;
  10935. let rand = Math.floor(Math.random() * allWeightNum);
  10936. for (const key in weightCfg) {
  10937. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  10938. return weightCfg[key];
  10939. }
  10940. }
  10941. return weightCfg[1];
  10942. }
  10943. showGirlTalkPop(wordsIndex, node, msgNode) {
  10944. node.visible = true;
  10945. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  10946. node.t0.play(Laya.Handler.create(this, () => {
  10947. node.visible = false;
  10948. }));
  10949. }
  10950. stopGirlPop(node) {
  10951. node.t0.stop();
  10952. node.visible = false;
  10953. }
  10954. createHead(loader, url, size = 107) {
  10955. if (Laya.Browser.name == "Browser") {
  10956. loader.url = url;
  10957. return;
  10958. }
  10959. if (Moyu.isTT) {
  10960. let localImage = new Image();
  10961. localImage.src = url;
  10962. localImage.onload = () => {
  10963. let t2d = new Laya.Texture2D();
  10964. t2d.width = size;
  10965. t2d.height = size;
  10966. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  10967. t2d.loadImageSource(localImage);
  10968. };
  10969. }
  10970. else {
  10971. console.log('zh:url=', url);
  10972. loader.url = url;
  10973. }
  10974. }
  10975. addTestCoin(num) {
  10976. DataMgr.setCoin(num);
  10977. }
  10978. addTestDiamond(num) {
  10979. DataMgr.setDiamond(num);
  10980. }
  10981. addTestSkill() {
  10982. DataMgr.setBigSkill(0, 99);
  10983. DataMgr.setBigSkill(1, 99);
  10984. DataMgr.setBigSkill(2, 99);
  10985. }
  10986. playClassicEmotion(number, x, y) {
  10987. if (this.gameMode == GameMode.bigMove)
  10988. return;
  10989. let randIndex = this.randomNum(0, 2);
  10990. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  10991. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  10992. if (this.gameMgr.selfTurn) {
  10993. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  10994. this.classicEmotionSpine.play(data, randIndex, false, parent);
  10995. }
  10996. else {
  10997. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  10998. }
  10999. else {
  11000. if (number == this.gameMgr.blackNum) {
  11001. if (this.gameMgr.selfBallArr.length == 0) {
  11002. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11003. }
  11004. else {
  11005. }
  11006. }
  11007. else {
  11008. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11009. }
  11010. }
  11011. }
  11012. }
  11013. else {
  11014. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11015. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11016. }
  11017. else {
  11018. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11019. }
  11020. else {
  11021. if (number == this.gameMgr.blackNum) {
  11022. if (this.gameMgr.aiBallArr.length == 0) {
  11023. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11024. }
  11025. else {
  11026. }
  11027. }
  11028. else {
  11029. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11030. }
  11031. }
  11032. }
  11033. }
  11034. }
  11035. playHappySound(number) {
  11036. if (this.gameMode != GameMode.classic)
  11037. return;
  11038. if (number == 8)
  11039. return;
  11040. let play = false;
  11041. if (this.gameMgr.selfTurn) {
  11042. if (this.gameMgr.ensureBallType) {
  11043. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11044. play = true;
  11045. }
  11046. }
  11047. else {
  11048. play = true;
  11049. }
  11050. }
  11051. else {
  11052. if (this.gameMgr.ensureBallType) {
  11053. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11054. play = true;
  11055. }
  11056. }
  11057. else {
  11058. play = true;
  11059. }
  11060. }
  11061. if (play)
  11062. xGame.soundMgr.playSound("applause");
  11063. }
  11064. destroyClassicEmotion() {
  11065. if (this.gameMode == GameMode.bigMove)
  11066. return;
  11067. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11068. parent.destroyChildren();
  11069. }
  11070. playAwardSpine(x, y) {
  11071. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11072. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11073. this.awardSpine.play(data, 0, false, parent);
  11074. }
  11075. destroyAwardSpine() {
  11076. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11077. parent.destroyChildren();
  11078. }
  11079. isBlock(bx, by, hx, hy, except = null) {
  11080. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11081. let balls = xGame.common.d2World.ballArr;
  11082. let outArr = [];
  11083. for (let index = 0; index < balls.length; index++) {
  11084. let obj = balls[index];
  11085. if (obj.number == 0)
  11086. continue;
  11087. if (obj == except)
  11088. continue;
  11089. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11090. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11091. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11092. if (num >= 1)
  11093. num = 1;
  11094. if (num < 0)
  11095. continue;
  11096. let gap = Math.sin(Math.acos(num)) * dis;
  11097. if (gap < this.ballSize) {
  11098. outArr.push({
  11099. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11100. disHon: Math.cos(Math.acos(num)) * dis,
  11101. disVer: Math.sin(Math.acos(num)) * dis,
  11102. src: balls[index],
  11103. dir: this.tempDir1
  11104. });
  11105. }
  11106. }
  11107. if (outArr.length > 0) {
  11108. outArr.sort((a, b) => { return a.dis - b.dis; });
  11109. return outArr[0];
  11110. }
  11111. }
  11112. AngleBetween(vector1, vector2) {
  11113. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11114. return rad * (180 / Math.PI);
  11115. }
  11116. getSecretaryScale() {
  11117. if (this.secretary.spineName == "mishu") {
  11118. return 1.28;
  11119. }
  11120. else {
  11121. return 1.024;
  11122. }
  11123. }
  11124. signAwardContainsRod(arr) {
  11125. let temp;
  11126. for (let index = 0; index < arr.length; index++) {
  11127. temp = arr[index].split('-')[0];
  11128. if (parseInt(temp) > 2) {
  11129. return true;
  11130. }
  11131. }
  11132. }
  11133. judgeSameDay() {
  11134. let lastTime = DataMgr.getSignTime();
  11135. let curTime = new Date().getTime();
  11136. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11137. return true;
  11138. }
  11139. return false;
  11140. }
  11141. getAward(arr, callback) {
  11142. let showTriple = arr[0].type <= 2;
  11143. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11144. let temp;
  11145. for (let index = 0; index < arr.length; index++) {
  11146. temp = arr[index];
  11147. switch (temp.type) {
  11148. case 1:
  11149. this.playObjFlyAnim(temp.num, temp.type);
  11150. break;
  11151. case 2:
  11152. this.playObjFlyAnim(temp.num, temp.type);
  11153. break;
  11154. case 3:
  11155. case 4:
  11156. case 5:
  11157. case 6:
  11158. DataMgr.setBallRod(temp.type - 2, 1);
  11159. DataMgr.setCurBallRod(temp.type - 2);
  11160. break;
  11161. default:
  11162. break;
  11163. }
  11164. }
  11165. callback && callback(watchVideo);
  11166. });
  11167. }
  11168. getMoneyNode() {
  11169. let moneyNode;
  11170. let sign = xGame.uiMgr.getUI(UISign);
  11171. let draw = xGame.uiMgr.getUI(UIDraw);
  11172. let end = xGame.uiMgr.getUI(UIGameEnd);
  11173. let skill = xGame.uiMgr.getUI(UISkill);
  11174. if (sign && !sign.isHide)
  11175. moneyNode = sign.ui.moneyNode;
  11176. if (draw && !draw.isHide)
  11177. moneyNode = draw.ui.moneyNode;
  11178. if (end && !end.isHide)
  11179. moneyNode = end.ui.moneyNode;
  11180. if (skill && !skill.isHide)
  11181. moneyNode = skill.ui.moneyNode;
  11182. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11183. let main = xGame.uiMgr.getUI(UIMain);
  11184. if (condition1 && main && !main.isHide) {
  11185. moneyNode = main.ui.moneyNode;
  11186. }
  11187. return moneyNode;
  11188. }
  11189. playObjFlyAnim(num, type, callback = null) {
  11190. this.stPos.x = Laya.stage.width / 2;
  11191. this.stPos.y = Laya.stage.height / 2;
  11192. let moneyNode = this.getMoneyNode();
  11193. switch (type) {
  11194. case Prop.diamond:
  11195. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11196. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11197. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11198. this.edPos.x /= 2;
  11199. this.edPos.y /= 2;
  11200. break;
  11201. case Prop.coin:
  11202. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11203. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11204. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11205. this.edPos.x /= 2;
  11206. this.edPos.y /= 2;
  11207. break;
  11208. default:
  11209. break;
  11210. }
  11211. xGame.soundMgr.playSound("coinbag");
  11212. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11213. switch (type) {
  11214. case Prop.diamond:
  11215. DataMgr.setDiamond(num);
  11216. break;
  11217. case Prop.coin:
  11218. DataMgr.setCoin(num);
  11219. break;
  11220. default:
  11221. break;
  11222. }
  11223. callback && callback();
  11224. });
  11225. }
  11226. autoPopUIView() {
  11227. let arr = [];
  11228. let sign = this.judgeSameDay() ? false : true;
  11229. if (sign)
  11230. arr.push("sign");
  11231. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11232. if (draw)
  11233. arr.push("draw");
  11234. if (arr.length <= 0)
  11235. return;
  11236. let str = this.getRandArrEle(arr);
  11237. switch (str) {
  11238. case "sign":
  11239. xGame.uiMgr.Show(UISign);
  11240. break;
  11241. case "draw":
  11242. xGame.uiMgr.Show(UIDraw);
  11243. break;
  11244. default:
  11245. break;
  11246. }
  11247. }
  11248. getMSTime(time) {
  11249. let min = Math.floor(time / 60);
  11250. let sec = Math.floor((time - min * 60));
  11251. if (sec < 10)
  11252. sec = "0" + sec;
  11253. if (min < 10)
  11254. min = "0" + min;
  11255. return `${min}:${sec}`;
  11256. }
  11257. testPower() {
  11258. DataMgr.setPower(0, false);
  11259. }
  11260. getAllStarNum() {
  11261. let data = DataMgr.getPlaceBallLevelList();
  11262. let out = 0;
  11263. for (let index = 0; index < data.length; index++) {
  11264. out += data[index].star;
  11265. }
  11266. return out;
  11267. }
  11268. recoverCameraView() {
  11269. Laya.timer.once(900, this, () => {
  11270. xGame.common.showOneCamera("mainCamera");
  11271. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11272. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11273. xGame.common.gameUI.ui.border.alpha = 0;
  11274. if (Laya.physicsTimer.scale < 1) {
  11275. Laya.physicsTimer.scale = 1;
  11276. }
  11277. }
  11278. });
  11279. }
  11280. getClassicLevel() {
  11281. let successTimes = DataMgr.getClassicTimes();
  11282. let needKey = "";
  11283. let lastKey = "";
  11284. let cfg = cfgTable.classictimesData;
  11285. let data;
  11286. for (const key in cfg) {
  11287. data = cfg[key];
  11288. if (successTimes <= data.times) {
  11289. needKey = key;
  11290. }
  11291. lastKey = key;
  11292. }
  11293. if (needKey == "")
  11294. needKey = lastKey;
  11295. return cfg[needKey];
  11296. }
  11297. }
  11298. Common._instance = null;
  11299. class ui_Component92 extends fgui.GComponent {
  11300. static createInstance() {
  11301. return (fgui.UIPackage.createObject("game", "Component92"));
  11302. }
  11303. onConstruct() {
  11304. this.n0 = (this.getChild("n0"));
  11305. }
  11306. }
  11307. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11308. class ui_Component129 extends fgui.GProgressBar {
  11309. static createInstance() {
  11310. return (fgui.UIPackage.createObject("game", "Component129"));
  11311. }
  11312. onConstruct() {
  11313. this.bar_v = (this.getChild("bar_v"));
  11314. this.n84 = (this.getChild("n84"));
  11315. }
  11316. }
  11317. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11318. class ui_Component130 extends fgui.GComponent {
  11319. static createInstance() {
  11320. return (fgui.UIPackage.createObject("game", "Component130"));
  11321. }
  11322. onConstruct() {
  11323. this.ani = (this.getChild("ani"));
  11324. this.t0 = this.getTransition("t0");
  11325. }
  11326. }
  11327. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11328. class ui_powerEft extends fgui.GComponent {
  11329. static createInstance() {
  11330. return (fgui.UIPackage.createObject("game", "powerEft"));
  11331. }
  11332. onConstruct() {
  11333. this.ani = (this.getChild("ani"));
  11334. this.n88 = (this.getChild("n88"));
  11335. this.n89 = (this.getChild("n89"));
  11336. }
  11337. }
  11338. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11339. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11340. static createInstance() {
  11341. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11342. }
  11343. onConstruct() {
  11344. this.c1 = this.getController("c1");
  11345. this.n2 = (this.getChild("n2"));
  11346. this.n22 = (this.getChild("n22"));
  11347. this.n23 = (this.getChild("n23"));
  11348. this.n15 = (this.getChild("n15"));
  11349. this.challenge = (this.getChild("challenge"));
  11350. this.n17 = (this.getChild("n17"));
  11351. this.n3 = (this.getChild("n3"));
  11352. this.starNode = (this.getChild("starNode"));
  11353. this.levelTxt = (this.getChild("levelTxt"));
  11354. this.n14 = (this.getChild("n14"));
  11355. this.n19 = (this.getChild("n19"));
  11356. this.n20 = (this.getChild("n20"));
  11357. this.n21 = (this.getChild("n21"));
  11358. this.special = (this.getChild("special"));
  11359. }
  11360. }
  11361. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11362. class ui_Component79 extends fgui.GComponent {
  11363. static createInstance() {
  11364. return (fgui.UIPackage.createObject("game", "Component79"));
  11365. }
  11366. onConstruct() {
  11367. this.c1 = this.getController("c1");
  11368. this.n7 = (this.getChild("n7"));
  11369. this.n8 = (this.getChild("n8"));
  11370. this.n9 = (this.getChild("n9"));
  11371. this.n10 = (this.getChild("n10"));
  11372. this.n11 = (this.getChild("n11"));
  11373. this.n12 = (this.getChild("n12"));
  11374. }
  11375. }
  11376. ui_Component79.URL = "ui://isxx5ak7avag477";
  11377. class ui_Component80 extends fgui.GComponent {
  11378. static createInstance() {
  11379. return (fgui.UIPackage.createObject("game", "Component80"));
  11380. }
  11381. onConstruct() {
  11382. this.n0 = (this.getChild("n0"));
  11383. this.n1 = (this.getChild("n1"));
  11384. this.myList = (this.getChild("myList"));
  11385. this.t0 = this.getTransition("t0");
  11386. }
  11387. }
  11388. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11389. class ui_SignNormal extends fgui.GComponent {
  11390. static createInstance() {
  11391. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11392. }
  11393. onConstruct() {
  11394. this.c1 = this.getController("c1");
  11395. this.n7 = (this.getChild("n7"));
  11396. this.n15 = (this.getChild("n15"));
  11397. this.titleTxt = (this.getChild("titleTxt"));
  11398. this.n8 = (this.getChild("n8"));
  11399. this.myIcon = (this.getChild("myIcon"));
  11400. this.numTxt = (this.getChild("numTxt"));
  11401. this.n12 = (this.getChild("n12"));
  11402. this.n13 = (this.getChild("n13"));
  11403. this.n17 = (this.getChild("n17"));
  11404. this.n14 = (this.getChild("n14"));
  11405. }
  11406. }
  11407. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11408. class ui_screenNode extends fgui.GComponent {
  11409. static createInstance() {
  11410. return (fgui.UIPackage.createObject("game", "screenNode"));
  11411. }
  11412. onConstruct() {
  11413. this.n9 = (this.getChild("n9"));
  11414. this.screenImg = (this.getChild("screenImg"));
  11415. }
  11416. }
  11417. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11418. class ui_GetAwrad_com1 extends fgui.GComponent {
  11419. static createInstance() {
  11420. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11421. }
  11422. onConstruct() {
  11423. this.n38 = (this.getChild("n38"));
  11424. this.n39 = (this.getChild("n39"));
  11425. this.n40 = (this.getChild("n40"));
  11426. this.t0 = this.getTransition("t0");
  11427. this.t1 = this.getTransition("t1");
  11428. }
  11429. }
  11430. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11431. class ui_GetAwrad_com2 extends fgui.GComponent {
  11432. static createInstance() {
  11433. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11434. }
  11435. onConstruct() {
  11436. this.n39 = (this.getChild("n39"));
  11437. this.n40 = (this.getChild("n40"));
  11438. this.t0 = this.getTransition("t0");
  11439. }
  11440. }
  11441. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11442. class ui_Component128 extends fgui.GComponent {
  11443. static createInstance() {
  11444. return (fgui.UIPackage.createObject("game", "Component128"));
  11445. }
  11446. onConstruct() {
  11447. this.n38 = (this.getChild("n38"));
  11448. this.n40 = (this.getChild("n40"));
  11449. }
  11450. }
  11451. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11452. class ui_Component100_1 extends fgui.GComponent {
  11453. static createInstance() {
  11454. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11455. }
  11456. onConstruct() {
  11457. this.myNode = (this.getChild("myNode"));
  11458. this.t0 = this.getTransition("t0");
  11459. }
  11460. }
  11461. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11462. class ui_Component142 extends fgui.GComponent {
  11463. static createInstance() {
  11464. return (fgui.UIPackage.createObject("game", "Component142"));
  11465. }
  11466. onConstruct() {
  11467. this.n41 = (this.getChild("n41"));
  11468. this.n42 = (this.getChild("n42"));
  11469. }
  11470. }
  11471. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11472. class ui_main_guang extends fgui.GComponent {
  11473. static createInstance() {
  11474. return (fgui.UIPackage.createObject("game", "main_guang"));
  11475. }
  11476. onConstruct() {
  11477. this.n1 = (this.getChild("n1"));
  11478. this.n2 = (this.getChild("n2"));
  11479. this.n3 = (this.getChild("n3"));
  11480. this.n4 = (this.getChild("n4"));
  11481. this.n5 = (this.getChild("n5"));
  11482. this.n6 = (this.getChild("n6"));
  11483. this.n8 = (this.getChild("n8"));
  11484. this.t0 = this.getTransition("t0");
  11485. }
  11486. }
  11487. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11488. class ui_try_com1 extends fgui.GComponent {
  11489. static createInstance() {
  11490. return (fgui.UIPackage.createObject("game", "try_com1"));
  11491. }
  11492. onConstruct() {
  11493. this.c1 = this.getController("c1");
  11494. this.n0 = (this.getChild("n0"));
  11495. this.n2 = (this.getChild("n2"));
  11496. this.cancelBtn = (this.getChild("cancelBtn"));
  11497. this.videoBtn = (this.getChild("videoBtn"));
  11498. this.n9 = (this.getChild("n9"));
  11499. this.n24 = (this.getChild("n24"));
  11500. this.titleTxt = (this.getChild("titleTxt"));
  11501. this.n32 = (this.getChild("n32"));
  11502. this.n29 = (this.getChild("n29"));
  11503. this.n36 = (this.getChild("n36"));
  11504. this.txtTime = (this.getChild("txtTime"));
  11505. this.t0 = this.getTransition("t0");
  11506. }
  11507. }
  11508. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11509. class ui_try_com2 extends fgui.GComponent {
  11510. static createInstance() {
  11511. return (fgui.UIPackage.createObject("game", "try_com2"));
  11512. }
  11513. onConstruct() {
  11514. this.skillicon = (this.getChild("skillicon"));
  11515. this.n35 = (this.getChild("n35"));
  11516. this.n31 = (this.getChild("n31"));
  11517. this.n32 = (this.getChild("n32"));
  11518. this.n33 = (this.getChild("n33"));
  11519. this.n34 = (this.getChild("n34"));
  11520. }
  11521. }
  11522. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11523. class ui_try_com3 extends fgui.GComponent {
  11524. static createInstance() {
  11525. return (fgui.UIPackage.createObject("game", "try_com3"));
  11526. }
  11527. onConstruct() {
  11528. this.n33 = (this.getChild("n33"));
  11529. this.n34 = (this.getChild("n34"));
  11530. this.n35 = (this.getChild("n35"));
  11531. this.t0 = this.getTransition("t0");
  11532. }
  11533. }
  11534. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11535. class ui_huihe1 extends fgui.GComponent {
  11536. static createInstance() {
  11537. return (fgui.UIPackage.createObject("game", "huihe1"));
  11538. }
  11539. onConstruct() {
  11540. this.n0 = (this.getChild("n0"));
  11541. this.n1 = (this.getChild("n1"));
  11542. this.t0 = this.getTransition("t0");
  11543. }
  11544. }
  11545. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11546. class ui_huihe2 extends fgui.GComponent {
  11547. static createInstance() {
  11548. return (fgui.UIPackage.createObject("game", "huihe2"));
  11549. }
  11550. onConstruct() {
  11551. this.n0 = (this.getChild("n0"));
  11552. this.n1 = (this.getChild("n1"));
  11553. this.t0 = this.getTransition("t0");
  11554. }
  11555. }
  11556. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11557. class ui_Component143 extends fgui.GComponent {
  11558. static createInstance() {
  11559. return (fgui.UIPackage.createObject("game", "Component143"));
  11560. }
  11561. onConstruct() {
  11562. this.n3 = (this.getChild("n3"));
  11563. this.n4 = (this.getChild("n4"));
  11564. this.n5 = (this.getChild("n5"));
  11565. this.n6 = (this.getChild("n6"));
  11566. this.n7 = (this.getChild("n7"));
  11567. this.n8 = (this.getChild("n8"));
  11568. this.n9 = (this.getChild("n9"));
  11569. this.n10 = (this.getChild("n10"));
  11570. this.t0 = this.getTransition("t0");
  11571. }
  11572. }
  11573. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11574. class ui_dh_jingbi2 extends fgui.GComponent {
  11575. static createInstance() {
  11576. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11577. }
  11578. onConstruct() {
  11579. this.n0 = (this.getChild("n0"));
  11580. this.n1 = (this.getChild("n1"));
  11581. this.n2 = (this.getChild("n2"));
  11582. this.n3 = (this.getChild("n3"));
  11583. this.n4 = (this.getChild("n4"));
  11584. this.n5 = (this.getChild("n5"));
  11585. this.n6 = (this.getChild("n6"));
  11586. this.n8 = (this.getChild("n8"));
  11587. this.n10 = (this.getChild("n10"));
  11588. this.t0 = this.getTransition("t0");
  11589. }
  11590. }
  11591. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11592. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11593. static createInstance() {
  11594. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11595. }
  11596. onConstruct() {
  11597. this.n1 = (this.getChild("n1"));
  11598. this.n4 = (this.getChild("n4"));
  11599. this.t0 = this.getTransition("t0");
  11600. }
  11601. }
  11602. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11603. class ui_dh_jingbi3 extends fgui.GComponent {
  11604. static createInstance() {
  11605. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11606. }
  11607. onConstruct() {
  11608. this.n0 = (this.getChild("n0"));
  11609. this.n1 = (this.getChild("n1"));
  11610. this.n2 = (this.getChild("n2"));
  11611. this.n3 = (this.getChild("n3"));
  11612. this.n4 = (this.getChild("n4"));
  11613. this.n5 = (this.getChild("n5"));
  11614. this.n6 = (this.getChild("n6"));
  11615. this.n8 = (this.getChild("n8"));
  11616. this.n10 = (this.getChild("n10"));
  11617. this.t0 = this.getTransition("t0");
  11618. }
  11619. }
  11620. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11621. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11622. static createInstance() {
  11623. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11624. }
  11625. onConstruct() {
  11626. this.n3 = (this.getChild("n3"));
  11627. this.n1 = (this.getChild("n1"));
  11628. this.t0 = this.getTransition("t0");
  11629. }
  11630. }
  11631. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11632. class ui_hb_jinbi1 extends fgui.GButton {
  11633. static createInstance() {
  11634. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11635. }
  11636. onConstruct() {
  11637. this.n20 = (this.getChild("n20"));
  11638. this.n25 = (this.getChild("n25"));
  11639. this.coinTxt = (this.getChild("coinTxt"));
  11640. this.n28 = (this.getChild("n28"));
  11641. this.n32 = (this.getChild("n32"));
  11642. this.n38 = (this.getChild("n38"));
  11643. this.n45 = (this.getChild("n45"));
  11644. this.getTips = (this.getChild("getTips"));
  11645. this.n39 = (this.getChild("n39"));
  11646. this.diamondTxt = (this.getChild("diamondTxt"));
  11647. this.n41 = (this.getChild("n41"));
  11648. this.n42 = (this.getChild("n42"));
  11649. this.n46 = (this.getChild("n46"));
  11650. this.n47 = (this.getChild("n47"));
  11651. this.n48 = (this.getChild("n48"));
  11652. this.t0 = this.getTransition("t0");
  11653. }
  11654. }
  11655. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11656. class ui_hb_jinbi2 extends fgui.GButton {
  11657. static createInstance() {
  11658. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11659. }
  11660. onConstruct() {
  11661. this.n20 = (this.getChild("n20"));
  11662. this.n25 = (this.getChild("n25"));
  11663. this.coinTxt = (this.getChild("coinTxt"));
  11664. this.n28 = (this.getChild("n28"));
  11665. this.n32 = (this.getChild("n32"));
  11666. this.n38 = (this.getChild("n38"));
  11667. this.n39 = (this.getChild("n39"));
  11668. this.diamondTxt = (this.getChild("diamondTxt"));
  11669. this.n41 = (this.getChild("n41"));
  11670. this.n42 = (this.getChild("n42"));
  11671. this.n43 = (this.getChild("n43"));
  11672. this.n44 = (this.getChild("n44"));
  11673. this.n45 = (this.getChild("n45"));
  11674. this.t0 = this.getTransition("t0");
  11675. }
  11676. }
  11677. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11678. class ui_hb_jinbi3 extends fgui.GButton {
  11679. static createInstance() {
  11680. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11681. }
  11682. onConstruct() {
  11683. this.n20 = (this.getChild("n20"));
  11684. this.n25 = (this.getChild("n25"));
  11685. this.coinTxt = (this.getChild("coinTxt"));
  11686. this.n28 = (this.getChild("n28"));
  11687. this.n32 = (this.getChild("n32"));
  11688. this.n38 = (this.getChild("n38"));
  11689. this.n39 = (this.getChild("n39"));
  11690. this.diamondTxt = (this.getChild("diamondTxt"));
  11691. this.n41 = (this.getChild("n41"));
  11692. this.n42 = (this.getChild("n42"));
  11693. this.n43 = (this.getChild("n43"));
  11694. this.n44 = (this.getChild("n44"));
  11695. this.n45 = (this.getChild("n45"));
  11696. this.t0 = this.getTransition("t0");
  11697. }
  11698. }
  11699. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11700. class ui_Component104 extends fgui.GComponent {
  11701. static createInstance() {
  11702. return (fgui.UIPackage.createObject("game", "Component104"));
  11703. }
  11704. onConstruct() {
  11705. this.c1 = this.getController("c1");
  11706. this.n12 = (this.getChild("n12"));
  11707. this.coinBtn = (this.getChild("coinBtn"));
  11708. this.diamondBtn = (this.getChild("diamondBtn"));
  11709. this.node3 = (this.getChild("node3"));
  11710. this.node4 = (this.getChild("node4"));
  11711. this.node5 = (this.getChild("node5"));
  11712. this.node1 = (this.getChild("node1"));
  11713. this.node2 = (this.getChild("node2"));
  11714. this.node6 = (this.getChild("node6"));
  11715. this.t0 = this.getTransition("t0");
  11716. }
  11717. }
  11718. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11719. class ui_Component105 extends fgui.GButton {
  11720. static createInstance() {
  11721. return (fgui.UIPackage.createObject("game", "Component105"));
  11722. }
  11723. onConstruct() {
  11724. this.c1 = this.getController("c1");
  11725. this.n49 = (this.getChild("n49"));
  11726. this.n18 = (this.getChild("n18"));
  11727. this.n46 = (this.getChild("n46"));
  11728. this.n48 = (this.getChild("n48"));
  11729. }
  11730. }
  11731. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11732. class ui_Component106 extends fgui.GButton {
  11733. static createInstance() {
  11734. return (fgui.UIPackage.createObject("game", "Component106"));
  11735. }
  11736. onConstruct() {
  11737. this.c1 = this.getController("c1");
  11738. this.n49 = (this.getChild("n49"));
  11739. this.n18 = (this.getChild("n18"));
  11740. this.n46 = (this.getChild("n46"));
  11741. this.n48 = (this.getChild("n48"));
  11742. }
  11743. }
  11744. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11745. class ui_hb_zs1 extends fgui.GButton {
  11746. static createInstance() {
  11747. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11748. }
  11749. onConstruct() {
  11750. this.c1 = this.getController("c1");
  11751. this.n20 = (this.getChild("n20"));
  11752. this.n21 = (this.getChild("n21"));
  11753. this.n26 = (this.getChild("n26"));
  11754. this.n27 = (this.getChild("n27"));
  11755. this.shareTxt = (this.getChild("shareTxt"));
  11756. this.n32 = (this.getChild("n32"));
  11757. this.n38 = (this.getChild("n38"));
  11758. this.n39 = (this.getChild("n39"));
  11759. this.n44 = (this.getChild("n44"));
  11760. this.diamondTxt = (this.getChild("diamondTxt"));
  11761. this.n41 = (this.getChild("n41"));
  11762. this.n45 = (this.getChild("n45"));
  11763. this.n47 = (this.getChild("n47"));
  11764. this.n48 = (this.getChild("n48"));
  11765. this.randTxt = (this.getChild("randTxt"));
  11766. this.n50 = (this.getChild("n50"));
  11767. this.t0 = this.getTransition("t0");
  11768. }
  11769. }
  11770. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11771. class ui_dh_zs1 extends fgui.GComponent {
  11772. static createInstance() {
  11773. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11774. }
  11775. onConstruct() {
  11776. this.n10 = (this.getChild("n10"));
  11777. this.n9 = (this.getChild("n9"));
  11778. this.n1 = (this.getChild("n1"));
  11779. this.n2 = (this.getChild("n2"));
  11780. this.n3 = (this.getChild("n3"));
  11781. this.n4 = (this.getChild("n4"));
  11782. this.n5 = (this.getChild("n5"));
  11783. this.n6 = (this.getChild("n6"));
  11784. this.n8 = (this.getChild("n8"));
  11785. this.n11 = (this.getChild("n11"));
  11786. this.t0 = this.getTransition("t0");
  11787. }
  11788. }
  11789. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11790. class ui_dh_zs1_1 extends fgui.GComponent {
  11791. static createInstance() {
  11792. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11793. }
  11794. onConstruct() {
  11795. this.n3 = (this.getChild("n3"));
  11796. this.n1 = (this.getChild("n1"));
  11797. this.t0 = this.getTransition("t0");
  11798. }
  11799. }
  11800. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11801. class ui_hb_zs2 extends fgui.GButton {
  11802. static createInstance() {
  11803. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11804. }
  11805. onConstruct() {
  11806. this.n20 = (this.getChild("n20"));
  11807. this.n21 = (this.getChild("n21"));
  11808. this.n26 = (this.getChild("n26"));
  11809. this.n27 = (this.getChild("n27"));
  11810. this.n32 = (this.getChild("n32"));
  11811. this.n38 = (this.getChild("n38"));
  11812. this.n39 = (this.getChild("n39"));
  11813. this.n44 = (this.getChild("n44"));
  11814. this.diamondTxt = (this.getChild("diamondTxt"));
  11815. this.n41 = (this.getChild("n41"));
  11816. this.n45 = (this.getChild("n45"));
  11817. this.t0 = this.getTransition("t0");
  11818. }
  11819. }
  11820. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11821. class ui_hb_zs3 extends fgui.GButton {
  11822. static createInstance() {
  11823. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11824. }
  11825. onConstruct() {
  11826. this.n20 = (this.getChild("n20"));
  11827. this.n21 = (this.getChild("n21"));
  11828. this.n26 = (this.getChild("n26"));
  11829. this.n27 = (this.getChild("n27"));
  11830. this.n32 = (this.getChild("n32"));
  11831. this.n38 = (this.getChild("n38"));
  11832. this.n47 = (this.getChild("n47"));
  11833. this.t0 = this.getTransition("t0");
  11834. }
  11835. }
  11836. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11837. class ui_dh_zs2 extends fgui.GComponent {
  11838. static createInstance() {
  11839. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11840. }
  11841. onConstruct() {
  11842. this.n10 = (this.getChild("n10"));
  11843. this.n9 = (this.getChild("n9"));
  11844. this.n1 = (this.getChild("n1"));
  11845. this.n2 = (this.getChild("n2"));
  11846. this.n3 = (this.getChild("n3"));
  11847. this.n4 = (this.getChild("n4"));
  11848. this.n5 = (this.getChild("n5"));
  11849. this.n6 = (this.getChild("n6"));
  11850. this.n8 = (this.getChild("n8"));
  11851. this.n11 = (this.getChild("n11"));
  11852. this.t0 = this.getTransition("t0");
  11853. }
  11854. }
  11855. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  11856. class ui_dh_zs2_1 extends fgui.GComponent {
  11857. static createInstance() {
  11858. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  11859. }
  11860. onConstruct() {
  11861. this.n3 = (this.getChild("n3"));
  11862. this.n1 = (this.getChild("n1"));
  11863. this.t0 = this.getTransition("t0");
  11864. }
  11865. }
  11866. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  11867. class ui_dh_zs3 extends fgui.GComponent {
  11868. static createInstance() {
  11869. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  11870. }
  11871. onConstruct() {
  11872. this.n10 = (this.getChild("n10"));
  11873. this.n9 = (this.getChild("n9"));
  11874. this.n1 = (this.getChild("n1"));
  11875. this.n2 = (this.getChild("n2"));
  11876. this.n3 = (this.getChild("n3"));
  11877. this.n4 = (this.getChild("n4"));
  11878. this.n5 = (this.getChild("n5"));
  11879. this.n6 = (this.getChild("n6"));
  11880. this.n8 = (this.getChild("n8"));
  11881. this.n11 = (this.getChild("n11"));
  11882. this.t0 = this.getTransition("t0");
  11883. }
  11884. }
  11885. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  11886. class ui_dh_zs3_1 extends fgui.GComponent {
  11887. static createInstance() {
  11888. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  11889. }
  11890. onConstruct() {
  11891. this.n3 = (this.getChild("n3"));
  11892. this.n1 = (this.getChild("n1"));
  11893. this.t0 = this.getTransition("t0");
  11894. }
  11895. }
  11896. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  11897. class ui_Component107 extends fgui.GComponent {
  11898. static createInstance() {
  11899. return (fgui.UIPackage.createObject("game", "Component107"));
  11900. }
  11901. onConstruct() {
  11902. this.n18 = (this.getChild("n18"));
  11903. this.n19 = (this.getChild("n19"));
  11904. this.n20 = (this.getChild("n20"));
  11905. this.n21 = (this.getChild("n21"));
  11906. this.n22 = (this.getChild("n22"));
  11907. this.levelTxt = (this.getChild("levelTxt"));
  11908. this.t0 = this.getTransition("t0");
  11909. }
  11910. }
  11911. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  11912. class ui_box_com1 extends fgui.GComponent {
  11913. static createInstance() {
  11914. return (fgui.UIPackage.createObject("game", "box_com1"));
  11915. }
  11916. onConstruct() {
  11917. this.n14 = (this.getChild("n14"));
  11918. this.n6 = (this.getChild("n6"));
  11919. this.t0 = this.getTransition("t0");
  11920. }
  11921. }
  11922. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  11923. class ui_box_com2 extends fgui.GProgressBar {
  11924. static createInstance() {
  11925. return (fgui.UIPackage.createObject("game", "box_com2"));
  11926. }
  11927. onConstruct() {
  11928. this.bg0 = (this.getChild("bg0"));
  11929. this.bg = (this.getChild("bg"));
  11930. this.bar = (this.getChild("bar"));
  11931. this.n7 = (this.getChild("n7"));
  11932. this.n8 = (this.getChild("n8"));
  11933. this.n10 = (this.getChild("n10"));
  11934. this.n11 = (this.getChild("n11"));
  11935. this.n12 = (this.getChild("n12"));
  11936. }
  11937. }
  11938. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  11939. class ui_box_com4 extends fgui.GComponent {
  11940. static createInstance() {
  11941. return (fgui.UIPackage.createObject("game", "box_com4"));
  11942. }
  11943. onConstruct() {
  11944. this.n8 = (this.getChild("n8"));
  11945. this.t0 = this.getTransition("t0");
  11946. }
  11947. }
  11948. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  11949. class ui_box_com3 extends fgui.GComponent {
  11950. static createInstance() {
  11951. return (fgui.UIPackage.createObject("game", "box_com3"));
  11952. }
  11953. onConstruct() {
  11954. this.n2 = (this.getChild("n2"));
  11955. this.n3 = (this.getChild("n3"));
  11956. this.n4 = (this.getChild("n4"));
  11957. this.n5 = (this.getChild("n5"));
  11958. this.t0 = this.getTransition("t0");
  11959. this.t1 = this.getTransition("t1");
  11960. }
  11961. }
  11962. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  11963. class ui_Component97 extends fgui.GComponent {
  11964. static createInstance() {
  11965. return (fgui.UIPackage.createObject("game", "Component97"));
  11966. }
  11967. onConstruct() {
  11968. this.c1 = this.getController("c1");
  11969. this.n46 = (this.getChild("n46"));
  11970. this.diamondNode = (this.getChild("diamondNode"));
  11971. this.coinNode = (this.getChild("coinNode"));
  11972. this.t0 = this.getTransition("t0");
  11973. }
  11974. }
  11975. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  11976. class ui_Component98 extends fgui.GButton {
  11977. static createInstance() {
  11978. return (fgui.UIPackage.createObject("game", "Component98"));
  11979. }
  11980. onConstruct() {
  11981. this.n8 = (this.getChild("n8"));
  11982. this.n40 = (this.getChild("n40"));
  11983. }
  11984. }
  11985. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  11986. class ui_Component28_11 extends fgui.GButton {
  11987. static createInstance() {
  11988. return (fgui.UIPackage.createObject("game", "Component28_11"));
  11989. }
  11990. onConstruct() {
  11991. this.c1 = this.getController("c1");
  11992. this.n12 = (this.getChild("n12"));
  11993. this.n17 = (this.getChild("n17"));
  11994. this.n13 = (this.getChild("n13"));
  11995. this.diamondTxt = (this.getChild("diamondTxt"));
  11996. this.n15 = (this.getChild("n15"));
  11997. this.n16 = (this.getChild("n16"));
  11998. }
  11999. }
  12000. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12001. class ui_Component58_11 extends fgui.GComponent {
  12002. static createInstance() {
  12003. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12004. }
  12005. onConstruct() {
  12006. this.n23 = (this.getChild("n23"));
  12007. this.n41 = (this.getChild("n41"));
  12008. this.myList = (this.getChild("myList"));
  12009. this.n45 = (this.getChild("n45"));
  12010. this.n44 = (this.getChild("n44"));
  12011. this.t0 = this.getTransition("t0");
  12012. }
  12013. }
  12014. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12015. class ui_Component100 extends fgui.GComponent {
  12016. static createInstance() {
  12017. return (fgui.UIPackage.createObject("game", "Component100"));
  12018. }
  12019. onConstruct() {
  12020. this.c1 = this.getController("c1");
  12021. this.n75 = (this.getChild("n75"));
  12022. this.n76 = (this.getChild("n76"));
  12023. this.n80 = (this.getChild("n80"));
  12024. this.txt = (this.getChild("txt"));
  12025. this.spineRoot = (this.getChild("spineRoot"));
  12026. }
  12027. }
  12028. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12029. class ui_Component101 extends fgui.GComponent {
  12030. static createInstance() {
  12031. return (fgui.UIPackage.createObject("game", "Component101"));
  12032. }
  12033. onConstruct() {
  12034. this.c1 = this.getController("c1");
  12035. this.n36 = (this.getChild("n36"));
  12036. this.n35 = (this.getChild("n35"));
  12037. this.n33 = (this.getChild("n33"));
  12038. this.n34 = (this.getChild("n34"));
  12039. }
  12040. }
  12041. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12042. class ui_Component53 extends fgui.GComponent {
  12043. static createInstance() {
  12044. return (fgui.UIPackage.createObject("game", "Component53"));
  12045. }
  12046. onConstruct() {
  12047. this.n0 = (this.getChild("n0"));
  12048. this.n1 = (this.getChild("n1"));
  12049. this.n2 = (this.getChild("n2"));
  12050. this.n3 = (this.getChild("n3"));
  12051. this.n4 = (this.getChild("n4"));
  12052. this.n5 = (this.getChild("n5"));
  12053. this.n6 = (this.getChild("n6"));
  12054. this.n7 = (this.getChild("n7"));
  12055. this.n8 = (this.getChild("n8"));
  12056. this.n9 = (this.getChild("n9"));
  12057. this.n10 = (this.getChild("n10"));
  12058. this.n11 = (this.getChild("n11"));
  12059. this.n12 = (this.getChild("n12"));
  12060. this.n13 = (this.getChild("n13"));
  12061. this.n14 = (this.getChild("n14"));
  12062. this.n15 = (this.getChild("n15"));
  12063. this.n16 = (this.getChild("n16"));
  12064. this.n19 = (this.getChild("n19"));
  12065. this.n20 = (this.getChild("n20"));
  12066. this.n21 = (this.getChild("n21"));
  12067. this.n22 = (this.getChild("n22"));
  12068. this.n23 = (this.getChild("n23"));
  12069. this.n24 = (this.getChild("n24"));
  12070. this.n25 = (this.getChild("n25"));
  12071. this.n26 = (this.getChild("n26"));
  12072. this.n27 = (this.getChild("n27"));
  12073. this.n28 = (this.getChild("n28"));
  12074. this.n29 = (this.getChild("n29"));
  12075. this.n30 = (this.getChild("n30"));
  12076. this.n31 = (this.getChild("n31"));
  12077. this.n32 = (this.getChild("n32"));
  12078. this.n33 = (this.getChild("n33"));
  12079. this.n34 = (this.getChild("n34"));
  12080. this.n35 = (this.getChild("n35"));
  12081. this.t0 = this.getTransition("t0");
  12082. }
  12083. }
  12084. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12085. class ui_Component58 extends fgui.GComponent {
  12086. static createInstance() {
  12087. return (fgui.UIPackage.createObject("game", "Component58"));
  12088. }
  12089. onConstruct() {
  12090. this.n23 = (this.getChild("n23"));
  12091. this.n41 = (this.getChild("n41"));
  12092. this.n8 = (this.getChild("n8"));
  12093. this.skillList = (this.getChild("skillList"));
  12094. this.t0 = this.getTransition("t0");
  12095. }
  12096. }
  12097. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12098. class ui_Component59 extends fgui.GComponent {
  12099. static createInstance() {
  12100. return (fgui.UIPackage.createObject("game", "Component59"));
  12101. }
  12102. onConstruct() {
  12103. this.n3 = (this.getChild("n3"));
  12104. this.msgTxt = (this.getChild("msgTxt"));
  12105. this.t0 = this.getTransition("t0");
  12106. }
  12107. }
  12108. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12109. class ui_RulerNode extends fgui.GComponent {
  12110. static createInstance() {
  12111. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12112. }
  12113. onConstruct() {
  12114. this.n6 = (this.getChild("n6"));
  12115. this.n4 = (this.getChild("n4"));
  12116. this.img1 = (this.getChild("img1"));
  12117. this.img2 = (this.getChild("img2"));
  12118. }
  12119. }
  12120. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12121. class ui_Component108 extends fgui.GComponent {
  12122. static createInstance() {
  12123. return (fgui.UIPackage.createObject("game", "Component108"));
  12124. }
  12125. onConstruct() {
  12126. this.n19 = (this.getChild("n19"));
  12127. this.t0 = this.getTransition("t0");
  12128. }
  12129. }
  12130. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12131. class ui_Component63 extends fgui.GComponent {
  12132. static createInstance() {
  12133. return (fgui.UIPackage.createObject("game", "Component63"));
  12134. }
  12135. onConstruct() {
  12136. this.n66 = (this.getChild("n66"));
  12137. this.n56 = (this.getChild("n56"));
  12138. this.n63 = (this.getChild("n63"));
  12139. this.n65 = (this.getChild("n65"));
  12140. this.t0 = this.getTransition("t0");
  12141. }
  12142. }
  12143. ui_Component63.URL = "ui://isxx5ak7h657452";
  12144. class ui_topNode extends fgui.GComponent {
  12145. static createInstance() {
  12146. return (fgui.UIPackage.createObject("game", "topNode"));
  12147. }
  12148. onConstruct() {
  12149. this.selfProgress = (this.getChild("selfProgress"));
  12150. this.aiProgress = (this.getChild("aiProgress"));
  12151. this.selfKuang = (this.getChild("selfKuang"));
  12152. this.aiKuang = (this.getChild("aiKuang"));
  12153. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12154. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12155. this.n33 = (this.getChild("n33"));
  12156. this.n34 = (this.getChild("n34"));
  12157. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12158. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12159. this.selfBallList = (this.getChild("selfBallList"));
  12160. this.aiBallList = (this.getChild("aiBallList"));
  12161. this.middleNode = (this.getChild("middleNode"));
  12162. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12163. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12164. this.scoreNode = (this.getChild("scoreNode"));
  12165. this.selfTips = (this.getChild("selfTips"));
  12166. this.aiTips = (this.getChild("aiTips"));
  12167. }
  12168. }
  12169. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12170. class ui_selfProgress extends fgui.GProgressBar {
  12171. static createInstance() {
  12172. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12173. }
  12174. onConstruct() {
  12175. this.n3 = (this.getChild("n3"));
  12176. this.bar = (this.getChild("bar"));
  12177. }
  12178. }
  12179. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12180. class ui_aiProgress extends fgui.GProgressBar {
  12181. static createInstance() {
  12182. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12183. }
  12184. onConstruct() {
  12185. this.n3 = (this.getChild("n3"));
  12186. this.bar = (this.getChild("bar"));
  12187. }
  12188. }
  12189. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12190. class ui_ballDisplay extends fgui.GComponent {
  12191. static createInstance() {
  12192. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12193. }
  12194. onConstruct() {
  12195. this.myImg = (this.getChild("myImg"));
  12196. }
  12197. }
  12198. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12199. class ui_moveNode extends fgui.GComponent {
  12200. static createInstance() {
  12201. return (fgui.UIPackage.createObject("game", "moveNode"));
  12202. }
  12203. onConstruct() {
  12204. this.n8 = (this.getChild("n8"));
  12205. this.finger = (this.getChild("finger"));
  12206. }
  12207. }
  12208. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12209. class ui_cancelBtn extends fgui.GButton {
  12210. static createInstance() {
  12211. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12212. }
  12213. onConstruct() {
  12214. this.c1 = this.getController("c1");
  12215. this.n0 = (this.getChild("n0"));
  12216. this.n1 = (this.getChild("n1"));
  12217. }
  12218. }
  12219. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12220. class ui_shareBtn extends fgui.GButton {
  12221. static createInstance() {
  12222. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12223. }
  12224. onConstruct() {
  12225. this.c1 = this.getController("c1");
  12226. this.n2 = (this.getChild("n2"));
  12227. this.n1 = (this.getChild("n1"));
  12228. this.n3 = (this.getChild("n3"));
  12229. this.n4 = (this.getChild("n4"));
  12230. this.n5 = (this.getChild("n5"));
  12231. this.n6 = (this.getChild("n6"));
  12232. }
  12233. }
  12234. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12235. class ui_share2Btn extends fgui.GButton {
  12236. static createInstance() {
  12237. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12238. }
  12239. onConstruct() {
  12240. this.n3 = (this.getChild("n3"));
  12241. }
  12242. }
  12243. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12244. class ui_rodMethodNode extends fgui.GComponent {
  12245. static createInstance() {
  12246. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12247. }
  12248. onConstruct() {
  12249. this.bg = (this.getChild("bg"));
  12250. this.dot = (this.getChild("dot"));
  12251. }
  12252. }
  12253. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12254. class ui_sureBtn extends fgui.GButton {
  12255. static createInstance() {
  12256. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12257. }
  12258. onConstruct() {
  12259. this.n2 = (this.getChild("n2"));
  12260. this.n1 = (this.getChild("n1"));
  12261. }
  12262. }
  12263. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12264. class ui_Component18 extends fgui.GComponent {
  12265. static createInstance() {
  12266. return (fgui.UIPackage.createObject("game", "Component18"));
  12267. }
  12268. onConstruct() {
  12269. this.c1 = this.getController("c1");
  12270. this.nameTxt = (this.getChild("nameTxt"));
  12271. this.headImg = (this.getChild("headImg"));
  12272. this.n24 = (this.getChild("n24"));
  12273. this.skillImg = (this.getChild("skillImg"));
  12274. this.skillTxt = (this.getChild("skillTxt"));
  12275. }
  12276. }
  12277. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12278. class ui_Component45 extends fgui.GComponent {
  12279. static createInstance() {
  12280. return (fgui.UIPackage.createObject("game", "Component45"));
  12281. }
  12282. onConstruct() {
  12283. this.c1 = this.getController("c1");
  12284. this.n40 = (this.getChild("n40"));
  12285. this.n41 = (this.getChild("n41"));
  12286. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12287. this.n42 = (this.getChild("n42"));
  12288. this.awardTxt = (this.getChild("awardTxt"));
  12289. this.n44 = (this.getChild("n44"));
  12290. this.t0 = this.getTransition("t0");
  12291. }
  12292. }
  12293. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12294. class ui_emotionDisplay extends fgui.GButton {
  12295. static createInstance() {
  12296. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12297. }
  12298. onConstruct() {
  12299. this.myIcon = (this.getChild("myIcon"));
  12300. }
  12301. }
  12302. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12303. class ui_Component49 extends fgui.GButton {
  12304. static createInstance() {
  12305. return (fgui.UIPackage.createObject("game", "Component49"));
  12306. }
  12307. onConstruct() {
  12308. this.n69 = (this.getChild("n69"));
  12309. this.n56 = (this.getChild("n56"));
  12310. }
  12311. }
  12312. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12313. class ui_Component50 extends fgui.GButton {
  12314. static createInstance() {
  12315. return (fgui.UIPackage.createObject("game", "Component50"));
  12316. }
  12317. onConstruct() {
  12318. this.n54 = (this.getChild("n54"));
  12319. this.n65 = (this.getChild("n65"));
  12320. }
  12321. }
  12322. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12323. class ui_Component51 extends fgui.GButton {
  12324. static createInstance() {
  12325. return (fgui.UIPackage.createObject("game", "Component51"));
  12326. }
  12327. onConstruct() {
  12328. this.c1 = this.getController("c1");
  12329. this.n51 = (this.getChild("n51"));
  12330. this.n54 = (this.getChild("n54"));
  12331. }
  12332. }
  12333. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12334. class ui_Button5 extends fgui.GButton {
  12335. static createInstance() {
  12336. return (fgui.UIPackage.createObject("game", "Button5"));
  12337. }
  12338. onConstruct() {
  12339. this.c1 = this.getController("c1");
  12340. this.n0 = (this.getChild("n0"));
  12341. this.n2 = (this.getChild("n2"));
  12342. }
  12343. }
  12344. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12345. class ui_Component124 extends fgui.GComponent {
  12346. static createInstance() {
  12347. return (fgui.UIPackage.createObject("game", "Component124"));
  12348. }
  12349. onConstruct() {
  12350. this.n22 = (this.getChild("n22"));
  12351. this.shareNode = (this.getChild("shareNode"));
  12352. }
  12353. }
  12354. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12355. class ui_Component125 extends fgui.GComponent {
  12356. static createInstance() {
  12357. return (fgui.UIPackage.createObject("game", "Component125"));
  12358. }
  12359. onConstruct() {
  12360. this.n29 = (this.getChild("n29"));
  12361. this.coinTxt = (this.getChild("coinTxt"));
  12362. }
  12363. }
  12364. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12365. class ui_Component52 extends fgui.GButton {
  12366. static createInstance() {
  12367. return (fgui.UIPackage.createObject("game", "Component52"));
  12368. }
  12369. onConstruct() {
  12370. this.n35 = (this.getChild("n35"));
  12371. this.n36 = (this.getChild("n36"));
  12372. }
  12373. }
  12374. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12375. class ui_drawBtn extends fgui.GButton {
  12376. static createInstance() {
  12377. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12378. }
  12379. onConstruct() {
  12380. this.c1 = this.getController("c1");
  12381. this.n2 = (this.getChild("n2"));
  12382. this.n1 = (this.getChild("n1"));
  12383. }
  12384. }
  12385. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12386. class ui_Component43 extends fgui.GButton {
  12387. static createInstance() {
  12388. return (fgui.UIPackage.createObject("game", "Component43"));
  12389. }
  12390. onConstruct() {
  12391. this.n49 = (this.getChild("n49"));
  12392. }
  12393. }
  12394. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12395. class ui_wordsDisplay extends fgui.GComponent {
  12396. static createInstance() {
  12397. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12398. }
  12399. onConstruct() {
  12400. this.txt = (this.getChild("txt"));
  12401. this.n63 = (this.getChild("n63"));
  12402. }
  12403. }
  12404. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12405. class ui_Component3 extends fgui.GComponent {
  12406. static createInstance() {
  12407. return (fgui.UIPackage.createObject("game", "Component3"));
  12408. }
  12409. onConstruct() {
  12410. this.n26 = (this.getChild("n26"));
  12411. this.n24 = (this.getChild("n24"));
  12412. this.nameTxt = (this.getChild("nameTxt"));
  12413. this.headRoot = (this.getChild("headRoot"));
  12414. }
  12415. }
  12416. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12417. class ui_Component4 extends fgui.GComponent {
  12418. static createInstance() {
  12419. return (fgui.UIPackage.createObject("game", "Component4"));
  12420. }
  12421. onConstruct() {
  12422. this.headImg = (this.getChild("headImg"));
  12423. }
  12424. }
  12425. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12426. class ui_Component7 extends fgui.GButton {
  12427. static createInstance() {
  12428. return (fgui.UIPackage.createObject("game", "Component7"));
  12429. }
  12430. onConstruct() {
  12431. this.n17 = (this.getChild("n17"));
  12432. }
  12433. }
  12434. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12435. class ui_Component8 extends fgui.GButton {
  12436. static createInstance() {
  12437. return (fgui.UIPackage.createObject("game", "Component8"));
  12438. }
  12439. onConstruct() {
  12440. this.n19 = (this.getChild("n19"));
  12441. }
  12442. }
  12443. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12444. class ui_Component9 extends fgui.GButton {
  12445. static createInstance() {
  12446. return (fgui.UIPackage.createObject("game", "Component9"));
  12447. }
  12448. onConstruct() {
  12449. this.n18 = (this.getChild("n18"));
  12450. }
  12451. }
  12452. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12453. class ui_Component10 extends fgui.GButton {
  12454. static createInstance() {
  12455. return (fgui.UIPackage.createObject("game", "Component10"));
  12456. }
  12457. onConstruct() {
  12458. this.c1 = this.getController("c1");
  12459. this.n40 = (this.getChild("n40"));
  12460. }
  12461. }
  12462. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12463. class ui_Component11 extends fgui.GButton {
  12464. static createInstance() {
  12465. return (fgui.UIPackage.createObject("game", "Component11"));
  12466. }
  12467. onConstruct() {
  12468. this.n34 = (this.getChild("n34"));
  12469. }
  12470. }
  12471. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12472. class ui_Component12 extends fgui.GButton {
  12473. static createInstance() {
  12474. return (fgui.UIPackage.createObject("game", "Component12"));
  12475. }
  12476. onConstruct() {
  12477. this.n35 = (this.getChild("n35"));
  12478. }
  12479. }
  12480. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12481. class ui_Component13 extends fgui.GButton {
  12482. static createInstance() {
  12483. return (fgui.UIPackage.createObject("game", "Component13"));
  12484. }
  12485. onConstruct() {
  12486. this.n27 = (this.getChild("n27"));
  12487. this.n36 = (this.getChild("n36"));
  12488. }
  12489. }
  12490. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12491. class ui_dh_js_tuowei extends fgui.GComponent {
  12492. static createInstance() {
  12493. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12494. }
  12495. onConstruct() {
  12496. this.n19 = (this.getChild("n19"));
  12497. this.n18 = (this.getChild("n18"));
  12498. this.n0 = (this.getChild("n0"));
  12499. this.n3 = (this.getChild("n3"));
  12500. this.n4 = (this.getChild("n4"));
  12501. this.n5 = (this.getChild("n5"));
  12502. this.n6 = (this.getChild("n6"));
  12503. this.n8 = (this.getChild("n8"));
  12504. this.n9 = (this.getChild("n9"));
  12505. this.n10 = (this.getChild("n10"));
  12506. this.n11 = (this.getChild("n11"));
  12507. this.n12 = (this.getChild("n12"));
  12508. this.n13 = (this.getChild("n13"));
  12509. this.n14 = (this.getChild("n14"));
  12510. this.n15 = (this.getChild("n15"));
  12511. this.n20 = (this.getChild("n20"));
  12512. this.t0 = this.getTransition("t0");
  12513. this.t1 = this.getTransition("t1");
  12514. }
  12515. }
  12516. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12517. class ui_dh_js_tw_g extends fgui.GComponent {
  12518. static createInstance() {
  12519. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12520. }
  12521. onConstruct() {
  12522. this.n0 = (this.getChild("n0"));
  12523. this.n1 = (this.getChild("n1"));
  12524. this.t0 = this.getTransition("t0");
  12525. }
  12526. }
  12527. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12528. class ui_dh_js_xingxing extends fgui.GComponent {
  12529. static createInstance() {
  12530. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12531. }
  12532. onConstruct() {
  12533. this.n1 = (this.getChild("n1"));
  12534. this.n2 = (this.getChild("n2"));
  12535. this.n3 = (this.getChild("n3"));
  12536. this.n4 = (this.getChild("n4"));
  12537. this.n0 = (this.getChild("n0"));
  12538. this.t2 = this.getTransition("t2");
  12539. this.t1 = this.getTransition("t1");
  12540. }
  12541. }
  12542. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12543. class ui_dh_zy_jiazai extends fgui.GComponent {
  12544. static createInstance() {
  12545. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12546. }
  12547. onConstruct() {
  12548. this.c1 = this.getController("c1");
  12549. this.n0 = (this.getChild("n0"));
  12550. this.n1 = (this.getChild("n1"));
  12551. this.n2 = (this.getChild("n2"));
  12552. this.n4 = (this.getChild("n4"));
  12553. this.n5 = (this.getChild("n5"));
  12554. this.n6 = (this.getChild("n6"));
  12555. this.n8 = (this.getChild("n8"));
  12556. this.n7 = (this.getChild("n7"));
  12557. this.t0 = this.getTransition("t0");
  12558. }
  12559. }
  12560. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12561. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12562. static createInstance() {
  12563. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12564. }
  12565. onConstruct() {
  12566. this.c1 = this.getController("c1");
  12567. this.n3 = (this.getChild("n3"));
  12568. this.n5 = (this.getChild("n5"));
  12569. this.n4 = (this.getChild("n4"));
  12570. this.n0 = (this.getChild("n0"));
  12571. this.n1 = (this.getChild("n1"));
  12572. this.n2 = (this.getChild("n2"));
  12573. }
  12574. }
  12575. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12576. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12577. static createInstance() {
  12578. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12579. }
  12580. onConstruct() {
  12581. this.n19 = (this.getChild("n19"));
  12582. this.n21 = (this.getChild("n21"));
  12583. this.n0 = (this.getChild("n0"));
  12584. this.n3 = (this.getChild("n3"));
  12585. this.n4 = (this.getChild("n4"));
  12586. this.n5 = (this.getChild("n5"));
  12587. this.n6 = (this.getChild("n6"));
  12588. this.n8 = (this.getChild("n8"));
  12589. this.n9 = (this.getChild("n9"));
  12590. this.n10 = (this.getChild("n10"));
  12591. this.n11 = (this.getChild("n11"));
  12592. this.n12 = (this.getChild("n12"));
  12593. this.n13 = (this.getChild("n13"));
  12594. this.n14 = (this.getChild("n14"));
  12595. this.n15 = (this.getChild("n15"));
  12596. this.n23 = (this.getChild("n23"));
  12597. this.t0 = this.getTransition("t0");
  12598. this.t1 = this.getTransition("t1");
  12599. }
  12600. }
  12601. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12602. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12603. static createInstance() {
  12604. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12605. }
  12606. onConstruct() {
  12607. this.n1 = (this.getChild("n1"));
  12608. this.n2 = (this.getChild("n2"));
  12609. this.t0 = this.getTransition("t0");
  12610. }
  12611. }
  12612. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12613. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12614. static createInstance() {
  12615. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12616. }
  12617. onConstruct() {
  12618. this.n4 = (this.getChild("n4"));
  12619. this.n2 = (this.getChild("n2"));
  12620. this.n3 = (this.getChild("n3"));
  12621. this.idle = this.getTransition("idle");
  12622. this.attack = this.getTransition("attack");
  12623. }
  12624. }
  12625. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12626. class ui_special extends fgui.GComponent {
  12627. static createInstance() {
  12628. return (fgui.UIPackage.createObject("game", "special"));
  12629. }
  12630. onConstruct() {
  12631. this.n18 = (this.getChild("n18"));
  12632. this.n19 = (this.getChild("n19"));
  12633. this.n20 = (this.getChild("n20"));
  12634. this.n21 = (this.getChild("n21"));
  12635. this.n22 = (this.getChild("n22"));
  12636. this.levelTxt = (this.getChild("levelTxt"));
  12637. this.n24 = (this.getChild("n24"));
  12638. this.n25 = (this.getChild("n25"));
  12639. this.t0 = this.getTransition("t0");
  12640. }
  12641. }
  12642. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12643. class ui_Component145 extends fgui.GComponent {
  12644. static createInstance() {
  12645. return (fgui.UIPackage.createObject("game", "Component145"));
  12646. }
  12647. onConstruct() {
  12648. this.guanyuNode = (this.getChild("guanyuNode"));
  12649. }
  12650. }
  12651. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12652. class ui_longBtn extends fgui.GButton {
  12653. static createInstance() {
  12654. return (fgui.UIPackage.createObject("game", "longBtn"));
  12655. }
  12656. onConstruct() {
  12657. this.c1 = this.getController("c1");
  12658. this.n2 = (this.getChild("n2"));
  12659. this.n1 = (this.getChild("n1"));
  12660. this.n4 = (this.getChild("n4"));
  12661. }
  12662. }
  12663. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12664. class ui_Component146 extends fgui.GComponent {
  12665. static createInstance() {
  12666. return (fgui.UIPackage.createObject("game", "Component146"));
  12667. }
  12668. onConstruct() {
  12669. this.n89 = (this.getChild("n89"));
  12670. this.n90 = (this.getChild("n90"));
  12671. this.guideBtn = (this.getChild("guideBtn"));
  12672. }
  12673. }
  12674. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12675. class ui_Component146_11 extends fgui.GComponent {
  12676. static createInstance() {
  12677. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12678. }
  12679. onConstruct() {
  12680. this.n89 = (this.getChild("n89"));
  12681. this.n90 = (this.getChild("n90"));
  12682. this.guideBtn = (this.getChild("guideBtn"));
  12683. }
  12684. }
  12685. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12686. class ui_Component111_1 extends fgui.GComponent {
  12687. static createInstance() {
  12688. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12689. }
  12690. onConstruct() {
  12691. this.n68 = (this.getChild("n68"));
  12692. this.myMask = (this.getChild("myMask"));
  12693. }
  12694. }
  12695. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12696. class ui_Component64_1 extends fgui.GComponent {
  12697. static createInstance() {
  12698. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12699. }
  12700. onConstruct() {
  12701. this.n57 = (this.getChild("n57"));
  12702. this.n54 = (this.getChild("n54"));
  12703. this.n55 = (this.getChild("n55"));
  12704. this.n56 = (this.getChild("n56"));
  12705. this.t1 = this.getTransition("t1");
  12706. }
  12707. }
  12708. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12709. class ui_ModeSelection_com123 extends fgui.GComponent {
  12710. static createInstance() {
  12711. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12712. }
  12713. onConstruct() {
  12714. this.type1 = (this.getChild("type1"));
  12715. this.type2 = (this.getChild("type2"));
  12716. this.type3 = (this.getChild("type3"));
  12717. this.n38 = (this.getChild("n38"));
  12718. this.t0 = this.getTransition("t0");
  12719. }
  12720. }
  12721. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12722. class ui_Component132_2 extends fgui.GComponent {
  12723. static createInstance() {
  12724. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12725. }
  12726. onConstruct() {
  12727. this.n25 = (this.getChild("n25"));
  12728. this.n26 = (this.getChild("n26"));
  12729. this.n27 = (this.getChild("n27"));
  12730. this.t0 = this.getTransition("t0");
  12731. }
  12732. }
  12733. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12734. class ui_UIPower$1 extends fgui.GComponent {
  12735. static createInstance() {
  12736. return (fgui.UIPackage.createObject("game", "UIPower"));
  12737. }
  12738. onConstruct() {
  12739. this.n11 = (this.getChild("n11"));
  12740. this.myNode = (this.getChild("myNode"));
  12741. this.t0 = this.getTransition("t0");
  12742. }
  12743. }
  12744. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12745. class ui_Component133 extends fgui.GComponent {
  12746. static createInstance() {
  12747. return (fgui.UIPackage.createObject("game", "Component133"));
  12748. }
  12749. onConstruct() {
  12750. this.n29 = (this.getChild("n29"));
  12751. this.n30 = (this.getChild("n30"));
  12752. }
  12753. }
  12754. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12755. class ui_Component134 extends fgui.GComponent {
  12756. static createInstance() {
  12757. return (fgui.UIPackage.createObject("game", "Component134"));
  12758. }
  12759. onConstruct() {
  12760. this.n30 = (this.getChild("n30"));
  12761. this.n31 = (this.getChild("n31"));
  12762. this.t0 = this.getTransition("t0");
  12763. }
  12764. }
  12765. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12766. class ui_Component135 extends fgui.GComponent {
  12767. static createInstance() {
  12768. return (fgui.UIPackage.createObject("game", "Component135"));
  12769. }
  12770. onConstruct() {
  12771. this.n30 = (this.getChild("n30"));
  12772. this.t0 = this.getTransition("t0");
  12773. }
  12774. }
  12775. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12776. class ui_Component137 extends fgui.GComponent {
  12777. static createInstance() {
  12778. return (fgui.UIPackage.createObject("game", "Component137"));
  12779. }
  12780. onConstruct() {
  12781. this.n28 = (this.getChild("n28"));
  12782. this.n29 = (this.getChild("n29"));
  12783. this.n30 = (this.getChild("n30"));
  12784. this.n32 = (this.getChild("n32"));
  12785. }
  12786. }
  12787. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12788. class ui_dh_zuanshi extends fgui.GButton {
  12789. static createInstance() {
  12790. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12791. }
  12792. onConstruct() {
  12793. this.n1 = (this.getChild("n1"));
  12794. this.n2 = (this.getChild("n2"));
  12795. this.n0 = (this.getChild("n0"));
  12796. this.n3 = (this.getChild("n3"));
  12797. this.n4 = (this.getChild("n4"));
  12798. }
  12799. }
  12800. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12801. class ui_Component138 extends fgui.GComponent {
  12802. static createInstance() {
  12803. return (fgui.UIPackage.createObject("game", "Component138"));
  12804. }
  12805. onConstruct() {
  12806. this.n1 = (this.getChild("n1"));
  12807. this.n2 = (this.getChild("n2"));
  12808. this.t0 = this.getTransition("t0");
  12809. }
  12810. }
  12811. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12812. class ui_Component139 extends fgui.GComponent {
  12813. static createInstance() {
  12814. return (fgui.UIPackage.createObject("game", "Component139"));
  12815. }
  12816. onConstruct() {
  12817. this.n0 = (this.getChild("n0"));
  12818. this.t0 = this.getTransition("t0");
  12819. }
  12820. }
  12821. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12822. class ui_Component140 extends fgui.GComponent {
  12823. static createInstance() {
  12824. return (fgui.UIPackage.createObject("game", "Component140"));
  12825. }
  12826. onConstruct() {
  12827. this.n2 = (this.getChild("n2"));
  12828. this.n3 = (this.getChild("n3"));
  12829. this.t0 = this.getTransition("t0");
  12830. }
  12831. }
  12832. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12833. class ui_Component141 extends fgui.GComponent {
  12834. static createInstance() {
  12835. return (fgui.UIPackage.createObject("game", "Component141"));
  12836. }
  12837. onConstruct() {
  12838. this.n0 = (this.getChild("n0"));
  12839. this.t0 = this.getTransition("t0");
  12840. }
  12841. }
  12842. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12843. class ui_powerNode extends fgui.GProgressBar {
  12844. static createInstance() {
  12845. return (fgui.UIPackage.createObject("game", "powerNode"));
  12846. }
  12847. onConstruct() {
  12848. this.n2 = (this.getChild("n2"));
  12849. this.bar_v = (this.getChild("bar_v"));
  12850. this.showImg = (this.getChild("showImg"));
  12851. this.n12 = (this.getChild("n12"));
  12852. }
  12853. }
  12854. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12855. class ui_dh_jingbi1 extends fgui.GComponent {
  12856. static createInstance() {
  12857. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  12858. }
  12859. onConstruct() {
  12860. this.n0 = (this.getChild("n0"));
  12861. this.n1 = (this.getChild("n1"));
  12862. this.n2 = (this.getChild("n2"));
  12863. this.n3 = (this.getChild("n3"));
  12864. this.n4 = (this.getChild("n4"));
  12865. this.n5 = (this.getChild("n5"));
  12866. this.n6 = (this.getChild("n6"));
  12867. this.n8 = (this.getChild("n8"));
  12868. this.t0 = this.getTransition("t0");
  12869. }
  12870. }
  12871. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  12872. class ui_Component94 extends fgui.GButton {
  12873. static createInstance() {
  12874. return (fgui.UIPackage.createObject("game", "Component94"));
  12875. }
  12876. onConstruct() {
  12877. this.n77 = (this.getChild("n77"));
  12878. }
  12879. }
  12880. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  12881. class ui_Component95 extends fgui.GButton {
  12882. static createInstance() {
  12883. return (fgui.UIPackage.createObject("game", "Component95"));
  12884. }
  12885. onConstruct() {
  12886. this.n77 = (this.getChild("n77"));
  12887. }
  12888. }
  12889. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  12890. class ui_Component126 extends fgui.GComponent {
  12891. static createInstance() {
  12892. return (fgui.UIPackage.createObject("game", "Component126"));
  12893. }
  12894. onConstruct() {
  12895. this.c1 = this.getController("c1");
  12896. this.normalBtn = (this.getChild("normalBtn"));
  12897. this.tripleBtn = (this.getChild("tripleBtn"));
  12898. }
  12899. }
  12900. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  12901. class ui_Component60 extends fgui.GComponent {
  12902. static createInstance() {
  12903. return (fgui.UIPackage.createObject("game", "Component60"));
  12904. }
  12905. onConstruct() {
  12906. this.c1 = this.getController("c1");
  12907. this.n48 = (this.getChild("n48"));
  12908. this.womanTxt = (this.getChild("womanTxt"));
  12909. this.t0 = this.getTransition("t0");
  12910. }
  12911. }
  12912. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  12913. class ui_Component98_3 extends fgui.GButton {
  12914. static createInstance() {
  12915. return (fgui.UIPackage.createObject("game", "Component98_3"));
  12916. }
  12917. onConstruct() {
  12918. this.c1 = this.getController("c1");
  12919. this.n8 = (this.getChild("n8"));
  12920. this.n41 = (this.getChild("n41"));
  12921. this.n40 = (this.getChild("n40"));
  12922. }
  12923. }
  12924. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  12925. class ui_ModeSelection_com1 extends fgui.GButton {
  12926. static createInstance() {
  12927. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  12928. }
  12929. onConstruct() {
  12930. this.n34 = (this.getChild("n34"));
  12931. this.n36 = (this.getChild("n36"));
  12932. this.n22 = (this.getChild("n22"));
  12933. this.n20 = (this.getChild("n20"));
  12934. this.n23 = (this.getChild("n23"));
  12935. this.n24 = (this.getChild("n24"));
  12936. this.n26 = (this.getChild("n26"));
  12937. this.n33 = (this.getChild("n33"));
  12938. this.coinImg = (this.getChild("coinImg"));
  12939. this.need = (this.getChild("need"));
  12940. this.n35 = (this.getChild("n35"));
  12941. this.n29 = (this.getChild("n29"));
  12942. this.tipsTxt = (this.getChild("tipsTxt"));
  12943. this.n30 = (this.getChild("n30"));
  12944. this.peopleTxt = (this.getChild("peopleTxt"));
  12945. this.t0 = this.getTransition("t0");
  12946. }
  12947. }
  12948. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  12949. class ui_ModeSelection_com2 extends fgui.GButton {
  12950. static createInstance() {
  12951. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  12952. }
  12953. onConstruct() {
  12954. this.n36 = (this.getChild("n36"));
  12955. this.n34 = (this.getChild("n34"));
  12956. this.n22 = (this.getChild("n22"));
  12957. this.n20 = (this.getChild("n20"));
  12958. this.n23 = (this.getChild("n23"));
  12959. this.n24 = (this.getChild("n24"));
  12960. this.n26 = (this.getChild("n26"));
  12961. this.n33 = (this.getChild("n33"));
  12962. this.coinImg = (this.getChild("coinImg"));
  12963. this.need = (this.getChild("need"));
  12964. this.n35 = (this.getChild("n35"));
  12965. this.n29 = (this.getChild("n29"));
  12966. this.tipsTxt = (this.getChild("tipsTxt"));
  12967. this.n30 = (this.getChild("n30"));
  12968. this.peopleTxt = (this.getChild("peopleTxt"));
  12969. this.t0 = this.getTransition("t0");
  12970. }
  12971. }
  12972. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  12973. class ui_ModeSelection_com3 extends fgui.GButton {
  12974. static createInstance() {
  12975. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  12976. }
  12977. onConstruct() {
  12978. this.n34 = (this.getChild("n34"));
  12979. this.n36 = (this.getChild("n36"));
  12980. this.n22 = (this.getChild("n22"));
  12981. this.n20 = (this.getChild("n20"));
  12982. this.n23 = (this.getChild("n23"));
  12983. this.n24 = (this.getChild("n24"));
  12984. this.n26 = (this.getChild("n26"));
  12985. this.n33 = (this.getChild("n33"));
  12986. this.coinImg = (this.getChild("coinImg"));
  12987. this.need = (this.getChild("need"));
  12988. this.n35 = (this.getChild("n35"));
  12989. this.n29 = (this.getChild("n29"));
  12990. this.tipsTxt = (this.getChild("tipsTxt"));
  12991. this.n30 = (this.getChild("n30"));
  12992. this.peopleTxt = (this.getChild("peopleTxt"));
  12993. this.t0 = this.getTransition("t0");
  12994. }
  12995. }
  12996. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  12997. class ui_Invitation_com1 extends fgui.GComponent {
  12998. static createInstance() {
  12999. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13000. }
  13001. onConstruct() {
  13002. this.n14 = (this.getChild("n14"));
  13003. this.n13 = (this.getChild("n13"));
  13004. this.n3 = (this.getChild("n3"));
  13005. this.n1 = (this.getChild("n1"));
  13006. this.n6 = (this.getChild("n6"));
  13007. this.n7 = (this.getChild("n7"));
  13008. this.enterBtn = (this.getChild("enterBtn"));
  13009. this.n11 = (this.getChild("n11"));
  13010. this.n12 = (this.getChild("n12"));
  13011. this.n15 = (this.getChild("n15"));
  13012. this.t0 = this.getTransition("t0");
  13013. this.t1 = this.getTransition("t1");
  13014. }
  13015. }
  13016. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13017. class ui_Component87_1 extends fgui.GComponent {
  13018. static createInstance() {
  13019. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13020. }
  13021. onConstruct() {
  13022. this.n74 = (this.getChild("n74"));
  13023. this.n73 = (this.getChild("n73"));
  13024. this.ballTxt = (this.getChild("ballTxt"));
  13025. this.n76 = (this.getChild("n76"));
  13026. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13027. this.levelTxt = (this.getChild("levelTxt"));
  13028. this.n87 = (this.getChild("n87"));
  13029. this.n84 = (this.getChild("n84"));
  13030. this.hpTxt = (this.getChild("hpTxt"));
  13031. this.n89 = (this.getChild("n89"));
  13032. this.tipsTxt = (this.getChild("tipsTxt"));
  13033. }
  13034. }
  13035. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13036. class ui_sqg1 extends fgui.GComponent {
  13037. static createInstance() {
  13038. return (fgui.UIPackage.createObject("game", "sqg1"));
  13039. }
  13040. onConstruct() {
  13041. this.n1 = (this.getChild("n1"));
  13042. this.n0 = (this.getChild("n0"));
  13043. }
  13044. }
  13045. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13046. class ui_sqg2 extends fgui.GComponent {
  13047. static createInstance() {
  13048. return (fgui.UIPackage.createObject("game", "sqg2"));
  13049. }
  13050. onConstruct() {
  13051. this.n1 = (this.getChild("n1"));
  13052. this.n0 = (this.getChild("n0"));
  13053. }
  13054. }
  13055. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13056. class ui_sqg3 extends fgui.GComponent {
  13057. static createInstance() {
  13058. return (fgui.UIPackage.createObject("game", "sqg3"));
  13059. }
  13060. onConstruct() {
  13061. this.n1 = (this.getChild("n1"));
  13062. this.n0 = (this.getChild("n0"));
  13063. }
  13064. }
  13065. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13066. class ui_sqg4 extends fgui.GComponent {
  13067. static createInstance() {
  13068. return (fgui.UIPackage.createObject("game", "sqg4"));
  13069. }
  13070. onConstruct() {
  13071. this.n1 = (this.getChild("n1"));
  13072. this.n0 = (this.getChild("n0"));
  13073. }
  13074. }
  13075. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13076. class ui_Component36 extends fgui.GButton {
  13077. static createInstance() {
  13078. return (fgui.UIPackage.createObject("game", "Component36"));
  13079. }
  13080. onConstruct() {
  13081. this.c1 = this.getController("c1");
  13082. this.n53 = (this.getChild("n53"));
  13083. this.n56 = (this.getChild("n56"));
  13084. }
  13085. }
  13086. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13087. class ui_Component37 extends fgui.GButton {
  13088. static createInstance() {
  13089. return (fgui.UIPackage.createObject("game", "Component37"));
  13090. }
  13091. onConstruct() {
  13092. this.c1 = this.getController("c1");
  13093. this.n52 = (this.getChild("n52"));
  13094. this.n54 = (this.getChild("n54"));
  13095. }
  13096. }
  13097. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13098. class ui_UISetting extends fgui.GComponent {
  13099. static createInstance() {
  13100. return (fgui.UIPackage.createObject("game", "UISetting"));
  13101. }
  13102. onConstruct() {
  13103. this.c1 = this.getController("c1");
  13104. this.n4 = (this.getChild("n4"));
  13105. this.soundBtn = (this.getChild("soundBtn"));
  13106. this.shakeBtn = (this.getChild("shakeBtn"));
  13107. this.clickNode = (this.getChild("clickNode"));
  13108. this.xyBtn = (this.getChild("xyBtn"));
  13109. }
  13110. }
  13111. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13112. class ui_Component39 extends fgui.GComponent {
  13113. static createInstance() {
  13114. return (fgui.UIPackage.createObject("game", "Component39"));
  13115. }
  13116. onConstruct() {
  13117. this.n5 = (this.getChild("n5"));
  13118. this.n6 = (this.getChild("n6"));
  13119. this.n7 = (this.getChild("n7"));
  13120. this.t0 = this.getTransition("t0");
  13121. }
  13122. }
  13123. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13124. class ui_Component40 extends fgui.GButton {
  13125. static createInstance() {
  13126. return (fgui.UIPackage.createObject("game", "Component40"));
  13127. }
  13128. onConstruct() {
  13129. this.n46 = (this.getChild("n46"));
  13130. this.n47 = (this.getChild("n47"));
  13131. }
  13132. }
  13133. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13134. class ui_Component41 extends fgui.GComponent {
  13135. static createInstance() {
  13136. return (fgui.UIPackage.createObject("game", "Component41"));
  13137. }
  13138. onConstruct() {
  13139. this.c1 = this.getController("c1");
  13140. this.n0 = (this.getChild("n0"));
  13141. this.titleTxt = (this.getChild("titleTxt"));
  13142. this.n2 = (this.getChild("n2"));
  13143. this.msgTips = (this.getChild("msgTips"));
  13144. this.numTxt = (this.getChild("numTxt"));
  13145. this.n18 = (this.getChild("n18"));
  13146. this.cancelBtn = (this.getChild("cancelBtn"));
  13147. this.videoBtn = (this.getChild("videoBtn"));
  13148. this.n10 = (this.getChild("n10"));
  13149. }
  13150. }
  13151. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13152. class ui_Component42 extends fgui.GComponent {
  13153. static createInstance() {
  13154. return (fgui.UIPackage.createObject("game", "Component42"));
  13155. }
  13156. onConstruct() {
  13157. this.c1 = this.getController("c1");
  13158. this.n1 = (this.getChild("n1"));
  13159. this.n2 = (this.getChild("n2"));
  13160. this.n3 = (this.getChild("n3"));
  13161. this.tipsTxt = (this.getChild("tipsTxt"));
  13162. this.cancelBtn = (this.getChild("cancelBtn"));
  13163. this.sureBtn = (this.getChild("sureBtn"));
  13164. this.n11 = (this.getChild("n11"));
  13165. this.n13 = (this.getChild("n13"));
  13166. this.n14 = (this.getChild("n14"));
  13167. this.womanTxt = (this.getChild("womanTxt"));
  13168. this.t0 = this.getTransition("t0");
  13169. }
  13170. }
  13171. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13172. class ui_dh_js_shengli extends fgui.GComponent {
  13173. static createInstance() {
  13174. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13175. }
  13176. onConstruct() {
  13177. this.n3 = (this.getChild("n3"));
  13178. this.n4 = (this.getChild("n4"));
  13179. this.n1 = (this.getChild("n1"));
  13180. this.n2 = (this.getChild("n2"));
  13181. this.n5 = (this.getChild("n5"));
  13182. this.n6 = (this.getChild("n6"));
  13183. this.n7 = (this.getChild("n7"));
  13184. this.n8 = (this.getChild("n8"));
  13185. this.attack = this.getTransition("attack");
  13186. this.idle = this.getTransition("idle");
  13187. }
  13188. }
  13189. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13190. class ui_dh_js_shengli_g extends fgui.GComponent {
  13191. static createInstance() {
  13192. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13193. }
  13194. onConstruct() {
  13195. this.n3 = (this.getChild("n3"));
  13196. this.n1 = (this.getChild("n1"));
  13197. this.t0 = this.getTransition("t0");
  13198. }
  13199. }
  13200. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13201. class ui_dh_js_shibai extends fgui.GComponent {
  13202. static createInstance() {
  13203. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13204. }
  13205. onConstruct() {
  13206. this.n0 = (this.getChild("n0"));
  13207. this.n1 = (this.getChild("n1"));
  13208. this.n2 = (this.getChild("n2"));
  13209. this.n3 = (this.getChild("n3"));
  13210. this.idle = this.getTransition("idle");
  13211. this.attack = this.getTransition("attack");
  13212. }
  13213. }
  13214. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13215. class ui_dh_zy_ganfa extends fgui.GButton {
  13216. static createInstance() {
  13217. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13218. }
  13219. onConstruct() {
  13220. this.n0 = (this.getChild("n0"));
  13221. }
  13222. }
  13223. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13224. class ui_dh_zy_sc_guang extends fgui.GButton {
  13225. static createInstance() {
  13226. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13227. }
  13228. onConstruct() {
  13229. this.n0 = (this.getChild("n0"));
  13230. this.n2 = (this.getChild("n2"));
  13231. }
  13232. }
  13233. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13234. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13235. static createInstance() {
  13236. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13237. }
  13238. onConstruct() {
  13239. this.n0 = (this.getChild("n0"));
  13240. this.n3 = (this.getChild("n3"));
  13241. this.t0 = this.getTransition("t0");
  13242. }
  13243. }
  13244. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13245. class ui_dh_zy_wanfa extends fgui.GButton {
  13246. static createInstance() {
  13247. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13248. }
  13249. onConstruct() {
  13250. this.n0 = (this.getChild("n0"));
  13251. }
  13252. }
  13253. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13254. class ui_Component53_1 extends fgui.GComponent {
  13255. static createInstance() {
  13256. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13257. }
  13258. onConstruct() {
  13259. this.n0 = (this.getChild("n0"));
  13260. this.n1 = (this.getChild("n1"));
  13261. this.n2 = (this.getChild("n2"));
  13262. this.n3 = (this.getChild("n3"));
  13263. this.n4 = (this.getChild("n4"));
  13264. this.n5 = (this.getChild("n5"));
  13265. this.n6 = (this.getChild("n6"));
  13266. this.n7 = (this.getChild("n7"));
  13267. this.n8 = (this.getChild("n8"));
  13268. this.n9 = (this.getChild("n9"));
  13269. this.n10 = (this.getChild("n10"));
  13270. this.n11 = (this.getChild("n11"));
  13271. this.n12 = (this.getChild("n12"));
  13272. this.n13 = (this.getChild("n13"));
  13273. this.n14 = (this.getChild("n14"));
  13274. this.n15 = (this.getChild("n15"));
  13275. this.n16 = (this.getChild("n16"));
  13276. this.n19 = (this.getChild("n19"));
  13277. this.n20 = (this.getChild("n20"));
  13278. this.n21 = (this.getChild("n21"));
  13279. this.n22 = (this.getChild("n22"));
  13280. this.n23 = (this.getChild("n23"));
  13281. this.n24 = (this.getChild("n24"));
  13282. this.n25 = (this.getChild("n25"));
  13283. this.n26 = (this.getChild("n26"));
  13284. this.n27 = (this.getChild("n27"));
  13285. this.n28 = (this.getChild("n28"));
  13286. this.n29 = (this.getChild("n29"));
  13287. this.n30 = (this.getChild("n30"));
  13288. this.n31 = (this.getChild("n31"));
  13289. this.n32 = (this.getChild("n32"));
  13290. this.n33 = (this.getChild("n33"));
  13291. this.n34 = (this.getChild("n34"));
  13292. this.n35 = (this.getChild("n35"));
  13293. this.t0 = this.getTransition("t0");
  13294. }
  13295. }
  13296. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13297. class ui_Component30 extends fgui.GComponent {
  13298. static createInstance() {
  13299. return (fgui.UIPackage.createObject("game", "Component30"));
  13300. }
  13301. onConstruct() {
  13302. this.c1 = this.getController("c1");
  13303. this.n46 = (this.getChild("n46"));
  13304. this.n47 = (this.getChild("n47"));
  13305. this.numTxt = (this.getChild("numTxt"));
  13306. this.n50 = (this.getChild("n50"));
  13307. this.n53 = (this.getChild("n53"));
  13308. this.n54 = (this.getChild("n54"));
  13309. this.n55 = (this.getChild("n55"));
  13310. this.n56 = (this.getChild("n56"));
  13311. }
  13312. }
  13313. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13314. class ui_Component30_1 extends fgui.GComponent {
  13315. static createInstance() {
  13316. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13317. }
  13318. onConstruct() {
  13319. this.c1 = this.getController("c1");
  13320. this.n46 = (this.getChild("n46"));
  13321. this.n47 = (this.getChild("n47"));
  13322. this.numTxt = (this.getChild("numTxt"));
  13323. this.n50 = (this.getChild("n50"));
  13324. this.n51 = (this.getChild("n51"));
  13325. this.n52 = (this.getChild("n52"));
  13326. this.n53 = (this.getChild("n53"));
  13327. this.n54 = (this.getChild("n54"));
  13328. }
  13329. }
  13330. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13331. class ui_Component31 extends fgui.GComponent {
  13332. static createInstance() {
  13333. return (fgui.UIPackage.createObject("game", "Component31"));
  13334. }
  13335. onConstruct() {
  13336. this.n55 = (this.getChild("n55"));
  13337. this.n54 = (this.getChild("n54"));
  13338. this.conditionTxt = (this.getChild("conditionTxt"));
  13339. this.n57 = (this.getChild("n57"));
  13340. this.t0 = this.getTransition("t0");
  13341. }
  13342. }
  13343. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13344. class ui_Component32 extends fgui.GComponent {
  13345. static createInstance() {
  13346. return (fgui.UIPackage.createObject("game", "Component32"));
  13347. }
  13348. onConstruct() {
  13349. this.n5 = (this.getChild("n5"));
  13350. this.n6 = (this.getChild("n6"));
  13351. this.n7 = (this.getChild("n7"));
  13352. this.t0 = this.getTransition("t0");
  13353. }
  13354. }
  13355. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13356. class ui_AwardItem extends fgui.GComponent {
  13357. static createInstance() {
  13358. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13359. }
  13360. onConstruct() {
  13361. this.n9 = (this.getChild("n9"));
  13362. this.myIcon = (this.getChild("myIcon"));
  13363. this.numTxt = (this.getChild("numTxt"));
  13364. this.nameTxt = (this.getChild("nameTxt"));
  13365. this.n16 = (this.getChild("n16"));
  13366. this.n17 = (this.getChild("n17"));
  13367. }
  13368. }
  13369. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13370. class ui_ranking_com1 extends fgui.GButton {
  13371. static createInstance() {
  13372. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13373. }
  13374. onConstruct() {
  13375. this.c1 = this.getController("c1");
  13376. this.n49 = (this.getChild("n49"));
  13377. this.n18 = (this.getChild("n18"));
  13378. this.n46 = (this.getChild("n46"));
  13379. this.n48 = (this.getChild("n48"));
  13380. this.n50 = (this.getChild("n50"));
  13381. }
  13382. }
  13383. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13384. class ui_ranking_com2 extends fgui.GButton {
  13385. static createInstance() {
  13386. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13387. }
  13388. onConstruct() {
  13389. this.c1 = this.getController("c1");
  13390. this.n49 = (this.getChild("n49"));
  13391. this.n18 = (this.getChild("n18"));
  13392. this.n46 = (this.getChild("n46"));
  13393. this.n48 = (this.getChild("n48"));
  13394. this.n50 = (this.getChild("n50"));
  13395. }
  13396. }
  13397. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13398. class ui_ranking_com3 extends fgui.GComponent {
  13399. static createInstance() {
  13400. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13401. }
  13402. onConstruct() {
  13403. this.n17 = (this.getChild("n17"));
  13404. this.myIcon = (this.getChild("myIcon"));
  13405. }
  13406. }
  13407. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13408. class ui_ranking_com4 extends fgui.GComponent {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13411. }
  13412. onConstruct() {
  13413. this.n16 = (this.getChild("n16"));
  13414. this.head = (this.getChild("head"));
  13415. }
  13416. }
  13417. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13418. class ui_ranking_com5 extends fgui.GComponent {
  13419. static createInstance() {
  13420. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13421. }
  13422. onConstruct() {
  13423. this.c1 = this.getController("c1");
  13424. this.c2 = this.getController("c2");
  13425. this.n2 = (this.getChild("n2"));
  13426. this.n3 = (this.getChild("n3"));
  13427. this.levelBtn = (this.getChild("levelBtn"));
  13428. this.starBtn = (this.getChild("starBtn"));
  13429. this.n23 = (this.getChild("n23"));
  13430. this.n24 = (this.getChild("n24"));
  13431. this.n25 = (this.getChild("n25"));
  13432. this.myList = (this.getChild("myList"));
  13433. this.selfNode = (this.getChild("selfNode"));
  13434. this.n9 = (this.getChild("n9"));
  13435. this.n12 = (this.getChild("n12"));
  13436. this.n13 = (this.getChild("n13"));
  13437. this.n14 = (this.getChild("n14"));
  13438. this.n39 = (this.getChild("n39"));
  13439. this.n41 = (this.getChild("n41"));
  13440. this.n42 = (this.getChild("n42"));
  13441. this.n45 = (this.getChild("n45"));
  13442. this.changeBtn = (this.getChild("changeBtn"));
  13443. this.closeBtn = (this.getChild("closeBtn"));
  13444. this.t0 = this.getTransition("t0");
  13445. }
  13446. }
  13447. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13448. class ui_RankItem extends fgui.GComponent {
  13449. static createInstance() {
  13450. return (fgui.UIPackage.createObject("game", "RankItem"));
  13451. }
  13452. onConstruct() {
  13453. this.n10 = (this.getChild("n10"));
  13454. this.n11 = (this.getChild("n11"));
  13455. this.rankTxt = (this.getChild("rankTxt"));
  13456. this.headNode = (this.getChild("headNode"));
  13457. this.nameTxt = (this.getChild("nameTxt"));
  13458. this.n19 = (this.getChild("n19"));
  13459. this.valueTxt = (this.getChild("valueTxt"));
  13460. this.img1 = (this.getChild("img1"));
  13461. this.img2 = (this.getChild("img2"));
  13462. this.img3 = (this.getChild("img3"));
  13463. }
  13464. }
  13465. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13466. class ui_ranking_com9 extends fgui.GComponent {
  13467. static createInstance() {
  13468. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13469. }
  13470. onConstruct() {
  13471. this.c1 = this.getController("c1");
  13472. this.n27 = (this.getChild("n27"));
  13473. this.n28 = (this.getChild("n28"));
  13474. this.headNode = (this.getChild("headNode"));
  13475. this.rankTxt = (this.getChild("rankTxt"));
  13476. this.nameTxt = (this.getChild("nameTxt"));
  13477. this.n34 = (this.getChild("n34"));
  13478. this.valueTxt = (this.getChild("valueTxt"));
  13479. this.n36 = (this.getChild("n36"));
  13480. this.n37 = (this.getChild("n37"));
  13481. this.n38 = (this.getChild("n38"));
  13482. this.n39 = (this.getChild("n39"));
  13483. this.n40 = (this.getChild("n40"));
  13484. }
  13485. }
  13486. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13487. class ui_ranking_com10 extends fgui.GComponent {
  13488. static createInstance() {
  13489. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13490. }
  13491. onConstruct() {
  13492. this.n23 = (this.getChild("n23"));
  13493. this.n24 = (this.getChild("n24"));
  13494. }
  13495. }
  13496. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13497. class ui_ranking_com11 extends fgui.GComponent {
  13498. static createInstance() {
  13499. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13500. }
  13501. onConstruct() {
  13502. this.n24 = (this.getChild("n24"));
  13503. this.n25 = (this.getChild("n25"));
  13504. this.t0 = this.getTransition("t0");
  13505. }
  13506. }
  13507. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13508. class ui_ranking_com13 extends fgui.GButton {
  13509. static createInstance() {
  13510. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13511. }
  13512. onConstruct() {
  13513. this.c1 = this.getController("c1");
  13514. this.n44 = (this.getChild("n44"));
  13515. this.n45 = (this.getChild("n45"));
  13516. this.n46 = (this.getChild("n46"));
  13517. }
  13518. }
  13519. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13520. class ui_Component122 extends fgui.GComponent {
  13521. static createInstance() {
  13522. return (fgui.UIPackage.createObject("game", "Component122"));
  13523. }
  13524. onConstruct() {
  13525. this.gameNode3 = (this.getChild("gameNode3"));
  13526. }
  13527. }
  13528. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13529. class ui_skillItem extends fgui.GComponent {
  13530. static createInstance() {
  13531. return (fgui.UIPackage.createObject("game", "skillItem"));
  13532. }
  13533. onConstruct() {
  13534. this.c1 = this.getController("c1");
  13535. this.n31 = (this.getChild("n31"));
  13536. this.n6 = (this.getChild("n6"));
  13537. this.skillImg = (this.getChild("skillImg"));
  13538. this.nameTxt = (this.getChild("nameTxt"));
  13539. this.levelTxt = (this.getChild("levelTxt"));
  13540. this.n28 = (this.getChild("n28"));
  13541. this.describeTxt = (this.getChild("describeTxt"));
  13542. this.n32 = (this.getChild("n32"));
  13543. this.mutiBtn = (this.getChild("mutiBtn"));
  13544. this.tryNode = (this.getChild("tryNode"));
  13545. this.normalBtn = (this.getChild("normalBtn"));
  13546. this.startBtn = (this.getChild("startBtn"));
  13547. this.n42 = (this.getChild("n42"));
  13548. this.n43 = (this.getChild("n43"));
  13549. this.n44 = (this.getChild("n44"));
  13550. }
  13551. }
  13552. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13553. class ui_Component26 extends fgui.GButton {
  13554. static createInstance() {
  13555. return (fgui.UIPackage.createObject("game", "Component26"));
  13556. }
  13557. onConstruct() {
  13558. this.n11 = (this.getChild("n11"));
  13559. this.n30 = (this.getChild("n30"));
  13560. this.n34 = (this.getChild("n34"));
  13561. }
  13562. }
  13563. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13564. class ui_Component28 extends fgui.GButton {
  13565. static createInstance() {
  13566. return (fgui.UIPackage.createObject("game", "Component28"));
  13567. }
  13568. onConstruct() {
  13569. this.n12 = (this.getChild("n12"));
  13570. this.n31 = (this.getChild("n31"));
  13571. this.curTxt = (this.getChild("curTxt"));
  13572. this.n33 = (this.getChild("n33"));
  13573. }
  13574. }
  13575. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13576. class ui_Component1302 extends fgui.GComponent {
  13577. static createInstance() {
  13578. return (fgui.UIPackage.createObject("game", "Component1302"));
  13579. }
  13580. onConstruct() {
  13581. this.n2 = (this.getChild("n2"));
  13582. this.n3 = (this.getChild("n3"));
  13583. }
  13584. }
  13585. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13586. class ui_Component113 extends fgui.GComponent {
  13587. static createInstance() {
  13588. return (fgui.UIPackage.createObject("game", "Component113"));
  13589. }
  13590. onConstruct() {
  13591. this.n85 = (this.getChild("n85"));
  13592. this.n86 = (this.getChild("n86"));
  13593. this.n77 = (this.getChild("n77"));
  13594. this.n79 = (this.getChild("n79"));
  13595. this.n80 = (this.getChild("n80"));
  13596. this.n81 = (this.getChild("n81"));
  13597. this.n82 = (this.getChild("n82"));
  13598. this.n84 = (this.getChild("n84"));
  13599. this.n87 = (this.getChild("n87"));
  13600. this.t0 = this.getTransition("t0");
  13601. }
  13602. }
  13603. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13604. class ui_Component114 extends fgui.GComponent {
  13605. static createInstance() {
  13606. return (fgui.UIPackage.createObject("game", "Component114"));
  13607. }
  13608. onConstruct() {
  13609. this.n77 = (this.getChild("n77"));
  13610. this.t0 = this.getTransition("t0");
  13611. }
  13612. }
  13613. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13614. class ui_Component115 extends fgui.GComponent {
  13615. static createInstance() {
  13616. return (fgui.UIPackage.createObject("game", "Component115"));
  13617. }
  13618. onConstruct() {
  13619. this.n83 = (this.getChild("n83"));
  13620. this.fingerNode = (this.getChild("fingerNode"));
  13621. this.n84 = (this.getChild("n84"));
  13622. }
  13623. }
  13624. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13625. class ui_Component117 extends fgui.GComponent {
  13626. static createInstance() {
  13627. return (fgui.UIPackage.createObject("game", "Component117"));
  13628. }
  13629. onConstruct() {
  13630. this.n87 = (this.getChild("n87"));
  13631. this.n88 = (this.getChild("n88"));
  13632. this.n84 = (this.getChild("n84"));
  13633. this.n85 = (this.getChild("n85"));
  13634. this.n86 = (this.getChild("n86"));
  13635. this.t0 = this.getTransition("t0");
  13636. }
  13637. }
  13638. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13639. class ui_Component98_1 extends fgui.GButton {
  13640. static createInstance() {
  13641. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13642. }
  13643. onConstruct() {
  13644. this.c1 = this.getController("c1");
  13645. this.n8 = (this.getChild("n8"));
  13646. this.n41 = (this.getChild("n41"));
  13647. this.n40 = (this.getChild("n40"));
  13648. }
  13649. }
  13650. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13651. class ui_Component61 extends fgui.GComponent {
  13652. static createInstance() {
  13653. return (fgui.UIPackage.createObject("game", "Component61"));
  13654. }
  13655. onConstruct() {
  13656. this.n14 = (this.getChild("n14"));
  13657. this.n6 = (this.getChild("n6"));
  13658. this.t0 = this.getTransition("t0");
  13659. }
  13660. }
  13661. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13662. class ui_Component62 extends fgui.GComponent {
  13663. static createInstance() {
  13664. return (fgui.UIPackage.createObject("game", "Component62"));
  13665. }
  13666. onConstruct() {
  13667. this.n66 = (this.getChild("n66"));
  13668. this.n56 = (this.getChild("n56"));
  13669. this.n63 = (this.getChild("n63"));
  13670. this.n65 = (this.getChild("n65"));
  13671. this.t0 = this.getTransition("t0");
  13672. }
  13673. }
  13674. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13675. class ui_d3Root extends fgui.GComponent {
  13676. static createInstance() {
  13677. return (fgui.UIPackage.createObject("game", "d3Root"));
  13678. }
  13679. onConstruct() {
  13680. }
  13681. }
  13682. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13683. class ui_d2Root extends fgui.GComponent {
  13684. static createInstance() {
  13685. return (fgui.UIPackage.createObject("game", "d2Root"));
  13686. }
  13687. onConstruct() {
  13688. }
  13689. }
  13690. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13691. class ui_ballNode extends fgui.GComponent {
  13692. static createInstance() {
  13693. return (fgui.UIPackage.createObject("game", "ballNode"));
  13694. }
  13695. onConstruct() {
  13696. }
  13697. }
  13698. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13699. class ui_border extends fgui.GComponent {
  13700. static createInstance() {
  13701. return (fgui.UIPackage.createObject("game", "border"));
  13702. }
  13703. onConstruct() {
  13704. this.bar1 = (this.getChild("bar1"));
  13705. this.bar2 = (this.getChild("bar2"));
  13706. this.bar3 = (this.getChild("bar3"));
  13707. this.bar4 = (this.getChild("bar4"));
  13708. this.bar5 = (this.getChild("bar5"));
  13709. this.bar6 = (this.getChild("bar6"));
  13710. this.circle1 = (this.getChild("circle1"));
  13711. this.circle2 = (this.getChild("circle2"));
  13712. this.circle3 = (this.getChild("circle3"));
  13713. this.circle4 = (this.getChild("circle4"));
  13714. this.circle5 = (this.getChild("circle5"));
  13715. this.circle6 = (this.getChild("circle6"));
  13716. this.n28 = (this.getChild("n28"));
  13717. }
  13718. }
  13719. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13720. class ui_Component41_2 extends fgui.GComponent {
  13721. static createInstance() {
  13722. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13723. }
  13724. onConstruct() {
  13725. this.c1 = this.getController("c1");
  13726. this.n0 = (this.getChild("n0"));
  13727. this.n2 = (this.getChild("n2"));
  13728. this.n19 = (this.getChild("n19"));
  13729. this.cancelBtn = (this.getChild("cancelBtn"));
  13730. this.videoBtn = (this.getChild("videoBtn"));
  13731. this.n9 = (this.getChild("n9"));
  13732. this.n22 = (this.getChild("n22"));
  13733. this.tipsTxt = (this.getChild("tipsTxt"));
  13734. this.n23 = (this.getChild("n23"));
  13735. this.n24 = (this.getChild("n24"));
  13736. this.n26 = (this.getChild("n26"));
  13737. this.n27 = (this.getChild("n27"));
  13738. this.titleTxt = (this.getChild("titleTxt"));
  13739. }
  13740. }
  13741. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13742. class ui_Component41_1 extends fgui.GComponent {
  13743. static createInstance() {
  13744. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13745. }
  13746. onConstruct() {
  13747. this.c1 = this.getController("c1");
  13748. this.n0 = (this.getChild("n0"));
  13749. this.n2 = (this.getChild("n2"));
  13750. this.cancelBtn = (this.getChild("cancelBtn"));
  13751. this.videoBtn = (this.getChild("videoBtn"));
  13752. this.n27 = (this.getChild("n27"));
  13753. this.n30 = (this.getChild("n30"));
  13754. this.n31 = (this.getChild("n31"));
  13755. this.n32 = (this.getChild("n32"));
  13756. this.n33 = (this.getChild("n33"));
  13757. this.n34 = (this.getChild("n34"));
  13758. this.n35 = (this.getChild("n35"));
  13759. this.n36 = (this.getChild("n36"));
  13760. this.n1 = (this.getChild("n1"));
  13761. this.n37 = (this.getChild("n37"));
  13762. this.t0 = this.getTransition("t0");
  13763. this.t1 = this.getTransition("t1");
  13764. this.t2 = this.getTransition("t2");
  13765. this.t3 = this.getTransition("t3");
  13766. }
  13767. }
  13768. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13769. class ui_againBtn extends fgui.GButton {
  13770. static createInstance() {
  13771. return (fgui.UIPackage.createObject("game", "againBtn"));
  13772. }
  13773. onConstruct() {
  13774. this.n2 = (this.getChild("n2"));
  13775. this.n1 = (this.getChild("n1"));
  13776. this.n5 = (this.getChild("n5"));
  13777. }
  13778. }
  13779. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13780. class ui_Component118 extends fgui.GButton {
  13781. static createInstance() {
  13782. return (fgui.UIPackage.createObject("game", "Component118"));
  13783. }
  13784. onConstruct() {
  13785. this.c1 = this.getController("c1");
  13786. this.n14 = (this.getChild("n14"));
  13787. this.n9 = (this.getChild("n9"));
  13788. this.n10 = (this.getChild("n10"));
  13789. this.diamondTxt = (this.getChild("diamondTxt"));
  13790. this.n13 = (this.getChild("n13"));
  13791. this.n15 = (this.getChild("n15"));
  13792. }
  13793. }
  13794. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13795. class ui_Component119 extends fgui.GComponent {
  13796. static createInstance() {
  13797. return (fgui.UIPackage.createObject("game", "Component119"));
  13798. }
  13799. onConstruct() {
  13800. this.n1 = (this.getChild("n1"));
  13801. this.n2 = (this.getChild("n2"));
  13802. this.n13 = (this.getChild("n13"));
  13803. this.n6 = (this.getChild("n6"));
  13804. this.screenNode = (this.getChild("screenNode"));
  13805. this.n15 = (this.getChild("n15"));
  13806. this.closeBtn = (this.getChild("closeBtn"));
  13807. this.share2Btn = (this.getChild("share2Btn"));
  13808. this.shareBtn = (this.getChild("shareBtn"));
  13809. this.tipsNode = (this.getChild("tipsNode"));
  13810. this.awardNode = (this.getChild("awardNode"));
  13811. }
  13812. }
  13813. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13814. class ui_Component132_1 extends fgui.GComponent {
  13815. static createInstance() {
  13816. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13817. }
  13818. onConstruct() {
  13819. this.n25 = (this.getChild("n25"));
  13820. this.n26 = (this.getChild("n26"));
  13821. this.n27 = (this.getChild("n27"));
  13822. this.t0 = this.getTransition("t0");
  13823. }
  13824. }
  13825. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13826. class ui_SecretaryDisplay extends fgui.GComponent {
  13827. static createInstance() {
  13828. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13829. }
  13830. onConstruct() {
  13831. this.n2 = (this.getChild("n2"));
  13832. this.levelTxt = (this.getChild("levelTxt"));
  13833. this.n4 = (this.getChild("n4"));
  13834. this.secretary = (this.getChild("secretary"));
  13835. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13836. this.n16 = (this.getChild("n16"));
  13837. this.n37 = (this.getChild("n37"));
  13838. this.n41 = (this.getChild("n41"));
  13839. this.n14 = (this.getChild("n14"));
  13840. this.n17 = (this.getChild("n17"));
  13841. this.heightTxt = (this.getChild("heightTxt"));
  13842. this.n46 = (this.getChild("n46"));
  13843. this.n36 = (this.getChild("n36"));
  13844. this.n38 = (this.getChild("n38"));
  13845. this.foodTxt = (this.getChild("foodTxt"));
  13846. this.n47 = (this.getChild("n47"));
  13847. this.n40 = (this.getChild("n40"));
  13848. this.n42 = (this.getChild("n42"));
  13849. this.historyTxt = (this.getChild("historyTxt"));
  13850. this.n48 = (this.getChild("n48"));
  13851. this.nameImg = (this.getChild("nameImg"));
  13852. this.n12 = (this.getChild("n12"));
  13853. this.n49 = (this.getChild("n49"));
  13854. this.t0 = this.getTransition("t0");
  13855. }
  13856. }
  13857. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  13858. class ui_BallRodDisplay extends fgui.GComponent {
  13859. static createInstance() {
  13860. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  13861. }
  13862. onConstruct() {
  13863. this.c1 = this.getController("c1");
  13864. this.n31 = (this.getChild("n31"));
  13865. this.n6 = (this.getChild("n6"));
  13866. this.nameTxt = (this.getChild("nameTxt"));
  13867. this.rodImg = (this.getChild("rodImg"));
  13868. this.levelNode = (this.getChild("levelNode"));
  13869. this.eftRod = (this.getChild("eftRod"));
  13870. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13871. }
  13872. }
  13873. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  13874. class ui_Component111_11 extends fgui.GComponent {
  13875. static createInstance() {
  13876. return (fgui.UIPackage.createObject("game", "Component111_11"));
  13877. }
  13878. onConstruct() {
  13879. this.n68 = (this.getChild("n68"));
  13880. this.n69 = (this.getChild("n69"));
  13881. }
  13882. }
  13883. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  13884. class ui_Component112 extends fgui.GComponent {
  13885. static createInstance() {
  13886. return (fgui.UIPackage.createObject("game", "Component112"));
  13887. }
  13888. onConstruct() {
  13889. this.n68 = (this.getChild("n68"));
  13890. this.n70 = (this.getChild("n70"));
  13891. this.myMask = (this.getChild("myMask"));
  13892. }
  13893. }
  13894. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  13895. class ui_Component111 extends fgui.GComponent {
  13896. static createInstance() {
  13897. return (fgui.UIPackage.createObject("game", "Component111"));
  13898. }
  13899. onConstruct() {
  13900. this.n68 = (this.getChild("n68"));
  13901. this.myMask = (this.getChild("myMask"));
  13902. }
  13903. }
  13904. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  13905. class ui_Component144 extends fgui.GButton {
  13906. static createInstance() {
  13907. return (fgui.UIPackage.createObject("game", "Component144"));
  13908. }
  13909. onConstruct() {
  13910. this.n8 = (this.getChild("n8"));
  13911. }
  13912. }
  13913. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  13914. class ui_Sign_com2 extends fgui.GComponent {
  13915. static createInstance() {
  13916. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  13917. }
  13918. onConstruct() {
  13919. this.n0 = (this.getChild("n0"));
  13920. this.n1 = (this.getChild("n1"));
  13921. this.t0 = this.getTransition("t0");
  13922. }
  13923. }
  13924. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  13925. class ui_Sign_guang extends fgui.GComponent {
  13926. static createInstance() {
  13927. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  13928. }
  13929. onConstruct() {
  13930. this.n1 = (this.getChild("n1"));
  13931. this.n2 = (this.getChild("n2"));
  13932. this.n3 = (this.getChild("n3"));
  13933. this.n4 = (this.getChild("n4"));
  13934. this.n5 = (this.getChild("n5"));
  13935. this.n6 = (this.getChild("n6"));
  13936. this.n8 = (this.getChild("n8"));
  13937. }
  13938. }
  13939. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  13940. class ui_SignMax extends fgui.GComponent {
  13941. static createInstance() {
  13942. return (fgui.UIPackage.createObject("game", "SignMax"));
  13943. }
  13944. onConstruct() {
  13945. this.c1 = this.getController("c1");
  13946. this.n7 = (this.getChild("n7"));
  13947. this.n15 = (this.getChild("n15"));
  13948. this.n8 = (this.getChild("n8"));
  13949. this.titleTxt = (this.getChild("titleTxt"));
  13950. this.myIcon1 = (this.getChild("myIcon1"));
  13951. this.numTxt1 = (this.getChild("numTxt1"));
  13952. this.myIcon2 = (this.getChild("myIcon2"));
  13953. this.n20 = (this.getChild("n20"));
  13954. this.n17 = (this.getChild("n17"));
  13955. this.numTxt2 = (this.getChild("numTxt2"));
  13956. this.n12 = (this.getChild("n12"));
  13957. this.n13 = (this.getChild("n13"));
  13958. this.n21 = (this.getChild("n21"));
  13959. this.n14 = (this.getChild("n14"));
  13960. }
  13961. }
  13962. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  13963. class ui_Sign_com2_1 extends fgui.GComponent {
  13964. static createInstance() {
  13965. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  13966. }
  13967. onConstruct() {
  13968. this.n0 = (this.getChild("n0"));
  13969. this.n1 = (this.getChild("n1"));
  13970. this.t0 = this.getTransition("t0");
  13971. }
  13972. }
  13973. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  13974. class ui_Sign_com5 extends fgui.GComponent {
  13975. static createInstance() {
  13976. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  13977. }
  13978. onConstruct() {
  13979. this.n3 = (this.getChild("n3"));
  13980. this.n29 = (this.getChild("n29"));
  13981. this.n4 = (this.getChild("n4"));
  13982. this.day1 = (this.getChild("day1"));
  13983. this.day2 = (this.getChild("day2"));
  13984. this.day3 = (this.getChild("day3"));
  13985. this.day4 = (this.getChild("day4"));
  13986. this.day5 = (this.getChild("day5"));
  13987. this.day6 = (this.getChild("day6"));
  13988. this.day7 = (this.getChild("day7"));
  13989. this.t0 = this.getTransition("t0");
  13990. }
  13991. }
  13992. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  13993. class ui_Sign_com8 extends fgui.GComponent {
  13994. static createInstance() {
  13995. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  13996. }
  13997. onConstruct() {
  13998. this.n48 = (this.getChild("n48"));
  13999. this.womanTxt = (this.getChild("womanTxt"));
  14000. this.t0 = this.getTransition("t0");
  14001. }
  14002. }
  14003. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14004. class ui_Sign_com6 extends fgui.GComponent {
  14005. static createInstance() {
  14006. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14007. }
  14008. onConstruct() {
  14009. this.n2 = (this.getChild("n2"));
  14010. this.n3 = (this.getChild("n3"));
  14011. this.t0 = this.getTransition("t0");
  14012. }
  14013. }
  14014. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14015. class ui_Sign_com7 extends fgui.GComponent {
  14016. static createInstance() {
  14017. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14018. }
  14019. onConstruct() {
  14020. this.n29 = (this.getChild("n29"));
  14021. this.n2 = (this.getChild("n2"));
  14022. }
  14023. }
  14024. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14025. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14026. static createInstance() {
  14027. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14028. }
  14029. onConstruct() {
  14030. this.n5 = (this.getChild("n5"));
  14031. this.n4 = (this.getChild("n4"));
  14032. this.t0 = this.getTransition("t0");
  14033. }
  14034. }
  14035. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14036. class ui_UITurntable_com2 extends fgui.GComponent {
  14037. static createInstance() {
  14038. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14039. }
  14040. onConstruct() {
  14041. this.c1 = this.getController("c1");
  14042. this.n4 = (this.getChild("n4"));
  14043. this.n6 = (this.getChild("n6"));
  14044. this.n10 = (this.getChild("n10"));
  14045. this.n11 = (this.getChild("n11"));
  14046. this.n12 = (this.getChild("n12"));
  14047. this.n13 = (this.getChild("n13"));
  14048. this.n14 = (this.getChild("n14"));
  14049. this.n15 = (this.getChild("n15"));
  14050. this.n16 = (this.getChild("n16"));
  14051. this.n17 = (this.getChild("n17"));
  14052. this.n18 = (this.getChild("n18"));
  14053. this.n19 = (this.getChild("n19"));
  14054. this.n20 = (this.getChild("n20"));
  14055. this.n21 = (this.getChild("n21"));
  14056. this.n22 = (this.getChild("n22"));
  14057. this.n23 = (this.getChild("n23"));
  14058. this.n24 = (this.getChild("n24"));
  14059. this.n25 = (this.getChild("n25"));
  14060. this.n26 = (this.getChild("n26"));
  14061. this.n27 = (this.getChild("n27"));
  14062. this.n28 = (this.getChild("n28"));
  14063. this.n29 = (this.getChild("n29"));
  14064. this.n30 = (this.getChild("n30"));
  14065. this.n31 = (this.getChild("n31"));
  14066. this.n32 = (this.getChild("n32"));
  14067. this.n33 = (this.getChild("n33"));
  14068. }
  14069. }
  14070. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14071. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14072. static createInstance() {
  14073. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14074. }
  14075. onConstruct() {
  14076. this.n5 = (this.getChild("n5"));
  14077. this.n4 = (this.getChild("n4"));
  14078. this.t0 = this.getTransition("t0");
  14079. }
  14080. }
  14081. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14082. class ui_UITurntable_com5 extends fgui.GComponent {
  14083. static createInstance() {
  14084. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14085. }
  14086. onConstruct() {
  14087. this.flashNode = (this.getChild("flashNode"));
  14088. this.rotNode = (this.getChild("rotNode"));
  14089. this.n3 = (this.getChild("n3"));
  14090. this.n21 = (this.getChild("n21"));
  14091. this.t0 = this.getTransition("t0");
  14092. }
  14093. }
  14094. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14095. class ui_UITurntable_com7 extends fgui.GComponent {
  14096. static createInstance() {
  14097. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14098. }
  14099. onConstruct() {
  14100. this.n2 = (this.getChild("n2"));
  14101. this.n35 = (this.getChild("n35"));
  14102. this.img1 = (this.getChild("img1"));
  14103. this.img2 = (this.getChild("img2"));
  14104. this.img3 = (this.getChild("img3"));
  14105. this.img4 = (this.getChild("img4"));
  14106. this.img6 = (this.getChild("img6"));
  14107. this.img5 = (this.getChild("img5"));
  14108. this.txt1 = (this.getChild("txt1"));
  14109. this.txt2 = (this.getChild("txt2"));
  14110. this.txt3 = (this.getChild("txt3"));
  14111. this.txt4 = (this.getChild("txt4"));
  14112. this.txt5 = (this.getChild("txt5"));
  14113. this.txt6 = (this.getChild("txt6"));
  14114. }
  14115. }
  14116. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14117. class ui_UITurntable_com9 extends fgui.GComponent {
  14118. static createInstance() {
  14119. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14120. }
  14121. onConstruct() {
  14122. this.n38 = (this.getChild("n38"));
  14123. this.n39 = (this.getChild("n39"));
  14124. }
  14125. }
  14126. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14127. class ui_UITurntable_com10 extends fgui.GComponent {
  14128. static createInstance() {
  14129. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14130. }
  14131. onConstruct() {
  14132. this.n39 = (this.getChild("n39"));
  14133. this.n40 = (this.getChild("n40"));
  14134. this.t0 = this.getTransition("t0");
  14135. }
  14136. }
  14137. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14138. class ui_UITurntable_com11 extends fgui.GComponent {
  14139. static createInstance() {
  14140. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14141. }
  14142. onConstruct() {
  14143. this.n38 = (this.getChild("n38"));
  14144. this.n39 = (this.getChild("n39"));
  14145. this.n40 = (this.getChild("n40"));
  14146. this.t0 = this.getTransition("t0");
  14147. }
  14148. }
  14149. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14150. class ui_UITurntable_com12 extends fgui.GComponent {
  14151. static createInstance() {
  14152. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14153. }
  14154. onConstruct() {
  14155. this.n43 = (this.getChild("n43"));
  14156. this.barNode = (this.getChild("barNode"));
  14157. this.tipsTxt = (this.getChild("tipsTxt"));
  14158. this.n45 = (this.getChild("n45"));
  14159. this.boxBtn = (this.getChild("boxBtn"));
  14160. }
  14161. }
  14162. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14163. class ui_UITurntable_com1 extends fgui.GButton {
  14164. static createInstance() {
  14165. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14166. }
  14167. onConstruct() {
  14168. this.n41 = (this.getChild("n41"));
  14169. this.n42 = (this.getChild("n42"));
  14170. this.t0 = this.getTransition("t0");
  14171. }
  14172. }
  14173. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14174. class ui_UITurntable_com3 extends fgui.GComponent {
  14175. static createInstance() {
  14176. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14177. }
  14178. onConstruct() {
  14179. this.n48 = (this.getChild("n48"));
  14180. this.womanTxt = (this.getChild("womanTxt"));
  14181. this.t0 = this.getTransition("t0");
  14182. }
  14183. }
  14184. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14185. class ui_cancelBtn2 extends fgui.GButton {
  14186. static createInstance() {
  14187. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14188. }
  14189. onConstruct() {
  14190. this.c1 = this.getController("c1");
  14191. this.n0 = (this.getChild("n0"));
  14192. this.n1 = (this.getChild("n1"));
  14193. this.n2 = (this.getChild("n2"));
  14194. this.n3 = (this.getChild("n3"));
  14195. this.n4 = (this.getChild("n4"));
  14196. this.n5 = (this.getChild("n5"));
  14197. this.n6 = (this.getChild("n6"));
  14198. this.n7 = (this.getChild("n7"));
  14199. this.n8 = (this.getChild("n8"));
  14200. this.powerEft = (this.getChild("powerEft"));
  14201. }
  14202. }
  14203. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14204. class ui_shareBtn2 extends fgui.GButton {
  14205. static createInstance() {
  14206. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14207. }
  14208. onConstruct() {
  14209. this.c1 = this.getController("c1");
  14210. this.n2 = (this.getChild("n2"));
  14211. this.n24 = (this.getChild("n24"));
  14212. this.n1 = (this.getChild("n1"));
  14213. this.n3 = (this.getChild("n3"));
  14214. this.n23 = (this.getChild("n23"));
  14215. this.n4 = (this.getChild("n4"));
  14216. this.n5 = (this.getChild("n5"));
  14217. this.n6 = (this.getChild("n6"));
  14218. this.n20 = (this.getChild("n20"));
  14219. this.n21 = (this.getChild("n21"));
  14220. this.n22 = (this.getChild("n22"));
  14221. this.powerEft = (this.getChild("powerEft"));
  14222. }
  14223. }
  14224. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14225. class ui_UIMoney extends fgui.GComponent {
  14226. static createInstance() {
  14227. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14228. }
  14229. onConstruct() {
  14230. this.c1 = this.getController("c1");
  14231. this.n4 = (this.getChild("n4"));
  14232. this.coinImg = (this.getChild("coinImg"));
  14233. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14234. this.coinTxt = (this.getChild("coinTxt"));
  14235. this.n7 = (this.getChild("n7"));
  14236. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14237. this.diamondTxt = (this.getChild("diamondTxt"));
  14238. this.diamondImg = (this.getChild("diamondImg"));
  14239. this.n12 = (this.getChild("n12"));
  14240. this.powerImg = (this.getChild("powerImg"));
  14241. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14242. this.powerTxt = (this.getChild("powerTxt"));
  14243. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14244. }
  14245. }
  14246. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14247. class ui_backBtn extends fgui.GButton {
  14248. static createInstance() {
  14249. return (fgui.UIPackage.createObject("game", "backBtn"));
  14250. }
  14251. onConstruct() {
  14252. this.n0 = (this.getChild("n0"));
  14253. this.t0 = this.getTransition("t0");
  14254. this.t1 = this.getTransition("t1");
  14255. }
  14256. }
  14257. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14258. class ui_MoneyBtn extends fgui.GButton {
  14259. static createInstance() {
  14260. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14261. }
  14262. onConstruct() {
  14263. this.button = this.getController("button");
  14264. this.n0 = (this.getChild("n0"));
  14265. }
  14266. }
  14267. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14268. class ui_UIMoneyBtn extends fgui.GComponent {
  14269. static createInstance() {
  14270. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14271. }
  14272. onConstruct() {
  14273. this.n1 = (this.getChild("n1"));
  14274. this.closeBtn = (this.getChild("closeBtn"));
  14275. }
  14276. }
  14277. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14278. class ui_Component64 extends fgui.GComponent {
  14279. static createInstance() {
  14280. return (fgui.UIPackage.createObject("game", "Component64"));
  14281. }
  14282. onConstruct() {
  14283. this.n57 = (this.getChild("n57"));
  14284. this.n54 = (this.getChild("n54"));
  14285. this.n55 = (this.getChild("n55"));
  14286. this.n56 = (this.getChild("n56"));
  14287. this.t1 = this.getTransition("t1");
  14288. }
  14289. }
  14290. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14291. class ui_Component41_3 extends fgui.GComponent {
  14292. static createInstance() {
  14293. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14294. }
  14295. onConstruct() {
  14296. this.c1 = this.getController("c1");
  14297. this.n0 = (this.getChild("n0"));
  14298. this.n2 = (this.getChild("n2"));
  14299. this.cancelBtn = (this.getChild("cancelBtn"));
  14300. this.videoBtn = (this.getChild("videoBtn"));
  14301. this.n9 = (this.getChild("n9"));
  14302. this.n24 = (this.getChild("n24"));
  14303. this.n27 = (this.getChild("n27"));
  14304. this.titleTxt = (this.getChild("titleTxt"));
  14305. this.n28 = (this.getChild("n28"));
  14306. this.t0 = this.getTransition("t0");
  14307. }
  14308. }
  14309. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14310. class ui_dh_zs_4 extends fgui.GComponent {
  14311. static createInstance() {
  14312. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14313. }
  14314. onConstruct() {
  14315. this.n1 = (this.getChild("n1"));
  14316. this.n2 = (this.getChild("n2"));
  14317. this.n3 = (this.getChild("n3"));
  14318. this.n4 = (this.getChild("n4"));
  14319. this.n5 = (this.getChild("n5"));
  14320. this.n6 = (this.getChild("n6"));
  14321. this.n8 = (this.getChild("n8"));
  14322. this.t0 = this.getTransition("t0");
  14323. }
  14324. }
  14325. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14326. class ui_Component71_1 extends fgui.GButton {
  14327. static createInstance() {
  14328. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14329. }
  14330. onConstruct() {
  14331. this.n17 = (this.getChild("n17"));
  14332. this.t0 = this.getTransition("t0");
  14333. }
  14334. }
  14335. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14336. class ui_Component83 extends fgui.GComponent {
  14337. static createInstance() {
  14338. return (fgui.UIPackage.createObject("game", "Component83"));
  14339. }
  14340. onConstruct() {
  14341. this.c1 = this.getController("c1");
  14342. this.n17 = (this.getChild("n17"));
  14343. this.n19 = (this.getChild("n19"));
  14344. this.n20 = (this.getChild("n20"));
  14345. }
  14346. }
  14347. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14348. class ui_Component84 extends fgui.GComponent {
  14349. static createInstance() {
  14350. return (fgui.UIPackage.createObject("game", "Component84"));
  14351. }
  14352. onConstruct() {
  14353. this.c1 = this.getController("c1");
  14354. this.n4 = (this.getChild("n4"));
  14355. this.n22 = (this.getChild("n22"));
  14356. this.n23 = (this.getChild("n23"));
  14357. this.numTxt = (this.getChild("numTxt"));
  14358. this.n25 = (this.getChild("n25"));
  14359. this.n26 = (this.getChild("n26"));
  14360. }
  14361. }
  14362. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14363. class ui_Component84_1 extends fgui.GComponent {
  14364. static createInstance() {
  14365. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14366. }
  14367. onConstruct() {
  14368. this.c1 = this.getController("c1");
  14369. this.n4 = (this.getChild("n4"));
  14370. this.n22 = (this.getChild("n22"));
  14371. this.n23 = (this.getChild("n23"));
  14372. this.numTxt = (this.getChild("numTxt"));
  14373. this.n25 = (this.getChild("n25"));
  14374. this.n26 = (this.getChild("n26"));
  14375. }
  14376. }
  14377. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14378. class ui_Component85 extends fgui.GComponent {
  14379. static createInstance() {
  14380. return (fgui.UIPackage.createObject("game", "Component85"));
  14381. }
  14382. onConstruct() {
  14383. this.n1 = (this.getChild("n1"));
  14384. this.n6 = (this.getChild("n6"));
  14385. this.n2 = (this.getChild("n2"));
  14386. this.n3 = (this.getChild("n3"));
  14387. this.levelTxt = (this.getChild("levelTxt"));
  14388. this.n10 = (this.getChild("n10"));
  14389. this.n11 = (this.getChild("n11"));
  14390. this.n12 = (this.getChild("n12"));
  14391. this.n13 = (this.getChild("n13"));
  14392. this.n14 = (this.getChild("n14"));
  14393. this.modeNode = (this.getChild("modeNode"));
  14394. this.n18 = (this.getChild("n18"));
  14395. this.conditionTxt = (this.getChild("conditionTxt"));
  14396. this.diamondNode = (this.getChild("diamondNode"));
  14397. this.coinNode = (this.getChild("coinNode"));
  14398. this.startBtn = (this.getChild("startBtn"));
  14399. this.n28 = (this.getChild("n28"));
  14400. this.displayRoot = (this.getChild("displayRoot"));
  14401. this.t0 = this.getTransition("t0");
  14402. }
  14403. }
  14404. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14405. class ui_Component86 extends fgui.GButton {
  14406. static createInstance() {
  14407. return (fgui.UIPackage.createObject("game", "Component86"));
  14408. }
  14409. onConstruct() {
  14410. this.n15 = (this.getChild("n15"));
  14411. this.t0 = this.getTransition("t0");
  14412. }
  14413. }
  14414. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14415. class ui_Component87 extends fgui.GComponent {
  14416. static createInstance() {
  14417. return (fgui.UIPackage.createObject("game", "Component87"));
  14418. }
  14419. onConstruct() {
  14420. this.n66 = (this.getChild("n66"));
  14421. this.myProgress = (this.getChild("myProgress"));
  14422. this.starAni = (this.getChild("starAni"));
  14423. this.hpTxt = (this.getChild("hpTxt"));
  14424. this.n74 = (this.getChild("n74"));
  14425. this.n73 = (this.getChild("n73"));
  14426. this.ballTxt = (this.getChild("ballTxt"));
  14427. this.n76 = (this.getChild("n76"));
  14428. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14429. this.levelTxt = (this.getChild("levelTxt"));
  14430. this.star1 = (this.getChild("star1"));
  14431. this.star2 = (this.getChild("star2"));
  14432. this.star3 = (this.getChild("star3"));
  14433. }
  14434. }
  14435. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14436. class ui_Component88 extends fgui.GProgressBar {
  14437. static createInstance() {
  14438. return (fgui.UIPackage.createObject("game", "Component88"));
  14439. }
  14440. onConstruct() {
  14441. this.n68 = (this.getChild("n68"));
  14442. this.bar = (this.getChild("bar"));
  14443. }
  14444. }
  14445. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14446. class ui_Component89 extends fgui.GComponent {
  14447. static createInstance() {
  14448. return (fgui.UIPackage.createObject("game", "Component89"));
  14449. }
  14450. onConstruct() {
  14451. this.c1 = this.getController("c1");
  14452. this.n71 = (this.getChild("n71"));
  14453. this.n72 = (this.getChild("n72"));
  14454. }
  14455. }
  14456. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14457. class ui_Component90 extends fgui.GComponent {
  14458. static createInstance() {
  14459. return (fgui.UIPackage.createObject("game", "Component90"));
  14460. }
  14461. onConstruct() {
  14462. this.c1 = this.getController("c1");
  14463. this.n64 = (this.getChild("n64"));
  14464. this.n65 = (this.getChild("n65"));
  14465. this.n66 = (this.getChild("n66"));
  14466. this.t0 = this.getTransition("t0");
  14467. }
  14468. }
  14469. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14470. class ui_Component127 extends fgui.GButton {
  14471. static createInstance() {
  14472. return (fgui.UIPackage.createObject("game", "Component127"));
  14473. }
  14474. onConstruct() {
  14475. this.n5 = (this.getChild("n5"));
  14476. }
  14477. }
  14478. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14479. class gameBinder {
  14480. static bindAll() {
  14481. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14482. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14483. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14484. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14485. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14486. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14487. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14488. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14489. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14490. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14491. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14492. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14493. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14494. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14495. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14496. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14497. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14498. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14499. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14500. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14501. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14502. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14503. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14504. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14505. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14506. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14507. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14508. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14509. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14510. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14511. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14512. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14513. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14514. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14515. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14516. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14517. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14518. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14519. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14520. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14521. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14522. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14523. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14524. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14525. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14526. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14527. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14528. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14529. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14530. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14531. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14532. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14533. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14534. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14535. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14536. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14537. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14538. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14539. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14540. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14541. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14542. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14543. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14544. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14545. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14546. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14547. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14548. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14549. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14550. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14551. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14552. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14553. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14554. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14555. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14556. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14557. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14558. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14559. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14560. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14561. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14562. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14563. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14564. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14565. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14566. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14567. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14568. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14569. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14570. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14571. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14572. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14573. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14574. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14575. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14576. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14577. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14578. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14579. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14580. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14581. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14582. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14583. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14584. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14585. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14586. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14587. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14588. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14589. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14590. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14591. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14592. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14593. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14594. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14595. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14596. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14597. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14598. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14599. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14600. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14601. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14602. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14603. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14604. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14605. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14606. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14607. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14608. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14609. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14610. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14611. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14612. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14613. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14614. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14615. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14616. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14617. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14618. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14619. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14620. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14621. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14622. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14623. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14624. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14625. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14626. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14627. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14628. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14629. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14630. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14631. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14632. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14633. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14634. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14635. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14636. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14637. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14638. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14639. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14640. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14641. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14642. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14643. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14644. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14645. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14646. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14647. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14648. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14649. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14650. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14651. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14652. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14653. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14654. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14655. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14656. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14657. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14658. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14659. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14660. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14661. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14662. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14663. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14664. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14665. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14666. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14667. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14668. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14669. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14670. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14671. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14672. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14673. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14674. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14675. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14676. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14677. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14678. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14679. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14680. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14681. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14682. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14683. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14684. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14685. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14686. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14687. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14688. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14689. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14690. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14691. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14692. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14693. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14694. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14695. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14696. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14697. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14698. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14699. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14700. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14701. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14702. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14703. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14704. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14705. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14706. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14707. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14708. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14709. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14710. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14711. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14712. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14713. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14714. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14715. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14716. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14717. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14718. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14719. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14720. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14721. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14722. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14723. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14724. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14725. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14726. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14727. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14728. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14729. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14730. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14731. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14732. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14733. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14734. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14735. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14736. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14737. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14738. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14739. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14740. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14741. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14742. }
  14743. }
  14744. class ui_btn6 extends fgui.GButton {
  14745. static createInstance() {
  14746. return (fgui.UIPackage.createObject("loading", "btn6"));
  14747. }
  14748. onConstruct() {
  14749. this.n6 = (this.getChild("n6"));
  14750. this.n1 = (this.getChild("n1"));
  14751. }
  14752. }
  14753. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14754. class ui_xyItem extends fgui.GComponent {
  14755. static createInstance() {
  14756. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14757. }
  14758. onConstruct() {
  14759. this.xyItem = (this.getChild("xyItem"));
  14760. }
  14761. }
  14762. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14763. class ui_loadinfo extends fgui.GProgressBar {
  14764. static createInstance() {
  14765. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14766. }
  14767. onConstruct() {
  14768. this.bg = (this.getChild("bg"));
  14769. this.bar = (this.getChild("bar"));
  14770. this.title = (this.getChild("title"));
  14771. this.ani = (this.getChild("ani"));
  14772. }
  14773. }
  14774. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14775. class ui_xyNode extends fgui.GComponent {
  14776. static createInstance() {
  14777. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14778. }
  14779. onConstruct() {
  14780. this.n0 = (this.getChild("n0"));
  14781. this.btnYes = (this.getChild("btnYes"));
  14782. this.btnNo = (this.getChild("btnNo"));
  14783. this.btnKnown = (this.getChild("btnKnown"));
  14784. this.btnSure = (this.getChild("btnSure"));
  14785. this.txtWelcom = (this.getChild("txtWelcom"));
  14786. this.txtXy = (this.getChild("txtXy"));
  14787. this.n75 = (this.getChild("n75"));
  14788. this.btnXy1 = (this.getChild("btnXy1"));
  14789. this.btnXy3 = (this.getChild("btnXy3"));
  14790. this.btnXy2 = (this.getChild("btnXy2"));
  14791. this.n74 = (this.getChild("n74"));
  14792. this.xy1 = (this.getChild("xy1"));
  14793. this.txtTitle = (this.getChild("txtTitle"));
  14794. this.btnBack = (this.getChild("btnBack"));
  14795. this.xyList = (this.getChild("xyList"));
  14796. this.xy2 = (this.getChild("xy2"));
  14797. this.xyNode = (this.getChild("xyNode"));
  14798. }
  14799. }
  14800. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14801. class ui_ageNode extends fgui.GComponent {
  14802. static createInstance() {
  14803. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14804. }
  14805. onConstruct() {
  14806. this.n3 = (this.getChild("n3"));
  14807. this.n7 = (this.getChild("n7"));
  14808. this.n4 = (this.getChild("n4"));
  14809. this.btnAge = (this.getChild("btnAge"));
  14810. this.ageNode = (this.getChild("ageNode"));
  14811. }
  14812. }
  14813. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14814. class ui_rnNode extends fgui.GComponent {
  14815. static createInstance() {
  14816. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14817. }
  14818. onConstruct() {
  14819. this.n28 = (this.getChild("n28"));
  14820. this.n30 = (this.getChild("n30"));
  14821. this.n33 = (this.getChild("n33"));
  14822. this.rn1 = (this.getChild("rn1"));
  14823. this.n40 = (this.getChild("n40"));
  14824. this.n41 = (this.getChild("n41"));
  14825. this.rn3 = (this.getChild("rn3"));
  14826. this.n37 = (this.getChild("n37"));
  14827. this.n39 = (this.getChild("n39"));
  14828. this.rn2 = (this.getChild("rn2"));
  14829. this.n47 = (this.getChild("n47"));
  14830. this.n49 = (this.getChild("n49"));
  14831. this.n44 = (this.getChild("n44"));
  14832. this.inputCode = (this.getChild("inputCode"));
  14833. this.inputName = (this.getChild("inputName"));
  14834. this.n48 = (this.getChild("n48"));
  14835. this.n50 = (this.getChild("n50"));
  14836. this.rn4 = (this.getChild("rn4"));
  14837. this.btnCheck = (this.getChild("btnCheck"));
  14838. this.btnExit = (this.getChild("btnExit"));
  14839. this.btnDone = (this.getChild("btnDone"));
  14840. this.rnNode = (this.getChild("rnNode"));
  14841. }
  14842. }
  14843. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14844. class ui_tipNode extends fgui.GComponent {
  14845. static createInstance() {
  14846. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14847. }
  14848. onConstruct() {
  14849. this.bg = (this.getChild("bg"));
  14850. this.n55 = (this.getChild("n55"));
  14851. this.n56 = (this.getChild("n56"));
  14852. this.tipNode = (this.getChild("tipNode"));
  14853. }
  14854. }
  14855. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14856. class ui_fcmNode extends fgui.GComponent {
  14857. static createInstance() {
  14858. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  14859. }
  14860. onConstruct() {
  14861. this.n63 = (this.getChild("n63"));
  14862. this.n62 = (this.getChild("n62"));
  14863. this.btnRn = (this.getChild("btnRn"));
  14864. this.n61 = (this.getChild("n61"));
  14865. this.n58 = (this.getChild("n58"));
  14866. this.fcmNode = (this.getChild("fcmNode"));
  14867. }
  14868. }
  14869. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  14870. class ui_msgNode extends fgui.GComponent {
  14871. static createInstance() {
  14872. return (fgui.UIPackage.createObject("loading", "msgNode"));
  14873. }
  14874. onConstruct() {
  14875. this.n69 = (this.getChild("n69"));
  14876. this.txtMsg = (this.getChild("txtMsg"));
  14877. this.msgNode = (this.getChild("msgNode"));
  14878. }
  14879. }
  14880. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  14881. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  14882. static createInstance() {
  14883. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  14884. }
  14885. onConstruct() {
  14886. this.n1 = (this.getChild("n1"));
  14887. this.n13 = (this.getChild("n13"));
  14888. this.n14 = (this.getChild("n14"));
  14889. this.n15 = (this.getChild("n15"));
  14890. this.n3 = (this.getChild("n3"));
  14891. this.n4 = (this.getChild("n4"));
  14892. this.n5 = (this.getChild("n5"));
  14893. this.n6 = (this.getChild("n6"));
  14894. this.n7 = (this.getChild("n7"));
  14895. this.n8 = (this.getChild("n8"));
  14896. this.n9 = (this.getChild("n9"));
  14897. this.n10 = (this.getChild("n10"));
  14898. this.n12 = (this.getChild("n12"));
  14899. this.n11 = (this.getChild("n11"));
  14900. this.n16 = (this.getChild("n16"));
  14901. this.n17 = (this.getChild("n17"));
  14902. this.n18 = (this.getChild("n18"));
  14903. this.n20 = (this.getChild("n20"));
  14904. this.n21 = (this.getChild("n21"));
  14905. this.t0 = this.getTransition("t0");
  14906. }
  14907. }
  14908. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  14909. class ui_btn5 extends fgui.GButton {
  14910. static createInstance() {
  14911. return (fgui.UIPackage.createObject("loading", "btn5"));
  14912. }
  14913. onConstruct() {
  14914. this.n9 = (this.getChild("n9"));
  14915. this.n1 = (this.getChild("n1"));
  14916. }
  14917. }
  14918. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  14919. class ui_UILoading extends fgui.GComponent {
  14920. static createInstance() {
  14921. return (fgui.UIPackage.createObject("loading", "UILoading"));
  14922. }
  14923. onConstruct() {
  14924. this.n12 = (this.getChild("n12"));
  14925. this.loadinfo = (this.getChild("loadinfo"));
  14926. this.n13 = (this.getChild("n13"));
  14927. this.txtLoad = (this.getChild("txtLoad"));
  14928. this.n18 = (this.getChild("n18"));
  14929. }
  14930. }
  14931. ui_UILoading.URL = "ui://37nctnhwphc33";
  14932. class ui_AgeItem extends fgui.GComponent {
  14933. static createInstance() {
  14934. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  14935. }
  14936. onConstruct() {
  14937. this.txtAge = (this.getChild("txtAge"));
  14938. }
  14939. }
  14940. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  14941. class ui_btn1 extends fgui.GButton {
  14942. static createInstance() {
  14943. return (fgui.UIPackage.createObject("loading", "btn1"));
  14944. }
  14945. onConstruct() {
  14946. this.n6 = (this.getChild("n6"));
  14947. this.n1 = (this.getChild("n1"));
  14948. }
  14949. }
  14950. ui_btn1.URL = "ui://37nctnhwxe622p";
  14951. class ui_btn3 extends fgui.GButton {
  14952. static createInstance() {
  14953. return (fgui.UIPackage.createObject("loading", "btn3"));
  14954. }
  14955. onConstruct() {
  14956. this.n9 = (this.getChild("n9"));
  14957. this.n1 = (this.getChild("n1"));
  14958. }
  14959. }
  14960. ui_btn3.URL = "ui://37nctnhwxe622s";
  14961. class ui_btn2 extends fgui.GButton {
  14962. static createInstance() {
  14963. return (fgui.UIPackage.createObject("loading", "btn2"));
  14964. }
  14965. onConstruct() {
  14966. this.n6 = (this.getChild("n6"));
  14967. this.n1 = (this.getChild("n1"));
  14968. }
  14969. }
  14970. ui_btn2.URL = "ui://37nctnhwxe622t";
  14971. class ui_btnBack extends fgui.GButton {
  14972. static createInstance() {
  14973. return (fgui.UIPackage.createObject("loading", "btnBack"));
  14974. }
  14975. onConstruct() {
  14976. this.n6 = (this.getChild("n6"));
  14977. this.n7 = (this.getChild("n7"));
  14978. }
  14979. }
  14980. ui_btnBack.URL = "ui://37nctnhwxe622u";
  14981. class ui_btnXy1 extends fgui.GButton {
  14982. static createInstance() {
  14983. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  14984. }
  14985. onConstruct() {
  14986. this.n1 = (this.getChild("n1"));
  14987. }
  14988. }
  14989. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  14990. class ui_btnXy2 extends fgui.GButton {
  14991. static createInstance() {
  14992. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  14993. }
  14994. onConstruct() {
  14995. this.n1 = (this.getChild("n1"));
  14996. }
  14997. }
  14998. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  14999. class ui_btnXy3 extends fgui.GButton {
  15000. static createInstance() {
  15001. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15002. }
  15003. onConstruct() {
  15004. this.n1 = (this.getChild("n1"));
  15005. }
  15006. }
  15007. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15008. class ui_btn4 extends fgui.GButton {
  15009. static createInstance() {
  15010. return (fgui.UIPackage.createObject("loading", "btn4"));
  15011. }
  15012. onConstruct() {
  15013. this.n9 = (this.getChild("n9"));
  15014. this.n1 = (this.getChild("n1"));
  15015. }
  15016. }
  15017. ui_btn4.URL = "ui://37nctnhwxe622z";
  15018. class loadingBinder {
  15019. static bindAll() {
  15020. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15021. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15022. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15023. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15024. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15025. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15026. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15027. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15028. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15029. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15030. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15031. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15032. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15033. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15034. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15035. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15036. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15037. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15038. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15039. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15040. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15041. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15042. }
  15043. }
  15044. class UIMgr {
  15045. constructor() {
  15046. this._stage = null;
  15047. this._uiList = [];
  15048. this._showList = [];
  15049. this._bindPkgList = [];
  15050. this.uiIndex = 0;
  15051. }
  15052. static get inst() {
  15053. if (UIMgr._inst == null) {
  15054. UIMgr._inst = new UIMgr();
  15055. }
  15056. return UIMgr._inst;
  15057. }
  15058. setStage(s) {
  15059. if (this._stage) {
  15060. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15061. return;
  15062. }
  15063. this._stage = s;
  15064. }
  15065. init() {
  15066. this.setStage(Laya.stage);
  15067. fairygui.UIConfig.defaultFont = "微软雅黑";
  15068. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15069. fairygui.UIConfig.packageFileExtension = "obj";
  15070. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15071. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15072. fairygui.GRoot.inst.width = Laya.stage.width;
  15073. fairygui.GRoot.inst.height = Laya.stage.height;
  15074. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15075. }
  15076. addAllUpdate() {
  15077. this.uiIndex = 0;
  15078. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15079. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15080. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15081. }
  15082. }
  15083. }
  15084. bindFUI(pkgname) {
  15085. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15086. return;
  15087. }
  15088. switch (pkgname) {
  15089. case fguiRes.loading:
  15090. fairygui.UIPackage.addPackage(pkgname);
  15091. loadingBinder.bindAll();
  15092. this._bindPkgList.push(pkgname);
  15093. break;
  15094. case fguiRes.game:
  15095. fairygui.UIPackage.addPackage(pkgname);
  15096. gameBinder.bindAll();
  15097. this._bindPkgList.push(pkgname);
  15098. break;
  15099. default:
  15100. break;
  15101. }
  15102. }
  15103. Show(cls, ...param) {
  15104. let nameStr = cls.uiName;
  15105. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15106. let temp = this._uiList[i];
  15107. let str = temp.className;
  15108. if (str == nameStr) {
  15109. if (temp.isMuti) {
  15110. if (temp.isHide) {
  15111. temp.show(...param);
  15112. this._uiList.splice(i, 1);
  15113. this._uiList.push(temp);
  15114. return temp;
  15115. }
  15116. }
  15117. else {
  15118. temp.show(...param);
  15119. this._uiList.splice(i, 1);
  15120. this._uiList.push(temp);
  15121. return temp;
  15122. }
  15123. }
  15124. }
  15125. let ui = new cls();
  15126. ui.className = nameStr;
  15127. this._showUI(ui, param);
  15128. return ui;
  15129. }
  15130. destroyUI(ui) {
  15131. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15132. let temp = this._uiList[i].className;
  15133. if (temp == ui.className) {
  15134. this._uiList.splice(i, 1);
  15135. break;
  15136. }
  15137. }
  15138. this.checkUIState();
  15139. }
  15140. _showUI(ui, param) {
  15141. this._uiList.push(ui);
  15142. ui.show(...param);
  15143. }
  15144. Hide(uiClass) {
  15145. let ui = this.getUI(uiClass);
  15146. if (ui && !ui.isHide) {
  15147. ui.hide();
  15148. }
  15149. }
  15150. getUI(ui) {
  15151. let nameStr = ui.uiName;
  15152. for (let index = 0; index < this._uiList.length; index++) {
  15153. let temp = this._uiList[index];
  15154. if (temp.className == nameStr) {
  15155. return temp;
  15156. }
  15157. }
  15158. return null;
  15159. }
  15160. isShow(cls) {
  15161. for (var i of this._uiList) {
  15162. if (i instanceof cls) {
  15163. return i.isShowing;
  15164. }
  15165. }
  15166. return false;
  15167. }
  15168. showUINum() {
  15169. let num = 0;
  15170. for (var i of this._uiList) {
  15171. if (i.isShowing) {
  15172. num++;
  15173. }
  15174. }
  15175. return num;
  15176. }
  15177. checkUIState() {
  15178. Laya.timer.clear(this, this._uiCheck);
  15179. Laya.timer.once(400, this, this._uiCheck);
  15180. }
  15181. _uiCheck() {
  15182. let showList = [];
  15183. for (var i of this._uiList) {
  15184. if (!i.isHide) {
  15185. showList.push(i);
  15186. }
  15187. }
  15188. for (let index = 0; index < showList.length; index++) {
  15189. if (index == showList.length - 1) {
  15190. showList[index].checkActive(true);
  15191. }
  15192. else {
  15193. showList[index].checkActive(false);
  15194. }
  15195. }
  15196. }
  15197. showTip(msg, time = 600, size = 30) {
  15198. }
  15199. }
  15200. class UIShowList {
  15201. }
  15202. class SoundMgr {
  15203. constructor() {
  15204. this.soundMax = 4;
  15205. this.isLoad = false;
  15206. this.soundMap = {};
  15207. this.isSound = true;
  15208. this.openShake = true;
  15209. SoundMgr._instance = this;
  15210. }
  15211. static getInstance() {
  15212. if (!this._instance) {
  15213. this._instance = new SoundMgr();
  15214. }
  15215. return this._instance;
  15216. }
  15217. init() {
  15218. console.log('zh:sm init 1');
  15219. Laya.SoundManager.autoReleaseSound = true;
  15220. Laya.SoundManager.autoStopMusic = true;
  15221. Laya.SoundManager.musicVolume = 0.3;
  15222. Laya.SoundManager.soundVolume = 0.5;
  15223. this.musicPlayed = false;
  15224. this.audioUrl = "asset/sound/ogg/";
  15225. console.log('zh:sm init 2');
  15226. console.log('zh:dev type ');
  15227. if (Laya.Browser.onAndroid) {
  15228. console.log('zh:dev type android');
  15229. this.audioUrl = "asset/sound/ogg/";
  15230. this.isLoad = true;
  15231. }
  15232. else {
  15233. console.log('zh:dev type not android');
  15234. this.audioUrl = "asset/sound/mp3/";
  15235. this.isLoad = true;
  15236. }
  15237. }
  15238. onSetting(isS) {
  15239. this.isSound = isS;
  15240. this.mute(!this.isSound);
  15241. }
  15242. clearCount() {
  15243. for (var key in this.soundMap) {
  15244. delete this.soundMap[key];
  15245. }
  15246. }
  15247. playMusic(path, loop = 0) {
  15248. console.log('zh:playMusic 1 PATH=' + path);
  15249. this.musicPath = path;
  15250. if (!this.isLoad)
  15251. console.log('zh:playMusic 2');
  15252. return;
  15253. if (!path || path == "")
  15254. console.log('zh:playMusic 3');
  15255. return;
  15256. if (!this.isSound)
  15257. console.log('zh:playMusic 4');
  15258. return;
  15259. this.musicPlayed = true;
  15260. console.log('zh:playMusic 5');
  15261. let url = this.getUrl(path);
  15262. console.log('zh:playMusic 6' + url);
  15263. if (Laya.Browser.onPC) {
  15264. console.log('zh:playMusic 7');
  15265. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15266. console.log('zh:playMusic 8');
  15267. this.play(url, loop);
  15268. }));
  15269. }
  15270. else
  15271. this.play(url, loop);
  15272. }
  15273. play(url, loop) {
  15274. Laya.SoundManager.playMusic(url, loop);
  15275. }
  15276. getUrl(path) {
  15277. let url = this.audioUrl + path;
  15278. if (Laya.Browser.onAndroid) {
  15279. url += ".ogg";
  15280. }
  15281. else {
  15282. url += ".mp3";
  15283. }
  15284. return url;
  15285. }
  15286. pauseMusic(pause) {
  15287. if (pause) {
  15288. this.mute(true);
  15289. }
  15290. else if (this.isSound)
  15291. this.mute(false);
  15292. }
  15293. stopMusic() {
  15294. Laya.SoundManager.stopMusic();
  15295. if (Moyu.isNeedPlatAudio) {
  15296. Moyu.stopMusic();
  15297. }
  15298. }
  15299. mute(mute) {
  15300. if (Moyu.isNeedPlatAudio) {
  15301. Moyu.pauseMusic(mute);
  15302. }
  15303. else {
  15304. Laya.SoundManager.musicMuted = mute;
  15305. if (!mute && !this.musicPlayed && this.musicPath) {
  15306. this.playMusic(this.musicPath);
  15307. }
  15308. }
  15309. }
  15310. stopSound(path) {
  15311. let url = this.getUrl(path);
  15312. Laya.SoundManager.stopSound(url);
  15313. }
  15314. playSound(path, loop = 1, soundMax = this.soundMax) {
  15315. if (!this.isLoad)
  15316. return;
  15317. if (!this.isSound)
  15318. return;
  15319. if (!path || path == "")
  15320. return;
  15321. let url = this.getUrl(path);
  15322. if (Moyu.isNeedPlatAudio) {
  15323. Moyu.playSound(path, loop == 0);
  15324. }
  15325. else {
  15326. let count = 1;
  15327. if (this.soundMap[path])
  15328. count = this.soundMap[path] + 1;
  15329. if (count > soundMax)
  15330. return;
  15331. this.soundMap[path] = count;
  15332. Laya.SoundManager.playSound(url, loop);
  15333. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15334. }
  15335. }
  15336. removePath(path) {
  15337. if (this.soundMap[path]) {
  15338. let count = this.soundMap[path];
  15339. count--;
  15340. if (count < 1)
  15341. delete this.soundMap[path];
  15342. else
  15343. this.soundMap[path] = count;
  15344. }
  15345. }
  15346. playBtnSound() {
  15347. this.playSound("btn");
  15348. }
  15349. playGetSound() {
  15350. }
  15351. playCloseUISound() {
  15352. }
  15353. }
  15354. SoundMgr._instance = null;
  15355. var Handler$1 = Laya.Handler;
  15356. var EResType;
  15357. (function (EResType) {
  15358. EResType[EResType["none"] = 0] = "none";
  15359. EResType[EResType["nromal"] = 1] = "nromal";
  15360. EResType[EResType["td"] = 2] = "td";
  15361. EResType[EResType["sk"] = 3] = "sk";
  15362. })(EResType || (EResType = {}));
  15363. class CResLoader {
  15364. constructor(doneCall, proCall) {
  15365. this.completrCall = doneCall;
  15366. this.progressCall = proCall;
  15367. this.progressHander = new Handler$1(this, this.onProgress);
  15368. this.tdResMap = {};
  15369. }
  15370. load(resList) {
  15371. this.resCount = 0;
  15372. this.loadCount = 0;
  15373. for (let i = 0; i < resList.length; i++) {
  15374. let path = resList[i];
  15375. if (!path)
  15376. continue;
  15377. this.resCount++;
  15378. let type = this.getResType(path);
  15379. if (type == EResType.nromal)
  15380. this.loadNromal(path);
  15381. else if (type == EResType.td)
  15382. this.loadTd(path);
  15383. }
  15384. }
  15385. getRes(path) {
  15386. let type = this.getResType(path);
  15387. if (type == EResType.nromal)
  15388. return Laya.loader.getRes(path);
  15389. else if (type == EResType.td) {
  15390. let res = this.tdResMap[path];
  15391. if (res)
  15392. return res.clone();
  15393. return null;
  15394. }
  15395. }
  15396. destroy() {
  15397. this.progressHander.clear();
  15398. this.progressHander = null;
  15399. }
  15400. clearRes(path) {
  15401. let type = this.getResType(path);
  15402. if (type == EResType.nromal)
  15403. Laya.loader.clearRes(path);
  15404. else if (type == EResType.td) {
  15405. let obj = this.tdResMap[path];
  15406. if (obj)
  15407. obj.destroy();
  15408. delete this.tdResMap[path];
  15409. }
  15410. }
  15411. getResType(path) {
  15412. let exs = this.getExtension(path);
  15413. if (exs == "sk")
  15414. return EResType.sk;
  15415. if (exs == "ls" || exs == "lh" || exs == "lm")
  15416. return EResType.td;
  15417. else
  15418. return EResType.nromal;
  15419. }
  15420. getExtension(res) {
  15421. var index = res.lastIndexOf(".");
  15422. return res.substr(index + 1);
  15423. }
  15424. loadNromal(path) {
  15425. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15426. if (res) {
  15427. this.onLoad();
  15428. }
  15429. else
  15430. console.log("load res fail:" + path);
  15431. }), this.progressHander);
  15432. }
  15433. loadSk() {
  15434. }
  15435. loadTd(path) {
  15436. if (this.tdResMap[path]) {
  15437. this.onLoad();
  15438. return;
  15439. }
  15440. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15441. if (res) {
  15442. this.tdResMap[path] = res;
  15443. this.onLoad();
  15444. }
  15445. else
  15446. console.log("load res fail:" + path);
  15447. }));
  15448. }
  15449. onLoad() {
  15450. this.loadCount++;
  15451. this.onProgress(1);
  15452. if (this.loadCount >= this.resCount) {
  15453. this.completrCall.run();
  15454. }
  15455. }
  15456. onProgress(pro) {
  15457. let progress = (this.loadCount + pro) / this.resCount;
  15458. this.progressCall.runWith(progress);
  15459. }
  15460. }
  15461. var Handler$2 = Laya.Handler;
  15462. class ResInfo {
  15463. constructor() {
  15464. this.index = 0;
  15465. }
  15466. }
  15467. class ResMgr {
  15468. constructor() {
  15469. this.resList = [];
  15470. this.doneList = [];
  15471. this.resMap = {};
  15472. this.currentLoad = null;
  15473. this.completeHandler = new Handler$2(this, this.onComplete);
  15474. this.progressHandler = new Handler$2(this, this.onProgress);
  15475. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15476. }
  15477. static getInstance() {
  15478. if (ResMgr._instance == null) {
  15479. ResMgr._instance = new ResMgr();
  15480. }
  15481. return ResMgr._instance;
  15482. }
  15483. loadList(list, completeHandler, progressHandler) {
  15484. if (list.length < 1) {
  15485. completeHandler.run();
  15486. return;
  15487. }
  15488. let info = this.getResInfo();
  15489. info.resList = list;
  15490. info.completeHandler = completeHandler;
  15491. info.progressHandler = progressHandler;
  15492. this.resList.push(info);
  15493. this.startLoad();
  15494. }
  15495. loadFguiRes(list, completeHandler, progressHandler) {
  15496. Laya.loader.load(list, completeHandler, progressHandler);
  15497. }
  15498. loadAny(list, completeHandler, progressHandler) {
  15499. Laya.loader.load(list, completeHandler, progressHandler);
  15500. }
  15501. load(path, completeHandler, progressHandler) {
  15502. let count = this.resMap[path];
  15503. if (count && count > 0) {
  15504. if (completeHandler)
  15505. completeHandler.run();
  15506. }
  15507. else
  15508. this.loadList([path], completeHandler, progressHandler);
  15509. }
  15510. getRes(path) {
  15511. let res = this.resMap[path];
  15512. if (!res)
  15513. this.showLog("资源不存在:" + path);
  15514. else
  15515. return this.loader.getRes(path);
  15516. }
  15517. clearList(list, force = false) {
  15518. if (!list || list.length < 1)
  15519. return;
  15520. let cr = () => {
  15521. for (const k in list) {
  15522. let v = list[k];
  15523. if (!v)
  15524. continue;
  15525. if (force) {
  15526. this.loader.clearRes(v);
  15527. delete this.resMap[v];
  15528. }
  15529. else {
  15530. let count = this.resMap[v];
  15531. if (count && count > 1) {
  15532. count--;
  15533. this.resMap[v] = count;
  15534. }
  15535. else {
  15536. this.loader.clearRes(v);
  15537. delete this.resMap[v];
  15538. }
  15539. }
  15540. }
  15541. if (!window.hasOwnProperty("ks"))
  15542. Laya.Resource.destroyUnusedResources();
  15543. };
  15544. Laya.timer.clearAll(this);
  15545. Laya.timer.once(2000, this, cr);
  15546. }
  15547. clear3D() {
  15548. for (const k in this.loader.tdResMap) {
  15549. this.loader.clearRes(k);
  15550. if (this.resMap[k])
  15551. delete this.resMap[k];
  15552. }
  15553. if (!window.hasOwnProperty("ks"))
  15554. Laya.Resource.destroyUnusedResources();
  15555. }
  15556. clear(path, force = false) {
  15557. this.clearList([path], force);
  15558. }
  15559. getResInfo() {
  15560. if (this.doneList.length > 0)
  15561. return this.doneList.pop();
  15562. else
  15563. return new ResInfo();
  15564. }
  15565. startLoad() {
  15566. if (this.currentLoad)
  15567. return;
  15568. this.currentLoad = this.resList.pop();
  15569. if (this.currentLoad) {
  15570. this.loader.load(this.currentLoad.resList);
  15571. }
  15572. }
  15573. onComplete() {
  15574. if (!this.currentLoad)
  15575. return;
  15576. for (const k in this.currentLoad.resList) {
  15577. let v = this.currentLoad.resList[k];
  15578. let count = this.resMap[v];
  15579. if (count)
  15580. count++;
  15581. else
  15582. count = 1;
  15583. this.resMap[v] = count;
  15584. }
  15585. if (this.currentLoad.completeHandler)
  15586. this.currentLoad.completeHandler.run();
  15587. this.doneList.push(this.currentLoad);
  15588. this.currentLoad = null;
  15589. this.startLoad();
  15590. }
  15591. onProgress(pro) {
  15592. if (!this.currentLoad)
  15593. return;
  15594. if (this.currentLoad.progressHandler)
  15595. this.currentLoad.progressHandler.runWith(pro);
  15596. }
  15597. showLog(str, ...args) {
  15598. console.log("[ResLoader] " + str);
  15599. }
  15600. }
  15601. ResMgr._instance = null;
  15602. class EventMgr extends Laya.EventDispatcher {
  15603. }
  15604. let eventMgr = new EventMgr();
  15605. class ConfigMgr {
  15606. static getInstance() {
  15607. if (!this._instance) {
  15608. this._instance = new ConfigMgr();
  15609. }
  15610. return this._instance;
  15611. }
  15612. init() {
  15613. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15614. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15615. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15616. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15617. }
  15618. getUserInfoByIndex(index) {
  15619. return this.npcJson[index];
  15620. }
  15621. getRandomUserInfo() {
  15622. let index = xGame.tools.random(0, this.npcJson.length);
  15623. return this.npcJson[index];
  15624. }
  15625. getMaxBigMoveLength() {
  15626. return Object.keys(this.levelCfg).length;
  15627. }
  15628. getBigMoveLevelByIndex(index) {
  15629. let cfg = this.levelCfg;
  15630. cfg = cfg[index];
  15631. return cfg;
  15632. }
  15633. getRandomClassicLevel() {
  15634. let cfg = this.classicCfg;
  15635. let num = Object.keys(cfg).length;
  15636. let rand = xGame.common.randomNum(1, num);
  15637. return cfg[rand];
  15638. }
  15639. getPlaceBallByLevel(level) {
  15640. return this.placeBallCfg[level];
  15641. }
  15642. getMaxPlaceBall() {
  15643. return Object.keys(this.placeBallCfg).length;
  15644. }
  15645. }
  15646. class PoolD3Mgr {
  15647. constructor() {
  15648. this.pool = {};
  15649. }
  15650. static get ins() {
  15651. return this._ins || (this._ins = new PoolD3Mgr);
  15652. }
  15653. createList(key, prefab, parent) {
  15654. if (!this.pool[key]) {
  15655. this.pool[key] = {};
  15656. this.pool[key].prefab = prefab;
  15657. this.pool[key].list = [];
  15658. this.pool[key].parent = parent;
  15659. }
  15660. }
  15661. getItem(key) {
  15662. if (!this.pool[key]) {
  15663. return;
  15664. }
  15665. let temp;
  15666. if (this.pool[key].list.length > 0) {
  15667. temp = this.pool[key].list.pop();
  15668. }
  15669. else {
  15670. temp = this.pool[key].prefab.clone();
  15671. if (this.pool[key].parent) {
  15672. this.pool[key].parent.addChild(temp);
  15673. }
  15674. }
  15675. temp.active = true;
  15676. return temp;
  15677. }
  15678. putItem(key, obj) {
  15679. if (!this.pool[key]) {
  15680. return;
  15681. }
  15682. obj.active = false;
  15683. this.pool[key].list.push(obj);
  15684. }
  15685. }
  15686. let context$1 = context;
  15687. let uiMgr = UIMgr.inst;
  15688. let soundMgr = SoundMgr.getInstance();
  15689. let resMgr = ResMgr.getInstance();
  15690. let httpMgr = HttpMgr.getInstance();
  15691. let common = Common.getInstance();
  15692. let cfgMgr = ConfigMgr.getInstance();
  15693. let poolD3Mgr = PoolD3Mgr.ins;
  15694. let d3TexUrl = "res/d3Res/";
  15695. let d3ModeUrl = "res/unityRes/";
  15696. function setStageSize(view) {
  15697. if (view.width) {
  15698. view.width = Laya.stage.width;
  15699. view.height = Laya.stage.height;
  15700. }
  15701. }
  15702. function filledBg(view) {
  15703. let wh = Laya.stage.height / Laya.stage.width;
  15704. if (wh > 16 / 9) {
  15705. view.height = Laya.stage.height;
  15706. view.width = Laya.stage.height / 1334 * 750;
  15707. }
  15708. else {
  15709. view.width = Laya.stage.width;
  15710. view.height = Laya.stage.width / 750 * 1334;
  15711. }
  15712. }
  15713. function setNotch(view) {
  15714. if (view.height) {
  15715. view.y += context$1.notchHeight;
  15716. }
  15717. }
  15718. function showTip(str) {
  15719. uiMgr.Show(UIMsg, str);
  15720. }
  15721. function log(...args) {
  15722. console.log(args);
  15723. }
  15724. let xGame = {
  15725. context: context$1,
  15726. eventMgr,
  15727. resMgr,
  15728. uiMgr,
  15729. soundMgr,
  15730. define,
  15731. tools,
  15732. httpMgr,
  15733. d3TexUrl,
  15734. d3ModeUrl,
  15735. common,
  15736. cfgMgr,
  15737. poolD3Mgr,
  15738. setStageSize,
  15739. filledBg,
  15740. setNotch,
  15741. showTip,
  15742. log,
  15743. };
  15744. window["xGame"] = xGame;
  15745. let dataName = 'tBall_';
  15746. class UserData {
  15747. constructor() {
  15748. this.userId = "";
  15749. this.isAgree = false;
  15750. this.coinNum = 0;
  15751. this.gemNum = 0;
  15752. this.sound = true;
  15753. this.vibration = true;
  15754. this.currentDate = 0;
  15755. this.createTime = 0;
  15756. this.awardTime = 0;
  15757. this.roleId = 1;
  15758. this.roleList = [];
  15759. this.roleAds = [];
  15760. this.dressId = 101;
  15761. this.itemId = 201;
  15762. this.bigSkills = [1, 1, 1, 1, 1];
  15763. this.coin = 4000;
  15764. this.diamond = 0;
  15765. this.skillSuccessTimes = 0;
  15766. this.skillGuide = 0;
  15767. this.skillAccTimes = 0;
  15768. this.placeBallData = [];
  15769. this.shareDiamondTimes = 0;
  15770. this.dailyVideoShareTimes = 0;
  15771. this.secretary = [1, 0];
  15772. this.curSecretary = 0;
  15773. this.ballRod = [1, 0, 0, 0, 0, 1];
  15774. this.curBallRod = 5;
  15775. this.signData = 0;
  15776. this.signTime = 0;
  15777. this.drawTimes = 0;
  15778. this.drawAwardTimes = 0;
  15779. this.dailyfreeDrawTimes = 1;
  15780. this.power = 5;
  15781. this.powerTime = 0;
  15782. this.challengeTimes = 0;
  15783. this.extraSign = 0;
  15784. this.classicTimes = 0;
  15785. this.guideHelpLine = 0;
  15786. this.newUser = true;
  15787. this.rootBallFoul = 0;
  15788. this.timeoutFoul = 0;
  15789. this.roleList = [1];
  15790. }
  15791. saveData() {
  15792. let data = {};
  15793. for (let k in this) {
  15794. data[k.toString()] = this[k];
  15795. }
  15796. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15797. }
  15798. getData() {
  15799. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15800. if (ld) {
  15801. let localData = JSON.parse(ld);
  15802. if (localData) {
  15803. for (let k in this) {
  15804. let key = k.toString();
  15805. let data = localData[key];
  15806. if (data != undefined) {
  15807. this[k] = data;
  15808. }
  15809. }
  15810. }
  15811. }
  15812. }
  15813. }
  15814. class ItemData {
  15815. constructor() {
  15816. this.itemList = {};
  15817. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15818. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15819. }
  15820. saveData() {
  15821. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15822. }
  15823. getData() {
  15824. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15825. if (ld) {
  15826. let localData = JSON.parse(ld);
  15827. if (localData) {
  15828. this.itemList = localData;
  15829. }
  15830. }
  15831. }
  15832. }
  15833. class GameData {
  15834. constructor() {
  15835. this.curLevel = 0;
  15836. this.gameType = 1;
  15837. this.signIdx = 0;
  15838. this.signMax = 0;
  15839. this.rotaryTime = 0;
  15840. this.rotaryCount = 0;
  15841. this.rotaryList = [];
  15842. this.diyCount = 3;
  15843. this.awardIdx = 0;
  15844. this.shareNum = 2;
  15845. this.rankWeek = 0;
  15846. this.rankScore = 0;
  15847. this.gameCount = 0;
  15848. this.trySkill = -1;
  15849. this.tryTime = 0;
  15850. }
  15851. saveData() {
  15852. let data = {};
  15853. for (let k in this) {
  15854. data[k.toString()] = this[k];
  15855. }
  15856. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  15857. }
  15858. getData() {
  15859. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  15860. if (ld) {
  15861. let localData = JSON.parse(ld);
  15862. if (localData) {
  15863. for (let k in this) {
  15864. let key = k.toString();
  15865. let data = localData[key];
  15866. if (data != undefined) {
  15867. this[k] = data;
  15868. }
  15869. }
  15870. }
  15871. }
  15872. }
  15873. }
  15874. class DataMgr {
  15875. static Init() {
  15876. this.userData = new UserData();
  15877. this.gameData = new GameData();
  15878. this.itemData = new ItemData();
  15879. this.userData.getData();
  15880. this.gameData.getData();
  15881. this.itemData.getData();
  15882. this.roleId = this.userData.roleId;
  15883. this.resetUse();
  15884. }
  15885. static isNewDay() {
  15886. Moyu.isNewDay(this, (isnew) => {
  15887. xGame.common.isNewDay = isnew;
  15888. if (!isnew)
  15889. return;
  15890. DataMgr.setShareDiamondTimes(0, false);
  15891. DataMgr.setDailyVideoShareTimes(0, false);
  15892. DataMgr.setDailyfreeDrawTimes(1);
  15893. DataMgr.setExtraSign(0);
  15894. });
  15895. }
  15896. static deletData() {
  15897. Laya.LocalStorage.clear();
  15898. }
  15899. static upRankData() {
  15900. let num = xGame.common.getAllStarNum();
  15901. if (num > 0)
  15902. Moyu.upRankData(xGame.common.curRankID, num);
  15903. }
  15904. static addItem(id, count = 1) {
  15905. let v = this.itemData.itemList[id];
  15906. if (!v)
  15907. v = { id: id, count: count, adnum: 0, active: true };
  15908. else {
  15909. if (v.active) {
  15910. v.count += count;
  15911. }
  15912. else {
  15913. v.count = count;
  15914. v.active = true;
  15915. }
  15916. }
  15917. this.itemData.itemList[id] = v;
  15918. xGame.soundMgr.playGetSound();
  15919. this.saveItemData();
  15920. }
  15921. static hasItem(id) {
  15922. let v = this.itemData.itemList[id];
  15923. if (v && v.active)
  15924. return true;
  15925. return false;
  15926. }
  15927. static getItem(id) {
  15928. let v = this.itemData.itemList[id];
  15929. return v;
  15930. }
  15931. static getItemCount(id) {
  15932. let v = this.itemData.itemList[id];
  15933. if (v && v.active)
  15934. return v.count;
  15935. return 0;
  15936. }
  15937. static getItemAd(id) {
  15938. let v = this.itemData.itemList[id];
  15939. if (v) {
  15940. return v.adnum;
  15941. }
  15942. return 0;
  15943. }
  15944. static onItemAd(id, num = 1) {
  15945. let v = this.itemData.itemList[id];
  15946. if (!v)
  15947. v = { id: id, count: 1, adnum: num, active: false };
  15948. else
  15949. v.adnum += num;
  15950. this.itemData.itemList[id] = v;
  15951. this.saveItemData();
  15952. }
  15953. static costItem(id, count) {
  15954. let v = this.itemData.itemList[id];
  15955. if (v && v.active) {
  15956. if (v.count < count)
  15957. return false;
  15958. else {
  15959. v.count -= count;
  15960. this.itemData.itemList[id] = v;
  15961. return true;
  15962. }
  15963. }
  15964. return false;
  15965. }
  15966. static resetUse() {
  15967. this.dressId = this.userData.dressId;
  15968. this.itemId = this.userData.itemId;
  15969. }
  15970. static passLevel() {
  15971. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  15972. this.gameData.curLevel++;
  15973. this.curLevel = this.gameData.curLevel;
  15974. this.saveGameData();
  15975. }
  15976. static useRole(id) {
  15977. this.roleId = id;
  15978. if (this.hasRole(id)) {
  15979. this.userData.roleId = id;
  15980. this.saveUserData();
  15981. }
  15982. }
  15983. static addRole(id) {
  15984. if (this.hasRole(id))
  15985. return;
  15986. this.userData.roleList.push(id);
  15987. this.saveUserData();
  15988. }
  15989. static hasRole(id) {
  15990. return this.userData.roleList.indexOf(id) >= 0;
  15991. }
  15992. static gemEnough(num) {
  15993. return this.userData.gemNum >= num;
  15994. }
  15995. static roleHasAd(id) {
  15996. let count = this.userData.roleAds[id];
  15997. if (count != undefined && count >= 0)
  15998. return true;
  15999. else
  16000. return false;
  16001. }
  16002. static saveUserData(time = 1000, event, arg) {
  16003. if (this.userSaving)
  16004. return;
  16005. this.userSaving = true;
  16006. Laya.timer.once(time, this, () => {
  16007. this.userSaving = false;
  16008. this.userData.saveData();
  16009. if (event)
  16010. xGame.eventMgr.event(event, arg);
  16011. });
  16012. }
  16013. static saveGameData() {
  16014. if (this.gameSaving)
  16015. return;
  16016. this.gameSaving = true;
  16017. Laya.timer.once(1000, this, () => {
  16018. this.gameSaving = false;
  16019. this.gameData.saveData();
  16020. });
  16021. }
  16022. static saveItemData() {
  16023. let fun = () => {
  16024. this.itemData.saveData();
  16025. };
  16026. Laya.timer.clear(this, fun);
  16027. Laya.timer.once(500, this, fun);
  16028. }
  16029. static saveData() {
  16030. this.saveUserData();
  16031. this.saveGameData();
  16032. }
  16033. static getBigSkillList() {
  16034. return this.userData.bigSkills;
  16035. }
  16036. static getBigSkillByIndex(index) {
  16037. return this.userData.bigSkills[index];
  16038. }
  16039. static setBigSkill(index, val, addUp = true) {
  16040. if (addUp) {
  16041. this.userData.bigSkills[index] += val;
  16042. }
  16043. else {
  16044. this.userData.bigSkills[index] = val;
  16045. }
  16046. this.saveUserData();
  16047. }
  16048. static coinEnough(need) {
  16049. if (typeof need != "number") {
  16050. console.error("金币格式错误");
  16051. return;
  16052. }
  16053. return this.userData.coin >= need;
  16054. }
  16055. static setCoin(val) {
  16056. if (typeof val != "number") {
  16057. return;
  16058. }
  16059. this.userData.coin += val;
  16060. this.saveUserData();
  16061. xGame.eventMgr.event(COIN_CHANGE);
  16062. }
  16063. static getCoin() {
  16064. return this.userData.coin;
  16065. }
  16066. static diamondEnough(need) {
  16067. if (typeof need != "number") {
  16068. console.error("金币格式错误");
  16069. return;
  16070. }
  16071. return this.userData.diamond >= need;
  16072. }
  16073. static setDiamond(val) {
  16074. if (typeof val != "number") {
  16075. return;
  16076. }
  16077. this.userData.diamond += val;
  16078. this.saveUserData();
  16079. xGame.eventMgr.event(DIAMOND_CHANGE);
  16080. }
  16081. static getDiamond() {
  16082. return this.userData.diamond;
  16083. }
  16084. static getSkillSuccessTimes() {
  16085. return this.userData.skillSuccessTimes;
  16086. }
  16087. static setSkillSuccessTimes(val, addUp = true) {
  16088. if (addUp)
  16089. this.userData.skillSuccessTimes += val;
  16090. else
  16091. this.userData.skillSuccessTimes = val;
  16092. this.saveUserData();
  16093. }
  16094. static getSkillAccTimes() {
  16095. return this.userData.skillAccTimes;
  16096. }
  16097. static setSkillAccTimes(val) {
  16098. this.userData.skillAccTimes += val;
  16099. this.saveUserData();
  16100. }
  16101. static getSkillGuide() {
  16102. if (!xGame.common.openGuide) {
  16103. return 1;
  16104. }
  16105. return this.userData.skillGuide;
  16106. }
  16107. static setSkillGuide(val) {
  16108. this.userData.skillGuide = val;
  16109. this.saveUserData();
  16110. }
  16111. static getPlaceBallLevelList() {
  16112. return this.userData.placeBallData;
  16113. }
  16114. static getPlaceBallLevel(level) {
  16115. let arr = this.userData.placeBallData;
  16116. let index = level - 1;
  16117. let out;
  16118. if (arr[index]) {
  16119. out = arr[index];
  16120. }
  16121. else {
  16122. let max = arr.length;
  16123. if (max == index) {
  16124. out = {
  16125. star: 0,
  16126. play: true,
  16127. isCur: true,
  16128. getAward: false
  16129. };
  16130. }
  16131. else {
  16132. out = {
  16133. star: 0,
  16134. play: false,
  16135. getAward: false
  16136. };
  16137. }
  16138. }
  16139. return out;
  16140. }
  16141. static setPlaceBallLevel(level, star) {
  16142. let arr = this.userData.placeBallData;
  16143. let index = level - 1;
  16144. if (arr[index]) {
  16145. arr[index].star = Math.max(arr[index].star, star);
  16146. }
  16147. else {
  16148. let max = arr.length;
  16149. if (max == index) {
  16150. arr.push({
  16151. star: star,
  16152. play: true,
  16153. getAward: false
  16154. });
  16155. }
  16156. else {
  16157. console.error("关卡存储出错");
  16158. }
  16159. }
  16160. this.saveUserData();
  16161. }
  16162. static setPlaceBallAward(level) {
  16163. let arr = this.userData.placeBallData;
  16164. let index = level - 1;
  16165. if (arr[index]) {
  16166. arr[index].getAward = true;
  16167. }
  16168. this.saveUserData();
  16169. }
  16170. static getShareDiamondTimes() {
  16171. return this.userData.shareDiamondTimes;
  16172. }
  16173. static setShareDiamondTimes(val, addUp = true) {
  16174. if (addUp) {
  16175. this.userData.shareDiamondTimes += val;
  16176. }
  16177. else {
  16178. this.userData.shareDiamondTimes = val;
  16179. }
  16180. this.saveUserData();
  16181. }
  16182. static getDailyVideoShareTimes() {
  16183. return this.userData.dailyVideoShareTimes;
  16184. }
  16185. static setDailyVideoShareTimes(val, addUp = true) {
  16186. if (addUp) {
  16187. this.userData.dailyVideoShareTimes += val;
  16188. }
  16189. else {
  16190. this.userData.dailyVideoShareTimes = val;
  16191. }
  16192. this.saveUserData();
  16193. }
  16194. static getSecretary(index) {
  16195. return this.userData.secretary[index];
  16196. }
  16197. static setSecretary(index, val) {
  16198. this.userData.secretary[index] = val;
  16199. this.saveUserData();
  16200. }
  16201. static getCurSecretary() {
  16202. return this.userData.curSecretary;
  16203. }
  16204. static setCurSecretary(index) {
  16205. this.userData.curSecretary = index;
  16206. this.saveUserData();
  16207. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16208. }
  16209. static getBallRod(index) {
  16210. return this.userData.ballRod[index];
  16211. }
  16212. static setBallRod(index, val) {
  16213. this.userData.ballRod[index] = val;
  16214. this.saveUserData();
  16215. }
  16216. static getCurBallRod() {
  16217. return this.userData.curBallRod;
  16218. }
  16219. static setCurBallRod(index) {
  16220. this.userData.curBallRod = index;
  16221. this.saveUserData();
  16222. }
  16223. static setSignData(val) {
  16224. this.userData.signData = val;
  16225. this.saveUserData();
  16226. }
  16227. static getSignData() {
  16228. return this.userData.signData;
  16229. }
  16230. static setSignTime(val) {
  16231. this.userData.signTime = val;
  16232. this.saveUserData();
  16233. }
  16234. static getSignTime() {
  16235. return this.userData.signTime;
  16236. }
  16237. static getDrawTimes() {
  16238. return this.userData.drawTimes;
  16239. }
  16240. static setDrawTimes(val, addUp = true) {
  16241. if (addUp) {
  16242. this.userData.drawTimes += val;
  16243. }
  16244. else {
  16245. this.userData.drawTimes = val;
  16246. }
  16247. this.saveUserData();
  16248. }
  16249. static getDrawAwardTimes() {
  16250. return this.userData.drawAwardTimes;
  16251. }
  16252. static setDrawAwardTimes(val) {
  16253. this.userData.drawAwardTimes = val;
  16254. this.saveUserData();
  16255. }
  16256. static getDailyfreeDrawTimes() {
  16257. return this.userData.dailyfreeDrawTimes;
  16258. }
  16259. static setDailyfreeDrawTimes(val) {
  16260. this.userData.dailyfreeDrawTimes = val;
  16261. this.saveUserData();
  16262. }
  16263. static setPower(val, addUp = true) {
  16264. if (addUp)
  16265. this.userData.power += val;
  16266. else
  16267. this.userData.power = val;
  16268. if (this.userData.power >= xGame.common.maxPower) {
  16269. this.userData.power = xGame.common.maxPower;
  16270. }
  16271. xGame.eventMgr.event(POWER_CHANGE, val);
  16272. this.saveUserData();
  16273. }
  16274. static getPower() {
  16275. return this.userData.power;
  16276. }
  16277. static setPowerTime(val) {
  16278. this.userData.powerTime = val;
  16279. this.saveUserData();
  16280. }
  16281. static getPowerTime() {
  16282. return this.userData.powerTime;
  16283. }
  16284. static powerEnough() {
  16285. return this.getPower() > 0;
  16286. }
  16287. static getChallengeTimes() {
  16288. return this.userData.challengeTimes;
  16289. }
  16290. static setChallengeTimes(val) {
  16291. this.userData.challengeTimes += val;
  16292. this.saveUserData();
  16293. }
  16294. static getExtraSign() {
  16295. return this.userData.extraSign;
  16296. }
  16297. static setExtraSign(val) {
  16298. this.userData.extraSign = val;
  16299. this.saveUserData();
  16300. }
  16301. static getClassicTimes() {
  16302. return this.userData.classicTimes;
  16303. }
  16304. static setClassicTimes() {
  16305. this.userData.classicTimes += 1;
  16306. this.saveUserData();
  16307. }
  16308. static getGuideHelpLine() {
  16309. return this.userData.guideHelpLine;
  16310. }
  16311. static setGuideHelpLine() {
  16312. this.userData.guideHelpLine = 1;
  16313. this.saveUserData();
  16314. }
  16315. static getNewUser() {
  16316. return this.userData.newUser;
  16317. }
  16318. static setNewUser() {
  16319. this.userData.newUser = false;
  16320. this.saveUserData();
  16321. }
  16322. static getRootBallFoul() {
  16323. return this.userData.rootBallFoul;
  16324. }
  16325. static setRootBallFoul() {
  16326. this.userData.rootBallFoul = 1;
  16327. this.saveUserData();
  16328. }
  16329. static getTimeoutFoul() {
  16330. return this.userData.timeoutFoul;
  16331. }
  16332. static setTimeoutFoul() {
  16333. this.userData.timeoutFoul = 1;
  16334. this.saveUserData();
  16335. }
  16336. }
  16337. DataMgr.isNewUser = false;
  16338. DataMgr.fristEnter = true;
  16339. DataMgr.levelType = 0;
  16340. DataMgr.awardId = 0;
  16341. DataMgr.awardCoin = 0;
  16342. DataMgr.sceneId = -1;
  16343. DataMgr.tryId = 0;
  16344. DataMgr.curLevel = 1;
  16345. DataMgr.vipLevel = 0;
  16346. DataMgr.maxLevel = 0;
  16347. DataMgr.awardRatio = 1;
  16348. DataMgr.gameList = [];
  16349. DataMgr.rankList = [];
  16350. DataMgr.recoverTime = 480000;
  16351. DataMgr.minScore = 0;
  16352. DataMgr.rankDis = 0;
  16353. DataMgr.userSaving = false;
  16354. DataMgr.gameSaving = false;
  16355. class D3Tween extends Laya.Script3D {
  16356. constructor() {
  16357. super();
  16358. this.isInited = false;
  16359. }
  16360. ;
  16361. init() {
  16362. if (this.isInited)
  16363. return;
  16364. this.isInited = true;
  16365. this.gameObj = this.owner;
  16366. this.transform = this.gameObj.transform;
  16367. }
  16368. get rotX() {
  16369. return this.transform.localRotationEulerX;
  16370. }
  16371. set rotX(v) {
  16372. this.transform.localRotationEulerX = v;
  16373. }
  16374. get rotY() {
  16375. return this.transform.localRotationEulerY;
  16376. }
  16377. set rotY(v) {
  16378. this.transform.localRotationEulerY = v;
  16379. }
  16380. get rotZ() {
  16381. return this.transform.localRotationEulerZ;
  16382. }
  16383. set rotZ(v) {
  16384. this.transform.localRotationEulerZ = v;
  16385. }
  16386. get posX() {
  16387. return this.transform.localPositionX;
  16388. }
  16389. set posX(v) {
  16390. this.transform.localPositionX = v;
  16391. }
  16392. get posY() {
  16393. return this.transform.localPositionY;
  16394. }
  16395. set posY(v) {
  16396. this.transform.localPositionY = v;
  16397. }
  16398. get posZ() {
  16399. return this.transform.localPositionZ;
  16400. }
  16401. set posZ(v) {
  16402. this.transform.localPositionZ = v;
  16403. }
  16404. get rotation() {
  16405. return this.transform.localRotation;
  16406. }
  16407. set rotation(v) {
  16408. this.transform.localRotation = v;
  16409. }
  16410. }
  16411. class D2Hole extends Laya.Script {
  16412. constructor() { super(); }
  16413. onTriggerEnter(collider) {
  16414. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16415. return;
  16416. }
  16417. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16418. if (collider.owner["mySrc"].isRunSkillAni) {
  16419. return;
  16420. }
  16421. if (collider.owner["mySrc"].number != 0) {
  16422. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16423. }
  16424. xGame.common.ballColliHole(collider);
  16425. xGame.common.recoverCameraView();
  16426. }
  16427. }
  16428. }
  16429. class Table extends Laya.Script3D {
  16430. constructor() {
  16431. super();
  16432. this.isSetBorder = false;
  16433. this.inited = false;
  16434. }
  16435. ;
  16436. onAwake() {
  16437. this.init();
  16438. }
  16439. init() {
  16440. if (this.inited)
  16441. return;
  16442. this.inited = true;
  16443. this.gameObj = this.owner;
  16444. this.border = this.gameObj.getChildByName("border");
  16445. }
  16446. setBorderPos() {
  16447. if (this.isSetBorder)
  16448. return;
  16449. this.isSetBorder = true;
  16450. let ui = xGame.common.gameUI.ui;
  16451. let bar1 = this.border.getChildByName("bar1");
  16452. let bar2 = this.border.getChildByName("bar2");
  16453. let bar3 = this.border.getChildByName("bar3");
  16454. let bar4 = this.border.getChildByName("bar4");
  16455. let bar5 = this.border.getChildByName("bar5");
  16456. let bar6 = this.border.getChildByName("bar6");
  16457. this.setInfo(bar1, ui.border.bar1, "box");
  16458. this.setInfo(bar2, ui.border.bar2, "box");
  16459. this.setInfo(bar3, ui.border.bar3, "box");
  16460. this.setInfo(bar4, ui.border.bar4, "box");
  16461. this.setInfo(bar5, ui.border.bar5, "box");
  16462. this.setInfo(bar6, ui.border.bar6, "box");
  16463. let circle1 = this.border.getChildByName("circle1");
  16464. let circle2 = this.border.getChildByName("circle2");
  16465. let circle3 = this.border.getChildByName("circle3");
  16466. let circle4 = this.border.getChildByName("circle4");
  16467. let circle5 = this.border.getChildByName("circle5");
  16468. let circle6 = this.border.getChildByName("circle6");
  16469. this.setInfo(circle1, ui.border.circle1, "circle");
  16470. this.setInfo(circle2, ui.border.circle2, "circle");
  16471. this.setInfo(circle3, ui.border.circle3, "circle");
  16472. this.setInfo(circle4, ui.border.circle4, "circle");
  16473. this.setInfo(circle5, ui.border.circle5, "circle");
  16474. this.setInfo(circle6, ui.border.circle6, "circle");
  16475. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16476. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16477. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16478. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16479. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16480. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16481. let arr = xGame.common.gameMgr.holePosList;
  16482. xGame.common.gameMgr.posObj = {
  16483. "1": arr[0],
  16484. "3": arr[2],
  16485. "4": arr[3],
  16486. "6": arr[5]
  16487. };
  16488. }
  16489. initHolePos(x, y) {
  16490. if (x < 300)
  16491. x += 25;
  16492. else if (x > 1000)
  16493. x -= 25;
  16494. else if (y > 200)
  16495. y -= 10;
  16496. else
  16497. y += 10;
  16498. if (y < 200)
  16499. y += 30;
  16500. else if (y > 500)
  16501. y -= 30;
  16502. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16503. }
  16504. setInfo(d3Obj, d2Obj, type) {
  16505. let ui = xGame.common.gameUI.ui;
  16506. let sprite = new Laya.Sprite();
  16507. ui.border.displayObject.addChild(sprite);
  16508. let colli = xGame.common.getCollider(type);
  16509. sprite.addComponentIntance(colli);
  16510. let rigy = xGame.common.getRigbody();
  16511. rigy.type = "static";
  16512. sprite.addComponentIntance(rigy);
  16513. let d3Pos = d3Obj.transform.position;
  16514. xGame.common.pos3to2Convert(d3Pos);
  16515. let scaleX = d3Obj.transform.localScaleX;
  16516. let scaleZ = d3Obj.transform.localScaleZ;
  16517. let width = xGame.common.scale3to2Convert(scaleZ);
  16518. let height = xGame.common.scale3to2Convert(scaleX);
  16519. sprite.pivotX = width / 2;
  16520. sprite.pivotY = height / 2;
  16521. sprite.x = d3Pos.x;
  16522. sprite.y = d3Pos.y;
  16523. sprite.width = width;
  16524. sprite.height = height;
  16525. d2Obj.x = d3Pos.x;
  16526. d2Obj.y = d3Pos.y;
  16527. d2Obj.width = width;
  16528. d2Obj.height = height;
  16529. if (type == "box") {
  16530. colli.width = width;
  16531. colli.height = height;
  16532. colli.isSensor = false;
  16533. colli.label = "border";
  16534. }
  16535. else {
  16536. colli.radius = width / 2;
  16537. colli.isSensor = true;
  16538. colli.label = "hole";
  16539. sprite.addComponent(D2Hole);
  16540. }
  16541. }
  16542. }
  16543. class D3World extends Laya.Script3D {
  16544. constructor() {
  16545. super();
  16546. this.loadNum = 0;
  16547. this.setLoadNum = 7;
  16548. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16549. }
  16550. onAwake() {
  16551. }
  16552. loadScene() {
  16553. this.scene = this.owner;
  16554. let url = `res/unityRes/root.lh`;
  16555. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16556. this.scene.addChild(prefab);
  16557. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16558. this.putCameraInfo();
  16559. this.camera.enableHDR = false;
  16560. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16561. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16562. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16563. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16564. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16565. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16566. this.knife.active = false;
  16567. this.loadD3Obj();
  16568. }));
  16569. }
  16570. putCameraInfo() {
  16571. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16572. this.cameraObj = new cameraType();
  16573. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16574. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16575. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16576. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16577. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16578. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16579. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16580. this.visitAngleChild.init();
  16581. this.visitRootObj.posX = this.visitAngleChild.posX;
  16582. this.visitRootObj.posY = this.visitAngleChild.posY;
  16583. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16584. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16585. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16586. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16587. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16588. xGame.common.showOneCamera("mainCamera");
  16589. }
  16590. loadD3Obj() {
  16591. this.loadTable();
  16592. this.loadRoom();
  16593. this.loadInHoleParticial();
  16594. this.loadIceParticial();
  16595. this.loadHitParticial();
  16596. this.loadFireworksParticial();
  16597. this.loadBall();
  16598. }
  16599. loadInHoleParticial() {
  16600. this.loadD3Res("inHoleEft", "", (prefab) => {
  16601. prefab.addComponent(Partical);
  16602. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16603. });
  16604. }
  16605. loadIceParticial() {
  16606. this.loadD3Res("iceEft", "", (prefab) => {
  16607. prefab.addComponent(Partical);
  16608. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16609. });
  16610. }
  16611. loadHitParticial() {
  16612. this.loadD3Res("hitEft", "", (prefab) => {
  16613. prefab.addComponent(Partical);
  16614. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16615. });
  16616. }
  16617. loadFireworksParticial() {
  16618. this.loadD3Res("fireworksEft", "", (prefab) => {
  16619. prefab.addComponent(Partical);
  16620. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16621. });
  16622. }
  16623. loadBall(index = 1) {
  16624. this.loadD3Res("ball", index, (prefab) => {
  16625. this.ballPrefab = prefab;
  16626. this.ballPrefab.addComponent(Ball);
  16627. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16628. });
  16629. }
  16630. loadTable(index = 1) {
  16631. this.loadD3Res("table", index, (prefab) => {
  16632. this.tableSrc = prefab.addComponent(Table);
  16633. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16634. this.d3Hand.init();
  16635. this.tableRoot.addChild(prefab);
  16636. });
  16637. }
  16638. loadRoom(index = 1) {
  16639. this.loadD3Res("room", index, (prefab) => {
  16640. this.roomRoot.addChild(prefab);
  16641. });
  16642. }
  16643. loadD3Res(type, index, callback) {
  16644. let url = `res/unityRes/${type}${index}.lh`;
  16645. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16646. callback && callback(prefab);
  16647. this.checkResLoad();
  16648. }));
  16649. }
  16650. checkResLoad() {
  16651. this.loadNum++;
  16652. if (this.loadNum >= this.setLoadNum) {
  16653. xGame.eventMgr.event(D3RES_LOADED);
  16654. }
  16655. }
  16656. prePlayEft() {
  16657. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16658. eft.transform.localPositionX = 0;
  16659. eft.transform.localPositionY = -5;
  16660. eft.transform.localPositionZ = 0;
  16661. eft.active = true;
  16662. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16663. ice.transform.localPositionX = 0;
  16664. ice.transform.localPositionY = -5;
  16665. ice.transform.localPositionZ = 0;
  16666. ice.active = true;
  16667. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16668. hit.transform.localPositionX = 0;
  16669. hit.transform.localPositionY = -5;
  16670. hit.transform.localPositionZ = 0;
  16671. hit.active = true;
  16672. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16673. fireworks.transform.localPositionX = 0;
  16674. fireworks.transform.localPositionY = -5;
  16675. fireworks.transform.localPositionZ = 0;
  16676. fireworks.active = true;
  16677. }
  16678. }
  16679. class cameraType {
  16680. }
  16681. class MoyuMgr$1 {
  16682. static initMoyu() {
  16683. this.moyuView = new MoyuView$1();
  16684. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16685. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16686. this.moyuView.ui.displayObject.zOrder = 1000;
  16687. this.moyuView.init();
  16688. this.moyuView.showTip(true);
  16689. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16690. window['XApk'] = this;
  16691. }
  16692. static showAge(show) {
  16693. if (this.moyuView)
  16694. this.moyuView.showAge(show);
  16695. }
  16696. static onPlatMsg(idx) {
  16697. if (!MoyuMgr$1.moyuView)
  16698. return;
  16699. if (idx == '0') {
  16700. MoyuMgr$1.moyuView.showTip(false);
  16701. }
  16702. }
  16703. static showAgree(call) {
  16704. if (this.moyuView)
  16705. this.moyuView.showAgree(call);
  16706. else
  16707. call && call();
  16708. }
  16709. static showXy(type = 1) {
  16710. if (this.moyuView)
  16711. this.moyuView.showXy(type);
  16712. }
  16713. }
  16714. MoyuMgr$1.isAdvise = false;
  16715. class MoyuView$1 {
  16716. constructor() {
  16717. this.ysxyNum = 1;
  16718. this.ysJson = null;
  16719. this.ui = ui_UIMoyu.createInstance();
  16720. }
  16721. init() {
  16722. this.ui.mainBg.visible = false;
  16723. this.ui.xyNode.visible = false;
  16724. this.ui.ageNode.visible = false;
  16725. this.ui.tipNode.visible = false;
  16726. this.ui.rnNode.visible = false;
  16727. this.ui.fcmNode.visible = false;
  16728. this.ui.ageTip.visible = false;
  16729. this.ui.msgNode.visible = false;
  16730. this.ui.visible = false;
  16731. this.ui.xyNode.xyList.setVirtual();
  16732. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16733. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16734. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16735. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16736. this.ui.xyNode.btnKnown.visible = false;
  16737. this.ui.xyNode.xy1.visible = false;
  16738. this.ui.xyNode.xy2.visible = false;
  16739. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16740. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16741. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16742. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16743. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16744. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16745. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16746. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16747. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16748. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16749. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16750. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16751. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16752. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16753. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16754. this.ysxyNum = 2;
  16755. }
  16756. }
  16757. onClick(obj) {
  16758. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16759. switch (obj) {
  16760. case this.ui.ageTip:
  16761. if (Moyu.isTTApk) {
  16762. this.ui.ageNode.visible = true;
  16763. this.ui.mainBg.visible = true;
  16764. }
  16765. break;
  16766. case this.ui.tipNode:
  16767. this.showTip(false);
  16768. break;
  16769. case this.ui.ageNode.btnAge:
  16770. this.ui.ageNode.visible = false;
  16771. this.ui.mainBg.visible = false;
  16772. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16773. this.ui.visible = false;
  16774. break;
  16775. case this.ui.xyNode.btnXy3:
  16776. case this.ui.xyNode.btnXy1:
  16777. this.loadXy(1);
  16778. break;
  16779. case this.ui.xyNode.btnXy2:
  16780. this.loadXy(2);
  16781. break;
  16782. case this.ui.xyNode.btnBack:
  16783. this.ui.xyNode.xy1.visible = true;
  16784. this.ui.xyNode.xy2.visible = false;
  16785. break;
  16786. case this.ui.xyNode.btnKnown:
  16787. this.ui.xyNode.visible = false;
  16788. this.ui.mainBg.visible = false;
  16789. this.ui.visible = false;
  16790. break;
  16791. case this.ui.rnNode.btnCheck:
  16792. this.check();
  16793. break;
  16794. case this.ui.rnNode.btnExit:
  16795. case this.ui.xyNode.btnNo:
  16796. this.ysxyNum--;
  16797. if (this.ysxyNum > 0)
  16798. this.showMsg("Refuse to quit the game once again");
  16799. else {
  16800. Moyu.userAgree(false);
  16801. Moyu.exit();
  16802. }
  16803. break;
  16804. case this.ui.xyNode.btnSure:
  16805. case this.ui.xyNode.btnYes:
  16806. DataMgr.userData.isAgree = true;
  16807. DataMgr.saveUserData();
  16808. this.onAgree();
  16809. break;
  16810. case this.ui.rnNode.btnDone:
  16811. this.ui.rnNode.visible = false;
  16812. this.ui.visible = false;
  16813. break;
  16814. case this.ui.fcmNode.btnRn:
  16815. this.showRn();
  16816. break;
  16817. }
  16818. }
  16819. showTip(show) {
  16820. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16821. return;
  16822. if (show) {
  16823. MoyuMgr$1.isAdvise = true;
  16824. this.ui.visible = true;
  16825. this.ui.tipNode.visible = true;
  16826. this.ui.tipNode.alpha = 1;
  16827. Laya.timer.once(1000, this, this.showTip, [false]);
  16828. }
  16829. else {
  16830. this.ui.tipNode.alpha = 1;
  16831. this.ui.tipNode.visible = true;
  16832. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16833. this.ui.tipNode.visible = false;
  16834. MoyuMgr$1.isAdvise = false;
  16835. }), 1000);
  16836. }
  16837. }
  16838. showAge(show, px = 0, py = 0) {
  16839. if (Moyu.platType > 10 && !Moyu.isIos) {
  16840. this.ui.ageTip.x = px;
  16841. this.ui.ageTip.y = py;
  16842. this.ui.ageTip.visible = show;
  16843. if (show)
  16844. this.ui.visible = true;
  16845. }
  16846. }
  16847. showAgree(call) {
  16848. this.agreeCall = call;
  16849. this.onAgree();
  16850. return;
  16851. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16852. this.showXy(0);
  16853. }
  16854. else
  16855. this.onAgree();
  16856. }
  16857. onAgree() {
  16858. if (!this.ui.ageNode.visible)
  16859. this.ui.visible = false;
  16860. this.ui.xyNode.visible = false;
  16861. Moyu.userAgree(true);
  16862. this.showAge(false);
  16863. this.agreeCall && this.agreeCall();
  16864. this.showRn();
  16865. }
  16866. showMsg(txt) {
  16867. this.ui.msgNode.txtMsg.text = txt;
  16868. this.ui.msgNode.visible = true;
  16869. this.ui.msgNode.alpha = 1;
  16870. this.ui.visible = true;
  16871. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  16872. this.ui.msgNode.visible = false;
  16873. }), 2500, true);
  16874. }
  16875. showRn() {
  16876. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16877. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  16878. this.ui.rnNode.rn1.visible = true;
  16879. this.ui.rnNode.rn2.visible = false;
  16880. this.ui.rnNode.rn3.visible = false;
  16881. this.ui.rnNode.rn4.visible = false;
  16882. this.ui.rnNode.visible = true;
  16883. this.ui.mainBg.visible = true;
  16884. this.ui.rnNode.btnDone.visible = false;
  16885. this.ui.rnNode.btnExit.visible = true;
  16886. this.ui.rnNode.btnCheck.visible = true;
  16887. this.ui.fcmNode.visible = false;
  16888. this.ui.visible = true;
  16889. return;
  16890. }
  16891. }
  16892. this.showFcm();
  16893. }
  16894. showFcm() {
  16895. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  16896. Moyu.initFCM(true);
  16897. if (Moyu.gameTime < 1)
  16898. this.fcmLoop();
  16899. else if (Moyu.gameTime < 999)
  16900. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  16901. }
  16902. }
  16903. fcmLoop() {
  16904. if (Moyu.gameTime < 1) {
  16905. this.ui.rnNode.visible = false;
  16906. this.ui.fcmNode.visible = true;
  16907. this.ui.mainBg.visible = true;
  16908. this.ui.visible = true;
  16909. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  16910. Laya.timer.clear(this.ui, this.fcmLoop);
  16911. }
  16912. }
  16913. check() {
  16914. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  16915. this.ui.rnNode.rn1.visible = false;
  16916. this.ui.rnNode.rn2.visible = false;
  16917. this.ui.rnNode.rn4.visible = true;
  16918. }
  16919. else if (this.ui.rnNode.rn4.visible) {
  16920. let name = this.ui.rnNode.inputName.text;
  16921. let code = this.ui.rnNode.inputCode.text;
  16922. if (code && code.length == 18) {
  16923. this.ui.rnNode.rn1.visible = false;
  16924. this.ui.rnNode.rn4.visible = false;
  16925. Moyu.authenticate(name, code, (res) => {
  16926. this.ui.rnNode.rn2.visible = !res;
  16927. this.ui.rnNode.rn3.visible = res;
  16928. this.ui.rnNode.btnDone.visible = res;
  16929. this.ui.rnNode.btnExit.visible = !res;
  16930. this.ui.rnNode.btnCheck.visible = !res;
  16931. if (res)
  16932. this.showFcm();
  16933. });
  16934. }
  16935. else
  16936. this.showMsg("信息填写不完整");
  16937. }
  16938. }
  16939. loadXy(type = 0) {
  16940. this.ui.xyNode.xy1.visible = false;
  16941. this.ui.xyNode.xy2.visible = true;
  16942. this.ui.xyNode.xyList.scrollToView(0);
  16943. if (type == 1) {
  16944. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  16945. }
  16946. else if (type == 2) {
  16947. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  16948. }
  16949. }
  16950. showXy(type = 0) {
  16951. this.xyBtn();
  16952. if (type == 0) {
  16953. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  16954. this.ui.xyNode.btnSure.visible = true;
  16955. }
  16956. else {
  16957. this.ui.xyNode.btnYes.visible = true;
  16958. this.ui.xyNode.btnNo.visible = true;
  16959. }
  16960. }
  16961. else {
  16962. this.ui.xyNode.btnKnown.visible = true;
  16963. this.ui.mainBg.visible = true;
  16964. }
  16965. this.ui.xyNode.xy1.visible = true;
  16966. this.ui.xyNode.xy2.visible = false;
  16967. this.ui.xyNode.visible = true;
  16968. this.ui.visible = true;
  16969. }
  16970. xyBtn() {
  16971. this.ui.xyNode.btnSure.visible = false;
  16972. this.ui.xyNode.btnYes.visible = false;
  16973. this.ui.xyNode.btnNo.visible = false;
  16974. this.ui.xyNode.btnKnown.visible = false;
  16975. {
  16976. this.ui.xyNode.btnXy3.visible = false;
  16977. this.ui.xyNode.btnXy2.visible = true;
  16978. this.ui.xyNode.btnXy1.visible = true;
  16979. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  16980. }
  16981. }
  16982. createXY(json) {
  16983. this.ysJson = json.content;
  16984. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  16985. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  16986. this.ui.xyNode.xy2.visible = true;
  16987. }
  16988. renderListItem(idx, cell) {
  16989. let xy = this.ysJson[idx];
  16990. cell.height = xy.line * 30;
  16991. cell.xyItem.text = xy.text;
  16992. }
  16993. onDestroy() {
  16994. this.agreeCall = null;
  16995. }
  16996. }
  16997. class UILoading extends UIBase {
  16998. constructor() {
  16999. super();
  17000. this.accTime = 0;
  17001. this.curNum = 0;
  17002. this.rate = 1;
  17003. this.loadSubOk = false;
  17004. this.loadResOK = false;
  17005. this.openLoading = true;
  17006. this.beginLoadRes = false;
  17007. this.finishD2 = false;
  17008. this.finishD3 = false;
  17009. }
  17010. onConstructor() {
  17011. this.ui = ui_UILoading.createInstance();
  17012. this.contentPane = this.ui;
  17013. this.isEject = false;
  17014. this._initUI();
  17015. this._addEvent();
  17016. }
  17017. _initUI() {
  17018. MoyuMgr$1.initMoyu();
  17019. }
  17020. _addEvent() {
  17021. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17022. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17023. }
  17024. show() {
  17025. super.show();
  17026. console.log('zh:加载分包资源');
  17027. loadSubRes(this.subResProgress.bind(this));
  17028. this.ui.txtLoad.text = "Loading...";
  17029. }
  17030. subResProgress(pro, finish) {
  17031. this.curNum = pro;
  17032. if (finish) {
  17033. this.curNum = 1;
  17034. this.loadSubOk = true;
  17035. }
  17036. }
  17037. laodD3Res() {
  17038. let scene3D = new Laya.Scene3D();
  17039. xGame.common.d3Scene = scene3D;
  17040. xGame.common.d3World = scene3D.addComponent(D3World);
  17041. xGame.common.d3World.loadScene();
  17042. }
  17043. loadD2Res() {
  17044. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17045. this.finishD2 = true;
  17046. this.checkLoadAll();
  17047. this.curNum = 1;
  17048. }), Laya.Handler.create(this, (pro) => {
  17049. this.curNum = pro;
  17050. }, null, false));
  17051. }
  17052. d3ResFinish() {
  17053. this.finishD3 = true;
  17054. this.checkLoadAll();
  17055. }
  17056. checkLoadAll() {
  17057. if (this.finishD2 && this.finishD3) {
  17058. this.loadResOK = true;
  17059. }
  17060. }
  17061. loadRes() {
  17062. this.laodD3Res();
  17063. this.loadD2Res();
  17064. }
  17065. myUpdate(dt) {
  17066. if (!this.openLoading)
  17067. return;
  17068. this.accTime += dt * this.rate;
  17069. if (this.accTime >= this.curNum)
  17070. this.accTime = this.curNum;
  17071. this.ui.loadinfo.value = this.accTime * 100;
  17072. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17073. if (!this.beginLoadRes) {
  17074. this.beginLoadRes = true;
  17075. this.ui.txtLoad.text = "Loading...";
  17076. this.curNum = 0;
  17077. this.accTime = 0;
  17078. this.loadRes();
  17079. }
  17080. if (this.loadResOK) {
  17081. this.openLoading = false;
  17082. Laya.timer.once(300, this, () => {
  17083. xGame.common.d3Scene.active = false;
  17084. MoyuMgr$1.showAgree(enterGame);
  17085. });
  17086. }
  17087. }
  17088. }
  17089. release() {
  17090. }
  17091. hide() {
  17092. super.hide();
  17093. this.release();
  17094. }
  17095. onClose() {
  17096. this.hide();
  17097. }
  17098. }
  17099. UILoading.uiName = "UILoading";
  17100. class UIRepentProp$1 extends UIBase {
  17101. constructor() {
  17102. super();
  17103. this.viewType = 0;
  17104. this.regretType = 0;
  17105. }
  17106. onConstructor() {
  17107. this.ui = ui_UIRepentProp.createInstance();
  17108. this.contentPane = this.ui;
  17109. this.isEject = false;
  17110. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17111. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17112. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17113. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17114. }
  17115. show(viewType, regretType, callback) {
  17116. PlatMgr.showInsert(true);
  17117. this.viewType = viewType;
  17118. this.regretType = regretType;
  17119. this.callback = callback;
  17120. super.show();
  17121. this.ui.t0.play();
  17122. this.ui.c1.selectedIndex = this.viewType;
  17123. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17124. if (this.viewType == 0) {
  17125. let guide = DataMgr.getGuideHelpLine();
  17126. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17127. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17128. }
  17129. xGame.common.gameMgr.gamePause = true;
  17130. }
  17131. hideSelf() {
  17132. xGame.common.gameMgr.gamePause = false;
  17133. this.callback && this.callback(false);
  17134. this.hide();
  17135. }
  17136. videoRegret() {
  17137. Moyu.showVideoAd(() => {
  17138. this.callback && this.callback(true);
  17139. this.hideSelf();
  17140. }, EAdType.regretBall);
  17141. }
  17142. videoAddHelpLine() {
  17143. let guide = DataMgr.getGuideHelpLine();
  17144. if (guide == 0) {
  17145. this.callback && this.callback(true);
  17146. this.hideSelf();
  17147. DataMgr.setGuideHelpLine();
  17148. xGame.common.gameUI.ui.guideNode.visible = false;
  17149. }
  17150. else {
  17151. Moyu.showVideoAd(() => {
  17152. this.callback && this.callback(true);
  17153. this.hideSelf();
  17154. }, EAdType.longHelpLine);
  17155. }
  17156. }
  17157. }
  17158. UIRepentProp$1.uiName = "UIRepentProp";
  17159. class UIRodMethod$1 extends UIBase {
  17160. constructor() {
  17161. super();
  17162. this.isPressd = false;
  17163. }
  17164. onConstructor() {
  17165. this.ui = ui_UIRodMethod.createInstance();
  17166. this.contentPane = this.ui;
  17167. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17168. this.moveDir = new Laya.Vector2();
  17169. this.moveDest = new Laya.Vector2();
  17170. this.centerPos = new Laya.Vector2();
  17171. xGame.common.uiRodMethod = this;
  17172. }
  17173. show() {
  17174. super.show();
  17175. xGame.common.gameMgr.gamePause = true;
  17176. this.openPressDotEvent();
  17177. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17178. this.centerPos.x = this.ui.white.x;
  17179. this.centerPos.y = this.ui.white.y;
  17180. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17181. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17182. this.setDot();
  17183. }
  17184. setDot() {
  17185. this.ui.dot.x = this.moveDest.x;
  17186. this.ui.dot.y = this.moveDest.y;
  17187. }
  17188. closeSelf() {
  17189. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17190. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17191. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17192. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17193. xGame.common.gameMgr.gamePause = false;
  17194. this.hide();
  17195. }
  17196. openPressDotEvent() {
  17197. this.closePressDotEvent();
  17198. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17199. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17200. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17201. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17202. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17203. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17204. }
  17205. closePressDotEvent() {
  17206. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17207. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17208. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17209. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17210. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17211. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17212. }
  17213. onDown(e) {
  17214. if (e.type == Laya.Event.MOUSE_DOWN)
  17215. this.isPressd = true;
  17216. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17217. this.isPressd = false;
  17218. if (!this.isPressd)
  17219. return;
  17220. this.moveDest.x = e.stageX;
  17221. this.moveDest.y = e.stageY;
  17222. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17223. if (dis > 6724) {
  17224. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17225. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17226. }
  17227. this.setDot();
  17228. }
  17229. resetRod() {
  17230. this.ui.dot.x = this.ui.white.x;
  17231. this.ui.dot.y = this.ui.white.y;
  17232. this.gameRod.dot.x = this.gameRod.bg.x;
  17233. this.gameRod.dot.y = this.gameRod.bg.y;
  17234. xGame.common.rodOffest.x = 0;
  17235. xGame.common.rodOffest.y = 0;
  17236. }
  17237. }
  17238. UIRodMethod$1.uiName = "UIRodMethod";
  17239. class UIMsg$1 extends UIBase {
  17240. constructor() {
  17241. super();
  17242. }
  17243. onConstructor() {
  17244. this.ui = ui_UIMsg.createInstance();
  17245. this.contentPane = this.ui;
  17246. this.isEject = false;
  17247. this.isMuti = true;
  17248. }
  17249. show(msg, callback) {
  17250. super.show();
  17251. this.ui.tipsNode.msgTxt.text = msg;
  17252. this.ui.alpha = 1;
  17253. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17254. this.hide();
  17255. callback && callback();
  17256. }), 1000);
  17257. }
  17258. }
  17259. UIMsg$1.uiName = "UIMsg";
  17260. class UITips$1 extends UIBase {
  17261. constructor() {
  17262. super();
  17263. this.type = 0;
  17264. }
  17265. onConstructor() {
  17266. this.ui = ui_UITips.createInstance();
  17267. this.contentPane = this.ui;
  17268. this.isEject = false;
  17269. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17270. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17271. }
  17272. show(tipsTxt, womanTxt, type) {
  17273. super.show();
  17274. this.ui.t0.play();
  17275. this.ui.myNode.tipsTxt.text = tipsTxt;
  17276. this.ui.myNode.womanTxt.text = womanTxt;
  17277. PlatMgr.showInsert(true);
  17278. this.ui.myNode.c1.selectedIndex = type;
  17279. this.type = type;
  17280. switch (this.type) {
  17281. case TipsType.exitGame:
  17282. xGame.common.gameMgr.gamePause = true;
  17283. break;
  17284. case TipsType.foul:
  17285. Laya.timer.once(200, this, () => {
  17286. xGame.common.gameMgr.gamePause = true;
  17287. });
  17288. break;
  17289. default:
  17290. break;
  17291. }
  17292. }
  17293. clickLeftBtn() {
  17294. this.hide();
  17295. xGame.common.gameMgr.gamePause = false;
  17296. switch (this.type) {
  17297. case TipsType.exitGame:
  17298. break;
  17299. case TipsType.foul:
  17300. break;
  17301. default:
  17302. break;
  17303. }
  17304. }
  17305. clickRightBtn() {
  17306. this.hide();
  17307. switch (this.type) {
  17308. case TipsType.exitGame:
  17309. xGame.eventMgr.event(RESET_GAME);
  17310. xGame.uiMgr.Show(UIMain$1);
  17311. Moyu.recordEnd(this, null);
  17312. xGame.common.longHelpLine = false;
  17313. break;
  17314. case TipsType.foul:
  17315. xGame.common.gameMgr.gamePause = false;
  17316. Laya.timer.clearAll(this);
  17317. break;
  17318. default:
  17319. break;
  17320. }
  17321. }
  17322. }
  17323. UITips$1.uiName = "UITips";
  17324. class UIGame$1 extends UIBase {
  17325. constructor() {
  17326. super();
  17327. this.powerNum = 0;
  17328. this.isD3Inited = false;
  17329. this.isPrePlay = false;
  17330. this.isMoveRod = false;
  17331. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17332. this.rulerDis = 20;
  17333. this.rulerOffset = 0;
  17334. }
  17335. onConstructor() {
  17336. this.ui = ui_UIGame.createInstance();
  17337. this.contentPane = this.ui;
  17338. this.ui.x += xGame.common.sysOffestNum;
  17339. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17340. this.isEject = false;
  17341. xGame.common.gameUI = this;
  17342. this.initSelf();
  17343. }
  17344. isTurnSelf() {
  17345. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17346. return true;
  17347. }
  17348. }
  17349. initSelf() {
  17350. let topUI = this.ui.topNode;
  17351. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17352. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17353. this.barInfo = {};
  17354. this.barInfo.curY = 0;
  17355. this.barInfo.height = this.ui.powerNode.height;
  17356. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17357. this.barInfo.powerStartY = this.ui.powerNode.y;
  17358. xGame.common.aiPlayer = new AIPlayer();
  17359. xGame.common.gameMgr = new GameMgr();
  17360. xGame.common.skillMgr = new SkillMgr();
  17361. xGame.common.wordsMgr = new WordsMgr();
  17362. xGame.common.talkMgr = new TalkMgr();
  17363. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17364. console.log("加载经典模式表情文件chenggon !");
  17365. });
  17366. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17367. console.log("挑战模式奖励模式spine加载成功!");
  17368. });
  17369. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17370. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17371. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17372. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17373. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17374. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17375. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17376. }
  17377. returnHome() {
  17378. let tips = "Are you sure to exit the game?";
  17379. let woman = "Boss, why don't you play for a while longer?";
  17380. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17381. }
  17382. addRodMethodClick() {
  17383. if (this.isTurnSelf()) {
  17384. xGame.uiMgr.Show(UIRodMethod$1);
  17385. }
  17386. }
  17387. clickHelpLineBtn(force = false) {
  17388. if (!this.isTurnSelf())
  17389. return;
  17390. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17391. if (success) {
  17392. xGame.common.longHelpLine = true;
  17393. xGame.common.d2World.getHelpLine();
  17394. Moyu.sendDataEvent("guideNum");
  17395. }
  17396. else {
  17397. }
  17398. });
  17399. }
  17400. renderSelfDisplayBalls(index, target) {
  17401. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17402. target.myImg.url = xGame.common.getGameIconUrl(str);
  17403. }
  17404. renderAIDisplayBalls(index, target) {
  17405. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17406. target.myImg.url = xGame.common.getGameIconUrl(str);
  17407. ;
  17408. }
  17409. updateMode() {
  17410. if (xGame.common.gameMode == GameMode.classic) {
  17411. this.ui.topNode.scoreNode.visible = false;
  17412. }
  17413. else if (xGame.common.gameMode == GameMode.bigMove) {
  17414. this.ui.topNode.scoreNode.visible = true;
  17415. }
  17416. }
  17417. show() {
  17418. super.show();
  17419. console.log("zh:uigame show");
  17420. this.ui.alpha = 0;
  17421. this.updateSelf();
  17422. console.log("zh:uigame bf gamemusic01 start");
  17423. xGame.soundMgr.playMusic("gamemusic01");
  17424. console.log("zh:uigame bf gamemusic01 end");
  17425. xGame.common.gameMgr.gamePause = false;
  17426. xGame.common.gameUI.ui.blackAni.visible = false;
  17427. xGame.common.gameUI.ui.whiteAni.visible = false;
  17428. this.ui.powerEft.visible = false;
  17429. this.ui.colorNode.visible = false;
  17430. this.updateHead();
  17431. }
  17432. updateSelf() {
  17433. if (xGame.common.gameMode == GameMode.classic) {
  17434. this.ui.c1.selectedIndex = 0;
  17435. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17436. this.ui.topNode.middleNode.visible = true;
  17437. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17438. }
  17439. else if (xGame.common.gameMode == GameMode.bigMove) {
  17440. this.ui.c1.selectedIndex = 0;
  17441. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17442. this.ui.topNode.middleNode.visible = false;
  17443. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17444. let rand = xGame.common.randomNum(1, max);
  17445. let guide = DataMgr.getSkillGuide();
  17446. if (guide == 0)
  17447. rand = 1;
  17448. xGame.common.bigMoveLevelIndex = rand;
  17449. }
  17450. else if (xGame.common.gameMode == GameMode.placeBall) {
  17451. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17452. this.ui.c1.selectedIndex = 1 + data.type;
  17453. this.ui.alpha = 1;
  17454. this.startGame();
  17455. }
  17456. this.updateMode();
  17457. this.initD3world();
  17458. this.initD2world();
  17459. }
  17460. startGame() {
  17461. this.ui.snowNode.visible = Math.random() <= 0.1;
  17462. this.ui.d2Node.visible = false;
  17463. xGame.common.d3World.d3Hand.gameObj.active = false;
  17464. xGame.common.d3World.tableSrc.init();
  17465. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17466. this.cameraViewChange(() => {
  17467. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17468. switch (xGame.common.gameMode) {
  17469. case GameMode.classic:
  17470. xGame.common.d3World.d3Hand.gameObj.active = true;
  17471. this.playPutBallD3Ani();
  17472. break;
  17473. case GameMode.bigMove:
  17474. this.enterGame();
  17475. Laya.timer.once(500, this, () => {
  17476. this.ui.topNode.middleNode.visible = true;
  17477. this.ui.topNode.middleNode.t0.play();
  17478. });
  17479. break;
  17480. case GameMode.placeBall:
  17481. this.enterGame();
  17482. break;
  17483. default:
  17484. break;
  17485. }
  17486. });
  17487. PlatMgr.showBanner(false);
  17488. }
  17489. enterGame() {
  17490. this.ui.d2Node.visible = true;
  17491. xGame.common.d3World.d3Hand.gameObj.active = false;
  17492. xGame.common.showOneCamera("mainCamera");
  17493. Moyu.recordGame(30, true);
  17494. if (!this.isPrePlay) {
  17495. this.isPrePlay = true;
  17496. xGame.common.d3World.prePlayEft();
  17497. }
  17498. xGame.common.gameMgr.gameReady();
  17499. this.openAllEvent();
  17500. this.ui.snowNode.visible = false;
  17501. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17502. this.ui.helpBtn.visible = condition;
  17503. }
  17504. showHelpLineGuide() {
  17505. let longGuide = DataMgr.getGuideHelpLine();
  17506. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17507. this.ui.helpBtn.visible = true;
  17508. this.ui.guideNode.visible = true;
  17509. }
  17510. }
  17511. setTurnAlpha(alpha) {
  17512. this.ui.keduNode.alpha = alpha;
  17513. this.ui.ganNode.alpha = alpha;
  17514. this.ui.rodMethodNode.alpha = alpha;
  17515. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17516. }
  17517. cameraViewChange(callback) {
  17518. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17519. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17520. xGame.common.showOneCamera("visitAngle");
  17521. cameraSrc.localRotationEulerY = 180;
  17522. cameraSrc.localRotationEulerZ = 0;
  17523. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17524. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17525. callback && callback();
  17526. }));
  17527. }));
  17528. }
  17529. playPutBallD3Ani() {
  17530. xGame.common.showOneCamera("mainCamera");
  17531. let handSrc = xGame.common.d3World.d3Hand;
  17532. handSrc.gameObj.active = true;
  17533. handSrc.transform.localPositionZ = 3;
  17534. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17535. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17536. handSrc.gameObj.active = false;
  17537. this.enterGame();
  17538. }), 400);
  17539. }));
  17540. }
  17541. updateHead() {
  17542. let user = Moyu.getUserInfo();
  17543. this.ui.topNode.selfNameTxt.text = user.nickName;
  17544. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17545. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17546. if (DataMgr.getSkillGuide() < 1) {
  17547. this.ui.topNode.aiNameTxt.text = 'billiards';
  17548. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17549. }
  17550. else {
  17551. this.ui.topNode.aiNameTxt.text = aiData.name;
  17552. let randNo = Math.floor(Math.random() * 10) + 1;
  17553. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17554. }
  17555. }
  17556. initD2world() {
  17557. let node = this.ui.d2Root.displayObject;
  17558. let src = node.getComponent(D2World);
  17559. if (!src) {
  17560. xGame.common.d2World = node.addComponent(D2World);
  17561. }
  17562. xGame.common.d2World.initSelf();
  17563. }
  17564. initD3world() {
  17565. if (this.isD3Inited)
  17566. return;
  17567. this.isD3Inited = true;
  17568. let scene3D = xGame.common.d3Scene;
  17569. this.ui.d3Root.displayObject.addChild(scene3D);
  17570. scene3D.active = true;
  17571. xGame.common.d3World.tableSrc.setBorderPos();
  17572. }
  17573. onRootMove(e) {
  17574. let rootBall = xGame.common.d2World.rootBall;
  17575. this.ui.moveNode.x = e.x;
  17576. this.ui.moveNode.y = e.y;
  17577. rootBall.gameObj.x = e.x;
  17578. rootBall.gameObj.y = e.y;
  17579. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17580. }
  17581. aiRootMove(move) {
  17582. if (move)
  17583. this.hideBallUI();
  17584. else {
  17585. this.showBallUI();
  17586. xGame.common.d2World.getHelpLine();
  17587. }
  17588. }
  17589. aiForce(type, force = 0) {
  17590. this.pressTarget = PressType.powerNode;
  17591. if (type == 1)
  17592. this.onEventUp({ force: true });
  17593. else if (type == 2)
  17594. this.onEventMove({ stageY: force, force: true });
  17595. }
  17596. onEventPress(e) {
  17597. if (e.stopPropagation)
  17598. e.stopPropagation();
  17599. if (!this.isTurnSelf())
  17600. return;
  17601. let target = e.target;
  17602. switch (target) {
  17603. case this.ui.myPowerNode.displayObject:
  17604. this.pressTarget = PressType.powerNode;
  17605. this.barInfo.curY = e.stageY;
  17606. this.updateBarInfo();
  17607. break;
  17608. case this.ui.moveNode.displayObject:
  17609. this.pressTarget = PressType.moveNode;
  17610. this.hideBallUI();
  17611. this.eventObj.curX = this.ui.moveNode.x;
  17612. this.eventObj.curY = this.ui.moveNode.y;
  17613. this.ui.moveNode.finger.visible = false;
  17614. this.eventObj.lastX = e.stageX;
  17615. this.eventObj.lastY = e.stageY;
  17616. break;
  17617. case this.ui.rulerClickNode.displayObject:
  17618. this.pressTarget = PressType.rulerNode;
  17619. this.eventObj.lastY = e.stageY;
  17620. break;
  17621. case this.ui.d2Root.displayObject:
  17622. this.pressTarget = PressType.d2Root;
  17623. this.eventObj.lastX = e.stageX;
  17624. this.eventObj.lastY = e.stageY;
  17625. this.eventObj.starX = e.stageX;
  17626. this.eventObj.starY = e.stageY;
  17627. this.eventObj.curX = 0;
  17628. this.eventObj.curY = 0;
  17629. xGame.common.d2World.d2Gan.setGanLastInfo();
  17630. this.rulerOffset = 0;
  17631. break;
  17632. default:
  17633. break;
  17634. }
  17635. }
  17636. onEventMove(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.barInfo.curY = e.stageY;
  17648. this.updateBarInfo();
  17649. this.isMoveRod = true;
  17650. break;
  17651. case PressType.moveNode:
  17652. let rootBall = xGame.common.d2World.rootBall;
  17653. let radius = rootBall.gameObj.width / 2;
  17654. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17655. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17656. let border = xGame.common.d2World.borderRect;
  17657. if (curX <= border.x + radius)
  17658. curX = border.x + radius;
  17659. else if (curX >= border.x + border.width - radius)
  17660. curX = border.x + border.width - radius;
  17661. if (curY <= border.y + radius)
  17662. curY = border.y + radius;
  17663. else if (curY >= border.y + border.height - radius)
  17664. curY = border.y + border.height - radius;
  17665. if (xGame.common.gameMgr.isOpenBall) {
  17666. if (curX >= border.x + border.openBallW - radius)
  17667. curX = border.x + border.openBallW - radius;
  17668. }
  17669. this.ui.moveNode.x = curX;
  17670. this.ui.moveNode.y = curY;
  17671. rootBall.gameObj.x = curX;
  17672. rootBall.gameObj.y = curY;
  17673. rootBall.d3BallSrc.setTransPos(curX, curY);
  17674. this.isMoveRod = true;
  17675. break;
  17676. case PressType.rulerNode:
  17677. let yy = e.stageY - this.eventObj.lastY;
  17678. this.eventObj.lastY = e.stageY;
  17679. let ruler1 = this.ui.rulerNode.img1;
  17680. let ruler2 = this.ui.rulerNode.img2;
  17681. ruler1.y += yy;
  17682. ruler2.y += yy;
  17683. this.rulerOffset += yy;
  17684. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17685. this.rulerOffset = 0;
  17686. xGame.soundMgr.playSound("inch", 1, 10);
  17687. }
  17688. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17689. let h = ruler1.height;
  17690. this.checkGuide();
  17691. this.isMoveRod = true;
  17692. if (ruler1.y >= h) {
  17693. ruler1.y = -h;
  17694. ruler2.y = 0;
  17695. return;
  17696. }
  17697. else if (ruler1.y <= -h) {
  17698. ruler1.y = h;
  17699. ruler2.y = 0;
  17700. return;
  17701. }
  17702. if (ruler2.y >= h) {
  17703. ruler2.y = -h;
  17704. ruler1.y = 0;
  17705. return;
  17706. }
  17707. else if (ruler2.y <= -h) {
  17708. ruler2.y = h;
  17709. ruler1.y = 0;
  17710. return;
  17711. }
  17712. break;
  17713. case PressType.d2Root:
  17714. this.eventObj.curX = e.stageX;
  17715. this.eventObj.curY = e.stageY;
  17716. let offset = this.checkRodMoveDir();
  17717. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17718. this.eventObj.lastX = e.stageX;
  17719. this.eventObj.lastY = e.stageY;
  17720. break;
  17721. default:
  17722. break;
  17723. }
  17724. }
  17725. onEventUp(e) {
  17726. if (e.stopPropagation)
  17727. e.stopPropagation();
  17728. if (e && e.force) {
  17729. }
  17730. else {
  17731. if (!this.isTurnSelf())
  17732. return;
  17733. }
  17734. switch (this.pressTarget) {
  17735. case PressType.powerNode:
  17736. this.ui.powerNode.value = 0;
  17737. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17738. this.ui.powerTxt.text = "";
  17739. if (this.powerNum > 0) {
  17740. xGame.eventMgr.event(BALL_SHOOT);
  17741. xGame.common.d2World.shoot(this.powerNum);
  17742. xGame.common.d2World.d2Gan.shoot();
  17743. xGame.common.d2World.d2HelpLine.shoot();
  17744. this.finishGuide();
  17745. this.ui.powerEft.visible = false;
  17746. this.ui.colorNode.visible = false;
  17747. let ganStr = "";
  17748. if (this.powerNum <= 30) {
  17749. ganStr = "gan_30";
  17750. }
  17751. else if (this.powerNum <= 60) {
  17752. ganStr = "gan_50";
  17753. }
  17754. else {
  17755. ganStr = "gan_80";
  17756. }
  17757. xGame.soundMgr.playSound(ganStr);
  17758. }
  17759. break;
  17760. case PressType.moveNode:
  17761. let rootBall = xGame.common.d2World.rootBall;
  17762. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17763. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17764. let isIntersect = this.judgeBallIntersect();
  17765. if (isIntersect) {
  17766. this.ui.moveNode.x = lastX;
  17767. this.ui.moveNode.y = lastY;
  17768. rootBall.gameObj.x = lastX;
  17769. rootBall.gameObj.y = lastY;
  17770. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17771. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17772. }
  17773. else {
  17774. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17775. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17776. }
  17777. this.showBallUI();
  17778. this.ui.moveNode.finger.visible = true;
  17779. xGame.common.d2World.getHelpLine();
  17780. break;
  17781. case PressType.rulerNode:
  17782. break;
  17783. case PressType.d2Root:
  17784. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17785. if (dis <= 25) {
  17786. this.moveToClickDot(e);
  17787. }
  17788. break;
  17789. default:
  17790. break;
  17791. }
  17792. this.pressTarget = -1;
  17793. }
  17794. checkGuide() {
  17795. let guide = DataMgr.getSkillGuide();
  17796. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17797. xGame.common.guideStep++;
  17798. xGame.common.gameUI.ui.guide2.visible = false;
  17799. xGame.common.gameUI.ui.guide3.visible = true;
  17800. }
  17801. }
  17802. finishGuide() {
  17803. let guide = DataMgr.getSkillGuide();
  17804. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17805. xGame.common.guideStep = 10;
  17806. this.closeAllGuide();
  17807. }
  17808. }
  17809. closeAllGuide() {
  17810. xGame.common.gameUI.ui.guide1.visible = false;
  17811. xGame.common.gameUI.ui.guide2.visible = false;
  17812. xGame.common.gameUI.ui.guide3.visible = false;
  17813. }
  17814. updateBarInfo() {
  17815. let star = this.ui.powerNode.y;
  17816. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17817. if (rate >= 1)
  17818. rate = 1;
  17819. if (rate <= 0)
  17820. rate = 0;
  17821. this.powerNum = Math.ceil(rate * 100);
  17822. this.ui.powerNode.value = this.powerNum;
  17823. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17824. this.ui.colorNode.value = this.powerNum;
  17825. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17826. this.ui.powerEft.visible = this.powerNum != 0;
  17827. this.ui.colorNode.visible = this.powerNum != 0;
  17828. this.ui.powerTxt.text = this.powerNum + "";
  17829. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17830. }
  17831. forceCancel() {
  17832. this.ui.powerNode.value = 0;
  17833. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17834. this.ui.powerTxt.text = "";
  17835. }
  17836. checkRodMoveDir() {
  17837. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17838. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  17839. if (tempX >= 0 && tempY <= 0) {
  17840. return this.checkDir();
  17841. }
  17842. else if (tempX < 0 && tempY < 0) {
  17843. return this.checkDir(1, -1);
  17844. }
  17845. else if (tempX < 0 && tempY > 0) {
  17846. return this.checkDir(-1, -1);
  17847. }
  17848. else {
  17849. return this.checkDir(-1, 1);
  17850. }
  17851. }
  17852. checkDir(flagX = 1, flagY = 1) {
  17853. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  17854. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  17855. if (offsetY == 0) {
  17856. return offsetX * flagX;
  17857. }
  17858. if (offsetX == 0) {
  17859. return offsetY * flagY;
  17860. }
  17861. let angle = offsetY / offsetX;
  17862. if (Math.abs(angle) >= 1) {
  17863. return offsetY * flagY;
  17864. }
  17865. else {
  17866. return offsetX * flagX;
  17867. }
  17868. }
  17869. judgeBallIntersect() {
  17870. let rootBall = xGame.common.d2World.rootBall;
  17871. let ballArr = xGame.common.d2World.ballArr;
  17872. let radius = rootBall.gameObj.width / 2;
  17873. let temp;
  17874. let isIntersect = false;
  17875. for (let index = 0; index < ballArr.length; index++) {
  17876. temp = ballArr[index];
  17877. if (temp.number == rootBall.number)
  17878. continue;
  17879. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  17880. if (isIntersect) {
  17881. break;
  17882. }
  17883. }
  17884. return isIntersect;
  17885. }
  17886. hideBallUI() {
  17887. let d2Gan = xGame.common.d2World.d2Gan;
  17888. if (!d2Gan.ui.isDisposed)
  17889. d2Gan.ui.visible = false;
  17890. let d2Help = xGame.common.d2World.d2HelpLine;
  17891. if (!d2Help.ui.isDisposed)
  17892. d2Help.ui.visible = false;
  17893. let rootBall = xGame.common.d2World.rootBall;
  17894. if (!rootBall.destroyed) {
  17895. rootBall.gameObj.active = false;
  17896. }
  17897. }
  17898. showBallUI() {
  17899. let d2Gan = xGame.common.d2World.d2Gan;
  17900. if (!d2Gan.ui.isDisposed)
  17901. d2Gan.ui.visible = true;
  17902. let d2Help = xGame.common.d2World.d2HelpLine;
  17903. if (!d2Help.ui.isDisposed)
  17904. d2Help.ui.visible = true;
  17905. let rootBall = xGame.common.d2World.rootBall;
  17906. if (!rootBall.destroyed) {
  17907. rootBall.gameObj.active = true;
  17908. }
  17909. }
  17910. moveToClickDot(e) {
  17911. if (!this.isMoveRod && !xGame.common.clickedBall) {
  17912. let root = xGame.common.d2World.rootBall.gameObj;
  17913. let xx = e.stageX - xGame.common.sysOffestNum;
  17914. let yy = e.stageY;
  17915. let x = xx - root.x;
  17916. let y = yy - root.y;
  17917. let angle = xGame.common.getfguiRotation(x, y);
  17918. xGame.common.d2World.d2Gan.ui.rotation = angle;
  17919. xGame.common.d2World.getHelpLine();
  17920. }
  17921. this.isMoveRod = false;
  17922. xGame.common.clickedBall = false;
  17923. }
  17924. openAllEvent() {
  17925. this.closeAllEvent();
  17926. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17927. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17928. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17929. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17930. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17931. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17932. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17933. }
  17934. closeAllEvent() {
  17935. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17936. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17937. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17938. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  17939. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  17940. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  17941. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  17942. }
  17943. resetGame() {
  17944. this.closeAllEvent();
  17945. this.hideBallUI();
  17946. xGame.common.gameMgr.gamePause = true;
  17947. }
  17948. }
  17949. UIGame$1.uiName = "UIGame";
  17950. class UIAddCoin$1 extends UIBase {
  17951. constructor() {
  17952. super();
  17953. this.coinNum = 2000;
  17954. }
  17955. onConstructor() {
  17956. this.ui = ui_UIAddCoin.createInstance();
  17957. this.contentPane = this.ui;
  17958. this.isEject = false;
  17959. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  17960. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  17961. }
  17962. show() {
  17963. super.show();
  17964. this.ui.t0.play();
  17965. }
  17966. videoAddCoin() {
  17967. Moyu.showVideoAd(() => {
  17968. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  17969. this.hide();
  17970. }, EAdType.addFailCoin);
  17971. }
  17972. }
  17973. UIAddCoin$1.uiName = "UIAddCoin";
  17974. class UIInvitation$1 extends UIBase {
  17975. constructor() {
  17976. super();
  17977. }
  17978. onConstructor() {
  17979. this.ui = ui_UIInvitation.createInstance();
  17980. this.contentPane = this.ui;
  17981. this.isEject = false;
  17982. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  17983. }
  17984. show() {
  17985. super.show();
  17986. }
  17987. enterGame() {
  17988. xGame.common.gameMode = GameMode.classic;
  17989. DataMgr.setChallengeTimes(1);
  17990. xGame.common.passAwardCoin = 2000;
  17991. let need = xGame.common.classicNiceNeddCoin;
  17992. if (DataMgr.coinEnough(need)) {
  17993. DataMgr.setCoin(-need);
  17994. xGame.eventMgr.event(RESTART_GAME, true);
  17995. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  17996. }
  17997. else {
  17998. xGame.eventMgr.event(RESTART_GAME, true);
  17999. }
  18000. this.hide();
  18001. }
  18002. hide() {
  18003. super.hide();
  18004. }
  18005. }
  18006. UIInvitation$1.uiName = "UIInvitation";
  18007. class UIPower$1 extends UIBase {
  18008. constructor() {
  18009. super();
  18010. }
  18011. onConstructor() {
  18012. this.ui = ui_UIPower.createInstance();
  18013. this.contentPane = this.ui;
  18014. this.isEject = false;
  18015. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18016. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18017. }
  18018. show() {
  18019. super.show();
  18020. this.ui.t0.play();
  18021. }
  18022. videoGetPower() {
  18023. Moyu.showVideoAd(() => {
  18024. DataMgr.setPower(xGame.common.videoPower, true);
  18025. xGame.eventMgr.event(POWER_TIME);
  18026. this.hide();
  18027. }, EAdType.getPower);
  18028. }
  18029. }
  18030. UIPower$1.uiName = "UIPower";
  18031. class UIGameEnd$1 extends UIBase {
  18032. constructor() {
  18033. super();
  18034. this.success = false;
  18035. this.awardCoinNum = 1000;
  18036. this.awardDiamondNum = 10;
  18037. }
  18038. onConstructor() {
  18039. this.ui = ui_UIGameEnd.createInstance();
  18040. this.contentPane = this.ui;
  18041. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18042. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18043. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18044. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18045. this.ui.talkNode.visible = false;
  18046. if (Moyu.isKs)
  18047. this.ui.closeNode.closeBtn.x += 100;
  18048. }
  18049. updateType() {
  18050. switch (xGame.common.gameMode) {
  18051. case GameMode.classic:
  18052. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18053. this.ui.coinNode.visible = this.success;
  18054. if (!this.success) {
  18055. Laya.timer.once(500, this, () => {
  18056. xGame.uiMgr.Show(UIAddCoin$1);
  18057. });
  18058. }
  18059. this.ui.isGetAward.visible = false;
  18060. this.ui.leftBtn.c1.selectedIndex = 3;
  18061. this.ui.rightBtn.c1.selectedIndex = 0;
  18062. this.moneyNode.ui.c1.selectedIndex = 1;
  18063. break;
  18064. case GameMode.bigMove:
  18065. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18066. this.ui.coinNode.visible = this.success;
  18067. if (xGame.common.gameMode == GameMode.bigMove) {
  18068. if (this.success) {
  18069. DataMgr.setSkillSuccessTimes(1, true);
  18070. DataMgr.setSkillAccTimes(1);
  18071. }
  18072. else {
  18073. DataMgr.setSkillSuccessTimes(0, false);
  18074. }
  18075. }
  18076. if (!this.success) {
  18077. Laya.timer.once(500, this, () => {
  18078. xGame.uiMgr.Show(UIAddCoin$1);
  18079. });
  18080. }
  18081. this.ui.isGetAward.visible = false;
  18082. this.ui.leftBtn.c1.selectedIndex = 3;
  18083. this.ui.rightBtn.c1.selectedIndex = 0;
  18084. this.moneyNode.ui.c1.selectedIndex = 1;
  18085. break;
  18086. case GameMode.placeBall:
  18087. this.ui.coinNode.visible = false;
  18088. if (this.success) {
  18089. if (xGame.common.placeBallStarNum == 3) {
  18090. this.ui.c1.selectedIndex = 2;
  18091. }
  18092. else {
  18093. this.ui.c1.selectedIndex = 3;
  18094. }
  18095. }
  18096. else {
  18097. this.ui.c1.selectedIndex = 4;
  18098. }
  18099. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18100. if (cfg.type == PlaceBallType.challenge) {
  18101. this.ui.c1.selectedIndex = 2;
  18102. }
  18103. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18104. this.updatePlaceBallBtn();
  18105. this.updatePlaceBallStarNum();
  18106. this.updatePlaceBallAwardState();
  18107. this.moneyNode.ui.c1.selectedIndex = 2;
  18108. this.moneyNode.checkPowerTime();
  18109. this.moneyNode.powerChange();
  18110. DataMgr.upRankData();
  18111. break;
  18112. default:
  18113. break;
  18114. }
  18115. }
  18116. updatePlaceBallBtn() {
  18117. this.ui.leftBtn.c1.selectedIndex = 5;
  18118. if (this.success) {
  18119. this.ui.rightBtn.c1.selectedIndex = 14;
  18120. }
  18121. else {
  18122. if (xGame.common.placeBallStarNum == 3) {
  18123. this.ui.rightBtn.c1.selectedIndex = 14;
  18124. }
  18125. else {
  18126. this.ui.rightBtn.c1.selectedIndex = 1;
  18127. }
  18128. }
  18129. }
  18130. updatePlaceBallStarNum() {
  18131. let starNum = xGame.common.placeBallStarNum;
  18132. if (starNum == 0)
  18133. this.ui.starNumNode.c1.selectedIndex = 3;
  18134. else {
  18135. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18136. }
  18137. }
  18138. updatePlaceBallAwardState() {
  18139. let level = xGame.common.placeBallCurLevel;
  18140. let starNum = xGame.common.placeBallStarNum;
  18141. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18142. let data = cfgTable.placeballData[level].award;
  18143. let cfg = cfgTable.placeballData[level];
  18144. this.awardDiamondNum = data[1];
  18145. this.awardCoinNum = data[0];
  18146. if (cfg.type == PlaceBallType.challenge) {
  18147. this.awardDiamondNum = 0;
  18148. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18149. }
  18150. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18151. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18152. if (cfg.type == PlaceBallType.challenge) {
  18153. this.ui.awardNode.coinNode.visible = true;
  18154. }
  18155. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18156. this.ui.awardNode.diamondNode.x = 265;
  18157. this.ui.awardNode.coinNode.x = 354;
  18158. }
  18159. else {
  18160. this.ui.awardNode.diamondNode.x = 291;
  18161. this.ui.awardNode.coinNode.x = 291;
  18162. }
  18163. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18164. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18165. if (this.awardCoinNum == 0) {
  18166. this.ui.awardNode.coinNode.numTxt.text = "";
  18167. }
  18168. if (getAward) {
  18169. this.ui.isGetAward.visible = true;
  18170. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18171. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18172. }
  18173. else {
  18174. this.ui.isGetAward.visible = false;
  18175. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18176. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18177. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18178. }
  18179. else {
  18180. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18181. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18182. }
  18183. }
  18184. }
  18185. show(success) {
  18186. super.show();
  18187. xGame.eventMgr.event(RESET_GAME);
  18188. this.success = success;
  18189. Laya.timer.clearAll(this);
  18190. this.playSecretaryAni();
  18191. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18192. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18193. offsetTime = Math.floor(offsetTime / 1000);
  18194. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18195. this.updateType();
  18196. Laya.timer.once(200, this, () => {
  18197. this.addAward(() => {
  18198. this.updateType();
  18199. Laya.timer.once(500, this, () => {
  18200. this.showChallengeLevel();
  18201. });
  18202. });
  18203. });
  18204. if (this.success) {
  18205. xGame.soundMgr.playSound('slots_roll01');
  18206. xGame.soundMgr.playSound("s_win");
  18207. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18208. }
  18209. else {
  18210. xGame.soundMgr.playSound('matchwin01');
  18211. xGame.soundMgr.playSound("s_lose");
  18212. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18213. }
  18214. if (!Moyu.isLegal)
  18215. PlatMgr.showBanner(true);
  18216. let challengeNum = DataMgr.getChallengeTimes();
  18217. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18218. DataMgr.setChallengeTimes(1);
  18219. }
  18220. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18221. DataMgr.setClassicTimes();
  18222. }
  18223. }
  18224. showChallengeLevel() {
  18225. if (DataMgr.getChallengeTimes() != 0)
  18226. return;
  18227. let skill = DataMgr.getSkillAccTimes();
  18228. let put = DataMgr.getPlaceBallLevelList().length;
  18229. if (skill >= 3 || put >= 5) {
  18230. xGame.uiMgr.Show(UIInvitation$1);
  18231. this.hide();
  18232. }
  18233. }
  18234. addAward(callback) {
  18235. if (!this.success) {
  18236. callback && callback();
  18237. return;
  18238. }
  18239. switch (xGame.common.gameMode) {
  18240. case GameMode.classic:
  18241. this.awardCoinNum = xGame.common.passAwardCoin;
  18242. this.awardDiamondNum = 0;
  18243. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18244. break;
  18245. case GameMode.bigMove:
  18246. this.awardCoinNum = xGame.common.passAwardCoin;
  18247. this.awardDiamondNum = 0;
  18248. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18249. callback && callback();
  18250. break;
  18251. case GameMode.placeBall:
  18252. let level = xGame.common.placeBallCurLevel;
  18253. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18254. if (xGame.common.placeBallStarNum != 3) {
  18255. callback && callback();
  18256. return;
  18257. }
  18258. else {
  18259. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18260. if (getAward) {
  18261. callback && callback();
  18262. return;
  18263. }
  18264. }
  18265. let cfg = cfgTable.placeballData[level];
  18266. let data = cfgTable.placeballData[level].award;
  18267. this.awardCoinNum = data[0];
  18268. this.awardDiamondNum = data[1];
  18269. if (cfg.type == PlaceBallType.challenge) {
  18270. this.awardDiamondNum = 0;
  18271. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18272. }
  18273. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18274. let diamondAward;
  18275. if (this.awardDiamondNum > 0) {
  18276. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18277. xGame.common.getAward([diamondAward, coinAward], callback);
  18278. }
  18279. else {
  18280. xGame.common.getAward([coinAward], callback);
  18281. }
  18282. if (cfg.type == PlaceBallType.normal) {
  18283. DataMgr.setPlaceBallAward(level);
  18284. }
  18285. break;
  18286. default:
  18287. break;
  18288. }
  18289. }
  18290. playSecretaryAni_old() {
  18291. let parent = this.ui.secretary.displayObject;
  18292. parent.destroyChildren();
  18293. let xx = this.ui.secretary.width / 2;
  18294. let yy = this.ui.secretary.height;
  18295. let scale = xGame.common.getSecretaryScale();
  18296. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18297. if (this.success) {
  18298. let rand = Math.random() <= 0.5 ? 2 : 3;
  18299. xGame.common.secretary.play(data, rand, false, parent, () => {
  18300. xGame.common.secretary.play(data, 1, true, parent);
  18301. });
  18302. }
  18303. else {
  18304. xGame.common.secretary.play(data, 0, true, parent);
  18305. }
  18306. }
  18307. playSecretaryAni() {
  18308. let parent = this.ui.secretary.displayObject;
  18309. parent.destroyChildren();
  18310. let xx = this.ui.secretary.width / 2;
  18311. let yy = this.ui.secretary.height;
  18312. let scale = xGame.common.getSecretaryScale();
  18313. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18314. if (this.success) {
  18315. let rand = 0;
  18316. xGame.common.secretary.play(data, 0, true, parent);
  18317. }
  18318. else {
  18319. xGame.common.secretary.play(data, 0, true, parent);
  18320. }
  18321. }
  18322. restartGame() {
  18323. switch (xGame.common.gameMode) {
  18324. case GameMode.classic:
  18325. xGame.eventMgr.event(RESTART_GAME);
  18326. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18327. break;
  18328. case GameMode.bigMove:
  18329. this.hide();
  18330. xGame.eventMgr.event(RESTART_GAME);
  18331. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18332. break;
  18333. default:
  18334. break;
  18335. }
  18336. }
  18337. hide() {
  18338. super.hide();
  18339. xGame.common.stopGirlPop(this.ui.talkNode);
  18340. PlatMgr.showBanner(false);
  18341. }
  18342. returnHome() {
  18343. this.hide();
  18344. let showFailWords = !this.success;
  18345. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18346. }
  18347. clickLeftBtn() {
  18348. switch (xGame.common.gameMode) {
  18349. case GameMode.classic:
  18350. case GameMode.bigMove:
  18351. this.returnHome();
  18352. break;
  18353. case GameMode.placeBall:
  18354. let level = xGame.common.placeBallCurLevel;
  18355. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18356. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18357. break;
  18358. default:
  18359. break;
  18360. }
  18361. }
  18362. powerStartPlaceBallLevel(level, btn) {
  18363. if (DataMgr.powerEnough()) {
  18364. btn.touchable = false;
  18365. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18366. btn.touchable = true;
  18367. DataMgr.setPower(-1);
  18368. xGame.eventMgr.event(POWER_TIME);
  18369. this.startPlaceBallLevel(level);
  18370. }));
  18371. }
  18372. else {
  18373. xGame.uiMgr.Show(UIPower$1, 0);
  18374. }
  18375. }
  18376. clickRightBtn() {
  18377. switch (xGame.common.gameMode) {
  18378. case GameMode.classic:
  18379. console.log('zh:clickRightBtn 111');
  18380. case GameMode.bigMove:
  18381. console.log('zh:clickRightBtn 222');
  18382. this.restartGame();
  18383. break;
  18384. case GameMode.placeBall:
  18385. console.log('zh:clickRightBtn 333');
  18386. let level = xGame.common.placeBallCurLevel;
  18387. let data = DataMgr.getPlaceBallLevel(level);
  18388. let curPss = data.play && !data.isCur;
  18389. if (curPss) {
  18390. console.log('zh:clickRightBtn 333-111');
  18391. console.log('zh:当前LV=' + level);
  18392. if (level == 60) {
  18393. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18394. Laya.timer.once(3000, this, () => {
  18395. this.returnHome();
  18396. });
  18397. }
  18398. else {
  18399. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18400. }
  18401. }
  18402. else {
  18403. console.log('zh:clickRightBtn 333-000');
  18404. Moyu.sendDataEvent("placeBallNextLevel");
  18405. Moyu.showVideoAd(() => {
  18406. DataMgr.setPlaceBallLevel(level, 1);
  18407. this.startPlaceBallLevel(level + 1);
  18408. }, xGame.define.EAdType.placeBallNextLevel);
  18409. }
  18410. break;
  18411. default:
  18412. console.log('zh:clickRightBtn 444');
  18413. break;
  18414. }
  18415. }
  18416. startPlaceBallLevel(level) {
  18417. xGame.common.gameMode = GameMode.placeBall;
  18418. xGame.common.placeBallCurLevel = level;
  18419. xGame.uiMgr.Show(UIGame$1);
  18420. this.hide();
  18421. }
  18422. }
  18423. UIGameEnd$1.uiName = "UIGameEnd";
  18424. class ShowItem$1 {
  18425. constructor() {
  18426. this.ui = ui_ShowItem.createInstance();
  18427. }
  18428. destroySelf() {
  18429. if (!this.ui.isDisposed) {
  18430. this.ui.removeFromParent();
  18431. this.ui.dispose();
  18432. }
  18433. }
  18434. setParent(parent) {
  18435. parent.addChild(this.ui);
  18436. }
  18437. setPos(x, y) {
  18438. this.ui.x = x;
  18439. this.ui.y = y;
  18440. }
  18441. setUrl(index) {
  18442. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18443. }
  18444. }
  18445. class UILevelProp$1 extends UIBase {
  18446. constructor() {
  18447. super();
  18448. this.firstPos = 385;
  18449. this.secondPos = 467;
  18450. this.showItemArr = [];
  18451. }
  18452. onConstructor() {
  18453. this.ui = ui_UILevelProp.createInstance();
  18454. this.contentPane = this.ui;
  18455. this.isEject = false;
  18456. this.addUIClick(this.ui.closeBtn, this.hide);
  18457. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18458. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18459. }
  18460. show(level) {
  18461. super.show();
  18462. this.ui.t1.play();
  18463. this.level = level;
  18464. this.data = cfgTable.placeballData[this.level];
  18465. this.updateSelf();
  18466. this.showPreView();
  18467. this.moneyNode.ui.c1.selectedIndex = 2;
  18468. this.moneyNode.checkPowerTime();
  18469. this.moneyNode.powerChange();
  18470. }
  18471. showPreView() {
  18472. let item;
  18473. let data;
  18474. for (let index = 0; index < this.showItemArr.length; index++) {
  18475. item = this.showItemArr[index];
  18476. item.destroySelf();
  18477. }
  18478. this.showItemArr = [];
  18479. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18480. for (const key in cfgData) {
  18481. data = cfgData[key];
  18482. item = new ShowItem$1();
  18483. item.setParent(this.ui.myNode.displayRoot);
  18484. item.setPos(data.x, data.y);
  18485. item.setUrl(data.value);
  18486. this.showItemArr.push(item);
  18487. }
  18488. }
  18489. updateSelf() {
  18490. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18491. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18492. if (this.data.ball == -1) {
  18493. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18494. }
  18495. else {
  18496. this.ui.myNode.conditionTxt.text = "Reward";
  18497. }
  18498. let localData = DataMgr.getPlaceBallLevel(this.level);
  18499. let getAward = localData.getAward;
  18500. let cfg = cfgTable.placeballData[this.level];
  18501. let coin = this.data.award[0];
  18502. let diamond = this.data.award[1];
  18503. if (cfg.type == PlaceBallType.challenge) {
  18504. diamond = 0;
  18505. coin = 100;
  18506. }
  18507. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18508. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18509. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18510. if (cfg.type == PlaceBallType.challenge) {
  18511. this.ui.myNode.coinNode.numTxt.text = "";
  18512. }
  18513. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18514. if (coin > 0 && diamond > 0) {
  18515. this.ui.myNode.diamondNode.x = 385;
  18516. this.ui.myNode.coinNode.x = 467;
  18517. }
  18518. else {
  18519. this.ui.myNode.diamondNode.x = 385;
  18520. this.ui.myNode.coinNode.x = 385;
  18521. }
  18522. if (!getAward) {
  18523. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18524. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18525. }
  18526. else {
  18527. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18528. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18529. }
  18530. }
  18531. startGame() {
  18532. if (DataMgr.powerEnough()) {
  18533. this.ui.myNode.startBtn.touchable = false;
  18534. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18535. console.log('zh:startGame ');
  18536. this.ui.myNode.startBtn.touchable = true;
  18537. DataMgr.setPower(-1);
  18538. xGame.eventMgr.event(POWER_TIME);
  18539. xGame.common.gameMode = GameMode.placeBall;
  18540. xGame.common.placeBallCurLevel = this.level;
  18541. xGame.uiMgr.Show(UIGame$1);
  18542. xGame.uiMgr.Hide(UILevelDisplay$1);
  18543. xGame.uiMgr.Hide(UIMain$1);
  18544. this.hide();
  18545. }));
  18546. }
  18547. else {
  18548. console.log('zh:startGame no power');
  18549. xGame.uiMgr.Show(UIPower$1);
  18550. }
  18551. }
  18552. hide() {
  18553. super.hide();
  18554. }
  18555. }
  18556. UILevelProp$1.uiName = "UILevelProp";
  18557. class PutBallLevelDisplay$1 {
  18558. constructor(ui, index) {
  18559. this.index = 0;
  18560. this.ui = ui;
  18561. this.index = index;
  18562. this.ui.onClick(this, this.clickSelf);
  18563. this.updateSelf();
  18564. this.ui.levelTxt.text = (this.index + 1) + "";
  18565. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18566. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18567. }
  18568. updateSelf() {
  18569. let level = this.index + 1;
  18570. this.data = DataMgr.getPlaceBallLevel(level);
  18571. this.ui.starNode.c1.selectedIndex = this.data.star;
  18572. let isChallenge = cfgTable.placeballData[level].type;
  18573. if (this.data.isCur) {
  18574. if (isChallenge) {
  18575. this.ui.c1.selectedIndex = 5;
  18576. }
  18577. else {
  18578. this.ui.c1.selectedIndex = 2;
  18579. }
  18580. }
  18581. else {
  18582. if (this.data.play) {
  18583. if (this.data.star == 3) {
  18584. this.ui.c1.selectedIndex = 0;
  18585. }
  18586. else {
  18587. this.ui.c1.selectedIndex = 1;
  18588. }
  18589. }
  18590. else {
  18591. if (isChallenge) {
  18592. this.ui.c1.selectedIndex = 4;
  18593. }
  18594. else {
  18595. this.ui.c1.selectedIndex = 3;
  18596. }
  18597. }
  18598. }
  18599. }
  18600. clickSelf() {
  18601. if (!this.data.play)
  18602. return;
  18603. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18604. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18605. }
  18606. }
  18607. class UILevelDisplay$1 extends UIBase {
  18608. constructor() {
  18609. super();
  18610. }
  18611. onConstructor() {
  18612. this.ui = ui_UILevelDisplay.createInstance();
  18613. this.contentPane = this.ui;
  18614. this.isEject = false;
  18615. this.myList = this.ui.myNode.myList;
  18616. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18617. this.levelItemArr = [];
  18618. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18619. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18620. this.myList.numItems = levelNum;
  18621. if (Moyu.isKs)
  18622. this.ui.closeNode.closeBtn.x += 100;
  18623. }
  18624. levelItemRender(index, target) {
  18625. let item = new PutBallLevelDisplay$1(target, index);
  18626. this.levelItemArr.push(item);
  18627. }
  18628. show() {
  18629. super.show();
  18630. this.updateLevel();
  18631. this.scrollToPlace();
  18632. }
  18633. updateLevel() {
  18634. let temp;
  18635. for (let index = 0; index < this.levelItemArr.length; index++) {
  18636. temp = this.levelItemArr[index];
  18637. temp.updateSelf();
  18638. }
  18639. }
  18640. scrollToPlace() {
  18641. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18642. let passArr = DataMgr.getPlaceBallLevelList();
  18643. let offest = passArr.length;
  18644. if (offest >= maxNum - 1)
  18645. offest = maxNum - 1;
  18646. this.myList.scrollToView(offest, true, true);
  18647. }
  18648. hide() {
  18649. super.hide();
  18650. }
  18651. }
  18652. UILevelDisplay$1.uiName = "UILevelDisplay";
  18653. class UIMatching$1 extends UIBase {
  18654. constructor() {
  18655. super();
  18656. }
  18657. onConstructor() {
  18658. this.ui = ui_UIMatching.createInstance();
  18659. this.contentPane = this.ui;
  18660. this.isEject = false;
  18661. }
  18662. show(callback) {
  18663. super.show();
  18664. PlatMgr.showBanner(true);
  18665. this.callback = callback;
  18666. let user = Moyu.getUserInfo();
  18667. if (!this.selfPot) {
  18668. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18669. }
  18670. if (!this.aiPot) {
  18671. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18672. }
  18673. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18674. this.ui.selfHead.nameTxt.text = user.nickName;
  18675. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18676. this.ui.aiHead.nameTxt.text = "???";
  18677. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18678. this.ui.selfHead.c1.selectedIndex = 0;
  18679. this.ui.aiHead.c1.selectedIndex = 0;
  18680. this.ui.selfHead.x = this.selfPot.x;
  18681. this.ui.selfHead.y = this.selfPot.y;
  18682. this.ui.aiHead.x = this.aiPot.x;
  18683. this.ui.aiHead.y = this.aiPot.y;
  18684. switch (xGame.common.gameMode) {
  18685. case GameMode.classic:
  18686. break;
  18687. case GameMode.bigMove:
  18688. this.initSkillData();
  18689. break;
  18690. default:
  18691. break;
  18692. }
  18693. this.ui.t1.play(Laya.Handler.create(this, () => {
  18694. this.ui.t2.play(Laya.Handler.create(this, () => {
  18695. switch (xGame.common.gameMode) {
  18696. case GameMode.classic:
  18697. this.waitingPeople();
  18698. break;
  18699. case GameMode.bigMove:
  18700. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18701. break;
  18702. default:
  18703. break;
  18704. }
  18705. }));
  18706. }));
  18707. }
  18708. initSkillData() {
  18709. this.skillSelectData = [];
  18710. let skillUrl = xGame.common.skillIconList;
  18711. let skillName = xGame.common.skillNameList;
  18712. let skillLevel = DataMgr.getBigSkillList();
  18713. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18714. for (let index = 0; index < 5; index++) {
  18715. let obj = {};
  18716. obj.skillImg = skillUrl[index];
  18717. obj.skillName = skillName[index];
  18718. obj.skillType = skillType[index];
  18719. obj.skillLevel = skillLevel[index];
  18720. this.skillSelectData.push(obj);
  18721. }
  18722. }
  18723. getAISkillLevel(myLevel) {
  18724. let video = xGame.common.upSkillLevel;
  18725. let aiLevel;
  18726. let temp;
  18727. if (video) {
  18728. temp = xGame.common.randomNum(-2, -1);
  18729. }
  18730. else {
  18731. if (myLevel <= 5) {
  18732. temp = xGame.common.randomNum(1, 3);
  18733. }
  18734. else if (myLevel <= 9) {
  18735. temp = xGame.common.randomNum(-2, 1);
  18736. }
  18737. else {
  18738. temp = xGame.common.randomNum(-4, 0);
  18739. }
  18740. }
  18741. aiLevel = temp + myLevel;
  18742. if (aiLevel <= 1)
  18743. aiLevel = 1;
  18744. if (aiLevel >= 10)
  18745. aiLevel = 10;
  18746. return aiLevel;
  18747. }
  18748. getAISkillType() {
  18749. return xGame.common.randomNum(1, 4);
  18750. let successTimes = DataMgr.getSkillSuccessTimes();
  18751. let info = cfgTable.aiskillData[successTimes];
  18752. if (!info) {
  18753. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18754. info = cfgTable.aiskillData[max];
  18755. }
  18756. let dataArr = info.skillselect;
  18757. let myCfg = {};
  18758. for (let index = 0; index < dataArr.length; index++) {
  18759. let temp = dataArr[index].split('-');
  18760. myCfg[temp[0]] = {};
  18761. myCfg[temp[0]].id = parseInt(temp[0]);
  18762. myCfg[temp[0]].weight = parseInt(temp[1]);
  18763. }
  18764. let aiCfg = xGame.common.initWeight(myCfg);
  18765. let curData = xGame.common.getRandomWeightData(aiCfg);
  18766. return parseInt(curData.id);
  18767. }
  18768. getAISkillData(index) {
  18769. let myLevel = this.skillSelectData[index].skillLevel;
  18770. let aiLevel = this.getAISkillLevel(myLevel);
  18771. let aiType = this.getAISkillType() - 1;
  18772. return { aiLevel, aiType } = { aiLevel, aiType };
  18773. }
  18774. skillSelectFinish(index) {
  18775. let aiInfo = this.getAISkillData(index);
  18776. xGame.common.gameMgr.selfCurSkill = index;
  18777. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18778. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18779. this.ui.selfHead.c1.selectedIndex = 1;
  18780. this.ui.aiHead.c1.selectedIndex = 1;
  18781. let myData = this.skillSelectData[index];
  18782. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18783. let guide = DataMgr.getSkillGuide();
  18784. if (guide == 0) {
  18785. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18786. }
  18787. else {
  18788. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18789. }
  18790. let aiData = this.skillSelectData[aiInfo.aiType];
  18791. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18792. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18793. this.waitingPeople();
  18794. }
  18795. waitingPeople() {
  18796. let time = xGame.common.randomNum(1000, 3000);
  18797. time += 1000;
  18798. Laya.timer.once(time, this, () => {
  18799. this.matchingSuccess();
  18800. });
  18801. }
  18802. matchingSuccess() {
  18803. let gameUI = xGame.common.gameUI;
  18804. let name = gameUI.ui.topNode.aiNameTxt.text;
  18805. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18806. this.ui.aiHead.nameTxt.text = name;
  18807. this.ui.aiHead.headImg.url = url;
  18808. name = gameUI.ui.topNode.selfNameTxt.text;
  18809. url = gameUI.ui.topNode.selfHeadLoader.url;
  18810. this.ui.selfHead.nameTxt.text = name;
  18811. this.ui.selfHead.headImg.url = url;
  18812. this.ui.t3.play(Laya.Handler.create(this, () => {
  18813. this.callback && this.callback();
  18814. this.ui.t4.play(Laya.Handler.create(this, () => {
  18815. this.destroySelf();
  18816. }));
  18817. }));
  18818. }
  18819. destroySelf() {
  18820. this.callback = null;
  18821. this.skillSelectData = null;
  18822. this.selfPot = null;
  18823. this.aiPot = null;
  18824. if (!this.ui.isDisposed) {
  18825. this.ui.removeFromParent();
  18826. this.ui.dispose();
  18827. }
  18828. xGame.uiMgr.destroyUI(this);
  18829. }
  18830. }
  18831. UIMatching$1.uiName = "UIMatching";
  18832. class SkillDisplay$1 {
  18833. constructor(ui, data, uiIndex) {
  18834. this.starX = 0;
  18835. this.starY = 0;
  18836. this.index = 0;
  18837. this.ui = ui;
  18838. this.data = data;
  18839. this.index = uiIndex;
  18840. this.initSelf();
  18841. console.log('zh:SkillDisplay constructor this.skillData=', data);
  18842. }
  18843. initSelf() {
  18844. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  18845. this.ui.nameTxt.text = this.data.name;
  18846. this.ui.describeTxt.text = this.data.describe;
  18847. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  18848. this.ui.startBtn.onClick(this, this.startGame);
  18849. this.updateSelf();
  18850. }
  18851. updateSelf() {
  18852. this.checkTry();
  18853. let level = DataMgr.getBigSkillByIndex(this.index);
  18854. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  18855. }
  18856. checkTry() {
  18857. let index = this.index;
  18858. let level = DataMgr.getBigSkillByIndex(index);
  18859. if (level == null) {
  18860. DataMgr.setBigSkill(index, 1, false);
  18861. level = 1;
  18862. }
  18863. this.ui.levelTxt.text = "LV." + level;
  18864. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  18865. this.ui.tryNode.visible = true;
  18866. else
  18867. this.ui.tryNode.visible = false;
  18868. }
  18869. clickAddLevel() {
  18870. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18871. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  18872. Moyu.showVideoAd(() => {
  18873. DataMgr.setBigSkill(this.data.index, 1);
  18874. this.updateSelf();
  18875. xGame.common.upSkillLevel = true;
  18876. }, EAdType.upSkill);
  18877. }
  18878. startGame() {
  18879. if (this.data.index == 3) {
  18880. alert('Coming soon!');
  18881. return;
  18882. }
  18883. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18884. let needCoin = xGame.common.bigMoveNeedCoin;
  18885. xGame.common.passAwardCoin = 2000;
  18886. let guide = DataMgr.getSkillGuide();
  18887. console.log('zh:startGame guide=' + guide);
  18888. xGame.common.temSelfLevel = 0;
  18889. if (guide == 0) {
  18890. needCoin = 0;
  18891. xGame.common.temSelfLevel = 100;
  18892. }
  18893. if (DataMgr.coinEnough(needCoin)) {
  18894. DataMgr.setCoin(-needCoin);
  18895. xGame.common.curPlayerSkillType = this.index;
  18896. if (guide == 0)
  18897. xGame.common.curPlayerSkillType = 0;
  18898. xGame.uiMgr.Show(UIGame$1);
  18899. xGame.uiMgr.Hide(UIMain$1);
  18900. xGame.uiMgr.Show(UIMatching$1, () => {
  18901. xGame.common.gameUI.ui.alpha = 1;
  18902. xGame.common.gameUI.startGame();
  18903. xGame.uiMgr.Hide(UISkill$1);
  18904. });
  18905. }
  18906. else {
  18907. xGame.uiMgr.Show(UIAddProp$1, 0);
  18908. Moyu.sendDataEvent("AddCoinVideo");
  18909. }
  18910. }
  18911. }
  18912. class UISkill$1 extends UIBase {
  18913. constructor() {
  18914. super();
  18915. this.skillData = [];
  18916. }
  18917. onConstructor() {
  18918. this.ui = ui_UISkill.createInstance();
  18919. this.contentPane = this.ui;
  18920. this.isEject = false;
  18921. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18922. this.initSkillData();
  18923. console.log('zh:aaaaaa1111111111');
  18924. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  18925. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  18926. console.log('zh:aaaaaa22222222');
  18927. this.displayList = [];
  18928. this.ui.skillNode.skillList.numItems = 3;
  18929. this.addUIClick(this.ui, this.interuptSecretary);
  18930. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  18931. this.ui.talkNode.visible = false;
  18932. if (Moyu.isKs)
  18933. this.ui.closeNode.closeBtn.x += 100;
  18934. }
  18935. show() {
  18936. super.show();
  18937. this.playSecretaryIdle();
  18938. this.moneyNode.ui.c1.selectedIndex = 1;
  18939. Laya.timer.clearAll(this);
  18940. xGame.soundMgr.playSound("s_start");
  18941. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18942. let guide = DataMgr.getSkillGuide();
  18943. this.ui.guideNode.visible = guide == 0;
  18944. let item = this.getSkillItemByUIIndex(0);
  18945. if (guide == 0) {
  18946. item.ui.c1.selectedIndex = 1;
  18947. }
  18948. else {
  18949. item.ui.c1.selectedIndex = 0;
  18950. }
  18951. this.ui.guideNode.guideBtn.visible = guide == 0;
  18952. for (let index = 0; index < this.displayList.length; index++) {
  18953. this.displayList[index].checkTry();
  18954. }
  18955. }
  18956. getSkillItemByUIIndex(cur) {
  18957. for (let index = 0; index < this.displayList.length; index++) {
  18958. if (this.displayList[index].index == cur) {
  18959. return this.displayList[index];
  18960. }
  18961. }
  18962. }
  18963. enterGuideLevel() {
  18964. let item = this.getSkillItemByUIIndex(0);
  18965. item.startGame();
  18966. if (DataMgr.getNewUser())
  18967. Moyu.sendDataEvent("gameStart1");
  18968. }
  18969. initSkillData() {
  18970. this.skillData = [];
  18971. let nameList = xGame.common.skillNameList;
  18972. let iconList = xGame.common.skillIconList;
  18973. let describeList = [
  18974. "Jump shot executed — ball bounced and pocketed an extra one!",
  18975. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  18976. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  18977. ];
  18978. console.log('zh:initSkillData 111111111');
  18979. let data;
  18980. for (let index = 0; index < nameList.length; index++) {
  18981. data = {};
  18982. data.name = nameList[index];
  18983. data.icon = iconList[index];
  18984. data.describe = describeList[index];
  18985. data.index = index;
  18986. this.skillData.push(data);
  18987. }
  18988. }
  18989. updateSkillItem(index, target) {
  18990. if (this.displayList[index] == null) {
  18991. let uiIndex;
  18992. switch (index) {
  18993. case 0:
  18994. uiIndex = 1;
  18995. break;
  18996. case 1:
  18997. uiIndex = 0;
  18998. break;
  18999. case 2:
  19000. uiIndex = 2;
  19001. break;
  19002. case 3:
  19003. uiIndex = 3;
  19004. break;
  19005. default:
  19006. break;
  19007. }
  19008. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19009. this.displayList.push(temp);
  19010. }
  19011. }
  19012. playSecretaryIdle() {
  19013. let parent = this.ui.secretary.displayObject;
  19014. parent.destroyChildren();
  19015. let xx = this.ui.secretary.width / 2;
  19016. let yy = this.ui.secretary.height;
  19017. let scale = xGame.common.getSecretaryScale();
  19018. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19019. xGame.common.secretary.play(data, 0, true, parent);
  19020. }
  19021. returnUIMain() {
  19022. this.hide();
  19023. xGame.common.stopGirlPop(this.ui.talkNode);
  19024. xGame.uiMgr.Show(UIMain$1);
  19025. }
  19026. interuptSecretary() {
  19027. Laya.timer.clearAll(this);
  19028. this.playSecretaryRandomSound();
  19029. }
  19030. playSecretaryRandomSound() {
  19031. if (this.isHide)
  19032. return;
  19033. let time = xGame.common.randomNum(45000, 60000);
  19034. Laya.timer.once(time, this, () => {
  19035. if (this.isHide)
  19036. return;
  19037. let index = xGame.common.randomNum(4, 7);
  19038. xGame.soundMgr.playSound("s_main0" + index);
  19039. let words = 1;
  19040. switch (index) {
  19041. case 4:
  19042. words = 5;
  19043. break;
  19044. case 5:
  19045. words = 3;
  19046. break;
  19047. case 6:
  19048. words = 6;
  19049. break;
  19050. case 7:
  19051. words = 7;
  19052. break;
  19053. default:
  19054. break;
  19055. }
  19056. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19057. this.playSecretaryRandomSound();
  19058. });
  19059. }
  19060. }
  19061. UISkill$1.uiName = "UISkill";
  19062. class UIAddProp$1 extends UIBase {
  19063. constructor() {
  19064. super();
  19065. this.curType = "";
  19066. }
  19067. onConstructor() {
  19068. this.ui = ui_UIAddProp.createInstance();
  19069. this.contentPane = this.ui;
  19070. this.isEject = false;
  19071. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19072. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19073. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19074. this.updateUI();
  19075. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19076. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19077. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19078. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19079. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19080. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19081. }
  19082. show(type) {
  19083. super.show();
  19084. this.curType = type == 0 ? "coin" : "diamond";
  19085. this.switchBtn("");
  19086. this.ui.t0.play();
  19087. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19088. PlatMgr.showInsert(true);
  19089. }
  19090. closeSelf() {
  19091. this.hide();
  19092. }
  19093. updateUI() {
  19094. let data = cfgTable.moneyData;
  19095. let temp;
  19096. let obj;
  19097. for (const key in data) {
  19098. temp = data[key];
  19099. obj = this.ui.myNode["node" + key];
  19100. if (parseInt(key) <= 2) {
  19101. obj.diamondTxt.text = "+" + temp.num;
  19102. }
  19103. else {
  19104. obj.coinTxt.text = temp.num;
  19105. obj.diamondTxt.text = temp.get.split('_')[1];
  19106. }
  19107. }
  19108. this.updateDiamondShare();
  19109. }
  19110. updateDiamondShare() {
  19111. let data = DataMgr.getShareDiamondTimes();
  19112. if (data >= xGame.common.maxShareDiamondTimes) {
  19113. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19114. this.ui.myNode.node1.touchable = false;
  19115. }
  19116. else {
  19117. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19118. this.ui.myNode.node1.touchable = true;
  19119. }
  19120. }
  19121. switchBtn(type) {
  19122. if (type == "")
  19123. type = this.curType;
  19124. else {
  19125. if (this.curType == type) {
  19126. return;
  19127. }
  19128. else {
  19129. this.curType = type;
  19130. }
  19131. }
  19132. if (type == "coin") {
  19133. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19134. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19135. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19136. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19137. this.ui.myNode.c1.selectedIndex = 0;
  19138. }
  19139. else {
  19140. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19141. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19142. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19143. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19144. this.ui.myNode.c1.selectedIndex = 1;
  19145. }
  19146. }
  19147. convertCoin(index) {
  19148. let data = cfgTable.moneyData[index];
  19149. let coinNum = data.num;
  19150. let str = data.get.split('_')[1];
  19151. let needDiamond = parseInt(str);
  19152. if (DataMgr.diamondEnough(needDiamond)) {
  19153. DataMgr.setDiamond(-needDiamond);
  19154. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19155. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19156. }
  19157. else {
  19158. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19159. this.switchBtn("diamond");
  19160. }
  19161. }
  19162. videoGetDiamond() {
  19163. let num = cfgTable.moneyData[2].num;
  19164. Moyu.showVideoAd(() => {
  19165. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19166. this.closeSelf();
  19167. }, EAdType.addDiamond);
  19168. }
  19169. videoGetCoin() {
  19170. Moyu.showVideoAd(() => {
  19171. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19172. this.closeSelf();
  19173. }, EAdType.addCoin);
  19174. }
  19175. shareGetDiamond() {
  19176. let times = DataMgr.getShareDiamondTimes();
  19177. if (times >= xGame.common.maxShareDiamondTimes) {
  19178. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19179. }
  19180. else {
  19181. if (Moyu.isTT) {
  19182. let num = cfgTable.moneyData[1].num;
  19183. Moyu.shareVideo = '';
  19184. Moyu.shareGame((success) => {
  19185. if (success) {
  19186. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19187. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19188. DataMgr.setShareDiamondTimes(1);
  19189. this.updateDiamondShare();
  19190. }
  19191. else {
  19192. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19193. }
  19194. });
  19195. }
  19196. else {
  19197. Moyu.showVideoAd(() => {
  19198. let diamond = xGame.common.randomNum(50, 100);
  19199. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19200. DataMgr.setShareDiamondTimes(1);
  19201. this.updateDiamondShare();
  19202. }, EAdType.randomDiamond);
  19203. }
  19204. }
  19205. }
  19206. openPutBallView() {
  19207. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19208. let skill = xGame.uiMgr.getUI(UISkill$1);
  19209. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19210. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19211. if (end && !end.isHide) {
  19212. xGame.uiMgr.Hide(UIGameEnd$1);
  19213. xGame.uiMgr.Show(UIMain$1);
  19214. }
  19215. if (skill && !skill.isHide)
  19216. xGame.uiMgr.Hide(UISkill$1);
  19217. if (uigame && !uigame.isHide)
  19218. xGame.uiMgr.Hide(UIGame$1);
  19219. if (level && !level.isHide) {
  19220. }
  19221. else {
  19222. xGame.uiMgr.Show(UILevelDisplay$1);
  19223. }
  19224. this.closeSelf();
  19225. }
  19226. }
  19227. UIAddProp$1.uiName = "UIAddProp";
  19228. class MoneyNode$1 {
  19229. constructor(ui) {
  19230. this.leftTime = 0;
  19231. this.ui = ui;
  19232. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19233. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19234. this.ui.addPowerBtn.onClick(this, this.addPower);
  19235. this.ui.c1.selectedIndex = 1;
  19236. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19237. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19238. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19239. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19240. this.coinChange();
  19241. this.diamondChange();
  19242. this.powerChange();
  19243. }
  19244. addPower() {
  19245. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19246. xGame.uiMgr.Show(UIPower$1);
  19247. }
  19248. powerChange() {
  19249. let powerNum = DataMgr.getPower();
  19250. this.ui.powerTxt.text = powerNum + "";
  19251. }
  19252. checkPowerTime() {
  19253. let cur = new Date().getTime();
  19254. let last = DataMgr.getPowerTime();
  19255. if (last == 0) {
  19256. last = cur;
  19257. DataMgr.setPowerTime(cur);
  19258. }
  19259. let power = DataMgr.getPower();
  19260. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19261. Laya.timer.clearAll(this);
  19262. if (power >= xGame.common.natureMaxPower) {
  19263. this.ui.powerTimeTxt.text = "";
  19264. DataMgr.setPowerTime(cur);
  19265. return;
  19266. }
  19267. if (power + offset >= xGame.common.natureMaxPower) {
  19268. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19269. this.ui.powerTimeTxt.text = "";
  19270. DataMgr.setPowerTime(cur);
  19271. }
  19272. else {
  19273. if (offset > 0) {
  19274. DataMgr.setPower(offset);
  19275. DataMgr.setPowerTime(cur);
  19276. }
  19277. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19278. this.leftTime = xGame.common.powerRecoverNum - time;
  19279. if (this.leftTime <= 0)
  19280. this.leftTime = 0;
  19281. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19282. Laya.timer.loop(1000, this, this.updatePowerTime);
  19283. }
  19284. }
  19285. updatePowerTime() {
  19286. this.leftTime -= 1;
  19287. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19288. if (this.leftTime <= 0) {
  19289. this.checkPowerTime();
  19290. }
  19291. }
  19292. coinChange() {
  19293. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19294. }
  19295. diamondChange() {
  19296. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19297. }
  19298. addCoin() {
  19299. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19300. Moyu.sendDataEvent("AddCoinBtn");
  19301. xGame.uiMgr.Show(UIAddProp$1, 0);
  19302. }
  19303. addDiamond() {
  19304. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19305. Moyu.sendDataEvent("AddDiamondBtn");
  19306. xGame.uiMgr.Show(UIAddProp$1, 1);
  19307. }
  19308. }
  19309. class SettingNode$1 {
  19310. constructor(ui) {
  19311. this.showSetting = false;
  19312. this.openSound = true;
  19313. this.openShake = true;
  19314. this.ui = ui;
  19315. this.ui.soundBtn.onClick(this, this.switchSound);
  19316. this.ui.shakeBtn.onClick(this, this.switchShake);
  19317. this.ui.xyBtn.onClick(this, this.onXy);
  19318. this.ui.clickNode.onClick(this, this.changeSetting);
  19319. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19320. this.ui.xyBtn.visible = false;
  19321. this.ui.shakeBtn.visible = false;
  19322. }
  19323. changeSetting() {
  19324. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19325. this.showSetting = !this.showSetting;
  19326. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19327. }
  19328. switchSound() {
  19329. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19330. this.openSound = !this.openSound;
  19331. Moyu.onSetting(this.openSound, this.openShake);
  19332. xGame.soundMgr.onSetting(this.openSound);
  19333. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19334. }
  19335. switchShake() {
  19336. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19337. this.openShake = !this.openShake;
  19338. Moyu.onSetting(this.openSound, this.openShake);
  19339. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19340. }
  19341. onXy() {
  19342. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19343. MoyuMgr$1.showXy(1);
  19344. }
  19345. }
  19346. class UIDraw$1 extends UIBase {
  19347. constructor() {
  19348. super();
  19349. this.curKey = 0;
  19350. }
  19351. onConstructor() {
  19352. this.ui = ui_UIDraw.createInstance();
  19353. this.contentPane = this.ui;
  19354. this.isEject = false;
  19355. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19356. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19357. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19358. this.initDraw();
  19359. this.initUI();
  19360. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19361. if (Moyu.isKs)
  19362. this.ui.closeNode.closeBtn.x += 100;
  19363. }
  19364. show() {
  19365. super.show();
  19366. this.ui.t0.play();
  19367. this.playSecretaryIdle();
  19368. this.updateDraw();
  19369. this.checkFree();
  19370. if (PlatMgr.bannerDelay > 0) {
  19371. this.ui.closeNode.closeBtn.visible = false;
  19372. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19373. this.ui.closeNode.closeBtn.visible = true;
  19374. });
  19375. }
  19376. PlatMgr.showRateBanner();
  19377. }
  19378. hide() {
  19379. Laya.timer.clearAll(this);
  19380. super.hide();
  19381. }
  19382. checkFree() {
  19383. let isFree = DataMgr.getDailyfreeDrawTimes();
  19384. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19385. }
  19386. initDraw() {
  19387. this.drawObj = [];
  19388. let data = cfgTable.drawData;
  19389. let temp;
  19390. let weight = 0;
  19391. for (const key in data) {
  19392. temp = data[key];
  19393. weight += temp.weight;
  19394. this.drawObj.push(weight);
  19395. }
  19396. this.allWeight = weight;
  19397. }
  19398. initUI() {
  19399. let data = cfgTable.drawData;
  19400. let temp;
  19401. let img;
  19402. let txt;
  19403. for (const key in data) {
  19404. temp = data[key];
  19405. img = this.ui.myNode.rotNode["img" + key];
  19406. txt = this.ui.myNode.rotNode["txt" + key];
  19407. img.url = xGame.common.getGameIconUrl(temp.icon);
  19408. txt.visible = true;
  19409. if (temp.award > 2) {
  19410. img.rotation = 0;
  19411. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19412. }
  19413. else {
  19414. img.rotation = temp.rotation;
  19415. txt.text = temp.num;
  19416. }
  19417. }
  19418. }
  19419. getCurkey() {
  19420. let rand = Math.random() * this.allWeight;
  19421. let temp;
  19422. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19423. temp = this.drawObj[index];
  19424. if (index == 0) {
  19425. if (rand < temp) {
  19426. return index + 1;
  19427. }
  19428. }
  19429. else {
  19430. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19431. return index + 1;
  19432. }
  19433. }
  19434. }
  19435. return 2;
  19436. }
  19437. startDraw() {
  19438. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19439. if (freeTimes > 0) {
  19440. this.beginDraw();
  19441. DataMgr.setDailyfreeDrawTimes(0);
  19442. this.checkFree();
  19443. }
  19444. else {
  19445. GlobalManager.instance.registerMethod('qjff_chouJiang', this.qjff_chouJiang);
  19446. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19447. }
  19448. else {
  19449. console.log('zh:AD 失败,直接发放奖励');
  19450. this.qjff_chouJiang;
  19451. }
  19452. }
  19453. }
  19454. qjff_chouJiang() {
  19455. this.beginDraw();
  19456. }
  19457. beginDraw() {
  19458. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19459. this.ui.drawBtn.touchable = false;
  19460. this.curKey = this.getCurkey();
  19461. console.log("当前key", this.curKey);
  19462. let cell = 60;
  19463. let lap = 3;
  19464. let angle = cell * (this.curKey - 1) + lap * 360;
  19465. let target = this.ui.myNode.rotNode;
  19466. target.rotation = 0;
  19467. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19468. console.log("旋转完成");
  19469. this.ui.drawBtn.touchable = true;
  19470. this.getAward();
  19471. }));
  19472. }
  19473. getAward() {
  19474. let data = cfgTable.drawData[this.curKey];
  19475. let temp = new AwardType();
  19476. temp.type = data.award;
  19477. temp.num = data.num;
  19478. xGame.common.getAward([temp], () => {
  19479. DataMgr.setDrawTimes(1);
  19480. this.updateDraw();
  19481. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19482. });
  19483. }
  19484. updateDraw() {
  19485. let drawTimes = DataMgr.getDrawTimes();
  19486. let awardTimes = DataMgr.getDrawAwardTimes();
  19487. if (Math.floor(drawTimes / 3) > awardTimes) {
  19488. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19489. this.ui.extraNode.boxBtn.touchable = true;
  19490. this.ui.extraNode.tipsTxt.text = "3/3";
  19491. this.ui.extraNode.barNode.width = 265;
  19492. this.getExtraAward();
  19493. }
  19494. else {
  19495. this.ui.extraNode.boxBtn.t0.stop();
  19496. this.ui.extraNode.boxBtn.touchable = false;
  19497. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19498. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19499. }
  19500. let data = cfgTable.drawData[1];
  19501. if (awardTimes == 0) {
  19502. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19503. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19504. this.ui.myNode.rotNode.img1.rotation = 0;
  19505. }
  19506. else {
  19507. let award = data.nextid;
  19508. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19509. this.ui.myNode.rotNode.txt1.text = award[1];
  19510. this.ui.myNode.rotNode.img1.rotation = 0;
  19511. }
  19512. }
  19513. getExtraAward() {
  19514. let drawTimes = DataMgr.getDrawTimes();
  19515. let awardTimes = DataMgr.getDrawAwardTimes();
  19516. let data = cfgTable.drawData[1];
  19517. let award = new AwardType();
  19518. if (awardTimes == 0) {
  19519. award.num = data.num;
  19520. award.type = data.award;
  19521. xGame.common.getAward([award], () => {
  19522. let all = Math.floor(drawTimes / 3);
  19523. DataMgr.setDrawAwardTimes(all);
  19524. this.updateDraw();
  19525. });
  19526. }
  19527. else {
  19528. award.num = parseInt(data.nextid[1]);
  19529. award.type = parseInt(data.nextid[0]);
  19530. xGame.common.getAward([award], () => {
  19531. let all = Math.floor(drawTimes / 3);
  19532. DataMgr.setDrawAwardTimes(all);
  19533. this.updateDraw();
  19534. });
  19535. }
  19536. }
  19537. closeSelf() {
  19538. this.hide();
  19539. }
  19540. playSecretaryIdle() {
  19541. let parent = this.ui.secretary.displayObject;
  19542. parent.destroyChildren();
  19543. let xx = this.ui.secretary.width / 2;
  19544. let yy = this.ui.secretary.height;
  19545. let scale = xGame.common.getSecretaryScale();
  19546. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19547. xGame.common.secretary.play(data, 0, true, parent);
  19548. }
  19549. }
  19550. UIDraw$1.uiName = "UIDraw";
  19551. class UIRanking$1 extends UIBase {
  19552. constructor() {
  19553. super();
  19554. this.showSelf = true;
  19555. this.rankType = 1;
  19556. this.rankList = [];
  19557. this.myIndex = 0;
  19558. this.myStar = 0;
  19559. }
  19560. onConstructor() {
  19561. this.ui = ui_UIRanking.createInstance();
  19562. this.contentPane = this.ui;
  19563. this.isEject = false;
  19564. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19565. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19566. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19567. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19568. this.ui.myNode.myList.setVirtual();
  19569. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19570. }
  19571. show() {
  19572. super.show();
  19573. this.myIndex = 51;
  19574. Moyu.getRankList({
  19575. rankId: xGame.common.curRankID,
  19576. type: MoyuRankType.total,
  19577. page: 1,
  19578. pageSize: 50,
  19579. }, this, this.updateItemData);
  19580. this.updateSelf();
  19581. let self = Moyu.getUserInfo();
  19582. if (!self.isAuth) {
  19583. Moyu.initUser(this, () => {
  19584. DataMgr.upRankData();
  19585. });
  19586. }
  19587. }
  19588. updateSelfItem() {
  19589. let self = Moyu.getUserInfo();
  19590. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19591. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19592. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19593. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19594. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19595. }
  19596. updateItemData(data) {
  19597. this.myStar = xGame.common.getAllStarNum();
  19598. if (this.rankList.length < 2) {
  19599. this.rankList = data;
  19600. let self = Moyu.getUserInfo();
  19601. for (let i = 0; i < data.length; i++) {
  19602. let data = this.rankList[i];
  19603. if (data.userId == self.userId) {
  19604. this.rankList.splice(i, 1);
  19605. break;
  19606. }
  19607. }
  19608. for (let i = 0; i < data.length; i++) {
  19609. let data = this.rankList[i];
  19610. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19611. this.myIndex = i + 1;
  19612. let user = { headIcon: self.headIcon, nickName: "myself" };
  19613. let ud = { user: user, data: {} };
  19614. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19615. if (Moyu.platType < 11) {
  19616. user.headIcon = self.headIcon;
  19617. user.nickName = self.nickName;
  19618. }
  19619. this.rankList.splice(i, 0, md);
  19620. break;
  19621. }
  19622. }
  19623. }
  19624. this.updateSelfItem();
  19625. this.ui.myNode.myList.numItems = this.rankList.length;
  19626. }
  19627. updateItemUI(index, obj) {
  19628. let data = this.rankList[index];
  19629. let userData = JSON.parse(data.userData).user;
  19630. obj.nameTxt.text = userData.nickName.toString();
  19631. obj.valueTxt.text = data.rankScore;
  19632. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19633. obj.rankTxt.text = index + 1;
  19634. switch (index) {
  19635. case 0:
  19636. this.setImg(obj, 1, 0, 0);
  19637. obj.rankTxt.color = "#FFC047";
  19638. break;
  19639. case 1:
  19640. this.setImg(obj, 0, 1, 0);
  19641. obj.rankTxt.color = "#ACACAC";
  19642. break;
  19643. case 2:
  19644. this.setImg(obj, 0, 0, 1);
  19645. obj.rankTxt.color = "#D09672";
  19646. break;
  19647. default:
  19648. this.setImg(obj, 0, 0, 0);
  19649. obj.rankTxt.color = "#496FAB";
  19650. break;
  19651. }
  19652. }
  19653. setImg(obj, a, b, c) {
  19654. obj.img1.visible = a ? true : false;
  19655. obj.img2.visible = b ? true : false;
  19656. obj.img3.visible = c ? true : false;
  19657. }
  19658. changeList(type) {
  19659. this.rankType = type;
  19660. this.updateSelf();
  19661. }
  19662. changeSelfNode() {
  19663. this.showSelf = !this.showSelf;
  19664. this.updateSelf();
  19665. }
  19666. updateSelf() {
  19667. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19668. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19669. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19670. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19671. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19672. }
  19673. }
  19674. UIRanking$1.uiName = "UIRanking";
  19675. class UISecretary$1 extends UIBase {
  19676. constructor() {
  19677. super();
  19678. this.curIndex = 1;
  19679. }
  19680. onConstructor() {
  19681. this.ui = ui_UISecretary.createInstance();
  19682. this.contentPane = this.ui;
  19683. this.isEject = false;
  19684. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19685. this.nodeObj = { left: null, right: null, cur: null };
  19686. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19687. }
  19688. show() {
  19689. super.show();
  19690. this.ui.t0.play();
  19691. this.updateData();
  19692. }
  19693. addSecretarySpine(node, spineName) {
  19694. if (spineName == "mishu") {
  19695. if (this.secretarySpine1) {
  19696. node.displayObject.destroyChildren();
  19697. this.playWoman(this.secretarySpine1, node.displayObject);
  19698. }
  19699. else {
  19700. let spine1 = new SpineMgr("mishu", () => {
  19701. this.secretarySpine1 = spine1;
  19702. this.playWoman(this.secretarySpine1, node.displayObject);
  19703. });
  19704. }
  19705. }
  19706. else {
  19707. if (this.secretarySpine2) {
  19708. node.displayObject.destroyChildren();
  19709. this.playWoman(this.secretarySpine2, node.displayObject);
  19710. }
  19711. else {
  19712. let spine2 = new SpineMgr("xiaomishu2", () => {
  19713. this.secretarySpine2 = spine2;
  19714. this.playWoman(this.secretarySpine2, node.displayObject);
  19715. });
  19716. }
  19717. }
  19718. }
  19719. playWoman(node, parent) {
  19720. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19721. let yy = this.ui.myNode.gameNode3.secretary.height;
  19722. let scale = 1.5;
  19723. if (node == this.secretarySpine2) {
  19724. scale = 1.2;
  19725. }
  19726. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19727. node.play(data, 0, true, parent);
  19728. }
  19729. turnLeft() {
  19730. this.curIndex--;
  19731. if (this.curIndex < 1) {
  19732. this.curIndex = 2;
  19733. }
  19734. let left = this.nodeObj.left;
  19735. let right = this.nodeObj.right;
  19736. let cur = this.nodeObj.cur;
  19737. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19738. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19739. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19740. this.updateData();
  19741. }));
  19742. this.ui.myNode.setChildIndex(right, 2);
  19743. this.nodeObj.left = cur;
  19744. this.nodeObj.right = left;
  19745. this.nodeObj.cur = right;
  19746. }
  19747. turnRight() {
  19748. this.curIndex++;
  19749. if (this.curIndex > 2) {
  19750. this.curIndex = 1;
  19751. }
  19752. let left = this.nodeObj.left;
  19753. let right = this.nodeObj.right;
  19754. let cur = this.nodeObj.cur;
  19755. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19756. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19757. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19758. this.updateData();
  19759. }));
  19760. this.ui.myNode.setChildIndex(left, 2);
  19761. this.nodeObj.left = right;
  19762. this.nodeObj.right = cur;
  19763. this.nodeObj.cur = left;
  19764. }
  19765. updateData() {
  19766. let data = cfgTable.secretaryshopData;
  19767. let children = this.ui.myNode._children;
  19768. let temp;
  19769. let curData;
  19770. for (let index = 0; index < children.length; index++) {
  19771. temp = children[index];
  19772. curData = data[1];
  19773. temp.heightTxt.text = curData.height;
  19774. temp.foodTxt.text = curData.food;
  19775. temp.historyTxt.text = curData.history;
  19776. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19777. this.addSecretarySpine(temp.secretary, curData.spine);
  19778. let womanIndex = curData.id - 1;
  19779. let getWoman = DataMgr.getSecretary(womanIndex);
  19780. let curUse = DataMgr.getCurSecretary();
  19781. if (getWoman) {
  19782. if (curUse == womanIndex) {
  19783. temp.purchaseBtn.c1.selectedIndex = 1;
  19784. }
  19785. else {
  19786. temp.purchaseBtn.c1.selectedIndex = 2;
  19787. }
  19788. }
  19789. else {
  19790. temp.purchaseBtn.c1.selectedIndex = 0;
  19791. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19792. }
  19793. temp.purchaseBtn.offClick(this, this.clickSecretary);
  19794. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  19795. }
  19796. }
  19797. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  19798. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19799. if (getWoman) {
  19800. if (curUse != womanIndex) {
  19801. console.log();
  19802. DataMgr.setCurSecretary(womanIndex);
  19803. this.updateData();
  19804. }
  19805. }
  19806. else {
  19807. let need = needDiamond;
  19808. if (DataMgr.diamondEnough(need)) {
  19809. DataMgr.setDiamond(-need);
  19810. DataMgr.setSecretary(womanIndex, 1);
  19811. DataMgr.setCurSecretary(womanIndex);
  19812. this.updateData();
  19813. }
  19814. else {
  19815. xGame.uiMgr.Show(UIAddProp$1, 1);
  19816. }
  19817. }
  19818. }
  19819. closeSelf() {
  19820. this.hide();
  19821. }
  19822. }
  19823. UISecretary$1.uiName = "UISecretary";
  19824. class BallRodDisplay$1 {
  19825. constructor(ui, index) {
  19826. this.index = 0;
  19827. this.uiIndex = 0;
  19828. this.ui = ui;
  19829. this.index = index;
  19830. this.initData();
  19831. }
  19832. initData() {
  19833. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  19834. let data = cfgTable.ballrodData[this.index + 1];
  19835. this.ui.nameTxt.text = data.name;
  19836. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  19837. this.ui.levelNode.c1.selectedIndex = data.quality;
  19838. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  19839. if (data.spine) {
  19840. this.mySpine = new SpineMgr(data.spine, () => {
  19841. let xx = 150;
  19842. let yy = 70;
  19843. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  19844. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  19845. });
  19846. }
  19847. }
  19848. updateSelf() {
  19849. let get = DataMgr.getBallRod(this.index);
  19850. if (get == null)
  19851. get = 1;
  19852. let curUse = DataMgr.getCurBallRod();
  19853. if (get) {
  19854. if (curUse == this.index) {
  19855. this.ui.purchaseBtn.c1.selectedIndex = 0;
  19856. }
  19857. else {
  19858. this.ui.purchaseBtn.c1.selectedIndex = 1;
  19859. }
  19860. }
  19861. else {
  19862. this.ui.purchaseBtn.c1.selectedIndex = 2;
  19863. }
  19864. }
  19865. buyBallRod() {
  19866. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19867. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  19868. switch (selectedIndex) {
  19869. case 0:
  19870. break;
  19871. case 1:
  19872. DataMgr.setCurBallRod(this.index);
  19873. let ui = xGame.uiMgr.getUI(UIShop$1);
  19874. ui.updateBallRod();
  19875. break;
  19876. case 2:
  19877. let data = cfgTable.ballrodData[this.index + 1];
  19878. let need = data.price;
  19879. if (DataMgr.diamondEnough(need)) {
  19880. DataMgr.setDiamond(-need);
  19881. DataMgr.setBallRod(this.index, 1);
  19882. DataMgr.setCurBallRod(this.index);
  19883. let ui = xGame.uiMgr.getUI(UIShop$1);
  19884. ui.updateBallRod();
  19885. }
  19886. else {
  19887. xGame.uiMgr.Show(UIAddProp$1, 1);
  19888. }
  19889. break;
  19890. default:
  19891. break;
  19892. }
  19893. }
  19894. }
  19895. class UIShop$1 extends UIBase {
  19896. constructor() {
  19897. super();
  19898. this.itemNums = 0;
  19899. }
  19900. onConstructor() {
  19901. this.ui = ui_UIShop.createInstance();
  19902. this.contentPane = this.ui;
  19903. this.isEject = false;
  19904. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19905. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19906. this.addUIClick(this.ui, this.interuptSecretary);
  19907. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  19908. this.ballRodArr = [];
  19909. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  19910. this.ui.myNode.myList.numItems = this.itemNums;
  19911. if (Moyu.isKs)
  19912. this.ui.closeNode.closeBtn.x += 100;
  19913. }
  19914. show() {
  19915. super.show();
  19916. this.playSecretaryIdle();
  19917. this.updateBallRod();
  19918. }
  19919. updateBallRod() {
  19920. for (let index = 0; index < this.ballRodArr.length; index++) {
  19921. this.ballRodArr[index].updateSelf();
  19922. }
  19923. }
  19924. renderBallRod(sort, obj) {
  19925. let index = this.getIndexBySort(sort + 1) - 1;
  19926. let ballRod = new BallRodDisplay$1(obj, index);
  19927. this.ballRodArr.push(ballRod);
  19928. }
  19929. getIndexBySort(sort) {
  19930. let object = cfgTable.ballrodData;
  19931. for (const key in object) {
  19932. if (object[key].sort == sort) {
  19933. return parseInt(key);
  19934. }
  19935. }
  19936. }
  19937. playSecretaryIdle() {
  19938. let parent = this.ui.secretary.displayObject;
  19939. parent.destroyChildren();
  19940. let xx = this.ui.secretary.width / 2;
  19941. let yy = this.ui.secretary.height;
  19942. let scale = xGame.common.getSecretaryScale();
  19943. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19944. xGame.common.secretary.play(data, 0, true, parent);
  19945. }
  19946. interuptSecretary() {
  19947. Laya.timer.clearAll(this);
  19948. this.playSecretaryRandomSound();
  19949. }
  19950. playSecretaryRandomSound() {
  19951. if (this.isHide)
  19952. return;
  19953. let time = xGame.common.randomNum(45000, 60000);
  19954. Laya.timer.once(time, this, () => {
  19955. if (this.isHide)
  19956. return;
  19957. let index = xGame.common.randomNum(4, 7);
  19958. xGame.soundMgr.playSound("s_main0" + index);
  19959. let words = 1;
  19960. switch (index) {
  19961. case 4:
  19962. words = 5;
  19963. break;
  19964. case 5:
  19965. words = 3;
  19966. break;
  19967. case 6:
  19968. words = 6;
  19969. break;
  19970. case 7:
  19971. words = 7;
  19972. break;
  19973. default:
  19974. break;
  19975. }
  19976. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19977. this.playSecretaryRandomSound();
  19978. });
  19979. }
  19980. closeSelf() {
  19981. this.hide();
  19982. }
  19983. }
  19984. UIShop$1.uiName = "UIShop";
  19985. class SignMax$1 {
  19986. constructor(ui) {
  19987. this.ui = ui;
  19988. }
  19989. updateSelf(index, sameDay, curDayIndex) {
  19990. let data = cfgTable.signData[index + 1];
  19991. this.ui.titleTxt.text = data.title;
  19992. let arr1 = data.award[0].split('-');
  19993. let arr2 = data.award[1].split('-');
  19994. let num1 = parseInt(arr1[1]);
  19995. let num2 = parseInt(arr2[1]);
  19996. this.ui.numTxt1.text = num1 + "";
  19997. this.ui.numTxt2.text = num2 + "";
  19998. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  19999. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20000. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20001. this.ui.numTxt1.visible = false;
  20002. }
  20003. else {
  20004. this.ui.numTxt1.visible = true;
  20005. }
  20006. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20007. this.ui.numTxt2.visible = false;
  20008. }
  20009. else {
  20010. this.ui.numTxt2.visible = true;
  20011. }
  20012. if (index < curDayIndex) {
  20013. this.ui.c1.selectedIndex = 1;
  20014. }
  20015. else if (index == curDayIndex) {
  20016. if (sameDay) {
  20017. this.ui.c1.selectedIndex = 2;
  20018. }
  20019. else {
  20020. this.ui.c1.selectedIndex = 2;
  20021. }
  20022. }
  20023. else {
  20024. this.ui.c1.selectedIndex = 0;
  20025. }
  20026. }
  20027. }
  20028. class SignNormal$1 {
  20029. constructor(ui) {
  20030. this.ui = ui;
  20031. }
  20032. updateSelf(index, sameDay, curDayIndex) {
  20033. let data = cfgTable.signData[index + 1];
  20034. this.ui.titleTxt.text = data.title;
  20035. let arr = data.award[0].split('-');
  20036. let type = parseInt(arr[0]);
  20037. let num = parseInt(arr[1]);
  20038. this.ui.numTxt.text = num + "";
  20039. if (type > 2) {
  20040. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20041. this.ui.myIcon.rotation = 0;
  20042. }
  20043. else {
  20044. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20045. this.ui.myIcon.rotation = 0;
  20046. }
  20047. if (xGame.common.signAwardContainsRod(data.award)) {
  20048. this.ui.numTxt.visible = false;
  20049. }
  20050. else {
  20051. this.ui.numTxt.visible = true;
  20052. }
  20053. if (index < curDayIndex) {
  20054. this.ui.c1.selectedIndex = 1;
  20055. }
  20056. else if (index == curDayIndex) {
  20057. if (sameDay) {
  20058. this.ui.c1.selectedIndex = 2;
  20059. }
  20060. else {
  20061. this.ui.c1.selectedIndex = 2;
  20062. }
  20063. }
  20064. else {
  20065. this.ui.c1.selectedIndex = 0;
  20066. }
  20067. }
  20068. }
  20069. class UISign$1 extends UIBase {
  20070. constructor() {
  20071. super();
  20072. this.curDayIndex = 0;
  20073. this.starX = 0;
  20074. }
  20075. onConstructor() {
  20076. this.ui = ui_UISign.createInstance();
  20077. this.contentPane = this.ui;
  20078. this.isEject = false;
  20079. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20080. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20081. this.initSignItem();
  20082. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20083. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20084. }
  20085. show() {
  20086. super.show();
  20087. this.ui.t0.play();
  20088. this.playSecretaryIdle();
  20089. this.updateSign();
  20090. }
  20091. initSignItem() {
  20092. this.signArr = [];
  20093. for (let index = 0; index < 6; index++) {
  20094. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20095. this.signArr.push(temp);
  20096. }
  20097. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20098. if (Moyu.isKs)
  20099. this.ui.closeNode.closeBtn.x += 100;
  20100. }
  20101. updateSign() {
  20102. let sameDay = xGame.common.judgeSameDay();
  20103. let max = 7;
  20104. this.curDayIndex = DataMgr.getSignData();
  20105. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20106. this.curDayIndex = 0;
  20107. if (!sameDay) {
  20108. this.ui.normalBtn.visible = true;
  20109. this.ui.tipsNode.visible = false;
  20110. this.ui.againBtn.visible = false;
  20111. }
  20112. else {
  20113. this.ui.normalBtn.visible = false;
  20114. let again = DataMgr.getExtraSign();
  20115. let isCurrency = false;
  20116. let index = this.curDayIndex;
  20117. if (index == 0)
  20118. index = 7;
  20119. let award = cfgTable.signData[index].award;
  20120. let num = award[0].split("-")[0];
  20121. if (num == "1" || num == "2")
  20122. isCurrency = true;
  20123. let showAgain = again == 0 && isCurrency;
  20124. this.ui.againBtn.visible = showAgain;
  20125. this.ui.tipsNode.visible = !showAgain;
  20126. }
  20127. for (let index = 0; index < this.signArr.length; index++) {
  20128. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20129. }
  20130. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20131. }
  20132. playSecretaryIdle() {
  20133. let parent = this.ui.secretary.displayObject;
  20134. parent.destroyChildren();
  20135. let xx = this.ui.secretary.width / 2;
  20136. let yy = this.ui.secretary.height;
  20137. let scale = xGame.common.getSecretaryScale();
  20138. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20139. xGame.common.secretary.play(data, 0, true, parent);
  20140. }
  20141. closeSelf() {
  20142. this.hide();
  20143. }
  20144. normalGetAward() {
  20145. let sameDay = xGame.common.judgeSameDay();
  20146. if (!sameDay) {
  20147. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20148. let temp;
  20149. let type;
  20150. let num;
  20151. let arr = [];
  20152. for (let index = 0; index < award.length; index++) {
  20153. temp = award[index].split("-");
  20154. type = parseInt(temp[0]);
  20155. num = parseInt(temp[1]);
  20156. let awardType = new AwardType();
  20157. awardType.num = num;
  20158. awardType.type = type;
  20159. arr.push(awardType);
  20160. }
  20161. xGame.common.getAward(arr, (watchVideo) => {
  20162. this.curDayIndex++;
  20163. if (this.curDayIndex > 7)
  20164. this.curDayIndex = 0;
  20165. DataMgr.setSignData(this.curDayIndex);
  20166. DataMgr.setSignTime(new Date().getTime());
  20167. if (watchVideo) {
  20168. DataMgr.setExtraSign(1);
  20169. Moyu.sendDataEvent("signIn1");
  20170. }
  20171. this.updateSign();
  20172. });
  20173. }
  20174. }
  20175. againGetAward() {
  20176. Moyu.sendDataEvent("signIn2");
  20177. Moyu.showVideoAd(() => {
  20178. let index = this.curDayIndex;
  20179. if (index == 0)
  20180. index = 7;
  20181. let award = cfgTable.signData[index].award;
  20182. let temp;
  20183. let type;
  20184. let num;
  20185. for (let index = 0; index < award.length; index++) {
  20186. temp = award[index].split("-");
  20187. type = parseInt(temp[0]);
  20188. num = parseInt(temp[1]) * 3;
  20189. xGame.common.playObjFlyAnim(num, type);
  20190. }
  20191. DataMgr.setExtraSign(1);
  20192. this.updateSign();
  20193. }, EAdType.againSign);
  20194. }
  20195. }
  20196. UISign$1.uiName = "UISign";
  20197. class UIModeSelection$1 extends UIBase {
  20198. constructor() {
  20199. super();
  20200. }
  20201. onConstructor() {
  20202. this.ui = ui_UIModeSelection.createInstance();
  20203. this.contentPane = this.ui;
  20204. this.isEject = false;
  20205. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20206. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20207. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20208. this.addUIClick(this.ui.closeBtn, this.hide);
  20209. this.peopleArr = [650, 6900, 3800];
  20210. this.peopleOffest = [50, 500, 200];
  20211. this.updateSelf();
  20212. }
  20213. show(callback) {
  20214. super.show();
  20215. this.ui.t0.play();
  20216. this.callback = callback;
  20217. }
  20218. updateSelf() {
  20219. let cfg = cfgTable.modeselectData;
  20220. for (let index = 1; index <= 3; index++) {
  20221. let node = this.ui.myNode["type" + index];
  20222. node.need.text = cfg[index].need;
  20223. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20224. node.peopleTxt.text = this.getRandPeople(index - 1);
  20225. }
  20226. }
  20227. enterGame(type) {
  20228. xGame.common.classicRoomType = type;
  20229. let cfg = cfgTable.modeselectData[type];
  20230. let need = cfg.need;
  20231. xGame.common.passAwardCoin = cfg.award;
  20232. if (DataMgr.coinEnough(need)) {
  20233. DataMgr.setCoin(-need);
  20234. this.ui.myNode["type" + type].t0.play();
  20235. Laya.timer.once(200, this, () => {
  20236. this.callback && this.callback();
  20237. });
  20238. }
  20239. else {
  20240. Moyu.sendDataEvent("AddCoinVideo");
  20241. xGame.uiMgr.Show(UIAddProp$1, 0);
  20242. }
  20243. }
  20244. getRandPeople(index) {
  20245. let rand = this.peopleOffest[index];
  20246. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20247. }
  20248. }
  20249. UIModeSelection$1.uiName = "UIModeSelection";
  20250. class UIMain$1 extends UIBase {
  20251. constructor() {
  20252. super();
  20253. this.firstEnter = true;
  20254. }
  20255. nativeCallJs(msg) {
  20256. let t = msg;
  20257. console.log("zh:ts 奖励开始发放-", t);
  20258. GlobalManager.instance.callMethod(msg);
  20259. }
  20260. onConstructor() {
  20261. this.ui = ui_UIMain.createInstance();
  20262. this.contentPane = this.ui;
  20263. this.isEject = false;
  20264. this.addEvent();
  20265. this.addClickSpine();
  20266. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20267. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20268. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20269. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20270. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20271. let curUse = DataMgr.getCurSecretary();
  20272. this.changeSecretary(curUse);
  20273. this.ui.talkNode.visible = false;
  20274. let guide = DataMgr.getSkillGuide();
  20275. if (xGame.common.isNewDay && guide == 1) {
  20276. xGame.common.isNewDay = false;
  20277. xGame.soundMgr.playSound("s_main01");
  20278. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20279. console.log("播放小秘书每天语音");
  20280. }
  20281. this.onGetUserInfo();
  20282. this.ui.n83.visible = false;
  20283. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20284. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20285. }
  20286. changeSecretary(curUse) {
  20287. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20288. xGame.common.secretary && xGame.common.secretary.dispose();
  20289. this.addSecretarySpine(name);
  20290. }
  20291. addSecretarySpine(name) {
  20292. let spine = new SpineMgr(name, () => {
  20293. this.playSecretaryIdle();
  20294. });
  20295. xGame.common.secretary = spine;
  20296. }
  20297. addClickSpine() {
  20298. let clickSpine = new SpineMgr("dianji", () => {
  20299. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20300. let parent = Laya.stage;
  20301. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20302. clickSpine.play(data, 0, false, parent, (spine) => {
  20303. spine.destroy(true);
  20304. });
  20305. });
  20306. });
  20307. }
  20308. addEvent() {
  20309. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20310. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20311. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20312. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20313. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20314. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20315. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20316. this.addUIClick(this.ui, this.interuptSecretary);
  20317. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20318. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20319. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20320. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20321. this.addUIClick(this.ui.signBtn, this.openSignView);
  20322. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20323. }
  20324. show(showFailWords) {
  20325. super.show();
  20326. this.moneyNode.ui.c1.selectedIndex = 1;
  20327. this.playSecretaryIdle();
  20328. xGame.soundMgr.playMusic("caromhall01");
  20329. Laya.timer.clearAll(this);
  20330. this.playSecretaryRandomSound();
  20331. if (showFailWords) {
  20332. setTimeout(() => {
  20333. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20334. let words = -1;
  20335. if (str == "s_main02") {
  20336. words = 2;
  20337. }
  20338. else {
  20339. words = 3;
  20340. }
  20341. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20342. xGame.soundMgr.playSound(str);
  20343. }, 300);
  20344. }
  20345. this.showGuide();
  20346. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20347. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20348. let guide = DataMgr.getSkillGuide();
  20349. if (guide == 1) {
  20350. let randTime = xGame.common.randomNum(300, 800);
  20351. if (this.firstEnter) {
  20352. this.firstEnter = false;
  20353. randTime += 900;
  20354. }
  20355. Laya.timer.once(randTime, this, () => {
  20356. xGame.common.autoPopUIView();
  20357. });
  20358. }
  20359. }
  20360. checkActive(show) {
  20361. }
  20362. showGuide() {
  20363. let guide = DataMgr.getSkillGuide();
  20364. this.ui.guideBtn.visible = guide == 0;
  20365. this.ui.enterGuide.visible = false;
  20366. this.ui.secretaryGuide.visible = guide == 0;
  20367. if (guide == 0) {
  20368. xGame.soundMgr.playSound("s_guide");
  20369. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20370. }
  20371. }
  20372. ensureSecretary() {
  20373. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20374. this.ui.secretaryGuide.visible = false;
  20375. this.ui.enterGuide.visible = true;
  20376. this.ui.wordsNode.t0.play();
  20377. if (DataMgr.getNewUser())
  20378. Moyu.sendDataEvent("gameReady");
  20379. }
  20380. playSecretaryIdle() {
  20381. let parent = this.ui.secretary.displayObject;
  20382. parent.destroyChildren();
  20383. let xx = this.ui.secretary.width / 2;
  20384. let yy = this.ui.secretary.height;
  20385. let scale = xGame.common.getSecretaryScale();
  20386. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20387. console.log("zh:playSecretaryIdle", data);
  20388. xGame.common.secretary.play(data, 0, true, parent);
  20389. }
  20390. startGame(type) {
  20391. xGame.common.gameMode = type;
  20392. Moyu.sendDataEvent("PlayGame", { type: type });
  20393. switch (xGame.common.gameMode) {
  20394. case GameMode.classic:
  20395. let challengeTimes = DataMgr.getChallengeTimes();
  20396. if (challengeTimes == 0) {
  20397. xGame.uiMgr.Show(UIInvitation$1);
  20398. }
  20399. else {
  20400. this.beginGame();
  20401. }
  20402. break;
  20403. case GameMode.bigMove:
  20404. this.beginGame();
  20405. if (DataMgr.getNewUser())
  20406. Moyu.sendDataEvent("gameStart0");
  20407. break;
  20408. default:
  20409. break;
  20410. }
  20411. }
  20412. beginGame(isNice = false) {
  20413. if (xGame.common.gameMode == GameMode.classic) {
  20414. if (isNice) {
  20415. this.enterClassic();
  20416. }
  20417. else {
  20418. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20419. this.enterClassic();
  20420. });
  20421. }
  20422. }
  20423. else if (xGame.common.gameMode == GameMode.bigMove) {
  20424. this.ui.enterGuide.visible = false;
  20425. xGame.uiMgr.Show(UISkill$1);
  20426. }
  20427. }
  20428. enterClassic() {
  20429. xGame.uiMgr.Show(UIGame$1);
  20430. xGame.uiMgr.Show(UIMatching$1, () => {
  20431. if (!this.isHide)
  20432. this.hide();
  20433. xGame.common.gameUI.ui.alpha = 1;
  20434. xGame.common.gameUI.startGame();
  20435. xGame.uiMgr.Hide(UIGameEnd$1);
  20436. });
  20437. }
  20438. startGlobal() {
  20439. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20440. JSBridgeUtils.instance.showInternAd('全球');
  20441. }
  20442. startWeekly() {
  20443. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  20444. GlobalManager.instance.registerMethod('zhouSaiMonth', this.zhouSaiMonth);
  20445. JSBridgeUtils.instance.showRewardAd('zhouSaiMonth');
  20446. }
  20447. zhouSaiMonth() {
  20448. console.log('zh: zhouSaiMonth 被调用');
  20449. }
  20450. startPlaceBall() {
  20451. xGame.uiMgr.Show(UILevelDisplay$1);
  20452. }
  20453. hide() {
  20454. super.hide();
  20455. xGame.common.stopGirlPop(this.ui.talkNode);
  20456. }
  20457. onGetUserInfo(force = false) {
  20458. if (Moyu.isWx) {
  20459. let info = Moyu.getSystemInfo();
  20460. if (info)
  20461. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  20462. }
  20463. else {
  20464. Moyu.initUser(this, this.freshUser, force);
  20465. }
  20466. if (!Moyu.hasUserInfo) {
  20467. let user = Moyu.getUserInfo();
  20468. user.headIcon = 'res/ty_touxiang.png';
  20469. }
  20470. this.freshUser();
  20471. }
  20472. freshUser() {
  20473. let user = Moyu.getUserInfo();
  20474. if (!user.isAuth) {
  20475. user.headIcon = 'res/ty_touxiang.png';
  20476. }
  20477. else
  20478. DataMgr.upRankData();
  20479. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  20480. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  20481. }
  20482. interuptSecretary() {
  20483. Laya.timer.clearAll(this);
  20484. this.playSecretaryRandomSound();
  20485. }
  20486. playSecretaryRandomSound() {
  20487. if (this.isHide)
  20488. return;
  20489. let time = xGame.common.randomNum(45000, 60000);
  20490. Laya.timer.once(time, this, () => {
  20491. if (this.isHide)
  20492. return;
  20493. let index = xGame.common.randomNum(4, 7);
  20494. xGame.soundMgr.playSound("s_main0" + index);
  20495. let words = 1;
  20496. switch (index) {
  20497. case 4:
  20498. words = 5;
  20499. break;
  20500. case 5:
  20501. words = 3;
  20502. break;
  20503. case 6:
  20504. words = 6;
  20505. break;
  20506. case 7:
  20507. words = 7;
  20508. break;
  20509. default:
  20510. break;
  20511. }
  20512. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20513. this.playSecretaryRandomSound();
  20514. });
  20515. }
  20516. openSecretaryView() {
  20517. xGame.uiMgr.Show(UISecretary$1);
  20518. Moyu.sendDataEvent("secretary");
  20519. }
  20520. openShopView() {
  20521. xGame.uiMgr.Show(UIShop$1);
  20522. }
  20523. openSignView() {
  20524. xGame.uiMgr.Show(UISign$1);
  20525. }
  20526. openDrawView() {
  20527. xGame.uiMgr.Show(UIDraw$1);
  20528. }
  20529. openRanking() {
  20530. xGame.uiMgr.Show(UIRanking$1);
  20531. Moyu.sendDataEvent("rankingList");
  20532. }
  20533. }
  20534. UIMain$1.uiName = "UIMain";
  20535. function InitShader() {
  20536. }
  20537. function appInit() {
  20538. xGame.context.init(getLoadingResList(), initCallback);
  20539. }
  20540. function getLoadingResList() {
  20541. return [
  20542. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  20543. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  20544. ];
  20545. }
  20546. function getGameResList() {
  20547. return [
  20548. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  20549. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  20550. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  20551. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  20552. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  20553. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  20554. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  20555. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  20556. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  20557. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  20558. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  20559. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  20560. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  20561. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  20562. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  20563. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  20564. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  20565. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  20566. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  20567. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  20568. ];
  20569. }
  20570. function initCallback() {
  20571. window["DataMgr"] = DataMgr;
  20572. DataMgr.Init();
  20573. Moyu.init(getPlat(), this, () => {
  20574. DataMgr.isNewDay();
  20575. PlatMgr.initConfig();
  20576. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  20577. }, true);
  20578. console.log('zh:开始sm init1 start');
  20579. xGame.soundMgr.init();
  20580. console.log('zh:开始sm init1 end');
  20581. xGame.uiMgr.init();
  20582. xGame.uiMgr.bindFUI(fguiRes.loading);
  20583. xGame.uiMgr.Show(UILoading);
  20584. }
  20585. function loadSubRes(callback) {
  20586. var tab = ["asset", "res", "spine"];
  20587. let subDone = 0;
  20588. for (var i = 0; i < tab.length; i++) {
  20589. let sub = tab[i];
  20590. Moyu.loadSubRes(sub, (pro) => {
  20591. callback && callback(pro, false);
  20592. }).then(() => {
  20593. subDone++;
  20594. if (subDone >= tab.length)
  20595. callback && callback(1, true);
  20596. });
  20597. }
  20598. }
  20599. function enterGame() {
  20600. xGame.cfgMgr.init();
  20601. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  20602. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  20603. xGame.uiMgr.Hide(UILoading);
  20604. fgui.UIPackage.removePackage(fguiRes.loading);
  20605. xGame.uiMgr.bindFUI(fguiRes.game);
  20606. xGame.uiMgr.Show(UIMain$1);
  20607. if (DataMgr.getNewUser())
  20608. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  20609. }
  20610. function getPlat() {
  20611. let cfg = new MoyuCfg();
  20612. cfg.plat = MoyuPlat.web;
  20613. cfg.myId = 120;
  20614. cfg.myKey = '8848a885774230a4';
  20615. cfg.version = 0;
  20616. if (window.hasOwnProperty("gamebox")) {
  20617. cfg.plat = MoyuPlat.f399;
  20618. cfg.version = 0;
  20619. }
  20620. else if (window.hasOwnProperty("ks")) {
  20621. cfg.plat = MoyuPlat.ks;
  20622. cfg.version = 0;
  20623. cfg.ads.ksVideoId = '2300002254_01';
  20624. cfg.ads.ksInsertId = '2300002254_02';
  20625. }
  20626. else if (Laya.Browser.onTTMiniGame) {
  20627. cfg.plat = MoyuPlat.tt;
  20628. cfg.version = 0;
  20629. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  20630. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  20631. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  20632. }
  20633. else if (Laya.Browser.onMiniGame) {
  20634. cfg.plat = MoyuPlat.wx;
  20635. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  20636. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  20637. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  20638. }
  20639. else if (Laya.Browser.onQQMiniGame) {
  20640. cfg.plat = MoyuPlat.qq;
  20641. }
  20642. else if (Laya.Browser.onQGMiniGame) {
  20643. cfg.plat = MoyuPlat.op;
  20644. cfg.ads.opVideoId = '455502';
  20645. cfg.ads.opBannerId = '455507';
  20646. }
  20647. else if (Laya.Browser.onVVMiniGame) {
  20648. cfg.plat = MoyuPlat.vv;
  20649. cfg.version = 0;
  20650. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  20651. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  20652. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  20653. }
  20654. else if (Laya.Browser.onHWMiniGame) {
  20655. cfg.plat = MoyuPlat.hw;
  20656. }
  20657. else if (window["mz"]) {
  20658. cfg.plat = MoyuPlat.mz;
  20659. }
  20660. else {
  20661. let cfg = window['conchConfig'];
  20662. if (cfg) {
  20663. var os = cfg.getOS();
  20664. if (os == "Conch-ios") {
  20665. cfg.plat = MoyuPlat.ios;
  20666. }
  20667. else if (os == "Conch-android") {
  20668. }
  20669. }
  20670. }
  20671. return cfg;
  20672. }
  20673. class Main {
  20674. constructor() {
  20675. if (window["Laya3D"])
  20676. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  20677. else {
  20678. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  20679. this.initMain();
  20680. }
  20681. }
  20682. initMain() {
  20683. Laya["Physics"] && Laya["Physics"].enable();
  20684. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  20685. Laya.stage.scaleMode = GameConfig.scaleMode;
  20686. Laya.stage.screenMode = GameConfig.screenMode;
  20687. Laya.stage.alignV = GameConfig.alignV;
  20688. Laya.stage.alignH = GameConfig.alignH;
  20689. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  20690. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  20691. Laya.enableDebugPanel();
  20692. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  20693. Laya["PhysicsDebugDraw"].enable();
  20694. if (GameConfig.stat)
  20695. Laya.Stat.show();
  20696. Laya.alertGlobalError(true);
  20697. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  20698. }
  20699. onVersionLoaded() {
  20700. appInit();
  20701. }
  20702. }
  20703. new Main();
  20704. }());
  20705. //# sourceMappingURL=bundle.js.map