bundle.js 826 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673
  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 GlobalManager {
  1062. constructor() {
  1063. }
  1064. registerMethod(name, method) {
  1065. console.log('zh: 注册全局方法', name);
  1066. this[name] = method;
  1067. }
  1068. callMethod(name, ...args) {
  1069. console.log('zh: 调用全局方法', name);
  1070. if (this[name]) {
  1071. return this[name](...args);
  1072. }
  1073. else {
  1074. console.error(`zh: 全局方法 Method ${name} not found`);
  1075. }
  1076. }
  1077. }
  1078. GlobalManager.instance = new GlobalManager();
  1079. class JSBridgeUtils {
  1080. constructor() { }
  1081. static get instance() {
  1082. if (!this._instance) {
  1083. this._instance = new JSBridgeUtils();
  1084. }
  1085. return this._instance;
  1086. }
  1087. initBridge() {
  1088. if (!Laya.Browser.onAndroid) {
  1089. console.log('zh:非android dev');
  1090. return;
  1091. }
  1092. let cfg = window['conchConfig'];
  1093. if (cfg) {
  1094. var os = cfg.getOS();
  1095. if (os == "Conch-android") {
  1096. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1097. if (this.bridge) {
  1098. return true;
  1099. }
  1100. else {
  1101. return false;
  1102. }
  1103. }
  1104. else {
  1105. return false;
  1106. }
  1107. }
  1108. else {
  1109. return false;
  1110. }
  1111. }
  1112. testAd1() {
  1113. if (!Laya.Browser.onAndroid) {
  1114. console.log('zh:非android dev');
  1115. return;
  1116. }
  1117. if (!this.initBridge()) {
  1118. return;
  1119. }
  1120. let rs = this.bridge.call("testString", "hello");
  1121. console.log('zh:testString rs=' + rs);
  1122. }
  1123. testAdCallBack() {
  1124. if (!this.initBridge()) {
  1125. return;
  1126. }
  1127. console.log("zh:testAdCallBack start");
  1128. const defaultObj = { code: 200, msg: "req update Ui" };
  1129. const reqObj = { code: 300, msg: "hello java ui" };
  1130. this.bridge.callWithBack((rsStr) => {
  1131. const rsObj = JSON.parse(rsStr);
  1132. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1133. }, "testAsyncCallback", JSON.stringify(reqObj));
  1134. }
  1135. showInternAd(mark) {
  1136. if (!Laya.Browser.onAndroid) {
  1137. console.log('zh:非android dev');
  1138. return false;
  1139. }
  1140. if (!this.initBridge()) {
  1141. return false;
  1142. }
  1143. let rs = this.bridge.call("showInternAd", mark);
  1144. console.log('zh:showInternAd rs= ' + rs + ' ,mark=' + mark);
  1145. try {
  1146. const result = JSON.parse(rs);
  1147. if (result.code === 200) {
  1148. console.log("zh:广告显示成功");
  1149. return true;
  1150. }
  1151. else {
  1152. console.warn("zh:广告显示失败:", result.msg);
  1153. return false;
  1154. }
  1155. }
  1156. catch (e) {
  1157. console.error("zh:解析桥接返回值失败:", e);
  1158. return false;
  1159. }
  1160. }
  1161. showRewardAd(mark) {
  1162. if (!Laya.Browser.onAndroid) {
  1163. console.log('zh:非android dev');
  1164. return false;
  1165. }
  1166. if (!this.initBridge()) {
  1167. return false;
  1168. }
  1169. let rs = this.bridge.call("showRewardAd", mark);
  1170. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1171. try {
  1172. const result = JSON.parse(rs);
  1173. if (result.code === 200) {
  1174. console.log("zh:广告显示成功");
  1175. return true;
  1176. }
  1177. else {
  1178. console.warn("zh:广告显示失败:", result.msg);
  1179. return false;
  1180. }
  1181. }
  1182. catch (e) {
  1183. console.error("zh:解析桥接返回值失败:", e);
  1184. return false;
  1185. }
  1186. }
  1187. nativeCallJs(msg) {
  1188. console.log("zh:nativeCallJs received data: 1111", msg);
  1189. if (msg === 'Ad1') {
  1190. GlobalManager.instance.callMethod('Ad1');
  1191. console.log("zh: Ad1 奖励发送成功");
  1192. }
  1193. else if (msg === 'Ad2') {
  1194. GlobalManager.instance.callMethod('Ad2');
  1195. console.log("zh: Ad2 奖励发送成功");
  1196. }
  1197. else if (msg === 'Ad3') {
  1198. GlobalManager.instance.callMethod('Ad3');
  1199. console.log("zh: Ad3 奖励发送成功");
  1200. }
  1201. else if (msg === 'Ad4') {
  1202. GlobalManager.instance.callMethod('Ad4');
  1203. console.log("zh: Ad4 奖励发送成功");
  1204. }
  1205. else if (msg === 'Ad5') {
  1206. console.log("zh: Ad5 奖励发送成功");
  1207. GlobalManager.instance.callMethod('Ad5');
  1208. }
  1209. }
  1210. }
  1211. class UIBox extends UIBase {
  1212. constructor() {
  1213. super();
  1214. this.boxNum = 0;
  1215. this.boxMax = 10;
  1216. this.inAd = false;
  1217. this.isClose = false;
  1218. }
  1219. onConstructor() {
  1220. this.ui = ui_UIBox.createInstance();
  1221. this.contentPane = this.ui;
  1222. this.isEject = false;
  1223. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1224. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1225. Laya.timer.loop(1000, this, this.update);
  1226. }
  1227. update() {
  1228. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1229. this.boxNum -= 1;
  1230. this.upBar();
  1231. }
  1232. }
  1233. upBar() {
  1234. if (this.boxNum > this.boxMax)
  1235. this.boxNum = this.boxMax;
  1236. this.ui.bar.value = this.boxNum * 10;
  1237. }
  1238. show() {
  1239. super.show();
  1240. this.isClose = false;
  1241. this.boxNum = 0;
  1242. this.inAd = false;
  1243. this.upBar();
  1244. this.ui.t0.play();
  1245. this.ui.closeBtn.visible = false;
  1246. Laya.timer.once(3000, this, () => {
  1247. this.ui.closeBtn.visible = true;
  1248. this.ui.bar.alpha = 1;
  1249. });
  1250. Laya.timer.once(500, this, () => {
  1251. this.ui.t1.play();
  1252. });
  1253. }
  1254. hide() {
  1255. Laya.timer.clearAll(this);
  1256. Moyu.showBannerAd(false);
  1257. super.hide();
  1258. }
  1259. onOpenBox() {
  1260. this.boxNum++;
  1261. if (this.boxNum < this.boxMax) {
  1262. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1263. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1264. }
  1265. else if (this.boxNum == this.boxMax) {
  1266. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1267. this.ui.openBtn.c1.selectedIndex = 13;
  1268. this.inAd = true;
  1269. }
  1270. else
  1271. this.getAward();
  1272. }
  1273. else if (this.inAd) {
  1274. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1275. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1276. }
  1277. else {
  1278. console.log('zh:AD 失败,直接发放奖励');
  1279. this.qjff_AD_for_UIBOX_onOpenBox();
  1280. }
  1281. }
  1282. this.upBar();
  1283. }
  1284. qjff_AD_for_UIBOX_onOpenBox() {
  1285. this.getAward();
  1286. }
  1287. onCloseBox() {
  1288. if (this.isClose)
  1289. this.hide();
  1290. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1291. this.isClose = true;
  1292. PlatMgr.showBanner(true, 0, 3000);
  1293. }
  1294. else
  1295. this.hide();
  1296. }
  1297. getAward() {
  1298. let str = "";
  1299. if (Math.random() < 0.5) {
  1300. let max = Moyu.isLegal ? 500 : 2500;
  1301. let num = xGame.tools.random(max, 500 + max);
  1302. DataMgr.setCoin(num);
  1303. str = "金币x" + num;
  1304. }
  1305. else {
  1306. let max = Moyu.isLegal ? 10 : 30;
  1307. let num = xGame.tools.random(max, 30 + max);
  1308. DataMgr.setDiamond(num);
  1309. str = "钻石x" + num;
  1310. }
  1311. xGame.showTip("恭喜获得-" + str);
  1312. this.hide();
  1313. }
  1314. }
  1315. UIBox.uiName = "UIBox";
  1316. class ui_UITry extends fgui.GComponent {
  1317. static createInstance() {
  1318. return (fgui.UIPackage.createObject("game", "UITry"));
  1319. }
  1320. onConstruct() {
  1321. this.n11 = (this.getChild("n11"));
  1322. this.myNode = (this.getChild("myNode"));
  1323. this.t0 = this.getTransition("t0");
  1324. }
  1325. }
  1326. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1327. class UITry extends UIBase {
  1328. constructor() {
  1329. super();
  1330. this.closeTime = 0;
  1331. this.closeNum = 0;
  1332. this.skillUrl = xGame.common.skillIconList;
  1333. }
  1334. onConstructor() {
  1335. this.ui = ui_UITry.createInstance();
  1336. this.contentPane = this.ui;
  1337. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1338. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1339. }
  1340. show() {
  1341. super.show();
  1342. this.closeNum = 0;
  1343. this.closeTime = 15;
  1344. this.ui.t0.play();
  1345. PlatMgr.showRateBanner();
  1346. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1347. Laya.timer.loop(1000, this, this.updateTime);
  1348. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1349. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1350. xGame.common.gameMgr.gamePause = true;
  1351. }
  1352. updateTime() {
  1353. if (this.closeTime > 1) {
  1354. this.closeTime--;
  1355. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1356. }
  1357. else
  1358. this.hide();
  1359. }
  1360. hide() {
  1361. Laya.timer.clearAll(this);
  1362. Moyu.showBannerAd(false);
  1363. super.hide();
  1364. xGame.common.gameMgr.gamePause = false;
  1365. }
  1366. onTry() {
  1367. console.log('zh:qjff_AD_for_uitry');
  1368. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1369. }
  1370. else {
  1371. console.log('zh:AD 失败,直接发放奖励');
  1372. this.qjff_AD_for_uitry();
  1373. }
  1374. }
  1375. qjff_AD_for_uitry() {
  1376. let select = xGame.common.curPlayerSkillType;
  1377. DataMgr.gameData.trySkill = select;
  1378. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1379. DataMgr.saveGameData();
  1380. DataMgr.setBigSkill(select, 1);
  1381. xGame.showTip("Trial Successful");
  1382. this.hide();
  1383. }
  1384. onCancel() {
  1385. if (this.closeNum > 0) {
  1386. this.closeNum--;
  1387. if (this.closeNum < 2)
  1388. this.hide();
  1389. return;
  1390. }
  1391. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1392. this.onTry();
  1393. }
  1394. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1395. this.closeNum = 3;
  1396. }
  1397. else
  1398. this.hide();
  1399. }
  1400. }
  1401. UITry.uiName = "UITry";
  1402. class PlatMgr {
  1403. static initConfig() {
  1404. this.lastVt = 0;
  1405. if (!Moyu.platConfig)
  1406. return;
  1407. for (let k in Moyu.platConfig) {
  1408. let pd = this[k];
  1409. let pc = Moyu.platConfig[k];
  1410. if (pd != undefined && pc != undefined)
  1411. this[k] = pc;
  1412. }
  1413. Moyu.setBannerPos(0.5, 1);
  1414. }
  1415. static rand100(num) {
  1416. return xGame.tools.random(0, 100) < num;
  1417. }
  1418. static isMisVideo() {
  1419. let dt = Laya.timer.currTimer - this.lastVt;
  1420. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1421. this.lastVt = Laya.timer.currTimer;
  1422. return true;
  1423. }
  1424. else {
  1425. if (this.rand100(this.fullVideoRate))
  1426. Moyu.showInsertAd(0, 0, 'full');
  1427. return false;
  1428. }
  1429. }
  1430. static showVideo(call, type) {
  1431. Moyu.showVideoAd(() => {
  1432. this.lastVt = Laya.timer.currTimer;
  1433. call && call();
  1434. }, type);
  1435. }
  1436. static showInsert(delay = false) {
  1437. if (this.getRand() < this.insertRate) {
  1438. let dt = delay ? this.insertDelay : 0;
  1439. Moyu.showInsertAd(dt, this.insertGap);
  1440. }
  1441. }
  1442. static gameInsert() {
  1443. if (this.getRand() < this.gameInsertRate) {
  1444. console.log('zh: 游戏中插屏 hhhhhhhhhhhhhhhhhh');
  1445. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1446. }
  1447. }
  1448. static showRateBanner() {
  1449. if (this.getRand() < this.bannerRate)
  1450. this.showBanner(true, this.bannerDelay, 3000);
  1451. }
  1452. static showBanner(show, delay = 0, hide = 0) {
  1453. if (!show)
  1454. Moyu.showBannerAd(false);
  1455. else {
  1456. Laya.timer.clear(this, this.bannerShow);
  1457. if (delay > 0)
  1458. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1459. else
  1460. this.bannerShow(true);
  1461. if (hide > 0)
  1462. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1463. }
  1464. }
  1465. static bannerShow(show) {
  1466. Moyu.showBannerAd(show);
  1467. console.log("showBanner" + show);
  1468. }
  1469. static getRand() {
  1470. return xGame.tools.random(0, 100);
  1471. }
  1472. static openBox() {
  1473. if (this.getRand() < this.boxRate)
  1474. xGame.uiMgr.Show(UIBox);
  1475. }
  1476. static openTry() {
  1477. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1478. return;
  1479. if (this.getRand() < this.tryRate)
  1480. xGame.uiMgr.Show(UITry);
  1481. else if (DataMgr.gameData.gameCount == 1)
  1482. xGame.uiMgr.Show(UITry);
  1483. }
  1484. }
  1485. PlatMgr.forceShare = 0;
  1486. PlatMgr.signAdRate = 0;
  1487. PlatMgr.forceVideoRate = 0;
  1488. PlatMgr.forceVideoGap = 0;
  1489. PlatMgr.fullVideoRate = 0;
  1490. PlatMgr.gameInsertRate = 0;
  1491. PlatMgr.insertGap = 0;
  1492. PlatMgr.insertDelay = 0;
  1493. PlatMgr.insertRate = 0;
  1494. PlatMgr.boxRate = 0;
  1495. PlatMgr.boxVideoRate = 0;
  1496. PlatMgr.boxInsertRate = 0;
  1497. PlatMgr.boxBannerRate = 0;
  1498. PlatMgr.tryRate = 0;
  1499. PlatMgr.tryClose3Rate = 0;
  1500. PlatMgr.tryVideoRate = 0;
  1501. PlatMgr.bannerRate = 0;
  1502. PlatMgr.lastVt = 0;
  1503. class ui_UIAddProp extends fgui.GComponent {
  1504. static createInstance() {
  1505. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1506. }
  1507. onConstruct() {
  1508. this.n11 = (this.getChild("n11"));
  1509. this.myNode = (this.getChild("myNode"));
  1510. this.closeBtn = (this.getChild("closeBtn"));
  1511. this.t0 = this.getTransition("t0");
  1512. }
  1513. }
  1514. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1515. class SpineMgr {
  1516. constructor(name, loadCb = null) {
  1517. this.loaded = false;
  1518. this.spineName = '';
  1519. this.loadedCallback = loadCb;
  1520. this.templet = new Laya.Templet();
  1521. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1522. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1523. if (name === 'mishu') {
  1524. this.templet.loadAni('spine/nvmishu.sk');
  1525. }
  1526. else {
  1527. this.templet.loadAni(`spine/${name}.sk`);
  1528. }
  1529. this.templet.lock = true;
  1530. this.spineName = name;
  1531. }
  1532. onError() {
  1533. console.log("zh:spine加载出错");
  1534. }
  1535. parseComplete() {
  1536. this.loaded = true;
  1537. this.loadedCallback && this.loadedCallback();
  1538. }
  1539. dispose() {
  1540. if (this.templet && !this.templet.destroyed) {
  1541. this.templet.destroy();
  1542. }
  1543. this.templet = null;
  1544. }
  1545. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1546. if (!this.loaded) {
  1547. return;
  1548. }
  1549. let spine;
  1550. if (mySpine) {
  1551. spine = mySpine;
  1552. }
  1553. else {
  1554. spine = this.createSpine(data, parent);
  1555. }
  1556. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1557. if (!isLoop) {
  1558. spine.on(Laya.Event.STOPPED, this, () => {
  1559. spine.offAll(Laya.Event.STOPPED);
  1560. callback && callback(spine);
  1561. });
  1562. }
  1563. return spine;
  1564. }
  1565. createSpine(data, parent, type = 1) {
  1566. let spine;
  1567. spine = this.templet.buildArmature(type);
  1568. spine.showSkinByIndex(0);
  1569. parent.addChild(spine);
  1570. spine.pos(data.x, data.y);
  1571. spine.scale(data.scaleX, data.scaleY, true);
  1572. return spine;
  1573. }
  1574. }
  1575. var AIState;
  1576. (function (AIState) {
  1577. AIState[AIState["none"] = 0] = "none";
  1578. AIState[AIState["idle"] = 1] = "idle";
  1579. AIState[AIState["reset"] = 2] = "reset";
  1580. AIState[AIState["move"] = 3] = "move";
  1581. AIState[AIState["wait"] = 4] = "wait";
  1582. AIState[AIState["select"] = 5] = "select";
  1583. AIState[AIState["turn"] = 6] = "turn";
  1584. AIState[AIState["shoot"] = 7] = "shoot";
  1585. AIState[AIState["leave"] = 8] = "leave";
  1586. })(AIState || (AIState = {}));
  1587. class AIPlayer {
  1588. constructor() {
  1589. this.dtime = 30;
  1590. this.awayTime = 0;
  1591. this.awayNum = 0;
  1592. this.hideTime = 0;
  1593. this.rootMoveTime = 0;
  1594. this.isGuide = false;
  1595. this.state = AIState.none;
  1596. this.waitTime = 0;
  1597. this.forceNum = 0;
  1598. this.forceMax = 0;
  1599. this.ballSize = 33;
  1600. this.selectNum = 0;
  1601. this.destRot = 0;
  1602. this.aiLv = 10;
  1603. this.kickBall = [];
  1604. this.lineBall = [];
  1605. this.scoreBall = [];
  1606. this.holeBall = [];
  1607. this.turnNum = 0;
  1608. this.setNum = 0;
  1609. this.setMax = 0;
  1610. this.setRate = 0;
  1611. this.rectL = 0;
  1612. this.rectR = 0;
  1613. this.rectT = 0;
  1614. this.rectB = 0;
  1615. this.rootPos = { x: 0, y: 0 };
  1616. this.bestForce = 0;
  1617. this.bestAngle = 180;
  1618. this.bestPos = { x: 0, y: 0 };
  1619. this.bestKick = { x: 0, y: 0 };
  1620. this.posList = [];
  1621. this.posIdx = 0;
  1622. this.chatTime = 3000;
  1623. this.tempDir1 = new Laya.Vector2();
  1624. this.tempDir2 = new Laya.Vector2();
  1625. this.tempDir3 = new Laya.Vector2();
  1626. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1627. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1628. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1629. this.gameSrc = xGame.common.gameUI;
  1630. this.hideTime = Laya.timer.currTimer;
  1631. Moyu.setOnTipCall((id) => {
  1632. if (id == 20012)
  1633. this.hideTime = Laya.timer.currTimer;
  1634. else
  1635. (id == 20011);
  1636. {
  1637. let dt = Laya.timer.currTimer - this.hideTime;
  1638. console.log("onshow" + dt);
  1639. if (dt > 30000 && this.state > AIState.none)
  1640. xGame.common.gameMgr.aiGameEnd(false);
  1641. }
  1642. }, this);
  1643. }
  1644. init() {
  1645. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1646. this.awayTime = xGame.tools.random(5000, 10000);
  1647. this.awayNum = 0;
  1648. this.hideTime = Laya.timer.currTimer;
  1649. let rect = xGame.common.d2World.borderRect;
  1650. this.rectL = Math.ceil(rect.x) + 17;
  1651. this.rectT = Math.ceil(rect.y) + 17;
  1652. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1653. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1654. this.wBall = xGame.common.d2World.rootBall;
  1655. this.ballSize = this.wBall.gameObj.width - 1;
  1656. if (this.posList.length < 1) {
  1657. let dp = 40;
  1658. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1659. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1660. let dx = i < this.rectR ? i : this.rectR;
  1661. let dy = j < this.rectB ? j : this.rectB;
  1662. let order = xGame.tools.random(0, 1000);
  1663. this.posList.push({ x: dx, y: dy, order: order });
  1664. }
  1665. }
  1666. this.posList.sort(function (a, b) {
  1667. return a.order - b.order;
  1668. });
  1669. this.setMax = this.posList.length;
  1670. }
  1671. this.state = AIState.idle;
  1672. }
  1673. setAiLevel(num) {
  1674. this.aiLv = num;
  1675. }
  1676. initBall() {
  1677. this.rootPos.x = this.wBall.gameObj.x;
  1678. this.rootPos.y = this.wBall.gameObj.y;
  1679. this.initHoleBall();
  1680. }
  1681. initHoleBall() {
  1682. this.kickBall = [];
  1683. this.lineBall = [];
  1684. this.scoreBall = [];
  1685. this.holeBall = [];
  1686. this.selectNum = 0;
  1687. this.forceNum = 0;
  1688. this.forceMax = 0;
  1689. this.turnNum = 0;
  1690. let list = xGame.common.d2World.ballArr;
  1691. if (list.length < 20 && !this.isGuide) {
  1692. let holes = xGame.common.gameMgr.holePosList;
  1693. for (let i = 0; i < list.length; i++) {
  1694. let obj = list[i];
  1695. if (!obj)
  1696. continue;
  1697. obj.kickPos.x = 0;
  1698. obj.kickPos.y = 0;
  1699. obj.poleAngle = 0;
  1700. obj.hard = 0;
  1701. obj.borderDis = 0;
  1702. obj.kickAngle = 180;
  1703. if (obj.number == 0)
  1704. continue;
  1705. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1706. continue;
  1707. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1708. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1709. continue;
  1710. }
  1711. let b = obj.gameObj;
  1712. let wbp = this.rootPos;
  1713. let bx = wbp.x - b.x;
  1714. let by = wbp.y - b.y;
  1715. obj.borderDis = xGame.tools.random(0, 100);
  1716. this.kickBall.push(obj);
  1717. if (!this.isLine(wbp, obj))
  1718. continue;
  1719. obj.kickAngle = xGame.tools.random(90, 180);
  1720. obj.kickPos.x = b.x;
  1721. obj.kickPos.y = b.y;
  1722. this.lineBall.push(obj);
  1723. let minDis = 999999;
  1724. let hole = false;
  1725. for (let j = 0; j < holes.length; j++) {
  1726. let hp = holes[j];
  1727. if (bx >= 0 && hp.x > b.x + 100)
  1728. continue;
  1729. if (bx <= 0 && hp.x < b.x - 100)
  1730. continue;
  1731. if (by < -10 && hp.y < wbp.y)
  1732. continue;
  1733. if (by > 10 && hp.y > wbp.y)
  1734. continue;
  1735. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1736. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1737. if (dis < minDis) {
  1738. let dx = b.x - this.tempDir1.x * this.ballSize;
  1739. let dy = b.y - this.tempDir1.y * this.ballSize;
  1740. this.tempDir3.x = this.tempDir1.x;
  1741. this.tempDir3.y = this.tempDir1.y;
  1742. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1743. obj.kickPos.x = dx;
  1744. obj.kickPos.y = dy;
  1745. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1746. if (num > 1)
  1747. num = 1;
  1748. obj.kickAngle = Math.acos(num) * 57.3;
  1749. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1750. dis = dis * 2;
  1751. if (Math.abs(hp.x - 600) < 100)
  1752. dis += 50;
  1753. obj.hard = dis + obj.kickAngle * 3;
  1754. hole = true;
  1755. }
  1756. }
  1757. }
  1758. }
  1759. if (hole) {
  1760. this.scoreBall.push(obj);
  1761. this.holeBall.push(obj);
  1762. }
  1763. }
  1764. this.scoreBall.sort(function (a, b) {
  1765. return a.hard - b.hard;
  1766. });
  1767. this.holeBall.sort(function (a, b) {
  1768. return a.kickAngle - b.kickAngle;
  1769. });
  1770. this.kickBall.sort(function (a, b) {
  1771. return a.borderDis - b.borderDis;
  1772. });
  1773. }
  1774. else {
  1775. let max = list.length - 1;
  1776. let i = xGame.tools.random(0, max);
  1777. for (i; i <= max; i++) {
  1778. let idx = i >= max ? i -= max : i;
  1779. let obj = list[idx];
  1780. if (obj && obj.number != 0) {
  1781. obj.kickAngle = xGame.tools.random(90, 180);
  1782. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1783. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1784. this.lineBall.push(obj);
  1785. break;
  1786. }
  1787. }
  1788. }
  1789. }
  1790. selectBall() {
  1791. let ball = null;
  1792. this.destRot = 0;
  1793. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1794. let ai = 110 - this.aiLv * 10;
  1795. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1796. let score = false;
  1797. if (this.scoreBall.length < 1) {
  1798. if (this.lineBall.length < 1) {
  1799. for (let i = 0; i < this.kickBall.length; i++) {
  1800. let list = [];
  1801. let bo = this.kickBall[i];
  1802. let bobj = bo.gameObj;
  1803. let rect = xGame.common.d2World.borderRect;
  1804. let mobj = this.wBall.gameObj;
  1805. let minb = bobj.y - rect.y - 20;
  1806. let minw = mobj.y - rect.y - 50;
  1807. if (minb > 0 && minw > 0) {
  1808. let dlenx = 0;
  1809. let dleny = mobj.y - rect.y;
  1810. let spx = mobj.x;
  1811. let spy = rect.y - dleny;
  1812. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1813. }
  1814. minb = rect.y + rect.height - bobj.y - 20;
  1815. minw = rect.y + rect.height - mobj.y - 50;
  1816. if (minb > 0 && minw > 0) {
  1817. let dlenx = 0;
  1818. let dleny = rect.y + rect.height - mobj.y;
  1819. let spx = mobj.x;
  1820. let spy = rect.y + rect.height + dleny;
  1821. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1822. }
  1823. minb = bobj.x - rect.x - 20;
  1824. minw = mobj.x - rect.x - 50;
  1825. if (minb > 0 && minw > 0) {
  1826. let dlenx = mobj.x - rect.x;
  1827. let dleny = 0;
  1828. let spx = rect.x - dlenx;
  1829. let spy = mobj.y;
  1830. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1831. }
  1832. minb = rect.x + rect.width - bobj.x - 20;
  1833. minw = rect.x + rect.width - mobj.x - 50;
  1834. if (minb > 0 && minw > 0) {
  1835. let dlenx = rect.x + rect.width - mobj.x;
  1836. let dleny = 0;
  1837. let spx = rect.x + rect.width + dlenx;
  1838. let spy = mobj.y;
  1839. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1840. }
  1841. list.sort(function (a, b) {
  1842. return a.order - b.order;
  1843. });
  1844. for (let i = 0; i < list.length; i++) {
  1845. let data = list[i];
  1846. let mx = mobj.x - bobj.x;
  1847. let my = mobj.y - bobj.y;
  1848. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1849. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1850. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1851. if (num > 1)
  1852. num = 1;
  1853. let cos = Math.acos(num);
  1854. if (cos > 1.57)
  1855. cos = 1.57;
  1856. else if (cos < 0.01)
  1857. cos = 0.01;
  1858. let tan = Math.tan(cos);
  1859. let dx = tan * data.dleny;
  1860. let dy = tan * data.dlenx;
  1861. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1862. if (Math.abs(bx - 667) < 40)
  1863. continue;
  1864. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1865. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1866. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1867. this.forceMax = dis * 0.08;
  1868. this.destRot += mis * 0.1;
  1869. this.setKick(bx, by);
  1870. return true;
  1871. }
  1872. }
  1873. }
  1874. }
  1875. else {
  1876. ball = xGame.common.getRandArrEle(this.lineBall);
  1877. }
  1878. }
  1879. else {
  1880. for (let i = 0; i < this.scoreBall.length; i++) {
  1881. if (i < this.scoreBall.length - 1) {
  1882. let rand = 70 + this.aiLv * 10 + i * 10;
  1883. if (xGame.tools.random(0, 100) < rand) {
  1884. ball = this.scoreBall[i];
  1885. break;
  1886. }
  1887. }
  1888. else {
  1889. ball = this.scoreBall[i];
  1890. break;
  1891. }
  1892. }
  1893. score = true;
  1894. this.selectNum++;
  1895. }
  1896. if (!ball)
  1897. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1898. if (this.selectNum >= max) {
  1899. let dx = ball.gameObj.x;
  1900. let dy = ball.gameObj.y;
  1901. let kickAngle = 0;
  1902. if (score) {
  1903. dx = ball.kickPos.x;
  1904. dy = ball.kickPos.y;
  1905. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1906. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1907. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1908. if (adot > 1)
  1909. adot = 1;
  1910. kickAngle = Math.acos(adot) * 57.3;
  1911. if (kickAngle > 45) {
  1912. let kdx = ball.kickPos.x - ball.gameObj.x;
  1913. let kdy = ball.kickPos.y - ball.gameObj.y;
  1914. dx = ball.kickPos.x - kdx * mis * 0.3;
  1915. dy = ball.kickPos.y - kdy * mis * 0.3;
  1916. }
  1917. else
  1918. this.destRot += mis;
  1919. }
  1920. else if (ball.poleAngle != 0) {
  1921. this.destRot += ball.poleAngle;
  1922. }
  1923. if (xGame.common.gameMode == 0) {
  1924. let af = kickAngle * 0.08;
  1925. this.forceMax = ball.hard * 0.1 + af * af;
  1926. }
  1927. this.setKick(dx, dy);
  1928. }
  1929. else {
  1930. let rand = this.aiLv * 5 + 40;
  1931. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1932. ball = xGame.common.getRandArrEle(this.scoreBall);
  1933. else
  1934. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1935. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1936. if (xGame.tools.random(0, 100) > rand) {
  1937. this.selectNum = max;
  1938. }
  1939. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1940. this.selectNum++;
  1941. }
  1942. ball.onClick(0, true);
  1943. }
  1944. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1945. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1946. let balls = xGame.common.d2World.ballArr;
  1947. let max = xGame.tools.getDis(hx, hy, bx, by);
  1948. for (let index = 0; index < balls.length; index++) {
  1949. let obj = balls[index];
  1950. if (obj.number == 0)
  1951. continue;
  1952. if (obj.number == bn || obj.number == dn)
  1953. continue;
  1954. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1955. if (dis * dis > max)
  1956. continue;
  1957. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1958. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1959. if (num > 1)
  1960. num = 1;
  1961. if (num < 0)
  1962. continue;
  1963. let gap = Math.sin(Math.acos(num)) * dis;
  1964. if (gap < this.ballSize)
  1965. return true;
  1966. }
  1967. return false;
  1968. }
  1969. isLine(xy, ball) {
  1970. let bx = xy.x;
  1971. let by = xy.y;
  1972. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1973. let dis = ball.getDestDis(xy);
  1974. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1975. let sin = Math.sin(angle);
  1976. let cos = Math.cos(angle);
  1977. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1978. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1979. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1980. let dx = bx + this.tempDir2.x * dis;
  1981. let dy = by + this.tempDir2.y * dis;
  1982. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1983. sin = Math.sin(-angle);
  1984. cos = Math.cos(-angle);
  1985. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1986. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1987. dx = bx + this.tempDir2.x * dis;
  1988. dy = by + this.tempDir2.y * dis;
  1989. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1990. if (isr && isl)
  1991. return false;
  1992. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1993. }
  1994. return true;
  1995. }
  1996. turnPole() {
  1997. this.turnNum++;
  1998. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1999. let dr = rot - this.destRot;
  2000. let abs = Math.abs(dr) % 360;
  2001. if (abs > 180) {
  2002. if (rot > 180)
  2003. rot -= 360;
  2004. if (this.destRot > 180)
  2005. this.destRot -= 360;
  2006. }
  2007. let max = this.turnNum * 5 + this.aiLv * 5;
  2008. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2009. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2010. let at = xGame.tools.random(1000, 2000);
  2011. if (!this.onAway(3))
  2012. at += xGame.tools.random(10000, 15000);
  2013. this.setState(AIState.shoot, at);
  2014. }
  2015. else {
  2016. let mr = 0;
  2017. if (abs > 3)
  2018. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2019. else if (Math.random() > 0.6)
  2020. mr = xGame.tools.random(1, 10) * 0.1;
  2021. mr = dr > 0 ? -mr : mr;
  2022. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2023. }
  2024. }
  2025. setKick(dx, dy) {
  2026. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2027. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2028. this.tempDir1.x = 0;
  2029. this.tempDir1.y = 1;
  2030. this.tempDir2.y = -this.tempDir2.y;
  2031. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2032. if (num > 1)
  2033. num = 1;
  2034. let rot = Math.acos(num) * 57.3;
  2035. if (this.tempDir2.x < 0)
  2036. rot = 360 - rot;
  2037. this.destRot += rot;
  2038. if (!xGame.common.gameMgr.finishOneShoot) {
  2039. this.forceMax += xGame.tools.random(10, 50);
  2040. this.forceMax -= this.aiLv * 2;
  2041. if (this.forceMax < 20)
  2042. this.forceMax = 20;
  2043. }
  2044. if (this.forceMax > 100)
  2045. this.forceMax = 101;
  2046. else if (this.forceMax < 10)
  2047. this.forceMax += xGame.tools.random(0, 10);
  2048. if (xGame.common.gameMode == 1)
  2049. this.forceMax = xGame.tools.random(80, 100);
  2050. else
  2051. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2052. let max = 2000 - this.aiLv * 100;
  2053. if (Math.random() > 0.8)
  2054. max += xGame.tools.random(100, 2000);
  2055. this.setState(AIState.turn, xGame.tools.random(500, max));
  2056. }
  2057. shoot() {
  2058. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2059. if (Math.random() > 0.8) {
  2060. this.gameSrc.aiForce(1);
  2061. this.setState(AIState.wait);
  2062. }
  2063. }
  2064. else {
  2065. let df = xGame.tools.random(3, 8);
  2066. if (this.forceNum < this.forceMax)
  2067. this.forceNum += df;
  2068. else
  2069. this.forceNum -= df;
  2070. let startY = this.gameSrc.ui.powerNode.y;
  2071. let height = this.gameSrc.ui.powerNode.height;
  2072. let force = startY + height * this.forceNum * 0.01;
  2073. this.gameSrc.aiForce(2, force);
  2074. }
  2075. }
  2076. reset() {
  2077. for (let i = 0; i < 4; i++) {
  2078. this.setRate--;
  2079. this.setNum++;
  2080. let pos = this.posList[this.posIdx];
  2081. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2082. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2083. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2084. this.rootPos.x = 387;
  2085. if (this.rootPos.x < this.rectL)
  2086. this.rootPos.x = this.rectL;
  2087. else if (this.rootPos.x > this.rectR)
  2088. this.rootPos.x = this.rectR;
  2089. if (this.rootPos.y < this.rectT)
  2090. this.rootPos.y = this.rectT;
  2091. else if (this.rootPos.y > this.rectB)
  2092. this.rootPos.y = this.rectB;
  2093. this.posIdx++;
  2094. let max = this.posList.length;
  2095. if (this.posIdx >= max)
  2096. this.posIdx -= max;
  2097. this.initHoleBall();
  2098. let ball = null;
  2099. if (this.scoreBall.length > 0)
  2100. ball = this.scoreBall[0];
  2101. else if (this.lineBall.length > 0)
  2102. ball = xGame.common.getRandArrEle(this.lineBall);
  2103. if (ball && ball.kickAngle < this.bestAngle) {
  2104. this.bestAngle = ball.kickAngle;
  2105. this.bestKick.x = ball.kickPos.x;
  2106. this.bestKick.y = ball.kickPos.y;
  2107. this.bestPos.x = this.rootPos.x;
  2108. this.bestPos.y = this.rootPos.y;
  2109. this.bestForce = ball.hard * 0.08;
  2110. }
  2111. }
  2112. if (this.setNum >= this.setMax)
  2113. this.setMax = 0;
  2114. if (this.setRate < 1) {
  2115. this.setState(AIState.move, 0);
  2116. this.rootMoveTime = Laya.timer.currTimer;
  2117. this.gameSrc.aiRootMove(true);
  2118. }
  2119. }
  2120. delayLine() {
  2121. this.gameSrc.aiRootMove(false);
  2122. }
  2123. move() {
  2124. if (this.bestPos.x < 1)
  2125. this.bestPos = this.rootPos;
  2126. let wObj = this.wBall.gameObj;
  2127. let destx = wObj.x;
  2128. let desty = wObj.y;
  2129. let dx = Math.abs(destx - this.bestPos.x);
  2130. let dy = Math.abs(desty - this.bestPos.y);
  2131. let mx = 3 + dx * 0.03;
  2132. let my = 3 + dy * 0.03;
  2133. if (dx < 4 && dy < 4) {
  2134. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2135. dt = dt < 1000 ? 1000 - dt : 0;
  2136. if (this.setMax > 0) {
  2137. let min = this.setMax * 0.3 + this.aiLv * 5;
  2138. this.setRate = xGame.tools.random(min, this.setMax);
  2139. this.setState(AIState.reset, 0);
  2140. }
  2141. else {
  2142. this.destRot = 0;
  2143. this.forceMax = this.bestForce;
  2144. this.setKick(this.bestKick.x, this.bestKick.y);
  2145. }
  2146. if (dt > 100) {
  2147. Laya.timer.clear(this, this.delayLine);
  2148. Laya.timer.once(dt, this, this.delayLine);
  2149. }
  2150. else
  2151. this.gameSrc.aiRootMove(false);
  2152. }
  2153. else {
  2154. if (dx > 4)
  2155. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2156. if (dy > 4)
  2157. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2158. this.gameSrc.onRootMove({ x: destx, y: desty });
  2159. }
  2160. }
  2161. resetRoot() {
  2162. this.bestAngle = 180;
  2163. this.bestForce = 0;
  2164. this.setMax = this.posList.length;
  2165. this.posIdx = xGame.tools.random(0, this.setMax);
  2166. let min = this.setMax * 0.3 + this.aiLv * 5;
  2167. this.setRate = xGame.tools.random(min, this.setMax);
  2168. let max = 2000 - this.aiLv * 100;
  2169. if (Math.random() > 0.8)
  2170. max += xGame.tools.random(100, 1000);
  2171. if (this.isGuide)
  2172. this.setState(AIState.select, 500);
  2173. else if (this.onAway(2))
  2174. this.setState(AIState.reset, xGame.tools.random(400, max));
  2175. else
  2176. this.setState(AIState.none);
  2177. if (xGame.common.gameMgr.finishOneShoot)
  2178. this.chat();
  2179. }
  2180. runAI() {
  2181. if (this.state > AIState.idle)
  2182. return;
  2183. this.initBall();
  2184. this.onGame(2500);
  2185. if (Math.random() > 0.6)
  2186. this.chat();
  2187. }
  2188. stopRun() {
  2189. this.setState(AIState.idle);
  2190. }
  2191. onGame(base) {
  2192. let max = base - this.aiLv * 100;
  2193. if (Math.random() > 0.8)
  2194. max += xGame.tools.random(100, 1000);
  2195. if (this.onAway(2))
  2196. this.setState(AIState.select, xGame.tools.random(500, max));
  2197. else
  2198. this.setState(AIState.none);
  2199. }
  2200. setState(sta, wt = 0) {
  2201. if (this.state == AIState.none)
  2202. return;
  2203. this.state = sta;
  2204. this.waitTime = wt;
  2205. }
  2206. onUpdate() {
  2207. if (this.state == AIState.none)
  2208. return;
  2209. this.awayTime -= this.dtime;
  2210. if (this.awayTime < 1) {
  2211. this.awayTime = xGame.tools.random(6000, 10000);
  2212. this.awayNum += (11 - this.aiLv);
  2213. this.onAway(1);
  2214. }
  2215. if (this.waitTime >= 0) {
  2216. this.waitTime -= this.dtime;
  2217. return;
  2218. }
  2219. switch (this.state) {
  2220. case AIState.idle:
  2221. this.chat();
  2222. break;
  2223. case AIState.reset:
  2224. this.reset();
  2225. break;
  2226. case AIState.move:
  2227. this.move();
  2228. break;
  2229. case AIState.leave:
  2230. this.state = AIState.none;
  2231. xGame.common.gameMgr.aiGameEnd(true);
  2232. break;
  2233. case AIState.select:
  2234. this.selectBall();
  2235. break;
  2236. case AIState.turn:
  2237. this.turnPole();
  2238. break;
  2239. case AIState.shoot:
  2240. this.shoot();
  2241. break;
  2242. }
  2243. }
  2244. onAway(type) {
  2245. if (type == 1) {
  2246. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2247. let num = this.awayNum + db * 20;
  2248. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2249. xGame.common.gameMgr.aiLeave();
  2250. this.setState(AIState.leave, 6666);
  2251. }
  2252. }
  2253. else if (type == 2) {
  2254. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2255. let num = this.awayNum + db * 30;
  2256. if (xGame.tools.random(0, 10000) < num)
  2257. return false;
  2258. }
  2259. else if (type == 3) {
  2260. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2261. let num = this.awayNum + db * 10;
  2262. if (xGame.tools.random(0, 4000) < num)
  2263. return false;
  2264. }
  2265. return true;
  2266. }
  2267. chat() {
  2268. if (this.chatTime > 0) {
  2269. this.chatTime -= this.dtime;
  2270. return;
  2271. }
  2272. this.chatTime = xGame.tools.random(2000, 10000);
  2273. let rand = xGame.tools.random(0, 100);
  2274. if (rand < 15)
  2275. this.talk();
  2276. else if (rand < 35)
  2277. this.emotion();
  2278. }
  2279. talk() {
  2280. xGame.common.talkMgr.showAITalk(0);
  2281. }
  2282. emotion() {
  2283. xGame.common.talkMgr.showAIEmotion(0);
  2284. }
  2285. resetAI() {
  2286. this.stopRun();
  2287. this.state = AIState.none;
  2288. }
  2289. }
  2290. class Partical extends Laya.Script3D {
  2291. constructor() {
  2292. super();
  2293. this.duration = 2000;
  2294. }
  2295. ;
  2296. onAwake() {
  2297. this.gameObj = this.owner;
  2298. }
  2299. onEnable() {
  2300. this.openTimer();
  2301. }
  2302. openTimer() {
  2303. Laya.timer.once(this.duration, this, this.disappear);
  2304. }
  2305. setCallback(obj, callback) {
  2306. this.obj = obj;
  2307. this.callback = callback;
  2308. Laya.timer.clearAll(this);
  2309. Laya.timer.once(this.duration, this, this.disappear);
  2310. }
  2311. disappear() {
  2312. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2313. this.callback && this.callback(this.obj);
  2314. }
  2315. }
  2316. class Ball extends Laya.Script3D {
  2317. constructor() {
  2318. super();
  2319. this.posV3 = new Laya.Vector3();
  2320. this.rotRate = 2.1;
  2321. this.rotSpeed = new Laya.Vector3();
  2322. this.myIndex = 0;
  2323. }
  2324. onAwake() {
  2325. this.gameObj = this.owner;
  2326. this.transform = this.gameObj.transform;
  2327. this.ballNode = this.gameObj.getChildByName("Ball");
  2328. this.shadowNode = this.gameObj.getChildByName("shadow");
  2329. }
  2330. initSelf(index, x, y, owner) {
  2331. this.d2BallSrc = owner;
  2332. this.myIndex = index;
  2333. this.setAlbedoTexture();
  2334. this.setTransPos(x, y);
  2335. this.setScale();
  2336. this.ballNode.transform.localRotationEulerX = 90;
  2337. if (index == 0) {
  2338. }
  2339. }
  2340. setAlbedoTexture(isIce = false) {
  2341. let url;
  2342. if (isIce) {
  2343. url = `res/d3Res/ballTexture/ice.jpg`;
  2344. }
  2345. else {
  2346. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2347. }
  2348. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2349. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2350. }));
  2351. }
  2352. runFireworks(obj, delay, callback) {
  2353. Laya.timer.clearAll(this);
  2354. Laya.timer.once(delay + 1, this, () => {
  2355. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2356. fire.transform.localPositionX = this.transform.localPositionX;
  2357. fire.transform.localPositionY = this.transform.localPositionY;
  2358. fire.transform.localPositionZ = this.transform.localPositionZ;
  2359. let src = fire.getComponent(Partical);
  2360. src.duration = 1000;
  2361. src.setCallback(obj, callback);
  2362. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2363. eft.transform.localPositionX = this.transform.localPositionX;
  2364. eft.transform.localPositionY = this.transform.localPositionY;
  2365. eft.transform.localPositionZ = this.transform.localPositionZ;
  2366. });
  2367. }
  2368. setTransPos(x, y) {
  2369. this.setRotation();
  2370. xGame.common.pos2to3Convert(x, y, this.posV3);
  2371. this.transform.localPositionX = this.posV3.x;
  2372. this.transform.localPositionY = 0;
  2373. this.transform.localPositionZ = this.posV3.z;
  2374. this.transform.localRotationEulerX = 0;
  2375. this.transform.localRotationEulerY = 0;
  2376. this.transform.localRotationEulerZ = 0;
  2377. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2378. this.shadowNode.transform.localPositionY = 0.1;
  2379. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2380. }
  2381. setRotation() {
  2382. if (this.d2BallSrc.canRot) {
  2383. let speed = this.d2BallSrc.rigy.linearVelocity;
  2384. this.rotSpeed.x = speed.x * this.rotRate;
  2385. this.rotSpeed.z = speed.y * this.rotRate;
  2386. this.rotSpeed.y = this.d2BallSrc.rotY;
  2387. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2388. }
  2389. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2390. this.rotSpeed.x = this.rotSpeed.y = 0;
  2391. this.rotSpeed.y = this.d2BallSrc.rotY;
  2392. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2393. }
  2394. }
  2395. setScale() {
  2396. let radius = xGame.common.d2World.rootBall.ui.width;
  2397. let scale = xGame.common.scale2to3Convert(radius);
  2398. this.transform.localScaleX = scale;
  2399. this.transform.localScaleY = scale;
  2400. this.transform.localScaleZ = scale;
  2401. }
  2402. playInHoleEft() {
  2403. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2404. eft.transform.position = this.transform.position;
  2405. }
  2406. playIceEft() {
  2407. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2408. eft.transform.position = this.transform.position;
  2409. }
  2410. get scaleXYZ() {
  2411. return this.transform.localScaleX;
  2412. }
  2413. set scaleXYZ(val) {
  2414. this.transform.localScaleX = val;
  2415. this.transform.localScaleY = val;
  2416. this.transform.localScaleZ = val;
  2417. }
  2418. get posX() {
  2419. return this.transform.localPositionX;
  2420. }
  2421. set posX(val) {
  2422. this.transform.localPositionX = val;
  2423. }
  2424. get posY() {
  2425. return this.transform.localPositionY;
  2426. }
  2427. set posY(val) {
  2428. this.transform.localPositionY = val;
  2429. }
  2430. get posZ() {
  2431. return this.transform.localPositionZ;
  2432. }
  2433. set posZ(val) {
  2434. this.transform.localPositionZ = val;
  2435. }
  2436. destroySelf() {
  2437. this.posV3 = null;
  2438. this.rotSpeed = null;
  2439. this.d2BallSrc = null;
  2440. this.ballNode = null;
  2441. this.gameObj.destroy(true);
  2442. this.transform = null;
  2443. this.destroy();
  2444. }
  2445. }
  2446. class ui_D2Ball extends fgui.GComponent {
  2447. static createInstance() {
  2448. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2449. }
  2450. onConstruct() {
  2451. this.myIcon = (this.getChild("myIcon"));
  2452. this.inner = (this.getChild("inner"));
  2453. this.n8 = (this.getChild("n8"));
  2454. this.n4 = (this.getChild("n4"));
  2455. this.wrongTips = (this.getChild("wrongTips"));
  2456. this.rightTips = (this.getChild("rightTips"));
  2457. this.breathAni = this.getTransition("breathAni");
  2458. }
  2459. }
  2460. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2461. class D2BallSrc extends Laya.Script {
  2462. constructor() {
  2463. super();
  2464. this.number = 0;
  2465. this.startX = 0;
  2466. this.startY = 0;
  2467. this.angleV2 = new Laya.Vector2();
  2468. this.isRootBall = false;
  2469. this.isBlackBall = false;
  2470. this.ballType = "";
  2471. this.canRot = true;
  2472. this.rotY = 0;
  2473. this.poleAngle = 0;
  2474. this.kickPos = { x: 0, y: 0 };
  2475. this.hard = 0;
  2476. this.kickAngle = 0;
  2477. this.borderDis = 0;
  2478. this.speedP10 = 5.6;
  2479. this.lastSpeed = { x: 0, y: 0 };
  2480. this.stillSpeed = 0.12;
  2481. this.ballFunc = "normal";
  2482. this.isRunSkillAni = false;
  2483. this.isInHole = false;
  2484. this.iceOwner = "";
  2485. this.forceRun = false;
  2486. this.myUNID = "";
  2487. this.rectL = 0;
  2488. this.rectR = 0;
  2489. this.rectT = 0;
  2490. this.rectB = 0;
  2491. this.forceVec = new Laya.Vector2();
  2492. this.lastDis = 0;
  2493. this.helpOut = { type: "", x: 0, y: 0 };
  2494. }
  2495. initSelf(number, x, y, d3Ball) {
  2496. if (!this.gameObj)
  2497. this.gameObj = this.owner;
  2498. this.number = number;
  2499. this.startX = x;
  2500. this.startY = y;
  2501. this.d3Ball = d3Ball;
  2502. this.isRootBall = false;
  2503. this.isBlackBall = false;
  2504. this.ballType = "";
  2505. if (number == 0) {
  2506. this.isRootBall = true;
  2507. }
  2508. else if (number == 8) {
  2509. this.isBlackBall = true;
  2510. }
  2511. else {
  2512. if (number <= 7) {
  2513. this.ballType = ballCamp.full;
  2514. }
  2515. else {
  2516. this.ballType = ballCamp.flower;
  2517. }
  2518. }
  2519. this.setInfo();
  2520. this.setD3Ball();
  2521. this.owner["mySrc"] = this;
  2522. this.rigy.linearDamping = 1;
  2523. D2BallSrc._unid++;
  2524. this.myUNID = "d2ball" + D2BallSrc._unid;
  2525. let rect = xGame.common.d2World.borderRect;
  2526. this.rectL = Math.ceil(rect.x) + 20;
  2527. this.rectT = Math.ceil(rect.y) + 20;
  2528. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2529. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2530. }
  2531. setInfo() {
  2532. this.gameObj.x = this.startX;
  2533. this.gameObj.y = this.startY;
  2534. let radius = this.ui.width / 2;
  2535. this.gameObj.width = radius * 2;
  2536. this.gameObj.height = radius * 2;
  2537. if (xGame.common.showDebug) {
  2538. this.ui.myIcon.alpha = 1;
  2539. this.ui.inner.alpha = 1;
  2540. }
  2541. else {
  2542. this.ui.myIcon.alpha = 0;
  2543. this.ui.inner.alpha = 0;
  2544. }
  2545. }
  2546. setD3Ball() {
  2547. this.d3Ball = this.d3Ball;
  2548. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2549. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2550. }
  2551. onUpdate() {
  2552. if (xGame.common.gameMgr.gamePause)
  2553. return;
  2554. if (this.isInHole)
  2555. return;
  2556. if (!xGame.common.d2World.openCheckStill)
  2557. return;
  2558. this.runBall();
  2559. }
  2560. runBall() {
  2561. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2562. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2563. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2564. this.judgeBorder();
  2565. }
  2566. getDestDis(dest) {
  2567. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2568. }
  2569. setmyXY(x, y) {
  2570. this.d3BallSrc.setTransPos(x, y);
  2571. }
  2572. getSpeed() {
  2573. let speed = this.rigy.linearVelocity;
  2574. return speed.x * speed.x + speed.y * speed.y;
  2575. }
  2576. onTriggerEnter(collider) {
  2577. if (!collider || !collider.owner)
  2578. return;
  2579. let coll = "collide";
  2580. let speed = this.getSpeed();
  2581. let sv2 = this.speedP10 * this.speedP10;
  2582. if (collider.label == "ball") {
  2583. if (speed < 9 && this.number != 0)
  2584. coll = "";
  2585. else if (speed < sv2)
  2586. coll = "collide_4";
  2587. else if (speed < sv2 * 6.2)
  2588. coll = "collide_3";
  2589. else if (speed < sv2 * 25)
  2590. coll = "collide_2";
  2591. else if (speed < sv2 * 56)
  2592. coll = "collide_1";
  2593. xGame.soundMgr.playSound(coll);
  2594. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2595. if (collider.owner) {
  2596. let rig = collider.owner.getComponent(D2BallSrc);
  2597. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2598. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2599. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2600. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2601. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2602. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2603. let rx = 0;
  2604. let ry = 0;
  2605. if (this.gameObj.x < this.rectL)
  2606. rx = vx;
  2607. else if (this.gameObj.x > this.rectR)
  2608. rx = -vx;
  2609. else if (this.gameObj.y < this.rectT)
  2610. ry = vy;
  2611. else if (this.gameObj.y > this.rectB)
  2612. ry = -vy;
  2613. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2614. }
  2615. }
  2616. if (this.number != 0) {
  2617. return;
  2618. }
  2619. else {
  2620. if (this.forceRun) {
  2621. console.log("randon force");
  2622. this.applyForce(collider);
  2623. }
  2624. }
  2625. if (xGame.common.d2World.isOnSameLine) {
  2626. xGame.common.d2World.isOnSameLine = false;
  2627. this.rigy.linearVelocity = { x: 0, y: 0 };
  2628. }
  2629. if (xGame.common.gameMgr.firstColliObj == null) {
  2630. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2631. xGame.common.gameMgr.isTouchedBall = true;
  2632. }
  2633. }
  2634. else {
  2635. xGame.common.recoverCameraView();
  2636. let wallStr = "";
  2637. if (speed < 9) { }
  2638. else if (speed < sv2) { }
  2639. else if (speed < sv2 * 6.2)
  2640. wallStr = "wall_30";
  2641. else if (speed < sv2 * 25)
  2642. wallStr = "wall_50";
  2643. else if (speed < sv2 * 56)
  2644. wallStr = "wall_80";
  2645. xGame.soundMgr.playSound(wallStr);
  2646. }
  2647. }
  2648. applyForce(collider) {
  2649. let src = collider.owner.mySrc;
  2650. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2651. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2652. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2653. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2654. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2655. }
  2656. checkWrongBall(playEft = true) {
  2657. if (this.isInHole)
  2658. return;
  2659. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2660. if (this.number != 0 && playEft)
  2661. this.d3BallSrc.playInHoleEft();
  2662. let coll = "inpocket_1";
  2663. let speed = this.getSpeed();
  2664. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2665. if (speed < 9 && this.number != 0)
  2666. coll = "";
  2667. else if (speed < sv2 * 6.2)
  2668. coll = "inpocket_4";
  2669. else if (speed < sv2 * 25)
  2670. coll = "collide_3";
  2671. else if (speed < sv2 * 56)
  2672. coll = "collide_2";
  2673. xGame.soundMgr.playSound(coll);
  2674. this.isInHole = true;
  2675. if (this.number == 0) {
  2676. console.log("白球进了。。");
  2677. this.reset();
  2678. this.rigy.linearVelocity = { x: 0, y: 0 };
  2679. this.hideSelf();
  2680. xGame.common.gameUI.ui.whiteAni.visible = true;
  2681. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2682. xGame.common.gameUI.ui.whiteAni.visible = false;
  2683. }));
  2684. }
  2685. else {
  2686. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2687. xGame.common.d2World.removeOneBall(this);
  2688. this.destroySelf();
  2689. xGame.common.playHappySound(this.number);
  2690. this.runFlyEft();
  2691. }
  2692. }
  2693. runFlyEft() {
  2694. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2695. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2696. }
  2697. }
  2698. hideSelf() {
  2699. if (this.d3Ball)
  2700. this.d3Ball.active = false;
  2701. }
  2702. showSelf() {
  2703. this.isInHole = false;
  2704. if (this.d3Ball && !this.d3Ball.active)
  2705. this.d3Ball.active = true;
  2706. }
  2707. isStill() {
  2708. let speed = this.rigy.linearVelocity;
  2709. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2710. this.rigy.linearVelocity = { x: 0, y: 0 };
  2711. return true;
  2712. }
  2713. return false;
  2714. }
  2715. reset() {
  2716. }
  2717. destroySelf() {
  2718. this.d3BallSrc.destroySelf();
  2719. if (!this.ui.isDisposed) {
  2720. this.ui.removeFromParent();
  2721. this.ui.dispose();
  2722. this.ui = null;
  2723. }
  2724. this.outColli = null;
  2725. this.innerColli = null;
  2726. this.rigy = null;
  2727. this.d3Ball = null;
  2728. this.d3BallSrc = null;
  2729. this.angleV2 = null;
  2730. this.gameObj.destroy(true);
  2731. this.destroy();
  2732. }
  2733. judgeBorder() {
  2734. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2735. return;
  2736. }
  2737. if (this.destroyed)
  2738. return;
  2739. if (xGame.common.gameMode == GameMode.classic)
  2740. return;
  2741. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2742. if (isOver) {
  2743. this.checkWrongBall();
  2744. }
  2745. }
  2746. onClick(e, force = false) {
  2747. if (this.number == 0)
  2748. return;
  2749. if (force) {
  2750. }
  2751. else {
  2752. if (xGame.common.d2World.openCheckStill)
  2753. return;
  2754. if (!xGame.common.gameMgr.selfTurn) {
  2755. return;
  2756. }
  2757. }
  2758. if (!xGame.common.gameMgr.finishOneShoot)
  2759. return;
  2760. let root = xGame.common.d2World.rootBall.gameObj;
  2761. let x = this.gameObj.x - root.x;
  2762. let y = this.gameObj.y - root.y;
  2763. let angle = xGame.common.getfguiRotation(x, y);
  2764. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2765. xGame.common.d2World.getHelpLine();
  2766. xGame.common.clickedBall = true;
  2767. this.checkGuide();
  2768. }
  2769. checkGuide() {
  2770. let guide = DataMgr.getSkillGuide();
  2771. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2772. xGame.common.guideStep++;
  2773. xGame.common.gameUI.ui.guide1.visible = false;
  2774. xGame.common.gameUI.ui.guide2.visible = true;
  2775. }
  2776. }
  2777. checkDistance(disX, disY, angle) {
  2778. let diameter = this.gameObj.width - 1;
  2779. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2780. if (!this.lastDis)
  2781. this.lastDis = dis;
  2782. else {
  2783. if (dis > this.lastDis) {
  2784. this.helpOut.type = "remove";
  2785. return this.helpOut;
  2786. }
  2787. }
  2788. if (dis <= Math.pow(diameter, 2)) {
  2789. let del = 0.01;
  2790. let offest = 0;
  2791. let realX = disX - this.gameObj.x;
  2792. let realY = disY - this.gameObj.y;
  2793. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2794. offest += del;
  2795. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2796. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2797. }
  2798. this.helpOut.type = "ok";
  2799. this.helpOut.x = realX + this.gameObj.x;
  2800. this.helpOut.y = realY + this.gameObj.y;
  2801. return this.helpOut;
  2802. }
  2803. else {
  2804. this.helpOut.type = "no";
  2805. return this.helpOut;
  2806. }
  2807. }
  2808. clearBallEft() {
  2809. this.clearBallRightEft();
  2810. this.clearBallWrongEft();
  2811. }
  2812. clearBallRightEft() {
  2813. this.ui.breathAni.stop();
  2814. this.ui.rightTips.visible = false;
  2815. }
  2816. clearBallWrongEft() {
  2817. this.ui.wrongTips.visible = false;
  2818. }
  2819. showWrongEft() {
  2820. if (!xGame.common.gameMgr.selfTurn)
  2821. return;
  2822. this.ui.wrongTips.visible = true;
  2823. }
  2824. showRightEft() {
  2825. if (!xGame.common.gameMgr.selfTurn)
  2826. return;
  2827. this.ui.rightTips.visible = true;
  2828. this.ui.rightTips.scaleX = 1;
  2829. this.ui.rightTips.scaleY = 1;
  2830. this.ui.breathAni.play();
  2831. }
  2832. setBallFunc(type, owner) {
  2833. if (type == "ice") {
  2834. this.ballFunc = type;
  2835. this.d3BallSrc.setAlbedoTexture(true);
  2836. this.rigy.type = "static";
  2837. this.iceOwner = owner;
  2838. }
  2839. else {
  2840. if (owner == this.iceOwner) {
  2841. this.ballFunc = type;
  2842. this.d3BallSrc.setAlbedoTexture(false);
  2843. this.rigy.type = "dynamic";
  2844. }
  2845. }
  2846. }
  2847. }
  2848. D2BallSrc._unid = 0;
  2849. class D2RootBallSrc extends D2BallSrc {
  2850. constructor() {
  2851. super();
  2852. this.maxSpeed = 0;
  2853. this.classicMaxSpeed = 2.2;
  2854. this.bigSkillMaxSpeed = 4;
  2855. this.angle = 0;
  2856. this.allPercent = 0;
  2857. this.linearPercent = 0;
  2858. this.anglePercent = 0;
  2859. this.maxAngleRate = 0.6;
  2860. this.baseRot = 7;
  2861. this.angleMax = 0;
  2862. this.speed = new Laya.Vector2();
  2863. this.rotSpeed = new Laya.Vector2();
  2864. }
  2865. isStill() {
  2866. let speed = this.rigy.linearVelocity;
  2867. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2868. if (this.anglePercent <= 0.1) {
  2869. this.rigy.linearVelocity = { x: 0, y: 0 };
  2870. return true;
  2871. }
  2872. }
  2873. return false;
  2874. }
  2875. reset() {
  2876. this.linearPercent = 0;
  2877. this.anglePercent = 0;
  2878. }
  2879. setSpeed(percent, angle) {
  2880. this.allPercent = percent;
  2881. this.angle = angle;
  2882. this.setAngleSpeed();
  2883. this.setLinearSpeed();
  2884. let hit = "hit";
  2885. if (percent < 25)
  2886. hit = "hit03";
  2887. else if (percent < 50)
  2888. hit = "hit02";
  2889. else if (percent < 75)
  2890. hit = "hit01";
  2891. xGame.soundMgr.playSound(hit);
  2892. }
  2893. setAngleSpeed() {
  2894. let offest = xGame.common.rodOffest;
  2895. let radius = 82;
  2896. let rate = Math.abs(offest.y / radius) * 0.5;
  2897. if (offest.y > 0)
  2898. this.angleMax = -this.baseRot * 2;
  2899. else
  2900. this.angleMax = this.baseRot;
  2901. this.rotY = -offest.x / radius * 100;
  2902. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2903. this.linearPercent = this.allPercent - this.anglePercent;
  2904. }
  2905. setLinearSpeed() {
  2906. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2907. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2908. if (!xGame.common.longHelpLine) {
  2909. let offset = -150 + xGame.common.randomNum(0, 300);
  2910. offset /= 100;
  2911. this.angle += offset;
  2912. }
  2913. }
  2914. }
  2915. let sin = Math.sin(this.angle * Math.PI / 180);
  2916. let cos = Math.cos(this.angle * Math.PI / 180);
  2917. switch (xGame.common.gameMode) {
  2918. case GameMode.classic:
  2919. this.maxSpeed = this.classicMaxSpeed;
  2920. break;
  2921. case GameMode.bigMove:
  2922. this.maxSpeed = this.bigSkillMaxSpeed;
  2923. break;
  2924. case GameMode.placeBall:
  2925. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2926. if (data.type == 1) {
  2927. this.maxSpeed = this.bigSkillMaxSpeed;
  2928. }
  2929. else {
  2930. this.maxSpeed = this.classicMaxSpeed;
  2931. }
  2932. break;
  2933. default:
  2934. break;
  2935. }
  2936. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2937. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2938. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2939. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2940. this.rigy.applyLinearImpulseToCenter(this.speed);
  2941. }
  2942. onUpdate() {
  2943. if (this.anglePercent > 0.1) {
  2944. this.anglePercent *= 0.97;
  2945. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2946. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2947. this.rigy.applyForceToCenter(this.rotSpeed);
  2948. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2949. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2950. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2951. if (num > 0.9)
  2952. this.canRot = true;
  2953. }
  2954. else
  2955. this.canRot = true;
  2956. if (Math.abs(this.rotY) > 0.1)
  2957. this.rotY *= 0.98;
  2958. super.onUpdate();
  2959. }
  2960. destroySelf() {
  2961. super.destroySelf();
  2962. this.speed = null;
  2963. }
  2964. }
  2965. class D2Ball extends Laya.Sprite {
  2966. constructor(isRootBall = false) {
  2967. super();
  2968. this.ui = ui_D2Ball.createInstance();
  2969. this.pivotX = this.ui.width / 2;
  2970. this.pivotY = this.ui.width / 2;
  2971. this.x = 0;
  2972. this.y = 0;
  2973. this.addChild(this.ui.displayObject);
  2974. this.ui.displayObject.x += this.ui.width / 2;
  2975. this.ui.displayObject.y += this.ui.width / 2;
  2976. if (isRootBall) {
  2977. this.d2Src = this.addComponent(D2RootBallSrc);
  2978. }
  2979. else {
  2980. this.d2Src = this.addComponent(D2BallSrc);
  2981. }
  2982. this.d2Src.ui = this.ui;
  2983. this.addCircleCollider();
  2984. this.addInnerCircleCollider();
  2985. this.addRigyBody();
  2986. }
  2987. addCircleCollider() {
  2988. let colli = xGame.common.getCollider("circle");
  2989. colli.radius = this.ui.width / 2;
  2990. this.addComponentIntance(colli);
  2991. this.d2Src.outColli = colli;
  2992. colli.label = "ball";
  2993. }
  2994. addInnerCircleCollider() {
  2995. let colli = xGame.common.getCollider("circle");
  2996. colli.radius = this.ui.inner.width / 2;
  2997. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2998. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2999. this.addComponentIntance(colli);
  3000. this.d2Src.innerColli = colli;
  3001. colli.label = "inner";
  3002. }
  3003. addRigyBody() {
  3004. let rigy = xGame.common.getRigbody();
  3005. rigy.type = "dynamic";
  3006. this.addComponentIntance(rigy);
  3007. this.d2Src.rigy = rigy;
  3008. }
  3009. disposeSelf() {
  3010. if (!this.ui.isDisposed) {
  3011. this.ui.dispose();
  3012. this.ui.removeFromParent();
  3013. this.ui = null;
  3014. }
  3015. }
  3016. }
  3017. class ui_D2Gan extends fgui.GComponent {
  3018. static createInstance() {
  3019. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3020. }
  3021. onConstruct() {
  3022. this.myIcon = (this.getChild("myIcon"));
  3023. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3024. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3025. this.self = (this.getChild("self"));
  3026. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3027. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3028. this.ai = (this.getChild("ai"));
  3029. }
  3030. }
  3031. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3032. class D2Gan {
  3033. constructor() {
  3034. this.offset = 0.15;
  3035. this.cell = 1.5;
  3036. this.onBallCell = 0.4;
  3037. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3038. this.moveNum = 70;
  3039. this.rulerRate = 0.1;
  3040. this.ui = ui_D2Gan.createInstance();
  3041. this.changeSelfRod();
  3042. this.changeAIRod();
  3043. }
  3044. changeSelfRod() {
  3045. let index = DataMgr.getCurBallRod();
  3046. let data = cfgTable.ballrodData[index + 1];
  3047. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3048. this.selfMySpine && this.selfMySpine.dispose();
  3049. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3050. if (data.spine) {
  3051. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3052. this.selfMySpine = new SpineMgr(data.spine, () => {
  3053. let xx = this.ui.selfEftRoot.width / 2;
  3054. let yy = this.ui.selfEftRoot.height / 2;
  3055. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3056. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3057. outSpine.rotation = -90;
  3058. });
  3059. }
  3060. }
  3061. changeAIRod() {
  3062. let length = Object.keys(cfgTable.ballrodData).length;
  3063. let rand = Math.floor(length * Math.random()) + 1;
  3064. let data = cfgTable.ballrodData[rand];
  3065. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3066. this.aiMySpine && this.aiMySpine.dispose();
  3067. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3068. if (data.spine) {
  3069. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3070. this.aiMySpine = new SpineMgr(data.spine, () => {
  3071. let xx = this.ui.aiEftRoot.width / 2;
  3072. let yy = this.ui.aiEftRoot.height / 2;
  3073. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3074. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3075. outSpine.rotation = -90;
  3076. });
  3077. }
  3078. }
  3079. setGanLastInfo() {
  3080. this.lastInfo.rotation = this.ui.rotation;
  3081. this.lastInfo.x = this.ui.x;
  3082. this.lastInfo.y = this.ui.y;
  3083. }
  3084. rotateSelf(flag, isRuler = false) {
  3085. let angle;
  3086. flag = flag * this.offset;
  3087. if (xGame.common.d2World.isHelpLineOnBall) {
  3088. angle = flag * this.onBallCell;
  3089. }
  3090. else {
  3091. angle = flag * this.cell;
  3092. }
  3093. if (isRuler) {
  3094. angle *= this.rulerRate;
  3095. }
  3096. this.ui.rotation += angle;
  3097. xGame.common.d2World.getHelpLine();
  3098. }
  3099. checkDistance() {
  3100. let target = xGame.common.d2World.targetBall;
  3101. let root = xGame.common.d2World.rootBall;
  3102. if (target == null) {
  3103. return 1;
  3104. }
  3105. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3106. if (dis <= 2500) {
  3107. return 5;
  3108. }
  3109. return 1;
  3110. }
  3111. rotDest(rot) {
  3112. this.ui.rotation = rot;
  3113. xGame.common.d2World.getHelpLine();
  3114. }
  3115. storagePower(powerNum) {
  3116. let pos = (powerNum / 100) * this.moveNum;
  3117. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3118. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3119. this.ui.x = this.lastInfo.x + xx;
  3120. this.ui.y = this.lastInfo.y + yy;
  3121. }
  3122. shoot() {
  3123. this.storagePower(0);
  3124. this.ui.visible = false;
  3125. }
  3126. destroySelf() {
  3127. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3128. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3129. this.selfMySpine && this.selfMySpine.dispose();
  3130. this.aiMySpine && this.aiMySpine.dispose();
  3131. this.lastInfo = null;
  3132. if (!this.ui.isDisposed) {
  3133. this.ui.removeFromParent();
  3134. this.ui.dispose();
  3135. }
  3136. }
  3137. }
  3138. class ui_HelpLine extends fgui.GComponent {
  3139. static createInstance() {
  3140. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3141. }
  3142. onConstruct() {
  3143. this.n10 = (this.getChild("n10"));
  3144. this.rect = (this.getChild("rect"));
  3145. this.dir11 = (this.getChild("dir11"));
  3146. this.dir = (this.getChild("dir"));
  3147. this.rootDir = (this.getChild("rootDir"));
  3148. this.dirDot = (this.getChild("dirDot"));
  3149. }
  3150. }
  3151. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3152. class D2HelpLine {
  3153. constructor() {
  3154. this.starX = 0;
  3155. this.starY = 0;
  3156. this.ui = ui_HelpLine.createInstance();
  3157. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3158. this.starX = this.ui.rect.x;
  3159. this.starY = this.ui.rect.y;
  3160. }
  3161. shoot() {
  3162. this.ui.visible = false;
  3163. }
  3164. destroySelf() {
  3165. if (this.ui.isDisposed) {
  3166. this.ui.removeFromParent();
  3167. this.ui.dispose();
  3168. }
  3169. }
  3170. }
  3171. class D2World extends Laya.Script {
  3172. constructor() {
  3173. super();
  3174. this.ballArr = [];
  3175. this.openCheckStill = false;
  3176. this.checkArr = [];
  3177. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3178. this.isHelpLineOnBall = false;
  3179. this.isOnSameLine = false;
  3180. this.reflectAngle = 0;
  3181. this.powerPercent = 0;
  3182. this.inHolesSpeed = [];
  3183. this.outDir = new Laya.Vector2();
  3184. this.rootDir = new Laya.Vector2();
  3185. this.aiLv = 0;
  3186. this.rootPos = new Laya.Vector2();
  3187. this.tempDir1 = new Laya.Vector2();
  3188. this.tempDir2 = new Laya.Vector2();
  3189. this.tempDir3 = new Laya.Vector2();
  3190. this.ballSize = 33;
  3191. this.destRot = 0;
  3192. }
  3193. initSelf() {
  3194. this.createBalls();
  3195. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3196. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3197. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3198. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3199. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3200. }
  3201. setBorderRect() {
  3202. let ui = xGame.common.gameUI.ui;
  3203. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3204. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3205. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3206. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3207. this.borderRect.x = starX;
  3208. this.borderRect.y = starY;
  3209. this.borderRect.width = width;
  3210. this.borderRect.height = height;
  3211. }
  3212. resetGame() {
  3213. this.openCheckStill = false;
  3214. let temp;
  3215. for (let index = 0; index < this.ballArr.length; index++) {
  3216. temp = this.ballArr[index];
  3217. temp.destroySelf();
  3218. }
  3219. xGame.common.d3World.ballRoot.destroyChildren();
  3220. xGame.common.gameUI.ui.ballNode.removeChildren();
  3221. console.log("进入摧毁逻辑");
  3222. this.d2Gan.destroySelf();
  3223. this.d2HelpLine.destroySelf();
  3224. this.ballArr = [];
  3225. }
  3226. setD2Gan() {
  3227. let ballNode = this.rootBall.ui;
  3228. let d2Gan = new D2Gan();
  3229. this.d2Gan = d2Gan;
  3230. let ganNode = d2Gan.ui;
  3231. ballNode.addChild(ganNode);
  3232. ganNode.pivotX = ganNode.pivotX;
  3233. ganNode.pivotY = ganNode.pivotY;
  3234. ganNode.x = ganNode.myIcon.width / 2;
  3235. ganNode.y = this.rootBall.gameObj.width;
  3236. d2Gan.setGanLastInfo();
  3237. }
  3238. setHelpLine() {
  3239. let d2Help = new D2HelpLine();
  3240. this.d2HelpLine = d2Help;
  3241. }
  3242. createBalls() {
  3243. let cfg;
  3244. switch (xGame.common.gameMode) {
  3245. case GameMode.classic:
  3246. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3247. break;
  3248. case GameMode.bigMove:
  3249. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3250. break;
  3251. case GameMode.placeBall:
  3252. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3253. break;
  3254. default:
  3255. break;
  3256. }
  3257. cfg = JSON.parse(JSON.stringify(cfg));
  3258. for (const key in cfg) {
  3259. if (cfg[key].value == 0) {
  3260. this.createRootBall(cfg[key]);
  3261. delete cfg[key];
  3262. break;
  3263. }
  3264. }
  3265. this.createOtherBalls(cfg);
  3266. }
  3267. createRootBall(data) {
  3268. let root = new D2Ball(true);
  3269. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3270. this.rootBall = root.d2Src;
  3271. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3272. let d3BallSrc = d3Ball.getComponent(Ball);
  3273. xGame.common.d3World.rootBall = d3Ball;
  3274. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3275. let xx = data.x;
  3276. let yy = data.y;
  3277. let numer = data.value;
  3278. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3279. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3280. this.ballArr.push(this.rootBall);
  3281. this.setD2Gan();
  3282. this.setHelpLine();
  3283. }
  3284. createOtherBalls(cfg) {
  3285. let temp;
  3286. let src;
  3287. let data;
  3288. for (const key in cfg) {
  3289. data = cfg[key];
  3290. temp = new D2Ball();
  3291. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3292. src = temp.d2Src;
  3293. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3294. src.initSelf(data.value, data.x, data.y, d3Ball);
  3295. this.ballArr.push(src);
  3296. }
  3297. }
  3298. shoot(percent) {
  3299. this.powerPercent = percent;
  3300. this.openCheckStill = true;
  3301. let d2Angle = this.d2Gan.ui.rotation;
  3302. this.rootBall.setSpeed(percent, d2Angle);
  3303. this.clearBallAllEft();
  3304. this.changePlayerView();
  3305. }
  3306. onUpdate() {
  3307. if (!this.openCheckStill)
  3308. return;
  3309. this.checkStill();
  3310. }
  3311. checkStill() {
  3312. for (let index = 0; index < this.ballArr.length; index++) {
  3313. if (!this.ballArr[index].isStill()) {
  3314. return;
  3315. }
  3316. }
  3317. xGame.eventMgr.event(ALL_BALL_STOP);
  3318. }
  3319. allBallStop() {
  3320. this.openCheckStill = false;
  3321. xGame.common.recoverCameraView();
  3322. }
  3323. waitShoot() {
  3324. if (!this.d2Gan.ui.isDisposed) {
  3325. this.d2Gan.ui.visible = true;
  3326. }
  3327. if (!this.d2HelpLine.ui.isDisposed) {
  3328. this.d2HelpLine.ui.visible = true;
  3329. }
  3330. this.clearBallAllEft();
  3331. this.showBallRightEft();
  3332. this.getHelpLine();
  3333. this.inHolesSpeed = [];
  3334. this.selectOneBall();
  3335. }
  3336. _getAllBallArr() {
  3337. let arr = this.ballArr;
  3338. let outArr = [];
  3339. for (let index = 0; index < arr.length; index++) {
  3340. if (arr[index] instanceof D2RootBallSrc)
  3341. continue;
  3342. if (arr[index].ballFunc == "ice")
  3343. continue;
  3344. if (arr[index].destroyed)
  3345. continue;
  3346. outArr.push(arr[index]);
  3347. }
  3348. return outArr;
  3349. }
  3350. _getBlackObj() {
  3351. let arr = this.ballArr;
  3352. for (let index = 0; index < arr.length; index++) {
  3353. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3354. return arr[index];
  3355. }
  3356. }
  3357. }
  3358. selectOneBall() {
  3359. let all = this._getAllBallArr();
  3360. let target;
  3361. switch (xGame.common.gameMode) {
  3362. case GameMode.classic:
  3363. if (xGame.common.gameMgr.selfTurn) {
  3364. let self = xGame.common.gameMgr.selfBallArr;
  3365. let black = this._getBlackObj();
  3366. if (xGame.common.gameMgr.ensureBallType) {
  3367. if (self.length > 0) {
  3368. let out = [];
  3369. for (let j = 0; j < all.length; j++) {
  3370. if (self.indexOf(all[j].number) > -1) {
  3371. out.push(all[j]);
  3372. }
  3373. }
  3374. target = this.selectBestEnterOne(out);
  3375. }
  3376. else {
  3377. target = this.selectBestEnterOne([black]);
  3378. }
  3379. }
  3380. else {
  3381. target = this.selectBestEnterOne(all);
  3382. }
  3383. }
  3384. else {
  3385. target = this.selectBestEnterOne(all);
  3386. }
  3387. break;
  3388. case GameMode.bigMove:
  3389. target = this.selectBestEnterOne(all);
  3390. break;
  3391. case GameMode.placeBall:
  3392. if (all.length > 0) {
  3393. target = this.selectBestEnterOne(all);
  3394. }
  3395. break;
  3396. default:
  3397. break;
  3398. }
  3399. if (target && !target.destroyed && target.onClick) {
  3400. target.onClick(0, true);
  3401. let num = -200 + xGame.common.randomNum(0, 400);
  3402. num /= 150;
  3403. if (xGame.common.longHelpLine) {
  3404. num = 0;
  3405. }
  3406. this.destRot += num;
  3407. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3408. }
  3409. }
  3410. removeOneBall(ball) {
  3411. for (let index = 0; index < this.ballArr.length; index++) {
  3412. if (this.ballArr[index].id == ball.id) {
  3413. this.ballArr.splice(index, 1);
  3414. break;
  3415. }
  3416. }
  3417. }
  3418. getHelpLine() {
  3419. this.d2HelpLine.ui.dirDot.visible = false;
  3420. this.isOnSameLine = false;
  3421. let startX = this.rootBall.gameObj.x;
  3422. let startY = this.rootBall.gameObj.y;
  3423. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3424. if (dis == null) {
  3425. this.d2HelpLine.ui.visible = false;
  3426. console.error("辅助线异常");
  3427. return;
  3428. }
  3429. this.d2HelpLine.ui.visible = true;
  3430. let angle = this.d2Gan.ui.rotation;
  3431. let radius = 16.5;
  3432. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3433. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3434. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3435. if (colliObj == null) {
  3436. this.getColliPos(disX, disY, radius, angle);
  3437. xGame.common.d2World.isHelpLineOnBall = false;
  3438. this.targetBall = null;
  3439. this.reflectAngle = 0;
  3440. this.showBallWrongEft();
  3441. }
  3442. else {
  3443. let target = colliObj.src;
  3444. let radius = 16.5;
  3445. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3446. dis1 = Math.sqrt(dis1);
  3447. let realDis = colliObj.disHon - dis1;
  3448. let dir = colliObj.dir;
  3449. let xx = startX + dir.x * realDis;
  3450. let yy = startY + dir.y * realDis;
  3451. this.getColliPos(xx, yy, radius, angle);
  3452. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3453. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3454. let offset = xGame.common.rodOffest;
  3455. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3456. this.isOnSameLine = true;
  3457. }
  3458. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3459. xGame.common.d2World.isHelpLineOnBall = true;
  3460. this.targetBall = target;
  3461. this.reflectAngle = reflectAngle;
  3462. this.showBallWrongEft();
  3463. if (xGame.common.longHelpLine) {
  3464. this.delayReflectLine(target, reflectAngle);
  3465. }
  3466. }
  3467. }
  3468. getBorderDot(startX, startY, angle) {
  3469. let radius = 17;
  3470. let distance;
  3471. let isDone;
  3472. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3473. isDone = this.judgeUpDown(distance, angle, startX);
  3474. if (isDone != null) {
  3475. return isDone;
  3476. }
  3477. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3478. isDone = this.judgeUpDown(distance, angle, startX);
  3479. if (isDone != null) {
  3480. return isDone;
  3481. }
  3482. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3483. isDone = this.judgeLeftRight(distance, angle, startY);
  3484. if (isDone != null) {
  3485. return isDone;
  3486. }
  3487. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3488. isDone = this.judgeLeftRight(distance, angle, startY);
  3489. if (isDone != null) {
  3490. return isDone;
  3491. }
  3492. }
  3493. judgeUpDown(distance, angle, startX) {
  3494. let flag = Math.sin(angle * Math.PI / 180);
  3495. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3496. if (distance >= 0) {
  3497. if (flag > 0) {
  3498. if (temp < this.borderRect.x + this.borderRect.width) {
  3499. return distance;
  3500. }
  3501. }
  3502. else {
  3503. if (temp > this.borderRect.x) {
  3504. return distance;
  3505. }
  3506. }
  3507. }
  3508. }
  3509. judgeLeftRight(distance, angle, starY) {
  3510. let flag = -Math.cos(angle * Math.PI / 180);
  3511. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3512. if (distance >= 0) {
  3513. if (flag > 0) {
  3514. if (temp < this.borderRect.y + this.borderRect.height) {
  3515. return distance;
  3516. }
  3517. }
  3518. else {
  3519. if (temp > this.borderRect.y) {
  3520. return distance;
  3521. }
  3522. }
  3523. }
  3524. }
  3525. clearBallAllEft() {
  3526. let temp;
  3527. for (let index = 0; index < this.ballArr.length; index++) {
  3528. temp = this.ballArr[index];
  3529. temp.clearBallEft();
  3530. }
  3531. }
  3532. showBallRightEft() {
  3533. let gameMgr = xGame.common.gameMgr;
  3534. let temp;
  3535. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3536. if (targetArr.length <= 0)
  3537. return;
  3538. for (let index = 0; index < this.ballArr.length; index++) {
  3539. temp = this.ballArr[index];
  3540. if (targetArr.indexOf(temp.number) > -1) {
  3541. temp.showRightEft();
  3542. }
  3543. }
  3544. }
  3545. showBallWrongEft() {
  3546. let gameMgr = xGame.common.gameMgr;
  3547. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3548. if (targetArr.length <= 0)
  3549. return;
  3550. let temp;
  3551. for (let index = 0; index < this.ballArr.length; index++) {
  3552. temp = this.ballArr[index];
  3553. if (this.targetBall && this.targetBall.number == temp.number) {
  3554. if (targetArr.indexOf(temp.number) <= -1) {
  3555. temp.showWrongEft();
  3556. }
  3557. else {
  3558. temp.clearBallWrongEft();
  3559. }
  3560. }
  3561. else {
  3562. temp.clearBallWrongEft();
  3563. }
  3564. }
  3565. }
  3566. getColliPos(x, y, radius, angle) {
  3567. this.d2HelpLine.ui.x = x;
  3568. this.d2HelpLine.ui.y = y;
  3569. let dirX = x - this.rootBall.gameObj.x;
  3570. let dirY = y - this.rootBall.gameObj.y;
  3571. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3572. if (rectH <= 0)
  3573. rectH = 0;
  3574. this.d2HelpLine.ui.rect.height = 0;
  3575. this.d2HelpLine.ui.rect.height = rectH;
  3576. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3577. if (rectH < this.rootBall.gameObj.width) {
  3578. this.d2HelpLine.ui.rect.visible = false;
  3579. }
  3580. else {
  3581. this.d2HelpLine.ui.rect.visible = true;
  3582. }
  3583. this.d2HelpLine.ui.dir.visible = false;
  3584. this.d2HelpLine.ui.rootDir.visible = false;
  3585. }
  3586. getReflectLine(x, y, radius, target) {
  3587. this.d2HelpLine.ui.dir.visible = true;
  3588. let dirX = target.x - x;
  3589. let dirY = target.y - y;
  3590. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3591. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3592. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3593. this.d2HelpLine.ui.dir.height = 48;
  3594. this.d2HelpLine.ui.dir.rotation = angle;
  3595. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3596. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3597. return angle;
  3598. }
  3599. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3600. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3601. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3602. let targetX = target.gameObj.x;
  3603. let targetY = target.gameObj.y;
  3604. this.outDir.setValue(targetX - xx, targetY - yy);
  3605. this.rootDir.setValue(rtX - xx, rtY - yy);
  3606. let ver = Math.PI / 2;
  3607. let sin = Math.sin(ver);
  3608. let cos = Math.cos(ver);
  3609. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3610. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3611. this.outDir.setValue(outX, outY);
  3612. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3613. Laya.Vector2.normalize(this.outDir, this.outDir);
  3614. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3615. if (Math.abs(result) <= 0.08) {
  3616. this.d2HelpLine.ui.rootDir.visible = false;
  3617. return;
  3618. }
  3619. if (result > 0) {
  3620. angle += 90;
  3621. }
  3622. else if (result < 0) {
  3623. angle -= 90;
  3624. }
  3625. this.d2HelpLine.ui.rootDir.visible = true;
  3626. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3627. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3628. this.d2HelpLine.ui.rootDir.rotation = angle;
  3629. }
  3630. delayReflectLine(obj, angle) {
  3631. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3632. return;
  3633. }
  3634. this.isOnSameLine = false;
  3635. let startX = obj.gameObj.x;
  3636. let startY = obj.gameObj.y;
  3637. let dis = this.getBorderDot(startX, startY, angle);
  3638. if (dis == null) {
  3639. this.d2HelpLine.ui.dirDot.visible = false;
  3640. return;
  3641. }
  3642. this.d2HelpLine.ui.visible = true;
  3643. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3644. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3645. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3646. if (colliObj == null) {
  3647. this.setDelayLine(disX, disY, obj, angle);
  3648. }
  3649. else {
  3650. let radius = 16;
  3651. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3652. dis1 = Math.sqrt(dis1);
  3653. let realDis = colliObj.disHon - dis1;
  3654. let dir = colliObj.dir;
  3655. let xx = startX + dir.x * realDis;
  3656. let yy = startY + dir.y * realDis;
  3657. this.setDelayLine(xx, yy, obj, angle);
  3658. }
  3659. }
  3660. setDelayLine(x, y, obj, angle) {
  3661. let dirX = x - obj.gameObj.x;
  3662. let dirY = y - obj.gameObj.y;
  3663. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3664. if (rectH <= 0)
  3665. rectH = 0;
  3666. this.d2HelpLine.ui.dir.height = rectH;
  3667. this.d2HelpLine.ui.dirDot.visible = true;
  3668. this.d2HelpLine.ui.dirDot.x = 17;
  3669. this.d2HelpLine.ui.dirDot.y = 17;
  3670. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3671. ;
  3672. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3673. }
  3674. changePlayerView() {
  3675. if (Math.random() >= 0.7)
  3676. return;
  3677. if (!this.targetBall) {
  3678. return;
  3679. }
  3680. if (!xGame.common.gameMgr.selfTurn)
  3681. return;
  3682. switch (xGame.common.gameMode) {
  3683. case GameMode.classic:
  3684. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3685. if (this.targetBall.number != 8) {
  3686. return;
  3687. }
  3688. }
  3689. break;
  3690. case GameMode.bigMove:
  3691. return;
  3692. case GameMode.placeBall:
  3693. break;
  3694. default:
  3695. break;
  3696. }
  3697. let startX = this.targetBall.gameObj.x;
  3698. let startY = this.targetBall.gameObj.y;
  3699. let angle = this.reflectAngle;
  3700. let dis = this.getBorderDot(startX, startY, angle);
  3701. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3702. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3703. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3704. if (colliObj) {
  3705. return;
  3706. }
  3707. let offset = 40;
  3708. let posObj = xGame.common.gameMgr.posObj;
  3709. let temp;
  3710. let radius;
  3711. let tarX, tarY;
  3712. for (const key in posObj) {
  3713. temp = posObj[key];
  3714. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3715. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3716. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3717. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3718. xGame.common.showOneCamera("angle" + key);
  3719. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3720. Laya.physicsTimer.scale = 0.7;
  3721. break;
  3722. }
  3723. }
  3724. }
  3725. selectBestEnterOne(arr) {
  3726. this.aiLv = xGame.tools.random(1, 11);
  3727. this.aiLv = 10;
  3728. this.wBall = xGame.common.d2World.rootBall;
  3729. this.rootPos.x = this.wBall.gameObj.x;
  3730. this.rootPos.y = this.wBall.gameObj.y;
  3731. this.initHoleBall(arr);
  3732. return this.selectBall();
  3733. }
  3734. selectBall() {
  3735. let ball = null;
  3736. this.destRot = 0;
  3737. let ai = 110 - this.aiLv * 10;
  3738. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3739. let score = false;
  3740. if (this.scoreBall.length < 1) {
  3741. if (this.lineBall.length < 1) {
  3742. for (let i = 0; i < this.kickBall.length; i++) {
  3743. let list = [];
  3744. let bo = this.kickBall[i];
  3745. let bobj = bo.gameObj;
  3746. let rect = xGame.common.d2World.borderRect;
  3747. let mobj = this.wBall.gameObj;
  3748. let minb = bobj.y - rect.y - 20;
  3749. let minw = mobj.y - rect.y - 50;
  3750. if (minb > 0 && minw > 0) {
  3751. let dlenx = 0;
  3752. let dleny = mobj.y - rect.y;
  3753. let spx = mobj.x;
  3754. let spy = rect.y - dleny;
  3755. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3756. }
  3757. minb = rect.y + rect.height - bobj.y - 20;
  3758. minw = rect.y + rect.height - mobj.y - 50;
  3759. if (minb > 0 && minw > 0) {
  3760. let dlenx = 0;
  3761. let dleny = rect.y + rect.height - mobj.y;
  3762. let spx = mobj.x;
  3763. let spy = rect.y + rect.height + dleny;
  3764. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3765. }
  3766. minb = bobj.x - rect.x - 20;
  3767. minw = mobj.x - rect.x - 50;
  3768. if (minb > 0 && minw > 0) {
  3769. let dlenx = mobj.x - rect.x;
  3770. let dleny = 0;
  3771. let spx = rect.x - dlenx;
  3772. let spy = mobj.y;
  3773. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3774. }
  3775. minb = rect.x + rect.width - bobj.x - 20;
  3776. minw = rect.x + rect.width - mobj.x - 50;
  3777. if (minb > 0 && minw > 0) {
  3778. let dlenx = rect.x + rect.width - mobj.x;
  3779. let dleny = 0;
  3780. let spx = rect.x + rect.width + dlenx;
  3781. let spy = mobj.y;
  3782. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3783. }
  3784. list.sort(function (a, b) {
  3785. return a.order - b.order;
  3786. });
  3787. for (let i = 0; i < list.length; i++) {
  3788. let data = list[i];
  3789. let mx = mobj.x - bobj.x;
  3790. let my = mobj.y - bobj.y;
  3791. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3792. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3793. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3794. if (num > 1)
  3795. num = 1;
  3796. let cos = Math.acos(num);
  3797. if (cos > 1.57)
  3798. cos = 1.57;
  3799. else if (cos < 0.01)
  3800. cos = 0.01;
  3801. let tan = Math.tan(cos);
  3802. let dx = tan * data.dleny;
  3803. let dy = tan * data.dlenx;
  3804. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3805. if (Math.abs(bx - 667) < 40)
  3806. continue;
  3807. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3808. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3809. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3810. this.forceMax = dis * 0.08;
  3811. this.destRot += mis * 0.1;
  3812. this.setKick(bx, by);
  3813. return true;
  3814. }
  3815. }
  3816. }
  3817. }
  3818. else {
  3819. ball = xGame.common.getRandArrEle(this.lineBall);
  3820. }
  3821. }
  3822. else {
  3823. for (let i = 0; i < this.scoreBall.length; i++) {
  3824. if (i < this.scoreBall.length - 1) {
  3825. let rand = 70 + this.aiLv * 10 + i * 10;
  3826. if (xGame.tools.random(0, 100) < rand) {
  3827. ball = this.scoreBall[i];
  3828. break;
  3829. }
  3830. }
  3831. else {
  3832. ball = this.scoreBall[i];
  3833. break;
  3834. }
  3835. }
  3836. score = true;
  3837. this.selectNum++;
  3838. }
  3839. if (!ball)
  3840. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3841. let dx = ball.gameObj.x;
  3842. let dy = ball.gameObj.y;
  3843. let kickAngle = 0;
  3844. if (score) {
  3845. dx = ball.kickPos.x;
  3846. dy = ball.kickPos.y;
  3847. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3848. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3849. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3850. if (adot > 1)
  3851. adot = 1;
  3852. kickAngle = Math.acos(adot) * 57.3;
  3853. if (kickAngle > 45) {
  3854. let kdx = ball.kickPos.x - ball.gameObj.x;
  3855. let kdy = ball.kickPos.y - ball.gameObj.y;
  3856. dx = ball.kickPos.x - kdx * mis * 0.3;
  3857. dy = ball.kickPos.y - kdy * mis * 0.3;
  3858. }
  3859. else
  3860. this.destRot += mis;
  3861. }
  3862. else if (ball.poleAngle != 0) {
  3863. this.destRot += ball.poleAngle;
  3864. }
  3865. if (xGame.common.gameMode == 0) {
  3866. let af = kickAngle * 0.08;
  3867. this.forceMax = ball.hard * 0.1 + af * af;
  3868. }
  3869. this.setKick(dx, dy);
  3870. return ball;
  3871. }
  3872. initHoleBall(arr) {
  3873. this.kickBall = [];
  3874. this.lineBall = [];
  3875. this.scoreBall = [];
  3876. this.holeBall = [];
  3877. this.selectNum = 0;
  3878. this.forceNum = 0;
  3879. this.forceMax = 0;
  3880. this.turnNum = 0;
  3881. let list = arr;
  3882. let holes = xGame.common.gameMgr.holePosList;
  3883. let self = xGame.common.aiPlayer;
  3884. for (let i = 0; i < list.length; i++) {
  3885. let obj = list[i];
  3886. if (!obj)
  3887. continue;
  3888. obj.kickPos.x = 0;
  3889. obj.kickPos.y = 0;
  3890. obj.poleAngle = 0;
  3891. obj.hard = 0;
  3892. obj.borderDis = 0;
  3893. obj.kickAngle = 180;
  3894. let b = obj.gameObj;
  3895. let wbp = this.rootPos;
  3896. let bx = wbp.x - b.x;
  3897. let by = wbp.y - b.y;
  3898. obj.borderDis = xGame.tools.random(0, 100);
  3899. this.kickBall.push(obj);
  3900. if (!this.isLine(wbp, obj))
  3901. continue;
  3902. obj.kickAngle = xGame.tools.random(90, 180);
  3903. obj.kickPos.x = b.x;
  3904. obj.kickPos.y = b.y;
  3905. this.lineBall.push(obj);
  3906. let minDis = 999999;
  3907. let hole = false;
  3908. for (let j = 0; j < holes.length; j++) {
  3909. let hp = holes[j];
  3910. if (bx >= 0 && hp.x > b.x + 100)
  3911. continue;
  3912. if (bx <= 0 && hp.x < b.x - 100)
  3913. continue;
  3914. if (by < -10 && hp.y < wbp.y)
  3915. continue;
  3916. if (by > 10 && hp.y > wbp.y)
  3917. continue;
  3918. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3919. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3920. if (dis < minDis) {
  3921. let dx = b.x - this.tempDir1.x * this.ballSize;
  3922. let dy = b.y - this.tempDir1.y * this.ballSize;
  3923. this.tempDir3.x = this.tempDir1.x;
  3924. this.tempDir3.y = this.tempDir1.y;
  3925. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3926. obj.kickPos.x = dx;
  3927. obj.kickPos.y = dy;
  3928. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3929. if (num > 1)
  3930. num = 1;
  3931. obj.kickAngle = Math.acos(num) * 57.3;
  3932. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3933. dis = dis * 2;
  3934. if (Math.abs(hp.x - 600) < 100)
  3935. dis += 50;
  3936. obj.hard = dis + obj.kickAngle * 3;
  3937. hole = true;
  3938. }
  3939. }
  3940. }
  3941. }
  3942. if (hole) {
  3943. this.scoreBall.push(obj);
  3944. this.holeBall.push(obj);
  3945. }
  3946. }
  3947. this.scoreBall.sort(function (a, b) {
  3948. return a.hard - b.hard;
  3949. });
  3950. this.holeBall.sort(function (a, b) {
  3951. return a.kickAngle - b.kickAngle;
  3952. });
  3953. this.kickBall.sort(function (a, b) {
  3954. return a.borderDis - b.borderDis;
  3955. });
  3956. }
  3957. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3958. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3959. let balls = xGame.common.d2World.ballArr;
  3960. let max = xGame.tools.getDis(hx, hy, bx, by);
  3961. for (let index = 0; index < balls.length; index++) {
  3962. let obj = balls[index];
  3963. if (obj.number == 0)
  3964. continue;
  3965. if (obj.number == bn || obj.number == dn)
  3966. continue;
  3967. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3968. if (dis * dis > max)
  3969. continue;
  3970. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3971. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3972. if (num > 1)
  3973. num = 1;
  3974. if (num < 0)
  3975. continue;
  3976. let gap = Math.sin(Math.acos(num)) * dis;
  3977. if (gap < this.ballSize)
  3978. return true;
  3979. }
  3980. return false;
  3981. }
  3982. isLine(xy, ball) {
  3983. let bx = xy.x;
  3984. let by = xy.y;
  3985. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3986. let dis = ball.getDestDis(xy);
  3987. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3988. let sin = Math.sin(angle);
  3989. let cos = Math.cos(angle);
  3990. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3991. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3992. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3993. let dx = bx + this.tempDir2.x * dis;
  3994. let dy = by + this.tempDir2.y * dis;
  3995. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3996. sin = Math.sin(-angle);
  3997. cos = Math.cos(-angle);
  3998. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3999. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4000. dx = bx + this.tempDir2.x * dis;
  4001. dy = by + this.tempDir2.y * dis;
  4002. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4003. if (isr && isl)
  4004. return false;
  4005. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4006. }
  4007. return true;
  4008. }
  4009. setKick(dx, dy) {
  4010. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4011. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4012. this.tempDir1.x = 0;
  4013. this.tempDir1.y = 1;
  4014. this.tempDir2.y = -this.tempDir2.y;
  4015. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4016. if (num > 1)
  4017. num = 1;
  4018. let rot = Math.acos(num) * 57.3;
  4019. if (this.tempDir2.x < 0)
  4020. rot = 360 - rot;
  4021. this.destRot += rot;
  4022. }
  4023. }
  4024. class ui_UIGame extends fgui.GComponent {
  4025. static createInstance() {
  4026. return (fgui.UIPackage.createObject("game", "UIGame"));
  4027. }
  4028. onConstruct() {
  4029. this.c1 = this.getController("c1");
  4030. this.d3Root = (this.getChild("d3Root"));
  4031. this.clickNode = (this.getChild("clickNode"));
  4032. this.d2Root = (this.getChild("d2Root"));
  4033. this.topNode = (this.getChild("topNode"));
  4034. this.n72 = (this.getChild("n72"));
  4035. this.n40 = (this.getChild("n40"));
  4036. this.rulerNode = (this.getChild("rulerNode"));
  4037. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4038. this.n50 = (this.getChild("n50"));
  4039. this.keduNode = (this.getChild("keduNode"));
  4040. this.powerTxt = (this.getChild("powerTxt"));
  4041. this.powerNode = (this.getChild("powerNode"));
  4042. this.colorNode = (this.getChild("colorNode"));
  4043. this.powerEft = (this.getChild("powerEft"));
  4044. this.myPowerNode = (this.getChild("myPowerNode"));
  4045. this.ganNode = (this.getChild("ganNode"));
  4046. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4047. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4048. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4049. this.skillRod = (this.getChild("skillRod"));
  4050. this.border = (this.getChild("border"));
  4051. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4052. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4053. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4054. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4055. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4056. this.guanyuNode = (this.getChild("guanyuNode"));
  4057. this.helpBtn = (this.getChild("helpBtn"));
  4058. this.wordsBtn = (this.getChild("wordsBtn"));
  4059. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4060. this.returnBtn = (this.getChild("returnBtn"));
  4061. this.ballNode = (this.getChild("ballNode"));
  4062. this.whiteAni = (this.getChild("whiteAni"));
  4063. this.blackAni = (this.getChild("blackAni"));
  4064. this.selfTurn = (this.getChild("selfTurn"));
  4065. this.aiTurn = (this.getChild("aiTurn"));
  4066. this.deskNode = (this.getChild("deskNode"));
  4067. this.moveNode = (this.getChild("moveNode"));
  4068. this.selfTalk = (this.getChild("selfTalk"));
  4069. this.aiTalk = (this.getChild("aiTalk"));
  4070. this.d2Node = (this.getChild("d2Node"));
  4071. this.snowNode = (this.getChild("snowNode"));
  4072. this.guide2 = (this.getChild("guide2"));
  4073. this.guide1 = (this.getChild("guide1"));
  4074. this.guide3 = (this.getChild("guide3"));
  4075. this.guideNode = (this.getChild("guideNode"));
  4076. }
  4077. }
  4078. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4079. class ui_UIGameEnd extends fgui.GComponent {
  4080. static createInstance() {
  4081. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4082. }
  4083. onConstruct() {
  4084. this.c1 = this.getController("c1");
  4085. this.n22 = (this.getChild("n22"));
  4086. this.n2 = (this.getChild("n2"));
  4087. this.n52 = (this.getChild("n52"));
  4088. this.n53 = (this.getChild("n53"));
  4089. this.coinNode = (this.getChild("coinNode"));
  4090. this.closeNode = (this.getChild("closeNode"));
  4091. this.moneyNode = (this.getChild("moneyNode"));
  4092. this.secretary = (this.getChild("secretary"));
  4093. this.n27 = (this.getChild("n27"));
  4094. this.n29 = (this.getChild("n29"));
  4095. this.talkNode = (this.getChild("talkNode"));
  4096. this.n38 = (this.getChild("n38"));
  4097. this.n39 = (this.getChild("n39"));
  4098. this.n40 = (this.getChild("n40"));
  4099. this.awardNode = (this.getChild("awardNode"));
  4100. this.starNumNode = (this.getChild("starNumNode"));
  4101. this.n47 = (this.getChild("n47"));
  4102. this.conditionNode = (this.getChild("conditionNode"));
  4103. this.isGetAward = (this.getChild("isGetAward"));
  4104. this.leftBtn = (this.getChild("leftBtn"));
  4105. this.rightBtn = (this.getChild("rightBtn"));
  4106. this.btnNode = (this.getChild("btnNode"));
  4107. }
  4108. }
  4109. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4110. class ui_UIAddCoin extends fgui.GComponent {
  4111. static createInstance() {
  4112. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4113. }
  4114. onConstruct() {
  4115. this.n11 = (this.getChild("n11"));
  4116. this.myNode = (this.getChild("myNode"));
  4117. this.t0 = this.getTransition("t0");
  4118. }
  4119. }
  4120. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4121. class UIAddCoin extends UIBase {
  4122. constructor() {
  4123. super();
  4124. this.coinNum = 2000;
  4125. }
  4126. onConstructor() {
  4127. this.ui = ui_UIAddCoin.createInstance();
  4128. this.contentPane = this.ui;
  4129. this.isEject = false;
  4130. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4131. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4132. }
  4133. show() {
  4134. super.show();
  4135. this.ui.t0.play();
  4136. }
  4137. videoAddCoin() {
  4138. console.log('zh:qjff_AD_for_UIAddCoin');
  4139. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4140. }
  4141. else {
  4142. console.log('zh:AD 失败,直接发放奖励');
  4143. this.qjff_AD_for_UIAddCoin();
  4144. }
  4145. }
  4146. qjff_AD_for_UIAddCoin() {
  4147. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4148. this.hide();
  4149. }
  4150. }
  4151. UIAddCoin.uiName = "UIAddCoin";
  4152. class ui_UIInvitation extends fgui.GComponent {
  4153. static createInstance() {
  4154. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4155. }
  4156. onConstruct() {
  4157. this.n14 = (this.getChild("n14"));
  4158. this.myNode = (this.getChild("myNode"));
  4159. this.t0 = this.getTransition("t0");
  4160. }
  4161. }
  4162. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4163. class UIInvitation extends UIBase {
  4164. constructor() {
  4165. super();
  4166. }
  4167. onConstructor() {
  4168. this.ui = ui_UIInvitation.createInstance();
  4169. this.contentPane = this.ui;
  4170. this.isEject = false;
  4171. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4172. }
  4173. show() {
  4174. super.show();
  4175. }
  4176. enterGame() {
  4177. xGame.common.gameMode = GameMode.classic;
  4178. DataMgr.setChallengeTimes(1);
  4179. xGame.common.passAwardCoin = 2000;
  4180. let need = xGame.common.classicNiceNeddCoin;
  4181. if (DataMgr.coinEnough(need)) {
  4182. DataMgr.setCoin(-need);
  4183. xGame.eventMgr.event(RESTART_GAME, true);
  4184. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4185. }
  4186. else {
  4187. xGame.eventMgr.event(RESTART_GAME, true);
  4188. }
  4189. this.hide();
  4190. }
  4191. hide() {
  4192. super.hide();
  4193. }
  4194. }
  4195. UIInvitation.uiName = "UIInvitation";
  4196. class ui_UIMain extends fgui.GComponent {
  4197. static createInstance() {
  4198. return (fgui.UIPackage.createObject("game", "UIMain"));
  4199. }
  4200. onConstruct() {
  4201. this.n47 = (this.getChild("n47"));
  4202. this.n10 = (this.getChild("n10"));
  4203. this.secretary = (this.getChild("secretary"));
  4204. this.shopBtn = (this.getChild("shopBtn"));
  4205. this.moneyNode = (this.getChild("moneyNode"));
  4206. this.headNode = (this.getChild("headNode"));
  4207. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4208. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4209. this.classicBtn = (this.getChild("classicBtn"));
  4210. this.globalBtn = (this.getChild("globalBtn"));
  4211. this.n44 = (this.getChild("n44"));
  4212. this.signBtn = (this.getChild("signBtn"));
  4213. this.drawBtn = (this.getChild("drawBtn"));
  4214. this.settingNode = (this.getChild("settingNode"));
  4215. this.n45 = (this.getChild("n45"));
  4216. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4217. this.n46 = (this.getChild("n46"));
  4218. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4219. this.liucheng1 = (this.getChild("liucheng1"));
  4220. this.rightBtn = (this.getChild("rightBtn"));
  4221. this.n75 = (this.getChild("n75"));
  4222. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4223. this.liucheng2 = (this.getChild("liucheng2"));
  4224. this.guideBtn = (this.getChild("guideBtn"));
  4225. this.n73 = (this.getChild("n73"));
  4226. this.wordsNode = (this.getChild("wordsNode"));
  4227. this.enterGuide = (this.getChild("enterGuide"));
  4228. this.talkNode = (this.getChild("talkNode"));
  4229. this.n83 = (this.getChild("n83"));
  4230. this.n84 = (this.getChild("n84"));
  4231. }
  4232. }
  4233. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4234. class ui_UIMoyu extends fgui.GComponent {
  4235. static createInstance() {
  4236. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4237. }
  4238. onConstruct() {
  4239. this.ageTip = (this.getChild("ageTip"));
  4240. this.mainBg = (this.getChild("mainBg"));
  4241. this.xyNode = (this.getChild("xyNode"));
  4242. this.rnNode = (this.getChild("rnNode"));
  4243. this.fcmNode = (this.getChild("fcmNode"));
  4244. this.ageNode = (this.getChild("ageNode"));
  4245. this.tipNode = (this.getChild("tipNode"));
  4246. this.msgNode = (this.getChild("msgNode"));
  4247. }
  4248. }
  4249. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4250. class MoyuMgr {
  4251. static initMoyu() {
  4252. this.moyuView = new MoyuView();
  4253. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4254. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4255. this.moyuView.ui.displayObject.zOrder = 1000;
  4256. this.moyuView.init();
  4257. this.moyuView.showTip(true);
  4258. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4259. window['XApk'] = this;
  4260. }
  4261. static showAge(show) {
  4262. if (this.moyuView)
  4263. this.moyuView.showAge(show);
  4264. }
  4265. static onPlatMsg(idx) {
  4266. if (!MoyuMgr.moyuView)
  4267. return;
  4268. if (idx == '0') {
  4269. MoyuMgr.moyuView.showTip(false);
  4270. }
  4271. }
  4272. static showAgree(call) {
  4273. if (this.moyuView)
  4274. this.moyuView.showAgree(call);
  4275. else
  4276. call && call();
  4277. }
  4278. static showXy(type = 1) {
  4279. if (this.moyuView)
  4280. this.moyuView.showXy(type);
  4281. }
  4282. }
  4283. MoyuMgr.isAdvise = false;
  4284. class MoyuView {
  4285. constructor() {
  4286. this.ysxyNum = 1;
  4287. this.ysJson = null;
  4288. this.ui = ui_UIMoyu.createInstance();
  4289. }
  4290. init() {
  4291. this.ui.mainBg.visible = false;
  4292. this.ui.xyNode.visible = false;
  4293. this.ui.ageNode.visible = false;
  4294. this.ui.tipNode.visible = false;
  4295. this.ui.rnNode.visible = false;
  4296. this.ui.fcmNode.visible = false;
  4297. this.ui.ageTip.visible = false;
  4298. this.ui.msgNode.visible = false;
  4299. this.ui.visible = false;
  4300. this.ui.xyNode.xyList.setVirtual();
  4301. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4302. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4303. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4304. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4305. this.ui.xyNode.btnKnown.visible = false;
  4306. this.ui.xyNode.xy1.visible = false;
  4307. this.ui.xyNode.xy2.visible = false;
  4308. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4309. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4310. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4311. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4312. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4313. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4314. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4315. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4316. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4317. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4318. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4319. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4320. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4321. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4322. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4323. this.ysxyNum = 2;
  4324. }
  4325. }
  4326. onClick(obj) {
  4327. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4328. switch (obj) {
  4329. case this.ui.ageTip:
  4330. if (Moyu.isTTApk) {
  4331. this.ui.ageNode.visible = true;
  4332. this.ui.mainBg.visible = true;
  4333. }
  4334. break;
  4335. case this.ui.tipNode:
  4336. this.showTip(false);
  4337. break;
  4338. case this.ui.ageNode.btnAge:
  4339. this.ui.ageNode.visible = false;
  4340. this.ui.mainBg.visible = false;
  4341. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4342. this.ui.visible = false;
  4343. break;
  4344. case this.ui.xyNode.btnXy3:
  4345. case this.ui.xyNode.btnXy1:
  4346. this.loadXy(1);
  4347. break;
  4348. case this.ui.xyNode.btnXy2:
  4349. this.loadXy(2);
  4350. break;
  4351. case this.ui.xyNode.btnBack:
  4352. this.ui.xyNode.xy1.visible = true;
  4353. this.ui.xyNode.xy2.visible = false;
  4354. break;
  4355. case this.ui.xyNode.btnKnown:
  4356. this.ui.xyNode.visible = false;
  4357. this.ui.mainBg.visible = false;
  4358. this.ui.visible = false;
  4359. break;
  4360. case this.ui.rnNode.btnCheck:
  4361. this.check();
  4362. break;
  4363. case this.ui.rnNode.btnExit:
  4364. case this.ui.xyNode.btnNo:
  4365. this.ysxyNum--;
  4366. if (this.ysxyNum > 0)
  4367. this.showMsg("Refuse to quit the game once again");
  4368. else {
  4369. Moyu.userAgree(false);
  4370. Moyu.exit();
  4371. }
  4372. break;
  4373. case this.ui.xyNode.btnSure:
  4374. case this.ui.xyNode.btnYes:
  4375. DataMgr.userData.isAgree = true;
  4376. DataMgr.saveUserData();
  4377. this.onAgree();
  4378. break;
  4379. case this.ui.rnNode.btnDone:
  4380. this.ui.rnNode.visible = false;
  4381. this.ui.visible = false;
  4382. break;
  4383. case this.ui.fcmNode.btnRn:
  4384. this.showRn();
  4385. break;
  4386. }
  4387. }
  4388. showTip(show) {
  4389. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4390. return;
  4391. if (show) {
  4392. MoyuMgr.isAdvise = true;
  4393. this.ui.visible = true;
  4394. this.ui.tipNode.visible = true;
  4395. this.ui.tipNode.alpha = 1;
  4396. Laya.timer.once(1000, this, this.showTip, [false]);
  4397. }
  4398. else {
  4399. this.ui.tipNode.alpha = 1;
  4400. this.ui.tipNode.visible = true;
  4401. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4402. this.ui.tipNode.visible = false;
  4403. MoyuMgr.isAdvise = false;
  4404. }), 1000);
  4405. }
  4406. }
  4407. showAge(show, px = 0, py = 0) {
  4408. if (Moyu.platType > 10 && !Moyu.isIos) {
  4409. this.ui.ageTip.x = px;
  4410. this.ui.ageTip.y = py;
  4411. this.ui.ageTip.visible = show;
  4412. if (show)
  4413. this.ui.visible = true;
  4414. }
  4415. }
  4416. showAgree(call) {
  4417. this.agreeCall = call;
  4418. this.onAgree();
  4419. return;
  4420. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4421. this.showXy(0);
  4422. }
  4423. else
  4424. this.onAgree();
  4425. }
  4426. onAgree() {
  4427. if (!this.ui.ageNode.visible)
  4428. this.ui.visible = false;
  4429. this.ui.xyNode.visible = false;
  4430. Moyu.userAgree(true);
  4431. this.showAge(false);
  4432. this.agreeCall && this.agreeCall();
  4433. this.showRn();
  4434. }
  4435. showMsg(txt) {
  4436. this.ui.msgNode.txtMsg.text = txt;
  4437. this.ui.msgNode.visible = true;
  4438. this.ui.msgNode.alpha = 1;
  4439. this.ui.visible = true;
  4440. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4441. this.ui.msgNode.visible = false;
  4442. }), 2500, true);
  4443. }
  4444. showRn() {
  4445. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4446. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4447. this.ui.rnNode.rn1.visible = true;
  4448. this.ui.rnNode.rn2.visible = false;
  4449. this.ui.rnNode.rn3.visible = false;
  4450. this.ui.rnNode.rn4.visible = false;
  4451. this.ui.rnNode.visible = true;
  4452. this.ui.mainBg.visible = true;
  4453. this.ui.rnNode.btnDone.visible = false;
  4454. this.ui.rnNode.btnExit.visible = true;
  4455. this.ui.rnNode.btnCheck.visible = true;
  4456. this.ui.fcmNode.visible = false;
  4457. this.ui.visible = true;
  4458. return;
  4459. }
  4460. }
  4461. this.showFcm();
  4462. }
  4463. showFcm() {
  4464. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4465. Moyu.initFCM(true);
  4466. if (Moyu.gameTime < 1)
  4467. this.fcmLoop();
  4468. else if (Moyu.gameTime < 999)
  4469. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4470. }
  4471. }
  4472. fcmLoop() {
  4473. if (Moyu.gameTime < 1) {
  4474. this.ui.rnNode.visible = false;
  4475. this.ui.fcmNode.visible = true;
  4476. this.ui.mainBg.visible = true;
  4477. this.ui.visible = true;
  4478. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4479. Laya.timer.clear(this.ui, this.fcmLoop);
  4480. }
  4481. }
  4482. check() {
  4483. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4484. this.ui.rnNode.rn1.visible = false;
  4485. this.ui.rnNode.rn2.visible = false;
  4486. this.ui.rnNode.rn4.visible = true;
  4487. }
  4488. else if (this.ui.rnNode.rn4.visible) {
  4489. let name = this.ui.rnNode.inputName.text;
  4490. let code = this.ui.rnNode.inputCode.text;
  4491. if (code && code.length == 18) {
  4492. this.ui.rnNode.rn1.visible = false;
  4493. this.ui.rnNode.rn4.visible = false;
  4494. Moyu.authenticate(name, code, (res) => {
  4495. this.ui.rnNode.rn2.visible = !res;
  4496. this.ui.rnNode.rn3.visible = res;
  4497. this.ui.rnNode.btnDone.visible = res;
  4498. this.ui.rnNode.btnExit.visible = !res;
  4499. this.ui.rnNode.btnCheck.visible = !res;
  4500. if (res)
  4501. this.showFcm();
  4502. });
  4503. }
  4504. else
  4505. this.showMsg("信息填写不完整");
  4506. }
  4507. }
  4508. loadXy(type = 0) {
  4509. this.ui.xyNode.xy1.visible = false;
  4510. this.ui.xyNode.xy2.visible = true;
  4511. this.ui.xyNode.xyList.scrollToView(0);
  4512. if (type == 1) {
  4513. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4514. }
  4515. else if (type == 2) {
  4516. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4517. }
  4518. }
  4519. showXy(type = 0) {
  4520. this.xyBtn();
  4521. if (type == 0) {
  4522. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4523. this.ui.xyNode.btnSure.visible = true;
  4524. }
  4525. else {
  4526. this.ui.xyNode.btnYes.visible = true;
  4527. this.ui.xyNode.btnNo.visible = true;
  4528. }
  4529. }
  4530. else {
  4531. this.ui.xyNode.btnKnown.visible = true;
  4532. this.ui.mainBg.visible = true;
  4533. }
  4534. this.ui.xyNode.xy1.visible = true;
  4535. this.ui.xyNode.xy2.visible = false;
  4536. this.ui.xyNode.visible = true;
  4537. this.ui.visible = true;
  4538. }
  4539. xyBtn() {
  4540. this.ui.xyNode.btnSure.visible = false;
  4541. this.ui.xyNode.btnYes.visible = false;
  4542. this.ui.xyNode.btnNo.visible = false;
  4543. this.ui.xyNode.btnKnown.visible = false;
  4544. {
  4545. this.ui.xyNode.btnXy3.visible = false;
  4546. this.ui.xyNode.btnXy2.visible = true;
  4547. this.ui.xyNode.btnXy1.visible = true;
  4548. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4549. }
  4550. }
  4551. createXY(json) {
  4552. this.ysJson = json.content;
  4553. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4554. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4555. this.ui.xyNode.xy2.visible = true;
  4556. }
  4557. renderListItem(idx, cell) {
  4558. let xy = this.ysJson[idx];
  4559. cell.height = xy.line * 30;
  4560. cell.xyItem.text = xy.text;
  4561. }
  4562. onDestroy() {
  4563. this.agreeCall = null;
  4564. }
  4565. }
  4566. class SettingNode {
  4567. constructor(ui) {
  4568. this.showSetting = false;
  4569. this.openSound = true;
  4570. this.openShake = true;
  4571. this.ui = ui;
  4572. this.ui.soundBtn.onClick(this, this.switchSound);
  4573. this.ui.shakeBtn.onClick(this, this.switchShake);
  4574. this.ui.xyBtn.onClick(this, this.onXy);
  4575. this.ui.clickNode.onClick(this, this.changeSetting);
  4576. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4577. this.ui.xyBtn.visible = false;
  4578. this.ui.shakeBtn.visible = false;
  4579. }
  4580. changeSetting() {
  4581. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4582. this.showSetting = !this.showSetting;
  4583. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4584. }
  4585. switchSound() {
  4586. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4587. this.openSound = !this.openSound;
  4588. Moyu.onSetting(this.openSound, this.openShake);
  4589. xGame.soundMgr.onSetting(this.openSound);
  4590. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4591. }
  4592. switchShake() {
  4593. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4594. this.openShake = !this.openShake;
  4595. Moyu.onSetting(this.openSound, this.openShake);
  4596. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4597. }
  4598. onXy() {
  4599. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4600. MoyuMgr.showXy(1);
  4601. }
  4602. }
  4603. class ui_UILevelDisplay extends fgui.GComponent {
  4604. static createInstance() {
  4605. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4606. }
  4607. onConstruct() {
  4608. this.n9 = (this.getChild("n9"));
  4609. this.myNode = (this.getChild("myNode"));
  4610. this.closeNode = (this.getChild("closeNode"));
  4611. }
  4612. }
  4613. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4614. class ui_UILevelProp extends fgui.GComponent {
  4615. static createInstance() {
  4616. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4617. }
  4618. onConstruct() {
  4619. this.n16 = (this.getChild("n16"));
  4620. this.myNode = (this.getChild("myNode"));
  4621. this.closeBtn = (this.getChild("closeBtn"));
  4622. this.moneyNode = (this.getChild("moneyNode"));
  4623. this.t1 = this.getTransition("t1");
  4624. }
  4625. }
  4626. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4627. class ui_ShowItem extends fgui.GComponent {
  4628. static createInstance() {
  4629. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4630. }
  4631. onConstruct() {
  4632. this.myImg = (this.getChild("myImg"));
  4633. }
  4634. }
  4635. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4636. class ShowItem {
  4637. constructor() {
  4638. this.ui = ui_ShowItem.createInstance();
  4639. }
  4640. destroySelf() {
  4641. if (!this.ui.isDisposed) {
  4642. this.ui.removeFromParent();
  4643. this.ui.dispose();
  4644. }
  4645. }
  4646. setParent(parent) {
  4647. parent.addChild(this.ui);
  4648. }
  4649. setPos(x, y) {
  4650. this.ui.x = x;
  4651. this.ui.y = y;
  4652. }
  4653. setUrl(index) {
  4654. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4655. }
  4656. }
  4657. class ui_UIPower extends fgui.GComponent {
  4658. static createInstance() {
  4659. return (fgui.UIPackage.createObject("game", "UIPower"));
  4660. }
  4661. onConstruct() {
  4662. this.n11 = (this.getChild("n11"));
  4663. this.myNode = (this.getChild("myNode"));
  4664. this.t0 = this.getTransition("t0");
  4665. }
  4666. }
  4667. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4668. class UIPower extends UIBase {
  4669. constructor() {
  4670. super();
  4671. }
  4672. onConstructor() {
  4673. this.ui = ui_UIPower.createInstance();
  4674. this.contentPane = this.ui;
  4675. this.isEject = false;
  4676. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4677. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4678. }
  4679. show() {
  4680. super.show();
  4681. this.ui.t0.play();
  4682. }
  4683. videoGetPower() {
  4684. console.log('zh:qjff_AD_for_uipower');
  4685. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4686. }
  4687. else {
  4688. console.log('zh:AD 失败,直接发放奖励');
  4689. this.qjff_AD_for_uipower();
  4690. }
  4691. }
  4692. qjff_AD_for_uipower() {
  4693. DataMgr.setPower(xGame.common.videoPower, true);
  4694. xGame.eventMgr.event(POWER_TIME);
  4695. this.hide();
  4696. }
  4697. }
  4698. UIPower.uiName = "UIPower";
  4699. class UILevelProp extends UIBase {
  4700. constructor() {
  4701. super();
  4702. this.firstPos = 385;
  4703. this.secondPos = 467;
  4704. this.showItemArr = [];
  4705. }
  4706. onFontLoaded() {
  4707. try {
  4708. this.ui.myNode.conditionTxt.font = "arial";
  4709. console.log("zh: onFontLoaded 设置arial字体成功");
  4710. }
  4711. catch (error) {
  4712. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4713. }
  4714. }
  4715. onConstructor() {
  4716. this.ui = ui_UILevelProp.createInstance();
  4717. this.contentPane = this.ui;
  4718. this.isEject = false;
  4719. this.addUIClick(this.ui.closeBtn, this.hide);
  4720. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4721. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4722. }
  4723. show(level) {
  4724. super.show();
  4725. this.ui.t1.play();
  4726. this.level = level;
  4727. this.data = cfgTable.placeballData[this.level];
  4728. this.updateSelf();
  4729. this.showPreView();
  4730. this.moneyNode.ui.c1.selectedIndex = 2;
  4731. this.moneyNode.checkPowerTime();
  4732. this.moneyNode.powerChange();
  4733. }
  4734. showPreView() {
  4735. let item;
  4736. let data;
  4737. for (let index = 0; index < this.showItemArr.length; index++) {
  4738. item = this.showItemArr[index];
  4739. item.destroySelf();
  4740. }
  4741. this.showItemArr = [];
  4742. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4743. for (const key in cfgData) {
  4744. data = cfgData[key];
  4745. item = new ShowItem();
  4746. item.setParent(this.ui.myNode.displayRoot);
  4747. item.setPos(data.x, data.y);
  4748. item.setUrl(data.value);
  4749. this.showItemArr.push(item);
  4750. }
  4751. }
  4752. updateSelf() {
  4753. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4754. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4755. if (this.data.ball == -1) {
  4756. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4757. }
  4758. else {
  4759. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4760. }
  4761. let localData = DataMgr.getPlaceBallLevel(this.level);
  4762. let getAward = localData.getAward;
  4763. let cfg = cfgTable.placeballData[this.level];
  4764. let coin = this.data.award[0];
  4765. let diamond = this.data.award[1];
  4766. if (cfg.type == PlaceBallType.challenge) {
  4767. diamond = 0;
  4768. coin = 100;
  4769. }
  4770. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4771. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4772. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4773. if (cfg.type == PlaceBallType.challenge) {
  4774. this.ui.myNode.coinNode.numTxt.text = "";
  4775. }
  4776. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4777. if (coin > 0 && diamond > 0) {
  4778. this.ui.myNode.diamondNode.x = 385;
  4779. this.ui.myNode.coinNode.x = 467;
  4780. }
  4781. else {
  4782. this.ui.myNode.diamondNode.x = 385;
  4783. this.ui.myNode.coinNode.x = 385;
  4784. }
  4785. if (!getAward) {
  4786. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4787. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4788. }
  4789. else {
  4790. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4791. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4792. }
  4793. }
  4794. startGame() {
  4795. if (DataMgr.powerEnough()) {
  4796. this.ui.myNode.startBtn.touchable = false;
  4797. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4798. console.log('zh:startGame ');
  4799. this.ui.myNode.startBtn.touchable = true;
  4800. DataMgr.setPower(-1);
  4801. xGame.eventMgr.event(POWER_TIME);
  4802. xGame.common.gameMode = GameMode.placeBall;
  4803. xGame.common.placeBallCurLevel = this.level;
  4804. xGame.uiMgr.Show(UIGame);
  4805. xGame.uiMgr.Hide(UILevelDisplay);
  4806. xGame.uiMgr.Hide(UIMain);
  4807. this.hide();
  4808. }));
  4809. }
  4810. else {
  4811. console.log('zh:startGame no power');
  4812. xGame.uiMgr.Show(UIPower);
  4813. }
  4814. }
  4815. hide() {
  4816. super.hide();
  4817. }
  4818. }
  4819. UILevelProp.uiName = "UILevelProp";
  4820. class PutBallLevelDisplay {
  4821. constructor(ui, index) {
  4822. this.index = 0;
  4823. this.ui = ui;
  4824. this.index = index;
  4825. this.ui.onClick(this, this.clickSelf);
  4826. this.updateSelf();
  4827. this.ui.levelTxt.text = (this.index + 1) + "";
  4828. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4829. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4830. }
  4831. updateSelf() {
  4832. let level = this.index + 1;
  4833. this.data = DataMgr.getPlaceBallLevel(level);
  4834. this.ui.starNode.c1.selectedIndex = this.data.star;
  4835. let isChallenge = cfgTable.placeballData[level].type;
  4836. if (this.data.isCur) {
  4837. if (isChallenge) {
  4838. this.ui.c1.selectedIndex = 5;
  4839. }
  4840. else {
  4841. this.ui.c1.selectedIndex = 2;
  4842. }
  4843. }
  4844. else {
  4845. if (this.data.play) {
  4846. if (this.data.star == 3) {
  4847. this.ui.c1.selectedIndex = 0;
  4848. }
  4849. else {
  4850. this.ui.c1.selectedIndex = 1;
  4851. }
  4852. }
  4853. else {
  4854. if (isChallenge) {
  4855. this.ui.c1.selectedIndex = 4;
  4856. }
  4857. else {
  4858. this.ui.c1.selectedIndex = 3;
  4859. }
  4860. }
  4861. }
  4862. }
  4863. clickSelf() {
  4864. if (!this.data.play)
  4865. return;
  4866. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4867. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4868. }
  4869. }
  4870. class UILevelDisplay extends UIBase {
  4871. constructor() {
  4872. super();
  4873. }
  4874. onConstructor() {
  4875. this.ui = ui_UILevelDisplay.createInstance();
  4876. this.contentPane = this.ui;
  4877. this.isEject = false;
  4878. this.myList = this.ui.myNode.myList;
  4879. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4880. this.levelItemArr = [];
  4881. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4882. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4883. this.myList.numItems = levelNum;
  4884. if (Moyu.isKs)
  4885. this.ui.closeNode.closeBtn.x += 100;
  4886. }
  4887. levelItemRender(index, target) {
  4888. let item = new PutBallLevelDisplay(target, index);
  4889. this.levelItemArr.push(item);
  4890. }
  4891. show() {
  4892. super.show();
  4893. this.updateLevel();
  4894. this.scrollToPlace();
  4895. }
  4896. updateLevel() {
  4897. let temp;
  4898. for (let index = 0; index < this.levelItemArr.length; index++) {
  4899. temp = this.levelItemArr[index];
  4900. temp.updateSelf();
  4901. }
  4902. }
  4903. scrollToPlace() {
  4904. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4905. let passArr = DataMgr.getPlaceBallLevelList();
  4906. let offest = passArr.length;
  4907. if (offest >= maxNum - 1)
  4908. offest = maxNum - 1;
  4909. this.myList.scrollToView(offest, true, true);
  4910. }
  4911. hide() {
  4912. super.hide();
  4913. }
  4914. }
  4915. UILevelDisplay.uiName = "UILevelDisplay";
  4916. class ui_UIMatching extends fgui.GComponent {
  4917. static createInstance() {
  4918. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4919. }
  4920. onConstruct() {
  4921. this.n5 = (this.getChild("n5"));
  4922. this.n49 = (this.getChild("n49"));
  4923. this.n51 = (this.getChild("n51"));
  4924. this.n64 = (this.getChild("n64"));
  4925. this.n2 = (this.getChild("n2"));
  4926. this.n53 = (this.getChild("n53"));
  4927. this.n54 = (this.getChild("n54"));
  4928. this.n56 = (this.getChild("n56"));
  4929. this.n58 = (this.getChild("n58"));
  4930. this.n59 = (this.getChild("n59"));
  4931. this.n57 = (this.getChild("n57"));
  4932. this.n60 = (this.getChild("n60"));
  4933. this.n62 = (this.getChild("n62"));
  4934. this.awardTxt = (this.getChild("awardTxt"));
  4935. this.n61 = (this.getChild("n61"));
  4936. this.selfHead = (this.getChild("selfHead"));
  4937. this.aiHead = (this.getChild("aiHead"));
  4938. this.n82 = (this.getChild("n82"));
  4939. this.n84 = (this.getChild("n84"));
  4940. this.n83 = (this.getChild("n83"));
  4941. this.t1 = this.getTransition("t1");
  4942. this.t2 = this.getTransition("t2");
  4943. this.t3 = this.getTransition("t3");
  4944. this.t4 = this.getTransition("t4");
  4945. }
  4946. }
  4947. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4948. class UIMatching extends UIBase {
  4949. constructor() {
  4950. super();
  4951. }
  4952. onConstructor() {
  4953. this.ui = ui_UIMatching.createInstance();
  4954. this.contentPane = this.ui;
  4955. this.isEject = false;
  4956. }
  4957. show(callback) {
  4958. super.show();
  4959. PlatMgr.showBanner(true);
  4960. this.callback = callback;
  4961. let user = Moyu.getUserInfo();
  4962. if (!this.selfPot) {
  4963. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4964. }
  4965. if (!this.aiPot) {
  4966. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4967. }
  4968. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4969. this.ui.selfHead.nameTxt.text = user.nickName;
  4970. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4971. this.ui.aiHead.nameTxt.text = "???";
  4972. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4973. this.ui.selfHead.c1.selectedIndex = 0;
  4974. this.ui.aiHead.c1.selectedIndex = 0;
  4975. this.ui.selfHead.x = this.selfPot.x;
  4976. this.ui.selfHead.y = this.selfPot.y;
  4977. this.ui.aiHead.x = this.aiPot.x;
  4978. this.ui.aiHead.y = this.aiPot.y;
  4979. switch (xGame.common.gameMode) {
  4980. case GameMode.classic:
  4981. break;
  4982. case GameMode.bigMove:
  4983. this.initSkillData();
  4984. break;
  4985. default:
  4986. break;
  4987. }
  4988. this.ui.t1.play(Laya.Handler.create(this, () => {
  4989. this.ui.t2.play(Laya.Handler.create(this, () => {
  4990. switch (xGame.common.gameMode) {
  4991. case GameMode.classic:
  4992. this.waitingPeople();
  4993. break;
  4994. case GameMode.bigMove:
  4995. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4996. break;
  4997. default:
  4998. break;
  4999. }
  5000. }));
  5001. }));
  5002. }
  5003. initSkillData() {
  5004. this.skillSelectData = [];
  5005. let skillUrl = xGame.common.skillIconList;
  5006. let skillName = xGame.common.skillNameList;
  5007. let skillLevel = DataMgr.getBigSkillList();
  5008. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5009. for (let index = 0; index < 5; index++) {
  5010. let obj = {};
  5011. obj.skillImg = skillUrl[index];
  5012. obj.skillName = skillName[index];
  5013. obj.skillType = skillType[index];
  5014. obj.skillLevel = skillLevel[index];
  5015. this.skillSelectData.push(obj);
  5016. }
  5017. }
  5018. getAISkillLevel(myLevel) {
  5019. let video = xGame.common.upSkillLevel;
  5020. let aiLevel;
  5021. let temp;
  5022. if (video) {
  5023. temp = xGame.common.randomNum(-2, -1);
  5024. }
  5025. else {
  5026. if (myLevel <= 5) {
  5027. temp = xGame.common.randomNum(1, 3);
  5028. }
  5029. else if (myLevel <= 9) {
  5030. temp = xGame.common.randomNum(-2, 1);
  5031. }
  5032. else {
  5033. temp = xGame.common.randomNum(-4, 0);
  5034. }
  5035. }
  5036. aiLevel = temp + myLevel;
  5037. if (aiLevel <= 1)
  5038. aiLevel = 1;
  5039. if (aiLevel >= 10)
  5040. aiLevel = 10;
  5041. return aiLevel;
  5042. }
  5043. getAISkillType() {
  5044. return xGame.common.randomNum(1, 4);
  5045. let successTimes = DataMgr.getSkillSuccessTimes();
  5046. let info = cfgTable.aiskillData[successTimes];
  5047. if (!info) {
  5048. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5049. info = cfgTable.aiskillData[max];
  5050. }
  5051. let dataArr = info.skillselect;
  5052. let myCfg = {};
  5053. for (let index = 0; index < dataArr.length; index++) {
  5054. let temp = dataArr[index].split('-');
  5055. myCfg[temp[0]] = {};
  5056. myCfg[temp[0]].id = parseInt(temp[0]);
  5057. myCfg[temp[0]].weight = parseInt(temp[1]);
  5058. }
  5059. let aiCfg = xGame.common.initWeight(myCfg);
  5060. let curData = xGame.common.getRandomWeightData(aiCfg);
  5061. return parseInt(curData.id);
  5062. }
  5063. getAISkillData(index) {
  5064. let myLevel = this.skillSelectData[index].skillLevel;
  5065. let aiLevel = this.getAISkillLevel(myLevel);
  5066. let aiType = this.getAISkillType() - 1;
  5067. return { aiLevel, aiType } = { aiLevel, aiType };
  5068. }
  5069. skillSelectFinish(index) {
  5070. let aiInfo = this.getAISkillData(index);
  5071. xGame.common.gameMgr.selfCurSkill = index;
  5072. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5073. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5074. this.ui.selfHead.c1.selectedIndex = 1;
  5075. this.ui.aiHead.c1.selectedIndex = 1;
  5076. let myData = this.skillSelectData[index];
  5077. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5078. let guide = DataMgr.getSkillGuide();
  5079. if (guide == 0) {
  5080. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5081. }
  5082. else {
  5083. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5084. }
  5085. let aiData = this.skillSelectData[aiInfo.aiType];
  5086. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5087. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5088. this.waitingPeople();
  5089. }
  5090. waitingPeople() {
  5091. let time = xGame.common.randomNum(1000, 3000);
  5092. time += 1000;
  5093. Laya.timer.once(time, this, () => {
  5094. this.matchingSuccess();
  5095. });
  5096. }
  5097. matchingSuccess() {
  5098. let gameUI = xGame.common.gameUI;
  5099. let name = gameUI.ui.topNode.aiNameTxt.text;
  5100. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5101. this.ui.aiHead.nameTxt.text = name;
  5102. this.ui.aiHead.headImg.url = url;
  5103. name = gameUI.ui.topNode.selfNameTxt.text;
  5104. url = gameUI.ui.topNode.selfHeadLoader.url;
  5105. this.ui.selfHead.nameTxt.text = name;
  5106. this.ui.selfHead.headImg.url = url;
  5107. this.ui.t3.play(Laya.Handler.create(this, () => {
  5108. this.callback && this.callback();
  5109. this.ui.t4.play(Laya.Handler.create(this, () => {
  5110. this.destroySelf();
  5111. }));
  5112. }));
  5113. }
  5114. destroySelf() {
  5115. this.callback = null;
  5116. this.skillSelectData = null;
  5117. this.selfPot = null;
  5118. this.aiPot = null;
  5119. if (!this.ui.isDisposed) {
  5120. this.ui.removeFromParent();
  5121. this.ui.dispose();
  5122. }
  5123. xGame.uiMgr.destroyUI(this);
  5124. }
  5125. }
  5126. UIMatching.uiName = "UIMatching";
  5127. class ui_UIRanking extends fgui.GComponent {
  5128. static createInstance() {
  5129. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5130. }
  5131. onConstruct() {
  5132. this.n26 = (this.getChild("n26"));
  5133. this.myNode = (this.getChild("myNode"));
  5134. }
  5135. }
  5136. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5137. class UIRanking extends UIBase {
  5138. constructor() {
  5139. super();
  5140. this.showSelf = true;
  5141. this.rankType = 1;
  5142. this.rankList = [];
  5143. this.myIndex = 0;
  5144. this.myStar = 0;
  5145. }
  5146. onConstructor() {
  5147. this.ui = ui_UIRanking.createInstance();
  5148. this.contentPane = this.ui;
  5149. this.isEject = false;
  5150. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5151. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5152. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5153. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5154. this.ui.myNode.myList.setVirtual();
  5155. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5156. }
  5157. show() {
  5158. super.show();
  5159. this.myIndex = 51;
  5160. Moyu.getRankList({
  5161. rankId: xGame.common.curRankID,
  5162. type: MoyuRankType.total,
  5163. page: 1,
  5164. pageSize: 50,
  5165. }, this, this.updateItemData);
  5166. this.updateSelf();
  5167. let self = Moyu.getUserInfo();
  5168. if (!self.isAuth) {
  5169. Moyu.initUser(this, () => {
  5170. DataMgr.upRankData();
  5171. });
  5172. }
  5173. }
  5174. updateSelfItem() {
  5175. let self = Moyu.getUserInfo();
  5176. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5177. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  5178. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5179. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  5180. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5181. }
  5182. updateItemData(data) {
  5183. this.myStar = xGame.common.getAllStarNum();
  5184. if (this.rankList.length < 2) {
  5185. this.rankList = data;
  5186. let self = Moyu.getUserInfo();
  5187. for (let i = 0; i < data.length; i++) {
  5188. let data = this.rankList[i];
  5189. if (data.userId == self.userId) {
  5190. this.rankList.splice(i, 1);
  5191. break;
  5192. }
  5193. }
  5194. for (let i = 0; i < data.length; i++) {
  5195. let data = this.rankList[i];
  5196. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5197. this.myIndex = i + 1;
  5198. let user = { headIcon: self.headIcon, nickName: "myself" };
  5199. let ud = { user: user, data: {} };
  5200. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5201. if (Moyu.platType < 11) {
  5202. user.headIcon = self.headIcon;
  5203. user.nickName = self.nickName;
  5204. }
  5205. this.rankList.splice(i, 0, md);
  5206. break;
  5207. }
  5208. }
  5209. }
  5210. this.updateSelfItem();
  5211. this.ui.myNode.myList.numItems = this.rankList.length;
  5212. }
  5213. updateItemUI(index, obj) {
  5214. let data = this.rankList[index];
  5215. let userData = JSON.parse(data.userData).user;
  5216. obj.nameTxt.text = userData.nickName.toString();
  5217. obj.valueTxt.text = data.rankScore;
  5218. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5219. obj.rankTxt.text = index + 1;
  5220. switch (index) {
  5221. case 0:
  5222. this.setImg(obj, 1, 0, 0);
  5223. obj.rankTxt.color = "#FFC047";
  5224. break;
  5225. case 1:
  5226. this.setImg(obj, 0, 1, 0);
  5227. obj.rankTxt.color = "#ACACAC";
  5228. break;
  5229. case 2:
  5230. this.setImg(obj, 0, 0, 1);
  5231. obj.rankTxt.color = "#D09672";
  5232. break;
  5233. default:
  5234. this.setImg(obj, 0, 0, 0);
  5235. obj.rankTxt.color = "#496FAB";
  5236. break;
  5237. }
  5238. }
  5239. setImg(obj, a, b, c) {
  5240. obj.img1.visible = a ? true : false;
  5241. obj.img2.visible = b ? true : false;
  5242. obj.img3.visible = c ? true : false;
  5243. }
  5244. changeList(type) {
  5245. this.rankType = type;
  5246. this.updateSelf();
  5247. }
  5248. changeSelfNode() {
  5249. this.showSelf = !this.showSelf;
  5250. this.updateSelf();
  5251. }
  5252. updateSelf() {
  5253. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5254. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5255. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5256. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5257. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5258. }
  5259. }
  5260. UIRanking.uiName = "UIRanking";
  5261. class ui_UISecretary extends fgui.GComponent {
  5262. static createInstance() {
  5263. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5264. }
  5265. onConstruct() {
  5266. this.n0 = (this.getChild("n0"));
  5267. this.myNode = (this.getChild("myNode"));
  5268. this.closeBtn = (this.getChild("closeBtn"));
  5269. this.t0 = this.getTransition("t0");
  5270. }
  5271. }
  5272. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5273. class UISecretary extends UIBase {
  5274. constructor() {
  5275. super();
  5276. this.curIndex = 1;
  5277. }
  5278. onConstructor() {
  5279. this.ui = ui_UISecretary.createInstance();
  5280. this.contentPane = this.ui;
  5281. this.isEject = false;
  5282. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5283. this.nodeObj = { left: null, right: null, cur: null };
  5284. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5285. }
  5286. show() {
  5287. super.show();
  5288. this.ui.t0.play();
  5289. this.updateData();
  5290. }
  5291. addSecretarySpine(node, spineName) {
  5292. if (spineName == "mishu") {
  5293. if (this.secretarySpine1) {
  5294. node.displayObject.destroyChildren();
  5295. this.playWoman(this.secretarySpine1, node.displayObject);
  5296. }
  5297. else {
  5298. let spine1 = new SpineMgr("mishu", () => {
  5299. this.secretarySpine1 = spine1;
  5300. this.playWoman(this.secretarySpine1, node.displayObject);
  5301. });
  5302. }
  5303. }
  5304. else {
  5305. if (this.secretarySpine2) {
  5306. node.displayObject.destroyChildren();
  5307. this.playWoman(this.secretarySpine2, node.displayObject);
  5308. }
  5309. else {
  5310. let spine2 = new SpineMgr("xiaomishu2", () => {
  5311. this.secretarySpine2 = spine2;
  5312. this.playWoman(this.secretarySpine2, node.displayObject);
  5313. });
  5314. }
  5315. }
  5316. }
  5317. playWoman(node, parent) {
  5318. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5319. let yy = this.ui.myNode.gameNode3.secretary.height;
  5320. let scale = 1.5;
  5321. if (node == this.secretarySpine2) {
  5322. scale = 1.2;
  5323. }
  5324. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5325. node.play(data, 0, true, parent);
  5326. }
  5327. turnLeft() {
  5328. this.curIndex--;
  5329. if (this.curIndex < 1) {
  5330. this.curIndex = 2;
  5331. }
  5332. let left = this.nodeObj.left;
  5333. let right = this.nodeObj.right;
  5334. let cur = this.nodeObj.cur;
  5335. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5336. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5337. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5338. this.updateData();
  5339. }));
  5340. this.ui.myNode.setChildIndex(right, 2);
  5341. this.nodeObj.left = cur;
  5342. this.nodeObj.right = left;
  5343. this.nodeObj.cur = right;
  5344. }
  5345. turnRight() {
  5346. this.curIndex++;
  5347. if (this.curIndex > 2) {
  5348. this.curIndex = 1;
  5349. }
  5350. let left = this.nodeObj.left;
  5351. let right = this.nodeObj.right;
  5352. let cur = this.nodeObj.cur;
  5353. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5354. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5355. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5356. this.updateData();
  5357. }));
  5358. this.ui.myNode.setChildIndex(left, 2);
  5359. this.nodeObj.left = right;
  5360. this.nodeObj.right = cur;
  5361. this.nodeObj.cur = left;
  5362. }
  5363. updateData() {
  5364. let data = cfgTable.secretaryshopData;
  5365. let children = this.ui.myNode._children;
  5366. let temp;
  5367. let curData;
  5368. for (let index = 0; index < children.length; index++) {
  5369. temp = children[index];
  5370. curData = data[1];
  5371. temp.heightTxt.text = curData.height;
  5372. temp.foodTxt.text = curData.food;
  5373. temp.historyTxt.text = curData.history;
  5374. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5375. this.addSecretarySpine(temp.secretary, curData.spine);
  5376. let womanIndex = curData.id - 1;
  5377. let getWoman = DataMgr.getSecretary(womanIndex);
  5378. let curUse = DataMgr.getCurSecretary();
  5379. if (getWoman) {
  5380. if (curUse == womanIndex) {
  5381. temp.purchaseBtn.c1.selectedIndex = 1;
  5382. }
  5383. else {
  5384. temp.purchaseBtn.c1.selectedIndex = 2;
  5385. }
  5386. }
  5387. else {
  5388. temp.purchaseBtn.c1.selectedIndex = 0;
  5389. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5390. }
  5391. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5392. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5393. }
  5394. }
  5395. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5396. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5397. if (getWoman) {
  5398. if (curUse != womanIndex) {
  5399. console.log();
  5400. DataMgr.setCurSecretary(womanIndex);
  5401. this.updateData();
  5402. }
  5403. }
  5404. else {
  5405. let need = needDiamond;
  5406. if (DataMgr.diamondEnough(need)) {
  5407. DataMgr.setDiamond(-need);
  5408. DataMgr.setSecretary(womanIndex, 1);
  5409. DataMgr.setCurSecretary(womanIndex);
  5410. this.updateData();
  5411. }
  5412. else {
  5413. xGame.uiMgr.Show(UIAddProp, 1);
  5414. }
  5415. }
  5416. }
  5417. closeSelf() {
  5418. this.hide();
  5419. }
  5420. }
  5421. UISecretary.uiName = "UISecretary";
  5422. class ui_UIShop extends fgui.GComponent {
  5423. static createInstance() {
  5424. return (fgui.UIPackage.createObject("game", "UIShop"));
  5425. }
  5426. onConstruct() {
  5427. this.n48 = (this.getChild("n48"));
  5428. this.n0 = (this.getChild("n0"));
  5429. this.secretary = (this.getChild("secretary"));
  5430. this.talkNode = (this.getChild("talkNode"));
  5431. this.closeNode = (this.getChild("closeNode"));
  5432. this.moneyNode = (this.getChild("moneyNode"));
  5433. this.myNode = (this.getChild("myNode"));
  5434. }
  5435. }
  5436. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5437. class BallRodDisplay {
  5438. constructor(ui, index) {
  5439. this.index = 0;
  5440. this.uiIndex = 0;
  5441. this.ui = ui;
  5442. this.index = index;
  5443. this.initData();
  5444. }
  5445. initData() {
  5446. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5447. let data = cfgTable.ballrodData[this.index + 1];
  5448. this.ui.nameTxt.text = data.name;
  5449. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5450. this.ui.levelNode.c1.selectedIndex = data.quality;
  5451. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5452. if (data.spine) {
  5453. this.mySpine = new SpineMgr(data.spine, () => {
  5454. let xx = 150;
  5455. let yy = 70;
  5456. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5457. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5458. });
  5459. }
  5460. }
  5461. updateSelf() {
  5462. let get = DataMgr.getBallRod(this.index);
  5463. if (get == null)
  5464. get = 1;
  5465. let curUse = DataMgr.getCurBallRod();
  5466. if (get) {
  5467. if (curUse == this.index) {
  5468. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5469. }
  5470. else {
  5471. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5472. }
  5473. }
  5474. else {
  5475. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5476. }
  5477. }
  5478. buyBallRod() {
  5479. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5480. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5481. switch (selectedIndex) {
  5482. case 0:
  5483. break;
  5484. case 1:
  5485. DataMgr.setCurBallRod(this.index);
  5486. let ui = xGame.uiMgr.getUI(UIShop);
  5487. ui.updateBallRod();
  5488. break;
  5489. case 2:
  5490. let data = cfgTable.ballrodData[this.index + 1];
  5491. let need = data.price;
  5492. if (DataMgr.diamondEnough(need)) {
  5493. DataMgr.setDiamond(-need);
  5494. DataMgr.setBallRod(this.index, 1);
  5495. DataMgr.setCurBallRod(this.index);
  5496. let ui = xGame.uiMgr.getUI(UIShop);
  5497. ui.updateBallRod();
  5498. }
  5499. else {
  5500. xGame.uiMgr.Show(UIAddProp, 1);
  5501. }
  5502. break;
  5503. default:
  5504. break;
  5505. }
  5506. }
  5507. }
  5508. class UIShop extends UIBase {
  5509. constructor() {
  5510. super();
  5511. this.itemNums = 0;
  5512. }
  5513. onConstructor() {
  5514. this.ui = ui_UIShop.createInstance();
  5515. this.contentPane = this.ui;
  5516. this.isEject = false;
  5517. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5518. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5519. this.addUIClick(this.ui, this.interuptSecretary);
  5520. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5521. this.ballRodArr = [];
  5522. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5523. this.ui.myNode.myList.numItems = this.itemNums;
  5524. if (Moyu.isKs)
  5525. this.ui.closeNode.closeBtn.x += 100;
  5526. }
  5527. show() {
  5528. super.show();
  5529. this.playSecretaryIdle();
  5530. this.updateBallRod();
  5531. }
  5532. updateBallRod() {
  5533. for (let index = 0; index < this.ballRodArr.length; index++) {
  5534. this.ballRodArr[index].updateSelf();
  5535. }
  5536. }
  5537. renderBallRod(sort, obj) {
  5538. let index = this.getIndexBySort(sort + 1) - 1;
  5539. let ballRod = new BallRodDisplay(obj, index);
  5540. this.ballRodArr.push(ballRod);
  5541. }
  5542. getIndexBySort(sort) {
  5543. let object = cfgTable.ballrodData;
  5544. for (const key in object) {
  5545. if (object[key].sort == sort) {
  5546. return parseInt(key);
  5547. }
  5548. }
  5549. }
  5550. playSecretaryIdle() {
  5551. let parent = this.ui.secretary.displayObject;
  5552. parent.destroyChildren();
  5553. let xx = this.ui.secretary.width / 2;
  5554. let yy = this.ui.secretary.height;
  5555. let scale = xGame.common.getSecretaryScale();
  5556. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5557. xGame.common.secretary.play(data, 0, true, parent);
  5558. }
  5559. interuptSecretary() {
  5560. Laya.timer.clearAll(this);
  5561. this.playSecretaryRandomSound();
  5562. }
  5563. playSecretaryRandomSound() {
  5564. if (this.isHide)
  5565. return;
  5566. let time = xGame.common.randomNum(45000, 60000);
  5567. Laya.timer.once(time, this, () => {
  5568. if (this.isHide)
  5569. return;
  5570. let index = xGame.common.randomNum(4, 7);
  5571. xGame.soundMgr.playSound("s_main0" + index);
  5572. let words = 1;
  5573. switch (index) {
  5574. case 4:
  5575. words = 5;
  5576. break;
  5577. case 5:
  5578. words = 3;
  5579. break;
  5580. case 6:
  5581. words = 6;
  5582. break;
  5583. case 7:
  5584. words = 7;
  5585. break;
  5586. default:
  5587. break;
  5588. }
  5589. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5590. this.playSecretaryRandomSound();
  5591. });
  5592. }
  5593. closeSelf() {
  5594. this.hide();
  5595. }
  5596. }
  5597. UIShop.uiName = "UIShop";
  5598. class ui_UISign extends fgui.GComponent {
  5599. static createInstance() {
  5600. return (fgui.UIPackage.createObject("game", "UISign"));
  5601. }
  5602. onConstruct() {
  5603. this.n6 = (this.getChild("n6"));
  5604. this.closeNode = (this.getChild("closeNode"));
  5605. this.myNode = (this.getChild("myNode"));
  5606. this.moneyNode = (this.getChild("moneyNode"));
  5607. this.secretary = (this.getChild("secretary"));
  5608. this.talkNode = (this.getChild("talkNode"));
  5609. this.tripleBtn = (this.getChild("tripleBtn"));
  5610. this.normalBtn = (this.getChild("normalBtn"));
  5611. this.tipsNode = (this.getChild("tipsNode"));
  5612. this.againBtn = (this.getChild("againBtn"));
  5613. this.t0 = this.getTransition("t0");
  5614. }
  5615. }
  5616. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5617. class SignMax {
  5618. constructor(ui) {
  5619. this.ui = ui;
  5620. }
  5621. updateSelf(index, sameDay, curDayIndex) {
  5622. let data = cfgTable.signData[index + 1];
  5623. this.ui.titleTxt.text = data.title;
  5624. let arr1 = data.award[0].split('-');
  5625. let arr2 = data.award[1].split('-');
  5626. let num1 = parseInt(arr1[1]);
  5627. let num2 = parseInt(arr2[1]);
  5628. this.ui.numTxt1.text = num1 + "";
  5629. this.ui.numTxt2.text = num2 + "";
  5630. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5631. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5632. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5633. this.ui.numTxt1.visible = false;
  5634. }
  5635. else {
  5636. this.ui.numTxt1.visible = true;
  5637. }
  5638. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5639. this.ui.numTxt2.visible = false;
  5640. }
  5641. else {
  5642. this.ui.numTxt2.visible = true;
  5643. }
  5644. if (index < curDayIndex) {
  5645. this.ui.c1.selectedIndex = 1;
  5646. }
  5647. else if (index == curDayIndex) {
  5648. if (sameDay) {
  5649. this.ui.c1.selectedIndex = 2;
  5650. }
  5651. else {
  5652. this.ui.c1.selectedIndex = 2;
  5653. }
  5654. }
  5655. else {
  5656. this.ui.c1.selectedIndex = 0;
  5657. }
  5658. }
  5659. }
  5660. class SignNormal {
  5661. constructor(ui) {
  5662. this.ui = ui;
  5663. }
  5664. updateSelf(index, sameDay, curDayIndex) {
  5665. let data = cfgTable.signData[index + 1];
  5666. this.ui.titleTxt.text = data.title;
  5667. let arr = data.award[0].split('-');
  5668. let type = parseInt(arr[0]);
  5669. let num = parseInt(arr[1]);
  5670. this.ui.numTxt.text = num + "";
  5671. if (type > 2) {
  5672. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5673. this.ui.myIcon.rotation = 0;
  5674. }
  5675. else {
  5676. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5677. this.ui.myIcon.rotation = 0;
  5678. }
  5679. if (xGame.common.signAwardContainsRod(data.award)) {
  5680. this.ui.numTxt.visible = false;
  5681. }
  5682. else {
  5683. this.ui.numTxt.visible = true;
  5684. }
  5685. if (index < curDayIndex) {
  5686. this.ui.c1.selectedIndex = 1;
  5687. }
  5688. else if (index == curDayIndex) {
  5689. if (sameDay) {
  5690. this.ui.c1.selectedIndex = 2;
  5691. }
  5692. else {
  5693. this.ui.c1.selectedIndex = 2;
  5694. }
  5695. }
  5696. else {
  5697. this.ui.c1.selectedIndex = 0;
  5698. }
  5699. }
  5700. }
  5701. class UISign extends UIBase {
  5702. constructor() {
  5703. super();
  5704. this.curDayIndex = 0;
  5705. this.starX = 0;
  5706. }
  5707. onConstructor() {
  5708. this.ui = ui_UISign.createInstance();
  5709. this.contentPane = this.ui;
  5710. this.isEject = false;
  5711. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5712. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5713. this.initSignItem();
  5714. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5715. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5716. }
  5717. show() {
  5718. super.show();
  5719. this.ui.t0.play();
  5720. this.playSecretaryIdle();
  5721. this.updateSign();
  5722. }
  5723. initSignItem() {
  5724. this.signArr = [];
  5725. for (let index = 0; index < 6; index++) {
  5726. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5727. this.signArr.push(temp);
  5728. }
  5729. this.signMax = new SignMax(this.ui.myNode.day7);
  5730. if (Moyu.isKs)
  5731. this.ui.closeNode.closeBtn.x += 100;
  5732. }
  5733. updateSign() {
  5734. let sameDay = xGame.common.judgeSameDay();
  5735. let max = 7;
  5736. this.curDayIndex = DataMgr.getSignData();
  5737. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5738. this.curDayIndex = 0;
  5739. if (!sameDay) {
  5740. this.ui.normalBtn.visible = true;
  5741. this.ui.tipsNode.visible = false;
  5742. this.ui.againBtn.visible = false;
  5743. }
  5744. else {
  5745. this.ui.normalBtn.visible = false;
  5746. let again = DataMgr.getExtraSign();
  5747. let isCurrency = false;
  5748. let index = this.curDayIndex;
  5749. if (index == 0)
  5750. index = 7;
  5751. let award = cfgTable.signData[index].award;
  5752. let num = award[0].split("-")[0];
  5753. if (num == "1" || num == "2")
  5754. isCurrency = true;
  5755. let showAgain = again == 0 && isCurrency;
  5756. this.ui.againBtn.visible = showAgain;
  5757. this.ui.tipsNode.visible = !showAgain;
  5758. }
  5759. for (let index = 0; index < this.signArr.length; index++) {
  5760. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5761. }
  5762. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5763. }
  5764. playSecretaryIdle() {
  5765. let parent = this.ui.secretary.displayObject;
  5766. parent.destroyChildren();
  5767. let xx = this.ui.secretary.width / 2;
  5768. let yy = this.ui.secretary.height;
  5769. let scale = xGame.common.getSecretaryScale();
  5770. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5771. xGame.common.secretary.play(data, 0, true, parent);
  5772. }
  5773. closeSelf() {
  5774. this.hide();
  5775. }
  5776. normalGetAward() {
  5777. let sameDay = xGame.common.judgeSameDay();
  5778. if (!sameDay) {
  5779. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5780. let temp;
  5781. let type;
  5782. let num;
  5783. let arr = [];
  5784. for (let index = 0; index < award.length; index++) {
  5785. temp = award[index].split("-");
  5786. type = parseInt(temp[0]);
  5787. num = parseInt(temp[1]);
  5788. let awardType = new AwardType();
  5789. awardType.num = num;
  5790. awardType.type = type;
  5791. arr.push(awardType);
  5792. }
  5793. xGame.common.getAward(arr, (watchVideo) => {
  5794. this.curDayIndex++;
  5795. if (this.curDayIndex > 7)
  5796. this.curDayIndex = 0;
  5797. DataMgr.setSignData(this.curDayIndex);
  5798. DataMgr.setSignTime(new Date().getTime());
  5799. if (watchVideo) {
  5800. DataMgr.setExtraSign(1);
  5801. Moyu.sendDataEvent("signIn1");
  5802. }
  5803. this.updateSign();
  5804. });
  5805. }
  5806. }
  5807. againGetAward() {
  5808. Moyu.sendDataEvent("signIn2");
  5809. console.log('zh:qjff_AD_for_uisign');
  5810. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5811. }
  5812. else {
  5813. console.log('zh:AD 失败,直接发放奖励');
  5814. this.qjff_AD_for_uisign();
  5815. }
  5816. }
  5817. qjff_AD_for_uisign() {
  5818. let index = this.curDayIndex;
  5819. if (index == 0)
  5820. index = 7;
  5821. let award = cfgTable.signData[index].award;
  5822. let temp;
  5823. let type;
  5824. let num;
  5825. for (let index = 0; index < award.length; index++) {
  5826. temp = award[index].split("-");
  5827. type = parseInt(temp[0]);
  5828. num = parseInt(temp[1]) * 3;
  5829. xGame.common.playObjFlyAnim(num, type);
  5830. }
  5831. DataMgr.setExtraSign(1);
  5832. this.updateSign();
  5833. }
  5834. }
  5835. UISign.uiName = "UISign";
  5836. class ui_UISkill extends fgui.GComponent {
  5837. static createInstance() {
  5838. return (fgui.UIPackage.createObject("game", "UISkill"));
  5839. }
  5840. onConstruct() {
  5841. this.n48 = (this.getChild("n48"));
  5842. this.n0 = (this.getChild("n0"));
  5843. this.secretary = (this.getChild("secretary"));
  5844. this.talkNode = (this.getChild("talkNode"));
  5845. this.closeNode = (this.getChild("closeNode"));
  5846. this.moneyNode = (this.getChild("moneyNode"));
  5847. this.skillNode = (this.getChild("skillNode"));
  5848. this.guideNode = (this.getChild("guideNode"));
  5849. }
  5850. }
  5851. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5852. class SkillDisplay {
  5853. constructor(ui, data, uiIndex) {
  5854. this.starX = 0;
  5855. this.starY = 0;
  5856. this.index = 0;
  5857. this.ui = ui;
  5858. this.data = data;
  5859. this.index = uiIndex;
  5860. this.initSelf();
  5861. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5862. }
  5863. initSelf() {
  5864. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5865. this.ui.nameTxt.text = this.data.name;
  5866. this.ui.describeTxt.text = this.data.describe;
  5867. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5868. this.ui.startBtn.onClick(this, this.startGame);
  5869. this.updateSelf();
  5870. }
  5871. updateSelf() {
  5872. this.checkTry();
  5873. let level = DataMgr.getBigSkillByIndex(this.index);
  5874. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5875. }
  5876. checkTry() {
  5877. let index = this.index;
  5878. let level = DataMgr.getBigSkillByIndex(index);
  5879. if (level == null) {
  5880. DataMgr.setBigSkill(index, 1, false);
  5881. level = 1;
  5882. }
  5883. this.ui.levelTxt.text = "LV." + level;
  5884. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5885. this.ui.tryNode.visible = true;
  5886. else
  5887. this.ui.tryNode.visible = false;
  5888. }
  5889. clickAddLevel() {
  5890. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5891. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5892. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5893. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5894. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5895. }
  5896. else {
  5897. console.log('zh:AD 失败,直接发放奖励');
  5898. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5899. }
  5900. }
  5901. qjff_AD_for_skilldisplay_clickAddLevel() {
  5902. DataMgr.setBigSkill(this.data.index, 1);
  5903. this.updateSelf();
  5904. xGame.common.upSkillLevel = true;
  5905. }
  5906. startGame() {
  5907. if (this.data.index == 3) {
  5908. alert('Coming soon!');
  5909. return;
  5910. }
  5911. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5912. let needCoin = xGame.common.bigMoveNeedCoin;
  5913. xGame.common.passAwardCoin = 2000;
  5914. let guide = DataMgr.getSkillGuide();
  5915. console.log('zh:startGame guide=' + guide);
  5916. xGame.common.temSelfLevel = 0;
  5917. if (guide == 0) {
  5918. needCoin = 0;
  5919. xGame.common.temSelfLevel = 100;
  5920. }
  5921. if (DataMgr.coinEnough(needCoin)) {
  5922. DataMgr.setCoin(-needCoin);
  5923. xGame.common.curPlayerSkillType = this.index;
  5924. if (guide == 0)
  5925. xGame.common.curPlayerSkillType = 0;
  5926. xGame.uiMgr.Show(UIGame);
  5927. xGame.uiMgr.Hide(UIMain);
  5928. xGame.uiMgr.Show(UIMatching, () => {
  5929. xGame.common.gameUI.ui.alpha = 1;
  5930. xGame.common.gameUI.startGame();
  5931. xGame.uiMgr.Hide(UISkill);
  5932. });
  5933. }
  5934. else {
  5935. xGame.uiMgr.Show(UIAddProp, 0);
  5936. Moyu.sendDataEvent("AddCoinVideo");
  5937. }
  5938. }
  5939. }
  5940. class UISkill extends UIBase {
  5941. constructor() {
  5942. super();
  5943. this.skillData = [];
  5944. }
  5945. onConstructor() {
  5946. this.ui = ui_UISkill.createInstance();
  5947. this.contentPane = this.ui;
  5948. this.isEject = false;
  5949. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5950. this.initSkillData();
  5951. console.log('zh:aaaaaa1111111111');
  5952. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5953. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5954. console.log('zh:aaaaaa22222222');
  5955. this.displayList = [];
  5956. this.ui.skillNode.skillList.numItems = 3;
  5957. this.addUIClick(this.ui, this.interuptSecretary);
  5958. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5959. this.ui.talkNode.visible = false;
  5960. if (Moyu.isKs)
  5961. this.ui.closeNode.closeBtn.x += 100;
  5962. }
  5963. show() {
  5964. super.show();
  5965. this.playSecretaryIdle();
  5966. this.moneyNode.ui.c1.selectedIndex = 1;
  5967. Laya.timer.clearAll(this);
  5968. xGame.soundMgr.playSound("s_start");
  5969. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5970. let guide = DataMgr.getSkillGuide();
  5971. this.ui.guideNode.visible = guide == 0;
  5972. let item = this.getSkillItemByUIIndex(0);
  5973. if (guide == 0) {
  5974. item.ui.c1.selectedIndex = 1;
  5975. }
  5976. else {
  5977. item.ui.c1.selectedIndex = 0;
  5978. }
  5979. this.ui.guideNode.guideBtn.visible = guide == 0;
  5980. for (let index = 0; index < this.displayList.length; index++) {
  5981. this.displayList[index].checkTry();
  5982. }
  5983. }
  5984. getSkillItemByUIIndex(cur) {
  5985. for (let index = 0; index < this.displayList.length; index++) {
  5986. if (this.displayList[index].index == cur) {
  5987. return this.displayList[index];
  5988. }
  5989. }
  5990. }
  5991. enterGuideLevel() {
  5992. let item = this.getSkillItemByUIIndex(0);
  5993. item.startGame();
  5994. if (DataMgr.getNewUser())
  5995. Moyu.sendDataEvent("gameStart1");
  5996. }
  5997. initSkillData() {
  5998. this.skillData = [];
  5999. let nameList = xGame.common.skillNameList;
  6000. let iconList = xGame.common.skillIconList;
  6001. let describeList = [
  6002. "Jump shot executed — ball bounced and pocketed an extra one!",
  6003. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  6004. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  6005. ];
  6006. console.log('zh:initSkillData 111111111');
  6007. let data;
  6008. for (let index = 0; index < nameList.length; index++) {
  6009. data = {};
  6010. data.name = nameList[index];
  6011. data.icon = iconList[index];
  6012. data.describe = describeList[index];
  6013. data.index = index;
  6014. this.skillData.push(data);
  6015. }
  6016. }
  6017. updateSkillItem(index, target) {
  6018. if (this.displayList[index] == null) {
  6019. let uiIndex;
  6020. switch (index) {
  6021. case 0:
  6022. uiIndex = 1;
  6023. break;
  6024. case 1:
  6025. uiIndex = 0;
  6026. break;
  6027. case 2:
  6028. uiIndex = 2;
  6029. break;
  6030. case 3:
  6031. uiIndex = 3;
  6032. break;
  6033. default:
  6034. break;
  6035. }
  6036. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6037. this.displayList.push(temp);
  6038. }
  6039. }
  6040. playSecretaryIdle() {
  6041. let parent = this.ui.secretary.displayObject;
  6042. parent.destroyChildren();
  6043. let xx = this.ui.secretary.width / 2;
  6044. let yy = this.ui.secretary.height;
  6045. let scale = xGame.common.getSecretaryScale();
  6046. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6047. xGame.common.secretary.play(data, 0, true, parent);
  6048. }
  6049. returnUIMain() {
  6050. this.hide();
  6051. xGame.common.stopGirlPop(this.ui.talkNode);
  6052. xGame.uiMgr.Show(UIMain);
  6053. }
  6054. interuptSecretary() {
  6055. Laya.timer.clearAll(this);
  6056. this.playSecretaryRandomSound();
  6057. }
  6058. playSecretaryRandomSound() {
  6059. if (this.isHide)
  6060. return;
  6061. let time = xGame.common.randomNum(45000, 60000);
  6062. Laya.timer.once(time, this, () => {
  6063. if (this.isHide)
  6064. return;
  6065. let index = xGame.common.randomNum(4, 7);
  6066. xGame.soundMgr.playSound("s_main0" + index);
  6067. let words = 1;
  6068. switch (index) {
  6069. case 4:
  6070. words = 5;
  6071. break;
  6072. case 5:
  6073. words = 3;
  6074. break;
  6075. case 6:
  6076. words = 6;
  6077. break;
  6078. case 7:
  6079. words = 7;
  6080. break;
  6081. default:
  6082. break;
  6083. }
  6084. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6085. this.playSecretaryRandomSound();
  6086. });
  6087. }
  6088. }
  6089. UISkill.uiName = "UISkill";
  6090. class ui_UIMsg extends fgui.GComponent {
  6091. static createInstance() {
  6092. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6093. }
  6094. onConstruct() {
  6095. this.tipsNode = (this.getChild("tipsNode"));
  6096. }
  6097. }
  6098. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6099. class UIMsg extends UIBase {
  6100. constructor() {
  6101. super();
  6102. }
  6103. onConstructor() {
  6104. this.ui = ui_UIMsg.createInstance();
  6105. this.contentPane = this.ui;
  6106. this.isEject = false;
  6107. this.isMuti = true;
  6108. }
  6109. show(msg, callback) {
  6110. super.show();
  6111. this.ui.tipsNode.msgTxt.text = msg;
  6112. this.ui.alpha = 1;
  6113. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6114. this.hide();
  6115. callback && callback();
  6116. }), 1000);
  6117. }
  6118. }
  6119. UIMsg.uiName = "UIMsg";
  6120. class ui_UIModeSelection extends fgui.GComponent {
  6121. static createInstance() {
  6122. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6123. }
  6124. onConstruct() {
  6125. this.n19 = (this.getChild("n19"));
  6126. this.closeBtn = (this.getChild("closeBtn"));
  6127. this.myNode = (this.getChild("myNode"));
  6128. this.t0 = this.getTransition("t0");
  6129. }
  6130. }
  6131. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6132. class UIModeSelection extends UIBase {
  6133. constructor() {
  6134. super();
  6135. }
  6136. onConstructor() {
  6137. this.ui = ui_UIModeSelection.createInstance();
  6138. this.contentPane = this.ui;
  6139. this.isEject = false;
  6140. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6141. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6142. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6143. this.addUIClick(this.ui.closeBtn, this.hide);
  6144. this.peopleArr = [650, 6900, 3800];
  6145. this.peopleOffest = [50, 500, 200];
  6146. this.updateSelf();
  6147. }
  6148. show(callback) {
  6149. super.show();
  6150. this.ui.t0.play();
  6151. this.callback = callback;
  6152. }
  6153. updateSelf() {
  6154. let cfg = cfgTable.modeselectData;
  6155. for (let index = 1; index <= 3; index++) {
  6156. let node = this.ui.myNode["type" + index];
  6157. node.need.text = cfg[index].need;
  6158. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6159. node.peopleTxt.text = this.getRandPeople(index - 1);
  6160. }
  6161. }
  6162. enterGame(type) {
  6163. xGame.common.classicRoomType = type;
  6164. let cfg = cfgTable.modeselectData[type];
  6165. let need = cfg.need;
  6166. xGame.common.passAwardCoin = cfg.award;
  6167. if (DataMgr.coinEnough(need)) {
  6168. DataMgr.setCoin(-need);
  6169. this.ui.myNode["type" + type].t0.play();
  6170. Laya.timer.once(200, this, () => {
  6171. this.callback && this.callback();
  6172. });
  6173. }
  6174. else {
  6175. Moyu.sendDataEvent("AddCoinVideo");
  6176. xGame.uiMgr.Show(UIAddProp, 0);
  6177. }
  6178. }
  6179. getRandPeople(index) {
  6180. let rand = this.peopleOffest[index];
  6181. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6182. }
  6183. }
  6184. UIModeSelection.uiName = "UIModeSelection";
  6185. class ui_UIGetAward extends fgui.GComponent {
  6186. static createInstance() {
  6187. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6188. }
  6189. onConstruct() {
  6190. this.n4 = (this.getChild("n4"));
  6191. this.n0 = (this.getChild("n0"));
  6192. this.myList = (this.getChild("myList"));
  6193. this.n1 = (this.getChild("n1"));
  6194. this.eftNode = (this.getChild("eftNode"));
  6195. this.btnNode = (this.getChild("btnNode"));
  6196. this.t0 = this.getTransition("t0");
  6197. }
  6198. }
  6199. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6200. class UIGetAward extends UIBase {
  6201. constructor() {
  6202. super();
  6203. this.showTriple = true;
  6204. }
  6205. onConstructor() {
  6206. this.ui = ui_UIGetAward.createInstance();
  6207. this.contentPane = this.ui;
  6208. this.isEject = false;
  6209. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6210. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6211. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6212. }
  6213. show(arr, showTriple, callback) {
  6214. super.show();
  6215. this.ui.t0.play();
  6216. this.ui.eftNode.visible = true;
  6217. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6218. this.ui.eftNode.visible = false;
  6219. }), 1, 0, 0, 0.9);
  6220. this.awardArr = arr;
  6221. this.showTriple = showTriple;
  6222. this.callback = callback;
  6223. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6224. this.ui.myList.numItems = arr.length;
  6225. xGame.soundMgr.playSound("getaward");
  6226. }
  6227. updateSelf(index, obj) {
  6228. let temp = this.awardArr[index];
  6229. let icon = this.getIcon(temp.type);
  6230. let str = icon;
  6231. if (temp.type > 2) {
  6232. str = "s" + icon;
  6233. }
  6234. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6235. obj.myIcon.rotation = 0;
  6236. obj.numTxt.text = temp.num + "";
  6237. obj.numTxt.visible = temp.type > 2 ? false : true;
  6238. obj.nameTxt.text = this.getNameStr(temp.type);
  6239. }
  6240. renderItem(index, obj) {
  6241. this.updateSelf(index, obj);
  6242. }
  6243. tripleGetAward() {
  6244. console.log('zh:qjff_AD_for_uigetAward');
  6245. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6246. }
  6247. else {
  6248. console.log('zh:AD 失败,直接发放奖励');
  6249. this.qjff_AD_for_uigetAward();
  6250. }
  6251. }
  6252. qjff_AD_for_uigetAward() {
  6253. this.getAward(3);
  6254. }
  6255. normalGetAward() {
  6256. if (PlatMgr.isMisVideo())
  6257. this.tripleGetAward();
  6258. else
  6259. this.getAward();
  6260. }
  6261. getAward(times = 1) {
  6262. this.hide();
  6263. for (let index = 0; index < this.awardArr.length; index++) {
  6264. this.awardArr[index].num *= times;
  6265. }
  6266. this.callback && this.callback(times != 1);
  6267. }
  6268. getIcon(type) {
  6269. switch (type) {
  6270. case Prop.diamond:
  6271. return "ty_zs";
  6272. case Prop.coin:
  6273. return "ty_jb";
  6274. case Prop.gan1:
  6275. return "qg1";
  6276. case Prop.gan2:
  6277. return "qg2";
  6278. case Prop.gan3:
  6279. return "qg3";
  6280. case Prop.gan4:
  6281. return "qg4";
  6282. default:
  6283. break;
  6284. }
  6285. }
  6286. getNameStr(type) {
  6287. switch (type) {
  6288. case Prop.diamond:
  6289. return "Diamond";
  6290. case Prop.coin:
  6291. return "Coins";
  6292. case Prop.gan1:
  6293. case Prop.gan2:
  6294. case Prop.gan3:
  6295. case Prop.gan4:
  6296. return cfgTable.ballrodData[type - 1].name;
  6297. default:
  6298. break;
  6299. }
  6300. }
  6301. }
  6302. UIGetAward.uiName = "UIGetAward";
  6303. class ui_UIRepentProp extends fgui.GComponent {
  6304. static createInstance() {
  6305. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6306. }
  6307. onConstruct() {
  6308. this.c1 = this.getController("c1");
  6309. this.n11 = (this.getChild("n11"));
  6310. this.regretNode = (this.getChild("regretNode"));
  6311. this.helpLineNode = (this.getChild("helpLineNode"));
  6312. this.t0 = this.getTransition("t0");
  6313. }
  6314. }
  6315. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6316. class UIRepentProp extends UIBase {
  6317. constructor() {
  6318. super();
  6319. this.viewType = 0;
  6320. this.regretType = 0;
  6321. }
  6322. onConstructor() {
  6323. this.ui = ui_UIRepentProp.createInstance();
  6324. this.contentPane = this.ui;
  6325. this.isEject = false;
  6326. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6327. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6328. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6329. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6330. }
  6331. show(viewType, regretType, callback) {
  6332. PlatMgr.showInsert(true);
  6333. this.viewType = viewType;
  6334. this.regretType = regretType;
  6335. this.callback = callback;
  6336. super.show();
  6337. this.ui.t0.play();
  6338. this.ui.c1.selectedIndex = this.viewType;
  6339. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6340. if (this.viewType == 0) {
  6341. let guide = DataMgr.getGuideHelpLine();
  6342. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6343. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6344. }
  6345. xGame.common.gameMgr.gamePause = true;
  6346. }
  6347. hideSelf() {
  6348. xGame.common.gameMgr.gamePause = false;
  6349. this.callback && this.callback(false);
  6350. this.hide();
  6351. }
  6352. videoRegret() {
  6353. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6354. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6355. }
  6356. else {
  6357. console.log('zh:AD 失败,直接发放奖励');
  6358. this.qjff_AD_for_UIrepentProp_videoRegret();
  6359. }
  6360. }
  6361. qjff_AD_for_UIrepentProp_videoRegret() {
  6362. this.callback && this.callback(true);
  6363. this.hideSelf();
  6364. }
  6365. videoAddHelpLine() {
  6366. let guide = DataMgr.getGuideHelpLine();
  6367. if (guide == 0) {
  6368. this.callback && this.callback(true);
  6369. this.hideSelf();
  6370. DataMgr.setGuideHelpLine();
  6371. xGame.common.gameUI.ui.guideNode.visible = false;
  6372. }
  6373. else {
  6374. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6375. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6376. }
  6377. else {
  6378. console.log('zh:AD 失败,直接发放奖励');
  6379. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6380. }
  6381. }
  6382. }
  6383. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6384. this.callback && this.callback(true);
  6385. this.hideSelf();
  6386. }
  6387. }
  6388. UIRepentProp.uiName = "UIRepentProp";
  6389. class UIMain extends UIBase {
  6390. constructor() {
  6391. super();
  6392. this.firstEnter = true;
  6393. }
  6394. nativeCallJs(msg) {
  6395. let t = msg;
  6396. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6397. switch (t) {
  6398. case 'qjff_chouJiang':
  6399. let dui = xGame.uiMgr.getUI(UIDraw);
  6400. dui.qjff_chouJiang();
  6401. break;
  6402. case 'qjff_AD_for_uisign':
  6403. let dui2 = xGame.uiMgr.getUI(UISign);
  6404. dui2.qjff_AD_for_uisign();
  6405. break;
  6406. case 'qjff_AD_for_uitry':
  6407. let dui3 = xGame.uiMgr.getUI(UITry);
  6408. dui3.qjff_AD_for_uitry();
  6409. break;
  6410. case 'qjff_AD_for_uipower':
  6411. let dui4 = xGame.uiMgr.getUI(UIPower);
  6412. dui4.qjff_AD_for_uipower();
  6413. break;
  6414. case 'qjff_AD_for_uigetAward':
  6415. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6416. dui5.qjff_AD_for_uigetAward();
  6417. break;
  6418. case 'qjff_AD_for_uiGameEnd':
  6419. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6420. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6421. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6422. break;
  6423. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6424. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6425. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6426. break;
  6427. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6428. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6429. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6430. break;
  6431. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6432. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6433. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6434. break;
  6435. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6436. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6437. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6438. break;
  6439. case 'qjff_AD_for_UIBOX_onOpenBox':
  6440. let dui11 = xGame.uiMgr.getUI(UIBox);
  6441. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6442. break;
  6443. case 'qjff_AD_for_UIAddCoin':
  6444. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6445. dui12.qjff_AD_for_UIAddCoin();
  6446. break;
  6447. case '111a':
  6448. let dui14 = xGame.uiMgr.getUI(UISign);
  6449. dui14.qjff_AD_for_uisign();
  6450. break;
  6451. case '222a':
  6452. let dui15 = xGame.uiMgr.getUI(UISign);
  6453. dui15.qjff_AD_for_uisign();
  6454. break;
  6455. case '333a':
  6456. let dui16 = xGame.uiMgr.getUI(UISign);
  6457. dui16.qjff_AD_for_uisign();
  6458. break;
  6459. default:
  6460. console.log('zh:未知的方法名字' + t);
  6461. break;
  6462. }
  6463. }
  6464. onConstructor() {
  6465. console.log('zh: UIMain onConstructor');
  6466. this.ui = ui_UIMain.createInstance();
  6467. this.contentPane = this.ui;
  6468. this.isEject = false;
  6469. this.addEvent();
  6470. this.addClickSpine();
  6471. this.settingNode = new SettingNode(this.ui.settingNode);
  6472. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6473. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6474. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6475. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6476. let curUse = DataMgr.getCurSecretary();
  6477. this.changeSecretary(curUse);
  6478. this.ui.talkNode.visible = false;
  6479. let guide = DataMgr.getSkillGuide();
  6480. if (xGame.common.isNewDay && guide == 1) {
  6481. xGame.common.isNewDay = false;
  6482. xGame.soundMgr.playSound("s_main01");
  6483. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6484. console.log("播放小秘书每天语音");
  6485. }
  6486. this.onGetUserInfo();
  6487. this.ui.n83.visible = false;
  6488. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6489. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6490. }
  6491. changeSecretary(curUse) {
  6492. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6493. xGame.common.secretary && xGame.common.secretary.dispose();
  6494. this.addSecretarySpine(name);
  6495. }
  6496. addSecretarySpine(name) {
  6497. let spine = new SpineMgr(name, () => {
  6498. this.playSecretaryIdle();
  6499. });
  6500. xGame.common.secretary = spine;
  6501. }
  6502. addClickSpine() {
  6503. let clickSpine = new SpineMgr("dianji", () => {
  6504. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6505. let parent = Laya.stage;
  6506. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6507. clickSpine.play(data, 0, false, parent, (spine) => {
  6508. spine.destroy(true);
  6509. });
  6510. });
  6511. });
  6512. }
  6513. addEvent() {
  6514. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6515. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6516. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6517. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6518. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6519. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6520. this.addUIClick(this.ui, this.interuptSecretary);
  6521. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6522. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6523. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6524. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6525. this.addUIClick(this.ui.signBtn, this.openSignView);
  6526. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6527. }
  6528. show(showFailWords) {
  6529. super.show();
  6530. this.moneyNode.ui.c1.selectedIndex = 1;
  6531. this.playSecretaryIdle();
  6532. xGame.soundMgr.playMusic("caromhall01");
  6533. Laya.timer.clearAll(this);
  6534. this.playSecretaryRandomSound();
  6535. if (showFailWords) {
  6536. setTimeout(() => {
  6537. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6538. let words = -1;
  6539. if (str == "s_main02") {
  6540. words = 2;
  6541. }
  6542. else {
  6543. words = 3;
  6544. }
  6545. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6546. xGame.soundMgr.playSound(str);
  6547. }, 300);
  6548. }
  6549. this.showGuide();
  6550. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6551. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6552. let guide = DataMgr.getSkillGuide();
  6553. if (guide == 1) {
  6554. let randTime = xGame.common.randomNum(300, 800);
  6555. if (this.firstEnter) {
  6556. this.firstEnter = false;
  6557. randTime += 900;
  6558. }
  6559. Laya.timer.once(randTime, this, () => {
  6560. xGame.common.autoPopUIView();
  6561. });
  6562. }
  6563. }
  6564. checkActive(show) {
  6565. }
  6566. showGuide() {
  6567. let guide = DataMgr.getSkillGuide();
  6568. this.ui.guideBtn.visible = guide == 0;
  6569. this.ui.enterGuide.visible = false;
  6570. this.ui.secretaryGuide.visible = guide == 0;
  6571. if (guide == 0) {
  6572. xGame.soundMgr.playSound("s_guide");
  6573. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6574. }
  6575. }
  6576. ensureSecretary() {
  6577. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6578. this.ui.secretaryGuide.visible = false;
  6579. this.ui.enterGuide.visible = true;
  6580. this.ui.wordsNode.t0.play();
  6581. if (DataMgr.getNewUser())
  6582. Moyu.sendDataEvent("gameReady");
  6583. }
  6584. playSecretaryIdle() {
  6585. let parent = this.ui.secretary.displayObject;
  6586. parent.destroyChildren();
  6587. let xx = this.ui.secretary.width / 2;
  6588. let yy = this.ui.secretary.height;
  6589. let scale = xGame.common.getSecretaryScale();
  6590. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6591. console.log("zh:playSecretaryIdle", data);
  6592. xGame.common.secretary.play(data, 0, true, parent);
  6593. }
  6594. startGame(type) {
  6595. xGame.common.gameMode = type;
  6596. Moyu.sendDataEvent("PlayGame", { type: type });
  6597. switch (xGame.common.gameMode) {
  6598. case GameMode.classic:
  6599. let challengeTimes = DataMgr.getChallengeTimes();
  6600. if (challengeTimes == 0) {
  6601. xGame.uiMgr.Show(UIInvitation);
  6602. }
  6603. else {
  6604. this.beginGame();
  6605. }
  6606. break;
  6607. case GameMode.bigMove:
  6608. this.beginGame();
  6609. if (DataMgr.getNewUser())
  6610. Moyu.sendDataEvent("gameStart0");
  6611. break;
  6612. default:
  6613. break;
  6614. }
  6615. }
  6616. beginGame(isNice = false) {
  6617. if (xGame.common.gameMode == GameMode.classic) {
  6618. if (isNice) {
  6619. this.enterClassic();
  6620. }
  6621. else {
  6622. xGame.uiMgr.Show(UIModeSelection, () => {
  6623. this.enterClassic();
  6624. });
  6625. }
  6626. }
  6627. else if (xGame.common.gameMode == GameMode.bigMove) {
  6628. this.ui.enterGuide.visible = false;
  6629. xGame.uiMgr.Show(UISkill);
  6630. }
  6631. }
  6632. enterClassic() {
  6633. xGame.uiMgr.Show(UIGame);
  6634. xGame.uiMgr.Show(UIMatching, () => {
  6635. if (!this.isHide)
  6636. this.hide();
  6637. xGame.common.gameUI.ui.alpha = 1;
  6638. xGame.common.gameUI.startGame();
  6639. xGame.uiMgr.Hide(UIGameEnd);
  6640. });
  6641. }
  6642. startGlobal() {
  6643. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6644. }
  6645. startWeekly() {
  6646. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6647. }
  6648. zhouSaiMonth() {
  6649. console.log('zh: zhouSaiMonth 被调用');
  6650. }
  6651. startPlaceBall() {
  6652. xGame.uiMgr.Show(UILevelDisplay);
  6653. }
  6654. hide() {
  6655. super.hide();
  6656. xGame.common.stopGirlPop(this.ui.talkNode);
  6657. }
  6658. onGetUserInfo(force = false) {
  6659. if (Moyu.isWx) {
  6660. let info = Moyu.getSystemInfo();
  6661. if (info)
  6662. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6663. }
  6664. else {
  6665. Moyu.initUser(this, this.freshUser, force);
  6666. }
  6667. if (!Moyu.hasUserInfo) {
  6668. let user = Moyu.getUserInfo();
  6669. user.headIcon = 'res/ty_touxiang.png';
  6670. }
  6671. this.freshUser();
  6672. }
  6673. freshUser() {
  6674. let user = Moyu.getUserInfo();
  6675. if (!user.isAuth) {
  6676. user.headIcon = 'res/ty_touxiang.png';
  6677. }
  6678. else
  6679. DataMgr.upRankData();
  6680. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6681. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6682. }
  6683. interuptSecretary() {
  6684. Laya.timer.clearAll(this);
  6685. this.playSecretaryRandomSound();
  6686. }
  6687. playSecretaryRandomSound() {
  6688. if (this.isHide)
  6689. return;
  6690. let time = xGame.common.randomNum(45000, 60000);
  6691. Laya.timer.once(time, this, () => {
  6692. if (this.isHide)
  6693. return;
  6694. let index = xGame.common.randomNum(4, 7);
  6695. xGame.soundMgr.playSound("s_main0" + index);
  6696. let words = 1;
  6697. switch (index) {
  6698. case 4:
  6699. words = 5;
  6700. break;
  6701. case 5:
  6702. words = 3;
  6703. break;
  6704. case 6:
  6705. words = 6;
  6706. break;
  6707. case 7:
  6708. words = 7;
  6709. break;
  6710. default:
  6711. break;
  6712. }
  6713. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6714. this.playSecretaryRandomSound();
  6715. });
  6716. }
  6717. openSecretaryView() {
  6718. xGame.uiMgr.Show(UISecretary);
  6719. Moyu.sendDataEvent("secretary");
  6720. }
  6721. openShopView() {
  6722. xGame.uiMgr.Show(UIShop);
  6723. }
  6724. openSignView() {
  6725. xGame.uiMgr.Show(UISign);
  6726. }
  6727. openDrawView() {
  6728. xGame.uiMgr.Show(UIDraw);
  6729. }
  6730. openRanking() {
  6731. xGame.uiMgr.Show(UIRanking);
  6732. Moyu.sendDataEvent("rankingList");
  6733. }
  6734. }
  6735. UIMain.uiName = "UIMain";
  6736. class UIGameEnd extends UIBase {
  6737. constructor() {
  6738. super();
  6739. this.success = false;
  6740. this.awardCoinNum = 1000;
  6741. this.awardDiamondNum = 10;
  6742. }
  6743. onConstructor() {
  6744. this.ui = ui_UIGameEnd.createInstance();
  6745. this.contentPane = this.ui;
  6746. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6747. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6748. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6749. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6750. this.ui.talkNode.visible = false;
  6751. if (Moyu.isKs)
  6752. this.ui.closeNode.closeBtn.x += 100;
  6753. }
  6754. updateType() {
  6755. switch (xGame.common.gameMode) {
  6756. case GameMode.classic:
  6757. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6758. this.ui.coinNode.visible = this.success;
  6759. if (!this.success) {
  6760. Laya.timer.once(500, this, () => {
  6761. xGame.uiMgr.Show(UIAddCoin);
  6762. });
  6763. }
  6764. this.ui.isGetAward.visible = false;
  6765. this.ui.leftBtn.c1.selectedIndex = 3;
  6766. this.ui.rightBtn.c1.selectedIndex = 0;
  6767. this.moneyNode.ui.c1.selectedIndex = 1;
  6768. break;
  6769. case GameMode.bigMove:
  6770. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6771. this.ui.coinNode.visible = this.success;
  6772. if (xGame.common.gameMode == GameMode.bigMove) {
  6773. if (this.success) {
  6774. DataMgr.setSkillSuccessTimes(1, true);
  6775. DataMgr.setSkillAccTimes(1);
  6776. }
  6777. else {
  6778. DataMgr.setSkillSuccessTimes(0, false);
  6779. }
  6780. }
  6781. if (!this.success) {
  6782. Laya.timer.once(500, this, () => {
  6783. xGame.uiMgr.Show(UIAddCoin);
  6784. });
  6785. }
  6786. this.ui.isGetAward.visible = false;
  6787. this.ui.leftBtn.c1.selectedIndex = 3;
  6788. this.ui.rightBtn.c1.selectedIndex = 0;
  6789. this.moneyNode.ui.c1.selectedIndex = 1;
  6790. break;
  6791. case GameMode.placeBall:
  6792. this.ui.coinNode.visible = false;
  6793. if (this.success) {
  6794. if (xGame.common.placeBallStarNum == 3) {
  6795. this.ui.c1.selectedIndex = 2;
  6796. }
  6797. else {
  6798. this.ui.c1.selectedIndex = 3;
  6799. }
  6800. }
  6801. else {
  6802. this.ui.c1.selectedIndex = 4;
  6803. }
  6804. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6805. if (cfg.type == PlaceBallType.challenge) {
  6806. this.ui.c1.selectedIndex = 2;
  6807. }
  6808. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6809. this.updatePlaceBallBtn();
  6810. this.updatePlaceBallStarNum();
  6811. this.updatePlaceBallAwardState();
  6812. this.moneyNode.ui.c1.selectedIndex = 2;
  6813. this.moneyNode.checkPowerTime();
  6814. this.moneyNode.powerChange();
  6815. DataMgr.upRankData();
  6816. break;
  6817. default:
  6818. break;
  6819. }
  6820. }
  6821. updatePlaceBallBtn() {
  6822. this.ui.leftBtn.c1.selectedIndex = 5;
  6823. if (this.success) {
  6824. this.ui.rightBtn.c1.selectedIndex = 14;
  6825. }
  6826. else {
  6827. if (xGame.common.placeBallStarNum == 3) {
  6828. this.ui.rightBtn.c1.selectedIndex = 14;
  6829. }
  6830. else {
  6831. this.ui.rightBtn.c1.selectedIndex = 1;
  6832. }
  6833. }
  6834. }
  6835. updatePlaceBallStarNum() {
  6836. let starNum = xGame.common.placeBallStarNum;
  6837. if (starNum == 0)
  6838. this.ui.starNumNode.c1.selectedIndex = 3;
  6839. else {
  6840. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6841. }
  6842. }
  6843. updatePlaceBallAwardState() {
  6844. let level = xGame.common.placeBallCurLevel;
  6845. let starNum = xGame.common.placeBallStarNum;
  6846. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6847. let data = cfgTable.placeballData[level].award;
  6848. let cfg = cfgTable.placeballData[level];
  6849. this.awardDiamondNum = data[1];
  6850. this.awardCoinNum = data[0];
  6851. if (cfg.type == PlaceBallType.challenge) {
  6852. this.awardDiamondNum = 0;
  6853. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6854. }
  6855. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6856. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6857. if (cfg.type == PlaceBallType.challenge) {
  6858. this.ui.awardNode.coinNode.visible = true;
  6859. }
  6860. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6861. this.ui.awardNode.diamondNode.x = 265;
  6862. this.ui.awardNode.coinNode.x = 354;
  6863. }
  6864. else {
  6865. this.ui.awardNode.diamondNode.x = 291;
  6866. this.ui.awardNode.coinNode.x = 291;
  6867. }
  6868. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6869. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6870. if (this.awardCoinNum == 0) {
  6871. this.ui.awardNode.coinNode.numTxt.text = "";
  6872. }
  6873. if (getAward) {
  6874. this.ui.isGetAward.visible = true;
  6875. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6876. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6877. }
  6878. else {
  6879. this.ui.isGetAward.visible = false;
  6880. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6881. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6882. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6883. }
  6884. else {
  6885. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6886. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6887. }
  6888. }
  6889. }
  6890. show(success) {
  6891. super.show();
  6892. xGame.eventMgr.event(RESET_GAME);
  6893. this.success = success;
  6894. Laya.timer.clearAll(this);
  6895. this.playSecretaryAni();
  6896. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6897. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6898. offsetTime = Math.floor(offsetTime / 1000);
  6899. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6900. this.updateType();
  6901. Laya.timer.once(200, this, () => {
  6902. this.addAward(() => {
  6903. this.updateType();
  6904. Laya.timer.once(500, this, () => {
  6905. this.showChallengeLevel();
  6906. });
  6907. });
  6908. });
  6909. if (this.success) {
  6910. xGame.soundMgr.playSound('slots_roll01');
  6911. xGame.soundMgr.playSound("s_win");
  6912. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6913. }
  6914. else {
  6915. xGame.soundMgr.playSound('matchwin01');
  6916. xGame.soundMgr.playSound("s_lose");
  6917. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6918. }
  6919. if (!Moyu.isLegal)
  6920. PlatMgr.showBanner(true);
  6921. let challengeNum = DataMgr.getChallengeTimes();
  6922. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6923. DataMgr.setChallengeTimes(1);
  6924. }
  6925. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6926. DataMgr.setClassicTimes();
  6927. }
  6928. }
  6929. showChallengeLevel() {
  6930. if (DataMgr.getChallengeTimes() != 0)
  6931. return;
  6932. let skill = DataMgr.getSkillAccTimes();
  6933. let put = DataMgr.getPlaceBallLevelList().length;
  6934. if (skill >= 3 || put >= 5) {
  6935. xGame.uiMgr.Show(UIInvitation);
  6936. this.hide();
  6937. }
  6938. }
  6939. addAward(callback) {
  6940. if (!this.success) {
  6941. callback && callback();
  6942. return;
  6943. }
  6944. switch (xGame.common.gameMode) {
  6945. case GameMode.classic:
  6946. this.awardCoinNum = xGame.common.passAwardCoin;
  6947. this.awardDiamondNum = 0;
  6948. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6949. break;
  6950. case GameMode.bigMove:
  6951. this.awardCoinNum = xGame.common.passAwardCoin;
  6952. this.awardDiamondNum = 0;
  6953. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6954. callback && callback();
  6955. break;
  6956. case GameMode.placeBall:
  6957. let level = xGame.common.placeBallCurLevel;
  6958. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6959. if (xGame.common.placeBallStarNum != 3) {
  6960. callback && callback();
  6961. return;
  6962. }
  6963. else {
  6964. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6965. if (getAward) {
  6966. callback && callback();
  6967. return;
  6968. }
  6969. }
  6970. let cfg = cfgTable.placeballData[level];
  6971. let data = cfgTable.placeballData[level].award;
  6972. this.awardCoinNum = data[0];
  6973. this.awardDiamondNum = data[1];
  6974. if (cfg.type == PlaceBallType.challenge) {
  6975. this.awardDiamondNum = 0;
  6976. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6977. }
  6978. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6979. let diamondAward;
  6980. if (this.awardDiamondNum > 0) {
  6981. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6982. xGame.common.getAward([diamondAward, coinAward], callback);
  6983. }
  6984. else {
  6985. xGame.common.getAward([coinAward], callback);
  6986. }
  6987. if (cfg.type == PlaceBallType.normal) {
  6988. DataMgr.setPlaceBallAward(level);
  6989. }
  6990. break;
  6991. default:
  6992. break;
  6993. }
  6994. }
  6995. playSecretaryAni_old() {
  6996. let parent = this.ui.secretary.displayObject;
  6997. parent.destroyChildren();
  6998. let xx = this.ui.secretary.width / 2;
  6999. let yy = this.ui.secretary.height;
  7000. let scale = xGame.common.getSecretaryScale();
  7001. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7002. if (this.success) {
  7003. let rand = Math.random() <= 0.5 ? 2 : 3;
  7004. xGame.common.secretary.play(data, rand, false, parent, () => {
  7005. xGame.common.secretary.play(data, 1, true, parent);
  7006. });
  7007. }
  7008. else {
  7009. xGame.common.secretary.play(data, 0, true, parent);
  7010. }
  7011. }
  7012. playSecretaryAni() {
  7013. let parent = this.ui.secretary.displayObject;
  7014. parent.destroyChildren();
  7015. let xx = this.ui.secretary.width / 2;
  7016. let yy = this.ui.secretary.height;
  7017. let scale = xGame.common.getSecretaryScale();
  7018. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7019. if (this.success) {
  7020. let rand = 0;
  7021. xGame.common.secretary.play(data, 0, true, parent);
  7022. }
  7023. else {
  7024. xGame.common.secretary.play(data, 0, true, parent);
  7025. }
  7026. }
  7027. restartGame() {
  7028. switch (xGame.common.gameMode) {
  7029. case GameMode.classic:
  7030. xGame.eventMgr.event(RESTART_GAME);
  7031. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7032. break;
  7033. case GameMode.bigMove:
  7034. this.hide();
  7035. xGame.eventMgr.event(RESTART_GAME);
  7036. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7037. break;
  7038. default:
  7039. break;
  7040. }
  7041. }
  7042. hide() {
  7043. super.hide();
  7044. xGame.common.stopGirlPop(this.ui.talkNode);
  7045. PlatMgr.showBanner(false);
  7046. }
  7047. returnHome() {
  7048. this.hide();
  7049. let showFailWords = !this.success;
  7050. xGame.uiMgr.Show(UIMain, showFailWords);
  7051. }
  7052. clickLeftBtn() {
  7053. switch (xGame.common.gameMode) {
  7054. case GameMode.classic:
  7055. case GameMode.bigMove:
  7056. this.returnHome();
  7057. break;
  7058. case GameMode.placeBall:
  7059. let level = xGame.common.placeBallCurLevel;
  7060. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7061. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7062. break;
  7063. default:
  7064. break;
  7065. }
  7066. }
  7067. powerStartPlaceBallLevel(level, btn) {
  7068. if (DataMgr.powerEnough()) {
  7069. btn.touchable = false;
  7070. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7071. btn.touchable = true;
  7072. DataMgr.setPower(-1);
  7073. xGame.eventMgr.event(POWER_TIME);
  7074. this.startPlaceBallLevel(level);
  7075. }));
  7076. }
  7077. else {
  7078. xGame.uiMgr.Show(UIPower, 0);
  7079. }
  7080. }
  7081. clickRightBtn() {
  7082. switch (xGame.common.gameMode) {
  7083. case GameMode.classic:
  7084. console.log('zh:clickRightBtn 111');
  7085. case GameMode.bigMove:
  7086. console.log('zh:clickRightBtn 222');
  7087. this.restartGame();
  7088. break;
  7089. case GameMode.placeBall:
  7090. console.log('zh:clickRightBtn 333');
  7091. let level = xGame.common.placeBallCurLevel;
  7092. let data = DataMgr.getPlaceBallLevel(level);
  7093. let curPss = data.play && !data.isCur;
  7094. if (curPss) {
  7095. console.log('zh:clickRightBtn 333-111');
  7096. console.log('zh:当前LV=' + level);
  7097. if (level == 60) {
  7098. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7099. Laya.timer.once(3000, this, () => {
  7100. this.returnHome();
  7101. });
  7102. }
  7103. else {
  7104. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7105. }
  7106. }
  7107. else {
  7108. console.log('zh:clickRightBtn 333-000');
  7109. Moyu.sendDataEvent("placeBallNextLevel");
  7110. console.log('zh:qjff_AD_for_uiGameEnd');
  7111. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7112. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7113. }
  7114. else {
  7115. console.log('zh:AD 失败,直接发放奖励');
  7116. this.qjff_AD_for_uiGameEnd(level);
  7117. }
  7118. }
  7119. break;
  7120. default:
  7121. console.log('zh:clickRightBtn 444');
  7122. break;
  7123. }
  7124. }
  7125. qjff_AD_for_uiGameEnd(level) {
  7126. DataMgr.setPlaceBallLevel(level, 1);
  7127. this.startPlaceBallLevel(level + 1);
  7128. }
  7129. startPlaceBallLevel(level) {
  7130. xGame.common.gameMode = GameMode.placeBall;
  7131. xGame.common.placeBallCurLevel = level;
  7132. xGame.uiMgr.Show(UIGame);
  7133. this.hide();
  7134. }
  7135. }
  7136. UIGameEnd.uiName = "UIGameEnd";
  7137. class ui_UIVideoShare extends fgui.GComponent {
  7138. static createInstance() {
  7139. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7140. }
  7141. onConstruct() {
  7142. this.n10 = (this.getChild("n10"));
  7143. this.myNode = (this.getChild("myNode"));
  7144. this.t0 = this.getTransition("t0");
  7145. }
  7146. }
  7147. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7148. class UIVideoShare extends UIBase {
  7149. constructor() {
  7150. super();
  7151. this.success = false;
  7152. this.awardNum = 0;
  7153. this.isShared = true;
  7154. }
  7155. onConstructor() {
  7156. this.ui = ui_UIVideoShare.createInstance();
  7157. this.contentPane = this.ui;
  7158. this.isEject = false;
  7159. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7160. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7161. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7162. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7163. }
  7164. show(success) {
  7165. super.show();
  7166. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7167. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7168. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7169. this.success = success;
  7170. let time = xGame.common.randomNum(600, 1500);
  7171. Moyu.showInsertAd(time, 60000);
  7172. if (success)
  7173. xGame.soundMgr.playSound("applause");
  7174. this.ui.t0.play();
  7175. this.checkShareState();
  7176. let times = DataMgr.getDailyVideoShareTimes();
  7177. this.awardNum = times == 0 ? 2000 : 200;
  7178. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7179. }
  7180. checkShareState() {
  7181. if (PlatMgr.forceShare == 0) {
  7182. this.ui.myNode.closeBtn.visible = true;
  7183. this.ui.myNode.tipsNode.visible = false;
  7184. this.ui.myNode.closeBtn.x = 90;
  7185. this.ui.myNode.shareBtn.x = 342;
  7186. }
  7187. else if (PlatMgr.forceShare == 1) {
  7188. this.ui.myNode.closeBtn.visible = false;
  7189. this.ui.myNode.tipsNode.visible = true;
  7190. this.ui.myNode.shareBtn.x = 218;
  7191. this.isShared = true;
  7192. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7193. }
  7194. }
  7195. checkForceShare() {
  7196. this.isShared = !this.isShared;
  7197. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7198. }
  7199. videoShare() {
  7200. if (PlatMgr.forceShare == 1) {
  7201. if (this.isShared) {
  7202. this.shareGame();
  7203. }
  7204. else {
  7205. this.hideSelf();
  7206. }
  7207. }
  7208. else {
  7209. this.shareGame();
  7210. }
  7211. }
  7212. shareGame() {
  7213. Moyu.sendDataEvent("VideoShare");
  7214. if (Moyu.canShare() > 100) {
  7215. Moyu.shareGame((success) => {
  7216. if (success) {
  7217. DataMgr.setDailyVideoShareTimes(1);
  7218. DataMgr.setCoin(this.awardNum);
  7219. }
  7220. this.hideSelf();
  7221. }, this);
  7222. }
  7223. else {
  7224. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7225. this.hideSelf();
  7226. }
  7227. }
  7228. hideSelf() {
  7229. this.hide();
  7230. xGame.uiMgr.Show(UIGameEnd, this.success);
  7231. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7232. xGame.common.screenImg.destroy();
  7233. xGame.common.screenImg = null;
  7234. }
  7235. }
  7236. }
  7237. UIVideoShare.uiName = "UIVideoShare";
  7238. class ui_UITips extends fgui.GComponent {
  7239. static createInstance() {
  7240. return (fgui.UIPackage.createObject("game", "UITips"));
  7241. }
  7242. onConstruct() {
  7243. this.n0 = (this.getChild("n0"));
  7244. this.myNode = (this.getChild("myNode"));
  7245. this.t0 = this.getTransition("t0");
  7246. }
  7247. }
  7248. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7249. class UITips extends UIBase {
  7250. constructor() {
  7251. super();
  7252. this.type = 0;
  7253. }
  7254. onConstructor() {
  7255. this.ui = ui_UITips.createInstance();
  7256. this.contentPane = this.ui;
  7257. this.isEject = false;
  7258. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7259. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7260. }
  7261. show(tipsTxt, womanTxt, type) {
  7262. super.show();
  7263. this.ui.t0.play();
  7264. this.ui.myNode.tipsTxt.text = tipsTxt;
  7265. this.ui.myNode.womanTxt.text = womanTxt;
  7266. PlatMgr.showInsert(true);
  7267. this.ui.myNode.c1.selectedIndex = type;
  7268. this.type = type;
  7269. switch (this.type) {
  7270. case TipsType.exitGame:
  7271. xGame.common.gameMgr.gamePause = true;
  7272. break;
  7273. case TipsType.foul:
  7274. Laya.timer.once(200, this, () => {
  7275. xGame.common.gameMgr.gamePause = true;
  7276. });
  7277. break;
  7278. default:
  7279. break;
  7280. }
  7281. }
  7282. clickLeftBtn() {
  7283. this.hide();
  7284. xGame.common.gameMgr.gamePause = false;
  7285. switch (this.type) {
  7286. case TipsType.exitGame:
  7287. break;
  7288. case TipsType.foul:
  7289. break;
  7290. default:
  7291. break;
  7292. }
  7293. }
  7294. clickRightBtn() {
  7295. this.hide();
  7296. switch (this.type) {
  7297. case TipsType.exitGame:
  7298. xGame.eventMgr.event(RESET_GAME);
  7299. xGame.uiMgr.Show(UIMain);
  7300. Moyu.recordEnd(this, null);
  7301. xGame.common.longHelpLine = false;
  7302. break;
  7303. case TipsType.foul:
  7304. xGame.common.gameMgr.gamePause = false;
  7305. Laya.timer.clearAll(this);
  7306. break;
  7307. default:
  7308. break;
  7309. }
  7310. }
  7311. }
  7312. UITips.uiName = "UITips";
  7313. class GameMgr {
  7314. constructor() {
  7315. this.selfCamp = "";
  7316. this.selfFoulNum = 0;
  7317. this.selfBallArr = [];
  7318. this.selfTimer = 0;
  7319. this.selfScore = 0;
  7320. this.aiCamp = "";
  7321. this.aiFoulNum = 0;
  7322. this.aiBallArr = [];
  7323. this.aiTimer = 0;
  7324. this.aiScore = 0;
  7325. this.aiSkillLevelNum = 1;
  7326. this.targertScore = 0;
  7327. this.setTime = 30;
  7328. this.selfTurnRate = 0.5;
  7329. this.accTime = 0;
  7330. this.curFoul = "";
  7331. this.maxFoulTimes = 3;
  7332. this.isFirstInGame = true;
  7333. this.firstColliObj = null;
  7334. this.inHoleBalls = [];
  7335. this.blackNum = 8;
  7336. this.success = false;
  7337. this.holePosList = [];
  7338. this.posObj = {};
  7339. this._selfTurn = false;
  7340. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7341. this.ensureBallType = false;
  7342. this.isOpenBall = true;
  7343. this.finishOneShoot = true;
  7344. this.isEnd = false;
  7345. this.isChangeTurn = false;
  7346. this.isInterrupt = false;
  7347. this.aiPlayedBreakArmy = false;
  7348. this.isTouchedBall = false;
  7349. this.finishBalls = 0;
  7350. this.needBalls = 0;
  7351. this.allBallNum = 0;
  7352. this.placeBallPosData = {};
  7353. this.curHP = 0;
  7354. this.showLongView = false;
  7355. this.firstShoot = true;
  7356. this._gamePause = false;
  7357. this.trunCount = 0;
  7358. this.isBlackInHole = false;
  7359. this.isEnter = true;
  7360. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7361. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7362. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7363. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7364. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7365. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7366. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7367. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7368. }
  7369. get gamePause() {
  7370. return this._gamePause;
  7371. }
  7372. set gamePause(v) {
  7373. if (v) {
  7374. Laya.physicsTimer.pause();
  7375. }
  7376. else {
  7377. Laya.physicsTimer.resume();
  7378. }
  7379. this._gamePause = v;
  7380. }
  7381. get selfTurn() {
  7382. return this._selfTurn;
  7383. }
  7384. set selfTurn(val) {
  7385. this.trunCount++;
  7386. this._selfTurn = val;
  7387. if (val) {
  7388. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7389. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7390. }
  7391. else {
  7392. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7393. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7394. if (this.trunCount > 1)
  7395. PlatMgr.openBox();
  7396. }
  7397. }
  7398. resetGame() {
  7399. this.inHoleBalls = [];
  7400. this.isFirstInGame = true;
  7401. this.firstColliObj = null;
  7402. this.aiCamp = "";
  7403. this.selfCamp = "";
  7404. this.aiFoulNum = 0;
  7405. this.selfFoulNum = 0;
  7406. this.selfBallArr = [];
  7407. this.aiBallArr = [];
  7408. this.gamePause = false;
  7409. this.ensureBallType = false;
  7410. this.isInterrupt = false;
  7411. this.updateLeftBall();
  7412. this.clearTime();
  7413. this.aiPlayedBreakArmy = false;
  7414. this.isBlackInHole = false;
  7415. this.placeBallPosData = {};
  7416. if (xGame.common.d3World.knifeRoot) {
  7417. xGame.common.d3World.knifeRoot.destroyChildren();
  7418. }
  7419. }
  7420. gameReady() {
  7421. this.trunCount = 0;
  7422. this.firstColliObj = null;
  7423. this.isFirstInGame = true;
  7424. this.selfTurn = Math.random() <= this.selfTurnRate;
  7425. let challengeNum = DataMgr.getChallengeTimes();
  7426. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7427. this.selfTurn = true;
  7428. }
  7429. if (xGame.common.gameMode == GameMode.placeBall)
  7430. this.selfTurn = true;
  7431. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7432. this.selfTurn = true;
  7433. }
  7434. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7435. this.checkGuide();
  7436. if (xGame.common.uiRodMethod)
  7437. xGame.common.uiRodMethod.resetRod();
  7438. xGame.common.d2World.getHelpLine();
  7439. this.isOpenBall = true;
  7440. this.isTouchedBall = false;
  7441. xGame.common.aiPlayer.stopRun();
  7442. this.setTime = 30;
  7443. let ui = xGame.common.gameUI.ui;
  7444. switch (xGame.common.gameMode) {
  7445. case GameMode.classic:
  7446. xGame.common.aiPlayer.init();
  7447. this.blackNum = 8;
  7448. this.placeRootBall();
  7449. this.peoplePlay(9, 10);
  7450. ui.wordsBtn.visible = true;
  7451. ui.aiWordsBtn.visible = true;
  7452. xGame.common.talkMgr.changeAIState(true);
  7453. DataMgr.gameData.gameCount++;
  7454. DataMgr.saveGameData();
  7455. break;
  7456. case GameMode.bigMove:
  7457. this.blackNum = -1;
  7458. this.selfScore = 0;
  7459. this.aiScore = 0;
  7460. xGame.common.aiPlayer.init();
  7461. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7462. this.updateSelfScore();
  7463. this.updateAIScore();
  7464. this.updateTargetSroce();
  7465. this.placeRootBall();
  7466. this.peoplePlay(9, 10);
  7467. ui.wordsBtn.visible = true;
  7468. ui.aiWordsBtn.visible = true;
  7469. xGame.common.talkMgr.changeAIState(true);
  7470. if (DataMgr.getSkillGuide() < 1)
  7471. DataMgr.gameData.gameCount = 0;
  7472. else {
  7473. DataMgr.gameData.gameCount++;
  7474. DataMgr.saveGameData();
  7475. PlatMgr.openTry();
  7476. }
  7477. if (xGame.common.d3World.knifeRoot) {
  7478. xGame.common.d3World.knifeRoot.destroyChildren();
  7479. }
  7480. break;
  7481. case GameMode.placeBall:
  7482. this.blackNum = -1;
  7483. this.selfTurn = true;
  7484. this.setTime = 10000;
  7485. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7486. this.curHP = this.placeBallData.hp;
  7487. if (this.placeBallData.ball == -1)
  7488. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7489. else
  7490. this.needBalls = this.placeBallData.ball;
  7491. console.log("需要的进球数目", this.needBalls);
  7492. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7493. this.finishBalls = 0;
  7494. this.placeBallPosData = {};
  7495. this.updatePlaceBallPos();
  7496. this.updatePlaceBallState();
  7497. this.finishOneShoot = true;
  7498. xGame.common.gameUI.ui.moveNode.visible = false;
  7499. this.isOpenBall = false;
  7500. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7501. ui.wordsBtn.visible = false;
  7502. ui.aiWordsBtn.visible = false;
  7503. xGame.common.talkMgr.changeAIState(false);
  7504. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7505. PlatMgr.openBox();
  7506. });
  7507. break;
  7508. default:
  7509. break;
  7510. }
  7511. this.showLongView = false;
  7512. xGame.common.wordsMgr.comboTimes = 1;
  7513. let guide = DataMgr.getSkillGuide();
  7514. if (guide)
  7515. xGame.eventMgr.event(WAIT_SHOOT);
  7516. xGame.common.upSkillLevel = false;
  7517. xGame.common.gameStartTime = new Date().getTime();
  7518. this.firstShoot = true;
  7519. }
  7520. checkGuide() {
  7521. let guide = DataMgr.getSkillGuide();
  7522. let gameUI = xGame.common.gameUI.ui;
  7523. gameUI.guide1.visible = false;
  7524. gameUI.guide2.visible = false;
  7525. gameUI.guide3.visible = false;
  7526. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7527. this.selfTurn = true;
  7528. }
  7529. else {
  7530. return;
  7531. }
  7532. let oneBall = this.getOneBall();
  7533. gameUI.guide1.visible = true;
  7534. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7535. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7536. }
  7537. getOneBall() {
  7538. let arr = xGame.common.d2World.ballArr;
  7539. for (let index = 0; index < arr.length; index++) {
  7540. if (arr[index].number == 0)
  7541. continue;
  7542. return arr[index];
  7543. }
  7544. }
  7545. updateSelfScore() {
  7546. let ui = xGame.common.gameUI.ui.topNode;
  7547. ui.selfScoreTxt.text = this.selfScore + "";
  7548. }
  7549. updateAIScore() {
  7550. let ui = xGame.common.gameUI.ui.topNode;
  7551. ui.aiScoreTxt.text = this.aiScore + "";
  7552. }
  7553. updateTargetSroce() {
  7554. let ui = xGame.common.gameUI.ui.topNode;
  7555. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7556. }
  7557. updateLeftBall() {
  7558. let topUI = xGame.common.gameUI.ui.topNode;
  7559. topUI.selfBallList.numItems = this.selfBallArr.length;
  7560. topUI.aiBallList.numItems = this.aiBallArr.length;
  7561. }
  7562. ballShoot() {
  7563. this.clearTime();
  7564. this.finishOneShoot = false;
  7565. xGame.common.gameUI.ui.moveNode.visible = false;
  7566. if (xGame.common.gameUI.ui.guideNode.visible) {
  7567. xGame.common.gameUI.ui.guideNode.visible = false;
  7568. }
  7569. if (this.firstShoot) {
  7570. this.firstShoot = false;
  7571. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7572. }
  7573. }
  7574. ensureCamp(number) {
  7575. this.ensureBallType = true;
  7576. this.isOpenBall = false;
  7577. if (xGame.common.gameMode != GameMode.classic)
  7578. return;
  7579. let full = [1, 2, 3, 4, 5, 6, 7];
  7580. let flower = [9, 10, 11, 12, 13, 14, 15];
  7581. let sayWords = "";
  7582. if (this.selfTurn) {
  7583. if (number <= 7) {
  7584. this.selfCamp = ballCamp.full;
  7585. this.selfBallArr = full;
  7586. this.aiCamp = ballCamp.flower;
  7587. this.aiBallArr = flower;
  7588. sayWords = cfgTable.wordsData[3].msg;
  7589. }
  7590. else {
  7591. this.selfCamp = ballCamp.flower;
  7592. this.selfBallArr = flower;
  7593. this.aiCamp = ballCamp.full;
  7594. this.aiBallArr = full;
  7595. sayWords = cfgTable.wordsData[4].msg;
  7596. }
  7597. }
  7598. else {
  7599. if (number <= 7) {
  7600. this.selfCamp = ballCamp.flower;
  7601. this.selfBallArr = flower;
  7602. this.aiCamp = ballCamp.full;
  7603. this.aiBallArr = full;
  7604. sayWords = cfgTable.wordsData[2].msg;
  7605. }
  7606. else {
  7607. this.selfCamp = ballCamp.full;
  7608. this.selfBallArr = full;
  7609. this.aiCamp = ballCamp.flower;
  7610. this.aiBallArr = flower;
  7611. sayWords = cfgTable.wordsData[1].msg;
  7612. }
  7613. }
  7614. this.updateLeftBall();
  7615. xGame.uiMgr.Show(UIMsg, sayWords);
  7616. }
  7617. updatePlaceBallState() {
  7618. let ui = xGame.common.gameUI.ui;
  7619. switch (this.placeBallData.type) {
  7620. case PlaceBallType.normal:
  7621. let normal = ui.placeNormalNode;
  7622. normal.hpTxt.text = this.curHP + "";
  7623. this.updatePlaceBallStar(normal);
  7624. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7625. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7626. break;
  7627. case PlaceBallType.challenge:
  7628. let challenge = ui.placeChallengeNode;
  7629. challenge.hpTxt.text = "Shots:" + this.curHP;
  7630. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7631. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7632. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7633. break;
  7634. default:
  7635. break;
  7636. }
  7637. }
  7638. playSubHpAni() {
  7639. let ui = xGame.common.gameUI.ui;
  7640. switch (this.placeBallData.type) {
  7641. case PlaceBallType.normal:
  7642. let normal = ui.placeNormalNode;
  7643. normal.hpTxt.visible = false;
  7644. normal.starAni.c1.selectedIndex = 1;
  7645. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7646. normal.hpTxt.visible = true;
  7647. normal.starAni.c1.selectedIndex = 0;
  7648. }));
  7649. break;
  7650. default:
  7651. break;
  7652. }
  7653. }
  7654. getEndStarNum() {
  7655. let num;
  7656. let level = xGame.common.placeBallCurLevel;
  7657. if (this.curHP == this.placeBallData.hp) {
  7658. num = 3;
  7659. }
  7660. else if (this.curHP <= 1) {
  7661. num = 1;
  7662. }
  7663. else {
  7664. num = 2;
  7665. }
  7666. if (!this.success) {
  7667. num = 0;
  7668. }
  7669. else {
  7670. DataMgr.setPlaceBallLevel(level, num);
  7671. }
  7672. let myType = cfgTable.placeballData[level].type;
  7673. if (this.success && myType == 1) {
  7674. num = 3;
  7675. }
  7676. xGame.common.placeBallStarNum = num;
  7677. }
  7678. updatePlaceBallStar(node) {
  7679. let star = 0;
  7680. if (this.curHP == this.placeBallData.hp) {
  7681. star = 3;
  7682. }
  7683. else if (this.curHP >= 2) {
  7684. star = 2;
  7685. }
  7686. else if (this.curHP == 1) {
  7687. star = 1;
  7688. }
  7689. else {
  7690. star = 0;
  7691. }
  7692. let temp;
  7693. for (let index = 1; index <= 3; index++) {
  7694. temp = node["star" + index];
  7695. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7696. }
  7697. node.myProgress.value = (star / 3) * 100;
  7698. }
  7699. openRegretView(isFoul, GoalNum, challenge = false) {
  7700. let regretType = -1;
  7701. if (isFoul) {
  7702. regretType = 1;
  7703. }
  7704. else {
  7705. if (GoalNum <= 0) {
  7706. regretType = 0;
  7707. }
  7708. }
  7709. if (challenge) {
  7710. regretType = 1;
  7711. }
  7712. if (regretType != -1) {
  7713. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7714. if (success) {
  7715. this.curHP++;
  7716. this.updatePlaceBallState();
  7717. this.setPlaceBallAllPos();
  7718. xGame.common.gameUI.ui.moveNode.visible = false;
  7719. }
  7720. else {
  7721. if (this.curHP <= 0) {
  7722. this.success = false;
  7723. this.gameEnd();
  7724. }
  7725. this.playSubHpAni();
  7726. }
  7727. this.updatePlaceBallState();
  7728. this.updatePlaceBallPos();
  7729. });
  7730. }
  7731. }
  7732. setPlaceBallAllPos() {
  7733. let allBall = xGame.common.d2World.ballArr;
  7734. let cfgArr = this.placeBallPosData;
  7735. let temp;
  7736. let obj;
  7737. for (let index = 0; index < allBall.length; index++) {
  7738. temp = allBall[index];
  7739. if (temp.destroyed)
  7740. continue;
  7741. obj = cfgArr[temp.myUNID];
  7742. if (obj && obj.src && !obj.src.destroyed) {
  7743. temp.gameObj.x = obj.posX;
  7744. temp.gameObj.y = obj.posY;
  7745. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7746. }
  7747. }
  7748. xGame.common.d2World.getHelpLine();
  7749. }
  7750. updatePlaceBallPos() {
  7751. let arr = xGame.common.d2World.ballArr;
  7752. let temp;
  7753. for (let index = 0; index < arr.length; index++) {
  7754. temp = arr[index];
  7755. if (!this.placeBallPosData[temp.myUNID]) {
  7756. this.placeBallPosData[temp.myUNID] = {
  7757. src: temp,
  7758. posX: temp.gameObj.x,
  7759. posY: temp.gameObj.y
  7760. };
  7761. }
  7762. else {
  7763. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7764. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7765. }
  7766. }
  7767. let check;
  7768. for (const key in this.placeBallPosData) {
  7769. check = this.placeBallPosData[key];
  7770. if (check.src.destroyed) {
  7771. delete this.placeBallPosData[key];
  7772. }
  7773. }
  7774. }
  7775. gameRun(type) {
  7776. if (this.gamePause)
  7777. return;
  7778. this.curFoul = this.getFoulType();
  7779. if (type) {
  7780. xGame.common.d2World.d2Gan.shoot();
  7781. xGame.common.gameUI.forceCancel();
  7782. this.curFoul = type;
  7783. }
  7784. this.isEnd = false;
  7785. this.isChangeTurn = true;
  7786. if (xGame.common.gameMode == GameMode.classic) {
  7787. this.judgeClassic(this.curFoul);
  7788. this.checkClassicWords(() => {
  7789. xGame.common.destroyClassicEmotion();
  7790. if (this.isEnd) {
  7791. if (this.isBlackInHole) {
  7792. xGame.common.gameUI.ui.blackAni.visible = true;
  7793. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7794. xGame.common.gameUI.ui.blackAni.visible = false;
  7795. this.gameEnd();
  7796. }));
  7797. }
  7798. else {
  7799. this.gameEnd();
  7800. }
  7801. }
  7802. else {
  7803. this.waitShoot();
  7804. xGame.eventMgr.event(WAIT_SHOOT);
  7805. }
  7806. });
  7807. }
  7808. else if (xGame.common.gameMode == GameMode.bigMove) {
  7809. xGame.common.aiPlayer.stopRun();
  7810. let scoreArr = this.getScore(this.curFoul);
  7811. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7812. this.isEnd = true;
  7813. }
  7814. this.checkBigSkillWords(() => {
  7815. if (this.isEnd) {
  7816. this.gameEnd();
  7817. }
  7818. else {
  7819. this.waitShoot();
  7820. xGame.eventMgr.event(WAIT_SHOOT);
  7821. }
  7822. });
  7823. }
  7824. else if (xGame.common.gameMode == GameMode.placeBall) {
  7825. xGame.common.destroyAwardSpine();
  7826. let isFoul = this.curFoul == FoulType.rootHole;
  7827. let GoalNum = this.inHoleBalls.length;
  7828. if (this.inHoleBalls.indexOf(0) > -1)
  7829. GoalNum -= 1;
  7830. if (isFoul) {
  7831. this.placeRootBall();
  7832. }
  7833. console.log("neeballs", this.needBalls);
  7834. console.log("当前完成的goalNum", GoalNum);
  7835. this.finishBalls += GoalNum;
  7836. console.log("当前完成的finishballs", this.finishBalls);
  7837. let need = this.needBalls;
  7838. if (this.placeBallData.type == PlaceBallType.challenge) {
  7839. need += 100;
  7840. }
  7841. if (this.finishBalls >= need) {
  7842. this.success = true;
  7843. this.gameEnd();
  7844. }
  7845. else {
  7846. switch (this.placeBallData.type) {
  7847. case PlaceBallType.normal:
  7848. if (!isFoul && GoalNum > 0) {
  7849. this.updatePlaceBallPos();
  7850. this.updatePlaceBallState();
  7851. }
  7852. else {
  7853. this.curHP--;
  7854. this.openRegretView(isFoul, GoalNum);
  7855. }
  7856. this.waitShoot();
  7857. xGame.eventMgr.event(WAIT_SHOOT);
  7858. break;
  7859. case PlaceBallType.challenge:
  7860. this.curHP--;
  7861. this.updatePlaceBallState();
  7862. if (isFoul) {
  7863. this.openRegretView(isFoul, GoalNum, true);
  7864. }
  7865. else {
  7866. this.updatePlaceBallPos();
  7867. if (this.curHP <= 0) {
  7868. this.success = true;
  7869. this.gameEnd();
  7870. }
  7871. }
  7872. this.waitShoot();
  7873. xGame.eventMgr.event(WAIT_SHOOT);
  7874. break;
  7875. default:
  7876. break;
  7877. }
  7878. }
  7879. }
  7880. }
  7881. checkClassicWords(callback) {
  7882. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7883. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7884. let type = this.getClassicWordsType();
  7885. if (condition && type != -1) {
  7886. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7887. xGame.soundMgr.playSound(str);
  7888. xGame.common.wordsMgr.playClassicWords(type, callback);
  7889. }
  7890. else {
  7891. Laya.timer.once(300, this, () => {
  7892. callback && callback();
  7893. });
  7894. }
  7895. }
  7896. getClassicWordsType() {
  7897. let d2world = xGame.common.d2World;
  7898. let type = -1;
  7899. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7900. type = ClassicWordsType.perfectShow;
  7901. return type;
  7902. }
  7903. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7904. type = ClassicWordsType.directShoot;
  7905. return type;
  7906. }
  7907. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7908. type = ClassicWordsType.anotherShoot;
  7909. return type;
  7910. }
  7911. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7912. type = ClassicWordsType.bigPower;
  7913. return type;
  7914. }
  7915. let minSpeed = 1;
  7916. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7917. type = ClassicWordsType.hardShoot;
  7918. return type;
  7919. }
  7920. if (this.inHoleBalls.length > 0) {
  7921. type = ClassicWordsType.directShoot;
  7922. return type;
  7923. }
  7924. return type;
  7925. }
  7926. checkBigSkillWords(callback) {
  7927. if (this.curFoul == FoulType.timeOut) {
  7928. callback && callback();
  7929. }
  7930. else {
  7931. let playSkill = false;
  7932. if (this.selfTurn) {
  7933. playSkill = true;
  7934. }
  7935. else {
  7936. if (!this.aiPlayedBreakArmy) {
  7937. this.aiPlayedBreakArmy = true;
  7938. playSkill = true;
  7939. }
  7940. if (this.aiCurSkill != SkillType.breakArmy) {
  7941. playSkill = true;
  7942. }
  7943. }
  7944. if (xGame.common.skillMgr.playedLastSkill) {
  7945. xGame.common.skillMgr.playedLastSkill = false;
  7946. playSkill = false;
  7947. }
  7948. if (playSkill) {
  7949. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7950. let selfExtra = 0;
  7951. let aiExtra = 0;
  7952. if (this.selfTurn)
  7953. selfExtra += extraScore;
  7954. else
  7955. aiExtra += extraScore;
  7956. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7957. this.isEnd = true;
  7958. }
  7959. this.playBigSkillTimes(callback);
  7960. });
  7961. }
  7962. else {
  7963. this.playBigSkillTimes(callback);
  7964. }
  7965. }
  7966. }
  7967. playBigSkillTimes(callback) {
  7968. let length = this.inHoleBalls.length;
  7969. if (this.inHoleBalls.indexOf(0) > -1) {
  7970. length = this.inHoleBalls.length - 1;
  7971. }
  7972. if (length <= 0) {
  7973. callback && callback();
  7974. return;
  7975. }
  7976. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7977. callback && callback();
  7978. });
  7979. }
  7980. playSkillTips() {
  7981. let levelNum = 0;
  7982. let curType;
  7983. if (this.selfTurn) {
  7984. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7985. curType = this.selfCurSkill;
  7986. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7987. levelNum += 5;
  7988. }
  7989. }
  7990. else {
  7991. levelNum = this.aiSkillLevelNum;
  7992. curType = this.aiCurSkill;
  7993. }
  7994. let str = ``;
  7995. switch (curType) {
  7996. case SkillType.highSpace:
  7997. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7998. break;
  7999. case SkillType.breakArmy:
  8000. str = `You pocketed ${levelNum} extra balls`;
  8001. break;
  8002. case SkillType.ice:
  8003. str = `${levelNum * 2} extra balls were frozen`;
  8004. break;
  8005. case SkillType.fireworks:
  8006. str = `${levelNum} extra balls exploded `;
  8007. break;
  8008. case SkillType.GuanYu:
  8009. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8010. break;
  8011. default:
  8012. break;
  8013. }
  8014. xGame.uiMgr.Show(UIMsg, str);
  8015. }
  8016. getFoulType() {
  8017. let foulType = "";
  8018. if (this.firstColliObj == null) {
  8019. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8020. return FoulType.rootHole;
  8021. }
  8022. return FoulType.notTouch;
  8023. }
  8024. else {
  8025. if (this.selfTurn) {
  8026. if (this.selfBallArr.length > 0) {
  8027. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8028. foulType = FoulType.wrongTouch;
  8029. }
  8030. }
  8031. else {
  8032. if (this.ensureBallType) {
  8033. }
  8034. else {
  8035. if (this.firstColliObj == this.blackNum) {
  8036. foulType = FoulType.wrongTouch;
  8037. }
  8038. }
  8039. }
  8040. }
  8041. else {
  8042. if (this.aiBallArr.length > 0) {
  8043. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8044. foulType = FoulType.wrongTouch;
  8045. }
  8046. }
  8047. else {
  8048. if (this.ensureBallType) {
  8049. }
  8050. else {
  8051. if (this.firstColliObj == this.blackNum) {
  8052. foulType = FoulType.wrongTouch;
  8053. }
  8054. }
  8055. }
  8056. }
  8057. if (this.inHoleBalls.length <= 0) {
  8058. return foulType;
  8059. }
  8060. let temp;
  8061. if (this.inHoleBalls.indexOf(0) > -1) {
  8062. foulType = FoulType.rootHole;
  8063. }
  8064. else {
  8065. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8066. temp = this.inHoleBalls[index];
  8067. if (this.selfTurn) {
  8068. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8069. foulType = FoulType.wrongHole;
  8070. break;
  8071. }
  8072. }
  8073. else {
  8074. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8075. foulType = FoulType.wrongHole;
  8076. break;
  8077. }
  8078. }
  8079. }
  8080. }
  8081. let foo;
  8082. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8083. temp = this.inHoleBalls[index];
  8084. foo = this.selfBallArr.indexOf(temp);
  8085. if (foo > -1) {
  8086. this.selfBallArr.splice(foo, 1);
  8087. }
  8088. foo = this.aiBallArr.indexOf(temp);
  8089. if (foo > -1) {
  8090. this.aiBallArr.splice(foo, 1);
  8091. }
  8092. }
  8093. this.updateLeftBall();
  8094. }
  8095. return foulType;
  8096. }
  8097. judgeGameEndByBlack(arr) {
  8098. if (this.selfTurn) {
  8099. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8100. this.selfFoulNum = this.maxFoulTimes;
  8101. return true;
  8102. }
  8103. }
  8104. else {
  8105. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8106. this.aiFoulNum = this.maxFoulTimes;
  8107. return true;
  8108. }
  8109. }
  8110. }
  8111. judgeClassic(type) {
  8112. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8113. xGame.common.aiPlayer.stopRun();
  8114. if (this.judgeNormalSuccess()) {
  8115. this.isEnd = true;
  8116. return;
  8117. }
  8118. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8119. if (this.selfTurn) {
  8120. if (isFoul) {
  8121. this.selfFoulNum++;
  8122. }
  8123. if (this.selfFoulNum >= this.maxFoulTimes) {
  8124. this.success = false;
  8125. this.isEnd = true;
  8126. return;
  8127. }
  8128. }
  8129. else {
  8130. if (isFoul)
  8131. this.aiFoulNum++;
  8132. if (this.aiFoulNum >= this.maxFoulTimes) {
  8133. this.success = true;
  8134. this.isEnd = true;
  8135. return;
  8136. }
  8137. }
  8138. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8139. this.isChangeTurn = false;
  8140. }
  8141. else {
  8142. this.isInterrupt = true;
  8143. }
  8144. }
  8145. waitShoot() {
  8146. if (xGame.common.gameMode == GameMode.classic) {
  8147. switch (this.curFoul) {
  8148. case FoulType.timeOut:
  8149. case FoulType.rootHole:
  8150. this.selfTurn = !this.selfTurn;
  8151. this.peoplePlay(5, 6, true);
  8152. break;
  8153. case FoulType.notTouch:
  8154. this.selfTurn = !this.selfTurn;
  8155. this.peoplePlay(7, 7);
  8156. break;
  8157. case FoulType.wrongHole:
  8158. this.selfTurn = !this.selfTurn;
  8159. this.peoplePlay(11, 11);
  8160. break;
  8161. default:
  8162. if (this.inHoleBalls.length > 0) {
  8163. this.peoplePlay(0, 0, false, false);
  8164. }
  8165. else {
  8166. this.selfTurn = !this.selfTurn;
  8167. this.peoplePlay(7, 7);
  8168. }
  8169. break;
  8170. }
  8171. }
  8172. else if (xGame.common.gameMode == GameMode.bigMove) {
  8173. if (this.curFoul == FoulType.timeOut) {
  8174. this.selfTurn = !this.selfTurn;
  8175. this.peoplePlay(14, 15);
  8176. this.placeRootBall();
  8177. }
  8178. else {
  8179. this.selfTurn = !this.selfTurn;
  8180. if (this.curFoul == FoulType.rootHole) {
  8181. this.peoplePlay(12, 13);
  8182. this.placeRootBall();
  8183. }
  8184. else {
  8185. this.peoplePlay(0, 0, false, false);
  8186. }
  8187. }
  8188. }
  8189. else if (xGame.common.gameMode == GameMode.placeBall) {
  8190. this.finishOneShoot = true;
  8191. }
  8192. this.gameResult();
  8193. }
  8194. gameResult() {
  8195. this.firstColliObj = null;
  8196. this.inHoleBalls = [];
  8197. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8198. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8199. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8200. if (xGame.common.uiRodMethod)
  8201. xGame.common.uiRodMethod.resetRod();
  8202. xGame.common.d2World.rootBall.showSelf();
  8203. this.clearIceSkill();
  8204. if (this.selfTurn) {
  8205. console.log("gameResult");
  8206. PlatMgr.gameInsert();
  8207. }
  8208. xGame.common.d3World.knifeRoot.destroyChildren();
  8209. if (this.selfTurn) {
  8210. xGame.common.gameUI.showHelpLineGuide();
  8211. xGame.common.gameUI.setTurnAlpha(true);
  8212. }
  8213. else {
  8214. xGame.common.gameUI.setTurnAlpha(false);
  8215. }
  8216. }
  8217. getScore(type) {
  8218. let selfAdd = 0;
  8219. let aiAdd = 0;
  8220. if (type == FoulType.timeOut) {
  8221. if (this.selfTurn)
  8222. aiAdd += 3;
  8223. else
  8224. selfAdd += 3;
  8225. }
  8226. else {
  8227. if (this.inHoleBalls.length > 0) {
  8228. if (this.selfTurn) {
  8229. if (type == FoulType.rootHole) {
  8230. aiAdd += 3;
  8231. if (this.inHoleBalls.length - 1 > 0) {
  8232. selfAdd += this.inHoleBalls.length - 1;
  8233. }
  8234. }
  8235. else {
  8236. selfAdd += this.inHoleBalls.length;
  8237. }
  8238. }
  8239. else {
  8240. if (type == FoulType.rootHole) {
  8241. selfAdd += 3;
  8242. if (this.inHoleBalls.length - 1 > 0) {
  8243. aiAdd += this.inHoleBalls.length - 1;
  8244. }
  8245. }
  8246. else {
  8247. aiAdd += this.inHoleBalls.length;
  8248. }
  8249. }
  8250. }
  8251. }
  8252. return [selfAdd, aiAdd];
  8253. }
  8254. judgeScoreEnd(selfAdd, aiAdd) {
  8255. this.selfScore += selfAdd;
  8256. this.aiScore += aiAdd;
  8257. this.updateAIScore();
  8258. this.updateSelfScore();
  8259. if (this.selfScore >= this.targertScore) {
  8260. this.success = true;
  8261. return true;
  8262. }
  8263. if (this.aiScore >= this.targertScore) {
  8264. this.success = false;
  8265. return true;
  8266. }
  8267. let ballArr = xGame.common.d2World.ballArr;
  8268. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8269. if (this.selfScore > this.aiScore) {
  8270. this.success = true;
  8271. return true;
  8272. }
  8273. else if (this.selfScore < this.aiScore) {
  8274. this.success = false;
  8275. return true;
  8276. }
  8277. else {
  8278. if (this.selfTurn) {
  8279. this.success = false;
  8280. }
  8281. else {
  8282. this.success = true;
  8283. }
  8284. return true;
  8285. }
  8286. }
  8287. }
  8288. clearIceSkill() {
  8289. let arr = xGame.common.d2World.ballArr;
  8290. let temp;
  8291. if (this.selfTurn) {
  8292. if (this.selfCurSkill == SkillType.ice) {
  8293. for (let index = 0; index < arr.length; index++) {
  8294. temp = arr[index];
  8295. if (temp.ballFunc == "ice") {
  8296. temp.setBallFunc("normal", "self");
  8297. }
  8298. }
  8299. }
  8300. }
  8301. else {
  8302. if (this.aiCurSkill == SkillType.ice) {
  8303. for (let index = 0; index < arr.length; index++) {
  8304. temp = arr[index];
  8305. if (temp.ballFunc == "ice") {
  8306. temp.setBallFunc("normal", "ai");
  8307. }
  8308. }
  8309. }
  8310. }
  8311. }
  8312. judgeNormalSuccess() {
  8313. if (this.selfTurn) {
  8314. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8315. this.success = true;
  8316. return true;
  8317. }
  8318. }
  8319. else {
  8320. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8321. this.success = false;
  8322. return true;
  8323. }
  8324. }
  8325. }
  8326. gameEnd() {
  8327. if (Moyu.isTT) {
  8328. xGame.common.screenImg = getScreenImg();
  8329. }
  8330. console.log("游戏结束", this.success);
  8331. xGame.common.aiPlayer.stopRun();
  8332. if (xGame.common.gameMode == GameMode.placeBall) {
  8333. this.getEndStarNum();
  8334. this.updatePlaceBallState();
  8335. }
  8336. this.isEnter = false;
  8337. Moyu.recordEnd(this, () => {
  8338. if (this.isEnter)
  8339. return;
  8340. this.isEnter = true;
  8341. console.log("进入录结束回调");
  8342. this.enterNext();
  8343. });
  8344. Laya.timer.once(1000, this, () => {
  8345. if (this.isEnter)
  8346. return;
  8347. this.isEnter = true;
  8348. this.enterNext();
  8349. });
  8350. xGame.common.longHelpLine = false;
  8351. }
  8352. enterNext() {
  8353. Laya.timer.clearAll(this);
  8354. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8355. xGame.uiMgr.Show(UIVideoShare, this.success);
  8356. }
  8357. else {
  8358. xGame.uiMgr.Show(UIGameEnd, this.success);
  8359. }
  8360. }
  8361. aiLeave() {
  8362. let ui = xGame.common.gameUI.ui;
  8363. ui.topNode.aiNameTxt.text = "offline";
  8364. }
  8365. aiGameEnd(suc) {
  8366. this.success = suc;
  8367. xGame.common.aiPlayer.stopRun();
  8368. if (this.success) {
  8369. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8370. Laya.timer.once(1000, this, () => {
  8371. this.clearTime();
  8372. this.gameEnd();
  8373. });
  8374. }
  8375. }
  8376. openTimer() {
  8377. let src = xGame.common.gameUI;
  8378. if (this.selfTurn) {
  8379. src.ui.topNode.selfProgress.visible = true;
  8380. src.ui.topNode.aiProgress.visible = false;
  8381. this.curTimer = src.ui.topNode.selfProgress;
  8382. }
  8383. else {
  8384. src.ui.topNode.selfProgress.visible = false;
  8385. src.ui.topNode.aiProgress.visible = true;
  8386. this.curTimer = src.ui.topNode.aiProgress;
  8387. }
  8388. this.accTime = 0;
  8389. Laya.timer.clearAll(this);
  8390. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8391. this.curTimer.value = 100;
  8392. }
  8393. updateTime(dt) {
  8394. if (this.gamePause)
  8395. return;
  8396. this.accTime += dt;
  8397. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8398. if (this.accTime >= this.setTime) {
  8399. this.clearTime();
  8400. console.log("时钟进入了gameRun");
  8401. this.gameRun(FoulType.timeOut);
  8402. }
  8403. }
  8404. clearTime() {
  8405. let src = xGame.common.gameUI;
  8406. src.ui.topNode.selfProgress.visible = false;
  8407. src.ui.topNode.aiProgress.visible = false;
  8408. Laya.timer.clearAll(this);
  8409. }
  8410. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8411. let ui = xGame.common.gameUI.ui;
  8412. let selfMsg, aiMsg;
  8413. if (sayWords) {
  8414. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8415. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8416. if (Foul) {
  8417. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8418. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8419. this.placeRootBall();
  8420. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8421. if (this.curFoul == FoulType.rootHole) {
  8422. if (!DataMgr.getRootBallFoul()) {
  8423. DataMgr.setRootBallFoul();
  8424. aiMsg = "";
  8425. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8426. let woman = "Boss, pay attention next time~";
  8427. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8428. }
  8429. }
  8430. else if (this.curFoul == FoulType.timeOut) {
  8431. if (!DataMgr.getTimeoutFoul()) {
  8432. DataMgr.setTimeoutFoul();
  8433. aiMsg = "";
  8434. let tips = "Game timeout, 3 fouls, this game failed.";
  8435. let woman = "Boss, pay attention to the timeline~";
  8436. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8437. }
  8438. }
  8439. }
  8440. }
  8441. }
  8442. if (this.selfTurn) {
  8443. if (sayWords) {
  8444. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8445. ui.selfTurn.visible = true;
  8446. ui.aiTurn.visible = false;
  8447. ui.selfTurn.t0.play();
  8448. Moyu.vibration();
  8449. });
  8450. }
  8451. }
  8452. else {
  8453. let aiNum = xGame.tools.random(1, 11);
  8454. let challengeNum = DataMgr.getChallengeTimes();
  8455. let delay = false;
  8456. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8457. aiNum = 9;
  8458. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8459. aiNum = 3;
  8460. if (challengeNum == 3) {
  8461. if (!this.showLongView) {
  8462. this.showLongView = true;
  8463. delay = true;
  8464. }
  8465. }
  8466. }
  8467. }
  8468. if (delay) {
  8469. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8470. if (success) {
  8471. xGame.common.longHelpLine = true;
  8472. xGame.common.d2World.getHelpLine();
  8473. }
  8474. else {
  8475. aiNum = 10;
  8476. }
  8477. xGame.common.aiPlayer.setAiLevel(aiNum);
  8478. if (sayWords) {
  8479. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8480. xGame.common.aiPlayer.runAI();
  8481. ui.selfTurn.visible = false;
  8482. ui.aiTurn.visible = true;
  8483. ui.aiTurn.t0.play();
  8484. });
  8485. }
  8486. else {
  8487. xGame.common.aiPlayer.runAI();
  8488. }
  8489. this.openTimer();
  8490. this.finishOneShoot = true;
  8491. if (this.selfTurn) {
  8492. ui.topNode.selfKuang.visible = true;
  8493. ui.topNode.aiKuang.visible = false;
  8494. ui.topNode.selfTips.visible = true;
  8495. ui.topNode.aiTips.visible = false;
  8496. }
  8497. else {
  8498. ui.topNode.selfKuang.visible = false;
  8499. ui.topNode.aiKuang.visible = true;
  8500. ui.topNode.selfTips.visible = false;
  8501. ui.topNode.aiTips.visible = true;
  8502. }
  8503. });
  8504. return;
  8505. }
  8506. if (xGame.common.gameMode == GameMode.classic) {
  8507. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8508. if (cfg) {
  8509. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8510. aiNum = aiLevel;
  8511. }
  8512. }
  8513. xGame.common.aiPlayer.setAiLevel(aiNum);
  8514. if (sayWords) {
  8515. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8516. xGame.common.aiPlayer.runAI();
  8517. ui.selfTurn.visible = false;
  8518. ui.aiTurn.visible = true;
  8519. ui.aiTurn.t0.play();
  8520. });
  8521. }
  8522. else {
  8523. xGame.common.aiPlayer.runAI();
  8524. }
  8525. }
  8526. this.openTimer();
  8527. this.finishOneShoot = true;
  8528. if (this.selfTurn) {
  8529. ui.topNode.selfKuang.visible = true;
  8530. ui.topNode.aiKuang.visible = false;
  8531. ui.topNode.selfTips.visible = true;
  8532. ui.topNode.aiTips.visible = false;
  8533. }
  8534. else {
  8535. ui.topNode.selfKuang.visible = false;
  8536. ui.topNode.aiKuang.visible = true;
  8537. ui.topNode.selfTips.visible = false;
  8538. ui.topNode.aiTips.visible = true;
  8539. }
  8540. }
  8541. placeRootBall() {
  8542. let rootBall = xGame.common.d2World.rootBall;
  8543. if (!rootBall)
  8544. return;
  8545. rootBall.gameObj.x = this.lastRootBallPos.x;
  8546. rootBall.gameObj.y = this.lastRootBallPos.y;
  8547. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8548. let moveNode = xGame.common.gameUI.ui.moveNode;
  8549. moveNode.visible = true;
  8550. moveNode.x = this.lastRootBallPos.x;
  8551. moveNode.y = this.lastRootBallPos.y;
  8552. if (!this.selfTurn) {
  8553. xGame.common.aiPlayer.resetRoot();
  8554. }
  8555. }
  8556. }
  8557. class ui_guanyuAni extends fgui.GComponent {
  8558. static createInstance() {
  8559. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8560. }
  8561. onConstruct() {
  8562. this.n0 = (this.getChild("n0"));
  8563. }
  8564. }
  8565. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8566. class UIFireworks extends UIBase {
  8567. constructor() {
  8568. super();
  8569. }
  8570. onConstructor() {
  8571. this.isEject = false;
  8572. }
  8573. show(callback) {
  8574. super.show();
  8575. }
  8576. }
  8577. UIFireworks.uiName = "UIFireworks";
  8578. class ui_UIGuanYu extends fgui.GComponent {
  8579. static createInstance() {
  8580. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8581. }
  8582. onConstruct() {
  8583. this.n2 = (this.getChild("n2"));
  8584. this.n1 = (this.getChild("n1"));
  8585. this.n3 = (this.getChild("n3"));
  8586. this.n4 = (this.getChild("n4"));
  8587. this.n5 = (this.getChild("n5"));
  8588. this.n6 = (this.getChild("n6"));
  8589. this.n8 = (this.getChild("n8"));
  8590. this.n7 = (this.getChild("n7"));
  8591. this.t0 = this.getTransition("t0");
  8592. }
  8593. }
  8594. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8595. class UIGuanYu extends UIBase {
  8596. constructor() {
  8597. super();
  8598. }
  8599. onConstructor() {
  8600. this.ui = ui_UIGuanYu.createInstance();
  8601. this.contentPane = this.ui;
  8602. this.isEject = false;
  8603. }
  8604. show(callback) {
  8605. super.show();
  8606. this.ui.t0.play(Laya.Handler.create(this, () => {
  8607. callback && callback();
  8608. this.hide();
  8609. }));
  8610. }
  8611. }
  8612. UIGuanYu.uiName = "UIGuanYu";
  8613. class SkillMgr {
  8614. constructor() {
  8615. this.leveNum = 0;
  8616. this.extraScore = 0;
  8617. this.selfTurn = false;
  8618. this.playedLastSkill = false;
  8619. this.tweenArr = [];
  8620. this._finishNum = 0;
  8621. this._curFinish = 0;
  8622. this._rootX = 0;
  8623. this._rootY = 0;
  8624. this.knifeTimes = 0;
  8625. this.knifeV2 = new Laya.Vector2();
  8626. this.knifeV3 = new Laya.Vector3();
  8627. this.rtStarX = 0;
  8628. this.rtStarY = 0;
  8629. this.addBigSkillSpine();
  8630. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8631. }
  8632. addBigSkillSpine() {
  8633. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8634. console.log("extra2 success");
  8635. });
  8636. }
  8637. runBigSkill(callback) {
  8638. this.tweenArr = [];
  8639. this.callback = callback;
  8640. this.judgeSkill();
  8641. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8642. let guide = DataMgr.getSkillGuide();
  8643. if (!xGame.common.gameMgr.selfTurn) {
  8644. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8645. }
  8646. else {
  8647. if (xGame.common.temSelfLevel != 0) {
  8648. this.leveNum = xGame.common.temSelfLevel;
  8649. }
  8650. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8651. this.leveNum += 5;
  8652. }
  8653. }
  8654. if (guide == 0) {
  8655. DataMgr.setSkillGuide(1);
  8656. if (DataMgr.getNewUser()) {
  8657. Moyu.sendDataEvent("gameFirstPlay");
  8658. DataMgr.setNewUser();
  8659. }
  8660. }
  8661. this.playSpineAni(() => {
  8662. switch (this.curSkill) {
  8663. case SkillType.highSpace:
  8664. this.runHighSpace();
  8665. break;
  8666. case SkillType.breakArmy:
  8667. this.runBreakArmy();
  8668. break;
  8669. case SkillType.ice:
  8670. this.runIce();
  8671. break;
  8672. case SkillType.fireworks:
  8673. this.runFireworks();
  8674. break;
  8675. case SkillType.GuanYu:
  8676. this.runGuanYu();
  8677. break;
  8678. default:
  8679. break;
  8680. }
  8681. });
  8682. }
  8683. judgeSkill() {
  8684. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8685. let gameMgr = xGame.common.gameMgr;
  8686. let type;
  8687. for (let index = 0; index < typeArr.length; index++) {
  8688. type = typeArr[index];
  8689. if (gameMgr.selfTurn) {
  8690. if (gameMgr.selfCurSkill == type) {
  8691. this.selfTurn = true;
  8692. this.curSkill = type;
  8693. return;
  8694. }
  8695. }
  8696. else {
  8697. if (gameMgr.aiCurSkill == type) {
  8698. this.selfTurn = false;
  8699. this.curSkill = type;
  8700. return;
  8701. }
  8702. }
  8703. }
  8704. }
  8705. playSpineAni(callback) {
  8706. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8707. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8708. parent.destroyChildren();
  8709. let aniIndex = 0;
  8710. let skillSpine;
  8711. switch (this.curSkill) {
  8712. case SkillType.highSpace:
  8713. aniIndex = 1;
  8714. xGame.soundMgr.playSound("skill01");
  8715. skillSpine = this.skillSpine2;
  8716. data.scaleX = 0.5;
  8717. data.scaleY = 0.5;
  8718. skillSpine.play(data, 1, false, parent, () => {
  8719. callback && callback();
  8720. });
  8721. break;
  8722. case SkillType.breakArmy:
  8723. aniIndex = 2;
  8724. xGame.soundMgr.playSound("skill02");
  8725. skillSpine = this.skillSpine2;
  8726. data.scaleX = 0.5;
  8727. data.scaleY = 0.5;
  8728. skillSpine.play(data, 2, false, parent, () => {
  8729. callback && callback();
  8730. });
  8731. break;
  8732. case SkillType.ice:
  8733. aniIndex = 0;
  8734. xGame.soundMgr.playSound("skill03");
  8735. skillSpine = this.skillSpine2;
  8736. data.scaleX = 0.5;
  8737. data.scaleY = 0.5;
  8738. skillSpine.play(data, 0, false, parent, () => {
  8739. callback && callback();
  8740. });
  8741. break;
  8742. case SkillType.fireworks:
  8743. xGame.soundMgr.playSound("skill_04_01");
  8744. xGame.soundMgr.playSound("skill04");
  8745. xGame.uiMgr.Show(UIFireworks, callback);
  8746. break;
  8747. case SkillType.GuanYu:
  8748. xGame.soundMgr.playSound("skill05_1");
  8749. xGame.soundMgr.playSound("skill05");
  8750. xGame.uiMgr.Show(UIGuanYu, callback);
  8751. break;
  8752. default:
  8753. break;
  8754. }
  8755. }
  8756. getAllBallArr() {
  8757. let arr = xGame.common.d2World.ballArr;
  8758. let outArr = [];
  8759. for (let index = 0; index < arr.length; index++) {
  8760. if (arr[index] instanceof D2RootBallSrc)
  8761. continue;
  8762. if (arr[index].ballFunc == "ice")
  8763. continue;
  8764. if (arr[index].destroyed)
  8765. continue;
  8766. outArr.push(arr[index]);
  8767. }
  8768. return outArr;
  8769. }
  8770. getOneArr(deletObj) {
  8771. let allArr = this.getAllBallArr();
  8772. let temp;
  8773. for (let index = 0; index < allArr.length; index++) {
  8774. temp = allArr[index];
  8775. if (temp.id == deletObj.id) {
  8776. allArr.splice(index, 1);
  8777. break;
  8778. }
  8779. }
  8780. return allArr;
  8781. }
  8782. getNearBallBag(ball) {
  8783. let ui = xGame.common.gameUI.ui;
  8784. let circleArr = [];
  8785. for (let index = 1; index <= 6; index++) {
  8786. circleArr.push(ui.border["circle" + index]);
  8787. }
  8788. let outIndex = 0;
  8789. let temp;
  8790. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8791. ;
  8792. let dis = 0;
  8793. for (let index = 1; index < circleArr.length; index++) {
  8794. temp = circleArr[index];
  8795. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8796. if (dis < min) {
  8797. min = dis;
  8798. outIndex = index;
  8799. }
  8800. }
  8801. return [circleArr[outIndex], outIndex];
  8802. }
  8803. ballFlyToBag(ballArr, time = 300) {
  8804. let temp;
  8805. let hole;
  8806. this._finishNum = ballArr.length;
  8807. this._curFinish = 0;
  8808. let holeObj = {};
  8809. let holeCfg = {
  8810. "1": 0,
  8811. "2": 0,
  8812. "3": 0,
  8813. "4": 0,
  8814. "5": 0,
  8815. "6": 0
  8816. };
  8817. for (let index = 0; index < ballArr.length; index++) {
  8818. temp = ballArr[index];
  8819. temp.outColli.isSensor = true;
  8820. temp.innerColli.isSensor = true;
  8821. temp.isRunSkillAni = true;
  8822. let holeArr = this.getNearBallBag(temp);
  8823. hole = holeArr[0];
  8824. holeObj[index] = holeArr[1];
  8825. temp.d3BallSrc.scaleXYZ = 0.5;
  8826. this.tweenArr.push(temp.d3BallSrc, temp);
  8827. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8828. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8829. }));
  8830. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8831. let mIndex = holeObj[this._curFinish];
  8832. let isDone = holeCfg[mIndex];
  8833. if (isDone) {
  8834. ballArr[this._curFinish].checkWrongBall(false);
  8835. }
  8836. else {
  8837. holeCfg[mIndex] = 1;
  8838. ballArr[this._curFinish].checkWrongBall();
  8839. }
  8840. this._curFinish++;
  8841. if (this._curFinish >= this._finishNum) {
  8842. if (this.curSkill == SkillType.highSpace) {
  8843. }
  8844. else if (this.curSkill == SkillType.breakArmy) {
  8845. let rootBall = xGame.common.d2World.rootBall;
  8846. rootBall.gameObj.x = this._rootX;
  8847. rootBall.gameObj.y = this._rootY;
  8848. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8849. xGame.common.d2World.d2Gan.ui.visible = true;
  8850. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8851. xGame.common.d2World.getHelpLine();
  8852. this.callback && this.callback(this.extraScore);
  8853. }
  8854. }
  8855. }));
  8856. }
  8857. }
  8858. runHighSpace() {
  8859. let rootBall = xGame.common.d2World.rootBall;
  8860. rootBall.showSelf();
  8861. let d3Src = rootBall.d3BallSrc;
  8862. let allArr = this.getAllBallArr();
  8863. if (allArr.length <= 0) {
  8864. this.callback && this.callback(0);
  8865. return;
  8866. }
  8867. let selectBall = xGame.common.d2World.targetBall;
  8868. let wrong = selectBall && selectBall.destroyed;
  8869. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8870. selectBall = xGame.common.getRandArrEle(allArr);
  8871. }
  8872. let targetD3Src = selectBall.d3BallSrc;
  8873. xGame.common.d2World.d2Gan.ui.visible = false;
  8874. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8875. d3Src.scaleXYZ = 0.5;
  8876. this.tweenArr.push(d3Src);
  8877. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8878. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8879. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8880. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8881. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8882. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8883. let outArr = [selectBall];
  8884. let other = this.leveNum - 1;
  8885. if (other > 0) {
  8886. let nearArr = this.getOneArr(selectBall);
  8887. if (nearArr.length > 0) {
  8888. xGame.common.botherArr(nearArr);
  8889. if (other >= nearArr.length)
  8890. other = nearArr.length;
  8891. for (let index = 0; index < other; index++) {
  8892. outArr.push(nearArr[index]);
  8893. }
  8894. }
  8895. }
  8896. xGame.common.extraMoveNum = other + 1;
  8897. this.extraScore = other + 1;
  8898. this._rootX = selectBall.gameObj.x;
  8899. this._rootY = selectBall.gameObj.y;
  8900. rootBall.gameObj.x = this._rootX;
  8901. rootBall.gameObj.y = this._rootY;
  8902. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8903. Laya.Tween.clearAll(d3Src);
  8904. this.addRandomForce(outArr);
  8905. }));
  8906. }));
  8907. }
  8908. addRandomForce(outArr) {
  8909. if (outArr.length > 0) {
  8910. xGame.common.d2World.openCheckStill = true;
  8911. this.playedLastSkill = true;
  8912. }
  8913. let temp;
  8914. for (let index = 0; index < outArr.length; index++) {
  8915. let angle = xGame.common.randomNum(0, 360);
  8916. let linearPercent = xGame.common.randomNum(65, 100);
  8917. temp = outArr[index];
  8918. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8919. }
  8920. }
  8921. setLinearSpeed(angle, rigy, linearPercent) {
  8922. let sin = Math.sin(angle * Math.PI / 180);
  8923. let cos = Math.cos(angle * Math.PI / 180);
  8924. let maxSpeed = 4;
  8925. let speed = new Laya.Vector2();
  8926. speed.x = maxSpeed * linearPercent * sin;
  8927. speed.y = -maxSpeed * linearPercent * cos;
  8928. rigy.applyLinearImpulseToCenter(speed);
  8929. }
  8930. runBreakArmy() {
  8931. xGame.common.d2World.d2Gan.ui.visible = false;
  8932. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8933. let gameUI = xGame.common.gameUI.ui;
  8934. gameUI.skillRod.visible = true;
  8935. gameUI.skillRod.rotation = 110;
  8936. let outArr = this.getAllBallArr();
  8937. if (outArr.length <= 0) {
  8938. gameUI.skillRod.visible = false;
  8939. this.callback && this.callback(0);
  8940. return;
  8941. }
  8942. xGame.common.botherArr(outArr);
  8943. if (this.leveNum >= outArr.length)
  8944. this.leveNum = outArr.length;
  8945. let deleteNum = outArr.length - this.leveNum;
  8946. outArr.splice(0, deleteNum);
  8947. this.extraScore = this.leveNum;
  8948. let potX = gameUI.skillRod.x;
  8949. let potY = gameUI.skillRod.y;
  8950. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8951. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8952. let disArr = [];
  8953. for (let index = 0; index < outArr.length; index++) {
  8954. let obj = outArr[index];
  8955. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8956. dis = Math.pow(dis, 0.5);
  8957. disArr.push(dis);
  8958. }
  8959. this.tweenArr.push(gameUI.skillRod);
  8960. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8961. })).update = Laya.Handler.create(this, (e, t, c) => {
  8962. let angle = gameUI.skillRod.rotation;
  8963. let xx;
  8964. let yy;
  8965. let temp;
  8966. for (let index = 0; index < outArr.length; index++) {
  8967. temp = outArr[index];
  8968. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8969. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8970. yy -= 20;
  8971. temp.gameObj.x = xx;
  8972. temp.gameObj.y = yy;
  8973. temp.d3BallSrc.setTransPos(xx, yy);
  8974. }
  8975. if (angle <= 60) {
  8976. Laya.Tween.clearAll(gameUI.skillRod);
  8977. this.ballFlyToBag(outArr, 150);
  8978. gameUI.skillRod.visible = false;
  8979. }
  8980. }, null, false);
  8981. }
  8982. runIce() {
  8983. let ballArr = xGame.common.d2World.ballArr;
  8984. this.leveNum *= 2;
  8985. if (this.leveNum >= ballArr.length - 1)
  8986. this.leveNum = ballArr.length - 1;
  8987. let tempArr = [];
  8988. let outArr = [];
  8989. for (let index = 0; index < ballArr.length; index++) {
  8990. if (ballArr[index] instanceof D2RootBallSrc)
  8991. continue;
  8992. tempArr.push(ballArr[index]);
  8993. }
  8994. if (tempArr.length <= 0) {
  8995. this.callback && this.callback(0);
  8996. return;
  8997. }
  8998. xGame.common.botherArr(tempArr);
  8999. for (let index = 0; index < this.leveNum; index++) {
  9000. outArr.push(tempArr[index]);
  9001. }
  9002. this.extraScore = this.leveNum;
  9003. let temp;
  9004. for (let index = 0; index < outArr.length; index++) {
  9005. temp = outArr[index];
  9006. temp.d3BallSrc.playIceEft();
  9007. }
  9008. Laya.timer.once(2000, this, () => {
  9009. for (let index = 0; index < outArr.length; index++) {
  9010. temp = outArr[index];
  9011. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9012. temp.setBallFunc("ice", str);
  9013. }
  9014. this.callback && this.callback(0);
  9015. });
  9016. }
  9017. runFireworks() {
  9018. let allArr = this.getAllBallArr();
  9019. if (allArr.length <= 0) {
  9020. this.callback && this.callback(0);
  9021. return;
  9022. }
  9023. xGame.common.d2World.d2Gan.ui.visible = false;
  9024. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9025. let outArr = [];
  9026. let other = this.leveNum;
  9027. if (other > 0) {
  9028. if (allArr.length > 0) {
  9029. xGame.common.botherArr(allArr);
  9030. if (other >= allArr.length)
  9031. other = allArr.length;
  9032. for (let index = 0; index < other; index++) {
  9033. outArr.push(allArr[index]);
  9034. }
  9035. }
  9036. }
  9037. xGame.common.extraMoveNum = other;
  9038. this.extraScore = other;
  9039. this.addRandmomFireworks(outArr);
  9040. }
  9041. addRandmomFireworks(outArr) {
  9042. Laya.timer.once(1100, this, () => {
  9043. if (outArr.length > 0) {
  9044. xGame.common.d2World.openCheckStill = true;
  9045. this.playedLastSkill = true;
  9046. }
  9047. });
  9048. xGame.soundMgr.playSound("skill_04_02");
  9049. let temp;
  9050. let delay = -200;
  9051. for (let index = 0; index < outArr.length; index++) {
  9052. temp = outArr[index];
  9053. delay += 200;
  9054. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9055. let angle = xGame.common.randomNum(0, 360);
  9056. angle = this.getFireworksAngle(obj);
  9057. let linearPercent = xGame.common.randomNum(45, 80);
  9058. if (!obj.destroyed)
  9059. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9060. });
  9061. }
  9062. }
  9063. getFireworksAngle(obj) {
  9064. let rootBall = xGame.common.d2World.rootBall;
  9065. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9066. }
  9067. resetGame() {
  9068. Laya.timer.clearAll(this);
  9069. if (this.tweenArr) {
  9070. for (let index = 0; index < this.tweenArr.length; index++) {
  9071. Laya.Tween.clearAll(this.tweenArr[index]);
  9072. }
  9073. }
  9074. this.tweenArr = null;
  9075. }
  9076. runGuanYu() {
  9077. xGame.common.d2World.d2Gan.ui.visible = false;
  9078. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9079. let rootBall = xGame.common.d2World.rootBall;
  9080. if (rootBall.isInHole) {
  9081. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9082. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9083. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9084. rootBall.showSelf();
  9085. }
  9086. this.rtStarX = rootBall.gameObj.x;
  9087. this.rtStarY = rootBall.gameObj.y;
  9088. this.knifeTimes = 0;
  9089. this.playedLastSkill = true;
  9090. rootBall.forceRun = true;
  9091. rootBall.rigy.type = "static";
  9092. xGame.common.d2World.openCheckStill = true;
  9093. this.guanyuRandomKnife();
  9094. }
  9095. guanyuRandomKnife() {
  9096. let rootBall = xGame.common.d2World.rootBall;
  9097. let dir = this.getRandDir();
  9098. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9099. console.log("当前angle", angle);
  9100. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9101. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9102. let dis = 324;
  9103. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9104. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9105. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9106. this.rtStarX = rootBall.gameObj.x;
  9107. this.rtStarY = rootBall.gameObj.y;
  9108. this.knifeTimes++;
  9109. let skillLevel;
  9110. if (xGame.common.gameMgr.selfTurn) {
  9111. skillLevel = DataMgr.getBigSkillByIndex(4);
  9112. }
  9113. else {
  9114. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9115. }
  9116. if (!skillLevel)
  9117. skillLevel = 1;
  9118. skillLevel += 2;
  9119. if (this.knifeTimes < skillLevel) {
  9120. Laya.timer.once(400, this, () => {
  9121. this.guanyuRandomKnife();
  9122. });
  9123. }
  9124. else {
  9125. rootBall.forceRun = false;
  9126. rootBall.rigy.type = "dynamic";
  9127. xGame.common.extraMoveNum = skillLevel;
  9128. }
  9129. }));
  9130. }
  9131. getRandDir() {
  9132. let rootBall = xGame.common.d2World.rootBall;
  9133. let allBall = this.getAllBallArr();
  9134. let target = xGame.common.getRandArrEle(allBall);
  9135. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9136. return this.knifeV2;
  9137. }
  9138. cloneKnife(x, y, rotation) {
  9139. let parent = xGame.common.d3World.knifeRoot;
  9140. let prefab = xGame.common.d3World.knife;
  9141. let clone = prefab.clone();
  9142. parent.addChild(clone);
  9143. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9144. clone.transform.localPositionX = this.knifeV3.x;
  9145. clone.transform.localPositionY = 0;
  9146. clone.transform.localPositionZ = this.knifeV3.z;
  9147. clone.transform.localRotationEulerX = 0;
  9148. clone.transform.localRotationEulerY = rotation;
  9149. clone.transform.localRotationEulerZ = 0;
  9150. clone.active = true;
  9151. return clone;
  9152. }
  9153. cloneGuanYuEft(x, y, angle) {
  9154. return;
  9155. let parent = xGame.common.gameUI.ui.guanyuNode;
  9156. let eft = new ui_guanyuAni();
  9157. eft.parent = parent;
  9158. eft.x = x;
  9159. eft.y = y;
  9160. eft.rotation = angle;
  9161. }
  9162. }
  9163. class ui_UIWordsList extends fgui.GComponent {
  9164. static createInstance() {
  9165. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9166. }
  9167. onConstruct() {
  9168. this.c1 = this.getController("c1");
  9169. this.n74 = (this.getChild("n74"));
  9170. this.clickNode = (this.getChild("clickNode"));
  9171. this.myNode = (this.getChild("myNode"));
  9172. this.n68 = (this.getChild("n68"));
  9173. this.n66 = (this.getChild("n66"));
  9174. this.n55 = (this.getChild("n55"));
  9175. this.wordsBtn = (this.getChild("wordsBtn"));
  9176. this.emotionBtn = (this.getChild("emotionBtn"));
  9177. this.mybggg = (this.getChild("mybggg"));
  9178. this.wordsList = (this.getChild("wordsList"));
  9179. this.emotionList = (this.getChild("emotionList"));
  9180. this.myRoot = (this.getChild("myRoot"));
  9181. }
  9182. }
  9183. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9184. class EmotionDisplay {
  9185. constructor(index, ui) {
  9186. this.ui = ui;
  9187. this.index = index;
  9188. this.ui.onClick(this, this.clickSelf);
  9189. this.updateSelf();
  9190. }
  9191. updateSelf() {
  9192. let data = cfgTable.emotionData[this.index + 1];
  9193. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9194. }
  9195. clickSelf() {
  9196. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9197. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9198. xGame.common.talkMgr.closeTalkView();
  9199. }
  9200. }
  9201. class WordsDisplay {
  9202. constructor(index, ui) {
  9203. this.ui = ui;
  9204. this.index = index;
  9205. this.ui.onClick(this, this.clickSelf);
  9206. this.updateSelf();
  9207. }
  9208. updateSelf() {
  9209. let data = cfgTable.talkwordsData[this.index + 1];
  9210. this.ui.txt.text = data.msg;
  9211. }
  9212. clickSelf() {
  9213. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9214. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9215. xGame.common.talkMgr.closeTalkView();
  9216. }
  9217. }
  9218. class UIWordsList extends UIBase {
  9219. constructor() {
  9220. super();
  9221. }
  9222. onConstructor() {
  9223. this.ui = ui_UIWordsList.createInstance();
  9224. this.contentPane = this.ui;
  9225. this.isEject = false;
  9226. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9227. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9228. this.addUIClick(this.ui.clickNode, this.hide);
  9229. this.initTalkList();
  9230. this.initEmotionList();
  9231. }
  9232. show() {
  9233. super.show();
  9234. }
  9235. initTalkList() {
  9236. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9237. let data = cfgTable.talkwordsData;
  9238. let length = Object.keys(data).length;
  9239. this.ui.wordsList.numItems = length;
  9240. }
  9241. initEmotionList() {
  9242. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9243. let data = cfgTable.emotionData;
  9244. let length = Object.keys(data).length;
  9245. this.ui.emotionList.numItems = length;
  9246. }
  9247. renderTalkItem(index, obj) {
  9248. let temp = new WordsDisplay(index, obj);
  9249. }
  9250. renderEmotionItem(index, obj) {
  9251. let temp = new EmotionDisplay(index, obj);
  9252. }
  9253. openTalkList() {
  9254. this.ui.c1.selectedIndex = 0;
  9255. }
  9256. openEmotionList() {
  9257. this.ui.c1.selectedIndex = 1;
  9258. }
  9259. }
  9260. UIWordsList.uiName = "UIWordsList";
  9261. class TalkMgr {
  9262. constructor() {
  9263. this.aiSpeak = true;
  9264. this.emotionList = [];
  9265. this.talkList = [];
  9266. this.addEvent();
  9267. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9268. this.emotionList = [];
  9269. this.talkList = [];
  9270. for (let k in cfgTable.emotionData) {
  9271. this.emotionList.push(cfgTable.emotionData[k].id);
  9272. }
  9273. for (let k in cfgTable.talkwordsData) {
  9274. this.talkList.push(cfgTable.talkwordsData[k].id);
  9275. }
  9276. }
  9277. addEvent() {
  9278. let ui = xGame.common.gameUI.ui;
  9279. ui.wordsBtn.visible = true;
  9280. ui.wordsBtn.onClick(this, this.openTalkView);
  9281. ui.aiWordsBtn.visible = true;
  9282. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9283. }
  9284. openTalkView() {
  9285. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9286. xGame.uiMgr.Show(UIWordsList);
  9287. }
  9288. closeTalkView() {
  9289. xGame.uiMgr.Hide(UIWordsList);
  9290. }
  9291. clickAIState() {
  9292. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9293. this.aiSpeak = !this.aiSpeak;
  9294. this.changeAIState(this.aiSpeak);
  9295. }
  9296. changeAIState(speak) {
  9297. this.aiSpeak = speak;
  9298. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9299. if (speak) {
  9300. btn.c1.selectedIndex = 0;
  9301. }
  9302. else {
  9303. btn.c1.selectedIndex = 1;
  9304. }
  9305. }
  9306. showSelfTalk(wordsId) {
  9307. let ui = xGame.common.gameUI.ui;
  9308. ui.selfTalk.visible = true;
  9309. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9310. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9311. ui.selfTalk.t0.play();
  9312. }
  9313. showSelfEmotion(emotionId) {
  9314. let ui = xGame.common.gameUI.ui;
  9315. ui.selfTalk.visible = true;
  9316. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9317. this.selfSpine && this.selfSpine.dispose();
  9318. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9319. let spineData = cfgTable.emotionData[emotionId].spine;
  9320. this.selfSpine = new SpineMgr(spineData, () => {
  9321. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9322. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9323. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9324. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9325. });
  9326. ui.selfTalk.t0.play();
  9327. }
  9328. showAITalk(wordsId) {
  9329. if (!this.aiSpeak)
  9330. return;
  9331. if (DataMgr.gameData.gameCount < 2)
  9332. return;
  9333. if (wordsId < 1)
  9334. wordsId = this.getRandTalk();
  9335. let ui = xGame.common.gameUI.ui;
  9336. ui.aiTalk.visible = true;
  9337. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9338. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9339. ui.aiTalk.t0.play();
  9340. }
  9341. getRandTalk() {
  9342. let rand = xGame.tools.random(0, this.talkList.length);
  9343. return this.emotionList[rand];
  9344. }
  9345. getRandEmotion() {
  9346. let rand = xGame.tools.random(0, this.emotionList.length);
  9347. return this.emotionList[rand];
  9348. }
  9349. showAIEmotion(emotionId) {
  9350. if (!this.aiSpeak)
  9351. return;
  9352. if (DataMgr.gameData.gameCount < 2)
  9353. return;
  9354. if (emotionId < 1)
  9355. emotionId = this.getRandEmotion();
  9356. let ui = xGame.common.gameUI.ui;
  9357. ui.aiTalk.visible = true;
  9358. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9359. this.aiSpine && this.aiSpine.dispose();
  9360. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9361. let spineData = cfgTable.emotionData[emotionId].spine;
  9362. this.aiSpine = new SpineMgr(spineData, () => {
  9363. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9364. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9365. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9366. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9367. });
  9368. ui.aiTalk.t0.play();
  9369. }
  9370. resetGame() {
  9371. let ui = xGame.common.gameUI.ui;
  9372. ui.aiTalk.visible = false;
  9373. ui.selfTalk.visible = false;
  9374. this.aiSpine && this.aiSpine.dispose();
  9375. this.selfSpine && this.selfSpine.dispose();
  9376. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9377. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9378. this.closeTalkView();
  9379. }
  9380. }
  9381. class WordsMgr {
  9382. constructor() {
  9383. this.comboTimes = 1;
  9384. this.skillTimes = 0;
  9385. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9386. this.comboSpine = new SpineMgr("yxz_liangan");
  9387. this.skillSpine = new SpineMgr("yiganxqiu");
  9388. this.scoreSpine = new SpineMgr("defen");
  9389. }
  9390. setClassicCombo(isInterrupt) {
  9391. if (isInterrupt) {
  9392. this.comboTimes = 0;
  9393. }
  9394. }
  9395. playClassicWords(type, callback) {
  9396. this.callback = callback;
  9397. let aniIndex = type;
  9398. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9399. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9400. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9401. mySpine.destroy(true);
  9402. this.playClassicTimes();
  9403. });
  9404. }
  9405. playClassicTimes() {
  9406. this.comboTimes++;
  9407. if (this.comboTimes <= 1) {
  9408. this.callback && this.callback();
  9409. }
  9410. else {
  9411. let aniIndex = this.comboTimes - 1;
  9412. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9413. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9414. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9415. mySpine.destroy(true);
  9416. this.callback && this.callback();
  9417. });
  9418. }
  9419. }
  9420. playBigSkillTimes(times, callback) {
  9421. if (times <= 0) {
  9422. callback && callback();
  9423. return;
  9424. }
  9425. this.callback = callback;
  9426. let pre = "sz_0";
  9427. let aniIndex = 0;
  9428. this.getWordsImg(times, pre, () => {
  9429. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9430. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9431. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9432. let r1 = ``;
  9433. let r2 = ``;
  9434. if (times <= 9) {
  9435. r1 = `res/d2Res/${pre}${times}.png`;
  9436. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9437. aniIndex = 0;
  9438. }
  9439. else {
  9440. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9441. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9442. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9443. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9444. aniIndex = 1;
  9445. }
  9446. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9447. mySpine.destroy(true);
  9448. xGame.common.gameMgr.playSkillTips();
  9449. this.playScore(times);
  9450. xGame.common.playRandomMutiBallBigSkillSound();
  9451. }, mySpine);
  9452. });
  9453. }
  9454. playScore(score) {
  9455. let pre = "sz_";
  9456. let aniIndex = 0;
  9457. this.getWordsImg(score, pre, () => {
  9458. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9459. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9460. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9461. let r1 = ``;
  9462. let r2 = ``;
  9463. if (score <= 9) {
  9464. r1 = `res/d2Res/${pre}${score}.png`;
  9465. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9466. aniIndex = 0;
  9467. }
  9468. else {
  9469. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9470. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9471. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9472. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9473. aniIndex = 1;
  9474. }
  9475. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9476. mySpine.destroy(true);
  9477. this.callback && this.callback();
  9478. }, mySpine);
  9479. });
  9480. }
  9481. getWordsImg(number, pre = "", callback) {
  9482. let arr = [];
  9483. if (number <= 9) {
  9484. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9485. }
  9486. else {
  9487. 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 });
  9488. }
  9489. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9490. callback && callback();
  9491. }));
  9492. }
  9493. }
  9494. class ui_UIRodMethod extends fgui.GComponent {
  9495. static createInstance() {
  9496. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9497. }
  9498. onConstruct() {
  9499. this.n24 = (this.getChild("n24"));
  9500. this.white = (this.getChild("white"));
  9501. this.dot = (this.getChild("dot"));
  9502. this.sureBtn = (this.getChild("sureBtn"));
  9503. this.n20 = (this.getChild("n20"));
  9504. this.n21 = (this.getChild("n21"));
  9505. this.n22 = (this.getChild("n22"));
  9506. this.n23 = (this.getChild("n23"));
  9507. this.n5 = (this.getChild("n5"));
  9508. this.n14 = (this.getChild("n14"));
  9509. this.t0 = this.getTransition("t0");
  9510. }
  9511. }
  9512. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9513. class UIRodMethod extends UIBase {
  9514. constructor() {
  9515. super();
  9516. this.isPressd = false;
  9517. }
  9518. onConstructor() {
  9519. this.ui = ui_UIRodMethod.createInstance();
  9520. this.contentPane = this.ui;
  9521. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9522. this.moveDir = new Laya.Vector2();
  9523. this.moveDest = new Laya.Vector2();
  9524. this.centerPos = new Laya.Vector2();
  9525. xGame.common.uiRodMethod = this;
  9526. }
  9527. show() {
  9528. super.show();
  9529. xGame.common.gameMgr.gamePause = true;
  9530. this.openPressDotEvent();
  9531. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9532. this.centerPos.x = this.ui.white.x;
  9533. this.centerPos.y = this.ui.white.y;
  9534. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9535. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9536. this.setDot();
  9537. }
  9538. setDot() {
  9539. this.ui.dot.x = this.moveDest.x;
  9540. this.ui.dot.y = this.moveDest.y;
  9541. }
  9542. closeSelf() {
  9543. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9544. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9545. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9546. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9547. xGame.common.gameMgr.gamePause = false;
  9548. this.hide();
  9549. }
  9550. openPressDotEvent() {
  9551. this.closePressDotEvent();
  9552. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9553. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9554. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9555. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9556. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9557. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9558. }
  9559. closePressDotEvent() {
  9560. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9561. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9562. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9563. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9564. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9565. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9566. }
  9567. onDown(e) {
  9568. if (e.type == Laya.Event.MOUSE_DOWN)
  9569. this.isPressd = true;
  9570. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9571. this.isPressd = false;
  9572. if (!this.isPressd)
  9573. return;
  9574. this.moveDest.x = e.stageX;
  9575. this.moveDest.y = e.stageY;
  9576. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9577. if (dis > 6724) {
  9578. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9579. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9580. }
  9581. this.setDot();
  9582. }
  9583. resetRod() {
  9584. this.ui.dot.x = this.ui.white.x;
  9585. this.ui.dot.y = this.ui.white.y;
  9586. this.gameRod.dot.x = this.gameRod.bg.x;
  9587. this.gameRod.dot.y = this.gameRod.bg.y;
  9588. xGame.common.rodOffest.x = 0;
  9589. xGame.common.rodOffest.y = 0;
  9590. }
  9591. }
  9592. UIRodMethod.uiName = "UIRodMethod";
  9593. class UIGame extends UIBase {
  9594. constructor() {
  9595. super();
  9596. this.powerNum = 0;
  9597. this.isD3Inited = false;
  9598. this.isPrePlay = false;
  9599. this.isMoveRod = false;
  9600. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9601. this.rulerDis = 20;
  9602. this.rulerOffset = 0;
  9603. }
  9604. onConstructor() {
  9605. this.ui = ui_UIGame.createInstance();
  9606. this.contentPane = this.ui;
  9607. this.ui.x += xGame.common.sysOffestNum;
  9608. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9609. this.isEject = false;
  9610. xGame.common.gameUI = this;
  9611. this.initSelf();
  9612. }
  9613. isTurnSelf() {
  9614. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9615. return true;
  9616. }
  9617. }
  9618. initSelf() {
  9619. let topUI = this.ui.topNode;
  9620. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9621. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9622. this.barInfo = {};
  9623. this.barInfo.curY = 0;
  9624. this.barInfo.height = this.ui.powerNode.height;
  9625. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9626. this.barInfo.powerStartY = this.ui.powerNode.y;
  9627. xGame.common.aiPlayer = new AIPlayer();
  9628. xGame.common.gameMgr = new GameMgr();
  9629. xGame.common.skillMgr = new SkillMgr();
  9630. xGame.common.wordsMgr = new WordsMgr();
  9631. xGame.common.talkMgr = new TalkMgr();
  9632. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9633. console.log("加载经典模式表情文件chenggon !");
  9634. });
  9635. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9636. console.log("挑战模式奖励模式spine加载成功!");
  9637. });
  9638. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9639. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9640. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9641. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9642. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9643. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9644. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9645. }
  9646. returnHome() {
  9647. let tips = "Are you sure to exit the game?";
  9648. let woman = "Boss, why don't you play for a while longer?";
  9649. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9650. }
  9651. addRodMethodClick() {
  9652. if (this.isTurnSelf()) {
  9653. xGame.uiMgr.Show(UIRodMethod);
  9654. }
  9655. }
  9656. clickHelpLineBtn(force = false) {
  9657. if (!this.isTurnSelf())
  9658. return;
  9659. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9660. if (success) {
  9661. xGame.common.longHelpLine = true;
  9662. xGame.common.d2World.getHelpLine();
  9663. Moyu.sendDataEvent("guideNum");
  9664. }
  9665. else {
  9666. }
  9667. });
  9668. }
  9669. renderSelfDisplayBalls(index, target) {
  9670. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9671. target.myImg.url = xGame.common.getGameIconUrl(str);
  9672. }
  9673. renderAIDisplayBalls(index, target) {
  9674. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9675. target.myImg.url = xGame.common.getGameIconUrl(str);
  9676. ;
  9677. }
  9678. updateMode() {
  9679. if (xGame.common.gameMode == GameMode.classic) {
  9680. this.ui.topNode.scoreNode.visible = false;
  9681. }
  9682. else if (xGame.common.gameMode == GameMode.bigMove) {
  9683. this.ui.topNode.scoreNode.visible = true;
  9684. }
  9685. }
  9686. show() {
  9687. super.show();
  9688. console.log("zh:uigame show");
  9689. this.ui.alpha = 0;
  9690. this.updateSelf();
  9691. console.log("zh:uigame bf gamemusic01 start");
  9692. xGame.soundMgr.playMusic("gamemusic01");
  9693. console.log("zh:uigame bf gamemusic01 end");
  9694. xGame.common.gameMgr.gamePause = false;
  9695. xGame.common.gameUI.ui.blackAni.visible = false;
  9696. xGame.common.gameUI.ui.whiteAni.visible = false;
  9697. this.ui.powerEft.visible = false;
  9698. this.ui.colorNode.visible = false;
  9699. this.updateHead();
  9700. }
  9701. updateSelf() {
  9702. if (xGame.common.gameMode == GameMode.classic) {
  9703. this.ui.c1.selectedIndex = 0;
  9704. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9705. this.ui.topNode.middleNode.visible = true;
  9706. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9707. }
  9708. else if (xGame.common.gameMode == GameMode.bigMove) {
  9709. this.ui.c1.selectedIndex = 0;
  9710. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9711. this.ui.topNode.middleNode.visible = false;
  9712. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9713. let rand = xGame.common.randomNum(1, max);
  9714. let guide = DataMgr.getSkillGuide();
  9715. if (guide == 0)
  9716. rand = 1;
  9717. xGame.common.bigMoveLevelIndex = rand;
  9718. }
  9719. else if (xGame.common.gameMode == GameMode.placeBall) {
  9720. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9721. this.ui.c1.selectedIndex = 1 + data.type;
  9722. this.ui.alpha = 1;
  9723. this.startGame();
  9724. }
  9725. this.updateMode();
  9726. this.initD3world();
  9727. this.initD2world();
  9728. }
  9729. startGame() {
  9730. this.ui.snowNode.visible = Math.random() <= 0.1;
  9731. this.ui.d2Node.visible = false;
  9732. xGame.common.d3World.d3Hand.gameObj.active = false;
  9733. xGame.common.d3World.tableSrc.init();
  9734. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9735. this.cameraViewChange(() => {
  9736. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9737. switch (xGame.common.gameMode) {
  9738. case GameMode.classic:
  9739. xGame.common.d3World.d3Hand.gameObj.active = true;
  9740. this.playPutBallD3Ani();
  9741. break;
  9742. case GameMode.bigMove:
  9743. this.enterGame();
  9744. Laya.timer.once(500, this, () => {
  9745. this.ui.topNode.middleNode.visible = true;
  9746. this.ui.topNode.middleNode.t0.play();
  9747. });
  9748. break;
  9749. case GameMode.placeBall:
  9750. this.enterGame();
  9751. break;
  9752. default:
  9753. break;
  9754. }
  9755. });
  9756. PlatMgr.showBanner(false);
  9757. }
  9758. enterGame() {
  9759. this.ui.d2Node.visible = true;
  9760. xGame.common.d3World.d3Hand.gameObj.active = false;
  9761. xGame.common.showOneCamera("mainCamera");
  9762. Moyu.recordGame(30, true);
  9763. if (!this.isPrePlay) {
  9764. this.isPrePlay = true;
  9765. xGame.common.d3World.prePlayEft();
  9766. }
  9767. xGame.common.gameMgr.gameReady();
  9768. this.openAllEvent();
  9769. this.ui.snowNode.visible = false;
  9770. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9771. this.ui.helpBtn.visible = condition;
  9772. }
  9773. showHelpLineGuide() {
  9774. let longGuide = DataMgr.getGuideHelpLine();
  9775. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9776. this.ui.helpBtn.visible = true;
  9777. this.ui.guideNode.visible = true;
  9778. }
  9779. }
  9780. setTurnAlpha(alpha) {
  9781. this.ui.keduNode.alpha = alpha;
  9782. this.ui.ganNode.alpha = alpha;
  9783. this.ui.rodMethodNode.alpha = alpha;
  9784. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9785. }
  9786. cameraViewChange(callback) {
  9787. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9788. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9789. xGame.common.showOneCamera("visitAngle");
  9790. cameraSrc.localRotationEulerY = 180;
  9791. cameraSrc.localRotationEulerZ = 0;
  9792. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9793. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9794. callback && callback();
  9795. }));
  9796. }));
  9797. }
  9798. playPutBallD3Ani() {
  9799. xGame.common.showOneCamera("mainCamera");
  9800. let handSrc = xGame.common.d3World.d3Hand;
  9801. handSrc.gameObj.active = true;
  9802. handSrc.transform.localPositionZ = 3;
  9803. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9804. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9805. handSrc.gameObj.active = false;
  9806. this.enterGame();
  9807. }), 400);
  9808. }));
  9809. }
  9810. updateHead() {
  9811. let user = Moyu.getUserInfo();
  9812. this.ui.topNode.selfNameTxt.text = user.nickName;
  9813. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9814. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9815. if (DataMgr.getSkillGuide() < 1) {
  9816. this.ui.topNode.aiNameTxt.text = 'billiards';
  9817. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9818. }
  9819. else {
  9820. this.ui.topNode.aiNameTxt.text = aiData.name;
  9821. let randNo = Math.floor(Math.random() * 10) + 1;
  9822. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9823. }
  9824. }
  9825. initD2world() {
  9826. let node = this.ui.d2Root.displayObject;
  9827. let src = node.getComponent(D2World);
  9828. if (!src) {
  9829. xGame.common.d2World = node.addComponent(D2World);
  9830. }
  9831. xGame.common.d2World.initSelf();
  9832. }
  9833. initD3world() {
  9834. if (this.isD3Inited)
  9835. return;
  9836. this.isD3Inited = true;
  9837. let scene3D = xGame.common.d3Scene;
  9838. this.ui.d3Root.displayObject.addChild(scene3D);
  9839. scene3D.active = true;
  9840. xGame.common.d3World.tableSrc.setBorderPos();
  9841. }
  9842. onRootMove(e) {
  9843. let rootBall = xGame.common.d2World.rootBall;
  9844. this.ui.moveNode.x = e.x;
  9845. this.ui.moveNode.y = e.y;
  9846. rootBall.gameObj.x = e.x;
  9847. rootBall.gameObj.y = e.y;
  9848. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9849. }
  9850. aiRootMove(move) {
  9851. if (move)
  9852. this.hideBallUI();
  9853. else {
  9854. this.showBallUI();
  9855. xGame.common.d2World.getHelpLine();
  9856. }
  9857. }
  9858. aiForce(type, force = 0) {
  9859. this.pressTarget = PressType.powerNode;
  9860. if (type == 1)
  9861. this.onEventUp({ force: true });
  9862. else if (type == 2)
  9863. this.onEventMove({ stageY: force, force: true });
  9864. }
  9865. onEventPress(e) {
  9866. if (e.stopPropagation)
  9867. e.stopPropagation();
  9868. if (!this.isTurnSelf())
  9869. return;
  9870. let target = e.target;
  9871. switch (target) {
  9872. case this.ui.myPowerNode.displayObject:
  9873. this.pressTarget = PressType.powerNode;
  9874. this.barInfo.curY = e.stageY;
  9875. this.updateBarInfo();
  9876. break;
  9877. case this.ui.moveNode.displayObject:
  9878. this.pressTarget = PressType.moveNode;
  9879. this.hideBallUI();
  9880. this.eventObj.curX = this.ui.moveNode.x;
  9881. this.eventObj.curY = this.ui.moveNode.y;
  9882. this.ui.moveNode.finger.visible = false;
  9883. this.eventObj.lastX = e.stageX;
  9884. this.eventObj.lastY = e.stageY;
  9885. break;
  9886. case this.ui.rulerClickNode.displayObject:
  9887. this.pressTarget = PressType.rulerNode;
  9888. this.eventObj.lastY = e.stageY;
  9889. break;
  9890. case this.ui.d2Root.displayObject:
  9891. this.pressTarget = PressType.d2Root;
  9892. this.eventObj.lastX = e.stageX;
  9893. this.eventObj.lastY = e.stageY;
  9894. this.eventObj.starX = e.stageX;
  9895. this.eventObj.starY = e.stageY;
  9896. this.eventObj.curX = 0;
  9897. this.eventObj.curY = 0;
  9898. xGame.common.d2World.d2Gan.setGanLastInfo();
  9899. this.rulerOffset = 0;
  9900. break;
  9901. default:
  9902. break;
  9903. }
  9904. }
  9905. onEventMove(e) {
  9906. if (e.stopPropagation)
  9907. e.stopPropagation();
  9908. if (e && e.force) {
  9909. }
  9910. else {
  9911. if (!this.isTurnSelf())
  9912. return;
  9913. }
  9914. switch (this.pressTarget) {
  9915. case PressType.powerNode:
  9916. this.barInfo.curY = e.stageY;
  9917. this.updateBarInfo();
  9918. this.isMoveRod = true;
  9919. break;
  9920. case PressType.moveNode:
  9921. let rootBall = xGame.common.d2World.rootBall;
  9922. let radius = rootBall.gameObj.width / 2;
  9923. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9924. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9925. let border = xGame.common.d2World.borderRect;
  9926. if (curX <= border.x + radius)
  9927. curX = border.x + radius;
  9928. else if (curX >= border.x + border.width - radius)
  9929. curX = border.x + border.width - radius;
  9930. if (curY <= border.y + radius)
  9931. curY = border.y + radius;
  9932. else if (curY >= border.y + border.height - radius)
  9933. curY = border.y + border.height - radius;
  9934. if (xGame.common.gameMgr.isOpenBall) {
  9935. if (curX >= border.x + border.openBallW - radius)
  9936. curX = border.x + border.openBallW - radius;
  9937. }
  9938. this.ui.moveNode.x = curX;
  9939. this.ui.moveNode.y = curY;
  9940. rootBall.gameObj.x = curX;
  9941. rootBall.gameObj.y = curY;
  9942. rootBall.d3BallSrc.setTransPos(curX, curY);
  9943. this.isMoveRod = true;
  9944. break;
  9945. case PressType.rulerNode:
  9946. let yy = e.stageY - this.eventObj.lastY;
  9947. this.eventObj.lastY = e.stageY;
  9948. let ruler1 = this.ui.rulerNode.img1;
  9949. let ruler2 = this.ui.rulerNode.img2;
  9950. ruler1.y += yy;
  9951. ruler2.y += yy;
  9952. this.rulerOffset += yy;
  9953. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9954. this.rulerOffset = 0;
  9955. xGame.soundMgr.playSound("inch", 1, 10);
  9956. }
  9957. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9958. let h = ruler1.height;
  9959. this.checkGuide();
  9960. this.isMoveRod = true;
  9961. if (ruler1.y >= h) {
  9962. ruler1.y = -h;
  9963. ruler2.y = 0;
  9964. return;
  9965. }
  9966. else if (ruler1.y <= -h) {
  9967. ruler1.y = h;
  9968. ruler2.y = 0;
  9969. return;
  9970. }
  9971. if (ruler2.y >= h) {
  9972. ruler2.y = -h;
  9973. ruler1.y = 0;
  9974. return;
  9975. }
  9976. else if (ruler2.y <= -h) {
  9977. ruler2.y = h;
  9978. ruler1.y = 0;
  9979. return;
  9980. }
  9981. break;
  9982. case PressType.d2Root:
  9983. this.eventObj.curX = e.stageX;
  9984. this.eventObj.curY = e.stageY;
  9985. let offset = this.checkRodMoveDir();
  9986. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9987. this.eventObj.lastX = e.stageX;
  9988. this.eventObj.lastY = e.stageY;
  9989. break;
  9990. default:
  9991. break;
  9992. }
  9993. }
  9994. onEventUp(e) {
  9995. if (e.stopPropagation)
  9996. e.stopPropagation();
  9997. if (e && e.force) {
  9998. }
  9999. else {
  10000. if (!this.isTurnSelf())
  10001. return;
  10002. }
  10003. switch (this.pressTarget) {
  10004. case PressType.powerNode:
  10005. this.ui.powerNode.value = 0;
  10006. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10007. this.ui.powerTxt.text = "";
  10008. if (this.powerNum > 0) {
  10009. xGame.eventMgr.event(BALL_SHOOT);
  10010. xGame.common.d2World.shoot(this.powerNum);
  10011. xGame.common.d2World.d2Gan.shoot();
  10012. xGame.common.d2World.d2HelpLine.shoot();
  10013. this.finishGuide();
  10014. this.ui.powerEft.visible = false;
  10015. this.ui.colorNode.visible = false;
  10016. let ganStr = "";
  10017. if (this.powerNum <= 30) {
  10018. ganStr = "gan_30";
  10019. }
  10020. else if (this.powerNum <= 60) {
  10021. ganStr = "gan_50";
  10022. }
  10023. else {
  10024. ganStr = "gan_80";
  10025. }
  10026. xGame.soundMgr.playSound(ganStr);
  10027. }
  10028. break;
  10029. case PressType.moveNode:
  10030. let rootBall = xGame.common.d2World.rootBall;
  10031. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10032. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10033. let isIntersect = this.judgeBallIntersect();
  10034. if (isIntersect) {
  10035. this.ui.moveNode.x = lastX;
  10036. this.ui.moveNode.y = lastY;
  10037. rootBall.gameObj.x = lastX;
  10038. rootBall.gameObj.y = lastY;
  10039. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10040. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10041. }
  10042. else {
  10043. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10044. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10045. }
  10046. this.showBallUI();
  10047. this.ui.moveNode.finger.visible = true;
  10048. xGame.common.d2World.getHelpLine();
  10049. break;
  10050. case PressType.rulerNode:
  10051. break;
  10052. case PressType.d2Root:
  10053. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10054. if (dis <= 25) {
  10055. this.moveToClickDot(e);
  10056. }
  10057. break;
  10058. default:
  10059. break;
  10060. }
  10061. this.pressTarget = -1;
  10062. }
  10063. checkGuide() {
  10064. let guide = DataMgr.getSkillGuide();
  10065. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10066. xGame.common.guideStep++;
  10067. xGame.common.gameUI.ui.guide2.visible = false;
  10068. xGame.common.gameUI.ui.guide3.visible = true;
  10069. }
  10070. }
  10071. finishGuide() {
  10072. let guide = DataMgr.getSkillGuide();
  10073. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10074. xGame.common.guideStep = 10;
  10075. this.closeAllGuide();
  10076. }
  10077. }
  10078. closeAllGuide() {
  10079. xGame.common.gameUI.ui.guide1.visible = false;
  10080. xGame.common.gameUI.ui.guide2.visible = false;
  10081. xGame.common.gameUI.ui.guide3.visible = false;
  10082. }
  10083. updateBarInfo() {
  10084. let star = this.ui.powerNode.y;
  10085. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10086. if (rate >= 1)
  10087. rate = 1;
  10088. if (rate <= 0)
  10089. rate = 0;
  10090. this.powerNum = Math.ceil(rate * 100);
  10091. this.ui.powerNode.value = this.powerNum;
  10092. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10093. this.ui.colorNode.value = this.powerNum;
  10094. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10095. this.ui.powerEft.visible = this.powerNum != 0;
  10096. this.ui.colorNode.visible = this.powerNum != 0;
  10097. this.ui.powerTxt.text = this.powerNum + "";
  10098. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10099. }
  10100. forceCancel() {
  10101. this.ui.powerNode.value = 0;
  10102. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10103. this.ui.powerTxt.text = "";
  10104. }
  10105. checkRodMoveDir() {
  10106. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10107. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10108. if (tempX >= 0 && tempY <= 0) {
  10109. return this.checkDir();
  10110. }
  10111. else if (tempX < 0 && tempY < 0) {
  10112. return this.checkDir(1, -1);
  10113. }
  10114. else if (tempX < 0 && tempY > 0) {
  10115. return this.checkDir(-1, -1);
  10116. }
  10117. else {
  10118. return this.checkDir(-1, 1);
  10119. }
  10120. }
  10121. checkDir(flagX = 1, flagY = 1) {
  10122. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10123. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10124. if (offsetY == 0) {
  10125. return offsetX * flagX;
  10126. }
  10127. if (offsetX == 0) {
  10128. return offsetY * flagY;
  10129. }
  10130. let angle = offsetY / offsetX;
  10131. if (Math.abs(angle) >= 1) {
  10132. return offsetY * flagY;
  10133. }
  10134. else {
  10135. return offsetX * flagX;
  10136. }
  10137. }
  10138. judgeBallIntersect() {
  10139. let rootBall = xGame.common.d2World.rootBall;
  10140. let ballArr = xGame.common.d2World.ballArr;
  10141. let radius = rootBall.gameObj.width / 2;
  10142. let temp;
  10143. let isIntersect = false;
  10144. for (let index = 0; index < ballArr.length; index++) {
  10145. temp = ballArr[index];
  10146. if (temp.number == rootBall.number)
  10147. continue;
  10148. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10149. if (isIntersect) {
  10150. break;
  10151. }
  10152. }
  10153. return isIntersect;
  10154. }
  10155. hideBallUI() {
  10156. let d2Gan = xGame.common.d2World.d2Gan;
  10157. if (!d2Gan.ui.isDisposed)
  10158. d2Gan.ui.visible = false;
  10159. let d2Help = xGame.common.d2World.d2HelpLine;
  10160. if (!d2Help.ui.isDisposed)
  10161. d2Help.ui.visible = false;
  10162. let rootBall = xGame.common.d2World.rootBall;
  10163. if (!rootBall.destroyed) {
  10164. rootBall.gameObj.active = false;
  10165. }
  10166. }
  10167. showBallUI() {
  10168. let d2Gan = xGame.common.d2World.d2Gan;
  10169. if (!d2Gan.ui.isDisposed)
  10170. d2Gan.ui.visible = true;
  10171. let d2Help = xGame.common.d2World.d2HelpLine;
  10172. if (!d2Help.ui.isDisposed)
  10173. d2Help.ui.visible = true;
  10174. let rootBall = xGame.common.d2World.rootBall;
  10175. if (!rootBall.destroyed) {
  10176. rootBall.gameObj.active = true;
  10177. }
  10178. }
  10179. moveToClickDot(e) {
  10180. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10181. let root = xGame.common.d2World.rootBall.gameObj;
  10182. let xx = e.stageX - xGame.common.sysOffestNum;
  10183. let yy = e.stageY;
  10184. let x = xx - root.x;
  10185. let y = yy - root.y;
  10186. let angle = xGame.common.getfguiRotation(x, y);
  10187. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10188. xGame.common.d2World.getHelpLine();
  10189. }
  10190. this.isMoveRod = false;
  10191. xGame.common.clickedBall = false;
  10192. }
  10193. openAllEvent() {
  10194. this.closeAllEvent();
  10195. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10196. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10197. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10198. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10199. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10200. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10201. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10202. }
  10203. closeAllEvent() {
  10204. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10205. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10206. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10207. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10208. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10209. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10210. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10211. }
  10212. resetGame() {
  10213. this.closeAllEvent();
  10214. this.hideBallUI();
  10215. xGame.common.gameMgr.gamePause = true;
  10216. }
  10217. }
  10218. UIGame.uiName = "UIGame";
  10219. class UIAddProp extends UIBase {
  10220. constructor() {
  10221. super();
  10222. this.curType = "";
  10223. }
  10224. onConstructor() {
  10225. this.ui = ui_UIAddProp.createInstance();
  10226. this.contentPane = this.ui;
  10227. this.isEject = false;
  10228. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10229. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10230. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10231. this.updateUI();
  10232. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10233. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10234. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10235. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10236. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10237. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10238. }
  10239. show(type) {
  10240. super.show();
  10241. this.curType = type == 0 ? "coin" : "diamond";
  10242. this.switchBtn("");
  10243. this.ui.t0.play();
  10244. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10245. PlatMgr.showInsert(true);
  10246. }
  10247. closeSelf() {
  10248. this.hide();
  10249. }
  10250. updateUI() {
  10251. let data = cfgTable.moneyData;
  10252. let temp;
  10253. let obj;
  10254. for (const key in data) {
  10255. temp = data[key];
  10256. obj = this.ui.myNode["node" + key];
  10257. if (parseInt(key) <= 2) {
  10258. obj.diamondTxt.text = "+" + temp.num;
  10259. }
  10260. else {
  10261. obj.coinTxt.text = temp.num;
  10262. obj.diamondTxt.text = temp.get.split('_')[1];
  10263. }
  10264. }
  10265. this.updateDiamondShare();
  10266. }
  10267. updateDiamondShare() {
  10268. let data = DataMgr.getShareDiamondTimes();
  10269. if (data >= xGame.common.maxShareDiamondTimes) {
  10270. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10271. this.ui.myNode.node1.touchable = false;
  10272. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10273. }
  10274. else {
  10275. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10276. this.ui.myNode.node1.touchable = true;
  10277. }
  10278. }
  10279. switchBtn(type) {
  10280. if (type == "")
  10281. type = this.curType;
  10282. else {
  10283. if (this.curType == type) {
  10284. return;
  10285. }
  10286. else {
  10287. this.curType = type;
  10288. }
  10289. }
  10290. if (type == "coin") {
  10291. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10292. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10293. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10294. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10295. this.ui.myNode.c1.selectedIndex = 0;
  10296. }
  10297. else {
  10298. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10299. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10300. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10301. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10302. this.ui.myNode.c1.selectedIndex = 1;
  10303. }
  10304. }
  10305. convertCoin(index) {
  10306. let data = cfgTable.moneyData[index];
  10307. let coinNum = data.num;
  10308. let str = data.get.split('_')[1];
  10309. let needDiamond = parseInt(str);
  10310. if (DataMgr.diamondEnough(needDiamond)) {
  10311. DataMgr.setDiamond(-needDiamond);
  10312. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10313. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10314. }
  10315. else {
  10316. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10317. this.switchBtn("diamond");
  10318. }
  10319. }
  10320. videoGetDiamond() {
  10321. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10322. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10323. }
  10324. else {
  10325. console.log('zh:AD 失败,直接发放奖励');
  10326. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10327. }
  10328. }
  10329. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10330. let num = cfgTable.moneyData[2].num;
  10331. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10332. this.closeSelf();
  10333. }
  10334. videoGetCoin() {
  10335. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10336. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10337. }
  10338. else {
  10339. console.log('zh:AD 失败,直接发放奖励');
  10340. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10341. }
  10342. }
  10343. qjff_AD_for_uiAddProp_videoGetCoin() {
  10344. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10345. this.closeSelf();
  10346. }
  10347. shareGetDiamond() {
  10348. let times = DataMgr.getShareDiamondTimes();
  10349. if (times >= xGame.common.maxShareDiamondTimes) {
  10350. console.log('zh: 233333333333 maxShareDiamondTimes');
  10351. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10352. }
  10353. else {
  10354. console.log('zh:33333333333333ad');
  10355. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10356. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10357. }
  10358. else {
  10359. console.log('zh:AD 失败,直接发放奖励');
  10360. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10361. }
  10362. }
  10363. }
  10364. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10365. let diamond = xGame.common.randomNum(50, 100);
  10366. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10367. DataMgr.setShareDiamondTimes(1);
  10368. this.updateDiamondShare();
  10369. }
  10370. openPutBallView() {
  10371. let end = xGame.uiMgr.getUI(UIGameEnd);
  10372. let skill = xGame.uiMgr.getUI(UISkill);
  10373. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10374. let uigame = xGame.uiMgr.getUI(UIGame);
  10375. if (end && !end.isHide) {
  10376. xGame.uiMgr.Hide(UIGameEnd);
  10377. xGame.uiMgr.Show(UIMain);
  10378. }
  10379. if (skill && !skill.isHide)
  10380. xGame.uiMgr.Hide(UISkill);
  10381. if (uigame && !uigame.isHide)
  10382. xGame.uiMgr.Hide(UIGame);
  10383. if (level && !level.isHide) {
  10384. }
  10385. else {
  10386. xGame.uiMgr.Show(UILevelDisplay);
  10387. }
  10388. this.closeSelf();
  10389. }
  10390. }
  10391. UIAddProp.uiName = "UIAddProp";
  10392. class MoneyNode {
  10393. constructor(ui) {
  10394. this.leftTime = 0;
  10395. this.ui = ui;
  10396. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10397. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10398. this.ui.addPowerBtn.onClick(this, this.addPower);
  10399. this.ui.c1.selectedIndex = 1;
  10400. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10401. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10402. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10403. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10404. this.coinChange();
  10405. this.diamondChange();
  10406. this.powerChange();
  10407. }
  10408. addPower() {
  10409. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10410. xGame.uiMgr.Show(UIPower);
  10411. }
  10412. powerChange() {
  10413. let powerNum = DataMgr.getPower();
  10414. this.ui.powerTxt.text = powerNum + "";
  10415. }
  10416. checkPowerTime() {
  10417. let cur = new Date().getTime();
  10418. let last = DataMgr.getPowerTime();
  10419. if (last == 0) {
  10420. last = cur;
  10421. DataMgr.setPowerTime(cur);
  10422. }
  10423. let power = DataMgr.getPower();
  10424. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10425. Laya.timer.clearAll(this);
  10426. if (power >= xGame.common.natureMaxPower) {
  10427. this.ui.powerTimeTxt.text = "";
  10428. DataMgr.setPowerTime(cur);
  10429. return;
  10430. }
  10431. if (power + offset >= xGame.common.natureMaxPower) {
  10432. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10433. this.ui.powerTimeTxt.text = "";
  10434. DataMgr.setPowerTime(cur);
  10435. }
  10436. else {
  10437. if (offset > 0) {
  10438. DataMgr.setPower(offset);
  10439. DataMgr.setPowerTime(cur);
  10440. }
  10441. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10442. this.leftTime = xGame.common.powerRecoverNum - time;
  10443. if (this.leftTime <= 0)
  10444. this.leftTime = 0;
  10445. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10446. Laya.timer.loop(1000, this, this.updatePowerTime);
  10447. }
  10448. }
  10449. updatePowerTime() {
  10450. this.leftTime -= 1;
  10451. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10452. if (this.leftTime <= 0) {
  10453. this.checkPowerTime();
  10454. }
  10455. }
  10456. coinChange() {
  10457. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10458. }
  10459. diamondChange() {
  10460. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10461. }
  10462. addCoin() {
  10463. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10464. Moyu.sendDataEvent("AddCoinBtn");
  10465. xGame.uiMgr.Show(UIAddProp, 0);
  10466. }
  10467. addDiamond() {
  10468. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10469. Moyu.sendDataEvent("AddDiamondBtn");
  10470. xGame.uiMgr.Show(UIAddProp, 1);
  10471. }
  10472. }
  10473. class UIDraw extends UIBase {
  10474. constructor() {
  10475. super();
  10476. this.curKey = 0;
  10477. }
  10478. onConstructor() {
  10479. this.ui = ui_UIDraw.createInstance();
  10480. this.contentPane = this.ui;
  10481. this.isEject = false;
  10482. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10483. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10484. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10485. this.initDraw();
  10486. this.initUI();
  10487. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10488. if (Moyu.isKs)
  10489. this.ui.closeNode.closeBtn.x += 100;
  10490. }
  10491. show() {
  10492. super.show();
  10493. this.ui.t0.play();
  10494. this.playSecretaryIdle();
  10495. this.updateDraw();
  10496. this.checkFree();
  10497. if (PlatMgr.bannerDelay > 0) {
  10498. this.ui.closeNode.closeBtn.visible = false;
  10499. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10500. this.ui.closeNode.closeBtn.visible = true;
  10501. });
  10502. }
  10503. PlatMgr.showRateBanner();
  10504. }
  10505. hide() {
  10506. Laya.timer.clearAll(this);
  10507. super.hide();
  10508. }
  10509. checkFree() {
  10510. let isFree = DataMgr.getDailyfreeDrawTimes();
  10511. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10512. }
  10513. initDraw() {
  10514. this.drawObj = [];
  10515. let data = cfgTable.drawData;
  10516. let temp;
  10517. let weight = 0;
  10518. for (const key in data) {
  10519. temp = data[key];
  10520. weight += temp.weight;
  10521. this.drawObj.push(weight);
  10522. }
  10523. this.allWeight = weight;
  10524. }
  10525. initUI() {
  10526. let data = cfgTable.drawData;
  10527. let temp;
  10528. let img;
  10529. let txt;
  10530. for (const key in data) {
  10531. temp = data[key];
  10532. img = this.ui.myNode.rotNode["img" + key];
  10533. txt = this.ui.myNode.rotNode["txt" + key];
  10534. img.url = xGame.common.getGameIconUrl(temp.icon);
  10535. txt.visible = true;
  10536. if (temp.award > 2) {
  10537. img.rotation = 0;
  10538. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10539. }
  10540. else {
  10541. img.rotation = temp.rotation;
  10542. txt.text = temp.num;
  10543. }
  10544. }
  10545. }
  10546. getCurkey() {
  10547. let rand = Math.random() * this.allWeight;
  10548. let temp;
  10549. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10550. temp = this.drawObj[index];
  10551. if (index == 0) {
  10552. if (rand < temp) {
  10553. return index + 1;
  10554. }
  10555. }
  10556. else {
  10557. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10558. return index + 1;
  10559. }
  10560. }
  10561. }
  10562. return 2;
  10563. }
  10564. startDraw() {
  10565. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10566. if (freeTimes > 0) {
  10567. this.beginDraw();
  10568. DataMgr.setDailyfreeDrawTimes(0);
  10569. this.checkFree();
  10570. }
  10571. else {
  10572. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10573. }
  10574. else {
  10575. console.log('zh:AD 失败,直接发放奖励');
  10576. this.qjff_chouJiang();
  10577. }
  10578. }
  10579. }
  10580. qjff_chouJiang() {
  10581. this.beginDraw();
  10582. }
  10583. beginDraw() {
  10584. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10585. this.ui.drawBtn.touchable = false;
  10586. this.curKey = this.getCurkey();
  10587. console.log("当前key", this.curKey);
  10588. let cell = 60;
  10589. let lap = 3;
  10590. let angle = cell * (this.curKey - 1) + lap * 360;
  10591. let target = this.ui.myNode.rotNode;
  10592. target.rotation = 0;
  10593. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10594. console.log("旋转完成");
  10595. this.ui.drawBtn.touchable = true;
  10596. this.getAward();
  10597. }));
  10598. }
  10599. getAward() {
  10600. let data = cfgTable.drawData[this.curKey];
  10601. let temp = new AwardType();
  10602. temp.type = data.award;
  10603. temp.num = data.num;
  10604. xGame.common.getAward([temp], () => {
  10605. DataMgr.setDrawTimes(1);
  10606. this.updateDraw();
  10607. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10608. });
  10609. }
  10610. updateDraw() {
  10611. let drawTimes = DataMgr.getDrawTimes();
  10612. let awardTimes = DataMgr.getDrawAwardTimes();
  10613. if (Math.floor(drawTimes / 3) > awardTimes) {
  10614. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10615. this.ui.extraNode.boxBtn.touchable = true;
  10616. this.ui.extraNode.tipsTxt.text = "3/3";
  10617. this.ui.extraNode.barNode.width = 265;
  10618. this.getExtraAward();
  10619. }
  10620. else {
  10621. this.ui.extraNode.boxBtn.t0.stop();
  10622. this.ui.extraNode.boxBtn.touchable = false;
  10623. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10624. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10625. }
  10626. let data = cfgTable.drawData[1];
  10627. if (awardTimes == 0) {
  10628. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10629. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10630. this.ui.myNode.rotNode.img1.rotation = 0;
  10631. }
  10632. else {
  10633. let award = data.nextid;
  10634. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10635. this.ui.myNode.rotNode.txt1.text = award[1];
  10636. this.ui.myNode.rotNode.img1.rotation = 0;
  10637. }
  10638. }
  10639. getExtraAward() {
  10640. let drawTimes = DataMgr.getDrawTimes();
  10641. let awardTimes = DataMgr.getDrawAwardTimes();
  10642. let data = cfgTable.drawData[1];
  10643. let award = new AwardType();
  10644. if (awardTimes == 0) {
  10645. award.num = data.num;
  10646. award.type = data.award;
  10647. xGame.common.getAward([award], () => {
  10648. let all = Math.floor(drawTimes / 3);
  10649. DataMgr.setDrawAwardTimes(all);
  10650. this.updateDraw();
  10651. });
  10652. }
  10653. else {
  10654. award.num = parseInt(data.nextid[1]);
  10655. award.type = parseInt(data.nextid[0]);
  10656. xGame.common.getAward([award], () => {
  10657. let all = Math.floor(drawTimes / 3);
  10658. DataMgr.setDrawAwardTimes(all);
  10659. this.updateDraw();
  10660. });
  10661. }
  10662. }
  10663. closeSelf() {
  10664. this.hide();
  10665. }
  10666. playSecretaryIdle() {
  10667. let parent = this.ui.secretary.displayObject;
  10668. parent.destroyChildren();
  10669. let xx = this.ui.secretary.width / 2;
  10670. let yy = this.ui.secretary.height;
  10671. let scale = xGame.common.getSecretaryScale();
  10672. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10673. xGame.common.secretary.play(data, 0, true, parent);
  10674. }
  10675. }
  10676. UIDraw.uiName = "UIDraw";
  10677. class ui_UIFlyEft extends fgui.GComponent {
  10678. static createInstance() {
  10679. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10680. }
  10681. onConstruct() {
  10682. this.n0 = (this.getChild("n0"));
  10683. this.n1 = (this.getChild("n1"));
  10684. this.n2 = (this.getChild("n2"));
  10685. this.n3 = (this.getChild("n3"));
  10686. this.n4 = (this.getChild("n4"));
  10687. this.n5 = (this.getChild("n5"));
  10688. this.n6 = (this.getChild("n6"));
  10689. this.n7 = (this.getChild("n7"));
  10690. this.iconNode = (this.getChild("iconNode"));
  10691. this.txt = (this.getChild("txt"));
  10692. this.txtNode = (this.getChild("txtNode"));
  10693. }
  10694. }
  10695. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10696. class UIFlyEft extends UIBase {
  10697. constructor() {
  10698. super();
  10699. this.max = 8;
  10700. this.delay = 0;
  10701. }
  10702. onConstructor() {
  10703. this.ui = ui_UIFlyEft.createInstance();
  10704. this.contentPane = this.ui;
  10705. this.isEject = false;
  10706. this.isMuti = true;
  10707. this.ui.x += xGame.common.sysOffestNum;
  10708. }
  10709. getArrPos() {
  10710. if (this.iconPos && this.iconPos.length > 0)
  10711. return;
  10712. this.iconPos = [];
  10713. let temp;
  10714. for (let index = 0; index < this.max; index++) {
  10715. temp = this.ui["n" + index];
  10716. this.iconPos.push([temp.x, temp.y]);
  10717. }
  10718. }
  10719. show(stPos, edPos, num, type, callback) {
  10720. super.show();
  10721. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10722. this.getArrPos();
  10723. this.updateUI(type);
  10724. this.updatePos();
  10725. this.runFly(edPos, callback);
  10726. this.runWorlds(stPos, num);
  10727. }
  10728. updateUI(type) {
  10729. let temp;
  10730. let str;
  10731. for (let index = 0; index < this.max; index++) {
  10732. temp = this.ui["n" + index];
  10733. str = this.getIconStr(type);
  10734. temp.url = xGame.common.getGameIconUrl(str);
  10735. }
  10736. }
  10737. getIconStr(type) {
  10738. switch (type) {
  10739. case Prop.diamond:
  10740. return "ty_zs";
  10741. case Prop.coin:
  10742. return "ty_jb";
  10743. default:
  10744. break;
  10745. }
  10746. }
  10747. updatePos() {
  10748. let temp;
  10749. for (let index = 0; index < this.max; index++) {
  10750. temp = this.ui["n" + index];
  10751. temp.x = this.iconPos[index][0];
  10752. temp.y = this.iconPos[index][1];
  10753. }
  10754. }
  10755. runFly(endPos, callback) {
  10756. let all = 0;
  10757. let temp;
  10758. for (let index = 0; index < this.max; index++) {
  10759. temp = this.ui["n" + index];
  10760. temp.visible = true;
  10761. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10762. temp.visible = false;
  10763. all++;
  10764. if (all >= this.max) {
  10765. callback && callback();
  10766. }
  10767. }), 20 * index);
  10768. }
  10769. }
  10770. runWorlds(stPos, num) {
  10771. let str = "+" + num;
  10772. this.ui.txt.text = str;
  10773. let starX = stPos.x;
  10774. let starY = stPos.y + 50;
  10775. this.ui.txt.x = starX;
  10776. this.ui.txt.y = starY;
  10777. this.ui.txt.visible = true;
  10778. this.ui.txt.alpha = 1;
  10779. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10780. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10781. this.ui.txt.visible = false;
  10782. this.hide();
  10783. }));
  10784. }));
  10785. }
  10786. }
  10787. UIFlyEft.uiName = "UIFlyEft";
  10788. class Common {
  10789. constructor() {
  10790. this.convertNum = 0.025;
  10791. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10792. this.scaleV3One = new Laya.Vector3();
  10793. this.scaleV3Two = new Laya.Vector3();
  10794. this.posV4 = new Laya.Vector4();
  10795. this.showDebug = false;
  10796. this.openGuide = true;
  10797. this.rodOffest = new Laya.Vector2(0, 0);
  10798. this.rodAngle = 0;
  10799. this.gameMode = GameMode.classic;
  10800. this.bigMoveLevelIndex = 1;
  10801. this.bigMoveNeedCoin = 1000;
  10802. this.classicNiceNeddCoin = 1000;
  10803. this.passAwardCoin = 2000;
  10804. this.classicRoomType = 1;
  10805. this.maxPower = 20;
  10806. this.natureMaxPower = 5;
  10807. this.videoPower = 2;
  10808. this.powerRecoverNum = 900;
  10809. this.curPlayerSkillType = 0;
  10810. this.isNewDay = false;
  10811. this.clickedBall = false;
  10812. this.placeBallCurLevel = 0;
  10813. this.placeBallStarNum = 0;
  10814. this.longHelpLine = false;
  10815. this.maxShareDiamondTimes = 3;
  10816. this.guideStep = 0;
  10817. this.temSelfLevel = 0;
  10818. this.extraMoveNum = 0;
  10819. this.curRankID = 0;
  10820. this.rankID = {
  10821. normalStar: 12000,
  10822. wxStar: 12001
  10823. };
  10824. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10825. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10826. this.btnClickStr = "buttonclick";
  10827. this.maxSkillLevel = 10;
  10828. this.upSkillLevel = false;
  10829. this.gameStartTime = 0;
  10830. this._sysOffestNum = 0;
  10831. this.angleV2 = new Laya.Vector2();
  10832. this.rootV = new Laya.Vector2(0, 1);
  10833. this.tempDir1 = new Laya.Vector2();
  10834. this.tempDir2 = new Laya.Vector2();
  10835. this.ballSize = 33;
  10836. this.stPos = new Laya.Point();
  10837. this.edPos = new Laya.Point();
  10838. Common._instance = this;
  10839. window["common"] = this;
  10840. }
  10841. static getInstance() {
  10842. if (!this._instance) {
  10843. this._instance = new Common();
  10844. }
  10845. return this._instance;
  10846. }
  10847. get sysOffestNum() {
  10848. if (this._sysOffestNum == 0) {
  10849. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10850. }
  10851. return this._sysOffestNum;
  10852. }
  10853. testShader() {
  10854. let test = new LightShader();
  10855. test.texture = "res/d3Res/ballTexture/ball1.png";
  10856. Laya.stage.addChild(test);
  10857. }
  10858. playScale(node) {
  10859. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10860. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10861. }));
  10862. }));
  10863. }
  10864. setGroup(colli, ...group) {
  10865. let out = 0;
  10866. for (let index = 0; index < group.length; index++) {
  10867. if (index == 0) {
  10868. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10869. }
  10870. else {
  10871. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10872. }
  10873. }
  10874. colli.collisionGroup = out;
  10875. }
  10876. setCanGroupWith(colli, ...group) {
  10877. let out = 0;
  10878. for (let index = 0; index < group.length; index++) {
  10879. if (index == 0) {
  10880. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10881. }
  10882. else {
  10883. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10884. }
  10885. }
  10886. colli.canCollideWith = out;
  10887. }
  10888. loadPrefab(name, callback) {
  10889. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10890. let prefab = new Laya.Prefab();
  10891. prefab.json = obj;
  10892. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10893. callback && callback(img);
  10894. }));
  10895. }
  10896. pos2to3Convert(x, y, d3Pos) {
  10897. x = x + this.sysOffestNum;
  10898. d3Pos.setValue(x, y, 0);
  10899. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10900. if (success) {
  10901. }
  10902. else {
  10903. console.error("转换出错了。。。。。。。。");
  10904. }
  10905. }
  10906. scale2to3Convert(num) {
  10907. this.scaleV3One.setValue(0, 0, 0);
  10908. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10909. this.scaleV3Two.setValue(0, num, 0);
  10910. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10911. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10912. return outNum;
  10913. }
  10914. pos3to2Convert(d3Pos) {
  10915. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10916. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10917. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10918. d3Pos.x -= this.sysOffestNum;
  10919. }
  10920. scale3to2Convert(num) {
  10921. let scale = this.scale2to3Convert(1);
  10922. let d2Out = num / scale;
  10923. return d2Out;
  10924. }
  10925. getCollider(type, restitution = 0.9, density = 10) {
  10926. let colli;
  10927. if (type == "box")
  10928. colli = new Laya.BoxCollider();
  10929. else
  10930. colli = new Laya.CircleCollider();
  10931. colli.friction = 0;
  10932. colli.restitution = restitution;
  10933. colli.density = density;
  10934. return colli;
  10935. }
  10936. getRigbody() {
  10937. let rigy = new Laya.RigidBody();
  10938. rigy.bullet = true;
  10939. rigy.allowRotation = false;
  10940. rigy.allowSleep = false;
  10941. rigy.gravityScale = 0;
  10942. return rigy;
  10943. }
  10944. getfguiRotation(x, y) {
  10945. this.angleV2.setValue(x, y);
  10946. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10947. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10948. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10949. angle = -angle;
  10950. }
  10951. return 180 + angle;
  10952. }
  10953. getAngle(x, y) {
  10954. this.angleV2.setValue(x, y);
  10955. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10956. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10957. return angle;
  10958. }
  10959. randomNum(a, b) {
  10960. return a + Math.floor((b - a + 1) * Math.random());
  10961. }
  10962. getRandArrEle(arr) {
  10963. return arr[Math.floor(arr.length * Math.random())];
  10964. }
  10965. getSign(val) {
  10966. return val >= 0 ? 1 : -1;
  10967. }
  10968. botherArr(arr) {
  10969. let times = arr.length + 2;
  10970. let length = arr.length;
  10971. let a;
  10972. let b;
  10973. let temp;
  10974. for (let index = 0; index < times; index++) {
  10975. a = Math.floor(Math.random() * length);
  10976. b = Math.floor(Math.random() * length);
  10977. temp = arr[a];
  10978. arr[a] = arr[b];
  10979. arr[b] = temp;
  10980. }
  10981. }
  10982. getGameIconUrl(id) {
  10983. return "ui://game/" + id;
  10984. }
  10985. getComponentUrl(id) {
  10986. return "ui://game/" + id;
  10987. }
  10988. getAnimation() {
  10989. }
  10990. judgeSkillType(type = SkillType.highSpace) {
  10991. if (this.gameMode == GameMode.classic)
  10992. return;
  10993. let gameMgr = this.gameMgr;
  10994. if (gameMgr.selfTurn) {
  10995. if (gameMgr.selfCurSkill == type) {
  10996. return true;
  10997. }
  10998. }
  10999. else {
  11000. if (gameMgr.aiCurSkill == type) {
  11001. return true;
  11002. }
  11003. }
  11004. }
  11005. ballColliHole(collider) {
  11006. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11007. xGame.common.gameMgr.isFirstInGame = false;
  11008. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11009. }
  11010. collider.owner.mySrc.checkWrongBall();
  11011. }
  11012. getArrMaxEle(arr) {
  11013. let max = -Infinity;
  11014. for (let index = 0; index < arr.length; index++) {
  11015. max = Math.max(arr[index], max);
  11016. }
  11017. return max;
  11018. }
  11019. getArrMinEle(arr) {
  11020. let min = Infinity;
  11021. for (let index = 0; index < arr.length; index++) {
  11022. min = Math.min(arr[index], min);
  11023. }
  11024. return min;
  11025. }
  11026. playRandomMutiBallBigSkillSound() {
  11027. if (Math.random() <= 0.5)
  11028. return;
  11029. let rand = this.randomNum(1, 6);
  11030. let str = "ganfa0" + rand;
  11031. xGame.soundMgr.playSound(str);
  11032. }
  11033. showOneCamera(type) {
  11034. let object = xGame.common.d3World.cameraObj;
  11035. for (const key in object) {
  11036. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11037. object[key].init();
  11038. object[key].owner.active = key == type;
  11039. }
  11040. }
  11041. }
  11042. checkBallOverBorder(x, y) {
  11043. let radius = 17;
  11044. let condition = this._checkBorder(x + radius, y) ||
  11045. this._checkBorder(x - radius, y) ||
  11046. this._checkBorder(x, y + radius) ||
  11047. this._checkBorder(x, y - radius);
  11048. if (condition) {
  11049. return true;
  11050. }
  11051. }
  11052. _checkBorder(x, y) {
  11053. let borderRect = this.d2World.borderRect;
  11054. let xOffest = 20;
  11055. let yOffest = 20;
  11056. if (y <= borderRect.y - yOffest) {
  11057. return true;
  11058. }
  11059. if (y >= borderRect.y + borderRect.height + yOffest) {
  11060. return true;
  11061. }
  11062. if (x <= borderRect.x - xOffest) {
  11063. return true;
  11064. }
  11065. if (x >= borderRect.x + borderRect.width + xOffest) {
  11066. return true;
  11067. }
  11068. }
  11069. initWeight(cfg) {
  11070. let allCfgData = { data: {}, allWeightNum: 0 };
  11071. let weightCfg = allCfgData.data;
  11072. let weight = 0;
  11073. for (const key in cfg) {
  11074. weightCfg[key] = {};
  11075. weightCfg[key].id = cfg[key].id;
  11076. weightCfg[key].minWeight = weight;
  11077. weight += cfg[key].weight;
  11078. weightCfg[key].maxWeight = weight;
  11079. }
  11080. allCfgData.allWeightNum = weight;
  11081. return allCfgData;
  11082. }
  11083. getRandomWeightData(cfg) {
  11084. let weightCfg = cfg.data;
  11085. let allWeightNum = cfg.allWeightNum;
  11086. let rand = Math.floor(Math.random() * allWeightNum);
  11087. for (const key in weightCfg) {
  11088. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11089. return weightCfg[key];
  11090. }
  11091. }
  11092. return weightCfg[1];
  11093. }
  11094. showGirlTalkPop(wordsIndex, node, msgNode) {
  11095. node.visible = true;
  11096. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11097. node.t0.play(Laya.Handler.create(this, () => {
  11098. node.visible = false;
  11099. }));
  11100. }
  11101. stopGirlPop(node) {
  11102. node.t0.stop();
  11103. node.visible = false;
  11104. }
  11105. createHead(loader, url, size = 107) {
  11106. if (Laya.Browser.name == "Browser") {
  11107. loader.url = url;
  11108. return;
  11109. }
  11110. if (Moyu.isTT) {
  11111. let localImage = new Image();
  11112. localImage.src = url;
  11113. localImage.onload = () => {
  11114. let t2d = new Laya.Texture2D();
  11115. t2d.width = size;
  11116. t2d.height = size;
  11117. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11118. t2d.loadImageSource(localImage);
  11119. };
  11120. }
  11121. else {
  11122. console.log('zh:url=', url);
  11123. loader.url = url;
  11124. }
  11125. }
  11126. addTestCoin(num) {
  11127. DataMgr.setCoin(num);
  11128. }
  11129. addTestDiamond(num) {
  11130. DataMgr.setDiamond(num);
  11131. }
  11132. addTestSkill() {
  11133. DataMgr.setBigSkill(0, 99);
  11134. DataMgr.setBigSkill(1, 99);
  11135. DataMgr.setBigSkill(2, 99);
  11136. }
  11137. playClassicEmotion(number, x, y) {
  11138. if (this.gameMode == GameMode.bigMove)
  11139. return;
  11140. let randIndex = this.randomNum(0, 2);
  11141. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11142. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11143. if (this.gameMgr.selfTurn) {
  11144. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11145. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11146. }
  11147. else {
  11148. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11149. }
  11150. else {
  11151. if (number == this.gameMgr.blackNum) {
  11152. if (this.gameMgr.selfBallArr.length == 0) {
  11153. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11154. }
  11155. else {
  11156. }
  11157. }
  11158. else {
  11159. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11160. }
  11161. }
  11162. }
  11163. }
  11164. else {
  11165. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11166. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11167. }
  11168. else {
  11169. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11170. }
  11171. else {
  11172. if (number == this.gameMgr.blackNum) {
  11173. if (this.gameMgr.aiBallArr.length == 0) {
  11174. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11175. }
  11176. else {
  11177. }
  11178. }
  11179. else {
  11180. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11181. }
  11182. }
  11183. }
  11184. }
  11185. }
  11186. playHappySound(number) {
  11187. if (this.gameMode != GameMode.classic)
  11188. return;
  11189. if (number == 8)
  11190. return;
  11191. let play = false;
  11192. if (this.gameMgr.selfTurn) {
  11193. if (this.gameMgr.ensureBallType) {
  11194. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11195. play = true;
  11196. }
  11197. }
  11198. else {
  11199. play = true;
  11200. }
  11201. }
  11202. else {
  11203. if (this.gameMgr.ensureBallType) {
  11204. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11205. play = true;
  11206. }
  11207. }
  11208. else {
  11209. play = true;
  11210. }
  11211. }
  11212. if (play)
  11213. xGame.soundMgr.playSound("applause");
  11214. }
  11215. destroyClassicEmotion() {
  11216. if (this.gameMode == GameMode.bigMove)
  11217. return;
  11218. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11219. parent.destroyChildren();
  11220. }
  11221. playAwardSpine(x, y) {
  11222. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11223. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11224. this.awardSpine.play(data, 0, false, parent);
  11225. }
  11226. destroyAwardSpine() {
  11227. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11228. parent.destroyChildren();
  11229. }
  11230. isBlock(bx, by, hx, hy, except = null) {
  11231. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11232. let balls = xGame.common.d2World.ballArr;
  11233. let outArr = [];
  11234. for (let index = 0; index < balls.length; index++) {
  11235. let obj = balls[index];
  11236. if (obj.number == 0)
  11237. continue;
  11238. if (obj == except)
  11239. continue;
  11240. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11241. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11242. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11243. if (num >= 1)
  11244. num = 1;
  11245. if (num < 0)
  11246. continue;
  11247. let gap = Math.sin(Math.acos(num)) * dis;
  11248. if (gap < this.ballSize) {
  11249. outArr.push({
  11250. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11251. disHon: Math.cos(Math.acos(num)) * dis,
  11252. disVer: Math.sin(Math.acos(num)) * dis,
  11253. src: balls[index],
  11254. dir: this.tempDir1
  11255. });
  11256. }
  11257. }
  11258. if (outArr.length > 0) {
  11259. outArr.sort((a, b) => { return a.dis - b.dis; });
  11260. return outArr[0];
  11261. }
  11262. }
  11263. AngleBetween(vector1, vector2) {
  11264. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11265. return rad * (180 / Math.PI);
  11266. }
  11267. getSecretaryScale() {
  11268. if (this.secretary.spineName == "mishu") {
  11269. return 1.28;
  11270. }
  11271. else {
  11272. return 1.024;
  11273. }
  11274. }
  11275. signAwardContainsRod(arr) {
  11276. let temp;
  11277. for (let index = 0; index < arr.length; index++) {
  11278. temp = arr[index].split('-')[0];
  11279. if (parseInt(temp) > 2) {
  11280. return true;
  11281. }
  11282. }
  11283. }
  11284. judgeSameDay() {
  11285. let lastTime = DataMgr.getSignTime();
  11286. let curTime = new Date().getTime();
  11287. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11288. return true;
  11289. }
  11290. return false;
  11291. }
  11292. getAward(arr, callback) {
  11293. let showTriple = arr[0].type <= 2;
  11294. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11295. let temp;
  11296. for (let index = 0; index < arr.length; index++) {
  11297. temp = arr[index];
  11298. switch (temp.type) {
  11299. case 1:
  11300. this.playObjFlyAnim(temp.num, temp.type);
  11301. break;
  11302. case 2:
  11303. this.playObjFlyAnim(temp.num, temp.type);
  11304. break;
  11305. case 3:
  11306. case 4:
  11307. case 5:
  11308. case 6:
  11309. DataMgr.setBallRod(temp.type - 2, 1);
  11310. DataMgr.setCurBallRod(temp.type - 2);
  11311. break;
  11312. default:
  11313. break;
  11314. }
  11315. }
  11316. callback && callback(watchVideo);
  11317. });
  11318. }
  11319. getMoneyNode() {
  11320. let moneyNode;
  11321. let sign = xGame.uiMgr.getUI(UISign);
  11322. let draw = xGame.uiMgr.getUI(UIDraw);
  11323. let end = xGame.uiMgr.getUI(UIGameEnd);
  11324. let skill = xGame.uiMgr.getUI(UISkill);
  11325. if (sign && !sign.isHide)
  11326. moneyNode = sign.ui.moneyNode;
  11327. if (draw && !draw.isHide)
  11328. moneyNode = draw.ui.moneyNode;
  11329. if (end && !end.isHide)
  11330. moneyNode = end.ui.moneyNode;
  11331. if (skill && !skill.isHide)
  11332. moneyNode = skill.ui.moneyNode;
  11333. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11334. let main = xGame.uiMgr.getUI(UIMain);
  11335. if (condition1 && main && !main.isHide) {
  11336. moneyNode = main.ui.moneyNode;
  11337. }
  11338. return moneyNode;
  11339. }
  11340. playObjFlyAnim(num, type, callback = null) {
  11341. this.stPos.x = Laya.stage.width / 2;
  11342. this.stPos.y = Laya.stage.height / 2;
  11343. let moneyNode = this.getMoneyNode();
  11344. switch (type) {
  11345. case Prop.diamond:
  11346. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11347. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11348. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11349. this.edPos.x /= 2;
  11350. this.edPos.y /= 2;
  11351. break;
  11352. case Prop.coin:
  11353. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11354. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11355. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11356. this.edPos.x /= 2;
  11357. this.edPos.y /= 2;
  11358. break;
  11359. default:
  11360. break;
  11361. }
  11362. xGame.soundMgr.playSound("coinbag");
  11363. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11364. switch (type) {
  11365. case Prop.diamond:
  11366. DataMgr.setDiamond(num);
  11367. break;
  11368. case Prop.coin:
  11369. DataMgr.setCoin(num);
  11370. break;
  11371. default:
  11372. break;
  11373. }
  11374. callback && callback();
  11375. });
  11376. }
  11377. autoPopUIView() {
  11378. let arr = [];
  11379. let sign = this.judgeSameDay() ? false : true;
  11380. if (sign)
  11381. arr.push("sign");
  11382. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11383. if (draw)
  11384. arr.push("draw");
  11385. if (arr.length <= 0)
  11386. return;
  11387. let str = this.getRandArrEle(arr);
  11388. switch (str) {
  11389. case "sign":
  11390. xGame.uiMgr.Show(UISign);
  11391. break;
  11392. case "draw":
  11393. xGame.uiMgr.Show(UIDraw);
  11394. break;
  11395. default:
  11396. break;
  11397. }
  11398. }
  11399. getMSTime(time) {
  11400. let min = Math.floor(time / 60);
  11401. let sec = Math.floor((time - min * 60));
  11402. if (sec < 10)
  11403. sec = "0" + sec;
  11404. if (min < 10)
  11405. min = "0" + min;
  11406. return `${min}:${sec}`;
  11407. }
  11408. testPower() {
  11409. DataMgr.setPower(0, false);
  11410. }
  11411. getAllStarNum() {
  11412. let data = DataMgr.getPlaceBallLevelList();
  11413. let out = 0;
  11414. for (let index = 0; index < data.length; index++) {
  11415. out += data[index].star;
  11416. }
  11417. return out;
  11418. }
  11419. recoverCameraView() {
  11420. Laya.timer.once(900, this, () => {
  11421. xGame.common.showOneCamera("mainCamera");
  11422. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11423. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11424. xGame.common.gameUI.ui.border.alpha = 0;
  11425. if (Laya.physicsTimer.scale < 1) {
  11426. Laya.physicsTimer.scale = 1;
  11427. }
  11428. }
  11429. });
  11430. }
  11431. getClassicLevel() {
  11432. let successTimes = DataMgr.getClassicTimes();
  11433. let needKey = "";
  11434. let lastKey = "";
  11435. let cfg = cfgTable.classictimesData;
  11436. let data;
  11437. for (const key in cfg) {
  11438. data = cfg[key];
  11439. if (successTimes <= data.times) {
  11440. needKey = key;
  11441. }
  11442. lastKey = key;
  11443. }
  11444. if (needKey == "")
  11445. needKey = lastKey;
  11446. return cfg[needKey];
  11447. }
  11448. }
  11449. Common._instance = null;
  11450. class ui_Component92 extends fgui.GComponent {
  11451. static createInstance() {
  11452. return (fgui.UIPackage.createObject("game", "Component92"));
  11453. }
  11454. onConstruct() {
  11455. this.n0 = (this.getChild("n0"));
  11456. }
  11457. }
  11458. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11459. class ui_Component129 extends fgui.GProgressBar {
  11460. static createInstance() {
  11461. return (fgui.UIPackage.createObject("game", "Component129"));
  11462. }
  11463. onConstruct() {
  11464. this.bar_v = (this.getChild("bar_v"));
  11465. this.n84 = (this.getChild("n84"));
  11466. }
  11467. }
  11468. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11469. class ui_Component130 extends fgui.GComponent {
  11470. static createInstance() {
  11471. return (fgui.UIPackage.createObject("game", "Component130"));
  11472. }
  11473. onConstruct() {
  11474. this.ani = (this.getChild("ani"));
  11475. this.t0 = this.getTransition("t0");
  11476. }
  11477. }
  11478. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11479. class ui_powerEft extends fgui.GComponent {
  11480. static createInstance() {
  11481. return (fgui.UIPackage.createObject("game", "powerEft"));
  11482. }
  11483. onConstruct() {
  11484. this.ani = (this.getChild("ani"));
  11485. this.n88 = (this.getChild("n88"));
  11486. this.n89 = (this.getChild("n89"));
  11487. }
  11488. }
  11489. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11490. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11491. static createInstance() {
  11492. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11493. }
  11494. onConstruct() {
  11495. this.c1 = this.getController("c1");
  11496. this.n2 = (this.getChild("n2"));
  11497. this.n22 = (this.getChild("n22"));
  11498. this.n23 = (this.getChild("n23"));
  11499. this.n15 = (this.getChild("n15"));
  11500. this.challenge = (this.getChild("challenge"));
  11501. this.n17 = (this.getChild("n17"));
  11502. this.n3 = (this.getChild("n3"));
  11503. this.starNode = (this.getChild("starNode"));
  11504. this.levelTxt = (this.getChild("levelTxt"));
  11505. this.n14 = (this.getChild("n14"));
  11506. this.n19 = (this.getChild("n19"));
  11507. this.n20 = (this.getChild("n20"));
  11508. this.n21 = (this.getChild("n21"));
  11509. this.special = (this.getChild("special"));
  11510. }
  11511. }
  11512. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11513. class ui_Component79 extends fgui.GComponent {
  11514. static createInstance() {
  11515. return (fgui.UIPackage.createObject("game", "Component79"));
  11516. }
  11517. onConstruct() {
  11518. this.c1 = this.getController("c1");
  11519. this.n7 = (this.getChild("n7"));
  11520. this.n8 = (this.getChild("n8"));
  11521. this.n9 = (this.getChild("n9"));
  11522. this.n10 = (this.getChild("n10"));
  11523. this.n11 = (this.getChild("n11"));
  11524. this.n12 = (this.getChild("n12"));
  11525. }
  11526. }
  11527. ui_Component79.URL = "ui://isxx5ak7avag477";
  11528. class ui_Component80 extends fgui.GComponent {
  11529. static createInstance() {
  11530. return (fgui.UIPackage.createObject("game", "Component80"));
  11531. }
  11532. onConstruct() {
  11533. this.n0 = (this.getChild("n0"));
  11534. this.n1 = (this.getChild("n1"));
  11535. this.myList = (this.getChild("myList"));
  11536. this.t0 = this.getTransition("t0");
  11537. }
  11538. }
  11539. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11540. class ui_SignNormal extends fgui.GComponent {
  11541. static createInstance() {
  11542. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11543. }
  11544. onConstruct() {
  11545. this.c1 = this.getController("c1");
  11546. this.n7 = (this.getChild("n7"));
  11547. this.n15 = (this.getChild("n15"));
  11548. this.titleTxt = (this.getChild("titleTxt"));
  11549. this.n8 = (this.getChild("n8"));
  11550. this.myIcon = (this.getChild("myIcon"));
  11551. this.numTxt = (this.getChild("numTxt"));
  11552. this.n12 = (this.getChild("n12"));
  11553. this.n13 = (this.getChild("n13"));
  11554. this.n17 = (this.getChild("n17"));
  11555. this.n14 = (this.getChild("n14"));
  11556. }
  11557. }
  11558. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11559. class ui_screenNode extends fgui.GComponent {
  11560. static createInstance() {
  11561. return (fgui.UIPackage.createObject("game", "screenNode"));
  11562. }
  11563. onConstruct() {
  11564. this.n9 = (this.getChild("n9"));
  11565. this.screenImg = (this.getChild("screenImg"));
  11566. }
  11567. }
  11568. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11569. class ui_GetAwrad_com1 extends fgui.GComponent {
  11570. static createInstance() {
  11571. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11572. }
  11573. onConstruct() {
  11574. this.n38 = (this.getChild("n38"));
  11575. this.n39 = (this.getChild("n39"));
  11576. this.n40 = (this.getChild("n40"));
  11577. this.t0 = this.getTransition("t0");
  11578. this.t1 = this.getTransition("t1");
  11579. }
  11580. }
  11581. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11582. class ui_GetAwrad_com2 extends fgui.GComponent {
  11583. static createInstance() {
  11584. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11585. }
  11586. onConstruct() {
  11587. this.n39 = (this.getChild("n39"));
  11588. this.n40 = (this.getChild("n40"));
  11589. this.t0 = this.getTransition("t0");
  11590. }
  11591. }
  11592. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11593. class ui_Component128 extends fgui.GComponent {
  11594. static createInstance() {
  11595. return (fgui.UIPackage.createObject("game", "Component128"));
  11596. }
  11597. onConstruct() {
  11598. this.n38 = (this.getChild("n38"));
  11599. this.n40 = (this.getChild("n40"));
  11600. }
  11601. }
  11602. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11603. class ui_Component100_1 extends fgui.GComponent {
  11604. static createInstance() {
  11605. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11606. }
  11607. onConstruct() {
  11608. this.myNode = (this.getChild("myNode"));
  11609. this.t0 = this.getTransition("t0");
  11610. }
  11611. }
  11612. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11613. class ui_Component142 extends fgui.GComponent {
  11614. static createInstance() {
  11615. return (fgui.UIPackage.createObject("game", "Component142"));
  11616. }
  11617. onConstruct() {
  11618. this.n41 = (this.getChild("n41"));
  11619. this.n42 = (this.getChild("n42"));
  11620. }
  11621. }
  11622. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11623. class ui_main_guang extends fgui.GComponent {
  11624. static createInstance() {
  11625. return (fgui.UIPackage.createObject("game", "main_guang"));
  11626. }
  11627. onConstruct() {
  11628. this.n1 = (this.getChild("n1"));
  11629. this.n2 = (this.getChild("n2"));
  11630. this.n3 = (this.getChild("n3"));
  11631. this.n4 = (this.getChild("n4"));
  11632. this.n5 = (this.getChild("n5"));
  11633. this.n6 = (this.getChild("n6"));
  11634. this.n8 = (this.getChild("n8"));
  11635. this.t0 = this.getTransition("t0");
  11636. }
  11637. }
  11638. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11639. class ui_try_com1 extends fgui.GComponent {
  11640. static createInstance() {
  11641. return (fgui.UIPackage.createObject("game", "try_com1"));
  11642. }
  11643. onConstruct() {
  11644. this.c1 = this.getController("c1");
  11645. this.n0 = (this.getChild("n0"));
  11646. this.n2 = (this.getChild("n2"));
  11647. this.cancelBtn = (this.getChild("cancelBtn"));
  11648. this.videoBtn = (this.getChild("videoBtn"));
  11649. this.n9 = (this.getChild("n9"));
  11650. this.n24 = (this.getChild("n24"));
  11651. this.titleTxt = (this.getChild("titleTxt"));
  11652. this.n32 = (this.getChild("n32"));
  11653. this.n29 = (this.getChild("n29"));
  11654. this.n36 = (this.getChild("n36"));
  11655. this.txtTime = (this.getChild("txtTime"));
  11656. this.t0 = this.getTransition("t0");
  11657. }
  11658. }
  11659. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11660. class ui_try_com2 extends fgui.GComponent {
  11661. static createInstance() {
  11662. return (fgui.UIPackage.createObject("game", "try_com2"));
  11663. }
  11664. onConstruct() {
  11665. this.skillicon = (this.getChild("skillicon"));
  11666. this.n35 = (this.getChild("n35"));
  11667. this.n31 = (this.getChild("n31"));
  11668. this.n32 = (this.getChild("n32"));
  11669. this.n33 = (this.getChild("n33"));
  11670. this.n34 = (this.getChild("n34"));
  11671. }
  11672. }
  11673. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11674. class ui_try_com3 extends fgui.GComponent {
  11675. static createInstance() {
  11676. return (fgui.UIPackage.createObject("game", "try_com3"));
  11677. }
  11678. onConstruct() {
  11679. this.n33 = (this.getChild("n33"));
  11680. this.n34 = (this.getChild("n34"));
  11681. this.n35 = (this.getChild("n35"));
  11682. this.t0 = this.getTransition("t0");
  11683. }
  11684. }
  11685. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11686. class ui_huihe1 extends fgui.GComponent {
  11687. static createInstance() {
  11688. return (fgui.UIPackage.createObject("game", "huihe1"));
  11689. }
  11690. onConstruct() {
  11691. this.n0 = (this.getChild("n0"));
  11692. this.n1 = (this.getChild("n1"));
  11693. this.t0 = this.getTransition("t0");
  11694. }
  11695. }
  11696. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11697. class ui_huihe2 extends fgui.GComponent {
  11698. static createInstance() {
  11699. return (fgui.UIPackage.createObject("game", "huihe2"));
  11700. }
  11701. onConstruct() {
  11702. this.n0 = (this.getChild("n0"));
  11703. this.n1 = (this.getChild("n1"));
  11704. this.t0 = this.getTransition("t0");
  11705. }
  11706. }
  11707. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11708. class ui_Component143 extends fgui.GComponent {
  11709. static createInstance() {
  11710. return (fgui.UIPackage.createObject("game", "Component143"));
  11711. }
  11712. onConstruct() {
  11713. this.n3 = (this.getChild("n3"));
  11714. this.n4 = (this.getChild("n4"));
  11715. this.n5 = (this.getChild("n5"));
  11716. this.n6 = (this.getChild("n6"));
  11717. this.n7 = (this.getChild("n7"));
  11718. this.n8 = (this.getChild("n8"));
  11719. this.n9 = (this.getChild("n9"));
  11720. this.n10 = (this.getChild("n10"));
  11721. this.t0 = this.getTransition("t0");
  11722. }
  11723. }
  11724. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11725. class ui_dh_jingbi2 extends fgui.GComponent {
  11726. static createInstance() {
  11727. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11728. }
  11729. onConstruct() {
  11730. this.n0 = (this.getChild("n0"));
  11731. this.n1 = (this.getChild("n1"));
  11732. this.n2 = (this.getChild("n2"));
  11733. this.n3 = (this.getChild("n3"));
  11734. this.n4 = (this.getChild("n4"));
  11735. this.n5 = (this.getChild("n5"));
  11736. this.n6 = (this.getChild("n6"));
  11737. this.n8 = (this.getChild("n8"));
  11738. this.n10 = (this.getChild("n10"));
  11739. this.t0 = this.getTransition("t0");
  11740. }
  11741. }
  11742. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11743. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11744. static createInstance() {
  11745. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11746. }
  11747. onConstruct() {
  11748. this.n1 = (this.getChild("n1"));
  11749. this.n4 = (this.getChild("n4"));
  11750. this.t0 = this.getTransition("t0");
  11751. }
  11752. }
  11753. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11754. class ui_dh_jingbi3 extends fgui.GComponent {
  11755. static createInstance() {
  11756. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11757. }
  11758. onConstruct() {
  11759. this.n0 = (this.getChild("n0"));
  11760. this.n1 = (this.getChild("n1"));
  11761. this.n2 = (this.getChild("n2"));
  11762. this.n3 = (this.getChild("n3"));
  11763. this.n4 = (this.getChild("n4"));
  11764. this.n5 = (this.getChild("n5"));
  11765. this.n6 = (this.getChild("n6"));
  11766. this.n8 = (this.getChild("n8"));
  11767. this.n10 = (this.getChild("n10"));
  11768. this.t0 = this.getTransition("t0");
  11769. }
  11770. }
  11771. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11772. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11773. static createInstance() {
  11774. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11775. }
  11776. onConstruct() {
  11777. this.n3 = (this.getChild("n3"));
  11778. this.n1 = (this.getChild("n1"));
  11779. this.t0 = this.getTransition("t0");
  11780. }
  11781. }
  11782. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11783. class ui_hb_jinbi1 extends fgui.GButton {
  11784. static createInstance() {
  11785. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11786. }
  11787. onConstruct() {
  11788. this.n20 = (this.getChild("n20"));
  11789. this.n25 = (this.getChild("n25"));
  11790. this.coinTxt = (this.getChild("coinTxt"));
  11791. this.n28 = (this.getChild("n28"));
  11792. this.n32 = (this.getChild("n32"));
  11793. this.n38 = (this.getChild("n38"));
  11794. this.n45 = (this.getChild("n45"));
  11795. this.getTips = (this.getChild("getTips"));
  11796. this.n39 = (this.getChild("n39"));
  11797. this.diamondTxt = (this.getChild("diamondTxt"));
  11798. this.n41 = (this.getChild("n41"));
  11799. this.n42 = (this.getChild("n42"));
  11800. this.n46 = (this.getChild("n46"));
  11801. this.n47 = (this.getChild("n47"));
  11802. this.n48 = (this.getChild("n48"));
  11803. this.t0 = this.getTransition("t0");
  11804. }
  11805. }
  11806. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11807. class ui_hb_jinbi2 extends fgui.GButton {
  11808. static createInstance() {
  11809. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11810. }
  11811. onConstruct() {
  11812. this.n20 = (this.getChild("n20"));
  11813. this.n25 = (this.getChild("n25"));
  11814. this.coinTxt = (this.getChild("coinTxt"));
  11815. this.n28 = (this.getChild("n28"));
  11816. this.n32 = (this.getChild("n32"));
  11817. this.n38 = (this.getChild("n38"));
  11818. this.n39 = (this.getChild("n39"));
  11819. this.diamondTxt = (this.getChild("diamondTxt"));
  11820. this.n41 = (this.getChild("n41"));
  11821. this.n42 = (this.getChild("n42"));
  11822. this.n43 = (this.getChild("n43"));
  11823. this.n44 = (this.getChild("n44"));
  11824. this.n45 = (this.getChild("n45"));
  11825. this.t0 = this.getTransition("t0");
  11826. }
  11827. }
  11828. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11829. class ui_hb_jinbi3 extends fgui.GButton {
  11830. static createInstance() {
  11831. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11832. }
  11833. onConstruct() {
  11834. this.n20 = (this.getChild("n20"));
  11835. this.n25 = (this.getChild("n25"));
  11836. this.coinTxt = (this.getChild("coinTxt"));
  11837. this.n28 = (this.getChild("n28"));
  11838. this.n32 = (this.getChild("n32"));
  11839. this.n38 = (this.getChild("n38"));
  11840. this.n39 = (this.getChild("n39"));
  11841. this.diamondTxt = (this.getChild("diamondTxt"));
  11842. this.n41 = (this.getChild("n41"));
  11843. this.n42 = (this.getChild("n42"));
  11844. this.n43 = (this.getChild("n43"));
  11845. this.n44 = (this.getChild("n44"));
  11846. this.n45 = (this.getChild("n45"));
  11847. this.t0 = this.getTransition("t0");
  11848. }
  11849. }
  11850. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11851. class ui_Component104 extends fgui.GComponent {
  11852. static createInstance() {
  11853. return (fgui.UIPackage.createObject("game", "Component104"));
  11854. }
  11855. onConstruct() {
  11856. this.c1 = this.getController("c1");
  11857. this.n12 = (this.getChild("n12"));
  11858. this.coinBtn = (this.getChild("coinBtn"));
  11859. this.diamondBtn = (this.getChild("diamondBtn"));
  11860. this.node3 = (this.getChild("node3"));
  11861. this.node4 = (this.getChild("node4"));
  11862. this.node5 = (this.getChild("node5"));
  11863. this.node1 = (this.getChild("node1"));
  11864. this.node2 = (this.getChild("node2"));
  11865. this.node6 = (this.getChild("node6"));
  11866. this.t0 = this.getTransition("t0");
  11867. }
  11868. }
  11869. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11870. class ui_Component105 extends fgui.GButton {
  11871. static createInstance() {
  11872. return (fgui.UIPackage.createObject("game", "Component105"));
  11873. }
  11874. onConstruct() {
  11875. this.c1 = this.getController("c1");
  11876. this.n49 = (this.getChild("n49"));
  11877. this.n18 = (this.getChild("n18"));
  11878. this.n46 = (this.getChild("n46"));
  11879. this.n48 = (this.getChild("n48"));
  11880. }
  11881. }
  11882. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11883. class ui_Component106 extends fgui.GButton {
  11884. static createInstance() {
  11885. return (fgui.UIPackage.createObject("game", "Component106"));
  11886. }
  11887. onConstruct() {
  11888. this.c1 = this.getController("c1");
  11889. this.n49 = (this.getChild("n49"));
  11890. this.n18 = (this.getChild("n18"));
  11891. this.n46 = (this.getChild("n46"));
  11892. this.n48 = (this.getChild("n48"));
  11893. }
  11894. }
  11895. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11896. class ui_hb_zs1 extends fgui.GButton {
  11897. static createInstance() {
  11898. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11899. }
  11900. onConstruct() {
  11901. this.c1 = this.getController("c1");
  11902. this.n20 = (this.getChild("n20"));
  11903. this.n21 = (this.getChild("n21"));
  11904. this.n26 = (this.getChild("n26"));
  11905. this.n27 = (this.getChild("n27"));
  11906. this.shareTxt = (this.getChild("shareTxt"));
  11907. this.n32 = (this.getChild("n32"));
  11908. this.n38 = (this.getChild("n38"));
  11909. this.n39 = (this.getChild("n39"));
  11910. this.n44 = (this.getChild("n44"));
  11911. this.diamondTxt = (this.getChild("diamondTxt"));
  11912. this.n41 = (this.getChild("n41"));
  11913. this.n45 = (this.getChild("n45"));
  11914. this.n47 = (this.getChild("n47"));
  11915. this.n48 = (this.getChild("n48"));
  11916. this.randTxt = (this.getChild("randTxt"));
  11917. this.n50 = (this.getChild("n50"));
  11918. this.t0 = this.getTransition("t0");
  11919. }
  11920. }
  11921. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11922. class ui_dh_zs1 extends fgui.GComponent {
  11923. static createInstance() {
  11924. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11925. }
  11926. onConstruct() {
  11927. this.n10 = (this.getChild("n10"));
  11928. this.n9 = (this.getChild("n9"));
  11929. this.n1 = (this.getChild("n1"));
  11930. this.n2 = (this.getChild("n2"));
  11931. this.n3 = (this.getChild("n3"));
  11932. this.n4 = (this.getChild("n4"));
  11933. this.n5 = (this.getChild("n5"));
  11934. this.n6 = (this.getChild("n6"));
  11935. this.n8 = (this.getChild("n8"));
  11936. this.n11 = (this.getChild("n11"));
  11937. this.t0 = this.getTransition("t0");
  11938. }
  11939. }
  11940. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11941. class ui_dh_zs1_1 extends fgui.GComponent {
  11942. static createInstance() {
  11943. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11944. }
  11945. onConstruct() {
  11946. this.n3 = (this.getChild("n3"));
  11947. this.n1 = (this.getChild("n1"));
  11948. this.t0 = this.getTransition("t0");
  11949. }
  11950. }
  11951. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11952. class ui_hb_zs2 extends fgui.GButton {
  11953. static createInstance() {
  11954. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11955. }
  11956. onConstruct() {
  11957. this.n20 = (this.getChild("n20"));
  11958. this.n21 = (this.getChild("n21"));
  11959. this.n26 = (this.getChild("n26"));
  11960. this.n27 = (this.getChild("n27"));
  11961. this.n32 = (this.getChild("n32"));
  11962. this.n38 = (this.getChild("n38"));
  11963. this.n39 = (this.getChild("n39"));
  11964. this.n44 = (this.getChild("n44"));
  11965. this.diamondTxt = (this.getChild("diamondTxt"));
  11966. this.n41 = (this.getChild("n41"));
  11967. this.n45 = (this.getChild("n45"));
  11968. this.t0 = this.getTransition("t0");
  11969. }
  11970. }
  11971. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11972. class ui_hb_zs3 extends fgui.GButton {
  11973. static createInstance() {
  11974. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11975. }
  11976. onConstruct() {
  11977. this.n20 = (this.getChild("n20"));
  11978. this.n21 = (this.getChild("n21"));
  11979. this.n26 = (this.getChild("n26"));
  11980. this.n27 = (this.getChild("n27"));
  11981. this.n32 = (this.getChild("n32"));
  11982. this.n38 = (this.getChild("n38"));
  11983. this.n47 = (this.getChild("n47"));
  11984. this.t0 = this.getTransition("t0");
  11985. }
  11986. }
  11987. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11988. class ui_dh_zs2 extends fgui.GComponent {
  11989. static createInstance() {
  11990. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11991. }
  11992. onConstruct() {
  11993. this.n10 = (this.getChild("n10"));
  11994. this.n9 = (this.getChild("n9"));
  11995. this.n1 = (this.getChild("n1"));
  11996. this.n2 = (this.getChild("n2"));
  11997. this.n3 = (this.getChild("n3"));
  11998. this.n4 = (this.getChild("n4"));
  11999. this.n5 = (this.getChild("n5"));
  12000. this.n6 = (this.getChild("n6"));
  12001. this.n8 = (this.getChild("n8"));
  12002. this.n11 = (this.getChild("n11"));
  12003. this.t0 = this.getTransition("t0");
  12004. }
  12005. }
  12006. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12007. class ui_dh_zs2_1 extends fgui.GComponent {
  12008. static createInstance() {
  12009. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12010. }
  12011. onConstruct() {
  12012. this.n3 = (this.getChild("n3"));
  12013. this.n1 = (this.getChild("n1"));
  12014. this.t0 = this.getTransition("t0");
  12015. }
  12016. }
  12017. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12018. class ui_dh_zs3 extends fgui.GComponent {
  12019. static createInstance() {
  12020. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12021. }
  12022. onConstruct() {
  12023. this.n10 = (this.getChild("n10"));
  12024. this.n9 = (this.getChild("n9"));
  12025. this.n1 = (this.getChild("n1"));
  12026. this.n2 = (this.getChild("n2"));
  12027. this.n3 = (this.getChild("n3"));
  12028. this.n4 = (this.getChild("n4"));
  12029. this.n5 = (this.getChild("n5"));
  12030. this.n6 = (this.getChild("n6"));
  12031. this.n8 = (this.getChild("n8"));
  12032. this.n11 = (this.getChild("n11"));
  12033. this.t0 = this.getTransition("t0");
  12034. }
  12035. }
  12036. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12037. class ui_dh_zs3_1 extends fgui.GComponent {
  12038. static createInstance() {
  12039. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12040. }
  12041. onConstruct() {
  12042. this.n3 = (this.getChild("n3"));
  12043. this.n1 = (this.getChild("n1"));
  12044. this.t0 = this.getTransition("t0");
  12045. }
  12046. }
  12047. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12048. class ui_Component107 extends fgui.GComponent {
  12049. static createInstance() {
  12050. return (fgui.UIPackage.createObject("game", "Component107"));
  12051. }
  12052. onConstruct() {
  12053. this.n18 = (this.getChild("n18"));
  12054. this.n19 = (this.getChild("n19"));
  12055. this.n20 = (this.getChild("n20"));
  12056. this.n21 = (this.getChild("n21"));
  12057. this.n22 = (this.getChild("n22"));
  12058. this.levelTxt = (this.getChild("levelTxt"));
  12059. this.t0 = this.getTransition("t0");
  12060. }
  12061. }
  12062. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12063. class ui_box_com1 extends fgui.GComponent {
  12064. static createInstance() {
  12065. return (fgui.UIPackage.createObject("game", "box_com1"));
  12066. }
  12067. onConstruct() {
  12068. this.n14 = (this.getChild("n14"));
  12069. this.n6 = (this.getChild("n6"));
  12070. this.t0 = this.getTransition("t0");
  12071. }
  12072. }
  12073. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12074. class ui_box_com2 extends fgui.GProgressBar {
  12075. static createInstance() {
  12076. return (fgui.UIPackage.createObject("game", "box_com2"));
  12077. }
  12078. onConstruct() {
  12079. this.bg0 = (this.getChild("bg0"));
  12080. this.bg = (this.getChild("bg"));
  12081. this.bar = (this.getChild("bar"));
  12082. this.n7 = (this.getChild("n7"));
  12083. this.n8 = (this.getChild("n8"));
  12084. this.n10 = (this.getChild("n10"));
  12085. this.n11 = (this.getChild("n11"));
  12086. this.n12 = (this.getChild("n12"));
  12087. }
  12088. }
  12089. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12090. class ui_box_com4 extends fgui.GComponent {
  12091. static createInstance() {
  12092. return (fgui.UIPackage.createObject("game", "box_com4"));
  12093. }
  12094. onConstruct() {
  12095. this.n8 = (this.getChild("n8"));
  12096. this.t0 = this.getTransition("t0");
  12097. }
  12098. }
  12099. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12100. class ui_box_com3 extends fgui.GComponent {
  12101. static createInstance() {
  12102. return (fgui.UIPackage.createObject("game", "box_com3"));
  12103. }
  12104. onConstruct() {
  12105. this.n2 = (this.getChild("n2"));
  12106. this.n3 = (this.getChild("n3"));
  12107. this.n4 = (this.getChild("n4"));
  12108. this.n5 = (this.getChild("n5"));
  12109. this.t0 = this.getTransition("t0");
  12110. this.t1 = this.getTransition("t1");
  12111. }
  12112. }
  12113. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12114. class ui_Component97 extends fgui.GComponent {
  12115. static createInstance() {
  12116. return (fgui.UIPackage.createObject("game", "Component97"));
  12117. }
  12118. onConstruct() {
  12119. this.c1 = this.getController("c1");
  12120. this.n46 = (this.getChild("n46"));
  12121. this.diamondNode = (this.getChild("diamondNode"));
  12122. this.coinNode = (this.getChild("coinNode"));
  12123. this.t0 = this.getTransition("t0");
  12124. }
  12125. }
  12126. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12127. class ui_Component98 extends fgui.GButton {
  12128. static createInstance() {
  12129. return (fgui.UIPackage.createObject("game", "Component98"));
  12130. }
  12131. onConstruct() {
  12132. this.n8 = (this.getChild("n8"));
  12133. this.n40 = (this.getChild("n40"));
  12134. }
  12135. }
  12136. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12137. class ui_Component28_11 extends fgui.GButton {
  12138. static createInstance() {
  12139. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12140. }
  12141. onConstruct() {
  12142. this.c1 = this.getController("c1");
  12143. this.n12 = (this.getChild("n12"));
  12144. this.n17 = (this.getChild("n17"));
  12145. this.n13 = (this.getChild("n13"));
  12146. this.diamondTxt = (this.getChild("diamondTxt"));
  12147. this.n15 = (this.getChild("n15"));
  12148. this.n16 = (this.getChild("n16"));
  12149. this.n18 = (this.getChild("n18"));
  12150. }
  12151. }
  12152. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12153. class ui_Component58_11 extends fgui.GComponent {
  12154. static createInstance() {
  12155. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12156. }
  12157. onConstruct() {
  12158. this.n23 = (this.getChild("n23"));
  12159. this.n41 = (this.getChild("n41"));
  12160. this.myList = (this.getChild("myList"));
  12161. this.n45 = (this.getChild("n45"));
  12162. this.n44 = (this.getChild("n44"));
  12163. this.t0 = this.getTransition("t0");
  12164. }
  12165. }
  12166. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12167. class ui_Component100 extends fgui.GComponent {
  12168. static createInstance() {
  12169. return (fgui.UIPackage.createObject("game", "Component100"));
  12170. }
  12171. onConstruct() {
  12172. this.c1 = this.getController("c1");
  12173. this.n75 = (this.getChild("n75"));
  12174. this.n76 = (this.getChild("n76"));
  12175. this.n80 = (this.getChild("n80"));
  12176. this.txt = (this.getChild("txt"));
  12177. this.spineRoot = (this.getChild("spineRoot"));
  12178. }
  12179. }
  12180. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12181. class ui_Component101 extends fgui.GComponent {
  12182. static createInstance() {
  12183. return (fgui.UIPackage.createObject("game", "Component101"));
  12184. }
  12185. onConstruct() {
  12186. this.c1 = this.getController("c1");
  12187. this.n36 = (this.getChild("n36"));
  12188. this.n35 = (this.getChild("n35"));
  12189. this.n33 = (this.getChild("n33"));
  12190. this.n34 = (this.getChild("n34"));
  12191. }
  12192. }
  12193. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12194. class ui_Component53 extends fgui.GComponent {
  12195. static createInstance() {
  12196. return (fgui.UIPackage.createObject("game", "Component53"));
  12197. }
  12198. onConstruct() {
  12199. this.n0 = (this.getChild("n0"));
  12200. this.n1 = (this.getChild("n1"));
  12201. this.n2 = (this.getChild("n2"));
  12202. this.n3 = (this.getChild("n3"));
  12203. this.n4 = (this.getChild("n4"));
  12204. this.n5 = (this.getChild("n5"));
  12205. this.n6 = (this.getChild("n6"));
  12206. this.n7 = (this.getChild("n7"));
  12207. this.n8 = (this.getChild("n8"));
  12208. this.n9 = (this.getChild("n9"));
  12209. this.n10 = (this.getChild("n10"));
  12210. this.n11 = (this.getChild("n11"));
  12211. this.n12 = (this.getChild("n12"));
  12212. this.n13 = (this.getChild("n13"));
  12213. this.n14 = (this.getChild("n14"));
  12214. this.n15 = (this.getChild("n15"));
  12215. this.n16 = (this.getChild("n16"));
  12216. this.n19 = (this.getChild("n19"));
  12217. this.n20 = (this.getChild("n20"));
  12218. this.n21 = (this.getChild("n21"));
  12219. this.n22 = (this.getChild("n22"));
  12220. this.n23 = (this.getChild("n23"));
  12221. this.n24 = (this.getChild("n24"));
  12222. this.n25 = (this.getChild("n25"));
  12223. this.n26 = (this.getChild("n26"));
  12224. this.n27 = (this.getChild("n27"));
  12225. this.n28 = (this.getChild("n28"));
  12226. this.n29 = (this.getChild("n29"));
  12227. this.n30 = (this.getChild("n30"));
  12228. this.n31 = (this.getChild("n31"));
  12229. this.n32 = (this.getChild("n32"));
  12230. this.n33 = (this.getChild("n33"));
  12231. this.n34 = (this.getChild("n34"));
  12232. this.n35 = (this.getChild("n35"));
  12233. this.t0 = this.getTransition("t0");
  12234. }
  12235. }
  12236. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12237. class ui_Component58 extends fgui.GComponent {
  12238. static createInstance() {
  12239. return (fgui.UIPackage.createObject("game", "Component58"));
  12240. }
  12241. onConstruct() {
  12242. this.n23 = (this.getChild("n23"));
  12243. this.n41 = (this.getChild("n41"));
  12244. this.n8 = (this.getChild("n8"));
  12245. this.skillList = (this.getChild("skillList"));
  12246. this.t0 = this.getTransition("t0");
  12247. }
  12248. }
  12249. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12250. class ui_Component59 extends fgui.GComponent {
  12251. static createInstance() {
  12252. return (fgui.UIPackage.createObject("game", "Component59"));
  12253. }
  12254. onConstruct() {
  12255. this.n3 = (this.getChild("n3"));
  12256. this.msgTxt = (this.getChild("msgTxt"));
  12257. this.t0 = this.getTransition("t0");
  12258. }
  12259. }
  12260. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12261. class ui_RulerNode extends fgui.GComponent {
  12262. static createInstance() {
  12263. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12264. }
  12265. onConstruct() {
  12266. this.n6 = (this.getChild("n6"));
  12267. this.n4 = (this.getChild("n4"));
  12268. this.img1 = (this.getChild("img1"));
  12269. this.img2 = (this.getChild("img2"));
  12270. }
  12271. }
  12272. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12273. class ui_Component108 extends fgui.GComponent {
  12274. static createInstance() {
  12275. return (fgui.UIPackage.createObject("game", "Component108"));
  12276. }
  12277. onConstruct() {
  12278. this.n19 = (this.getChild("n19"));
  12279. this.t0 = this.getTransition("t0");
  12280. }
  12281. }
  12282. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12283. class ui_Component63 extends fgui.GComponent {
  12284. static createInstance() {
  12285. return (fgui.UIPackage.createObject("game", "Component63"));
  12286. }
  12287. onConstruct() {
  12288. this.n66 = (this.getChild("n66"));
  12289. this.n56 = (this.getChild("n56"));
  12290. this.n63 = (this.getChild("n63"));
  12291. this.n65 = (this.getChild("n65"));
  12292. this.t0 = this.getTransition("t0");
  12293. }
  12294. }
  12295. ui_Component63.URL = "ui://isxx5ak7h657452";
  12296. class ui_topNode extends fgui.GComponent {
  12297. static createInstance() {
  12298. return (fgui.UIPackage.createObject("game", "topNode"));
  12299. }
  12300. onConstruct() {
  12301. this.selfProgress = (this.getChild("selfProgress"));
  12302. this.aiProgress = (this.getChild("aiProgress"));
  12303. this.selfKuang = (this.getChild("selfKuang"));
  12304. this.aiKuang = (this.getChild("aiKuang"));
  12305. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12306. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12307. this.n33 = (this.getChild("n33"));
  12308. this.n34 = (this.getChild("n34"));
  12309. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12310. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12311. this.selfBallList = (this.getChild("selfBallList"));
  12312. this.aiBallList = (this.getChild("aiBallList"));
  12313. this.middleNode = (this.getChild("middleNode"));
  12314. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12315. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12316. this.scoreNode = (this.getChild("scoreNode"));
  12317. this.selfTips = (this.getChild("selfTips"));
  12318. this.aiTips = (this.getChild("aiTips"));
  12319. }
  12320. }
  12321. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12322. class ui_selfProgress extends fgui.GProgressBar {
  12323. static createInstance() {
  12324. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12325. }
  12326. onConstruct() {
  12327. this.n3 = (this.getChild("n3"));
  12328. this.bar = (this.getChild("bar"));
  12329. }
  12330. }
  12331. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12332. class ui_aiProgress extends fgui.GProgressBar {
  12333. static createInstance() {
  12334. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12335. }
  12336. onConstruct() {
  12337. this.n3 = (this.getChild("n3"));
  12338. this.bar = (this.getChild("bar"));
  12339. }
  12340. }
  12341. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12342. class ui_ballDisplay extends fgui.GComponent {
  12343. static createInstance() {
  12344. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12345. }
  12346. onConstruct() {
  12347. this.myImg = (this.getChild("myImg"));
  12348. }
  12349. }
  12350. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12351. class ui_moveNode extends fgui.GComponent {
  12352. static createInstance() {
  12353. return (fgui.UIPackage.createObject("game", "moveNode"));
  12354. }
  12355. onConstruct() {
  12356. this.n8 = (this.getChild("n8"));
  12357. this.finger = (this.getChild("finger"));
  12358. }
  12359. }
  12360. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12361. class ui_cancelBtn extends fgui.GButton {
  12362. static createInstance() {
  12363. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12364. }
  12365. onConstruct() {
  12366. this.c1 = this.getController("c1");
  12367. this.n0 = (this.getChild("n0"));
  12368. this.n1 = (this.getChild("n1"));
  12369. }
  12370. }
  12371. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12372. class ui_shareBtn extends fgui.GButton {
  12373. static createInstance() {
  12374. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12375. }
  12376. onConstruct() {
  12377. this.c1 = this.getController("c1");
  12378. this.n2 = (this.getChild("n2"));
  12379. this.n1 = (this.getChild("n1"));
  12380. this.n3 = (this.getChild("n3"));
  12381. this.n4 = (this.getChild("n4"));
  12382. this.n5 = (this.getChild("n5"));
  12383. this.n6 = (this.getChild("n6"));
  12384. }
  12385. }
  12386. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12387. class ui_share2Btn extends fgui.GButton {
  12388. static createInstance() {
  12389. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12390. }
  12391. onConstruct() {
  12392. this.n3 = (this.getChild("n3"));
  12393. }
  12394. }
  12395. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12396. class ui_rodMethodNode extends fgui.GComponent {
  12397. static createInstance() {
  12398. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12399. }
  12400. onConstruct() {
  12401. this.bg = (this.getChild("bg"));
  12402. this.dot = (this.getChild("dot"));
  12403. }
  12404. }
  12405. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12406. class ui_sureBtn extends fgui.GButton {
  12407. static createInstance() {
  12408. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12409. }
  12410. onConstruct() {
  12411. this.n2 = (this.getChild("n2"));
  12412. this.n1 = (this.getChild("n1"));
  12413. }
  12414. }
  12415. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12416. class ui_Component18 extends fgui.GComponent {
  12417. static createInstance() {
  12418. return (fgui.UIPackage.createObject("game", "Component18"));
  12419. }
  12420. onConstruct() {
  12421. this.c1 = this.getController("c1");
  12422. this.nameTxt = (this.getChild("nameTxt"));
  12423. this.headImg = (this.getChild("headImg"));
  12424. this.n24 = (this.getChild("n24"));
  12425. this.skillImg = (this.getChild("skillImg"));
  12426. this.skillTxt = (this.getChild("skillTxt"));
  12427. }
  12428. }
  12429. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12430. class ui_Component45 extends fgui.GComponent {
  12431. static createInstance() {
  12432. return (fgui.UIPackage.createObject("game", "Component45"));
  12433. }
  12434. onConstruct() {
  12435. this.c1 = this.getController("c1");
  12436. this.n40 = (this.getChild("n40"));
  12437. this.n41 = (this.getChild("n41"));
  12438. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12439. this.n42 = (this.getChild("n42"));
  12440. this.awardTxt = (this.getChild("awardTxt"));
  12441. this.n44 = (this.getChild("n44"));
  12442. this.t0 = this.getTransition("t0");
  12443. }
  12444. }
  12445. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12446. class ui_emotionDisplay extends fgui.GButton {
  12447. static createInstance() {
  12448. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12449. }
  12450. onConstruct() {
  12451. this.myIcon = (this.getChild("myIcon"));
  12452. }
  12453. }
  12454. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12455. class ui_Component49 extends fgui.GButton {
  12456. static createInstance() {
  12457. return (fgui.UIPackage.createObject("game", "Component49"));
  12458. }
  12459. onConstruct() {
  12460. this.n69 = (this.getChild("n69"));
  12461. this.n56 = (this.getChild("n56"));
  12462. }
  12463. }
  12464. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12465. class ui_Component50 extends fgui.GButton {
  12466. static createInstance() {
  12467. return (fgui.UIPackage.createObject("game", "Component50"));
  12468. }
  12469. onConstruct() {
  12470. this.n54 = (this.getChild("n54"));
  12471. this.n65 = (this.getChild("n65"));
  12472. }
  12473. }
  12474. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12475. class ui_Component51 extends fgui.GButton {
  12476. static createInstance() {
  12477. return (fgui.UIPackage.createObject("game", "Component51"));
  12478. }
  12479. onConstruct() {
  12480. this.c1 = this.getController("c1");
  12481. this.n51 = (this.getChild("n51"));
  12482. this.n54 = (this.getChild("n54"));
  12483. }
  12484. }
  12485. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12486. class ui_Button5 extends fgui.GButton {
  12487. static createInstance() {
  12488. return (fgui.UIPackage.createObject("game", "Button5"));
  12489. }
  12490. onConstruct() {
  12491. this.c1 = this.getController("c1");
  12492. this.n0 = (this.getChild("n0"));
  12493. this.n2 = (this.getChild("n2"));
  12494. }
  12495. }
  12496. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12497. class ui_Component124 extends fgui.GComponent {
  12498. static createInstance() {
  12499. return (fgui.UIPackage.createObject("game", "Component124"));
  12500. }
  12501. onConstruct() {
  12502. this.n22 = (this.getChild("n22"));
  12503. this.shareNode = (this.getChild("shareNode"));
  12504. }
  12505. }
  12506. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12507. class ui_Component125 extends fgui.GComponent {
  12508. static createInstance() {
  12509. return (fgui.UIPackage.createObject("game", "Component125"));
  12510. }
  12511. onConstruct() {
  12512. this.n29 = (this.getChild("n29"));
  12513. this.coinTxt = (this.getChild("coinTxt"));
  12514. }
  12515. }
  12516. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12517. class ui_Component52 extends fgui.GButton {
  12518. static createInstance() {
  12519. return (fgui.UIPackage.createObject("game", "Component52"));
  12520. }
  12521. onConstruct() {
  12522. this.n35 = (this.getChild("n35"));
  12523. this.n36 = (this.getChild("n36"));
  12524. }
  12525. }
  12526. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12527. class ui_drawBtn extends fgui.GButton {
  12528. static createInstance() {
  12529. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12530. }
  12531. onConstruct() {
  12532. this.c1 = this.getController("c1");
  12533. this.n2 = (this.getChild("n2"));
  12534. this.n1 = (this.getChild("n1"));
  12535. this.n5 = (this.getChild("n5"));
  12536. }
  12537. }
  12538. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12539. class ui_Component43 extends fgui.GButton {
  12540. static createInstance() {
  12541. return (fgui.UIPackage.createObject("game", "Component43"));
  12542. }
  12543. onConstruct() {
  12544. this.n49 = (this.getChild("n49"));
  12545. }
  12546. }
  12547. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12548. class ui_wordsDisplay extends fgui.GComponent {
  12549. static createInstance() {
  12550. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12551. }
  12552. onConstruct() {
  12553. this.txt = (this.getChild("txt"));
  12554. this.n63 = (this.getChild("n63"));
  12555. }
  12556. }
  12557. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12558. class ui_Component3 extends fgui.GComponent {
  12559. static createInstance() {
  12560. return (fgui.UIPackage.createObject("game", "Component3"));
  12561. }
  12562. onConstruct() {
  12563. this.n26 = (this.getChild("n26"));
  12564. this.n24 = (this.getChild("n24"));
  12565. this.nameTxt = (this.getChild("nameTxt"));
  12566. this.headRoot = (this.getChild("headRoot"));
  12567. }
  12568. }
  12569. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12570. class ui_Component4 extends fgui.GComponent {
  12571. static createInstance() {
  12572. return (fgui.UIPackage.createObject("game", "Component4"));
  12573. }
  12574. onConstruct() {
  12575. this.headImg = (this.getChild("headImg"));
  12576. }
  12577. }
  12578. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12579. class ui_Component7 extends fgui.GButton {
  12580. static createInstance() {
  12581. return (fgui.UIPackage.createObject("game", "Component7"));
  12582. }
  12583. onConstruct() {
  12584. this.n17 = (this.getChild("n17"));
  12585. }
  12586. }
  12587. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12588. class ui_Component8 extends fgui.GButton {
  12589. static createInstance() {
  12590. return (fgui.UIPackage.createObject("game", "Component8"));
  12591. }
  12592. onConstruct() {
  12593. this.n19 = (this.getChild("n19"));
  12594. }
  12595. }
  12596. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12597. class ui_Component10 extends fgui.GButton {
  12598. static createInstance() {
  12599. return (fgui.UIPackage.createObject("game", "Component10"));
  12600. }
  12601. onConstruct() {
  12602. this.c1 = this.getController("c1");
  12603. this.n40 = (this.getChild("n40"));
  12604. }
  12605. }
  12606. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12607. class ui_Component11 extends fgui.GButton {
  12608. static createInstance() {
  12609. return (fgui.UIPackage.createObject("game", "Component11"));
  12610. }
  12611. onConstruct() {
  12612. this.n34 = (this.getChild("n34"));
  12613. }
  12614. }
  12615. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12616. class ui_Component12 extends fgui.GButton {
  12617. static createInstance() {
  12618. return (fgui.UIPackage.createObject("game", "Component12"));
  12619. }
  12620. onConstruct() {
  12621. this.n35 = (this.getChild("n35"));
  12622. }
  12623. }
  12624. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12625. class ui_Component13 extends fgui.GButton {
  12626. static createInstance() {
  12627. return (fgui.UIPackage.createObject("game", "Component13"));
  12628. }
  12629. onConstruct() {
  12630. this.n27 = (this.getChild("n27"));
  12631. this.n36 = (this.getChild("n36"));
  12632. }
  12633. }
  12634. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12635. class ui_dh_js_tuowei extends fgui.GComponent {
  12636. static createInstance() {
  12637. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12638. }
  12639. onConstruct() {
  12640. this.n19 = (this.getChild("n19"));
  12641. this.n18 = (this.getChild("n18"));
  12642. this.n0 = (this.getChild("n0"));
  12643. this.n3 = (this.getChild("n3"));
  12644. this.n4 = (this.getChild("n4"));
  12645. this.n5 = (this.getChild("n5"));
  12646. this.n6 = (this.getChild("n6"));
  12647. this.n8 = (this.getChild("n8"));
  12648. this.n9 = (this.getChild("n9"));
  12649. this.n10 = (this.getChild("n10"));
  12650. this.n11 = (this.getChild("n11"));
  12651. this.n12 = (this.getChild("n12"));
  12652. this.n13 = (this.getChild("n13"));
  12653. this.n14 = (this.getChild("n14"));
  12654. this.n15 = (this.getChild("n15"));
  12655. this.n20 = (this.getChild("n20"));
  12656. this.t0 = this.getTransition("t0");
  12657. this.t1 = this.getTransition("t1");
  12658. }
  12659. }
  12660. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12661. class ui_dh_js_tw_g extends fgui.GComponent {
  12662. static createInstance() {
  12663. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12664. }
  12665. onConstruct() {
  12666. this.n0 = (this.getChild("n0"));
  12667. this.n1 = (this.getChild("n1"));
  12668. this.t0 = this.getTransition("t0");
  12669. }
  12670. }
  12671. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12672. class ui_dh_js_xingxing extends fgui.GComponent {
  12673. static createInstance() {
  12674. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12675. }
  12676. onConstruct() {
  12677. this.n1 = (this.getChild("n1"));
  12678. this.n2 = (this.getChild("n2"));
  12679. this.n3 = (this.getChild("n3"));
  12680. this.n4 = (this.getChild("n4"));
  12681. this.n0 = (this.getChild("n0"));
  12682. this.t2 = this.getTransition("t2");
  12683. this.t1 = this.getTransition("t1");
  12684. }
  12685. }
  12686. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12687. class ui_dh_zy_jiazai extends fgui.GComponent {
  12688. static createInstance() {
  12689. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12690. }
  12691. onConstruct() {
  12692. this.c1 = this.getController("c1");
  12693. this.n0 = (this.getChild("n0"));
  12694. this.n1 = (this.getChild("n1"));
  12695. this.n2 = (this.getChild("n2"));
  12696. this.n4 = (this.getChild("n4"));
  12697. this.n5 = (this.getChild("n5"));
  12698. this.n6 = (this.getChild("n6"));
  12699. this.n8 = (this.getChild("n8"));
  12700. this.n7 = (this.getChild("n7"));
  12701. this.t0 = this.getTransition("t0");
  12702. }
  12703. }
  12704. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12705. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12706. static createInstance() {
  12707. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12708. }
  12709. onConstruct() {
  12710. this.c1 = this.getController("c1");
  12711. this.n3 = (this.getChild("n3"));
  12712. this.n5 = (this.getChild("n5"));
  12713. this.n4 = (this.getChild("n4"));
  12714. this.n0 = (this.getChild("n0"));
  12715. this.n1 = (this.getChild("n1"));
  12716. this.n2 = (this.getChild("n2"));
  12717. }
  12718. }
  12719. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12720. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12721. static createInstance() {
  12722. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12723. }
  12724. onConstruct() {
  12725. this.n19 = (this.getChild("n19"));
  12726. this.n21 = (this.getChild("n21"));
  12727. this.n0 = (this.getChild("n0"));
  12728. this.n3 = (this.getChild("n3"));
  12729. this.n4 = (this.getChild("n4"));
  12730. this.n5 = (this.getChild("n5"));
  12731. this.n6 = (this.getChild("n6"));
  12732. this.n8 = (this.getChild("n8"));
  12733. this.n9 = (this.getChild("n9"));
  12734. this.n10 = (this.getChild("n10"));
  12735. this.n11 = (this.getChild("n11"));
  12736. this.n12 = (this.getChild("n12"));
  12737. this.n13 = (this.getChild("n13"));
  12738. this.n14 = (this.getChild("n14"));
  12739. this.n15 = (this.getChild("n15"));
  12740. this.n23 = (this.getChild("n23"));
  12741. this.t0 = this.getTransition("t0");
  12742. this.t1 = this.getTransition("t1");
  12743. }
  12744. }
  12745. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12746. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12747. static createInstance() {
  12748. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12749. }
  12750. onConstruct() {
  12751. this.n1 = (this.getChild("n1"));
  12752. this.n2 = (this.getChild("n2"));
  12753. this.t0 = this.getTransition("t0");
  12754. }
  12755. }
  12756. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12757. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12758. static createInstance() {
  12759. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12760. }
  12761. onConstruct() {
  12762. this.n4 = (this.getChild("n4"));
  12763. this.n2 = (this.getChild("n2"));
  12764. this.n3 = (this.getChild("n3"));
  12765. this.idle = this.getTransition("idle");
  12766. this.attack = this.getTransition("attack");
  12767. }
  12768. }
  12769. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12770. class ui_special extends fgui.GComponent {
  12771. static createInstance() {
  12772. return (fgui.UIPackage.createObject("game", "special"));
  12773. }
  12774. onConstruct() {
  12775. this.n18 = (this.getChild("n18"));
  12776. this.n19 = (this.getChild("n19"));
  12777. this.n20 = (this.getChild("n20"));
  12778. this.n21 = (this.getChild("n21"));
  12779. this.n22 = (this.getChild("n22"));
  12780. this.levelTxt = (this.getChild("levelTxt"));
  12781. this.n24 = (this.getChild("n24"));
  12782. this.n25 = (this.getChild("n25"));
  12783. this.t0 = this.getTransition("t0");
  12784. }
  12785. }
  12786. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12787. class ui_Component145 extends fgui.GComponent {
  12788. static createInstance() {
  12789. return (fgui.UIPackage.createObject("game", "Component145"));
  12790. }
  12791. onConstruct() {
  12792. this.guanyuNode = (this.getChild("guanyuNode"));
  12793. }
  12794. }
  12795. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12796. class ui_longBtn extends fgui.GButton {
  12797. static createInstance() {
  12798. return (fgui.UIPackage.createObject("game", "longBtn"));
  12799. }
  12800. onConstruct() {
  12801. this.c1 = this.getController("c1");
  12802. this.n2 = (this.getChild("n2"));
  12803. this.n1 = (this.getChild("n1"));
  12804. this.n4 = (this.getChild("n4"));
  12805. }
  12806. }
  12807. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12808. class ui_Component146 extends fgui.GComponent {
  12809. static createInstance() {
  12810. return (fgui.UIPackage.createObject("game", "Component146"));
  12811. }
  12812. onConstruct() {
  12813. this.n89 = (this.getChild("n89"));
  12814. this.n90 = (this.getChild("n90"));
  12815. this.guideBtn = (this.getChild("guideBtn"));
  12816. }
  12817. }
  12818. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12819. class ui_Component146_11 extends fgui.GComponent {
  12820. static createInstance() {
  12821. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12822. }
  12823. onConstruct() {
  12824. this.n89 = (this.getChild("n89"));
  12825. this.n90 = (this.getChild("n90"));
  12826. this.guideBtn = (this.getChild("guideBtn"));
  12827. }
  12828. }
  12829. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12830. class ui_Component111_1 extends fgui.GComponent {
  12831. static createInstance() {
  12832. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12833. }
  12834. onConstruct() {
  12835. this.n68 = (this.getChild("n68"));
  12836. this.myMask = (this.getChild("myMask"));
  12837. }
  12838. }
  12839. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12840. class ui_Component64_1 extends fgui.GComponent {
  12841. static createInstance() {
  12842. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12843. }
  12844. onConstruct() {
  12845. this.n57 = (this.getChild("n57"));
  12846. this.n54 = (this.getChild("n54"));
  12847. this.n55 = (this.getChild("n55"));
  12848. this.n56 = (this.getChild("n56"));
  12849. this.t1 = this.getTransition("t1");
  12850. }
  12851. }
  12852. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12853. class ui_ModeSelection_com123 extends fgui.GComponent {
  12854. static createInstance() {
  12855. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12856. }
  12857. onConstruct() {
  12858. this.type1 = (this.getChild("type1"));
  12859. this.type2 = (this.getChild("type2"));
  12860. this.type3 = (this.getChild("type3"));
  12861. this.n38 = (this.getChild("n38"));
  12862. this.t0 = this.getTransition("t0");
  12863. }
  12864. }
  12865. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12866. class ui_Component132_2 extends fgui.GComponent {
  12867. static createInstance() {
  12868. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12869. }
  12870. onConstruct() {
  12871. this.n25 = (this.getChild("n25"));
  12872. this.n26 = (this.getChild("n26"));
  12873. this.n27 = (this.getChild("n27"));
  12874. this.t0 = this.getTransition("t0");
  12875. }
  12876. }
  12877. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12878. class ui_UIPower$1 extends fgui.GComponent {
  12879. static createInstance() {
  12880. return (fgui.UIPackage.createObject("game", "UIPower"));
  12881. }
  12882. onConstruct() {
  12883. this.n11 = (this.getChild("n11"));
  12884. this.myNode = (this.getChild("myNode"));
  12885. this.t0 = this.getTransition("t0");
  12886. }
  12887. }
  12888. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12889. class ui_Component133 extends fgui.GComponent {
  12890. static createInstance() {
  12891. return (fgui.UIPackage.createObject("game", "Component133"));
  12892. }
  12893. onConstruct() {
  12894. this.n29 = (this.getChild("n29"));
  12895. this.n30 = (this.getChild("n30"));
  12896. }
  12897. }
  12898. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12899. class ui_Component134 extends fgui.GComponent {
  12900. static createInstance() {
  12901. return (fgui.UIPackage.createObject("game", "Component134"));
  12902. }
  12903. onConstruct() {
  12904. this.n30 = (this.getChild("n30"));
  12905. this.n31 = (this.getChild("n31"));
  12906. this.t0 = this.getTransition("t0");
  12907. }
  12908. }
  12909. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12910. class ui_Component135 extends fgui.GComponent {
  12911. static createInstance() {
  12912. return (fgui.UIPackage.createObject("game", "Component135"));
  12913. }
  12914. onConstruct() {
  12915. this.n30 = (this.getChild("n30"));
  12916. this.t0 = this.getTransition("t0");
  12917. }
  12918. }
  12919. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12920. class ui_Component137 extends fgui.GComponent {
  12921. static createInstance() {
  12922. return (fgui.UIPackage.createObject("game", "Component137"));
  12923. }
  12924. onConstruct() {
  12925. this.n28 = (this.getChild("n28"));
  12926. this.n29 = (this.getChild("n29"));
  12927. this.n30 = (this.getChild("n30"));
  12928. this.n32 = (this.getChild("n32"));
  12929. }
  12930. }
  12931. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12932. class ui_dh_zuanshi extends fgui.GButton {
  12933. static createInstance() {
  12934. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12935. }
  12936. onConstruct() {
  12937. this.n1 = (this.getChild("n1"));
  12938. this.n2 = (this.getChild("n2"));
  12939. this.n0 = (this.getChild("n0"));
  12940. this.n3 = (this.getChild("n3"));
  12941. this.n4 = (this.getChild("n4"));
  12942. }
  12943. }
  12944. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12945. class ui_Component138 extends fgui.GComponent {
  12946. static createInstance() {
  12947. return (fgui.UIPackage.createObject("game", "Component138"));
  12948. }
  12949. onConstruct() {
  12950. this.n1 = (this.getChild("n1"));
  12951. this.n2 = (this.getChild("n2"));
  12952. this.t0 = this.getTransition("t0");
  12953. }
  12954. }
  12955. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12956. class ui_Component139 extends fgui.GComponent {
  12957. static createInstance() {
  12958. return (fgui.UIPackage.createObject("game", "Component139"));
  12959. }
  12960. onConstruct() {
  12961. this.n0 = (this.getChild("n0"));
  12962. this.t0 = this.getTransition("t0");
  12963. }
  12964. }
  12965. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12966. class ui_Component140 extends fgui.GComponent {
  12967. static createInstance() {
  12968. return (fgui.UIPackage.createObject("game", "Component140"));
  12969. }
  12970. onConstruct() {
  12971. this.n2 = (this.getChild("n2"));
  12972. this.n3 = (this.getChild("n3"));
  12973. this.t0 = this.getTransition("t0");
  12974. }
  12975. }
  12976. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12977. class ui_Component141 extends fgui.GComponent {
  12978. static createInstance() {
  12979. return (fgui.UIPackage.createObject("game", "Component141"));
  12980. }
  12981. onConstruct() {
  12982. this.n0 = (this.getChild("n0"));
  12983. this.t0 = this.getTransition("t0");
  12984. }
  12985. }
  12986. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12987. class ui_powerNode extends fgui.GProgressBar {
  12988. static createInstance() {
  12989. return (fgui.UIPackage.createObject("game", "powerNode"));
  12990. }
  12991. onConstruct() {
  12992. this.n2 = (this.getChild("n2"));
  12993. this.bar_v = (this.getChild("bar_v"));
  12994. this.showImg = (this.getChild("showImg"));
  12995. this.n12 = (this.getChild("n12"));
  12996. }
  12997. }
  12998. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12999. class ui_dh_jingbi1 extends fgui.GComponent {
  13000. static createInstance() {
  13001. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13002. }
  13003. onConstruct() {
  13004. this.n0 = (this.getChild("n0"));
  13005. this.n1 = (this.getChild("n1"));
  13006. this.n2 = (this.getChild("n2"));
  13007. this.n3 = (this.getChild("n3"));
  13008. this.n4 = (this.getChild("n4"));
  13009. this.n5 = (this.getChild("n5"));
  13010. this.n6 = (this.getChild("n6"));
  13011. this.n8 = (this.getChild("n8"));
  13012. this.t0 = this.getTransition("t0");
  13013. }
  13014. }
  13015. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13016. class ui_Component94 extends fgui.GButton {
  13017. static createInstance() {
  13018. return (fgui.UIPackage.createObject("game", "Component94"));
  13019. }
  13020. onConstruct() {
  13021. this.n77 = (this.getChild("n77"));
  13022. }
  13023. }
  13024. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13025. class ui_Component95 extends fgui.GButton {
  13026. static createInstance() {
  13027. return (fgui.UIPackage.createObject("game", "Component95"));
  13028. }
  13029. onConstruct() {
  13030. this.n77 = (this.getChild("n77"));
  13031. }
  13032. }
  13033. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13034. class ui_Component126 extends fgui.GComponent {
  13035. static createInstance() {
  13036. return (fgui.UIPackage.createObject("game", "Component126"));
  13037. }
  13038. onConstruct() {
  13039. this.c1 = this.getController("c1");
  13040. this.normalBtn = (this.getChild("normalBtn"));
  13041. this.tripleBtn = (this.getChild("tripleBtn"));
  13042. }
  13043. }
  13044. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13045. class ui_Component60 extends fgui.GComponent {
  13046. static createInstance() {
  13047. return (fgui.UIPackage.createObject("game", "Component60"));
  13048. }
  13049. onConstruct() {
  13050. this.c1 = this.getController("c1");
  13051. this.n48 = (this.getChild("n48"));
  13052. this.womanTxt = (this.getChild("womanTxt"));
  13053. this.t0 = this.getTransition("t0");
  13054. }
  13055. }
  13056. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13057. class ui_Component98_3 extends fgui.GButton {
  13058. static createInstance() {
  13059. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13060. }
  13061. onConstruct() {
  13062. this.c1 = this.getController("c1");
  13063. this.n8 = (this.getChild("n8"));
  13064. this.n41 = (this.getChild("n41"));
  13065. this.n40 = (this.getChild("n40"));
  13066. }
  13067. }
  13068. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13069. class ui_ModeSelection_com1 extends fgui.GButton {
  13070. static createInstance() {
  13071. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13072. }
  13073. onConstruct() {
  13074. this.n34 = (this.getChild("n34"));
  13075. this.n36 = (this.getChild("n36"));
  13076. this.n22 = (this.getChild("n22"));
  13077. this.n20 = (this.getChild("n20"));
  13078. this.n23 = (this.getChild("n23"));
  13079. this.n24 = (this.getChild("n24"));
  13080. this.n26 = (this.getChild("n26"));
  13081. this.n33 = (this.getChild("n33"));
  13082. this.coinImg = (this.getChild("coinImg"));
  13083. this.need = (this.getChild("need"));
  13084. this.n35 = (this.getChild("n35"));
  13085. this.n29 = (this.getChild("n29"));
  13086. this.tipsTxt = (this.getChild("tipsTxt"));
  13087. this.n30 = (this.getChild("n30"));
  13088. this.peopleTxt = (this.getChild("peopleTxt"));
  13089. this.t0 = this.getTransition("t0");
  13090. }
  13091. }
  13092. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13093. class ui_ModeSelection_com2 extends fgui.GButton {
  13094. static createInstance() {
  13095. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13096. }
  13097. onConstruct() {
  13098. this.n36 = (this.getChild("n36"));
  13099. this.n34 = (this.getChild("n34"));
  13100. this.n22 = (this.getChild("n22"));
  13101. this.n20 = (this.getChild("n20"));
  13102. this.n23 = (this.getChild("n23"));
  13103. this.n24 = (this.getChild("n24"));
  13104. this.n26 = (this.getChild("n26"));
  13105. this.n33 = (this.getChild("n33"));
  13106. this.coinImg = (this.getChild("coinImg"));
  13107. this.need = (this.getChild("need"));
  13108. this.n35 = (this.getChild("n35"));
  13109. this.n29 = (this.getChild("n29"));
  13110. this.tipsTxt = (this.getChild("tipsTxt"));
  13111. this.n30 = (this.getChild("n30"));
  13112. this.peopleTxt = (this.getChild("peopleTxt"));
  13113. this.t0 = this.getTransition("t0");
  13114. }
  13115. }
  13116. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13117. class ui_ModeSelection_com3 extends fgui.GButton {
  13118. static createInstance() {
  13119. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13120. }
  13121. onConstruct() {
  13122. this.n34 = (this.getChild("n34"));
  13123. this.n36 = (this.getChild("n36"));
  13124. this.n22 = (this.getChild("n22"));
  13125. this.n20 = (this.getChild("n20"));
  13126. this.n23 = (this.getChild("n23"));
  13127. this.n24 = (this.getChild("n24"));
  13128. this.n26 = (this.getChild("n26"));
  13129. this.n33 = (this.getChild("n33"));
  13130. this.coinImg = (this.getChild("coinImg"));
  13131. this.need = (this.getChild("need"));
  13132. this.n35 = (this.getChild("n35"));
  13133. this.n29 = (this.getChild("n29"));
  13134. this.tipsTxt = (this.getChild("tipsTxt"));
  13135. this.n30 = (this.getChild("n30"));
  13136. this.peopleTxt = (this.getChild("peopleTxt"));
  13137. this.t0 = this.getTransition("t0");
  13138. }
  13139. }
  13140. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13141. class ui_Invitation_com1 extends fgui.GComponent {
  13142. static createInstance() {
  13143. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13144. }
  13145. onConstruct() {
  13146. this.n14 = (this.getChild("n14"));
  13147. this.n13 = (this.getChild("n13"));
  13148. this.n3 = (this.getChild("n3"));
  13149. this.n1 = (this.getChild("n1"));
  13150. this.n6 = (this.getChild("n6"));
  13151. this.n7 = (this.getChild("n7"));
  13152. this.enterBtn = (this.getChild("enterBtn"));
  13153. this.n11 = (this.getChild("n11"));
  13154. this.n12 = (this.getChild("n12"));
  13155. this.n15 = (this.getChild("n15"));
  13156. this.t0 = this.getTransition("t0");
  13157. this.t1 = this.getTransition("t1");
  13158. }
  13159. }
  13160. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13161. class ui_Component87_1 extends fgui.GComponent {
  13162. static createInstance() {
  13163. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13164. }
  13165. onConstruct() {
  13166. this.n74 = (this.getChild("n74"));
  13167. this.n73 = (this.getChild("n73"));
  13168. this.ballTxt = (this.getChild("ballTxt"));
  13169. this.n76 = (this.getChild("n76"));
  13170. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13171. this.levelTxt = (this.getChild("levelTxt"));
  13172. this.n87 = (this.getChild("n87"));
  13173. this.n84 = (this.getChild("n84"));
  13174. this.hpTxt = (this.getChild("hpTxt"));
  13175. this.n89 = (this.getChild("n89"));
  13176. this.tipsTxt = (this.getChild("tipsTxt"));
  13177. }
  13178. }
  13179. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13180. class ui_sqg1 extends fgui.GComponent {
  13181. static createInstance() {
  13182. return (fgui.UIPackage.createObject("game", "sqg1"));
  13183. }
  13184. onConstruct() {
  13185. this.n1 = (this.getChild("n1"));
  13186. this.n0 = (this.getChild("n0"));
  13187. }
  13188. }
  13189. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13190. class ui_sqg2 extends fgui.GComponent {
  13191. static createInstance() {
  13192. return (fgui.UIPackage.createObject("game", "sqg2"));
  13193. }
  13194. onConstruct() {
  13195. this.n1 = (this.getChild("n1"));
  13196. this.n0 = (this.getChild("n0"));
  13197. }
  13198. }
  13199. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13200. class ui_sqg3 extends fgui.GComponent {
  13201. static createInstance() {
  13202. return (fgui.UIPackage.createObject("game", "sqg3"));
  13203. }
  13204. onConstruct() {
  13205. this.n1 = (this.getChild("n1"));
  13206. this.n0 = (this.getChild("n0"));
  13207. }
  13208. }
  13209. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13210. class ui_sqg4 extends fgui.GComponent {
  13211. static createInstance() {
  13212. return (fgui.UIPackage.createObject("game", "sqg4"));
  13213. }
  13214. onConstruct() {
  13215. this.n1 = (this.getChild("n1"));
  13216. this.n0 = (this.getChild("n0"));
  13217. }
  13218. }
  13219. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13220. class ui_Component36 extends fgui.GButton {
  13221. static createInstance() {
  13222. return (fgui.UIPackage.createObject("game", "Component36"));
  13223. }
  13224. onConstruct() {
  13225. this.c1 = this.getController("c1");
  13226. this.n53 = (this.getChild("n53"));
  13227. this.n56 = (this.getChild("n56"));
  13228. }
  13229. }
  13230. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13231. class ui_Component37 extends fgui.GButton {
  13232. static createInstance() {
  13233. return (fgui.UIPackage.createObject("game", "Component37"));
  13234. }
  13235. onConstruct() {
  13236. this.c1 = this.getController("c1");
  13237. this.n52 = (this.getChild("n52"));
  13238. this.n54 = (this.getChild("n54"));
  13239. }
  13240. }
  13241. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13242. class ui_UISetting extends fgui.GComponent {
  13243. static createInstance() {
  13244. return (fgui.UIPackage.createObject("game", "UISetting"));
  13245. }
  13246. onConstruct() {
  13247. this.c1 = this.getController("c1");
  13248. this.n4 = (this.getChild("n4"));
  13249. this.soundBtn = (this.getChild("soundBtn"));
  13250. this.shakeBtn = (this.getChild("shakeBtn"));
  13251. this.clickNode = (this.getChild("clickNode"));
  13252. this.xyBtn = (this.getChild("xyBtn"));
  13253. }
  13254. }
  13255. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13256. class ui_Component39 extends fgui.GComponent {
  13257. static createInstance() {
  13258. return (fgui.UIPackage.createObject("game", "Component39"));
  13259. }
  13260. onConstruct() {
  13261. this.n5 = (this.getChild("n5"));
  13262. this.n6 = (this.getChild("n6"));
  13263. this.n7 = (this.getChild("n7"));
  13264. this.t0 = this.getTransition("t0");
  13265. }
  13266. }
  13267. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13268. class ui_Component40 extends fgui.GButton {
  13269. static createInstance() {
  13270. return (fgui.UIPackage.createObject("game", "Component40"));
  13271. }
  13272. onConstruct() {
  13273. this.n46 = (this.getChild("n46"));
  13274. this.n47 = (this.getChild("n47"));
  13275. }
  13276. }
  13277. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13278. class ui_Component41 extends fgui.GComponent {
  13279. static createInstance() {
  13280. return (fgui.UIPackage.createObject("game", "Component41"));
  13281. }
  13282. onConstruct() {
  13283. this.c1 = this.getController("c1");
  13284. this.n0 = (this.getChild("n0"));
  13285. this.titleTxt = (this.getChild("titleTxt"));
  13286. this.n2 = (this.getChild("n2"));
  13287. this.msgTips = (this.getChild("msgTips"));
  13288. this.numTxt = (this.getChild("numTxt"));
  13289. this.n18 = (this.getChild("n18"));
  13290. this.cancelBtn = (this.getChild("cancelBtn"));
  13291. this.videoBtn = (this.getChild("videoBtn"));
  13292. this.n10 = (this.getChild("n10"));
  13293. }
  13294. }
  13295. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13296. class ui_Component42 extends fgui.GComponent {
  13297. static createInstance() {
  13298. return (fgui.UIPackage.createObject("game", "Component42"));
  13299. }
  13300. onConstruct() {
  13301. this.c1 = this.getController("c1");
  13302. this.n1 = (this.getChild("n1"));
  13303. this.n2 = (this.getChild("n2"));
  13304. this.n3 = (this.getChild("n3"));
  13305. this.tipsTxt = (this.getChild("tipsTxt"));
  13306. this.cancelBtn = (this.getChild("cancelBtn"));
  13307. this.sureBtn = (this.getChild("sureBtn"));
  13308. this.n11 = (this.getChild("n11"));
  13309. this.n13 = (this.getChild("n13"));
  13310. this.n14 = (this.getChild("n14"));
  13311. this.womanTxt = (this.getChild("womanTxt"));
  13312. this.t0 = this.getTransition("t0");
  13313. }
  13314. }
  13315. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13316. class ui_dh_js_shengli extends fgui.GComponent {
  13317. static createInstance() {
  13318. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13319. }
  13320. onConstruct() {
  13321. this.n3 = (this.getChild("n3"));
  13322. this.n4 = (this.getChild("n4"));
  13323. this.n1 = (this.getChild("n1"));
  13324. this.n2 = (this.getChild("n2"));
  13325. this.n5 = (this.getChild("n5"));
  13326. this.n6 = (this.getChild("n6"));
  13327. this.n7 = (this.getChild("n7"));
  13328. this.n8 = (this.getChild("n8"));
  13329. this.attack = this.getTransition("attack");
  13330. this.idle = this.getTransition("idle");
  13331. }
  13332. }
  13333. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13334. class ui_dh_js_shengli_g extends fgui.GComponent {
  13335. static createInstance() {
  13336. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13337. }
  13338. onConstruct() {
  13339. this.n3 = (this.getChild("n3"));
  13340. this.n1 = (this.getChild("n1"));
  13341. this.t0 = this.getTransition("t0");
  13342. }
  13343. }
  13344. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13345. class ui_dh_js_shibai extends fgui.GComponent {
  13346. static createInstance() {
  13347. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13348. }
  13349. onConstruct() {
  13350. this.n0 = (this.getChild("n0"));
  13351. this.n1 = (this.getChild("n1"));
  13352. this.n2 = (this.getChild("n2"));
  13353. this.n3 = (this.getChild("n3"));
  13354. this.idle = this.getTransition("idle");
  13355. this.attack = this.getTransition("attack");
  13356. }
  13357. }
  13358. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13359. class ui_dh_zy_ganfa extends fgui.GButton {
  13360. static createInstance() {
  13361. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13362. }
  13363. onConstruct() {
  13364. this.n0 = (this.getChild("n0"));
  13365. }
  13366. }
  13367. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13368. class ui_dh_zy_sc_guang extends fgui.GButton {
  13369. static createInstance() {
  13370. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13371. }
  13372. onConstruct() {
  13373. this.n0 = (this.getChild("n0"));
  13374. this.n2 = (this.getChild("n2"));
  13375. }
  13376. }
  13377. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13378. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13379. static createInstance() {
  13380. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13381. }
  13382. onConstruct() {
  13383. this.n0 = (this.getChild("n0"));
  13384. this.n3 = (this.getChild("n3"));
  13385. this.t0 = this.getTransition("t0");
  13386. }
  13387. }
  13388. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13389. class ui_dh_zy_wanfa extends fgui.GButton {
  13390. static createInstance() {
  13391. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13392. }
  13393. onConstruct() {
  13394. this.n0 = (this.getChild("n0"));
  13395. }
  13396. }
  13397. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13398. class ui_Component53_1 extends fgui.GComponent {
  13399. static createInstance() {
  13400. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13401. }
  13402. onConstruct() {
  13403. this.n0 = (this.getChild("n0"));
  13404. this.n1 = (this.getChild("n1"));
  13405. this.n2 = (this.getChild("n2"));
  13406. this.n3 = (this.getChild("n3"));
  13407. this.n4 = (this.getChild("n4"));
  13408. this.n5 = (this.getChild("n5"));
  13409. this.n6 = (this.getChild("n6"));
  13410. this.n7 = (this.getChild("n7"));
  13411. this.n8 = (this.getChild("n8"));
  13412. this.n9 = (this.getChild("n9"));
  13413. this.n10 = (this.getChild("n10"));
  13414. this.n11 = (this.getChild("n11"));
  13415. this.n12 = (this.getChild("n12"));
  13416. this.n13 = (this.getChild("n13"));
  13417. this.n14 = (this.getChild("n14"));
  13418. this.n15 = (this.getChild("n15"));
  13419. this.n16 = (this.getChild("n16"));
  13420. this.n19 = (this.getChild("n19"));
  13421. this.n20 = (this.getChild("n20"));
  13422. this.n21 = (this.getChild("n21"));
  13423. this.n22 = (this.getChild("n22"));
  13424. this.n23 = (this.getChild("n23"));
  13425. this.n24 = (this.getChild("n24"));
  13426. this.n25 = (this.getChild("n25"));
  13427. this.n26 = (this.getChild("n26"));
  13428. this.n27 = (this.getChild("n27"));
  13429. this.n28 = (this.getChild("n28"));
  13430. this.n29 = (this.getChild("n29"));
  13431. this.n30 = (this.getChild("n30"));
  13432. this.n31 = (this.getChild("n31"));
  13433. this.n32 = (this.getChild("n32"));
  13434. this.n33 = (this.getChild("n33"));
  13435. this.n34 = (this.getChild("n34"));
  13436. this.n35 = (this.getChild("n35"));
  13437. this.t0 = this.getTransition("t0");
  13438. }
  13439. }
  13440. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13441. class ui_Component30 extends fgui.GComponent {
  13442. static createInstance() {
  13443. return (fgui.UIPackage.createObject("game", "Component30"));
  13444. }
  13445. onConstruct() {
  13446. this.c1 = this.getController("c1");
  13447. this.n46 = (this.getChild("n46"));
  13448. this.n47 = (this.getChild("n47"));
  13449. this.numTxt = (this.getChild("numTxt"));
  13450. this.n50 = (this.getChild("n50"));
  13451. this.n53 = (this.getChild("n53"));
  13452. this.n54 = (this.getChild("n54"));
  13453. this.n55 = (this.getChild("n55"));
  13454. this.n56 = (this.getChild("n56"));
  13455. }
  13456. }
  13457. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13458. class ui_Component30_1 extends fgui.GComponent {
  13459. static createInstance() {
  13460. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13461. }
  13462. onConstruct() {
  13463. this.c1 = this.getController("c1");
  13464. this.n46 = (this.getChild("n46"));
  13465. this.n47 = (this.getChild("n47"));
  13466. this.numTxt = (this.getChild("numTxt"));
  13467. this.n50 = (this.getChild("n50"));
  13468. this.n51 = (this.getChild("n51"));
  13469. this.n52 = (this.getChild("n52"));
  13470. this.n53 = (this.getChild("n53"));
  13471. this.n54 = (this.getChild("n54"));
  13472. }
  13473. }
  13474. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13475. class ui_Component31 extends fgui.GComponent {
  13476. static createInstance() {
  13477. return (fgui.UIPackage.createObject("game", "Component31"));
  13478. }
  13479. onConstruct() {
  13480. this.n55 = (this.getChild("n55"));
  13481. this.n54 = (this.getChild("n54"));
  13482. this.conditionTxt = (this.getChild("conditionTxt"));
  13483. this.n57 = (this.getChild("n57"));
  13484. this.t0 = this.getTransition("t0");
  13485. }
  13486. }
  13487. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13488. class ui_Component32 extends fgui.GComponent {
  13489. static createInstance() {
  13490. return (fgui.UIPackage.createObject("game", "Component32"));
  13491. }
  13492. onConstruct() {
  13493. this.n5 = (this.getChild("n5"));
  13494. this.n6 = (this.getChild("n6"));
  13495. this.n7 = (this.getChild("n7"));
  13496. this.t0 = this.getTransition("t0");
  13497. }
  13498. }
  13499. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13500. class ui_AwardItem extends fgui.GComponent {
  13501. static createInstance() {
  13502. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13503. }
  13504. onConstruct() {
  13505. this.n9 = (this.getChild("n9"));
  13506. this.myIcon = (this.getChild("myIcon"));
  13507. this.numTxt = (this.getChild("numTxt"));
  13508. this.nameTxt = (this.getChild("nameTxt"));
  13509. this.n16 = (this.getChild("n16"));
  13510. this.n17 = (this.getChild("n17"));
  13511. }
  13512. }
  13513. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13514. class ui_ranking_com1 extends fgui.GButton {
  13515. static createInstance() {
  13516. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13517. }
  13518. onConstruct() {
  13519. this.c1 = this.getController("c1");
  13520. this.n49 = (this.getChild("n49"));
  13521. this.n18 = (this.getChild("n18"));
  13522. this.n46 = (this.getChild("n46"));
  13523. this.n48 = (this.getChild("n48"));
  13524. this.n50 = (this.getChild("n50"));
  13525. }
  13526. }
  13527. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13528. class ui_ranking_com2 extends fgui.GButton {
  13529. static createInstance() {
  13530. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13531. }
  13532. onConstruct() {
  13533. this.c1 = this.getController("c1");
  13534. this.n49 = (this.getChild("n49"));
  13535. this.n18 = (this.getChild("n18"));
  13536. this.n46 = (this.getChild("n46"));
  13537. this.n48 = (this.getChild("n48"));
  13538. this.n50 = (this.getChild("n50"));
  13539. }
  13540. }
  13541. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13542. class ui_ranking_com3 extends fgui.GComponent {
  13543. static createInstance() {
  13544. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13545. }
  13546. onConstruct() {
  13547. this.n17 = (this.getChild("n17"));
  13548. this.myIcon = (this.getChild("myIcon"));
  13549. }
  13550. }
  13551. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13552. class ui_ranking_com4 extends fgui.GComponent {
  13553. static createInstance() {
  13554. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13555. }
  13556. onConstruct() {
  13557. this.n16 = (this.getChild("n16"));
  13558. this.head = (this.getChild("head"));
  13559. }
  13560. }
  13561. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13562. class ui_ranking_com5 extends fgui.GComponent {
  13563. static createInstance() {
  13564. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13565. }
  13566. onConstruct() {
  13567. this.c1 = this.getController("c1");
  13568. this.c2 = this.getController("c2");
  13569. this.n2 = (this.getChild("n2"));
  13570. this.n3 = (this.getChild("n3"));
  13571. this.levelBtn = (this.getChild("levelBtn"));
  13572. this.starBtn = (this.getChild("starBtn"));
  13573. this.n23 = (this.getChild("n23"));
  13574. this.n24 = (this.getChild("n24"));
  13575. this.n25 = (this.getChild("n25"));
  13576. this.myList = (this.getChild("myList"));
  13577. this.selfNode = (this.getChild("selfNode"));
  13578. this.n9 = (this.getChild("n9"));
  13579. this.n12 = (this.getChild("n12"));
  13580. this.n13 = (this.getChild("n13"));
  13581. this.n14 = (this.getChild("n14"));
  13582. this.n39 = (this.getChild("n39"));
  13583. this.n41 = (this.getChild("n41"));
  13584. this.n42 = (this.getChild("n42"));
  13585. this.n45 = (this.getChild("n45"));
  13586. this.changeBtn = (this.getChild("changeBtn"));
  13587. this.closeBtn = (this.getChild("closeBtn"));
  13588. this.t0 = this.getTransition("t0");
  13589. }
  13590. }
  13591. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13592. class ui_RankItem extends fgui.GComponent {
  13593. static createInstance() {
  13594. return (fgui.UIPackage.createObject("game", "RankItem"));
  13595. }
  13596. onConstruct() {
  13597. this.n10 = (this.getChild("n10"));
  13598. this.n11 = (this.getChild("n11"));
  13599. this.rankTxt = (this.getChild("rankTxt"));
  13600. this.headNode = (this.getChild("headNode"));
  13601. this.nameTxt = (this.getChild("nameTxt"));
  13602. this.n19 = (this.getChild("n19"));
  13603. this.valueTxt = (this.getChild("valueTxt"));
  13604. this.img1 = (this.getChild("img1"));
  13605. this.img2 = (this.getChild("img2"));
  13606. this.img3 = (this.getChild("img3"));
  13607. }
  13608. }
  13609. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13610. class ui_ranking_com9 extends fgui.GComponent {
  13611. static createInstance() {
  13612. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13613. }
  13614. onConstruct() {
  13615. this.c1 = this.getController("c1");
  13616. this.n27 = (this.getChild("n27"));
  13617. this.n28 = (this.getChild("n28"));
  13618. this.headNode = (this.getChild("headNode"));
  13619. this.rankTxt = (this.getChild("rankTxt"));
  13620. this.nameTxt = (this.getChild("nameTxt"));
  13621. this.n34 = (this.getChild("n34"));
  13622. this.valueTxt = (this.getChild("valueTxt"));
  13623. this.n36 = (this.getChild("n36"));
  13624. this.n37 = (this.getChild("n37"));
  13625. this.n38 = (this.getChild("n38"));
  13626. this.n39 = (this.getChild("n39"));
  13627. this.n40 = (this.getChild("n40"));
  13628. }
  13629. }
  13630. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13631. class ui_ranking_com10 extends fgui.GComponent {
  13632. static createInstance() {
  13633. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13634. }
  13635. onConstruct() {
  13636. this.n23 = (this.getChild("n23"));
  13637. this.n24 = (this.getChild("n24"));
  13638. }
  13639. }
  13640. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13641. class ui_ranking_com11 extends fgui.GComponent {
  13642. static createInstance() {
  13643. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13644. }
  13645. onConstruct() {
  13646. this.n24 = (this.getChild("n24"));
  13647. this.n25 = (this.getChild("n25"));
  13648. this.t0 = this.getTransition("t0");
  13649. }
  13650. }
  13651. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13652. class ui_ranking_com13 extends fgui.GButton {
  13653. static createInstance() {
  13654. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13655. }
  13656. onConstruct() {
  13657. this.c1 = this.getController("c1");
  13658. this.n44 = (this.getChild("n44"));
  13659. this.n45 = (this.getChild("n45"));
  13660. this.n46 = (this.getChild("n46"));
  13661. }
  13662. }
  13663. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13664. class ui_Component122 extends fgui.GComponent {
  13665. static createInstance() {
  13666. return (fgui.UIPackage.createObject("game", "Component122"));
  13667. }
  13668. onConstruct() {
  13669. this.gameNode3 = (this.getChild("gameNode3"));
  13670. }
  13671. }
  13672. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13673. class ui_skillItem extends fgui.GComponent {
  13674. static createInstance() {
  13675. return (fgui.UIPackage.createObject("game", "skillItem"));
  13676. }
  13677. onConstruct() {
  13678. this.c1 = this.getController("c1");
  13679. this.n31 = (this.getChild("n31"));
  13680. this.n6 = (this.getChild("n6"));
  13681. this.skillImg = (this.getChild("skillImg"));
  13682. this.nameTxt = (this.getChild("nameTxt"));
  13683. this.levelTxt = (this.getChild("levelTxt"));
  13684. this.n28 = (this.getChild("n28"));
  13685. this.describeTxt = (this.getChild("describeTxt"));
  13686. this.n32 = (this.getChild("n32"));
  13687. this.mutiBtn = (this.getChild("mutiBtn"));
  13688. this.tryNode = (this.getChild("tryNode"));
  13689. this.normalBtn = (this.getChild("normalBtn"));
  13690. this.startBtn = (this.getChild("startBtn"));
  13691. this.n42 = (this.getChild("n42"));
  13692. this.n43 = (this.getChild("n43"));
  13693. this.n44 = (this.getChild("n44"));
  13694. }
  13695. }
  13696. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13697. class ui_Component26 extends fgui.GButton {
  13698. static createInstance() {
  13699. return (fgui.UIPackage.createObject("game", "Component26"));
  13700. }
  13701. onConstruct() {
  13702. this.n11 = (this.getChild("n11"));
  13703. this.n30 = (this.getChild("n30"));
  13704. this.n34 = (this.getChild("n34"));
  13705. }
  13706. }
  13707. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13708. class ui_Component28 extends fgui.GButton {
  13709. static createInstance() {
  13710. return (fgui.UIPackage.createObject("game", "Component28"));
  13711. }
  13712. onConstruct() {
  13713. this.n12 = (this.getChild("n12"));
  13714. this.n31 = (this.getChild("n31"));
  13715. this.curTxt = (this.getChild("curTxt"));
  13716. this.n33 = (this.getChild("n33"));
  13717. }
  13718. }
  13719. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13720. class ui_Component1302 extends fgui.GComponent {
  13721. static createInstance() {
  13722. return (fgui.UIPackage.createObject("game", "Component1302"));
  13723. }
  13724. onConstruct() {
  13725. this.n2 = (this.getChild("n2"));
  13726. this.n3 = (this.getChild("n3"));
  13727. }
  13728. }
  13729. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13730. class ui_Component113 extends fgui.GComponent {
  13731. static createInstance() {
  13732. return (fgui.UIPackage.createObject("game", "Component113"));
  13733. }
  13734. onConstruct() {
  13735. this.n85 = (this.getChild("n85"));
  13736. this.n86 = (this.getChild("n86"));
  13737. this.n77 = (this.getChild("n77"));
  13738. this.n79 = (this.getChild("n79"));
  13739. this.n80 = (this.getChild("n80"));
  13740. this.n81 = (this.getChild("n81"));
  13741. this.n82 = (this.getChild("n82"));
  13742. this.n84 = (this.getChild("n84"));
  13743. this.n87 = (this.getChild("n87"));
  13744. this.t0 = this.getTransition("t0");
  13745. }
  13746. }
  13747. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13748. class ui_Component114 extends fgui.GComponent {
  13749. static createInstance() {
  13750. return (fgui.UIPackage.createObject("game", "Component114"));
  13751. }
  13752. onConstruct() {
  13753. this.n77 = (this.getChild("n77"));
  13754. this.t0 = this.getTransition("t0");
  13755. }
  13756. }
  13757. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13758. class ui_Component115 extends fgui.GComponent {
  13759. static createInstance() {
  13760. return (fgui.UIPackage.createObject("game", "Component115"));
  13761. }
  13762. onConstruct() {
  13763. this.n83 = (this.getChild("n83"));
  13764. this.fingerNode = (this.getChild("fingerNode"));
  13765. this.n84 = (this.getChild("n84"));
  13766. }
  13767. }
  13768. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13769. class ui_Component117 extends fgui.GComponent {
  13770. static createInstance() {
  13771. return (fgui.UIPackage.createObject("game", "Component117"));
  13772. }
  13773. onConstruct() {
  13774. this.n87 = (this.getChild("n87"));
  13775. this.n88 = (this.getChild("n88"));
  13776. this.n84 = (this.getChild("n84"));
  13777. this.n85 = (this.getChild("n85"));
  13778. this.n86 = (this.getChild("n86"));
  13779. this.t0 = this.getTransition("t0");
  13780. }
  13781. }
  13782. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13783. class ui_Component98_1 extends fgui.GButton {
  13784. static createInstance() {
  13785. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13786. }
  13787. onConstruct() {
  13788. this.c1 = this.getController("c1");
  13789. this.n8 = (this.getChild("n8"));
  13790. this.n41 = (this.getChild("n41"));
  13791. this.n40 = (this.getChild("n40"));
  13792. }
  13793. }
  13794. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13795. class ui_Component61 extends fgui.GComponent {
  13796. static createInstance() {
  13797. return (fgui.UIPackage.createObject("game", "Component61"));
  13798. }
  13799. onConstruct() {
  13800. this.n14 = (this.getChild("n14"));
  13801. this.n6 = (this.getChild("n6"));
  13802. this.t0 = this.getTransition("t0");
  13803. }
  13804. }
  13805. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13806. class ui_Component62 extends fgui.GComponent {
  13807. static createInstance() {
  13808. return (fgui.UIPackage.createObject("game", "Component62"));
  13809. }
  13810. onConstruct() {
  13811. this.n66 = (this.getChild("n66"));
  13812. this.n56 = (this.getChild("n56"));
  13813. this.n63 = (this.getChild("n63"));
  13814. this.n65 = (this.getChild("n65"));
  13815. this.t0 = this.getTransition("t0");
  13816. }
  13817. }
  13818. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13819. class ui_d3Root extends fgui.GComponent {
  13820. static createInstance() {
  13821. return (fgui.UIPackage.createObject("game", "d3Root"));
  13822. }
  13823. onConstruct() {
  13824. }
  13825. }
  13826. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13827. class ui_d2Root extends fgui.GComponent {
  13828. static createInstance() {
  13829. return (fgui.UIPackage.createObject("game", "d2Root"));
  13830. }
  13831. onConstruct() {
  13832. }
  13833. }
  13834. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13835. class ui_ballNode extends fgui.GComponent {
  13836. static createInstance() {
  13837. return (fgui.UIPackage.createObject("game", "ballNode"));
  13838. }
  13839. onConstruct() {
  13840. }
  13841. }
  13842. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13843. class ui_border extends fgui.GComponent {
  13844. static createInstance() {
  13845. return (fgui.UIPackage.createObject("game", "border"));
  13846. }
  13847. onConstruct() {
  13848. this.bar1 = (this.getChild("bar1"));
  13849. this.bar2 = (this.getChild("bar2"));
  13850. this.bar3 = (this.getChild("bar3"));
  13851. this.bar4 = (this.getChild("bar4"));
  13852. this.bar5 = (this.getChild("bar5"));
  13853. this.bar6 = (this.getChild("bar6"));
  13854. this.circle1 = (this.getChild("circle1"));
  13855. this.circle2 = (this.getChild("circle2"));
  13856. this.circle3 = (this.getChild("circle3"));
  13857. this.circle4 = (this.getChild("circle4"));
  13858. this.circle5 = (this.getChild("circle5"));
  13859. this.circle6 = (this.getChild("circle6"));
  13860. this.n28 = (this.getChild("n28"));
  13861. }
  13862. }
  13863. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13864. class ui_Component41_2 extends fgui.GComponent {
  13865. static createInstance() {
  13866. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13867. }
  13868. onConstruct() {
  13869. this.c1 = this.getController("c1");
  13870. this.n0 = (this.getChild("n0"));
  13871. this.n2 = (this.getChild("n2"));
  13872. this.n19 = (this.getChild("n19"));
  13873. this.cancelBtn = (this.getChild("cancelBtn"));
  13874. this.videoBtn = (this.getChild("videoBtn"));
  13875. this.n9 = (this.getChild("n9"));
  13876. this.n22 = (this.getChild("n22"));
  13877. this.tipsTxt = (this.getChild("tipsTxt"));
  13878. this.n23 = (this.getChild("n23"));
  13879. this.n24 = (this.getChild("n24"));
  13880. this.n26 = (this.getChild("n26"));
  13881. this.n27 = (this.getChild("n27"));
  13882. this.titleTxt = (this.getChild("titleTxt"));
  13883. }
  13884. }
  13885. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13886. class ui_Component41_1 extends fgui.GComponent {
  13887. static createInstance() {
  13888. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13889. }
  13890. onConstruct() {
  13891. this.c1 = this.getController("c1");
  13892. this.n0 = (this.getChild("n0"));
  13893. this.n2 = (this.getChild("n2"));
  13894. this.cancelBtn = (this.getChild("cancelBtn"));
  13895. this.videoBtn = (this.getChild("videoBtn"));
  13896. this.n27 = (this.getChild("n27"));
  13897. this.n30 = (this.getChild("n30"));
  13898. this.n31 = (this.getChild("n31"));
  13899. this.n32 = (this.getChild("n32"));
  13900. this.n33 = (this.getChild("n33"));
  13901. this.n34 = (this.getChild("n34"));
  13902. this.n35 = (this.getChild("n35"));
  13903. this.n36 = (this.getChild("n36"));
  13904. this.n1 = (this.getChild("n1"));
  13905. this.n37 = (this.getChild("n37"));
  13906. this.t0 = this.getTransition("t0");
  13907. this.t1 = this.getTransition("t1");
  13908. this.t2 = this.getTransition("t2");
  13909. this.t3 = this.getTransition("t3");
  13910. }
  13911. }
  13912. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13913. class ui_againBtn extends fgui.GButton {
  13914. static createInstance() {
  13915. return (fgui.UIPackage.createObject("game", "againBtn"));
  13916. }
  13917. onConstruct() {
  13918. this.n2 = (this.getChild("n2"));
  13919. this.n1 = (this.getChild("n1"));
  13920. this.n5 = (this.getChild("n5"));
  13921. }
  13922. }
  13923. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13924. class ui_Component118 extends fgui.GButton {
  13925. static createInstance() {
  13926. return (fgui.UIPackage.createObject("game", "Component118"));
  13927. }
  13928. onConstruct() {
  13929. this.c1 = this.getController("c1");
  13930. this.n14 = (this.getChild("n14"));
  13931. this.n9 = (this.getChild("n9"));
  13932. this.n10 = (this.getChild("n10"));
  13933. this.diamondTxt = (this.getChild("diamondTxt"));
  13934. this.n13 = (this.getChild("n13"));
  13935. this.n15 = (this.getChild("n15"));
  13936. }
  13937. }
  13938. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13939. class ui_Component119 extends fgui.GComponent {
  13940. static createInstance() {
  13941. return (fgui.UIPackage.createObject("game", "Component119"));
  13942. }
  13943. onConstruct() {
  13944. this.n1 = (this.getChild("n1"));
  13945. this.n2 = (this.getChild("n2"));
  13946. this.n13 = (this.getChild("n13"));
  13947. this.n6 = (this.getChild("n6"));
  13948. this.screenNode = (this.getChild("screenNode"));
  13949. this.n15 = (this.getChild("n15"));
  13950. this.closeBtn = (this.getChild("closeBtn"));
  13951. this.share2Btn = (this.getChild("share2Btn"));
  13952. this.shareBtn = (this.getChild("shareBtn"));
  13953. this.tipsNode = (this.getChild("tipsNode"));
  13954. this.awardNode = (this.getChild("awardNode"));
  13955. }
  13956. }
  13957. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13958. class ui_Component132_1 extends fgui.GComponent {
  13959. static createInstance() {
  13960. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13961. }
  13962. onConstruct() {
  13963. this.n25 = (this.getChild("n25"));
  13964. this.n26 = (this.getChild("n26"));
  13965. this.n27 = (this.getChild("n27"));
  13966. this.t0 = this.getTransition("t0");
  13967. }
  13968. }
  13969. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13970. class ui_SecretaryDisplay extends fgui.GComponent {
  13971. static createInstance() {
  13972. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13973. }
  13974. onConstruct() {
  13975. this.n2 = (this.getChild("n2"));
  13976. this.levelTxt = (this.getChild("levelTxt"));
  13977. this.n4 = (this.getChild("n4"));
  13978. this.secretary = (this.getChild("secretary"));
  13979. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13980. this.n16 = (this.getChild("n16"));
  13981. this.n37 = (this.getChild("n37"));
  13982. this.n41 = (this.getChild("n41"));
  13983. this.n14 = (this.getChild("n14"));
  13984. this.n17 = (this.getChild("n17"));
  13985. this.heightTxt = (this.getChild("heightTxt"));
  13986. this.n46 = (this.getChild("n46"));
  13987. this.n36 = (this.getChild("n36"));
  13988. this.n38 = (this.getChild("n38"));
  13989. this.foodTxt = (this.getChild("foodTxt"));
  13990. this.n47 = (this.getChild("n47"));
  13991. this.n40 = (this.getChild("n40"));
  13992. this.n42 = (this.getChild("n42"));
  13993. this.historyTxt = (this.getChild("historyTxt"));
  13994. this.n48 = (this.getChild("n48"));
  13995. this.nameImg = (this.getChild("nameImg"));
  13996. this.n12 = (this.getChild("n12"));
  13997. this.n49 = (this.getChild("n49"));
  13998. this.t0 = this.getTransition("t0");
  13999. }
  14000. }
  14001. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14002. class ui_BallRodDisplay extends fgui.GComponent {
  14003. static createInstance() {
  14004. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14005. }
  14006. onConstruct() {
  14007. this.c1 = this.getController("c1");
  14008. this.n31 = (this.getChild("n31"));
  14009. this.n6 = (this.getChild("n6"));
  14010. this.nameTxt = (this.getChild("nameTxt"));
  14011. this.rodImg = (this.getChild("rodImg"));
  14012. this.levelNode = (this.getChild("levelNode"));
  14013. this.eftRod = (this.getChild("eftRod"));
  14014. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14015. }
  14016. }
  14017. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14018. class ui_Component111_11 extends fgui.GComponent {
  14019. static createInstance() {
  14020. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14021. }
  14022. onConstruct() {
  14023. this.n68 = (this.getChild("n68"));
  14024. this.n69 = (this.getChild("n69"));
  14025. }
  14026. }
  14027. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14028. class ui_Component112 extends fgui.GComponent {
  14029. static createInstance() {
  14030. return (fgui.UIPackage.createObject("game", "Component112"));
  14031. }
  14032. onConstruct() {
  14033. this.n68 = (this.getChild("n68"));
  14034. this.n70 = (this.getChild("n70"));
  14035. this.myMask = (this.getChild("myMask"));
  14036. }
  14037. }
  14038. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14039. class ui_Component111 extends fgui.GComponent {
  14040. static createInstance() {
  14041. return (fgui.UIPackage.createObject("game", "Component111"));
  14042. }
  14043. onConstruct() {
  14044. this.n68 = (this.getChild("n68"));
  14045. this.myMask = (this.getChild("myMask"));
  14046. }
  14047. }
  14048. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14049. class ui_Component144 extends fgui.GButton {
  14050. static createInstance() {
  14051. return (fgui.UIPackage.createObject("game", "Component144"));
  14052. }
  14053. onConstruct() {
  14054. this.n8 = (this.getChild("n8"));
  14055. }
  14056. }
  14057. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14058. class ui_Sign_com2 extends fgui.GComponent {
  14059. static createInstance() {
  14060. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14061. }
  14062. onConstruct() {
  14063. this.n0 = (this.getChild("n0"));
  14064. this.n1 = (this.getChild("n1"));
  14065. this.t0 = this.getTransition("t0");
  14066. }
  14067. }
  14068. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14069. class ui_Sign_guang extends fgui.GComponent {
  14070. static createInstance() {
  14071. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14072. }
  14073. onConstruct() {
  14074. this.n1 = (this.getChild("n1"));
  14075. this.n2 = (this.getChild("n2"));
  14076. this.n3 = (this.getChild("n3"));
  14077. this.n4 = (this.getChild("n4"));
  14078. this.n5 = (this.getChild("n5"));
  14079. this.n6 = (this.getChild("n6"));
  14080. this.n8 = (this.getChild("n8"));
  14081. }
  14082. }
  14083. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14084. class ui_SignMax extends fgui.GComponent {
  14085. static createInstance() {
  14086. return (fgui.UIPackage.createObject("game", "SignMax"));
  14087. }
  14088. onConstruct() {
  14089. this.c1 = this.getController("c1");
  14090. this.n7 = (this.getChild("n7"));
  14091. this.n15 = (this.getChild("n15"));
  14092. this.n8 = (this.getChild("n8"));
  14093. this.titleTxt = (this.getChild("titleTxt"));
  14094. this.myIcon1 = (this.getChild("myIcon1"));
  14095. this.numTxt1 = (this.getChild("numTxt1"));
  14096. this.myIcon2 = (this.getChild("myIcon2"));
  14097. this.n20 = (this.getChild("n20"));
  14098. this.n17 = (this.getChild("n17"));
  14099. this.numTxt2 = (this.getChild("numTxt2"));
  14100. this.n12 = (this.getChild("n12"));
  14101. this.n13 = (this.getChild("n13"));
  14102. this.n21 = (this.getChild("n21"));
  14103. this.n14 = (this.getChild("n14"));
  14104. }
  14105. }
  14106. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14107. class ui_Sign_com2_1 extends fgui.GComponent {
  14108. static createInstance() {
  14109. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14110. }
  14111. onConstruct() {
  14112. this.n0 = (this.getChild("n0"));
  14113. this.n1 = (this.getChild("n1"));
  14114. this.t0 = this.getTransition("t0");
  14115. }
  14116. }
  14117. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14118. class ui_Sign_com5 extends fgui.GComponent {
  14119. static createInstance() {
  14120. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14121. }
  14122. onConstruct() {
  14123. this.n3 = (this.getChild("n3"));
  14124. this.n29 = (this.getChild("n29"));
  14125. this.n4 = (this.getChild("n4"));
  14126. this.day1 = (this.getChild("day1"));
  14127. this.day2 = (this.getChild("day2"));
  14128. this.day3 = (this.getChild("day3"));
  14129. this.day4 = (this.getChild("day4"));
  14130. this.day5 = (this.getChild("day5"));
  14131. this.day6 = (this.getChild("day6"));
  14132. this.day7 = (this.getChild("day7"));
  14133. this.t0 = this.getTransition("t0");
  14134. }
  14135. }
  14136. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14137. class ui_Sign_com8 extends fgui.GComponent {
  14138. static createInstance() {
  14139. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14140. }
  14141. onConstruct() {
  14142. this.n48 = (this.getChild("n48"));
  14143. this.womanTxt = (this.getChild("womanTxt"));
  14144. this.t0 = this.getTransition("t0");
  14145. }
  14146. }
  14147. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14148. class ui_Sign_com6 extends fgui.GComponent {
  14149. static createInstance() {
  14150. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14151. }
  14152. onConstruct() {
  14153. this.n2 = (this.getChild("n2"));
  14154. this.n3 = (this.getChild("n3"));
  14155. this.t0 = this.getTransition("t0");
  14156. }
  14157. }
  14158. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14159. class ui_Sign_com7 extends fgui.GComponent {
  14160. static createInstance() {
  14161. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14162. }
  14163. onConstruct() {
  14164. this.n29 = (this.getChild("n29"));
  14165. this.n2 = (this.getChild("n2"));
  14166. }
  14167. }
  14168. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14169. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14170. static createInstance() {
  14171. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14172. }
  14173. onConstruct() {
  14174. this.n5 = (this.getChild("n5"));
  14175. this.n4 = (this.getChild("n4"));
  14176. this.t0 = this.getTransition("t0");
  14177. }
  14178. }
  14179. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14180. class ui_UITurntable_com2 extends fgui.GComponent {
  14181. static createInstance() {
  14182. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14183. }
  14184. onConstruct() {
  14185. this.c1 = this.getController("c1");
  14186. this.n4 = (this.getChild("n4"));
  14187. this.n6 = (this.getChild("n6"));
  14188. this.n10 = (this.getChild("n10"));
  14189. this.n11 = (this.getChild("n11"));
  14190. this.n12 = (this.getChild("n12"));
  14191. this.n13 = (this.getChild("n13"));
  14192. this.n14 = (this.getChild("n14"));
  14193. this.n15 = (this.getChild("n15"));
  14194. this.n16 = (this.getChild("n16"));
  14195. this.n17 = (this.getChild("n17"));
  14196. this.n18 = (this.getChild("n18"));
  14197. this.n19 = (this.getChild("n19"));
  14198. this.n20 = (this.getChild("n20"));
  14199. this.n21 = (this.getChild("n21"));
  14200. this.n22 = (this.getChild("n22"));
  14201. this.n23 = (this.getChild("n23"));
  14202. this.n24 = (this.getChild("n24"));
  14203. this.n25 = (this.getChild("n25"));
  14204. this.n26 = (this.getChild("n26"));
  14205. this.n27 = (this.getChild("n27"));
  14206. this.n28 = (this.getChild("n28"));
  14207. this.n29 = (this.getChild("n29"));
  14208. this.n30 = (this.getChild("n30"));
  14209. this.n31 = (this.getChild("n31"));
  14210. this.n32 = (this.getChild("n32"));
  14211. this.n33 = (this.getChild("n33"));
  14212. }
  14213. }
  14214. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14215. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14216. static createInstance() {
  14217. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14218. }
  14219. onConstruct() {
  14220. this.n5 = (this.getChild("n5"));
  14221. this.n4 = (this.getChild("n4"));
  14222. this.t0 = this.getTransition("t0");
  14223. }
  14224. }
  14225. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14226. class ui_UITurntable_com5 extends fgui.GComponent {
  14227. static createInstance() {
  14228. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14229. }
  14230. onConstruct() {
  14231. this.flashNode = (this.getChild("flashNode"));
  14232. this.rotNode = (this.getChild("rotNode"));
  14233. this.n3 = (this.getChild("n3"));
  14234. this.n21 = (this.getChild("n21"));
  14235. this.t0 = this.getTransition("t0");
  14236. }
  14237. }
  14238. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14239. class ui_UITurntable_com7 extends fgui.GComponent {
  14240. static createInstance() {
  14241. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14242. }
  14243. onConstruct() {
  14244. this.n2 = (this.getChild("n2"));
  14245. this.n35 = (this.getChild("n35"));
  14246. this.img1 = (this.getChild("img1"));
  14247. this.img2 = (this.getChild("img2"));
  14248. this.img3 = (this.getChild("img3"));
  14249. this.img4 = (this.getChild("img4"));
  14250. this.img6 = (this.getChild("img6"));
  14251. this.img5 = (this.getChild("img5"));
  14252. this.txt1 = (this.getChild("txt1"));
  14253. this.txt2 = (this.getChild("txt2"));
  14254. this.txt3 = (this.getChild("txt3"));
  14255. this.txt4 = (this.getChild("txt4"));
  14256. this.txt5 = (this.getChild("txt5"));
  14257. this.txt6 = (this.getChild("txt6"));
  14258. }
  14259. }
  14260. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14261. class ui_UITurntable_com9 extends fgui.GComponent {
  14262. static createInstance() {
  14263. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14264. }
  14265. onConstruct() {
  14266. this.n38 = (this.getChild("n38"));
  14267. this.n39 = (this.getChild("n39"));
  14268. }
  14269. }
  14270. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14271. class ui_UITurntable_com10 extends fgui.GComponent {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14274. }
  14275. onConstruct() {
  14276. this.n39 = (this.getChild("n39"));
  14277. this.n40 = (this.getChild("n40"));
  14278. this.t0 = this.getTransition("t0");
  14279. }
  14280. }
  14281. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14282. class ui_UITurntable_com11 extends fgui.GComponent {
  14283. static createInstance() {
  14284. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14285. }
  14286. onConstruct() {
  14287. this.n38 = (this.getChild("n38"));
  14288. this.n39 = (this.getChild("n39"));
  14289. this.n40 = (this.getChild("n40"));
  14290. this.t0 = this.getTransition("t0");
  14291. }
  14292. }
  14293. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14294. class ui_UITurntable_com12 extends fgui.GComponent {
  14295. static createInstance() {
  14296. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14297. }
  14298. onConstruct() {
  14299. this.n43 = (this.getChild("n43"));
  14300. this.barNode = (this.getChild("barNode"));
  14301. this.tipsTxt = (this.getChild("tipsTxt"));
  14302. this.n45 = (this.getChild("n45"));
  14303. this.boxBtn = (this.getChild("boxBtn"));
  14304. }
  14305. }
  14306. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14307. class ui_UITurntable_com1 extends fgui.GButton {
  14308. static createInstance() {
  14309. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14310. }
  14311. onConstruct() {
  14312. this.n41 = (this.getChild("n41"));
  14313. this.n42 = (this.getChild("n42"));
  14314. this.t0 = this.getTransition("t0");
  14315. }
  14316. }
  14317. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14318. class ui_UITurntable_com3 extends fgui.GComponent {
  14319. static createInstance() {
  14320. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14321. }
  14322. onConstruct() {
  14323. this.n48 = (this.getChild("n48"));
  14324. this.womanTxt = (this.getChild("womanTxt"));
  14325. this.t0 = this.getTransition("t0");
  14326. }
  14327. }
  14328. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14329. class ui_cancelBtn2 extends fgui.GButton {
  14330. static createInstance() {
  14331. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14332. }
  14333. onConstruct() {
  14334. this.c1 = this.getController("c1");
  14335. this.n0 = (this.getChild("n0"));
  14336. this.n1 = (this.getChild("n1"));
  14337. this.n2 = (this.getChild("n2"));
  14338. this.n3 = (this.getChild("n3"));
  14339. this.n4 = (this.getChild("n4"));
  14340. this.n5 = (this.getChild("n5"));
  14341. this.n6 = (this.getChild("n6"));
  14342. this.n7 = (this.getChild("n7"));
  14343. this.n8 = (this.getChild("n8"));
  14344. this.powerEft = (this.getChild("powerEft"));
  14345. }
  14346. }
  14347. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14348. class ui_shareBtn2 extends fgui.GButton {
  14349. static createInstance() {
  14350. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14351. }
  14352. onConstruct() {
  14353. this.c1 = this.getController("c1");
  14354. this.n2 = (this.getChild("n2"));
  14355. this.n24 = (this.getChild("n24"));
  14356. this.n1 = (this.getChild("n1"));
  14357. this.n3 = (this.getChild("n3"));
  14358. this.n23 = (this.getChild("n23"));
  14359. this.n4 = (this.getChild("n4"));
  14360. this.n5 = (this.getChild("n5"));
  14361. this.n6 = (this.getChild("n6"));
  14362. this.n20 = (this.getChild("n20"));
  14363. this.n21 = (this.getChild("n21"));
  14364. this.n22 = (this.getChild("n22"));
  14365. this.powerEft = (this.getChild("powerEft"));
  14366. }
  14367. }
  14368. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14369. class ui_UIMoney extends fgui.GComponent {
  14370. static createInstance() {
  14371. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14372. }
  14373. onConstruct() {
  14374. this.c1 = this.getController("c1");
  14375. this.n4 = (this.getChild("n4"));
  14376. this.coinImg = (this.getChild("coinImg"));
  14377. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14378. this.coinTxt = (this.getChild("coinTxt"));
  14379. this.n7 = (this.getChild("n7"));
  14380. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14381. this.diamondTxt = (this.getChild("diamondTxt"));
  14382. this.diamondImg = (this.getChild("diamondImg"));
  14383. this.n12 = (this.getChild("n12"));
  14384. this.powerImg = (this.getChild("powerImg"));
  14385. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14386. this.powerTxt = (this.getChild("powerTxt"));
  14387. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14388. }
  14389. }
  14390. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14391. class ui_backBtn extends fgui.GButton {
  14392. static createInstance() {
  14393. return (fgui.UIPackage.createObject("game", "backBtn"));
  14394. }
  14395. onConstruct() {
  14396. this.n0 = (this.getChild("n0"));
  14397. this.t0 = this.getTransition("t0");
  14398. this.t1 = this.getTransition("t1");
  14399. }
  14400. }
  14401. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14402. class ui_MoneyBtn extends fgui.GButton {
  14403. static createInstance() {
  14404. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14405. }
  14406. onConstruct() {
  14407. this.button = this.getController("button");
  14408. this.n0 = (this.getChild("n0"));
  14409. }
  14410. }
  14411. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14412. class ui_UIMoneyBtn extends fgui.GComponent {
  14413. static createInstance() {
  14414. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14415. }
  14416. onConstruct() {
  14417. this.n1 = (this.getChild("n1"));
  14418. this.closeBtn = (this.getChild("closeBtn"));
  14419. }
  14420. }
  14421. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14422. class ui_Component64 extends fgui.GComponent {
  14423. static createInstance() {
  14424. return (fgui.UIPackage.createObject("game", "Component64"));
  14425. }
  14426. onConstruct() {
  14427. this.n57 = (this.getChild("n57"));
  14428. this.n54 = (this.getChild("n54"));
  14429. this.n55 = (this.getChild("n55"));
  14430. this.n56 = (this.getChild("n56"));
  14431. this.t1 = this.getTransition("t1");
  14432. }
  14433. }
  14434. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14435. class ui_Component41_3 extends fgui.GComponent {
  14436. static createInstance() {
  14437. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14438. }
  14439. onConstruct() {
  14440. this.c1 = this.getController("c1");
  14441. this.n0 = (this.getChild("n0"));
  14442. this.n2 = (this.getChild("n2"));
  14443. this.cancelBtn = (this.getChild("cancelBtn"));
  14444. this.videoBtn = (this.getChild("videoBtn"));
  14445. this.n9 = (this.getChild("n9"));
  14446. this.n24 = (this.getChild("n24"));
  14447. this.n27 = (this.getChild("n27"));
  14448. this.titleTxt = (this.getChild("titleTxt"));
  14449. this.n28 = (this.getChild("n28"));
  14450. this.t0 = this.getTransition("t0");
  14451. }
  14452. }
  14453. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14454. class ui_dh_zs_4 extends fgui.GComponent {
  14455. static createInstance() {
  14456. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14457. }
  14458. onConstruct() {
  14459. this.n1 = (this.getChild("n1"));
  14460. this.n2 = (this.getChild("n2"));
  14461. this.n3 = (this.getChild("n3"));
  14462. this.n4 = (this.getChild("n4"));
  14463. this.n5 = (this.getChild("n5"));
  14464. this.n6 = (this.getChild("n6"));
  14465. this.n8 = (this.getChild("n8"));
  14466. this.t0 = this.getTransition("t0");
  14467. }
  14468. }
  14469. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14470. class ui_Component71_1 extends fgui.GButton {
  14471. static createInstance() {
  14472. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14473. }
  14474. onConstruct() {
  14475. this.n17 = (this.getChild("n17"));
  14476. this.t0 = this.getTransition("t0");
  14477. }
  14478. }
  14479. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14480. class ui_Component83 extends fgui.GComponent {
  14481. static createInstance() {
  14482. return (fgui.UIPackage.createObject("game", "Component83"));
  14483. }
  14484. onConstruct() {
  14485. this.c1 = this.getController("c1");
  14486. this.n17 = (this.getChild("n17"));
  14487. this.n19 = (this.getChild("n19"));
  14488. this.n20 = (this.getChild("n20"));
  14489. }
  14490. }
  14491. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14492. class ui_Component84 extends fgui.GComponent {
  14493. static createInstance() {
  14494. return (fgui.UIPackage.createObject("game", "Component84"));
  14495. }
  14496. onConstruct() {
  14497. this.c1 = this.getController("c1");
  14498. this.n4 = (this.getChild("n4"));
  14499. this.n22 = (this.getChild("n22"));
  14500. this.n23 = (this.getChild("n23"));
  14501. this.numTxt = (this.getChild("numTxt"));
  14502. this.n25 = (this.getChild("n25"));
  14503. this.n26 = (this.getChild("n26"));
  14504. }
  14505. }
  14506. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14507. class ui_Component84_1 extends fgui.GComponent {
  14508. static createInstance() {
  14509. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14510. }
  14511. onConstruct() {
  14512. this.c1 = this.getController("c1");
  14513. this.n4 = (this.getChild("n4"));
  14514. this.n22 = (this.getChild("n22"));
  14515. this.n23 = (this.getChild("n23"));
  14516. this.numTxt = (this.getChild("numTxt"));
  14517. this.n25 = (this.getChild("n25"));
  14518. this.n26 = (this.getChild("n26"));
  14519. }
  14520. }
  14521. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14522. class ui_Component85 extends fgui.GComponent {
  14523. static createInstance() {
  14524. return (fgui.UIPackage.createObject("game", "Component85"));
  14525. }
  14526. onConstruct() {
  14527. this.n1 = (this.getChild("n1"));
  14528. this.n6 = (this.getChild("n6"));
  14529. this.n2 = (this.getChild("n2"));
  14530. this.n3 = (this.getChild("n3"));
  14531. this.levelTxt = (this.getChild("levelTxt"));
  14532. this.n10 = (this.getChild("n10"));
  14533. this.n11 = (this.getChild("n11"));
  14534. this.n12 = (this.getChild("n12"));
  14535. this.n13 = (this.getChild("n13"));
  14536. this.n14 = (this.getChild("n14"));
  14537. this.modeNode = (this.getChild("modeNode"));
  14538. this.n18 = (this.getChild("n18"));
  14539. this.conditionTxt = (this.getChild("conditionTxt"));
  14540. this.diamondNode = (this.getChild("diamondNode"));
  14541. this.coinNode = (this.getChild("coinNode"));
  14542. this.startBtn = (this.getChild("startBtn"));
  14543. this.n28 = (this.getChild("n28"));
  14544. this.displayRoot = (this.getChild("displayRoot"));
  14545. this.t0 = this.getTransition("t0");
  14546. }
  14547. }
  14548. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14549. class ui_Component86 extends fgui.GButton {
  14550. static createInstance() {
  14551. return (fgui.UIPackage.createObject("game", "Component86"));
  14552. }
  14553. onConstruct() {
  14554. this.n15 = (this.getChild("n15"));
  14555. this.t0 = this.getTransition("t0");
  14556. }
  14557. }
  14558. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14559. class ui_Component87 extends fgui.GComponent {
  14560. static createInstance() {
  14561. return (fgui.UIPackage.createObject("game", "Component87"));
  14562. }
  14563. onConstruct() {
  14564. this.n66 = (this.getChild("n66"));
  14565. this.myProgress = (this.getChild("myProgress"));
  14566. this.starAni = (this.getChild("starAni"));
  14567. this.hpTxt = (this.getChild("hpTxt"));
  14568. this.n74 = (this.getChild("n74"));
  14569. this.n73 = (this.getChild("n73"));
  14570. this.ballTxt = (this.getChild("ballTxt"));
  14571. this.n76 = (this.getChild("n76"));
  14572. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14573. this.levelTxt = (this.getChild("levelTxt"));
  14574. this.star1 = (this.getChild("star1"));
  14575. this.star2 = (this.getChild("star2"));
  14576. this.star3 = (this.getChild("star3"));
  14577. }
  14578. }
  14579. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14580. class ui_Component88 extends fgui.GProgressBar {
  14581. static createInstance() {
  14582. return (fgui.UIPackage.createObject("game", "Component88"));
  14583. }
  14584. onConstruct() {
  14585. this.n68 = (this.getChild("n68"));
  14586. this.bar = (this.getChild("bar"));
  14587. }
  14588. }
  14589. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14590. class ui_Component89 extends fgui.GComponent {
  14591. static createInstance() {
  14592. return (fgui.UIPackage.createObject("game", "Component89"));
  14593. }
  14594. onConstruct() {
  14595. this.c1 = this.getController("c1");
  14596. this.n71 = (this.getChild("n71"));
  14597. this.n72 = (this.getChild("n72"));
  14598. }
  14599. }
  14600. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14601. class ui_Component90 extends fgui.GComponent {
  14602. static createInstance() {
  14603. return (fgui.UIPackage.createObject("game", "Component90"));
  14604. }
  14605. onConstruct() {
  14606. this.c1 = this.getController("c1");
  14607. this.n64 = (this.getChild("n64"));
  14608. this.n65 = (this.getChild("n65"));
  14609. this.n66 = (this.getChild("n66"));
  14610. this.t0 = this.getTransition("t0");
  14611. }
  14612. }
  14613. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14614. class ui_Component127 extends fgui.GButton {
  14615. static createInstance() {
  14616. return (fgui.UIPackage.createObject("game", "Component127"));
  14617. }
  14618. onConstruct() {
  14619. this.n5 = (this.getChild("n5"));
  14620. }
  14621. }
  14622. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14623. class gameBinder {
  14624. static bindAll() {
  14625. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14626. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14627. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14628. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14629. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14630. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14631. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14632. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14633. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14634. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14635. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14636. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14637. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14638. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14639. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14640. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14641. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14642. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14643. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14644. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14645. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14646. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14647. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14648. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14649. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14650. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14651. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14652. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14653. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14654. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14655. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14656. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14657. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14658. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14659. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14660. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14661. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14662. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14663. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14664. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14665. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14666. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14667. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14668. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14669. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14670. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14671. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14672. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14673. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14674. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14675. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14676. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14677. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14678. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14679. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14680. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14681. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14682. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14683. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14684. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14685. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14686. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14687. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14688. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14689. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14690. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14691. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14692. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14693. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14694. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14695. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14696. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14697. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14698. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14699. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14700. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14701. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14702. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14703. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14704. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14705. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14706. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14707. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14708. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14709. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14710. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14711. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14712. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14713. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14714. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14715. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14716. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14717. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14718. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14719. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14720. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14721. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14722. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14723. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14724. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14725. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14726. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14727. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14728. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14729. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14730. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14731. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14732. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14733. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14734. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14735. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14736. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14737. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14738. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14739. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14740. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14741. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14742. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14743. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14744. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14745. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14746. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14747. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14748. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14749. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14750. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14751. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14752. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14753. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14754. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14755. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14756. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14757. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14758. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14759. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14760. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14761. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14762. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14763. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14764. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14765. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14766. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14767. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14768. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14769. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14770. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14771. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14772. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14773. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14774. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14775. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14776. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14777. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14778. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14779. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14780. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14781. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14782. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14783. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14784. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14785. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14786. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14787. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14788. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14789. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14790. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14791. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14792. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14793. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14794. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14795. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14796. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14797. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14798. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14799. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14800. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14801. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14802. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14803. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14804. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14805. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14806. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14807. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14808. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14809. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14810. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14811. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14812. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14813. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14814. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14815. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14816. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14817. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14818. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14819. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14820. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14821. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14822. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14823. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14824. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14825. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14826. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14827. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14828. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14829. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14830. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14831. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14832. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14833. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14834. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14835. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14836. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14837. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14838. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14839. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14840. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14841. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14842. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14843. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14844. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14845. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14846. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14847. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14848. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14849. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14850. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14851. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14852. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14853. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14854. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14855. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14856. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14857. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14858. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14859. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14860. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14861. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14862. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14863. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14864. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14865. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14866. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14867. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14868. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14869. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14870. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14871. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14872. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14873. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14874. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14875. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14876. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14877. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14878. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14879. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14880. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14881. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14882. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14883. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14884. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14885. }
  14886. }
  14887. class ui_btn6 extends fgui.GButton {
  14888. static createInstance() {
  14889. return (fgui.UIPackage.createObject("loading", "btn6"));
  14890. }
  14891. onConstruct() {
  14892. this.n6 = (this.getChild("n6"));
  14893. this.n1 = (this.getChild("n1"));
  14894. }
  14895. }
  14896. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14897. class ui_xyItem extends fgui.GComponent {
  14898. static createInstance() {
  14899. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14900. }
  14901. onConstruct() {
  14902. this.xyItem = (this.getChild("xyItem"));
  14903. }
  14904. }
  14905. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14906. class ui_loadinfo extends fgui.GProgressBar {
  14907. static createInstance() {
  14908. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14909. }
  14910. onConstruct() {
  14911. this.bg = (this.getChild("bg"));
  14912. this.bar = (this.getChild("bar"));
  14913. this.title = (this.getChild("title"));
  14914. this.ani = (this.getChild("ani"));
  14915. }
  14916. }
  14917. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14918. class ui_xyNode extends fgui.GComponent {
  14919. static createInstance() {
  14920. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14921. }
  14922. onConstruct() {
  14923. this.n0 = (this.getChild("n0"));
  14924. this.btnYes = (this.getChild("btnYes"));
  14925. this.btnNo = (this.getChild("btnNo"));
  14926. this.btnKnown = (this.getChild("btnKnown"));
  14927. this.btnSure = (this.getChild("btnSure"));
  14928. this.txtWelcom = (this.getChild("txtWelcom"));
  14929. this.txtXy = (this.getChild("txtXy"));
  14930. this.n75 = (this.getChild("n75"));
  14931. this.btnXy1 = (this.getChild("btnXy1"));
  14932. this.btnXy3 = (this.getChild("btnXy3"));
  14933. this.btnXy2 = (this.getChild("btnXy2"));
  14934. this.n74 = (this.getChild("n74"));
  14935. this.xy1 = (this.getChild("xy1"));
  14936. this.txtTitle = (this.getChild("txtTitle"));
  14937. this.btnBack = (this.getChild("btnBack"));
  14938. this.xyList = (this.getChild("xyList"));
  14939. this.xy2 = (this.getChild("xy2"));
  14940. this.xyNode = (this.getChild("xyNode"));
  14941. }
  14942. }
  14943. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14944. class ui_ageNode extends fgui.GComponent {
  14945. static createInstance() {
  14946. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14947. }
  14948. onConstruct() {
  14949. this.n3 = (this.getChild("n3"));
  14950. this.n7 = (this.getChild("n7"));
  14951. this.n4 = (this.getChild("n4"));
  14952. this.btnAge = (this.getChild("btnAge"));
  14953. this.ageNode = (this.getChild("ageNode"));
  14954. }
  14955. }
  14956. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14957. class ui_rnNode extends fgui.GComponent {
  14958. static createInstance() {
  14959. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14960. }
  14961. onConstruct() {
  14962. this.n28 = (this.getChild("n28"));
  14963. this.n30 = (this.getChild("n30"));
  14964. this.n33 = (this.getChild("n33"));
  14965. this.rn1 = (this.getChild("rn1"));
  14966. this.n40 = (this.getChild("n40"));
  14967. this.n41 = (this.getChild("n41"));
  14968. this.rn3 = (this.getChild("rn3"));
  14969. this.n37 = (this.getChild("n37"));
  14970. this.n39 = (this.getChild("n39"));
  14971. this.rn2 = (this.getChild("rn2"));
  14972. this.n47 = (this.getChild("n47"));
  14973. this.n49 = (this.getChild("n49"));
  14974. this.n44 = (this.getChild("n44"));
  14975. this.inputCode = (this.getChild("inputCode"));
  14976. this.inputName = (this.getChild("inputName"));
  14977. this.n48 = (this.getChild("n48"));
  14978. this.n50 = (this.getChild("n50"));
  14979. this.rn4 = (this.getChild("rn4"));
  14980. this.btnCheck = (this.getChild("btnCheck"));
  14981. this.btnExit = (this.getChild("btnExit"));
  14982. this.btnDone = (this.getChild("btnDone"));
  14983. this.rnNode = (this.getChild("rnNode"));
  14984. }
  14985. }
  14986. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14987. class ui_tipNode extends fgui.GComponent {
  14988. static createInstance() {
  14989. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14990. }
  14991. onConstruct() {
  14992. this.bg = (this.getChild("bg"));
  14993. this.n55 = (this.getChild("n55"));
  14994. this.n56 = (this.getChild("n56"));
  14995. this.tipNode = (this.getChild("tipNode"));
  14996. }
  14997. }
  14998. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14999. class ui_fcmNode extends fgui.GComponent {
  15000. static createInstance() {
  15001. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15002. }
  15003. onConstruct() {
  15004. this.n63 = (this.getChild("n63"));
  15005. this.n62 = (this.getChild("n62"));
  15006. this.btnRn = (this.getChild("btnRn"));
  15007. this.n61 = (this.getChild("n61"));
  15008. this.n58 = (this.getChild("n58"));
  15009. this.fcmNode = (this.getChild("fcmNode"));
  15010. }
  15011. }
  15012. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15013. class ui_msgNode extends fgui.GComponent {
  15014. static createInstance() {
  15015. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15016. }
  15017. onConstruct() {
  15018. this.n69 = (this.getChild("n69"));
  15019. this.txtMsg = (this.getChild("txtMsg"));
  15020. this.msgNode = (this.getChild("msgNode"));
  15021. }
  15022. }
  15023. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15024. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15025. static createInstance() {
  15026. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15027. }
  15028. onConstruct() {
  15029. this.n1 = (this.getChild("n1"));
  15030. this.n13 = (this.getChild("n13"));
  15031. this.n14 = (this.getChild("n14"));
  15032. this.n15 = (this.getChild("n15"));
  15033. this.n3 = (this.getChild("n3"));
  15034. this.n4 = (this.getChild("n4"));
  15035. this.n5 = (this.getChild("n5"));
  15036. this.n6 = (this.getChild("n6"));
  15037. this.n7 = (this.getChild("n7"));
  15038. this.n8 = (this.getChild("n8"));
  15039. this.n9 = (this.getChild("n9"));
  15040. this.n10 = (this.getChild("n10"));
  15041. this.n12 = (this.getChild("n12"));
  15042. this.n11 = (this.getChild("n11"));
  15043. this.n16 = (this.getChild("n16"));
  15044. this.n17 = (this.getChild("n17"));
  15045. this.n18 = (this.getChild("n18"));
  15046. this.n20 = (this.getChild("n20"));
  15047. this.n21 = (this.getChild("n21"));
  15048. this.t0 = this.getTransition("t0");
  15049. }
  15050. }
  15051. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15052. class ui_btn5 extends fgui.GButton {
  15053. static createInstance() {
  15054. return (fgui.UIPackage.createObject("loading", "btn5"));
  15055. }
  15056. onConstruct() {
  15057. this.n9 = (this.getChild("n9"));
  15058. this.n1 = (this.getChild("n1"));
  15059. }
  15060. }
  15061. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15062. class ui_UILoading extends fgui.GComponent {
  15063. static createInstance() {
  15064. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15065. }
  15066. onConstruct() {
  15067. this.n12 = (this.getChild("n12"));
  15068. this.loadinfo = (this.getChild("loadinfo"));
  15069. this.n13 = (this.getChild("n13"));
  15070. this.txtLoad = (this.getChild("txtLoad"));
  15071. this.n18 = (this.getChild("n18"));
  15072. }
  15073. }
  15074. ui_UILoading.URL = "ui://37nctnhwphc33";
  15075. class ui_AgeItem extends fgui.GComponent {
  15076. static createInstance() {
  15077. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15078. }
  15079. onConstruct() {
  15080. this.txtAge = (this.getChild("txtAge"));
  15081. }
  15082. }
  15083. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15084. class ui_btn1 extends fgui.GButton {
  15085. static createInstance() {
  15086. return (fgui.UIPackage.createObject("loading", "btn1"));
  15087. }
  15088. onConstruct() {
  15089. this.n6 = (this.getChild("n6"));
  15090. this.n1 = (this.getChild("n1"));
  15091. }
  15092. }
  15093. ui_btn1.URL = "ui://37nctnhwxe622p";
  15094. class ui_btn3 extends fgui.GButton {
  15095. static createInstance() {
  15096. return (fgui.UIPackage.createObject("loading", "btn3"));
  15097. }
  15098. onConstruct() {
  15099. this.n9 = (this.getChild("n9"));
  15100. this.n1 = (this.getChild("n1"));
  15101. }
  15102. }
  15103. ui_btn3.URL = "ui://37nctnhwxe622s";
  15104. class ui_btn2 extends fgui.GButton {
  15105. static createInstance() {
  15106. return (fgui.UIPackage.createObject("loading", "btn2"));
  15107. }
  15108. onConstruct() {
  15109. this.n6 = (this.getChild("n6"));
  15110. this.n1 = (this.getChild("n1"));
  15111. }
  15112. }
  15113. ui_btn2.URL = "ui://37nctnhwxe622t";
  15114. class ui_btnBack extends fgui.GButton {
  15115. static createInstance() {
  15116. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15117. }
  15118. onConstruct() {
  15119. this.n6 = (this.getChild("n6"));
  15120. this.n7 = (this.getChild("n7"));
  15121. }
  15122. }
  15123. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15124. class ui_btnXy1 extends fgui.GButton {
  15125. static createInstance() {
  15126. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15127. }
  15128. onConstruct() {
  15129. this.n1 = (this.getChild("n1"));
  15130. }
  15131. }
  15132. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15133. class ui_btnXy2 extends fgui.GButton {
  15134. static createInstance() {
  15135. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15136. }
  15137. onConstruct() {
  15138. this.n1 = (this.getChild("n1"));
  15139. }
  15140. }
  15141. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15142. class ui_btnXy3 extends fgui.GButton {
  15143. static createInstance() {
  15144. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15145. }
  15146. onConstruct() {
  15147. this.n1 = (this.getChild("n1"));
  15148. }
  15149. }
  15150. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15151. class ui_btn4 extends fgui.GButton {
  15152. static createInstance() {
  15153. return (fgui.UIPackage.createObject("loading", "btn4"));
  15154. }
  15155. onConstruct() {
  15156. this.n9 = (this.getChild("n9"));
  15157. this.n1 = (this.getChild("n1"));
  15158. }
  15159. }
  15160. ui_btn4.URL = "ui://37nctnhwxe622z";
  15161. class loadingBinder {
  15162. static bindAll() {
  15163. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15164. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15165. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15166. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15167. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15168. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15169. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15170. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15171. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15172. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15173. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15174. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15175. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15176. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15177. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15178. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15179. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15180. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15181. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15182. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15183. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15184. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15185. }
  15186. }
  15187. class UIMgr {
  15188. constructor() {
  15189. this._stage = null;
  15190. this._uiList = [];
  15191. this._showList = [];
  15192. this._bindPkgList = [];
  15193. this.uiIndex = 0;
  15194. }
  15195. static get inst() {
  15196. if (UIMgr._inst == null) {
  15197. UIMgr._inst = new UIMgr();
  15198. }
  15199. return UIMgr._inst;
  15200. }
  15201. setStage(s) {
  15202. if (this._stage) {
  15203. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15204. return;
  15205. }
  15206. this._stage = s;
  15207. }
  15208. clearTempData() {
  15209. console.log('zh:clearTempData start');
  15210. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15211. console.log('zh:clearTempData end');
  15212. }
  15213. init() {
  15214. this.setStage(Laya.stage);
  15215. fairygui.UIConfig.defaultFont = "微软雅黑";
  15216. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15217. fairygui.UIConfig.packageFileExtension = "obj";
  15218. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15219. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15220. fairygui.GRoot.inst.width = Laya.stage.width;
  15221. fairygui.GRoot.inst.height = Laya.stage.height;
  15222. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15223. }
  15224. addAllUpdate() {
  15225. this.uiIndex = 0;
  15226. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15227. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15228. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15229. }
  15230. }
  15231. }
  15232. bindFUI(pkgname) {
  15233. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15234. return;
  15235. }
  15236. switch (pkgname) {
  15237. case fguiRes.loading:
  15238. fairygui.UIPackage.addPackage(pkgname);
  15239. loadingBinder.bindAll();
  15240. this._bindPkgList.push(pkgname);
  15241. break;
  15242. case fguiRes.game:
  15243. fairygui.UIPackage.addPackage(pkgname);
  15244. gameBinder.bindAll();
  15245. this._bindPkgList.push(pkgname);
  15246. break;
  15247. default:
  15248. break;
  15249. }
  15250. }
  15251. Show(cls, ...param) {
  15252. let nameStr = cls.uiName;
  15253. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15254. let temp = this._uiList[i];
  15255. let str = temp.className;
  15256. if (str == nameStr) {
  15257. if (temp.isMuti) {
  15258. if (temp.isHide) {
  15259. temp.show(...param);
  15260. this._uiList.splice(i, 1);
  15261. this._uiList.push(temp);
  15262. return temp;
  15263. }
  15264. }
  15265. else {
  15266. temp.show(...param);
  15267. this._uiList.splice(i, 1);
  15268. this._uiList.push(temp);
  15269. return temp;
  15270. }
  15271. }
  15272. }
  15273. let ui = new cls();
  15274. ui.className = nameStr;
  15275. this._showUI(ui, param);
  15276. return ui;
  15277. }
  15278. destroyUI(ui) {
  15279. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15280. let temp = this._uiList[i].className;
  15281. if (temp == ui.className) {
  15282. this._uiList.splice(i, 1);
  15283. break;
  15284. }
  15285. }
  15286. this.checkUIState();
  15287. }
  15288. _showUI(ui, param) {
  15289. this._uiList.push(ui);
  15290. ui.show(...param);
  15291. }
  15292. Hide(uiClass) {
  15293. let ui = this.getUI(uiClass);
  15294. if (ui && !ui.isHide) {
  15295. ui.hide();
  15296. }
  15297. }
  15298. getUI(ui) {
  15299. let nameStr = ui.uiName;
  15300. for (let index = 0; index < this._uiList.length; index++) {
  15301. let temp = this._uiList[index];
  15302. if (temp.className == nameStr) {
  15303. return temp;
  15304. }
  15305. }
  15306. return null;
  15307. }
  15308. isShow(cls) {
  15309. for (var i of this._uiList) {
  15310. if (i instanceof cls) {
  15311. return i.isShowing;
  15312. }
  15313. }
  15314. return false;
  15315. }
  15316. showUINum() {
  15317. let num = 0;
  15318. for (var i of this._uiList) {
  15319. if (i.isShowing) {
  15320. num++;
  15321. }
  15322. }
  15323. return num;
  15324. }
  15325. checkUIState() {
  15326. Laya.timer.clear(this, this._uiCheck);
  15327. Laya.timer.once(400, this, this._uiCheck);
  15328. }
  15329. _uiCheck() {
  15330. let showList = [];
  15331. for (var i of this._uiList) {
  15332. if (!i.isHide) {
  15333. showList.push(i);
  15334. }
  15335. }
  15336. for (let index = 0; index < showList.length; index++) {
  15337. if (index == showList.length - 1) {
  15338. showList[index].checkActive(true);
  15339. }
  15340. else {
  15341. showList[index].checkActive(false);
  15342. }
  15343. }
  15344. }
  15345. showTip(msg, time = 600, size = 30) {
  15346. }
  15347. }
  15348. class UIShowList {
  15349. }
  15350. class SoundMgr {
  15351. constructor() {
  15352. this.soundMax = 4;
  15353. this.isLoad = false;
  15354. this.soundMap = {};
  15355. this.isSound = true;
  15356. this.openShake = true;
  15357. SoundMgr._instance = this;
  15358. }
  15359. static getInstance() {
  15360. if (!this._instance) {
  15361. this._instance = new SoundMgr();
  15362. }
  15363. return this._instance;
  15364. }
  15365. init() {
  15366. console.log('zh:sm init 1');
  15367. Laya.SoundManager.autoReleaseSound = true;
  15368. Laya.SoundManager.autoStopMusic = true;
  15369. Laya.SoundManager.musicVolume = 0.3;
  15370. Laya.SoundManager.soundVolume = 0.5;
  15371. this.musicPlayed = false;
  15372. this.audioUrl = "asset/sound/ogg/";
  15373. console.log('zh:sm init 2');
  15374. console.log('zh:dev type ');
  15375. if (Laya.Browser.onAndroid) {
  15376. console.log('zh:dev type android');
  15377. this.audioUrl = "asset/sound/ogg/";
  15378. this.isLoad = true;
  15379. }
  15380. else {
  15381. console.log('zh:dev type not android');
  15382. this.audioUrl = "asset/sound/mp3/";
  15383. this.isLoad = true;
  15384. }
  15385. }
  15386. onSetting(isS) {
  15387. this.isSound = isS;
  15388. this.mute(!this.isSound);
  15389. }
  15390. clearCount() {
  15391. for (var key in this.soundMap) {
  15392. delete this.soundMap[key];
  15393. }
  15394. }
  15395. playMusic(path, loop = 0) {
  15396. console.log('zh:playMusic 1 PATH=' + path);
  15397. this.musicPath = path;
  15398. if (!this.isLoad)
  15399. console.log('zh:playMusic 2');
  15400. return;
  15401. if (!path || path == "")
  15402. console.log('zh:playMusic 3');
  15403. return;
  15404. if (!this.isSound)
  15405. console.log('zh:playMusic 4');
  15406. return;
  15407. this.musicPlayed = true;
  15408. console.log('zh:playMusic 5');
  15409. let url = this.getUrl(path);
  15410. console.log('zh:playMusic 6' + url);
  15411. if (Laya.Browser.onPC) {
  15412. console.log('zh:playMusic 7');
  15413. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15414. console.log('zh:playMusic 8');
  15415. this.play(url, loop);
  15416. }));
  15417. }
  15418. else
  15419. this.play(url, loop);
  15420. }
  15421. play(url, loop) {
  15422. Laya.SoundManager.playMusic(url, loop);
  15423. }
  15424. getUrl(path) {
  15425. let url = this.audioUrl + path;
  15426. if (Laya.Browser.onAndroid) {
  15427. url += ".ogg";
  15428. }
  15429. else {
  15430. url += ".mp3";
  15431. }
  15432. return url;
  15433. }
  15434. pauseMusic(pause) {
  15435. if (pause) {
  15436. this.mute(true);
  15437. }
  15438. else if (this.isSound)
  15439. this.mute(false);
  15440. }
  15441. stopMusic() {
  15442. Laya.SoundManager.stopMusic();
  15443. if (Moyu.isNeedPlatAudio) {
  15444. Moyu.stopMusic();
  15445. }
  15446. }
  15447. mute(mute) {
  15448. if (Moyu.isNeedPlatAudio) {
  15449. Moyu.pauseMusic(mute);
  15450. }
  15451. else {
  15452. Laya.SoundManager.musicMuted = mute;
  15453. if (!mute && !this.musicPlayed && this.musicPath) {
  15454. this.playMusic(this.musicPath);
  15455. }
  15456. }
  15457. }
  15458. stopSound(path) {
  15459. let url = this.getUrl(path);
  15460. Laya.SoundManager.stopSound(url);
  15461. }
  15462. playSound(path, loop = 1, soundMax = this.soundMax) {
  15463. if (!this.isLoad)
  15464. return;
  15465. if (!this.isSound)
  15466. return;
  15467. if (!path || path == "")
  15468. return;
  15469. let url = this.getUrl(path);
  15470. if (Moyu.isNeedPlatAudio) {
  15471. Moyu.playSound(path, loop == 0);
  15472. }
  15473. else {
  15474. let count = 1;
  15475. if (this.soundMap[path])
  15476. count = this.soundMap[path] + 1;
  15477. if (count > soundMax)
  15478. return;
  15479. this.soundMap[path] = count;
  15480. Laya.SoundManager.playSound(url, loop);
  15481. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15482. }
  15483. }
  15484. removePath(path) {
  15485. if (this.soundMap[path]) {
  15486. let count = this.soundMap[path];
  15487. count--;
  15488. if (count < 1)
  15489. delete this.soundMap[path];
  15490. else
  15491. this.soundMap[path] = count;
  15492. }
  15493. }
  15494. playBtnSound() {
  15495. this.playSound("btn");
  15496. }
  15497. playGetSound() {
  15498. }
  15499. playCloseUISound() {
  15500. }
  15501. }
  15502. SoundMgr._instance = null;
  15503. var Handler$1 = Laya.Handler;
  15504. var EResType;
  15505. (function (EResType) {
  15506. EResType[EResType["none"] = 0] = "none";
  15507. EResType[EResType["nromal"] = 1] = "nromal";
  15508. EResType[EResType["td"] = 2] = "td";
  15509. EResType[EResType["sk"] = 3] = "sk";
  15510. })(EResType || (EResType = {}));
  15511. class CResLoader {
  15512. constructor(doneCall, proCall) {
  15513. this.completrCall = doneCall;
  15514. this.progressCall = proCall;
  15515. this.progressHander = new Handler$1(this, this.onProgress);
  15516. this.tdResMap = {};
  15517. }
  15518. load(resList) {
  15519. this.resCount = 0;
  15520. this.loadCount = 0;
  15521. for (let i = 0; i < resList.length; i++) {
  15522. let path = resList[i];
  15523. if (!path)
  15524. continue;
  15525. this.resCount++;
  15526. let type = this.getResType(path);
  15527. if (type == EResType.nromal)
  15528. this.loadNromal(path);
  15529. else if (type == EResType.td)
  15530. this.loadTd(path);
  15531. }
  15532. }
  15533. getRes(path) {
  15534. let type = this.getResType(path);
  15535. if (type == EResType.nromal)
  15536. return Laya.loader.getRes(path);
  15537. else if (type == EResType.td) {
  15538. let res = this.tdResMap[path];
  15539. if (res)
  15540. return res.clone();
  15541. return null;
  15542. }
  15543. }
  15544. destroy() {
  15545. this.progressHander.clear();
  15546. this.progressHander = null;
  15547. }
  15548. clearRes(path) {
  15549. let type = this.getResType(path);
  15550. if (type == EResType.nromal)
  15551. Laya.loader.clearRes(path);
  15552. else if (type == EResType.td) {
  15553. let obj = this.tdResMap[path];
  15554. if (obj)
  15555. obj.destroy();
  15556. delete this.tdResMap[path];
  15557. }
  15558. }
  15559. getResType(path) {
  15560. let exs = this.getExtension(path);
  15561. if (exs == "sk")
  15562. return EResType.sk;
  15563. if (exs == "ls" || exs == "lh" || exs == "lm")
  15564. return EResType.td;
  15565. else
  15566. return EResType.nromal;
  15567. }
  15568. getExtension(res) {
  15569. var index = res.lastIndexOf(".");
  15570. return res.substr(index + 1);
  15571. }
  15572. loadNromal(path) {
  15573. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15574. if (res) {
  15575. this.onLoad();
  15576. }
  15577. else
  15578. console.log("load res fail:" + path);
  15579. }), this.progressHander);
  15580. }
  15581. loadSk() {
  15582. }
  15583. loadTd(path) {
  15584. if (this.tdResMap[path]) {
  15585. this.onLoad();
  15586. return;
  15587. }
  15588. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15589. if (res) {
  15590. this.tdResMap[path] = res;
  15591. this.onLoad();
  15592. }
  15593. else
  15594. console.log("load res fail:" + path);
  15595. }));
  15596. }
  15597. onLoad() {
  15598. this.loadCount++;
  15599. this.onProgress(1);
  15600. if (this.loadCount >= this.resCount) {
  15601. this.completrCall.run();
  15602. }
  15603. }
  15604. onProgress(pro) {
  15605. let progress = (this.loadCount + pro) / this.resCount;
  15606. this.progressCall.runWith(progress);
  15607. }
  15608. }
  15609. var Handler$2 = Laya.Handler;
  15610. class ResInfo {
  15611. constructor() {
  15612. this.index = 0;
  15613. }
  15614. }
  15615. class ResMgr {
  15616. constructor() {
  15617. this.resList = [];
  15618. this.doneList = [];
  15619. this.resMap = {};
  15620. this.currentLoad = null;
  15621. this.completeHandler = new Handler$2(this, this.onComplete);
  15622. this.progressHandler = new Handler$2(this, this.onProgress);
  15623. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15624. }
  15625. static getInstance() {
  15626. if (ResMgr._instance == null) {
  15627. ResMgr._instance = new ResMgr();
  15628. }
  15629. return ResMgr._instance;
  15630. }
  15631. loadList(list, completeHandler, progressHandler) {
  15632. if (list.length < 1) {
  15633. completeHandler.run();
  15634. return;
  15635. }
  15636. let info = this.getResInfo();
  15637. info.resList = list;
  15638. info.completeHandler = completeHandler;
  15639. info.progressHandler = progressHandler;
  15640. this.resList.push(info);
  15641. this.startLoad();
  15642. }
  15643. loadFguiRes(list, completeHandler, progressHandler) {
  15644. Laya.loader.load(list, completeHandler, progressHandler);
  15645. }
  15646. loadAny(list, completeHandler, progressHandler) {
  15647. Laya.loader.load(list, completeHandler, progressHandler);
  15648. }
  15649. load(path, completeHandler, progressHandler) {
  15650. let count = this.resMap[path];
  15651. if (count && count > 0) {
  15652. if (completeHandler)
  15653. completeHandler.run();
  15654. }
  15655. else
  15656. this.loadList([path], completeHandler, progressHandler);
  15657. }
  15658. getRes(path) {
  15659. let res = this.resMap[path];
  15660. if (!res)
  15661. this.showLog("资源不存在:" + path);
  15662. else
  15663. return this.loader.getRes(path);
  15664. }
  15665. clearList(list, force = false) {
  15666. if (!list || list.length < 1)
  15667. return;
  15668. let cr = () => {
  15669. for (const k in list) {
  15670. let v = list[k];
  15671. if (!v)
  15672. continue;
  15673. if (force) {
  15674. this.loader.clearRes(v);
  15675. delete this.resMap[v];
  15676. }
  15677. else {
  15678. let count = this.resMap[v];
  15679. if (count && count > 1) {
  15680. count--;
  15681. this.resMap[v] = count;
  15682. }
  15683. else {
  15684. this.loader.clearRes(v);
  15685. delete this.resMap[v];
  15686. }
  15687. }
  15688. }
  15689. if (!window.hasOwnProperty("ks"))
  15690. Laya.Resource.destroyUnusedResources();
  15691. };
  15692. Laya.timer.clearAll(this);
  15693. Laya.timer.once(2000, this, cr);
  15694. }
  15695. clear3D() {
  15696. for (const k in this.loader.tdResMap) {
  15697. this.loader.clearRes(k);
  15698. if (this.resMap[k])
  15699. delete this.resMap[k];
  15700. }
  15701. if (!window.hasOwnProperty("ks"))
  15702. Laya.Resource.destroyUnusedResources();
  15703. }
  15704. clear(path, force = false) {
  15705. this.clearList([path], force);
  15706. }
  15707. getResInfo() {
  15708. if (this.doneList.length > 0)
  15709. return this.doneList.pop();
  15710. else
  15711. return new ResInfo();
  15712. }
  15713. startLoad() {
  15714. if (this.currentLoad)
  15715. return;
  15716. this.currentLoad = this.resList.pop();
  15717. if (this.currentLoad) {
  15718. this.loader.load(this.currentLoad.resList);
  15719. }
  15720. }
  15721. onComplete() {
  15722. if (!this.currentLoad)
  15723. return;
  15724. for (const k in this.currentLoad.resList) {
  15725. let v = this.currentLoad.resList[k];
  15726. let count = this.resMap[v];
  15727. if (count)
  15728. count++;
  15729. else
  15730. count = 1;
  15731. this.resMap[v] = count;
  15732. }
  15733. if (this.currentLoad.completeHandler)
  15734. this.currentLoad.completeHandler.run();
  15735. this.doneList.push(this.currentLoad);
  15736. this.currentLoad = null;
  15737. this.startLoad();
  15738. }
  15739. onProgress(pro) {
  15740. if (!this.currentLoad)
  15741. return;
  15742. if (this.currentLoad.progressHandler)
  15743. this.currentLoad.progressHandler.runWith(pro);
  15744. }
  15745. showLog(str, ...args) {
  15746. console.log("[ResLoader] " + str);
  15747. }
  15748. }
  15749. ResMgr._instance = null;
  15750. class EventMgr extends Laya.EventDispatcher {
  15751. }
  15752. let eventMgr = new EventMgr();
  15753. class ConfigMgr {
  15754. static getInstance() {
  15755. if (!this._instance) {
  15756. this._instance = new ConfigMgr();
  15757. }
  15758. return this._instance;
  15759. }
  15760. init() {
  15761. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15762. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15763. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15764. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15765. }
  15766. getUserInfoByIndex(index) {
  15767. return this.npcJson[index];
  15768. }
  15769. getRandomUserInfo() {
  15770. let index = xGame.tools.random(0, this.npcJson.length);
  15771. return this.npcJson[index];
  15772. }
  15773. getMaxBigMoveLength() {
  15774. return Object.keys(this.levelCfg).length;
  15775. }
  15776. getBigMoveLevelByIndex(index) {
  15777. let cfg = this.levelCfg;
  15778. cfg = cfg[index];
  15779. return cfg;
  15780. }
  15781. getRandomClassicLevel() {
  15782. let cfg = this.classicCfg;
  15783. let num = Object.keys(cfg).length;
  15784. let rand = xGame.common.randomNum(1, num);
  15785. return cfg[rand];
  15786. }
  15787. getPlaceBallByLevel(level) {
  15788. return this.placeBallCfg[level];
  15789. }
  15790. getMaxPlaceBall() {
  15791. return Object.keys(this.placeBallCfg).length;
  15792. }
  15793. }
  15794. class PoolD3Mgr {
  15795. constructor() {
  15796. this.pool = {};
  15797. }
  15798. static get ins() {
  15799. return this._ins || (this._ins = new PoolD3Mgr);
  15800. }
  15801. createList(key, prefab, parent) {
  15802. if (!this.pool[key]) {
  15803. this.pool[key] = {};
  15804. this.pool[key].prefab = prefab;
  15805. this.pool[key].list = [];
  15806. this.pool[key].parent = parent;
  15807. }
  15808. }
  15809. getItem(key) {
  15810. if (!this.pool[key]) {
  15811. return;
  15812. }
  15813. let temp;
  15814. if (this.pool[key].list.length > 0) {
  15815. temp = this.pool[key].list.pop();
  15816. }
  15817. else {
  15818. temp = this.pool[key].prefab.clone();
  15819. if (this.pool[key].parent) {
  15820. this.pool[key].parent.addChild(temp);
  15821. }
  15822. }
  15823. temp.active = true;
  15824. return temp;
  15825. }
  15826. putItem(key, obj) {
  15827. if (!this.pool[key]) {
  15828. return;
  15829. }
  15830. obj.active = false;
  15831. this.pool[key].list.push(obj);
  15832. }
  15833. }
  15834. let context$1 = context;
  15835. let uiMgr = UIMgr.inst;
  15836. let soundMgr = SoundMgr.getInstance();
  15837. let resMgr = ResMgr.getInstance();
  15838. let httpMgr = HttpMgr.getInstance();
  15839. let common = Common.getInstance();
  15840. let cfgMgr = ConfigMgr.getInstance();
  15841. let poolD3Mgr = PoolD3Mgr.ins;
  15842. let d3TexUrl = "res/d3Res/";
  15843. let d3ModeUrl = "res/unityRes/";
  15844. function setStageSize(view) {
  15845. if (view.width) {
  15846. view.width = Laya.stage.width;
  15847. view.height = Laya.stage.height;
  15848. }
  15849. }
  15850. function filledBg(view) {
  15851. let wh = Laya.stage.height / Laya.stage.width;
  15852. if (wh > 16 / 9) {
  15853. view.height = Laya.stage.height;
  15854. view.width = Laya.stage.height / 1334 * 750;
  15855. }
  15856. else {
  15857. view.width = Laya.stage.width;
  15858. view.height = Laya.stage.width / 750 * 1334;
  15859. }
  15860. }
  15861. function setNotch(view) {
  15862. if (view.height) {
  15863. view.y += context$1.notchHeight;
  15864. }
  15865. }
  15866. function showTip(str) {
  15867. uiMgr.Show(UIMsg, str);
  15868. }
  15869. function log(...args) {
  15870. console.log(args);
  15871. }
  15872. let xGame = {
  15873. context: context$1,
  15874. eventMgr,
  15875. resMgr,
  15876. uiMgr,
  15877. soundMgr,
  15878. define,
  15879. tools,
  15880. httpMgr,
  15881. d3TexUrl,
  15882. d3ModeUrl,
  15883. common,
  15884. cfgMgr,
  15885. poolD3Mgr,
  15886. setStageSize,
  15887. filledBg,
  15888. setNotch,
  15889. showTip,
  15890. log,
  15891. };
  15892. window["xGame"] = xGame;
  15893. let dataName = 'tBall_';
  15894. class UserData {
  15895. constructor() {
  15896. this.userId = "";
  15897. this.isAgree = false;
  15898. this.coinNum = 0;
  15899. this.gemNum = 0;
  15900. this.sound = true;
  15901. this.vibration = true;
  15902. this.currentDate = 0;
  15903. this.createTime = 0;
  15904. this.awardTime = 0;
  15905. this.roleId = 1;
  15906. this.roleList = [];
  15907. this.roleAds = [];
  15908. this.dressId = 101;
  15909. this.itemId = 201;
  15910. this.bigSkills = [1, 1, 1, 1, 1];
  15911. this.coin = 4000;
  15912. this.diamond = 0;
  15913. this.skillSuccessTimes = 0;
  15914. this.skillGuide = 0;
  15915. this.skillAccTimes = 0;
  15916. this.placeBallData = [];
  15917. this.shareDiamondTimes = 0;
  15918. this.dailyVideoShareTimes = 0;
  15919. this.secretary = [1, 0];
  15920. this.curSecretary = 0;
  15921. this.ballRod = [1, 0, 0, 0, 0, 1];
  15922. this.curBallRod = 5;
  15923. this.signData = 0;
  15924. this.signTime = 0;
  15925. this.drawTimes = 0;
  15926. this.drawAwardTimes = 0;
  15927. this.dailyfreeDrawTimes = 1;
  15928. this.power = 5;
  15929. this.powerTime = 0;
  15930. this.challengeTimes = 0;
  15931. this.extraSign = 0;
  15932. this.classicTimes = 0;
  15933. this.guideHelpLine = 0;
  15934. this.newUser = true;
  15935. this.rootBallFoul = 0;
  15936. this.timeoutFoul = 0;
  15937. this.roleList = [1];
  15938. }
  15939. saveData() {
  15940. let data = {};
  15941. for (let k in this) {
  15942. data[k.toString()] = this[k];
  15943. }
  15944. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15945. }
  15946. getData() {
  15947. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15948. if (ld) {
  15949. let localData = JSON.parse(ld);
  15950. if (localData) {
  15951. for (let k in this) {
  15952. let key = k.toString();
  15953. let data = localData[key];
  15954. if (data != undefined) {
  15955. this[k] = data;
  15956. }
  15957. }
  15958. }
  15959. }
  15960. }
  15961. }
  15962. class ItemData {
  15963. constructor() {
  15964. this.itemList = {};
  15965. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15966. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15967. }
  15968. saveData() {
  15969. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15970. }
  15971. getData() {
  15972. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15973. if (ld) {
  15974. let localData = JSON.parse(ld);
  15975. if (localData) {
  15976. this.itemList = localData;
  15977. }
  15978. }
  15979. }
  15980. }
  15981. class GameData {
  15982. constructor() {
  15983. this.curLevel = 0;
  15984. this.gameType = 1;
  15985. this.signIdx = 0;
  15986. this.signMax = 0;
  15987. this.rotaryTime = 0;
  15988. this.rotaryCount = 0;
  15989. this.rotaryList = [];
  15990. this.diyCount = 3;
  15991. this.awardIdx = 0;
  15992. this.shareNum = 2;
  15993. this.rankWeek = 0;
  15994. this.rankScore = 0;
  15995. this.gameCount = 0;
  15996. this.trySkill = -1;
  15997. this.tryTime = 0;
  15998. }
  15999. saveData() {
  16000. let data = {};
  16001. for (let k in this) {
  16002. data[k.toString()] = this[k];
  16003. }
  16004. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16005. }
  16006. getData() {
  16007. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16008. if (ld) {
  16009. let localData = JSON.parse(ld);
  16010. if (localData) {
  16011. for (let k in this) {
  16012. let key = k.toString();
  16013. let data = localData[key];
  16014. if (data != undefined) {
  16015. this[k] = data;
  16016. }
  16017. }
  16018. }
  16019. }
  16020. }
  16021. }
  16022. class DataMgr {
  16023. static Init() {
  16024. this.userData = new UserData();
  16025. this.gameData = new GameData();
  16026. this.itemData = new ItemData();
  16027. this.userData.getData();
  16028. this.gameData.getData();
  16029. this.itemData.getData();
  16030. this.roleId = this.userData.roleId;
  16031. this.resetUse();
  16032. }
  16033. static isNewDay() {
  16034. Moyu.isNewDay(this, (isnew) => {
  16035. xGame.common.isNewDay = isnew;
  16036. if (!isnew)
  16037. return;
  16038. DataMgr.setShareDiamondTimes(0, false);
  16039. DataMgr.setDailyVideoShareTimes(0, false);
  16040. DataMgr.setDailyfreeDrawTimes(1);
  16041. DataMgr.setExtraSign(0);
  16042. });
  16043. }
  16044. static deletData() {
  16045. Laya.LocalStorage.clear();
  16046. }
  16047. static upRankData() {
  16048. let num = xGame.common.getAllStarNum();
  16049. if (num > 0)
  16050. Moyu.upRankData(xGame.common.curRankID, num);
  16051. }
  16052. static addItem(id, count = 1) {
  16053. let v = this.itemData.itemList[id];
  16054. if (!v)
  16055. v = { id: id, count: count, adnum: 0, active: true };
  16056. else {
  16057. if (v.active) {
  16058. v.count += count;
  16059. }
  16060. else {
  16061. v.count = count;
  16062. v.active = true;
  16063. }
  16064. }
  16065. this.itemData.itemList[id] = v;
  16066. xGame.soundMgr.playGetSound();
  16067. this.saveItemData();
  16068. }
  16069. static hasItem(id) {
  16070. let v = this.itemData.itemList[id];
  16071. if (v && v.active)
  16072. return true;
  16073. return false;
  16074. }
  16075. static getItem(id) {
  16076. let v = this.itemData.itemList[id];
  16077. return v;
  16078. }
  16079. static getItemCount(id) {
  16080. let v = this.itemData.itemList[id];
  16081. if (v && v.active)
  16082. return v.count;
  16083. return 0;
  16084. }
  16085. static getItemAd(id) {
  16086. let v = this.itemData.itemList[id];
  16087. if (v) {
  16088. return v.adnum;
  16089. }
  16090. return 0;
  16091. }
  16092. static onItemAd(id, num = 1) {
  16093. let v = this.itemData.itemList[id];
  16094. if (!v)
  16095. v = { id: id, count: 1, adnum: num, active: false };
  16096. else
  16097. v.adnum += num;
  16098. this.itemData.itemList[id] = v;
  16099. this.saveItemData();
  16100. }
  16101. static costItem(id, count) {
  16102. let v = this.itemData.itemList[id];
  16103. if (v && v.active) {
  16104. if (v.count < count)
  16105. return false;
  16106. else {
  16107. v.count -= count;
  16108. this.itemData.itemList[id] = v;
  16109. return true;
  16110. }
  16111. }
  16112. return false;
  16113. }
  16114. static resetUse() {
  16115. this.dressId = this.userData.dressId;
  16116. this.itemId = this.userData.itemId;
  16117. }
  16118. static passLevel() {
  16119. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16120. this.gameData.curLevel++;
  16121. this.curLevel = this.gameData.curLevel;
  16122. this.saveGameData();
  16123. }
  16124. static useRole(id) {
  16125. this.roleId = id;
  16126. if (this.hasRole(id)) {
  16127. this.userData.roleId = id;
  16128. this.saveUserData();
  16129. }
  16130. }
  16131. static addRole(id) {
  16132. if (this.hasRole(id))
  16133. return;
  16134. this.userData.roleList.push(id);
  16135. this.saveUserData();
  16136. }
  16137. static hasRole(id) {
  16138. return this.userData.roleList.indexOf(id) >= 0;
  16139. }
  16140. static gemEnough(num) {
  16141. return this.userData.gemNum >= num;
  16142. }
  16143. static roleHasAd(id) {
  16144. let count = this.userData.roleAds[id];
  16145. if (count != undefined && count >= 0)
  16146. return true;
  16147. else
  16148. return false;
  16149. }
  16150. static saveUserData(time = 1000, event, arg) {
  16151. if (this.userSaving)
  16152. return;
  16153. this.userSaving = true;
  16154. Laya.timer.once(time, this, () => {
  16155. this.userSaving = false;
  16156. this.userData.saveData();
  16157. if (event)
  16158. xGame.eventMgr.event(event, arg);
  16159. });
  16160. }
  16161. static saveGameData() {
  16162. if (this.gameSaving)
  16163. return;
  16164. this.gameSaving = true;
  16165. Laya.timer.once(1000, this, () => {
  16166. this.gameSaving = false;
  16167. this.gameData.saveData();
  16168. });
  16169. }
  16170. static saveItemData() {
  16171. let fun = () => {
  16172. this.itemData.saveData();
  16173. };
  16174. Laya.timer.clear(this, fun);
  16175. Laya.timer.once(500, this, fun);
  16176. }
  16177. static saveData() {
  16178. this.saveUserData();
  16179. this.saveGameData();
  16180. }
  16181. static getBigSkillList() {
  16182. return this.userData.bigSkills;
  16183. }
  16184. static getBigSkillByIndex(index) {
  16185. return this.userData.bigSkills[index];
  16186. }
  16187. static setBigSkill(index, val, addUp = true) {
  16188. if (addUp) {
  16189. this.userData.bigSkills[index] += val;
  16190. }
  16191. else {
  16192. this.userData.bigSkills[index] = val;
  16193. }
  16194. this.saveUserData();
  16195. }
  16196. static coinEnough(need) {
  16197. if (typeof need != "number") {
  16198. console.error("金币格式错误");
  16199. return;
  16200. }
  16201. return this.userData.coin >= need;
  16202. }
  16203. static setCoin(val) {
  16204. if (typeof val != "number") {
  16205. return;
  16206. }
  16207. this.userData.coin += val;
  16208. this.saveUserData();
  16209. xGame.eventMgr.event(COIN_CHANGE);
  16210. }
  16211. static getCoin() {
  16212. return this.userData.coin;
  16213. }
  16214. static diamondEnough(need) {
  16215. if (typeof need != "number") {
  16216. console.error("金币格式错误");
  16217. return;
  16218. }
  16219. return this.userData.diamond >= need;
  16220. }
  16221. static setDiamond(val) {
  16222. if (typeof val != "number") {
  16223. return;
  16224. }
  16225. this.userData.diamond += val;
  16226. this.saveUserData();
  16227. xGame.eventMgr.event(DIAMOND_CHANGE);
  16228. }
  16229. static getDiamond() {
  16230. return this.userData.diamond;
  16231. }
  16232. static getSkillSuccessTimes() {
  16233. return this.userData.skillSuccessTimes;
  16234. }
  16235. static setSkillSuccessTimes(val, addUp = true) {
  16236. if (addUp)
  16237. this.userData.skillSuccessTimes += val;
  16238. else
  16239. this.userData.skillSuccessTimes = val;
  16240. this.saveUserData();
  16241. }
  16242. static getSkillAccTimes() {
  16243. return this.userData.skillAccTimes;
  16244. }
  16245. static setSkillAccTimes(val) {
  16246. this.userData.skillAccTimes += val;
  16247. this.saveUserData();
  16248. }
  16249. static getSkillGuide() {
  16250. if (!xGame.common.openGuide) {
  16251. return 1;
  16252. }
  16253. return this.userData.skillGuide;
  16254. }
  16255. static setSkillGuide(val) {
  16256. this.userData.skillGuide = val;
  16257. this.saveUserData();
  16258. }
  16259. static getPlaceBallLevelList() {
  16260. return this.userData.placeBallData;
  16261. }
  16262. static getPlaceBallLevel(level) {
  16263. let arr = this.userData.placeBallData;
  16264. let index = level - 1;
  16265. let out;
  16266. if (arr[index]) {
  16267. out = arr[index];
  16268. }
  16269. else {
  16270. let max = arr.length;
  16271. if (max == index) {
  16272. out = {
  16273. star: 0,
  16274. play: true,
  16275. isCur: true,
  16276. getAward: false
  16277. };
  16278. }
  16279. else {
  16280. out = {
  16281. star: 0,
  16282. play: false,
  16283. getAward: false
  16284. };
  16285. }
  16286. }
  16287. return out;
  16288. }
  16289. static setPlaceBallLevel(level, star) {
  16290. let arr = this.userData.placeBallData;
  16291. let index = level - 1;
  16292. if (arr[index]) {
  16293. arr[index].star = Math.max(arr[index].star, star);
  16294. }
  16295. else {
  16296. let max = arr.length;
  16297. if (max == index) {
  16298. arr.push({
  16299. star: star,
  16300. play: true,
  16301. getAward: false
  16302. });
  16303. }
  16304. else {
  16305. console.error("关卡存储出错");
  16306. }
  16307. }
  16308. this.saveUserData();
  16309. }
  16310. static setPlaceBallAward(level) {
  16311. let arr = this.userData.placeBallData;
  16312. let index = level - 1;
  16313. if (arr[index]) {
  16314. arr[index].getAward = true;
  16315. }
  16316. this.saveUserData();
  16317. }
  16318. static getShareDiamondTimes() {
  16319. return this.userData.shareDiamondTimes;
  16320. }
  16321. static setShareDiamondTimes(val, addUp = true) {
  16322. if (addUp) {
  16323. this.userData.shareDiamondTimes += val;
  16324. }
  16325. else {
  16326. this.userData.shareDiamondTimes = val;
  16327. }
  16328. this.saveUserData();
  16329. }
  16330. static getDailyVideoShareTimes() {
  16331. return this.userData.dailyVideoShareTimes;
  16332. }
  16333. static setDailyVideoShareTimes(val, addUp = true) {
  16334. if (addUp) {
  16335. this.userData.dailyVideoShareTimes += val;
  16336. }
  16337. else {
  16338. this.userData.dailyVideoShareTimes = val;
  16339. }
  16340. this.saveUserData();
  16341. }
  16342. static getSecretary(index) {
  16343. return this.userData.secretary[index];
  16344. }
  16345. static setSecretary(index, val) {
  16346. this.userData.secretary[index] = val;
  16347. this.saveUserData();
  16348. }
  16349. static getCurSecretary() {
  16350. return this.userData.curSecretary;
  16351. }
  16352. static setCurSecretary(index) {
  16353. this.userData.curSecretary = index;
  16354. this.saveUserData();
  16355. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16356. }
  16357. static getBallRod(index) {
  16358. return this.userData.ballRod[index];
  16359. }
  16360. static setBallRod(index, val) {
  16361. this.userData.ballRod[index] = val;
  16362. this.saveUserData();
  16363. }
  16364. static getCurBallRod() {
  16365. return this.userData.curBallRod;
  16366. }
  16367. static setCurBallRod(index) {
  16368. this.userData.curBallRod = index;
  16369. this.saveUserData();
  16370. }
  16371. static setSignData(val) {
  16372. this.userData.signData = val;
  16373. this.saveUserData();
  16374. }
  16375. static getSignData() {
  16376. return this.userData.signData;
  16377. }
  16378. static setSignTime(val) {
  16379. this.userData.signTime = val;
  16380. this.saveUserData();
  16381. }
  16382. static getSignTime() {
  16383. return this.userData.signTime;
  16384. }
  16385. static getDrawTimes() {
  16386. return this.userData.drawTimes;
  16387. }
  16388. static setDrawTimes(val, addUp = true) {
  16389. if (addUp) {
  16390. this.userData.drawTimes += val;
  16391. }
  16392. else {
  16393. this.userData.drawTimes = val;
  16394. }
  16395. this.saveUserData();
  16396. }
  16397. static getDrawAwardTimes() {
  16398. return this.userData.drawAwardTimes;
  16399. }
  16400. static setDrawAwardTimes(val) {
  16401. this.userData.drawAwardTimes = val;
  16402. this.saveUserData();
  16403. }
  16404. static getDailyfreeDrawTimes() {
  16405. return this.userData.dailyfreeDrawTimes;
  16406. }
  16407. static setDailyfreeDrawTimes(val) {
  16408. this.userData.dailyfreeDrawTimes = val;
  16409. this.saveUserData();
  16410. }
  16411. static setPower(val, addUp = true) {
  16412. if (addUp)
  16413. this.userData.power += val;
  16414. else
  16415. this.userData.power = val;
  16416. if (this.userData.power >= xGame.common.maxPower) {
  16417. this.userData.power = xGame.common.maxPower;
  16418. }
  16419. xGame.eventMgr.event(POWER_CHANGE, val);
  16420. this.saveUserData();
  16421. }
  16422. static getPower() {
  16423. return this.userData.power;
  16424. }
  16425. static setPowerTime(val) {
  16426. this.userData.powerTime = val;
  16427. this.saveUserData();
  16428. }
  16429. static getPowerTime() {
  16430. return this.userData.powerTime;
  16431. }
  16432. static powerEnough() {
  16433. return this.getPower() > 0;
  16434. }
  16435. static getChallengeTimes() {
  16436. return this.userData.challengeTimes;
  16437. }
  16438. static setChallengeTimes(val) {
  16439. this.userData.challengeTimes += val;
  16440. this.saveUserData();
  16441. }
  16442. static getExtraSign() {
  16443. return this.userData.extraSign;
  16444. }
  16445. static setExtraSign(val) {
  16446. this.userData.extraSign = val;
  16447. this.saveUserData();
  16448. }
  16449. static getClassicTimes() {
  16450. return this.userData.classicTimes;
  16451. }
  16452. static setClassicTimes() {
  16453. this.userData.classicTimes += 1;
  16454. this.saveUserData();
  16455. }
  16456. static getGuideHelpLine() {
  16457. return this.userData.guideHelpLine;
  16458. }
  16459. static setGuideHelpLine() {
  16460. this.userData.guideHelpLine = 1;
  16461. this.saveUserData();
  16462. }
  16463. static getNewUser() {
  16464. return this.userData.newUser;
  16465. }
  16466. static setNewUser() {
  16467. this.userData.newUser = false;
  16468. this.saveUserData();
  16469. }
  16470. static getRootBallFoul() {
  16471. return this.userData.rootBallFoul;
  16472. }
  16473. static setRootBallFoul() {
  16474. this.userData.rootBallFoul = 1;
  16475. this.saveUserData();
  16476. }
  16477. static getTimeoutFoul() {
  16478. return this.userData.timeoutFoul;
  16479. }
  16480. static setTimeoutFoul() {
  16481. this.userData.timeoutFoul = 1;
  16482. this.saveUserData();
  16483. }
  16484. }
  16485. DataMgr.isNewUser = false;
  16486. DataMgr.fristEnter = true;
  16487. DataMgr.levelType = 0;
  16488. DataMgr.awardId = 0;
  16489. DataMgr.awardCoin = 0;
  16490. DataMgr.sceneId = -1;
  16491. DataMgr.tryId = 0;
  16492. DataMgr.curLevel = 1;
  16493. DataMgr.vipLevel = 0;
  16494. DataMgr.maxLevel = 0;
  16495. DataMgr.awardRatio = 1;
  16496. DataMgr.gameList = [];
  16497. DataMgr.rankList = [];
  16498. DataMgr.recoverTime = 480000;
  16499. DataMgr.minScore = 0;
  16500. DataMgr.rankDis = 0;
  16501. DataMgr.userSaving = false;
  16502. DataMgr.gameSaving = false;
  16503. class D3Tween extends Laya.Script3D {
  16504. constructor() {
  16505. super();
  16506. this.isInited = false;
  16507. }
  16508. ;
  16509. init() {
  16510. if (this.isInited)
  16511. return;
  16512. this.isInited = true;
  16513. this.gameObj = this.owner;
  16514. this.transform = this.gameObj.transform;
  16515. }
  16516. get rotX() {
  16517. return this.transform.localRotationEulerX;
  16518. }
  16519. set rotX(v) {
  16520. this.transform.localRotationEulerX = v;
  16521. }
  16522. get rotY() {
  16523. return this.transform.localRotationEulerY;
  16524. }
  16525. set rotY(v) {
  16526. this.transform.localRotationEulerY = v;
  16527. }
  16528. get rotZ() {
  16529. return this.transform.localRotationEulerZ;
  16530. }
  16531. set rotZ(v) {
  16532. this.transform.localRotationEulerZ = v;
  16533. }
  16534. get posX() {
  16535. return this.transform.localPositionX;
  16536. }
  16537. set posX(v) {
  16538. this.transform.localPositionX = v;
  16539. }
  16540. get posY() {
  16541. return this.transform.localPositionY;
  16542. }
  16543. set posY(v) {
  16544. this.transform.localPositionY = v;
  16545. }
  16546. get posZ() {
  16547. return this.transform.localPositionZ;
  16548. }
  16549. set posZ(v) {
  16550. this.transform.localPositionZ = v;
  16551. }
  16552. get rotation() {
  16553. return this.transform.localRotation;
  16554. }
  16555. set rotation(v) {
  16556. this.transform.localRotation = v;
  16557. }
  16558. }
  16559. class D2Hole extends Laya.Script {
  16560. constructor() { super(); }
  16561. onTriggerEnter(collider) {
  16562. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16563. return;
  16564. }
  16565. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16566. if (collider.owner["mySrc"].isRunSkillAni) {
  16567. return;
  16568. }
  16569. if (collider.owner["mySrc"].number != 0) {
  16570. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16571. }
  16572. xGame.common.ballColliHole(collider);
  16573. xGame.common.recoverCameraView();
  16574. }
  16575. }
  16576. }
  16577. class Table extends Laya.Script3D {
  16578. constructor() {
  16579. super();
  16580. this.isSetBorder = false;
  16581. this.inited = false;
  16582. }
  16583. ;
  16584. onAwake() {
  16585. this.init();
  16586. }
  16587. init() {
  16588. if (this.inited)
  16589. return;
  16590. this.inited = true;
  16591. this.gameObj = this.owner;
  16592. this.border = this.gameObj.getChildByName("border");
  16593. }
  16594. setBorderPos() {
  16595. if (this.isSetBorder)
  16596. return;
  16597. this.isSetBorder = true;
  16598. let ui = xGame.common.gameUI.ui;
  16599. let bar1 = this.border.getChildByName("bar1");
  16600. let bar2 = this.border.getChildByName("bar2");
  16601. let bar3 = this.border.getChildByName("bar3");
  16602. let bar4 = this.border.getChildByName("bar4");
  16603. let bar5 = this.border.getChildByName("bar5");
  16604. let bar6 = this.border.getChildByName("bar6");
  16605. this.setInfo(bar1, ui.border.bar1, "box");
  16606. this.setInfo(bar2, ui.border.bar2, "box");
  16607. this.setInfo(bar3, ui.border.bar3, "box");
  16608. this.setInfo(bar4, ui.border.bar4, "box");
  16609. this.setInfo(bar5, ui.border.bar5, "box");
  16610. this.setInfo(bar6, ui.border.bar6, "box");
  16611. let circle1 = this.border.getChildByName("circle1");
  16612. let circle2 = this.border.getChildByName("circle2");
  16613. let circle3 = this.border.getChildByName("circle3");
  16614. let circle4 = this.border.getChildByName("circle4");
  16615. let circle5 = this.border.getChildByName("circle5");
  16616. let circle6 = this.border.getChildByName("circle6");
  16617. this.setInfo(circle1, ui.border.circle1, "circle");
  16618. this.setInfo(circle2, ui.border.circle2, "circle");
  16619. this.setInfo(circle3, ui.border.circle3, "circle");
  16620. this.setInfo(circle4, ui.border.circle4, "circle");
  16621. this.setInfo(circle5, ui.border.circle5, "circle");
  16622. this.setInfo(circle6, ui.border.circle6, "circle");
  16623. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16624. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16625. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16626. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16627. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16628. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16629. let arr = xGame.common.gameMgr.holePosList;
  16630. xGame.common.gameMgr.posObj = {
  16631. "1": arr[0],
  16632. "3": arr[2],
  16633. "4": arr[3],
  16634. "6": arr[5]
  16635. };
  16636. }
  16637. initHolePos(x, y) {
  16638. if (x < 300)
  16639. x += 25;
  16640. else if (x > 1000)
  16641. x -= 25;
  16642. else if (y > 200)
  16643. y -= 10;
  16644. else
  16645. y += 10;
  16646. if (y < 200)
  16647. y += 30;
  16648. else if (y > 500)
  16649. y -= 30;
  16650. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16651. }
  16652. setInfo(d3Obj, d2Obj, type) {
  16653. let ui = xGame.common.gameUI.ui;
  16654. let sprite = new Laya.Sprite();
  16655. ui.border.displayObject.addChild(sprite);
  16656. let colli = xGame.common.getCollider(type);
  16657. sprite.addComponentIntance(colli);
  16658. let rigy = xGame.common.getRigbody();
  16659. rigy.type = "static";
  16660. sprite.addComponentIntance(rigy);
  16661. let d3Pos = d3Obj.transform.position;
  16662. xGame.common.pos3to2Convert(d3Pos);
  16663. let scaleX = d3Obj.transform.localScaleX;
  16664. let scaleZ = d3Obj.transform.localScaleZ;
  16665. let width = xGame.common.scale3to2Convert(scaleZ);
  16666. let height = xGame.common.scale3to2Convert(scaleX);
  16667. sprite.pivotX = width / 2;
  16668. sprite.pivotY = height / 2;
  16669. sprite.x = d3Pos.x;
  16670. sprite.y = d3Pos.y;
  16671. sprite.width = width;
  16672. sprite.height = height;
  16673. d2Obj.x = d3Pos.x;
  16674. d2Obj.y = d3Pos.y;
  16675. d2Obj.width = width;
  16676. d2Obj.height = height;
  16677. if (type == "box") {
  16678. colli.width = width;
  16679. colli.height = height;
  16680. colli.isSensor = false;
  16681. colli.label = "border";
  16682. }
  16683. else {
  16684. colli.radius = width / 2;
  16685. colli.isSensor = true;
  16686. colli.label = "hole";
  16687. sprite.addComponent(D2Hole);
  16688. }
  16689. }
  16690. }
  16691. class D3World extends Laya.Script3D {
  16692. constructor() {
  16693. super();
  16694. this.loadNum = 0;
  16695. this.setLoadNum = 7;
  16696. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16697. }
  16698. onAwake() {
  16699. }
  16700. loadScene() {
  16701. this.scene = this.owner;
  16702. let url = `res/unityRes/root.lh`;
  16703. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16704. this.scene.addChild(prefab);
  16705. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16706. this.putCameraInfo();
  16707. this.camera.enableHDR = false;
  16708. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16709. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16710. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16711. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16712. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16713. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16714. this.knife.active = false;
  16715. this.loadD3Obj();
  16716. }));
  16717. }
  16718. putCameraInfo() {
  16719. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16720. this.cameraObj = new cameraType();
  16721. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16722. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16723. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16724. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16725. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16726. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16727. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16728. this.visitAngleChild.init();
  16729. this.visitRootObj.posX = this.visitAngleChild.posX;
  16730. this.visitRootObj.posY = this.visitAngleChild.posY;
  16731. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16732. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16733. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16734. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16735. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16736. xGame.common.showOneCamera("mainCamera");
  16737. }
  16738. loadD3Obj() {
  16739. this.loadTable();
  16740. this.loadRoom();
  16741. this.loadInHoleParticial();
  16742. this.loadIceParticial();
  16743. this.loadHitParticial();
  16744. this.loadFireworksParticial();
  16745. this.loadBall();
  16746. }
  16747. loadInHoleParticial() {
  16748. this.loadD3Res("inHoleEft", "", (prefab) => {
  16749. prefab.addComponent(Partical);
  16750. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16751. });
  16752. }
  16753. loadIceParticial() {
  16754. this.loadD3Res("iceEft", "", (prefab) => {
  16755. prefab.addComponent(Partical);
  16756. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16757. });
  16758. }
  16759. loadHitParticial() {
  16760. this.loadD3Res("hitEft", "", (prefab) => {
  16761. prefab.addComponent(Partical);
  16762. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16763. });
  16764. }
  16765. loadFireworksParticial() {
  16766. this.loadD3Res("fireworksEft", "", (prefab) => {
  16767. prefab.addComponent(Partical);
  16768. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16769. });
  16770. }
  16771. loadBall(index = 1) {
  16772. this.loadD3Res("ball", index, (prefab) => {
  16773. this.ballPrefab = prefab;
  16774. this.ballPrefab.addComponent(Ball);
  16775. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16776. });
  16777. }
  16778. loadTable(index = 1) {
  16779. this.loadD3Res("table", index, (prefab) => {
  16780. this.tableSrc = prefab.addComponent(Table);
  16781. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16782. this.d3Hand.init();
  16783. this.tableRoot.addChild(prefab);
  16784. });
  16785. }
  16786. loadRoom(index = 1) {
  16787. this.loadD3Res("room", index, (prefab) => {
  16788. this.roomRoot.addChild(prefab);
  16789. });
  16790. }
  16791. loadD3Res(type, index, callback) {
  16792. let url = `res/unityRes/${type}${index}.lh`;
  16793. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16794. callback && callback(prefab);
  16795. this.checkResLoad();
  16796. }));
  16797. }
  16798. checkResLoad() {
  16799. this.loadNum++;
  16800. if (this.loadNum >= this.setLoadNum) {
  16801. xGame.eventMgr.event(D3RES_LOADED);
  16802. }
  16803. }
  16804. prePlayEft() {
  16805. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16806. eft.transform.localPositionX = 0;
  16807. eft.transform.localPositionY = -5;
  16808. eft.transform.localPositionZ = 0;
  16809. eft.active = true;
  16810. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16811. ice.transform.localPositionX = 0;
  16812. ice.transform.localPositionY = -5;
  16813. ice.transform.localPositionZ = 0;
  16814. ice.active = true;
  16815. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16816. hit.transform.localPositionX = 0;
  16817. hit.transform.localPositionY = -5;
  16818. hit.transform.localPositionZ = 0;
  16819. hit.active = true;
  16820. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16821. fireworks.transform.localPositionX = 0;
  16822. fireworks.transform.localPositionY = -5;
  16823. fireworks.transform.localPositionZ = 0;
  16824. fireworks.active = true;
  16825. }
  16826. }
  16827. class cameraType {
  16828. }
  16829. class MoyuMgr$1 {
  16830. static initMoyu() {
  16831. this.moyuView = new MoyuView$1();
  16832. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16833. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16834. this.moyuView.ui.displayObject.zOrder = 1000;
  16835. this.moyuView.init();
  16836. this.moyuView.showTip(true);
  16837. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16838. window['XApk'] = this;
  16839. }
  16840. static showAge(show) {
  16841. if (this.moyuView)
  16842. this.moyuView.showAge(show);
  16843. }
  16844. static onPlatMsg(idx) {
  16845. if (!MoyuMgr$1.moyuView)
  16846. return;
  16847. if (idx == '0') {
  16848. MoyuMgr$1.moyuView.showTip(false);
  16849. }
  16850. }
  16851. static showAgree(call) {
  16852. if (this.moyuView)
  16853. this.moyuView.showAgree(call);
  16854. else
  16855. call && call();
  16856. }
  16857. static showXy(type = 1) {
  16858. if (this.moyuView)
  16859. this.moyuView.showXy(type);
  16860. }
  16861. }
  16862. MoyuMgr$1.isAdvise = false;
  16863. class MoyuView$1 {
  16864. constructor() {
  16865. this.ysxyNum = 1;
  16866. this.ysJson = null;
  16867. this.ui = ui_UIMoyu.createInstance();
  16868. }
  16869. init() {
  16870. this.ui.mainBg.visible = false;
  16871. this.ui.xyNode.visible = false;
  16872. this.ui.ageNode.visible = false;
  16873. this.ui.tipNode.visible = false;
  16874. this.ui.rnNode.visible = false;
  16875. this.ui.fcmNode.visible = false;
  16876. this.ui.ageTip.visible = false;
  16877. this.ui.msgNode.visible = false;
  16878. this.ui.visible = false;
  16879. this.ui.xyNode.xyList.setVirtual();
  16880. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16881. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16882. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16883. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16884. this.ui.xyNode.btnKnown.visible = false;
  16885. this.ui.xyNode.xy1.visible = false;
  16886. this.ui.xyNode.xy2.visible = false;
  16887. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16888. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16889. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16890. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16891. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16892. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16893. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16894. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16895. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16896. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16897. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16898. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16899. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16900. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16901. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16902. this.ysxyNum = 2;
  16903. }
  16904. }
  16905. onClick(obj) {
  16906. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16907. switch (obj) {
  16908. case this.ui.ageTip:
  16909. if (Moyu.isTTApk) {
  16910. this.ui.ageNode.visible = true;
  16911. this.ui.mainBg.visible = true;
  16912. }
  16913. break;
  16914. case this.ui.tipNode:
  16915. this.showTip(false);
  16916. break;
  16917. case this.ui.ageNode.btnAge:
  16918. this.ui.ageNode.visible = false;
  16919. this.ui.mainBg.visible = false;
  16920. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16921. this.ui.visible = false;
  16922. break;
  16923. case this.ui.xyNode.btnXy3:
  16924. case this.ui.xyNode.btnXy1:
  16925. this.loadXy(1);
  16926. break;
  16927. case this.ui.xyNode.btnXy2:
  16928. this.loadXy(2);
  16929. break;
  16930. case this.ui.xyNode.btnBack:
  16931. this.ui.xyNode.xy1.visible = true;
  16932. this.ui.xyNode.xy2.visible = false;
  16933. break;
  16934. case this.ui.xyNode.btnKnown:
  16935. this.ui.xyNode.visible = false;
  16936. this.ui.mainBg.visible = false;
  16937. this.ui.visible = false;
  16938. break;
  16939. case this.ui.rnNode.btnCheck:
  16940. this.check();
  16941. break;
  16942. case this.ui.rnNode.btnExit:
  16943. case this.ui.xyNode.btnNo:
  16944. this.ysxyNum--;
  16945. if (this.ysxyNum > 0)
  16946. this.showMsg("Refuse to quit the game once again");
  16947. else {
  16948. Moyu.userAgree(false);
  16949. Moyu.exit();
  16950. }
  16951. break;
  16952. case this.ui.xyNode.btnSure:
  16953. case this.ui.xyNode.btnYes:
  16954. DataMgr.userData.isAgree = true;
  16955. DataMgr.saveUserData();
  16956. this.onAgree();
  16957. break;
  16958. case this.ui.rnNode.btnDone:
  16959. this.ui.rnNode.visible = false;
  16960. this.ui.visible = false;
  16961. break;
  16962. case this.ui.fcmNode.btnRn:
  16963. this.showRn();
  16964. break;
  16965. }
  16966. }
  16967. showTip(show) {
  16968. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16969. return;
  16970. if (show) {
  16971. MoyuMgr$1.isAdvise = true;
  16972. this.ui.visible = true;
  16973. this.ui.tipNode.visible = true;
  16974. this.ui.tipNode.alpha = 1;
  16975. Laya.timer.once(1000, this, this.showTip, [false]);
  16976. }
  16977. else {
  16978. this.ui.tipNode.alpha = 1;
  16979. this.ui.tipNode.visible = true;
  16980. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16981. this.ui.tipNode.visible = false;
  16982. MoyuMgr$1.isAdvise = false;
  16983. }), 1000);
  16984. }
  16985. }
  16986. showAge(show, px = 0, py = 0) {
  16987. if (Moyu.platType > 10 && !Moyu.isIos) {
  16988. this.ui.ageTip.x = px;
  16989. this.ui.ageTip.y = py;
  16990. this.ui.ageTip.visible = show;
  16991. if (show)
  16992. this.ui.visible = true;
  16993. }
  16994. }
  16995. showAgree(call) {
  16996. this.agreeCall = call;
  16997. this.onAgree();
  16998. return;
  16999. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17000. this.showXy(0);
  17001. }
  17002. else
  17003. this.onAgree();
  17004. }
  17005. onAgree() {
  17006. if (!this.ui.ageNode.visible)
  17007. this.ui.visible = false;
  17008. this.ui.xyNode.visible = false;
  17009. Moyu.userAgree(true);
  17010. this.showAge(false);
  17011. this.agreeCall && this.agreeCall();
  17012. this.showRn();
  17013. }
  17014. showMsg(txt) {
  17015. this.ui.msgNode.txtMsg.text = txt;
  17016. this.ui.msgNode.visible = true;
  17017. this.ui.msgNode.alpha = 1;
  17018. this.ui.visible = true;
  17019. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17020. this.ui.msgNode.visible = false;
  17021. }), 2500, true);
  17022. }
  17023. showRn() {
  17024. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17025. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17026. this.ui.rnNode.rn1.visible = true;
  17027. this.ui.rnNode.rn2.visible = false;
  17028. this.ui.rnNode.rn3.visible = false;
  17029. this.ui.rnNode.rn4.visible = false;
  17030. this.ui.rnNode.visible = true;
  17031. this.ui.mainBg.visible = true;
  17032. this.ui.rnNode.btnDone.visible = false;
  17033. this.ui.rnNode.btnExit.visible = true;
  17034. this.ui.rnNode.btnCheck.visible = true;
  17035. this.ui.fcmNode.visible = false;
  17036. this.ui.visible = true;
  17037. return;
  17038. }
  17039. }
  17040. this.showFcm();
  17041. }
  17042. showFcm() {
  17043. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17044. Moyu.initFCM(true);
  17045. if (Moyu.gameTime < 1)
  17046. this.fcmLoop();
  17047. else if (Moyu.gameTime < 999)
  17048. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17049. }
  17050. }
  17051. fcmLoop() {
  17052. if (Moyu.gameTime < 1) {
  17053. this.ui.rnNode.visible = false;
  17054. this.ui.fcmNode.visible = true;
  17055. this.ui.mainBg.visible = true;
  17056. this.ui.visible = true;
  17057. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17058. Laya.timer.clear(this.ui, this.fcmLoop);
  17059. }
  17060. }
  17061. check() {
  17062. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17063. this.ui.rnNode.rn1.visible = false;
  17064. this.ui.rnNode.rn2.visible = false;
  17065. this.ui.rnNode.rn4.visible = true;
  17066. }
  17067. else if (this.ui.rnNode.rn4.visible) {
  17068. let name = this.ui.rnNode.inputName.text;
  17069. let code = this.ui.rnNode.inputCode.text;
  17070. if (code && code.length == 18) {
  17071. this.ui.rnNode.rn1.visible = false;
  17072. this.ui.rnNode.rn4.visible = false;
  17073. Moyu.authenticate(name, code, (res) => {
  17074. this.ui.rnNode.rn2.visible = !res;
  17075. this.ui.rnNode.rn3.visible = res;
  17076. this.ui.rnNode.btnDone.visible = res;
  17077. this.ui.rnNode.btnExit.visible = !res;
  17078. this.ui.rnNode.btnCheck.visible = !res;
  17079. if (res)
  17080. this.showFcm();
  17081. });
  17082. }
  17083. else
  17084. this.showMsg("信息填写不完整");
  17085. }
  17086. }
  17087. loadXy(type = 0) {
  17088. this.ui.xyNode.xy1.visible = false;
  17089. this.ui.xyNode.xy2.visible = true;
  17090. this.ui.xyNode.xyList.scrollToView(0);
  17091. if (type == 1) {
  17092. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17093. }
  17094. else if (type == 2) {
  17095. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17096. }
  17097. }
  17098. showXy(type = 0) {
  17099. this.xyBtn();
  17100. if (type == 0) {
  17101. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17102. this.ui.xyNode.btnSure.visible = true;
  17103. }
  17104. else {
  17105. this.ui.xyNode.btnYes.visible = true;
  17106. this.ui.xyNode.btnNo.visible = true;
  17107. }
  17108. }
  17109. else {
  17110. this.ui.xyNode.btnKnown.visible = true;
  17111. this.ui.mainBg.visible = true;
  17112. }
  17113. this.ui.xyNode.xy1.visible = true;
  17114. this.ui.xyNode.xy2.visible = false;
  17115. this.ui.xyNode.visible = true;
  17116. this.ui.visible = true;
  17117. }
  17118. xyBtn() {
  17119. this.ui.xyNode.btnSure.visible = false;
  17120. this.ui.xyNode.btnYes.visible = false;
  17121. this.ui.xyNode.btnNo.visible = false;
  17122. this.ui.xyNode.btnKnown.visible = false;
  17123. {
  17124. this.ui.xyNode.btnXy3.visible = false;
  17125. this.ui.xyNode.btnXy2.visible = true;
  17126. this.ui.xyNode.btnXy1.visible = true;
  17127. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17128. }
  17129. }
  17130. createXY(json) {
  17131. this.ysJson = json.content;
  17132. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17133. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17134. this.ui.xyNode.xy2.visible = true;
  17135. }
  17136. renderListItem(idx, cell) {
  17137. let xy = this.ysJson[idx];
  17138. cell.height = xy.line * 30;
  17139. cell.xyItem.text = xy.text;
  17140. }
  17141. onDestroy() {
  17142. this.agreeCall = null;
  17143. }
  17144. }
  17145. class UILoading extends UIBase {
  17146. constructor() {
  17147. super();
  17148. this.accTime = 0;
  17149. this.curNum = 0;
  17150. this.rate = 1;
  17151. this.loadSubOk = false;
  17152. this.loadResOK = false;
  17153. this.openLoading = true;
  17154. this.beginLoadRes = false;
  17155. this.finishD2 = false;
  17156. this.finishD3 = false;
  17157. }
  17158. onConstructor() {
  17159. this.ui = ui_UILoading.createInstance();
  17160. this.contentPane = this.ui;
  17161. this.isEject = false;
  17162. this._initUI();
  17163. this._addEvent();
  17164. }
  17165. _initUI() {
  17166. MoyuMgr$1.initMoyu();
  17167. }
  17168. _addEvent() {
  17169. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17170. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17171. }
  17172. show() {
  17173. super.show();
  17174. console.log('zh:加载分包资源');
  17175. loadSubRes(this.subResProgress.bind(this));
  17176. this.ui.txtLoad.text = "Loading...";
  17177. }
  17178. subResProgress(pro, finish) {
  17179. this.curNum = pro;
  17180. if (finish) {
  17181. this.curNum = 1;
  17182. this.loadSubOk = true;
  17183. }
  17184. }
  17185. laodD3Res() {
  17186. let scene3D = new Laya.Scene3D();
  17187. xGame.common.d3Scene = scene3D;
  17188. xGame.common.d3World = scene3D.addComponent(D3World);
  17189. xGame.common.d3World.loadScene();
  17190. }
  17191. loadD2Res() {
  17192. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17193. this.finishD2 = true;
  17194. this.checkLoadAll();
  17195. this.curNum = 1;
  17196. }), Laya.Handler.create(this, (pro) => {
  17197. this.curNum = pro;
  17198. }, null, false));
  17199. }
  17200. d3ResFinish() {
  17201. this.finishD3 = true;
  17202. this.checkLoadAll();
  17203. }
  17204. checkLoadAll() {
  17205. if (this.finishD2 && this.finishD3) {
  17206. this.loadResOK = true;
  17207. }
  17208. }
  17209. loadRes() {
  17210. this.laodD3Res();
  17211. this.loadD2Res();
  17212. }
  17213. myUpdate(dt) {
  17214. if (!this.openLoading)
  17215. return;
  17216. this.accTime += dt * this.rate;
  17217. if (this.accTime >= this.curNum)
  17218. this.accTime = this.curNum;
  17219. this.ui.loadinfo.value = this.accTime * 100;
  17220. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17221. if (!this.beginLoadRes) {
  17222. this.beginLoadRes = true;
  17223. this.ui.txtLoad.text = "Loading...";
  17224. this.curNum = 0;
  17225. this.accTime = 0;
  17226. this.loadRes();
  17227. }
  17228. if (this.loadResOK) {
  17229. this.openLoading = false;
  17230. Laya.timer.once(300, this, () => {
  17231. xGame.common.d3Scene.active = false;
  17232. MoyuMgr$1.showAgree(enterGame);
  17233. });
  17234. }
  17235. }
  17236. }
  17237. release() {
  17238. }
  17239. hide() {
  17240. super.hide();
  17241. this.release();
  17242. }
  17243. onClose() {
  17244. this.hide();
  17245. }
  17246. }
  17247. UILoading.uiName = "UILoading";
  17248. class UIRepentProp$1 extends UIBase {
  17249. constructor() {
  17250. super();
  17251. this.viewType = 0;
  17252. this.regretType = 0;
  17253. }
  17254. onConstructor() {
  17255. this.ui = ui_UIRepentProp.createInstance();
  17256. this.contentPane = this.ui;
  17257. this.isEject = false;
  17258. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17259. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17260. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17261. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17262. }
  17263. show(viewType, regretType, callback) {
  17264. PlatMgr.showInsert(true);
  17265. this.viewType = viewType;
  17266. this.regretType = regretType;
  17267. this.callback = callback;
  17268. super.show();
  17269. this.ui.t0.play();
  17270. this.ui.c1.selectedIndex = this.viewType;
  17271. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17272. if (this.viewType == 0) {
  17273. let guide = DataMgr.getGuideHelpLine();
  17274. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17275. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17276. }
  17277. xGame.common.gameMgr.gamePause = true;
  17278. }
  17279. hideSelf() {
  17280. xGame.common.gameMgr.gamePause = false;
  17281. this.callback && this.callback(false);
  17282. this.hide();
  17283. }
  17284. videoRegret() {
  17285. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17286. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17287. }
  17288. else {
  17289. console.log('zh:AD 失败,直接发放奖励');
  17290. this.qjff_AD_for_UIrepentProp_videoRegret();
  17291. }
  17292. }
  17293. qjff_AD_for_UIrepentProp_videoRegret() {
  17294. this.callback && this.callback(true);
  17295. this.hideSelf();
  17296. }
  17297. videoAddHelpLine() {
  17298. let guide = DataMgr.getGuideHelpLine();
  17299. if (guide == 0) {
  17300. this.callback && this.callback(true);
  17301. this.hideSelf();
  17302. DataMgr.setGuideHelpLine();
  17303. xGame.common.gameUI.ui.guideNode.visible = false;
  17304. }
  17305. else {
  17306. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17307. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17308. }
  17309. else {
  17310. console.log('zh:AD 失败,直接发放奖励');
  17311. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17312. }
  17313. }
  17314. }
  17315. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17316. this.callback && this.callback(true);
  17317. this.hideSelf();
  17318. }
  17319. }
  17320. UIRepentProp$1.uiName = "UIRepentProp";
  17321. class UIRodMethod$1 extends UIBase {
  17322. constructor() {
  17323. super();
  17324. this.isPressd = false;
  17325. }
  17326. onConstructor() {
  17327. this.ui = ui_UIRodMethod.createInstance();
  17328. this.contentPane = this.ui;
  17329. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17330. this.moveDir = new Laya.Vector2();
  17331. this.moveDest = new Laya.Vector2();
  17332. this.centerPos = new Laya.Vector2();
  17333. xGame.common.uiRodMethod = this;
  17334. }
  17335. show() {
  17336. super.show();
  17337. xGame.common.gameMgr.gamePause = true;
  17338. this.openPressDotEvent();
  17339. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17340. this.centerPos.x = this.ui.white.x;
  17341. this.centerPos.y = this.ui.white.y;
  17342. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17343. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17344. this.setDot();
  17345. }
  17346. setDot() {
  17347. this.ui.dot.x = this.moveDest.x;
  17348. this.ui.dot.y = this.moveDest.y;
  17349. }
  17350. closeSelf() {
  17351. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17352. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17353. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17354. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17355. xGame.common.gameMgr.gamePause = false;
  17356. this.hide();
  17357. }
  17358. openPressDotEvent() {
  17359. this.closePressDotEvent();
  17360. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17361. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17362. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17363. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17364. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17365. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17366. }
  17367. closePressDotEvent() {
  17368. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17369. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17370. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17371. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17372. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17373. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17374. }
  17375. onDown(e) {
  17376. if (e.type == Laya.Event.MOUSE_DOWN)
  17377. this.isPressd = true;
  17378. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17379. this.isPressd = false;
  17380. if (!this.isPressd)
  17381. return;
  17382. this.moveDest.x = e.stageX;
  17383. this.moveDest.y = e.stageY;
  17384. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17385. if (dis > 6724) {
  17386. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17387. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17388. }
  17389. this.setDot();
  17390. }
  17391. resetRod() {
  17392. this.ui.dot.x = this.ui.white.x;
  17393. this.ui.dot.y = this.ui.white.y;
  17394. this.gameRod.dot.x = this.gameRod.bg.x;
  17395. this.gameRod.dot.y = this.gameRod.bg.y;
  17396. xGame.common.rodOffest.x = 0;
  17397. xGame.common.rodOffest.y = 0;
  17398. }
  17399. }
  17400. UIRodMethod$1.uiName = "UIRodMethod";
  17401. class UIMsg$1 extends UIBase {
  17402. constructor() {
  17403. super();
  17404. }
  17405. onConstructor() {
  17406. this.ui = ui_UIMsg.createInstance();
  17407. this.contentPane = this.ui;
  17408. this.isEject = false;
  17409. this.isMuti = true;
  17410. }
  17411. show(msg, callback) {
  17412. super.show();
  17413. this.ui.tipsNode.msgTxt.text = msg;
  17414. this.ui.alpha = 1;
  17415. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17416. this.hide();
  17417. callback && callback();
  17418. }), 1000);
  17419. }
  17420. }
  17421. UIMsg$1.uiName = "UIMsg";
  17422. class UITips$1 extends UIBase {
  17423. constructor() {
  17424. super();
  17425. this.type = 0;
  17426. }
  17427. onConstructor() {
  17428. this.ui = ui_UITips.createInstance();
  17429. this.contentPane = this.ui;
  17430. this.isEject = false;
  17431. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17432. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17433. }
  17434. show(tipsTxt, womanTxt, type) {
  17435. super.show();
  17436. this.ui.t0.play();
  17437. this.ui.myNode.tipsTxt.text = tipsTxt;
  17438. this.ui.myNode.womanTxt.text = womanTxt;
  17439. PlatMgr.showInsert(true);
  17440. this.ui.myNode.c1.selectedIndex = type;
  17441. this.type = type;
  17442. switch (this.type) {
  17443. case TipsType.exitGame:
  17444. xGame.common.gameMgr.gamePause = true;
  17445. break;
  17446. case TipsType.foul:
  17447. Laya.timer.once(200, this, () => {
  17448. xGame.common.gameMgr.gamePause = true;
  17449. });
  17450. break;
  17451. default:
  17452. break;
  17453. }
  17454. }
  17455. clickLeftBtn() {
  17456. this.hide();
  17457. xGame.common.gameMgr.gamePause = false;
  17458. switch (this.type) {
  17459. case TipsType.exitGame:
  17460. break;
  17461. case TipsType.foul:
  17462. break;
  17463. default:
  17464. break;
  17465. }
  17466. }
  17467. clickRightBtn() {
  17468. this.hide();
  17469. switch (this.type) {
  17470. case TipsType.exitGame:
  17471. xGame.eventMgr.event(RESET_GAME);
  17472. xGame.uiMgr.Show(UIMain$1);
  17473. Moyu.recordEnd(this, null);
  17474. xGame.common.longHelpLine = false;
  17475. break;
  17476. case TipsType.foul:
  17477. xGame.common.gameMgr.gamePause = false;
  17478. Laya.timer.clearAll(this);
  17479. break;
  17480. default:
  17481. break;
  17482. }
  17483. }
  17484. }
  17485. UITips$1.uiName = "UITips";
  17486. class UIGame$1 extends UIBase {
  17487. constructor() {
  17488. super();
  17489. this.powerNum = 0;
  17490. this.isD3Inited = false;
  17491. this.isPrePlay = false;
  17492. this.isMoveRod = false;
  17493. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17494. this.rulerDis = 20;
  17495. this.rulerOffset = 0;
  17496. }
  17497. onConstructor() {
  17498. this.ui = ui_UIGame.createInstance();
  17499. this.contentPane = this.ui;
  17500. this.ui.x += xGame.common.sysOffestNum;
  17501. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17502. this.isEject = false;
  17503. xGame.common.gameUI = this;
  17504. this.initSelf();
  17505. }
  17506. isTurnSelf() {
  17507. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17508. return true;
  17509. }
  17510. }
  17511. initSelf() {
  17512. let topUI = this.ui.topNode;
  17513. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17514. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17515. this.barInfo = {};
  17516. this.barInfo.curY = 0;
  17517. this.barInfo.height = this.ui.powerNode.height;
  17518. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17519. this.barInfo.powerStartY = this.ui.powerNode.y;
  17520. xGame.common.aiPlayer = new AIPlayer();
  17521. xGame.common.gameMgr = new GameMgr();
  17522. xGame.common.skillMgr = new SkillMgr();
  17523. xGame.common.wordsMgr = new WordsMgr();
  17524. xGame.common.talkMgr = new TalkMgr();
  17525. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17526. console.log("加载经典模式表情文件chenggon !");
  17527. });
  17528. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17529. console.log("挑战模式奖励模式spine加载成功!");
  17530. });
  17531. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17532. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17533. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17534. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17535. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17536. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17537. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17538. }
  17539. returnHome() {
  17540. let tips = "Are you sure to exit the game?";
  17541. let woman = "Boss, why don't you play for a while longer?";
  17542. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17543. }
  17544. addRodMethodClick() {
  17545. if (this.isTurnSelf()) {
  17546. xGame.uiMgr.Show(UIRodMethod$1);
  17547. }
  17548. }
  17549. clickHelpLineBtn(force = false) {
  17550. if (!this.isTurnSelf())
  17551. return;
  17552. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17553. if (success) {
  17554. xGame.common.longHelpLine = true;
  17555. xGame.common.d2World.getHelpLine();
  17556. Moyu.sendDataEvent("guideNum");
  17557. }
  17558. else {
  17559. }
  17560. });
  17561. }
  17562. renderSelfDisplayBalls(index, target) {
  17563. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17564. target.myImg.url = xGame.common.getGameIconUrl(str);
  17565. }
  17566. renderAIDisplayBalls(index, target) {
  17567. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17568. target.myImg.url = xGame.common.getGameIconUrl(str);
  17569. ;
  17570. }
  17571. updateMode() {
  17572. if (xGame.common.gameMode == GameMode.classic) {
  17573. this.ui.topNode.scoreNode.visible = false;
  17574. }
  17575. else if (xGame.common.gameMode == GameMode.bigMove) {
  17576. this.ui.topNode.scoreNode.visible = true;
  17577. }
  17578. }
  17579. show() {
  17580. super.show();
  17581. console.log("zh:uigame show");
  17582. this.ui.alpha = 0;
  17583. this.updateSelf();
  17584. console.log("zh:uigame bf gamemusic01 start");
  17585. xGame.soundMgr.playMusic("gamemusic01");
  17586. console.log("zh:uigame bf gamemusic01 end");
  17587. xGame.common.gameMgr.gamePause = false;
  17588. xGame.common.gameUI.ui.blackAni.visible = false;
  17589. xGame.common.gameUI.ui.whiteAni.visible = false;
  17590. this.ui.powerEft.visible = false;
  17591. this.ui.colorNode.visible = false;
  17592. this.updateHead();
  17593. }
  17594. updateSelf() {
  17595. if (xGame.common.gameMode == GameMode.classic) {
  17596. this.ui.c1.selectedIndex = 0;
  17597. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17598. this.ui.topNode.middleNode.visible = true;
  17599. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17600. }
  17601. else if (xGame.common.gameMode == GameMode.bigMove) {
  17602. this.ui.c1.selectedIndex = 0;
  17603. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17604. this.ui.topNode.middleNode.visible = false;
  17605. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17606. let rand = xGame.common.randomNum(1, max);
  17607. let guide = DataMgr.getSkillGuide();
  17608. if (guide == 0)
  17609. rand = 1;
  17610. xGame.common.bigMoveLevelIndex = rand;
  17611. }
  17612. else if (xGame.common.gameMode == GameMode.placeBall) {
  17613. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17614. this.ui.c1.selectedIndex = 1 + data.type;
  17615. this.ui.alpha = 1;
  17616. this.startGame();
  17617. }
  17618. this.updateMode();
  17619. this.initD3world();
  17620. this.initD2world();
  17621. }
  17622. startGame() {
  17623. this.ui.snowNode.visible = Math.random() <= 0.1;
  17624. this.ui.d2Node.visible = false;
  17625. xGame.common.d3World.d3Hand.gameObj.active = false;
  17626. xGame.common.d3World.tableSrc.init();
  17627. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17628. this.cameraViewChange(() => {
  17629. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17630. switch (xGame.common.gameMode) {
  17631. case GameMode.classic:
  17632. xGame.common.d3World.d3Hand.gameObj.active = true;
  17633. this.playPutBallD3Ani();
  17634. break;
  17635. case GameMode.bigMove:
  17636. this.enterGame();
  17637. Laya.timer.once(500, this, () => {
  17638. this.ui.topNode.middleNode.visible = true;
  17639. this.ui.topNode.middleNode.t0.play();
  17640. });
  17641. break;
  17642. case GameMode.placeBall:
  17643. this.enterGame();
  17644. break;
  17645. default:
  17646. break;
  17647. }
  17648. });
  17649. PlatMgr.showBanner(false);
  17650. }
  17651. enterGame() {
  17652. this.ui.d2Node.visible = true;
  17653. xGame.common.d3World.d3Hand.gameObj.active = false;
  17654. xGame.common.showOneCamera("mainCamera");
  17655. Moyu.recordGame(30, true);
  17656. if (!this.isPrePlay) {
  17657. this.isPrePlay = true;
  17658. xGame.common.d3World.prePlayEft();
  17659. }
  17660. xGame.common.gameMgr.gameReady();
  17661. this.openAllEvent();
  17662. this.ui.snowNode.visible = false;
  17663. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17664. this.ui.helpBtn.visible = condition;
  17665. }
  17666. showHelpLineGuide() {
  17667. let longGuide = DataMgr.getGuideHelpLine();
  17668. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17669. this.ui.helpBtn.visible = true;
  17670. this.ui.guideNode.visible = true;
  17671. }
  17672. }
  17673. setTurnAlpha(alpha) {
  17674. this.ui.keduNode.alpha = alpha;
  17675. this.ui.ganNode.alpha = alpha;
  17676. this.ui.rodMethodNode.alpha = alpha;
  17677. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17678. }
  17679. cameraViewChange(callback) {
  17680. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17681. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17682. xGame.common.showOneCamera("visitAngle");
  17683. cameraSrc.localRotationEulerY = 180;
  17684. cameraSrc.localRotationEulerZ = 0;
  17685. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17686. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17687. callback && callback();
  17688. }));
  17689. }));
  17690. }
  17691. playPutBallD3Ani() {
  17692. xGame.common.showOneCamera("mainCamera");
  17693. let handSrc = xGame.common.d3World.d3Hand;
  17694. handSrc.gameObj.active = true;
  17695. handSrc.transform.localPositionZ = 3;
  17696. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17697. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17698. handSrc.gameObj.active = false;
  17699. this.enterGame();
  17700. }), 400);
  17701. }));
  17702. }
  17703. updateHead() {
  17704. let user = Moyu.getUserInfo();
  17705. this.ui.topNode.selfNameTxt.text = user.nickName;
  17706. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17707. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17708. if (DataMgr.getSkillGuide() < 1) {
  17709. this.ui.topNode.aiNameTxt.text = 'billiards';
  17710. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17711. }
  17712. else {
  17713. this.ui.topNode.aiNameTxt.text = aiData.name;
  17714. let randNo = Math.floor(Math.random() * 10) + 1;
  17715. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17716. }
  17717. }
  17718. initD2world() {
  17719. let node = this.ui.d2Root.displayObject;
  17720. let src = node.getComponent(D2World);
  17721. if (!src) {
  17722. xGame.common.d2World = node.addComponent(D2World);
  17723. }
  17724. xGame.common.d2World.initSelf();
  17725. }
  17726. initD3world() {
  17727. if (this.isD3Inited)
  17728. return;
  17729. this.isD3Inited = true;
  17730. let scene3D = xGame.common.d3Scene;
  17731. this.ui.d3Root.displayObject.addChild(scene3D);
  17732. scene3D.active = true;
  17733. xGame.common.d3World.tableSrc.setBorderPos();
  17734. }
  17735. onRootMove(e) {
  17736. let rootBall = xGame.common.d2World.rootBall;
  17737. this.ui.moveNode.x = e.x;
  17738. this.ui.moveNode.y = e.y;
  17739. rootBall.gameObj.x = e.x;
  17740. rootBall.gameObj.y = e.y;
  17741. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17742. }
  17743. aiRootMove(move) {
  17744. if (move)
  17745. this.hideBallUI();
  17746. else {
  17747. this.showBallUI();
  17748. xGame.common.d2World.getHelpLine();
  17749. }
  17750. }
  17751. aiForce(type, force = 0) {
  17752. this.pressTarget = PressType.powerNode;
  17753. if (type == 1)
  17754. this.onEventUp({ force: true });
  17755. else if (type == 2)
  17756. this.onEventMove({ stageY: force, force: true });
  17757. }
  17758. onEventPress(e) {
  17759. if (e.stopPropagation)
  17760. e.stopPropagation();
  17761. if (!this.isTurnSelf())
  17762. return;
  17763. let target = e.target;
  17764. switch (target) {
  17765. case this.ui.myPowerNode.displayObject:
  17766. this.pressTarget = PressType.powerNode;
  17767. this.barInfo.curY = e.stageY;
  17768. this.updateBarInfo();
  17769. break;
  17770. case this.ui.moveNode.displayObject:
  17771. this.pressTarget = PressType.moveNode;
  17772. this.hideBallUI();
  17773. this.eventObj.curX = this.ui.moveNode.x;
  17774. this.eventObj.curY = this.ui.moveNode.y;
  17775. this.ui.moveNode.finger.visible = false;
  17776. this.eventObj.lastX = e.stageX;
  17777. this.eventObj.lastY = e.stageY;
  17778. break;
  17779. case this.ui.rulerClickNode.displayObject:
  17780. this.pressTarget = PressType.rulerNode;
  17781. this.eventObj.lastY = e.stageY;
  17782. break;
  17783. case this.ui.d2Root.displayObject:
  17784. this.pressTarget = PressType.d2Root;
  17785. this.eventObj.lastX = e.stageX;
  17786. this.eventObj.lastY = e.stageY;
  17787. this.eventObj.starX = e.stageX;
  17788. this.eventObj.starY = e.stageY;
  17789. this.eventObj.curX = 0;
  17790. this.eventObj.curY = 0;
  17791. xGame.common.d2World.d2Gan.setGanLastInfo();
  17792. this.rulerOffset = 0;
  17793. break;
  17794. default:
  17795. break;
  17796. }
  17797. }
  17798. onEventMove(e) {
  17799. if (e.stopPropagation)
  17800. e.stopPropagation();
  17801. if (e && e.force) {
  17802. }
  17803. else {
  17804. if (!this.isTurnSelf())
  17805. return;
  17806. }
  17807. switch (this.pressTarget) {
  17808. case PressType.powerNode:
  17809. this.barInfo.curY = e.stageY;
  17810. this.updateBarInfo();
  17811. this.isMoveRod = true;
  17812. break;
  17813. case PressType.moveNode:
  17814. let rootBall = xGame.common.d2World.rootBall;
  17815. let radius = rootBall.gameObj.width / 2;
  17816. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17817. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17818. let border = xGame.common.d2World.borderRect;
  17819. if (curX <= border.x + radius)
  17820. curX = border.x + radius;
  17821. else if (curX >= border.x + border.width - radius)
  17822. curX = border.x + border.width - radius;
  17823. if (curY <= border.y + radius)
  17824. curY = border.y + radius;
  17825. else if (curY >= border.y + border.height - radius)
  17826. curY = border.y + border.height - radius;
  17827. if (xGame.common.gameMgr.isOpenBall) {
  17828. if (curX >= border.x + border.openBallW - radius)
  17829. curX = border.x + border.openBallW - radius;
  17830. }
  17831. this.ui.moveNode.x = curX;
  17832. this.ui.moveNode.y = curY;
  17833. rootBall.gameObj.x = curX;
  17834. rootBall.gameObj.y = curY;
  17835. rootBall.d3BallSrc.setTransPos(curX, curY);
  17836. this.isMoveRod = true;
  17837. break;
  17838. case PressType.rulerNode:
  17839. let yy = e.stageY - this.eventObj.lastY;
  17840. this.eventObj.lastY = e.stageY;
  17841. let ruler1 = this.ui.rulerNode.img1;
  17842. let ruler2 = this.ui.rulerNode.img2;
  17843. ruler1.y += yy;
  17844. ruler2.y += yy;
  17845. this.rulerOffset += yy;
  17846. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17847. this.rulerOffset = 0;
  17848. xGame.soundMgr.playSound("inch", 1, 10);
  17849. }
  17850. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17851. let h = ruler1.height;
  17852. this.checkGuide();
  17853. this.isMoveRod = true;
  17854. if (ruler1.y >= h) {
  17855. ruler1.y = -h;
  17856. ruler2.y = 0;
  17857. return;
  17858. }
  17859. else if (ruler1.y <= -h) {
  17860. ruler1.y = h;
  17861. ruler2.y = 0;
  17862. return;
  17863. }
  17864. if (ruler2.y >= h) {
  17865. ruler2.y = -h;
  17866. ruler1.y = 0;
  17867. return;
  17868. }
  17869. else if (ruler2.y <= -h) {
  17870. ruler2.y = h;
  17871. ruler1.y = 0;
  17872. return;
  17873. }
  17874. break;
  17875. case PressType.d2Root:
  17876. this.eventObj.curX = e.stageX;
  17877. this.eventObj.curY = e.stageY;
  17878. let offset = this.checkRodMoveDir();
  17879. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17880. this.eventObj.lastX = e.stageX;
  17881. this.eventObj.lastY = e.stageY;
  17882. break;
  17883. default:
  17884. break;
  17885. }
  17886. }
  17887. onEventUp(e) {
  17888. if (e.stopPropagation)
  17889. e.stopPropagation();
  17890. if (e && e.force) {
  17891. }
  17892. else {
  17893. if (!this.isTurnSelf())
  17894. return;
  17895. }
  17896. switch (this.pressTarget) {
  17897. case PressType.powerNode:
  17898. this.ui.powerNode.value = 0;
  17899. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17900. this.ui.powerTxt.text = "";
  17901. if (this.powerNum > 0) {
  17902. xGame.eventMgr.event(BALL_SHOOT);
  17903. xGame.common.d2World.shoot(this.powerNum);
  17904. xGame.common.d2World.d2Gan.shoot();
  17905. xGame.common.d2World.d2HelpLine.shoot();
  17906. this.finishGuide();
  17907. this.ui.powerEft.visible = false;
  17908. this.ui.colorNode.visible = false;
  17909. let ganStr = "";
  17910. if (this.powerNum <= 30) {
  17911. ganStr = "gan_30";
  17912. }
  17913. else if (this.powerNum <= 60) {
  17914. ganStr = "gan_50";
  17915. }
  17916. else {
  17917. ganStr = "gan_80";
  17918. }
  17919. xGame.soundMgr.playSound(ganStr);
  17920. }
  17921. break;
  17922. case PressType.moveNode:
  17923. let rootBall = xGame.common.d2World.rootBall;
  17924. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17925. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17926. let isIntersect = this.judgeBallIntersect();
  17927. if (isIntersect) {
  17928. this.ui.moveNode.x = lastX;
  17929. this.ui.moveNode.y = lastY;
  17930. rootBall.gameObj.x = lastX;
  17931. rootBall.gameObj.y = lastY;
  17932. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17933. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17934. }
  17935. else {
  17936. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17937. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17938. }
  17939. this.showBallUI();
  17940. this.ui.moveNode.finger.visible = true;
  17941. xGame.common.d2World.getHelpLine();
  17942. break;
  17943. case PressType.rulerNode:
  17944. break;
  17945. case PressType.d2Root:
  17946. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17947. if (dis <= 25) {
  17948. this.moveToClickDot(e);
  17949. }
  17950. break;
  17951. default:
  17952. break;
  17953. }
  17954. this.pressTarget = -1;
  17955. }
  17956. checkGuide() {
  17957. let guide = DataMgr.getSkillGuide();
  17958. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17959. xGame.common.guideStep++;
  17960. xGame.common.gameUI.ui.guide2.visible = false;
  17961. xGame.common.gameUI.ui.guide3.visible = true;
  17962. }
  17963. }
  17964. finishGuide() {
  17965. let guide = DataMgr.getSkillGuide();
  17966. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17967. xGame.common.guideStep = 10;
  17968. this.closeAllGuide();
  17969. }
  17970. }
  17971. closeAllGuide() {
  17972. xGame.common.gameUI.ui.guide1.visible = false;
  17973. xGame.common.gameUI.ui.guide2.visible = false;
  17974. xGame.common.gameUI.ui.guide3.visible = false;
  17975. }
  17976. updateBarInfo() {
  17977. let star = this.ui.powerNode.y;
  17978. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17979. if (rate >= 1)
  17980. rate = 1;
  17981. if (rate <= 0)
  17982. rate = 0;
  17983. this.powerNum = Math.ceil(rate * 100);
  17984. this.ui.powerNode.value = this.powerNum;
  17985. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17986. this.ui.colorNode.value = this.powerNum;
  17987. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17988. this.ui.powerEft.visible = this.powerNum != 0;
  17989. this.ui.colorNode.visible = this.powerNum != 0;
  17990. this.ui.powerTxt.text = this.powerNum + "";
  17991. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17992. }
  17993. forceCancel() {
  17994. this.ui.powerNode.value = 0;
  17995. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17996. this.ui.powerTxt.text = "";
  17997. }
  17998. checkRodMoveDir() {
  17999. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18000. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18001. if (tempX >= 0 && tempY <= 0) {
  18002. return this.checkDir();
  18003. }
  18004. else if (tempX < 0 && tempY < 0) {
  18005. return this.checkDir(1, -1);
  18006. }
  18007. else if (tempX < 0 && tempY > 0) {
  18008. return this.checkDir(-1, -1);
  18009. }
  18010. else {
  18011. return this.checkDir(-1, 1);
  18012. }
  18013. }
  18014. checkDir(flagX = 1, flagY = 1) {
  18015. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18016. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18017. if (offsetY == 0) {
  18018. return offsetX * flagX;
  18019. }
  18020. if (offsetX == 0) {
  18021. return offsetY * flagY;
  18022. }
  18023. let angle = offsetY / offsetX;
  18024. if (Math.abs(angle) >= 1) {
  18025. return offsetY * flagY;
  18026. }
  18027. else {
  18028. return offsetX * flagX;
  18029. }
  18030. }
  18031. judgeBallIntersect() {
  18032. let rootBall = xGame.common.d2World.rootBall;
  18033. let ballArr = xGame.common.d2World.ballArr;
  18034. let radius = rootBall.gameObj.width / 2;
  18035. let temp;
  18036. let isIntersect = false;
  18037. for (let index = 0; index < ballArr.length; index++) {
  18038. temp = ballArr[index];
  18039. if (temp.number == rootBall.number)
  18040. continue;
  18041. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18042. if (isIntersect) {
  18043. break;
  18044. }
  18045. }
  18046. return isIntersect;
  18047. }
  18048. hideBallUI() {
  18049. let d2Gan = xGame.common.d2World.d2Gan;
  18050. if (!d2Gan.ui.isDisposed)
  18051. d2Gan.ui.visible = false;
  18052. let d2Help = xGame.common.d2World.d2HelpLine;
  18053. if (!d2Help.ui.isDisposed)
  18054. d2Help.ui.visible = false;
  18055. let rootBall = xGame.common.d2World.rootBall;
  18056. if (!rootBall.destroyed) {
  18057. rootBall.gameObj.active = false;
  18058. }
  18059. }
  18060. showBallUI() {
  18061. let d2Gan = xGame.common.d2World.d2Gan;
  18062. if (!d2Gan.ui.isDisposed)
  18063. d2Gan.ui.visible = true;
  18064. let d2Help = xGame.common.d2World.d2HelpLine;
  18065. if (!d2Help.ui.isDisposed)
  18066. d2Help.ui.visible = true;
  18067. let rootBall = xGame.common.d2World.rootBall;
  18068. if (!rootBall.destroyed) {
  18069. rootBall.gameObj.active = true;
  18070. }
  18071. }
  18072. moveToClickDot(e) {
  18073. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18074. let root = xGame.common.d2World.rootBall.gameObj;
  18075. let xx = e.stageX - xGame.common.sysOffestNum;
  18076. let yy = e.stageY;
  18077. let x = xx - root.x;
  18078. let y = yy - root.y;
  18079. let angle = xGame.common.getfguiRotation(x, y);
  18080. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18081. xGame.common.d2World.getHelpLine();
  18082. }
  18083. this.isMoveRod = false;
  18084. xGame.common.clickedBall = false;
  18085. }
  18086. openAllEvent() {
  18087. this.closeAllEvent();
  18088. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18089. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18090. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18091. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18092. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18093. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18094. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18095. }
  18096. closeAllEvent() {
  18097. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18098. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18099. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18100. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18101. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18102. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18103. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18104. }
  18105. resetGame() {
  18106. this.closeAllEvent();
  18107. this.hideBallUI();
  18108. xGame.common.gameMgr.gamePause = true;
  18109. }
  18110. }
  18111. UIGame$1.uiName = "UIGame";
  18112. class UIAddCoin$1 extends UIBase {
  18113. constructor() {
  18114. super();
  18115. this.coinNum = 2000;
  18116. }
  18117. onConstructor() {
  18118. this.ui = ui_UIAddCoin.createInstance();
  18119. this.contentPane = this.ui;
  18120. this.isEject = false;
  18121. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18122. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18123. }
  18124. show() {
  18125. super.show();
  18126. this.ui.t0.play();
  18127. }
  18128. videoAddCoin() {
  18129. console.log('zh:qjff_AD_for_UIAddCoin');
  18130. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18131. }
  18132. else {
  18133. console.log('zh:AD 失败,直接发放奖励');
  18134. this.qjff_AD_for_UIAddCoin();
  18135. }
  18136. }
  18137. qjff_AD_for_UIAddCoin() {
  18138. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18139. this.hide();
  18140. }
  18141. }
  18142. UIAddCoin$1.uiName = "UIAddCoin";
  18143. class UIInvitation$1 extends UIBase {
  18144. constructor() {
  18145. super();
  18146. }
  18147. onConstructor() {
  18148. this.ui = ui_UIInvitation.createInstance();
  18149. this.contentPane = this.ui;
  18150. this.isEject = false;
  18151. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18152. }
  18153. show() {
  18154. super.show();
  18155. }
  18156. enterGame() {
  18157. xGame.common.gameMode = GameMode.classic;
  18158. DataMgr.setChallengeTimes(1);
  18159. xGame.common.passAwardCoin = 2000;
  18160. let need = xGame.common.classicNiceNeddCoin;
  18161. if (DataMgr.coinEnough(need)) {
  18162. DataMgr.setCoin(-need);
  18163. xGame.eventMgr.event(RESTART_GAME, true);
  18164. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18165. }
  18166. else {
  18167. xGame.eventMgr.event(RESTART_GAME, true);
  18168. }
  18169. this.hide();
  18170. }
  18171. hide() {
  18172. super.hide();
  18173. }
  18174. }
  18175. UIInvitation$1.uiName = "UIInvitation";
  18176. class UIPower$1 extends UIBase {
  18177. constructor() {
  18178. super();
  18179. }
  18180. onConstructor() {
  18181. this.ui = ui_UIPower.createInstance();
  18182. this.contentPane = this.ui;
  18183. this.isEject = false;
  18184. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18185. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18186. }
  18187. show() {
  18188. super.show();
  18189. this.ui.t0.play();
  18190. }
  18191. videoGetPower() {
  18192. console.log('zh:qjff_AD_for_uipower');
  18193. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18194. }
  18195. else {
  18196. console.log('zh:AD 失败,直接发放奖励');
  18197. this.qjff_AD_for_uipower();
  18198. }
  18199. }
  18200. qjff_AD_for_uipower() {
  18201. DataMgr.setPower(xGame.common.videoPower, true);
  18202. xGame.eventMgr.event(POWER_TIME);
  18203. this.hide();
  18204. }
  18205. }
  18206. UIPower$1.uiName = "UIPower";
  18207. class UIGameEnd$1 extends UIBase {
  18208. constructor() {
  18209. super();
  18210. this.success = false;
  18211. this.awardCoinNum = 1000;
  18212. this.awardDiamondNum = 10;
  18213. }
  18214. onConstructor() {
  18215. this.ui = ui_UIGameEnd.createInstance();
  18216. this.contentPane = this.ui;
  18217. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18218. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18219. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18220. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18221. this.ui.talkNode.visible = false;
  18222. if (Moyu.isKs)
  18223. this.ui.closeNode.closeBtn.x += 100;
  18224. }
  18225. updateType() {
  18226. switch (xGame.common.gameMode) {
  18227. case GameMode.classic:
  18228. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18229. this.ui.coinNode.visible = this.success;
  18230. if (!this.success) {
  18231. Laya.timer.once(500, this, () => {
  18232. xGame.uiMgr.Show(UIAddCoin$1);
  18233. });
  18234. }
  18235. this.ui.isGetAward.visible = false;
  18236. this.ui.leftBtn.c1.selectedIndex = 3;
  18237. this.ui.rightBtn.c1.selectedIndex = 0;
  18238. this.moneyNode.ui.c1.selectedIndex = 1;
  18239. break;
  18240. case GameMode.bigMove:
  18241. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18242. this.ui.coinNode.visible = this.success;
  18243. if (xGame.common.gameMode == GameMode.bigMove) {
  18244. if (this.success) {
  18245. DataMgr.setSkillSuccessTimes(1, true);
  18246. DataMgr.setSkillAccTimes(1);
  18247. }
  18248. else {
  18249. DataMgr.setSkillSuccessTimes(0, false);
  18250. }
  18251. }
  18252. if (!this.success) {
  18253. Laya.timer.once(500, this, () => {
  18254. xGame.uiMgr.Show(UIAddCoin$1);
  18255. });
  18256. }
  18257. this.ui.isGetAward.visible = false;
  18258. this.ui.leftBtn.c1.selectedIndex = 3;
  18259. this.ui.rightBtn.c1.selectedIndex = 0;
  18260. this.moneyNode.ui.c1.selectedIndex = 1;
  18261. break;
  18262. case GameMode.placeBall:
  18263. this.ui.coinNode.visible = false;
  18264. if (this.success) {
  18265. if (xGame.common.placeBallStarNum == 3) {
  18266. this.ui.c1.selectedIndex = 2;
  18267. }
  18268. else {
  18269. this.ui.c1.selectedIndex = 3;
  18270. }
  18271. }
  18272. else {
  18273. this.ui.c1.selectedIndex = 4;
  18274. }
  18275. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18276. if (cfg.type == PlaceBallType.challenge) {
  18277. this.ui.c1.selectedIndex = 2;
  18278. }
  18279. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18280. this.updatePlaceBallBtn();
  18281. this.updatePlaceBallStarNum();
  18282. this.updatePlaceBallAwardState();
  18283. this.moneyNode.ui.c1.selectedIndex = 2;
  18284. this.moneyNode.checkPowerTime();
  18285. this.moneyNode.powerChange();
  18286. DataMgr.upRankData();
  18287. break;
  18288. default:
  18289. break;
  18290. }
  18291. }
  18292. updatePlaceBallBtn() {
  18293. this.ui.leftBtn.c1.selectedIndex = 5;
  18294. if (this.success) {
  18295. this.ui.rightBtn.c1.selectedIndex = 14;
  18296. }
  18297. else {
  18298. if (xGame.common.placeBallStarNum == 3) {
  18299. this.ui.rightBtn.c1.selectedIndex = 14;
  18300. }
  18301. else {
  18302. this.ui.rightBtn.c1.selectedIndex = 1;
  18303. }
  18304. }
  18305. }
  18306. updatePlaceBallStarNum() {
  18307. let starNum = xGame.common.placeBallStarNum;
  18308. if (starNum == 0)
  18309. this.ui.starNumNode.c1.selectedIndex = 3;
  18310. else {
  18311. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18312. }
  18313. }
  18314. updatePlaceBallAwardState() {
  18315. let level = xGame.common.placeBallCurLevel;
  18316. let starNum = xGame.common.placeBallStarNum;
  18317. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18318. let data = cfgTable.placeballData[level].award;
  18319. let cfg = cfgTable.placeballData[level];
  18320. this.awardDiamondNum = data[1];
  18321. this.awardCoinNum = data[0];
  18322. if (cfg.type == PlaceBallType.challenge) {
  18323. this.awardDiamondNum = 0;
  18324. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18325. }
  18326. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18327. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18328. if (cfg.type == PlaceBallType.challenge) {
  18329. this.ui.awardNode.coinNode.visible = true;
  18330. }
  18331. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18332. this.ui.awardNode.diamondNode.x = 265;
  18333. this.ui.awardNode.coinNode.x = 354;
  18334. }
  18335. else {
  18336. this.ui.awardNode.diamondNode.x = 291;
  18337. this.ui.awardNode.coinNode.x = 291;
  18338. }
  18339. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18340. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18341. if (this.awardCoinNum == 0) {
  18342. this.ui.awardNode.coinNode.numTxt.text = "";
  18343. }
  18344. if (getAward) {
  18345. this.ui.isGetAward.visible = true;
  18346. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18347. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18348. }
  18349. else {
  18350. this.ui.isGetAward.visible = false;
  18351. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18352. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18353. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18354. }
  18355. else {
  18356. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18357. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18358. }
  18359. }
  18360. }
  18361. show(success) {
  18362. super.show();
  18363. xGame.eventMgr.event(RESET_GAME);
  18364. this.success = success;
  18365. Laya.timer.clearAll(this);
  18366. this.playSecretaryAni();
  18367. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18368. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18369. offsetTime = Math.floor(offsetTime / 1000);
  18370. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18371. this.updateType();
  18372. Laya.timer.once(200, this, () => {
  18373. this.addAward(() => {
  18374. this.updateType();
  18375. Laya.timer.once(500, this, () => {
  18376. this.showChallengeLevel();
  18377. });
  18378. });
  18379. });
  18380. if (this.success) {
  18381. xGame.soundMgr.playSound('slots_roll01');
  18382. xGame.soundMgr.playSound("s_win");
  18383. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18384. }
  18385. else {
  18386. xGame.soundMgr.playSound('matchwin01');
  18387. xGame.soundMgr.playSound("s_lose");
  18388. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18389. }
  18390. if (!Moyu.isLegal)
  18391. PlatMgr.showBanner(true);
  18392. let challengeNum = DataMgr.getChallengeTimes();
  18393. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18394. DataMgr.setChallengeTimes(1);
  18395. }
  18396. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18397. DataMgr.setClassicTimes();
  18398. }
  18399. }
  18400. showChallengeLevel() {
  18401. if (DataMgr.getChallengeTimes() != 0)
  18402. return;
  18403. let skill = DataMgr.getSkillAccTimes();
  18404. let put = DataMgr.getPlaceBallLevelList().length;
  18405. if (skill >= 3 || put >= 5) {
  18406. xGame.uiMgr.Show(UIInvitation$1);
  18407. this.hide();
  18408. }
  18409. }
  18410. addAward(callback) {
  18411. if (!this.success) {
  18412. callback && callback();
  18413. return;
  18414. }
  18415. switch (xGame.common.gameMode) {
  18416. case GameMode.classic:
  18417. this.awardCoinNum = xGame.common.passAwardCoin;
  18418. this.awardDiamondNum = 0;
  18419. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18420. break;
  18421. case GameMode.bigMove:
  18422. this.awardCoinNum = xGame.common.passAwardCoin;
  18423. this.awardDiamondNum = 0;
  18424. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18425. callback && callback();
  18426. break;
  18427. case GameMode.placeBall:
  18428. let level = xGame.common.placeBallCurLevel;
  18429. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18430. if (xGame.common.placeBallStarNum != 3) {
  18431. callback && callback();
  18432. return;
  18433. }
  18434. else {
  18435. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18436. if (getAward) {
  18437. callback && callback();
  18438. return;
  18439. }
  18440. }
  18441. let cfg = cfgTable.placeballData[level];
  18442. let data = cfgTable.placeballData[level].award;
  18443. this.awardCoinNum = data[0];
  18444. this.awardDiamondNum = data[1];
  18445. if (cfg.type == PlaceBallType.challenge) {
  18446. this.awardDiamondNum = 0;
  18447. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18448. }
  18449. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18450. let diamondAward;
  18451. if (this.awardDiamondNum > 0) {
  18452. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18453. xGame.common.getAward([diamondAward, coinAward], callback);
  18454. }
  18455. else {
  18456. xGame.common.getAward([coinAward], callback);
  18457. }
  18458. if (cfg.type == PlaceBallType.normal) {
  18459. DataMgr.setPlaceBallAward(level);
  18460. }
  18461. break;
  18462. default:
  18463. break;
  18464. }
  18465. }
  18466. playSecretaryAni_old() {
  18467. let parent = this.ui.secretary.displayObject;
  18468. parent.destroyChildren();
  18469. let xx = this.ui.secretary.width / 2;
  18470. let yy = this.ui.secretary.height;
  18471. let scale = xGame.common.getSecretaryScale();
  18472. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18473. if (this.success) {
  18474. let rand = Math.random() <= 0.5 ? 2 : 3;
  18475. xGame.common.secretary.play(data, rand, false, parent, () => {
  18476. xGame.common.secretary.play(data, 1, true, parent);
  18477. });
  18478. }
  18479. else {
  18480. xGame.common.secretary.play(data, 0, true, parent);
  18481. }
  18482. }
  18483. playSecretaryAni() {
  18484. let parent = this.ui.secretary.displayObject;
  18485. parent.destroyChildren();
  18486. let xx = this.ui.secretary.width / 2;
  18487. let yy = this.ui.secretary.height;
  18488. let scale = xGame.common.getSecretaryScale();
  18489. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18490. if (this.success) {
  18491. let rand = 0;
  18492. xGame.common.secretary.play(data, 0, true, parent);
  18493. }
  18494. else {
  18495. xGame.common.secretary.play(data, 0, true, parent);
  18496. }
  18497. }
  18498. restartGame() {
  18499. switch (xGame.common.gameMode) {
  18500. case GameMode.classic:
  18501. xGame.eventMgr.event(RESTART_GAME);
  18502. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18503. break;
  18504. case GameMode.bigMove:
  18505. this.hide();
  18506. xGame.eventMgr.event(RESTART_GAME);
  18507. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18508. break;
  18509. default:
  18510. break;
  18511. }
  18512. }
  18513. hide() {
  18514. super.hide();
  18515. xGame.common.stopGirlPop(this.ui.talkNode);
  18516. PlatMgr.showBanner(false);
  18517. }
  18518. returnHome() {
  18519. this.hide();
  18520. let showFailWords = !this.success;
  18521. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18522. }
  18523. clickLeftBtn() {
  18524. switch (xGame.common.gameMode) {
  18525. case GameMode.classic:
  18526. case GameMode.bigMove:
  18527. this.returnHome();
  18528. break;
  18529. case GameMode.placeBall:
  18530. let level = xGame.common.placeBallCurLevel;
  18531. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18532. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18533. break;
  18534. default:
  18535. break;
  18536. }
  18537. }
  18538. powerStartPlaceBallLevel(level, btn) {
  18539. if (DataMgr.powerEnough()) {
  18540. btn.touchable = false;
  18541. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18542. btn.touchable = true;
  18543. DataMgr.setPower(-1);
  18544. xGame.eventMgr.event(POWER_TIME);
  18545. this.startPlaceBallLevel(level);
  18546. }));
  18547. }
  18548. else {
  18549. xGame.uiMgr.Show(UIPower$1, 0);
  18550. }
  18551. }
  18552. clickRightBtn() {
  18553. switch (xGame.common.gameMode) {
  18554. case GameMode.classic:
  18555. console.log('zh:clickRightBtn 111');
  18556. case GameMode.bigMove:
  18557. console.log('zh:clickRightBtn 222');
  18558. this.restartGame();
  18559. break;
  18560. case GameMode.placeBall:
  18561. console.log('zh:clickRightBtn 333');
  18562. let level = xGame.common.placeBallCurLevel;
  18563. let data = DataMgr.getPlaceBallLevel(level);
  18564. let curPss = data.play && !data.isCur;
  18565. if (curPss) {
  18566. console.log('zh:clickRightBtn 333-111');
  18567. console.log('zh:当前LV=' + level);
  18568. if (level == 60) {
  18569. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18570. Laya.timer.once(3000, this, () => {
  18571. this.returnHome();
  18572. });
  18573. }
  18574. else {
  18575. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18576. }
  18577. }
  18578. else {
  18579. console.log('zh:clickRightBtn 333-000');
  18580. Moyu.sendDataEvent("placeBallNextLevel");
  18581. console.log('zh:qjff_AD_for_uiGameEnd');
  18582. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18583. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18584. }
  18585. else {
  18586. console.log('zh:AD 失败,直接发放奖励');
  18587. this.qjff_AD_for_uiGameEnd(level);
  18588. }
  18589. }
  18590. break;
  18591. default:
  18592. console.log('zh:clickRightBtn 444');
  18593. break;
  18594. }
  18595. }
  18596. qjff_AD_for_uiGameEnd(level) {
  18597. DataMgr.setPlaceBallLevel(level, 1);
  18598. this.startPlaceBallLevel(level + 1);
  18599. }
  18600. startPlaceBallLevel(level) {
  18601. xGame.common.gameMode = GameMode.placeBall;
  18602. xGame.common.placeBallCurLevel = level;
  18603. xGame.uiMgr.Show(UIGame$1);
  18604. this.hide();
  18605. }
  18606. }
  18607. UIGameEnd$1.uiName = "UIGameEnd";
  18608. class ShowItem$1 {
  18609. constructor() {
  18610. this.ui = ui_ShowItem.createInstance();
  18611. }
  18612. destroySelf() {
  18613. if (!this.ui.isDisposed) {
  18614. this.ui.removeFromParent();
  18615. this.ui.dispose();
  18616. }
  18617. }
  18618. setParent(parent) {
  18619. parent.addChild(this.ui);
  18620. }
  18621. setPos(x, y) {
  18622. this.ui.x = x;
  18623. this.ui.y = y;
  18624. }
  18625. setUrl(index) {
  18626. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18627. }
  18628. }
  18629. class UILevelProp$1 extends UIBase {
  18630. constructor() {
  18631. super();
  18632. this.firstPos = 385;
  18633. this.secondPos = 467;
  18634. this.showItemArr = [];
  18635. }
  18636. onFontLoaded() {
  18637. try {
  18638. this.ui.myNode.conditionTxt.font = "arial";
  18639. console.log("zh: onFontLoaded 设置arial字体成功");
  18640. }
  18641. catch (error) {
  18642. console.log("zh: constructor onFontLoaded加载arial字体失败");
  18643. }
  18644. }
  18645. onConstructor() {
  18646. this.ui = ui_UILevelProp.createInstance();
  18647. this.contentPane = this.ui;
  18648. this.isEject = false;
  18649. this.addUIClick(this.ui.closeBtn, this.hide);
  18650. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18651. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18652. }
  18653. show(level) {
  18654. super.show();
  18655. this.ui.t1.play();
  18656. this.level = level;
  18657. this.data = cfgTable.placeballData[this.level];
  18658. this.updateSelf();
  18659. this.showPreView();
  18660. this.moneyNode.ui.c1.selectedIndex = 2;
  18661. this.moneyNode.checkPowerTime();
  18662. this.moneyNode.powerChange();
  18663. }
  18664. showPreView() {
  18665. let item;
  18666. let data;
  18667. for (let index = 0; index < this.showItemArr.length; index++) {
  18668. item = this.showItemArr[index];
  18669. item.destroySelf();
  18670. }
  18671. this.showItemArr = [];
  18672. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18673. for (const key in cfgData) {
  18674. data = cfgData[key];
  18675. item = new ShowItem$1();
  18676. item.setParent(this.ui.myNode.displayRoot);
  18677. item.setPos(data.x, data.y);
  18678. item.setUrl(data.value);
  18679. this.showItemArr.push(item);
  18680. }
  18681. }
  18682. updateSelf() {
  18683. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18684. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18685. if (this.data.ball == -1) {
  18686. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18687. }
  18688. else {
  18689. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  18690. }
  18691. let localData = DataMgr.getPlaceBallLevel(this.level);
  18692. let getAward = localData.getAward;
  18693. let cfg = cfgTable.placeballData[this.level];
  18694. let coin = this.data.award[0];
  18695. let diamond = this.data.award[1];
  18696. if (cfg.type == PlaceBallType.challenge) {
  18697. diamond = 0;
  18698. coin = 100;
  18699. }
  18700. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18701. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18702. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18703. if (cfg.type == PlaceBallType.challenge) {
  18704. this.ui.myNode.coinNode.numTxt.text = "";
  18705. }
  18706. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18707. if (coin > 0 && diamond > 0) {
  18708. this.ui.myNode.diamondNode.x = 385;
  18709. this.ui.myNode.coinNode.x = 467;
  18710. }
  18711. else {
  18712. this.ui.myNode.diamondNode.x = 385;
  18713. this.ui.myNode.coinNode.x = 385;
  18714. }
  18715. if (!getAward) {
  18716. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18717. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18718. }
  18719. else {
  18720. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18721. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18722. }
  18723. }
  18724. startGame() {
  18725. if (DataMgr.powerEnough()) {
  18726. this.ui.myNode.startBtn.touchable = false;
  18727. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18728. console.log('zh:startGame ');
  18729. this.ui.myNode.startBtn.touchable = true;
  18730. DataMgr.setPower(-1);
  18731. xGame.eventMgr.event(POWER_TIME);
  18732. xGame.common.gameMode = GameMode.placeBall;
  18733. xGame.common.placeBallCurLevel = this.level;
  18734. xGame.uiMgr.Show(UIGame$1);
  18735. xGame.uiMgr.Hide(UILevelDisplay$1);
  18736. xGame.uiMgr.Hide(UIMain$1);
  18737. this.hide();
  18738. }));
  18739. }
  18740. else {
  18741. console.log('zh:startGame no power');
  18742. xGame.uiMgr.Show(UIPower$1);
  18743. }
  18744. }
  18745. hide() {
  18746. super.hide();
  18747. }
  18748. }
  18749. UILevelProp$1.uiName = "UILevelProp";
  18750. class PutBallLevelDisplay$1 {
  18751. constructor(ui, index) {
  18752. this.index = 0;
  18753. this.ui = ui;
  18754. this.index = index;
  18755. this.ui.onClick(this, this.clickSelf);
  18756. this.updateSelf();
  18757. this.ui.levelTxt.text = (this.index + 1) + "";
  18758. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18759. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18760. }
  18761. updateSelf() {
  18762. let level = this.index + 1;
  18763. this.data = DataMgr.getPlaceBallLevel(level);
  18764. this.ui.starNode.c1.selectedIndex = this.data.star;
  18765. let isChallenge = cfgTable.placeballData[level].type;
  18766. if (this.data.isCur) {
  18767. if (isChallenge) {
  18768. this.ui.c1.selectedIndex = 5;
  18769. }
  18770. else {
  18771. this.ui.c1.selectedIndex = 2;
  18772. }
  18773. }
  18774. else {
  18775. if (this.data.play) {
  18776. if (this.data.star == 3) {
  18777. this.ui.c1.selectedIndex = 0;
  18778. }
  18779. else {
  18780. this.ui.c1.selectedIndex = 1;
  18781. }
  18782. }
  18783. else {
  18784. if (isChallenge) {
  18785. this.ui.c1.selectedIndex = 4;
  18786. }
  18787. else {
  18788. this.ui.c1.selectedIndex = 3;
  18789. }
  18790. }
  18791. }
  18792. }
  18793. clickSelf() {
  18794. if (!this.data.play)
  18795. return;
  18796. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18797. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18798. }
  18799. }
  18800. class UILevelDisplay$1 extends UIBase {
  18801. constructor() {
  18802. super();
  18803. }
  18804. onConstructor() {
  18805. this.ui = ui_UILevelDisplay.createInstance();
  18806. this.contentPane = this.ui;
  18807. this.isEject = false;
  18808. this.myList = this.ui.myNode.myList;
  18809. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18810. this.levelItemArr = [];
  18811. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18812. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18813. this.myList.numItems = levelNum;
  18814. if (Moyu.isKs)
  18815. this.ui.closeNode.closeBtn.x += 100;
  18816. }
  18817. levelItemRender(index, target) {
  18818. let item = new PutBallLevelDisplay$1(target, index);
  18819. this.levelItemArr.push(item);
  18820. }
  18821. show() {
  18822. super.show();
  18823. this.updateLevel();
  18824. this.scrollToPlace();
  18825. }
  18826. updateLevel() {
  18827. let temp;
  18828. for (let index = 0; index < this.levelItemArr.length; index++) {
  18829. temp = this.levelItemArr[index];
  18830. temp.updateSelf();
  18831. }
  18832. }
  18833. scrollToPlace() {
  18834. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18835. let passArr = DataMgr.getPlaceBallLevelList();
  18836. let offest = passArr.length;
  18837. if (offest >= maxNum - 1)
  18838. offest = maxNum - 1;
  18839. this.myList.scrollToView(offest, true, true);
  18840. }
  18841. hide() {
  18842. super.hide();
  18843. }
  18844. }
  18845. UILevelDisplay$1.uiName = "UILevelDisplay";
  18846. class UIMatching$1 extends UIBase {
  18847. constructor() {
  18848. super();
  18849. }
  18850. onConstructor() {
  18851. this.ui = ui_UIMatching.createInstance();
  18852. this.contentPane = this.ui;
  18853. this.isEject = false;
  18854. }
  18855. show(callback) {
  18856. super.show();
  18857. PlatMgr.showBanner(true);
  18858. this.callback = callback;
  18859. let user = Moyu.getUserInfo();
  18860. if (!this.selfPot) {
  18861. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18862. }
  18863. if (!this.aiPot) {
  18864. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18865. }
  18866. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18867. this.ui.selfHead.nameTxt.text = user.nickName;
  18868. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18869. this.ui.aiHead.nameTxt.text = "???";
  18870. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18871. this.ui.selfHead.c1.selectedIndex = 0;
  18872. this.ui.aiHead.c1.selectedIndex = 0;
  18873. this.ui.selfHead.x = this.selfPot.x;
  18874. this.ui.selfHead.y = this.selfPot.y;
  18875. this.ui.aiHead.x = this.aiPot.x;
  18876. this.ui.aiHead.y = this.aiPot.y;
  18877. switch (xGame.common.gameMode) {
  18878. case GameMode.classic:
  18879. break;
  18880. case GameMode.bigMove:
  18881. this.initSkillData();
  18882. break;
  18883. default:
  18884. break;
  18885. }
  18886. this.ui.t1.play(Laya.Handler.create(this, () => {
  18887. this.ui.t2.play(Laya.Handler.create(this, () => {
  18888. switch (xGame.common.gameMode) {
  18889. case GameMode.classic:
  18890. this.waitingPeople();
  18891. break;
  18892. case GameMode.bigMove:
  18893. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18894. break;
  18895. default:
  18896. break;
  18897. }
  18898. }));
  18899. }));
  18900. }
  18901. initSkillData() {
  18902. this.skillSelectData = [];
  18903. let skillUrl = xGame.common.skillIconList;
  18904. let skillName = xGame.common.skillNameList;
  18905. let skillLevel = DataMgr.getBigSkillList();
  18906. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18907. for (let index = 0; index < 5; index++) {
  18908. let obj = {};
  18909. obj.skillImg = skillUrl[index];
  18910. obj.skillName = skillName[index];
  18911. obj.skillType = skillType[index];
  18912. obj.skillLevel = skillLevel[index];
  18913. this.skillSelectData.push(obj);
  18914. }
  18915. }
  18916. getAISkillLevel(myLevel) {
  18917. let video = xGame.common.upSkillLevel;
  18918. let aiLevel;
  18919. let temp;
  18920. if (video) {
  18921. temp = xGame.common.randomNum(-2, -1);
  18922. }
  18923. else {
  18924. if (myLevel <= 5) {
  18925. temp = xGame.common.randomNum(1, 3);
  18926. }
  18927. else if (myLevel <= 9) {
  18928. temp = xGame.common.randomNum(-2, 1);
  18929. }
  18930. else {
  18931. temp = xGame.common.randomNum(-4, 0);
  18932. }
  18933. }
  18934. aiLevel = temp + myLevel;
  18935. if (aiLevel <= 1)
  18936. aiLevel = 1;
  18937. if (aiLevel >= 10)
  18938. aiLevel = 10;
  18939. return aiLevel;
  18940. }
  18941. getAISkillType() {
  18942. return xGame.common.randomNum(1, 4);
  18943. let successTimes = DataMgr.getSkillSuccessTimes();
  18944. let info = cfgTable.aiskillData[successTimes];
  18945. if (!info) {
  18946. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18947. info = cfgTable.aiskillData[max];
  18948. }
  18949. let dataArr = info.skillselect;
  18950. let myCfg = {};
  18951. for (let index = 0; index < dataArr.length; index++) {
  18952. let temp = dataArr[index].split('-');
  18953. myCfg[temp[0]] = {};
  18954. myCfg[temp[0]].id = parseInt(temp[0]);
  18955. myCfg[temp[0]].weight = parseInt(temp[1]);
  18956. }
  18957. let aiCfg = xGame.common.initWeight(myCfg);
  18958. let curData = xGame.common.getRandomWeightData(aiCfg);
  18959. return parseInt(curData.id);
  18960. }
  18961. getAISkillData(index) {
  18962. let myLevel = this.skillSelectData[index].skillLevel;
  18963. let aiLevel = this.getAISkillLevel(myLevel);
  18964. let aiType = this.getAISkillType() - 1;
  18965. return { aiLevel, aiType } = { aiLevel, aiType };
  18966. }
  18967. skillSelectFinish(index) {
  18968. let aiInfo = this.getAISkillData(index);
  18969. xGame.common.gameMgr.selfCurSkill = index;
  18970. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18971. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18972. this.ui.selfHead.c1.selectedIndex = 1;
  18973. this.ui.aiHead.c1.selectedIndex = 1;
  18974. let myData = this.skillSelectData[index];
  18975. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18976. let guide = DataMgr.getSkillGuide();
  18977. if (guide == 0) {
  18978. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18979. }
  18980. else {
  18981. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18982. }
  18983. let aiData = this.skillSelectData[aiInfo.aiType];
  18984. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18985. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18986. this.waitingPeople();
  18987. }
  18988. waitingPeople() {
  18989. let time = xGame.common.randomNum(1000, 3000);
  18990. time += 1000;
  18991. Laya.timer.once(time, this, () => {
  18992. this.matchingSuccess();
  18993. });
  18994. }
  18995. matchingSuccess() {
  18996. let gameUI = xGame.common.gameUI;
  18997. let name = gameUI.ui.topNode.aiNameTxt.text;
  18998. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18999. this.ui.aiHead.nameTxt.text = name;
  19000. this.ui.aiHead.headImg.url = url;
  19001. name = gameUI.ui.topNode.selfNameTxt.text;
  19002. url = gameUI.ui.topNode.selfHeadLoader.url;
  19003. this.ui.selfHead.nameTxt.text = name;
  19004. this.ui.selfHead.headImg.url = url;
  19005. this.ui.t3.play(Laya.Handler.create(this, () => {
  19006. this.callback && this.callback();
  19007. this.ui.t4.play(Laya.Handler.create(this, () => {
  19008. this.destroySelf();
  19009. }));
  19010. }));
  19011. }
  19012. destroySelf() {
  19013. this.callback = null;
  19014. this.skillSelectData = null;
  19015. this.selfPot = null;
  19016. this.aiPot = null;
  19017. if (!this.ui.isDisposed) {
  19018. this.ui.removeFromParent();
  19019. this.ui.dispose();
  19020. }
  19021. xGame.uiMgr.destroyUI(this);
  19022. }
  19023. }
  19024. UIMatching$1.uiName = "UIMatching";
  19025. class SkillDisplay$1 {
  19026. constructor(ui, data, uiIndex) {
  19027. this.starX = 0;
  19028. this.starY = 0;
  19029. this.index = 0;
  19030. this.ui = ui;
  19031. this.data = data;
  19032. this.index = uiIndex;
  19033. this.initSelf();
  19034. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19035. }
  19036. initSelf() {
  19037. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19038. this.ui.nameTxt.text = this.data.name;
  19039. this.ui.describeTxt.text = this.data.describe;
  19040. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19041. this.ui.startBtn.onClick(this, this.startGame);
  19042. this.updateSelf();
  19043. }
  19044. updateSelf() {
  19045. this.checkTry();
  19046. let level = DataMgr.getBigSkillByIndex(this.index);
  19047. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19048. }
  19049. checkTry() {
  19050. let index = this.index;
  19051. let level = DataMgr.getBigSkillByIndex(index);
  19052. if (level == null) {
  19053. DataMgr.setBigSkill(index, 1, false);
  19054. level = 1;
  19055. }
  19056. this.ui.levelTxt.text = "LV." + level;
  19057. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19058. this.ui.tryNode.visible = true;
  19059. else
  19060. this.ui.tryNode.visible = false;
  19061. }
  19062. clickAddLevel() {
  19063. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19064. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19065. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19066. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19067. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19068. }
  19069. else {
  19070. console.log('zh:AD 失败,直接发放奖励');
  19071. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19072. }
  19073. }
  19074. qjff_AD_for_skilldisplay_clickAddLevel() {
  19075. DataMgr.setBigSkill(this.data.index, 1);
  19076. this.updateSelf();
  19077. xGame.common.upSkillLevel = true;
  19078. }
  19079. startGame() {
  19080. if (this.data.index == 3) {
  19081. alert('Coming soon!');
  19082. return;
  19083. }
  19084. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19085. let needCoin = xGame.common.bigMoveNeedCoin;
  19086. xGame.common.passAwardCoin = 2000;
  19087. let guide = DataMgr.getSkillGuide();
  19088. console.log('zh:startGame guide=' + guide);
  19089. xGame.common.temSelfLevel = 0;
  19090. if (guide == 0) {
  19091. needCoin = 0;
  19092. xGame.common.temSelfLevel = 100;
  19093. }
  19094. if (DataMgr.coinEnough(needCoin)) {
  19095. DataMgr.setCoin(-needCoin);
  19096. xGame.common.curPlayerSkillType = this.index;
  19097. if (guide == 0)
  19098. xGame.common.curPlayerSkillType = 0;
  19099. xGame.uiMgr.Show(UIGame$1);
  19100. xGame.uiMgr.Hide(UIMain$1);
  19101. xGame.uiMgr.Show(UIMatching$1, () => {
  19102. xGame.common.gameUI.ui.alpha = 1;
  19103. xGame.common.gameUI.startGame();
  19104. xGame.uiMgr.Hide(UISkill$1);
  19105. });
  19106. }
  19107. else {
  19108. xGame.uiMgr.Show(UIAddProp$1, 0);
  19109. Moyu.sendDataEvent("AddCoinVideo");
  19110. }
  19111. }
  19112. }
  19113. class UISkill$1 extends UIBase {
  19114. constructor() {
  19115. super();
  19116. this.skillData = [];
  19117. }
  19118. onConstructor() {
  19119. this.ui = ui_UISkill.createInstance();
  19120. this.contentPane = this.ui;
  19121. this.isEject = false;
  19122. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19123. this.initSkillData();
  19124. console.log('zh:aaaaaa1111111111');
  19125. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19126. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19127. console.log('zh:aaaaaa22222222');
  19128. this.displayList = [];
  19129. this.ui.skillNode.skillList.numItems = 3;
  19130. this.addUIClick(this.ui, this.interuptSecretary);
  19131. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19132. this.ui.talkNode.visible = false;
  19133. if (Moyu.isKs)
  19134. this.ui.closeNode.closeBtn.x += 100;
  19135. }
  19136. show() {
  19137. super.show();
  19138. this.playSecretaryIdle();
  19139. this.moneyNode.ui.c1.selectedIndex = 1;
  19140. Laya.timer.clearAll(this);
  19141. xGame.soundMgr.playSound("s_start");
  19142. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19143. let guide = DataMgr.getSkillGuide();
  19144. this.ui.guideNode.visible = guide == 0;
  19145. let item = this.getSkillItemByUIIndex(0);
  19146. if (guide == 0) {
  19147. item.ui.c1.selectedIndex = 1;
  19148. }
  19149. else {
  19150. item.ui.c1.selectedIndex = 0;
  19151. }
  19152. this.ui.guideNode.guideBtn.visible = guide == 0;
  19153. for (let index = 0; index < this.displayList.length; index++) {
  19154. this.displayList[index].checkTry();
  19155. }
  19156. }
  19157. getSkillItemByUIIndex(cur) {
  19158. for (let index = 0; index < this.displayList.length; index++) {
  19159. if (this.displayList[index].index == cur) {
  19160. return this.displayList[index];
  19161. }
  19162. }
  19163. }
  19164. enterGuideLevel() {
  19165. let item = this.getSkillItemByUIIndex(0);
  19166. item.startGame();
  19167. if (DataMgr.getNewUser())
  19168. Moyu.sendDataEvent("gameStart1");
  19169. }
  19170. initSkillData() {
  19171. this.skillData = [];
  19172. let nameList = xGame.common.skillNameList;
  19173. let iconList = xGame.common.skillIconList;
  19174. let describeList = [
  19175. "Jump shot executed — ball bounced and pocketed an extra one!",
  19176. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  19177. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  19178. ];
  19179. console.log('zh:initSkillData 111111111');
  19180. let data;
  19181. for (let index = 0; index < nameList.length; index++) {
  19182. data = {};
  19183. data.name = nameList[index];
  19184. data.icon = iconList[index];
  19185. data.describe = describeList[index];
  19186. data.index = index;
  19187. this.skillData.push(data);
  19188. }
  19189. }
  19190. updateSkillItem(index, target) {
  19191. if (this.displayList[index] == null) {
  19192. let uiIndex;
  19193. switch (index) {
  19194. case 0:
  19195. uiIndex = 1;
  19196. break;
  19197. case 1:
  19198. uiIndex = 0;
  19199. break;
  19200. case 2:
  19201. uiIndex = 2;
  19202. break;
  19203. case 3:
  19204. uiIndex = 3;
  19205. break;
  19206. default:
  19207. break;
  19208. }
  19209. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19210. this.displayList.push(temp);
  19211. }
  19212. }
  19213. playSecretaryIdle() {
  19214. let parent = this.ui.secretary.displayObject;
  19215. parent.destroyChildren();
  19216. let xx = this.ui.secretary.width / 2;
  19217. let yy = this.ui.secretary.height;
  19218. let scale = xGame.common.getSecretaryScale();
  19219. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19220. xGame.common.secretary.play(data, 0, true, parent);
  19221. }
  19222. returnUIMain() {
  19223. this.hide();
  19224. xGame.common.stopGirlPop(this.ui.talkNode);
  19225. xGame.uiMgr.Show(UIMain$1);
  19226. }
  19227. interuptSecretary() {
  19228. Laya.timer.clearAll(this);
  19229. this.playSecretaryRandomSound();
  19230. }
  19231. playSecretaryRandomSound() {
  19232. if (this.isHide)
  19233. return;
  19234. let time = xGame.common.randomNum(45000, 60000);
  19235. Laya.timer.once(time, this, () => {
  19236. if (this.isHide)
  19237. return;
  19238. let index = xGame.common.randomNum(4, 7);
  19239. xGame.soundMgr.playSound("s_main0" + index);
  19240. let words = 1;
  19241. switch (index) {
  19242. case 4:
  19243. words = 5;
  19244. break;
  19245. case 5:
  19246. words = 3;
  19247. break;
  19248. case 6:
  19249. words = 6;
  19250. break;
  19251. case 7:
  19252. words = 7;
  19253. break;
  19254. default:
  19255. break;
  19256. }
  19257. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19258. this.playSecretaryRandomSound();
  19259. });
  19260. }
  19261. }
  19262. UISkill$1.uiName = "UISkill";
  19263. class UIAddProp$1 extends UIBase {
  19264. constructor() {
  19265. super();
  19266. this.curType = "";
  19267. }
  19268. onConstructor() {
  19269. this.ui = ui_UIAddProp.createInstance();
  19270. this.contentPane = this.ui;
  19271. this.isEject = false;
  19272. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19273. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19274. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19275. this.updateUI();
  19276. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19277. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19278. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19279. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19280. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19281. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19282. }
  19283. show(type) {
  19284. super.show();
  19285. this.curType = type == 0 ? "coin" : "diamond";
  19286. this.switchBtn("");
  19287. this.ui.t0.play();
  19288. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19289. PlatMgr.showInsert(true);
  19290. }
  19291. closeSelf() {
  19292. this.hide();
  19293. }
  19294. updateUI() {
  19295. let data = cfgTable.moneyData;
  19296. let temp;
  19297. let obj;
  19298. for (const key in data) {
  19299. temp = data[key];
  19300. obj = this.ui.myNode["node" + key];
  19301. if (parseInt(key) <= 2) {
  19302. obj.diamondTxt.text = "+" + temp.num;
  19303. }
  19304. else {
  19305. obj.coinTxt.text = temp.num;
  19306. obj.diamondTxt.text = temp.get.split('_')[1];
  19307. }
  19308. }
  19309. this.updateDiamondShare();
  19310. }
  19311. updateDiamondShare() {
  19312. let data = DataMgr.getShareDiamondTimes();
  19313. if (data >= xGame.common.maxShareDiamondTimes) {
  19314. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19315. this.ui.myNode.node1.touchable = false;
  19316. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19317. }
  19318. else {
  19319. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19320. this.ui.myNode.node1.touchable = true;
  19321. }
  19322. }
  19323. switchBtn(type) {
  19324. if (type == "")
  19325. type = this.curType;
  19326. else {
  19327. if (this.curType == type) {
  19328. return;
  19329. }
  19330. else {
  19331. this.curType = type;
  19332. }
  19333. }
  19334. if (type == "coin") {
  19335. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19336. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19337. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19338. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19339. this.ui.myNode.c1.selectedIndex = 0;
  19340. }
  19341. else {
  19342. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19343. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19344. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19345. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19346. this.ui.myNode.c1.selectedIndex = 1;
  19347. }
  19348. }
  19349. convertCoin(index) {
  19350. let data = cfgTable.moneyData[index];
  19351. let coinNum = data.num;
  19352. let str = data.get.split('_')[1];
  19353. let needDiamond = parseInt(str);
  19354. if (DataMgr.diamondEnough(needDiamond)) {
  19355. DataMgr.setDiamond(-needDiamond);
  19356. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19357. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19358. }
  19359. else {
  19360. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19361. this.switchBtn("diamond");
  19362. }
  19363. }
  19364. videoGetDiamond() {
  19365. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19366. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19367. }
  19368. else {
  19369. console.log('zh:AD 失败,直接发放奖励');
  19370. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19371. }
  19372. }
  19373. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19374. let num = cfgTable.moneyData[2].num;
  19375. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19376. this.closeSelf();
  19377. }
  19378. videoGetCoin() {
  19379. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19380. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19381. }
  19382. else {
  19383. console.log('zh:AD 失败,直接发放奖励');
  19384. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19385. }
  19386. }
  19387. qjff_AD_for_uiAddProp_videoGetCoin() {
  19388. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19389. this.closeSelf();
  19390. }
  19391. shareGetDiamond() {
  19392. let times = DataMgr.getShareDiamondTimes();
  19393. if (times >= xGame.common.maxShareDiamondTimes) {
  19394. console.log('zh: 233333333333 maxShareDiamondTimes');
  19395. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19396. }
  19397. else {
  19398. console.log('zh:33333333333333ad');
  19399. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  19400. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  19401. }
  19402. else {
  19403. console.log('zh:AD 失败,直接发放奖励');
  19404. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  19405. }
  19406. }
  19407. }
  19408. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19409. let diamond = xGame.common.randomNum(50, 100);
  19410. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19411. DataMgr.setShareDiamondTimes(1);
  19412. this.updateDiamondShare();
  19413. }
  19414. openPutBallView() {
  19415. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19416. let skill = xGame.uiMgr.getUI(UISkill$1);
  19417. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19418. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19419. if (end && !end.isHide) {
  19420. xGame.uiMgr.Hide(UIGameEnd$1);
  19421. xGame.uiMgr.Show(UIMain$1);
  19422. }
  19423. if (skill && !skill.isHide)
  19424. xGame.uiMgr.Hide(UISkill$1);
  19425. if (uigame && !uigame.isHide)
  19426. xGame.uiMgr.Hide(UIGame$1);
  19427. if (level && !level.isHide) {
  19428. }
  19429. else {
  19430. xGame.uiMgr.Show(UILevelDisplay$1);
  19431. }
  19432. this.closeSelf();
  19433. }
  19434. }
  19435. UIAddProp$1.uiName = "UIAddProp";
  19436. class MoneyNode$1 {
  19437. constructor(ui) {
  19438. this.leftTime = 0;
  19439. this.ui = ui;
  19440. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19441. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19442. this.ui.addPowerBtn.onClick(this, this.addPower);
  19443. this.ui.c1.selectedIndex = 1;
  19444. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19445. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19446. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19447. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19448. this.coinChange();
  19449. this.diamondChange();
  19450. this.powerChange();
  19451. }
  19452. addPower() {
  19453. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19454. xGame.uiMgr.Show(UIPower$1);
  19455. }
  19456. powerChange() {
  19457. let powerNum = DataMgr.getPower();
  19458. this.ui.powerTxt.text = powerNum + "";
  19459. }
  19460. checkPowerTime() {
  19461. let cur = new Date().getTime();
  19462. let last = DataMgr.getPowerTime();
  19463. if (last == 0) {
  19464. last = cur;
  19465. DataMgr.setPowerTime(cur);
  19466. }
  19467. let power = DataMgr.getPower();
  19468. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19469. Laya.timer.clearAll(this);
  19470. if (power >= xGame.common.natureMaxPower) {
  19471. this.ui.powerTimeTxt.text = "";
  19472. DataMgr.setPowerTime(cur);
  19473. return;
  19474. }
  19475. if (power + offset >= xGame.common.natureMaxPower) {
  19476. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19477. this.ui.powerTimeTxt.text = "";
  19478. DataMgr.setPowerTime(cur);
  19479. }
  19480. else {
  19481. if (offset > 0) {
  19482. DataMgr.setPower(offset);
  19483. DataMgr.setPowerTime(cur);
  19484. }
  19485. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19486. this.leftTime = xGame.common.powerRecoverNum - time;
  19487. if (this.leftTime <= 0)
  19488. this.leftTime = 0;
  19489. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19490. Laya.timer.loop(1000, this, this.updatePowerTime);
  19491. }
  19492. }
  19493. updatePowerTime() {
  19494. this.leftTime -= 1;
  19495. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19496. if (this.leftTime <= 0) {
  19497. this.checkPowerTime();
  19498. }
  19499. }
  19500. coinChange() {
  19501. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19502. }
  19503. diamondChange() {
  19504. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19505. }
  19506. addCoin() {
  19507. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19508. Moyu.sendDataEvent("AddCoinBtn");
  19509. xGame.uiMgr.Show(UIAddProp$1, 0);
  19510. }
  19511. addDiamond() {
  19512. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19513. Moyu.sendDataEvent("AddDiamondBtn");
  19514. xGame.uiMgr.Show(UIAddProp$1, 1);
  19515. }
  19516. }
  19517. class SettingNode$1 {
  19518. constructor(ui) {
  19519. this.showSetting = false;
  19520. this.openSound = true;
  19521. this.openShake = true;
  19522. this.ui = ui;
  19523. this.ui.soundBtn.onClick(this, this.switchSound);
  19524. this.ui.shakeBtn.onClick(this, this.switchShake);
  19525. this.ui.xyBtn.onClick(this, this.onXy);
  19526. this.ui.clickNode.onClick(this, this.changeSetting);
  19527. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19528. this.ui.xyBtn.visible = false;
  19529. this.ui.shakeBtn.visible = false;
  19530. }
  19531. changeSetting() {
  19532. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19533. this.showSetting = !this.showSetting;
  19534. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19535. }
  19536. switchSound() {
  19537. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19538. this.openSound = !this.openSound;
  19539. Moyu.onSetting(this.openSound, this.openShake);
  19540. xGame.soundMgr.onSetting(this.openSound);
  19541. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19542. }
  19543. switchShake() {
  19544. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19545. this.openShake = !this.openShake;
  19546. Moyu.onSetting(this.openSound, this.openShake);
  19547. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19548. }
  19549. onXy() {
  19550. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19551. MoyuMgr$1.showXy(1);
  19552. }
  19553. }
  19554. class UIDraw$1 extends UIBase {
  19555. constructor() {
  19556. super();
  19557. this.curKey = 0;
  19558. }
  19559. onConstructor() {
  19560. this.ui = ui_UIDraw.createInstance();
  19561. this.contentPane = this.ui;
  19562. this.isEject = false;
  19563. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19564. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19565. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19566. this.initDraw();
  19567. this.initUI();
  19568. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19569. if (Moyu.isKs)
  19570. this.ui.closeNode.closeBtn.x += 100;
  19571. }
  19572. show() {
  19573. super.show();
  19574. this.ui.t0.play();
  19575. this.playSecretaryIdle();
  19576. this.updateDraw();
  19577. this.checkFree();
  19578. if (PlatMgr.bannerDelay > 0) {
  19579. this.ui.closeNode.closeBtn.visible = false;
  19580. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19581. this.ui.closeNode.closeBtn.visible = true;
  19582. });
  19583. }
  19584. PlatMgr.showRateBanner();
  19585. }
  19586. hide() {
  19587. Laya.timer.clearAll(this);
  19588. super.hide();
  19589. }
  19590. checkFree() {
  19591. let isFree = DataMgr.getDailyfreeDrawTimes();
  19592. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19593. }
  19594. initDraw() {
  19595. this.drawObj = [];
  19596. let data = cfgTable.drawData;
  19597. let temp;
  19598. let weight = 0;
  19599. for (const key in data) {
  19600. temp = data[key];
  19601. weight += temp.weight;
  19602. this.drawObj.push(weight);
  19603. }
  19604. this.allWeight = weight;
  19605. }
  19606. initUI() {
  19607. let data = cfgTable.drawData;
  19608. let temp;
  19609. let img;
  19610. let txt;
  19611. for (const key in data) {
  19612. temp = data[key];
  19613. img = this.ui.myNode.rotNode["img" + key];
  19614. txt = this.ui.myNode.rotNode["txt" + key];
  19615. img.url = xGame.common.getGameIconUrl(temp.icon);
  19616. txt.visible = true;
  19617. if (temp.award > 2) {
  19618. img.rotation = 0;
  19619. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19620. }
  19621. else {
  19622. img.rotation = temp.rotation;
  19623. txt.text = temp.num;
  19624. }
  19625. }
  19626. }
  19627. getCurkey() {
  19628. let rand = Math.random() * this.allWeight;
  19629. let temp;
  19630. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19631. temp = this.drawObj[index];
  19632. if (index == 0) {
  19633. if (rand < temp) {
  19634. return index + 1;
  19635. }
  19636. }
  19637. else {
  19638. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19639. return index + 1;
  19640. }
  19641. }
  19642. }
  19643. return 2;
  19644. }
  19645. startDraw() {
  19646. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19647. if (freeTimes > 0) {
  19648. this.beginDraw();
  19649. DataMgr.setDailyfreeDrawTimes(0);
  19650. this.checkFree();
  19651. }
  19652. else {
  19653. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19654. }
  19655. else {
  19656. console.log('zh:AD 失败,直接发放奖励');
  19657. this.qjff_chouJiang();
  19658. }
  19659. }
  19660. }
  19661. qjff_chouJiang() {
  19662. this.beginDraw();
  19663. }
  19664. beginDraw() {
  19665. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19666. this.ui.drawBtn.touchable = false;
  19667. this.curKey = this.getCurkey();
  19668. console.log("当前key", this.curKey);
  19669. let cell = 60;
  19670. let lap = 3;
  19671. let angle = cell * (this.curKey - 1) + lap * 360;
  19672. let target = this.ui.myNode.rotNode;
  19673. target.rotation = 0;
  19674. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19675. console.log("旋转完成");
  19676. this.ui.drawBtn.touchable = true;
  19677. this.getAward();
  19678. }));
  19679. }
  19680. getAward() {
  19681. let data = cfgTable.drawData[this.curKey];
  19682. let temp = new AwardType();
  19683. temp.type = data.award;
  19684. temp.num = data.num;
  19685. xGame.common.getAward([temp], () => {
  19686. DataMgr.setDrawTimes(1);
  19687. this.updateDraw();
  19688. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19689. });
  19690. }
  19691. updateDraw() {
  19692. let drawTimes = DataMgr.getDrawTimes();
  19693. let awardTimes = DataMgr.getDrawAwardTimes();
  19694. if (Math.floor(drawTimes / 3) > awardTimes) {
  19695. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19696. this.ui.extraNode.boxBtn.touchable = true;
  19697. this.ui.extraNode.tipsTxt.text = "3/3";
  19698. this.ui.extraNode.barNode.width = 265;
  19699. this.getExtraAward();
  19700. }
  19701. else {
  19702. this.ui.extraNode.boxBtn.t0.stop();
  19703. this.ui.extraNode.boxBtn.touchable = false;
  19704. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19705. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19706. }
  19707. let data = cfgTable.drawData[1];
  19708. if (awardTimes == 0) {
  19709. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19710. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19711. this.ui.myNode.rotNode.img1.rotation = 0;
  19712. }
  19713. else {
  19714. let award = data.nextid;
  19715. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19716. this.ui.myNode.rotNode.txt1.text = award[1];
  19717. this.ui.myNode.rotNode.img1.rotation = 0;
  19718. }
  19719. }
  19720. getExtraAward() {
  19721. let drawTimes = DataMgr.getDrawTimes();
  19722. let awardTimes = DataMgr.getDrawAwardTimes();
  19723. let data = cfgTable.drawData[1];
  19724. let award = new AwardType();
  19725. if (awardTimes == 0) {
  19726. award.num = data.num;
  19727. award.type = data.award;
  19728. xGame.common.getAward([award], () => {
  19729. let all = Math.floor(drawTimes / 3);
  19730. DataMgr.setDrawAwardTimes(all);
  19731. this.updateDraw();
  19732. });
  19733. }
  19734. else {
  19735. award.num = parseInt(data.nextid[1]);
  19736. award.type = parseInt(data.nextid[0]);
  19737. xGame.common.getAward([award], () => {
  19738. let all = Math.floor(drawTimes / 3);
  19739. DataMgr.setDrawAwardTimes(all);
  19740. this.updateDraw();
  19741. });
  19742. }
  19743. }
  19744. closeSelf() {
  19745. this.hide();
  19746. }
  19747. playSecretaryIdle() {
  19748. let parent = this.ui.secretary.displayObject;
  19749. parent.destroyChildren();
  19750. let xx = this.ui.secretary.width / 2;
  19751. let yy = this.ui.secretary.height;
  19752. let scale = xGame.common.getSecretaryScale();
  19753. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19754. xGame.common.secretary.play(data, 0, true, parent);
  19755. }
  19756. }
  19757. UIDraw$1.uiName = "UIDraw";
  19758. class UIRanking$1 extends UIBase {
  19759. constructor() {
  19760. super();
  19761. this.showSelf = true;
  19762. this.rankType = 1;
  19763. this.rankList = [];
  19764. this.myIndex = 0;
  19765. this.myStar = 0;
  19766. }
  19767. onConstructor() {
  19768. this.ui = ui_UIRanking.createInstance();
  19769. this.contentPane = this.ui;
  19770. this.isEject = false;
  19771. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19772. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19773. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19774. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19775. this.ui.myNode.myList.setVirtual();
  19776. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19777. }
  19778. show() {
  19779. super.show();
  19780. this.myIndex = 51;
  19781. Moyu.getRankList({
  19782. rankId: xGame.common.curRankID,
  19783. type: MoyuRankType.total,
  19784. page: 1,
  19785. pageSize: 50,
  19786. }, this, this.updateItemData);
  19787. this.updateSelf();
  19788. let self = Moyu.getUserInfo();
  19789. if (!self.isAuth) {
  19790. Moyu.initUser(this, () => {
  19791. DataMgr.upRankData();
  19792. });
  19793. }
  19794. }
  19795. updateSelfItem() {
  19796. let self = Moyu.getUserInfo();
  19797. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19798. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19799. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19800. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19801. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19802. }
  19803. updateItemData(data) {
  19804. this.myStar = xGame.common.getAllStarNum();
  19805. if (this.rankList.length < 2) {
  19806. this.rankList = data;
  19807. let self = Moyu.getUserInfo();
  19808. for (let i = 0; i < data.length; i++) {
  19809. let data = this.rankList[i];
  19810. if (data.userId == self.userId) {
  19811. this.rankList.splice(i, 1);
  19812. break;
  19813. }
  19814. }
  19815. for (let i = 0; i < data.length; i++) {
  19816. let data = this.rankList[i];
  19817. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19818. this.myIndex = i + 1;
  19819. let user = { headIcon: self.headIcon, nickName: "myself" };
  19820. let ud = { user: user, data: {} };
  19821. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19822. if (Moyu.platType < 11) {
  19823. user.headIcon = self.headIcon;
  19824. user.nickName = self.nickName;
  19825. }
  19826. this.rankList.splice(i, 0, md);
  19827. break;
  19828. }
  19829. }
  19830. }
  19831. this.updateSelfItem();
  19832. this.ui.myNode.myList.numItems = this.rankList.length;
  19833. }
  19834. updateItemUI(index, obj) {
  19835. let data = this.rankList[index];
  19836. let userData = JSON.parse(data.userData).user;
  19837. obj.nameTxt.text = userData.nickName.toString();
  19838. obj.valueTxt.text = data.rankScore;
  19839. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19840. obj.rankTxt.text = index + 1;
  19841. switch (index) {
  19842. case 0:
  19843. this.setImg(obj, 1, 0, 0);
  19844. obj.rankTxt.color = "#FFC047";
  19845. break;
  19846. case 1:
  19847. this.setImg(obj, 0, 1, 0);
  19848. obj.rankTxt.color = "#ACACAC";
  19849. break;
  19850. case 2:
  19851. this.setImg(obj, 0, 0, 1);
  19852. obj.rankTxt.color = "#D09672";
  19853. break;
  19854. default:
  19855. this.setImg(obj, 0, 0, 0);
  19856. obj.rankTxt.color = "#496FAB";
  19857. break;
  19858. }
  19859. }
  19860. setImg(obj, a, b, c) {
  19861. obj.img1.visible = a ? true : false;
  19862. obj.img2.visible = b ? true : false;
  19863. obj.img3.visible = c ? true : false;
  19864. }
  19865. changeList(type) {
  19866. this.rankType = type;
  19867. this.updateSelf();
  19868. }
  19869. changeSelfNode() {
  19870. this.showSelf = !this.showSelf;
  19871. this.updateSelf();
  19872. }
  19873. updateSelf() {
  19874. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19875. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19876. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19877. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19878. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19879. }
  19880. }
  19881. UIRanking$1.uiName = "UIRanking";
  19882. class UISecretary$1 extends UIBase {
  19883. constructor() {
  19884. super();
  19885. this.curIndex = 1;
  19886. }
  19887. onConstructor() {
  19888. this.ui = ui_UISecretary.createInstance();
  19889. this.contentPane = this.ui;
  19890. this.isEject = false;
  19891. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19892. this.nodeObj = { left: null, right: null, cur: null };
  19893. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19894. }
  19895. show() {
  19896. super.show();
  19897. this.ui.t0.play();
  19898. this.updateData();
  19899. }
  19900. addSecretarySpine(node, spineName) {
  19901. if (spineName == "mishu") {
  19902. if (this.secretarySpine1) {
  19903. node.displayObject.destroyChildren();
  19904. this.playWoman(this.secretarySpine1, node.displayObject);
  19905. }
  19906. else {
  19907. let spine1 = new SpineMgr("mishu", () => {
  19908. this.secretarySpine1 = spine1;
  19909. this.playWoman(this.secretarySpine1, node.displayObject);
  19910. });
  19911. }
  19912. }
  19913. else {
  19914. if (this.secretarySpine2) {
  19915. node.displayObject.destroyChildren();
  19916. this.playWoman(this.secretarySpine2, node.displayObject);
  19917. }
  19918. else {
  19919. let spine2 = new SpineMgr("xiaomishu2", () => {
  19920. this.secretarySpine2 = spine2;
  19921. this.playWoman(this.secretarySpine2, node.displayObject);
  19922. });
  19923. }
  19924. }
  19925. }
  19926. playWoman(node, parent) {
  19927. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19928. let yy = this.ui.myNode.gameNode3.secretary.height;
  19929. let scale = 1.5;
  19930. if (node == this.secretarySpine2) {
  19931. scale = 1.2;
  19932. }
  19933. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19934. node.play(data, 0, true, parent);
  19935. }
  19936. turnLeft() {
  19937. this.curIndex--;
  19938. if (this.curIndex < 1) {
  19939. this.curIndex = 2;
  19940. }
  19941. let left = this.nodeObj.left;
  19942. let right = this.nodeObj.right;
  19943. let cur = this.nodeObj.cur;
  19944. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19945. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19946. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19947. this.updateData();
  19948. }));
  19949. this.ui.myNode.setChildIndex(right, 2);
  19950. this.nodeObj.left = cur;
  19951. this.nodeObj.right = left;
  19952. this.nodeObj.cur = right;
  19953. }
  19954. turnRight() {
  19955. this.curIndex++;
  19956. if (this.curIndex > 2) {
  19957. this.curIndex = 1;
  19958. }
  19959. let left = this.nodeObj.left;
  19960. let right = this.nodeObj.right;
  19961. let cur = this.nodeObj.cur;
  19962. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19963. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19964. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19965. this.updateData();
  19966. }));
  19967. this.ui.myNode.setChildIndex(left, 2);
  19968. this.nodeObj.left = right;
  19969. this.nodeObj.right = cur;
  19970. this.nodeObj.cur = left;
  19971. }
  19972. updateData() {
  19973. let data = cfgTable.secretaryshopData;
  19974. let children = this.ui.myNode._children;
  19975. let temp;
  19976. let curData;
  19977. for (let index = 0; index < children.length; index++) {
  19978. temp = children[index];
  19979. curData = data[1];
  19980. temp.heightTxt.text = curData.height;
  19981. temp.foodTxt.text = curData.food;
  19982. temp.historyTxt.text = curData.history;
  19983. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19984. this.addSecretarySpine(temp.secretary, curData.spine);
  19985. let womanIndex = curData.id - 1;
  19986. let getWoman = DataMgr.getSecretary(womanIndex);
  19987. let curUse = DataMgr.getCurSecretary();
  19988. if (getWoman) {
  19989. if (curUse == womanIndex) {
  19990. temp.purchaseBtn.c1.selectedIndex = 1;
  19991. }
  19992. else {
  19993. temp.purchaseBtn.c1.selectedIndex = 2;
  19994. }
  19995. }
  19996. else {
  19997. temp.purchaseBtn.c1.selectedIndex = 0;
  19998. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19999. }
  20000. temp.purchaseBtn.offClick(this, this.clickSecretary);
  20001. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  20002. }
  20003. }
  20004. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20005. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20006. if (getWoman) {
  20007. if (curUse != womanIndex) {
  20008. console.log();
  20009. DataMgr.setCurSecretary(womanIndex);
  20010. this.updateData();
  20011. }
  20012. }
  20013. else {
  20014. let need = needDiamond;
  20015. if (DataMgr.diamondEnough(need)) {
  20016. DataMgr.setDiamond(-need);
  20017. DataMgr.setSecretary(womanIndex, 1);
  20018. DataMgr.setCurSecretary(womanIndex);
  20019. this.updateData();
  20020. }
  20021. else {
  20022. xGame.uiMgr.Show(UIAddProp$1, 1);
  20023. }
  20024. }
  20025. }
  20026. closeSelf() {
  20027. this.hide();
  20028. }
  20029. }
  20030. UISecretary$1.uiName = "UISecretary";
  20031. class BallRodDisplay$1 {
  20032. constructor(ui, index) {
  20033. this.index = 0;
  20034. this.uiIndex = 0;
  20035. this.ui = ui;
  20036. this.index = index;
  20037. this.initData();
  20038. }
  20039. initData() {
  20040. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20041. let data = cfgTable.ballrodData[this.index + 1];
  20042. this.ui.nameTxt.text = data.name;
  20043. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20044. this.ui.levelNode.c1.selectedIndex = data.quality;
  20045. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20046. if (data.spine) {
  20047. this.mySpine = new SpineMgr(data.spine, () => {
  20048. let xx = 150;
  20049. let yy = 70;
  20050. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20051. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20052. });
  20053. }
  20054. }
  20055. updateSelf() {
  20056. let get = DataMgr.getBallRod(this.index);
  20057. if (get == null)
  20058. get = 1;
  20059. let curUse = DataMgr.getCurBallRod();
  20060. if (get) {
  20061. if (curUse == this.index) {
  20062. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20063. }
  20064. else {
  20065. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20066. }
  20067. }
  20068. else {
  20069. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20070. }
  20071. }
  20072. buyBallRod() {
  20073. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20074. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20075. switch (selectedIndex) {
  20076. case 0:
  20077. break;
  20078. case 1:
  20079. DataMgr.setCurBallRod(this.index);
  20080. let ui = xGame.uiMgr.getUI(UIShop$1);
  20081. ui.updateBallRod();
  20082. break;
  20083. case 2:
  20084. let data = cfgTable.ballrodData[this.index + 1];
  20085. let need = data.price;
  20086. if (DataMgr.diamondEnough(need)) {
  20087. DataMgr.setDiamond(-need);
  20088. DataMgr.setBallRod(this.index, 1);
  20089. DataMgr.setCurBallRod(this.index);
  20090. let ui = xGame.uiMgr.getUI(UIShop$1);
  20091. ui.updateBallRod();
  20092. }
  20093. else {
  20094. xGame.uiMgr.Show(UIAddProp$1, 1);
  20095. }
  20096. break;
  20097. default:
  20098. break;
  20099. }
  20100. }
  20101. }
  20102. class UIShop$1 extends UIBase {
  20103. constructor() {
  20104. super();
  20105. this.itemNums = 0;
  20106. }
  20107. onConstructor() {
  20108. this.ui = ui_UIShop.createInstance();
  20109. this.contentPane = this.ui;
  20110. this.isEject = false;
  20111. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20112. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20113. this.addUIClick(this.ui, this.interuptSecretary);
  20114. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20115. this.ballRodArr = [];
  20116. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20117. this.ui.myNode.myList.numItems = this.itemNums;
  20118. if (Moyu.isKs)
  20119. this.ui.closeNode.closeBtn.x += 100;
  20120. }
  20121. show() {
  20122. super.show();
  20123. this.playSecretaryIdle();
  20124. this.updateBallRod();
  20125. }
  20126. updateBallRod() {
  20127. for (let index = 0; index < this.ballRodArr.length; index++) {
  20128. this.ballRodArr[index].updateSelf();
  20129. }
  20130. }
  20131. renderBallRod(sort, obj) {
  20132. let index = this.getIndexBySort(sort + 1) - 1;
  20133. let ballRod = new BallRodDisplay$1(obj, index);
  20134. this.ballRodArr.push(ballRod);
  20135. }
  20136. getIndexBySort(sort) {
  20137. let object = cfgTable.ballrodData;
  20138. for (const key in object) {
  20139. if (object[key].sort == sort) {
  20140. return parseInt(key);
  20141. }
  20142. }
  20143. }
  20144. playSecretaryIdle() {
  20145. let parent = this.ui.secretary.displayObject;
  20146. parent.destroyChildren();
  20147. let xx = this.ui.secretary.width / 2;
  20148. let yy = this.ui.secretary.height;
  20149. let scale = xGame.common.getSecretaryScale();
  20150. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20151. xGame.common.secretary.play(data, 0, true, parent);
  20152. }
  20153. interuptSecretary() {
  20154. Laya.timer.clearAll(this);
  20155. this.playSecretaryRandomSound();
  20156. }
  20157. playSecretaryRandomSound() {
  20158. if (this.isHide)
  20159. return;
  20160. let time = xGame.common.randomNum(45000, 60000);
  20161. Laya.timer.once(time, this, () => {
  20162. if (this.isHide)
  20163. return;
  20164. let index = xGame.common.randomNum(4, 7);
  20165. xGame.soundMgr.playSound("s_main0" + index);
  20166. let words = 1;
  20167. switch (index) {
  20168. case 4:
  20169. words = 5;
  20170. break;
  20171. case 5:
  20172. words = 3;
  20173. break;
  20174. case 6:
  20175. words = 6;
  20176. break;
  20177. case 7:
  20178. words = 7;
  20179. break;
  20180. default:
  20181. break;
  20182. }
  20183. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20184. this.playSecretaryRandomSound();
  20185. });
  20186. }
  20187. closeSelf() {
  20188. this.hide();
  20189. }
  20190. }
  20191. UIShop$1.uiName = "UIShop";
  20192. class SignMax$1 {
  20193. constructor(ui) {
  20194. this.ui = ui;
  20195. }
  20196. updateSelf(index, sameDay, curDayIndex) {
  20197. let data = cfgTable.signData[index + 1];
  20198. this.ui.titleTxt.text = data.title;
  20199. let arr1 = data.award[0].split('-');
  20200. let arr2 = data.award[1].split('-');
  20201. let num1 = parseInt(arr1[1]);
  20202. let num2 = parseInt(arr2[1]);
  20203. this.ui.numTxt1.text = num1 + "";
  20204. this.ui.numTxt2.text = num2 + "";
  20205. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20206. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20207. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20208. this.ui.numTxt1.visible = false;
  20209. }
  20210. else {
  20211. this.ui.numTxt1.visible = true;
  20212. }
  20213. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20214. this.ui.numTxt2.visible = false;
  20215. }
  20216. else {
  20217. this.ui.numTxt2.visible = true;
  20218. }
  20219. if (index < curDayIndex) {
  20220. this.ui.c1.selectedIndex = 1;
  20221. }
  20222. else if (index == curDayIndex) {
  20223. if (sameDay) {
  20224. this.ui.c1.selectedIndex = 2;
  20225. }
  20226. else {
  20227. this.ui.c1.selectedIndex = 2;
  20228. }
  20229. }
  20230. else {
  20231. this.ui.c1.selectedIndex = 0;
  20232. }
  20233. }
  20234. }
  20235. class SignNormal$1 {
  20236. constructor(ui) {
  20237. this.ui = ui;
  20238. }
  20239. updateSelf(index, sameDay, curDayIndex) {
  20240. let data = cfgTable.signData[index + 1];
  20241. this.ui.titleTxt.text = data.title;
  20242. let arr = data.award[0].split('-');
  20243. let type = parseInt(arr[0]);
  20244. let num = parseInt(arr[1]);
  20245. this.ui.numTxt.text = num + "";
  20246. if (type > 2) {
  20247. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20248. this.ui.myIcon.rotation = 0;
  20249. }
  20250. else {
  20251. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20252. this.ui.myIcon.rotation = 0;
  20253. }
  20254. if (xGame.common.signAwardContainsRod(data.award)) {
  20255. this.ui.numTxt.visible = false;
  20256. }
  20257. else {
  20258. this.ui.numTxt.visible = true;
  20259. }
  20260. if (index < curDayIndex) {
  20261. this.ui.c1.selectedIndex = 1;
  20262. }
  20263. else if (index == curDayIndex) {
  20264. if (sameDay) {
  20265. this.ui.c1.selectedIndex = 2;
  20266. }
  20267. else {
  20268. this.ui.c1.selectedIndex = 2;
  20269. }
  20270. }
  20271. else {
  20272. this.ui.c1.selectedIndex = 0;
  20273. }
  20274. }
  20275. }
  20276. class UISign$1 extends UIBase {
  20277. constructor() {
  20278. super();
  20279. this.curDayIndex = 0;
  20280. this.starX = 0;
  20281. }
  20282. onConstructor() {
  20283. this.ui = ui_UISign.createInstance();
  20284. this.contentPane = this.ui;
  20285. this.isEject = false;
  20286. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20287. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20288. this.initSignItem();
  20289. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20290. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20291. }
  20292. show() {
  20293. super.show();
  20294. this.ui.t0.play();
  20295. this.playSecretaryIdle();
  20296. this.updateSign();
  20297. }
  20298. initSignItem() {
  20299. this.signArr = [];
  20300. for (let index = 0; index < 6; index++) {
  20301. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20302. this.signArr.push(temp);
  20303. }
  20304. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20305. if (Moyu.isKs)
  20306. this.ui.closeNode.closeBtn.x += 100;
  20307. }
  20308. updateSign() {
  20309. let sameDay = xGame.common.judgeSameDay();
  20310. let max = 7;
  20311. this.curDayIndex = DataMgr.getSignData();
  20312. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20313. this.curDayIndex = 0;
  20314. if (!sameDay) {
  20315. this.ui.normalBtn.visible = true;
  20316. this.ui.tipsNode.visible = false;
  20317. this.ui.againBtn.visible = false;
  20318. }
  20319. else {
  20320. this.ui.normalBtn.visible = false;
  20321. let again = DataMgr.getExtraSign();
  20322. let isCurrency = false;
  20323. let index = this.curDayIndex;
  20324. if (index == 0)
  20325. index = 7;
  20326. let award = cfgTable.signData[index].award;
  20327. let num = award[0].split("-")[0];
  20328. if (num == "1" || num == "2")
  20329. isCurrency = true;
  20330. let showAgain = again == 0 && isCurrency;
  20331. this.ui.againBtn.visible = showAgain;
  20332. this.ui.tipsNode.visible = !showAgain;
  20333. }
  20334. for (let index = 0; index < this.signArr.length; index++) {
  20335. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20336. }
  20337. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20338. }
  20339. playSecretaryIdle() {
  20340. let parent = this.ui.secretary.displayObject;
  20341. parent.destroyChildren();
  20342. let xx = this.ui.secretary.width / 2;
  20343. let yy = this.ui.secretary.height;
  20344. let scale = xGame.common.getSecretaryScale();
  20345. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20346. xGame.common.secretary.play(data, 0, true, parent);
  20347. }
  20348. closeSelf() {
  20349. this.hide();
  20350. }
  20351. normalGetAward() {
  20352. let sameDay = xGame.common.judgeSameDay();
  20353. if (!sameDay) {
  20354. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20355. let temp;
  20356. let type;
  20357. let num;
  20358. let arr = [];
  20359. for (let index = 0; index < award.length; index++) {
  20360. temp = award[index].split("-");
  20361. type = parseInt(temp[0]);
  20362. num = parseInt(temp[1]);
  20363. let awardType = new AwardType();
  20364. awardType.num = num;
  20365. awardType.type = type;
  20366. arr.push(awardType);
  20367. }
  20368. xGame.common.getAward(arr, (watchVideo) => {
  20369. this.curDayIndex++;
  20370. if (this.curDayIndex > 7)
  20371. this.curDayIndex = 0;
  20372. DataMgr.setSignData(this.curDayIndex);
  20373. DataMgr.setSignTime(new Date().getTime());
  20374. if (watchVideo) {
  20375. DataMgr.setExtraSign(1);
  20376. Moyu.sendDataEvent("signIn1");
  20377. }
  20378. this.updateSign();
  20379. });
  20380. }
  20381. }
  20382. againGetAward() {
  20383. Moyu.sendDataEvent("signIn2");
  20384. console.log('zh:qjff_AD_for_uisign');
  20385. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20386. }
  20387. else {
  20388. console.log('zh:AD 失败,直接发放奖励');
  20389. this.qjff_AD_for_uisign();
  20390. }
  20391. }
  20392. qjff_AD_for_uisign() {
  20393. let index = this.curDayIndex;
  20394. if (index == 0)
  20395. index = 7;
  20396. let award = cfgTable.signData[index].award;
  20397. let temp;
  20398. let type;
  20399. let num;
  20400. for (let index = 0; index < award.length; index++) {
  20401. temp = award[index].split("-");
  20402. type = parseInt(temp[0]);
  20403. num = parseInt(temp[1]) * 3;
  20404. xGame.common.playObjFlyAnim(num, type);
  20405. }
  20406. DataMgr.setExtraSign(1);
  20407. this.updateSign();
  20408. }
  20409. }
  20410. UISign$1.uiName = "UISign";
  20411. class UIModeSelection$1 extends UIBase {
  20412. constructor() {
  20413. super();
  20414. }
  20415. onConstructor() {
  20416. this.ui = ui_UIModeSelection.createInstance();
  20417. this.contentPane = this.ui;
  20418. this.isEject = false;
  20419. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20420. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20421. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20422. this.addUIClick(this.ui.closeBtn, this.hide);
  20423. this.peopleArr = [650, 6900, 3800];
  20424. this.peopleOffest = [50, 500, 200];
  20425. this.updateSelf();
  20426. }
  20427. show(callback) {
  20428. super.show();
  20429. this.ui.t0.play();
  20430. this.callback = callback;
  20431. }
  20432. updateSelf() {
  20433. let cfg = cfgTable.modeselectData;
  20434. for (let index = 1; index <= 3; index++) {
  20435. let node = this.ui.myNode["type" + index];
  20436. node.need.text = cfg[index].need;
  20437. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20438. node.peopleTxt.text = this.getRandPeople(index - 1);
  20439. }
  20440. }
  20441. enterGame(type) {
  20442. xGame.common.classicRoomType = type;
  20443. let cfg = cfgTable.modeselectData[type];
  20444. let need = cfg.need;
  20445. xGame.common.passAwardCoin = cfg.award;
  20446. if (DataMgr.coinEnough(need)) {
  20447. DataMgr.setCoin(-need);
  20448. this.ui.myNode["type" + type].t0.play();
  20449. Laya.timer.once(200, this, () => {
  20450. this.callback && this.callback();
  20451. });
  20452. }
  20453. else {
  20454. Moyu.sendDataEvent("AddCoinVideo");
  20455. xGame.uiMgr.Show(UIAddProp$1, 0);
  20456. }
  20457. }
  20458. getRandPeople(index) {
  20459. let rand = this.peopleOffest[index];
  20460. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20461. }
  20462. }
  20463. UIModeSelection$1.uiName = "UIModeSelection";
  20464. class UITry$1 extends UIBase {
  20465. constructor() {
  20466. super();
  20467. this.closeTime = 0;
  20468. this.closeNum = 0;
  20469. this.skillUrl = xGame.common.skillIconList;
  20470. }
  20471. onConstructor() {
  20472. this.ui = ui_UITry.createInstance();
  20473. this.contentPane = this.ui;
  20474. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20475. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20476. }
  20477. show() {
  20478. super.show();
  20479. this.closeNum = 0;
  20480. this.closeTime = 15;
  20481. this.ui.t0.play();
  20482. PlatMgr.showRateBanner();
  20483. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20484. Laya.timer.loop(1000, this, this.updateTime);
  20485. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20486. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20487. xGame.common.gameMgr.gamePause = true;
  20488. }
  20489. updateTime() {
  20490. if (this.closeTime > 1) {
  20491. this.closeTime--;
  20492. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20493. }
  20494. else
  20495. this.hide();
  20496. }
  20497. hide() {
  20498. Laya.timer.clearAll(this);
  20499. Moyu.showBannerAd(false);
  20500. super.hide();
  20501. xGame.common.gameMgr.gamePause = false;
  20502. }
  20503. onTry() {
  20504. console.log('zh:qjff_AD_for_uitry');
  20505. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20506. }
  20507. else {
  20508. console.log('zh:AD 失败,直接发放奖励');
  20509. this.qjff_AD_for_uitry();
  20510. }
  20511. }
  20512. qjff_AD_for_uitry() {
  20513. let select = xGame.common.curPlayerSkillType;
  20514. DataMgr.gameData.trySkill = select;
  20515. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20516. DataMgr.saveGameData();
  20517. DataMgr.setBigSkill(select, 1);
  20518. xGame.showTip("Trial Successful");
  20519. this.hide();
  20520. }
  20521. onCancel() {
  20522. if (this.closeNum > 0) {
  20523. this.closeNum--;
  20524. if (this.closeNum < 2)
  20525. this.hide();
  20526. return;
  20527. }
  20528. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20529. this.onTry();
  20530. }
  20531. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20532. this.closeNum = 3;
  20533. }
  20534. else
  20535. this.hide();
  20536. }
  20537. }
  20538. UITry$1.uiName = "UITry";
  20539. class UIGetAward$1 extends UIBase {
  20540. constructor() {
  20541. super();
  20542. this.showTriple = true;
  20543. }
  20544. onConstructor() {
  20545. this.ui = ui_UIGetAward.createInstance();
  20546. this.contentPane = this.ui;
  20547. this.isEject = false;
  20548. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20549. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20550. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20551. }
  20552. show(arr, showTriple, callback) {
  20553. super.show();
  20554. this.ui.t0.play();
  20555. this.ui.eftNode.visible = true;
  20556. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20557. this.ui.eftNode.visible = false;
  20558. }), 1, 0, 0, 0.9);
  20559. this.awardArr = arr;
  20560. this.showTriple = showTriple;
  20561. this.callback = callback;
  20562. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20563. this.ui.myList.numItems = arr.length;
  20564. xGame.soundMgr.playSound("getaward");
  20565. }
  20566. updateSelf(index, obj) {
  20567. let temp = this.awardArr[index];
  20568. let icon = this.getIcon(temp.type);
  20569. let str = icon;
  20570. if (temp.type > 2) {
  20571. str = "s" + icon;
  20572. }
  20573. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20574. obj.myIcon.rotation = 0;
  20575. obj.numTxt.text = temp.num + "";
  20576. obj.numTxt.visible = temp.type > 2 ? false : true;
  20577. obj.nameTxt.text = this.getNameStr(temp.type);
  20578. }
  20579. renderItem(index, obj) {
  20580. this.updateSelf(index, obj);
  20581. }
  20582. tripleGetAward() {
  20583. console.log('zh:qjff_AD_for_uigetAward');
  20584. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20585. }
  20586. else {
  20587. console.log('zh:AD 失败,直接发放奖励');
  20588. this.qjff_AD_for_uigetAward();
  20589. }
  20590. }
  20591. qjff_AD_for_uigetAward() {
  20592. this.getAward(3);
  20593. }
  20594. normalGetAward() {
  20595. if (PlatMgr.isMisVideo())
  20596. this.tripleGetAward();
  20597. else
  20598. this.getAward();
  20599. }
  20600. getAward(times = 1) {
  20601. this.hide();
  20602. for (let index = 0; index < this.awardArr.length; index++) {
  20603. this.awardArr[index].num *= times;
  20604. }
  20605. this.callback && this.callback(times != 1);
  20606. }
  20607. getIcon(type) {
  20608. switch (type) {
  20609. case Prop.diamond:
  20610. return "ty_zs";
  20611. case Prop.coin:
  20612. return "ty_jb";
  20613. case Prop.gan1:
  20614. return "qg1";
  20615. case Prop.gan2:
  20616. return "qg2";
  20617. case Prop.gan3:
  20618. return "qg3";
  20619. case Prop.gan4:
  20620. return "qg4";
  20621. default:
  20622. break;
  20623. }
  20624. }
  20625. getNameStr(type) {
  20626. switch (type) {
  20627. case Prop.diamond:
  20628. return "Diamond";
  20629. case Prop.coin:
  20630. return "Coins";
  20631. case Prop.gan1:
  20632. case Prop.gan2:
  20633. case Prop.gan3:
  20634. case Prop.gan4:
  20635. return cfgTable.ballrodData[type - 1].name;
  20636. default:
  20637. break;
  20638. }
  20639. }
  20640. }
  20641. UIGetAward$1.uiName = "UIGetAward";
  20642. class UIBox$1 extends UIBase {
  20643. constructor() {
  20644. super();
  20645. this.boxNum = 0;
  20646. this.boxMax = 10;
  20647. this.inAd = false;
  20648. this.isClose = false;
  20649. }
  20650. onConstructor() {
  20651. this.ui = ui_UIBox.createInstance();
  20652. this.contentPane = this.ui;
  20653. this.isEject = false;
  20654. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20655. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20656. Laya.timer.loop(1000, this, this.update);
  20657. }
  20658. update() {
  20659. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20660. this.boxNum -= 1;
  20661. this.upBar();
  20662. }
  20663. }
  20664. upBar() {
  20665. if (this.boxNum > this.boxMax)
  20666. this.boxNum = this.boxMax;
  20667. this.ui.bar.value = this.boxNum * 10;
  20668. }
  20669. show() {
  20670. super.show();
  20671. this.isClose = false;
  20672. this.boxNum = 0;
  20673. this.inAd = false;
  20674. this.upBar();
  20675. this.ui.t0.play();
  20676. this.ui.closeBtn.visible = false;
  20677. Laya.timer.once(3000, this, () => {
  20678. this.ui.closeBtn.visible = true;
  20679. this.ui.bar.alpha = 1;
  20680. });
  20681. Laya.timer.once(500, this, () => {
  20682. this.ui.t1.play();
  20683. });
  20684. }
  20685. hide() {
  20686. Laya.timer.clearAll(this);
  20687. Moyu.showBannerAd(false);
  20688. super.hide();
  20689. }
  20690. onOpenBox() {
  20691. this.boxNum++;
  20692. if (this.boxNum < this.boxMax) {
  20693. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  20694. Moyu.showInsertAd(0, PlatMgr.insertGap);
  20695. }
  20696. else if (this.boxNum == this.boxMax) {
  20697. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20698. this.ui.openBtn.c1.selectedIndex = 13;
  20699. this.inAd = true;
  20700. }
  20701. else
  20702. this.getAward();
  20703. }
  20704. else if (this.inAd) {
  20705. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20706. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20707. }
  20708. else {
  20709. console.log('zh:AD 失败,直接发放奖励');
  20710. this.qjff_AD_for_UIBOX_onOpenBox();
  20711. }
  20712. }
  20713. this.upBar();
  20714. }
  20715. qjff_AD_for_UIBOX_onOpenBox() {
  20716. this.getAward();
  20717. }
  20718. onCloseBox() {
  20719. if (this.isClose)
  20720. this.hide();
  20721. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20722. this.isClose = true;
  20723. PlatMgr.showBanner(true, 0, 3000);
  20724. }
  20725. else
  20726. this.hide();
  20727. }
  20728. getAward() {
  20729. let str = "";
  20730. if (Math.random() < 0.5) {
  20731. let max = Moyu.isLegal ? 500 : 2500;
  20732. let num = xGame.tools.random(max, 500 + max);
  20733. DataMgr.setCoin(num);
  20734. str = "金币x" + num;
  20735. }
  20736. else {
  20737. let max = Moyu.isLegal ? 10 : 30;
  20738. let num = xGame.tools.random(max, 30 + max);
  20739. DataMgr.setDiamond(num);
  20740. str = "钻石x" + num;
  20741. }
  20742. xGame.showTip("恭喜获得-" + str);
  20743. this.hide();
  20744. }
  20745. }
  20746. UIBox$1.uiName = "UIBox";
  20747. class UIMain$1 extends UIBase {
  20748. constructor() {
  20749. super();
  20750. this.firstEnter = true;
  20751. }
  20752. nativeCallJs(msg) {
  20753. let t = msg;
  20754. console.log("zh: nativeCallJs 奖励开始发放:", t);
  20755. switch (t) {
  20756. case 'qjff_chouJiang':
  20757. let dui = xGame.uiMgr.getUI(UIDraw$1);
  20758. dui.qjff_chouJiang();
  20759. break;
  20760. case 'qjff_AD_for_uisign':
  20761. let dui2 = xGame.uiMgr.getUI(UISign$1);
  20762. dui2.qjff_AD_for_uisign();
  20763. break;
  20764. case 'qjff_AD_for_uitry':
  20765. let dui3 = xGame.uiMgr.getUI(UITry$1);
  20766. dui3.qjff_AD_for_uitry();
  20767. break;
  20768. case 'qjff_AD_for_uipower':
  20769. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  20770. dui4.qjff_AD_for_uipower();
  20771. break;
  20772. case 'qjff_AD_for_uigetAward':
  20773. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  20774. dui5.qjff_AD_for_uigetAward();
  20775. break;
  20776. case 'qjff_AD_for_uiGameEnd':
  20777. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  20778. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  20779. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  20780. break;
  20781. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  20782. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  20783. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  20784. break;
  20785. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  20786. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  20787. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  20788. break;
  20789. case 'qjff_AD_for_UIrepentProp_videoRegret':
  20790. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  20791. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  20792. break;
  20793. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  20794. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  20795. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20796. break;
  20797. case 'qjff_AD_for_UIBOX_onOpenBox':
  20798. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  20799. dui11.qjff_AD_for_UIBOX_onOpenBox();
  20800. break;
  20801. case 'qjff_AD_for_UIAddCoin':
  20802. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  20803. dui12.qjff_AD_for_UIAddCoin();
  20804. break;
  20805. case '111a':
  20806. let dui14 = xGame.uiMgr.getUI(UISign$1);
  20807. dui14.qjff_AD_for_uisign();
  20808. break;
  20809. case '222a':
  20810. let dui15 = xGame.uiMgr.getUI(UISign$1);
  20811. dui15.qjff_AD_for_uisign();
  20812. break;
  20813. case '333a':
  20814. let dui16 = xGame.uiMgr.getUI(UISign$1);
  20815. dui16.qjff_AD_for_uisign();
  20816. break;
  20817. default:
  20818. console.log('zh:未知的方法名字' + t);
  20819. break;
  20820. }
  20821. }
  20822. onConstructor() {
  20823. console.log('zh: UIMain onConstructor');
  20824. this.ui = ui_UIMain.createInstance();
  20825. this.contentPane = this.ui;
  20826. this.isEject = false;
  20827. this.addEvent();
  20828. this.addClickSpine();
  20829. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20830. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20831. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20832. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20833. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20834. let curUse = DataMgr.getCurSecretary();
  20835. this.changeSecretary(curUse);
  20836. this.ui.talkNode.visible = false;
  20837. let guide = DataMgr.getSkillGuide();
  20838. if (xGame.common.isNewDay && guide == 1) {
  20839. xGame.common.isNewDay = false;
  20840. xGame.soundMgr.playSound("s_main01");
  20841. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20842. console.log("播放小秘书每天语音");
  20843. }
  20844. this.onGetUserInfo();
  20845. this.ui.n83.visible = false;
  20846. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20847. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20848. }
  20849. changeSecretary(curUse) {
  20850. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20851. xGame.common.secretary && xGame.common.secretary.dispose();
  20852. this.addSecretarySpine(name);
  20853. }
  20854. addSecretarySpine(name) {
  20855. let spine = new SpineMgr(name, () => {
  20856. this.playSecretaryIdle();
  20857. });
  20858. xGame.common.secretary = spine;
  20859. }
  20860. addClickSpine() {
  20861. let clickSpine = new SpineMgr("dianji", () => {
  20862. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20863. let parent = Laya.stage;
  20864. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20865. clickSpine.play(data, 0, false, parent, (spine) => {
  20866. spine.destroy(true);
  20867. });
  20868. });
  20869. });
  20870. }
  20871. addEvent() {
  20872. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20873. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20874. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20875. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20876. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20877. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20878. this.addUIClick(this.ui, this.interuptSecretary);
  20879. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20880. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20881. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20882. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20883. this.addUIClick(this.ui.signBtn, this.openSignView);
  20884. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20885. }
  20886. show(showFailWords) {
  20887. super.show();
  20888. this.moneyNode.ui.c1.selectedIndex = 1;
  20889. this.playSecretaryIdle();
  20890. xGame.soundMgr.playMusic("caromhall01");
  20891. Laya.timer.clearAll(this);
  20892. this.playSecretaryRandomSound();
  20893. if (showFailWords) {
  20894. setTimeout(() => {
  20895. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20896. let words = -1;
  20897. if (str == "s_main02") {
  20898. words = 2;
  20899. }
  20900. else {
  20901. words = 3;
  20902. }
  20903. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20904. xGame.soundMgr.playSound(str);
  20905. }, 300);
  20906. }
  20907. this.showGuide();
  20908. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20909. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20910. let guide = DataMgr.getSkillGuide();
  20911. if (guide == 1) {
  20912. let randTime = xGame.common.randomNum(300, 800);
  20913. if (this.firstEnter) {
  20914. this.firstEnter = false;
  20915. randTime += 900;
  20916. }
  20917. Laya.timer.once(randTime, this, () => {
  20918. xGame.common.autoPopUIView();
  20919. });
  20920. }
  20921. }
  20922. checkActive(show) {
  20923. }
  20924. showGuide() {
  20925. let guide = DataMgr.getSkillGuide();
  20926. this.ui.guideBtn.visible = guide == 0;
  20927. this.ui.enterGuide.visible = false;
  20928. this.ui.secretaryGuide.visible = guide == 0;
  20929. if (guide == 0) {
  20930. xGame.soundMgr.playSound("s_guide");
  20931. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20932. }
  20933. }
  20934. ensureSecretary() {
  20935. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20936. this.ui.secretaryGuide.visible = false;
  20937. this.ui.enterGuide.visible = true;
  20938. this.ui.wordsNode.t0.play();
  20939. if (DataMgr.getNewUser())
  20940. Moyu.sendDataEvent("gameReady");
  20941. }
  20942. playSecretaryIdle() {
  20943. let parent = this.ui.secretary.displayObject;
  20944. parent.destroyChildren();
  20945. let xx = this.ui.secretary.width / 2;
  20946. let yy = this.ui.secretary.height;
  20947. let scale = xGame.common.getSecretaryScale();
  20948. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20949. console.log("zh:playSecretaryIdle", data);
  20950. xGame.common.secretary.play(data, 0, true, parent);
  20951. }
  20952. startGame(type) {
  20953. xGame.common.gameMode = type;
  20954. Moyu.sendDataEvent("PlayGame", { type: type });
  20955. switch (xGame.common.gameMode) {
  20956. case GameMode.classic:
  20957. let challengeTimes = DataMgr.getChallengeTimes();
  20958. if (challengeTimes == 0) {
  20959. xGame.uiMgr.Show(UIInvitation$1);
  20960. }
  20961. else {
  20962. this.beginGame();
  20963. }
  20964. break;
  20965. case GameMode.bigMove:
  20966. this.beginGame();
  20967. if (DataMgr.getNewUser())
  20968. Moyu.sendDataEvent("gameStart0");
  20969. break;
  20970. default:
  20971. break;
  20972. }
  20973. }
  20974. beginGame(isNice = false) {
  20975. if (xGame.common.gameMode == GameMode.classic) {
  20976. if (isNice) {
  20977. this.enterClassic();
  20978. }
  20979. else {
  20980. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20981. this.enterClassic();
  20982. });
  20983. }
  20984. }
  20985. else if (xGame.common.gameMode == GameMode.bigMove) {
  20986. this.ui.enterGuide.visible = false;
  20987. xGame.uiMgr.Show(UISkill$1);
  20988. }
  20989. }
  20990. enterClassic() {
  20991. xGame.uiMgr.Show(UIGame$1);
  20992. xGame.uiMgr.Show(UIMatching$1, () => {
  20993. if (!this.isHide)
  20994. this.hide();
  20995. xGame.common.gameUI.ui.alpha = 1;
  20996. xGame.common.gameUI.startGame();
  20997. xGame.uiMgr.Hide(UIGameEnd$1);
  20998. });
  20999. }
  21000. startGlobal() {
  21001. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21002. }
  21003. startWeekly() {
  21004. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21005. }
  21006. zhouSaiMonth() {
  21007. console.log('zh: zhouSaiMonth 被调用');
  21008. }
  21009. startPlaceBall() {
  21010. xGame.uiMgr.Show(UILevelDisplay$1);
  21011. }
  21012. hide() {
  21013. super.hide();
  21014. xGame.common.stopGirlPop(this.ui.talkNode);
  21015. }
  21016. onGetUserInfo(force = false) {
  21017. if (Moyu.isWx) {
  21018. let info = Moyu.getSystemInfo();
  21019. if (info)
  21020. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21021. }
  21022. else {
  21023. Moyu.initUser(this, this.freshUser, force);
  21024. }
  21025. if (!Moyu.hasUserInfo) {
  21026. let user = Moyu.getUserInfo();
  21027. user.headIcon = 'res/ty_touxiang.png';
  21028. }
  21029. this.freshUser();
  21030. }
  21031. freshUser() {
  21032. let user = Moyu.getUserInfo();
  21033. if (!user.isAuth) {
  21034. user.headIcon = 'res/ty_touxiang.png';
  21035. }
  21036. else
  21037. DataMgr.upRankData();
  21038. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21039. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21040. }
  21041. interuptSecretary() {
  21042. Laya.timer.clearAll(this);
  21043. this.playSecretaryRandomSound();
  21044. }
  21045. playSecretaryRandomSound() {
  21046. if (this.isHide)
  21047. return;
  21048. let time = xGame.common.randomNum(45000, 60000);
  21049. Laya.timer.once(time, this, () => {
  21050. if (this.isHide)
  21051. return;
  21052. let index = xGame.common.randomNum(4, 7);
  21053. xGame.soundMgr.playSound("s_main0" + index);
  21054. let words = 1;
  21055. switch (index) {
  21056. case 4:
  21057. words = 5;
  21058. break;
  21059. case 5:
  21060. words = 3;
  21061. break;
  21062. case 6:
  21063. words = 6;
  21064. break;
  21065. case 7:
  21066. words = 7;
  21067. break;
  21068. default:
  21069. break;
  21070. }
  21071. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21072. this.playSecretaryRandomSound();
  21073. });
  21074. }
  21075. openSecretaryView() {
  21076. xGame.uiMgr.Show(UISecretary$1);
  21077. Moyu.sendDataEvent("secretary");
  21078. }
  21079. openShopView() {
  21080. xGame.uiMgr.Show(UIShop$1);
  21081. }
  21082. openSignView() {
  21083. xGame.uiMgr.Show(UISign$1);
  21084. }
  21085. openDrawView() {
  21086. xGame.uiMgr.Show(UIDraw$1);
  21087. }
  21088. openRanking() {
  21089. xGame.uiMgr.Show(UIRanking$1);
  21090. Moyu.sendDataEvent("rankingList");
  21091. }
  21092. }
  21093. UIMain$1.uiName = "UIMain";
  21094. function InitShader() {
  21095. }
  21096. function appInit() {
  21097. xGame.context.init(getLoadingResList(), initCallback);
  21098. }
  21099. function getLoadingResList() {
  21100. return [
  21101. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21102. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21103. ];
  21104. }
  21105. function getGameResList() {
  21106. return [
  21107. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21108. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21109. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21110. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21111. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21112. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21113. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21114. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21115. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21116. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21117. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21118. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21119. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21120. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21121. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21122. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21123. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21124. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21125. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21126. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21127. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  21128. ];
  21129. }
  21130. function initCallback() {
  21131. window["DataMgr"] = DataMgr;
  21132. DataMgr.Init();
  21133. Moyu.init(getPlat(), this, () => {
  21134. DataMgr.isNewDay();
  21135. PlatMgr.initConfig();
  21136. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21137. }, true);
  21138. console.log('zh:开始sm init1 start');
  21139. xGame.soundMgr.init();
  21140. console.log('zh:开始sm init1 end');
  21141. xGame.uiMgr.init();
  21142. xGame.uiMgr.clearTempData();
  21143. xGame.uiMgr.bindFUI(fguiRes.loading);
  21144. xGame.uiMgr.Show(UILoading);
  21145. }
  21146. function loadSubRes(callback) {
  21147. var tab = ["asset", "res", "spine"];
  21148. let subDone = 0;
  21149. for (var i = 0; i < tab.length; i++) {
  21150. let sub = tab[i];
  21151. Moyu.loadSubRes(sub, (pro) => {
  21152. callback && callback(pro, false);
  21153. }).then(() => {
  21154. subDone++;
  21155. if (subDone >= tab.length)
  21156. callback && callback(1, true);
  21157. });
  21158. }
  21159. }
  21160. function enterGame() {
  21161. xGame.cfgMgr.init();
  21162. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21163. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21164. xGame.uiMgr.Hide(UILoading);
  21165. fgui.UIPackage.removePackage(fguiRes.loading);
  21166. xGame.uiMgr.bindFUI(fguiRes.game);
  21167. xGame.uiMgr.Show(UIMain$1);
  21168. if (DataMgr.getNewUser())
  21169. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21170. }
  21171. function getPlat() {
  21172. let cfg = new MoyuCfg();
  21173. cfg.plat = MoyuPlat.web;
  21174. cfg.myId = 120;
  21175. cfg.myKey = '8848a885774230a4';
  21176. cfg.version = 0;
  21177. if (window.hasOwnProperty("gamebox")) {
  21178. cfg.plat = MoyuPlat.f399;
  21179. cfg.version = 0;
  21180. }
  21181. else if (window.hasOwnProperty("ks")) {
  21182. cfg.plat = MoyuPlat.ks;
  21183. cfg.version = 0;
  21184. cfg.ads.ksVideoId = '2300002254_01';
  21185. cfg.ads.ksInsertId = '2300002254_02';
  21186. }
  21187. else if (Laya.Browser.onTTMiniGame) {
  21188. cfg.plat = MoyuPlat.tt;
  21189. cfg.version = 0;
  21190. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21191. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21192. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21193. }
  21194. else if (Laya.Browser.onMiniGame) {
  21195. cfg.plat = MoyuPlat.wx;
  21196. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21197. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21198. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21199. }
  21200. else if (Laya.Browser.onQQMiniGame) {
  21201. cfg.plat = MoyuPlat.qq;
  21202. }
  21203. else if (Laya.Browser.onQGMiniGame) {
  21204. cfg.plat = MoyuPlat.op;
  21205. cfg.ads.opVideoId = '455502';
  21206. cfg.ads.opBannerId = '455507';
  21207. }
  21208. else if (Laya.Browser.onVVMiniGame) {
  21209. cfg.plat = MoyuPlat.vv;
  21210. cfg.version = 0;
  21211. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21212. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21213. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21214. }
  21215. else if (Laya.Browser.onHWMiniGame) {
  21216. cfg.plat = MoyuPlat.hw;
  21217. }
  21218. else if (window["mz"]) {
  21219. cfg.plat = MoyuPlat.mz;
  21220. }
  21221. else {
  21222. let cfg = window['conchConfig'];
  21223. if (cfg) {
  21224. var os = cfg.getOS();
  21225. if (os == "Conch-ios") {
  21226. cfg.plat = MoyuPlat.ios;
  21227. }
  21228. else if (os == "Conch-android") {
  21229. }
  21230. }
  21231. }
  21232. return cfg;
  21233. }
  21234. class Main {
  21235. constructor() {
  21236. if (window["Laya3D"])
  21237. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21238. else {
  21239. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21240. this.initMain();
  21241. }
  21242. }
  21243. initMain() {
  21244. Laya["Physics"] && Laya["Physics"].enable();
  21245. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21246. Laya.stage.scaleMode = GameConfig.scaleMode;
  21247. Laya.stage.screenMode = GameConfig.screenMode;
  21248. Laya.stage.alignV = GameConfig.alignV;
  21249. Laya.stage.alignH = GameConfig.alignH;
  21250. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21251. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21252. Laya.enableDebugPanel();
  21253. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21254. Laya["PhysicsDebugDraw"].enable();
  21255. if (GameConfig.stat)
  21256. Laya.Stat.show();
  21257. Laya.alertGlobalError(true);
  21258. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21259. }
  21260. onVersionLoaded() {
  21261. appInit();
  21262. }
  21263. }
  21264. new Main();
  21265. }());
  21266. //# sourceMappingURL=bundle.js.map