bundle.js 826 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672
  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.closeBtn = (this.getChild("closeBtn"));
  6126. this.n19 = (this.getChild("n19"));
  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. }
  12150. }
  12151. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12152. class ui_Component58_11 extends fgui.GComponent {
  12153. static createInstance() {
  12154. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12155. }
  12156. onConstruct() {
  12157. this.n23 = (this.getChild("n23"));
  12158. this.n41 = (this.getChild("n41"));
  12159. this.myList = (this.getChild("myList"));
  12160. this.n45 = (this.getChild("n45"));
  12161. this.n44 = (this.getChild("n44"));
  12162. this.t0 = this.getTransition("t0");
  12163. }
  12164. }
  12165. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12166. class ui_Component100 extends fgui.GComponent {
  12167. static createInstance() {
  12168. return (fgui.UIPackage.createObject("game", "Component100"));
  12169. }
  12170. onConstruct() {
  12171. this.c1 = this.getController("c1");
  12172. this.n75 = (this.getChild("n75"));
  12173. this.n76 = (this.getChild("n76"));
  12174. this.n80 = (this.getChild("n80"));
  12175. this.txt = (this.getChild("txt"));
  12176. this.spineRoot = (this.getChild("spineRoot"));
  12177. }
  12178. }
  12179. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12180. class ui_Component101 extends fgui.GComponent {
  12181. static createInstance() {
  12182. return (fgui.UIPackage.createObject("game", "Component101"));
  12183. }
  12184. onConstruct() {
  12185. this.c1 = this.getController("c1");
  12186. this.n36 = (this.getChild("n36"));
  12187. this.n35 = (this.getChild("n35"));
  12188. this.n33 = (this.getChild("n33"));
  12189. this.n34 = (this.getChild("n34"));
  12190. }
  12191. }
  12192. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12193. class ui_Component53 extends fgui.GComponent {
  12194. static createInstance() {
  12195. return (fgui.UIPackage.createObject("game", "Component53"));
  12196. }
  12197. onConstruct() {
  12198. this.n0 = (this.getChild("n0"));
  12199. this.n1 = (this.getChild("n1"));
  12200. this.n2 = (this.getChild("n2"));
  12201. this.n3 = (this.getChild("n3"));
  12202. this.n4 = (this.getChild("n4"));
  12203. this.n5 = (this.getChild("n5"));
  12204. this.n6 = (this.getChild("n6"));
  12205. this.n7 = (this.getChild("n7"));
  12206. this.n8 = (this.getChild("n8"));
  12207. this.n9 = (this.getChild("n9"));
  12208. this.n10 = (this.getChild("n10"));
  12209. this.n11 = (this.getChild("n11"));
  12210. this.n12 = (this.getChild("n12"));
  12211. this.n13 = (this.getChild("n13"));
  12212. this.n14 = (this.getChild("n14"));
  12213. this.n15 = (this.getChild("n15"));
  12214. this.n16 = (this.getChild("n16"));
  12215. this.n19 = (this.getChild("n19"));
  12216. this.n20 = (this.getChild("n20"));
  12217. this.n21 = (this.getChild("n21"));
  12218. this.n22 = (this.getChild("n22"));
  12219. this.n23 = (this.getChild("n23"));
  12220. this.n24 = (this.getChild("n24"));
  12221. this.n25 = (this.getChild("n25"));
  12222. this.n26 = (this.getChild("n26"));
  12223. this.n27 = (this.getChild("n27"));
  12224. this.n28 = (this.getChild("n28"));
  12225. this.n29 = (this.getChild("n29"));
  12226. this.n30 = (this.getChild("n30"));
  12227. this.n31 = (this.getChild("n31"));
  12228. this.n32 = (this.getChild("n32"));
  12229. this.n33 = (this.getChild("n33"));
  12230. this.n34 = (this.getChild("n34"));
  12231. this.n35 = (this.getChild("n35"));
  12232. this.t0 = this.getTransition("t0");
  12233. }
  12234. }
  12235. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12236. class ui_Component58 extends fgui.GComponent {
  12237. static createInstance() {
  12238. return (fgui.UIPackage.createObject("game", "Component58"));
  12239. }
  12240. onConstruct() {
  12241. this.n23 = (this.getChild("n23"));
  12242. this.n41 = (this.getChild("n41"));
  12243. this.n8 = (this.getChild("n8"));
  12244. this.skillList = (this.getChild("skillList"));
  12245. this.t0 = this.getTransition("t0");
  12246. }
  12247. }
  12248. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12249. class ui_Component59 extends fgui.GComponent {
  12250. static createInstance() {
  12251. return (fgui.UIPackage.createObject("game", "Component59"));
  12252. }
  12253. onConstruct() {
  12254. this.n3 = (this.getChild("n3"));
  12255. this.msgTxt = (this.getChild("msgTxt"));
  12256. this.t0 = this.getTransition("t0");
  12257. }
  12258. }
  12259. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12260. class ui_RulerNode extends fgui.GComponent {
  12261. static createInstance() {
  12262. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12263. }
  12264. onConstruct() {
  12265. this.n6 = (this.getChild("n6"));
  12266. this.n4 = (this.getChild("n4"));
  12267. this.img1 = (this.getChild("img1"));
  12268. this.img2 = (this.getChild("img2"));
  12269. }
  12270. }
  12271. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12272. class ui_Component108 extends fgui.GComponent {
  12273. static createInstance() {
  12274. return (fgui.UIPackage.createObject("game", "Component108"));
  12275. }
  12276. onConstruct() {
  12277. this.n19 = (this.getChild("n19"));
  12278. this.t0 = this.getTransition("t0");
  12279. }
  12280. }
  12281. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12282. class ui_Component63 extends fgui.GComponent {
  12283. static createInstance() {
  12284. return (fgui.UIPackage.createObject("game", "Component63"));
  12285. }
  12286. onConstruct() {
  12287. this.n66 = (this.getChild("n66"));
  12288. this.n56 = (this.getChild("n56"));
  12289. this.n63 = (this.getChild("n63"));
  12290. this.n65 = (this.getChild("n65"));
  12291. this.t0 = this.getTransition("t0");
  12292. }
  12293. }
  12294. ui_Component63.URL = "ui://isxx5ak7h657452";
  12295. class ui_topNode extends fgui.GComponent {
  12296. static createInstance() {
  12297. return (fgui.UIPackage.createObject("game", "topNode"));
  12298. }
  12299. onConstruct() {
  12300. this.selfProgress = (this.getChild("selfProgress"));
  12301. this.aiProgress = (this.getChild("aiProgress"));
  12302. this.selfKuang = (this.getChild("selfKuang"));
  12303. this.aiKuang = (this.getChild("aiKuang"));
  12304. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12305. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12306. this.n33 = (this.getChild("n33"));
  12307. this.n34 = (this.getChild("n34"));
  12308. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12309. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12310. this.selfBallList = (this.getChild("selfBallList"));
  12311. this.aiBallList = (this.getChild("aiBallList"));
  12312. this.middleNode = (this.getChild("middleNode"));
  12313. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12314. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12315. this.scoreNode = (this.getChild("scoreNode"));
  12316. this.selfTips = (this.getChild("selfTips"));
  12317. this.aiTips = (this.getChild("aiTips"));
  12318. }
  12319. }
  12320. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12321. class ui_selfProgress extends fgui.GProgressBar {
  12322. static createInstance() {
  12323. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12324. }
  12325. onConstruct() {
  12326. this.n3 = (this.getChild("n3"));
  12327. this.bar = (this.getChild("bar"));
  12328. }
  12329. }
  12330. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12331. class ui_aiProgress extends fgui.GProgressBar {
  12332. static createInstance() {
  12333. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12334. }
  12335. onConstruct() {
  12336. this.n3 = (this.getChild("n3"));
  12337. this.bar = (this.getChild("bar"));
  12338. }
  12339. }
  12340. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12341. class ui_ballDisplay extends fgui.GComponent {
  12342. static createInstance() {
  12343. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12344. }
  12345. onConstruct() {
  12346. this.myImg = (this.getChild("myImg"));
  12347. }
  12348. }
  12349. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12350. class ui_moveNode extends fgui.GComponent {
  12351. static createInstance() {
  12352. return (fgui.UIPackage.createObject("game", "moveNode"));
  12353. }
  12354. onConstruct() {
  12355. this.n8 = (this.getChild("n8"));
  12356. this.finger = (this.getChild("finger"));
  12357. }
  12358. }
  12359. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12360. class ui_cancelBtn extends fgui.GButton {
  12361. static createInstance() {
  12362. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12363. }
  12364. onConstruct() {
  12365. this.c1 = this.getController("c1");
  12366. this.n0 = (this.getChild("n0"));
  12367. this.n1 = (this.getChild("n1"));
  12368. }
  12369. }
  12370. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12371. class ui_shareBtn extends fgui.GButton {
  12372. static createInstance() {
  12373. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12374. }
  12375. onConstruct() {
  12376. this.c1 = this.getController("c1");
  12377. this.n2 = (this.getChild("n2"));
  12378. this.n1 = (this.getChild("n1"));
  12379. this.n3 = (this.getChild("n3"));
  12380. this.n4 = (this.getChild("n4"));
  12381. this.n5 = (this.getChild("n5"));
  12382. this.n6 = (this.getChild("n6"));
  12383. }
  12384. }
  12385. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12386. class ui_share2Btn extends fgui.GButton {
  12387. static createInstance() {
  12388. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12389. }
  12390. onConstruct() {
  12391. this.n3 = (this.getChild("n3"));
  12392. }
  12393. }
  12394. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12395. class ui_rodMethodNode extends fgui.GComponent {
  12396. static createInstance() {
  12397. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12398. }
  12399. onConstruct() {
  12400. this.bg = (this.getChild("bg"));
  12401. this.dot = (this.getChild("dot"));
  12402. }
  12403. }
  12404. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12405. class ui_sureBtn extends fgui.GButton {
  12406. static createInstance() {
  12407. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12408. }
  12409. onConstruct() {
  12410. this.n2 = (this.getChild("n2"));
  12411. this.n1 = (this.getChild("n1"));
  12412. }
  12413. }
  12414. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12415. class ui_Component18 extends fgui.GComponent {
  12416. static createInstance() {
  12417. return (fgui.UIPackage.createObject("game", "Component18"));
  12418. }
  12419. onConstruct() {
  12420. this.c1 = this.getController("c1");
  12421. this.nameTxt = (this.getChild("nameTxt"));
  12422. this.headImg = (this.getChild("headImg"));
  12423. this.n24 = (this.getChild("n24"));
  12424. this.skillImg = (this.getChild("skillImg"));
  12425. this.skillTxt = (this.getChild("skillTxt"));
  12426. }
  12427. }
  12428. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12429. class ui_Component45 extends fgui.GComponent {
  12430. static createInstance() {
  12431. return (fgui.UIPackage.createObject("game", "Component45"));
  12432. }
  12433. onConstruct() {
  12434. this.c1 = this.getController("c1");
  12435. this.n40 = (this.getChild("n40"));
  12436. this.n41 = (this.getChild("n41"));
  12437. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12438. this.n42 = (this.getChild("n42"));
  12439. this.awardTxt = (this.getChild("awardTxt"));
  12440. this.n44 = (this.getChild("n44"));
  12441. this.t0 = this.getTransition("t0");
  12442. }
  12443. }
  12444. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12445. class ui_emotionDisplay extends fgui.GButton {
  12446. static createInstance() {
  12447. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12448. }
  12449. onConstruct() {
  12450. this.myIcon = (this.getChild("myIcon"));
  12451. }
  12452. }
  12453. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12454. class ui_Component49 extends fgui.GButton {
  12455. static createInstance() {
  12456. return (fgui.UIPackage.createObject("game", "Component49"));
  12457. }
  12458. onConstruct() {
  12459. this.n69 = (this.getChild("n69"));
  12460. this.n56 = (this.getChild("n56"));
  12461. }
  12462. }
  12463. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12464. class ui_Component50 extends fgui.GButton {
  12465. static createInstance() {
  12466. return (fgui.UIPackage.createObject("game", "Component50"));
  12467. }
  12468. onConstruct() {
  12469. this.n54 = (this.getChild("n54"));
  12470. this.n65 = (this.getChild("n65"));
  12471. }
  12472. }
  12473. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12474. class ui_Component51 extends fgui.GButton {
  12475. static createInstance() {
  12476. return (fgui.UIPackage.createObject("game", "Component51"));
  12477. }
  12478. onConstruct() {
  12479. this.c1 = this.getController("c1");
  12480. this.n51 = (this.getChild("n51"));
  12481. this.n54 = (this.getChild("n54"));
  12482. }
  12483. }
  12484. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12485. class ui_Button5 extends fgui.GButton {
  12486. static createInstance() {
  12487. return (fgui.UIPackage.createObject("game", "Button5"));
  12488. }
  12489. onConstruct() {
  12490. this.c1 = this.getController("c1");
  12491. this.n0 = (this.getChild("n0"));
  12492. this.n2 = (this.getChild("n2"));
  12493. }
  12494. }
  12495. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12496. class ui_Component124 extends fgui.GComponent {
  12497. static createInstance() {
  12498. return (fgui.UIPackage.createObject("game", "Component124"));
  12499. }
  12500. onConstruct() {
  12501. this.n22 = (this.getChild("n22"));
  12502. this.shareNode = (this.getChild("shareNode"));
  12503. }
  12504. }
  12505. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12506. class ui_Component125 extends fgui.GComponent {
  12507. static createInstance() {
  12508. return (fgui.UIPackage.createObject("game", "Component125"));
  12509. }
  12510. onConstruct() {
  12511. this.n29 = (this.getChild("n29"));
  12512. this.coinTxt = (this.getChild("coinTxt"));
  12513. }
  12514. }
  12515. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12516. class ui_Component52 extends fgui.GButton {
  12517. static createInstance() {
  12518. return (fgui.UIPackage.createObject("game", "Component52"));
  12519. }
  12520. onConstruct() {
  12521. this.n35 = (this.getChild("n35"));
  12522. this.n36 = (this.getChild("n36"));
  12523. }
  12524. }
  12525. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12526. class ui_drawBtn extends fgui.GButton {
  12527. static createInstance() {
  12528. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12529. }
  12530. onConstruct() {
  12531. this.c1 = this.getController("c1");
  12532. this.n2 = (this.getChild("n2"));
  12533. this.n1 = (this.getChild("n1"));
  12534. this.n5 = (this.getChild("n5"));
  12535. }
  12536. }
  12537. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12538. class ui_Component43 extends fgui.GButton {
  12539. static createInstance() {
  12540. return (fgui.UIPackage.createObject("game", "Component43"));
  12541. }
  12542. onConstruct() {
  12543. this.n49 = (this.getChild("n49"));
  12544. }
  12545. }
  12546. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12547. class ui_wordsDisplay extends fgui.GComponent {
  12548. static createInstance() {
  12549. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12550. }
  12551. onConstruct() {
  12552. this.txt = (this.getChild("txt"));
  12553. this.n63 = (this.getChild("n63"));
  12554. }
  12555. }
  12556. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12557. class ui_Component3 extends fgui.GComponent {
  12558. static createInstance() {
  12559. return (fgui.UIPackage.createObject("game", "Component3"));
  12560. }
  12561. onConstruct() {
  12562. this.n26 = (this.getChild("n26"));
  12563. this.n24 = (this.getChild("n24"));
  12564. this.nameTxt = (this.getChild("nameTxt"));
  12565. this.headRoot = (this.getChild("headRoot"));
  12566. }
  12567. }
  12568. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12569. class ui_Component4 extends fgui.GComponent {
  12570. static createInstance() {
  12571. return (fgui.UIPackage.createObject("game", "Component4"));
  12572. }
  12573. onConstruct() {
  12574. this.headImg = (this.getChild("headImg"));
  12575. }
  12576. }
  12577. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12578. class ui_Component7 extends fgui.GButton {
  12579. static createInstance() {
  12580. return (fgui.UIPackage.createObject("game", "Component7"));
  12581. }
  12582. onConstruct() {
  12583. this.n17 = (this.getChild("n17"));
  12584. }
  12585. }
  12586. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12587. class ui_Component8 extends fgui.GButton {
  12588. static createInstance() {
  12589. return (fgui.UIPackage.createObject("game", "Component8"));
  12590. }
  12591. onConstruct() {
  12592. this.n19 = (this.getChild("n19"));
  12593. }
  12594. }
  12595. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12596. class ui_Component10 extends fgui.GButton {
  12597. static createInstance() {
  12598. return (fgui.UIPackage.createObject("game", "Component10"));
  12599. }
  12600. onConstruct() {
  12601. this.c1 = this.getController("c1");
  12602. this.n40 = (this.getChild("n40"));
  12603. }
  12604. }
  12605. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12606. class ui_Component11 extends fgui.GButton {
  12607. static createInstance() {
  12608. return (fgui.UIPackage.createObject("game", "Component11"));
  12609. }
  12610. onConstruct() {
  12611. this.n34 = (this.getChild("n34"));
  12612. }
  12613. }
  12614. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12615. class ui_Component12 extends fgui.GButton {
  12616. static createInstance() {
  12617. return (fgui.UIPackage.createObject("game", "Component12"));
  12618. }
  12619. onConstruct() {
  12620. this.n35 = (this.getChild("n35"));
  12621. }
  12622. }
  12623. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12624. class ui_Component13 extends fgui.GButton {
  12625. static createInstance() {
  12626. return (fgui.UIPackage.createObject("game", "Component13"));
  12627. }
  12628. onConstruct() {
  12629. this.n27 = (this.getChild("n27"));
  12630. this.n36 = (this.getChild("n36"));
  12631. }
  12632. }
  12633. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12634. class ui_dh_js_tuowei extends fgui.GComponent {
  12635. static createInstance() {
  12636. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12637. }
  12638. onConstruct() {
  12639. this.n19 = (this.getChild("n19"));
  12640. this.n18 = (this.getChild("n18"));
  12641. this.n0 = (this.getChild("n0"));
  12642. this.n3 = (this.getChild("n3"));
  12643. this.n4 = (this.getChild("n4"));
  12644. this.n5 = (this.getChild("n5"));
  12645. this.n6 = (this.getChild("n6"));
  12646. this.n8 = (this.getChild("n8"));
  12647. this.n9 = (this.getChild("n9"));
  12648. this.n10 = (this.getChild("n10"));
  12649. this.n11 = (this.getChild("n11"));
  12650. this.n12 = (this.getChild("n12"));
  12651. this.n13 = (this.getChild("n13"));
  12652. this.n14 = (this.getChild("n14"));
  12653. this.n15 = (this.getChild("n15"));
  12654. this.n20 = (this.getChild("n20"));
  12655. this.t0 = this.getTransition("t0");
  12656. this.t1 = this.getTransition("t1");
  12657. }
  12658. }
  12659. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12660. class ui_dh_js_tw_g extends fgui.GComponent {
  12661. static createInstance() {
  12662. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12663. }
  12664. onConstruct() {
  12665. this.n0 = (this.getChild("n0"));
  12666. this.n1 = (this.getChild("n1"));
  12667. this.t0 = this.getTransition("t0");
  12668. }
  12669. }
  12670. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12671. class ui_dh_js_xingxing extends fgui.GComponent {
  12672. static createInstance() {
  12673. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12674. }
  12675. onConstruct() {
  12676. this.n1 = (this.getChild("n1"));
  12677. this.n2 = (this.getChild("n2"));
  12678. this.n3 = (this.getChild("n3"));
  12679. this.n4 = (this.getChild("n4"));
  12680. this.n0 = (this.getChild("n0"));
  12681. this.t2 = this.getTransition("t2");
  12682. this.t1 = this.getTransition("t1");
  12683. }
  12684. }
  12685. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12686. class ui_dh_zy_jiazai extends fgui.GComponent {
  12687. static createInstance() {
  12688. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12689. }
  12690. onConstruct() {
  12691. this.c1 = this.getController("c1");
  12692. this.n0 = (this.getChild("n0"));
  12693. this.n1 = (this.getChild("n1"));
  12694. this.n2 = (this.getChild("n2"));
  12695. this.n4 = (this.getChild("n4"));
  12696. this.n5 = (this.getChild("n5"));
  12697. this.n6 = (this.getChild("n6"));
  12698. this.n8 = (this.getChild("n8"));
  12699. this.n7 = (this.getChild("n7"));
  12700. this.t0 = this.getTransition("t0");
  12701. }
  12702. }
  12703. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12704. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12705. static createInstance() {
  12706. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12707. }
  12708. onConstruct() {
  12709. this.c1 = this.getController("c1");
  12710. this.n3 = (this.getChild("n3"));
  12711. this.n5 = (this.getChild("n5"));
  12712. this.n4 = (this.getChild("n4"));
  12713. this.n0 = (this.getChild("n0"));
  12714. this.n1 = (this.getChild("n1"));
  12715. this.n2 = (this.getChild("n2"));
  12716. }
  12717. }
  12718. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12719. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12720. static createInstance() {
  12721. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12722. }
  12723. onConstruct() {
  12724. this.n19 = (this.getChild("n19"));
  12725. this.n21 = (this.getChild("n21"));
  12726. this.n0 = (this.getChild("n0"));
  12727. this.n3 = (this.getChild("n3"));
  12728. this.n4 = (this.getChild("n4"));
  12729. this.n5 = (this.getChild("n5"));
  12730. this.n6 = (this.getChild("n6"));
  12731. this.n8 = (this.getChild("n8"));
  12732. this.n9 = (this.getChild("n9"));
  12733. this.n10 = (this.getChild("n10"));
  12734. this.n11 = (this.getChild("n11"));
  12735. this.n12 = (this.getChild("n12"));
  12736. this.n13 = (this.getChild("n13"));
  12737. this.n14 = (this.getChild("n14"));
  12738. this.n15 = (this.getChild("n15"));
  12739. this.n23 = (this.getChild("n23"));
  12740. this.t0 = this.getTransition("t0");
  12741. this.t1 = this.getTransition("t1");
  12742. }
  12743. }
  12744. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12745. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12746. static createInstance() {
  12747. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12748. }
  12749. onConstruct() {
  12750. this.n1 = (this.getChild("n1"));
  12751. this.n2 = (this.getChild("n2"));
  12752. this.t0 = this.getTransition("t0");
  12753. }
  12754. }
  12755. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12756. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12757. static createInstance() {
  12758. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12759. }
  12760. onConstruct() {
  12761. this.n4 = (this.getChild("n4"));
  12762. this.n2 = (this.getChild("n2"));
  12763. this.n3 = (this.getChild("n3"));
  12764. this.idle = this.getTransition("idle");
  12765. this.attack = this.getTransition("attack");
  12766. }
  12767. }
  12768. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12769. class ui_special extends fgui.GComponent {
  12770. static createInstance() {
  12771. return (fgui.UIPackage.createObject("game", "special"));
  12772. }
  12773. onConstruct() {
  12774. this.n18 = (this.getChild("n18"));
  12775. this.n19 = (this.getChild("n19"));
  12776. this.n20 = (this.getChild("n20"));
  12777. this.n21 = (this.getChild("n21"));
  12778. this.n22 = (this.getChild("n22"));
  12779. this.levelTxt = (this.getChild("levelTxt"));
  12780. this.n24 = (this.getChild("n24"));
  12781. this.n25 = (this.getChild("n25"));
  12782. this.t0 = this.getTransition("t0");
  12783. }
  12784. }
  12785. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12786. class ui_Component145 extends fgui.GComponent {
  12787. static createInstance() {
  12788. return (fgui.UIPackage.createObject("game", "Component145"));
  12789. }
  12790. onConstruct() {
  12791. this.guanyuNode = (this.getChild("guanyuNode"));
  12792. }
  12793. }
  12794. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12795. class ui_longBtn extends fgui.GButton {
  12796. static createInstance() {
  12797. return (fgui.UIPackage.createObject("game", "longBtn"));
  12798. }
  12799. onConstruct() {
  12800. this.c1 = this.getController("c1");
  12801. this.n2 = (this.getChild("n2"));
  12802. this.n1 = (this.getChild("n1"));
  12803. this.n4 = (this.getChild("n4"));
  12804. }
  12805. }
  12806. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12807. class ui_Component146 extends fgui.GComponent {
  12808. static createInstance() {
  12809. return (fgui.UIPackage.createObject("game", "Component146"));
  12810. }
  12811. onConstruct() {
  12812. this.n89 = (this.getChild("n89"));
  12813. this.n90 = (this.getChild("n90"));
  12814. this.guideBtn = (this.getChild("guideBtn"));
  12815. }
  12816. }
  12817. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12818. class ui_Component146_11 extends fgui.GComponent {
  12819. static createInstance() {
  12820. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12821. }
  12822. onConstruct() {
  12823. this.n89 = (this.getChild("n89"));
  12824. this.n90 = (this.getChild("n90"));
  12825. this.guideBtn = (this.getChild("guideBtn"));
  12826. }
  12827. }
  12828. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12829. class ui_Component111_1 extends fgui.GComponent {
  12830. static createInstance() {
  12831. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12832. }
  12833. onConstruct() {
  12834. this.n68 = (this.getChild("n68"));
  12835. this.myMask = (this.getChild("myMask"));
  12836. }
  12837. }
  12838. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12839. class ui_Component64_1 extends fgui.GComponent {
  12840. static createInstance() {
  12841. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12842. }
  12843. onConstruct() {
  12844. this.n57 = (this.getChild("n57"));
  12845. this.n54 = (this.getChild("n54"));
  12846. this.n55 = (this.getChild("n55"));
  12847. this.n56 = (this.getChild("n56"));
  12848. this.t1 = this.getTransition("t1");
  12849. }
  12850. }
  12851. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12852. class ui_ModeSelection_com123 extends fgui.GComponent {
  12853. static createInstance() {
  12854. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12855. }
  12856. onConstruct() {
  12857. this.type1 = (this.getChild("type1"));
  12858. this.type2 = (this.getChild("type2"));
  12859. this.type3 = (this.getChild("type3"));
  12860. this.n38 = (this.getChild("n38"));
  12861. this.t0 = this.getTransition("t0");
  12862. }
  12863. }
  12864. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12865. class ui_Component132_2 extends fgui.GComponent {
  12866. static createInstance() {
  12867. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12868. }
  12869. onConstruct() {
  12870. this.n25 = (this.getChild("n25"));
  12871. this.n26 = (this.getChild("n26"));
  12872. this.n27 = (this.getChild("n27"));
  12873. this.t0 = this.getTransition("t0");
  12874. }
  12875. }
  12876. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12877. class ui_UIPower$1 extends fgui.GComponent {
  12878. static createInstance() {
  12879. return (fgui.UIPackage.createObject("game", "UIPower"));
  12880. }
  12881. onConstruct() {
  12882. this.n11 = (this.getChild("n11"));
  12883. this.myNode = (this.getChild("myNode"));
  12884. this.t0 = this.getTransition("t0");
  12885. }
  12886. }
  12887. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12888. class ui_Component133 extends fgui.GComponent {
  12889. static createInstance() {
  12890. return (fgui.UIPackage.createObject("game", "Component133"));
  12891. }
  12892. onConstruct() {
  12893. this.n29 = (this.getChild("n29"));
  12894. this.n30 = (this.getChild("n30"));
  12895. }
  12896. }
  12897. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12898. class ui_Component134 extends fgui.GComponent {
  12899. static createInstance() {
  12900. return (fgui.UIPackage.createObject("game", "Component134"));
  12901. }
  12902. onConstruct() {
  12903. this.n30 = (this.getChild("n30"));
  12904. this.n31 = (this.getChild("n31"));
  12905. this.t0 = this.getTransition("t0");
  12906. }
  12907. }
  12908. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12909. class ui_Component135 extends fgui.GComponent {
  12910. static createInstance() {
  12911. return (fgui.UIPackage.createObject("game", "Component135"));
  12912. }
  12913. onConstruct() {
  12914. this.n30 = (this.getChild("n30"));
  12915. this.t0 = this.getTransition("t0");
  12916. }
  12917. }
  12918. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12919. class ui_Component137 extends fgui.GComponent {
  12920. static createInstance() {
  12921. return (fgui.UIPackage.createObject("game", "Component137"));
  12922. }
  12923. onConstruct() {
  12924. this.n28 = (this.getChild("n28"));
  12925. this.n29 = (this.getChild("n29"));
  12926. this.n30 = (this.getChild("n30"));
  12927. this.n32 = (this.getChild("n32"));
  12928. }
  12929. }
  12930. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12931. class ui_dh_zuanshi extends fgui.GButton {
  12932. static createInstance() {
  12933. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12934. }
  12935. onConstruct() {
  12936. this.n1 = (this.getChild("n1"));
  12937. this.n2 = (this.getChild("n2"));
  12938. this.n0 = (this.getChild("n0"));
  12939. this.n3 = (this.getChild("n3"));
  12940. this.n4 = (this.getChild("n4"));
  12941. }
  12942. }
  12943. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12944. class ui_Component138 extends fgui.GComponent {
  12945. static createInstance() {
  12946. return (fgui.UIPackage.createObject("game", "Component138"));
  12947. }
  12948. onConstruct() {
  12949. this.n1 = (this.getChild("n1"));
  12950. this.n2 = (this.getChild("n2"));
  12951. this.t0 = this.getTransition("t0");
  12952. }
  12953. }
  12954. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12955. class ui_Component139 extends fgui.GComponent {
  12956. static createInstance() {
  12957. return (fgui.UIPackage.createObject("game", "Component139"));
  12958. }
  12959. onConstruct() {
  12960. this.n0 = (this.getChild("n0"));
  12961. this.t0 = this.getTransition("t0");
  12962. }
  12963. }
  12964. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12965. class ui_Component140 extends fgui.GComponent {
  12966. static createInstance() {
  12967. return (fgui.UIPackage.createObject("game", "Component140"));
  12968. }
  12969. onConstruct() {
  12970. this.n2 = (this.getChild("n2"));
  12971. this.n3 = (this.getChild("n3"));
  12972. this.t0 = this.getTransition("t0");
  12973. }
  12974. }
  12975. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12976. class ui_Component141 extends fgui.GComponent {
  12977. static createInstance() {
  12978. return (fgui.UIPackage.createObject("game", "Component141"));
  12979. }
  12980. onConstruct() {
  12981. this.n0 = (this.getChild("n0"));
  12982. this.t0 = this.getTransition("t0");
  12983. }
  12984. }
  12985. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12986. class ui_powerNode extends fgui.GProgressBar {
  12987. static createInstance() {
  12988. return (fgui.UIPackage.createObject("game", "powerNode"));
  12989. }
  12990. onConstruct() {
  12991. this.n2 = (this.getChild("n2"));
  12992. this.bar_v = (this.getChild("bar_v"));
  12993. this.showImg = (this.getChild("showImg"));
  12994. this.n12 = (this.getChild("n12"));
  12995. }
  12996. }
  12997. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  12998. class ui_dh_jingbi1 extends fgui.GComponent {
  12999. static createInstance() {
  13000. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13001. }
  13002. onConstruct() {
  13003. this.n0 = (this.getChild("n0"));
  13004. this.n1 = (this.getChild("n1"));
  13005. this.n2 = (this.getChild("n2"));
  13006. this.n3 = (this.getChild("n3"));
  13007. this.n4 = (this.getChild("n4"));
  13008. this.n5 = (this.getChild("n5"));
  13009. this.n6 = (this.getChild("n6"));
  13010. this.n8 = (this.getChild("n8"));
  13011. this.t0 = this.getTransition("t0");
  13012. }
  13013. }
  13014. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13015. class ui_Component94 extends fgui.GButton {
  13016. static createInstance() {
  13017. return (fgui.UIPackage.createObject("game", "Component94"));
  13018. }
  13019. onConstruct() {
  13020. this.n77 = (this.getChild("n77"));
  13021. }
  13022. }
  13023. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13024. class ui_Component95 extends fgui.GButton {
  13025. static createInstance() {
  13026. return (fgui.UIPackage.createObject("game", "Component95"));
  13027. }
  13028. onConstruct() {
  13029. this.n77 = (this.getChild("n77"));
  13030. }
  13031. }
  13032. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13033. class ui_Component126 extends fgui.GComponent {
  13034. static createInstance() {
  13035. return (fgui.UIPackage.createObject("game", "Component126"));
  13036. }
  13037. onConstruct() {
  13038. this.c1 = this.getController("c1");
  13039. this.normalBtn = (this.getChild("normalBtn"));
  13040. this.tripleBtn = (this.getChild("tripleBtn"));
  13041. }
  13042. }
  13043. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13044. class ui_Component60 extends fgui.GComponent {
  13045. static createInstance() {
  13046. return (fgui.UIPackage.createObject("game", "Component60"));
  13047. }
  13048. onConstruct() {
  13049. this.c1 = this.getController("c1");
  13050. this.n48 = (this.getChild("n48"));
  13051. this.womanTxt = (this.getChild("womanTxt"));
  13052. this.t0 = this.getTransition("t0");
  13053. }
  13054. }
  13055. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13056. class ui_Component98_3 extends fgui.GButton {
  13057. static createInstance() {
  13058. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13059. }
  13060. onConstruct() {
  13061. this.c1 = this.getController("c1");
  13062. this.n8 = (this.getChild("n8"));
  13063. this.n41 = (this.getChild("n41"));
  13064. this.n40 = (this.getChild("n40"));
  13065. }
  13066. }
  13067. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13068. class ui_ModeSelection_com1 extends fgui.GButton {
  13069. static createInstance() {
  13070. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13071. }
  13072. onConstruct() {
  13073. this.n34 = (this.getChild("n34"));
  13074. this.n36 = (this.getChild("n36"));
  13075. this.n22 = (this.getChild("n22"));
  13076. this.n20 = (this.getChild("n20"));
  13077. this.n23 = (this.getChild("n23"));
  13078. this.n24 = (this.getChild("n24"));
  13079. this.n26 = (this.getChild("n26"));
  13080. this.n33 = (this.getChild("n33"));
  13081. this.coinImg = (this.getChild("coinImg"));
  13082. this.need = (this.getChild("need"));
  13083. this.n35 = (this.getChild("n35"));
  13084. this.n29 = (this.getChild("n29"));
  13085. this.tipsTxt = (this.getChild("tipsTxt"));
  13086. this.n30 = (this.getChild("n30"));
  13087. this.peopleTxt = (this.getChild("peopleTxt"));
  13088. this.t0 = this.getTransition("t0");
  13089. }
  13090. }
  13091. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13092. class ui_ModeSelection_com2 extends fgui.GButton {
  13093. static createInstance() {
  13094. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13095. }
  13096. onConstruct() {
  13097. this.n36 = (this.getChild("n36"));
  13098. this.n34 = (this.getChild("n34"));
  13099. this.n22 = (this.getChild("n22"));
  13100. this.n20 = (this.getChild("n20"));
  13101. this.n23 = (this.getChild("n23"));
  13102. this.n24 = (this.getChild("n24"));
  13103. this.n26 = (this.getChild("n26"));
  13104. this.n33 = (this.getChild("n33"));
  13105. this.coinImg = (this.getChild("coinImg"));
  13106. this.need = (this.getChild("need"));
  13107. this.n35 = (this.getChild("n35"));
  13108. this.n29 = (this.getChild("n29"));
  13109. this.tipsTxt = (this.getChild("tipsTxt"));
  13110. this.n30 = (this.getChild("n30"));
  13111. this.peopleTxt = (this.getChild("peopleTxt"));
  13112. this.t0 = this.getTransition("t0");
  13113. }
  13114. }
  13115. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13116. class ui_ModeSelection_com3 extends fgui.GButton {
  13117. static createInstance() {
  13118. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13119. }
  13120. onConstruct() {
  13121. this.n34 = (this.getChild("n34"));
  13122. this.n36 = (this.getChild("n36"));
  13123. this.n22 = (this.getChild("n22"));
  13124. this.n20 = (this.getChild("n20"));
  13125. this.n23 = (this.getChild("n23"));
  13126. this.n24 = (this.getChild("n24"));
  13127. this.n26 = (this.getChild("n26"));
  13128. this.n33 = (this.getChild("n33"));
  13129. this.coinImg = (this.getChild("coinImg"));
  13130. this.need = (this.getChild("need"));
  13131. this.n35 = (this.getChild("n35"));
  13132. this.n29 = (this.getChild("n29"));
  13133. this.tipsTxt = (this.getChild("tipsTxt"));
  13134. this.n30 = (this.getChild("n30"));
  13135. this.peopleTxt = (this.getChild("peopleTxt"));
  13136. this.t0 = this.getTransition("t0");
  13137. }
  13138. }
  13139. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13140. class ui_Invitation_com1 extends fgui.GComponent {
  13141. static createInstance() {
  13142. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13143. }
  13144. onConstruct() {
  13145. this.n14 = (this.getChild("n14"));
  13146. this.n13 = (this.getChild("n13"));
  13147. this.n3 = (this.getChild("n3"));
  13148. this.n1 = (this.getChild("n1"));
  13149. this.n6 = (this.getChild("n6"));
  13150. this.n7 = (this.getChild("n7"));
  13151. this.enterBtn = (this.getChild("enterBtn"));
  13152. this.n11 = (this.getChild("n11"));
  13153. this.n12 = (this.getChild("n12"));
  13154. this.n15 = (this.getChild("n15"));
  13155. this.t0 = this.getTransition("t0");
  13156. this.t1 = this.getTransition("t1");
  13157. }
  13158. }
  13159. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13160. class ui_Component87_1 extends fgui.GComponent {
  13161. static createInstance() {
  13162. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13163. }
  13164. onConstruct() {
  13165. this.n74 = (this.getChild("n74"));
  13166. this.n73 = (this.getChild("n73"));
  13167. this.ballTxt = (this.getChild("ballTxt"));
  13168. this.n76 = (this.getChild("n76"));
  13169. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13170. this.levelTxt = (this.getChild("levelTxt"));
  13171. this.n87 = (this.getChild("n87"));
  13172. this.n84 = (this.getChild("n84"));
  13173. this.hpTxt = (this.getChild("hpTxt"));
  13174. this.n89 = (this.getChild("n89"));
  13175. this.tipsTxt = (this.getChild("tipsTxt"));
  13176. }
  13177. }
  13178. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13179. class ui_sqg1 extends fgui.GComponent {
  13180. static createInstance() {
  13181. return (fgui.UIPackage.createObject("game", "sqg1"));
  13182. }
  13183. onConstruct() {
  13184. this.n1 = (this.getChild("n1"));
  13185. this.n0 = (this.getChild("n0"));
  13186. }
  13187. }
  13188. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13189. class ui_sqg2 extends fgui.GComponent {
  13190. static createInstance() {
  13191. return (fgui.UIPackage.createObject("game", "sqg2"));
  13192. }
  13193. onConstruct() {
  13194. this.n1 = (this.getChild("n1"));
  13195. this.n0 = (this.getChild("n0"));
  13196. }
  13197. }
  13198. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13199. class ui_sqg3 extends fgui.GComponent {
  13200. static createInstance() {
  13201. return (fgui.UIPackage.createObject("game", "sqg3"));
  13202. }
  13203. onConstruct() {
  13204. this.n1 = (this.getChild("n1"));
  13205. this.n0 = (this.getChild("n0"));
  13206. }
  13207. }
  13208. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13209. class ui_sqg4 extends fgui.GComponent {
  13210. static createInstance() {
  13211. return (fgui.UIPackage.createObject("game", "sqg4"));
  13212. }
  13213. onConstruct() {
  13214. this.n1 = (this.getChild("n1"));
  13215. this.n0 = (this.getChild("n0"));
  13216. }
  13217. }
  13218. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13219. class ui_Component36 extends fgui.GButton {
  13220. static createInstance() {
  13221. return (fgui.UIPackage.createObject("game", "Component36"));
  13222. }
  13223. onConstruct() {
  13224. this.c1 = this.getController("c1");
  13225. this.n53 = (this.getChild("n53"));
  13226. this.n56 = (this.getChild("n56"));
  13227. }
  13228. }
  13229. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13230. class ui_Component37 extends fgui.GButton {
  13231. static createInstance() {
  13232. return (fgui.UIPackage.createObject("game", "Component37"));
  13233. }
  13234. onConstruct() {
  13235. this.c1 = this.getController("c1");
  13236. this.n52 = (this.getChild("n52"));
  13237. this.n54 = (this.getChild("n54"));
  13238. }
  13239. }
  13240. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13241. class ui_UISetting extends fgui.GComponent {
  13242. static createInstance() {
  13243. return (fgui.UIPackage.createObject("game", "UISetting"));
  13244. }
  13245. onConstruct() {
  13246. this.c1 = this.getController("c1");
  13247. this.n4 = (this.getChild("n4"));
  13248. this.soundBtn = (this.getChild("soundBtn"));
  13249. this.shakeBtn = (this.getChild("shakeBtn"));
  13250. this.clickNode = (this.getChild("clickNode"));
  13251. this.xyBtn = (this.getChild("xyBtn"));
  13252. }
  13253. }
  13254. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13255. class ui_Component39 extends fgui.GComponent {
  13256. static createInstance() {
  13257. return (fgui.UIPackage.createObject("game", "Component39"));
  13258. }
  13259. onConstruct() {
  13260. this.n5 = (this.getChild("n5"));
  13261. this.n6 = (this.getChild("n6"));
  13262. this.n7 = (this.getChild("n7"));
  13263. this.t0 = this.getTransition("t0");
  13264. }
  13265. }
  13266. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13267. class ui_Component40 extends fgui.GButton {
  13268. static createInstance() {
  13269. return (fgui.UIPackage.createObject("game", "Component40"));
  13270. }
  13271. onConstruct() {
  13272. this.n46 = (this.getChild("n46"));
  13273. this.n47 = (this.getChild("n47"));
  13274. }
  13275. }
  13276. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13277. class ui_Component41 extends fgui.GComponent {
  13278. static createInstance() {
  13279. return (fgui.UIPackage.createObject("game", "Component41"));
  13280. }
  13281. onConstruct() {
  13282. this.c1 = this.getController("c1");
  13283. this.n0 = (this.getChild("n0"));
  13284. this.titleTxt = (this.getChild("titleTxt"));
  13285. this.n2 = (this.getChild("n2"));
  13286. this.msgTips = (this.getChild("msgTips"));
  13287. this.numTxt = (this.getChild("numTxt"));
  13288. this.n18 = (this.getChild("n18"));
  13289. this.cancelBtn = (this.getChild("cancelBtn"));
  13290. this.videoBtn = (this.getChild("videoBtn"));
  13291. this.n10 = (this.getChild("n10"));
  13292. }
  13293. }
  13294. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13295. class ui_Component42 extends fgui.GComponent {
  13296. static createInstance() {
  13297. return (fgui.UIPackage.createObject("game", "Component42"));
  13298. }
  13299. onConstruct() {
  13300. this.c1 = this.getController("c1");
  13301. this.n1 = (this.getChild("n1"));
  13302. this.n2 = (this.getChild("n2"));
  13303. this.n3 = (this.getChild("n3"));
  13304. this.tipsTxt = (this.getChild("tipsTxt"));
  13305. this.cancelBtn = (this.getChild("cancelBtn"));
  13306. this.sureBtn = (this.getChild("sureBtn"));
  13307. this.n11 = (this.getChild("n11"));
  13308. this.n13 = (this.getChild("n13"));
  13309. this.n14 = (this.getChild("n14"));
  13310. this.womanTxt = (this.getChild("womanTxt"));
  13311. this.t0 = this.getTransition("t0");
  13312. }
  13313. }
  13314. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13315. class ui_dh_js_shengli extends fgui.GComponent {
  13316. static createInstance() {
  13317. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13318. }
  13319. onConstruct() {
  13320. this.n3 = (this.getChild("n3"));
  13321. this.n4 = (this.getChild("n4"));
  13322. this.n1 = (this.getChild("n1"));
  13323. this.n2 = (this.getChild("n2"));
  13324. this.n5 = (this.getChild("n5"));
  13325. this.n6 = (this.getChild("n6"));
  13326. this.n7 = (this.getChild("n7"));
  13327. this.n8 = (this.getChild("n8"));
  13328. this.attack = this.getTransition("attack");
  13329. this.idle = this.getTransition("idle");
  13330. }
  13331. }
  13332. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13333. class ui_dh_js_shengli_g extends fgui.GComponent {
  13334. static createInstance() {
  13335. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13336. }
  13337. onConstruct() {
  13338. this.n3 = (this.getChild("n3"));
  13339. this.n1 = (this.getChild("n1"));
  13340. this.t0 = this.getTransition("t0");
  13341. }
  13342. }
  13343. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13344. class ui_dh_js_shibai extends fgui.GComponent {
  13345. static createInstance() {
  13346. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13347. }
  13348. onConstruct() {
  13349. this.n0 = (this.getChild("n0"));
  13350. this.n1 = (this.getChild("n1"));
  13351. this.n2 = (this.getChild("n2"));
  13352. this.n3 = (this.getChild("n3"));
  13353. this.idle = this.getTransition("idle");
  13354. this.attack = this.getTransition("attack");
  13355. }
  13356. }
  13357. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13358. class ui_dh_zy_ganfa extends fgui.GButton {
  13359. static createInstance() {
  13360. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13361. }
  13362. onConstruct() {
  13363. this.n0 = (this.getChild("n0"));
  13364. }
  13365. }
  13366. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13367. class ui_dh_zy_sc_guang extends fgui.GButton {
  13368. static createInstance() {
  13369. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13370. }
  13371. onConstruct() {
  13372. this.n0 = (this.getChild("n0"));
  13373. this.n2 = (this.getChild("n2"));
  13374. }
  13375. }
  13376. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13377. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13378. static createInstance() {
  13379. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13380. }
  13381. onConstruct() {
  13382. this.n0 = (this.getChild("n0"));
  13383. this.n3 = (this.getChild("n3"));
  13384. this.t0 = this.getTransition("t0");
  13385. }
  13386. }
  13387. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13388. class ui_dh_zy_wanfa extends fgui.GButton {
  13389. static createInstance() {
  13390. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13391. }
  13392. onConstruct() {
  13393. this.n0 = (this.getChild("n0"));
  13394. }
  13395. }
  13396. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13397. class ui_Component53_1 extends fgui.GComponent {
  13398. static createInstance() {
  13399. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13400. }
  13401. onConstruct() {
  13402. this.n0 = (this.getChild("n0"));
  13403. this.n1 = (this.getChild("n1"));
  13404. this.n2 = (this.getChild("n2"));
  13405. this.n3 = (this.getChild("n3"));
  13406. this.n4 = (this.getChild("n4"));
  13407. this.n5 = (this.getChild("n5"));
  13408. this.n6 = (this.getChild("n6"));
  13409. this.n7 = (this.getChild("n7"));
  13410. this.n8 = (this.getChild("n8"));
  13411. this.n9 = (this.getChild("n9"));
  13412. this.n10 = (this.getChild("n10"));
  13413. this.n11 = (this.getChild("n11"));
  13414. this.n12 = (this.getChild("n12"));
  13415. this.n13 = (this.getChild("n13"));
  13416. this.n14 = (this.getChild("n14"));
  13417. this.n15 = (this.getChild("n15"));
  13418. this.n16 = (this.getChild("n16"));
  13419. this.n19 = (this.getChild("n19"));
  13420. this.n20 = (this.getChild("n20"));
  13421. this.n21 = (this.getChild("n21"));
  13422. this.n22 = (this.getChild("n22"));
  13423. this.n23 = (this.getChild("n23"));
  13424. this.n24 = (this.getChild("n24"));
  13425. this.n25 = (this.getChild("n25"));
  13426. this.n26 = (this.getChild("n26"));
  13427. this.n27 = (this.getChild("n27"));
  13428. this.n28 = (this.getChild("n28"));
  13429. this.n29 = (this.getChild("n29"));
  13430. this.n30 = (this.getChild("n30"));
  13431. this.n31 = (this.getChild("n31"));
  13432. this.n32 = (this.getChild("n32"));
  13433. this.n33 = (this.getChild("n33"));
  13434. this.n34 = (this.getChild("n34"));
  13435. this.n35 = (this.getChild("n35"));
  13436. this.t0 = this.getTransition("t0");
  13437. }
  13438. }
  13439. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13440. class ui_Component30 extends fgui.GComponent {
  13441. static createInstance() {
  13442. return (fgui.UIPackage.createObject("game", "Component30"));
  13443. }
  13444. onConstruct() {
  13445. this.c1 = this.getController("c1");
  13446. this.n46 = (this.getChild("n46"));
  13447. this.n47 = (this.getChild("n47"));
  13448. this.numTxt = (this.getChild("numTxt"));
  13449. this.n50 = (this.getChild("n50"));
  13450. this.n53 = (this.getChild("n53"));
  13451. this.n54 = (this.getChild("n54"));
  13452. this.n55 = (this.getChild("n55"));
  13453. this.n56 = (this.getChild("n56"));
  13454. }
  13455. }
  13456. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13457. class ui_Component30_1 extends fgui.GComponent {
  13458. static createInstance() {
  13459. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13460. }
  13461. onConstruct() {
  13462. this.c1 = this.getController("c1");
  13463. this.n46 = (this.getChild("n46"));
  13464. this.n47 = (this.getChild("n47"));
  13465. this.numTxt = (this.getChild("numTxt"));
  13466. this.n50 = (this.getChild("n50"));
  13467. this.n51 = (this.getChild("n51"));
  13468. this.n52 = (this.getChild("n52"));
  13469. this.n53 = (this.getChild("n53"));
  13470. this.n54 = (this.getChild("n54"));
  13471. }
  13472. }
  13473. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13474. class ui_Component31 extends fgui.GComponent {
  13475. static createInstance() {
  13476. return (fgui.UIPackage.createObject("game", "Component31"));
  13477. }
  13478. onConstruct() {
  13479. this.n55 = (this.getChild("n55"));
  13480. this.n54 = (this.getChild("n54"));
  13481. this.conditionTxt = (this.getChild("conditionTxt"));
  13482. this.n57 = (this.getChild("n57"));
  13483. this.t0 = this.getTransition("t0");
  13484. }
  13485. }
  13486. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13487. class ui_Component32 extends fgui.GComponent {
  13488. static createInstance() {
  13489. return (fgui.UIPackage.createObject("game", "Component32"));
  13490. }
  13491. onConstruct() {
  13492. this.n5 = (this.getChild("n5"));
  13493. this.n6 = (this.getChild("n6"));
  13494. this.n7 = (this.getChild("n7"));
  13495. this.t0 = this.getTransition("t0");
  13496. }
  13497. }
  13498. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13499. class ui_AwardItem extends fgui.GComponent {
  13500. static createInstance() {
  13501. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13502. }
  13503. onConstruct() {
  13504. this.n9 = (this.getChild("n9"));
  13505. this.myIcon = (this.getChild("myIcon"));
  13506. this.numTxt = (this.getChild("numTxt"));
  13507. this.nameTxt = (this.getChild("nameTxt"));
  13508. this.n16 = (this.getChild("n16"));
  13509. this.n17 = (this.getChild("n17"));
  13510. }
  13511. }
  13512. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13513. class ui_ranking_com1 extends fgui.GButton {
  13514. static createInstance() {
  13515. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13516. }
  13517. onConstruct() {
  13518. this.c1 = this.getController("c1");
  13519. this.n49 = (this.getChild("n49"));
  13520. this.n18 = (this.getChild("n18"));
  13521. this.n46 = (this.getChild("n46"));
  13522. this.n48 = (this.getChild("n48"));
  13523. this.n50 = (this.getChild("n50"));
  13524. }
  13525. }
  13526. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13527. class ui_ranking_com2 extends fgui.GButton {
  13528. static createInstance() {
  13529. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13530. }
  13531. onConstruct() {
  13532. this.c1 = this.getController("c1");
  13533. this.n49 = (this.getChild("n49"));
  13534. this.n18 = (this.getChild("n18"));
  13535. this.n46 = (this.getChild("n46"));
  13536. this.n48 = (this.getChild("n48"));
  13537. this.n50 = (this.getChild("n50"));
  13538. }
  13539. }
  13540. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13541. class ui_ranking_com3 extends fgui.GComponent {
  13542. static createInstance() {
  13543. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13544. }
  13545. onConstruct() {
  13546. this.n17 = (this.getChild("n17"));
  13547. this.myIcon = (this.getChild("myIcon"));
  13548. }
  13549. }
  13550. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13551. class ui_ranking_com4 extends fgui.GComponent {
  13552. static createInstance() {
  13553. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13554. }
  13555. onConstruct() {
  13556. this.n16 = (this.getChild("n16"));
  13557. this.head = (this.getChild("head"));
  13558. }
  13559. }
  13560. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13561. class ui_ranking_com5 extends fgui.GComponent {
  13562. static createInstance() {
  13563. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13564. }
  13565. onConstruct() {
  13566. this.c1 = this.getController("c1");
  13567. this.c2 = this.getController("c2");
  13568. this.n2 = (this.getChild("n2"));
  13569. this.n3 = (this.getChild("n3"));
  13570. this.levelBtn = (this.getChild("levelBtn"));
  13571. this.starBtn = (this.getChild("starBtn"));
  13572. this.n23 = (this.getChild("n23"));
  13573. this.n24 = (this.getChild("n24"));
  13574. this.n25 = (this.getChild("n25"));
  13575. this.myList = (this.getChild("myList"));
  13576. this.selfNode = (this.getChild("selfNode"));
  13577. this.n9 = (this.getChild("n9"));
  13578. this.n12 = (this.getChild("n12"));
  13579. this.n13 = (this.getChild("n13"));
  13580. this.n14 = (this.getChild("n14"));
  13581. this.n39 = (this.getChild("n39"));
  13582. this.n41 = (this.getChild("n41"));
  13583. this.n42 = (this.getChild("n42"));
  13584. this.n45 = (this.getChild("n45"));
  13585. this.changeBtn = (this.getChild("changeBtn"));
  13586. this.closeBtn = (this.getChild("closeBtn"));
  13587. this.t0 = this.getTransition("t0");
  13588. }
  13589. }
  13590. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13591. class ui_RankItem extends fgui.GComponent {
  13592. static createInstance() {
  13593. return (fgui.UIPackage.createObject("game", "RankItem"));
  13594. }
  13595. onConstruct() {
  13596. this.n10 = (this.getChild("n10"));
  13597. this.n11 = (this.getChild("n11"));
  13598. this.rankTxt = (this.getChild("rankTxt"));
  13599. this.headNode = (this.getChild("headNode"));
  13600. this.nameTxt = (this.getChild("nameTxt"));
  13601. this.n19 = (this.getChild("n19"));
  13602. this.valueTxt = (this.getChild("valueTxt"));
  13603. this.img1 = (this.getChild("img1"));
  13604. this.img2 = (this.getChild("img2"));
  13605. this.img3 = (this.getChild("img3"));
  13606. }
  13607. }
  13608. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13609. class ui_ranking_com9 extends fgui.GComponent {
  13610. static createInstance() {
  13611. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13612. }
  13613. onConstruct() {
  13614. this.c1 = this.getController("c1");
  13615. this.n27 = (this.getChild("n27"));
  13616. this.n28 = (this.getChild("n28"));
  13617. this.headNode = (this.getChild("headNode"));
  13618. this.rankTxt = (this.getChild("rankTxt"));
  13619. this.nameTxt = (this.getChild("nameTxt"));
  13620. this.n34 = (this.getChild("n34"));
  13621. this.valueTxt = (this.getChild("valueTxt"));
  13622. this.n36 = (this.getChild("n36"));
  13623. this.n37 = (this.getChild("n37"));
  13624. this.n38 = (this.getChild("n38"));
  13625. this.n39 = (this.getChild("n39"));
  13626. this.n40 = (this.getChild("n40"));
  13627. }
  13628. }
  13629. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13630. class ui_ranking_com10 extends fgui.GComponent {
  13631. static createInstance() {
  13632. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13633. }
  13634. onConstruct() {
  13635. this.n23 = (this.getChild("n23"));
  13636. this.n24 = (this.getChild("n24"));
  13637. }
  13638. }
  13639. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13640. class ui_ranking_com11 extends fgui.GComponent {
  13641. static createInstance() {
  13642. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13643. }
  13644. onConstruct() {
  13645. this.n24 = (this.getChild("n24"));
  13646. this.n25 = (this.getChild("n25"));
  13647. this.t0 = this.getTransition("t0");
  13648. }
  13649. }
  13650. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13651. class ui_ranking_com13 extends fgui.GButton {
  13652. static createInstance() {
  13653. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13654. }
  13655. onConstruct() {
  13656. this.c1 = this.getController("c1");
  13657. this.n44 = (this.getChild("n44"));
  13658. this.n45 = (this.getChild("n45"));
  13659. this.n46 = (this.getChild("n46"));
  13660. }
  13661. }
  13662. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13663. class ui_Component122 extends fgui.GComponent {
  13664. static createInstance() {
  13665. return (fgui.UIPackage.createObject("game", "Component122"));
  13666. }
  13667. onConstruct() {
  13668. this.gameNode3 = (this.getChild("gameNode3"));
  13669. }
  13670. }
  13671. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13672. class ui_skillItem extends fgui.GComponent {
  13673. static createInstance() {
  13674. return (fgui.UIPackage.createObject("game", "skillItem"));
  13675. }
  13676. onConstruct() {
  13677. this.c1 = this.getController("c1");
  13678. this.n31 = (this.getChild("n31"));
  13679. this.n6 = (this.getChild("n6"));
  13680. this.skillImg = (this.getChild("skillImg"));
  13681. this.nameTxt = (this.getChild("nameTxt"));
  13682. this.levelTxt = (this.getChild("levelTxt"));
  13683. this.n28 = (this.getChild("n28"));
  13684. this.describeTxt = (this.getChild("describeTxt"));
  13685. this.n32 = (this.getChild("n32"));
  13686. this.mutiBtn = (this.getChild("mutiBtn"));
  13687. this.tryNode = (this.getChild("tryNode"));
  13688. this.normalBtn = (this.getChild("normalBtn"));
  13689. this.startBtn = (this.getChild("startBtn"));
  13690. this.n42 = (this.getChild("n42"));
  13691. this.n43 = (this.getChild("n43"));
  13692. this.n44 = (this.getChild("n44"));
  13693. }
  13694. }
  13695. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13696. class ui_Component26 extends fgui.GButton {
  13697. static createInstance() {
  13698. return (fgui.UIPackage.createObject("game", "Component26"));
  13699. }
  13700. onConstruct() {
  13701. this.n11 = (this.getChild("n11"));
  13702. this.n30 = (this.getChild("n30"));
  13703. this.n34 = (this.getChild("n34"));
  13704. }
  13705. }
  13706. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13707. class ui_Component28 extends fgui.GButton {
  13708. static createInstance() {
  13709. return (fgui.UIPackage.createObject("game", "Component28"));
  13710. }
  13711. onConstruct() {
  13712. this.n12 = (this.getChild("n12"));
  13713. this.n31 = (this.getChild("n31"));
  13714. this.curTxt = (this.getChild("curTxt"));
  13715. this.n33 = (this.getChild("n33"));
  13716. }
  13717. }
  13718. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13719. class ui_Component1302 extends fgui.GComponent {
  13720. static createInstance() {
  13721. return (fgui.UIPackage.createObject("game", "Component1302"));
  13722. }
  13723. onConstruct() {
  13724. this.n2 = (this.getChild("n2"));
  13725. this.n3 = (this.getChild("n3"));
  13726. }
  13727. }
  13728. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13729. class ui_Component113 extends fgui.GComponent {
  13730. static createInstance() {
  13731. return (fgui.UIPackage.createObject("game", "Component113"));
  13732. }
  13733. onConstruct() {
  13734. this.n85 = (this.getChild("n85"));
  13735. this.n86 = (this.getChild("n86"));
  13736. this.n77 = (this.getChild("n77"));
  13737. this.n79 = (this.getChild("n79"));
  13738. this.n80 = (this.getChild("n80"));
  13739. this.n81 = (this.getChild("n81"));
  13740. this.n82 = (this.getChild("n82"));
  13741. this.n84 = (this.getChild("n84"));
  13742. this.n87 = (this.getChild("n87"));
  13743. this.t0 = this.getTransition("t0");
  13744. }
  13745. }
  13746. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13747. class ui_Component114 extends fgui.GComponent {
  13748. static createInstance() {
  13749. return (fgui.UIPackage.createObject("game", "Component114"));
  13750. }
  13751. onConstruct() {
  13752. this.n77 = (this.getChild("n77"));
  13753. this.t0 = this.getTransition("t0");
  13754. }
  13755. }
  13756. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13757. class ui_Component115 extends fgui.GComponent {
  13758. static createInstance() {
  13759. return (fgui.UIPackage.createObject("game", "Component115"));
  13760. }
  13761. onConstruct() {
  13762. this.n83 = (this.getChild("n83"));
  13763. this.fingerNode = (this.getChild("fingerNode"));
  13764. this.n84 = (this.getChild("n84"));
  13765. }
  13766. }
  13767. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13768. class ui_Component117 extends fgui.GComponent {
  13769. static createInstance() {
  13770. return (fgui.UIPackage.createObject("game", "Component117"));
  13771. }
  13772. onConstruct() {
  13773. this.n87 = (this.getChild("n87"));
  13774. this.n88 = (this.getChild("n88"));
  13775. this.n84 = (this.getChild("n84"));
  13776. this.n85 = (this.getChild("n85"));
  13777. this.n86 = (this.getChild("n86"));
  13778. this.t0 = this.getTransition("t0");
  13779. }
  13780. }
  13781. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13782. class ui_Component98_1 extends fgui.GButton {
  13783. static createInstance() {
  13784. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13785. }
  13786. onConstruct() {
  13787. this.c1 = this.getController("c1");
  13788. this.n8 = (this.getChild("n8"));
  13789. this.n41 = (this.getChild("n41"));
  13790. this.n40 = (this.getChild("n40"));
  13791. }
  13792. }
  13793. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13794. class ui_Component61 extends fgui.GComponent {
  13795. static createInstance() {
  13796. return (fgui.UIPackage.createObject("game", "Component61"));
  13797. }
  13798. onConstruct() {
  13799. this.n14 = (this.getChild("n14"));
  13800. this.n6 = (this.getChild("n6"));
  13801. this.t0 = this.getTransition("t0");
  13802. }
  13803. }
  13804. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13805. class ui_Component62 extends fgui.GComponent {
  13806. static createInstance() {
  13807. return (fgui.UIPackage.createObject("game", "Component62"));
  13808. }
  13809. onConstruct() {
  13810. this.n66 = (this.getChild("n66"));
  13811. this.n56 = (this.getChild("n56"));
  13812. this.n63 = (this.getChild("n63"));
  13813. this.n65 = (this.getChild("n65"));
  13814. this.t0 = this.getTransition("t0");
  13815. }
  13816. }
  13817. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13818. class ui_d3Root extends fgui.GComponent {
  13819. static createInstance() {
  13820. return (fgui.UIPackage.createObject("game", "d3Root"));
  13821. }
  13822. onConstruct() {
  13823. }
  13824. }
  13825. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13826. class ui_d2Root extends fgui.GComponent {
  13827. static createInstance() {
  13828. return (fgui.UIPackage.createObject("game", "d2Root"));
  13829. }
  13830. onConstruct() {
  13831. }
  13832. }
  13833. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13834. class ui_ballNode extends fgui.GComponent {
  13835. static createInstance() {
  13836. return (fgui.UIPackage.createObject("game", "ballNode"));
  13837. }
  13838. onConstruct() {
  13839. }
  13840. }
  13841. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13842. class ui_border extends fgui.GComponent {
  13843. static createInstance() {
  13844. return (fgui.UIPackage.createObject("game", "border"));
  13845. }
  13846. onConstruct() {
  13847. this.bar1 = (this.getChild("bar1"));
  13848. this.bar2 = (this.getChild("bar2"));
  13849. this.bar3 = (this.getChild("bar3"));
  13850. this.bar4 = (this.getChild("bar4"));
  13851. this.bar5 = (this.getChild("bar5"));
  13852. this.bar6 = (this.getChild("bar6"));
  13853. this.circle1 = (this.getChild("circle1"));
  13854. this.circle2 = (this.getChild("circle2"));
  13855. this.circle3 = (this.getChild("circle3"));
  13856. this.circle4 = (this.getChild("circle4"));
  13857. this.circle5 = (this.getChild("circle5"));
  13858. this.circle6 = (this.getChild("circle6"));
  13859. this.n28 = (this.getChild("n28"));
  13860. }
  13861. }
  13862. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13863. class ui_Component41_2 extends fgui.GComponent {
  13864. static createInstance() {
  13865. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13866. }
  13867. onConstruct() {
  13868. this.c1 = this.getController("c1");
  13869. this.n0 = (this.getChild("n0"));
  13870. this.n2 = (this.getChild("n2"));
  13871. this.n19 = (this.getChild("n19"));
  13872. this.cancelBtn = (this.getChild("cancelBtn"));
  13873. this.videoBtn = (this.getChild("videoBtn"));
  13874. this.n9 = (this.getChild("n9"));
  13875. this.n22 = (this.getChild("n22"));
  13876. this.tipsTxt = (this.getChild("tipsTxt"));
  13877. this.n23 = (this.getChild("n23"));
  13878. this.n24 = (this.getChild("n24"));
  13879. this.n26 = (this.getChild("n26"));
  13880. this.n27 = (this.getChild("n27"));
  13881. this.titleTxt = (this.getChild("titleTxt"));
  13882. }
  13883. }
  13884. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13885. class ui_Component41_1 extends fgui.GComponent {
  13886. static createInstance() {
  13887. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13888. }
  13889. onConstruct() {
  13890. this.c1 = this.getController("c1");
  13891. this.n0 = (this.getChild("n0"));
  13892. this.n2 = (this.getChild("n2"));
  13893. this.cancelBtn = (this.getChild("cancelBtn"));
  13894. this.videoBtn = (this.getChild("videoBtn"));
  13895. this.n27 = (this.getChild("n27"));
  13896. this.n30 = (this.getChild("n30"));
  13897. this.n31 = (this.getChild("n31"));
  13898. this.n32 = (this.getChild("n32"));
  13899. this.n33 = (this.getChild("n33"));
  13900. this.n34 = (this.getChild("n34"));
  13901. this.n35 = (this.getChild("n35"));
  13902. this.n36 = (this.getChild("n36"));
  13903. this.n1 = (this.getChild("n1"));
  13904. this.n37 = (this.getChild("n37"));
  13905. this.t0 = this.getTransition("t0");
  13906. this.t1 = this.getTransition("t1");
  13907. this.t2 = this.getTransition("t2");
  13908. this.t3 = this.getTransition("t3");
  13909. }
  13910. }
  13911. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13912. class ui_againBtn extends fgui.GButton {
  13913. static createInstance() {
  13914. return (fgui.UIPackage.createObject("game", "againBtn"));
  13915. }
  13916. onConstruct() {
  13917. this.n2 = (this.getChild("n2"));
  13918. this.n1 = (this.getChild("n1"));
  13919. this.n5 = (this.getChild("n5"));
  13920. }
  13921. }
  13922. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13923. class ui_Component118 extends fgui.GButton {
  13924. static createInstance() {
  13925. return (fgui.UIPackage.createObject("game", "Component118"));
  13926. }
  13927. onConstruct() {
  13928. this.c1 = this.getController("c1");
  13929. this.n14 = (this.getChild("n14"));
  13930. this.n9 = (this.getChild("n9"));
  13931. this.n10 = (this.getChild("n10"));
  13932. this.diamondTxt = (this.getChild("diamondTxt"));
  13933. this.n13 = (this.getChild("n13"));
  13934. this.n15 = (this.getChild("n15"));
  13935. }
  13936. }
  13937. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13938. class ui_Component119 extends fgui.GComponent {
  13939. static createInstance() {
  13940. return (fgui.UIPackage.createObject("game", "Component119"));
  13941. }
  13942. onConstruct() {
  13943. this.n1 = (this.getChild("n1"));
  13944. this.n2 = (this.getChild("n2"));
  13945. this.n13 = (this.getChild("n13"));
  13946. this.n6 = (this.getChild("n6"));
  13947. this.screenNode = (this.getChild("screenNode"));
  13948. this.n15 = (this.getChild("n15"));
  13949. this.closeBtn = (this.getChild("closeBtn"));
  13950. this.share2Btn = (this.getChild("share2Btn"));
  13951. this.shareBtn = (this.getChild("shareBtn"));
  13952. this.tipsNode = (this.getChild("tipsNode"));
  13953. this.awardNode = (this.getChild("awardNode"));
  13954. }
  13955. }
  13956. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13957. class ui_Component132_1 extends fgui.GComponent {
  13958. static createInstance() {
  13959. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13960. }
  13961. onConstruct() {
  13962. this.n25 = (this.getChild("n25"));
  13963. this.n26 = (this.getChild("n26"));
  13964. this.n27 = (this.getChild("n27"));
  13965. this.t0 = this.getTransition("t0");
  13966. }
  13967. }
  13968. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13969. class ui_SecretaryDisplay extends fgui.GComponent {
  13970. static createInstance() {
  13971. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13972. }
  13973. onConstruct() {
  13974. this.n2 = (this.getChild("n2"));
  13975. this.levelTxt = (this.getChild("levelTxt"));
  13976. this.n4 = (this.getChild("n4"));
  13977. this.secretary = (this.getChild("secretary"));
  13978. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13979. this.n16 = (this.getChild("n16"));
  13980. this.n37 = (this.getChild("n37"));
  13981. this.n41 = (this.getChild("n41"));
  13982. this.n14 = (this.getChild("n14"));
  13983. this.n17 = (this.getChild("n17"));
  13984. this.heightTxt = (this.getChild("heightTxt"));
  13985. this.n46 = (this.getChild("n46"));
  13986. this.n36 = (this.getChild("n36"));
  13987. this.n38 = (this.getChild("n38"));
  13988. this.foodTxt = (this.getChild("foodTxt"));
  13989. this.n47 = (this.getChild("n47"));
  13990. this.n40 = (this.getChild("n40"));
  13991. this.n42 = (this.getChild("n42"));
  13992. this.historyTxt = (this.getChild("historyTxt"));
  13993. this.n48 = (this.getChild("n48"));
  13994. this.nameImg = (this.getChild("nameImg"));
  13995. this.n12 = (this.getChild("n12"));
  13996. this.n49 = (this.getChild("n49"));
  13997. this.t0 = this.getTransition("t0");
  13998. }
  13999. }
  14000. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14001. class ui_BallRodDisplay extends fgui.GComponent {
  14002. static createInstance() {
  14003. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14004. }
  14005. onConstruct() {
  14006. this.c1 = this.getController("c1");
  14007. this.n31 = (this.getChild("n31"));
  14008. this.n6 = (this.getChild("n6"));
  14009. this.nameTxt = (this.getChild("nameTxt"));
  14010. this.rodImg = (this.getChild("rodImg"));
  14011. this.levelNode = (this.getChild("levelNode"));
  14012. this.eftRod = (this.getChild("eftRod"));
  14013. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14014. }
  14015. }
  14016. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14017. class ui_Component111_11 extends fgui.GComponent {
  14018. static createInstance() {
  14019. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14020. }
  14021. onConstruct() {
  14022. this.n68 = (this.getChild("n68"));
  14023. this.n69 = (this.getChild("n69"));
  14024. }
  14025. }
  14026. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14027. class ui_Component112 extends fgui.GComponent {
  14028. static createInstance() {
  14029. return (fgui.UIPackage.createObject("game", "Component112"));
  14030. }
  14031. onConstruct() {
  14032. this.n68 = (this.getChild("n68"));
  14033. this.n70 = (this.getChild("n70"));
  14034. this.myMask = (this.getChild("myMask"));
  14035. }
  14036. }
  14037. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14038. class ui_Component111 extends fgui.GComponent {
  14039. static createInstance() {
  14040. return (fgui.UIPackage.createObject("game", "Component111"));
  14041. }
  14042. onConstruct() {
  14043. this.n68 = (this.getChild("n68"));
  14044. this.myMask = (this.getChild("myMask"));
  14045. }
  14046. }
  14047. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14048. class ui_Component144 extends fgui.GButton {
  14049. static createInstance() {
  14050. return (fgui.UIPackage.createObject("game", "Component144"));
  14051. }
  14052. onConstruct() {
  14053. this.n8 = (this.getChild("n8"));
  14054. }
  14055. }
  14056. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14057. class ui_Sign_com2 extends fgui.GComponent {
  14058. static createInstance() {
  14059. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14060. }
  14061. onConstruct() {
  14062. this.n0 = (this.getChild("n0"));
  14063. this.n1 = (this.getChild("n1"));
  14064. this.t0 = this.getTransition("t0");
  14065. }
  14066. }
  14067. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14068. class ui_Sign_guang extends fgui.GComponent {
  14069. static createInstance() {
  14070. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14071. }
  14072. onConstruct() {
  14073. this.n1 = (this.getChild("n1"));
  14074. this.n2 = (this.getChild("n2"));
  14075. this.n3 = (this.getChild("n3"));
  14076. this.n4 = (this.getChild("n4"));
  14077. this.n5 = (this.getChild("n5"));
  14078. this.n6 = (this.getChild("n6"));
  14079. this.n8 = (this.getChild("n8"));
  14080. }
  14081. }
  14082. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14083. class ui_SignMax extends fgui.GComponent {
  14084. static createInstance() {
  14085. return (fgui.UIPackage.createObject("game", "SignMax"));
  14086. }
  14087. onConstruct() {
  14088. this.c1 = this.getController("c1");
  14089. this.n7 = (this.getChild("n7"));
  14090. this.n15 = (this.getChild("n15"));
  14091. this.n8 = (this.getChild("n8"));
  14092. this.titleTxt = (this.getChild("titleTxt"));
  14093. this.myIcon1 = (this.getChild("myIcon1"));
  14094. this.numTxt1 = (this.getChild("numTxt1"));
  14095. this.myIcon2 = (this.getChild("myIcon2"));
  14096. this.n20 = (this.getChild("n20"));
  14097. this.n17 = (this.getChild("n17"));
  14098. this.numTxt2 = (this.getChild("numTxt2"));
  14099. this.n12 = (this.getChild("n12"));
  14100. this.n13 = (this.getChild("n13"));
  14101. this.n21 = (this.getChild("n21"));
  14102. this.n14 = (this.getChild("n14"));
  14103. }
  14104. }
  14105. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14106. class ui_Sign_com2_1 extends fgui.GComponent {
  14107. static createInstance() {
  14108. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14109. }
  14110. onConstruct() {
  14111. this.n0 = (this.getChild("n0"));
  14112. this.n1 = (this.getChild("n1"));
  14113. this.t0 = this.getTransition("t0");
  14114. }
  14115. }
  14116. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14117. class ui_Sign_com5 extends fgui.GComponent {
  14118. static createInstance() {
  14119. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14120. }
  14121. onConstruct() {
  14122. this.n3 = (this.getChild("n3"));
  14123. this.n29 = (this.getChild("n29"));
  14124. this.n4 = (this.getChild("n4"));
  14125. this.day1 = (this.getChild("day1"));
  14126. this.day2 = (this.getChild("day2"));
  14127. this.day3 = (this.getChild("day3"));
  14128. this.day4 = (this.getChild("day4"));
  14129. this.day5 = (this.getChild("day5"));
  14130. this.day6 = (this.getChild("day6"));
  14131. this.day7 = (this.getChild("day7"));
  14132. this.t0 = this.getTransition("t0");
  14133. }
  14134. }
  14135. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14136. class ui_Sign_com8 extends fgui.GComponent {
  14137. static createInstance() {
  14138. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14139. }
  14140. onConstruct() {
  14141. this.n48 = (this.getChild("n48"));
  14142. this.womanTxt = (this.getChild("womanTxt"));
  14143. this.t0 = this.getTransition("t0");
  14144. }
  14145. }
  14146. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14147. class ui_Sign_com6 extends fgui.GComponent {
  14148. static createInstance() {
  14149. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14150. }
  14151. onConstruct() {
  14152. this.n2 = (this.getChild("n2"));
  14153. this.n3 = (this.getChild("n3"));
  14154. this.t0 = this.getTransition("t0");
  14155. }
  14156. }
  14157. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14158. class ui_Sign_com7 extends fgui.GComponent {
  14159. static createInstance() {
  14160. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14161. }
  14162. onConstruct() {
  14163. this.n29 = (this.getChild("n29"));
  14164. this.n2 = (this.getChild("n2"));
  14165. }
  14166. }
  14167. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14168. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14169. static createInstance() {
  14170. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14171. }
  14172. onConstruct() {
  14173. this.n5 = (this.getChild("n5"));
  14174. this.n4 = (this.getChild("n4"));
  14175. this.t0 = this.getTransition("t0");
  14176. }
  14177. }
  14178. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14179. class ui_UITurntable_com2 extends fgui.GComponent {
  14180. static createInstance() {
  14181. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14182. }
  14183. onConstruct() {
  14184. this.c1 = this.getController("c1");
  14185. this.n4 = (this.getChild("n4"));
  14186. this.n6 = (this.getChild("n6"));
  14187. this.n10 = (this.getChild("n10"));
  14188. this.n11 = (this.getChild("n11"));
  14189. this.n12 = (this.getChild("n12"));
  14190. this.n13 = (this.getChild("n13"));
  14191. this.n14 = (this.getChild("n14"));
  14192. this.n15 = (this.getChild("n15"));
  14193. this.n16 = (this.getChild("n16"));
  14194. this.n17 = (this.getChild("n17"));
  14195. this.n18 = (this.getChild("n18"));
  14196. this.n19 = (this.getChild("n19"));
  14197. this.n20 = (this.getChild("n20"));
  14198. this.n21 = (this.getChild("n21"));
  14199. this.n22 = (this.getChild("n22"));
  14200. this.n23 = (this.getChild("n23"));
  14201. this.n24 = (this.getChild("n24"));
  14202. this.n25 = (this.getChild("n25"));
  14203. this.n26 = (this.getChild("n26"));
  14204. this.n27 = (this.getChild("n27"));
  14205. this.n28 = (this.getChild("n28"));
  14206. this.n29 = (this.getChild("n29"));
  14207. this.n30 = (this.getChild("n30"));
  14208. this.n31 = (this.getChild("n31"));
  14209. this.n32 = (this.getChild("n32"));
  14210. this.n33 = (this.getChild("n33"));
  14211. }
  14212. }
  14213. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14214. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14215. static createInstance() {
  14216. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14217. }
  14218. onConstruct() {
  14219. this.n5 = (this.getChild("n5"));
  14220. this.n4 = (this.getChild("n4"));
  14221. this.t0 = this.getTransition("t0");
  14222. }
  14223. }
  14224. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14225. class ui_UITurntable_com5 extends fgui.GComponent {
  14226. static createInstance() {
  14227. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14228. }
  14229. onConstruct() {
  14230. this.flashNode = (this.getChild("flashNode"));
  14231. this.rotNode = (this.getChild("rotNode"));
  14232. this.n3 = (this.getChild("n3"));
  14233. this.n21 = (this.getChild("n21"));
  14234. this.t0 = this.getTransition("t0");
  14235. }
  14236. }
  14237. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14238. class ui_UITurntable_com7 extends fgui.GComponent {
  14239. static createInstance() {
  14240. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14241. }
  14242. onConstruct() {
  14243. this.n2 = (this.getChild("n2"));
  14244. this.n35 = (this.getChild("n35"));
  14245. this.img1 = (this.getChild("img1"));
  14246. this.img2 = (this.getChild("img2"));
  14247. this.img3 = (this.getChild("img3"));
  14248. this.img4 = (this.getChild("img4"));
  14249. this.img6 = (this.getChild("img6"));
  14250. this.img5 = (this.getChild("img5"));
  14251. this.txt1 = (this.getChild("txt1"));
  14252. this.txt2 = (this.getChild("txt2"));
  14253. this.txt3 = (this.getChild("txt3"));
  14254. this.txt4 = (this.getChild("txt4"));
  14255. this.txt5 = (this.getChild("txt5"));
  14256. this.txt6 = (this.getChild("txt6"));
  14257. }
  14258. }
  14259. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14260. class ui_UITurntable_com9 extends fgui.GComponent {
  14261. static createInstance() {
  14262. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14263. }
  14264. onConstruct() {
  14265. this.n38 = (this.getChild("n38"));
  14266. this.n39 = (this.getChild("n39"));
  14267. }
  14268. }
  14269. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14270. class ui_UITurntable_com10 extends fgui.GComponent {
  14271. static createInstance() {
  14272. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14273. }
  14274. onConstruct() {
  14275. this.n39 = (this.getChild("n39"));
  14276. this.n40 = (this.getChild("n40"));
  14277. this.t0 = this.getTransition("t0");
  14278. }
  14279. }
  14280. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14281. class ui_UITurntable_com11 extends fgui.GComponent {
  14282. static createInstance() {
  14283. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14284. }
  14285. onConstruct() {
  14286. this.n38 = (this.getChild("n38"));
  14287. this.n39 = (this.getChild("n39"));
  14288. this.n40 = (this.getChild("n40"));
  14289. this.t0 = this.getTransition("t0");
  14290. }
  14291. }
  14292. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14293. class ui_UITurntable_com12 extends fgui.GComponent {
  14294. static createInstance() {
  14295. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14296. }
  14297. onConstruct() {
  14298. this.n43 = (this.getChild("n43"));
  14299. this.barNode = (this.getChild("barNode"));
  14300. this.tipsTxt = (this.getChild("tipsTxt"));
  14301. this.n45 = (this.getChild("n45"));
  14302. this.boxBtn = (this.getChild("boxBtn"));
  14303. }
  14304. }
  14305. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14306. class ui_UITurntable_com1 extends fgui.GButton {
  14307. static createInstance() {
  14308. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14309. }
  14310. onConstruct() {
  14311. this.n41 = (this.getChild("n41"));
  14312. this.n42 = (this.getChild("n42"));
  14313. this.t0 = this.getTransition("t0");
  14314. }
  14315. }
  14316. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14317. class ui_UITurntable_com3 extends fgui.GComponent {
  14318. static createInstance() {
  14319. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14320. }
  14321. onConstruct() {
  14322. this.n48 = (this.getChild("n48"));
  14323. this.womanTxt = (this.getChild("womanTxt"));
  14324. this.t0 = this.getTransition("t0");
  14325. }
  14326. }
  14327. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14328. class ui_cancelBtn2 extends fgui.GButton {
  14329. static createInstance() {
  14330. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14331. }
  14332. onConstruct() {
  14333. this.c1 = this.getController("c1");
  14334. this.n0 = (this.getChild("n0"));
  14335. this.n1 = (this.getChild("n1"));
  14336. this.n2 = (this.getChild("n2"));
  14337. this.n3 = (this.getChild("n3"));
  14338. this.n4 = (this.getChild("n4"));
  14339. this.n5 = (this.getChild("n5"));
  14340. this.n6 = (this.getChild("n6"));
  14341. this.n7 = (this.getChild("n7"));
  14342. this.n8 = (this.getChild("n8"));
  14343. this.powerEft = (this.getChild("powerEft"));
  14344. }
  14345. }
  14346. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14347. class ui_shareBtn2 extends fgui.GButton {
  14348. static createInstance() {
  14349. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14350. }
  14351. onConstruct() {
  14352. this.c1 = this.getController("c1");
  14353. this.n2 = (this.getChild("n2"));
  14354. this.n24 = (this.getChild("n24"));
  14355. this.n1 = (this.getChild("n1"));
  14356. this.n3 = (this.getChild("n3"));
  14357. this.n23 = (this.getChild("n23"));
  14358. this.n4 = (this.getChild("n4"));
  14359. this.n5 = (this.getChild("n5"));
  14360. this.n6 = (this.getChild("n6"));
  14361. this.n20 = (this.getChild("n20"));
  14362. this.n21 = (this.getChild("n21"));
  14363. this.n22 = (this.getChild("n22"));
  14364. this.powerEft = (this.getChild("powerEft"));
  14365. }
  14366. }
  14367. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14368. class ui_UIMoney extends fgui.GComponent {
  14369. static createInstance() {
  14370. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14371. }
  14372. onConstruct() {
  14373. this.c1 = this.getController("c1");
  14374. this.n4 = (this.getChild("n4"));
  14375. this.coinImg = (this.getChild("coinImg"));
  14376. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14377. this.coinTxt = (this.getChild("coinTxt"));
  14378. this.n7 = (this.getChild("n7"));
  14379. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14380. this.diamondTxt = (this.getChild("diamondTxt"));
  14381. this.diamondImg = (this.getChild("diamondImg"));
  14382. this.n12 = (this.getChild("n12"));
  14383. this.powerImg = (this.getChild("powerImg"));
  14384. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14385. this.powerTxt = (this.getChild("powerTxt"));
  14386. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14387. }
  14388. }
  14389. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14390. class ui_backBtn extends fgui.GButton {
  14391. static createInstance() {
  14392. return (fgui.UIPackage.createObject("game", "backBtn"));
  14393. }
  14394. onConstruct() {
  14395. this.n0 = (this.getChild("n0"));
  14396. this.t0 = this.getTransition("t0");
  14397. this.t1 = this.getTransition("t1");
  14398. }
  14399. }
  14400. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14401. class ui_MoneyBtn extends fgui.GButton {
  14402. static createInstance() {
  14403. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14404. }
  14405. onConstruct() {
  14406. this.button = this.getController("button");
  14407. this.n0 = (this.getChild("n0"));
  14408. }
  14409. }
  14410. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14411. class ui_UIMoneyBtn extends fgui.GComponent {
  14412. static createInstance() {
  14413. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14414. }
  14415. onConstruct() {
  14416. this.n1 = (this.getChild("n1"));
  14417. this.closeBtn = (this.getChild("closeBtn"));
  14418. }
  14419. }
  14420. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14421. class ui_Component64 extends fgui.GComponent {
  14422. static createInstance() {
  14423. return (fgui.UIPackage.createObject("game", "Component64"));
  14424. }
  14425. onConstruct() {
  14426. this.n57 = (this.getChild("n57"));
  14427. this.n54 = (this.getChild("n54"));
  14428. this.n55 = (this.getChild("n55"));
  14429. this.n56 = (this.getChild("n56"));
  14430. this.t1 = this.getTransition("t1");
  14431. }
  14432. }
  14433. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14434. class ui_Component41_3 extends fgui.GComponent {
  14435. static createInstance() {
  14436. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14437. }
  14438. onConstruct() {
  14439. this.c1 = this.getController("c1");
  14440. this.n0 = (this.getChild("n0"));
  14441. this.n2 = (this.getChild("n2"));
  14442. this.cancelBtn = (this.getChild("cancelBtn"));
  14443. this.videoBtn = (this.getChild("videoBtn"));
  14444. this.n9 = (this.getChild("n9"));
  14445. this.n24 = (this.getChild("n24"));
  14446. this.n27 = (this.getChild("n27"));
  14447. this.titleTxt = (this.getChild("titleTxt"));
  14448. this.n28 = (this.getChild("n28"));
  14449. this.t0 = this.getTransition("t0");
  14450. }
  14451. }
  14452. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14453. class ui_dh_zs_4 extends fgui.GComponent {
  14454. static createInstance() {
  14455. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14456. }
  14457. onConstruct() {
  14458. this.n1 = (this.getChild("n1"));
  14459. this.n2 = (this.getChild("n2"));
  14460. this.n3 = (this.getChild("n3"));
  14461. this.n4 = (this.getChild("n4"));
  14462. this.n5 = (this.getChild("n5"));
  14463. this.n6 = (this.getChild("n6"));
  14464. this.n8 = (this.getChild("n8"));
  14465. this.t0 = this.getTransition("t0");
  14466. }
  14467. }
  14468. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14469. class ui_Component71_1 extends fgui.GButton {
  14470. static createInstance() {
  14471. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14472. }
  14473. onConstruct() {
  14474. this.n17 = (this.getChild("n17"));
  14475. this.t0 = this.getTransition("t0");
  14476. }
  14477. }
  14478. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14479. class ui_Component83 extends fgui.GComponent {
  14480. static createInstance() {
  14481. return (fgui.UIPackage.createObject("game", "Component83"));
  14482. }
  14483. onConstruct() {
  14484. this.c1 = this.getController("c1");
  14485. this.n17 = (this.getChild("n17"));
  14486. this.n19 = (this.getChild("n19"));
  14487. this.n20 = (this.getChild("n20"));
  14488. }
  14489. }
  14490. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14491. class ui_Component84 extends fgui.GComponent {
  14492. static createInstance() {
  14493. return (fgui.UIPackage.createObject("game", "Component84"));
  14494. }
  14495. onConstruct() {
  14496. this.c1 = this.getController("c1");
  14497. this.n4 = (this.getChild("n4"));
  14498. this.n22 = (this.getChild("n22"));
  14499. this.n23 = (this.getChild("n23"));
  14500. this.numTxt = (this.getChild("numTxt"));
  14501. this.n25 = (this.getChild("n25"));
  14502. this.n26 = (this.getChild("n26"));
  14503. }
  14504. }
  14505. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14506. class ui_Component84_1 extends fgui.GComponent {
  14507. static createInstance() {
  14508. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14509. }
  14510. onConstruct() {
  14511. this.c1 = this.getController("c1");
  14512. this.n4 = (this.getChild("n4"));
  14513. this.n22 = (this.getChild("n22"));
  14514. this.n23 = (this.getChild("n23"));
  14515. this.numTxt = (this.getChild("numTxt"));
  14516. this.n25 = (this.getChild("n25"));
  14517. this.n26 = (this.getChild("n26"));
  14518. }
  14519. }
  14520. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14521. class ui_Component85 extends fgui.GComponent {
  14522. static createInstance() {
  14523. return (fgui.UIPackage.createObject("game", "Component85"));
  14524. }
  14525. onConstruct() {
  14526. this.n1 = (this.getChild("n1"));
  14527. this.n6 = (this.getChild("n6"));
  14528. this.n2 = (this.getChild("n2"));
  14529. this.n3 = (this.getChild("n3"));
  14530. this.levelTxt = (this.getChild("levelTxt"));
  14531. this.n10 = (this.getChild("n10"));
  14532. this.n11 = (this.getChild("n11"));
  14533. this.n12 = (this.getChild("n12"));
  14534. this.n13 = (this.getChild("n13"));
  14535. this.n14 = (this.getChild("n14"));
  14536. this.modeNode = (this.getChild("modeNode"));
  14537. this.n18 = (this.getChild("n18"));
  14538. this.conditionTxt = (this.getChild("conditionTxt"));
  14539. this.diamondNode = (this.getChild("diamondNode"));
  14540. this.coinNode = (this.getChild("coinNode"));
  14541. this.startBtn = (this.getChild("startBtn"));
  14542. this.n28 = (this.getChild("n28"));
  14543. this.displayRoot = (this.getChild("displayRoot"));
  14544. this.t0 = this.getTransition("t0");
  14545. }
  14546. }
  14547. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14548. class ui_Component86 extends fgui.GButton {
  14549. static createInstance() {
  14550. return (fgui.UIPackage.createObject("game", "Component86"));
  14551. }
  14552. onConstruct() {
  14553. this.n15 = (this.getChild("n15"));
  14554. this.t0 = this.getTransition("t0");
  14555. }
  14556. }
  14557. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14558. class ui_Component87 extends fgui.GComponent {
  14559. static createInstance() {
  14560. return (fgui.UIPackage.createObject("game", "Component87"));
  14561. }
  14562. onConstruct() {
  14563. this.n66 = (this.getChild("n66"));
  14564. this.myProgress = (this.getChild("myProgress"));
  14565. this.starAni = (this.getChild("starAni"));
  14566. this.hpTxt = (this.getChild("hpTxt"));
  14567. this.n74 = (this.getChild("n74"));
  14568. this.n73 = (this.getChild("n73"));
  14569. this.ballTxt = (this.getChild("ballTxt"));
  14570. this.n76 = (this.getChild("n76"));
  14571. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14572. this.levelTxt = (this.getChild("levelTxt"));
  14573. this.star1 = (this.getChild("star1"));
  14574. this.star2 = (this.getChild("star2"));
  14575. this.star3 = (this.getChild("star3"));
  14576. }
  14577. }
  14578. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14579. class ui_Component88 extends fgui.GProgressBar {
  14580. static createInstance() {
  14581. return (fgui.UIPackage.createObject("game", "Component88"));
  14582. }
  14583. onConstruct() {
  14584. this.n68 = (this.getChild("n68"));
  14585. this.bar = (this.getChild("bar"));
  14586. }
  14587. }
  14588. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14589. class ui_Component89 extends fgui.GComponent {
  14590. static createInstance() {
  14591. return (fgui.UIPackage.createObject("game", "Component89"));
  14592. }
  14593. onConstruct() {
  14594. this.c1 = this.getController("c1");
  14595. this.n71 = (this.getChild("n71"));
  14596. this.n72 = (this.getChild("n72"));
  14597. }
  14598. }
  14599. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14600. class ui_Component90 extends fgui.GComponent {
  14601. static createInstance() {
  14602. return (fgui.UIPackage.createObject("game", "Component90"));
  14603. }
  14604. onConstruct() {
  14605. this.c1 = this.getController("c1");
  14606. this.n64 = (this.getChild("n64"));
  14607. this.n65 = (this.getChild("n65"));
  14608. this.n66 = (this.getChild("n66"));
  14609. this.t0 = this.getTransition("t0");
  14610. }
  14611. }
  14612. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14613. class ui_Component127 extends fgui.GButton {
  14614. static createInstance() {
  14615. return (fgui.UIPackage.createObject("game", "Component127"));
  14616. }
  14617. onConstruct() {
  14618. this.n5 = (this.getChild("n5"));
  14619. }
  14620. }
  14621. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14622. class gameBinder {
  14623. static bindAll() {
  14624. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14625. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14626. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14627. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14628. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14629. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14630. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14631. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14632. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14633. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14634. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14635. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14636. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14637. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14638. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14639. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14640. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14641. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14642. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14643. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14644. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14645. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14646. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14647. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14648. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14649. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14650. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14651. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14652. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14653. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14654. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14655. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14656. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14657. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14658. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14659. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14660. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14661. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14662. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14663. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14664. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14665. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14666. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14667. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14668. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14669. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14670. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14671. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14672. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14673. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14674. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14675. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14676. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14677. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14678. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14679. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14680. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14681. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14682. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14683. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14684. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14685. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14686. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14687. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14688. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14689. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14690. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14691. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14692. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14693. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14694. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14695. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14696. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14697. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14698. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14699. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14700. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14701. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14702. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14703. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14704. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14705. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14706. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14707. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14708. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14709. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14710. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14711. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14712. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14713. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14714. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14715. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14716. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14717. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14718. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14719. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14720. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14721. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14722. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14723. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14724. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14725. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14726. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14727. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14728. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14729. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14730. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14731. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14732. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14733. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14734. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14735. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14736. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14737. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14738. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14739. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14740. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14741. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14742. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14743. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14744. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14745. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14746. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14747. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14748. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14749. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14750. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14751. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14752. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14753. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14754. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14755. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14756. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14757. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14758. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14759. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14760. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14761. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14762. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14763. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14764. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14765. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14766. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14767. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14768. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14769. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14770. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14771. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14772. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14773. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14774. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14775. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14776. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14777. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14778. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14779. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14780. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14781. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14782. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14783. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14784. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14785. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14786. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14787. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14788. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14789. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14790. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14791. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14792. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14793. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14794. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14795. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14796. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14797. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14798. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14799. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14800. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14801. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14802. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14803. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14804. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14805. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14806. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14807. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14808. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14809. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14810. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14811. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14812. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14813. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14814. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14815. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14816. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14817. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14818. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14819. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14820. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14821. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14822. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14823. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14824. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14825. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14826. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14827. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14828. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14829. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14830. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14831. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14832. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14833. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14834. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14835. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14836. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14837. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14838. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14839. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14840. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14841. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14842. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14843. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14844. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14845. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14846. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14847. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14848. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14849. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14850. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14851. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14852. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14853. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14854. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14855. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14856. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14857. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14858. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14859. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14860. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14861. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14862. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14863. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14864. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14865. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14866. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14867. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14868. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14869. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14870. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14871. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14872. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14873. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14874. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14875. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14876. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14877. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14878. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14879. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14880. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14881. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14882. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14883. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14884. }
  14885. }
  14886. class ui_btn6 extends fgui.GButton {
  14887. static createInstance() {
  14888. return (fgui.UIPackage.createObject("loading", "btn6"));
  14889. }
  14890. onConstruct() {
  14891. this.n6 = (this.getChild("n6"));
  14892. this.n1 = (this.getChild("n1"));
  14893. }
  14894. }
  14895. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14896. class ui_xyItem extends fgui.GComponent {
  14897. static createInstance() {
  14898. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14899. }
  14900. onConstruct() {
  14901. this.xyItem = (this.getChild("xyItem"));
  14902. }
  14903. }
  14904. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14905. class ui_loadinfo extends fgui.GProgressBar {
  14906. static createInstance() {
  14907. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14908. }
  14909. onConstruct() {
  14910. this.bg = (this.getChild("bg"));
  14911. this.bar = (this.getChild("bar"));
  14912. this.title = (this.getChild("title"));
  14913. this.ani = (this.getChild("ani"));
  14914. }
  14915. }
  14916. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14917. class ui_xyNode extends fgui.GComponent {
  14918. static createInstance() {
  14919. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14920. }
  14921. onConstruct() {
  14922. this.n0 = (this.getChild("n0"));
  14923. this.btnYes = (this.getChild("btnYes"));
  14924. this.btnNo = (this.getChild("btnNo"));
  14925. this.btnKnown = (this.getChild("btnKnown"));
  14926. this.btnSure = (this.getChild("btnSure"));
  14927. this.txtWelcom = (this.getChild("txtWelcom"));
  14928. this.txtXy = (this.getChild("txtXy"));
  14929. this.n75 = (this.getChild("n75"));
  14930. this.btnXy1 = (this.getChild("btnXy1"));
  14931. this.btnXy3 = (this.getChild("btnXy3"));
  14932. this.btnXy2 = (this.getChild("btnXy2"));
  14933. this.n74 = (this.getChild("n74"));
  14934. this.xy1 = (this.getChild("xy1"));
  14935. this.txtTitle = (this.getChild("txtTitle"));
  14936. this.btnBack = (this.getChild("btnBack"));
  14937. this.xyList = (this.getChild("xyList"));
  14938. this.xy2 = (this.getChild("xy2"));
  14939. this.xyNode = (this.getChild("xyNode"));
  14940. }
  14941. }
  14942. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14943. class ui_ageNode extends fgui.GComponent {
  14944. static createInstance() {
  14945. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14946. }
  14947. onConstruct() {
  14948. this.n3 = (this.getChild("n3"));
  14949. this.n7 = (this.getChild("n7"));
  14950. this.n4 = (this.getChild("n4"));
  14951. this.btnAge = (this.getChild("btnAge"));
  14952. this.ageNode = (this.getChild("ageNode"));
  14953. }
  14954. }
  14955. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14956. class ui_rnNode extends fgui.GComponent {
  14957. static createInstance() {
  14958. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14959. }
  14960. onConstruct() {
  14961. this.n28 = (this.getChild("n28"));
  14962. this.n30 = (this.getChild("n30"));
  14963. this.n33 = (this.getChild("n33"));
  14964. this.rn1 = (this.getChild("rn1"));
  14965. this.n40 = (this.getChild("n40"));
  14966. this.n41 = (this.getChild("n41"));
  14967. this.rn3 = (this.getChild("rn3"));
  14968. this.n37 = (this.getChild("n37"));
  14969. this.n39 = (this.getChild("n39"));
  14970. this.rn2 = (this.getChild("rn2"));
  14971. this.n47 = (this.getChild("n47"));
  14972. this.n49 = (this.getChild("n49"));
  14973. this.n44 = (this.getChild("n44"));
  14974. this.inputCode = (this.getChild("inputCode"));
  14975. this.inputName = (this.getChild("inputName"));
  14976. this.n48 = (this.getChild("n48"));
  14977. this.n50 = (this.getChild("n50"));
  14978. this.rn4 = (this.getChild("rn4"));
  14979. this.btnCheck = (this.getChild("btnCheck"));
  14980. this.btnExit = (this.getChild("btnExit"));
  14981. this.btnDone = (this.getChild("btnDone"));
  14982. this.rnNode = (this.getChild("rnNode"));
  14983. }
  14984. }
  14985. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14986. class ui_tipNode extends fgui.GComponent {
  14987. static createInstance() {
  14988. return (fgui.UIPackage.createObject("loading", "tipNode"));
  14989. }
  14990. onConstruct() {
  14991. this.bg = (this.getChild("bg"));
  14992. this.n55 = (this.getChild("n55"));
  14993. this.n56 = (this.getChild("n56"));
  14994. this.tipNode = (this.getChild("tipNode"));
  14995. }
  14996. }
  14997. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  14998. class ui_fcmNode extends fgui.GComponent {
  14999. static createInstance() {
  15000. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15001. }
  15002. onConstruct() {
  15003. this.n63 = (this.getChild("n63"));
  15004. this.n62 = (this.getChild("n62"));
  15005. this.btnRn = (this.getChild("btnRn"));
  15006. this.n61 = (this.getChild("n61"));
  15007. this.n58 = (this.getChild("n58"));
  15008. this.fcmNode = (this.getChild("fcmNode"));
  15009. }
  15010. }
  15011. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15012. class ui_msgNode extends fgui.GComponent {
  15013. static createInstance() {
  15014. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15015. }
  15016. onConstruct() {
  15017. this.n69 = (this.getChild("n69"));
  15018. this.txtMsg = (this.getChild("txtMsg"));
  15019. this.msgNode = (this.getChild("msgNode"));
  15020. }
  15021. }
  15022. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15023. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15024. static createInstance() {
  15025. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15026. }
  15027. onConstruct() {
  15028. this.n1 = (this.getChild("n1"));
  15029. this.n13 = (this.getChild("n13"));
  15030. this.n14 = (this.getChild("n14"));
  15031. this.n15 = (this.getChild("n15"));
  15032. this.n3 = (this.getChild("n3"));
  15033. this.n4 = (this.getChild("n4"));
  15034. this.n5 = (this.getChild("n5"));
  15035. this.n6 = (this.getChild("n6"));
  15036. this.n7 = (this.getChild("n7"));
  15037. this.n8 = (this.getChild("n8"));
  15038. this.n9 = (this.getChild("n9"));
  15039. this.n10 = (this.getChild("n10"));
  15040. this.n12 = (this.getChild("n12"));
  15041. this.n11 = (this.getChild("n11"));
  15042. this.n16 = (this.getChild("n16"));
  15043. this.n17 = (this.getChild("n17"));
  15044. this.n18 = (this.getChild("n18"));
  15045. this.n20 = (this.getChild("n20"));
  15046. this.n21 = (this.getChild("n21"));
  15047. this.t0 = this.getTransition("t0");
  15048. }
  15049. }
  15050. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15051. class ui_btn5 extends fgui.GButton {
  15052. static createInstance() {
  15053. return (fgui.UIPackage.createObject("loading", "btn5"));
  15054. }
  15055. onConstruct() {
  15056. this.n9 = (this.getChild("n9"));
  15057. this.n1 = (this.getChild("n1"));
  15058. }
  15059. }
  15060. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15061. class ui_UILoading extends fgui.GComponent {
  15062. static createInstance() {
  15063. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15064. }
  15065. onConstruct() {
  15066. this.n12 = (this.getChild("n12"));
  15067. this.loadinfo = (this.getChild("loadinfo"));
  15068. this.n13 = (this.getChild("n13"));
  15069. this.txtLoad = (this.getChild("txtLoad"));
  15070. this.n18 = (this.getChild("n18"));
  15071. }
  15072. }
  15073. ui_UILoading.URL = "ui://37nctnhwphc33";
  15074. class ui_AgeItem extends fgui.GComponent {
  15075. static createInstance() {
  15076. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15077. }
  15078. onConstruct() {
  15079. this.txtAge = (this.getChild("txtAge"));
  15080. }
  15081. }
  15082. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15083. class ui_btn1 extends fgui.GButton {
  15084. static createInstance() {
  15085. return (fgui.UIPackage.createObject("loading", "btn1"));
  15086. }
  15087. onConstruct() {
  15088. this.n6 = (this.getChild("n6"));
  15089. this.n1 = (this.getChild("n1"));
  15090. }
  15091. }
  15092. ui_btn1.URL = "ui://37nctnhwxe622p";
  15093. class ui_btn3 extends fgui.GButton {
  15094. static createInstance() {
  15095. return (fgui.UIPackage.createObject("loading", "btn3"));
  15096. }
  15097. onConstruct() {
  15098. this.n9 = (this.getChild("n9"));
  15099. this.n1 = (this.getChild("n1"));
  15100. }
  15101. }
  15102. ui_btn3.URL = "ui://37nctnhwxe622s";
  15103. class ui_btn2 extends fgui.GButton {
  15104. static createInstance() {
  15105. return (fgui.UIPackage.createObject("loading", "btn2"));
  15106. }
  15107. onConstruct() {
  15108. this.n6 = (this.getChild("n6"));
  15109. this.n1 = (this.getChild("n1"));
  15110. }
  15111. }
  15112. ui_btn2.URL = "ui://37nctnhwxe622t";
  15113. class ui_btnBack extends fgui.GButton {
  15114. static createInstance() {
  15115. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15116. }
  15117. onConstruct() {
  15118. this.n6 = (this.getChild("n6"));
  15119. this.n7 = (this.getChild("n7"));
  15120. }
  15121. }
  15122. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15123. class ui_btnXy1 extends fgui.GButton {
  15124. static createInstance() {
  15125. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15126. }
  15127. onConstruct() {
  15128. this.n1 = (this.getChild("n1"));
  15129. }
  15130. }
  15131. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15132. class ui_btnXy2 extends fgui.GButton {
  15133. static createInstance() {
  15134. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15135. }
  15136. onConstruct() {
  15137. this.n1 = (this.getChild("n1"));
  15138. }
  15139. }
  15140. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15141. class ui_btnXy3 extends fgui.GButton {
  15142. static createInstance() {
  15143. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15144. }
  15145. onConstruct() {
  15146. this.n1 = (this.getChild("n1"));
  15147. }
  15148. }
  15149. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15150. class ui_btn4 extends fgui.GButton {
  15151. static createInstance() {
  15152. return (fgui.UIPackage.createObject("loading", "btn4"));
  15153. }
  15154. onConstruct() {
  15155. this.n9 = (this.getChild("n9"));
  15156. this.n1 = (this.getChild("n1"));
  15157. }
  15158. }
  15159. ui_btn4.URL = "ui://37nctnhwxe622z";
  15160. class loadingBinder {
  15161. static bindAll() {
  15162. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15163. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15164. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15165. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15166. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15167. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15168. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15169. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15170. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15171. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15172. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15173. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15174. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15175. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15176. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15177. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15178. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15179. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15180. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15181. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15182. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15183. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15184. }
  15185. }
  15186. class UIMgr {
  15187. constructor() {
  15188. this._stage = null;
  15189. this._uiList = [];
  15190. this._showList = [];
  15191. this._bindPkgList = [];
  15192. this.uiIndex = 0;
  15193. }
  15194. static get inst() {
  15195. if (UIMgr._inst == null) {
  15196. UIMgr._inst = new UIMgr();
  15197. }
  15198. return UIMgr._inst;
  15199. }
  15200. setStage(s) {
  15201. if (this._stage) {
  15202. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15203. return;
  15204. }
  15205. this._stage = s;
  15206. }
  15207. clearTempData() {
  15208. console.log('zh:clearTempData start');
  15209. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15210. console.log('zh:clearTempData end');
  15211. }
  15212. init() {
  15213. this.setStage(Laya.stage);
  15214. fairygui.UIConfig.defaultFont = "微软雅黑";
  15215. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15216. fairygui.UIConfig.packageFileExtension = "obj";
  15217. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15218. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15219. fairygui.GRoot.inst.width = Laya.stage.width;
  15220. fairygui.GRoot.inst.height = Laya.stage.height;
  15221. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15222. }
  15223. addAllUpdate() {
  15224. this.uiIndex = 0;
  15225. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15226. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15227. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15228. }
  15229. }
  15230. }
  15231. bindFUI(pkgname) {
  15232. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15233. return;
  15234. }
  15235. switch (pkgname) {
  15236. case fguiRes.loading:
  15237. fairygui.UIPackage.addPackage(pkgname);
  15238. loadingBinder.bindAll();
  15239. this._bindPkgList.push(pkgname);
  15240. break;
  15241. case fguiRes.game:
  15242. fairygui.UIPackage.addPackage(pkgname);
  15243. gameBinder.bindAll();
  15244. this._bindPkgList.push(pkgname);
  15245. break;
  15246. default:
  15247. break;
  15248. }
  15249. }
  15250. Show(cls, ...param) {
  15251. let nameStr = cls.uiName;
  15252. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15253. let temp = this._uiList[i];
  15254. let str = temp.className;
  15255. if (str == nameStr) {
  15256. if (temp.isMuti) {
  15257. if (temp.isHide) {
  15258. temp.show(...param);
  15259. this._uiList.splice(i, 1);
  15260. this._uiList.push(temp);
  15261. return temp;
  15262. }
  15263. }
  15264. else {
  15265. temp.show(...param);
  15266. this._uiList.splice(i, 1);
  15267. this._uiList.push(temp);
  15268. return temp;
  15269. }
  15270. }
  15271. }
  15272. let ui = new cls();
  15273. ui.className = nameStr;
  15274. this._showUI(ui, param);
  15275. return ui;
  15276. }
  15277. destroyUI(ui) {
  15278. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15279. let temp = this._uiList[i].className;
  15280. if (temp == ui.className) {
  15281. this._uiList.splice(i, 1);
  15282. break;
  15283. }
  15284. }
  15285. this.checkUIState();
  15286. }
  15287. _showUI(ui, param) {
  15288. this._uiList.push(ui);
  15289. ui.show(...param);
  15290. }
  15291. Hide(uiClass) {
  15292. let ui = this.getUI(uiClass);
  15293. if (ui && !ui.isHide) {
  15294. ui.hide();
  15295. }
  15296. }
  15297. getUI(ui) {
  15298. let nameStr = ui.uiName;
  15299. for (let index = 0; index < this._uiList.length; index++) {
  15300. let temp = this._uiList[index];
  15301. if (temp.className == nameStr) {
  15302. return temp;
  15303. }
  15304. }
  15305. return null;
  15306. }
  15307. isShow(cls) {
  15308. for (var i of this._uiList) {
  15309. if (i instanceof cls) {
  15310. return i.isShowing;
  15311. }
  15312. }
  15313. return false;
  15314. }
  15315. showUINum() {
  15316. let num = 0;
  15317. for (var i of this._uiList) {
  15318. if (i.isShowing) {
  15319. num++;
  15320. }
  15321. }
  15322. return num;
  15323. }
  15324. checkUIState() {
  15325. Laya.timer.clear(this, this._uiCheck);
  15326. Laya.timer.once(400, this, this._uiCheck);
  15327. }
  15328. _uiCheck() {
  15329. let showList = [];
  15330. for (var i of this._uiList) {
  15331. if (!i.isHide) {
  15332. showList.push(i);
  15333. }
  15334. }
  15335. for (let index = 0; index < showList.length; index++) {
  15336. if (index == showList.length - 1) {
  15337. showList[index].checkActive(true);
  15338. }
  15339. else {
  15340. showList[index].checkActive(false);
  15341. }
  15342. }
  15343. }
  15344. showTip(msg, time = 600, size = 30) {
  15345. }
  15346. }
  15347. class UIShowList {
  15348. }
  15349. class SoundMgr {
  15350. constructor() {
  15351. this.soundMax = 4;
  15352. this.isLoad = false;
  15353. this.soundMap = {};
  15354. this.isSound = true;
  15355. this.openShake = true;
  15356. SoundMgr._instance = this;
  15357. }
  15358. static getInstance() {
  15359. if (!this._instance) {
  15360. this._instance = new SoundMgr();
  15361. }
  15362. return this._instance;
  15363. }
  15364. init() {
  15365. console.log('zh:sm init 1');
  15366. Laya.SoundManager.autoReleaseSound = true;
  15367. Laya.SoundManager.autoStopMusic = true;
  15368. Laya.SoundManager.musicVolume = 0.3;
  15369. Laya.SoundManager.soundVolume = 0.5;
  15370. this.musicPlayed = false;
  15371. this.audioUrl = "asset/sound/ogg/";
  15372. console.log('zh:sm init 2');
  15373. console.log('zh:dev type ');
  15374. if (Laya.Browser.onAndroid) {
  15375. console.log('zh:dev type android');
  15376. this.audioUrl = "asset/sound/ogg/";
  15377. this.isLoad = true;
  15378. }
  15379. else {
  15380. console.log('zh:dev type not android');
  15381. this.audioUrl = "asset/sound/mp3/";
  15382. this.isLoad = true;
  15383. }
  15384. }
  15385. onSetting(isS) {
  15386. this.isSound = isS;
  15387. this.mute(!this.isSound);
  15388. }
  15389. clearCount() {
  15390. for (var key in this.soundMap) {
  15391. delete this.soundMap[key];
  15392. }
  15393. }
  15394. playMusic(path, loop = 0) {
  15395. console.log('zh:playMusic 1 PATH=' + path);
  15396. this.musicPath = path;
  15397. if (!this.isLoad)
  15398. console.log('zh:playMusic 2');
  15399. return;
  15400. if (!path || path == "")
  15401. console.log('zh:playMusic 3');
  15402. return;
  15403. if (!this.isSound)
  15404. console.log('zh:playMusic 4');
  15405. return;
  15406. this.musicPlayed = true;
  15407. console.log('zh:playMusic 5');
  15408. let url = this.getUrl(path);
  15409. console.log('zh:playMusic 6' + url);
  15410. if (Laya.Browser.onPC) {
  15411. console.log('zh:playMusic 7');
  15412. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15413. console.log('zh:playMusic 8');
  15414. this.play(url, loop);
  15415. }));
  15416. }
  15417. else
  15418. this.play(url, loop);
  15419. }
  15420. play(url, loop) {
  15421. Laya.SoundManager.playMusic(url, loop);
  15422. }
  15423. getUrl(path) {
  15424. let url = this.audioUrl + path;
  15425. if (Laya.Browser.onAndroid) {
  15426. url += ".ogg";
  15427. }
  15428. else {
  15429. url += ".mp3";
  15430. }
  15431. return url;
  15432. }
  15433. pauseMusic(pause) {
  15434. if (pause) {
  15435. this.mute(true);
  15436. }
  15437. else if (this.isSound)
  15438. this.mute(false);
  15439. }
  15440. stopMusic() {
  15441. Laya.SoundManager.stopMusic();
  15442. if (Moyu.isNeedPlatAudio) {
  15443. Moyu.stopMusic();
  15444. }
  15445. }
  15446. mute(mute) {
  15447. if (Moyu.isNeedPlatAudio) {
  15448. Moyu.pauseMusic(mute);
  15449. }
  15450. else {
  15451. Laya.SoundManager.musicMuted = mute;
  15452. if (!mute && !this.musicPlayed && this.musicPath) {
  15453. this.playMusic(this.musicPath);
  15454. }
  15455. }
  15456. }
  15457. stopSound(path) {
  15458. let url = this.getUrl(path);
  15459. Laya.SoundManager.stopSound(url);
  15460. }
  15461. playSound(path, loop = 1, soundMax = this.soundMax) {
  15462. if (!this.isLoad)
  15463. return;
  15464. if (!this.isSound)
  15465. return;
  15466. if (!path || path == "")
  15467. return;
  15468. let url = this.getUrl(path);
  15469. if (Moyu.isNeedPlatAudio) {
  15470. Moyu.playSound(path, loop == 0);
  15471. }
  15472. else {
  15473. let count = 1;
  15474. if (this.soundMap[path])
  15475. count = this.soundMap[path] + 1;
  15476. if (count > soundMax)
  15477. return;
  15478. this.soundMap[path] = count;
  15479. Laya.SoundManager.playSound(url, loop);
  15480. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15481. }
  15482. }
  15483. removePath(path) {
  15484. if (this.soundMap[path]) {
  15485. let count = this.soundMap[path];
  15486. count--;
  15487. if (count < 1)
  15488. delete this.soundMap[path];
  15489. else
  15490. this.soundMap[path] = count;
  15491. }
  15492. }
  15493. playBtnSound() {
  15494. this.playSound("btn");
  15495. }
  15496. playGetSound() {
  15497. }
  15498. playCloseUISound() {
  15499. }
  15500. }
  15501. SoundMgr._instance = null;
  15502. var Handler$1 = Laya.Handler;
  15503. var EResType;
  15504. (function (EResType) {
  15505. EResType[EResType["none"] = 0] = "none";
  15506. EResType[EResType["nromal"] = 1] = "nromal";
  15507. EResType[EResType["td"] = 2] = "td";
  15508. EResType[EResType["sk"] = 3] = "sk";
  15509. })(EResType || (EResType = {}));
  15510. class CResLoader {
  15511. constructor(doneCall, proCall) {
  15512. this.completrCall = doneCall;
  15513. this.progressCall = proCall;
  15514. this.progressHander = new Handler$1(this, this.onProgress);
  15515. this.tdResMap = {};
  15516. }
  15517. load(resList) {
  15518. this.resCount = 0;
  15519. this.loadCount = 0;
  15520. for (let i = 0; i < resList.length; i++) {
  15521. let path = resList[i];
  15522. if (!path)
  15523. continue;
  15524. this.resCount++;
  15525. let type = this.getResType(path);
  15526. if (type == EResType.nromal)
  15527. this.loadNromal(path);
  15528. else if (type == EResType.td)
  15529. this.loadTd(path);
  15530. }
  15531. }
  15532. getRes(path) {
  15533. let type = this.getResType(path);
  15534. if (type == EResType.nromal)
  15535. return Laya.loader.getRes(path);
  15536. else if (type == EResType.td) {
  15537. let res = this.tdResMap[path];
  15538. if (res)
  15539. return res.clone();
  15540. return null;
  15541. }
  15542. }
  15543. destroy() {
  15544. this.progressHander.clear();
  15545. this.progressHander = null;
  15546. }
  15547. clearRes(path) {
  15548. let type = this.getResType(path);
  15549. if (type == EResType.nromal)
  15550. Laya.loader.clearRes(path);
  15551. else if (type == EResType.td) {
  15552. let obj = this.tdResMap[path];
  15553. if (obj)
  15554. obj.destroy();
  15555. delete this.tdResMap[path];
  15556. }
  15557. }
  15558. getResType(path) {
  15559. let exs = this.getExtension(path);
  15560. if (exs == "sk")
  15561. return EResType.sk;
  15562. if (exs == "ls" || exs == "lh" || exs == "lm")
  15563. return EResType.td;
  15564. else
  15565. return EResType.nromal;
  15566. }
  15567. getExtension(res) {
  15568. var index = res.lastIndexOf(".");
  15569. return res.substr(index + 1);
  15570. }
  15571. loadNromal(path) {
  15572. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15573. if (res) {
  15574. this.onLoad();
  15575. }
  15576. else
  15577. console.log("load res fail:" + path);
  15578. }), this.progressHander);
  15579. }
  15580. loadSk() {
  15581. }
  15582. loadTd(path) {
  15583. if (this.tdResMap[path]) {
  15584. this.onLoad();
  15585. return;
  15586. }
  15587. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15588. if (res) {
  15589. this.tdResMap[path] = res;
  15590. this.onLoad();
  15591. }
  15592. else
  15593. console.log("load res fail:" + path);
  15594. }));
  15595. }
  15596. onLoad() {
  15597. this.loadCount++;
  15598. this.onProgress(1);
  15599. if (this.loadCount >= this.resCount) {
  15600. this.completrCall.run();
  15601. }
  15602. }
  15603. onProgress(pro) {
  15604. let progress = (this.loadCount + pro) / this.resCount;
  15605. this.progressCall.runWith(progress);
  15606. }
  15607. }
  15608. var Handler$2 = Laya.Handler;
  15609. class ResInfo {
  15610. constructor() {
  15611. this.index = 0;
  15612. }
  15613. }
  15614. class ResMgr {
  15615. constructor() {
  15616. this.resList = [];
  15617. this.doneList = [];
  15618. this.resMap = {};
  15619. this.currentLoad = null;
  15620. this.completeHandler = new Handler$2(this, this.onComplete);
  15621. this.progressHandler = new Handler$2(this, this.onProgress);
  15622. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15623. }
  15624. static getInstance() {
  15625. if (ResMgr._instance == null) {
  15626. ResMgr._instance = new ResMgr();
  15627. }
  15628. return ResMgr._instance;
  15629. }
  15630. loadList(list, completeHandler, progressHandler) {
  15631. if (list.length < 1) {
  15632. completeHandler.run();
  15633. return;
  15634. }
  15635. let info = this.getResInfo();
  15636. info.resList = list;
  15637. info.completeHandler = completeHandler;
  15638. info.progressHandler = progressHandler;
  15639. this.resList.push(info);
  15640. this.startLoad();
  15641. }
  15642. loadFguiRes(list, completeHandler, progressHandler) {
  15643. Laya.loader.load(list, completeHandler, progressHandler);
  15644. }
  15645. loadAny(list, completeHandler, progressHandler) {
  15646. Laya.loader.load(list, completeHandler, progressHandler);
  15647. }
  15648. load(path, completeHandler, progressHandler) {
  15649. let count = this.resMap[path];
  15650. if (count && count > 0) {
  15651. if (completeHandler)
  15652. completeHandler.run();
  15653. }
  15654. else
  15655. this.loadList([path], completeHandler, progressHandler);
  15656. }
  15657. getRes(path) {
  15658. let res = this.resMap[path];
  15659. if (!res)
  15660. this.showLog("资源不存在:" + path);
  15661. else
  15662. return this.loader.getRes(path);
  15663. }
  15664. clearList(list, force = false) {
  15665. if (!list || list.length < 1)
  15666. return;
  15667. let cr = () => {
  15668. for (const k in list) {
  15669. let v = list[k];
  15670. if (!v)
  15671. continue;
  15672. if (force) {
  15673. this.loader.clearRes(v);
  15674. delete this.resMap[v];
  15675. }
  15676. else {
  15677. let count = this.resMap[v];
  15678. if (count && count > 1) {
  15679. count--;
  15680. this.resMap[v] = count;
  15681. }
  15682. else {
  15683. this.loader.clearRes(v);
  15684. delete this.resMap[v];
  15685. }
  15686. }
  15687. }
  15688. if (!window.hasOwnProperty("ks"))
  15689. Laya.Resource.destroyUnusedResources();
  15690. };
  15691. Laya.timer.clearAll(this);
  15692. Laya.timer.once(2000, this, cr);
  15693. }
  15694. clear3D() {
  15695. for (const k in this.loader.tdResMap) {
  15696. this.loader.clearRes(k);
  15697. if (this.resMap[k])
  15698. delete this.resMap[k];
  15699. }
  15700. if (!window.hasOwnProperty("ks"))
  15701. Laya.Resource.destroyUnusedResources();
  15702. }
  15703. clear(path, force = false) {
  15704. this.clearList([path], force);
  15705. }
  15706. getResInfo() {
  15707. if (this.doneList.length > 0)
  15708. return this.doneList.pop();
  15709. else
  15710. return new ResInfo();
  15711. }
  15712. startLoad() {
  15713. if (this.currentLoad)
  15714. return;
  15715. this.currentLoad = this.resList.pop();
  15716. if (this.currentLoad) {
  15717. this.loader.load(this.currentLoad.resList);
  15718. }
  15719. }
  15720. onComplete() {
  15721. if (!this.currentLoad)
  15722. return;
  15723. for (const k in this.currentLoad.resList) {
  15724. let v = this.currentLoad.resList[k];
  15725. let count = this.resMap[v];
  15726. if (count)
  15727. count++;
  15728. else
  15729. count = 1;
  15730. this.resMap[v] = count;
  15731. }
  15732. if (this.currentLoad.completeHandler)
  15733. this.currentLoad.completeHandler.run();
  15734. this.doneList.push(this.currentLoad);
  15735. this.currentLoad = null;
  15736. this.startLoad();
  15737. }
  15738. onProgress(pro) {
  15739. if (!this.currentLoad)
  15740. return;
  15741. if (this.currentLoad.progressHandler)
  15742. this.currentLoad.progressHandler.runWith(pro);
  15743. }
  15744. showLog(str, ...args) {
  15745. console.log("[ResLoader] " + str);
  15746. }
  15747. }
  15748. ResMgr._instance = null;
  15749. class EventMgr extends Laya.EventDispatcher {
  15750. }
  15751. let eventMgr = new EventMgr();
  15752. class ConfigMgr {
  15753. static getInstance() {
  15754. if (!this._instance) {
  15755. this._instance = new ConfigMgr();
  15756. }
  15757. return this._instance;
  15758. }
  15759. init() {
  15760. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15761. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15762. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15763. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15764. }
  15765. getUserInfoByIndex(index) {
  15766. return this.npcJson[index];
  15767. }
  15768. getRandomUserInfo() {
  15769. let index = xGame.tools.random(0, this.npcJson.length);
  15770. return this.npcJson[index];
  15771. }
  15772. getMaxBigMoveLength() {
  15773. return Object.keys(this.levelCfg).length;
  15774. }
  15775. getBigMoveLevelByIndex(index) {
  15776. let cfg = this.levelCfg;
  15777. cfg = cfg[index];
  15778. return cfg;
  15779. }
  15780. getRandomClassicLevel() {
  15781. let cfg = this.classicCfg;
  15782. let num = Object.keys(cfg).length;
  15783. let rand = xGame.common.randomNum(1, num);
  15784. return cfg[rand];
  15785. }
  15786. getPlaceBallByLevel(level) {
  15787. return this.placeBallCfg[level];
  15788. }
  15789. getMaxPlaceBall() {
  15790. return Object.keys(this.placeBallCfg).length;
  15791. }
  15792. }
  15793. class PoolD3Mgr {
  15794. constructor() {
  15795. this.pool = {};
  15796. }
  15797. static get ins() {
  15798. return this._ins || (this._ins = new PoolD3Mgr);
  15799. }
  15800. createList(key, prefab, parent) {
  15801. if (!this.pool[key]) {
  15802. this.pool[key] = {};
  15803. this.pool[key].prefab = prefab;
  15804. this.pool[key].list = [];
  15805. this.pool[key].parent = parent;
  15806. }
  15807. }
  15808. getItem(key) {
  15809. if (!this.pool[key]) {
  15810. return;
  15811. }
  15812. let temp;
  15813. if (this.pool[key].list.length > 0) {
  15814. temp = this.pool[key].list.pop();
  15815. }
  15816. else {
  15817. temp = this.pool[key].prefab.clone();
  15818. if (this.pool[key].parent) {
  15819. this.pool[key].parent.addChild(temp);
  15820. }
  15821. }
  15822. temp.active = true;
  15823. return temp;
  15824. }
  15825. putItem(key, obj) {
  15826. if (!this.pool[key]) {
  15827. return;
  15828. }
  15829. obj.active = false;
  15830. this.pool[key].list.push(obj);
  15831. }
  15832. }
  15833. let context$1 = context;
  15834. let uiMgr = UIMgr.inst;
  15835. let soundMgr = SoundMgr.getInstance();
  15836. let resMgr = ResMgr.getInstance();
  15837. let httpMgr = HttpMgr.getInstance();
  15838. let common = Common.getInstance();
  15839. let cfgMgr = ConfigMgr.getInstance();
  15840. let poolD3Mgr = PoolD3Mgr.ins;
  15841. let d3TexUrl = "res/d3Res/";
  15842. let d3ModeUrl = "res/unityRes/";
  15843. function setStageSize(view) {
  15844. if (view.width) {
  15845. view.width = Laya.stage.width;
  15846. view.height = Laya.stage.height;
  15847. }
  15848. }
  15849. function filledBg(view) {
  15850. let wh = Laya.stage.height / Laya.stage.width;
  15851. if (wh > 16 / 9) {
  15852. view.height = Laya.stage.height;
  15853. view.width = Laya.stage.height / 1334 * 750;
  15854. }
  15855. else {
  15856. view.width = Laya.stage.width;
  15857. view.height = Laya.stage.width / 750 * 1334;
  15858. }
  15859. }
  15860. function setNotch(view) {
  15861. if (view.height) {
  15862. view.y += context$1.notchHeight;
  15863. }
  15864. }
  15865. function showTip(str) {
  15866. uiMgr.Show(UIMsg, str);
  15867. }
  15868. function log(...args) {
  15869. console.log(args);
  15870. }
  15871. let xGame = {
  15872. context: context$1,
  15873. eventMgr,
  15874. resMgr,
  15875. uiMgr,
  15876. soundMgr,
  15877. define,
  15878. tools,
  15879. httpMgr,
  15880. d3TexUrl,
  15881. d3ModeUrl,
  15882. common,
  15883. cfgMgr,
  15884. poolD3Mgr,
  15885. setStageSize,
  15886. filledBg,
  15887. setNotch,
  15888. showTip,
  15889. log,
  15890. };
  15891. window["xGame"] = xGame;
  15892. let dataName = 'tBall_';
  15893. class UserData {
  15894. constructor() {
  15895. this.userId = "";
  15896. this.isAgree = false;
  15897. this.coinNum = 0;
  15898. this.gemNum = 0;
  15899. this.sound = true;
  15900. this.vibration = true;
  15901. this.currentDate = 0;
  15902. this.createTime = 0;
  15903. this.awardTime = 0;
  15904. this.roleId = 1;
  15905. this.roleList = [];
  15906. this.roleAds = [];
  15907. this.dressId = 101;
  15908. this.itemId = 201;
  15909. this.bigSkills = [1, 1, 1, 1, 1];
  15910. this.coin = 4000;
  15911. this.diamond = 0;
  15912. this.skillSuccessTimes = 0;
  15913. this.skillGuide = 0;
  15914. this.skillAccTimes = 0;
  15915. this.placeBallData = [];
  15916. this.shareDiamondTimes = 0;
  15917. this.dailyVideoShareTimes = 0;
  15918. this.secretary = [1, 0];
  15919. this.curSecretary = 0;
  15920. this.ballRod = [1, 0, 0, 0, 0, 1];
  15921. this.curBallRod = 5;
  15922. this.signData = 0;
  15923. this.signTime = 0;
  15924. this.drawTimes = 0;
  15925. this.drawAwardTimes = 0;
  15926. this.dailyfreeDrawTimes = 1;
  15927. this.power = 5;
  15928. this.powerTime = 0;
  15929. this.challengeTimes = 0;
  15930. this.extraSign = 0;
  15931. this.classicTimes = 0;
  15932. this.guideHelpLine = 0;
  15933. this.newUser = true;
  15934. this.rootBallFoul = 0;
  15935. this.timeoutFoul = 0;
  15936. this.roleList = [1];
  15937. }
  15938. saveData() {
  15939. let data = {};
  15940. for (let k in this) {
  15941. data[k.toString()] = this[k];
  15942. }
  15943. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15944. }
  15945. getData() {
  15946. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15947. if (ld) {
  15948. let localData = JSON.parse(ld);
  15949. if (localData) {
  15950. for (let k in this) {
  15951. let key = k.toString();
  15952. let data = localData[key];
  15953. if (data != undefined) {
  15954. this[k] = data;
  15955. }
  15956. }
  15957. }
  15958. }
  15959. }
  15960. }
  15961. class ItemData {
  15962. constructor() {
  15963. this.itemList = {};
  15964. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15965. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15966. }
  15967. saveData() {
  15968. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15969. }
  15970. getData() {
  15971. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15972. if (ld) {
  15973. let localData = JSON.parse(ld);
  15974. if (localData) {
  15975. this.itemList = localData;
  15976. }
  15977. }
  15978. }
  15979. }
  15980. class GameData {
  15981. constructor() {
  15982. this.curLevel = 0;
  15983. this.gameType = 1;
  15984. this.signIdx = 0;
  15985. this.signMax = 0;
  15986. this.rotaryTime = 0;
  15987. this.rotaryCount = 0;
  15988. this.rotaryList = [];
  15989. this.diyCount = 3;
  15990. this.awardIdx = 0;
  15991. this.shareNum = 2;
  15992. this.rankWeek = 0;
  15993. this.rankScore = 0;
  15994. this.gameCount = 0;
  15995. this.trySkill = -1;
  15996. this.tryTime = 0;
  15997. }
  15998. saveData() {
  15999. let data = {};
  16000. for (let k in this) {
  16001. data[k.toString()] = this[k];
  16002. }
  16003. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16004. }
  16005. getData() {
  16006. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16007. if (ld) {
  16008. let localData = JSON.parse(ld);
  16009. if (localData) {
  16010. for (let k in this) {
  16011. let key = k.toString();
  16012. let data = localData[key];
  16013. if (data != undefined) {
  16014. this[k] = data;
  16015. }
  16016. }
  16017. }
  16018. }
  16019. }
  16020. }
  16021. class DataMgr {
  16022. static Init() {
  16023. this.userData = new UserData();
  16024. this.gameData = new GameData();
  16025. this.itemData = new ItemData();
  16026. this.userData.getData();
  16027. this.gameData.getData();
  16028. this.itemData.getData();
  16029. this.roleId = this.userData.roleId;
  16030. this.resetUse();
  16031. }
  16032. static isNewDay() {
  16033. Moyu.isNewDay(this, (isnew) => {
  16034. xGame.common.isNewDay = isnew;
  16035. if (!isnew)
  16036. return;
  16037. DataMgr.setShareDiamondTimes(0, false);
  16038. DataMgr.setDailyVideoShareTimes(0, false);
  16039. DataMgr.setDailyfreeDrawTimes(1);
  16040. DataMgr.setExtraSign(0);
  16041. });
  16042. }
  16043. static deletData() {
  16044. Laya.LocalStorage.clear();
  16045. }
  16046. static upRankData() {
  16047. let num = xGame.common.getAllStarNum();
  16048. if (num > 0)
  16049. Moyu.upRankData(xGame.common.curRankID, num);
  16050. }
  16051. static addItem(id, count = 1) {
  16052. let v = this.itemData.itemList[id];
  16053. if (!v)
  16054. v = { id: id, count: count, adnum: 0, active: true };
  16055. else {
  16056. if (v.active) {
  16057. v.count += count;
  16058. }
  16059. else {
  16060. v.count = count;
  16061. v.active = true;
  16062. }
  16063. }
  16064. this.itemData.itemList[id] = v;
  16065. xGame.soundMgr.playGetSound();
  16066. this.saveItemData();
  16067. }
  16068. static hasItem(id) {
  16069. let v = this.itemData.itemList[id];
  16070. if (v && v.active)
  16071. return true;
  16072. return false;
  16073. }
  16074. static getItem(id) {
  16075. let v = this.itemData.itemList[id];
  16076. return v;
  16077. }
  16078. static getItemCount(id) {
  16079. let v = this.itemData.itemList[id];
  16080. if (v && v.active)
  16081. return v.count;
  16082. return 0;
  16083. }
  16084. static getItemAd(id) {
  16085. let v = this.itemData.itemList[id];
  16086. if (v) {
  16087. return v.adnum;
  16088. }
  16089. return 0;
  16090. }
  16091. static onItemAd(id, num = 1) {
  16092. let v = this.itemData.itemList[id];
  16093. if (!v)
  16094. v = { id: id, count: 1, adnum: num, active: false };
  16095. else
  16096. v.adnum += num;
  16097. this.itemData.itemList[id] = v;
  16098. this.saveItemData();
  16099. }
  16100. static costItem(id, count) {
  16101. let v = this.itemData.itemList[id];
  16102. if (v && v.active) {
  16103. if (v.count < count)
  16104. return false;
  16105. else {
  16106. v.count -= count;
  16107. this.itemData.itemList[id] = v;
  16108. return true;
  16109. }
  16110. }
  16111. return false;
  16112. }
  16113. static resetUse() {
  16114. this.dressId = this.userData.dressId;
  16115. this.itemId = this.userData.itemId;
  16116. }
  16117. static passLevel() {
  16118. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16119. this.gameData.curLevel++;
  16120. this.curLevel = this.gameData.curLevel;
  16121. this.saveGameData();
  16122. }
  16123. static useRole(id) {
  16124. this.roleId = id;
  16125. if (this.hasRole(id)) {
  16126. this.userData.roleId = id;
  16127. this.saveUserData();
  16128. }
  16129. }
  16130. static addRole(id) {
  16131. if (this.hasRole(id))
  16132. return;
  16133. this.userData.roleList.push(id);
  16134. this.saveUserData();
  16135. }
  16136. static hasRole(id) {
  16137. return this.userData.roleList.indexOf(id) >= 0;
  16138. }
  16139. static gemEnough(num) {
  16140. return this.userData.gemNum >= num;
  16141. }
  16142. static roleHasAd(id) {
  16143. let count = this.userData.roleAds[id];
  16144. if (count != undefined && count >= 0)
  16145. return true;
  16146. else
  16147. return false;
  16148. }
  16149. static saveUserData(time = 1000, event, arg) {
  16150. if (this.userSaving)
  16151. return;
  16152. this.userSaving = true;
  16153. Laya.timer.once(time, this, () => {
  16154. this.userSaving = false;
  16155. this.userData.saveData();
  16156. if (event)
  16157. xGame.eventMgr.event(event, arg);
  16158. });
  16159. }
  16160. static saveGameData() {
  16161. if (this.gameSaving)
  16162. return;
  16163. this.gameSaving = true;
  16164. Laya.timer.once(1000, this, () => {
  16165. this.gameSaving = false;
  16166. this.gameData.saveData();
  16167. });
  16168. }
  16169. static saveItemData() {
  16170. let fun = () => {
  16171. this.itemData.saveData();
  16172. };
  16173. Laya.timer.clear(this, fun);
  16174. Laya.timer.once(500, this, fun);
  16175. }
  16176. static saveData() {
  16177. this.saveUserData();
  16178. this.saveGameData();
  16179. }
  16180. static getBigSkillList() {
  16181. return this.userData.bigSkills;
  16182. }
  16183. static getBigSkillByIndex(index) {
  16184. return this.userData.bigSkills[index];
  16185. }
  16186. static setBigSkill(index, val, addUp = true) {
  16187. if (addUp) {
  16188. this.userData.bigSkills[index] += val;
  16189. }
  16190. else {
  16191. this.userData.bigSkills[index] = val;
  16192. }
  16193. this.saveUserData();
  16194. }
  16195. static coinEnough(need) {
  16196. if (typeof need != "number") {
  16197. console.error("金币格式错误");
  16198. return;
  16199. }
  16200. return this.userData.coin >= need;
  16201. }
  16202. static setCoin(val) {
  16203. if (typeof val != "number") {
  16204. return;
  16205. }
  16206. this.userData.coin += val;
  16207. this.saveUserData();
  16208. xGame.eventMgr.event(COIN_CHANGE);
  16209. }
  16210. static getCoin() {
  16211. return this.userData.coin;
  16212. }
  16213. static diamondEnough(need) {
  16214. if (typeof need != "number") {
  16215. console.error("金币格式错误");
  16216. return;
  16217. }
  16218. return this.userData.diamond >= need;
  16219. }
  16220. static setDiamond(val) {
  16221. if (typeof val != "number") {
  16222. return;
  16223. }
  16224. this.userData.diamond += val;
  16225. this.saveUserData();
  16226. xGame.eventMgr.event(DIAMOND_CHANGE);
  16227. }
  16228. static getDiamond() {
  16229. return this.userData.diamond;
  16230. }
  16231. static getSkillSuccessTimes() {
  16232. return this.userData.skillSuccessTimes;
  16233. }
  16234. static setSkillSuccessTimes(val, addUp = true) {
  16235. if (addUp)
  16236. this.userData.skillSuccessTimes += val;
  16237. else
  16238. this.userData.skillSuccessTimes = val;
  16239. this.saveUserData();
  16240. }
  16241. static getSkillAccTimes() {
  16242. return this.userData.skillAccTimes;
  16243. }
  16244. static setSkillAccTimes(val) {
  16245. this.userData.skillAccTimes += val;
  16246. this.saveUserData();
  16247. }
  16248. static getSkillGuide() {
  16249. if (!xGame.common.openGuide) {
  16250. return 1;
  16251. }
  16252. return this.userData.skillGuide;
  16253. }
  16254. static setSkillGuide(val) {
  16255. this.userData.skillGuide = val;
  16256. this.saveUserData();
  16257. }
  16258. static getPlaceBallLevelList() {
  16259. return this.userData.placeBallData;
  16260. }
  16261. static getPlaceBallLevel(level) {
  16262. let arr = this.userData.placeBallData;
  16263. let index = level - 1;
  16264. let out;
  16265. if (arr[index]) {
  16266. out = arr[index];
  16267. }
  16268. else {
  16269. let max = arr.length;
  16270. if (max == index) {
  16271. out = {
  16272. star: 0,
  16273. play: true,
  16274. isCur: true,
  16275. getAward: false
  16276. };
  16277. }
  16278. else {
  16279. out = {
  16280. star: 0,
  16281. play: false,
  16282. getAward: false
  16283. };
  16284. }
  16285. }
  16286. return out;
  16287. }
  16288. static setPlaceBallLevel(level, star) {
  16289. let arr = this.userData.placeBallData;
  16290. let index = level - 1;
  16291. if (arr[index]) {
  16292. arr[index].star = Math.max(arr[index].star, star);
  16293. }
  16294. else {
  16295. let max = arr.length;
  16296. if (max == index) {
  16297. arr.push({
  16298. star: star,
  16299. play: true,
  16300. getAward: false
  16301. });
  16302. }
  16303. else {
  16304. console.error("关卡存储出错");
  16305. }
  16306. }
  16307. this.saveUserData();
  16308. }
  16309. static setPlaceBallAward(level) {
  16310. let arr = this.userData.placeBallData;
  16311. let index = level - 1;
  16312. if (arr[index]) {
  16313. arr[index].getAward = true;
  16314. }
  16315. this.saveUserData();
  16316. }
  16317. static getShareDiamondTimes() {
  16318. return this.userData.shareDiamondTimes;
  16319. }
  16320. static setShareDiamondTimes(val, addUp = true) {
  16321. if (addUp) {
  16322. this.userData.shareDiamondTimes += val;
  16323. }
  16324. else {
  16325. this.userData.shareDiamondTimes = val;
  16326. }
  16327. this.saveUserData();
  16328. }
  16329. static getDailyVideoShareTimes() {
  16330. return this.userData.dailyVideoShareTimes;
  16331. }
  16332. static setDailyVideoShareTimes(val, addUp = true) {
  16333. if (addUp) {
  16334. this.userData.dailyVideoShareTimes += val;
  16335. }
  16336. else {
  16337. this.userData.dailyVideoShareTimes = val;
  16338. }
  16339. this.saveUserData();
  16340. }
  16341. static getSecretary(index) {
  16342. return this.userData.secretary[index];
  16343. }
  16344. static setSecretary(index, val) {
  16345. this.userData.secretary[index] = val;
  16346. this.saveUserData();
  16347. }
  16348. static getCurSecretary() {
  16349. return this.userData.curSecretary;
  16350. }
  16351. static setCurSecretary(index) {
  16352. this.userData.curSecretary = index;
  16353. this.saveUserData();
  16354. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16355. }
  16356. static getBallRod(index) {
  16357. return this.userData.ballRod[index];
  16358. }
  16359. static setBallRod(index, val) {
  16360. this.userData.ballRod[index] = val;
  16361. this.saveUserData();
  16362. }
  16363. static getCurBallRod() {
  16364. return this.userData.curBallRod;
  16365. }
  16366. static setCurBallRod(index) {
  16367. this.userData.curBallRod = index;
  16368. this.saveUserData();
  16369. }
  16370. static setSignData(val) {
  16371. this.userData.signData = val;
  16372. this.saveUserData();
  16373. }
  16374. static getSignData() {
  16375. return this.userData.signData;
  16376. }
  16377. static setSignTime(val) {
  16378. this.userData.signTime = val;
  16379. this.saveUserData();
  16380. }
  16381. static getSignTime() {
  16382. return this.userData.signTime;
  16383. }
  16384. static getDrawTimes() {
  16385. return this.userData.drawTimes;
  16386. }
  16387. static setDrawTimes(val, addUp = true) {
  16388. if (addUp) {
  16389. this.userData.drawTimes += val;
  16390. }
  16391. else {
  16392. this.userData.drawTimes = val;
  16393. }
  16394. this.saveUserData();
  16395. }
  16396. static getDrawAwardTimes() {
  16397. return this.userData.drawAwardTimes;
  16398. }
  16399. static setDrawAwardTimes(val) {
  16400. this.userData.drawAwardTimes = val;
  16401. this.saveUserData();
  16402. }
  16403. static getDailyfreeDrawTimes() {
  16404. return this.userData.dailyfreeDrawTimes;
  16405. }
  16406. static setDailyfreeDrawTimes(val) {
  16407. this.userData.dailyfreeDrawTimes = val;
  16408. this.saveUserData();
  16409. }
  16410. static setPower(val, addUp = true) {
  16411. if (addUp)
  16412. this.userData.power += val;
  16413. else
  16414. this.userData.power = val;
  16415. if (this.userData.power >= xGame.common.maxPower) {
  16416. this.userData.power = xGame.common.maxPower;
  16417. }
  16418. xGame.eventMgr.event(POWER_CHANGE, val);
  16419. this.saveUserData();
  16420. }
  16421. static getPower() {
  16422. return this.userData.power;
  16423. }
  16424. static setPowerTime(val) {
  16425. this.userData.powerTime = val;
  16426. this.saveUserData();
  16427. }
  16428. static getPowerTime() {
  16429. return this.userData.powerTime;
  16430. }
  16431. static powerEnough() {
  16432. return this.getPower() > 0;
  16433. }
  16434. static getChallengeTimes() {
  16435. return this.userData.challengeTimes;
  16436. }
  16437. static setChallengeTimes(val) {
  16438. this.userData.challengeTimes += val;
  16439. this.saveUserData();
  16440. }
  16441. static getExtraSign() {
  16442. return this.userData.extraSign;
  16443. }
  16444. static setExtraSign(val) {
  16445. this.userData.extraSign = val;
  16446. this.saveUserData();
  16447. }
  16448. static getClassicTimes() {
  16449. return this.userData.classicTimes;
  16450. }
  16451. static setClassicTimes() {
  16452. this.userData.classicTimes += 1;
  16453. this.saveUserData();
  16454. }
  16455. static getGuideHelpLine() {
  16456. return this.userData.guideHelpLine;
  16457. }
  16458. static setGuideHelpLine() {
  16459. this.userData.guideHelpLine = 1;
  16460. this.saveUserData();
  16461. }
  16462. static getNewUser() {
  16463. return this.userData.newUser;
  16464. }
  16465. static setNewUser() {
  16466. this.userData.newUser = false;
  16467. this.saveUserData();
  16468. }
  16469. static getRootBallFoul() {
  16470. return this.userData.rootBallFoul;
  16471. }
  16472. static setRootBallFoul() {
  16473. this.userData.rootBallFoul = 1;
  16474. this.saveUserData();
  16475. }
  16476. static getTimeoutFoul() {
  16477. return this.userData.timeoutFoul;
  16478. }
  16479. static setTimeoutFoul() {
  16480. this.userData.timeoutFoul = 1;
  16481. this.saveUserData();
  16482. }
  16483. }
  16484. DataMgr.isNewUser = false;
  16485. DataMgr.fristEnter = true;
  16486. DataMgr.levelType = 0;
  16487. DataMgr.awardId = 0;
  16488. DataMgr.awardCoin = 0;
  16489. DataMgr.sceneId = -1;
  16490. DataMgr.tryId = 0;
  16491. DataMgr.curLevel = 1;
  16492. DataMgr.vipLevel = 0;
  16493. DataMgr.maxLevel = 0;
  16494. DataMgr.awardRatio = 1;
  16495. DataMgr.gameList = [];
  16496. DataMgr.rankList = [];
  16497. DataMgr.recoverTime = 480000;
  16498. DataMgr.minScore = 0;
  16499. DataMgr.rankDis = 0;
  16500. DataMgr.userSaving = false;
  16501. DataMgr.gameSaving = false;
  16502. class D3Tween extends Laya.Script3D {
  16503. constructor() {
  16504. super();
  16505. this.isInited = false;
  16506. }
  16507. ;
  16508. init() {
  16509. if (this.isInited)
  16510. return;
  16511. this.isInited = true;
  16512. this.gameObj = this.owner;
  16513. this.transform = this.gameObj.transform;
  16514. }
  16515. get rotX() {
  16516. return this.transform.localRotationEulerX;
  16517. }
  16518. set rotX(v) {
  16519. this.transform.localRotationEulerX = v;
  16520. }
  16521. get rotY() {
  16522. return this.transform.localRotationEulerY;
  16523. }
  16524. set rotY(v) {
  16525. this.transform.localRotationEulerY = v;
  16526. }
  16527. get rotZ() {
  16528. return this.transform.localRotationEulerZ;
  16529. }
  16530. set rotZ(v) {
  16531. this.transform.localRotationEulerZ = v;
  16532. }
  16533. get posX() {
  16534. return this.transform.localPositionX;
  16535. }
  16536. set posX(v) {
  16537. this.transform.localPositionX = v;
  16538. }
  16539. get posY() {
  16540. return this.transform.localPositionY;
  16541. }
  16542. set posY(v) {
  16543. this.transform.localPositionY = v;
  16544. }
  16545. get posZ() {
  16546. return this.transform.localPositionZ;
  16547. }
  16548. set posZ(v) {
  16549. this.transform.localPositionZ = v;
  16550. }
  16551. get rotation() {
  16552. return this.transform.localRotation;
  16553. }
  16554. set rotation(v) {
  16555. this.transform.localRotation = v;
  16556. }
  16557. }
  16558. class D2Hole extends Laya.Script {
  16559. constructor() { super(); }
  16560. onTriggerEnter(collider) {
  16561. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16562. return;
  16563. }
  16564. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16565. if (collider.owner["mySrc"].isRunSkillAni) {
  16566. return;
  16567. }
  16568. if (collider.owner["mySrc"].number != 0) {
  16569. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16570. }
  16571. xGame.common.ballColliHole(collider);
  16572. xGame.common.recoverCameraView();
  16573. }
  16574. }
  16575. }
  16576. class Table extends Laya.Script3D {
  16577. constructor() {
  16578. super();
  16579. this.isSetBorder = false;
  16580. this.inited = false;
  16581. }
  16582. ;
  16583. onAwake() {
  16584. this.init();
  16585. }
  16586. init() {
  16587. if (this.inited)
  16588. return;
  16589. this.inited = true;
  16590. this.gameObj = this.owner;
  16591. this.border = this.gameObj.getChildByName("border");
  16592. }
  16593. setBorderPos() {
  16594. if (this.isSetBorder)
  16595. return;
  16596. this.isSetBorder = true;
  16597. let ui = xGame.common.gameUI.ui;
  16598. let bar1 = this.border.getChildByName("bar1");
  16599. let bar2 = this.border.getChildByName("bar2");
  16600. let bar3 = this.border.getChildByName("bar3");
  16601. let bar4 = this.border.getChildByName("bar4");
  16602. let bar5 = this.border.getChildByName("bar5");
  16603. let bar6 = this.border.getChildByName("bar6");
  16604. this.setInfo(bar1, ui.border.bar1, "box");
  16605. this.setInfo(bar2, ui.border.bar2, "box");
  16606. this.setInfo(bar3, ui.border.bar3, "box");
  16607. this.setInfo(bar4, ui.border.bar4, "box");
  16608. this.setInfo(bar5, ui.border.bar5, "box");
  16609. this.setInfo(bar6, ui.border.bar6, "box");
  16610. let circle1 = this.border.getChildByName("circle1");
  16611. let circle2 = this.border.getChildByName("circle2");
  16612. let circle3 = this.border.getChildByName("circle3");
  16613. let circle4 = this.border.getChildByName("circle4");
  16614. let circle5 = this.border.getChildByName("circle5");
  16615. let circle6 = this.border.getChildByName("circle6");
  16616. this.setInfo(circle1, ui.border.circle1, "circle");
  16617. this.setInfo(circle2, ui.border.circle2, "circle");
  16618. this.setInfo(circle3, ui.border.circle3, "circle");
  16619. this.setInfo(circle4, ui.border.circle4, "circle");
  16620. this.setInfo(circle5, ui.border.circle5, "circle");
  16621. this.setInfo(circle6, ui.border.circle6, "circle");
  16622. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16623. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16624. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16625. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16626. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16627. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16628. let arr = xGame.common.gameMgr.holePosList;
  16629. xGame.common.gameMgr.posObj = {
  16630. "1": arr[0],
  16631. "3": arr[2],
  16632. "4": arr[3],
  16633. "6": arr[5]
  16634. };
  16635. }
  16636. initHolePos(x, y) {
  16637. if (x < 300)
  16638. x += 25;
  16639. else if (x > 1000)
  16640. x -= 25;
  16641. else if (y > 200)
  16642. y -= 10;
  16643. else
  16644. y += 10;
  16645. if (y < 200)
  16646. y += 30;
  16647. else if (y > 500)
  16648. y -= 30;
  16649. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16650. }
  16651. setInfo(d3Obj, d2Obj, type) {
  16652. let ui = xGame.common.gameUI.ui;
  16653. let sprite = new Laya.Sprite();
  16654. ui.border.displayObject.addChild(sprite);
  16655. let colli = xGame.common.getCollider(type);
  16656. sprite.addComponentIntance(colli);
  16657. let rigy = xGame.common.getRigbody();
  16658. rigy.type = "static";
  16659. sprite.addComponentIntance(rigy);
  16660. let d3Pos = d3Obj.transform.position;
  16661. xGame.common.pos3to2Convert(d3Pos);
  16662. let scaleX = d3Obj.transform.localScaleX;
  16663. let scaleZ = d3Obj.transform.localScaleZ;
  16664. let width = xGame.common.scale3to2Convert(scaleZ);
  16665. let height = xGame.common.scale3to2Convert(scaleX);
  16666. sprite.pivotX = width / 2;
  16667. sprite.pivotY = height / 2;
  16668. sprite.x = d3Pos.x;
  16669. sprite.y = d3Pos.y;
  16670. sprite.width = width;
  16671. sprite.height = height;
  16672. d2Obj.x = d3Pos.x;
  16673. d2Obj.y = d3Pos.y;
  16674. d2Obj.width = width;
  16675. d2Obj.height = height;
  16676. if (type == "box") {
  16677. colli.width = width;
  16678. colli.height = height;
  16679. colli.isSensor = false;
  16680. colli.label = "border";
  16681. }
  16682. else {
  16683. colli.radius = width / 2;
  16684. colli.isSensor = true;
  16685. colli.label = "hole";
  16686. sprite.addComponent(D2Hole);
  16687. }
  16688. }
  16689. }
  16690. class D3World extends Laya.Script3D {
  16691. constructor() {
  16692. super();
  16693. this.loadNum = 0;
  16694. this.setLoadNum = 7;
  16695. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16696. }
  16697. onAwake() {
  16698. }
  16699. loadScene() {
  16700. this.scene = this.owner;
  16701. let url = `res/unityRes/root.lh`;
  16702. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16703. this.scene.addChild(prefab);
  16704. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16705. this.putCameraInfo();
  16706. this.camera.enableHDR = false;
  16707. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16708. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16709. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16710. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16711. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16712. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16713. this.knife.active = false;
  16714. this.loadD3Obj();
  16715. }));
  16716. }
  16717. putCameraInfo() {
  16718. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16719. this.cameraObj = new cameraType();
  16720. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16721. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16722. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16723. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16724. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16725. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16726. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16727. this.visitAngleChild.init();
  16728. this.visitRootObj.posX = this.visitAngleChild.posX;
  16729. this.visitRootObj.posY = this.visitAngleChild.posY;
  16730. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16731. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16732. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16733. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16734. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16735. xGame.common.showOneCamera("mainCamera");
  16736. }
  16737. loadD3Obj() {
  16738. this.loadTable();
  16739. this.loadRoom();
  16740. this.loadInHoleParticial();
  16741. this.loadIceParticial();
  16742. this.loadHitParticial();
  16743. this.loadFireworksParticial();
  16744. this.loadBall();
  16745. }
  16746. loadInHoleParticial() {
  16747. this.loadD3Res("inHoleEft", "", (prefab) => {
  16748. prefab.addComponent(Partical);
  16749. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16750. });
  16751. }
  16752. loadIceParticial() {
  16753. this.loadD3Res("iceEft", "", (prefab) => {
  16754. prefab.addComponent(Partical);
  16755. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16756. });
  16757. }
  16758. loadHitParticial() {
  16759. this.loadD3Res("hitEft", "", (prefab) => {
  16760. prefab.addComponent(Partical);
  16761. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16762. });
  16763. }
  16764. loadFireworksParticial() {
  16765. this.loadD3Res("fireworksEft", "", (prefab) => {
  16766. prefab.addComponent(Partical);
  16767. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16768. });
  16769. }
  16770. loadBall(index = 1) {
  16771. this.loadD3Res("ball", index, (prefab) => {
  16772. this.ballPrefab = prefab;
  16773. this.ballPrefab.addComponent(Ball);
  16774. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16775. });
  16776. }
  16777. loadTable(index = 1) {
  16778. this.loadD3Res("table", index, (prefab) => {
  16779. this.tableSrc = prefab.addComponent(Table);
  16780. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16781. this.d3Hand.init();
  16782. this.tableRoot.addChild(prefab);
  16783. });
  16784. }
  16785. loadRoom(index = 1) {
  16786. this.loadD3Res("room", index, (prefab) => {
  16787. this.roomRoot.addChild(prefab);
  16788. });
  16789. }
  16790. loadD3Res(type, index, callback) {
  16791. let url = `res/unityRes/${type}${index}.lh`;
  16792. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16793. callback && callback(prefab);
  16794. this.checkResLoad();
  16795. }));
  16796. }
  16797. checkResLoad() {
  16798. this.loadNum++;
  16799. if (this.loadNum >= this.setLoadNum) {
  16800. xGame.eventMgr.event(D3RES_LOADED);
  16801. }
  16802. }
  16803. prePlayEft() {
  16804. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16805. eft.transform.localPositionX = 0;
  16806. eft.transform.localPositionY = -5;
  16807. eft.transform.localPositionZ = 0;
  16808. eft.active = true;
  16809. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16810. ice.transform.localPositionX = 0;
  16811. ice.transform.localPositionY = -5;
  16812. ice.transform.localPositionZ = 0;
  16813. ice.active = true;
  16814. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16815. hit.transform.localPositionX = 0;
  16816. hit.transform.localPositionY = -5;
  16817. hit.transform.localPositionZ = 0;
  16818. hit.active = true;
  16819. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16820. fireworks.transform.localPositionX = 0;
  16821. fireworks.transform.localPositionY = -5;
  16822. fireworks.transform.localPositionZ = 0;
  16823. fireworks.active = true;
  16824. }
  16825. }
  16826. class cameraType {
  16827. }
  16828. class MoyuMgr$1 {
  16829. static initMoyu() {
  16830. this.moyuView = new MoyuView$1();
  16831. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16832. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16833. this.moyuView.ui.displayObject.zOrder = 1000;
  16834. this.moyuView.init();
  16835. this.moyuView.showTip(true);
  16836. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16837. window['XApk'] = this;
  16838. }
  16839. static showAge(show) {
  16840. if (this.moyuView)
  16841. this.moyuView.showAge(show);
  16842. }
  16843. static onPlatMsg(idx) {
  16844. if (!MoyuMgr$1.moyuView)
  16845. return;
  16846. if (idx == '0') {
  16847. MoyuMgr$1.moyuView.showTip(false);
  16848. }
  16849. }
  16850. static showAgree(call) {
  16851. if (this.moyuView)
  16852. this.moyuView.showAgree(call);
  16853. else
  16854. call && call();
  16855. }
  16856. static showXy(type = 1) {
  16857. if (this.moyuView)
  16858. this.moyuView.showXy(type);
  16859. }
  16860. }
  16861. MoyuMgr$1.isAdvise = false;
  16862. class MoyuView$1 {
  16863. constructor() {
  16864. this.ysxyNum = 1;
  16865. this.ysJson = null;
  16866. this.ui = ui_UIMoyu.createInstance();
  16867. }
  16868. init() {
  16869. this.ui.mainBg.visible = false;
  16870. this.ui.xyNode.visible = false;
  16871. this.ui.ageNode.visible = false;
  16872. this.ui.tipNode.visible = false;
  16873. this.ui.rnNode.visible = false;
  16874. this.ui.fcmNode.visible = false;
  16875. this.ui.ageTip.visible = false;
  16876. this.ui.msgNode.visible = false;
  16877. this.ui.visible = false;
  16878. this.ui.xyNode.xyList.setVirtual();
  16879. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16880. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16881. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16882. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16883. this.ui.xyNode.btnKnown.visible = false;
  16884. this.ui.xyNode.xy1.visible = false;
  16885. this.ui.xyNode.xy2.visible = false;
  16886. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16887. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16888. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16889. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16890. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16891. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16892. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16893. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16894. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16895. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16896. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16897. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16898. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16899. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16900. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16901. this.ysxyNum = 2;
  16902. }
  16903. }
  16904. onClick(obj) {
  16905. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16906. switch (obj) {
  16907. case this.ui.ageTip:
  16908. if (Moyu.isTTApk) {
  16909. this.ui.ageNode.visible = true;
  16910. this.ui.mainBg.visible = true;
  16911. }
  16912. break;
  16913. case this.ui.tipNode:
  16914. this.showTip(false);
  16915. break;
  16916. case this.ui.ageNode.btnAge:
  16917. this.ui.ageNode.visible = false;
  16918. this.ui.mainBg.visible = false;
  16919. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16920. this.ui.visible = false;
  16921. break;
  16922. case this.ui.xyNode.btnXy3:
  16923. case this.ui.xyNode.btnXy1:
  16924. this.loadXy(1);
  16925. break;
  16926. case this.ui.xyNode.btnXy2:
  16927. this.loadXy(2);
  16928. break;
  16929. case this.ui.xyNode.btnBack:
  16930. this.ui.xyNode.xy1.visible = true;
  16931. this.ui.xyNode.xy2.visible = false;
  16932. break;
  16933. case this.ui.xyNode.btnKnown:
  16934. this.ui.xyNode.visible = false;
  16935. this.ui.mainBg.visible = false;
  16936. this.ui.visible = false;
  16937. break;
  16938. case this.ui.rnNode.btnCheck:
  16939. this.check();
  16940. break;
  16941. case this.ui.rnNode.btnExit:
  16942. case this.ui.xyNode.btnNo:
  16943. this.ysxyNum--;
  16944. if (this.ysxyNum > 0)
  16945. this.showMsg("Refuse to quit the game once again");
  16946. else {
  16947. Moyu.userAgree(false);
  16948. Moyu.exit();
  16949. }
  16950. break;
  16951. case this.ui.xyNode.btnSure:
  16952. case this.ui.xyNode.btnYes:
  16953. DataMgr.userData.isAgree = true;
  16954. DataMgr.saveUserData();
  16955. this.onAgree();
  16956. break;
  16957. case this.ui.rnNode.btnDone:
  16958. this.ui.rnNode.visible = false;
  16959. this.ui.visible = false;
  16960. break;
  16961. case this.ui.fcmNode.btnRn:
  16962. this.showRn();
  16963. break;
  16964. }
  16965. }
  16966. showTip(show) {
  16967. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16968. return;
  16969. if (show) {
  16970. MoyuMgr$1.isAdvise = true;
  16971. this.ui.visible = true;
  16972. this.ui.tipNode.visible = true;
  16973. this.ui.tipNode.alpha = 1;
  16974. Laya.timer.once(1000, this, this.showTip, [false]);
  16975. }
  16976. else {
  16977. this.ui.tipNode.alpha = 1;
  16978. this.ui.tipNode.visible = true;
  16979. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16980. this.ui.tipNode.visible = false;
  16981. MoyuMgr$1.isAdvise = false;
  16982. }), 1000);
  16983. }
  16984. }
  16985. showAge(show, px = 0, py = 0) {
  16986. if (Moyu.platType > 10 && !Moyu.isIos) {
  16987. this.ui.ageTip.x = px;
  16988. this.ui.ageTip.y = py;
  16989. this.ui.ageTip.visible = show;
  16990. if (show)
  16991. this.ui.visible = true;
  16992. }
  16993. }
  16994. showAgree(call) {
  16995. this.agreeCall = call;
  16996. this.onAgree();
  16997. return;
  16998. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  16999. this.showXy(0);
  17000. }
  17001. else
  17002. this.onAgree();
  17003. }
  17004. onAgree() {
  17005. if (!this.ui.ageNode.visible)
  17006. this.ui.visible = false;
  17007. this.ui.xyNode.visible = false;
  17008. Moyu.userAgree(true);
  17009. this.showAge(false);
  17010. this.agreeCall && this.agreeCall();
  17011. this.showRn();
  17012. }
  17013. showMsg(txt) {
  17014. this.ui.msgNode.txtMsg.text = txt;
  17015. this.ui.msgNode.visible = true;
  17016. this.ui.msgNode.alpha = 1;
  17017. this.ui.visible = true;
  17018. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17019. this.ui.msgNode.visible = false;
  17020. }), 2500, true);
  17021. }
  17022. showRn() {
  17023. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17024. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17025. this.ui.rnNode.rn1.visible = true;
  17026. this.ui.rnNode.rn2.visible = false;
  17027. this.ui.rnNode.rn3.visible = false;
  17028. this.ui.rnNode.rn4.visible = false;
  17029. this.ui.rnNode.visible = true;
  17030. this.ui.mainBg.visible = true;
  17031. this.ui.rnNode.btnDone.visible = false;
  17032. this.ui.rnNode.btnExit.visible = true;
  17033. this.ui.rnNode.btnCheck.visible = true;
  17034. this.ui.fcmNode.visible = false;
  17035. this.ui.visible = true;
  17036. return;
  17037. }
  17038. }
  17039. this.showFcm();
  17040. }
  17041. showFcm() {
  17042. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17043. Moyu.initFCM(true);
  17044. if (Moyu.gameTime < 1)
  17045. this.fcmLoop();
  17046. else if (Moyu.gameTime < 999)
  17047. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17048. }
  17049. }
  17050. fcmLoop() {
  17051. if (Moyu.gameTime < 1) {
  17052. this.ui.rnNode.visible = false;
  17053. this.ui.fcmNode.visible = true;
  17054. this.ui.mainBg.visible = true;
  17055. this.ui.visible = true;
  17056. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17057. Laya.timer.clear(this.ui, this.fcmLoop);
  17058. }
  17059. }
  17060. check() {
  17061. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17062. this.ui.rnNode.rn1.visible = false;
  17063. this.ui.rnNode.rn2.visible = false;
  17064. this.ui.rnNode.rn4.visible = true;
  17065. }
  17066. else if (this.ui.rnNode.rn4.visible) {
  17067. let name = this.ui.rnNode.inputName.text;
  17068. let code = this.ui.rnNode.inputCode.text;
  17069. if (code && code.length == 18) {
  17070. this.ui.rnNode.rn1.visible = false;
  17071. this.ui.rnNode.rn4.visible = false;
  17072. Moyu.authenticate(name, code, (res) => {
  17073. this.ui.rnNode.rn2.visible = !res;
  17074. this.ui.rnNode.rn3.visible = res;
  17075. this.ui.rnNode.btnDone.visible = res;
  17076. this.ui.rnNode.btnExit.visible = !res;
  17077. this.ui.rnNode.btnCheck.visible = !res;
  17078. if (res)
  17079. this.showFcm();
  17080. });
  17081. }
  17082. else
  17083. this.showMsg("信息填写不完整");
  17084. }
  17085. }
  17086. loadXy(type = 0) {
  17087. this.ui.xyNode.xy1.visible = false;
  17088. this.ui.xyNode.xy2.visible = true;
  17089. this.ui.xyNode.xyList.scrollToView(0);
  17090. if (type == 1) {
  17091. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17092. }
  17093. else if (type == 2) {
  17094. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17095. }
  17096. }
  17097. showXy(type = 0) {
  17098. this.xyBtn();
  17099. if (type == 0) {
  17100. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17101. this.ui.xyNode.btnSure.visible = true;
  17102. }
  17103. else {
  17104. this.ui.xyNode.btnYes.visible = true;
  17105. this.ui.xyNode.btnNo.visible = true;
  17106. }
  17107. }
  17108. else {
  17109. this.ui.xyNode.btnKnown.visible = true;
  17110. this.ui.mainBg.visible = true;
  17111. }
  17112. this.ui.xyNode.xy1.visible = true;
  17113. this.ui.xyNode.xy2.visible = false;
  17114. this.ui.xyNode.visible = true;
  17115. this.ui.visible = true;
  17116. }
  17117. xyBtn() {
  17118. this.ui.xyNode.btnSure.visible = false;
  17119. this.ui.xyNode.btnYes.visible = false;
  17120. this.ui.xyNode.btnNo.visible = false;
  17121. this.ui.xyNode.btnKnown.visible = false;
  17122. {
  17123. this.ui.xyNode.btnXy3.visible = false;
  17124. this.ui.xyNode.btnXy2.visible = true;
  17125. this.ui.xyNode.btnXy1.visible = true;
  17126. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17127. }
  17128. }
  17129. createXY(json) {
  17130. this.ysJson = json.content;
  17131. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17132. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17133. this.ui.xyNode.xy2.visible = true;
  17134. }
  17135. renderListItem(idx, cell) {
  17136. let xy = this.ysJson[idx];
  17137. cell.height = xy.line * 30;
  17138. cell.xyItem.text = xy.text;
  17139. }
  17140. onDestroy() {
  17141. this.agreeCall = null;
  17142. }
  17143. }
  17144. class UILoading extends UIBase {
  17145. constructor() {
  17146. super();
  17147. this.accTime = 0;
  17148. this.curNum = 0;
  17149. this.rate = 1;
  17150. this.loadSubOk = false;
  17151. this.loadResOK = false;
  17152. this.openLoading = true;
  17153. this.beginLoadRes = false;
  17154. this.finishD2 = false;
  17155. this.finishD3 = false;
  17156. }
  17157. onConstructor() {
  17158. this.ui = ui_UILoading.createInstance();
  17159. this.contentPane = this.ui;
  17160. this.isEject = false;
  17161. this._initUI();
  17162. this._addEvent();
  17163. }
  17164. _initUI() {
  17165. MoyuMgr$1.initMoyu();
  17166. }
  17167. _addEvent() {
  17168. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17169. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17170. }
  17171. show() {
  17172. super.show();
  17173. console.log('zh:加载分包资源');
  17174. loadSubRes(this.subResProgress.bind(this));
  17175. this.ui.txtLoad.text = "Loading...";
  17176. }
  17177. subResProgress(pro, finish) {
  17178. this.curNum = pro;
  17179. if (finish) {
  17180. this.curNum = 1;
  17181. this.loadSubOk = true;
  17182. }
  17183. }
  17184. laodD3Res() {
  17185. let scene3D = new Laya.Scene3D();
  17186. xGame.common.d3Scene = scene3D;
  17187. xGame.common.d3World = scene3D.addComponent(D3World);
  17188. xGame.common.d3World.loadScene();
  17189. }
  17190. loadD2Res() {
  17191. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17192. this.finishD2 = true;
  17193. this.checkLoadAll();
  17194. this.curNum = 1;
  17195. }), Laya.Handler.create(this, (pro) => {
  17196. this.curNum = pro;
  17197. }, null, false));
  17198. }
  17199. d3ResFinish() {
  17200. this.finishD3 = true;
  17201. this.checkLoadAll();
  17202. }
  17203. checkLoadAll() {
  17204. if (this.finishD2 && this.finishD3) {
  17205. this.loadResOK = true;
  17206. }
  17207. }
  17208. loadRes() {
  17209. this.laodD3Res();
  17210. this.loadD2Res();
  17211. }
  17212. myUpdate(dt) {
  17213. if (!this.openLoading)
  17214. return;
  17215. this.accTime += dt * this.rate;
  17216. if (this.accTime >= this.curNum)
  17217. this.accTime = this.curNum;
  17218. this.ui.loadinfo.value = this.accTime * 100;
  17219. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17220. if (!this.beginLoadRes) {
  17221. this.beginLoadRes = true;
  17222. this.ui.txtLoad.text = "Loading...";
  17223. this.curNum = 0;
  17224. this.accTime = 0;
  17225. this.loadRes();
  17226. }
  17227. if (this.loadResOK) {
  17228. this.openLoading = false;
  17229. Laya.timer.once(300, this, () => {
  17230. xGame.common.d3Scene.active = false;
  17231. MoyuMgr$1.showAgree(enterGame);
  17232. });
  17233. }
  17234. }
  17235. }
  17236. release() {
  17237. }
  17238. hide() {
  17239. super.hide();
  17240. this.release();
  17241. }
  17242. onClose() {
  17243. this.hide();
  17244. }
  17245. }
  17246. UILoading.uiName = "UILoading";
  17247. class UIRepentProp$1 extends UIBase {
  17248. constructor() {
  17249. super();
  17250. this.viewType = 0;
  17251. this.regretType = 0;
  17252. }
  17253. onConstructor() {
  17254. this.ui = ui_UIRepentProp.createInstance();
  17255. this.contentPane = this.ui;
  17256. this.isEject = false;
  17257. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17258. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17259. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17260. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17261. }
  17262. show(viewType, regretType, callback) {
  17263. PlatMgr.showInsert(true);
  17264. this.viewType = viewType;
  17265. this.regretType = regretType;
  17266. this.callback = callback;
  17267. super.show();
  17268. this.ui.t0.play();
  17269. this.ui.c1.selectedIndex = this.viewType;
  17270. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17271. if (this.viewType == 0) {
  17272. let guide = DataMgr.getGuideHelpLine();
  17273. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17274. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17275. }
  17276. xGame.common.gameMgr.gamePause = true;
  17277. }
  17278. hideSelf() {
  17279. xGame.common.gameMgr.gamePause = false;
  17280. this.callback && this.callback(false);
  17281. this.hide();
  17282. }
  17283. videoRegret() {
  17284. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17285. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17286. }
  17287. else {
  17288. console.log('zh:AD 失败,直接发放奖励');
  17289. this.qjff_AD_for_UIrepentProp_videoRegret();
  17290. }
  17291. }
  17292. qjff_AD_for_UIrepentProp_videoRegret() {
  17293. this.callback && this.callback(true);
  17294. this.hideSelf();
  17295. }
  17296. videoAddHelpLine() {
  17297. let guide = DataMgr.getGuideHelpLine();
  17298. if (guide == 0) {
  17299. this.callback && this.callback(true);
  17300. this.hideSelf();
  17301. DataMgr.setGuideHelpLine();
  17302. xGame.common.gameUI.ui.guideNode.visible = false;
  17303. }
  17304. else {
  17305. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17306. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17307. }
  17308. else {
  17309. console.log('zh:AD 失败,直接发放奖励');
  17310. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17311. }
  17312. }
  17313. }
  17314. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17315. this.callback && this.callback(true);
  17316. this.hideSelf();
  17317. }
  17318. }
  17319. UIRepentProp$1.uiName = "UIRepentProp";
  17320. class UIRodMethod$1 extends UIBase {
  17321. constructor() {
  17322. super();
  17323. this.isPressd = false;
  17324. }
  17325. onConstructor() {
  17326. this.ui = ui_UIRodMethod.createInstance();
  17327. this.contentPane = this.ui;
  17328. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17329. this.moveDir = new Laya.Vector2();
  17330. this.moveDest = new Laya.Vector2();
  17331. this.centerPos = new Laya.Vector2();
  17332. xGame.common.uiRodMethod = this;
  17333. }
  17334. show() {
  17335. super.show();
  17336. xGame.common.gameMgr.gamePause = true;
  17337. this.openPressDotEvent();
  17338. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17339. this.centerPos.x = this.ui.white.x;
  17340. this.centerPos.y = this.ui.white.y;
  17341. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17342. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17343. this.setDot();
  17344. }
  17345. setDot() {
  17346. this.ui.dot.x = this.moveDest.x;
  17347. this.ui.dot.y = this.moveDest.y;
  17348. }
  17349. closeSelf() {
  17350. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17351. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17352. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17353. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17354. xGame.common.gameMgr.gamePause = false;
  17355. this.hide();
  17356. }
  17357. openPressDotEvent() {
  17358. this.closePressDotEvent();
  17359. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17360. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17361. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17362. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17363. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17364. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17365. }
  17366. closePressDotEvent() {
  17367. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17368. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17369. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17370. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17371. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17372. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17373. }
  17374. onDown(e) {
  17375. if (e.type == Laya.Event.MOUSE_DOWN)
  17376. this.isPressd = true;
  17377. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17378. this.isPressd = false;
  17379. if (!this.isPressd)
  17380. return;
  17381. this.moveDest.x = e.stageX;
  17382. this.moveDest.y = e.stageY;
  17383. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17384. if (dis > 6724) {
  17385. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17386. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17387. }
  17388. this.setDot();
  17389. }
  17390. resetRod() {
  17391. this.ui.dot.x = this.ui.white.x;
  17392. this.ui.dot.y = this.ui.white.y;
  17393. this.gameRod.dot.x = this.gameRod.bg.x;
  17394. this.gameRod.dot.y = this.gameRod.bg.y;
  17395. xGame.common.rodOffest.x = 0;
  17396. xGame.common.rodOffest.y = 0;
  17397. }
  17398. }
  17399. UIRodMethod$1.uiName = "UIRodMethod";
  17400. class UIMsg$1 extends UIBase {
  17401. constructor() {
  17402. super();
  17403. }
  17404. onConstructor() {
  17405. this.ui = ui_UIMsg.createInstance();
  17406. this.contentPane = this.ui;
  17407. this.isEject = false;
  17408. this.isMuti = true;
  17409. }
  17410. show(msg, callback) {
  17411. super.show();
  17412. this.ui.tipsNode.msgTxt.text = msg;
  17413. this.ui.alpha = 1;
  17414. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17415. this.hide();
  17416. callback && callback();
  17417. }), 1000);
  17418. }
  17419. }
  17420. UIMsg$1.uiName = "UIMsg";
  17421. class UITips$1 extends UIBase {
  17422. constructor() {
  17423. super();
  17424. this.type = 0;
  17425. }
  17426. onConstructor() {
  17427. this.ui = ui_UITips.createInstance();
  17428. this.contentPane = this.ui;
  17429. this.isEject = false;
  17430. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17431. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17432. }
  17433. show(tipsTxt, womanTxt, type) {
  17434. super.show();
  17435. this.ui.t0.play();
  17436. this.ui.myNode.tipsTxt.text = tipsTxt;
  17437. this.ui.myNode.womanTxt.text = womanTxt;
  17438. PlatMgr.showInsert(true);
  17439. this.ui.myNode.c1.selectedIndex = type;
  17440. this.type = type;
  17441. switch (this.type) {
  17442. case TipsType.exitGame:
  17443. xGame.common.gameMgr.gamePause = true;
  17444. break;
  17445. case TipsType.foul:
  17446. Laya.timer.once(200, this, () => {
  17447. xGame.common.gameMgr.gamePause = true;
  17448. });
  17449. break;
  17450. default:
  17451. break;
  17452. }
  17453. }
  17454. clickLeftBtn() {
  17455. this.hide();
  17456. xGame.common.gameMgr.gamePause = false;
  17457. switch (this.type) {
  17458. case TipsType.exitGame:
  17459. break;
  17460. case TipsType.foul:
  17461. break;
  17462. default:
  17463. break;
  17464. }
  17465. }
  17466. clickRightBtn() {
  17467. this.hide();
  17468. switch (this.type) {
  17469. case TipsType.exitGame:
  17470. xGame.eventMgr.event(RESET_GAME);
  17471. xGame.uiMgr.Show(UIMain$1);
  17472. Moyu.recordEnd(this, null);
  17473. xGame.common.longHelpLine = false;
  17474. break;
  17475. case TipsType.foul:
  17476. xGame.common.gameMgr.gamePause = false;
  17477. Laya.timer.clearAll(this);
  17478. break;
  17479. default:
  17480. break;
  17481. }
  17482. }
  17483. }
  17484. UITips$1.uiName = "UITips";
  17485. class UIGame$1 extends UIBase {
  17486. constructor() {
  17487. super();
  17488. this.powerNum = 0;
  17489. this.isD3Inited = false;
  17490. this.isPrePlay = false;
  17491. this.isMoveRod = false;
  17492. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17493. this.rulerDis = 20;
  17494. this.rulerOffset = 0;
  17495. }
  17496. onConstructor() {
  17497. this.ui = ui_UIGame.createInstance();
  17498. this.contentPane = this.ui;
  17499. this.ui.x += xGame.common.sysOffestNum;
  17500. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17501. this.isEject = false;
  17502. xGame.common.gameUI = this;
  17503. this.initSelf();
  17504. }
  17505. isTurnSelf() {
  17506. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17507. return true;
  17508. }
  17509. }
  17510. initSelf() {
  17511. let topUI = this.ui.topNode;
  17512. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17513. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17514. this.barInfo = {};
  17515. this.barInfo.curY = 0;
  17516. this.barInfo.height = this.ui.powerNode.height;
  17517. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17518. this.barInfo.powerStartY = this.ui.powerNode.y;
  17519. xGame.common.aiPlayer = new AIPlayer();
  17520. xGame.common.gameMgr = new GameMgr();
  17521. xGame.common.skillMgr = new SkillMgr();
  17522. xGame.common.wordsMgr = new WordsMgr();
  17523. xGame.common.talkMgr = new TalkMgr();
  17524. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17525. console.log("加载经典模式表情文件chenggon !");
  17526. });
  17527. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17528. console.log("挑战模式奖励模式spine加载成功!");
  17529. });
  17530. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17531. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17532. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17533. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17534. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17535. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17536. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17537. }
  17538. returnHome() {
  17539. let tips = "Are you sure to exit the game?";
  17540. let woman = "Boss, why don't you play for a while longer?";
  17541. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17542. }
  17543. addRodMethodClick() {
  17544. if (this.isTurnSelf()) {
  17545. xGame.uiMgr.Show(UIRodMethod$1);
  17546. }
  17547. }
  17548. clickHelpLineBtn(force = false) {
  17549. if (!this.isTurnSelf())
  17550. return;
  17551. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17552. if (success) {
  17553. xGame.common.longHelpLine = true;
  17554. xGame.common.d2World.getHelpLine();
  17555. Moyu.sendDataEvent("guideNum");
  17556. }
  17557. else {
  17558. }
  17559. });
  17560. }
  17561. renderSelfDisplayBalls(index, target) {
  17562. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17563. target.myImg.url = xGame.common.getGameIconUrl(str);
  17564. }
  17565. renderAIDisplayBalls(index, target) {
  17566. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17567. target.myImg.url = xGame.common.getGameIconUrl(str);
  17568. ;
  17569. }
  17570. updateMode() {
  17571. if (xGame.common.gameMode == GameMode.classic) {
  17572. this.ui.topNode.scoreNode.visible = false;
  17573. }
  17574. else if (xGame.common.gameMode == GameMode.bigMove) {
  17575. this.ui.topNode.scoreNode.visible = true;
  17576. }
  17577. }
  17578. show() {
  17579. super.show();
  17580. console.log("zh:uigame show");
  17581. this.ui.alpha = 0;
  17582. this.updateSelf();
  17583. console.log("zh:uigame bf gamemusic01 start");
  17584. xGame.soundMgr.playMusic("gamemusic01");
  17585. console.log("zh:uigame bf gamemusic01 end");
  17586. xGame.common.gameMgr.gamePause = false;
  17587. xGame.common.gameUI.ui.blackAni.visible = false;
  17588. xGame.common.gameUI.ui.whiteAni.visible = false;
  17589. this.ui.powerEft.visible = false;
  17590. this.ui.colorNode.visible = false;
  17591. this.updateHead();
  17592. }
  17593. updateSelf() {
  17594. if (xGame.common.gameMode == GameMode.classic) {
  17595. this.ui.c1.selectedIndex = 0;
  17596. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17597. this.ui.topNode.middleNode.visible = true;
  17598. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17599. }
  17600. else if (xGame.common.gameMode == GameMode.bigMove) {
  17601. this.ui.c1.selectedIndex = 0;
  17602. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17603. this.ui.topNode.middleNode.visible = false;
  17604. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17605. let rand = xGame.common.randomNum(1, max);
  17606. let guide = DataMgr.getSkillGuide();
  17607. if (guide == 0)
  17608. rand = 1;
  17609. xGame.common.bigMoveLevelIndex = rand;
  17610. }
  17611. else if (xGame.common.gameMode == GameMode.placeBall) {
  17612. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17613. this.ui.c1.selectedIndex = 1 + data.type;
  17614. this.ui.alpha = 1;
  17615. this.startGame();
  17616. }
  17617. this.updateMode();
  17618. this.initD3world();
  17619. this.initD2world();
  17620. }
  17621. startGame() {
  17622. this.ui.snowNode.visible = Math.random() <= 0.1;
  17623. this.ui.d2Node.visible = false;
  17624. xGame.common.d3World.d3Hand.gameObj.active = false;
  17625. xGame.common.d3World.tableSrc.init();
  17626. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17627. this.cameraViewChange(() => {
  17628. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17629. switch (xGame.common.gameMode) {
  17630. case GameMode.classic:
  17631. xGame.common.d3World.d3Hand.gameObj.active = true;
  17632. this.playPutBallD3Ani();
  17633. break;
  17634. case GameMode.bigMove:
  17635. this.enterGame();
  17636. Laya.timer.once(500, this, () => {
  17637. this.ui.topNode.middleNode.visible = true;
  17638. this.ui.topNode.middleNode.t0.play();
  17639. });
  17640. break;
  17641. case GameMode.placeBall:
  17642. this.enterGame();
  17643. break;
  17644. default:
  17645. break;
  17646. }
  17647. });
  17648. PlatMgr.showBanner(false);
  17649. }
  17650. enterGame() {
  17651. this.ui.d2Node.visible = true;
  17652. xGame.common.d3World.d3Hand.gameObj.active = false;
  17653. xGame.common.showOneCamera("mainCamera");
  17654. Moyu.recordGame(30, true);
  17655. if (!this.isPrePlay) {
  17656. this.isPrePlay = true;
  17657. xGame.common.d3World.prePlayEft();
  17658. }
  17659. xGame.common.gameMgr.gameReady();
  17660. this.openAllEvent();
  17661. this.ui.snowNode.visible = false;
  17662. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17663. this.ui.helpBtn.visible = condition;
  17664. }
  17665. showHelpLineGuide() {
  17666. let longGuide = DataMgr.getGuideHelpLine();
  17667. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17668. this.ui.helpBtn.visible = true;
  17669. this.ui.guideNode.visible = true;
  17670. }
  17671. }
  17672. setTurnAlpha(alpha) {
  17673. this.ui.keduNode.alpha = alpha;
  17674. this.ui.ganNode.alpha = alpha;
  17675. this.ui.rodMethodNode.alpha = alpha;
  17676. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17677. }
  17678. cameraViewChange(callback) {
  17679. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17680. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17681. xGame.common.showOneCamera("visitAngle");
  17682. cameraSrc.localRotationEulerY = 180;
  17683. cameraSrc.localRotationEulerZ = 0;
  17684. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17685. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17686. callback && callback();
  17687. }));
  17688. }));
  17689. }
  17690. playPutBallD3Ani() {
  17691. xGame.common.showOneCamera("mainCamera");
  17692. let handSrc = xGame.common.d3World.d3Hand;
  17693. handSrc.gameObj.active = true;
  17694. handSrc.transform.localPositionZ = 3;
  17695. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17696. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17697. handSrc.gameObj.active = false;
  17698. this.enterGame();
  17699. }), 400);
  17700. }));
  17701. }
  17702. updateHead() {
  17703. let user = Moyu.getUserInfo();
  17704. this.ui.topNode.selfNameTxt.text = user.nickName;
  17705. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17706. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17707. if (DataMgr.getSkillGuide() < 1) {
  17708. this.ui.topNode.aiNameTxt.text = 'billiards';
  17709. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17710. }
  17711. else {
  17712. this.ui.topNode.aiNameTxt.text = aiData.name;
  17713. let randNo = Math.floor(Math.random() * 10) + 1;
  17714. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17715. }
  17716. }
  17717. initD2world() {
  17718. let node = this.ui.d2Root.displayObject;
  17719. let src = node.getComponent(D2World);
  17720. if (!src) {
  17721. xGame.common.d2World = node.addComponent(D2World);
  17722. }
  17723. xGame.common.d2World.initSelf();
  17724. }
  17725. initD3world() {
  17726. if (this.isD3Inited)
  17727. return;
  17728. this.isD3Inited = true;
  17729. let scene3D = xGame.common.d3Scene;
  17730. this.ui.d3Root.displayObject.addChild(scene3D);
  17731. scene3D.active = true;
  17732. xGame.common.d3World.tableSrc.setBorderPos();
  17733. }
  17734. onRootMove(e) {
  17735. let rootBall = xGame.common.d2World.rootBall;
  17736. this.ui.moveNode.x = e.x;
  17737. this.ui.moveNode.y = e.y;
  17738. rootBall.gameObj.x = e.x;
  17739. rootBall.gameObj.y = e.y;
  17740. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17741. }
  17742. aiRootMove(move) {
  17743. if (move)
  17744. this.hideBallUI();
  17745. else {
  17746. this.showBallUI();
  17747. xGame.common.d2World.getHelpLine();
  17748. }
  17749. }
  17750. aiForce(type, force = 0) {
  17751. this.pressTarget = PressType.powerNode;
  17752. if (type == 1)
  17753. this.onEventUp({ force: true });
  17754. else if (type == 2)
  17755. this.onEventMove({ stageY: force, force: true });
  17756. }
  17757. onEventPress(e) {
  17758. if (e.stopPropagation)
  17759. e.stopPropagation();
  17760. if (!this.isTurnSelf())
  17761. return;
  17762. let target = e.target;
  17763. switch (target) {
  17764. case this.ui.myPowerNode.displayObject:
  17765. this.pressTarget = PressType.powerNode;
  17766. this.barInfo.curY = e.stageY;
  17767. this.updateBarInfo();
  17768. break;
  17769. case this.ui.moveNode.displayObject:
  17770. this.pressTarget = PressType.moveNode;
  17771. this.hideBallUI();
  17772. this.eventObj.curX = this.ui.moveNode.x;
  17773. this.eventObj.curY = this.ui.moveNode.y;
  17774. this.ui.moveNode.finger.visible = false;
  17775. this.eventObj.lastX = e.stageX;
  17776. this.eventObj.lastY = e.stageY;
  17777. break;
  17778. case this.ui.rulerClickNode.displayObject:
  17779. this.pressTarget = PressType.rulerNode;
  17780. this.eventObj.lastY = e.stageY;
  17781. break;
  17782. case this.ui.d2Root.displayObject:
  17783. this.pressTarget = PressType.d2Root;
  17784. this.eventObj.lastX = e.stageX;
  17785. this.eventObj.lastY = e.stageY;
  17786. this.eventObj.starX = e.stageX;
  17787. this.eventObj.starY = e.stageY;
  17788. this.eventObj.curX = 0;
  17789. this.eventObj.curY = 0;
  17790. xGame.common.d2World.d2Gan.setGanLastInfo();
  17791. this.rulerOffset = 0;
  17792. break;
  17793. default:
  17794. break;
  17795. }
  17796. }
  17797. onEventMove(e) {
  17798. if (e.stopPropagation)
  17799. e.stopPropagation();
  17800. if (e && e.force) {
  17801. }
  17802. else {
  17803. if (!this.isTurnSelf())
  17804. return;
  17805. }
  17806. switch (this.pressTarget) {
  17807. case PressType.powerNode:
  17808. this.barInfo.curY = e.stageY;
  17809. this.updateBarInfo();
  17810. this.isMoveRod = true;
  17811. break;
  17812. case PressType.moveNode:
  17813. let rootBall = xGame.common.d2World.rootBall;
  17814. let radius = rootBall.gameObj.width / 2;
  17815. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17816. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17817. let border = xGame.common.d2World.borderRect;
  17818. if (curX <= border.x + radius)
  17819. curX = border.x + radius;
  17820. else if (curX >= border.x + border.width - radius)
  17821. curX = border.x + border.width - radius;
  17822. if (curY <= border.y + radius)
  17823. curY = border.y + radius;
  17824. else if (curY >= border.y + border.height - radius)
  17825. curY = border.y + border.height - radius;
  17826. if (xGame.common.gameMgr.isOpenBall) {
  17827. if (curX >= border.x + border.openBallW - radius)
  17828. curX = border.x + border.openBallW - radius;
  17829. }
  17830. this.ui.moveNode.x = curX;
  17831. this.ui.moveNode.y = curY;
  17832. rootBall.gameObj.x = curX;
  17833. rootBall.gameObj.y = curY;
  17834. rootBall.d3BallSrc.setTransPos(curX, curY);
  17835. this.isMoveRod = true;
  17836. break;
  17837. case PressType.rulerNode:
  17838. let yy = e.stageY - this.eventObj.lastY;
  17839. this.eventObj.lastY = e.stageY;
  17840. let ruler1 = this.ui.rulerNode.img1;
  17841. let ruler2 = this.ui.rulerNode.img2;
  17842. ruler1.y += yy;
  17843. ruler2.y += yy;
  17844. this.rulerOffset += yy;
  17845. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17846. this.rulerOffset = 0;
  17847. xGame.soundMgr.playSound("inch", 1, 10);
  17848. }
  17849. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17850. let h = ruler1.height;
  17851. this.checkGuide();
  17852. this.isMoveRod = true;
  17853. if (ruler1.y >= h) {
  17854. ruler1.y = -h;
  17855. ruler2.y = 0;
  17856. return;
  17857. }
  17858. else if (ruler1.y <= -h) {
  17859. ruler1.y = h;
  17860. ruler2.y = 0;
  17861. return;
  17862. }
  17863. if (ruler2.y >= h) {
  17864. ruler2.y = -h;
  17865. ruler1.y = 0;
  17866. return;
  17867. }
  17868. else if (ruler2.y <= -h) {
  17869. ruler2.y = h;
  17870. ruler1.y = 0;
  17871. return;
  17872. }
  17873. break;
  17874. case PressType.d2Root:
  17875. this.eventObj.curX = e.stageX;
  17876. this.eventObj.curY = e.stageY;
  17877. let offset = this.checkRodMoveDir();
  17878. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17879. this.eventObj.lastX = e.stageX;
  17880. this.eventObj.lastY = e.stageY;
  17881. break;
  17882. default:
  17883. break;
  17884. }
  17885. }
  17886. onEventUp(e) {
  17887. if (e.stopPropagation)
  17888. e.stopPropagation();
  17889. if (e && e.force) {
  17890. }
  17891. else {
  17892. if (!this.isTurnSelf())
  17893. return;
  17894. }
  17895. switch (this.pressTarget) {
  17896. case PressType.powerNode:
  17897. this.ui.powerNode.value = 0;
  17898. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17899. this.ui.powerTxt.text = "";
  17900. if (this.powerNum > 0) {
  17901. xGame.eventMgr.event(BALL_SHOOT);
  17902. xGame.common.d2World.shoot(this.powerNum);
  17903. xGame.common.d2World.d2Gan.shoot();
  17904. xGame.common.d2World.d2HelpLine.shoot();
  17905. this.finishGuide();
  17906. this.ui.powerEft.visible = false;
  17907. this.ui.colorNode.visible = false;
  17908. let ganStr = "";
  17909. if (this.powerNum <= 30) {
  17910. ganStr = "gan_30";
  17911. }
  17912. else if (this.powerNum <= 60) {
  17913. ganStr = "gan_50";
  17914. }
  17915. else {
  17916. ganStr = "gan_80";
  17917. }
  17918. xGame.soundMgr.playSound(ganStr);
  17919. }
  17920. break;
  17921. case PressType.moveNode:
  17922. let rootBall = xGame.common.d2World.rootBall;
  17923. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17924. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17925. let isIntersect = this.judgeBallIntersect();
  17926. if (isIntersect) {
  17927. this.ui.moveNode.x = lastX;
  17928. this.ui.moveNode.y = lastY;
  17929. rootBall.gameObj.x = lastX;
  17930. rootBall.gameObj.y = lastY;
  17931. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17932. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17933. }
  17934. else {
  17935. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17936. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17937. }
  17938. this.showBallUI();
  17939. this.ui.moveNode.finger.visible = true;
  17940. xGame.common.d2World.getHelpLine();
  17941. break;
  17942. case PressType.rulerNode:
  17943. break;
  17944. case PressType.d2Root:
  17945. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17946. if (dis <= 25) {
  17947. this.moveToClickDot(e);
  17948. }
  17949. break;
  17950. default:
  17951. break;
  17952. }
  17953. this.pressTarget = -1;
  17954. }
  17955. checkGuide() {
  17956. let guide = DataMgr.getSkillGuide();
  17957. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17958. xGame.common.guideStep++;
  17959. xGame.common.gameUI.ui.guide2.visible = false;
  17960. xGame.common.gameUI.ui.guide3.visible = true;
  17961. }
  17962. }
  17963. finishGuide() {
  17964. let guide = DataMgr.getSkillGuide();
  17965. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17966. xGame.common.guideStep = 10;
  17967. this.closeAllGuide();
  17968. }
  17969. }
  17970. closeAllGuide() {
  17971. xGame.common.gameUI.ui.guide1.visible = false;
  17972. xGame.common.gameUI.ui.guide2.visible = false;
  17973. xGame.common.gameUI.ui.guide3.visible = false;
  17974. }
  17975. updateBarInfo() {
  17976. let star = this.ui.powerNode.y;
  17977. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17978. if (rate >= 1)
  17979. rate = 1;
  17980. if (rate <= 0)
  17981. rate = 0;
  17982. this.powerNum = Math.ceil(rate * 100);
  17983. this.ui.powerNode.value = this.powerNum;
  17984. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17985. this.ui.colorNode.value = this.powerNum;
  17986. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  17987. this.ui.powerEft.visible = this.powerNum != 0;
  17988. this.ui.colorNode.visible = this.powerNum != 0;
  17989. this.ui.powerTxt.text = this.powerNum + "";
  17990. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  17991. }
  17992. forceCancel() {
  17993. this.ui.powerNode.value = 0;
  17994. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17995. this.ui.powerTxt.text = "";
  17996. }
  17997. checkRodMoveDir() {
  17998. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  17999. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18000. if (tempX >= 0 && tempY <= 0) {
  18001. return this.checkDir();
  18002. }
  18003. else if (tempX < 0 && tempY < 0) {
  18004. return this.checkDir(1, -1);
  18005. }
  18006. else if (tempX < 0 && tempY > 0) {
  18007. return this.checkDir(-1, -1);
  18008. }
  18009. else {
  18010. return this.checkDir(-1, 1);
  18011. }
  18012. }
  18013. checkDir(flagX = 1, flagY = 1) {
  18014. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18015. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18016. if (offsetY == 0) {
  18017. return offsetX * flagX;
  18018. }
  18019. if (offsetX == 0) {
  18020. return offsetY * flagY;
  18021. }
  18022. let angle = offsetY / offsetX;
  18023. if (Math.abs(angle) >= 1) {
  18024. return offsetY * flagY;
  18025. }
  18026. else {
  18027. return offsetX * flagX;
  18028. }
  18029. }
  18030. judgeBallIntersect() {
  18031. let rootBall = xGame.common.d2World.rootBall;
  18032. let ballArr = xGame.common.d2World.ballArr;
  18033. let radius = rootBall.gameObj.width / 2;
  18034. let temp;
  18035. let isIntersect = false;
  18036. for (let index = 0; index < ballArr.length; index++) {
  18037. temp = ballArr[index];
  18038. if (temp.number == rootBall.number)
  18039. continue;
  18040. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18041. if (isIntersect) {
  18042. break;
  18043. }
  18044. }
  18045. return isIntersect;
  18046. }
  18047. hideBallUI() {
  18048. let d2Gan = xGame.common.d2World.d2Gan;
  18049. if (!d2Gan.ui.isDisposed)
  18050. d2Gan.ui.visible = false;
  18051. let d2Help = xGame.common.d2World.d2HelpLine;
  18052. if (!d2Help.ui.isDisposed)
  18053. d2Help.ui.visible = false;
  18054. let rootBall = xGame.common.d2World.rootBall;
  18055. if (!rootBall.destroyed) {
  18056. rootBall.gameObj.active = false;
  18057. }
  18058. }
  18059. showBallUI() {
  18060. let d2Gan = xGame.common.d2World.d2Gan;
  18061. if (!d2Gan.ui.isDisposed)
  18062. d2Gan.ui.visible = true;
  18063. let d2Help = xGame.common.d2World.d2HelpLine;
  18064. if (!d2Help.ui.isDisposed)
  18065. d2Help.ui.visible = true;
  18066. let rootBall = xGame.common.d2World.rootBall;
  18067. if (!rootBall.destroyed) {
  18068. rootBall.gameObj.active = true;
  18069. }
  18070. }
  18071. moveToClickDot(e) {
  18072. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18073. let root = xGame.common.d2World.rootBall.gameObj;
  18074. let xx = e.stageX - xGame.common.sysOffestNum;
  18075. let yy = e.stageY;
  18076. let x = xx - root.x;
  18077. let y = yy - root.y;
  18078. let angle = xGame.common.getfguiRotation(x, y);
  18079. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18080. xGame.common.d2World.getHelpLine();
  18081. }
  18082. this.isMoveRod = false;
  18083. xGame.common.clickedBall = false;
  18084. }
  18085. openAllEvent() {
  18086. this.closeAllEvent();
  18087. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18088. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18089. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18090. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18091. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18092. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18093. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18094. }
  18095. closeAllEvent() {
  18096. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18097. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18098. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18099. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18100. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18101. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18102. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18103. }
  18104. resetGame() {
  18105. this.closeAllEvent();
  18106. this.hideBallUI();
  18107. xGame.common.gameMgr.gamePause = true;
  18108. }
  18109. }
  18110. UIGame$1.uiName = "UIGame";
  18111. class UIAddCoin$1 extends UIBase {
  18112. constructor() {
  18113. super();
  18114. this.coinNum = 2000;
  18115. }
  18116. onConstructor() {
  18117. this.ui = ui_UIAddCoin.createInstance();
  18118. this.contentPane = this.ui;
  18119. this.isEject = false;
  18120. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18121. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18122. }
  18123. show() {
  18124. super.show();
  18125. this.ui.t0.play();
  18126. }
  18127. videoAddCoin() {
  18128. console.log('zh:qjff_AD_for_UIAddCoin');
  18129. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18130. }
  18131. else {
  18132. console.log('zh:AD 失败,直接发放奖励');
  18133. this.qjff_AD_for_UIAddCoin();
  18134. }
  18135. }
  18136. qjff_AD_for_UIAddCoin() {
  18137. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18138. this.hide();
  18139. }
  18140. }
  18141. UIAddCoin$1.uiName = "UIAddCoin";
  18142. class UIInvitation$1 extends UIBase {
  18143. constructor() {
  18144. super();
  18145. }
  18146. onConstructor() {
  18147. this.ui = ui_UIInvitation.createInstance();
  18148. this.contentPane = this.ui;
  18149. this.isEject = false;
  18150. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18151. }
  18152. show() {
  18153. super.show();
  18154. }
  18155. enterGame() {
  18156. xGame.common.gameMode = GameMode.classic;
  18157. DataMgr.setChallengeTimes(1);
  18158. xGame.common.passAwardCoin = 2000;
  18159. let need = xGame.common.classicNiceNeddCoin;
  18160. if (DataMgr.coinEnough(need)) {
  18161. DataMgr.setCoin(-need);
  18162. xGame.eventMgr.event(RESTART_GAME, true);
  18163. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18164. }
  18165. else {
  18166. xGame.eventMgr.event(RESTART_GAME, true);
  18167. }
  18168. this.hide();
  18169. }
  18170. hide() {
  18171. super.hide();
  18172. }
  18173. }
  18174. UIInvitation$1.uiName = "UIInvitation";
  18175. class UIPower$1 extends UIBase {
  18176. constructor() {
  18177. super();
  18178. }
  18179. onConstructor() {
  18180. this.ui = ui_UIPower.createInstance();
  18181. this.contentPane = this.ui;
  18182. this.isEject = false;
  18183. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18184. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18185. }
  18186. show() {
  18187. super.show();
  18188. this.ui.t0.play();
  18189. }
  18190. videoGetPower() {
  18191. console.log('zh:qjff_AD_for_uipower');
  18192. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18193. }
  18194. else {
  18195. console.log('zh:AD 失败,直接发放奖励');
  18196. this.qjff_AD_for_uipower();
  18197. }
  18198. }
  18199. qjff_AD_for_uipower() {
  18200. DataMgr.setPower(xGame.common.videoPower, true);
  18201. xGame.eventMgr.event(POWER_TIME);
  18202. this.hide();
  18203. }
  18204. }
  18205. UIPower$1.uiName = "UIPower";
  18206. class UIGameEnd$1 extends UIBase {
  18207. constructor() {
  18208. super();
  18209. this.success = false;
  18210. this.awardCoinNum = 1000;
  18211. this.awardDiamondNum = 10;
  18212. }
  18213. onConstructor() {
  18214. this.ui = ui_UIGameEnd.createInstance();
  18215. this.contentPane = this.ui;
  18216. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18217. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18218. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18219. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18220. this.ui.talkNode.visible = false;
  18221. if (Moyu.isKs)
  18222. this.ui.closeNode.closeBtn.x += 100;
  18223. }
  18224. updateType() {
  18225. switch (xGame.common.gameMode) {
  18226. case GameMode.classic:
  18227. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18228. this.ui.coinNode.visible = this.success;
  18229. if (!this.success) {
  18230. Laya.timer.once(500, this, () => {
  18231. xGame.uiMgr.Show(UIAddCoin$1);
  18232. });
  18233. }
  18234. this.ui.isGetAward.visible = false;
  18235. this.ui.leftBtn.c1.selectedIndex = 3;
  18236. this.ui.rightBtn.c1.selectedIndex = 0;
  18237. this.moneyNode.ui.c1.selectedIndex = 1;
  18238. break;
  18239. case GameMode.bigMove:
  18240. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18241. this.ui.coinNode.visible = this.success;
  18242. if (xGame.common.gameMode == GameMode.bigMove) {
  18243. if (this.success) {
  18244. DataMgr.setSkillSuccessTimes(1, true);
  18245. DataMgr.setSkillAccTimes(1);
  18246. }
  18247. else {
  18248. DataMgr.setSkillSuccessTimes(0, false);
  18249. }
  18250. }
  18251. if (!this.success) {
  18252. Laya.timer.once(500, this, () => {
  18253. xGame.uiMgr.Show(UIAddCoin$1);
  18254. });
  18255. }
  18256. this.ui.isGetAward.visible = false;
  18257. this.ui.leftBtn.c1.selectedIndex = 3;
  18258. this.ui.rightBtn.c1.selectedIndex = 0;
  18259. this.moneyNode.ui.c1.selectedIndex = 1;
  18260. break;
  18261. case GameMode.placeBall:
  18262. this.ui.coinNode.visible = false;
  18263. if (this.success) {
  18264. if (xGame.common.placeBallStarNum == 3) {
  18265. this.ui.c1.selectedIndex = 2;
  18266. }
  18267. else {
  18268. this.ui.c1.selectedIndex = 3;
  18269. }
  18270. }
  18271. else {
  18272. this.ui.c1.selectedIndex = 4;
  18273. }
  18274. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18275. if (cfg.type == PlaceBallType.challenge) {
  18276. this.ui.c1.selectedIndex = 2;
  18277. }
  18278. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18279. this.updatePlaceBallBtn();
  18280. this.updatePlaceBallStarNum();
  18281. this.updatePlaceBallAwardState();
  18282. this.moneyNode.ui.c1.selectedIndex = 2;
  18283. this.moneyNode.checkPowerTime();
  18284. this.moneyNode.powerChange();
  18285. DataMgr.upRankData();
  18286. break;
  18287. default:
  18288. break;
  18289. }
  18290. }
  18291. updatePlaceBallBtn() {
  18292. this.ui.leftBtn.c1.selectedIndex = 5;
  18293. if (this.success) {
  18294. this.ui.rightBtn.c1.selectedIndex = 14;
  18295. }
  18296. else {
  18297. if (xGame.common.placeBallStarNum == 3) {
  18298. this.ui.rightBtn.c1.selectedIndex = 14;
  18299. }
  18300. else {
  18301. this.ui.rightBtn.c1.selectedIndex = 1;
  18302. }
  18303. }
  18304. }
  18305. updatePlaceBallStarNum() {
  18306. let starNum = xGame.common.placeBallStarNum;
  18307. if (starNum == 0)
  18308. this.ui.starNumNode.c1.selectedIndex = 3;
  18309. else {
  18310. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18311. }
  18312. }
  18313. updatePlaceBallAwardState() {
  18314. let level = xGame.common.placeBallCurLevel;
  18315. let starNum = xGame.common.placeBallStarNum;
  18316. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18317. let data = cfgTable.placeballData[level].award;
  18318. let cfg = cfgTable.placeballData[level];
  18319. this.awardDiamondNum = data[1];
  18320. this.awardCoinNum = data[0];
  18321. if (cfg.type == PlaceBallType.challenge) {
  18322. this.awardDiamondNum = 0;
  18323. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18324. }
  18325. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18326. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18327. if (cfg.type == PlaceBallType.challenge) {
  18328. this.ui.awardNode.coinNode.visible = true;
  18329. }
  18330. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18331. this.ui.awardNode.diamondNode.x = 265;
  18332. this.ui.awardNode.coinNode.x = 354;
  18333. }
  18334. else {
  18335. this.ui.awardNode.diamondNode.x = 291;
  18336. this.ui.awardNode.coinNode.x = 291;
  18337. }
  18338. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18339. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18340. if (this.awardCoinNum == 0) {
  18341. this.ui.awardNode.coinNode.numTxt.text = "";
  18342. }
  18343. if (getAward) {
  18344. this.ui.isGetAward.visible = true;
  18345. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18346. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18347. }
  18348. else {
  18349. this.ui.isGetAward.visible = false;
  18350. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18351. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18352. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18353. }
  18354. else {
  18355. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18356. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18357. }
  18358. }
  18359. }
  18360. show(success) {
  18361. super.show();
  18362. xGame.eventMgr.event(RESET_GAME);
  18363. this.success = success;
  18364. Laya.timer.clearAll(this);
  18365. this.playSecretaryAni();
  18366. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18367. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18368. offsetTime = Math.floor(offsetTime / 1000);
  18369. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18370. this.updateType();
  18371. Laya.timer.once(200, this, () => {
  18372. this.addAward(() => {
  18373. this.updateType();
  18374. Laya.timer.once(500, this, () => {
  18375. this.showChallengeLevel();
  18376. });
  18377. });
  18378. });
  18379. if (this.success) {
  18380. xGame.soundMgr.playSound('slots_roll01');
  18381. xGame.soundMgr.playSound("s_win");
  18382. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18383. }
  18384. else {
  18385. xGame.soundMgr.playSound('matchwin01');
  18386. xGame.soundMgr.playSound("s_lose");
  18387. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18388. }
  18389. if (!Moyu.isLegal)
  18390. PlatMgr.showBanner(true);
  18391. let challengeNum = DataMgr.getChallengeTimes();
  18392. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18393. DataMgr.setChallengeTimes(1);
  18394. }
  18395. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18396. DataMgr.setClassicTimes();
  18397. }
  18398. }
  18399. showChallengeLevel() {
  18400. if (DataMgr.getChallengeTimes() != 0)
  18401. return;
  18402. let skill = DataMgr.getSkillAccTimes();
  18403. let put = DataMgr.getPlaceBallLevelList().length;
  18404. if (skill >= 3 || put >= 5) {
  18405. xGame.uiMgr.Show(UIInvitation$1);
  18406. this.hide();
  18407. }
  18408. }
  18409. addAward(callback) {
  18410. if (!this.success) {
  18411. callback && callback();
  18412. return;
  18413. }
  18414. switch (xGame.common.gameMode) {
  18415. case GameMode.classic:
  18416. this.awardCoinNum = xGame.common.passAwardCoin;
  18417. this.awardDiamondNum = 0;
  18418. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18419. break;
  18420. case GameMode.bigMove:
  18421. this.awardCoinNum = xGame.common.passAwardCoin;
  18422. this.awardDiamondNum = 0;
  18423. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18424. callback && callback();
  18425. break;
  18426. case GameMode.placeBall:
  18427. let level = xGame.common.placeBallCurLevel;
  18428. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18429. if (xGame.common.placeBallStarNum != 3) {
  18430. callback && callback();
  18431. return;
  18432. }
  18433. else {
  18434. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18435. if (getAward) {
  18436. callback && callback();
  18437. return;
  18438. }
  18439. }
  18440. let cfg = cfgTable.placeballData[level];
  18441. let data = cfgTable.placeballData[level].award;
  18442. this.awardCoinNum = data[0];
  18443. this.awardDiamondNum = data[1];
  18444. if (cfg.type == PlaceBallType.challenge) {
  18445. this.awardDiamondNum = 0;
  18446. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18447. }
  18448. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18449. let diamondAward;
  18450. if (this.awardDiamondNum > 0) {
  18451. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18452. xGame.common.getAward([diamondAward, coinAward], callback);
  18453. }
  18454. else {
  18455. xGame.common.getAward([coinAward], callback);
  18456. }
  18457. if (cfg.type == PlaceBallType.normal) {
  18458. DataMgr.setPlaceBallAward(level);
  18459. }
  18460. break;
  18461. default:
  18462. break;
  18463. }
  18464. }
  18465. playSecretaryAni_old() {
  18466. let parent = this.ui.secretary.displayObject;
  18467. parent.destroyChildren();
  18468. let xx = this.ui.secretary.width / 2;
  18469. let yy = this.ui.secretary.height;
  18470. let scale = xGame.common.getSecretaryScale();
  18471. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18472. if (this.success) {
  18473. let rand = Math.random() <= 0.5 ? 2 : 3;
  18474. xGame.common.secretary.play(data, rand, false, parent, () => {
  18475. xGame.common.secretary.play(data, 1, true, parent);
  18476. });
  18477. }
  18478. else {
  18479. xGame.common.secretary.play(data, 0, true, parent);
  18480. }
  18481. }
  18482. playSecretaryAni() {
  18483. let parent = this.ui.secretary.displayObject;
  18484. parent.destroyChildren();
  18485. let xx = this.ui.secretary.width / 2;
  18486. let yy = this.ui.secretary.height;
  18487. let scale = xGame.common.getSecretaryScale();
  18488. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18489. if (this.success) {
  18490. let rand = 0;
  18491. xGame.common.secretary.play(data, 0, true, parent);
  18492. }
  18493. else {
  18494. xGame.common.secretary.play(data, 0, true, parent);
  18495. }
  18496. }
  18497. restartGame() {
  18498. switch (xGame.common.gameMode) {
  18499. case GameMode.classic:
  18500. xGame.eventMgr.event(RESTART_GAME);
  18501. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18502. break;
  18503. case GameMode.bigMove:
  18504. this.hide();
  18505. xGame.eventMgr.event(RESTART_GAME);
  18506. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18507. break;
  18508. default:
  18509. break;
  18510. }
  18511. }
  18512. hide() {
  18513. super.hide();
  18514. xGame.common.stopGirlPop(this.ui.talkNode);
  18515. PlatMgr.showBanner(false);
  18516. }
  18517. returnHome() {
  18518. this.hide();
  18519. let showFailWords = !this.success;
  18520. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18521. }
  18522. clickLeftBtn() {
  18523. switch (xGame.common.gameMode) {
  18524. case GameMode.classic:
  18525. case GameMode.bigMove:
  18526. this.returnHome();
  18527. break;
  18528. case GameMode.placeBall:
  18529. let level = xGame.common.placeBallCurLevel;
  18530. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18531. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18532. break;
  18533. default:
  18534. break;
  18535. }
  18536. }
  18537. powerStartPlaceBallLevel(level, btn) {
  18538. if (DataMgr.powerEnough()) {
  18539. btn.touchable = false;
  18540. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18541. btn.touchable = true;
  18542. DataMgr.setPower(-1);
  18543. xGame.eventMgr.event(POWER_TIME);
  18544. this.startPlaceBallLevel(level);
  18545. }));
  18546. }
  18547. else {
  18548. xGame.uiMgr.Show(UIPower$1, 0);
  18549. }
  18550. }
  18551. clickRightBtn() {
  18552. switch (xGame.common.gameMode) {
  18553. case GameMode.classic:
  18554. console.log('zh:clickRightBtn 111');
  18555. case GameMode.bigMove:
  18556. console.log('zh:clickRightBtn 222');
  18557. this.restartGame();
  18558. break;
  18559. case GameMode.placeBall:
  18560. console.log('zh:clickRightBtn 333');
  18561. let level = xGame.common.placeBallCurLevel;
  18562. let data = DataMgr.getPlaceBallLevel(level);
  18563. let curPss = data.play && !data.isCur;
  18564. if (curPss) {
  18565. console.log('zh:clickRightBtn 333-111');
  18566. console.log('zh:当前LV=' + level);
  18567. if (level == 60) {
  18568. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18569. Laya.timer.once(3000, this, () => {
  18570. this.returnHome();
  18571. });
  18572. }
  18573. else {
  18574. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18575. }
  18576. }
  18577. else {
  18578. console.log('zh:clickRightBtn 333-000');
  18579. Moyu.sendDataEvent("placeBallNextLevel");
  18580. console.log('zh:qjff_AD_for_uiGameEnd');
  18581. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18582. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18583. }
  18584. else {
  18585. console.log('zh:AD 失败,直接发放奖励');
  18586. this.qjff_AD_for_uiGameEnd(level);
  18587. }
  18588. }
  18589. break;
  18590. default:
  18591. console.log('zh:clickRightBtn 444');
  18592. break;
  18593. }
  18594. }
  18595. qjff_AD_for_uiGameEnd(level) {
  18596. DataMgr.setPlaceBallLevel(level, 1);
  18597. this.startPlaceBallLevel(level + 1);
  18598. }
  18599. startPlaceBallLevel(level) {
  18600. xGame.common.gameMode = GameMode.placeBall;
  18601. xGame.common.placeBallCurLevel = level;
  18602. xGame.uiMgr.Show(UIGame$1);
  18603. this.hide();
  18604. }
  18605. }
  18606. UIGameEnd$1.uiName = "UIGameEnd";
  18607. class ShowItem$1 {
  18608. constructor() {
  18609. this.ui = ui_ShowItem.createInstance();
  18610. }
  18611. destroySelf() {
  18612. if (!this.ui.isDisposed) {
  18613. this.ui.removeFromParent();
  18614. this.ui.dispose();
  18615. }
  18616. }
  18617. setParent(parent) {
  18618. parent.addChild(this.ui);
  18619. }
  18620. setPos(x, y) {
  18621. this.ui.x = x;
  18622. this.ui.y = y;
  18623. }
  18624. setUrl(index) {
  18625. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18626. }
  18627. }
  18628. class UILevelProp$1 extends UIBase {
  18629. constructor() {
  18630. super();
  18631. this.firstPos = 385;
  18632. this.secondPos = 467;
  18633. this.showItemArr = [];
  18634. }
  18635. onFontLoaded() {
  18636. try {
  18637. this.ui.myNode.conditionTxt.font = "arial";
  18638. console.log("zh: onFontLoaded 设置arial字体成功");
  18639. }
  18640. catch (error) {
  18641. console.log("zh: constructor onFontLoaded加载arial字体失败");
  18642. }
  18643. }
  18644. onConstructor() {
  18645. this.ui = ui_UILevelProp.createInstance();
  18646. this.contentPane = this.ui;
  18647. this.isEject = false;
  18648. this.addUIClick(this.ui.closeBtn, this.hide);
  18649. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18650. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18651. }
  18652. show(level) {
  18653. super.show();
  18654. this.ui.t1.play();
  18655. this.level = level;
  18656. this.data = cfgTable.placeballData[this.level];
  18657. this.updateSelf();
  18658. this.showPreView();
  18659. this.moneyNode.ui.c1.selectedIndex = 2;
  18660. this.moneyNode.checkPowerTime();
  18661. this.moneyNode.powerChange();
  18662. }
  18663. showPreView() {
  18664. let item;
  18665. let data;
  18666. for (let index = 0; index < this.showItemArr.length; index++) {
  18667. item = this.showItemArr[index];
  18668. item.destroySelf();
  18669. }
  18670. this.showItemArr = [];
  18671. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18672. for (const key in cfgData) {
  18673. data = cfgData[key];
  18674. item = new ShowItem$1();
  18675. item.setParent(this.ui.myNode.displayRoot);
  18676. item.setPos(data.x, data.y);
  18677. item.setUrl(data.value);
  18678. this.showItemArr.push(item);
  18679. }
  18680. }
  18681. updateSelf() {
  18682. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18683. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18684. if (this.data.ball == -1) {
  18685. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18686. }
  18687. else {
  18688. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  18689. }
  18690. let localData = DataMgr.getPlaceBallLevel(this.level);
  18691. let getAward = localData.getAward;
  18692. let cfg = cfgTable.placeballData[this.level];
  18693. let coin = this.data.award[0];
  18694. let diamond = this.data.award[1];
  18695. if (cfg.type == PlaceBallType.challenge) {
  18696. diamond = 0;
  18697. coin = 100;
  18698. }
  18699. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18700. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18701. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18702. if (cfg.type == PlaceBallType.challenge) {
  18703. this.ui.myNode.coinNode.numTxt.text = "";
  18704. }
  18705. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18706. if (coin > 0 && diamond > 0) {
  18707. this.ui.myNode.diamondNode.x = 385;
  18708. this.ui.myNode.coinNode.x = 467;
  18709. }
  18710. else {
  18711. this.ui.myNode.diamondNode.x = 385;
  18712. this.ui.myNode.coinNode.x = 385;
  18713. }
  18714. if (!getAward) {
  18715. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18716. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18717. }
  18718. else {
  18719. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18720. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18721. }
  18722. }
  18723. startGame() {
  18724. if (DataMgr.powerEnough()) {
  18725. this.ui.myNode.startBtn.touchable = false;
  18726. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18727. console.log('zh:startGame ');
  18728. this.ui.myNode.startBtn.touchable = true;
  18729. DataMgr.setPower(-1);
  18730. xGame.eventMgr.event(POWER_TIME);
  18731. xGame.common.gameMode = GameMode.placeBall;
  18732. xGame.common.placeBallCurLevel = this.level;
  18733. xGame.uiMgr.Show(UIGame$1);
  18734. xGame.uiMgr.Hide(UILevelDisplay$1);
  18735. xGame.uiMgr.Hide(UIMain$1);
  18736. this.hide();
  18737. }));
  18738. }
  18739. else {
  18740. console.log('zh:startGame no power');
  18741. xGame.uiMgr.Show(UIPower$1);
  18742. }
  18743. }
  18744. hide() {
  18745. super.hide();
  18746. }
  18747. }
  18748. UILevelProp$1.uiName = "UILevelProp";
  18749. class PutBallLevelDisplay$1 {
  18750. constructor(ui, index) {
  18751. this.index = 0;
  18752. this.ui = ui;
  18753. this.index = index;
  18754. this.ui.onClick(this, this.clickSelf);
  18755. this.updateSelf();
  18756. this.ui.levelTxt.text = (this.index + 1) + "";
  18757. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18758. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18759. }
  18760. updateSelf() {
  18761. let level = this.index + 1;
  18762. this.data = DataMgr.getPlaceBallLevel(level);
  18763. this.ui.starNode.c1.selectedIndex = this.data.star;
  18764. let isChallenge = cfgTable.placeballData[level].type;
  18765. if (this.data.isCur) {
  18766. if (isChallenge) {
  18767. this.ui.c1.selectedIndex = 5;
  18768. }
  18769. else {
  18770. this.ui.c1.selectedIndex = 2;
  18771. }
  18772. }
  18773. else {
  18774. if (this.data.play) {
  18775. if (this.data.star == 3) {
  18776. this.ui.c1.selectedIndex = 0;
  18777. }
  18778. else {
  18779. this.ui.c1.selectedIndex = 1;
  18780. }
  18781. }
  18782. else {
  18783. if (isChallenge) {
  18784. this.ui.c1.selectedIndex = 4;
  18785. }
  18786. else {
  18787. this.ui.c1.selectedIndex = 3;
  18788. }
  18789. }
  18790. }
  18791. }
  18792. clickSelf() {
  18793. if (!this.data.play)
  18794. return;
  18795. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18796. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18797. }
  18798. }
  18799. class UILevelDisplay$1 extends UIBase {
  18800. constructor() {
  18801. super();
  18802. }
  18803. onConstructor() {
  18804. this.ui = ui_UILevelDisplay.createInstance();
  18805. this.contentPane = this.ui;
  18806. this.isEject = false;
  18807. this.myList = this.ui.myNode.myList;
  18808. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18809. this.levelItemArr = [];
  18810. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18811. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18812. this.myList.numItems = levelNum;
  18813. if (Moyu.isKs)
  18814. this.ui.closeNode.closeBtn.x += 100;
  18815. }
  18816. levelItemRender(index, target) {
  18817. let item = new PutBallLevelDisplay$1(target, index);
  18818. this.levelItemArr.push(item);
  18819. }
  18820. show() {
  18821. super.show();
  18822. this.updateLevel();
  18823. this.scrollToPlace();
  18824. }
  18825. updateLevel() {
  18826. let temp;
  18827. for (let index = 0; index < this.levelItemArr.length; index++) {
  18828. temp = this.levelItemArr[index];
  18829. temp.updateSelf();
  18830. }
  18831. }
  18832. scrollToPlace() {
  18833. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18834. let passArr = DataMgr.getPlaceBallLevelList();
  18835. let offest = passArr.length;
  18836. if (offest >= maxNum - 1)
  18837. offest = maxNum - 1;
  18838. this.myList.scrollToView(offest, true, true);
  18839. }
  18840. hide() {
  18841. super.hide();
  18842. }
  18843. }
  18844. UILevelDisplay$1.uiName = "UILevelDisplay";
  18845. class UIMatching$1 extends UIBase {
  18846. constructor() {
  18847. super();
  18848. }
  18849. onConstructor() {
  18850. this.ui = ui_UIMatching.createInstance();
  18851. this.contentPane = this.ui;
  18852. this.isEject = false;
  18853. }
  18854. show(callback) {
  18855. super.show();
  18856. PlatMgr.showBanner(true);
  18857. this.callback = callback;
  18858. let user = Moyu.getUserInfo();
  18859. if (!this.selfPot) {
  18860. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18861. }
  18862. if (!this.aiPot) {
  18863. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18864. }
  18865. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18866. this.ui.selfHead.nameTxt.text = user.nickName;
  18867. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18868. this.ui.aiHead.nameTxt.text = "???";
  18869. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18870. this.ui.selfHead.c1.selectedIndex = 0;
  18871. this.ui.aiHead.c1.selectedIndex = 0;
  18872. this.ui.selfHead.x = this.selfPot.x;
  18873. this.ui.selfHead.y = this.selfPot.y;
  18874. this.ui.aiHead.x = this.aiPot.x;
  18875. this.ui.aiHead.y = this.aiPot.y;
  18876. switch (xGame.common.gameMode) {
  18877. case GameMode.classic:
  18878. break;
  18879. case GameMode.bigMove:
  18880. this.initSkillData();
  18881. break;
  18882. default:
  18883. break;
  18884. }
  18885. this.ui.t1.play(Laya.Handler.create(this, () => {
  18886. this.ui.t2.play(Laya.Handler.create(this, () => {
  18887. switch (xGame.common.gameMode) {
  18888. case GameMode.classic:
  18889. this.waitingPeople();
  18890. break;
  18891. case GameMode.bigMove:
  18892. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18893. break;
  18894. default:
  18895. break;
  18896. }
  18897. }));
  18898. }));
  18899. }
  18900. initSkillData() {
  18901. this.skillSelectData = [];
  18902. let skillUrl = xGame.common.skillIconList;
  18903. let skillName = xGame.common.skillNameList;
  18904. let skillLevel = DataMgr.getBigSkillList();
  18905. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18906. for (let index = 0; index < 5; index++) {
  18907. let obj = {};
  18908. obj.skillImg = skillUrl[index];
  18909. obj.skillName = skillName[index];
  18910. obj.skillType = skillType[index];
  18911. obj.skillLevel = skillLevel[index];
  18912. this.skillSelectData.push(obj);
  18913. }
  18914. }
  18915. getAISkillLevel(myLevel) {
  18916. let video = xGame.common.upSkillLevel;
  18917. let aiLevel;
  18918. let temp;
  18919. if (video) {
  18920. temp = xGame.common.randomNum(-2, -1);
  18921. }
  18922. else {
  18923. if (myLevel <= 5) {
  18924. temp = xGame.common.randomNum(1, 3);
  18925. }
  18926. else if (myLevel <= 9) {
  18927. temp = xGame.common.randomNum(-2, 1);
  18928. }
  18929. else {
  18930. temp = xGame.common.randomNum(-4, 0);
  18931. }
  18932. }
  18933. aiLevel = temp + myLevel;
  18934. if (aiLevel <= 1)
  18935. aiLevel = 1;
  18936. if (aiLevel >= 10)
  18937. aiLevel = 10;
  18938. return aiLevel;
  18939. }
  18940. getAISkillType() {
  18941. return xGame.common.randomNum(1, 4);
  18942. let successTimes = DataMgr.getSkillSuccessTimes();
  18943. let info = cfgTable.aiskillData[successTimes];
  18944. if (!info) {
  18945. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18946. info = cfgTable.aiskillData[max];
  18947. }
  18948. let dataArr = info.skillselect;
  18949. let myCfg = {};
  18950. for (let index = 0; index < dataArr.length; index++) {
  18951. let temp = dataArr[index].split('-');
  18952. myCfg[temp[0]] = {};
  18953. myCfg[temp[0]].id = parseInt(temp[0]);
  18954. myCfg[temp[0]].weight = parseInt(temp[1]);
  18955. }
  18956. let aiCfg = xGame.common.initWeight(myCfg);
  18957. let curData = xGame.common.getRandomWeightData(aiCfg);
  18958. return parseInt(curData.id);
  18959. }
  18960. getAISkillData(index) {
  18961. let myLevel = this.skillSelectData[index].skillLevel;
  18962. let aiLevel = this.getAISkillLevel(myLevel);
  18963. let aiType = this.getAISkillType() - 1;
  18964. return { aiLevel, aiType } = { aiLevel, aiType };
  18965. }
  18966. skillSelectFinish(index) {
  18967. let aiInfo = this.getAISkillData(index);
  18968. xGame.common.gameMgr.selfCurSkill = index;
  18969. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18970. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18971. this.ui.selfHead.c1.selectedIndex = 1;
  18972. this.ui.aiHead.c1.selectedIndex = 1;
  18973. let myData = this.skillSelectData[index];
  18974. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18975. let guide = DataMgr.getSkillGuide();
  18976. if (guide == 0) {
  18977. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18978. }
  18979. else {
  18980. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18981. }
  18982. let aiData = this.skillSelectData[aiInfo.aiType];
  18983. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18984. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18985. this.waitingPeople();
  18986. }
  18987. waitingPeople() {
  18988. let time = xGame.common.randomNum(1000, 3000);
  18989. time += 1000;
  18990. Laya.timer.once(time, this, () => {
  18991. this.matchingSuccess();
  18992. });
  18993. }
  18994. matchingSuccess() {
  18995. let gameUI = xGame.common.gameUI;
  18996. let name = gameUI.ui.topNode.aiNameTxt.text;
  18997. let url = gameUI.ui.topNode.aiHeadLoader.url;
  18998. this.ui.aiHead.nameTxt.text = name;
  18999. this.ui.aiHead.headImg.url = url;
  19000. name = gameUI.ui.topNode.selfNameTxt.text;
  19001. url = gameUI.ui.topNode.selfHeadLoader.url;
  19002. this.ui.selfHead.nameTxt.text = name;
  19003. this.ui.selfHead.headImg.url = url;
  19004. this.ui.t3.play(Laya.Handler.create(this, () => {
  19005. this.callback && this.callback();
  19006. this.ui.t4.play(Laya.Handler.create(this, () => {
  19007. this.destroySelf();
  19008. }));
  19009. }));
  19010. }
  19011. destroySelf() {
  19012. this.callback = null;
  19013. this.skillSelectData = null;
  19014. this.selfPot = null;
  19015. this.aiPot = null;
  19016. if (!this.ui.isDisposed) {
  19017. this.ui.removeFromParent();
  19018. this.ui.dispose();
  19019. }
  19020. xGame.uiMgr.destroyUI(this);
  19021. }
  19022. }
  19023. UIMatching$1.uiName = "UIMatching";
  19024. class SkillDisplay$1 {
  19025. constructor(ui, data, uiIndex) {
  19026. this.starX = 0;
  19027. this.starY = 0;
  19028. this.index = 0;
  19029. this.ui = ui;
  19030. this.data = data;
  19031. this.index = uiIndex;
  19032. this.initSelf();
  19033. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19034. }
  19035. initSelf() {
  19036. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19037. this.ui.nameTxt.text = this.data.name;
  19038. this.ui.describeTxt.text = this.data.describe;
  19039. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19040. this.ui.startBtn.onClick(this, this.startGame);
  19041. this.updateSelf();
  19042. }
  19043. updateSelf() {
  19044. this.checkTry();
  19045. let level = DataMgr.getBigSkillByIndex(this.index);
  19046. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19047. }
  19048. checkTry() {
  19049. let index = this.index;
  19050. let level = DataMgr.getBigSkillByIndex(index);
  19051. if (level == null) {
  19052. DataMgr.setBigSkill(index, 1, false);
  19053. level = 1;
  19054. }
  19055. this.ui.levelTxt.text = "LV." + level;
  19056. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19057. this.ui.tryNode.visible = true;
  19058. else
  19059. this.ui.tryNode.visible = false;
  19060. }
  19061. clickAddLevel() {
  19062. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19063. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19064. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19065. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19066. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19067. }
  19068. else {
  19069. console.log('zh:AD 失败,直接发放奖励');
  19070. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19071. }
  19072. }
  19073. qjff_AD_for_skilldisplay_clickAddLevel() {
  19074. DataMgr.setBigSkill(this.data.index, 1);
  19075. this.updateSelf();
  19076. xGame.common.upSkillLevel = true;
  19077. }
  19078. startGame() {
  19079. if (this.data.index == 3) {
  19080. alert('Coming soon!');
  19081. return;
  19082. }
  19083. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19084. let needCoin = xGame.common.bigMoveNeedCoin;
  19085. xGame.common.passAwardCoin = 2000;
  19086. let guide = DataMgr.getSkillGuide();
  19087. console.log('zh:startGame guide=' + guide);
  19088. xGame.common.temSelfLevel = 0;
  19089. if (guide == 0) {
  19090. needCoin = 0;
  19091. xGame.common.temSelfLevel = 100;
  19092. }
  19093. if (DataMgr.coinEnough(needCoin)) {
  19094. DataMgr.setCoin(-needCoin);
  19095. xGame.common.curPlayerSkillType = this.index;
  19096. if (guide == 0)
  19097. xGame.common.curPlayerSkillType = 0;
  19098. xGame.uiMgr.Show(UIGame$1);
  19099. xGame.uiMgr.Hide(UIMain$1);
  19100. xGame.uiMgr.Show(UIMatching$1, () => {
  19101. xGame.common.gameUI.ui.alpha = 1;
  19102. xGame.common.gameUI.startGame();
  19103. xGame.uiMgr.Hide(UISkill$1);
  19104. });
  19105. }
  19106. else {
  19107. xGame.uiMgr.Show(UIAddProp$1, 0);
  19108. Moyu.sendDataEvent("AddCoinVideo");
  19109. }
  19110. }
  19111. }
  19112. class UISkill$1 extends UIBase {
  19113. constructor() {
  19114. super();
  19115. this.skillData = [];
  19116. }
  19117. onConstructor() {
  19118. this.ui = ui_UISkill.createInstance();
  19119. this.contentPane = this.ui;
  19120. this.isEject = false;
  19121. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19122. this.initSkillData();
  19123. console.log('zh:aaaaaa1111111111');
  19124. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19125. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19126. console.log('zh:aaaaaa22222222');
  19127. this.displayList = [];
  19128. this.ui.skillNode.skillList.numItems = 3;
  19129. this.addUIClick(this.ui, this.interuptSecretary);
  19130. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19131. this.ui.talkNode.visible = false;
  19132. if (Moyu.isKs)
  19133. this.ui.closeNode.closeBtn.x += 100;
  19134. }
  19135. show() {
  19136. super.show();
  19137. this.playSecretaryIdle();
  19138. this.moneyNode.ui.c1.selectedIndex = 1;
  19139. Laya.timer.clearAll(this);
  19140. xGame.soundMgr.playSound("s_start");
  19141. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19142. let guide = DataMgr.getSkillGuide();
  19143. this.ui.guideNode.visible = guide == 0;
  19144. let item = this.getSkillItemByUIIndex(0);
  19145. if (guide == 0) {
  19146. item.ui.c1.selectedIndex = 1;
  19147. }
  19148. else {
  19149. item.ui.c1.selectedIndex = 0;
  19150. }
  19151. this.ui.guideNode.guideBtn.visible = guide == 0;
  19152. for (let index = 0; index < this.displayList.length; index++) {
  19153. this.displayList[index].checkTry();
  19154. }
  19155. }
  19156. getSkillItemByUIIndex(cur) {
  19157. for (let index = 0; index < this.displayList.length; index++) {
  19158. if (this.displayList[index].index == cur) {
  19159. return this.displayList[index];
  19160. }
  19161. }
  19162. }
  19163. enterGuideLevel() {
  19164. let item = this.getSkillItemByUIIndex(0);
  19165. item.startGame();
  19166. if (DataMgr.getNewUser())
  19167. Moyu.sendDataEvent("gameStart1");
  19168. }
  19169. initSkillData() {
  19170. this.skillData = [];
  19171. let nameList = xGame.common.skillNameList;
  19172. let iconList = xGame.common.skillIconList;
  19173. let describeList = [
  19174. "Jump shot executed — ball bounced and pocketed an extra one!",
  19175. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  19176. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  19177. ];
  19178. console.log('zh:initSkillData 111111111');
  19179. let data;
  19180. for (let index = 0; index < nameList.length; index++) {
  19181. data = {};
  19182. data.name = nameList[index];
  19183. data.icon = iconList[index];
  19184. data.describe = describeList[index];
  19185. data.index = index;
  19186. this.skillData.push(data);
  19187. }
  19188. }
  19189. updateSkillItem(index, target) {
  19190. if (this.displayList[index] == null) {
  19191. let uiIndex;
  19192. switch (index) {
  19193. case 0:
  19194. uiIndex = 1;
  19195. break;
  19196. case 1:
  19197. uiIndex = 0;
  19198. break;
  19199. case 2:
  19200. uiIndex = 2;
  19201. break;
  19202. case 3:
  19203. uiIndex = 3;
  19204. break;
  19205. default:
  19206. break;
  19207. }
  19208. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19209. this.displayList.push(temp);
  19210. }
  19211. }
  19212. playSecretaryIdle() {
  19213. let parent = this.ui.secretary.displayObject;
  19214. parent.destroyChildren();
  19215. let xx = this.ui.secretary.width / 2;
  19216. let yy = this.ui.secretary.height;
  19217. let scale = xGame.common.getSecretaryScale();
  19218. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19219. xGame.common.secretary.play(data, 0, true, parent);
  19220. }
  19221. returnUIMain() {
  19222. this.hide();
  19223. xGame.common.stopGirlPop(this.ui.talkNode);
  19224. xGame.uiMgr.Show(UIMain$1);
  19225. }
  19226. interuptSecretary() {
  19227. Laya.timer.clearAll(this);
  19228. this.playSecretaryRandomSound();
  19229. }
  19230. playSecretaryRandomSound() {
  19231. if (this.isHide)
  19232. return;
  19233. let time = xGame.common.randomNum(45000, 60000);
  19234. Laya.timer.once(time, this, () => {
  19235. if (this.isHide)
  19236. return;
  19237. let index = xGame.common.randomNum(4, 7);
  19238. xGame.soundMgr.playSound("s_main0" + index);
  19239. let words = 1;
  19240. switch (index) {
  19241. case 4:
  19242. words = 5;
  19243. break;
  19244. case 5:
  19245. words = 3;
  19246. break;
  19247. case 6:
  19248. words = 6;
  19249. break;
  19250. case 7:
  19251. words = 7;
  19252. break;
  19253. default:
  19254. break;
  19255. }
  19256. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19257. this.playSecretaryRandomSound();
  19258. });
  19259. }
  19260. }
  19261. UISkill$1.uiName = "UISkill";
  19262. class UIAddProp$1 extends UIBase {
  19263. constructor() {
  19264. super();
  19265. this.curType = "";
  19266. }
  19267. onConstructor() {
  19268. this.ui = ui_UIAddProp.createInstance();
  19269. this.contentPane = this.ui;
  19270. this.isEject = false;
  19271. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19272. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19273. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19274. this.updateUI();
  19275. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19276. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19277. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19278. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19279. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19280. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19281. }
  19282. show(type) {
  19283. super.show();
  19284. this.curType = type == 0 ? "coin" : "diamond";
  19285. this.switchBtn("");
  19286. this.ui.t0.play();
  19287. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19288. PlatMgr.showInsert(true);
  19289. }
  19290. closeSelf() {
  19291. this.hide();
  19292. }
  19293. updateUI() {
  19294. let data = cfgTable.moneyData;
  19295. let temp;
  19296. let obj;
  19297. for (const key in data) {
  19298. temp = data[key];
  19299. obj = this.ui.myNode["node" + key];
  19300. if (parseInt(key) <= 2) {
  19301. obj.diamondTxt.text = "+" + temp.num;
  19302. }
  19303. else {
  19304. obj.coinTxt.text = temp.num;
  19305. obj.diamondTxt.text = temp.get.split('_')[1];
  19306. }
  19307. }
  19308. this.updateDiamondShare();
  19309. }
  19310. updateDiamondShare() {
  19311. let data = DataMgr.getShareDiamondTimes();
  19312. if (data >= xGame.common.maxShareDiamondTimes) {
  19313. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19314. this.ui.myNode.node1.touchable = false;
  19315. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19316. }
  19317. else {
  19318. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19319. this.ui.myNode.node1.touchable = true;
  19320. }
  19321. }
  19322. switchBtn(type) {
  19323. if (type == "")
  19324. type = this.curType;
  19325. else {
  19326. if (this.curType == type) {
  19327. return;
  19328. }
  19329. else {
  19330. this.curType = type;
  19331. }
  19332. }
  19333. if (type == "coin") {
  19334. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19335. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19336. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19337. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19338. this.ui.myNode.c1.selectedIndex = 0;
  19339. }
  19340. else {
  19341. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19342. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19343. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19344. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19345. this.ui.myNode.c1.selectedIndex = 1;
  19346. }
  19347. }
  19348. convertCoin(index) {
  19349. let data = cfgTable.moneyData[index];
  19350. let coinNum = data.num;
  19351. let str = data.get.split('_')[1];
  19352. let needDiamond = parseInt(str);
  19353. if (DataMgr.diamondEnough(needDiamond)) {
  19354. DataMgr.setDiamond(-needDiamond);
  19355. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19356. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19357. }
  19358. else {
  19359. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19360. this.switchBtn("diamond");
  19361. }
  19362. }
  19363. videoGetDiamond() {
  19364. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19365. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19366. }
  19367. else {
  19368. console.log('zh:AD 失败,直接发放奖励');
  19369. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19370. }
  19371. }
  19372. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19373. let num = cfgTable.moneyData[2].num;
  19374. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19375. this.closeSelf();
  19376. }
  19377. videoGetCoin() {
  19378. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19379. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19380. }
  19381. else {
  19382. console.log('zh:AD 失败,直接发放奖励');
  19383. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19384. }
  19385. }
  19386. qjff_AD_for_uiAddProp_videoGetCoin() {
  19387. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19388. this.closeSelf();
  19389. }
  19390. shareGetDiamond() {
  19391. let times = DataMgr.getShareDiamondTimes();
  19392. if (times >= xGame.common.maxShareDiamondTimes) {
  19393. console.log('zh: 233333333333 maxShareDiamondTimes');
  19394. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19395. }
  19396. else {
  19397. console.log('zh:33333333333333ad');
  19398. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  19399. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  19400. }
  19401. else {
  19402. console.log('zh:AD 失败,直接发放奖励');
  19403. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  19404. }
  19405. }
  19406. }
  19407. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19408. let diamond = xGame.common.randomNum(50, 100);
  19409. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19410. DataMgr.setShareDiamondTimes(1);
  19411. this.updateDiamondShare();
  19412. }
  19413. openPutBallView() {
  19414. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19415. let skill = xGame.uiMgr.getUI(UISkill$1);
  19416. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19417. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19418. if (end && !end.isHide) {
  19419. xGame.uiMgr.Hide(UIGameEnd$1);
  19420. xGame.uiMgr.Show(UIMain$1);
  19421. }
  19422. if (skill && !skill.isHide)
  19423. xGame.uiMgr.Hide(UISkill$1);
  19424. if (uigame && !uigame.isHide)
  19425. xGame.uiMgr.Hide(UIGame$1);
  19426. if (level && !level.isHide) {
  19427. }
  19428. else {
  19429. xGame.uiMgr.Show(UILevelDisplay$1);
  19430. }
  19431. this.closeSelf();
  19432. }
  19433. }
  19434. UIAddProp$1.uiName = "UIAddProp";
  19435. class MoneyNode$1 {
  19436. constructor(ui) {
  19437. this.leftTime = 0;
  19438. this.ui = ui;
  19439. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19440. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19441. this.ui.addPowerBtn.onClick(this, this.addPower);
  19442. this.ui.c1.selectedIndex = 1;
  19443. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19444. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19445. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19446. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19447. this.coinChange();
  19448. this.diamondChange();
  19449. this.powerChange();
  19450. }
  19451. addPower() {
  19452. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19453. xGame.uiMgr.Show(UIPower$1);
  19454. }
  19455. powerChange() {
  19456. let powerNum = DataMgr.getPower();
  19457. this.ui.powerTxt.text = powerNum + "";
  19458. }
  19459. checkPowerTime() {
  19460. let cur = new Date().getTime();
  19461. let last = DataMgr.getPowerTime();
  19462. if (last == 0) {
  19463. last = cur;
  19464. DataMgr.setPowerTime(cur);
  19465. }
  19466. let power = DataMgr.getPower();
  19467. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19468. Laya.timer.clearAll(this);
  19469. if (power >= xGame.common.natureMaxPower) {
  19470. this.ui.powerTimeTxt.text = "";
  19471. DataMgr.setPowerTime(cur);
  19472. return;
  19473. }
  19474. if (power + offset >= xGame.common.natureMaxPower) {
  19475. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19476. this.ui.powerTimeTxt.text = "";
  19477. DataMgr.setPowerTime(cur);
  19478. }
  19479. else {
  19480. if (offset > 0) {
  19481. DataMgr.setPower(offset);
  19482. DataMgr.setPowerTime(cur);
  19483. }
  19484. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19485. this.leftTime = xGame.common.powerRecoverNum - time;
  19486. if (this.leftTime <= 0)
  19487. this.leftTime = 0;
  19488. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19489. Laya.timer.loop(1000, this, this.updatePowerTime);
  19490. }
  19491. }
  19492. updatePowerTime() {
  19493. this.leftTime -= 1;
  19494. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19495. if (this.leftTime <= 0) {
  19496. this.checkPowerTime();
  19497. }
  19498. }
  19499. coinChange() {
  19500. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19501. }
  19502. diamondChange() {
  19503. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19504. }
  19505. addCoin() {
  19506. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19507. Moyu.sendDataEvent("AddCoinBtn");
  19508. xGame.uiMgr.Show(UIAddProp$1, 0);
  19509. }
  19510. addDiamond() {
  19511. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19512. Moyu.sendDataEvent("AddDiamondBtn");
  19513. xGame.uiMgr.Show(UIAddProp$1, 1);
  19514. }
  19515. }
  19516. class SettingNode$1 {
  19517. constructor(ui) {
  19518. this.showSetting = false;
  19519. this.openSound = true;
  19520. this.openShake = true;
  19521. this.ui = ui;
  19522. this.ui.soundBtn.onClick(this, this.switchSound);
  19523. this.ui.shakeBtn.onClick(this, this.switchShake);
  19524. this.ui.xyBtn.onClick(this, this.onXy);
  19525. this.ui.clickNode.onClick(this, this.changeSetting);
  19526. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19527. this.ui.xyBtn.visible = false;
  19528. this.ui.shakeBtn.visible = false;
  19529. }
  19530. changeSetting() {
  19531. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19532. this.showSetting = !this.showSetting;
  19533. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19534. }
  19535. switchSound() {
  19536. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19537. this.openSound = !this.openSound;
  19538. Moyu.onSetting(this.openSound, this.openShake);
  19539. xGame.soundMgr.onSetting(this.openSound);
  19540. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19541. }
  19542. switchShake() {
  19543. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19544. this.openShake = !this.openShake;
  19545. Moyu.onSetting(this.openSound, this.openShake);
  19546. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19547. }
  19548. onXy() {
  19549. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19550. MoyuMgr$1.showXy(1);
  19551. }
  19552. }
  19553. class UIDraw$1 extends UIBase {
  19554. constructor() {
  19555. super();
  19556. this.curKey = 0;
  19557. }
  19558. onConstructor() {
  19559. this.ui = ui_UIDraw.createInstance();
  19560. this.contentPane = this.ui;
  19561. this.isEject = false;
  19562. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19563. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19564. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19565. this.initDraw();
  19566. this.initUI();
  19567. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19568. if (Moyu.isKs)
  19569. this.ui.closeNode.closeBtn.x += 100;
  19570. }
  19571. show() {
  19572. super.show();
  19573. this.ui.t0.play();
  19574. this.playSecretaryIdle();
  19575. this.updateDraw();
  19576. this.checkFree();
  19577. if (PlatMgr.bannerDelay > 0) {
  19578. this.ui.closeNode.closeBtn.visible = false;
  19579. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19580. this.ui.closeNode.closeBtn.visible = true;
  19581. });
  19582. }
  19583. PlatMgr.showRateBanner();
  19584. }
  19585. hide() {
  19586. Laya.timer.clearAll(this);
  19587. super.hide();
  19588. }
  19589. checkFree() {
  19590. let isFree = DataMgr.getDailyfreeDrawTimes();
  19591. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19592. }
  19593. initDraw() {
  19594. this.drawObj = [];
  19595. let data = cfgTable.drawData;
  19596. let temp;
  19597. let weight = 0;
  19598. for (const key in data) {
  19599. temp = data[key];
  19600. weight += temp.weight;
  19601. this.drawObj.push(weight);
  19602. }
  19603. this.allWeight = weight;
  19604. }
  19605. initUI() {
  19606. let data = cfgTable.drawData;
  19607. let temp;
  19608. let img;
  19609. let txt;
  19610. for (const key in data) {
  19611. temp = data[key];
  19612. img = this.ui.myNode.rotNode["img" + key];
  19613. txt = this.ui.myNode.rotNode["txt" + key];
  19614. img.url = xGame.common.getGameIconUrl(temp.icon);
  19615. txt.visible = true;
  19616. if (temp.award > 2) {
  19617. img.rotation = 0;
  19618. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19619. }
  19620. else {
  19621. img.rotation = temp.rotation;
  19622. txt.text = temp.num;
  19623. }
  19624. }
  19625. }
  19626. getCurkey() {
  19627. let rand = Math.random() * this.allWeight;
  19628. let temp;
  19629. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19630. temp = this.drawObj[index];
  19631. if (index == 0) {
  19632. if (rand < temp) {
  19633. return index + 1;
  19634. }
  19635. }
  19636. else {
  19637. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19638. return index + 1;
  19639. }
  19640. }
  19641. }
  19642. return 2;
  19643. }
  19644. startDraw() {
  19645. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19646. if (freeTimes > 0) {
  19647. this.beginDraw();
  19648. DataMgr.setDailyfreeDrawTimes(0);
  19649. this.checkFree();
  19650. }
  19651. else {
  19652. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19653. }
  19654. else {
  19655. console.log('zh:AD 失败,直接发放奖励');
  19656. this.qjff_chouJiang();
  19657. }
  19658. }
  19659. }
  19660. qjff_chouJiang() {
  19661. this.beginDraw();
  19662. }
  19663. beginDraw() {
  19664. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19665. this.ui.drawBtn.touchable = false;
  19666. this.curKey = this.getCurkey();
  19667. console.log("当前key", this.curKey);
  19668. let cell = 60;
  19669. let lap = 3;
  19670. let angle = cell * (this.curKey - 1) + lap * 360;
  19671. let target = this.ui.myNode.rotNode;
  19672. target.rotation = 0;
  19673. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19674. console.log("旋转完成");
  19675. this.ui.drawBtn.touchable = true;
  19676. this.getAward();
  19677. }));
  19678. }
  19679. getAward() {
  19680. let data = cfgTable.drawData[this.curKey];
  19681. let temp = new AwardType();
  19682. temp.type = data.award;
  19683. temp.num = data.num;
  19684. xGame.common.getAward([temp], () => {
  19685. DataMgr.setDrawTimes(1);
  19686. this.updateDraw();
  19687. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19688. });
  19689. }
  19690. updateDraw() {
  19691. let drawTimes = DataMgr.getDrawTimes();
  19692. let awardTimes = DataMgr.getDrawAwardTimes();
  19693. if (Math.floor(drawTimes / 3) > awardTimes) {
  19694. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19695. this.ui.extraNode.boxBtn.touchable = true;
  19696. this.ui.extraNode.tipsTxt.text = "3/3";
  19697. this.ui.extraNode.barNode.width = 265;
  19698. this.getExtraAward();
  19699. }
  19700. else {
  19701. this.ui.extraNode.boxBtn.t0.stop();
  19702. this.ui.extraNode.boxBtn.touchable = false;
  19703. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19704. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19705. }
  19706. let data = cfgTable.drawData[1];
  19707. if (awardTimes == 0) {
  19708. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19709. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19710. this.ui.myNode.rotNode.img1.rotation = 0;
  19711. }
  19712. else {
  19713. let award = data.nextid;
  19714. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19715. this.ui.myNode.rotNode.txt1.text = award[1];
  19716. this.ui.myNode.rotNode.img1.rotation = 0;
  19717. }
  19718. }
  19719. getExtraAward() {
  19720. let drawTimes = DataMgr.getDrawTimes();
  19721. let awardTimes = DataMgr.getDrawAwardTimes();
  19722. let data = cfgTable.drawData[1];
  19723. let award = new AwardType();
  19724. if (awardTimes == 0) {
  19725. award.num = data.num;
  19726. award.type = data.award;
  19727. xGame.common.getAward([award], () => {
  19728. let all = Math.floor(drawTimes / 3);
  19729. DataMgr.setDrawAwardTimes(all);
  19730. this.updateDraw();
  19731. });
  19732. }
  19733. else {
  19734. award.num = parseInt(data.nextid[1]);
  19735. award.type = parseInt(data.nextid[0]);
  19736. xGame.common.getAward([award], () => {
  19737. let all = Math.floor(drawTimes / 3);
  19738. DataMgr.setDrawAwardTimes(all);
  19739. this.updateDraw();
  19740. });
  19741. }
  19742. }
  19743. closeSelf() {
  19744. this.hide();
  19745. }
  19746. playSecretaryIdle() {
  19747. let parent = this.ui.secretary.displayObject;
  19748. parent.destroyChildren();
  19749. let xx = this.ui.secretary.width / 2;
  19750. let yy = this.ui.secretary.height;
  19751. let scale = xGame.common.getSecretaryScale();
  19752. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19753. xGame.common.secretary.play(data, 0, true, parent);
  19754. }
  19755. }
  19756. UIDraw$1.uiName = "UIDraw";
  19757. class UIRanking$1 extends UIBase {
  19758. constructor() {
  19759. super();
  19760. this.showSelf = true;
  19761. this.rankType = 1;
  19762. this.rankList = [];
  19763. this.myIndex = 0;
  19764. this.myStar = 0;
  19765. }
  19766. onConstructor() {
  19767. this.ui = ui_UIRanking.createInstance();
  19768. this.contentPane = this.ui;
  19769. this.isEject = false;
  19770. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19771. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19772. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19773. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19774. this.ui.myNode.myList.setVirtual();
  19775. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19776. }
  19777. show() {
  19778. super.show();
  19779. this.myIndex = 51;
  19780. Moyu.getRankList({
  19781. rankId: xGame.common.curRankID,
  19782. type: MoyuRankType.total,
  19783. page: 1,
  19784. pageSize: 50,
  19785. }, this, this.updateItemData);
  19786. this.updateSelf();
  19787. let self = Moyu.getUserInfo();
  19788. if (!self.isAuth) {
  19789. Moyu.initUser(this, () => {
  19790. DataMgr.upRankData();
  19791. });
  19792. }
  19793. }
  19794. updateSelfItem() {
  19795. let self = Moyu.getUserInfo();
  19796. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19797. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19798. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19799. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19800. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19801. }
  19802. updateItemData(data) {
  19803. this.myStar = xGame.common.getAllStarNum();
  19804. if (this.rankList.length < 2) {
  19805. this.rankList = data;
  19806. let self = Moyu.getUserInfo();
  19807. for (let i = 0; i < data.length; i++) {
  19808. let data = this.rankList[i];
  19809. if (data.userId == self.userId) {
  19810. this.rankList.splice(i, 1);
  19811. break;
  19812. }
  19813. }
  19814. for (let i = 0; i < data.length; i++) {
  19815. let data = this.rankList[i];
  19816. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19817. this.myIndex = i + 1;
  19818. let user = { headIcon: self.headIcon, nickName: "myself" };
  19819. let ud = { user: user, data: {} };
  19820. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19821. if (Moyu.platType < 11) {
  19822. user.headIcon = self.headIcon;
  19823. user.nickName = self.nickName;
  19824. }
  19825. this.rankList.splice(i, 0, md);
  19826. break;
  19827. }
  19828. }
  19829. }
  19830. this.updateSelfItem();
  19831. this.ui.myNode.myList.numItems = this.rankList.length;
  19832. }
  19833. updateItemUI(index, obj) {
  19834. let data = this.rankList[index];
  19835. let userData = JSON.parse(data.userData).user;
  19836. obj.nameTxt.text = userData.nickName.toString();
  19837. obj.valueTxt.text = data.rankScore;
  19838. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19839. obj.rankTxt.text = index + 1;
  19840. switch (index) {
  19841. case 0:
  19842. this.setImg(obj, 1, 0, 0);
  19843. obj.rankTxt.color = "#FFC047";
  19844. break;
  19845. case 1:
  19846. this.setImg(obj, 0, 1, 0);
  19847. obj.rankTxt.color = "#ACACAC";
  19848. break;
  19849. case 2:
  19850. this.setImg(obj, 0, 0, 1);
  19851. obj.rankTxt.color = "#D09672";
  19852. break;
  19853. default:
  19854. this.setImg(obj, 0, 0, 0);
  19855. obj.rankTxt.color = "#496FAB";
  19856. break;
  19857. }
  19858. }
  19859. setImg(obj, a, b, c) {
  19860. obj.img1.visible = a ? true : false;
  19861. obj.img2.visible = b ? true : false;
  19862. obj.img3.visible = c ? true : false;
  19863. }
  19864. changeList(type) {
  19865. this.rankType = type;
  19866. this.updateSelf();
  19867. }
  19868. changeSelfNode() {
  19869. this.showSelf = !this.showSelf;
  19870. this.updateSelf();
  19871. }
  19872. updateSelf() {
  19873. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19874. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19875. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19876. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19877. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19878. }
  19879. }
  19880. UIRanking$1.uiName = "UIRanking";
  19881. class UISecretary$1 extends UIBase {
  19882. constructor() {
  19883. super();
  19884. this.curIndex = 1;
  19885. }
  19886. onConstructor() {
  19887. this.ui = ui_UISecretary.createInstance();
  19888. this.contentPane = this.ui;
  19889. this.isEject = false;
  19890. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19891. this.nodeObj = { left: null, right: null, cur: null };
  19892. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19893. }
  19894. show() {
  19895. super.show();
  19896. this.ui.t0.play();
  19897. this.updateData();
  19898. }
  19899. addSecretarySpine(node, spineName) {
  19900. if (spineName == "mishu") {
  19901. if (this.secretarySpine1) {
  19902. node.displayObject.destroyChildren();
  19903. this.playWoman(this.secretarySpine1, node.displayObject);
  19904. }
  19905. else {
  19906. let spine1 = new SpineMgr("mishu", () => {
  19907. this.secretarySpine1 = spine1;
  19908. this.playWoman(this.secretarySpine1, node.displayObject);
  19909. });
  19910. }
  19911. }
  19912. else {
  19913. if (this.secretarySpine2) {
  19914. node.displayObject.destroyChildren();
  19915. this.playWoman(this.secretarySpine2, node.displayObject);
  19916. }
  19917. else {
  19918. let spine2 = new SpineMgr("xiaomishu2", () => {
  19919. this.secretarySpine2 = spine2;
  19920. this.playWoman(this.secretarySpine2, node.displayObject);
  19921. });
  19922. }
  19923. }
  19924. }
  19925. playWoman(node, parent) {
  19926. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19927. let yy = this.ui.myNode.gameNode3.secretary.height;
  19928. let scale = 1.5;
  19929. if (node == this.secretarySpine2) {
  19930. scale = 1.2;
  19931. }
  19932. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19933. node.play(data, 0, true, parent);
  19934. }
  19935. turnLeft() {
  19936. this.curIndex--;
  19937. if (this.curIndex < 1) {
  19938. this.curIndex = 2;
  19939. }
  19940. let left = this.nodeObj.left;
  19941. let right = this.nodeObj.right;
  19942. let cur = this.nodeObj.cur;
  19943. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19944. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19945. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19946. this.updateData();
  19947. }));
  19948. this.ui.myNode.setChildIndex(right, 2);
  19949. this.nodeObj.left = cur;
  19950. this.nodeObj.right = left;
  19951. this.nodeObj.cur = right;
  19952. }
  19953. turnRight() {
  19954. this.curIndex++;
  19955. if (this.curIndex > 2) {
  19956. this.curIndex = 1;
  19957. }
  19958. let left = this.nodeObj.left;
  19959. let right = this.nodeObj.right;
  19960. let cur = this.nodeObj.cur;
  19961. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19962. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19963. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19964. this.updateData();
  19965. }));
  19966. this.ui.myNode.setChildIndex(left, 2);
  19967. this.nodeObj.left = right;
  19968. this.nodeObj.right = cur;
  19969. this.nodeObj.cur = left;
  19970. }
  19971. updateData() {
  19972. let data = cfgTable.secretaryshopData;
  19973. let children = this.ui.myNode._children;
  19974. let temp;
  19975. let curData;
  19976. for (let index = 0; index < children.length; index++) {
  19977. temp = children[index];
  19978. curData = data[1];
  19979. temp.heightTxt.text = curData.height;
  19980. temp.foodTxt.text = curData.food;
  19981. temp.historyTxt.text = curData.history;
  19982. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19983. this.addSecretarySpine(temp.secretary, curData.spine);
  19984. let womanIndex = curData.id - 1;
  19985. let getWoman = DataMgr.getSecretary(womanIndex);
  19986. let curUse = DataMgr.getCurSecretary();
  19987. if (getWoman) {
  19988. if (curUse == womanIndex) {
  19989. temp.purchaseBtn.c1.selectedIndex = 1;
  19990. }
  19991. else {
  19992. temp.purchaseBtn.c1.selectedIndex = 2;
  19993. }
  19994. }
  19995. else {
  19996. temp.purchaseBtn.c1.selectedIndex = 0;
  19997. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  19998. }
  19999. temp.purchaseBtn.offClick(this, this.clickSecretary);
  20000. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  20001. }
  20002. }
  20003. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20004. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20005. if (getWoman) {
  20006. if (curUse != womanIndex) {
  20007. console.log();
  20008. DataMgr.setCurSecretary(womanIndex);
  20009. this.updateData();
  20010. }
  20011. }
  20012. else {
  20013. let need = needDiamond;
  20014. if (DataMgr.diamondEnough(need)) {
  20015. DataMgr.setDiamond(-need);
  20016. DataMgr.setSecretary(womanIndex, 1);
  20017. DataMgr.setCurSecretary(womanIndex);
  20018. this.updateData();
  20019. }
  20020. else {
  20021. xGame.uiMgr.Show(UIAddProp$1, 1);
  20022. }
  20023. }
  20024. }
  20025. closeSelf() {
  20026. this.hide();
  20027. }
  20028. }
  20029. UISecretary$1.uiName = "UISecretary";
  20030. class BallRodDisplay$1 {
  20031. constructor(ui, index) {
  20032. this.index = 0;
  20033. this.uiIndex = 0;
  20034. this.ui = ui;
  20035. this.index = index;
  20036. this.initData();
  20037. }
  20038. initData() {
  20039. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20040. let data = cfgTable.ballrodData[this.index + 1];
  20041. this.ui.nameTxt.text = data.name;
  20042. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20043. this.ui.levelNode.c1.selectedIndex = data.quality;
  20044. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20045. if (data.spine) {
  20046. this.mySpine = new SpineMgr(data.spine, () => {
  20047. let xx = 150;
  20048. let yy = 70;
  20049. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20050. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20051. });
  20052. }
  20053. }
  20054. updateSelf() {
  20055. let get = DataMgr.getBallRod(this.index);
  20056. if (get == null)
  20057. get = 1;
  20058. let curUse = DataMgr.getCurBallRod();
  20059. if (get) {
  20060. if (curUse == this.index) {
  20061. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20062. }
  20063. else {
  20064. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20065. }
  20066. }
  20067. else {
  20068. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20069. }
  20070. }
  20071. buyBallRod() {
  20072. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20073. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20074. switch (selectedIndex) {
  20075. case 0:
  20076. break;
  20077. case 1:
  20078. DataMgr.setCurBallRod(this.index);
  20079. let ui = xGame.uiMgr.getUI(UIShop$1);
  20080. ui.updateBallRod();
  20081. break;
  20082. case 2:
  20083. let data = cfgTable.ballrodData[this.index + 1];
  20084. let need = data.price;
  20085. if (DataMgr.diamondEnough(need)) {
  20086. DataMgr.setDiamond(-need);
  20087. DataMgr.setBallRod(this.index, 1);
  20088. DataMgr.setCurBallRod(this.index);
  20089. let ui = xGame.uiMgr.getUI(UIShop$1);
  20090. ui.updateBallRod();
  20091. }
  20092. else {
  20093. xGame.uiMgr.Show(UIAddProp$1, 1);
  20094. }
  20095. break;
  20096. default:
  20097. break;
  20098. }
  20099. }
  20100. }
  20101. class UIShop$1 extends UIBase {
  20102. constructor() {
  20103. super();
  20104. this.itemNums = 0;
  20105. }
  20106. onConstructor() {
  20107. this.ui = ui_UIShop.createInstance();
  20108. this.contentPane = this.ui;
  20109. this.isEject = false;
  20110. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20111. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20112. this.addUIClick(this.ui, this.interuptSecretary);
  20113. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20114. this.ballRodArr = [];
  20115. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20116. this.ui.myNode.myList.numItems = this.itemNums;
  20117. if (Moyu.isKs)
  20118. this.ui.closeNode.closeBtn.x += 100;
  20119. }
  20120. show() {
  20121. super.show();
  20122. this.playSecretaryIdle();
  20123. this.updateBallRod();
  20124. }
  20125. updateBallRod() {
  20126. for (let index = 0; index < this.ballRodArr.length; index++) {
  20127. this.ballRodArr[index].updateSelf();
  20128. }
  20129. }
  20130. renderBallRod(sort, obj) {
  20131. let index = this.getIndexBySort(sort + 1) - 1;
  20132. let ballRod = new BallRodDisplay$1(obj, index);
  20133. this.ballRodArr.push(ballRod);
  20134. }
  20135. getIndexBySort(sort) {
  20136. let object = cfgTable.ballrodData;
  20137. for (const key in object) {
  20138. if (object[key].sort == sort) {
  20139. return parseInt(key);
  20140. }
  20141. }
  20142. }
  20143. playSecretaryIdle() {
  20144. let parent = this.ui.secretary.displayObject;
  20145. parent.destroyChildren();
  20146. let xx = this.ui.secretary.width / 2;
  20147. let yy = this.ui.secretary.height;
  20148. let scale = xGame.common.getSecretaryScale();
  20149. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20150. xGame.common.secretary.play(data, 0, true, parent);
  20151. }
  20152. interuptSecretary() {
  20153. Laya.timer.clearAll(this);
  20154. this.playSecretaryRandomSound();
  20155. }
  20156. playSecretaryRandomSound() {
  20157. if (this.isHide)
  20158. return;
  20159. let time = xGame.common.randomNum(45000, 60000);
  20160. Laya.timer.once(time, this, () => {
  20161. if (this.isHide)
  20162. return;
  20163. let index = xGame.common.randomNum(4, 7);
  20164. xGame.soundMgr.playSound("s_main0" + index);
  20165. let words = 1;
  20166. switch (index) {
  20167. case 4:
  20168. words = 5;
  20169. break;
  20170. case 5:
  20171. words = 3;
  20172. break;
  20173. case 6:
  20174. words = 6;
  20175. break;
  20176. case 7:
  20177. words = 7;
  20178. break;
  20179. default:
  20180. break;
  20181. }
  20182. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20183. this.playSecretaryRandomSound();
  20184. });
  20185. }
  20186. closeSelf() {
  20187. this.hide();
  20188. }
  20189. }
  20190. UIShop$1.uiName = "UIShop";
  20191. class SignMax$1 {
  20192. constructor(ui) {
  20193. this.ui = ui;
  20194. }
  20195. updateSelf(index, sameDay, curDayIndex) {
  20196. let data = cfgTable.signData[index + 1];
  20197. this.ui.titleTxt.text = data.title;
  20198. let arr1 = data.award[0].split('-');
  20199. let arr2 = data.award[1].split('-');
  20200. let num1 = parseInt(arr1[1]);
  20201. let num2 = parseInt(arr2[1]);
  20202. this.ui.numTxt1.text = num1 + "";
  20203. this.ui.numTxt2.text = num2 + "";
  20204. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20205. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20206. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20207. this.ui.numTxt1.visible = false;
  20208. }
  20209. else {
  20210. this.ui.numTxt1.visible = true;
  20211. }
  20212. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20213. this.ui.numTxt2.visible = false;
  20214. }
  20215. else {
  20216. this.ui.numTxt2.visible = true;
  20217. }
  20218. if (index < curDayIndex) {
  20219. this.ui.c1.selectedIndex = 1;
  20220. }
  20221. else if (index == curDayIndex) {
  20222. if (sameDay) {
  20223. this.ui.c1.selectedIndex = 2;
  20224. }
  20225. else {
  20226. this.ui.c1.selectedIndex = 2;
  20227. }
  20228. }
  20229. else {
  20230. this.ui.c1.selectedIndex = 0;
  20231. }
  20232. }
  20233. }
  20234. class SignNormal$1 {
  20235. constructor(ui) {
  20236. this.ui = ui;
  20237. }
  20238. updateSelf(index, sameDay, curDayIndex) {
  20239. let data = cfgTable.signData[index + 1];
  20240. this.ui.titleTxt.text = data.title;
  20241. let arr = data.award[0].split('-');
  20242. let type = parseInt(arr[0]);
  20243. let num = parseInt(arr[1]);
  20244. this.ui.numTxt.text = num + "";
  20245. if (type > 2) {
  20246. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20247. this.ui.myIcon.rotation = 0;
  20248. }
  20249. else {
  20250. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20251. this.ui.myIcon.rotation = 0;
  20252. }
  20253. if (xGame.common.signAwardContainsRod(data.award)) {
  20254. this.ui.numTxt.visible = false;
  20255. }
  20256. else {
  20257. this.ui.numTxt.visible = true;
  20258. }
  20259. if (index < curDayIndex) {
  20260. this.ui.c1.selectedIndex = 1;
  20261. }
  20262. else if (index == curDayIndex) {
  20263. if (sameDay) {
  20264. this.ui.c1.selectedIndex = 2;
  20265. }
  20266. else {
  20267. this.ui.c1.selectedIndex = 2;
  20268. }
  20269. }
  20270. else {
  20271. this.ui.c1.selectedIndex = 0;
  20272. }
  20273. }
  20274. }
  20275. class UISign$1 extends UIBase {
  20276. constructor() {
  20277. super();
  20278. this.curDayIndex = 0;
  20279. this.starX = 0;
  20280. }
  20281. onConstructor() {
  20282. this.ui = ui_UISign.createInstance();
  20283. this.contentPane = this.ui;
  20284. this.isEject = false;
  20285. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20286. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20287. this.initSignItem();
  20288. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20289. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20290. }
  20291. show() {
  20292. super.show();
  20293. this.ui.t0.play();
  20294. this.playSecretaryIdle();
  20295. this.updateSign();
  20296. }
  20297. initSignItem() {
  20298. this.signArr = [];
  20299. for (let index = 0; index < 6; index++) {
  20300. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20301. this.signArr.push(temp);
  20302. }
  20303. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20304. if (Moyu.isKs)
  20305. this.ui.closeNode.closeBtn.x += 100;
  20306. }
  20307. updateSign() {
  20308. let sameDay = xGame.common.judgeSameDay();
  20309. let max = 7;
  20310. this.curDayIndex = DataMgr.getSignData();
  20311. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20312. this.curDayIndex = 0;
  20313. if (!sameDay) {
  20314. this.ui.normalBtn.visible = true;
  20315. this.ui.tipsNode.visible = false;
  20316. this.ui.againBtn.visible = false;
  20317. }
  20318. else {
  20319. this.ui.normalBtn.visible = false;
  20320. let again = DataMgr.getExtraSign();
  20321. let isCurrency = false;
  20322. let index = this.curDayIndex;
  20323. if (index == 0)
  20324. index = 7;
  20325. let award = cfgTable.signData[index].award;
  20326. let num = award[0].split("-")[0];
  20327. if (num == "1" || num == "2")
  20328. isCurrency = true;
  20329. let showAgain = again == 0 && isCurrency;
  20330. this.ui.againBtn.visible = showAgain;
  20331. this.ui.tipsNode.visible = !showAgain;
  20332. }
  20333. for (let index = 0; index < this.signArr.length; index++) {
  20334. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20335. }
  20336. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20337. }
  20338. playSecretaryIdle() {
  20339. let parent = this.ui.secretary.displayObject;
  20340. parent.destroyChildren();
  20341. let xx = this.ui.secretary.width / 2;
  20342. let yy = this.ui.secretary.height;
  20343. let scale = xGame.common.getSecretaryScale();
  20344. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20345. xGame.common.secretary.play(data, 0, true, parent);
  20346. }
  20347. closeSelf() {
  20348. this.hide();
  20349. }
  20350. normalGetAward() {
  20351. let sameDay = xGame.common.judgeSameDay();
  20352. if (!sameDay) {
  20353. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20354. let temp;
  20355. let type;
  20356. let num;
  20357. let arr = [];
  20358. for (let index = 0; index < award.length; index++) {
  20359. temp = award[index].split("-");
  20360. type = parseInt(temp[0]);
  20361. num = parseInt(temp[1]);
  20362. let awardType = new AwardType();
  20363. awardType.num = num;
  20364. awardType.type = type;
  20365. arr.push(awardType);
  20366. }
  20367. xGame.common.getAward(arr, (watchVideo) => {
  20368. this.curDayIndex++;
  20369. if (this.curDayIndex > 7)
  20370. this.curDayIndex = 0;
  20371. DataMgr.setSignData(this.curDayIndex);
  20372. DataMgr.setSignTime(new Date().getTime());
  20373. if (watchVideo) {
  20374. DataMgr.setExtraSign(1);
  20375. Moyu.sendDataEvent("signIn1");
  20376. }
  20377. this.updateSign();
  20378. });
  20379. }
  20380. }
  20381. againGetAward() {
  20382. Moyu.sendDataEvent("signIn2");
  20383. console.log('zh:qjff_AD_for_uisign');
  20384. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20385. }
  20386. else {
  20387. console.log('zh:AD 失败,直接发放奖励');
  20388. this.qjff_AD_for_uisign();
  20389. }
  20390. }
  20391. qjff_AD_for_uisign() {
  20392. let index = this.curDayIndex;
  20393. if (index == 0)
  20394. index = 7;
  20395. let award = cfgTable.signData[index].award;
  20396. let temp;
  20397. let type;
  20398. let num;
  20399. for (let index = 0; index < award.length; index++) {
  20400. temp = award[index].split("-");
  20401. type = parseInt(temp[0]);
  20402. num = parseInt(temp[1]) * 3;
  20403. xGame.common.playObjFlyAnim(num, type);
  20404. }
  20405. DataMgr.setExtraSign(1);
  20406. this.updateSign();
  20407. }
  20408. }
  20409. UISign$1.uiName = "UISign";
  20410. class UIModeSelection$1 extends UIBase {
  20411. constructor() {
  20412. super();
  20413. }
  20414. onConstructor() {
  20415. this.ui = ui_UIModeSelection.createInstance();
  20416. this.contentPane = this.ui;
  20417. this.isEject = false;
  20418. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20419. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20420. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20421. this.addUIClick(this.ui.closeBtn, this.hide);
  20422. this.peopleArr = [650, 6900, 3800];
  20423. this.peopleOffest = [50, 500, 200];
  20424. this.updateSelf();
  20425. }
  20426. show(callback) {
  20427. super.show();
  20428. this.ui.t0.play();
  20429. this.callback = callback;
  20430. }
  20431. updateSelf() {
  20432. let cfg = cfgTable.modeselectData;
  20433. for (let index = 1; index <= 3; index++) {
  20434. let node = this.ui.myNode["type" + index];
  20435. node.need.text = cfg[index].need;
  20436. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20437. node.peopleTxt.text = this.getRandPeople(index - 1);
  20438. }
  20439. }
  20440. enterGame(type) {
  20441. xGame.common.classicRoomType = type;
  20442. let cfg = cfgTable.modeselectData[type];
  20443. let need = cfg.need;
  20444. xGame.common.passAwardCoin = cfg.award;
  20445. if (DataMgr.coinEnough(need)) {
  20446. DataMgr.setCoin(-need);
  20447. this.ui.myNode["type" + type].t0.play();
  20448. Laya.timer.once(200, this, () => {
  20449. this.callback && this.callback();
  20450. });
  20451. }
  20452. else {
  20453. Moyu.sendDataEvent("AddCoinVideo");
  20454. xGame.uiMgr.Show(UIAddProp$1, 0);
  20455. }
  20456. }
  20457. getRandPeople(index) {
  20458. let rand = this.peopleOffest[index];
  20459. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20460. }
  20461. }
  20462. UIModeSelection$1.uiName = "UIModeSelection";
  20463. class UITry$1 extends UIBase {
  20464. constructor() {
  20465. super();
  20466. this.closeTime = 0;
  20467. this.closeNum = 0;
  20468. this.skillUrl = xGame.common.skillIconList;
  20469. }
  20470. onConstructor() {
  20471. this.ui = ui_UITry.createInstance();
  20472. this.contentPane = this.ui;
  20473. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20474. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20475. }
  20476. show() {
  20477. super.show();
  20478. this.closeNum = 0;
  20479. this.closeTime = 15;
  20480. this.ui.t0.play();
  20481. PlatMgr.showRateBanner();
  20482. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20483. Laya.timer.loop(1000, this, this.updateTime);
  20484. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20485. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20486. xGame.common.gameMgr.gamePause = true;
  20487. }
  20488. updateTime() {
  20489. if (this.closeTime > 1) {
  20490. this.closeTime--;
  20491. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20492. }
  20493. else
  20494. this.hide();
  20495. }
  20496. hide() {
  20497. Laya.timer.clearAll(this);
  20498. Moyu.showBannerAd(false);
  20499. super.hide();
  20500. xGame.common.gameMgr.gamePause = false;
  20501. }
  20502. onTry() {
  20503. console.log('zh:qjff_AD_for_uitry');
  20504. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20505. }
  20506. else {
  20507. console.log('zh:AD 失败,直接发放奖励');
  20508. this.qjff_AD_for_uitry();
  20509. }
  20510. }
  20511. qjff_AD_for_uitry() {
  20512. let select = xGame.common.curPlayerSkillType;
  20513. DataMgr.gameData.trySkill = select;
  20514. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20515. DataMgr.saveGameData();
  20516. DataMgr.setBigSkill(select, 1);
  20517. xGame.showTip("Trial Successful");
  20518. this.hide();
  20519. }
  20520. onCancel() {
  20521. if (this.closeNum > 0) {
  20522. this.closeNum--;
  20523. if (this.closeNum < 2)
  20524. this.hide();
  20525. return;
  20526. }
  20527. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20528. this.onTry();
  20529. }
  20530. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20531. this.closeNum = 3;
  20532. }
  20533. else
  20534. this.hide();
  20535. }
  20536. }
  20537. UITry$1.uiName = "UITry";
  20538. class UIGetAward$1 extends UIBase {
  20539. constructor() {
  20540. super();
  20541. this.showTriple = true;
  20542. }
  20543. onConstructor() {
  20544. this.ui = ui_UIGetAward.createInstance();
  20545. this.contentPane = this.ui;
  20546. this.isEject = false;
  20547. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20548. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20549. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20550. }
  20551. show(arr, showTriple, callback) {
  20552. super.show();
  20553. this.ui.t0.play();
  20554. this.ui.eftNode.visible = true;
  20555. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20556. this.ui.eftNode.visible = false;
  20557. }), 1, 0, 0, 0.9);
  20558. this.awardArr = arr;
  20559. this.showTriple = showTriple;
  20560. this.callback = callback;
  20561. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20562. this.ui.myList.numItems = arr.length;
  20563. xGame.soundMgr.playSound("getaward");
  20564. }
  20565. updateSelf(index, obj) {
  20566. let temp = this.awardArr[index];
  20567. let icon = this.getIcon(temp.type);
  20568. let str = icon;
  20569. if (temp.type > 2) {
  20570. str = "s" + icon;
  20571. }
  20572. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20573. obj.myIcon.rotation = 0;
  20574. obj.numTxt.text = temp.num + "";
  20575. obj.numTxt.visible = temp.type > 2 ? false : true;
  20576. obj.nameTxt.text = this.getNameStr(temp.type);
  20577. }
  20578. renderItem(index, obj) {
  20579. this.updateSelf(index, obj);
  20580. }
  20581. tripleGetAward() {
  20582. console.log('zh:qjff_AD_for_uigetAward');
  20583. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20584. }
  20585. else {
  20586. console.log('zh:AD 失败,直接发放奖励');
  20587. this.qjff_AD_for_uigetAward();
  20588. }
  20589. }
  20590. qjff_AD_for_uigetAward() {
  20591. this.getAward(3);
  20592. }
  20593. normalGetAward() {
  20594. if (PlatMgr.isMisVideo())
  20595. this.tripleGetAward();
  20596. else
  20597. this.getAward();
  20598. }
  20599. getAward(times = 1) {
  20600. this.hide();
  20601. for (let index = 0; index < this.awardArr.length; index++) {
  20602. this.awardArr[index].num *= times;
  20603. }
  20604. this.callback && this.callback(times != 1);
  20605. }
  20606. getIcon(type) {
  20607. switch (type) {
  20608. case Prop.diamond:
  20609. return "ty_zs";
  20610. case Prop.coin:
  20611. return "ty_jb";
  20612. case Prop.gan1:
  20613. return "qg1";
  20614. case Prop.gan2:
  20615. return "qg2";
  20616. case Prop.gan3:
  20617. return "qg3";
  20618. case Prop.gan4:
  20619. return "qg4";
  20620. default:
  20621. break;
  20622. }
  20623. }
  20624. getNameStr(type) {
  20625. switch (type) {
  20626. case Prop.diamond:
  20627. return "Diamond";
  20628. case Prop.coin:
  20629. return "Coins";
  20630. case Prop.gan1:
  20631. case Prop.gan2:
  20632. case Prop.gan3:
  20633. case Prop.gan4:
  20634. return cfgTable.ballrodData[type - 1].name;
  20635. default:
  20636. break;
  20637. }
  20638. }
  20639. }
  20640. UIGetAward$1.uiName = "UIGetAward";
  20641. class UIBox$1 extends UIBase {
  20642. constructor() {
  20643. super();
  20644. this.boxNum = 0;
  20645. this.boxMax = 10;
  20646. this.inAd = false;
  20647. this.isClose = false;
  20648. }
  20649. onConstructor() {
  20650. this.ui = ui_UIBox.createInstance();
  20651. this.contentPane = this.ui;
  20652. this.isEject = false;
  20653. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20654. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20655. Laya.timer.loop(1000, this, this.update);
  20656. }
  20657. update() {
  20658. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20659. this.boxNum -= 1;
  20660. this.upBar();
  20661. }
  20662. }
  20663. upBar() {
  20664. if (this.boxNum > this.boxMax)
  20665. this.boxNum = this.boxMax;
  20666. this.ui.bar.value = this.boxNum * 10;
  20667. }
  20668. show() {
  20669. super.show();
  20670. this.isClose = false;
  20671. this.boxNum = 0;
  20672. this.inAd = false;
  20673. this.upBar();
  20674. this.ui.t0.play();
  20675. this.ui.closeBtn.visible = false;
  20676. Laya.timer.once(3000, this, () => {
  20677. this.ui.closeBtn.visible = true;
  20678. this.ui.bar.alpha = 1;
  20679. });
  20680. Laya.timer.once(500, this, () => {
  20681. this.ui.t1.play();
  20682. });
  20683. }
  20684. hide() {
  20685. Laya.timer.clearAll(this);
  20686. Moyu.showBannerAd(false);
  20687. super.hide();
  20688. }
  20689. onOpenBox() {
  20690. this.boxNum++;
  20691. if (this.boxNum < this.boxMax) {
  20692. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  20693. Moyu.showInsertAd(0, PlatMgr.insertGap);
  20694. }
  20695. else if (this.boxNum == this.boxMax) {
  20696. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20697. this.ui.openBtn.c1.selectedIndex = 13;
  20698. this.inAd = true;
  20699. }
  20700. else
  20701. this.getAward();
  20702. }
  20703. else if (this.inAd) {
  20704. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20705. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20706. }
  20707. else {
  20708. console.log('zh:AD 失败,直接发放奖励');
  20709. this.qjff_AD_for_UIBOX_onOpenBox();
  20710. }
  20711. }
  20712. this.upBar();
  20713. }
  20714. qjff_AD_for_UIBOX_onOpenBox() {
  20715. this.getAward();
  20716. }
  20717. onCloseBox() {
  20718. if (this.isClose)
  20719. this.hide();
  20720. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20721. this.isClose = true;
  20722. PlatMgr.showBanner(true, 0, 3000);
  20723. }
  20724. else
  20725. this.hide();
  20726. }
  20727. getAward() {
  20728. let str = "";
  20729. if (Math.random() < 0.5) {
  20730. let max = Moyu.isLegal ? 500 : 2500;
  20731. let num = xGame.tools.random(max, 500 + max);
  20732. DataMgr.setCoin(num);
  20733. str = "金币x" + num;
  20734. }
  20735. else {
  20736. let max = Moyu.isLegal ? 10 : 30;
  20737. let num = xGame.tools.random(max, 30 + max);
  20738. DataMgr.setDiamond(num);
  20739. str = "钻石x" + num;
  20740. }
  20741. xGame.showTip("恭喜获得-" + str);
  20742. this.hide();
  20743. }
  20744. }
  20745. UIBox$1.uiName = "UIBox";
  20746. class UIMain$1 extends UIBase {
  20747. constructor() {
  20748. super();
  20749. this.firstEnter = true;
  20750. }
  20751. nativeCallJs(msg) {
  20752. let t = msg;
  20753. console.log("zh: nativeCallJs 奖励开始发放:", t);
  20754. switch (t) {
  20755. case 'qjff_chouJiang':
  20756. let dui = xGame.uiMgr.getUI(UIDraw$1);
  20757. dui.qjff_chouJiang();
  20758. break;
  20759. case 'qjff_AD_for_uisign':
  20760. let dui2 = xGame.uiMgr.getUI(UISign$1);
  20761. dui2.qjff_AD_for_uisign();
  20762. break;
  20763. case 'qjff_AD_for_uitry':
  20764. let dui3 = xGame.uiMgr.getUI(UITry$1);
  20765. dui3.qjff_AD_for_uitry();
  20766. break;
  20767. case 'qjff_AD_for_uipower':
  20768. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  20769. dui4.qjff_AD_for_uipower();
  20770. break;
  20771. case 'qjff_AD_for_uigetAward':
  20772. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  20773. dui5.qjff_AD_for_uigetAward();
  20774. break;
  20775. case 'qjff_AD_for_uiGameEnd':
  20776. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  20777. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  20778. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  20779. break;
  20780. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  20781. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  20782. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  20783. break;
  20784. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  20785. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  20786. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  20787. break;
  20788. case 'qjff_AD_for_UIrepentProp_videoRegret':
  20789. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  20790. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  20791. break;
  20792. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  20793. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  20794. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20795. break;
  20796. case 'qjff_AD_for_UIBOX_onOpenBox':
  20797. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  20798. dui11.qjff_AD_for_UIBOX_onOpenBox();
  20799. break;
  20800. case 'qjff_AD_for_UIAddCoin':
  20801. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  20802. dui12.qjff_AD_for_UIAddCoin();
  20803. break;
  20804. case '111a':
  20805. let dui14 = xGame.uiMgr.getUI(UISign$1);
  20806. dui14.qjff_AD_for_uisign();
  20807. break;
  20808. case '222a':
  20809. let dui15 = xGame.uiMgr.getUI(UISign$1);
  20810. dui15.qjff_AD_for_uisign();
  20811. break;
  20812. case '333a':
  20813. let dui16 = xGame.uiMgr.getUI(UISign$1);
  20814. dui16.qjff_AD_for_uisign();
  20815. break;
  20816. default:
  20817. console.log('zh:未知的方法名字' + t);
  20818. break;
  20819. }
  20820. }
  20821. onConstructor() {
  20822. console.log('zh: UIMain onConstructor');
  20823. this.ui = ui_UIMain.createInstance();
  20824. this.contentPane = this.ui;
  20825. this.isEject = false;
  20826. this.addEvent();
  20827. this.addClickSpine();
  20828. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20829. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20830. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20831. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20832. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20833. let curUse = DataMgr.getCurSecretary();
  20834. this.changeSecretary(curUse);
  20835. this.ui.talkNode.visible = false;
  20836. let guide = DataMgr.getSkillGuide();
  20837. if (xGame.common.isNewDay && guide == 1) {
  20838. xGame.common.isNewDay = false;
  20839. xGame.soundMgr.playSound("s_main01");
  20840. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20841. console.log("播放小秘书每天语音");
  20842. }
  20843. this.onGetUserInfo();
  20844. this.ui.n83.visible = false;
  20845. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20846. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20847. }
  20848. changeSecretary(curUse) {
  20849. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20850. xGame.common.secretary && xGame.common.secretary.dispose();
  20851. this.addSecretarySpine(name);
  20852. }
  20853. addSecretarySpine(name) {
  20854. let spine = new SpineMgr(name, () => {
  20855. this.playSecretaryIdle();
  20856. });
  20857. xGame.common.secretary = spine;
  20858. }
  20859. addClickSpine() {
  20860. let clickSpine = new SpineMgr("dianji", () => {
  20861. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20862. let parent = Laya.stage;
  20863. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20864. clickSpine.play(data, 0, false, parent, (spine) => {
  20865. spine.destroy(true);
  20866. });
  20867. });
  20868. });
  20869. }
  20870. addEvent() {
  20871. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20872. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20873. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20874. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20875. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20876. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20877. this.addUIClick(this.ui, this.interuptSecretary);
  20878. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20879. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20880. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20881. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20882. this.addUIClick(this.ui.signBtn, this.openSignView);
  20883. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20884. }
  20885. show(showFailWords) {
  20886. super.show();
  20887. this.moneyNode.ui.c1.selectedIndex = 1;
  20888. this.playSecretaryIdle();
  20889. xGame.soundMgr.playMusic("caromhall01");
  20890. Laya.timer.clearAll(this);
  20891. this.playSecretaryRandomSound();
  20892. if (showFailWords) {
  20893. setTimeout(() => {
  20894. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20895. let words = -1;
  20896. if (str == "s_main02") {
  20897. words = 2;
  20898. }
  20899. else {
  20900. words = 3;
  20901. }
  20902. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20903. xGame.soundMgr.playSound(str);
  20904. }, 300);
  20905. }
  20906. this.showGuide();
  20907. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20908. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20909. let guide = DataMgr.getSkillGuide();
  20910. if (guide == 1) {
  20911. let randTime = xGame.common.randomNum(300, 800);
  20912. if (this.firstEnter) {
  20913. this.firstEnter = false;
  20914. randTime += 900;
  20915. }
  20916. Laya.timer.once(randTime, this, () => {
  20917. xGame.common.autoPopUIView();
  20918. });
  20919. }
  20920. }
  20921. checkActive(show) {
  20922. }
  20923. showGuide() {
  20924. let guide = DataMgr.getSkillGuide();
  20925. this.ui.guideBtn.visible = guide == 0;
  20926. this.ui.enterGuide.visible = false;
  20927. this.ui.secretaryGuide.visible = guide == 0;
  20928. if (guide == 0) {
  20929. xGame.soundMgr.playSound("s_guide");
  20930. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20931. }
  20932. }
  20933. ensureSecretary() {
  20934. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20935. this.ui.secretaryGuide.visible = false;
  20936. this.ui.enterGuide.visible = true;
  20937. this.ui.wordsNode.t0.play();
  20938. if (DataMgr.getNewUser())
  20939. Moyu.sendDataEvent("gameReady");
  20940. }
  20941. playSecretaryIdle() {
  20942. let parent = this.ui.secretary.displayObject;
  20943. parent.destroyChildren();
  20944. let xx = this.ui.secretary.width / 2;
  20945. let yy = this.ui.secretary.height;
  20946. let scale = xGame.common.getSecretaryScale();
  20947. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20948. console.log("zh:playSecretaryIdle", data);
  20949. xGame.common.secretary.play(data, 0, true, parent);
  20950. }
  20951. startGame(type) {
  20952. xGame.common.gameMode = type;
  20953. Moyu.sendDataEvent("PlayGame", { type: type });
  20954. switch (xGame.common.gameMode) {
  20955. case GameMode.classic:
  20956. let challengeTimes = DataMgr.getChallengeTimes();
  20957. if (challengeTimes == 0) {
  20958. xGame.uiMgr.Show(UIInvitation$1);
  20959. }
  20960. else {
  20961. this.beginGame();
  20962. }
  20963. break;
  20964. case GameMode.bigMove:
  20965. this.beginGame();
  20966. if (DataMgr.getNewUser())
  20967. Moyu.sendDataEvent("gameStart0");
  20968. break;
  20969. default:
  20970. break;
  20971. }
  20972. }
  20973. beginGame(isNice = false) {
  20974. if (xGame.common.gameMode == GameMode.classic) {
  20975. if (isNice) {
  20976. this.enterClassic();
  20977. }
  20978. else {
  20979. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20980. this.enterClassic();
  20981. });
  20982. }
  20983. }
  20984. else if (xGame.common.gameMode == GameMode.bigMove) {
  20985. this.ui.enterGuide.visible = false;
  20986. xGame.uiMgr.Show(UISkill$1);
  20987. }
  20988. }
  20989. enterClassic() {
  20990. xGame.uiMgr.Show(UIGame$1);
  20991. xGame.uiMgr.Show(UIMatching$1, () => {
  20992. if (!this.isHide)
  20993. this.hide();
  20994. xGame.common.gameUI.ui.alpha = 1;
  20995. xGame.common.gameUI.startGame();
  20996. xGame.uiMgr.Hide(UIGameEnd$1);
  20997. });
  20998. }
  20999. startGlobal() {
  21000. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21001. }
  21002. startWeekly() {
  21003. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21004. }
  21005. zhouSaiMonth() {
  21006. console.log('zh: zhouSaiMonth 被调用');
  21007. }
  21008. startPlaceBall() {
  21009. xGame.uiMgr.Show(UILevelDisplay$1);
  21010. }
  21011. hide() {
  21012. super.hide();
  21013. xGame.common.stopGirlPop(this.ui.talkNode);
  21014. }
  21015. onGetUserInfo(force = false) {
  21016. if (Moyu.isWx) {
  21017. let info = Moyu.getSystemInfo();
  21018. if (info)
  21019. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21020. }
  21021. else {
  21022. Moyu.initUser(this, this.freshUser, force);
  21023. }
  21024. if (!Moyu.hasUserInfo) {
  21025. let user = Moyu.getUserInfo();
  21026. user.headIcon = 'res/ty_touxiang.png';
  21027. }
  21028. this.freshUser();
  21029. }
  21030. freshUser() {
  21031. let user = Moyu.getUserInfo();
  21032. if (!user.isAuth) {
  21033. user.headIcon = 'res/ty_touxiang.png';
  21034. }
  21035. else
  21036. DataMgr.upRankData();
  21037. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21038. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21039. }
  21040. interuptSecretary() {
  21041. Laya.timer.clearAll(this);
  21042. this.playSecretaryRandomSound();
  21043. }
  21044. playSecretaryRandomSound() {
  21045. if (this.isHide)
  21046. return;
  21047. let time = xGame.common.randomNum(45000, 60000);
  21048. Laya.timer.once(time, this, () => {
  21049. if (this.isHide)
  21050. return;
  21051. let index = xGame.common.randomNum(4, 7);
  21052. xGame.soundMgr.playSound("s_main0" + index);
  21053. let words = 1;
  21054. switch (index) {
  21055. case 4:
  21056. words = 5;
  21057. break;
  21058. case 5:
  21059. words = 3;
  21060. break;
  21061. case 6:
  21062. words = 6;
  21063. break;
  21064. case 7:
  21065. words = 7;
  21066. break;
  21067. default:
  21068. break;
  21069. }
  21070. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21071. this.playSecretaryRandomSound();
  21072. });
  21073. }
  21074. openSecretaryView() {
  21075. xGame.uiMgr.Show(UISecretary$1);
  21076. Moyu.sendDataEvent("secretary");
  21077. }
  21078. openShopView() {
  21079. xGame.uiMgr.Show(UIShop$1);
  21080. }
  21081. openSignView() {
  21082. xGame.uiMgr.Show(UISign$1);
  21083. }
  21084. openDrawView() {
  21085. xGame.uiMgr.Show(UIDraw$1);
  21086. }
  21087. openRanking() {
  21088. xGame.uiMgr.Show(UIRanking$1);
  21089. Moyu.sendDataEvent("rankingList");
  21090. }
  21091. }
  21092. UIMain$1.uiName = "UIMain";
  21093. function InitShader() {
  21094. }
  21095. function appInit() {
  21096. xGame.context.init(getLoadingResList(), initCallback);
  21097. }
  21098. function getLoadingResList() {
  21099. return [
  21100. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21101. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21102. ];
  21103. }
  21104. function getGameResList() {
  21105. return [
  21106. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21107. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21108. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21109. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21110. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21111. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21112. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21113. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21114. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21115. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21116. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21117. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21118. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21119. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21120. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21121. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21122. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21123. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21124. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21125. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21126. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  21127. ];
  21128. }
  21129. function initCallback() {
  21130. window["DataMgr"] = DataMgr;
  21131. DataMgr.Init();
  21132. Moyu.init(getPlat(), this, () => {
  21133. DataMgr.isNewDay();
  21134. PlatMgr.initConfig();
  21135. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21136. }, true);
  21137. console.log('zh:开始sm init1 start');
  21138. xGame.soundMgr.init();
  21139. console.log('zh:开始sm init1 end');
  21140. xGame.uiMgr.init();
  21141. xGame.uiMgr.clearTempData();
  21142. xGame.uiMgr.bindFUI(fguiRes.loading);
  21143. xGame.uiMgr.Show(UILoading);
  21144. }
  21145. function loadSubRes(callback) {
  21146. var tab = ["asset", "res", "spine"];
  21147. let subDone = 0;
  21148. for (var i = 0; i < tab.length; i++) {
  21149. let sub = tab[i];
  21150. Moyu.loadSubRes(sub, (pro) => {
  21151. callback && callback(pro, false);
  21152. }).then(() => {
  21153. subDone++;
  21154. if (subDone >= tab.length)
  21155. callback && callback(1, true);
  21156. });
  21157. }
  21158. }
  21159. function enterGame() {
  21160. xGame.cfgMgr.init();
  21161. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21162. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21163. xGame.uiMgr.Hide(UILoading);
  21164. fgui.UIPackage.removePackage(fguiRes.loading);
  21165. xGame.uiMgr.bindFUI(fguiRes.game);
  21166. xGame.uiMgr.Show(UIMain$1);
  21167. if (DataMgr.getNewUser())
  21168. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21169. }
  21170. function getPlat() {
  21171. let cfg = new MoyuCfg();
  21172. cfg.plat = MoyuPlat.web;
  21173. cfg.myId = 120;
  21174. cfg.myKey = '8848a885774230a4';
  21175. cfg.version = 0;
  21176. if (window.hasOwnProperty("gamebox")) {
  21177. cfg.plat = MoyuPlat.f399;
  21178. cfg.version = 0;
  21179. }
  21180. else if (window.hasOwnProperty("ks")) {
  21181. cfg.plat = MoyuPlat.ks;
  21182. cfg.version = 0;
  21183. cfg.ads.ksVideoId = '2300002254_01';
  21184. cfg.ads.ksInsertId = '2300002254_02';
  21185. }
  21186. else if (Laya.Browser.onTTMiniGame) {
  21187. cfg.plat = MoyuPlat.tt;
  21188. cfg.version = 0;
  21189. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21190. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21191. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21192. }
  21193. else if (Laya.Browser.onMiniGame) {
  21194. cfg.plat = MoyuPlat.wx;
  21195. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21196. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21197. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21198. }
  21199. else if (Laya.Browser.onQQMiniGame) {
  21200. cfg.plat = MoyuPlat.qq;
  21201. }
  21202. else if (Laya.Browser.onQGMiniGame) {
  21203. cfg.plat = MoyuPlat.op;
  21204. cfg.ads.opVideoId = '455502';
  21205. cfg.ads.opBannerId = '455507';
  21206. }
  21207. else if (Laya.Browser.onVVMiniGame) {
  21208. cfg.plat = MoyuPlat.vv;
  21209. cfg.version = 0;
  21210. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21211. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21212. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21213. }
  21214. else if (Laya.Browser.onHWMiniGame) {
  21215. cfg.plat = MoyuPlat.hw;
  21216. }
  21217. else if (window["mz"]) {
  21218. cfg.plat = MoyuPlat.mz;
  21219. }
  21220. else {
  21221. let cfg = window['conchConfig'];
  21222. if (cfg) {
  21223. var os = cfg.getOS();
  21224. if (os == "Conch-ios") {
  21225. cfg.plat = MoyuPlat.ios;
  21226. }
  21227. else if (os == "Conch-android") {
  21228. }
  21229. }
  21230. }
  21231. return cfg;
  21232. }
  21233. class Main {
  21234. constructor() {
  21235. if (window["Laya3D"])
  21236. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21237. else {
  21238. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21239. this.initMain();
  21240. }
  21241. }
  21242. initMain() {
  21243. Laya["Physics"] && Laya["Physics"].enable();
  21244. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21245. Laya.stage.scaleMode = GameConfig.scaleMode;
  21246. Laya.stage.screenMode = GameConfig.screenMode;
  21247. Laya.stage.alignV = GameConfig.alignV;
  21248. Laya.stage.alignH = GameConfig.alignH;
  21249. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21250. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21251. Laya.enableDebugPanel();
  21252. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21253. Laya["PhysicsDebugDraw"].enable();
  21254. if (GameConfig.stat)
  21255. Laya.Stat.show();
  21256. Laya.alertGlobalError(true);
  21257. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21258. }
  21259. onVersionLoaded() {
  21260. appInit();
  21261. }
  21262. }
  21263. new Main();
  21264. }());
  21265. //# sourceMappingURL=bundle.js.map