bundle.js 826 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686
  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.n33 = (this.getChild("n33"));
  4205. this.shopBtn = (this.getChild("shopBtn"));
  4206. this.moneyNode = (this.getChild("moneyNode"));
  4207. this.headNode = (this.getChild("headNode"));
  4208. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4209. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4210. this.classicBtn = (this.getChild("classicBtn"));
  4211. this.weeklyBtn = (this.getChild("weeklyBtn"));
  4212. this.globalBtn = (this.getChild("globalBtn"));
  4213. this.n44 = (this.getChild("n44"));
  4214. this.signBtn = (this.getChild("signBtn"));
  4215. this.drawBtn = (this.getChild("drawBtn"));
  4216. this.settingNode = (this.getChild("settingNode"));
  4217. this.n45 = (this.getChild("n45"));
  4218. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4219. this.n46 = (this.getChild("n46"));
  4220. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4221. this.liucheng1 = (this.getChild("liucheng1"));
  4222. this.rightBtn = (this.getChild("rightBtn"));
  4223. this.n75 = (this.getChild("n75"));
  4224. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4225. this.liucheng2 = (this.getChild("liucheng2"));
  4226. this.guideBtn = (this.getChild("guideBtn"));
  4227. this.n73 = (this.getChild("n73"));
  4228. this.wordsNode = (this.getChild("wordsNode"));
  4229. this.enterGuide = (this.getChild("enterGuide"));
  4230. this.talkNode = (this.getChild("talkNode"));
  4231. this.n83 = (this.getChild("n83"));
  4232. this.n84 = (this.getChild("n84"));
  4233. }
  4234. }
  4235. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4236. class ui_UIMoyu extends fgui.GComponent {
  4237. static createInstance() {
  4238. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4239. }
  4240. onConstruct() {
  4241. this.ageTip = (this.getChild("ageTip"));
  4242. this.mainBg = (this.getChild("mainBg"));
  4243. this.xyNode = (this.getChild("xyNode"));
  4244. this.rnNode = (this.getChild("rnNode"));
  4245. this.fcmNode = (this.getChild("fcmNode"));
  4246. this.ageNode = (this.getChild("ageNode"));
  4247. this.tipNode = (this.getChild("tipNode"));
  4248. this.msgNode = (this.getChild("msgNode"));
  4249. }
  4250. }
  4251. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4252. class MoyuMgr {
  4253. static initMoyu() {
  4254. this.moyuView = new MoyuView();
  4255. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4256. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4257. this.moyuView.ui.displayObject.zOrder = 1000;
  4258. this.moyuView.init();
  4259. this.moyuView.showTip(true);
  4260. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4261. window['XApk'] = this;
  4262. }
  4263. static showAge(show) {
  4264. if (this.moyuView)
  4265. this.moyuView.showAge(show);
  4266. }
  4267. static onPlatMsg(idx) {
  4268. if (!MoyuMgr.moyuView)
  4269. return;
  4270. if (idx == '0') {
  4271. MoyuMgr.moyuView.showTip(false);
  4272. }
  4273. }
  4274. static showAgree(call) {
  4275. if (this.moyuView)
  4276. this.moyuView.showAgree(call);
  4277. else
  4278. call && call();
  4279. }
  4280. static showXy(type = 1) {
  4281. if (this.moyuView)
  4282. this.moyuView.showXy(type);
  4283. }
  4284. }
  4285. MoyuMgr.isAdvise = false;
  4286. class MoyuView {
  4287. constructor() {
  4288. this.ysxyNum = 1;
  4289. this.ysJson = null;
  4290. this.ui = ui_UIMoyu.createInstance();
  4291. }
  4292. init() {
  4293. this.ui.mainBg.visible = false;
  4294. this.ui.xyNode.visible = false;
  4295. this.ui.ageNode.visible = false;
  4296. this.ui.tipNode.visible = false;
  4297. this.ui.rnNode.visible = false;
  4298. this.ui.fcmNode.visible = false;
  4299. this.ui.ageTip.visible = false;
  4300. this.ui.msgNode.visible = false;
  4301. this.ui.visible = false;
  4302. this.ui.xyNode.xyList.setVirtual();
  4303. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4304. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4305. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4306. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4307. this.ui.xyNode.btnKnown.visible = false;
  4308. this.ui.xyNode.xy1.visible = false;
  4309. this.ui.xyNode.xy2.visible = false;
  4310. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4311. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4312. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4313. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4314. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4315. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4316. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4317. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4318. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4319. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4320. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4321. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4322. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4323. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4324. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4325. this.ysxyNum = 2;
  4326. }
  4327. }
  4328. onClick(obj) {
  4329. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4330. switch (obj) {
  4331. case this.ui.ageTip:
  4332. if (Moyu.isTTApk) {
  4333. this.ui.ageNode.visible = true;
  4334. this.ui.mainBg.visible = true;
  4335. }
  4336. break;
  4337. case this.ui.tipNode:
  4338. this.showTip(false);
  4339. break;
  4340. case this.ui.ageNode.btnAge:
  4341. this.ui.ageNode.visible = false;
  4342. this.ui.mainBg.visible = false;
  4343. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4344. this.ui.visible = false;
  4345. break;
  4346. case this.ui.xyNode.btnXy3:
  4347. case this.ui.xyNode.btnXy1:
  4348. this.loadXy(1);
  4349. break;
  4350. case this.ui.xyNode.btnXy2:
  4351. this.loadXy(2);
  4352. break;
  4353. case this.ui.xyNode.btnBack:
  4354. this.ui.xyNode.xy1.visible = true;
  4355. this.ui.xyNode.xy2.visible = false;
  4356. break;
  4357. case this.ui.xyNode.btnKnown:
  4358. this.ui.xyNode.visible = false;
  4359. this.ui.mainBg.visible = false;
  4360. this.ui.visible = false;
  4361. break;
  4362. case this.ui.rnNode.btnCheck:
  4363. this.check();
  4364. break;
  4365. case this.ui.rnNode.btnExit:
  4366. case this.ui.xyNode.btnNo:
  4367. this.ysxyNum--;
  4368. if (this.ysxyNum > 0)
  4369. this.showMsg("Refuse to quit the game once again");
  4370. else {
  4371. Moyu.userAgree(false);
  4372. Moyu.exit();
  4373. }
  4374. break;
  4375. case this.ui.xyNode.btnSure:
  4376. case this.ui.xyNode.btnYes:
  4377. DataMgr.userData.isAgree = true;
  4378. DataMgr.saveUserData();
  4379. this.onAgree();
  4380. break;
  4381. case this.ui.rnNode.btnDone:
  4382. this.ui.rnNode.visible = false;
  4383. this.ui.visible = false;
  4384. break;
  4385. case this.ui.fcmNode.btnRn:
  4386. this.showRn();
  4387. break;
  4388. }
  4389. }
  4390. showTip(show) {
  4391. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4392. return;
  4393. if (show) {
  4394. MoyuMgr.isAdvise = true;
  4395. this.ui.visible = true;
  4396. this.ui.tipNode.visible = true;
  4397. this.ui.tipNode.alpha = 1;
  4398. Laya.timer.once(1000, this, this.showTip, [false]);
  4399. }
  4400. else {
  4401. this.ui.tipNode.alpha = 1;
  4402. this.ui.tipNode.visible = true;
  4403. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4404. this.ui.tipNode.visible = false;
  4405. MoyuMgr.isAdvise = false;
  4406. }), 1000);
  4407. }
  4408. }
  4409. showAge(show, px = 0, py = 0) {
  4410. if (Moyu.platType > 10 && !Moyu.isIos) {
  4411. this.ui.ageTip.x = px;
  4412. this.ui.ageTip.y = py;
  4413. this.ui.ageTip.visible = show;
  4414. if (show)
  4415. this.ui.visible = true;
  4416. }
  4417. }
  4418. showAgree(call) {
  4419. this.agreeCall = call;
  4420. this.onAgree();
  4421. return;
  4422. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4423. this.showXy(0);
  4424. }
  4425. else
  4426. this.onAgree();
  4427. }
  4428. onAgree() {
  4429. if (!this.ui.ageNode.visible)
  4430. this.ui.visible = false;
  4431. this.ui.xyNode.visible = false;
  4432. Moyu.userAgree(true);
  4433. this.showAge(false);
  4434. this.agreeCall && this.agreeCall();
  4435. this.showRn();
  4436. }
  4437. showMsg(txt) {
  4438. this.ui.msgNode.txtMsg.text = txt;
  4439. this.ui.msgNode.visible = true;
  4440. this.ui.msgNode.alpha = 1;
  4441. this.ui.visible = true;
  4442. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4443. this.ui.msgNode.visible = false;
  4444. }), 2500, true);
  4445. }
  4446. showRn() {
  4447. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4448. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4449. this.ui.rnNode.rn1.visible = true;
  4450. this.ui.rnNode.rn2.visible = false;
  4451. this.ui.rnNode.rn3.visible = false;
  4452. this.ui.rnNode.rn4.visible = false;
  4453. this.ui.rnNode.visible = true;
  4454. this.ui.mainBg.visible = true;
  4455. this.ui.rnNode.btnDone.visible = false;
  4456. this.ui.rnNode.btnExit.visible = true;
  4457. this.ui.rnNode.btnCheck.visible = true;
  4458. this.ui.fcmNode.visible = false;
  4459. this.ui.visible = true;
  4460. return;
  4461. }
  4462. }
  4463. this.showFcm();
  4464. }
  4465. showFcm() {
  4466. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4467. Moyu.initFCM(true);
  4468. if (Moyu.gameTime < 1)
  4469. this.fcmLoop();
  4470. else if (Moyu.gameTime < 999)
  4471. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4472. }
  4473. }
  4474. fcmLoop() {
  4475. if (Moyu.gameTime < 1) {
  4476. this.ui.rnNode.visible = false;
  4477. this.ui.fcmNode.visible = true;
  4478. this.ui.mainBg.visible = true;
  4479. this.ui.visible = true;
  4480. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4481. Laya.timer.clear(this.ui, this.fcmLoop);
  4482. }
  4483. }
  4484. check() {
  4485. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4486. this.ui.rnNode.rn1.visible = false;
  4487. this.ui.rnNode.rn2.visible = false;
  4488. this.ui.rnNode.rn4.visible = true;
  4489. }
  4490. else if (this.ui.rnNode.rn4.visible) {
  4491. let name = this.ui.rnNode.inputName.text;
  4492. let code = this.ui.rnNode.inputCode.text;
  4493. if (code && code.length == 18) {
  4494. this.ui.rnNode.rn1.visible = false;
  4495. this.ui.rnNode.rn4.visible = false;
  4496. Moyu.authenticate(name, code, (res) => {
  4497. this.ui.rnNode.rn2.visible = !res;
  4498. this.ui.rnNode.rn3.visible = res;
  4499. this.ui.rnNode.btnDone.visible = res;
  4500. this.ui.rnNode.btnExit.visible = !res;
  4501. this.ui.rnNode.btnCheck.visible = !res;
  4502. if (res)
  4503. this.showFcm();
  4504. });
  4505. }
  4506. else
  4507. this.showMsg("信息填写不完整");
  4508. }
  4509. }
  4510. loadXy(type = 0) {
  4511. this.ui.xyNode.xy1.visible = false;
  4512. this.ui.xyNode.xy2.visible = true;
  4513. this.ui.xyNode.xyList.scrollToView(0);
  4514. if (type == 1) {
  4515. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4516. }
  4517. else if (type == 2) {
  4518. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4519. }
  4520. }
  4521. showXy(type = 0) {
  4522. this.xyBtn();
  4523. if (type == 0) {
  4524. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4525. this.ui.xyNode.btnSure.visible = true;
  4526. }
  4527. else {
  4528. this.ui.xyNode.btnYes.visible = true;
  4529. this.ui.xyNode.btnNo.visible = true;
  4530. }
  4531. }
  4532. else {
  4533. this.ui.xyNode.btnKnown.visible = true;
  4534. this.ui.mainBg.visible = true;
  4535. }
  4536. this.ui.xyNode.xy1.visible = true;
  4537. this.ui.xyNode.xy2.visible = false;
  4538. this.ui.xyNode.visible = true;
  4539. this.ui.visible = true;
  4540. }
  4541. xyBtn() {
  4542. this.ui.xyNode.btnSure.visible = false;
  4543. this.ui.xyNode.btnYes.visible = false;
  4544. this.ui.xyNode.btnNo.visible = false;
  4545. this.ui.xyNode.btnKnown.visible = false;
  4546. {
  4547. this.ui.xyNode.btnXy3.visible = false;
  4548. this.ui.xyNode.btnXy2.visible = true;
  4549. this.ui.xyNode.btnXy1.visible = true;
  4550. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4551. }
  4552. }
  4553. createXY(json) {
  4554. this.ysJson = json.content;
  4555. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4556. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4557. this.ui.xyNode.xy2.visible = true;
  4558. }
  4559. renderListItem(idx, cell) {
  4560. let xy = this.ysJson[idx];
  4561. cell.height = xy.line * 30;
  4562. cell.xyItem.text = xy.text;
  4563. }
  4564. onDestroy() {
  4565. this.agreeCall = null;
  4566. }
  4567. }
  4568. class SettingNode {
  4569. constructor(ui) {
  4570. this.showSetting = false;
  4571. this.openSound = true;
  4572. this.openShake = true;
  4573. this.ui = ui;
  4574. this.ui.soundBtn.onClick(this, this.switchSound);
  4575. this.ui.shakeBtn.onClick(this, this.switchShake);
  4576. this.ui.xyBtn.onClick(this, this.onXy);
  4577. this.ui.clickNode.onClick(this, this.changeSetting);
  4578. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4579. this.ui.xyBtn.visible = false;
  4580. this.ui.shakeBtn.visible = false;
  4581. }
  4582. changeSetting() {
  4583. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4584. this.showSetting = !this.showSetting;
  4585. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4586. }
  4587. switchSound() {
  4588. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4589. this.openSound = !this.openSound;
  4590. Moyu.onSetting(this.openSound, this.openShake);
  4591. xGame.soundMgr.onSetting(this.openSound);
  4592. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4593. }
  4594. switchShake() {
  4595. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4596. this.openShake = !this.openShake;
  4597. Moyu.onSetting(this.openSound, this.openShake);
  4598. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4599. }
  4600. onXy() {
  4601. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4602. MoyuMgr.showXy(1);
  4603. }
  4604. }
  4605. class ui_UILevelDisplay extends fgui.GComponent {
  4606. static createInstance() {
  4607. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4608. }
  4609. onConstruct() {
  4610. this.n9 = (this.getChild("n9"));
  4611. this.myNode = (this.getChild("myNode"));
  4612. this.closeNode = (this.getChild("closeNode"));
  4613. }
  4614. }
  4615. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4616. class ui_UILevelProp extends fgui.GComponent {
  4617. static createInstance() {
  4618. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4619. }
  4620. onConstruct() {
  4621. this.n16 = (this.getChild("n16"));
  4622. this.myNode = (this.getChild("myNode"));
  4623. this.closeBtn = (this.getChild("closeBtn"));
  4624. this.moneyNode = (this.getChild("moneyNode"));
  4625. this.t1 = this.getTransition("t1");
  4626. }
  4627. }
  4628. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4629. class ui_ShowItem extends fgui.GComponent {
  4630. static createInstance() {
  4631. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4632. }
  4633. onConstruct() {
  4634. this.myImg = (this.getChild("myImg"));
  4635. }
  4636. }
  4637. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4638. class ShowItem {
  4639. constructor() {
  4640. this.ui = ui_ShowItem.createInstance();
  4641. }
  4642. destroySelf() {
  4643. if (!this.ui.isDisposed) {
  4644. this.ui.removeFromParent();
  4645. this.ui.dispose();
  4646. }
  4647. }
  4648. setParent(parent) {
  4649. parent.addChild(this.ui);
  4650. }
  4651. setPos(x, y) {
  4652. this.ui.x = x;
  4653. this.ui.y = y;
  4654. }
  4655. setUrl(index) {
  4656. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4657. }
  4658. }
  4659. class ui_UIPower extends fgui.GComponent {
  4660. static createInstance() {
  4661. return (fgui.UIPackage.createObject("game", "UIPower"));
  4662. }
  4663. onConstruct() {
  4664. this.n11 = (this.getChild("n11"));
  4665. this.myNode = (this.getChild("myNode"));
  4666. this.t0 = this.getTransition("t0");
  4667. }
  4668. }
  4669. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4670. class UIPower extends UIBase {
  4671. constructor() {
  4672. super();
  4673. }
  4674. onConstructor() {
  4675. this.ui = ui_UIPower.createInstance();
  4676. this.contentPane = this.ui;
  4677. this.isEject = false;
  4678. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4679. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4680. }
  4681. show() {
  4682. super.show();
  4683. this.ui.t0.play();
  4684. }
  4685. videoGetPower() {
  4686. console.log('zh:qjff_AD_for_uipower');
  4687. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4688. }
  4689. else {
  4690. console.log('zh:AD 失败,直接发放奖励');
  4691. this.qjff_AD_for_uipower();
  4692. }
  4693. }
  4694. qjff_AD_for_uipower() {
  4695. DataMgr.setPower(xGame.common.videoPower, true);
  4696. xGame.eventMgr.event(POWER_TIME);
  4697. this.hide();
  4698. }
  4699. }
  4700. UIPower.uiName = "UIPower";
  4701. class UILevelProp extends UIBase {
  4702. constructor() {
  4703. super();
  4704. this.firstPos = 385;
  4705. this.secondPos = 467;
  4706. this.showItemArr = [];
  4707. }
  4708. onConstructor() {
  4709. this.ui = ui_UILevelProp.createInstance();
  4710. this.contentPane = this.ui;
  4711. this.isEject = false;
  4712. this.addUIClick(this.ui.closeBtn, this.hide);
  4713. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4714. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4715. }
  4716. show(level) {
  4717. super.show();
  4718. this.ui.t1.play();
  4719. this.level = level;
  4720. this.data = cfgTable.placeballData[this.level];
  4721. this.updateSelf();
  4722. this.showPreView();
  4723. this.moneyNode.ui.c1.selectedIndex = 2;
  4724. this.moneyNode.checkPowerTime();
  4725. this.moneyNode.powerChange();
  4726. }
  4727. showPreView() {
  4728. let item;
  4729. let data;
  4730. for (let index = 0; index < this.showItemArr.length; index++) {
  4731. item = this.showItemArr[index];
  4732. item.destroySelf();
  4733. }
  4734. this.showItemArr = [];
  4735. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4736. for (const key in cfgData) {
  4737. data = cfgData[key];
  4738. item = new ShowItem();
  4739. item.setParent(this.ui.myNode.displayRoot);
  4740. item.setPos(data.x, data.y);
  4741. item.setUrl(data.value);
  4742. this.showItemArr.push(item);
  4743. }
  4744. }
  4745. updateSelf() {
  4746. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4747. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4748. if (this.data.ball == -1) {
  4749. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4750. }
  4751. else {
  4752. this.ui.myNode.conditionTxt.text = "Reward";
  4753. }
  4754. let localData = DataMgr.getPlaceBallLevel(this.level);
  4755. let getAward = localData.getAward;
  4756. let cfg = cfgTable.placeballData[this.level];
  4757. let coin = this.data.award[0];
  4758. let diamond = this.data.award[1];
  4759. if (cfg.type == PlaceBallType.challenge) {
  4760. diamond = 0;
  4761. coin = 100;
  4762. }
  4763. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4764. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4765. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4766. if (cfg.type == PlaceBallType.challenge) {
  4767. this.ui.myNode.coinNode.numTxt.text = "";
  4768. }
  4769. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4770. if (coin > 0 && diamond > 0) {
  4771. this.ui.myNode.diamondNode.x = 385;
  4772. this.ui.myNode.coinNode.x = 467;
  4773. }
  4774. else {
  4775. this.ui.myNode.diamondNode.x = 385;
  4776. this.ui.myNode.coinNode.x = 385;
  4777. }
  4778. if (!getAward) {
  4779. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4780. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4781. }
  4782. else {
  4783. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4784. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4785. }
  4786. }
  4787. startGame() {
  4788. if (DataMgr.powerEnough()) {
  4789. this.ui.myNode.startBtn.touchable = false;
  4790. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4791. console.log('zh:startGame ');
  4792. this.ui.myNode.startBtn.touchable = true;
  4793. DataMgr.setPower(-1);
  4794. xGame.eventMgr.event(POWER_TIME);
  4795. xGame.common.gameMode = GameMode.placeBall;
  4796. xGame.common.placeBallCurLevel = this.level;
  4797. xGame.uiMgr.Show(UIGame);
  4798. xGame.uiMgr.Hide(UILevelDisplay);
  4799. xGame.uiMgr.Hide(UIMain);
  4800. this.hide();
  4801. }));
  4802. }
  4803. else {
  4804. console.log('zh:startGame no power');
  4805. xGame.uiMgr.Show(UIPower);
  4806. }
  4807. }
  4808. hide() {
  4809. super.hide();
  4810. }
  4811. }
  4812. UILevelProp.uiName = "UILevelProp";
  4813. class PutBallLevelDisplay {
  4814. constructor(ui, index) {
  4815. this.index = 0;
  4816. this.ui = ui;
  4817. this.index = index;
  4818. this.ui.onClick(this, this.clickSelf);
  4819. this.updateSelf();
  4820. this.ui.levelTxt.text = (this.index + 1) + "";
  4821. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4822. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4823. }
  4824. updateSelf() {
  4825. let level = this.index + 1;
  4826. this.data = DataMgr.getPlaceBallLevel(level);
  4827. this.ui.starNode.c1.selectedIndex = this.data.star;
  4828. let isChallenge = cfgTable.placeballData[level].type;
  4829. if (this.data.isCur) {
  4830. if (isChallenge) {
  4831. this.ui.c1.selectedIndex = 5;
  4832. }
  4833. else {
  4834. this.ui.c1.selectedIndex = 2;
  4835. }
  4836. }
  4837. else {
  4838. if (this.data.play) {
  4839. if (this.data.star == 3) {
  4840. this.ui.c1.selectedIndex = 0;
  4841. }
  4842. else {
  4843. this.ui.c1.selectedIndex = 1;
  4844. }
  4845. }
  4846. else {
  4847. if (isChallenge) {
  4848. this.ui.c1.selectedIndex = 4;
  4849. }
  4850. else {
  4851. this.ui.c1.selectedIndex = 3;
  4852. }
  4853. }
  4854. }
  4855. }
  4856. clickSelf() {
  4857. if (!this.data.play)
  4858. return;
  4859. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4860. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4861. }
  4862. }
  4863. class UILevelDisplay extends UIBase {
  4864. constructor() {
  4865. super();
  4866. }
  4867. onConstructor() {
  4868. this.ui = ui_UILevelDisplay.createInstance();
  4869. this.contentPane = this.ui;
  4870. this.isEject = false;
  4871. this.myList = this.ui.myNode.myList;
  4872. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4873. this.levelItemArr = [];
  4874. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4875. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4876. this.myList.numItems = levelNum;
  4877. if (Moyu.isKs)
  4878. this.ui.closeNode.closeBtn.x += 100;
  4879. }
  4880. levelItemRender(index, target) {
  4881. let item = new PutBallLevelDisplay(target, index);
  4882. this.levelItemArr.push(item);
  4883. }
  4884. show() {
  4885. super.show();
  4886. this.updateLevel();
  4887. this.scrollToPlace();
  4888. }
  4889. updateLevel() {
  4890. let temp;
  4891. for (let index = 0; index < this.levelItemArr.length; index++) {
  4892. temp = this.levelItemArr[index];
  4893. temp.updateSelf();
  4894. }
  4895. }
  4896. scrollToPlace() {
  4897. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4898. let passArr = DataMgr.getPlaceBallLevelList();
  4899. let offest = passArr.length;
  4900. if (offest >= maxNum - 1)
  4901. offest = maxNum - 1;
  4902. this.myList.scrollToView(offest, true, true);
  4903. }
  4904. hide() {
  4905. super.hide();
  4906. }
  4907. }
  4908. UILevelDisplay.uiName = "UILevelDisplay";
  4909. class ui_UIMatching extends fgui.GComponent {
  4910. static createInstance() {
  4911. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4912. }
  4913. onConstruct() {
  4914. this.n5 = (this.getChild("n5"));
  4915. this.n49 = (this.getChild("n49"));
  4916. this.n51 = (this.getChild("n51"));
  4917. this.n64 = (this.getChild("n64"));
  4918. this.n2 = (this.getChild("n2"));
  4919. this.n53 = (this.getChild("n53"));
  4920. this.n54 = (this.getChild("n54"));
  4921. this.n56 = (this.getChild("n56"));
  4922. this.n58 = (this.getChild("n58"));
  4923. this.n59 = (this.getChild("n59"));
  4924. this.n57 = (this.getChild("n57"));
  4925. this.n60 = (this.getChild("n60"));
  4926. this.n62 = (this.getChild("n62"));
  4927. this.awardTxt = (this.getChild("awardTxt"));
  4928. this.n61 = (this.getChild("n61"));
  4929. this.selfHead = (this.getChild("selfHead"));
  4930. this.aiHead = (this.getChild("aiHead"));
  4931. this.n82 = (this.getChild("n82"));
  4932. this.n84 = (this.getChild("n84"));
  4933. this.n83 = (this.getChild("n83"));
  4934. this.t1 = this.getTransition("t1");
  4935. this.t2 = this.getTransition("t2");
  4936. this.t3 = this.getTransition("t3");
  4937. this.t4 = this.getTransition("t4");
  4938. }
  4939. }
  4940. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4941. class UIMatching extends UIBase {
  4942. constructor() {
  4943. super();
  4944. }
  4945. onConstructor() {
  4946. this.ui = ui_UIMatching.createInstance();
  4947. this.contentPane = this.ui;
  4948. this.isEject = false;
  4949. }
  4950. show(callback) {
  4951. super.show();
  4952. PlatMgr.showBanner(true);
  4953. this.callback = callback;
  4954. let user = Moyu.getUserInfo();
  4955. if (!this.selfPot) {
  4956. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4957. }
  4958. if (!this.aiPot) {
  4959. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4960. }
  4961. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4962. this.ui.selfHead.nameTxt.text = user.nickName;
  4963. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4964. this.ui.aiHead.nameTxt.text = "???";
  4965. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4966. this.ui.selfHead.c1.selectedIndex = 0;
  4967. this.ui.aiHead.c1.selectedIndex = 0;
  4968. this.ui.selfHead.x = this.selfPot.x;
  4969. this.ui.selfHead.y = this.selfPot.y;
  4970. this.ui.aiHead.x = this.aiPot.x;
  4971. this.ui.aiHead.y = this.aiPot.y;
  4972. switch (xGame.common.gameMode) {
  4973. case GameMode.classic:
  4974. break;
  4975. case GameMode.bigMove:
  4976. this.initSkillData();
  4977. break;
  4978. default:
  4979. break;
  4980. }
  4981. this.ui.t1.play(Laya.Handler.create(this, () => {
  4982. this.ui.t2.play(Laya.Handler.create(this, () => {
  4983. switch (xGame.common.gameMode) {
  4984. case GameMode.classic:
  4985. this.waitingPeople();
  4986. break;
  4987. case GameMode.bigMove:
  4988. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4989. break;
  4990. default:
  4991. break;
  4992. }
  4993. }));
  4994. }));
  4995. }
  4996. initSkillData() {
  4997. this.skillSelectData = [];
  4998. let skillUrl = xGame.common.skillIconList;
  4999. let skillName = xGame.common.skillNameList;
  5000. let skillLevel = DataMgr.getBigSkillList();
  5001. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5002. for (let index = 0; index < 5; index++) {
  5003. let obj = {};
  5004. obj.skillImg = skillUrl[index];
  5005. obj.skillName = skillName[index];
  5006. obj.skillType = skillType[index];
  5007. obj.skillLevel = skillLevel[index];
  5008. this.skillSelectData.push(obj);
  5009. }
  5010. }
  5011. getAISkillLevel(myLevel) {
  5012. let video = xGame.common.upSkillLevel;
  5013. let aiLevel;
  5014. let temp;
  5015. if (video) {
  5016. temp = xGame.common.randomNum(-2, -1);
  5017. }
  5018. else {
  5019. if (myLevel <= 5) {
  5020. temp = xGame.common.randomNum(1, 3);
  5021. }
  5022. else if (myLevel <= 9) {
  5023. temp = xGame.common.randomNum(-2, 1);
  5024. }
  5025. else {
  5026. temp = xGame.common.randomNum(-4, 0);
  5027. }
  5028. }
  5029. aiLevel = temp + myLevel;
  5030. if (aiLevel <= 1)
  5031. aiLevel = 1;
  5032. if (aiLevel >= 10)
  5033. aiLevel = 10;
  5034. return aiLevel;
  5035. }
  5036. getAISkillType() {
  5037. return xGame.common.randomNum(1, 4);
  5038. let successTimes = DataMgr.getSkillSuccessTimes();
  5039. let info = cfgTable.aiskillData[successTimes];
  5040. if (!info) {
  5041. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5042. info = cfgTable.aiskillData[max];
  5043. }
  5044. let dataArr = info.skillselect;
  5045. let myCfg = {};
  5046. for (let index = 0; index < dataArr.length; index++) {
  5047. let temp = dataArr[index].split('-');
  5048. myCfg[temp[0]] = {};
  5049. myCfg[temp[0]].id = parseInt(temp[0]);
  5050. myCfg[temp[0]].weight = parseInt(temp[1]);
  5051. }
  5052. let aiCfg = xGame.common.initWeight(myCfg);
  5053. let curData = xGame.common.getRandomWeightData(aiCfg);
  5054. return parseInt(curData.id);
  5055. }
  5056. getAISkillData(index) {
  5057. let myLevel = this.skillSelectData[index].skillLevel;
  5058. let aiLevel = this.getAISkillLevel(myLevel);
  5059. let aiType = this.getAISkillType() - 1;
  5060. return { aiLevel, aiType } = { aiLevel, aiType };
  5061. }
  5062. skillSelectFinish(index) {
  5063. let aiInfo = this.getAISkillData(index);
  5064. xGame.common.gameMgr.selfCurSkill = index;
  5065. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5066. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5067. this.ui.selfHead.c1.selectedIndex = 1;
  5068. this.ui.aiHead.c1.selectedIndex = 1;
  5069. let myData = this.skillSelectData[index];
  5070. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5071. let guide = DataMgr.getSkillGuide();
  5072. if (guide == 0) {
  5073. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5074. }
  5075. else {
  5076. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5077. }
  5078. let aiData = this.skillSelectData[aiInfo.aiType];
  5079. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5080. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5081. this.waitingPeople();
  5082. }
  5083. waitingPeople() {
  5084. let time = xGame.common.randomNum(1000, 3000);
  5085. time += 1000;
  5086. Laya.timer.once(time, this, () => {
  5087. this.matchingSuccess();
  5088. });
  5089. }
  5090. matchingSuccess() {
  5091. let gameUI = xGame.common.gameUI;
  5092. let name = gameUI.ui.topNode.aiNameTxt.text;
  5093. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5094. this.ui.aiHead.nameTxt.text = name;
  5095. this.ui.aiHead.headImg.url = url;
  5096. name = gameUI.ui.topNode.selfNameTxt.text;
  5097. url = gameUI.ui.topNode.selfHeadLoader.url;
  5098. this.ui.selfHead.nameTxt.text = name;
  5099. this.ui.selfHead.headImg.url = url;
  5100. this.ui.t3.play(Laya.Handler.create(this, () => {
  5101. this.callback && this.callback();
  5102. this.ui.t4.play(Laya.Handler.create(this, () => {
  5103. this.destroySelf();
  5104. }));
  5105. }));
  5106. }
  5107. destroySelf() {
  5108. this.callback = null;
  5109. this.skillSelectData = null;
  5110. this.selfPot = null;
  5111. this.aiPot = null;
  5112. if (!this.ui.isDisposed) {
  5113. this.ui.removeFromParent();
  5114. this.ui.dispose();
  5115. }
  5116. xGame.uiMgr.destroyUI(this);
  5117. }
  5118. }
  5119. UIMatching.uiName = "UIMatching";
  5120. class ui_UIRanking extends fgui.GComponent {
  5121. static createInstance() {
  5122. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5123. }
  5124. onConstruct() {
  5125. this.n26 = (this.getChild("n26"));
  5126. this.myNode = (this.getChild("myNode"));
  5127. }
  5128. }
  5129. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5130. class UIRanking extends UIBase {
  5131. constructor() {
  5132. super();
  5133. this.showSelf = true;
  5134. this.rankType = 1;
  5135. this.rankList = [];
  5136. this.myIndex = 0;
  5137. this.myStar = 0;
  5138. }
  5139. onConstructor() {
  5140. this.ui = ui_UIRanking.createInstance();
  5141. this.contentPane = this.ui;
  5142. this.isEject = false;
  5143. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5144. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5145. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5146. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5147. this.ui.myNode.myList.setVirtual();
  5148. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5149. }
  5150. show() {
  5151. super.show();
  5152. this.myIndex = 51;
  5153. Moyu.getRankList({
  5154. rankId: xGame.common.curRankID,
  5155. type: MoyuRankType.total,
  5156. page: 1,
  5157. pageSize: 50,
  5158. }, this, this.updateItemData);
  5159. this.updateSelf();
  5160. let self = Moyu.getUserInfo();
  5161. if (!self.isAuth) {
  5162. Moyu.initUser(this, () => {
  5163. DataMgr.upRankData();
  5164. });
  5165. }
  5166. }
  5167. updateSelfItem() {
  5168. let self = Moyu.getUserInfo();
  5169. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5170. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  5171. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5172. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  5173. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5174. }
  5175. updateItemData(data) {
  5176. this.myStar = xGame.common.getAllStarNum();
  5177. if (this.rankList.length < 2) {
  5178. this.rankList = data;
  5179. let self = Moyu.getUserInfo();
  5180. for (let i = 0; i < data.length; i++) {
  5181. let data = this.rankList[i];
  5182. if (data.userId == self.userId) {
  5183. this.rankList.splice(i, 1);
  5184. break;
  5185. }
  5186. }
  5187. for (let i = 0; i < data.length; i++) {
  5188. let data = this.rankList[i];
  5189. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5190. this.myIndex = i + 1;
  5191. let user = { headIcon: self.headIcon, nickName: "myself" };
  5192. let ud = { user: user, data: {} };
  5193. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5194. if (Moyu.platType < 11) {
  5195. user.headIcon = self.headIcon;
  5196. user.nickName = self.nickName;
  5197. }
  5198. this.rankList.splice(i, 0, md);
  5199. break;
  5200. }
  5201. }
  5202. }
  5203. this.updateSelfItem();
  5204. this.ui.myNode.myList.numItems = this.rankList.length;
  5205. }
  5206. updateItemUI(index, obj) {
  5207. let data = this.rankList[index];
  5208. let userData = JSON.parse(data.userData).user;
  5209. obj.nameTxt.text = userData.nickName.toString();
  5210. obj.valueTxt.text = data.rankScore;
  5211. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5212. obj.rankTxt.text = index + 1;
  5213. switch (index) {
  5214. case 0:
  5215. this.setImg(obj, 1, 0, 0);
  5216. obj.rankTxt.color = "#FFC047";
  5217. break;
  5218. case 1:
  5219. this.setImg(obj, 0, 1, 0);
  5220. obj.rankTxt.color = "#ACACAC";
  5221. break;
  5222. case 2:
  5223. this.setImg(obj, 0, 0, 1);
  5224. obj.rankTxt.color = "#D09672";
  5225. break;
  5226. default:
  5227. this.setImg(obj, 0, 0, 0);
  5228. obj.rankTxt.color = "#496FAB";
  5229. break;
  5230. }
  5231. }
  5232. setImg(obj, a, b, c) {
  5233. obj.img1.visible = a ? true : false;
  5234. obj.img2.visible = b ? true : false;
  5235. obj.img3.visible = c ? true : false;
  5236. }
  5237. changeList(type) {
  5238. this.rankType = type;
  5239. this.updateSelf();
  5240. }
  5241. changeSelfNode() {
  5242. this.showSelf = !this.showSelf;
  5243. this.updateSelf();
  5244. }
  5245. updateSelf() {
  5246. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5247. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5248. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5249. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5250. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5251. }
  5252. }
  5253. UIRanking.uiName = "UIRanking";
  5254. class ui_UISecretary extends fgui.GComponent {
  5255. static createInstance() {
  5256. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5257. }
  5258. onConstruct() {
  5259. this.n0 = (this.getChild("n0"));
  5260. this.myNode = (this.getChild("myNode"));
  5261. this.closeBtn = (this.getChild("closeBtn"));
  5262. this.t0 = this.getTransition("t0");
  5263. }
  5264. }
  5265. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5266. class UISecretary extends UIBase {
  5267. constructor() {
  5268. super();
  5269. this.curIndex = 1;
  5270. }
  5271. onConstructor() {
  5272. this.ui = ui_UISecretary.createInstance();
  5273. this.contentPane = this.ui;
  5274. this.isEject = false;
  5275. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5276. this.nodeObj = { left: null, right: null, cur: null };
  5277. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5278. }
  5279. show() {
  5280. super.show();
  5281. this.ui.t0.play();
  5282. this.updateData();
  5283. }
  5284. addSecretarySpine(node, spineName) {
  5285. if (spineName == "mishu") {
  5286. if (this.secretarySpine1) {
  5287. node.displayObject.destroyChildren();
  5288. this.playWoman(this.secretarySpine1, node.displayObject);
  5289. }
  5290. else {
  5291. let spine1 = new SpineMgr("mishu", () => {
  5292. this.secretarySpine1 = spine1;
  5293. this.playWoman(this.secretarySpine1, node.displayObject);
  5294. });
  5295. }
  5296. }
  5297. else {
  5298. if (this.secretarySpine2) {
  5299. node.displayObject.destroyChildren();
  5300. this.playWoman(this.secretarySpine2, node.displayObject);
  5301. }
  5302. else {
  5303. let spine2 = new SpineMgr("xiaomishu2", () => {
  5304. this.secretarySpine2 = spine2;
  5305. this.playWoman(this.secretarySpine2, node.displayObject);
  5306. });
  5307. }
  5308. }
  5309. }
  5310. playWoman(node, parent) {
  5311. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5312. let yy = this.ui.myNode.gameNode3.secretary.height;
  5313. let scale = 1.5;
  5314. if (node == this.secretarySpine2) {
  5315. scale = 1.2;
  5316. }
  5317. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5318. node.play(data, 0, true, parent);
  5319. }
  5320. turnLeft() {
  5321. this.curIndex--;
  5322. if (this.curIndex < 1) {
  5323. this.curIndex = 2;
  5324. }
  5325. let left = this.nodeObj.left;
  5326. let right = this.nodeObj.right;
  5327. let cur = this.nodeObj.cur;
  5328. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5329. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5330. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5331. this.updateData();
  5332. }));
  5333. this.ui.myNode.setChildIndex(right, 2);
  5334. this.nodeObj.left = cur;
  5335. this.nodeObj.right = left;
  5336. this.nodeObj.cur = right;
  5337. }
  5338. turnRight() {
  5339. this.curIndex++;
  5340. if (this.curIndex > 2) {
  5341. this.curIndex = 1;
  5342. }
  5343. let left = this.nodeObj.left;
  5344. let right = this.nodeObj.right;
  5345. let cur = this.nodeObj.cur;
  5346. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5347. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5348. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5349. this.updateData();
  5350. }));
  5351. this.ui.myNode.setChildIndex(left, 2);
  5352. this.nodeObj.left = right;
  5353. this.nodeObj.right = cur;
  5354. this.nodeObj.cur = left;
  5355. }
  5356. updateData() {
  5357. let data = cfgTable.secretaryshopData;
  5358. let children = this.ui.myNode._children;
  5359. let temp;
  5360. let curData;
  5361. for (let index = 0; index < children.length; index++) {
  5362. temp = children[index];
  5363. curData = data[1];
  5364. temp.heightTxt.text = curData.height;
  5365. temp.foodTxt.text = curData.food;
  5366. temp.historyTxt.text = curData.history;
  5367. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5368. this.addSecretarySpine(temp.secretary, curData.spine);
  5369. let womanIndex = curData.id - 1;
  5370. let getWoman = DataMgr.getSecretary(womanIndex);
  5371. let curUse = DataMgr.getCurSecretary();
  5372. if (getWoman) {
  5373. if (curUse == womanIndex) {
  5374. temp.purchaseBtn.c1.selectedIndex = 1;
  5375. }
  5376. else {
  5377. temp.purchaseBtn.c1.selectedIndex = 2;
  5378. }
  5379. }
  5380. else {
  5381. temp.purchaseBtn.c1.selectedIndex = 0;
  5382. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5383. }
  5384. temp.purchaseBtn.offClick(this, this.clickSecretary);
  5385. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  5386. }
  5387. }
  5388. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5389. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5390. if (getWoman) {
  5391. if (curUse != womanIndex) {
  5392. console.log();
  5393. DataMgr.setCurSecretary(womanIndex);
  5394. this.updateData();
  5395. }
  5396. }
  5397. else {
  5398. let need = needDiamond;
  5399. if (DataMgr.diamondEnough(need)) {
  5400. DataMgr.setDiamond(-need);
  5401. DataMgr.setSecretary(womanIndex, 1);
  5402. DataMgr.setCurSecretary(womanIndex);
  5403. this.updateData();
  5404. }
  5405. else {
  5406. xGame.uiMgr.Show(UIAddProp, 1);
  5407. }
  5408. }
  5409. }
  5410. closeSelf() {
  5411. this.hide();
  5412. }
  5413. }
  5414. UISecretary.uiName = "UISecretary";
  5415. class ui_UIShop extends fgui.GComponent {
  5416. static createInstance() {
  5417. return (fgui.UIPackage.createObject("game", "UIShop"));
  5418. }
  5419. onConstruct() {
  5420. this.n48 = (this.getChild("n48"));
  5421. this.n0 = (this.getChild("n0"));
  5422. this.secretary = (this.getChild("secretary"));
  5423. this.talkNode = (this.getChild("talkNode"));
  5424. this.closeNode = (this.getChild("closeNode"));
  5425. this.moneyNode = (this.getChild("moneyNode"));
  5426. this.myNode = (this.getChild("myNode"));
  5427. }
  5428. }
  5429. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5430. class BallRodDisplay {
  5431. constructor(ui, index) {
  5432. this.index = 0;
  5433. this.uiIndex = 0;
  5434. this.ui = ui;
  5435. this.index = index;
  5436. this.initData();
  5437. }
  5438. initData() {
  5439. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5440. let data = cfgTable.ballrodData[this.index + 1];
  5441. this.ui.nameTxt.text = data.name;
  5442. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5443. this.ui.levelNode.c1.selectedIndex = data.quality;
  5444. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5445. if (data.spine) {
  5446. this.mySpine = new SpineMgr(data.spine, () => {
  5447. let xx = 150;
  5448. let yy = 70;
  5449. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5450. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5451. });
  5452. }
  5453. }
  5454. updateSelf() {
  5455. let get = DataMgr.getBallRod(this.index);
  5456. if (get == null)
  5457. get = 1;
  5458. let curUse = DataMgr.getCurBallRod();
  5459. if (get) {
  5460. if (curUse == this.index) {
  5461. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5462. }
  5463. else {
  5464. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5465. }
  5466. }
  5467. else {
  5468. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5469. }
  5470. }
  5471. buyBallRod() {
  5472. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5473. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5474. switch (selectedIndex) {
  5475. case 0:
  5476. break;
  5477. case 1:
  5478. DataMgr.setCurBallRod(this.index);
  5479. let ui = xGame.uiMgr.getUI(UIShop);
  5480. ui.updateBallRod();
  5481. break;
  5482. case 2:
  5483. let data = cfgTable.ballrodData[this.index + 1];
  5484. let need = data.price;
  5485. if (DataMgr.diamondEnough(need)) {
  5486. DataMgr.setDiamond(-need);
  5487. DataMgr.setBallRod(this.index, 1);
  5488. DataMgr.setCurBallRod(this.index);
  5489. let ui = xGame.uiMgr.getUI(UIShop);
  5490. ui.updateBallRod();
  5491. }
  5492. else {
  5493. xGame.uiMgr.Show(UIAddProp, 1);
  5494. }
  5495. break;
  5496. default:
  5497. break;
  5498. }
  5499. }
  5500. }
  5501. class UIShop extends UIBase {
  5502. constructor() {
  5503. super();
  5504. this.itemNums = 0;
  5505. }
  5506. onConstructor() {
  5507. this.ui = ui_UIShop.createInstance();
  5508. this.contentPane = this.ui;
  5509. this.isEject = false;
  5510. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5511. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5512. this.addUIClick(this.ui, this.interuptSecretary);
  5513. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5514. this.ballRodArr = [];
  5515. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5516. this.ui.myNode.myList.numItems = this.itemNums;
  5517. if (Moyu.isKs)
  5518. this.ui.closeNode.closeBtn.x += 100;
  5519. }
  5520. show() {
  5521. super.show();
  5522. this.playSecretaryIdle();
  5523. this.updateBallRod();
  5524. }
  5525. updateBallRod() {
  5526. for (let index = 0; index < this.ballRodArr.length; index++) {
  5527. this.ballRodArr[index].updateSelf();
  5528. }
  5529. }
  5530. renderBallRod(sort, obj) {
  5531. let index = this.getIndexBySort(sort + 1) - 1;
  5532. let ballRod = new BallRodDisplay(obj, index);
  5533. this.ballRodArr.push(ballRod);
  5534. }
  5535. getIndexBySort(sort) {
  5536. let object = cfgTable.ballrodData;
  5537. for (const key in object) {
  5538. if (object[key].sort == sort) {
  5539. return parseInt(key);
  5540. }
  5541. }
  5542. }
  5543. playSecretaryIdle() {
  5544. let parent = this.ui.secretary.displayObject;
  5545. parent.destroyChildren();
  5546. let xx = this.ui.secretary.width / 2;
  5547. let yy = this.ui.secretary.height;
  5548. let scale = xGame.common.getSecretaryScale();
  5549. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5550. xGame.common.secretary.play(data, 0, true, parent);
  5551. }
  5552. interuptSecretary() {
  5553. Laya.timer.clearAll(this);
  5554. this.playSecretaryRandomSound();
  5555. }
  5556. playSecretaryRandomSound() {
  5557. if (this.isHide)
  5558. return;
  5559. let time = xGame.common.randomNum(45000, 60000);
  5560. Laya.timer.once(time, this, () => {
  5561. if (this.isHide)
  5562. return;
  5563. let index = xGame.common.randomNum(4, 7);
  5564. xGame.soundMgr.playSound("s_main0" + index);
  5565. let words = 1;
  5566. switch (index) {
  5567. case 4:
  5568. words = 5;
  5569. break;
  5570. case 5:
  5571. words = 3;
  5572. break;
  5573. case 6:
  5574. words = 6;
  5575. break;
  5576. case 7:
  5577. words = 7;
  5578. break;
  5579. default:
  5580. break;
  5581. }
  5582. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5583. this.playSecretaryRandomSound();
  5584. });
  5585. }
  5586. closeSelf() {
  5587. this.hide();
  5588. }
  5589. }
  5590. UIShop.uiName = "UIShop";
  5591. class ui_UISign extends fgui.GComponent {
  5592. static createInstance() {
  5593. return (fgui.UIPackage.createObject("game", "UISign"));
  5594. }
  5595. onConstruct() {
  5596. this.n6 = (this.getChild("n6"));
  5597. this.closeNode = (this.getChild("closeNode"));
  5598. this.myNode = (this.getChild("myNode"));
  5599. this.moneyNode = (this.getChild("moneyNode"));
  5600. this.secretary = (this.getChild("secretary"));
  5601. this.talkNode = (this.getChild("talkNode"));
  5602. this.tripleBtn = (this.getChild("tripleBtn"));
  5603. this.normalBtn = (this.getChild("normalBtn"));
  5604. this.tipsNode = (this.getChild("tipsNode"));
  5605. this.againBtn = (this.getChild("againBtn"));
  5606. this.t0 = this.getTransition("t0");
  5607. }
  5608. }
  5609. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5610. class SignMax {
  5611. constructor(ui) {
  5612. this.ui = ui;
  5613. }
  5614. updateSelf(index, sameDay, curDayIndex) {
  5615. let data = cfgTable.signData[index + 1];
  5616. this.ui.titleTxt.text = data.title;
  5617. let arr1 = data.award[0].split('-');
  5618. let arr2 = data.award[1].split('-');
  5619. let num1 = parseInt(arr1[1]);
  5620. let num2 = parseInt(arr2[1]);
  5621. this.ui.numTxt1.text = num1 + "";
  5622. this.ui.numTxt2.text = num2 + "";
  5623. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5624. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5625. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5626. this.ui.numTxt1.visible = false;
  5627. }
  5628. else {
  5629. this.ui.numTxt1.visible = true;
  5630. }
  5631. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5632. this.ui.numTxt2.visible = false;
  5633. }
  5634. else {
  5635. this.ui.numTxt2.visible = true;
  5636. }
  5637. if (index < curDayIndex) {
  5638. this.ui.c1.selectedIndex = 1;
  5639. }
  5640. else if (index == curDayIndex) {
  5641. if (sameDay) {
  5642. this.ui.c1.selectedIndex = 2;
  5643. }
  5644. else {
  5645. this.ui.c1.selectedIndex = 2;
  5646. }
  5647. }
  5648. else {
  5649. this.ui.c1.selectedIndex = 0;
  5650. }
  5651. }
  5652. }
  5653. class SignNormal {
  5654. constructor(ui) {
  5655. this.ui = ui;
  5656. }
  5657. updateSelf(index, sameDay, curDayIndex) {
  5658. let data = cfgTable.signData[index + 1];
  5659. this.ui.titleTxt.text = data.title;
  5660. let arr = data.award[0].split('-');
  5661. let type = parseInt(arr[0]);
  5662. let num = parseInt(arr[1]);
  5663. this.ui.numTxt.text = num + "";
  5664. if (type > 2) {
  5665. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5666. this.ui.myIcon.rotation = 0;
  5667. }
  5668. else {
  5669. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5670. this.ui.myIcon.rotation = 0;
  5671. }
  5672. if (xGame.common.signAwardContainsRod(data.award)) {
  5673. this.ui.numTxt.visible = false;
  5674. }
  5675. else {
  5676. this.ui.numTxt.visible = true;
  5677. }
  5678. if (index < curDayIndex) {
  5679. this.ui.c1.selectedIndex = 1;
  5680. }
  5681. else if (index == curDayIndex) {
  5682. if (sameDay) {
  5683. this.ui.c1.selectedIndex = 2;
  5684. }
  5685. else {
  5686. this.ui.c1.selectedIndex = 2;
  5687. }
  5688. }
  5689. else {
  5690. this.ui.c1.selectedIndex = 0;
  5691. }
  5692. }
  5693. }
  5694. class UISign extends UIBase {
  5695. constructor() {
  5696. super();
  5697. this.curDayIndex = 0;
  5698. this.starX = 0;
  5699. }
  5700. onConstructor() {
  5701. this.ui = ui_UISign.createInstance();
  5702. this.contentPane = this.ui;
  5703. this.isEject = false;
  5704. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5705. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5706. this.initSignItem();
  5707. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5708. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5709. }
  5710. show() {
  5711. super.show();
  5712. this.ui.t0.play();
  5713. this.playSecretaryIdle();
  5714. this.updateSign();
  5715. }
  5716. initSignItem() {
  5717. this.signArr = [];
  5718. for (let index = 0; index < 6; index++) {
  5719. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5720. this.signArr.push(temp);
  5721. }
  5722. this.signMax = new SignMax(this.ui.myNode.day7);
  5723. if (Moyu.isKs)
  5724. this.ui.closeNode.closeBtn.x += 100;
  5725. }
  5726. updateSign() {
  5727. let sameDay = xGame.common.judgeSameDay();
  5728. let max = 7;
  5729. this.curDayIndex = DataMgr.getSignData();
  5730. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5731. this.curDayIndex = 0;
  5732. if (!sameDay) {
  5733. this.ui.normalBtn.visible = true;
  5734. this.ui.tipsNode.visible = false;
  5735. this.ui.againBtn.visible = false;
  5736. }
  5737. else {
  5738. this.ui.normalBtn.visible = false;
  5739. let again = DataMgr.getExtraSign();
  5740. let isCurrency = false;
  5741. let index = this.curDayIndex;
  5742. if (index == 0)
  5743. index = 7;
  5744. let award = cfgTable.signData[index].award;
  5745. let num = award[0].split("-")[0];
  5746. if (num == "1" || num == "2")
  5747. isCurrency = true;
  5748. let showAgain = again == 0 && isCurrency;
  5749. this.ui.againBtn.visible = showAgain;
  5750. this.ui.tipsNode.visible = !showAgain;
  5751. }
  5752. for (let index = 0; index < this.signArr.length; index++) {
  5753. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5754. }
  5755. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5756. }
  5757. playSecretaryIdle() {
  5758. let parent = this.ui.secretary.displayObject;
  5759. parent.destroyChildren();
  5760. let xx = this.ui.secretary.width / 2;
  5761. let yy = this.ui.secretary.height;
  5762. let scale = xGame.common.getSecretaryScale();
  5763. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5764. xGame.common.secretary.play(data, 0, true, parent);
  5765. }
  5766. closeSelf() {
  5767. this.hide();
  5768. }
  5769. normalGetAward() {
  5770. let sameDay = xGame.common.judgeSameDay();
  5771. if (!sameDay) {
  5772. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5773. let temp;
  5774. let type;
  5775. let num;
  5776. let arr = [];
  5777. for (let index = 0; index < award.length; index++) {
  5778. temp = award[index].split("-");
  5779. type = parseInt(temp[0]);
  5780. num = parseInt(temp[1]);
  5781. let awardType = new AwardType();
  5782. awardType.num = num;
  5783. awardType.type = type;
  5784. arr.push(awardType);
  5785. }
  5786. xGame.common.getAward(arr, (watchVideo) => {
  5787. this.curDayIndex++;
  5788. if (this.curDayIndex > 7)
  5789. this.curDayIndex = 0;
  5790. DataMgr.setSignData(this.curDayIndex);
  5791. DataMgr.setSignTime(new Date().getTime());
  5792. if (watchVideo) {
  5793. DataMgr.setExtraSign(1);
  5794. Moyu.sendDataEvent("signIn1");
  5795. }
  5796. this.updateSign();
  5797. });
  5798. }
  5799. }
  5800. againGetAward() {
  5801. Moyu.sendDataEvent("signIn2");
  5802. console.log('zh:qjff_AD_for_uisign');
  5803. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5804. }
  5805. else {
  5806. console.log('zh:AD 失败,直接发放奖励');
  5807. this.qjff_AD_for_uisign();
  5808. }
  5809. }
  5810. qjff_AD_for_uisign() {
  5811. let index = this.curDayIndex;
  5812. if (index == 0)
  5813. index = 7;
  5814. let award = cfgTable.signData[index].award;
  5815. let temp;
  5816. let type;
  5817. let num;
  5818. for (let index = 0; index < award.length; index++) {
  5819. temp = award[index].split("-");
  5820. type = parseInt(temp[0]);
  5821. num = parseInt(temp[1]) * 3;
  5822. xGame.common.playObjFlyAnim(num, type);
  5823. }
  5824. DataMgr.setExtraSign(1);
  5825. this.updateSign();
  5826. }
  5827. }
  5828. UISign.uiName = "UISign";
  5829. class ui_UISkill extends fgui.GComponent {
  5830. static createInstance() {
  5831. return (fgui.UIPackage.createObject("game", "UISkill"));
  5832. }
  5833. onConstruct() {
  5834. this.n48 = (this.getChild("n48"));
  5835. this.n0 = (this.getChild("n0"));
  5836. this.secretary = (this.getChild("secretary"));
  5837. this.talkNode = (this.getChild("talkNode"));
  5838. this.closeNode = (this.getChild("closeNode"));
  5839. this.moneyNode = (this.getChild("moneyNode"));
  5840. this.skillNode = (this.getChild("skillNode"));
  5841. this.guideNode = (this.getChild("guideNode"));
  5842. }
  5843. }
  5844. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5845. class SkillDisplay {
  5846. constructor(ui, data, uiIndex) {
  5847. this.starX = 0;
  5848. this.starY = 0;
  5849. this.index = 0;
  5850. this.ui = ui;
  5851. this.data = data;
  5852. this.index = uiIndex;
  5853. this.initSelf();
  5854. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5855. }
  5856. initSelf() {
  5857. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5858. this.ui.nameTxt.text = this.data.name;
  5859. this.ui.describeTxt.text = this.data.describe;
  5860. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5861. this.ui.startBtn.onClick(this, this.startGame);
  5862. this.updateSelf();
  5863. }
  5864. updateSelf() {
  5865. this.checkTry();
  5866. let level = DataMgr.getBigSkillByIndex(this.index);
  5867. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5868. }
  5869. checkTry() {
  5870. let index = this.index;
  5871. let level = DataMgr.getBigSkillByIndex(index);
  5872. if (level == null) {
  5873. DataMgr.setBigSkill(index, 1, false);
  5874. level = 1;
  5875. }
  5876. this.ui.levelTxt.text = "LV." + level;
  5877. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5878. this.ui.tryNode.visible = true;
  5879. else
  5880. this.ui.tryNode.visible = false;
  5881. }
  5882. clickAddLevel() {
  5883. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5884. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5885. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5886. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5887. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5888. }
  5889. else {
  5890. console.log('zh:AD 失败,直接发放奖励');
  5891. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5892. }
  5893. }
  5894. qjff_AD_for_skilldisplay_clickAddLevel() {
  5895. DataMgr.setBigSkill(this.data.index, 1);
  5896. this.updateSelf();
  5897. xGame.common.upSkillLevel = true;
  5898. }
  5899. startGame() {
  5900. if (this.data.index == 3) {
  5901. alert('Coming soon!');
  5902. return;
  5903. }
  5904. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5905. let needCoin = xGame.common.bigMoveNeedCoin;
  5906. xGame.common.passAwardCoin = 2000;
  5907. let guide = DataMgr.getSkillGuide();
  5908. console.log('zh:startGame guide=' + guide);
  5909. xGame.common.temSelfLevel = 0;
  5910. if (guide == 0) {
  5911. needCoin = 0;
  5912. xGame.common.temSelfLevel = 100;
  5913. }
  5914. if (DataMgr.coinEnough(needCoin)) {
  5915. DataMgr.setCoin(-needCoin);
  5916. xGame.common.curPlayerSkillType = this.index;
  5917. if (guide == 0)
  5918. xGame.common.curPlayerSkillType = 0;
  5919. xGame.uiMgr.Show(UIGame);
  5920. xGame.uiMgr.Hide(UIMain);
  5921. xGame.uiMgr.Show(UIMatching, () => {
  5922. xGame.common.gameUI.ui.alpha = 1;
  5923. xGame.common.gameUI.startGame();
  5924. xGame.uiMgr.Hide(UISkill);
  5925. });
  5926. }
  5927. else {
  5928. xGame.uiMgr.Show(UIAddProp, 0);
  5929. Moyu.sendDataEvent("AddCoinVideo");
  5930. }
  5931. }
  5932. }
  5933. class UISkill extends UIBase {
  5934. constructor() {
  5935. super();
  5936. this.skillData = [];
  5937. }
  5938. onConstructor() {
  5939. this.ui = ui_UISkill.createInstance();
  5940. this.contentPane = this.ui;
  5941. this.isEject = false;
  5942. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5943. this.initSkillData();
  5944. console.log('zh:aaaaaa1111111111');
  5945. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5946. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5947. console.log('zh:aaaaaa22222222');
  5948. this.displayList = [];
  5949. this.ui.skillNode.skillList.numItems = 3;
  5950. this.addUIClick(this.ui, this.interuptSecretary);
  5951. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5952. this.ui.talkNode.visible = false;
  5953. if (Moyu.isKs)
  5954. this.ui.closeNode.closeBtn.x += 100;
  5955. }
  5956. show() {
  5957. super.show();
  5958. this.playSecretaryIdle();
  5959. this.moneyNode.ui.c1.selectedIndex = 1;
  5960. Laya.timer.clearAll(this);
  5961. xGame.soundMgr.playSound("s_start");
  5962. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5963. let guide = DataMgr.getSkillGuide();
  5964. this.ui.guideNode.visible = guide == 0;
  5965. let item = this.getSkillItemByUIIndex(0);
  5966. if (guide == 0) {
  5967. item.ui.c1.selectedIndex = 1;
  5968. }
  5969. else {
  5970. item.ui.c1.selectedIndex = 0;
  5971. }
  5972. this.ui.guideNode.guideBtn.visible = guide == 0;
  5973. for (let index = 0; index < this.displayList.length; index++) {
  5974. this.displayList[index].checkTry();
  5975. }
  5976. }
  5977. getSkillItemByUIIndex(cur) {
  5978. for (let index = 0; index < this.displayList.length; index++) {
  5979. if (this.displayList[index].index == cur) {
  5980. return this.displayList[index];
  5981. }
  5982. }
  5983. }
  5984. enterGuideLevel() {
  5985. let item = this.getSkillItemByUIIndex(0);
  5986. item.startGame();
  5987. if (DataMgr.getNewUser())
  5988. Moyu.sendDataEvent("gameStart1");
  5989. }
  5990. initSkillData() {
  5991. this.skillData = [];
  5992. let nameList = xGame.common.skillNameList;
  5993. let iconList = xGame.common.skillIconList;
  5994. let describeList = [
  5995. "Jump shot executed — ball bounced and pocketed an extra one!",
  5996. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  5997. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  5998. ];
  5999. console.log('zh:initSkillData 111111111');
  6000. let data;
  6001. for (let index = 0; index < nameList.length; index++) {
  6002. data = {};
  6003. data.name = nameList[index];
  6004. data.icon = iconList[index];
  6005. data.describe = describeList[index];
  6006. data.index = index;
  6007. this.skillData.push(data);
  6008. }
  6009. }
  6010. updateSkillItem(index, target) {
  6011. if (this.displayList[index] == null) {
  6012. let uiIndex;
  6013. switch (index) {
  6014. case 0:
  6015. uiIndex = 1;
  6016. break;
  6017. case 1:
  6018. uiIndex = 0;
  6019. break;
  6020. case 2:
  6021. uiIndex = 2;
  6022. break;
  6023. case 3:
  6024. uiIndex = 3;
  6025. break;
  6026. default:
  6027. break;
  6028. }
  6029. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6030. this.displayList.push(temp);
  6031. }
  6032. }
  6033. playSecretaryIdle() {
  6034. let parent = this.ui.secretary.displayObject;
  6035. parent.destroyChildren();
  6036. let xx = this.ui.secretary.width / 2;
  6037. let yy = this.ui.secretary.height;
  6038. let scale = xGame.common.getSecretaryScale();
  6039. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6040. xGame.common.secretary.play(data, 0, true, parent);
  6041. }
  6042. returnUIMain() {
  6043. this.hide();
  6044. xGame.common.stopGirlPop(this.ui.talkNode);
  6045. xGame.uiMgr.Show(UIMain);
  6046. }
  6047. interuptSecretary() {
  6048. Laya.timer.clearAll(this);
  6049. this.playSecretaryRandomSound();
  6050. }
  6051. playSecretaryRandomSound() {
  6052. if (this.isHide)
  6053. return;
  6054. let time = xGame.common.randomNum(45000, 60000);
  6055. Laya.timer.once(time, this, () => {
  6056. if (this.isHide)
  6057. return;
  6058. let index = xGame.common.randomNum(4, 7);
  6059. xGame.soundMgr.playSound("s_main0" + index);
  6060. let words = 1;
  6061. switch (index) {
  6062. case 4:
  6063. words = 5;
  6064. break;
  6065. case 5:
  6066. words = 3;
  6067. break;
  6068. case 6:
  6069. words = 6;
  6070. break;
  6071. case 7:
  6072. words = 7;
  6073. break;
  6074. default:
  6075. break;
  6076. }
  6077. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6078. this.playSecretaryRandomSound();
  6079. });
  6080. }
  6081. }
  6082. UISkill.uiName = "UISkill";
  6083. class ui_UIMsg extends fgui.GComponent {
  6084. static createInstance() {
  6085. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6086. }
  6087. onConstruct() {
  6088. this.tipsNode = (this.getChild("tipsNode"));
  6089. }
  6090. }
  6091. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6092. class UIMsg extends UIBase {
  6093. constructor() {
  6094. super();
  6095. }
  6096. onConstructor() {
  6097. this.ui = ui_UIMsg.createInstance();
  6098. this.contentPane = this.ui;
  6099. this.isEject = false;
  6100. this.isMuti = true;
  6101. }
  6102. show(msg, callback) {
  6103. super.show();
  6104. this.ui.tipsNode.msgTxt.text = msg;
  6105. this.ui.alpha = 1;
  6106. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6107. this.hide();
  6108. callback && callback();
  6109. }), 1000);
  6110. }
  6111. }
  6112. UIMsg.uiName = "UIMsg";
  6113. class ui_UIModeSelection extends fgui.GComponent {
  6114. static createInstance() {
  6115. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6116. }
  6117. onConstruct() {
  6118. this.n19 = (this.getChild("n19"));
  6119. this.closeBtn = (this.getChild("closeBtn"));
  6120. this.myNode = (this.getChild("myNode"));
  6121. this.t0 = this.getTransition("t0");
  6122. }
  6123. }
  6124. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6125. class UIModeSelection extends UIBase {
  6126. constructor() {
  6127. super();
  6128. }
  6129. onConstructor() {
  6130. this.ui = ui_UIModeSelection.createInstance();
  6131. this.contentPane = this.ui;
  6132. this.isEject = false;
  6133. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6134. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6135. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6136. this.addUIClick(this.ui.closeBtn, this.hide);
  6137. this.peopleArr = [650, 6900, 3800];
  6138. this.peopleOffest = [50, 500, 200];
  6139. this.updateSelf();
  6140. }
  6141. show(callback) {
  6142. super.show();
  6143. this.ui.t0.play();
  6144. this.callback = callback;
  6145. }
  6146. updateSelf() {
  6147. let cfg = cfgTable.modeselectData;
  6148. for (let index = 1; index <= 3; index++) {
  6149. let node = this.ui.myNode["type" + index];
  6150. node.need.text = cfg[index].need;
  6151. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6152. node.peopleTxt.text = this.getRandPeople(index - 1);
  6153. }
  6154. }
  6155. enterGame(type) {
  6156. xGame.common.classicRoomType = type;
  6157. let cfg = cfgTable.modeselectData[type];
  6158. let need = cfg.need;
  6159. xGame.common.passAwardCoin = cfg.award;
  6160. if (DataMgr.coinEnough(need)) {
  6161. DataMgr.setCoin(-need);
  6162. this.ui.myNode["type" + type].t0.play();
  6163. Laya.timer.once(200, this, () => {
  6164. this.callback && this.callback();
  6165. });
  6166. }
  6167. else {
  6168. Moyu.sendDataEvent("AddCoinVideo");
  6169. xGame.uiMgr.Show(UIAddProp, 0);
  6170. }
  6171. }
  6172. getRandPeople(index) {
  6173. let rand = this.peopleOffest[index];
  6174. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6175. }
  6176. }
  6177. UIModeSelection.uiName = "UIModeSelection";
  6178. class ui_UIGetAward extends fgui.GComponent {
  6179. static createInstance() {
  6180. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6181. }
  6182. onConstruct() {
  6183. this.n4 = (this.getChild("n4"));
  6184. this.n0 = (this.getChild("n0"));
  6185. this.myList = (this.getChild("myList"));
  6186. this.n1 = (this.getChild("n1"));
  6187. this.eftNode = (this.getChild("eftNode"));
  6188. this.btnNode = (this.getChild("btnNode"));
  6189. this.t0 = this.getTransition("t0");
  6190. }
  6191. }
  6192. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6193. class UIGetAward extends UIBase {
  6194. constructor() {
  6195. super();
  6196. this.showTriple = true;
  6197. }
  6198. onConstructor() {
  6199. this.ui = ui_UIGetAward.createInstance();
  6200. this.contentPane = this.ui;
  6201. this.isEject = false;
  6202. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6203. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6204. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6205. }
  6206. show(arr, showTriple, callback) {
  6207. super.show();
  6208. this.ui.t0.play();
  6209. this.ui.eftNode.visible = true;
  6210. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6211. this.ui.eftNode.visible = false;
  6212. }), 1, 0, 0, 0.9);
  6213. this.awardArr = arr;
  6214. this.showTriple = showTriple;
  6215. this.callback = callback;
  6216. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6217. this.ui.myList.numItems = arr.length;
  6218. xGame.soundMgr.playSound("getaward");
  6219. }
  6220. updateSelf(index, obj) {
  6221. let temp = this.awardArr[index];
  6222. let icon = this.getIcon(temp.type);
  6223. let str = icon;
  6224. if (temp.type > 2) {
  6225. str = "s" + icon;
  6226. }
  6227. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6228. obj.myIcon.rotation = 0;
  6229. obj.numTxt.text = temp.num + "";
  6230. obj.numTxt.visible = temp.type > 2 ? false : true;
  6231. obj.nameTxt.text = this.getNameStr(temp.type);
  6232. }
  6233. renderItem(index, obj) {
  6234. this.updateSelf(index, obj);
  6235. }
  6236. tripleGetAward() {
  6237. console.log('zh:qjff_AD_for_uigetAward');
  6238. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6239. }
  6240. else {
  6241. console.log('zh:AD 失败,直接发放奖励');
  6242. this.qjff_AD_for_uigetAward();
  6243. }
  6244. }
  6245. qjff_AD_for_uigetAward() {
  6246. this.getAward(3);
  6247. }
  6248. normalGetAward() {
  6249. if (PlatMgr.isMisVideo())
  6250. this.tripleGetAward();
  6251. else
  6252. this.getAward();
  6253. }
  6254. getAward(times = 1) {
  6255. this.hide();
  6256. for (let index = 0; index < this.awardArr.length; index++) {
  6257. this.awardArr[index].num *= times;
  6258. }
  6259. this.callback && this.callback(times != 1);
  6260. }
  6261. getIcon(type) {
  6262. switch (type) {
  6263. case Prop.diamond:
  6264. return "ty_zs";
  6265. case Prop.coin:
  6266. return "ty_jb";
  6267. case Prop.gan1:
  6268. return "qg1";
  6269. case Prop.gan2:
  6270. return "qg2";
  6271. case Prop.gan3:
  6272. return "qg3";
  6273. case Prop.gan4:
  6274. return "qg4";
  6275. default:
  6276. break;
  6277. }
  6278. }
  6279. getNameStr(type) {
  6280. switch (type) {
  6281. case Prop.diamond:
  6282. return "Diamond";
  6283. case Prop.coin:
  6284. return "Coins";
  6285. case Prop.gan1:
  6286. case Prop.gan2:
  6287. case Prop.gan3:
  6288. case Prop.gan4:
  6289. return cfgTable.ballrodData[type - 1].name;
  6290. default:
  6291. break;
  6292. }
  6293. }
  6294. }
  6295. UIGetAward.uiName = "UIGetAward";
  6296. class ui_UIRepentProp extends fgui.GComponent {
  6297. static createInstance() {
  6298. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6299. }
  6300. onConstruct() {
  6301. this.c1 = this.getController("c1");
  6302. this.n11 = (this.getChild("n11"));
  6303. this.regretNode = (this.getChild("regretNode"));
  6304. this.helpLineNode = (this.getChild("helpLineNode"));
  6305. this.t0 = this.getTransition("t0");
  6306. }
  6307. }
  6308. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6309. class UIRepentProp extends UIBase {
  6310. constructor() {
  6311. super();
  6312. this.viewType = 0;
  6313. this.regretType = 0;
  6314. }
  6315. onConstructor() {
  6316. this.ui = ui_UIRepentProp.createInstance();
  6317. this.contentPane = this.ui;
  6318. this.isEject = false;
  6319. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6320. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6321. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6322. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6323. }
  6324. show(viewType, regretType, callback) {
  6325. PlatMgr.showInsert(true);
  6326. this.viewType = viewType;
  6327. this.regretType = regretType;
  6328. this.callback = callback;
  6329. super.show();
  6330. this.ui.t0.play();
  6331. this.ui.c1.selectedIndex = this.viewType;
  6332. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6333. if (this.viewType == 0) {
  6334. let guide = DataMgr.getGuideHelpLine();
  6335. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6336. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6337. }
  6338. xGame.common.gameMgr.gamePause = true;
  6339. }
  6340. hideSelf() {
  6341. xGame.common.gameMgr.gamePause = false;
  6342. this.callback && this.callback(false);
  6343. this.hide();
  6344. }
  6345. videoRegret() {
  6346. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6347. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6348. }
  6349. else {
  6350. console.log('zh:AD 失败,直接发放奖励');
  6351. this.qjff_AD_for_UIrepentProp_videoRegret();
  6352. }
  6353. }
  6354. qjff_AD_for_UIrepentProp_videoRegret() {
  6355. this.callback && this.callback(true);
  6356. this.hideSelf();
  6357. }
  6358. videoAddHelpLine() {
  6359. let guide = DataMgr.getGuideHelpLine();
  6360. if (guide == 0) {
  6361. this.callback && this.callback(true);
  6362. this.hideSelf();
  6363. DataMgr.setGuideHelpLine();
  6364. xGame.common.gameUI.ui.guideNode.visible = false;
  6365. }
  6366. else {
  6367. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6368. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6369. }
  6370. else {
  6371. console.log('zh:AD 失败,直接发放奖励');
  6372. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6373. }
  6374. }
  6375. }
  6376. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6377. this.callback && this.callback(true);
  6378. this.hideSelf();
  6379. }
  6380. }
  6381. UIRepentProp.uiName = "UIRepentProp";
  6382. class UIMain extends UIBase {
  6383. constructor() {
  6384. super();
  6385. this.firstEnter = true;
  6386. }
  6387. nativeCallJs(msg) {
  6388. let t = msg;
  6389. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6390. switch (t) {
  6391. case 'qjff_chouJiang':
  6392. let dui = xGame.uiMgr.getUI(UIDraw);
  6393. dui.qjff_chouJiang();
  6394. break;
  6395. case 'qjff_AD_for_uisign':
  6396. let dui2 = xGame.uiMgr.getUI(UISign);
  6397. dui2.qjff_AD_for_uisign();
  6398. break;
  6399. case 'qjff_AD_for_uitry':
  6400. let dui3 = xGame.uiMgr.getUI(UITry);
  6401. dui3.qjff_AD_for_uitry();
  6402. break;
  6403. case 'qjff_AD_for_uipower':
  6404. let dui4 = xGame.uiMgr.getUI(UIPower);
  6405. dui4.qjff_AD_for_uipower();
  6406. break;
  6407. case 'qjff_AD_for_uigetAward':
  6408. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6409. dui5.qjff_AD_for_uigetAward();
  6410. break;
  6411. case 'qjff_AD_for_uiGameEnd':
  6412. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6413. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6414. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6415. break;
  6416. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6417. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6418. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6419. break;
  6420. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6421. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6422. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6423. break;
  6424. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6425. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6426. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6427. break;
  6428. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6429. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6430. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6431. break;
  6432. case 'qjff_AD_for_UIBOX_onOpenBox':
  6433. let dui11 = xGame.uiMgr.getUI(UIBox);
  6434. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6435. break;
  6436. case 'qjff_AD_for_UIAddCoin':
  6437. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6438. dui12.qjff_AD_for_UIAddCoin();
  6439. break;
  6440. case '111a':
  6441. let dui14 = xGame.uiMgr.getUI(UISign);
  6442. dui14.qjff_AD_for_uisign();
  6443. break;
  6444. case '222a':
  6445. let dui15 = xGame.uiMgr.getUI(UISign);
  6446. dui15.qjff_AD_for_uisign();
  6447. break;
  6448. case '333a':
  6449. let dui16 = xGame.uiMgr.getUI(UISign);
  6450. dui16.qjff_AD_for_uisign();
  6451. break;
  6452. default:
  6453. console.log('zh:未知的方法名字' + t);
  6454. break;
  6455. }
  6456. }
  6457. onConstructor() {
  6458. console.log('zh: UIMain onConstructor');
  6459. this.ui = ui_UIMain.createInstance();
  6460. this.contentPane = this.ui;
  6461. this.isEject = false;
  6462. this.addEvent();
  6463. this.addClickSpine();
  6464. this.settingNode = new SettingNode(this.ui.settingNode);
  6465. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6466. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6467. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6468. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6469. let curUse = DataMgr.getCurSecretary();
  6470. this.changeSecretary(curUse);
  6471. this.ui.talkNode.visible = false;
  6472. let guide = DataMgr.getSkillGuide();
  6473. if (xGame.common.isNewDay && guide == 1) {
  6474. xGame.common.isNewDay = false;
  6475. xGame.soundMgr.playSound("s_main01");
  6476. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6477. console.log("播放小秘书每天语音");
  6478. }
  6479. this.onGetUserInfo();
  6480. this.ui.n83.visible = false;
  6481. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6482. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6483. }
  6484. changeSecretary(curUse) {
  6485. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6486. xGame.common.secretary && xGame.common.secretary.dispose();
  6487. this.addSecretarySpine(name);
  6488. }
  6489. addSecretarySpine(name) {
  6490. let spine = new SpineMgr(name, () => {
  6491. this.playSecretaryIdle();
  6492. });
  6493. xGame.common.secretary = spine;
  6494. }
  6495. addClickSpine() {
  6496. let clickSpine = new SpineMgr("dianji", () => {
  6497. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6498. let parent = Laya.stage;
  6499. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6500. clickSpine.play(data, 0, false, parent, (spine) => {
  6501. spine.destroy(true);
  6502. });
  6503. });
  6504. });
  6505. }
  6506. addEvent() {
  6507. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6508. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6509. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6510. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6511. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  6512. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6513. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6514. this.addUIClick(this.ui, this.interuptSecretary);
  6515. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6516. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6517. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6518. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6519. this.addUIClick(this.ui.signBtn, this.openSignView);
  6520. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6521. }
  6522. show(showFailWords) {
  6523. super.show();
  6524. this.moneyNode.ui.c1.selectedIndex = 1;
  6525. this.playSecretaryIdle();
  6526. xGame.soundMgr.playMusic("caromhall01");
  6527. Laya.timer.clearAll(this);
  6528. this.playSecretaryRandomSound();
  6529. if (showFailWords) {
  6530. setTimeout(() => {
  6531. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6532. let words = -1;
  6533. if (str == "s_main02") {
  6534. words = 2;
  6535. }
  6536. else {
  6537. words = 3;
  6538. }
  6539. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6540. xGame.soundMgr.playSound(str);
  6541. }, 300);
  6542. }
  6543. this.showGuide();
  6544. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6545. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6546. let guide = DataMgr.getSkillGuide();
  6547. if (guide == 1) {
  6548. let randTime = xGame.common.randomNum(300, 800);
  6549. if (this.firstEnter) {
  6550. this.firstEnter = false;
  6551. randTime += 900;
  6552. }
  6553. Laya.timer.once(randTime, this, () => {
  6554. xGame.common.autoPopUIView();
  6555. });
  6556. }
  6557. }
  6558. checkActive(show) {
  6559. }
  6560. showGuide() {
  6561. let guide = DataMgr.getSkillGuide();
  6562. this.ui.guideBtn.visible = guide == 0;
  6563. this.ui.enterGuide.visible = false;
  6564. this.ui.secretaryGuide.visible = guide == 0;
  6565. if (guide == 0) {
  6566. xGame.soundMgr.playSound("s_guide");
  6567. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6568. }
  6569. }
  6570. ensureSecretary() {
  6571. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6572. this.ui.secretaryGuide.visible = false;
  6573. this.ui.enterGuide.visible = true;
  6574. this.ui.wordsNode.t0.play();
  6575. if (DataMgr.getNewUser())
  6576. Moyu.sendDataEvent("gameReady");
  6577. }
  6578. playSecretaryIdle() {
  6579. let parent = this.ui.secretary.displayObject;
  6580. parent.destroyChildren();
  6581. let xx = this.ui.secretary.width / 2;
  6582. let yy = this.ui.secretary.height;
  6583. let scale = xGame.common.getSecretaryScale();
  6584. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6585. console.log("zh:playSecretaryIdle", data);
  6586. xGame.common.secretary.play(data, 0, true, parent);
  6587. }
  6588. startGame(type) {
  6589. xGame.common.gameMode = type;
  6590. Moyu.sendDataEvent("PlayGame", { type: type });
  6591. switch (xGame.common.gameMode) {
  6592. case GameMode.classic:
  6593. let challengeTimes = DataMgr.getChallengeTimes();
  6594. if (challengeTimes == 0) {
  6595. xGame.uiMgr.Show(UIInvitation);
  6596. }
  6597. else {
  6598. this.beginGame();
  6599. }
  6600. break;
  6601. case GameMode.bigMove:
  6602. this.beginGame();
  6603. if (DataMgr.getNewUser())
  6604. Moyu.sendDataEvent("gameStart0");
  6605. break;
  6606. default:
  6607. break;
  6608. }
  6609. }
  6610. beginGame(isNice = false) {
  6611. if (xGame.common.gameMode == GameMode.classic) {
  6612. if (isNice) {
  6613. this.enterClassic();
  6614. }
  6615. else {
  6616. xGame.uiMgr.Show(UIModeSelection, () => {
  6617. this.enterClassic();
  6618. });
  6619. }
  6620. }
  6621. else if (xGame.common.gameMode == GameMode.bigMove) {
  6622. this.ui.enterGuide.visible = false;
  6623. xGame.uiMgr.Show(UISkill);
  6624. }
  6625. }
  6626. enterClassic() {
  6627. xGame.uiMgr.Show(UIGame);
  6628. xGame.uiMgr.Show(UIMatching, () => {
  6629. if (!this.isHide)
  6630. this.hide();
  6631. xGame.common.gameUI.ui.alpha = 1;
  6632. xGame.common.gameUI.startGame();
  6633. xGame.uiMgr.Hide(UIGameEnd);
  6634. });
  6635. }
  6636. startGlobal() {
  6637. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6638. }
  6639. startWeekly() {
  6640. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6641. }
  6642. zhouSaiMonth() {
  6643. console.log('zh: zhouSaiMonth 被调用');
  6644. }
  6645. startPlaceBall() {
  6646. xGame.uiMgr.Show(UILevelDisplay);
  6647. }
  6648. hide() {
  6649. super.hide();
  6650. xGame.common.stopGirlPop(this.ui.talkNode);
  6651. }
  6652. onGetUserInfo(force = false) {
  6653. if (Moyu.isWx) {
  6654. let info = Moyu.getSystemInfo();
  6655. if (info)
  6656. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6657. }
  6658. else {
  6659. Moyu.initUser(this, this.freshUser, force);
  6660. }
  6661. if (!Moyu.hasUserInfo) {
  6662. let user = Moyu.getUserInfo();
  6663. user.headIcon = 'res/ty_touxiang.png';
  6664. }
  6665. this.freshUser();
  6666. }
  6667. freshUser() {
  6668. let user = Moyu.getUserInfo();
  6669. if (!user.isAuth) {
  6670. user.headIcon = 'res/ty_touxiang.png';
  6671. }
  6672. else
  6673. DataMgr.upRankData();
  6674. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6675. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6676. }
  6677. interuptSecretary() {
  6678. Laya.timer.clearAll(this);
  6679. this.playSecretaryRandomSound();
  6680. }
  6681. playSecretaryRandomSound() {
  6682. if (this.isHide)
  6683. return;
  6684. let time = xGame.common.randomNum(45000, 60000);
  6685. Laya.timer.once(time, this, () => {
  6686. if (this.isHide)
  6687. return;
  6688. let index = xGame.common.randomNum(4, 7);
  6689. xGame.soundMgr.playSound("s_main0" + index);
  6690. let words = 1;
  6691. switch (index) {
  6692. case 4:
  6693. words = 5;
  6694. break;
  6695. case 5:
  6696. words = 3;
  6697. break;
  6698. case 6:
  6699. words = 6;
  6700. break;
  6701. case 7:
  6702. words = 7;
  6703. break;
  6704. default:
  6705. break;
  6706. }
  6707. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6708. this.playSecretaryRandomSound();
  6709. });
  6710. }
  6711. openSecretaryView() {
  6712. xGame.uiMgr.Show(UISecretary);
  6713. Moyu.sendDataEvent("secretary");
  6714. }
  6715. openShopView() {
  6716. xGame.uiMgr.Show(UIShop);
  6717. }
  6718. openSignView() {
  6719. xGame.uiMgr.Show(UISign);
  6720. }
  6721. openDrawView() {
  6722. xGame.uiMgr.Show(UIDraw);
  6723. }
  6724. openRanking() {
  6725. xGame.uiMgr.Show(UIRanking);
  6726. Moyu.sendDataEvent("rankingList");
  6727. }
  6728. }
  6729. UIMain.uiName = "UIMain";
  6730. class UIGameEnd extends UIBase {
  6731. constructor() {
  6732. super();
  6733. this.success = false;
  6734. this.awardCoinNum = 1000;
  6735. this.awardDiamondNum = 10;
  6736. }
  6737. onConstructor() {
  6738. this.ui = ui_UIGameEnd.createInstance();
  6739. this.contentPane = this.ui;
  6740. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6741. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6742. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6743. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6744. this.ui.talkNode.visible = false;
  6745. if (Moyu.isKs)
  6746. this.ui.closeNode.closeBtn.x += 100;
  6747. }
  6748. updateType() {
  6749. switch (xGame.common.gameMode) {
  6750. case GameMode.classic:
  6751. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6752. this.ui.coinNode.visible = this.success;
  6753. if (!this.success) {
  6754. Laya.timer.once(500, this, () => {
  6755. xGame.uiMgr.Show(UIAddCoin);
  6756. });
  6757. }
  6758. this.ui.isGetAward.visible = false;
  6759. this.ui.leftBtn.c1.selectedIndex = 3;
  6760. this.ui.rightBtn.c1.selectedIndex = 0;
  6761. this.moneyNode.ui.c1.selectedIndex = 1;
  6762. break;
  6763. case GameMode.bigMove:
  6764. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6765. this.ui.coinNode.visible = this.success;
  6766. if (xGame.common.gameMode == GameMode.bigMove) {
  6767. if (this.success) {
  6768. DataMgr.setSkillSuccessTimes(1, true);
  6769. DataMgr.setSkillAccTimes(1);
  6770. }
  6771. else {
  6772. DataMgr.setSkillSuccessTimes(0, false);
  6773. }
  6774. }
  6775. if (!this.success) {
  6776. Laya.timer.once(500, this, () => {
  6777. xGame.uiMgr.Show(UIAddCoin);
  6778. });
  6779. }
  6780. this.ui.isGetAward.visible = false;
  6781. this.ui.leftBtn.c1.selectedIndex = 3;
  6782. this.ui.rightBtn.c1.selectedIndex = 0;
  6783. this.moneyNode.ui.c1.selectedIndex = 1;
  6784. break;
  6785. case GameMode.placeBall:
  6786. this.ui.coinNode.visible = false;
  6787. if (this.success) {
  6788. if (xGame.common.placeBallStarNum == 3) {
  6789. this.ui.c1.selectedIndex = 2;
  6790. }
  6791. else {
  6792. this.ui.c1.selectedIndex = 3;
  6793. }
  6794. }
  6795. else {
  6796. this.ui.c1.selectedIndex = 4;
  6797. }
  6798. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6799. if (cfg.type == PlaceBallType.challenge) {
  6800. this.ui.c1.selectedIndex = 2;
  6801. }
  6802. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6803. this.updatePlaceBallBtn();
  6804. this.updatePlaceBallStarNum();
  6805. this.updatePlaceBallAwardState();
  6806. this.moneyNode.ui.c1.selectedIndex = 2;
  6807. this.moneyNode.checkPowerTime();
  6808. this.moneyNode.powerChange();
  6809. DataMgr.upRankData();
  6810. break;
  6811. default:
  6812. break;
  6813. }
  6814. }
  6815. updatePlaceBallBtn() {
  6816. this.ui.leftBtn.c1.selectedIndex = 5;
  6817. if (this.success) {
  6818. this.ui.rightBtn.c1.selectedIndex = 14;
  6819. }
  6820. else {
  6821. if (xGame.common.placeBallStarNum == 3) {
  6822. this.ui.rightBtn.c1.selectedIndex = 14;
  6823. }
  6824. else {
  6825. this.ui.rightBtn.c1.selectedIndex = 1;
  6826. }
  6827. }
  6828. }
  6829. updatePlaceBallStarNum() {
  6830. let starNum = xGame.common.placeBallStarNum;
  6831. if (starNum == 0)
  6832. this.ui.starNumNode.c1.selectedIndex = 3;
  6833. else {
  6834. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6835. }
  6836. }
  6837. updatePlaceBallAwardState() {
  6838. let level = xGame.common.placeBallCurLevel;
  6839. let starNum = xGame.common.placeBallStarNum;
  6840. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6841. let data = cfgTable.placeballData[level].award;
  6842. let cfg = cfgTable.placeballData[level];
  6843. this.awardDiamondNum = data[1];
  6844. this.awardCoinNum = data[0];
  6845. if (cfg.type == PlaceBallType.challenge) {
  6846. this.awardDiamondNum = 0;
  6847. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6848. }
  6849. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6850. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6851. if (cfg.type == PlaceBallType.challenge) {
  6852. this.ui.awardNode.coinNode.visible = true;
  6853. }
  6854. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6855. this.ui.awardNode.diamondNode.x = 265;
  6856. this.ui.awardNode.coinNode.x = 354;
  6857. }
  6858. else {
  6859. this.ui.awardNode.diamondNode.x = 291;
  6860. this.ui.awardNode.coinNode.x = 291;
  6861. }
  6862. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6863. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6864. if (this.awardCoinNum == 0) {
  6865. this.ui.awardNode.coinNode.numTxt.text = "";
  6866. }
  6867. if (getAward) {
  6868. this.ui.isGetAward.visible = true;
  6869. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6870. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6871. }
  6872. else {
  6873. this.ui.isGetAward.visible = false;
  6874. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6875. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6876. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6877. }
  6878. else {
  6879. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6880. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6881. }
  6882. }
  6883. }
  6884. show(success) {
  6885. super.show();
  6886. xGame.eventMgr.event(RESET_GAME);
  6887. this.success = success;
  6888. Laya.timer.clearAll(this);
  6889. this.playSecretaryAni();
  6890. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6891. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6892. offsetTime = Math.floor(offsetTime / 1000);
  6893. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6894. this.updateType();
  6895. Laya.timer.once(200, this, () => {
  6896. this.addAward(() => {
  6897. this.updateType();
  6898. Laya.timer.once(500, this, () => {
  6899. this.showChallengeLevel();
  6900. });
  6901. });
  6902. });
  6903. if (this.success) {
  6904. xGame.soundMgr.playSound('slots_roll01');
  6905. xGame.soundMgr.playSound("s_win");
  6906. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6907. }
  6908. else {
  6909. xGame.soundMgr.playSound('matchwin01');
  6910. xGame.soundMgr.playSound("s_lose");
  6911. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6912. }
  6913. if (!Moyu.isLegal)
  6914. PlatMgr.showBanner(true);
  6915. let challengeNum = DataMgr.getChallengeTimes();
  6916. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6917. DataMgr.setChallengeTimes(1);
  6918. }
  6919. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6920. DataMgr.setClassicTimes();
  6921. }
  6922. }
  6923. showChallengeLevel() {
  6924. if (DataMgr.getChallengeTimes() != 0)
  6925. return;
  6926. let skill = DataMgr.getSkillAccTimes();
  6927. let put = DataMgr.getPlaceBallLevelList().length;
  6928. if (skill >= 3 || put >= 5) {
  6929. xGame.uiMgr.Show(UIInvitation);
  6930. this.hide();
  6931. }
  6932. }
  6933. addAward(callback) {
  6934. if (!this.success) {
  6935. callback && callback();
  6936. return;
  6937. }
  6938. switch (xGame.common.gameMode) {
  6939. case GameMode.classic:
  6940. this.awardCoinNum = xGame.common.passAwardCoin;
  6941. this.awardDiamondNum = 0;
  6942. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6943. break;
  6944. case GameMode.bigMove:
  6945. this.awardCoinNum = xGame.common.passAwardCoin;
  6946. this.awardDiamondNum = 0;
  6947. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6948. callback && callback();
  6949. break;
  6950. case GameMode.placeBall:
  6951. let level = xGame.common.placeBallCurLevel;
  6952. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6953. if (xGame.common.placeBallStarNum != 3) {
  6954. callback && callback();
  6955. return;
  6956. }
  6957. else {
  6958. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6959. if (getAward) {
  6960. callback && callback();
  6961. return;
  6962. }
  6963. }
  6964. let cfg = cfgTable.placeballData[level];
  6965. let data = cfgTable.placeballData[level].award;
  6966. this.awardCoinNum = data[0];
  6967. this.awardDiamondNum = data[1];
  6968. if (cfg.type == PlaceBallType.challenge) {
  6969. this.awardDiamondNum = 0;
  6970. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6971. }
  6972. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6973. let diamondAward;
  6974. if (this.awardDiamondNum > 0) {
  6975. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6976. xGame.common.getAward([diamondAward, coinAward], callback);
  6977. }
  6978. else {
  6979. xGame.common.getAward([coinAward], callback);
  6980. }
  6981. if (cfg.type == PlaceBallType.normal) {
  6982. DataMgr.setPlaceBallAward(level);
  6983. }
  6984. break;
  6985. default:
  6986. break;
  6987. }
  6988. }
  6989. playSecretaryAni_old() {
  6990. let parent = this.ui.secretary.displayObject;
  6991. parent.destroyChildren();
  6992. let xx = this.ui.secretary.width / 2;
  6993. let yy = this.ui.secretary.height;
  6994. let scale = xGame.common.getSecretaryScale();
  6995. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6996. if (this.success) {
  6997. let rand = Math.random() <= 0.5 ? 2 : 3;
  6998. xGame.common.secretary.play(data, rand, false, parent, () => {
  6999. xGame.common.secretary.play(data, 1, true, parent);
  7000. });
  7001. }
  7002. else {
  7003. xGame.common.secretary.play(data, 0, true, parent);
  7004. }
  7005. }
  7006. playSecretaryAni() {
  7007. let parent = this.ui.secretary.displayObject;
  7008. parent.destroyChildren();
  7009. let xx = this.ui.secretary.width / 2;
  7010. let yy = this.ui.secretary.height;
  7011. let scale = xGame.common.getSecretaryScale();
  7012. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7013. if (this.success) {
  7014. let rand = 0;
  7015. xGame.common.secretary.play(data, 0, true, parent);
  7016. }
  7017. else {
  7018. xGame.common.secretary.play(data, 0, true, parent);
  7019. }
  7020. }
  7021. restartGame() {
  7022. switch (xGame.common.gameMode) {
  7023. case GameMode.classic:
  7024. xGame.eventMgr.event(RESTART_GAME);
  7025. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7026. break;
  7027. case GameMode.bigMove:
  7028. this.hide();
  7029. xGame.eventMgr.event(RESTART_GAME);
  7030. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7031. break;
  7032. default:
  7033. break;
  7034. }
  7035. }
  7036. hide() {
  7037. super.hide();
  7038. xGame.common.stopGirlPop(this.ui.talkNode);
  7039. PlatMgr.showBanner(false);
  7040. }
  7041. returnHome() {
  7042. this.hide();
  7043. let showFailWords = !this.success;
  7044. xGame.uiMgr.Show(UIMain, showFailWords);
  7045. }
  7046. clickLeftBtn() {
  7047. switch (xGame.common.gameMode) {
  7048. case GameMode.classic:
  7049. case GameMode.bigMove:
  7050. this.returnHome();
  7051. break;
  7052. case GameMode.placeBall:
  7053. let level = xGame.common.placeBallCurLevel;
  7054. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7055. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7056. break;
  7057. default:
  7058. break;
  7059. }
  7060. }
  7061. powerStartPlaceBallLevel(level, btn) {
  7062. if (DataMgr.powerEnough()) {
  7063. btn.touchable = false;
  7064. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7065. btn.touchable = true;
  7066. DataMgr.setPower(-1);
  7067. xGame.eventMgr.event(POWER_TIME);
  7068. this.startPlaceBallLevel(level);
  7069. }));
  7070. }
  7071. else {
  7072. xGame.uiMgr.Show(UIPower, 0);
  7073. }
  7074. }
  7075. clickRightBtn() {
  7076. switch (xGame.common.gameMode) {
  7077. case GameMode.classic:
  7078. console.log('zh:clickRightBtn 111');
  7079. case GameMode.bigMove:
  7080. console.log('zh:clickRightBtn 222');
  7081. this.restartGame();
  7082. break;
  7083. case GameMode.placeBall:
  7084. console.log('zh:clickRightBtn 333');
  7085. let level = xGame.common.placeBallCurLevel;
  7086. let data = DataMgr.getPlaceBallLevel(level);
  7087. let curPss = data.play && !data.isCur;
  7088. if (curPss) {
  7089. console.log('zh:clickRightBtn 333-111');
  7090. console.log('zh:当前LV=' + level);
  7091. if (level == 60) {
  7092. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7093. Laya.timer.once(3000, this, () => {
  7094. this.returnHome();
  7095. });
  7096. }
  7097. else {
  7098. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7099. }
  7100. }
  7101. else {
  7102. console.log('zh:clickRightBtn 333-000');
  7103. Moyu.sendDataEvent("placeBallNextLevel");
  7104. console.log('zh:qjff_AD_for_uiGameEnd');
  7105. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7106. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7107. }
  7108. else {
  7109. console.log('zh:AD 失败,直接发放奖励');
  7110. this.qjff_AD_for_uiGameEnd(level);
  7111. }
  7112. }
  7113. break;
  7114. default:
  7115. console.log('zh:clickRightBtn 444');
  7116. break;
  7117. }
  7118. }
  7119. qjff_AD_for_uiGameEnd(level) {
  7120. DataMgr.setPlaceBallLevel(level, 1);
  7121. this.startPlaceBallLevel(level + 1);
  7122. }
  7123. startPlaceBallLevel(level) {
  7124. xGame.common.gameMode = GameMode.placeBall;
  7125. xGame.common.placeBallCurLevel = level;
  7126. xGame.uiMgr.Show(UIGame);
  7127. this.hide();
  7128. }
  7129. }
  7130. UIGameEnd.uiName = "UIGameEnd";
  7131. class ui_UIVideoShare extends fgui.GComponent {
  7132. static createInstance() {
  7133. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7134. }
  7135. onConstruct() {
  7136. this.n10 = (this.getChild("n10"));
  7137. this.myNode = (this.getChild("myNode"));
  7138. this.t0 = this.getTransition("t0");
  7139. }
  7140. }
  7141. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7142. class UIVideoShare extends UIBase {
  7143. constructor() {
  7144. super();
  7145. this.success = false;
  7146. this.awardNum = 0;
  7147. this.isShared = true;
  7148. }
  7149. onConstructor() {
  7150. this.ui = ui_UIVideoShare.createInstance();
  7151. this.contentPane = this.ui;
  7152. this.isEject = false;
  7153. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7154. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7155. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7156. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7157. }
  7158. show(success) {
  7159. super.show();
  7160. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7161. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7162. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7163. this.success = success;
  7164. let time = xGame.common.randomNum(600, 1500);
  7165. Moyu.showInsertAd(time, 60000);
  7166. if (success)
  7167. xGame.soundMgr.playSound("applause");
  7168. this.ui.t0.play();
  7169. this.checkShareState();
  7170. let times = DataMgr.getDailyVideoShareTimes();
  7171. this.awardNum = times == 0 ? 2000 : 200;
  7172. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7173. }
  7174. checkShareState() {
  7175. if (PlatMgr.forceShare == 0) {
  7176. this.ui.myNode.closeBtn.visible = true;
  7177. this.ui.myNode.tipsNode.visible = false;
  7178. this.ui.myNode.closeBtn.x = 90;
  7179. this.ui.myNode.shareBtn.x = 342;
  7180. }
  7181. else if (PlatMgr.forceShare == 1) {
  7182. this.ui.myNode.closeBtn.visible = false;
  7183. this.ui.myNode.tipsNode.visible = true;
  7184. this.ui.myNode.shareBtn.x = 218;
  7185. this.isShared = true;
  7186. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7187. }
  7188. }
  7189. checkForceShare() {
  7190. this.isShared = !this.isShared;
  7191. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7192. }
  7193. videoShare() {
  7194. if (PlatMgr.forceShare == 1) {
  7195. if (this.isShared) {
  7196. this.shareGame();
  7197. }
  7198. else {
  7199. this.hideSelf();
  7200. }
  7201. }
  7202. else {
  7203. this.shareGame();
  7204. }
  7205. }
  7206. shareGame() {
  7207. Moyu.sendDataEvent("VideoShare");
  7208. if (Moyu.canShare() > 100) {
  7209. Moyu.shareGame((success) => {
  7210. if (success) {
  7211. DataMgr.setDailyVideoShareTimes(1);
  7212. DataMgr.setCoin(this.awardNum);
  7213. }
  7214. this.hideSelf();
  7215. }, this);
  7216. }
  7217. else {
  7218. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7219. this.hideSelf();
  7220. }
  7221. }
  7222. hideSelf() {
  7223. this.hide();
  7224. xGame.uiMgr.Show(UIGameEnd, this.success);
  7225. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7226. xGame.common.screenImg.destroy();
  7227. xGame.common.screenImg = null;
  7228. }
  7229. }
  7230. }
  7231. UIVideoShare.uiName = "UIVideoShare";
  7232. class ui_UITips extends fgui.GComponent {
  7233. static createInstance() {
  7234. return (fgui.UIPackage.createObject("game", "UITips"));
  7235. }
  7236. onConstruct() {
  7237. this.n0 = (this.getChild("n0"));
  7238. this.myNode = (this.getChild("myNode"));
  7239. this.t0 = this.getTransition("t0");
  7240. }
  7241. }
  7242. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7243. class UITips extends UIBase {
  7244. constructor() {
  7245. super();
  7246. this.type = 0;
  7247. }
  7248. onConstructor() {
  7249. this.ui = ui_UITips.createInstance();
  7250. this.contentPane = this.ui;
  7251. this.isEject = false;
  7252. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7253. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7254. }
  7255. show(tipsTxt, womanTxt, type) {
  7256. super.show();
  7257. this.ui.t0.play();
  7258. this.ui.myNode.tipsTxt.text = tipsTxt;
  7259. this.ui.myNode.womanTxt.text = womanTxt;
  7260. PlatMgr.showInsert(true);
  7261. this.ui.myNode.c1.selectedIndex = type;
  7262. this.type = type;
  7263. switch (this.type) {
  7264. case TipsType.exitGame:
  7265. xGame.common.gameMgr.gamePause = true;
  7266. break;
  7267. case TipsType.foul:
  7268. Laya.timer.once(200, this, () => {
  7269. xGame.common.gameMgr.gamePause = true;
  7270. });
  7271. break;
  7272. default:
  7273. break;
  7274. }
  7275. }
  7276. clickLeftBtn() {
  7277. this.hide();
  7278. xGame.common.gameMgr.gamePause = false;
  7279. switch (this.type) {
  7280. case TipsType.exitGame:
  7281. break;
  7282. case TipsType.foul:
  7283. break;
  7284. default:
  7285. break;
  7286. }
  7287. }
  7288. clickRightBtn() {
  7289. this.hide();
  7290. switch (this.type) {
  7291. case TipsType.exitGame:
  7292. xGame.eventMgr.event(RESET_GAME);
  7293. xGame.uiMgr.Show(UIMain);
  7294. Moyu.recordEnd(this, null);
  7295. xGame.common.longHelpLine = false;
  7296. break;
  7297. case TipsType.foul:
  7298. xGame.common.gameMgr.gamePause = false;
  7299. Laya.timer.clearAll(this);
  7300. break;
  7301. default:
  7302. break;
  7303. }
  7304. }
  7305. }
  7306. UITips.uiName = "UITips";
  7307. class GameMgr {
  7308. constructor() {
  7309. this.selfCamp = "";
  7310. this.selfFoulNum = 0;
  7311. this.selfBallArr = [];
  7312. this.selfTimer = 0;
  7313. this.selfScore = 0;
  7314. this.aiCamp = "";
  7315. this.aiFoulNum = 0;
  7316. this.aiBallArr = [];
  7317. this.aiTimer = 0;
  7318. this.aiScore = 0;
  7319. this.aiSkillLevelNum = 1;
  7320. this.targertScore = 0;
  7321. this.setTime = 30;
  7322. this.selfTurnRate = 0.5;
  7323. this.accTime = 0;
  7324. this.curFoul = "";
  7325. this.maxFoulTimes = 3;
  7326. this.isFirstInGame = true;
  7327. this.firstColliObj = null;
  7328. this.inHoleBalls = [];
  7329. this.blackNum = 8;
  7330. this.success = false;
  7331. this.holePosList = [];
  7332. this.posObj = {};
  7333. this._selfTurn = false;
  7334. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7335. this.ensureBallType = false;
  7336. this.isOpenBall = true;
  7337. this.finishOneShoot = true;
  7338. this.isEnd = false;
  7339. this.isChangeTurn = false;
  7340. this.isInterrupt = false;
  7341. this.aiPlayedBreakArmy = false;
  7342. this.isTouchedBall = false;
  7343. this.finishBalls = 0;
  7344. this.needBalls = 0;
  7345. this.allBallNum = 0;
  7346. this.placeBallPosData = {};
  7347. this.curHP = 0;
  7348. this.showLongView = false;
  7349. this.firstShoot = true;
  7350. this._gamePause = false;
  7351. this.trunCount = 0;
  7352. this.isBlackInHole = false;
  7353. this.isEnter = true;
  7354. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7355. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7356. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7357. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7358. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7359. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7360. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7361. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7362. }
  7363. get gamePause() {
  7364. return this._gamePause;
  7365. }
  7366. set gamePause(v) {
  7367. if (v) {
  7368. Laya.physicsTimer.pause();
  7369. }
  7370. else {
  7371. Laya.physicsTimer.resume();
  7372. }
  7373. this._gamePause = v;
  7374. }
  7375. get selfTurn() {
  7376. return this._selfTurn;
  7377. }
  7378. set selfTurn(val) {
  7379. this.trunCount++;
  7380. this._selfTurn = val;
  7381. if (val) {
  7382. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7383. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7384. }
  7385. else {
  7386. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7387. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7388. if (this.trunCount > 1)
  7389. PlatMgr.openBox();
  7390. }
  7391. }
  7392. resetGame() {
  7393. this.inHoleBalls = [];
  7394. this.isFirstInGame = true;
  7395. this.firstColliObj = null;
  7396. this.aiCamp = "";
  7397. this.selfCamp = "";
  7398. this.aiFoulNum = 0;
  7399. this.selfFoulNum = 0;
  7400. this.selfBallArr = [];
  7401. this.aiBallArr = [];
  7402. this.gamePause = false;
  7403. this.ensureBallType = false;
  7404. this.isInterrupt = false;
  7405. this.updateLeftBall();
  7406. this.clearTime();
  7407. this.aiPlayedBreakArmy = false;
  7408. this.isBlackInHole = false;
  7409. this.placeBallPosData = {};
  7410. if (xGame.common.d3World.knifeRoot) {
  7411. xGame.common.d3World.knifeRoot.destroyChildren();
  7412. }
  7413. }
  7414. gameReady() {
  7415. this.trunCount = 0;
  7416. this.firstColliObj = null;
  7417. this.isFirstInGame = true;
  7418. this.selfTurn = Math.random() <= this.selfTurnRate;
  7419. let challengeNum = DataMgr.getChallengeTimes();
  7420. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7421. this.selfTurn = true;
  7422. }
  7423. if (xGame.common.gameMode == GameMode.placeBall)
  7424. this.selfTurn = true;
  7425. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7426. this.selfTurn = true;
  7427. }
  7428. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7429. this.checkGuide();
  7430. if (xGame.common.uiRodMethod)
  7431. xGame.common.uiRodMethod.resetRod();
  7432. xGame.common.d2World.getHelpLine();
  7433. this.isOpenBall = true;
  7434. this.isTouchedBall = false;
  7435. xGame.common.aiPlayer.stopRun();
  7436. this.setTime = 30;
  7437. let ui = xGame.common.gameUI.ui;
  7438. switch (xGame.common.gameMode) {
  7439. case GameMode.classic:
  7440. xGame.common.aiPlayer.init();
  7441. this.blackNum = 8;
  7442. this.placeRootBall();
  7443. this.peoplePlay(9, 10);
  7444. ui.wordsBtn.visible = true;
  7445. ui.aiWordsBtn.visible = true;
  7446. xGame.common.talkMgr.changeAIState(true);
  7447. DataMgr.gameData.gameCount++;
  7448. DataMgr.saveGameData();
  7449. break;
  7450. case GameMode.bigMove:
  7451. this.blackNum = -1;
  7452. this.selfScore = 0;
  7453. this.aiScore = 0;
  7454. xGame.common.aiPlayer.init();
  7455. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7456. this.updateSelfScore();
  7457. this.updateAIScore();
  7458. this.updateTargetSroce();
  7459. this.placeRootBall();
  7460. this.peoplePlay(9, 10);
  7461. ui.wordsBtn.visible = true;
  7462. ui.aiWordsBtn.visible = true;
  7463. xGame.common.talkMgr.changeAIState(true);
  7464. if (DataMgr.getSkillGuide() < 1)
  7465. DataMgr.gameData.gameCount = 0;
  7466. else {
  7467. DataMgr.gameData.gameCount++;
  7468. DataMgr.saveGameData();
  7469. PlatMgr.openTry();
  7470. }
  7471. if (xGame.common.d3World.knifeRoot) {
  7472. xGame.common.d3World.knifeRoot.destroyChildren();
  7473. }
  7474. break;
  7475. case GameMode.placeBall:
  7476. this.blackNum = -1;
  7477. this.selfTurn = true;
  7478. this.setTime = 10000;
  7479. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7480. this.curHP = this.placeBallData.hp;
  7481. if (this.placeBallData.ball == -1)
  7482. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7483. else
  7484. this.needBalls = this.placeBallData.ball;
  7485. console.log("需要的进球数目", this.needBalls);
  7486. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7487. this.finishBalls = 0;
  7488. this.placeBallPosData = {};
  7489. this.updatePlaceBallPos();
  7490. this.updatePlaceBallState();
  7491. this.finishOneShoot = true;
  7492. xGame.common.gameUI.ui.moveNode.visible = false;
  7493. this.isOpenBall = false;
  7494. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7495. ui.wordsBtn.visible = false;
  7496. ui.aiWordsBtn.visible = false;
  7497. xGame.common.talkMgr.changeAIState(false);
  7498. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7499. PlatMgr.openBox();
  7500. });
  7501. break;
  7502. default:
  7503. break;
  7504. }
  7505. this.showLongView = false;
  7506. xGame.common.wordsMgr.comboTimes = 1;
  7507. let guide = DataMgr.getSkillGuide();
  7508. if (guide)
  7509. xGame.eventMgr.event(WAIT_SHOOT);
  7510. xGame.common.upSkillLevel = false;
  7511. xGame.common.gameStartTime = new Date().getTime();
  7512. this.firstShoot = true;
  7513. }
  7514. checkGuide() {
  7515. let guide = DataMgr.getSkillGuide();
  7516. let gameUI = xGame.common.gameUI.ui;
  7517. gameUI.guide1.visible = false;
  7518. gameUI.guide2.visible = false;
  7519. gameUI.guide3.visible = false;
  7520. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7521. this.selfTurn = true;
  7522. }
  7523. else {
  7524. return;
  7525. }
  7526. let oneBall = this.getOneBall();
  7527. gameUI.guide1.visible = true;
  7528. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7529. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7530. }
  7531. getOneBall() {
  7532. let arr = xGame.common.d2World.ballArr;
  7533. for (let index = 0; index < arr.length; index++) {
  7534. if (arr[index].number == 0)
  7535. continue;
  7536. return arr[index];
  7537. }
  7538. }
  7539. updateSelfScore() {
  7540. let ui = xGame.common.gameUI.ui.topNode;
  7541. ui.selfScoreTxt.text = this.selfScore + "";
  7542. }
  7543. updateAIScore() {
  7544. let ui = xGame.common.gameUI.ui.topNode;
  7545. ui.aiScoreTxt.text = this.aiScore + "";
  7546. }
  7547. updateTargetSroce() {
  7548. let ui = xGame.common.gameUI.ui.topNode;
  7549. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7550. }
  7551. updateLeftBall() {
  7552. let topUI = xGame.common.gameUI.ui.topNode;
  7553. topUI.selfBallList.numItems = this.selfBallArr.length;
  7554. topUI.aiBallList.numItems = this.aiBallArr.length;
  7555. }
  7556. ballShoot() {
  7557. this.clearTime();
  7558. this.finishOneShoot = false;
  7559. xGame.common.gameUI.ui.moveNode.visible = false;
  7560. if (xGame.common.gameUI.ui.guideNode.visible) {
  7561. xGame.common.gameUI.ui.guideNode.visible = false;
  7562. }
  7563. if (this.firstShoot) {
  7564. this.firstShoot = false;
  7565. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7566. }
  7567. }
  7568. ensureCamp(number) {
  7569. this.ensureBallType = true;
  7570. this.isOpenBall = false;
  7571. if (xGame.common.gameMode != GameMode.classic)
  7572. return;
  7573. let full = [1, 2, 3, 4, 5, 6, 7];
  7574. let flower = [9, 10, 11, 12, 13, 14, 15];
  7575. let sayWords = "";
  7576. if (this.selfTurn) {
  7577. if (number <= 7) {
  7578. this.selfCamp = ballCamp.full;
  7579. this.selfBallArr = full;
  7580. this.aiCamp = ballCamp.flower;
  7581. this.aiBallArr = flower;
  7582. sayWords = cfgTable.wordsData[3].msg;
  7583. }
  7584. else {
  7585. this.selfCamp = ballCamp.flower;
  7586. this.selfBallArr = flower;
  7587. this.aiCamp = ballCamp.full;
  7588. this.aiBallArr = full;
  7589. sayWords = cfgTable.wordsData[4].msg;
  7590. }
  7591. }
  7592. else {
  7593. if (number <= 7) {
  7594. this.selfCamp = ballCamp.flower;
  7595. this.selfBallArr = flower;
  7596. this.aiCamp = ballCamp.full;
  7597. this.aiBallArr = full;
  7598. sayWords = cfgTable.wordsData[2].msg;
  7599. }
  7600. else {
  7601. this.selfCamp = ballCamp.full;
  7602. this.selfBallArr = full;
  7603. this.aiCamp = ballCamp.flower;
  7604. this.aiBallArr = flower;
  7605. sayWords = cfgTable.wordsData[1].msg;
  7606. }
  7607. }
  7608. this.updateLeftBall();
  7609. xGame.uiMgr.Show(UIMsg, sayWords);
  7610. }
  7611. updatePlaceBallState() {
  7612. let ui = xGame.common.gameUI.ui;
  7613. switch (this.placeBallData.type) {
  7614. case PlaceBallType.normal:
  7615. let normal = ui.placeNormalNode;
  7616. normal.hpTxt.text = this.curHP + "";
  7617. this.updatePlaceBallStar(normal);
  7618. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7619. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7620. break;
  7621. case PlaceBallType.challenge:
  7622. let challenge = ui.placeChallengeNode;
  7623. challenge.hpTxt.text = "Shots:" + this.curHP;
  7624. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7625. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7626. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7627. break;
  7628. default:
  7629. break;
  7630. }
  7631. }
  7632. playSubHpAni() {
  7633. let ui = xGame.common.gameUI.ui;
  7634. switch (this.placeBallData.type) {
  7635. case PlaceBallType.normal:
  7636. let normal = ui.placeNormalNode;
  7637. normal.hpTxt.visible = false;
  7638. normal.starAni.c1.selectedIndex = 1;
  7639. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7640. normal.hpTxt.visible = true;
  7641. normal.starAni.c1.selectedIndex = 0;
  7642. }));
  7643. break;
  7644. default:
  7645. break;
  7646. }
  7647. }
  7648. getEndStarNum() {
  7649. let num;
  7650. let level = xGame.common.placeBallCurLevel;
  7651. if (this.curHP == this.placeBallData.hp) {
  7652. num = 3;
  7653. }
  7654. else if (this.curHP <= 1) {
  7655. num = 1;
  7656. }
  7657. else {
  7658. num = 2;
  7659. }
  7660. if (!this.success) {
  7661. num = 0;
  7662. }
  7663. else {
  7664. DataMgr.setPlaceBallLevel(level, num);
  7665. }
  7666. let myType = cfgTable.placeballData[level].type;
  7667. if (this.success && myType == 1) {
  7668. num = 3;
  7669. }
  7670. xGame.common.placeBallStarNum = num;
  7671. }
  7672. updatePlaceBallStar(node) {
  7673. let star = 0;
  7674. if (this.curHP == this.placeBallData.hp) {
  7675. star = 3;
  7676. }
  7677. else if (this.curHP >= 2) {
  7678. star = 2;
  7679. }
  7680. else if (this.curHP == 1) {
  7681. star = 1;
  7682. }
  7683. else {
  7684. star = 0;
  7685. }
  7686. let temp;
  7687. for (let index = 1; index <= 3; index++) {
  7688. temp = node["star" + index];
  7689. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7690. }
  7691. node.myProgress.value = (star / 3) * 100;
  7692. }
  7693. openRegretView(isFoul, GoalNum, challenge = false) {
  7694. let regretType = -1;
  7695. if (isFoul) {
  7696. regretType = 1;
  7697. }
  7698. else {
  7699. if (GoalNum <= 0) {
  7700. regretType = 0;
  7701. }
  7702. }
  7703. if (challenge) {
  7704. regretType = 1;
  7705. }
  7706. if (regretType != -1) {
  7707. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7708. if (success) {
  7709. this.curHP++;
  7710. this.updatePlaceBallState();
  7711. this.setPlaceBallAllPos();
  7712. xGame.common.gameUI.ui.moveNode.visible = false;
  7713. }
  7714. else {
  7715. if (this.curHP <= 0) {
  7716. this.success = false;
  7717. this.gameEnd();
  7718. }
  7719. this.playSubHpAni();
  7720. }
  7721. this.updatePlaceBallState();
  7722. this.updatePlaceBallPos();
  7723. });
  7724. }
  7725. }
  7726. setPlaceBallAllPos() {
  7727. let allBall = xGame.common.d2World.ballArr;
  7728. let cfgArr = this.placeBallPosData;
  7729. let temp;
  7730. let obj;
  7731. for (let index = 0; index < allBall.length; index++) {
  7732. temp = allBall[index];
  7733. if (temp.destroyed)
  7734. continue;
  7735. obj = cfgArr[temp.myUNID];
  7736. if (obj && obj.src && !obj.src.destroyed) {
  7737. temp.gameObj.x = obj.posX;
  7738. temp.gameObj.y = obj.posY;
  7739. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7740. }
  7741. }
  7742. xGame.common.d2World.getHelpLine();
  7743. }
  7744. updatePlaceBallPos() {
  7745. let arr = xGame.common.d2World.ballArr;
  7746. let temp;
  7747. for (let index = 0; index < arr.length; index++) {
  7748. temp = arr[index];
  7749. if (!this.placeBallPosData[temp.myUNID]) {
  7750. this.placeBallPosData[temp.myUNID] = {
  7751. src: temp,
  7752. posX: temp.gameObj.x,
  7753. posY: temp.gameObj.y
  7754. };
  7755. }
  7756. else {
  7757. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7758. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7759. }
  7760. }
  7761. let check;
  7762. for (const key in this.placeBallPosData) {
  7763. check = this.placeBallPosData[key];
  7764. if (check.src.destroyed) {
  7765. delete this.placeBallPosData[key];
  7766. }
  7767. }
  7768. }
  7769. gameRun(type) {
  7770. if (this.gamePause)
  7771. return;
  7772. this.curFoul = this.getFoulType();
  7773. if (type) {
  7774. xGame.common.d2World.d2Gan.shoot();
  7775. xGame.common.gameUI.forceCancel();
  7776. this.curFoul = type;
  7777. }
  7778. this.isEnd = false;
  7779. this.isChangeTurn = true;
  7780. if (xGame.common.gameMode == GameMode.classic) {
  7781. this.judgeClassic(this.curFoul);
  7782. this.checkClassicWords(() => {
  7783. xGame.common.destroyClassicEmotion();
  7784. if (this.isEnd) {
  7785. if (this.isBlackInHole) {
  7786. xGame.common.gameUI.ui.blackAni.visible = true;
  7787. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7788. xGame.common.gameUI.ui.blackAni.visible = false;
  7789. this.gameEnd();
  7790. }));
  7791. }
  7792. else {
  7793. this.gameEnd();
  7794. }
  7795. }
  7796. else {
  7797. this.waitShoot();
  7798. xGame.eventMgr.event(WAIT_SHOOT);
  7799. }
  7800. });
  7801. }
  7802. else if (xGame.common.gameMode == GameMode.bigMove) {
  7803. xGame.common.aiPlayer.stopRun();
  7804. let scoreArr = this.getScore(this.curFoul);
  7805. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7806. this.isEnd = true;
  7807. }
  7808. this.checkBigSkillWords(() => {
  7809. if (this.isEnd) {
  7810. this.gameEnd();
  7811. }
  7812. else {
  7813. this.waitShoot();
  7814. xGame.eventMgr.event(WAIT_SHOOT);
  7815. }
  7816. });
  7817. }
  7818. else if (xGame.common.gameMode == GameMode.placeBall) {
  7819. xGame.common.destroyAwardSpine();
  7820. let isFoul = this.curFoul == FoulType.rootHole;
  7821. let GoalNum = this.inHoleBalls.length;
  7822. if (this.inHoleBalls.indexOf(0) > -1)
  7823. GoalNum -= 1;
  7824. if (isFoul) {
  7825. this.placeRootBall();
  7826. }
  7827. console.log("neeballs", this.needBalls);
  7828. console.log("当前完成的goalNum", GoalNum);
  7829. this.finishBalls += GoalNum;
  7830. console.log("当前完成的finishballs", this.finishBalls);
  7831. let need = this.needBalls;
  7832. if (this.placeBallData.type == PlaceBallType.challenge) {
  7833. need += 100;
  7834. }
  7835. if (this.finishBalls >= need) {
  7836. this.success = true;
  7837. this.gameEnd();
  7838. }
  7839. else {
  7840. switch (this.placeBallData.type) {
  7841. case PlaceBallType.normal:
  7842. if (!isFoul && GoalNum > 0) {
  7843. this.updatePlaceBallPos();
  7844. this.updatePlaceBallState();
  7845. }
  7846. else {
  7847. this.curHP--;
  7848. this.openRegretView(isFoul, GoalNum);
  7849. }
  7850. this.waitShoot();
  7851. xGame.eventMgr.event(WAIT_SHOOT);
  7852. break;
  7853. case PlaceBallType.challenge:
  7854. this.curHP--;
  7855. this.updatePlaceBallState();
  7856. if (isFoul) {
  7857. this.openRegretView(isFoul, GoalNum, true);
  7858. }
  7859. else {
  7860. this.updatePlaceBallPos();
  7861. if (this.curHP <= 0) {
  7862. this.success = true;
  7863. this.gameEnd();
  7864. }
  7865. }
  7866. this.waitShoot();
  7867. xGame.eventMgr.event(WAIT_SHOOT);
  7868. break;
  7869. default:
  7870. break;
  7871. }
  7872. }
  7873. }
  7874. }
  7875. checkClassicWords(callback) {
  7876. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7877. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7878. let type = this.getClassicWordsType();
  7879. if (condition && type != -1) {
  7880. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7881. xGame.soundMgr.playSound(str);
  7882. xGame.common.wordsMgr.playClassicWords(type, callback);
  7883. }
  7884. else {
  7885. Laya.timer.once(300, this, () => {
  7886. callback && callback();
  7887. });
  7888. }
  7889. }
  7890. getClassicWordsType() {
  7891. let d2world = xGame.common.d2World;
  7892. let type = -1;
  7893. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7894. type = ClassicWordsType.perfectShow;
  7895. return type;
  7896. }
  7897. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7898. type = ClassicWordsType.directShoot;
  7899. return type;
  7900. }
  7901. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7902. type = ClassicWordsType.anotherShoot;
  7903. return type;
  7904. }
  7905. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7906. type = ClassicWordsType.bigPower;
  7907. return type;
  7908. }
  7909. let minSpeed = 1;
  7910. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7911. type = ClassicWordsType.hardShoot;
  7912. return type;
  7913. }
  7914. if (this.inHoleBalls.length > 0) {
  7915. type = ClassicWordsType.directShoot;
  7916. return type;
  7917. }
  7918. return type;
  7919. }
  7920. checkBigSkillWords(callback) {
  7921. if (this.curFoul == FoulType.timeOut) {
  7922. callback && callback();
  7923. }
  7924. else {
  7925. let playSkill = false;
  7926. if (this.selfTurn) {
  7927. playSkill = true;
  7928. }
  7929. else {
  7930. if (!this.aiPlayedBreakArmy) {
  7931. this.aiPlayedBreakArmy = true;
  7932. playSkill = true;
  7933. }
  7934. if (this.aiCurSkill != SkillType.breakArmy) {
  7935. playSkill = true;
  7936. }
  7937. }
  7938. if (xGame.common.skillMgr.playedLastSkill) {
  7939. xGame.common.skillMgr.playedLastSkill = false;
  7940. playSkill = false;
  7941. }
  7942. if (playSkill) {
  7943. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7944. let selfExtra = 0;
  7945. let aiExtra = 0;
  7946. if (this.selfTurn)
  7947. selfExtra += extraScore;
  7948. else
  7949. aiExtra += extraScore;
  7950. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7951. this.isEnd = true;
  7952. }
  7953. this.playBigSkillTimes(callback);
  7954. });
  7955. }
  7956. else {
  7957. this.playBigSkillTimes(callback);
  7958. }
  7959. }
  7960. }
  7961. playBigSkillTimes(callback) {
  7962. let length = this.inHoleBalls.length;
  7963. if (this.inHoleBalls.indexOf(0) > -1) {
  7964. length = this.inHoleBalls.length - 1;
  7965. }
  7966. if (length <= 0) {
  7967. callback && callback();
  7968. return;
  7969. }
  7970. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7971. callback && callback();
  7972. });
  7973. }
  7974. playSkillTips() {
  7975. let levelNum = 0;
  7976. let curType;
  7977. if (this.selfTurn) {
  7978. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7979. curType = this.selfCurSkill;
  7980. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7981. levelNum += 5;
  7982. }
  7983. }
  7984. else {
  7985. levelNum = this.aiSkillLevelNum;
  7986. curType = this.aiCurSkill;
  7987. }
  7988. let str = ``;
  7989. switch (curType) {
  7990. case SkillType.highSpace:
  7991. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  7992. break;
  7993. case SkillType.breakArmy:
  7994. str = `You pocketed ${levelNum} extra balls`;
  7995. break;
  7996. case SkillType.ice:
  7997. str = `${levelNum * 2} extra balls were frozen`;
  7998. break;
  7999. case SkillType.fireworks:
  8000. str = `${levelNum} extra balls exploded `;
  8001. break;
  8002. case SkillType.GuanYu:
  8003. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8004. break;
  8005. default:
  8006. break;
  8007. }
  8008. xGame.uiMgr.Show(UIMsg, str);
  8009. }
  8010. getFoulType() {
  8011. let foulType = "";
  8012. if (this.firstColliObj == null) {
  8013. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8014. return FoulType.rootHole;
  8015. }
  8016. return FoulType.notTouch;
  8017. }
  8018. else {
  8019. if (this.selfTurn) {
  8020. if (this.selfBallArr.length > 0) {
  8021. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8022. foulType = FoulType.wrongTouch;
  8023. }
  8024. }
  8025. else {
  8026. if (this.ensureBallType) {
  8027. }
  8028. else {
  8029. if (this.firstColliObj == this.blackNum) {
  8030. foulType = FoulType.wrongTouch;
  8031. }
  8032. }
  8033. }
  8034. }
  8035. else {
  8036. if (this.aiBallArr.length > 0) {
  8037. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8038. foulType = FoulType.wrongTouch;
  8039. }
  8040. }
  8041. else {
  8042. if (this.ensureBallType) {
  8043. }
  8044. else {
  8045. if (this.firstColliObj == this.blackNum) {
  8046. foulType = FoulType.wrongTouch;
  8047. }
  8048. }
  8049. }
  8050. }
  8051. if (this.inHoleBalls.length <= 0) {
  8052. return foulType;
  8053. }
  8054. let temp;
  8055. if (this.inHoleBalls.indexOf(0) > -1) {
  8056. foulType = FoulType.rootHole;
  8057. }
  8058. else {
  8059. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8060. temp = this.inHoleBalls[index];
  8061. if (this.selfTurn) {
  8062. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8063. foulType = FoulType.wrongHole;
  8064. break;
  8065. }
  8066. }
  8067. else {
  8068. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8069. foulType = FoulType.wrongHole;
  8070. break;
  8071. }
  8072. }
  8073. }
  8074. }
  8075. let foo;
  8076. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8077. temp = this.inHoleBalls[index];
  8078. foo = this.selfBallArr.indexOf(temp);
  8079. if (foo > -1) {
  8080. this.selfBallArr.splice(foo, 1);
  8081. }
  8082. foo = this.aiBallArr.indexOf(temp);
  8083. if (foo > -1) {
  8084. this.aiBallArr.splice(foo, 1);
  8085. }
  8086. }
  8087. this.updateLeftBall();
  8088. }
  8089. return foulType;
  8090. }
  8091. judgeGameEndByBlack(arr) {
  8092. if (this.selfTurn) {
  8093. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8094. this.selfFoulNum = this.maxFoulTimes;
  8095. return true;
  8096. }
  8097. }
  8098. else {
  8099. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8100. this.aiFoulNum = this.maxFoulTimes;
  8101. return true;
  8102. }
  8103. }
  8104. }
  8105. judgeClassic(type) {
  8106. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8107. xGame.common.aiPlayer.stopRun();
  8108. if (this.judgeNormalSuccess()) {
  8109. this.isEnd = true;
  8110. return;
  8111. }
  8112. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8113. if (this.selfTurn) {
  8114. if (isFoul) {
  8115. this.selfFoulNum++;
  8116. }
  8117. if (this.selfFoulNum >= this.maxFoulTimes) {
  8118. this.success = false;
  8119. this.isEnd = true;
  8120. return;
  8121. }
  8122. }
  8123. else {
  8124. if (isFoul)
  8125. this.aiFoulNum++;
  8126. if (this.aiFoulNum >= this.maxFoulTimes) {
  8127. this.success = true;
  8128. this.isEnd = true;
  8129. return;
  8130. }
  8131. }
  8132. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8133. this.isChangeTurn = false;
  8134. }
  8135. else {
  8136. this.isInterrupt = true;
  8137. }
  8138. }
  8139. waitShoot() {
  8140. if (xGame.common.gameMode == GameMode.classic) {
  8141. switch (this.curFoul) {
  8142. case FoulType.timeOut:
  8143. case FoulType.rootHole:
  8144. this.selfTurn = !this.selfTurn;
  8145. this.peoplePlay(5, 6, true);
  8146. break;
  8147. case FoulType.notTouch:
  8148. this.selfTurn = !this.selfTurn;
  8149. this.peoplePlay(7, 7);
  8150. break;
  8151. case FoulType.wrongHole:
  8152. this.selfTurn = !this.selfTurn;
  8153. this.peoplePlay(11, 11);
  8154. break;
  8155. default:
  8156. if (this.inHoleBalls.length > 0) {
  8157. this.peoplePlay(0, 0, false, false);
  8158. }
  8159. else {
  8160. this.selfTurn = !this.selfTurn;
  8161. this.peoplePlay(7, 7);
  8162. }
  8163. break;
  8164. }
  8165. }
  8166. else if (xGame.common.gameMode == GameMode.bigMove) {
  8167. if (this.curFoul == FoulType.timeOut) {
  8168. this.selfTurn = !this.selfTurn;
  8169. this.peoplePlay(14, 15);
  8170. this.placeRootBall();
  8171. }
  8172. else {
  8173. this.selfTurn = !this.selfTurn;
  8174. if (this.curFoul == FoulType.rootHole) {
  8175. this.peoplePlay(12, 13);
  8176. this.placeRootBall();
  8177. }
  8178. else {
  8179. this.peoplePlay(0, 0, false, false);
  8180. }
  8181. }
  8182. }
  8183. else if (xGame.common.gameMode == GameMode.placeBall) {
  8184. this.finishOneShoot = true;
  8185. }
  8186. this.gameResult();
  8187. }
  8188. gameResult() {
  8189. this.firstColliObj = null;
  8190. this.inHoleBalls = [];
  8191. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8192. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8193. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8194. if (xGame.common.uiRodMethod)
  8195. xGame.common.uiRodMethod.resetRod();
  8196. xGame.common.d2World.rootBall.showSelf();
  8197. this.clearIceSkill();
  8198. if (this.selfTurn) {
  8199. console.log("gameResult");
  8200. PlatMgr.gameInsert();
  8201. }
  8202. xGame.common.d3World.knifeRoot.destroyChildren();
  8203. if (this.selfTurn) {
  8204. xGame.common.gameUI.showHelpLineGuide();
  8205. xGame.common.gameUI.setTurnAlpha(true);
  8206. }
  8207. else {
  8208. xGame.common.gameUI.setTurnAlpha(false);
  8209. }
  8210. }
  8211. getScore(type) {
  8212. let selfAdd = 0;
  8213. let aiAdd = 0;
  8214. if (type == FoulType.timeOut) {
  8215. if (this.selfTurn)
  8216. aiAdd += 3;
  8217. else
  8218. selfAdd += 3;
  8219. }
  8220. else {
  8221. if (this.inHoleBalls.length > 0) {
  8222. if (this.selfTurn) {
  8223. if (type == FoulType.rootHole) {
  8224. aiAdd += 3;
  8225. if (this.inHoleBalls.length - 1 > 0) {
  8226. selfAdd += this.inHoleBalls.length - 1;
  8227. }
  8228. }
  8229. else {
  8230. selfAdd += this.inHoleBalls.length;
  8231. }
  8232. }
  8233. else {
  8234. if (type == FoulType.rootHole) {
  8235. selfAdd += 3;
  8236. if (this.inHoleBalls.length - 1 > 0) {
  8237. aiAdd += this.inHoleBalls.length - 1;
  8238. }
  8239. }
  8240. else {
  8241. aiAdd += this.inHoleBalls.length;
  8242. }
  8243. }
  8244. }
  8245. }
  8246. return [selfAdd, aiAdd];
  8247. }
  8248. judgeScoreEnd(selfAdd, aiAdd) {
  8249. this.selfScore += selfAdd;
  8250. this.aiScore += aiAdd;
  8251. this.updateAIScore();
  8252. this.updateSelfScore();
  8253. if (this.selfScore >= this.targertScore) {
  8254. this.success = true;
  8255. return true;
  8256. }
  8257. if (this.aiScore >= this.targertScore) {
  8258. this.success = false;
  8259. return true;
  8260. }
  8261. let ballArr = xGame.common.d2World.ballArr;
  8262. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8263. if (this.selfScore > this.aiScore) {
  8264. this.success = true;
  8265. return true;
  8266. }
  8267. else if (this.selfScore < this.aiScore) {
  8268. this.success = false;
  8269. return true;
  8270. }
  8271. else {
  8272. if (this.selfTurn) {
  8273. this.success = false;
  8274. }
  8275. else {
  8276. this.success = true;
  8277. }
  8278. return true;
  8279. }
  8280. }
  8281. }
  8282. clearIceSkill() {
  8283. let arr = xGame.common.d2World.ballArr;
  8284. let temp;
  8285. if (this.selfTurn) {
  8286. if (this.selfCurSkill == SkillType.ice) {
  8287. for (let index = 0; index < arr.length; index++) {
  8288. temp = arr[index];
  8289. if (temp.ballFunc == "ice") {
  8290. temp.setBallFunc("normal", "self");
  8291. }
  8292. }
  8293. }
  8294. }
  8295. else {
  8296. if (this.aiCurSkill == SkillType.ice) {
  8297. for (let index = 0; index < arr.length; index++) {
  8298. temp = arr[index];
  8299. if (temp.ballFunc == "ice") {
  8300. temp.setBallFunc("normal", "ai");
  8301. }
  8302. }
  8303. }
  8304. }
  8305. }
  8306. judgeNormalSuccess() {
  8307. if (this.selfTurn) {
  8308. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8309. this.success = true;
  8310. return true;
  8311. }
  8312. }
  8313. else {
  8314. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8315. this.success = false;
  8316. return true;
  8317. }
  8318. }
  8319. }
  8320. gameEnd() {
  8321. if (Moyu.isTT) {
  8322. xGame.common.screenImg = getScreenImg();
  8323. }
  8324. console.log("游戏结束", this.success);
  8325. xGame.common.aiPlayer.stopRun();
  8326. if (xGame.common.gameMode == GameMode.placeBall) {
  8327. this.getEndStarNum();
  8328. this.updatePlaceBallState();
  8329. }
  8330. this.isEnter = false;
  8331. Moyu.recordEnd(this, () => {
  8332. if (this.isEnter)
  8333. return;
  8334. this.isEnter = true;
  8335. console.log("进入录结束回调");
  8336. this.enterNext();
  8337. });
  8338. Laya.timer.once(1000, this, () => {
  8339. if (this.isEnter)
  8340. return;
  8341. this.isEnter = true;
  8342. this.enterNext();
  8343. });
  8344. xGame.common.longHelpLine = false;
  8345. }
  8346. enterNext() {
  8347. Laya.timer.clearAll(this);
  8348. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8349. xGame.uiMgr.Show(UIVideoShare, this.success);
  8350. }
  8351. else {
  8352. xGame.uiMgr.Show(UIGameEnd, this.success);
  8353. }
  8354. }
  8355. aiLeave() {
  8356. let ui = xGame.common.gameUI.ui;
  8357. ui.topNode.aiNameTxt.text = "offline";
  8358. }
  8359. aiGameEnd(suc) {
  8360. this.success = suc;
  8361. xGame.common.aiPlayer.stopRun();
  8362. if (this.success) {
  8363. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8364. Laya.timer.once(1000, this, () => {
  8365. this.clearTime();
  8366. this.gameEnd();
  8367. });
  8368. }
  8369. }
  8370. openTimer() {
  8371. let src = xGame.common.gameUI;
  8372. if (this.selfTurn) {
  8373. src.ui.topNode.selfProgress.visible = true;
  8374. src.ui.topNode.aiProgress.visible = false;
  8375. this.curTimer = src.ui.topNode.selfProgress;
  8376. }
  8377. else {
  8378. src.ui.topNode.selfProgress.visible = false;
  8379. src.ui.topNode.aiProgress.visible = true;
  8380. this.curTimer = src.ui.topNode.aiProgress;
  8381. }
  8382. this.accTime = 0;
  8383. Laya.timer.clearAll(this);
  8384. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8385. this.curTimer.value = 100;
  8386. }
  8387. updateTime(dt) {
  8388. if (this.gamePause)
  8389. return;
  8390. this.accTime += dt;
  8391. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8392. if (this.accTime >= this.setTime) {
  8393. this.clearTime();
  8394. console.log("时钟进入了gameRun");
  8395. this.gameRun(FoulType.timeOut);
  8396. }
  8397. }
  8398. clearTime() {
  8399. let src = xGame.common.gameUI;
  8400. src.ui.topNode.selfProgress.visible = false;
  8401. src.ui.topNode.aiProgress.visible = false;
  8402. Laya.timer.clearAll(this);
  8403. }
  8404. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8405. let ui = xGame.common.gameUI.ui;
  8406. let selfMsg, aiMsg;
  8407. if (sayWords) {
  8408. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8409. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8410. if (Foul) {
  8411. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8412. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8413. this.placeRootBall();
  8414. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8415. if (this.curFoul == FoulType.rootHole) {
  8416. if (!DataMgr.getRootBallFoul()) {
  8417. DataMgr.setRootBallFoul();
  8418. aiMsg = "";
  8419. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8420. let woman = "Boss, pay attention next time~";
  8421. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8422. }
  8423. }
  8424. else if (this.curFoul == FoulType.timeOut) {
  8425. if (!DataMgr.getTimeoutFoul()) {
  8426. DataMgr.setTimeoutFoul();
  8427. aiMsg = "";
  8428. let tips = "Game timeout, 3 fouls, this game failed.";
  8429. let woman = "Boss, pay attention to the timeline~";
  8430. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8431. }
  8432. }
  8433. }
  8434. }
  8435. }
  8436. if (this.selfTurn) {
  8437. if (sayWords) {
  8438. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8439. ui.selfTurn.visible = true;
  8440. ui.aiTurn.visible = false;
  8441. ui.selfTurn.t0.play();
  8442. Moyu.vibration();
  8443. });
  8444. }
  8445. }
  8446. else {
  8447. let aiNum = xGame.tools.random(1, 11);
  8448. let challengeNum = DataMgr.getChallengeTimes();
  8449. let delay = false;
  8450. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8451. aiNum = 9;
  8452. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8453. aiNum = 3;
  8454. if (challengeNum == 3) {
  8455. if (!this.showLongView) {
  8456. this.showLongView = true;
  8457. delay = true;
  8458. }
  8459. }
  8460. }
  8461. }
  8462. if (delay) {
  8463. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8464. if (success) {
  8465. xGame.common.longHelpLine = true;
  8466. xGame.common.d2World.getHelpLine();
  8467. }
  8468. else {
  8469. aiNum = 10;
  8470. }
  8471. xGame.common.aiPlayer.setAiLevel(aiNum);
  8472. if (sayWords) {
  8473. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8474. xGame.common.aiPlayer.runAI();
  8475. ui.selfTurn.visible = false;
  8476. ui.aiTurn.visible = true;
  8477. ui.aiTurn.t0.play();
  8478. });
  8479. }
  8480. else {
  8481. xGame.common.aiPlayer.runAI();
  8482. }
  8483. this.openTimer();
  8484. this.finishOneShoot = true;
  8485. if (this.selfTurn) {
  8486. ui.topNode.selfKuang.visible = true;
  8487. ui.topNode.aiKuang.visible = false;
  8488. ui.topNode.selfTips.visible = true;
  8489. ui.topNode.aiTips.visible = false;
  8490. }
  8491. else {
  8492. ui.topNode.selfKuang.visible = false;
  8493. ui.topNode.aiKuang.visible = true;
  8494. ui.topNode.selfTips.visible = false;
  8495. ui.topNode.aiTips.visible = true;
  8496. }
  8497. });
  8498. return;
  8499. }
  8500. if (xGame.common.gameMode == GameMode.classic) {
  8501. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8502. if (cfg) {
  8503. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8504. aiNum = aiLevel;
  8505. }
  8506. }
  8507. xGame.common.aiPlayer.setAiLevel(aiNum);
  8508. if (sayWords) {
  8509. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8510. xGame.common.aiPlayer.runAI();
  8511. ui.selfTurn.visible = false;
  8512. ui.aiTurn.visible = true;
  8513. ui.aiTurn.t0.play();
  8514. });
  8515. }
  8516. else {
  8517. xGame.common.aiPlayer.runAI();
  8518. }
  8519. }
  8520. this.openTimer();
  8521. this.finishOneShoot = true;
  8522. if (this.selfTurn) {
  8523. ui.topNode.selfKuang.visible = true;
  8524. ui.topNode.aiKuang.visible = false;
  8525. ui.topNode.selfTips.visible = true;
  8526. ui.topNode.aiTips.visible = false;
  8527. }
  8528. else {
  8529. ui.topNode.selfKuang.visible = false;
  8530. ui.topNode.aiKuang.visible = true;
  8531. ui.topNode.selfTips.visible = false;
  8532. ui.topNode.aiTips.visible = true;
  8533. }
  8534. }
  8535. placeRootBall() {
  8536. let rootBall = xGame.common.d2World.rootBall;
  8537. if (!rootBall)
  8538. return;
  8539. rootBall.gameObj.x = this.lastRootBallPos.x;
  8540. rootBall.gameObj.y = this.lastRootBallPos.y;
  8541. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8542. let moveNode = xGame.common.gameUI.ui.moveNode;
  8543. moveNode.visible = true;
  8544. moveNode.x = this.lastRootBallPos.x;
  8545. moveNode.y = this.lastRootBallPos.y;
  8546. if (!this.selfTurn) {
  8547. xGame.common.aiPlayer.resetRoot();
  8548. }
  8549. }
  8550. }
  8551. class ui_guanyuAni extends fgui.GComponent {
  8552. static createInstance() {
  8553. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8554. }
  8555. onConstruct() {
  8556. this.n0 = (this.getChild("n0"));
  8557. }
  8558. }
  8559. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8560. class UIFireworks extends UIBase {
  8561. constructor() {
  8562. super();
  8563. }
  8564. onConstructor() {
  8565. this.isEject = false;
  8566. }
  8567. show(callback) {
  8568. super.show();
  8569. }
  8570. }
  8571. UIFireworks.uiName = "UIFireworks";
  8572. class ui_UIGuanYu extends fgui.GComponent {
  8573. static createInstance() {
  8574. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8575. }
  8576. onConstruct() {
  8577. this.n2 = (this.getChild("n2"));
  8578. this.n1 = (this.getChild("n1"));
  8579. this.n3 = (this.getChild("n3"));
  8580. this.n4 = (this.getChild("n4"));
  8581. this.n5 = (this.getChild("n5"));
  8582. this.n6 = (this.getChild("n6"));
  8583. this.n8 = (this.getChild("n8"));
  8584. this.n7 = (this.getChild("n7"));
  8585. this.t0 = this.getTransition("t0");
  8586. }
  8587. }
  8588. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8589. class UIGuanYu extends UIBase {
  8590. constructor() {
  8591. super();
  8592. }
  8593. onConstructor() {
  8594. this.ui = ui_UIGuanYu.createInstance();
  8595. this.contentPane = this.ui;
  8596. this.isEject = false;
  8597. }
  8598. show(callback) {
  8599. super.show();
  8600. this.ui.t0.play(Laya.Handler.create(this, () => {
  8601. callback && callback();
  8602. this.hide();
  8603. }));
  8604. }
  8605. }
  8606. UIGuanYu.uiName = "UIGuanYu";
  8607. class SkillMgr {
  8608. constructor() {
  8609. this.leveNum = 0;
  8610. this.extraScore = 0;
  8611. this.selfTurn = false;
  8612. this.playedLastSkill = false;
  8613. this.tweenArr = [];
  8614. this._finishNum = 0;
  8615. this._curFinish = 0;
  8616. this._rootX = 0;
  8617. this._rootY = 0;
  8618. this.knifeTimes = 0;
  8619. this.knifeV2 = new Laya.Vector2();
  8620. this.knifeV3 = new Laya.Vector3();
  8621. this.rtStarX = 0;
  8622. this.rtStarY = 0;
  8623. this.addBigSkillSpine();
  8624. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8625. }
  8626. addBigSkillSpine() {
  8627. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8628. console.log("extra2 success");
  8629. });
  8630. }
  8631. runBigSkill(callback) {
  8632. this.tweenArr = [];
  8633. this.callback = callback;
  8634. this.judgeSkill();
  8635. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8636. let guide = DataMgr.getSkillGuide();
  8637. if (!xGame.common.gameMgr.selfTurn) {
  8638. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8639. }
  8640. else {
  8641. if (xGame.common.temSelfLevel != 0) {
  8642. this.leveNum = xGame.common.temSelfLevel;
  8643. }
  8644. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8645. this.leveNum += 5;
  8646. }
  8647. }
  8648. if (guide == 0) {
  8649. DataMgr.setSkillGuide(1);
  8650. if (DataMgr.getNewUser()) {
  8651. Moyu.sendDataEvent("gameFirstPlay");
  8652. DataMgr.setNewUser();
  8653. }
  8654. }
  8655. this.playSpineAni(() => {
  8656. switch (this.curSkill) {
  8657. case SkillType.highSpace:
  8658. this.runHighSpace();
  8659. break;
  8660. case SkillType.breakArmy:
  8661. this.runBreakArmy();
  8662. break;
  8663. case SkillType.ice:
  8664. this.runIce();
  8665. break;
  8666. case SkillType.fireworks:
  8667. this.runFireworks();
  8668. break;
  8669. case SkillType.GuanYu:
  8670. this.runGuanYu();
  8671. break;
  8672. default:
  8673. break;
  8674. }
  8675. });
  8676. }
  8677. judgeSkill() {
  8678. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8679. let gameMgr = xGame.common.gameMgr;
  8680. let type;
  8681. for (let index = 0; index < typeArr.length; index++) {
  8682. type = typeArr[index];
  8683. if (gameMgr.selfTurn) {
  8684. if (gameMgr.selfCurSkill == type) {
  8685. this.selfTurn = true;
  8686. this.curSkill = type;
  8687. return;
  8688. }
  8689. }
  8690. else {
  8691. if (gameMgr.aiCurSkill == type) {
  8692. this.selfTurn = false;
  8693. this.curSkill = type;
  8694. return;
  8695. }
  8696. }
  8697. }
  8698. }
  8699. playSpineAni(callback) {
  8700. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8701. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8702. parent.destroyChildren();
  8703. let aniIndex = 0;
  8704. let skillSpine;
  8705. switch (this.curSkill) {
  8706. case SkillType.highSpace:
  8707. aniIndex = 1;
  8708. xGame.soundMgr.playSound("skill01");
  8709. skillSpine = this.skillSpine2;
  8710. data.scaleX = 0.5;
  8711. data.scaleY = 0.5;
  8712. skillSpine.play(data, 1, false, parent, () => {
  8713. callback && callback();
  8714. });
  8715. break;
  8716. case SkillType.breakArmy:
  8717. aniIndex = 2;
  8718. xGame.soundMgr.playSound("skill02");
  8719. skillSpine = this.skillSpine2;
  8720. data.scaleX = 0.5;
  8721. data.scaleY = 0.5;
  8722. skillSpine.play(data, 2, false, parent, () => {
  8723. callback && callback();
  8724. });
  8725. break;
  8726. case SkillType.ice:
  8727. aniIndex = 0;
  8728. xGame.soundMgr.playSound("skill03");
  8729. skillSpine = this.skillSpine2;
  8730. data.scaleX = 0.5;
  8731. data.scaleY = 0.5;
  8732. skillSpine.play(data, 0, false, parent, () => {
  8733. callback && callback();
  8734. });
  8735. break;
  8736. case SkillType.fireworks:
  8737. xGame.soundMgr.playSound("skill_04_01");
  8738. xGame.soundMgr.playSound("skill04");
  8739. xGame.uiMgr.Show(UIFireworks, callback);
  8740. break;
  8741. case SkillType.GuanYu:
  8742. xGame.soundMgr.playSound("skill05_1");
  8743. xGame.soundMgr.playSound("skill05");
  8744. xGame.uiMgr.Show(UIGuanYu, callback);
  8745. break;
  8746. default:
  8747. break;
  8748. }
  8749. }
  8750. getAllBallArr() {
  8751. let arr = xGame.common.d2World.ballArr;
  8752. let outArr = [];
  8753. for (let index = 0; index < arr.length; index++) {
  8754. if (arr[index] instanceof D2RootBallSrc)
  8755. continue;
  8756. if (arr[index].ballFunc == "ice")
  8757. continue;
  8758. if (arr[index].destroyed)
  8759. continue;
  8760. outArr.push(arr[index]);
  8761. }
  8762. return outArr;
  8763. }
  8764. getOneArr(deletObj) {
  8765. let allArr = this.getAllBallArr();
  8766. let temp;
  8767. for (let index = 0; index < allArr.length; index++) {
  8768. temp = allArr[index];
  8769. if (temp.id == deletObj.id) {
  8770. allArr.splice(index, 1);
  8771. break;
  8772. }
  8773. }
  8774. return allArr;
  8775. }
  8776. getNearBallBag(ball) {
  8777. let ui = xGame.common.gameUI.ui;
  8778. let circleArr = [];
  8779. for (let index = 1; index <= 6; index++) {
  8780. circleArr.push(ui.border["circle" + index]);
  8781. }
  8782. let outIndex = 0;
  8783. let temp;
  8784. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8785. ;
  8786. let dis = 0;
  8787. for (let index = 1; index < circleArr.length; index++) {
  8788. temp = circleArr[index];
  8789. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8790. if (dis < min) {
  8791. min = dis;
  8792. outIndex = index;
  8793. }
  8794. }
  8795. return [circleArr[outIndex], outIndex];
  8796. }
  8797. ballFlyToBag(ballArr, time = 300) {
  8798. let temp;
  8799. let hole;
  8800. this._finishNum = ballArr.length;
  8801. this._curFinish = 0;
  8802. let holeObj = {};
  8803. let holeCfg = {
  8804. "1": 0,
  8805. "2": 0,
  8806. "3": 0,
  8807. "4": 0,
  8808. "5": 0,
  8809. "6": 0
  8810. };
  8811. for (let index = 0; index < ballArr.length; index++) {
  8812. temp = ballArr[index];
  8813. temp.outColli.isSensor = true;
  8814. temp.innerColli.isSensor = true;
  8815. temp.isRunSkillAni = true;
  8816. let holeArr = this.getNearBallBag(temp);
  8817. hole = holeArr[0];
  8818. holeObj[index] = holeArr[1];
  8819. temp.d3BallSrc.scaleXYZ = 0.5;
  8820. this.tweenArr.push(temp.d3BallSrc, temp);
  8821. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8822. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8823. }));
  8824. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8825. let mIndex = holeObj[this._curFinish];
  8826. let isDone = holeCfg[mIndex];
  8827. if (isDone) {
  8828. ballArr[this._curFinish].checkWrongBall(false);
  8829. }
  8830. else {
  8831. holeCfg[mIndex] = 1;
  8832. ballArr[this._curFinish].checkWrongBall();
  8833. }
  8834. this._curFinish++;
  8835. if (this._curFinish >= this._finishNum) {
  8836. if (this.curSkill == SkillType.highSpace) {
  8837. }
  8838. else if (this.curSkill == SkillType.breakArmy) {
  8839. let rootBall = xGame.common.d2World.rootBall;
  8840. rootBall.gameObj.x = this._rootX;
  8841. rootBall.gameObj.y = this._rootY;
  8842. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8843. xGame.common.d2World.d2Gan.ui.visible = true;
  8844. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8845. xGame.common.d2World.getHelpLine();
  8846. this.callback && this.callback(this.extraScore);
  8847. }
  8848. }
  8849. }));
  8850. }
  8851. }
  8852. runHighSpace() {
  8853. let rootBall = xGame.common.d2World.rootBall;
  8854. rootBall.showSelf();
  8855. let d3Src = rootBall.d3BallSrc;
  8856. let allArr = this.getAllBallArr();
  8857. if (allArr.length <= 0) {
  8858. this.callback && this.callback(0);
  8859. return;
  8860. }
  8861. let selectBall = xGame.common.d2World.targetBall;
  8862. let wrong = selectBall && selectBall.destroyed;
  8863. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8864. selectBall = xGame.common.getRandArrEle(allArr);
  8865. }
  8866. let targetD3Src = selectBall.d3BallSrc;
  8867. xGame.common.d2World.d2Gan.ui.visible = false;
  8868. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8869. d3Src.scaleXYZ = 0.5;
  8870. this.tweenArr.push(d3Src);
  8871. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8872. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8873. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8874. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8875. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8876. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8877. let outArr = [selectBall];
  8878. let other = this.leveNum - 1;
  8879. if (other > 0) {
  8880. let nearArr = this.getOneArr(selectBall);
  8881. if (nearArr.length > 0) {
  8882. xGame.common.botherArr(nearArr);
  8883. if (other >= nearArr.length)
  8884. other = nearArr.length;
  8885. for (let index = 0; index < other; index++) {
  8886. outArr.push(nearArr[index]);
  8887. }
  8888. }
  8889. }
  8890. xGame.common.extraMoveNum = other + 1;
  8891. this.extraScore = other + 1;
  8892. this._rootX = selectBall.gameObj.x;
  8893. this._rootY = selectBall.gameObj.y;
  8894. rootBall.gameObj.x = this._rootX;
  8895. rootBall.gameObj.y = this._rootY;
  8896. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8897. Laya.Tween.clearAll(d3Src);
  8898. this.addRandomForce(outArr);
  8899. }));
  8900. }));
  8901. }
  8902. addRandomForce(outArr) {
  8903. if (outArr.length > 0) {
  8904. xGame.common.d2World.openCheckStill = true;
  8905. this.playedLastSkill = true;
  8906. }
  8907. let temp;
  8908. for (let index = 0; index < outArr.length; index++) {
  8909. let angle = xGame.common.randomNum(0, 360);
  8910. let linearPercent = xGame.common.randomNum(65, 100);
  8911. temp = outArr[index];
  8912. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8913. }
  8914. }
  8915. setLinearSpeed(angle, rigy, linearPercent) {
  8916. let sin = Math.sin(angle * Math.PI / 180);
  8917. let cos = Math.cos(angle * Math.PI / 180);
  8918. let maxSpeed = 4;
  8919. let speed = new Laya.Vector2();
  8920. speed.x = maxSpeed * linearPercent * sin;
  8921. speed.y = -maxSpeed * linearPercent * cos;
  8922. rigy.applyLinearImpulseToCenter(speed);
  8923. }
  8924. runBreakArmy() {
  8925. xGame.common.d2World.d2Gan.ui.visible = false;
  8926. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8927. let gameUI = xGame.common.gameUI.ui;
  8928. gameUI.skillRod.visible = true;
  8929. gameUI.skillRod.rotation = 110;
  8930. let outArr = this.getAllBallArr();
  8931. if (outArr.length <= 0) {
  8932. gameUI.skillRod.visible = false;
  8933. this.callback && this.callback(0);
  8934. return;
  8935. }
  8936. xGame.common.botherArr(outArr);
  8937. if (this.leveNum >= outArr.length)
  8938. this.leveNum = outArr.length;
  8939. let deleteNum = outArr.length - this.leveNum;
  8940. outArr.splice(0, deleteNum);
  8941. this.extraScore = this.leveNum;
  8942. let potX = gameUI.skillRod.x;
  8943. let potY = gameUI.skillRod.y;
  8944. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8945. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8946. let disArr = [];
  8947. for (let index = 0; index < outArr.length; index++) {
  8948. let obj = outArr[index];
  8949. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8950. dis = Math.pow(dis, 0.5);
  8951. disArr.push(dis);
  8952. }
  8953. this.tweenArr.push(gameUI.skillRod);
  8954. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8955. })).update = Laya.Handler.create(this, (e, t, c) => {
  8956. let angle = gameUI.skillRod.rotation;
  8957. let xx;
  8958. let yy;
  8959. let temp;
  8960. for (let index = 0; index < outArr.length; index++) {
  8961. temp = outArr[index];
  8962. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8963. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8964. yy -= 20;
  8965. temp.gameObj.x = xx;
  8966. temp.gameObj.y = yy;
  8967. temp.d3BallSrc.setTransPos(xx, yy);
  8968. }
  8969. if (angle <= 60) {
  8970. Laya.Tween.clearAll(gameUI.skillRod);
  8971. this.ballFlyToBag(outArr, 150);
  8972. gameUI.skillRod.visible = false;
  8973. }
  8974. }, null, false);
  8975. }
  8976. runIce() {
  8977. let ballArr = xGame.common.d2World.ballArr;
  8978. this.leveNum *= 2;
  8979. if (this.leveNum >= ballArr.length - 1)
  8980. this.leveNum = ballArr.length - 1;
  8981. let tempArr = [];
  8982. let outArr = [];
  8983. for (let index = 0; index < ballArr.length; index++) {
  8984. if (ballArr[index] instanceof D2RootBallSrc)
  8985. continue;
  8986. tempArr.push(ballArr[index]);
  8987. }
  8988. if (tempArr.length <= 0) {
  8989. this.callback && this.callback(0);
  8990. return;
  8991. }
  8992. xGame.common.botherArr(tempArr);
  8993. for (let index = 0; index < this.leveNum; index++) {
  8994. outArr.push(tempArr[index]);
  8995. }
  8996. this.extraScore = this.leveNum;
  8997. let temp;
  8998. for (let index = 0; index < outArr.length; index++) {
  8999. temp = outArr[index];
  9000. temp.d3BallSrc.playIceEft();
  9001. }
  9002. Laya.timer.once(2000, this, () => {
  9003. for (let index = 0; index < outArr.length; index++) {
  9004. temp = outArr[index];
  9005. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9006. temp.setBallFunc("ice", str);
  9007. }
  9008. this.callback && this.callback(0);
  9009. });
  9010. }
  9011. runFireworks() {
  9012. let allArr = this.getAllBallArr();
  9013. if (allArr.length <= 0) {
  9014. this.callback && this.callback(0);
  9015. return;
  9016. }
  9017. xGame.common.d2World.d2Gan.ui.visible = false;
  9018. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9019. let outArr = [];
  9020. let other = this.leveNum;
  9021. if (other > 0) {
  9022. if (allArr.length > 0) {
  9023. xGame.common.botherArr(allArr);
  9024. if (other >= allArr.length)
  9025. other = allArr.length;
  9026. for (let index = 0; index < other; index++) {
  9027. outArr.push(allArr[index]);
  9028. }
  9029. }
  9030. }
  9031. xGame.common.extraMoveNum = other;
  9032. this.extraScore = other;
  9033. this.addRandmomFireworks(outArr);
  9034. }
  9035. addRandmomFireworks(outArr) {
  9036. Laya.timer.once(1100, this, () => {
  9037. if (outArr.length > 0) {
  9038. xGame.common.d2World.openCheckStill = true;
  9039. this.playedLastSkill = true;
  9040. }
  9041. });
  9042. xGame.soundMgr.playSound("skill_04_02");
  9043. let temp;
  9044. let delay = -200;
  9045. for (let index = 0; index < outArr.length; index++) {
  9046. temp = outArr[index];
  9047. delay += 200;
  9048. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9049. let angle = xGame.common.randomNum(0, 360);
  9050. angle = this.getFireworksAngle(obj);
  9051. let linearPercent = xGame.common.randomNum(45, 80);
  9052. if (!obj.destroyed)
  9053. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9054. });
  9055. }
  9056. }
  9057. getFireworksAngle(obj) {
  9058. let rootBall = xGame.common.d2World.rootBall;
  9059. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9060. }
  9061. resetGame() {
  9062. Laya.timer.clearAll(this);
  9063. if (this.tweenArr) {
  9064. for (let index = 0; index < this.tweenArr.length; index++) {
  9065. Laya.Tween.clearAll(this.tweenArr[index]);
  9066. }
  9067. }
  9068. this.tweenArr = null;
  9069. }
  9070. runGuanYu() {
  9071. xGame.common.d2World.d2Gan.ui.visible = false;
  9072. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9073. let rootBall = xGame.common.d2World.rootBall;
  9074. if (rootBall.isInHole) {
  9075. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9076. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9077. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9078. rootBall.showSelf();
  9079. }
  9080. this.rtStarX = rootBall.gameObj.x;
  9081. this.rtStarY = rootBall.gameObj.y;
  9082. this.knifeTimes = 0;
  9083. this.playedLastSkill = true;
  9084. rootBall.forceRun = true;
  9085. rootBall.rigy.type = "static";
  9086. xGame.common.d2World.openCheckStill = true;
  9087. this.guanyuRandomKnife();
  9088. }
  9089. guanyuRandomKnife() {
  9090. let rootBall = xGame.common.d2World.rootBall;
  9091. let dir = this.getRandDir();
  9092. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9093. console.log("当前angle", angle);
  9094. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9095. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9096. let dis = 324;
  9097. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9098. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9099. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9100. this.rtStarX = rootBall.gameObj.x;
  9101. this.rtStarY = rootBall.gameObj.y;
  9102. this.knifeTimes++;
  9103. let skillLevel;
  9104. if (xGame.common.gameMgr.selfTurn) {
  9105. skillLevel = DataMgr.getBigSkillByIndex(4);
  9106. }
  9107. else {
  9108. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9109. }
  9110. if (!skillLevel)
  9111. skillLevel = 1;
  9112. skillLevel += 2;
  9113. if (this.knifeTimes < skillLevel) {
  9114. Laya.timer.once(400, this, () => {
  9115. this.guanyuRandomKnife();
  9116. });
  9117. }
  9118. else {
  9119. rootBall.forceRun = false;
  9120. rootBall.rigy.type = "dynamic";
  9121. xGame.common.extraMoveNum = skillLevel;
  9122. }
  9123. }));
  9124. }
  9125. getRandDir() {
  9126. let rootBall = xGame.common.d2World.rootBall;
  9127. let allBall = this.getAllBallArr();
  9128. let target = xGame.common.getRandArrEle(allBall);
  9129. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9130. return this.knifeV2;
  9131. }
  9132. cloneKnife(x, y, rotation) {
  9133. let parent = xGame.common.d3World.knifeRoot;
  9134. let prefab = xGame.common.d3World.knife;
  9135. let clone = prefab.clone();
  9136. parent.addChild(clone);
  9137. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9138. clone.transform.localPositionX = this.knifeV3.x;
  9139. clone.transform.localPositionY = 0;
  9140. clone.transform.localPositionZ = this.knifeV3.z;
  9141. clone.transform.localRotationEulerX = 0;
  9142. clone.transform.localRotationEulerY = rotation;
  9143. clone.transform.localRotationEulerZ = 0;
  9144. clone.active = true;
  9145. return clone;
  9146. }
  9147. cloneGuanYuEft(x, y, angle) {
  9148. return;
  9149. let parent = xGame.common.gameUI.ui.guanyuNode;
  9150. let eft = new ui_guanyuAni();
  9151. eft.parent = parent;
  9152. eft.x = x;
  9153. eft.y = y;
  9154. eft.rotation = angle;
  9155. }
  9156. }
  9157. class ui_UIWordsList extends fgui.GComponent {
  9158. static createInstance() {
  9159. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9160. }
  9161. onConstruct() {
  9162. this.c1 = this.getController("c1");
  9163. this.n74 = (this.getChild("n74"));
  9164. this.clickNode = (this.getChild("clickNode"));
  9165. this.myNode = (this.getChild("myNode"));
  9166. this.n68 = (this.getChild("n68"));
  9167. this.n66 = (this.getChild("n66"));
  9168. this.n55 = (this.getChild("n55"));
  9169. this.wordsBtn = (this.getChild("wordsBtn"));
  9170. this.emotionBtn = (this.getChild("emotionBtn"));
  9171. this.mybggg = (this.getChild("mybggg"));
  9172. this.wordsList = (this.getChild("wordsList"));
  9173. this.emotionList = (this.getChild("emotionList"));
  9174. this.myRoot = (this.getChild("myRoot"));
  9175. }
  9176. }
  9177. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9178. class EmotionDisplay {
  9179. constructor(index, ui) {
  9180. this.ui = ui;
  9181. this.index = index;
  9182. this.ui.onClick(this, this.clickSelf);
  9183. this.updateSelf();
  9184. }
  9185. updateSelf() {
  9186. let data = cfgTable.emotionData[this.index + 1];
  9187. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9188. }
  9189. clickSelf() {
  9190. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9191. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9192. xGame.common.talkMgr.closeTalkView();
  9193. }
  9194. }
  9195. class WordsDisplay {
  9196. constructor(index, ui) {
  9197. this.ui = ui;
  9198. this.index = index;
  9199. this.ui.onClick(this, this.clickSelf);
  9200. this.updateSelf();
  9201. }
  9202. updateSelf() {
  9203. let data = cfgTable.talkwordsData[this.index + 1];
  9204. this.ui.txt.text = data.msg;
  9205. }
  9206. clickSelf() {
  9207. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9208. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9209. xGame.common.talkMgr.closeTalkView();
  9210. }
  9211. }
  9212. class UIWordsList extends UIBase {
  9213. constructor() {
  9214. super();
  9215. }
  9216. onConstructor() {
  9217. this.ui = ui_UIWordsList.createInstance();
  9218. this.contentPane = this.ui;
  9219. this.isEject = false;
  9220. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9221. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9222. this.addUIClick(this.ui.clickNode, this.hide);
  9223. this.initTalkList();
  9224. this.initEmotionList();
  9225. }
  9226. show() {
  9227. super.show();
  9228. }
  9229. initTalkList() {
  9230. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9231. let data = cfgTable.talkwordsData;
  9232. let length = Object.keys(data).length;
  9233. this.ui.wordsList.numItems = length;
  9234. }
  9235. initEmotionList() {
  9236. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9237. let data = cfgTable.emotionData;
  9238. let length = Object.keys(data).length;
  9239. this.ui.emotionList.numItems = length;
  9240. }
  9241. renderTalkItem(index, obj) {
  9242. let temp = new WordsDisplay(index, obj);
  9243. }
  9244. renderEmotionItem(index, obj) {
  9245. let temp = new EmotionDisplay(index, obj);
  9246. }
  9247. openTalkList() {
  9248. this.ui.c1.selectedIndex = 0;
  9249. }
  9250. openEmotionList() {
  9251. this.ui.c1.selectedIndex = 1;
  9252. }
  9253. }
  9254. UIWordsList.uiName = "UIWordsList";
  9255. class TalkMgr {
  9256. constructor() {
  9257. this.aiSpeak = true;
  9258. this.emotionList = [];
  9259. this.talkList = [];
  9260. this.addEvent();
  9261. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9262. this.emotionList = [];
  9263. this.talkList = [];
  9264. for (let k in cfgTable.emotionData) {
  9265. this.emotionList.push(cfgTable.emotionData[k].id);
  9266. }
  9267. for (let k in cfgTable.talkwordsData) {
  9268. this.talkList.push(cfgTable.talkwordsData[k].id);
  9269. }
  9270. }
  9271. addEvent() {
  9272. let ui = xGame.common.gameUI.ui;
  9273. ui.wordsBtn.visible = true;
  9274. ui.wordsBtn.onClick(this, this.openTalkView);
  9275. ui.aiWordsBtn.visible = true;
  9276. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9277. }
  9278. openTalkView() {
  9279. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9280. xGame.uiMgr.Show(UIWordsList);
  9281. }
  9282. closeTalkView() {
  9283. xGame.uiMgr.Hide(UIWordsList);
  9284. }
  9285. clickAIState() {
  9286. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9287. this.aiSpeak = !this.aiSpeak;
  9288. this.changeAIState(this.aiSpeak);
  9289. }
  9290. changeAIState(speak) {
  9291. this.aiSpeak = speak;
  9292. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9293. if (speak) {
  9294. btn.c1.selectedIndex = 0;
  9295. }
  9296. else {
  9297. btn.c1.selectedIndex = 1;
  9298. }
  9299. }
  9300. showSelfTalk(wordsId) {
  9301. let ui = xGame.common.gameUI.ui;
  9302. ui.selfTalk.visible = true;
  9303. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9304. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9305. ui.selfTalk.t0.play();
  9306. }
  9307. showSelfEmotion(emotionId) {
  9308. let ui = xGame.common.gameUI.ui;
  9309. ui.selfTalk.visible = true;
  9310. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9311. this.selfSpine && this.selfSpine.dispose();
  9312. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9313. let spineData = cfgTable.emotionData[emotionId].spine;
  9314. this.selfSpine = new SpineMgr(spineData, () => {
  9315. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9316. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9317. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9318. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9319. });
  9320. ui.selfTalk.t0.play();
  9321. }
  9322. showAITalk(wordsId) {
  9323. if (!this.aiSpeak)
  9324. return;
  9325. if (DataMgr.gameData.gameCount < 2)
  9326. return;
  9327. if (wordsId < 1)
  9328. wordsId = this.getRandTalk();
  9329. let ui = xGame.common.gameUI.ui;
  9330. ui.aiTalk.visible = true;
  9331. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9332. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9333. ui.aiTalk.t0.play();
  9334. }
  9335. getRandTalk() {
  9336. let rand = xGame.tools.random(0, this.talkList.length);
  9337. return this.emotionList[rand];
  9338. }
  9339. getRandEmotion() {
  9340. let rand = xGame.tools.random(0, this.emotionList.length);
  9341. return this.emotionList[rand];
  9342. }
  9343. showAIEmotion(emotionId) {
  9344. if (!this.aiSpeak)
  9345. return;
  9346. if (DataMgr.gameData.gameCount < 2)
  9347. return;
  9348. if (emotionId < 1)
  9349. emotionId = this.getRandEmotion();
  9350. let ui = xGame.common.gameUI.ui;
  9351. ui.aiTalk.visible = true;
  9352. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9353. this.aiSpine && this.aiSpine.dispose();
  9354. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9355. let spineData = cfgTable.emotionData[emotionId].spine;
  9356. this.aiSpine = new SpineMgr(spineData, () => {
  9357. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9358. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9359. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9360. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9361. });
  9362. ui.aiTalk.t0.play();
  9363. }
  9364. resetGame() {
  9365. let ui = xGame.common.gameUI.ui;
  9366. ui.aiTalk.visible = false;
  9367. ui.selfTalk.visible = false;
  9368. this.aiSpine && this.aiSpine.dispose();
  9369. this.selfSpine && this.selfSpine.dispose();
  9370. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9371. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9372. this.closeTalkView();
  9373. }
  9374. }
  9375. class WordsMgr {
  9376. constructor() {
  9377. this.comboTimes = 1;
  9378. this.skillTimes = 0;
  9379. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9380. this.comboSpine = new SpineMgr("yxz_liangan");
  9381. this.skillSpine = new SpineMgr("yiganxqiu");
  9382. this.scoreSpine = new SpineMgr("defen");
  9383. }
  9384. setClassicCombo(isInterrupt) {
  9385. if (isInterrupt) {
  9386. this.comboTimes = 0;
  9387. }
  9388. }
  9389. playClassicWords(type, callback) {
  9390. this.callback = callback;
  9391. let aniIndex = type;
  9392. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9393. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9394. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9395. mySpine.destroy(true);
  9396. this.playClassicTimes();
  9397. });
  9398. }
  9399. playClassicTimes() {
  9400. this.comboTimes++;
  9401. if (this.comboTimes <= 1) {
  9402. this.callback && this.callback();
  9403. }
  9404. else {
  9405. let aniIndex = this.comboTimes - 1;
  9406. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9407. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9408. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9409. mySpine.destroy(true);
  9410. this.callback && this.callback();
  9411. });
  9412. }
  9413. }
  9414. playBigSkillTimes(times, callback) {
  9415. if (times <= 0) {
  9416. callback && callback();
  9417. return;
  9418. }
  9419. this.callback = callback;
  9420. let pre = "sz_0";
  9421. let aniIndex = 0;
  9422. this.getWordsImg(times, pre, () => {
  9423. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9424. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9425. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9426. let r1 = ``;
  9427. let r2 = ``;
  9428. if (times <= 9) {
  9429. r1 = `res/d2Res/${pre}${times}.png`;
  9430. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9431. aniIndex = 0;
  9432. }
  9433. else {
  9434. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9435. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9436. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9437. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9438. aniIndex = 1;
  9439. }
  9440. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9441. mySpine.destroy(true);
  9442. xGame.common.gameMgr.playSkillTips();
  9443. this.playScore(times);
  9444. xGame.common.playRandomMutiBallBigSkillSound();
  9445. }, mySpine);
  9446. });
  9447. }
  9448. playScore(score) {
  9449. let pre = "sz_";
  9450. let aniIndex = 0;
  9451. this.getWordsImg(score, pre, () => {
  9452. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9453. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9454. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9455. let r1 = ``;
  9456. let r2 = ``;
  9457. if (score <= 9) {
  9458. r1 = `res/d2Res/${pre}${score}.png`;
  9459. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9460. aniIndex = 0;
  9461. }
  9462. else {
  9463. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9464. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9465. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9466. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9467. aniIndex = 1;
  9468. }
  9469. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9470. mySpine.destroy(true);
  9471. this.callback && this.callback();
  9472. }, mySpine);
  9473. });
  9474. }
  9475. getWordsImg(number, pre = "", callback) {
  9476. let arr = [];
  9477. if (number <= 9) {
  9478. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9479. }
  9480. else {
  9481. 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 });
  9482. }
  9483. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9484. callback && callback();
  9485. }));
  9486. }
  9487. }
  9488. class ui_UIRodMethod extends fgui.GComponent {
  9489. static createInstance() {
  9490. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9491. }
  9492. onConstruct() {
  9493. this.n24 = (this.getChild("n24"));
  9494. this.white = (this.getChild("white"));
  9495. this.dot = (this.getChild("dot"));
  9496. this.sureBtn = (this.getChild("sureBtn"));
  9497. this.n20 = (this.getChild("n20"));
  9498. this.n21 = (this.getChild("n21"));
  9499. this.n22 = (this.getChild("n22"));
  9500. this.n23 = (this.getChild("n23"));
  9501. this.n5 = (this.getChild("n5"));
  9502. this.n14 = (this.getChild("n14"));
  9503. this.t0 = this.getTransition("t0");
  9504. }
  9505. }
  9506. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9507. class UIRodMethod extends UIBase {
  9508. constructor() {
  9509. super();
  9510. this.isPressd = false;
  9511. }
  9512. onConstructor() {
  9513. this.ui = ui_UIRodMethod.createInstance();
  9514. this.contentPane = this.ui;
  9515. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9516. this.moveDir = new Laya.Vector2();
  9517. this.moveDest = new Laya.Vector2();
  9518. this.centerPos = new Laya.Vector2();
  9519. xGame.common.uiRodMethod = this;
  9520. }
  9521. show() {
  9522. super.show();
  9523. xGame.common.gameMgr.gamePause = true;
  9524. this.openPressDotEvent();
  9525. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9526. this.centerPos.x = this.ui.white.x;
  9527. this.centerPos.y = this.ui.white.y;
  9528. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9529. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9530. this.setDot();
  9531. }
  9532. setDot() {
  9533. this.ui.dot.x = this.moveDest.x;
  9534. this.ui.dot.y = this.moveDest.y;
  9535. }
  9536. closeSelf() {
  9537. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9538. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9539. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9540. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9541. xGame.common.gameMgr.gamePause = false;
  9542. this.hide();
  9543. }
  9544. openPressDotEvent() {
  9545. this.closePressDotEvent();
  9546. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9547. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9548. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9549. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9550. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9551. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9552. }
  9553. closePressDotEvent() {
  9554. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9555. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9556. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9557. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9558. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9559. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9560. }
  9561. onDown(e) {
  9562. if (e.type == Laya.Event.MOUSE_DOWN)
  9563. this.isPressd = true;
  9564. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9565. this.isPressd = false;
  9566. if (!this.isPressd)
  9567. return;
  9568. this.moveDest.x = e.stageX;
  9569. this.moveDest.y = e.stageY;
  9570. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9571. if (dis > 6724) {
  9572. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9573. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9574. }
  9575. this.setDot();
  9576. }
  9577. resetRod() {
  9578. this.ui.dot.x = this.ui.white.x;
  9579. this.ui.dot.y = this.ui.white.y;
  9580. this.gameRod.dot.x = this.gameRod.bg.x;
  9581. this.gameRod.dot.y = this.gameRod.bg.y;
  9582. xGame.common.rodOffest.x = 0;
  9583. xGame.common.rodOffest.y = 0;
  9584. }
  9585. }
  9586. UIRodMethod.uiName = "UIRodMethod";
  9587. class UIGame extends UIBase {
  9588. constructor() {
  9589. super();
  9590. this.powerNum = 0;
  9591. this.isD3Inited = false;
  9592. this.isPrePlay = false;
  9593. this.isMoveRod = false;
  9594. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9595. this.rulerDis = 20;
  9596. this.rulerOffset = 0;
  9597. }
  9598. onConstructor() {
  9599. this.ui = ui_UIGame.createInstance();
  9600. this.contentPane = this.ui;
  9601. this.ui.x += xGame.common.sysOffestNum;
  9602. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9603. this.isEject = false;
  9604. xGame.common.gameUI = this;
  9605. this.initSelf();
  9606. }
  9607. isTurnSelf() {
  9608. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9609. return true;
  9610. }
  9611. }
  9612. initSelf() {
  9613. let topUI = this.ui.topNode;
  9614. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9615. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9616. this.barInfo = {};
  9617. this.barInfo.curY = 0;
  9618. this.barInfo.height = this.ui.powerNode.height;
  9619. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9620. this.barInfo.powerStartY = this.ui.powerNode.y;
  9621. xGame.common.aiPlayer = new AIPlayer();
  9622. xGame.common.gameMgr = new GameMgr();
  9623. xGame.common.skillMgr = new SkillMgr();
  9624. xGame.common.wordsMgr = new WordsMgr();
  9625. xGame.common.talkMgr = new TalkMgr();
  9626. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9627. console.log("加载经典模式表情文件chenggon !");
  9628. });
  9629. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9630. console.log("挑战模式奖励模式spine加载成功!");
  9631. });
  9632. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9633. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9634. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9635. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9636. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9637. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9638. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9639. }
  9640. returnHome() {
  9641. let tips = "Are you sure to exit the game?";
  9642. let woman = "Boss, why don't you play for a while longer?";
  9643. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9644. }
  9645. addRodMethodClick() {
  9646. if (this.isTurnSelf()) {
  9647. xGame.uiMgr.Show(UIRodMethod);
  9648. }
  9649. }
  9650. clickHelpLineBtn(force = false) {
  9651. if (!this.isTurnSelf())
  9652. return;
  9653. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9654. if (success) {
  9655. xGame.common.longHelpLine = true;
  9656. xGame.common.d2World.getHelpLine();
  9657. Moyu.sendDataEvent("guideNum");
  9658. }
  9659. else {
  9660. }
  9661. });
  9662. }
  9663. renderSelfDisplayBalls(index, target) {
  9664. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9665. target.myImg.url = xGame.common.getGameIconUrl(str);
  9666. }
  9667. renderAIDisplayBalls(index, target) {
  9668. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9669. target.myImg.url = xGame.common.getGameIconUrl(str);
  9670. ;
  9671. }
  9672. updateMode() {
  9673. if (xGame.common.gameMode == GameMode.classic) {
  9674. this.ui.topNode.scoreNode.visible = false;
  9675. }
  9676. else if (xGame.common.gameMode == GameMode.bigMove) {
  9677. this.ui.topNode.scoreNode.visible = true;
  9678. }
  9679. }
  9680. show() {
  9681. super.show();
  9682. console.log("zh:uigame show");
  9683. this.ui.alpha = 0;
  9684. this.updateSelf();
  9685. console.log("zh:uigame bf gamemusic01 start");
  9686. xGame.soundMgr.playMusic("gamemusic01");
  9687. console.log("zh:uigame bf gamemusic01 end");
  9688. xGame.common.gameMgr.gamePause = false;
  9689. xGame.common.gameUI.ui.blackAni.visible = false;
  9690. xGame.common.gameUI.ui.whiteAni.visible = false;
  9691. this.ui.powerEft.visible = false;
  9692. this.ui.colorNode.visible = false;
  9693. this.updateHead();
  9694. }
  9695. updateSelf() {
  9696. if (xGame.common.gameMode == GameMode.classic) {
  9697. this.ui.c1.selectedIndex = 0;
  9698. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9699. this.ui.topNode.middleNode.visible = true;
  9700. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9701. }
  9702. else if (xGame.common.gameMode == GameMode.bigMove) {
  9703. this.ui.c1.selectedIndex = 0;
  9704. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9705. this.ui.topNode.middleNode.visible = false;
  9706. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9707. let rand = xGame.common.randomNum(1, max);
  9708. let guide = DataMgr.getSkillGuide();
  9709. if (guide == 0)
  9710. rand = 1;
  9711. xGame.common.bigMoveLevelIndex = rand;
  9712. }
  9713. else if (xGame.common.gameMode == GameMode.placeBall) {
  9714. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9715. this.ui.c1.selectedIndex = 1 + data.type;
  9716. this.ui.alpha = 1;
  9717. this.startGame();
  9718. }
  9719. this.updateMode();
  9720. this.initD3world();
  9721. this.initD2world();
  9722. }
  9723. startGame() {
  9724. this.ui.snowNode.visible = Math.random() <= 0.1;
  9725. this.ui.d2Node.visible = false;
  9726. xGame.common.d3World.d3Hand.gameObj.active = false;
  9727. xGame.common.d3World.tableSrc.init();
  9728. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9729. this.cameraViewChange(() => {
  9730. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9731. switch (xGame.common.gameMode) {
  9732. case GameMode.classic:
  9733. xGame.common.d3World.d3Hand.gameObj.active = true;
  9734. this.playPutBallD3Ani();
  9735. break;
  9736. case GameMode.bigMove:
  9737. this.enterGame();
  9738. Laya.timer.once(500, this, () => {
  9739. this.ui.topNode.middleNode.visible = true;
  9740. this.ui.topNode.middleNode.t0.play();
  9741. });
  9742. break;
  9743. case GameMode.placeBall:
  9744. this.enterGame();
  9745. break;
  9746. default:
  9747. break;
  9748. }
  9749. });
  9750. PlatMgr.showBanner(false);
  9751. }
  9752. enterGame() {
  9753. this.ui.d2Node.visible = true;
  9754. xGame.common.d3World.d3Hand.gameObj.active = false;
  9755. xGame.common.showOneCamera("mainCamera");
  9756. Moyu.recordGame(30, true);
  9757. if (!this.isPrePlay) {
  9758. this.isPrePlay = true;
  9759. xGame.common.d3World.prePlayEft();
  9760. }
  9761. xGame.common.gameMgr.gameReady();
  9762. this.openAllEvent();
  9763. this.ui.snowNode.visible = false;
  9764. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9765. this.ui.helpBtn.visible = condition;
  9766. }
  9767. showHelpLineGuide() {
  9768. let longGuide = DataMgr.getGuideHelpLine();
  9769. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9770. this.ui.helpBtn.visible = true;
  9771. this.ui.guideNode.visible = true;
  9772. }
  9773. }
  9774. setTurnAlpha(alpha) {
  9775. this.ui.keduNode.alpha = alpha;
  9776. this.ui.ganNode.alpha = alpha;
  9777. this.ui.rodMethodNode.alpha = alpha;
  9778. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9779. }
  9780. cameraViewChange(callback) {
  9781. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9782. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9783. xGame.common.showOneCamera("visitAngle");
  9784. cameraSrc.localRotationEulerY = 180;
  9785. cameraSrc.localRotationEulerZ = 0;
  9786. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9787. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9788. callback && callback();
  9789. }));
  9790. }));
  9791. }
  9792. playPutBallD3Ani() {
  9793. xGame.common.showOneCamera("mainCamera");
  9794. let handSrc = xGame.common.d3World.d3Hand;
  9795. handSrc.gameObj.active = true;
  9796. handSrc.transform.localPositionZ = 3;
  9797. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9798. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9799. handSrc.gameObj.active = false;
  9800. this.enterGame();
  9801. }), 400);
  9802. }));
  9803. }
  9804. updateHead() {
  9805. let user = Moyu.getUserInfo();
  9806. this.ui.topNode.selfNameTxt.text = user.nickName;
  9807. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9808. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9809. if (DataMgr.getSkillGuide() < 1) {
  9810. this.ui.topNode.aiNameTxt.text = 'billiards';
  9811. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9812. }
  9813. else {
  9814. this.ui.topNode.aiNameTxt.text = aiData.name;
  9815. let randNo = Math.floor(Math.random() * 10) + 1;
  9816. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9817. }
  9818. }
  9819. initD2world() {
  9820. let node = this.ui.d2Root.displayObject;
  9821. let src = node.getComponent(D2World);
  9822. if (!src) {
  9823. xGame.common.d2World = node.addComponent(D2World);
  9824. }
  9825. xGame.common.d2World.initSelf();
  9826. }
  9827. initD3world() {
  9828. if (this.isD3Inited)
  9829. return;
  9830. this.isD3Inited = true;
  9831. let scene3D = xGame.common.d3Scene;
  9832. this.ui.d3Root.displayObject.addChild(scene3D);
  9833. scene3D.active = true;
  9834. xGame.common.d3World.tableSrc.setBorderPos();
  9835. }
  9836. onRootMove(e) {
  9837. let rootBall = xGame.common.d2World.rootBall;
  9838. this.ui.moveNode.x = e.x;
  9839. this.ui.moveNode.y = e.y;
  9840. rootBall.gameObj.x = e.x;
  9841. rootBall.gameObj.y = e.y;
  9842. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9843. }
  9844. aiRootMove(move) {
  9845. if (move)
  9846. this.hideBallUI();
  9847. else {
  9848. this.showBallUI();
  9849. xGame.common.d2World.getHelpLine();
  9850. }
  9851. }
  9852. aiForce(type, force = 0) {
  9853. this.pressTarget = PressType.powerNode;
  9854. if (type == 1)
  9855. this.onEventUp({ force: true });
  9856. else if (type == 2)
  9857. this.onEventMove({ stageY: force, force: true });
  9858. }
  9859. onEventPress(e) {
  9860. if (e.stopPropagation)
  9861. e.stopPropagation();
  9862. if (!this.isTurnSelf())
  9863. return;
  9864. let target = e.target;
  9865. switch (target) {
  9866. case this.ui.myPowerNode.displayObject:
  9867. this.pressTarget = PressType.powerNode;
  9868. this.barInfo.curY = e.stageY;
  9869. this.updateBarInfo();
  9870. break;
  9871. case this.ui.moveNode.displayObject:
  9872. this.pressTarget = PressType.moveNode;
  9873. this.hideBallUI();
  9874. this.eventObj.curX = this.ui.moveNode.x;
  9875. this.eventObj.curY = this.ui.moveNode.y;
  9876. this.ui.moveNode.finger.visible = false;
  9877. this.eventObj.lastX = e.stageX;
  9878. this.eventObj.lastY = e.stageY;
  9879. break;
  9880. case this.ui.rulerClickNode.displayObject:
  9881. this.pressTarget = PressType.rulerNode;
  9882. this.eventObj.lastY = e.stageY;
  9883. break;
  9884. case this.ui.d2Root.displayObject:
  9885. this.pressTarget = PressType.d2Root;
  9886. this.eventObj.lastX = e.stageX;
  9887. this.eventObj.lastY = e.stageY;
  9888. this.eventObj.starX = e.stageX;
  9889. this.eventObj.starY = e.stageY;
  9890. this.eventObj.curX = 0;
  9891. this.eventObj.curY = 0;
  9892. xGame.common.d2World.d2Gan.setGanLastInfo();
  9893. this.rulerOffset = 0;
  9894. break;
  9895. default:
  9896. break;
  9897. }
  9898. }
  9899. onEventMove(e) {
  9900. if (e.stopPropagation)
  9901. e.stopPropagation();
  9902. if (e && e.force) {
  9903. }
  9904. else {
  9905. if (!this.isTurnSelf())
  9906. return;
  9907. }
  9908. switch (this.pressTarget) {
  9909. case PressType.powerNode:
  9910. this.barInfo.curY = e.stageY;
  9911. this.updateBarInfo();
  9912. this.isMoveRod = true;
  9913. break;
  9914. case PressType.moveNode:
  9915. let rootBall = xGame.common.d2World.rootBall;
  9916. let radius = rootBall.gameObj.width / 2;
  9917. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9918. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9919. let border = xGame.common.d2World.borderRect;
  9920. if (curX <= border.x + radius)
  9921. curX = border.x + radius;
  9922. else if (curX >= border.x + border.width - radius)
  9923. curX = border.x + border.width - radius;
  9924. if (curY <= border.y + radius)
  9925. curY = border.y + radius;
  9926. else if (curY >= border.y + border.height - radius)
  9927. curY = border.y + border.height - radius;
  9928. if (xGame.common.gameMgr.isOpenBall) {
  9929. if (curX >= border.x + border.openBallW - radius)
  9930. curX = border.x + border.openBallW - radius;
  9931. }
  9932. this.ui.moveNode.x = curX;
  9933. this.ui.moveNode.y = curY;
  9934. rootBall.gameObj.x = curX;
  9935. rootBall.gameObj.y = curY;
  9936. rootBall.d3BallSrc.setTransPos(curX, curY);
  9937. this.isMoveRod = true;
  9938. break;
  9939. case PressType.rulerNode:
  9940. let yy = e.stageY - this.eventObj.lastY;
  9941. this.eventObj.lastY = e.stageY;
  9942. let ruler1 = this.ui.rulerNode.img1;
  9943. let ruler2 = this.ui.rulerNode.img2;
  9944. ruler1.y += yy;
  9945. ruler2.y += yy;
  9946. this.rulerOffset += yy;
  9947. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9948. this.rulerOffset = 0;
  9949. xGame.soundMgr.playSound("inch", 1, 10);
  9950. }
  9951. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9952. let h = ruler1.height;
  9953. this.checkGuide();
  9954. this.isMoveRod = true;
  9955. if (ruler1.y >= h) {
  9956. ruler1.y = -h;
  9957. ruler2.y = 0;
  9958. return;
  9959. }
  9960. else if (ruler1.y <= -h) {
  9961. ruler1.y = h;
  9962. ruler2.y = 0;
  9963. return;
  9964. }
  9965. if (ruler2.y >= h) {
  9966. ruler2.y = -h;
  9967. ruler1.y = 0;
  9968. return;
  9969. }
  9970. else if (ruler2.y <= -h) {
  9971. ruler2.y = h;
  9972. ruler1.y = 0;
  9973. return;
  9974. }
  9975. break;
  9976. case PressType.d2Root:
  9977. this.eventObj.curX = e.stageX;
  9978. this.eventObj.curY = e.stageY;
  9979. let offset = this.checkRodMoveDir();
  9980. xGame.common.d2World.d2Gan.rotateSelf(offset);
  9981. this.eventObj.lastX = e.stageX;
  9982. this.eventObj.lastY = e.stageY;
  9983. break;
  9984. default:
  9985. break;
  9986. }
  9987. }
  9988. onEventUp(e) {
  9989. if (e.stopPropagation)
  9990. e.stopPropagation();
  9991. if (e && e.force) {
  9992. }
  9993. else {
  9994. if (!this.isTurnSelf())
  9995. return;
  9996. }
  9997. switch (this.pressTarget) {
  9998. case PressType.powerNode:
  9999. this.ui.powerNode.value = 0;
  10000. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10001. this.ui.powerTxt.text = "";
  10002. if (this.powerNum > 0) {
  10003. xGame.eventMgr.event(BALL_SHOOT);
  10004. xGame.common.d2World.shoot(this.powerNum);
  10005. xGame.common.d2World.d2Gan.shoot();
  10006. xGame.common.d2World.d2HelpLine.shoot();
  10007. this.finishGuide();
  10008. this.ui.powerEft.visible = false;
  10009. this.ui.colorNode.visible = false;
  10010. let ganStr = "";
  10011. if (this.powerNum <= 30) {
  10012. ganStr = "gan_30";
  10013. }
  10014. else if (this.powerNum <= 60) {
  10015. ganStr = "gan_50";
  10016. }
  10017. else {
  10018. ganStr = "gan_80";
  10019. }
  10020. xGame.soundMgr.playSound(ganStr);
  10021. }
  10022. break;
  10023. case PressType.moveNode:
  10024. let rootBall = xGame.common.d2World.rootBall;
  10025. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10026. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10027. let isIntersect = this.judgeBallIntersect();
  10028. if (isIntersect) {
  10029. this.ui.moveNode.x = lastX;
  10030. this.ui.moveNode.y = lastY;
  10031. rootBall.gameObj.x = lastX;
  10032. rootBall.gameObj.y = lastY;
  10033. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10034. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10035. }
  10036. else {
  10037. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10038. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10039. }
  10040. this.showBallUI();
  10041. this.ui.moveNode.finger.visible = true;
  10042. xGame.common.d2World.getHelpLine();
  10043. break;
  10044. case PressType.rulerNode:
  10045. break;
  10046. case PressType.d2Root:
  10047. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10048. if (dis <= 25) {
  10049. this.moveToClickDot(e);
  10050. }
  10051. break;
  10052. default:
  10053. break;
  10054. }
  10055. this.pressTarget = -1;
  10056. }
  10057. checkGuide() {
  10058. let guide = DataMgr.getSkillGuide();
  10059. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10060. xGame.common.guideStep++;
  10061. xGame.common.gameUI.ui.guide2.visible = false;
  10062. xGame.common.gameUI.ui.guide3.visible = true;
  10063. }
  10064. }
  10065. finishGuide() {
  10066. let guide = DataMgr.getSkillGuide();
  10067. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10068. xGame.common.guideStep = 10;
  10069. this.closeAllGuide();
  10070. }
  10071. }
  10072. closeAllGuide() {
  10073. xGame.common.gameUI.ui.guide1.visible = false;
  10074. xGame.common.gameUI.ui.guide2.visible = false;
  10075. xGame.common.gameUI.ui.guide3.visible = false;
  10076. }
  10077. updateBarInfo() {
  10078. let star = this.ui.powerNode.y;
  10079. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10080. if (rate >= 1)
  10081. rate = 1;
  10082. if (rate <= 0)
  10083. rate = 0;
  10084. this.powerNum = Math.ceil(rate * 100);
  10085. this.ui.powerNode.value = this.powerNum;
  10086. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10087. this.ui.colorNode.value = this.powerNum;
  10088. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10089. this.ui.powerEft.visible = this.powerNum != 0;
  10090. this.ui.colorNode.visible = this.powerNum != 0;
  10091. this.ui.powerTxt.text = this.powerNum + "";
  10092. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10093. }
  10094. forceCancel() {
  10095. this.ui.powerNode.value = 0;
  10096. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10097. this.ui.powerTxt.text = "";
  10098. }
  10099. checkRodMoveDir() {
  10100. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10101. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10102. if (tempX >= 0 && tempY <= 0) {
  10103. return this.checkDir();
  10104. }
  10105. else if (tempX < 0 && tempY < 0) {
  10106. return this.checkDir(1, -1);
  10107. }
  10108. else if (tempX < 0 && tempY > 0) {
  10109. return this.checkDir(-1, -1);
  10110. }
  10111. else {
  10112. return this.checkDir(-1, 1);
  10113. }
  10114. }
  10115. checkDir(flagX = 1, flagY = 1) {
  10116. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10117. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10118. if (offsetY == 0) {
  10119. return offsetX * flagX;
  10120. }
  10121. if (offsetX == 0) {
  10122. return offsetY * flagY;
  10123. }
  10124. let angle = offsetY / offsetX;
  10125. if (Math.abs(angle) >= 1) {
  10126. return offsetY * flagY;
  10127. }
  10128. else {
  10129. return offsetX * flagX;
  10130. }
  10131. }
  10132. judgeBallIntersect() {
  10133. let rootBall = xGame.common.d2World.rootBall;
  10134. let ballArr = xGame.common.d2World.ballArr;
  10135. let radius = rootBall.gameObj.width / 2;
  10136. let temp;
  10137. let isIntersect = false;
  10138. for (let index = 0; index < ballArr.length; index++) {
  10139. temp = ballArr[index];
  10140. if (temp.number == rootBall.number)
  10141. continue;
  10142. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10143. if (isIntersect) {
  10144. break;
  10145. }
  10146. }
  10147. return isIntersect;
  10148. }
  10149. hideBallUI() {
  10150. let d2Gan = xGame.common.d2World.d2Gan;
  10151. if (!d2Gan.ui.isDisposed)
  10152. d2Gan.ui.visible = false;
  10153. let d2Help = xGame.common.d2World.d2HelpLine;
  10154. if (!d2Help.ui.isDisposed)
  10155. d2Help.ui.visible = false;
  10156. let rootBall = xGame.common.d2World.rootBall;
  10157. if (!rootBall.destroyed) {
  10158. rootBall.gameObj.active = false;
  10159. }
  10160. }
  10161. showBallUI() {
  10162. let d2Gan = xGame.common.d2World.d2Gan;
  10163. if (!d2Gan.ui.isDisposed)
  10164. d2Gan.ui.visible = true;
  10165. let d2Help = xGame.common.d2World.d2HelpLine;
  10166. if (!d2Help.ui.isDisposed)
  10167. d2Help.ui.visible = true;
  10168. let rootBall = xGame.common.d2World.rootBall;
  10169. if (!rootBall.destroyed) {
  10170. rootBall.gameObj.active = true;
  10171. }
  10172. }
  10173. moveToClickDot(e) {
  10174. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10175. let root = xGame.common.d2World.rootBall.gameObj;
  10176. let xx = e.stageX - xGame.common.sysOffestNum;
  10177. let yy = e.stageY;
  10178. let x = xx - root.x;
  10179. let y = yy - root.y;
  10180. let angle = xGame.common.getfguiRotation(x, y);
  10181. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10182. xGame.common.d2World.getHelpLine();
  10183. }
  10184. this.isMoveRod = false;
  10185. xGame.common.clickedBall = false;
  10186. }
  10187. openAllEvent() {
  10188. this.closeAllEvent();
  10189. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10190. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10191. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10192. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10193. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10194. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10195. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10196. }
  10197. closeAllEvent() {
  10198. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10199. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10200. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10201. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10202. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10203. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10204. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10205. }
  10206. resetGame() {
  10207. this.closeAllEvent();
  10208. this.hideBallUI();
  10209. xGame.common.gameMgr.gamePause = true;
  10210. }
  10211. }
  10212. UIGame.uiName = "UIGame";
  10213. class UIAddProp extends UIBase {
  10214. constructor() {
  10215. super();
  10216. this.curType = "";
  10217. }
  10218. onConstructor() {
  10219. this.ui = ui_UIAddProp.createInstance();
  10220. this.contentPane = this.ui;
  10221. this.isEject = false;
  10222. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10223. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10224. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10225. this.updateUI();
  10226. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10227. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10228. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10229. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10230. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10231. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10232. }
  10233. show(type) {
  10234. super.show();
  10235. this.curType = type == 0 ? "coin" : "diamond";
  10236. this.switchBtn("");
  10237. this.ui.t0.play();
  10238. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10239. PlatMgr.showInsert(true);
  10240. }
  10241. closeSelf() {
  10242. this.hide();
  10243. }
  10244. updateUI() {
  10245. let data = cfgTable.moneyData;
  10246. let temp;
  10247. let obj;
  10248. for (const key in data) {
  10249. temp = data[key];
  10250. obj = this.ui.myNode["node" + key];
  10251. if (parseInt(key) <= 2) {
  10252. obj.diamondTxt.text = "+" + temp.num;
  10253. }
  10254. else {
  10255. obj.coinTxt.text = temp.num;
  10256. obj.diamondTxt.text = temp.get.split('_')[1];
  10257. }
  10258. }
  10259. this.updateDiamondShare();
  10260. }
  10261. updateDiamondShare() {
  10262. let data = DataMgr.getShareDiamondTimes();
  10263. if (data >= xGame.common.maxShareDiamondTimes) {
  10264. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10265. this.ui.myNode.node1.touchable = false;
  10266. }
  10267. else {
  10268. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10269. this.ui.myNode.node1.touchable = true;
  10270. }
  10271. }
  10272. switchBtn(type) {
  10273. if (type == "")
  10274. type = this.curType;
  10275. else {
  10276. if (this.curType == type) {
  10277. return;
  10278. }
  10279. else {
  10280. this.curType = type;
  10281. }
  10282. }
  10283. if (type == "coin") {
  10284. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10285. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10286. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10287. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10288. this.ui.myNode.c1.selectedIndex = 0;
  10289. }
  10290. else {
  10291. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10292. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10293. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10294. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10295. this.ui.myNode.c1.selectedIndex = 1;
  10296. }
  10297. }
  10298. convertCoin(index) {
  10299. let data = cfgTable.moneyData[index];
  10300. let coinNum = data.num;
  10301. let str = data.get.split('_')[1];
  10302. let needDiamond = parseInt(str);
  10303. if (DataMgr.diamondEnough(needDiamond)) {
  10304. DataMgr.setDiamond(-needDiamond);
  10305. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10306. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10307. }
  10308. else {
  10309. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10310. this.switchBtn("diamond");
  10311. }
  10312. }
  10313. videoGetDiamond() {
  10314. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10315. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10316. }
  10317. else {
  10318. console.log('zh:AD 失败,直接发放奖励');
  10319. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10320. }
  10321. }
  10322. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10323. let num = cfgTable.moneyData[2].num;
  10324. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10325. this.closeSelf();
  10326. }
  10327. videoGetCoin() {
  10328. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10329. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10330. }
  10331. else {
  10332. console.log('zh:AD 失败,直接发放奖励');
  10333. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10334. }
  10335. }
  10336. qjff_AD_for_uiAddProp_videoGetCoin() {
  10337. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10338. this.closeSelf();
  10339. }
  10340. shareGetDiamond() {
  10341. let times = DataMgr.getShareDiamondTimes();
  10342. if (times >= xGame.common.maxShareDiamondTimes) {
  10343. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10344. }
  10345. else {
  10346. if (Moyu.isTT) {
  10347. let num = cfgTable.moneyData[1].num;
  10348. Moyu.shareVideo = '';
  10349. Moyu.shareGame((success) => {
  10350. if (success) {
  10351. xGame.uiMgr.Show(UIMsg, "分享成功!");
  10352. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10353. DataMgr.setShareDiamondTimes(1);
  10354. this.updateDiamondShare();
  10355. }
  10356. else {
  10357. xGame.uiMgr.Show(UIMsg, "分享失败!");
  10358. }
  10359. });
  10360. }
  10361. else {
  10362. Moyu.showVideoAd(() => {
  10363. let diamond = xGame.common.randomNum(50, 100);
  10364. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10365. DataMgr.setShareDiamondTimes(1);
  10366. this.updateDiamondShare();
  10367. }, EAdType.randomDiamond);
  10368. }
  10369. }
  10370. }
  10371. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10372. }
  10373. openPutBallView() {
  10374. let end = xGame.uiMgr.getUI(UIGameEnd);
  10375. let skill = xGame.uiMgr.getUI(UISkill);
  10376. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10377. let uigame = xGame.uiMgr.getUI(UIGame);
  10378. if (end && !end.isHide) {
  10379. xGame.uiMgr.Hide(UIGameEnd);
  10380. xGame.uiMgr.Show(UIMain);
  10381. }
  10382. if (skill && !skill.isHide)
  10383. xGame.uiMgr.Hide(UISkill);
  10384. if (uigame && !uigame.isHide)
  10385. xGame.uiMgr.Hide(UIGame);
  10386. if (level && !level.isHide) {
  10387. }
  10388. else {
  10389. xGame.uiMgr.Show(UILevelDisplay);
  10390. }
  10391. this.closeSelf();
  10392. }
  10393. }
  10394. UIAddProp.uiName = "UIAddProp";
  10395. class MoneyNode {
  10396. constructor(ui) {
  10397. this.leftTime = 0;
  10398. this.ui = ui;
  10399. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10400. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10401. this.ui.addPowerBtn.onClick(this, this.addPower);
  10402. this.ui.c1.selectedIndex = 1;
  10403. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10404. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10405. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10406. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10407. this.coinChange();
  10408. this.diamondChange();
  10409. this.powerChange();
  10410. }
  10411. addPower() {
  10412. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10413. xGame.uiMgr.Show(UIPower);
  10414. }
  10415. powerChange() {
  10416. let powerNum = DataMgr.getPower();
  10417. this.ui.powerTxt.text = powerNum + "";
  10418. }
  10419. checkPowerTime() {
  10420. let cur = new Date().getTime();
  10421. let last = DataMgr.getPowerTime();
  10422. if (last == 0) {
  10423. last = cur;
  10424. DataMgr.setPowerTime(cur);
  10425. }
  10426. let power = DataMgr.getPower();
  10427. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10428. Laya.timer.clearAll(this);
  10429. if (power >= xGame.common.natureMaxPower) {
  10430. this.ui.powerTimeTxt.text = "";
  10431. DataMgr.setPowerTime(cur);
  10432. return;
  10433. }
  10434. if (power + offset >= xGame.common.natureMaxPower) {
  10435. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10436. this.ui.powerTimeTxt.text = "";
  10437. DataMgr.setPowerTime(cur);
  10438. }
  10439. else {
  10440. if (offset > 0) {
  10441. DataMgr.setPower(offset);
  10442. DataMgr.setPowerTime(cur);
  10443. }
  10444. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10445. this.leftTime = xGame.common.powerRecoverNum - time;
  10446. if (this.leftTime <= 0)
  10447. this.leftTime = 0;
  10448. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10449. Laya.timer.loop(1000, this, this.updatePowerTime);
  10450. }
  10451. }
  10452. updatePowerTime() {
  10453. this.leftTime -= 1;
  10454. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10455. if (this.leftTime <= 0) {
  10456. this.checkPowerTime();
  10457. }
  10458. }
  10459. coinChange() {
  10460. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10461. }
  10462. diamondChange() {
  10463. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10464. }
  10465. addCoin() {
  10466. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10467. Moyu.sendDataEvent("AddCoinBtn");
  10468. xGame.uiMgr.Show(UIAddProp, 0);
  10469. }
  10470. addDiamond() {
  10471. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10472. Moyu.sendDataEvent("AddDiamondBtn");
  10473. xGame.uiMgr.Show(UIAddProp, 1);
  10474. }
  10475. }
  10476. class UIDraw extends UIBase {
  10477. constructor() {
  10478. super();
  10479. this.curKey = 0;
  10480. }
  10481. onConstructor() {
  10482. this.ui = ui_UIDraw.createInstance();
  10483. this.contentPane = this.ui;
  10484. this.isEject = false;
  10485. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10486. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10487. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10488. this.initDraw();
  10489. this.initUI();
  10490. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10491. if (Moyu.isKs)
  10492. this.ui.closeNode.closeBtn.x += 100;
  10493. }
  10494. show() {
  10495. super.show();
  10496. this.ui.t0.play();
  10497. this.playSecretaryIdle();
  10498. this.updateDraw();
  10499. this.checkFree();
  10500. if (PlatMgr.bannerDelay > 0) {
  10501. this.ui.closeNode.closeBtn.visible = false;
  10502. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10503. this.ui.closeNode.closeBtn.visible = true;
  10504. });
  10505. }
  10506. PlatMgr.showRateBanner();
  10507. }
  10508. hide() {
  10509. Laya.timer.clearAll(this);
  10510. super.hide();
  10511. }
  10512. checkFree() {
  10513. let isFree = DataMgr.getDailyfreeDrawTimes();
  10514. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10515. }
  10516. initDraw() {
  10517. this.drawObj = [];
  10518. let data = cfgTable.drawData;
  10519. let temp;
  10520. let weight = 0;
  10521. for (const key in data) {
  10522. temp = data[key];
  10523. weight += temp.weight;
  10524. this.drawObj.push(weight);
  10525. }
  10526. this.allWeight = weight;
  10527. }
  10528. initUI() {
  10529. let data = cfgTable.drawData;
  10530. let temp;
  10531. let img;
  10532. let txt;
  10533. for (const key in data) {
  10534. temp = data[key];
  10535. img = this.ui.myNode.rotNode["img" + key];
  10536. txt = this.ui.myNode.rotNode["txt" + key];
  10537. img.url = xGame.common.getGameIconUrl(temp.icon);
  10538. txt.visible = true;
  10539. if (temp.award > 2) {
  10540. img.rotation = 0;
  10541. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10542. }
  10543. else {
  10544. img.rotation = temp.rotation;
  10545. txt.text = temp.num;
  10546. }
  10547. }
  10548. }
  10549. getCurkey() {
  10550. let rand = Math.random() * this.allWeight;
  10551. let temp;
  10552. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10553. temp = this.drawObj[index];
  10554. if (index == 0) {
  10555. if (rand < temp) {
  10556. return index + 1;
  10557. }
  10558. }
  10559. else {
  10560. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10561. return index + 1;
  10562. }
  10563. }
  10564. }
  10565. return 2;
  10566. }
  10567. startDraw() {
  10568. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10569. if (freeTimes > 0) {
  10570. this.beginDraw();
  10571. DataMgr.setDailyfreeDrawTimes(0);
  10572. this.checkFree();
  10573. }
  10574. else {
  10575. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10576. }
  10577. else {
  10578. console.log('zh:AD 失败,直接发放奖励');
  10579. this.qjff_chouJiang();
  10580. }
  10581. }
  10582. }
  10583. qjff_chouJiang() {
  10584. this.beginDraw();
  10585. }
  10586. beginDraw() {
  10587. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10588. this.ui.drawBtn.touchable = false;
  10589. this.curKey = this.getCurkey();
  10590. console.log("当前key", this.curKey);
  10591. let cell = 60;
  10592. let lap = 3;
  10593. let angle = cell * (this.curKey - 1) + lap * 360;
  10594. let target = this.ui.myNode.rotNode;
  10595. target.rotation = 0;
  10596. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10597. console.log("旋转完成");
  10598. this.ui.drawBtn.touchable = true;
  10599. this.getAward();
  10600. }));
  10601. }
  10602. getAward() {
  10603. let data = cfgTable.drawData[this.curKey];
  10604. let temp = new AwardType();
  10605. temp.type = data.award;
  10606. temp.num = data.num;
  10607. xGame.common.getAward([temp], () => {
  10608. DataMgr.setDrawTimes(1);
  10609. this.updateDraw();
  10610. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10611. });
  10612. }
  10613. updateDraw() {
  10614. let drawTimes = DataMgr.getDrawTimes();
  10615. let awardTimes = DataMgr.getDrawAwardTimes();
  10616. if (Math.floor(drawTimes / 3) > awardTimes) {
  10617. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10618. this.ui.extraNode.boxBtn.touchable = true;
  10619. this.ui.extraNode.tipsTxt.text = "3/3";
  10620. this.ui.extraNode.barNode.width = 265;
  10621. this.getExtraAward();
  10622. }
  10623. else {
  10624. this.ui.extraNode.boxBtn.t0.stop();
  10625. this.ui.extraNode.boxBtn.touchable = false;
  10626. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10627. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10628. }
  10629. let data = cfgTable.drawData[1];
  10630. if (awardTimes == 0) {
  10631. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10632. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10633. this.ui.myNode.rotNode.img1.rotation = 0;
  10634. }
  10635. else {
  10636. let award = data.nextid;
  10637. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10638. this.ui.myNode.rotNode.txt1.text = award[1];
  10639. this.ui.myNode.rotNode.img1.rotation = 0;
  10640. }
  10641. }
  10642. getExtraAward() {
  10643. let drawTimes = DataMgr.getDrawTimes();
  10644. let awardTimes = DataMgr.getDrawAwardTimes();
  10645. let data = cfgTable.drawData[1];
  10646. let award = new AwardType();
  10647. if (awardTimes == 0) {
  10648. award.num = data.num;
  10649. award.type = data.award;
  10650. xGame.common.getAward([award], () => {
  10651. let all = Math.floor(drawTimes / 3);
  10652. DataMgr.setDrawAwardTimes(all);
  10653. this.updateDraw();
  10654. });
  10655. }
  10656. else {
  10657. award.num = parseInt(data.nextid[1]);
  10658. award.type = parseInt(data.nextid[0]);
  10659. xGame.common.getAward([award], () => {
  10660. let all = Math.floor(drawTimes / 3);
  10661. DataMgr.setDrawAwardTimes(all);
  10662. this.updateDraw();
  10663. });
  10664. }
  10665. }
  10666. closeSelf() {
  10667. this.hide();
  10668. }
  10669. playSecretaryIdle() {
  10670. let parent = this.ui.secretary.displayObject;
  10671. parent.destroyChildren();
  10672. let xx = this.ui.secretary.width / 2;
  10673. let yy = this.ui.secretary.height;
  10674. let scale = xGame.common.getSecretaryScale();
  10675. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10676. xGame.common.secretary.play(data, 0, true, parent);
  10677. }
  10678. }
  10679. UIDraw.uiName = "UIDraw";
  10680. class ui_UIFlyEft extends fgui.GComponent {
  10681. static createInstance() {
  10682. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10683. }
  10684. onConstruct() {
  10685. this.n0 = (this.getChild("n0"));
  10686. this.n1 = (this.getChild("n1"));
  10687. this.n2 = (this.getChild("n2"));
  10688. this.n3 = (this.getChild("n3"));
  10689. this.n4 = (this.getChild("n4"));
  10690. this.n5 = (this.getChild("n5"));
  10691. this.n6 = (this.getChild("n6"));
  10692. this.n7 = (this.getChild("n7"));
  10693. this.iconNode = (this.getChild("iconNode"));
  10694. this.txt = (this.getChild("txt"));
  10695. this.txtNode = (this.getChild("txtNode"));
  10696. }
  10697. }
  10698. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10699. class UIFlyEft extends UIBase {
  10700. constructor() {
  10701. super();
  10702. this.max = 8;
  10703. this.delay = 0;
  10704. }
  10705. onConstructor() {
  10706. this.ui = ui_UIFlyEft.createInstance();
  10707. this.contentPane = this.ui;
  10708. this.isEject = false;
  10709. this.isMuti = true;
  10710. this.ui.x += xGame.common.sysOffestNum;
  10711. }
  10712. getArrPos() {
  10713. if (this.iconPos && this.iconPos.length > 0)
  10714. return;
  10715. this.iconPos = [];
  10716. let temp;
  10717. for (let index = 0; index < this.max; index++) {
  10718. temp = this.ui["n" + index];
  10719. this.iconPos.push([temp.x, temp.y]);
  10720. }
  10721. }
  10722. show(stPos, edPos, num, type, callback) {
  10723. super.show();
  10724. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10725. this.getArrPos();
  10726. this.updateUI(type);
  10727. this.updatePos();
  10728. this.runFly(edPos, callback);
  10729. this.runWorlds(stPos, num);
  10730. }
  10731. updateUI(type) {
  10732. let temp;
  10733. let str;
  10734. for (let index = 0; index < this.max; index++) {
  10735. temp = this.ui["n" + index];
  10736. str = this.getIconStr(type);
  10737. temp.url = xGame.common.getGameIconUrl(str);
  10738. }
  10739. }
  10740. getIconStr(type) {
  10741. switch (type) {
  10742. case Prop.diamond:
  10743. return "ty_zs";
  10744. case Prop.coin:
  10745. return "ty_jb";
  10746. default:
  10747. break;
  10748. }
  10749. }
  10750. updatePos() {
  10751. let temp;
  10752. for (let index = 0; index < this.max; index++) {
  10753. temp = this.ui["n" + index];
  10754. temp.x = this.iconPos[index][0];
  10755. temp.y = this.iconPos[index][1];
  10756. }
  10757. }
  10758. runFly(endPos, callback) {
  10759. let all = 0;
  10760. let temp;
  10761. for (let index = 0; index < this.max; index++) {
  10762. temp = this.ui["n" + index];
  10763. temp.visible = true;
  10764. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10765. temp.visible = false;
  10766. all++;
  10767. if (all >= this.max) {
  10768. callback && callback();
  10769. }
  10770. }), 20 * index);
  10771. }
  10772. }
  10773. runWorlds(stPos, num) {
  10774. let str = "+" + num;
  10775. this.ui.txt.text = str;
  10776. let starX = stPos.x;
  10777. let starY = stPos.y + 50;
  10778. this.ui.txt.x = starX;
  10779. this.ui.txt.y = starY;
  10780. this.ui.txt.visible = true;
  10781. this.ui.txt.alpha = 1;
  10782. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10783. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10784. this.ui.txt.visible = false;
  10785. this.hide();
  10786. }));
  10787. }));
  10788. }
  10789. }
  10790. UIFlyEft.uiName = "UIFlyEft";
  10791. class Common {
  10792. constructor() {
  10793. this.convertNum = 0.025;
  10794. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10795. this.scaleV3One = new Laya.Vector3();
  10796. this.scaleV3Two = new Laya.Vector3();
  10797. this.posV4 = new Laya.Vector4();
  10798. this.showDebug = false;
  10799. this.openGuide = true;
  10800. this.rodOffest = new Laya.Vector2(0, 0);
  10801. this.rodAngle = 0;
  10802. this.gameMode = GameMode.classic;
  10803. this.bigMoveLevelIndex = 1;
  10804. this.bigMoveNeedCoin = 1000;
  10805. this.classicNiceNeddCoin = 1000;
  10806. this.passAwardCoin = 2000;
  10807. this.classicRoomType = 1;
  10808. this.maxPower = 20;
  10809. this.natureMaxPower = 5;
  10810. this.videoPower = 2;
  10811. this.powerRecoverNum = 900;
  10812. this.curPlayerSkillType = 0;
  10813. this.isNewDay = false;
  10814. this.clickedBall = false;
  10815. this.placeBallCurLevel = 0;
  10816. this.placeBallStarNum = 0;
  10817. this.longHelpLine = false;
  10818. this.maxShareDiamondTimes = 3;
  10819. this.guideStep = 0;
  10820. this.temSelfLevel = 0;
  10821. this.extraMoveNum = 0;
  10822. this.curRankID = 0;
  10823. this.rankID = {
  10824. normalStar: 12000,
  10825. wxStar: 12001
  10826. };
  10827. this.skillNameList = ["Fall from the sky", "Unstoppable Force", "Freeze Shot"];
  10828. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10829. this.btnClickStr = "buttonclick";
  10830. this.maxSkillLevel = 10;
  10831. this.upSkillLevel = false;
  10832. this.gameStartTime = 0;
  10833. this._sysOffestNum = 0;
  10834. this.angleV2 = new Laya.Vector2();
  10835. this.rootV = new Laya.Vector2(0, 1);
  10836. this.tempDir1 = new Laya.Vector2();
  10837. this.tempDir2 = new Laya.Vector2();
  10838. this.ballSize = 33;
  10839. this.stPos = new Laya.Point();
  10840. this.edPos = new Laya.Point();
  10841. Common._instance = this;
  10842. window["common"] = this;
  10843. }
  10844. static getInstance() {
  10845. if (!this._instance) {
  10846. this._instance = new Common();
  10847. }
  10848. return this._instance;
  10849. }
  10850. get sysOffestNum() {
  10851. if (this._sysOffestNum == 0) {
  10852. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10853. }
  10854. return this._sysOffestNum;
  10855. }
  10856. testShader() {
  10857. let test = new LightShader();
  10858. test.texture = "res/d3Res/ballTexture/ball1.png";
  10859. Laya.stage.addChild(test);
  10860. }
  10861. playScale(node) {
  10862. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10863. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10864. }));
  10865. }));
  10866. }
  10867. setGroup(colli, ...group) {
  10868. let out = 0;
  10869. for (let index = 0; index < group.length; index++) {
  10870. if (index == 0) {
  10871. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10872. }
  10873. else {
  10874. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10875. }
  10876. }
  10877. colli.collisionGroup = out;
  10878. }
  10879. setCanGroupWith(colli, ...group) {
  10880. let out = 0;
  10881. for (let index = 0; index < group.length; index++) {
  10882. if (index == 0) {
  10883. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10884. }
  10885. else {
  10886. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10887. }
  10888. }
  10889. colli.canCollideWith = out;
  10890. }
  10891. loadPrefab(name, callback) {
  10892. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10893. let prefab = new Laya.Prefab();
  10894. prefab.json = obj;
  10895. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10896. callback && callback(img);
  10897. }));
  10898. }
  10899. pos2to3Convert(x, y, d3Pos) {
  10900. x = x + this.sysOffestNum;
  10901. d3Pos.setValue(x, y, 0);
  10902. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10903. if (success) {
  10904. }
  10905. else {
  10906. console.error("转换出错了。。。。。。。。");
  10907. }
  10908. }
  10909. scale2to3Convert(num) {
  10910. this.scaleV3One.setValue(0, 0, 0);
  10911. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10912. this.scaleV3Two.setValue(0, num, 0);
  10913. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10914. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10915. return outNum;
  10916. }
  10917. pos3to2Convert(d3Pos) {
  10918. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10919. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10920. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10921. d3Pos.x -= this.sysOffestNum;
  10922. }
  10923. scale3to2Convert(num) {
  10924. let scale = this.scale2to3Convert(1);
  10925. let d2Out = num / scale;
  10926. return d2Out;
  10927. }
  10928. getCollider(type, restitution = 0.9, density = 10) {
  10929. let colli;
  10930. if (type == "box")
  10931. colli = new Laya.BoxCollider();
  10932. else
  10933. colli = new Laya.CircleCollider();
  10934. colli.friction = 0;
  10935. colli.restitution = restitution;
  10936. colli.density = density;
  10937. return colli;
  10938. }
  10939. getRigbody() {
  10940. let rigy = new Laya.RigidBody();
  10941. rigy.bullet = true;
  10942. rigy.allowRotation = false;
  10943. rigy.allowSleep = false;
  10944. rigy.gravityScale = 0;
  10945. return rigy;
  10946. }
  10947. getfguiRotation(x, y) {
  10948. this.angleV2.setValue(x, y);
  10949. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10950. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10951. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10952. angle = -angle;
  10953. }
  10954. return 180 + angle;
  10955. }
  10956. getAngle(x, y) {
  10957. this.angleV2.setValue(x, y);
  10958. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10959. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10960. return angle;
  10961. }
  10962. randomNum(a, b) {
  10963. return a + Math.floor((b - a + 1) * Math.random());
  10964. }
  10965. getRandArrEle(arr) {
  10966. return arr[Math.floor(arr.length * Math.random())];
  10967. }
  10968. getSign(val) {
  10969. return val >= 0 ? 1 : -1;
  10970. }
  10971. botherArr(arr) {
  10972. let times = arr.length + 2;
  10973. let length = arr.length;
  10974. let a;
  10975. let b;
  10976. let temp;
  10977. for (let index = 0; index < times; index++) {
  10978. a = Math.floor(Math.random() * length);
  10979. b = Math.floor(Math.random() * length);
  10980. temp = arr[a];
  10981. arr[a] = arr[b];
  10982. arr[b] = temp;
  10983. }
  10984. }
  10985. getGameIconUrl(id) {
  10986. return "ui://game/" + id;
  10987. }
  10988. getComponentUrl(id) {
  10989. return "ui://game/" + id;
  10990. }
  10991. getAnimation() {
  10992. }
  10993. judgeSkillType(type = SkillType.highSpace) {
  10994. if (this.gameMode == GameMode.classic)
  10995. return;
  10996. let gameMgr = this.gameMgr;
  10997. if (gameMgr.selfTurn) {
  10998. if (gameMgr.selfCurSkill == type) {
  10999. return true;
  11000. }
  11001. }
  11002. else {
  11003. if (gameMgr.aiCurSkill == type) {
  11004. return true;
  11005. }
  11006. }
  11007. }
  11008. ballColliHole(collider) {
  11009. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11010. xGame.common.gameMgr.isFirstInGame = false;
  11011. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11012. }
  11013. collider.owner.mySrc.checkWrongBall();
  11014. }
  11015. getArrMaxEle(arr) {
  11016. let max = -Infinity;
  11017. for (let index = 0; index < arr.length; index++) {
  11018. max = Math.max(arr[index], max);
  11019. }
  11020. return max;
  11021. }
  11022. getArrMinEle(arr) {
  11023. let min = Infinity;
  11024. for (let index = 0; index < arr.length; index++) {
  11025. min = Math.min(arr[index], min);
  11026. }
  11027. return min;
  11028. }
  11029. playRandomMutiBallBigSkillSound() {
  11030. if (Math.random() <= 0.5)
  11031. return;
  11032. let rand = this.randomNum(1, 6);
  11033. let str = "ganfa0" + rand;
  11034. xGame.soundMgr.playSound(str);
  11035. }
  11036. showOneCamera(type) {
  11037. let object = xGame.common.d3World.cameraObj;
  11038. for (const key in object) {
  11039. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11040. object[key].init();
  11041. object[key].owner.active = key == type;
  11042. }
  11043. }
  11044. }
  11045. checkBallOverBorder(x, y) {
  11046. let radius = 17;
  11047. let condition = this._checkBorder(x + radius, y) ||
  11048. this._checkBorder(x - radius, y) ||
  11049. this._checkBorder(x, y + radius) ||
  11050. this._checkBorder(x, y - radius);
  11051. if (condition) {
  11052. return true;
  11053. }
  11054. }
  11055. _checkBorder(x, y) {
  11056. let borderRect = this.d2World.borderRect;
  11057. let xOffest = 20;
  11058. let yOffest = 20;
  11059. if (y <= borderRect.y - yOffest) {
  11060. return true;
  11061. }
  11062. if (y >= borderRect.y + borderRect.height + yOffest) {
  11063. return true;
  11064. }
  11065. if (x <= borderRect.x - xOffest) {
  11066. return true;
  11067. }
  11068. if (x >= borderRect.x + borderRect.width + xOffest) {
  11069. return true;
  11070. }
  11071. }
  11072. initWeight(cfg) {
  11073. let allCfgData = { data: {}, allWeightNum: 0 };
  11074. let weightCfg = allCfgData.data;
  11075. let weight = 0;
  11076. for (const key in cfg) {
  11077. weightCfg[key] = {};
  11078. weightCfg[key].id = cfg[key].id;
  11079. weightCfg[key].minWeight = weight;
  11080. weight += cfg[key].weight;
  11081. weightCfg[key].maxWeight = weight;
  11082. }
  11083. allCfgData.allWeightNum = weight;
  11084. return allCfgData;
  11085. }
  11086. getRandomWeightData(cfg) {
  11087. let weightCfg = cfg.data;
  11088. let allWeightNum = cfg.allWeightNum;
  11089. let rand = Math.floor(Math.random() * allWeightNum);
  11090. for (const key in weightCfg) {
  11091. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11092. return weightCfg[key];
  11093. }
  11094. }
  11095. return weightCfg[1];
  11096. }
  11097. showGirlTalkPop(wordsIndex, node, msgNode) {
  11098. node.visible = true;
  11099. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11100. node.t0.play(Laya.Handler.create(this, () => {
  11101. node.visible = false;
  11102. }));
  11103. }
  11104. stopGirlPop(node) {
  11105. node.t0.stop();
  11106. node.visible = false;
  11107. }
  11108. createHead(loader, url, size = 107) {
  11109. if (Laya.Browser.name == "Browser") {
  11110. loader.url = url;
  11111. return;
  11112. }
  11113. if (Moyu.isTT) {
  11114. let localImage = new Image();
  11115. localImage.src = url;
  11116. localImage.onload = () => {
  11117. let t2d = new Laya.Texture2D();
  11118. t2d.width = size;
  11119. t2d.height = size;
  11120. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11121. t2d.loadImageSource(localImage);
  11122. };
  11123. }
  11124. else {
  11125. console.log('zh:url=', url);
  11126. loader.url = url;
  11127. }
  11128. }
  11129. addTestCoin(num) {
  11130. DataMgr.setCoin(num);
  11131. }
  11132. addTestDiamond(num) {
  11133. DataMgr.setDiamond(num);
  11134. }
  11135. addTestSkill() {
  11136. DataMgr.setBigSkill(0, 99);
  11137. DataMgr.setBigSkill(1, 99);
  11138. DataMgr.setBigSkill(2, 99);
  11139. }
  11140. playClassicEmotion(number, x, y) {
  11141. if (this.gameMode == GameMode.bigMove)
  11142. return;
  11143. let randIndex = this.randomNum(0, 2);
  11144. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11145. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11146. if (this.gameMgr.selfTurn) {
  11147. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11148. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11149. }
  11150. else {
  11151. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11152. }
  11153. else {
  11154. if (number == this.gameMgr.blackNum) {
  11155. if (this.gameMgr.selfBallArr.length == 0) {
  11156. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11157. }
  11158. else {
  11159. }
  11160. }
  11161. else {
  11162. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11163. }
  11164. }
  11165. }
  11166. }
  11167. else {
  11168. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11169. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11170. }
  11171. else {
  11172. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11173. }
  11174. else {
  11175. if (number == this.gameMgr.blackNum) {
  11176. if (this.gameMgr.aiBallArr.length == 0) {
  11177. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11178. }
  11179. else {
  11180. }
  11181. }
  11182. else {
  11183. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11184. }
  11185. }
  11186. }
  11187. }
  11188. }
  11189. playHappySound(number) {
  11190. if (this.gameMode != GameMode.classic)
  11191. return;
  11192. if (number == 8)
  11193. return;
  11194. let play = false;
  11195. if (this.gameMgr.selfTurn) {
  11196. if (this.gameMgr.ensureBallType) {
  11197. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11198. play = true;
  11199. }
  11200. }
  11201. else {
  11202. play = true;
  11203. }
  11204. }
  11205. else {
  11206. if (this.gameMgr.ensureBallType) {
  11207. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11208. play = true;
  11209. }
  11210. }
  11211. else {
  11212. play = true;
  11213. }
  11214. }
  11215. if (play)
  11216. xGame.soundMgr.playSound("applause");
  11217. }
  11218. destroyClassicEmotion() {
  11219. if (this.gameMode == GameMode.bigMove)
  11220. return;
  11221. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11222. parent.destroyChildren();
  11223. }
  11224. playAwardSpine(x, y) {
  11225. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11226. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11227. this.awardSpine.play(data, 0, false, parent);
  11228. }
  11229. destroyAwardSpine() {
  11230. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11231. parent.destroyChildren();
  11232. }
  11233. isBlock(bx, by, hx, hy, except = null) {
  11234. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11235. let balls = xGame.common.d2World.ballArr;
  11236. let outArr = [];
  11237. for (let index = 0; index < balls.length; index++) {
  11238. let obj = balls[index];
  11239. if (obj.number == 0)
  11240. continue;
  11241. if (obj == except)
  11242. continue;
  11243. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11244. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11245. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11246. if (num >= 1)
  11247. num = 1;
  11248. if (num < 0)
  11249. continue;
  11250. let gap = Math.sin(Math.acos(num)) * dis;
  11251. if (gap < this.ballSize) {
  11252. outArr.push({
  11253. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11254. disHon: Math.cos(Math.acos(num)) * dis,
  11255. disVer: Math.sin(Math.acos(num)) * dis,
  11256. src: balls[index],
  11257. dir: this.tempDir1
  11258. });
  11259. }
  11260. }
  11261. if (outArr.length > 0) {
  11262. outArr.sort((a, b) => { return a.dis - b.dis; });
  11263. return outArr[0];
  11264. }
  11265. }
  11266. AngleBetween(vector1, vector2) {
  11267. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11268. return rad * (180 / Math.PI);
  11269. }
  11270. getSecretaryScale() {
  11271. if (this.secretary.spineName == "mishu") {
  11272. return 1.28;
  11273. }
  11274. else {
  11275. return 1.024;
  11276. }
  11277. }
  11278. signAwardContainsRod(arr) {
  11279. let temp;
  11280. for (let index = 0; index < arr.length; index++) {
  11281. temp = arr[index].split('-')[0];
  11282. if (parseInt(temp) > 2) {
  11283. return true;
  11284. }
  11285. }
  11286. }
  11287. judgeSameDay() {
  11288. let lastTime = DataMgr.getSignTime();
  11289. let curTime = new Date().getTime();
  11290. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11291. return true;
  11292. }
  11293. return false;
  11294. }
  11295. getAward(arr, callback) {
  11296. let showTriple = arr[0].type <= 2;
  11297. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11298. let temp;
  11299. for (let index = 0; index < arr.length; index++) {
  11300. temp = arr[index];
  11301. switch (temp.type) {
  11302. case 1:
  11303. this.playObjFlyAnim(temp.num, temp.type);
  11304. break;
  11305. case 2:
  11306. this.playObjFlyAnim(temp.num, temp.type);
  11307. break;
  11308. case 3:
  11309. case 4:
  11310. case 5:
  11311. case 6:
  11312. DataMgr.setBallRod(temp.type - 2, 1);
  11313. DataMgr.setCurBallRod(temp.type - 2);
  11314. break;
  11315. default:
  11316. break;
  11317. }
  11318. }
  11319. callback && callback(watchVideo);
  11320. });
  11321. }
  11322. getMoneyNode() {
  11323. let moneyNode;
  11324. let sign = xGame.uiMgr.getUI(UISign);
  11325. let draw = xGame.uiMgr.getUI(UIDraw);
  11326. let end = xGame.uiMgr.getUI(UIGameEnd);
  11327. let skill = xGame.uiMgr.getUI(UISkill);
  11328. if (sign && !sign.isHide)
  11329. moneyNode = sign.ui.moneyNode;
  11330. if (draw && !draw.isHide)
  11331. moneyNode = draw.ui.moneyNode;
  11332. if (end && !end.isHide)
  11333. moneyNode = end.ui.moneyNode;
  11334. if (skill && !skill.isHide)
  11335. moneyNode = skill.ui.moneyNode;
  11336. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11337. let main = xGame.uiMgr.getUI(UIMain);
  11338. if (condition1 && main && !main.isHide) {
  11339. moneyNode = main.ui.moneyNode;
  11340. }
  11341. return moneyNode;
  11342. }
  11343. playObjFlyAnim(num, type, callback = null) {
  11344. this.stPos.x = Laya.stage.width / 2;
  11345. this.stPos.y = Laya.stage.height / 2;
  11346. let moneyNode = this.getMoneyNode();
  11347. switch (type) {
  11348. case Prop.diamond:
  11349. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11350. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11351. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11352. this.edPos.x /= 2;
  11353. this.edPos.y /= 2;
  11354. break;
  11355. case Prop.coin:
  11356. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11357. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11358. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11359. this.edPos.x /= 2;
  11360. this.edPos.y /= 2;
  11361. break;
  11362. default:
  11363. break;
  11364. }
  11365. xGame.soundMgr.playSound("coinbag");
  11366. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11367. switch (type) {
  11368. case Prop.diamond:
  11369. DataMgr.setDiamond(num);
  11370. break;
  11371. case Prop.coin:
  11372. DataMgr.setCoin(num);
  11373. break;
  11374. default:
  11375. break;
  11376. }
  11377. callback && callback();
  11378. });
  11379. }
  11380. autoPopUIView() {
  11381. let arr = [];
  11382. let sign = this.judgeSameDay() ? false : true;
  11383. if (sign)
  11384. arr.push("sign");
  11385. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11386. if (draw)
  11387. arr.push("draw");
  11388. if (arr.length <= 0)
  11389. return;
  11390. let str = this.getRandArrEle(arr);
  11391. switch (str) {
  11392. case "sign":
  11393. xGame.uiMgr.Show(UISign);
  11394. break;
  11395. case "draw":
  11396. xGame.uiMgr.Show(UIDraw);
  11397. break;
  11398. default:
  11399. break;
  11400. }
  11401. }
  11402. getMSTime(time) {
  11403. let min = Math.floor(time / 60);
  11404. let sec = Math.floor((time - min * 60));
  11405. if (sec < 10)
  11406. sec = "0" + sec;
  11407. if (min < 10)
  11408. min = "0" + min;
  11409. return `${min}:${sec}`;
  11410. }
  11411. testPower() {
  11412. DataMgr.setPower(0, false);
  11413. }
  11414. getAllStarNum() {
  11415. let data = DataMgr.getPlaceBallLevelList();
  11416. let out = 0;
  11417. for (let index = 0; index < data.length; index++) {
  11418. out += data[index].star;
  11419. }
  11420. return out;
  11421. }
  11422. recoverCameraView() {
  11423. Laya.timer.once(900, this, () => {
  11424. xGame.common.showOneCamera("mainCamera");
  11425. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11426. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11427. xGame.common.gameUI.ui.border.alpha = 0;
  11428. if (Laya.physicsTimer.scale < 1) {
  11429. Laya.physicsTimer.scale = 1;
  11430. }
  11431. }
  11432. });
  11433. }
  11434. getClassicLevel() {
  11435. let successTimes = DataMgr.getClassicTimes();
  11436. let needKey = "";
  11437. let lastKey = "";
  11438. let cfg = cfgTable.classictimesData;
  11439. let data;
  11440. for (const key in cfg) {
  11441. data = cfg[key];
  11442. if (successTimes <= data.times) {
  11443. needKey = key;
  11444. }
  11445. lastKey = key;
  11446. }
  11447. if (needKey == "")
  11448. needKey = lastKey;
  11449. return cfg[needKey];
  11450. }
  11451. }
  11452. Common._instance = null;
  11453. class ui_Component92 extends fgui.GComponent {
  11454. static createInstance() {
  11455. return (fgui.UIPackage.createObject("game", "Component92"));
  11456. }
  11457. onConstruct() {
  11458. this.n0 = (this.getChild("n0"));
  11459. }
  11460. }
  11461. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11462. class ui_Component129 extends fgui.GProgressBar {
  11463. static createInstance() {
  11464. return (fgui.UIPackage.createObject("game", "Component129"));
  11465. }
  11466. onConstruct() {
  11467. this.bar_v = (this.getChild("bar_v"));
  11468. this.n84 = (this.getChild("n84"));
  11469. }
  11470. }
  11471. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11472. class ui_Component130 extends fgui.GComponent {
  11473. static createInstance() {
  11474. return (fgui.UIPackage.createObject("game", "Component130"));
  11475. }
  11476. onConstruct() {
  11477. this.ani = (this.getChild("ani"));
  11478. this.t0 = this.getTransition("t0");
  11479. }
  11480. }
  11481. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11482. class ui_powerEft extends fgui.GComponent {
  11483. static createInstance() {
  11484. return (fgui.UIPackage.createObject("game", "powerEft"));
  11485. }
  11486. onConstruct() {
  11487. this.ani = (this.getChild("ani"));
  11488. this.n88 = (this.getChild("n88"));
  11489. this.n89 = (this.getChild("n89"));
  11490. }
  11491. }
  11492. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11493. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11494. static createInstance() {
  11495. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11496. }
  11497. onConstruct() {
  11498. this.c1 = this.getController("c1");
  11499. this.n2 = (this.getChild("n2"));
  11500. this.n22 = (this.getChild("n22"));
  11501. this.n23 = (this.getChild("n23"));
  11502. this.n15 = (this.getChild("n15"));
  11503. this.challenge = (this.getChild("challenge"));
  11504. this.n17 = (this.getChild("n17"));
  11505. this.n3 = (this.getChild("n3"));
  11506. this.starNode = (this.getChild("starNode"));
  11507. this.levelTxt = (this.getChild("levelTxt"));
  11508. this.n14 = (this.getChild("n14"));
  11509. this.n19 = (this.getChild("n19"));
  11510. this.n20 = (this.getChild("n20"));
  11511. this.n21 = (this.getChild("n21"));
  11512. this.special = (this.getChild("special"));
  11513. }
  11514. }
  11515. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11516. class ui_Component79 extends fgui.GComponent {
  11517. static createInstance() {
  11518. return (fgui.UIPackage.createObject("game", "Component79"));
  11519. }
  11520. onConstruct() {
  11521. this.c1 = this.getController("c1");
  11522. this.n7 = (this.getChild("n7"));
  11523. this.n8 = (this.getChild("n8"));
  11524. this.n9 = (this.getChild("n9"));
  11525. this.n10 = (this.getChild("n10"));
  11526. this.n11 = (this.getChild("n11"));
  11527. this.n12 = (this.getChild("n12"));
  11528. }
  11529. }
  11530. ui_Component79.URL = "ui://isxx5ak7avag477";
  11531. class ui_Component80 extends fgui.GComponent {
  11532. static createInstance() {
  11533. return (fgui.UIPackage.createObject("game", "Component80"));
  11534. }
  11535. onConstruct() {
  11536. this.n0 = (this.getChild("n0"));
  11537. this.n1 = (this.getChild("n1"));
  11538. this.myList = (this.getChild("myList"));
  11539. this.t0 = this.getTransition("t0");
  11540. }
  11541. }
  11542. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11543. class ui_SignNormal extends fgui.GComponent {
  11544. static createInstance() {
  11545. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11546. }
  11547. onConstruct() {
  11548. this.c1 = this.getController("c1");
  11549. this.n7 = (this.getChild("n7"));
  11550. this.n15 = (this.getChild("n15"));
  11551. this.titleTxt = (this.getChild("titleTxt"));
  11552. this.n8 = (this.getChild("n8"));
  11553. this.myIcon = (this.getChild("myIcon"));
  11554. this.numTxt = (this.getChild("numTxt"));
  11555. this.n12 = (this.getChild("n12"));
  11556. this.n13 = (this.getChild("n13"));
  11557. this.n17 = (this.getChild("n17"));
  11558. this.n14 = (this.getChild("n14"));
  11559. }
  11560. }
  11561. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11562. class ui_screenNode extends fgui.GComponent {
  11563. static createInstance() {
  11564. return (fgui.UIPackage.createObject("game", "screenNode"));
  11565. }
  11566. onConstruct() {
  11567. this.n9 = (this.getChild("n9"));
  11568. this.screenImg = (this.getChild("screenImg"));
  11569. }
  11570. }
  11571. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11572. class ui_GetAwrad_com1 extends fgui.GComponent {
  11573. static createInstance() {
  11574. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11575. }
  11576. onConstruct() {
  11577. this.n38 = (this.getChild("n38"));
  11578. this.n39 = (this.getChild("n39"));
  11579. this.n40 = (this.getChild("n40"));
  11580. this.t0 = this.getTransition("t0");
  11581. this.t1 = this.getTransition("t1");
  11582. }
  11583. }
  11584. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11585. class ui_GetAwrad_com2 extends fgui.GComponent {
  11586. static createInstance() {
  11587. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11588. }
  11589. onConstruct() {
  11590. this.n39 = (this.getChild("n39"));
  11591. this.n40 = (this.getChild("n40"));
  11592. this.t0 = this.getTransition("t0");
  11593. }
  11594. }
  11595. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11596. class ui_Component128 extends fgui.GComponent {
  11597. static createInstance() {
  11598. return (fgui.UIPackage.createObject("game", "Component128"));
  11599. }
  11600. onConstruct() {
  11601. this.n38 = (this.getChild("n38"));
  11602. this.n40 = (this.getChild("n40"));
  11603. }
  11604. }
  11605. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11606. class ui_Component100_1 extends fgui.GComponent {
  11607. static createInstance() {
  11608. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11609. }
  11610. onConstruct() {
  11611. this.myNode = (this.getChild("myNode"));
  11612. this.t0 = this.getTransition("t0");
  11613. }
  11614. }
  11615. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11616. class ui_Component142 extends fgui.GComponent {
  11617. static createInstance() {
  11618. return (fgui.UIPackage.createObject("game", "Component142"));
  11619. }
  11620. onConstruct() {
  11621. this.n41 = (this.getChild("n41"));
  11622. this.n42 = (this.getChild("n42"));
  11623. }
  11624. }
  11625. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11626. class ui_main_guang extends fgui.GComponent {
  11627. static createInstance() {
  11628. return (fgui.UIPackage.createObject("game", "main_guang"));
  11629. }
  11630. onConstruct() {
  11631. this.n1 = (this.getChild("n1"));
  11632. this.n2 = (this.getChild("n2"));
  11633. this.n3 = (this.getChild("n3"));
  11634. this.n4 = (this.getChild("n4"));
  11635. this.n5 = (this.getChild("n5"));
  11636. this.n6 = (this.getChild("n6"));
  11637. this.n8 = (this.getChild("n8"));
  11638. this.t0 = this.getTransition("t0");
  11639. }
  11640. }
  11641. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11642. class ui_try_com1 extends fgui.GComponent {
  11643. static createInstance() {
  11644. return (fgui.UIPackage.createObject("game", "try_com1"));
  11645. }
  11646. onConstruct() {
  11647. this.c1 = this.getController("c1");
  11648. this.n0 = (this.getChild("n0"));
  11649. this.n2 = (this.getChild("n2"));
  11650. this.cancelBtn = (this.getChild("cancelBtn"));
  11651. this.videoBtn = (this.getChild("videoBtn"));
  11652. this.n9 = (this.getChild("n9"));
  11653. this.n24 = (this.getChild("n24"));
  11654. this.titleTxt = (this.getChild("titleTxt"));
  11655. this.n32 = (this.getChild("n32"));
  11656. this.n29 = (this.getChild("n29"));
  11657. this.n36 = (this.getChild("n36"));
  11658. this.txtTime = (this.getChild("txtTime"));
  11659. this.t0 = this.getTransition("t0");
  11660. }
  11661. }
  11662. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11663. class ui_try_com2 extends fgui.GComponent {
  11664. static createInstance() {
  11665. return (fgui.UIPackage.createObject("game", "try_com2"));
  11666. }
  11667. onConstruct() {
  11668. this.skillicon = (this.getChild("skillicon"));
  11669. this.n35 = (this.getChild("n35"));
  11670. this.n31 = (this.getChild("n31"));
  11671. this.n32 = (this.getChild("n32"));
  11672. this.n33 = (this.getChild("n33"));
  11673. this.n34 = (this.getChild("n34"));
  11674. }
  11675. }
  11676. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11677. class ui_try_com3 extends fgui.GComponent {
  11678. static createInstance() {
  11679. return (fgui.UIPackage.createObject("game", "try_com3"));
  11680. }
  11681. onConstruct() {
  11682. this.n33 = (this.getChild("n33"));
  11683. this.n34 = (this.getChild("n34"));
  11684. this.n35 = (this.getChild("n35"));
  11685. this.t0 = this.getTransition("t0");
  11686. }
  11687. }
  11688. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11689. class ui_huihe1 extends fgui.GComponent {
  11690. static createInstance() {
  11691. return (fgui.UIPackage.createObject("game", "huihe1"));
  11692. }
  11693. onConstruct() {
  11694. this.n0 = (this.getChild("n0"));
  11695. this.n1 = (this.getChild("n1"));
  11696. this.t0 = this.getTransition("t0");
  11697. }
  11698. }
  11699. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11700. class ui_huihe2 extends fgui.GComponent {
  11701. static createInstance() {
  11702. return (fgui.UIPackage.createObject("game", "huihe2"));
  11703. }
  11704. onConstruct() {
  11705. this.n0 = (this.getChild("n0"));
  11706. this.n1 = (this.getChild("n1"));
  11707. this.t0 = this.getTransition("t0");
  11708. }
  11709. }
  11710. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11711. class ui_Component143 extends fgui.GComponent {
  11712. static createInstance() {
  11713. return (fgui.UIPackage.createObject("game", "Component143"));
  11714. }
  11715. onConstruct() {
  11716. this.n3 = (this.getChild("n3"));
  11717. this.n4 = (this.getChild("n4"));
  11718. this.n5 = (this.getChild("n5"));
  11719. this.n6 = (this.getChild("n6"));
  11720. this.n7 = (this.getChild("n7"));
  11721. this.n8 = (this.getChild("n8"));
  11722. this.n9 = (this.getChild("n9"));
  11723. this.n10 = (this.getChild("n10"));
  11724. this.t0 = this.getTransition("t0");
  11725. }
  11726. }
  11727. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11728. class ui_dh_jingbi2 extends fgui.GComponent {
  11729. static createInstance() {
  11730. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11731. }
  11732. onConstruct() {
  11733. this.n0 = (this.getChild("n0"));
  11734. this.n1 = (this.getChild("n1"));
  11735. this.n2 = (this.getChild("n2"));
  11736. this.n3 = (this.getChild("n3"));
  11737. this.n4 = (this.getChild("n4"));
  11738. this.n5 = (this.getChild("n5"));
  11739. this.n6 = (this.getChild("n6"));
  11740. this.n8 = (this.getChild("n8"));
  11741. this.n10 = (this.getChild("n10"));
  11742. this.t0 = this.getTransition("t0");
  11743. }
  11744. }
  11745. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11746. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11747. static createInstance() {
  11748. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11749. }
  11750. onConstruct() {
  11751. this.n1 = (this.getChild("n1"));
  11752. this.n4 = (this.getChild("n4"));
  11753. this.t0 = this.getTransition("t0");
  11754. }
  11755. }
  11756. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11757. class ui_dh_jingbi3 extends fgui.GComponent {
  11758. static createInstance() {
  11759. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11760. }
  11761. onConstruct() {
  11762. this.n0 = (this.getChild("n0"));
  11763. this.n1 = (this.getChild("n1"));
  11764. this.n2 = (this.getChild("n2"));
  11765. this.n3 = (this.getChild("n3"));
  11766. this.n4 = (this.getChild("n4"));
  11767. this.n5 = (this.getChild("n5"));
  11768. this.n6 = (this.getChild("n6"));
  11769. this.n8 = (this.getChild("n8"));
  11770. this.n10 = (this.getChild("n10"));
  11771. this.t0 = this.getTransition("t0");
  11772. }
  11773. }
  11774. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11775. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11776. static createInstance() {
  11777. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11778. }
  11779. onConstruct() {
  11780. this.n3 = (this.getChild("n3"));
  11781. this.n1 = (this.getChild("n1"));
  11782. this.t0 = this.getTransition("t0");
  11783. }
  11784. }
  11785. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11786. class ui_hb_jinbi1 extends fgui.GButton {
  11787. static createInstance() {
  11788. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11789. }
  11790. onConstruct() {
  11791. this.n20 = (this.getChild("n20"));
  11792. this.n25 = (this.getChild("n25"));
  11793. this.coinTxt = (this.getChild("coinTxt"));
  11794. this.n28 = (this.getChild("n28"));
  11795. this.n32 = (this.getChild("n32"));
  11796. this.n38 = (this.getChild("n38"));
  11797. this.n45 = (this.getChild("n45"));
  11798. this.getTips = (this.getChild("getTips"));
  11799. this.n39 = (this.getChild("n39"));
  11800. this.diamondTxt = (this.getChild("diamondTxt"));
  11801. this.n41 = (this.getChild("n41"));
  11802. this.n42 = (this.getChild("n42"));
  11803. this.n46 = (this.getChild("n46"));
  11804. this.n47 = (this.getChild("n47"));
  11805. this.n48 = (this.getChild("n48"));
  11806. this.t0 = this.getTransition("t0");
  11807. }
  11808. }
  11809. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11810. class ui_hb_jinbi2 extends fgui.GButton {
  11811. static createInstance() {
  11812. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11813. }
  11814. onConstruct() {
  11815. this.n20 = (this.getChild("n20"));
  11816. this.n25 = (this.getChild("n25"));
  11817. this.coinTxt = (this.getChild("coinTxt"));
  11818. this.n28 = (this.getChild("n28"));
  11819. this.n32 = (this.getChild("n32"));
  11820. this.n38 = (this.getChild("n38"));
  11821. this.n39 = (this.getChild("n39"));
  11822. this.diamondTxt = (this.getChild("diamondTxt"));
  11823. this.n41 = (this.getChild("n41"));
  11824. this.n42 = (this.getChild("n42"));
  11825. this.n43 = (this.getChild("n43"));
  11826. this.n44 = (this.getChild("n44"));
  11827. this.n45 = (this.getChild("n45"));
  11828. this.t0 = this.getTransition("t0");
  11829. }
  11830. }
  11831. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11832. class ui_hb_jinbi3 extends fgui.GButton {
  11833. static createInstance() {
  11834. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11835. }
  11836. onConstruct() {
  11837. this.n20 = (this.getChild("n20"));
  11838. this.n25 = (this.getChild("n25"));
  11839. this.coinTxt = (this.getChild("coinTxt"));
  11840. this.n28 = (this.getChild("n28"));
  11841. this.n32 = (this.getChild("n32"));
  11842. this.n38 = (this.getChild("n38"));
  11843. this.n39 = (this.getChild("n39"));
  11844. this.diamondTxt = (this.getChild("diamondTxt"));
  11845. this.n41 = (this.getChild("n41"));
  11846. this.n42 = (this.getChild("n42"));
  11847. this.n43 = (this.getChild("n43"));
  11848. this.n44 = (this.getChild("n44"));
  11849. this.n45 = (this.getChild("n45"));
  11850. this.t0 = this.getTransition("t0");
  11851. }
  11852. }
  11853. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11854. class ui_Component104 extends fgui.GComponent {
  11855. static createInstance() {
  11856. return (fgui.UIPackage.createObject("game", "Component104"));
  11857. }
  11858. onConstruct() {
  11859. this.c1 = this.getController("c1");
  11860. this.n12 = (this.getChild("n12"));
  11861. this.coinBtn = (this.getChild("coinBtn"));
  11862. this.diamondBtn = (this.getChild("diamondBtn"));
  11863. this.node3 = (this.getChild("node3"));
  11864. this.node4 = (this.getChild("node4"));
  11865. this.node5 = (this.getChild("node5"));
  11866. this.node1 = (this.getChild("node1"));
  11867. this.node2 = (this.getChild("node2"));
  11868. this.node6 = (this.getChild("node6"));
  11869. this.t0 = this.getTransition("t0");
  11870. }
  11871. }
  11872. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11873. class ui_Component105 extends fgui.GButton {
  11874. static createInstance() {
  11875. return (fgui.UIPackage.createObject("game", "Component105"));
  11876. }
  11877. onConstruct() {
  11878. this.c1 = this.getController("c1");
  11879. this.n49 = (this.getChild("n49"));
  11880. this.n18 = (this.getChild("n18"));
  11881. this.n46 = (this.getChild("n46"));
  11882. this.n48 = (this.getChild("n48"));
  11883. }
  11884. }
  11885. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11886. class ui_Component106 extends fgui.GButton {
  11887. static createInstance() {
  11888. return (fgui.UIPackage.createObject("game", "Component106"));
  11889. }
  11890. onConstruct() {
  11891. this.c1 = this.getController("c1");
  11892. this.n49 = (this.getChild("n49"));
  11893. this.n18 = (this.getChild("n18"));
  11894. this.n46 = (this.getChild("n46"));
  11895. this.n48 = (this.getChild("n48"));
  11896. }
  11897. }
  11898. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11899. class ui_hb_zs1 extends fgui.GButton {
  11900. static createInstance() {
  11901. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11902. }
  11903. onConstruct() {
  11904. this.c1 = this.getController("c1");
  11905. this.n20 = (this.getChild("n20"));
  11906. this.n21 = (this.getChild("n21"));
  11907. this.n26 = (this.getChild("n26"));
  11908. this.n27 = (this.getChild("n27"));
  11909. this.shareTxt = (this.getChild("shareTxt"));
  11910. this.n32 = (this.getChild("n32"));
  11911. this.n38 = (this.getChild("n38"));
  11912. this.n39 = (this.getChild("n39"));
  11913. this.n44 = (this.getChild("n44"));
  11914. this.diamondTxt = (this.getChild("diamondTxt"));
  11915. this.n41 = (this.getChild("n41"));
  11916. this.n45 = (this.getChild("n45"));
  11917. this.n47 = (this.getChild("n47"));
  11918. this.n48 = (this.getChild("n48"));
  11919. this.randTxt = (this.getChild("randTxt"));
  11920. this.n50 = (this.getChild("n50"));
  11921. this.t0 = this.getTransition("t0");
  11922. }
  11923. }
  11924. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11925. class ui_dh_zs1 extends fgui.GComponent {
  11926. static createInstance() {
  11927. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11928. }
  11929. onConstruct() {
  11930. this.n10 = (this.getChild("n10"));
  11931. this.n9 = (this.getChild("n9"));
  11932. this.n1 = (this.getChild("n1"));
  11933. this.n2 = (this.getChild("n2"));
  11934. this.n3 = (this.getChild("n3"));
  11935. this.n4 = (this.getChild("n4"));
  11936. this.n5 = (this.getChild("n5"));
  11937. this.n6 = (this.getChild("n6"));
  11938. this.n8 = (this.getChild("n8"));
  11939. this.n11 = (this.getChild("n11"));
  11940. this.t0 = this.getTransition("t0");
  11941. }
  11942. }
  11943. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11944. class ui_dh_zs1_1 extends fgui.GComponent {
  11945. static createInstance() {
  11946. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11947. }
  11948. onConstruct() {
  11949. this.n3 = (this.getChild("n3"));
  11950. this.n1 = (this.getChild("n1"));
  11951. this.t0 = this.getTransition("t0");
  11952. }
  11953. }
  11954. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11955. class ui_hb_zs2 extends fgui.GButton {
  11956. static createInstance() {
  11957. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11958. }
  11959. onConstruct() {
  11960. this.n20 = (this.getChild("n20"));
  11961. this.n21 = (this.getChild("n21"));
  11962. this.n26 = (this.getChild("n26"));
  11963. this.n27 = (this.getChild("n27"));
  11964. this.n32 = (this.getChild("n32"));
  11965. this.n38 = (this.getChild("n38"));
  11966. this.n39 = (this.getChild("n39"));
  11967. this.n44 = (this.getChild("n44"));
  11968. this.diamondTxt = (this.getChild("diamondTxt"));
  11969. this.n41 = (this.getChild("n41"));
  11970. this.n45 = (this.getChild("n45"));
  11971. this.t0 = this.getTransition("t0");
  11972. }
  11973. }
  11974. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11975. class ui_hb_zs3 extends fgui.GButton {
  11976. static createInstance() {
  11977. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11978. }
  11979. onConstruct() {
  11980. this.n20 = (this.getChild("n20"));
  11981. this.n21 = (this.getChild("n21"));
  11982. this.n26 = (this.getChild("n26"));
  11983. this.n27 = (this.getChild("n27"));
  11984. this.n32 = (this.getChild("n32"));
  11985. this.n38 = (this.getChild("n38"));
  11986. this.n47 = (this.getChild("n47"));
  11987. this.t0 = this.getTransition("t0");
  11988. }
  11989. }
  11990. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  11991. class ui_dh_zs2 extends fgui.GComponent {
  11992. static createInstance() {
  11993. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  11994. }
  11995. onConstruct() {
  11996. this.n10 = (this.getChild("n10"));
  11997. this.n9 = (this.getChild("n9"));
  11998. this.n1 = (this.getChild("n1"));
  11999. this.n2 = (this.getChild("n2"));
  12000. this.n3 = (this.getChild("n3"));
  12001. this.n4 = (this.getChild("n4"));
  12002. this.n5 = (this.getChild("n5"));
  12003. this.n6 = (this.getChild("n6"));
  12004. this.n8 = (this.getChild("n8"));
  12005. this.n11 = (this.getChild("n11"));
  12006. this.t0 = this.getTransition("t0");
  12007. }
  12008. }
  12009. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12010. class ui_dh_zs2_1 extends fgui.GComponent {
  12011. static createInstance() {
  12012. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12013. }
  12014. onConstruct() {
  12015. this.n3 = (this.getChild("n3"));
  12016. this.n1 = (this.getChild("n1"));
  12017. this.t0 = this.getTransition("t0");
  12018. }
  12019. }
  12020. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12021. class ui_dh_zs3 extends fgui.GComponent {
  12022. static createInstance() {
  12023. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12024. }
  12025. onConstruct() {
  12026. this.n10 = (this.getChild("n10"));
  12027. this.n9 = (this.getChild("n9"));
  12028. this.n1 = (this.getChild("n1"));
  12029. this.n2 = (this.getChild("n2"));
  12030. this.n3 = (this.getChild("n3"));
  12031. this.n4 = (this.getChild("n4"));
  12032. this.n5 = (this.getChild("n5"));
  12033. this.n6 = (this.getChild("n6"));
  12034. this.n8 = (this.getChild("n8"));
  12035. this.n11 = (this.getChild("n11"));
  12036. this.t0 = this.getTransition("t0");
  12037. }
  12038. }
  12039. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12040. class ui_dh_zs3_1 extends fgui.GComponent {
  12041. static createInstance() {
  12042. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12043. }
  12044. onConstruct() {
  12045. this.n3 = (this.getChild("n3"));
  12046. this.n1 = (this.getChild("n1"));
  12047. this.t0 = this.getTransition("t0");
  12048. }
  12049. }
  12050. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12051. class ui_Component107 extends fgui.GComponent {
  12052. static createInstance() {
  12053. return (fgui.UIPackage.createObject("game", "Component107"));
  12054. }
  12055. onConstruct() {
  12056. this.n18 = (this.getChild("n18"));
  12057. this.n19 = (this.getChild("n19"));
  12058. this.n20 = (this.getChild("n20"));
  12059. this.n21 = (this.getChild("n21"));
  12060. this.n22 = (this.getChild("n22"));
  12061. this.levelTxt = (this.getChild("levelTxt"));
  12062. this.t0 = this.getTransition("t0");
  12063. }
  12064. }
  12065. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12066. class ui_box_com1 extends fgui.GComponent {
  12067. static createInstance() {
  12068. return (fgui.UIPackage.createObject("game", "box_com1"));
  12069. }
  12070. onConstruct() {
  12071. this.n14 = (this.getChild("n14"));
  12072. this.n6 = (this.getChild("n6"));
  12073. this.t0 = this.getTransition("t0");
  12074. }
  12075. }
  12076. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12077. class ui_box_com2 extends fgui.GProgressBar {
  12078. static createInstance() {
  12079. return (fgui.UIPackage.createObject("game", "box_com2"));
  12080. }
  12081. onConstruct() {
  12082. this.bg0 = (this.getChild("bg0"));
  12083. this.bg = (this.getChild("bg"));
  12084. this.bar = (this.getChild("bar"));
  12085. this.n7 = (this.getChild("n7"));
  12086. this.n8 = (this.getChild("n8"));
  12087. this.n10 = (this.getChild("n10"));
  12088. this.n11 = (this.getChild("n11"));
  12089. this.n12 = (this.getChild("n12"));
  12090. }
  12091. }
  12092. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12093. class ui_box_com4 extends fgui.GComponent {
  12094. static createInstance() {
  12095. return (fgui.UIPackage.createObject("game", "box_com4"));
  12096. }
  12097. onConstruct() {
  12098. this.n8 = (this.getChild("n8"));
  12099. this.t0 = this.getTransition("t0");
  12100. }
  12101. }
  12102. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12103. class ui_box_com3 extends fgui.GComponent {
  12104. static createInstance() {
  12105. return (fgui.UIPackage.createObject("game", "box_com3"));
  12106. }
  12107. onConstruct() {
  12108. this.n2 = (this.getChild("n2"));
  12109. this.n3 = (this.getChild("n3"));
  12110. this.n4 = (this.getChild("n4"));
  12111. this.n5 = (this.getChild("n5"));
  12112. this.t0 = this.getTransition("t0");
  12113. this.t1 = this.getTransition("t1");
  12114. }
  12115. }
  12116. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12117. class ui_Component97 extends fgui.GComponent {
  12118. static createInstance() {
  12119. return (fgui.UIPackage.createObject("game", "Component97"));
  12120. }
  12121. onConstruct() {
  12122. this.c1 = this.getController("c1");
  12123. this.n46 = (this.getChild("n46"));
  12124. this.diamondNode = (this.getChild("diamondNode"));
  12125. this.coinNode = (this.getChild("coinNode"));
  12126. this.t0 = this.getTransition("t0");
  12127. }
  12128. }
  12129. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12130. class ui_Component98 extends fgui.GButton {
  12131. static createInstance() {
  12132. return (fgui.UIPackage.createObject("game", "Component98"));
  12133. }
  12134. onConstruct() {
  12135. this.n8 = (this.getChild("n8"));
  12136. this.n40 = (this.getChild("n40"));
  12137. }
  12138. }
  12139. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12140. class ui_Component28_11 extends fgui.GButton {
  12141. static createInstance() {
  12142. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12143. }
  12144. onConstruct() {
  12145. this.c1 = this.getController("c1");
  12146. this.n12 = (this.getChild("n12"));
  12147. this.n17 = (this.getChild("n17"));
  12148. this.n13 = (this.getChild("n13"));
  12149. this.diamondTxt = (this.getChild("diamondTxt"));
  12150. this.n15 = (this.getChild("n15"));
  12151. this.n16 = (this.getChild("n16"));
  12152. }
  12153. }
  12154. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12155. class ui_Component58_11 extends fgui.GComponent {
  12156. static createInstance() {
  12157. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12158. }
  12159. onConstruct() {
  12160. this.n23 = (this.getChild("n23"));
  12161. this.n41 = (this.getChild("n41"));
  12162. this.myList = (this.getChild("myList"));
  12163. this.n45 = (this.getChild("n45"));
  12164. this.n44 = (this.getChild("n44"));
  12165. this.t0 = this.getTransition("t0");
  12166. }
  12167. }
  12168. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12169. class ui_Component100 extends fgui.GComponent {
  12170. static createInstance() {
  12171. return (fgui.UIPackage.createObject("game", "Component100"));
  12172. }
  12173. onConstruct() {
  12174. this.c1 = this.getController("c1");
  12175. this.n75 = (this.getChild("n75"));
  12176. this.n76 = (this.getChild("n76"));
  12177. this.n80 = (this.getChild("n80"));
  12178. this.txt = (this.getChild("txt"));
  12179. this.spineRoot = (this.getChild("spineRoot"));
  12180. }
  12181. }
  12182. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12183. class ui_Component101 extends fgui.GComponent {
  12184. static createInstance() {
  12185. return (fgui.UIPackage.createObject("game", "Component101"));
  12186. }
  12187. onConstruct() {
  12188. this.c1 = this.getController("c1");
  12189. this.n36 = (this.getChild("n36"));
  12190. this.n35 = (this.getChild("n35"));
  12191. this.n33 = (this.getChild("n33"));
  12192. this.n34 = (this.getChild("n34"));
  12193. }
  12194. }
  12195. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12196. class ui_Component53 extends fgui.GComponent {
  12197. static createInstance() {
  12198. return (fgui.UIPackage.createObject("game", "Component53"));
  12199. }
  12200. onConstruct() {
  12201. this.n0 = (this.getChild("n0"));
  12202. this.n1 = (this.getChild("n1"));
  12203. this.n2 = (this.getChild("n2"));
  12204. this.n3 = (this.getChild("n3"));
  12205. this.n4 = (this.getChild("n4"));
  12206. this.n5 = (this.getChild("n5"));
  12207. this.n6 = (this.getChild("n6"));
  12208. this.n7 = (this.getChild("n7"));
  12209. this.n8 = (this.getChild("n8"));
  12210. this.n9 = (this.getChild("n9"));
  12211. this.n10 = (this.getChild("n10"));
  12212. this.n11 = (this.getChild("n11"));
  12213. this.n12 = (this.getChild("n12"));
  12214. this.n13 = (this.getChild("n13"));
  12215. this.n14 = (this.getChild("n14"));
  12216. this.n15 = (this.getChild("n15"));
  12217. this.n16 = (this.getChild("n16"));
  12218. this.n19 = (this.getChild("n19"));
  12219. this.n20 = (this.getChild("n20"));
  12220. this.n21 = (this.getChild("n21"));
  12221. this.n22 = (this.getChild("n22"));
  12222. this.n23 = (this.getChild("n23"));
  12223. this.n24 = (this.getChild("n24"));
  12224. this.n25 = (this.getChild("n25"));
  12225. this.n26 = (this.getChild("n26"));
  12226. this.n27 = (this.getChild("n27"));
  12227. this.n28 = (this.getChild("n28"));
  12228. this.n29 = (this.getChild("n29"));
  12229. this.n30 = (this.getChild("n30"));
  12230. this.n31 = (this.getChild("n31"));
  12231. this.n32 = (this.getChild("n32"));
  12232. this.n33 = (this.getChild("n33"));
  12233. this.n34 = (this.getChild("n34"));
  12234. this.n35 = (this.getChild("n35"));
  12235. this.t0 = this.getTransition("t0");
  12236. }
  12237. }
  12238. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12239. class ui_Component58 extends fgui.GComponent {
  12240. static createInstance() {
  12241. return (fgui.UIPackage.createObject("game", "Component58"));
  12242. }
  12243. onConstruct() {
  12244. this.n23 = (this.getChild("n23"));
  12245. this.n41 = (this.getChild("n41"));
  12246. this.n8 = (this.getChild("n8"));
  12247. this.skillList = (this.getChild("skillList"));
  12248. this.t0 = this.getTransition("t0");
  12249. }
  12250. }
  12251. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12252. class ui_Component59 extends fgui.GComponent {
  12253. static createInstance() {
  12254. return (fgui.UIPackage.createObject("game", "Component59"));
  12255. }
  12256. onConstruct() {
  12257. this.n3 = (this.getChild("n3"));
  12258. this.msgTxt = (this.getChild("msgTxt"));
  12259. this.t0 = this.getTransition("t0");
  12260. }
  12261. }
  12262. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12263. class ui_RulerNode extends fgui.GComponent {
  12264. static createInstance() {
  12265. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12266. }
  12267. onConstruct() {
  12268. this.n6 = (this.getChild("n6"));
  12269. this.n4 = (this.getChild("n4"));
  12270. this.img1 = (this.getChild("img1"));
  12271. this.img2 = (this.getChild("img2"));
  12272. }
  12273. }
  12274. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12275. class ui_Component108 extends fgui.GComponent {
  12276. static createInstance() {
  12277. return (fgui.UIPackage.createObject("game", "Component108"));
  12278. }
  12279. onConstruct() {
  12280. this.n19 = (this.getChild("n19"));
  12281. this.t0 = this.getTransition("t0");
  12282. }
  12283. }
  12284. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12285. class ui_Component63 extends fgui.GComponent {
  12286. static createInstance() {
  12287. return (fgui.UIPackage.createObject("game", "Component63"));
  12288. }
  12289. onConstruct() {
  12290. this.n66 = (this.getChild("n66"));
  12291. this.n56 = (this.getChild("n56"));
  12292. this.n63 = (this.getChild("n63"));
  12293. this.n65 = (this.getChild("n65"));
  12294. this.t0 = this.getTransition("t0");
  12295. }
  12296. }
  12297. ui_Component63.URL = "ui://isxx5ak7h657452";
  12298. class ui_topNode extends fgui.GComponent {
  12299. static createInstance() {
  12300. return (fgui.UIPackage.createObject("game", "topNode"));
  12301. }
  12302. onConstruct() {
  12303. this.selfProgress = (this.getChild("selfProgress"));
  12304. this.aiProgress = (this.getChild("aiProgress"));
  12305. this.selfKuang = (this.getChild("selfKuang"));
  12306. this.aiKuang = (this.getChild("aiKuang"));
  12307. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12308. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12309. this.n33 = (this.getChild("n33"));
  12310. this.n34 = (this.getChild("n34"));
  12311. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12312. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12313. this.selfBallList = (this.getChild("selfBallList"));
  12314. this.aiBallList = (this.getChild("aiBallList"));
  12315. this.middleNode = (this.getChild("middleNode"));
  12316. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12317. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12318. this.scoreNode = (this.getChild("scoreNode"));
  12319. this.selfTips = (this.getChild("selfTips"));
  12320. this.aiTips = (this.getChild("aiTips"));
  12321. }
  12322. }
  12323. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12324. class ui_selfProgress extends fgui.GProgressBar {
  12325. static createInstance() {
  12326. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12327. }
  12328. onConstruct() {
  12329. this.n3 = (this.getChild("n3"));
  12330. this.bar = (this.getChild("bar"));
  12331. }
  12332. }
  12333. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12334. class ui_aiProgress extends fgui.GProgressBar {
  12335. static createInstance() {
  12336. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12337. }
  12338. onConstruct() {
  12339. this.n3 = (this.getChild("n3"));
  12340. this.bar = (this.getChild("bar"));
  12341. }
  12342. }
  12343. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12344. class ui_ballDisplay extends fgui.GComponent {
  12345. static createInstance() {
  12346. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12347. }
  12348. onConstruct() {
  12349. this.myImg = (this.getChild("myImg"));
  12350. }
  12351. }
  12352. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12353. class ui_moveNode extends fgui.GComponent {
  12354. static createInstance() {
  12355. return (fgui.UIPackage.createObject("game", "moveNode"));
  12356. }
  12357. onConstruct() {
  12358. this.n8 = (this.getChild("n8"));
  12359. this.finger = (this.getChild("finger"));
  12360. }
  12361. }
  12362. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12363. class ui_cancelBtn extends fgui.GButton {
  12364. static createInstance() {
  12365. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12366. }
  12367. onConstruct() {
  12368. this.c1 = this.getController("c1");
  12369. this.n0 = (this.getChild("n0"));
  12370. this.n1 = (this.getChild("n1"));
  12371. }
  12372. }
  12373. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12374. class ui_shareBtn extends fgui.GButton {
  12375. static createInstance() {
  12376. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12377. }
  12378. onConstruct() {
  12379. this.c1 = this.getController("c1");
  12380. this.n2 = (this.getChild("n2"));
  12381. this.n1 = (this.getChild("n1"));
  12382. this.n3 = (this.getChild("n3"));
  12383. this.n4 = (this.getChild("n4"));
  12384. this.n5 = (this.getChild("n5"));
  12385. this.n6 = (this.getChild("n6"));
  12386. }
  12387. }
  12388. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12389. class ui_share2Btn extends fgui.GButton {
  12390. static createInstance() {
  12391. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12392. }
  12393. onConstruct() {
  12394. this.n3 = (this.getChild("n3"));
  12395. }
  12396. }
  12397. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12398. class ui_rodMethodNode extends fgui.GComponent {
  12399. static createInstance() {
  12400. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12401. }
  12402. onConstruct() {
  12403. this.bg = (this.getChild("bg"));
  12404. this.dot = (this.getChild("dot"));
  12405. }
  12406. }
  12407. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12408. class ui_sureBtn extends fgui.GButton {
  12409. static createInstance() {
  12410. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12411. }
  12412. onConstruct() {
  12413. this.n2 = (this.getChild("n2"));
  12414. this.n1 = (this.getChild("n1"));
  12415. }
  12416. }
  12417. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12418. class ui_Component18 extends fgui.GComponent {
  12419. static createInstance() {
  12420. return (fgui.UIPackage.createObject("game", "Component18"));
  12421. }
  12422. onConstruct() {
  12423. this.c1 = this.getController("c1");
  12424. this.nameTxt = (this.getChild("nameTxt"));
  12425. this.headImg = (this.getChild("headImg"));
  12426. this.n24 = (this.getChild("n24"));
  12427. this.skillImg = (this.getChild("skillImg"));
  12428. this.skillTxt = (this.getChild("skillTxt"));
  12429. }
  12430. }
  12431. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12432. class ui_Component45 extends fgui.GComponent {
  12433. static createInstance() {
  12434. return (fgui.UIPackage.createObject("game", "Component45"));
  12435. }
  12436. onConstruct() {
  12437. this.c1 = this.getController("c1");
  12438. this.n40 = (this.getChild("n40"));
  12439. this.n41 = (this.getChild("n41"));
  12440. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12441. this.n42 = (this.getChild("n42"));
  12442. this.awardTxt = (this.getChild("awardTxt"));
  12443. this.n44 = (this.getChild("n44"));
  12444. this.t0 = this.getTransition("t0");
  12445. }
  12446. }
  12447. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12448. class ui_emotionDisplay extends fgui.GButton {
  12449. static createInstance() {
  12450. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12451. }
  12452. onConstruct() {
  12453. this.myIcon = (this.getChild("myIcon"));
  12454. }
  12455. }
  12456. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12457. class ui_Component49 extends fgui.GButton {
  12458. static createInstance() {
  12459. return (fgui.UIPackage.createObject("game", "Component49"));
  12460. }
  12461. onConstruct() {
  12462. this.n69 = (this.getChild("n69"));
  12463. this.n56 = (this.getChild("n56"));
  12464. }
  12465. }
  12466. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12467. class ui_Component50 extends fgui.GButton {
  12468. static createInstance() {
  12469. return (fgui.UIPackage.createObject("game", "Component50"));
  12470. }
  12471. onConstruct() {
  12472. this.n54 = (this.getChild("n54"));
  12473. this.n65 = (this.getChild("n65"));
  12474. }
  12475. }
  12476. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12477. class ui_Component51 extends fgui.GButton {
  12478. static createInstance() {
  12479. return (fgui.UIPackage.createObject("game", "Component51"));
  12480. }
  12481. onConstruct() {
  12482. this.c1 = this.getController("c1");
  12483. this.n51 = (this.getChild("n51"));
  12484. this.n54 = (this.getChild("n54"));
  12485. }
  12486. }
  12487. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12488. class ui_Button5 extends fgui.GButton {
  12489. static createInstance() {
  12490. return (fgui.UIPackage.createObject("game", "Button5"));
  12491. }
  12492. onConstruct() {
  12493. this.c1 = this.getController("c1");
  12494. this.n0 = (this.getChild("n0"));
  12495. this.n2 = (this.getChild("n2"));
  12496. }
  12497. }
  12498. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12499. class ui_Component124 extends fgui.GComponent {
  12500. static createInstance() {
  12501. return (fgui.UIPackage.createObject("game", "Component124"));
  12502. }
  12503. onConstruct() {
  12504. this.n22 = (this.getChild("n22"));
  12505. this.shareNode = (this.getChild("shareNode"));
  12506. }
  12507. }
  12508. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12509. class ui_Component125 extends fgui.GComponent {
  12510. static createInstance() {
  12511. return (fgui.UIPackage.createObject("game", "Component125"));
  12512. }
  12513. onConstruct() {
  12514. this.n29 = (this.getChild("n29"));
  12515. this.coinTxt = (this.getChild("coinTxt"));
  12516. }
  12517. }
  12518. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12519. class ui_Component52 extends fgui.GButton {
  12520. static createInstance() {
  12521. return (fgui.UIPackage.createObject("game", "Component52"));
  12522. }
  12523. onConstruct() {
  12524. this.n35 = (this.getChild("n35"));
  12525. this.n36 = (this.getChild("n36"));
  12526. }
  12527. }
  12528. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12529. class ui_drawBtn extends fgui.GButton {
  12530. static createInstance() {
  12531. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12532. }
  12533. onConstruct() {
  12534. this.c1 = this.getController("c1");
  12535. this.n2 = (this.getChild("n2"));
  12536. this.n1 = (this.getChild("n1"));
  12537. this.n5 = (this.getChild("n5"));
  12538. }
  12539. }
  12540. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12541. class ui_Component43 extends fgui.GButton {
  12542. static createInstance() {
  12543. return (fgui.UIPackage.createObject("game", "Component43"));
  12544. }
  12545. onConstruct() {
  12546. this.n49 = (this.getChild("n49"));
  12547. }
  12548. }
  12549. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12550. class ui_wordsDisplay extends fgui.GComponent {
  12551. static createInstance() {
  12552. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12553. }
  12554. onConstruct() {
  12555. this.txt = (this.getChild("txt"));
  12556. this.n63 = (this.getChild("n63"));
  12557. }
  12558. }
  12559. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12560. class ui_Component3 extends fgui.GComponent {
  12561. static createInstance() {
  12562. return (fgui.UIPackage.createObject("game", "Component3"));
  12563. }
  12564. onConstruct() {
  12565. this.n26 = (this.getChild("n26"));
  12566. this.n24 = (this.getChild("n24"));
  12567. this.nameTxt = (this.getChild("nameTxt"));
  12568. this.headRoot = (this.getChild("headRoot"));
  12569. }
  12570. }
  12571. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12572. class ui_Component4 extends fgui.GComponent {
  12573. static createInstance() {
  12574. return (fgui.UIPackage.createObject("game", "Component4"));
  12575. }
  12576. onConstruct() {
  12577. this.headImg = (this.getChild("headImg"));
  12578. }
  12579. }
  12580. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12581. class ui_Component7 extends fgui.GButton {
  12582. static createInstance() {
  12583. return (fgui.UIPackage.createObject("game", "Component7"));
  12584. }
  12585. onConstruct() {
  12586. this.n17 = (this.getChild("n17"));
  12587. }
  12588. }
  12589. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12590. class ui_Component8 extends fgui.GButton {
  12591. static createInstance() {
  12592. return (fgui.UIPackage.createObject("game", "Component8"));
  12593. }
  12594. onConstruct() {
  12595. this.n19 = (this.getChild("n19"));
  12596. }
  12597. }
  12598. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12599. class ui_Component9 extends fgui.GButton {
  12600. static createInstance() {
  12601. return (fgui.UIPackage.createObject("game", "Component9"));
  12602. }
  12603. onConstruct() {
  12604. this.n18 = (this.getChild("n18"));
  12605. }
  12606. }
  12607. ui_Component9.URL = "ui://isxx5ak7ixm43xs";
  12608. class ui_Component10 extends fgui.GButton {
  12609. static createInstance() {
  12610. return (fgui.UIPackage.createObject("game", "Component10"));
  12611. }
  12612. onConstruct() {
  12613. this.c1 = this.getController("c1");
  12614. this.n40 = (this.getChild("n40"));
  12615. }
  12616. }
  12617. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12618. class ui_Component11 extends fgui.GButton {
  12619. static createInstance() {
  12620. return (fgui.UIPackage.createObject("game", "Component11"));
  12621. }
  12622. onConstruct() {
  12623. this.n34 = (this.getChild("n34"));
  12624. }
  12625. }
  12626. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12627. class ui_Component12 extends fgui.GButton {
  12628. static createInstance() {
  12629. return (fgui.UIPackage.createObject("game", "Component12"));
  12630. }
  12631. onConstruct() {
  12632. this.n35 = (this.getChild("n35"));
  12633. }
  12634. }
  12635. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12636. class ui_Component13 extends fgui.GButton {
  12637. static createInstance() {
  12638. return (fgui.UIPackage.createObject("game", "Component13"));
  12639. }
  12640. onConstruct() {
  12641. this.n27 = (this.getChild("n27"));
  12642. this.n36 = (this.getChild("n36"));
  12643. }
  12644. }
  12645. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12646. class ui_dh_js_tuowei extends fgui.GComponent {
  12647. static createInstance() {
  12648. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12649. }
  12650. onConstruct() {
  12651. this.n19 = (this.getChild("n19"));
  12652. this.n18 = (this.getChild("n18"));
  12653. this.n0 = (this.getChild("n0"));
  12654. this.n3 = (this.getChild("n3"));
  12655. this.n4 = (this.getChild("n4"));
  12656. this.n5 = (this.getChild("n5"));
  12657. this.n6 = (this.getChild("n6"));
  12658. this.n8 = (this.getChild("n8"));
  12659. this.n9 = (this.getChild("n9"));
  12660. this.n10 = (this.getChild("n10"));
  12661. this.n11 = (this.getChild("n11"));
  12662. this.n12 = (this.getChild("n12"));
  12663. this.n13 = (this.getChild("n13"));
  12664. this.n14 = (this.getChild("n14"));
  12665. this.n15 = (this.getChild("n15"));
  12666. this.n20 = (this.getChild("n20"));
  12667. this.t0 = this.getTransition("t0");
  12668. this.t1 = this.getTransition("t1");
  12669. }
  12670. }
  12671. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12672. class ui_dh_js_tw_g extends fgui.GComponent {
  12673. static createInstance() {
  12674. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12675. }
  12676. onConstruct() {
  12677. this.n0 = (this.getChild("n0"));
  12678. this.n1 = (this.getChild("n1"));
  12679. this.t0 = this.getTransition("t0");
  12680. }
  12681. }
  12682. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12683. class ui_dh_js_xingxing extends fgui.GComponent {
  12684. static createInstance() {
  12685. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12686. }
  12687. onConstruct() {
  12688. this.n1 = (this.getChild("n1"));
  12689. this.n2 = (this.getChild("n2"));
  12690. this.n3 = (this.getChild("n3"));
  12691. this.n4 = (this.getChild("n4"));
  12692. this.n0 = (this.getChild("n0"));
  12693. this.t2 = this.getTransition("t2");
  12694. this.t1 = this.getTransition("t1");
  12695. }
  12696. }
  12697. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12698. class ui_dh_zy_jiazai extends fgui.GComponent {
  12699. static createInstance() {
  12700. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12701. }
  12702. onConstruct() {
  12703. this.c1 = this.getController("c1");
  12704. this.n0 = (this.getChild("n0"));
  12705. this.n1 = (this.getChild("n1"));
  12706. this.n2 = (this.getChild("n2"));
  12707. this.n4 = (this.getChild("n4"));
  12708. this.n5 = (this.getChild("n5"));
  12709. this.n6 = (this.getChild("n6"));
  12710. this.n8 = (this.getChild("n8"));
  12711. this.n7 = (this.getChild("n7"));
  12712. this.t0 = this.getTransition("t0");
  12713. }
  12714. }
  12715. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12716. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12717. static createInstance() {
  12718. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12719. }
  12720. onConstruct() {
  12721. this.c1 = this.getController("c1");
  12722. this.n3 = (this.getChild("n3"));
  12723. this.n5 = (this.getChild("n5"));
  12724. this.n4 = (this.getChild("n4"));
  12725. this.n0 = (this.getChild("n0"));
  12726. this.n1 = (this.getChild("n1"));
  12727. this.n2 = (this.getChild("n2"));
  12728. }
  12729. }
  12730. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12731. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12732. static createInstance() {
  12733. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12734. }
  12735. onConstruct() {
  12736. this.n19 = (this.getChild("n19"));
  12737. this.n21 = (this.getChild("n21"));
  12738. this.n0 = (this.getChild("n0"));
  12739. this.n3 = (this.getChild("n3"));
  12740. this.n4 = (this.getChild("n4"));
  12741. this.n5 = (this.getChild("n5"));
  12742. this.n6 = (this.getChild("n6"));
  12743. this.n8 = (this.getChild("n8"));
  12744. this.n9 = (this.getChild("n9"));
  12745. this.n10 = (this.getChild("n10"));
  12746. this.n11 = (this.getChild("n11"));
  12747. this.n12 = (this.getChild("n12"));
  12748. this.n13 = (this.getChild("n13"));
  12749. this.n14 = (this.getChild("n14"));
  12750. this.n15 = (this.getChild("n15"));
  12751. this.n23 = (this.getChild("n23"));
  12752. this.t0 = this.getTransition("t0");
  12753. this.t1 = this.getTransition("t1");
  12754. }
  12755. }
  12756. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12757. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12758. static createInstance() {
  12759. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12760. }
  12761. onConstruct() {
  12762. this.n1 = (this.getChild("n1"));
  12763. this.n2 = (this.getChild("n2"));
  12764. this.t0 = this.getTransition("t0");
  12765. }
  12766. }
  12767. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12768. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12769. static createInstance() {
  12770. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12771. }
  12772. onConstruct() {
  12773. this.n4 = (this.getChild("n4"));
  12774. this.n2 = (this.getChild("n2"));
  12775. this.n3 = (this.getChild("n3"));
  12776. this.idle = this.getTransition("idle");
  12777. this.attack = this.getTransition("attack");
  12778. }
  12779. }
  12780. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12781. class ui_special extends fgui.GComponent {
  12782. static createInstance() {
  12783. return (fgui.UIPackage.createObject("game", "special"));
  12784. }
  12785. onConstruct() {
  12786. this.n18 = (this.getChild("n18"));
  12787. this.n19 = (this.getChild("n19"));
  12788. this.n20 = (this.getChild("n20"));
  12789. this.n21 = (this.getChild("n21"));
  12790. this.n22 = (this.getChild("n22"));
  12791. this.levelTxt = (this.getChild("levelTxt"));
  12792. this.n24 = (this.getChild("n24"));
  12793. this.n25 = (this.getChild("n25"));
  12794. this.t0 = this.getTransition("t0");
  12795. }
  12796. }
  12797. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12798. class ui_Component145 extends fgui.GComponent {
  12799. static createInstance() {
  12800. return (fgui.UIPackage.createObject("game", "Component145"));
  12801. }
  12802. onConstruct() {
  12803. this.guanyuNode = (this.getChild("guanyuNode"));
  12804. }
  12805. }
  12806. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12807. class ui_longBtn extends fgui.GButton {
  12808. static createInstance() {
  12809. return (fgui.UIPackage.createObject("game", "longBtn"));
  12810. }
  12811. onConstruct() {
  12812. this.c1 = this.getController("c1");
  12813. this.n2 = (this.getChild("n2"));
  12814. this.n1 = (this.getChild("n1"));
  12815. this.n4 = (this.getChild("n4"));
  12816. }
  12817. }
  12818. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12819. class ui_Component146 extends fgui.GComponent {
  12820. static createInstance() {
  12821. return (fgui.UIPackage.createObject("game", "Component146"));
  12822. }
  12823. onConstruct() {
  12824. this.n89 = (this.getChild("n89"));
  12825. this.n90 = (this.getChild("n90"));
  12826. this.guideBtn = (this.getChild("guideBtn"));
  12827. }
  12828. }
  12829. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12830. class ui_Component146_11 extends fgui.GComponent {
  12831. static createInstance() {
  12832. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12833. }
  12834. onConstruct() {
  12835. this.n89 = (this.getChild("n89"));
  12836. this.n90 = (this.getChild("n90"));
  12837. this.guideBtn = (this.getChild("guideBtn"));
  12838. }
  12839. }
  12840. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12841. class ui_Component111_1 extends fgui.GComponent {
  12842. static createInstance() {
  12843. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12844. }
  12845. onConstruct() {
  12846. this.n68 = (this.getChild("n68"));
  12847. this.myMask = (this.getChild("myMask"));
  12848. }
  12849. }
  12850. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12851. class ui_Component64_1 extends fgui.GComponent {
  12852. static createInstance() {
  12853. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12854. }
  12855. onConstruct() {
  12856. this.n57 = (this.getChild("n57"));
  12857. this.n54 = (this.getChild("n54"));
  12858. this.n55 = (this.getChild("n55"));
  12859. this.n56 = (this.getChild("n56"));
  12860. this.t1 = this.getTransition("t1");
  12861. }
  12862. }
  12863. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12864. class ui_ModeSelection_com123 extends fgui.GComponent {
  12865. static createInstance() {
  12866. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12867. }
  12868. onConstruct() {
  12869. this.type1 = (this.getChild("type1"));
  12870. this.type2 = (this.getChild("type2"));
  12871. this.type3 = (this.getChild("type3"));
  12872. this.n38 = (this.getChild("n38"));
  12873. this.t0 = this.getTransition("t0");
  12874. }
  12875. }
  12876. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12877. class ui_Component132_2 extends fgui.GComponent {
  12878. static createInstance() {
  12879. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12880. }
  12881. onConstruct() {
  12882. this.n25 = (this.getChild("n25"));
  12883. this.n26 = (this.getChild("n26"));
  12884. this.n27 = (this.getChild("n27"));
  12885. this.t0 = this.getTransition("t0");
  12886. }
  12887. }
  12888. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12889. class ui_UIPower$1 extends fgui.GComponent {
  12890. static createInstance() {
  12891. return (fgui.UIPackage.createObject("game", "UIPower"));
  12892. }
  12893. onConstruct() {
  12894. this.n11 = (this.getChild("n11"));
  12895. this.myNode = (this.getChild("myNode"));
  12896. this.t0 = this.getTransition("t0");
  12897. }
  12898. }
  12899. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12900. class ui_Component133 extends fgui.GComponent {
  12901. static createInstance() {
  12902. return (fgui.UIPackage.createObject("game", "Component133"));
  12903. }
  12904. onConstruct() {
  12905. this.n29 = (this.getChild("n29"));
  12906. this.n30 = (this.getChild("n30"));
  12907. }
  12908. }
  12909. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12910. class ui_Component134 extends fgui.GComponent {
  12911. static createInstance() {
  12912. return (fgui.UIPackage.createObject("game", "Component134"));
  12913. }
  12914. onConstruct() {
  12915. this.n30 = (this.getChild("n30"));
  12916. this.n31 = (this.getChild("n31"));
  12917. this.t0 = this.getTransition("t0");
  12918. }
  12919. }
  12920. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12921. class ui_Component135 extends fgui.GComponent {
  12922. static createInstance() {
  12923. return (fgui.UIPackage.createObject("game", "Component135"));
  12924. }
  12925. onConstruct() {
  12926. this.n30 = (this.getChild("n30"));
  12927. this.t0 = this.getTransition("t0");
  12928. }
  12929. }
  12930. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12931. class ui_Component137 extends fgui.GComponent {
  12932. static createInstance() {
  12933. return (fgui.UIPackage.createObject("game", "Component137"));
  12934. }
  12935. onConstruct() {
  12936. this.n28 = (this.getChild("n28"));
  12937. this.n29 = (this.getChild("n29"));
  12938. this.n30 = (this.getChild("n30"));
  12939. this.n32 = (this.getChild("n32"));
  12940. }
  12941. }
  12942. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12943. class ui_dh_zuanshi extends fgui.GButton {
  12944. static createInstance() {
  12945. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12946. }
  12947. onConstruct() {
  12948. this.n1 = (this.getChild("n1"));
  12949. this.n2 = (this.getChild("n2"));
  12950. this.n0 = (this.getChild("n0"));
  12951. this.n3 = (this.getChild("n3"));
  12952. this.n4 = (this.getChild("n4"));
  12953. }
  12954. }
  12955. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12956. class ui_Component138 extends fgui.GComponent {
  12957. static createInstance() {
  12958. return (fgui.UIPackage.createObject("game", "Component138"));
  12959. }
  12960. onConstruct() {
  12961. this.n1 = (this.getChild("n1"));
  12962. this.n2 = (this.getChild("n2"));
  12963. this.t0 = this.getTransition("t0");
  12964. }
  12965. }
  12966. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12967. class ui_Component139 extends fgui.GComponent {
  12968. static createInstance() {
  12969. return (fgui.UIPackage.createObject("game", "Component139"));
  12970. }
  12971. onConstruct() {
  12972. this.n0 = (this.getChild("n0"));
  12973. this.t0 = this.getTransition("t0");
  12974. }
  12975. }
  12976. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12977. class ui_Component140 extends fgui.GComponent {
  12978. static createInstance() {
  12979. return (fgui.UIPackage.createObject("game", "Component140"));
  12980. }
  12981. onConstruct() {
  12982. this.n2 = (this.getChild("n2"));
  12983. this.n3 = (this.getChild("n3"));
  12984. this.t0 = this.getTransition("t0");
  12985. }
  12986. }
  12987. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12988. class ui_Component141 extends fgui.GComponent {
  12989. static createInstance() {
  12990. return (fgui.UIPackage.createObject("game", "Component141"));
  12991. }
  12992. onConstruct() {
  12993. this.n0 = (this.getChild("n0"));
  12994. this.t0 = this.getTransition("t0");
  12995. }
  12996. }
  12997. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  12998. class ui_powerNode extends fgui.GProgressBar {
  12999. static createInstance() {
  13000. return (fgui.UIPackage.createObject("game", "powerNode"));
  13001. }
  13002. onConstruct() {
  13003. this.n2 = (this.getChild("n2"));
  13004. this.bar_v = (this.getChild("bar_v"));
  13005. this.showImg = (this.getChild("showImg"));
  13006. this.n12 = (this.getChild("n12"));
  13007. }
  13008. }
  13009. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13010. class ui_dh_jingbi1 extends fgui.GComponent {
  13011. static createInstance() {
  13012. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13013. }
  13014. onConstruct() {
  13015. this.n0 = (this.getChild("n0"));
  13016. this.n1 = (this.getChild("n1"));
  13017. this.n2 = (this.getChild("n2"));
  13018. this.n3 = (this.getChild("n3"));
  13019. this.n4 = (this.getChild("n4"));
  13020. this.n5 = (this.getChild("n5"));
  13021. this.n6 = (this.getChild("n6"));
  13022. this.n8 = (this.getChild("n8"));
  13023. this.t0 = this.getTransition("t0");
  13024. }
  13025. }
  13026. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13027. class ui_Component94 extends fgui.GButton {
  13028. static createInstance() {
  13029. return (fgui.UIPackage.createObject("game", "Component94"));
  13030. }
  13031. onConstruct() {
  13032. this.n77 = (this.getChild("n77"));
  13033. }
  13034. }
  13035. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13036. class ui_Component95 extends fgui.GButton {
  13037. static createInstance() {
  13038. return (fgui.UIPackage.createObject("game", "Component95"));
  13039. }
  13040. onConstruct() {
  13041. this.n77 = (this.getChild("n77"));
  13042. }
  13043. }
  13044. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13045. class ui_Component126 extends fgui.GComponent {
  13046. static createInstance() {
  13047. return (fgui.UIPackage.createObject("game", "Component126"));
  13048. }
  13049. onConstruct() {
  13050. this.c1 = this.getController("c1");
  13051. this.normalBtn = (this.getChild("normalBtn"));
  13052. this.tripleBtn = (this.getChild("tripleBtn"));
  13053. }
  13054. }
  13055. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13056. class ui_Component60 extends fgui.GComponent {
  13057. static createInstance() {
  13058. return (fgui.UIPackage.createObject("game", "Component60"));
  13059. }
  13060. onConstruct() {
  13061. this.c1 = this.getController("c1");
  13062. this.n48 = (this.getChild("n48"));
  13063. this.womanTxt = (this.getChild("womanTxt"));
  13064. this.t0 = this.getTransition("t0");
  13065. }
  13066. }
  13067. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13068. class ui_Component98_3 extends fgui.GButton {
  13069. static createInstance() {
  13070. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13071. }
  13072. onConstruct() {
  13073. this.c1 = this.getController("c1");
  13074. this.n8 = (this.getChild("n8"));
  13075. this.n41 = (this.getChild("n41"));
  13076. this.n40 = (this.getChild("n40"));
  13077. }
  13078. }
  13079. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13080. class ui_ModeSelection_com1 extends fgui.GButton {
  13081. static createInstance() {
  13082. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13083. }
  13084. onConstruct() {
  13085. this.n34 = (this.getChild("n34"));
  13086. this.n36 = (this.getChild("n36"));
  13087. this.n22 = (this.getChild("n22"));
  13088. this.n20 = (this.getChild("n20"));
  13089. this.n23 = (this.getChild("n23"));
  13090. this.n24 = (this.getChild("n24"));
  13091. this.n26 = (this.getChild("n26"));
  13092. this.n33 = (this.getChild("n33"));
  13093. this.coinImg = (this.getChild("coinImg"));
  13094. this.need = (this.getChild("need"));
  13095. this.n35 = (this.getChild("n35"));
  13096. this.n29 = (this.getChild("n29"));
  13097. this.tipsTxt = (this.getChild("tipsTxt"));
  13098. this.n30 = (this.getChild("n30"));
  13099. this.peopleTxt = (this.getChild("peopleTxt"));
  13100. this.t0 = this.getTransition("t0");
  13101. }
  13102. }
  13103. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13104. class ui_ModeSelection_com2 extends fgui.GButton {
  13105. static createInstance() {
  13106. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13107. }
  13108. onConstruct() {
  13109. this.n36 = (this.getChild("n36"));
  13110. this.n34 = (this.getChild("n34"));
  13111. this.n22 = (this.getChild("n22"));
  13112. this.n20 = (this.getChild("n20"));
  13113. this.n23 = (this.getChild("n23"));
  13114. this.n24 = (this.getChild("n24"));
  13115. this.n26 = (this.getChild("n26"));
  13116. this.n33 = (this.getChild("n33"));
  13117. this.coinImg = (this.getChild("coinImg"));
  13118. this.need = (this.getChild("need"));
  13119. this.n35 = (this.getChild("n35"));
  13120. this.n29 = (this.getChild("n29"));
  13121. this.tipsTxt = (this.getChild("tipsTxt"));
  13122. this.n30 = (this.getChild("n30"));
  13123. this.peopleTxt = (this.getChild("peopleTxt"));
  13124. this.t0 = this.getTransition("t0");
  13125. }
  13126. }
  13127. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13128. class ui_ModeSelection_com3 extends fgui.GButton {
  13129. static createInstance() {
  13130. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13131. }
  13132. onConstruct() {
  13133. this.n34 = (this.getChild("n34"));
  13134. this.n36 = (this.getChild("n36"));
  13135. this.n22 = (this.getChild("n22"));
  13136. this.n20 = (this.getChild("n20"));
  13137. this.n23 = (this.getChild("n23"));
  13138. this.n24 = (this.getChild("n24"));
  13139. this.n26 = (this.getChild("n26"));
  13140. this.n33 = (this.getChild("n33"));
  13141. this.coinImg = (this.getChild("coinImg"));
  13142. this.need = (this.getChild("need"));
  13143. this.n35 = (this.getChild("n35"));
  13144. this.n29 = (this.getChild("n29"));
  13145. this.tipsTxt = (this.getChild("tipsTxt"));
  13146. this.n30 = (this.getChild("n30"));
  13147. this.peopleTxt = (this.getChild("peopleTxt"));
  13148. this.t0 = this.getTransition("t0");
  13149. }
  13150. }
  13151. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13152. class ui_Invitation_com1 extends fgui.GComponent {
  13153. static createInstance() {
  13154. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13155. }
  13156. onConstruct() {
  13157. this.n14 = (this.getChild("n14"));
  13158. this.n13 = (this.getChild("n13"));
  13159. this.n3 = (this.getChild("n3"));
  13160. this.n1 = (this.getChild("n1"));
  13161. this.n6 = (this.getChild("n6"));
  13162. this.n7 = (this.getChild("n7"));
  13163. this.enterBtn = (this.getChild("enterBtn"));
  13164. this.n11 = (this.getChild("n11"));
  13165. this.n12 = (this.getChild("n12"));
  13166. this.n15 = (this.getChild("n15"));
  13167. this.t0 = this.getTransition("t0");
  13168. this.t1 = this.getTransition("t1");
  13169. }
  13170. }
  13171. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13172. class ui_Component87_1 extends fgui.GComponent {
  13173. static createInstance() {
  13174. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13175. }
  13176. onConstruct() {
  13177. this.n74 = (this.getChild("n74"));
  13178. this.n73 = (this.getChild("n73"));
  13179. this.ballTxt = (this.getChild("ballTxt"));
  13180. this.n76 = (this.getChild("n76"));
  13181. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13182. this.levelTxt = (this.getChild("levelTxt"));
  13183. this.n87 = (this.getChild("n87"));
  13184. this.n84 = (this.getChild("n84"));
  13185. this.hpTxt = (this.getChild("hpTxt"));
  13186. this.n89 = (this.getChild("n89"));
  13187. this.tipsTxt = (this.getChild("tipsTxt"));
  13188. }
  13189. }
  13190. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13191. class ui_sqg1 extends fgui.GComponent {
  13192. static createInstance() {
  13193. return (fgui.UIPackage.createObject("game", "sqg1"));
  13194. }
  13195. onConstruct() {
  13196. this.n1 = (this.getChild("n1"));
  13197. this.n0 = (this.getChild("n0"));
  13198. }
  13199. }
  13200. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13201. class ui_sqg2 extends fgui.GComponent {
  13202. static createInstance() {
  13203. return (fgui.UIPackage.createObject("game", "sqg2"));
  13204. }
  13205. onConstruct() {
  13206. this.n1 = (this.getChild("n1"));
  13207. this.n0 = (this.getChild("n0"));
  13208. }
  13209. }
  13210. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13211. class ui_sqg3 extends fgui.GComponent {
  13212. static createInstance() {
  13213. return (fgui.UIPackage.createObject("game", "sqg3"));
  13214. }
  13215. onConstruct() {
  13216. this.n1 = (this.getChild("n1"));
  13217. this.n0 = (this.getChild("n0"));
  13218. }
  13219. }
  13220. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13221. class ui_sqg4 extends fgui.GComponent {
  13222. static createInstance() {
  13223. return (fgui.UIPackage.createObject("game", "sqg4"));
  13224. }
  13225. onConstruct() {
  13226. this.n1 = (this.getChild("n1"));
  13227. this.n0 = (this.getChild("n0"));
  13228. }
  13229. }
  13230. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13231. class ui_Component36 extends fgui.GButton {
  13232. static createInstance() {
  13233. return (fgui.UIPackage.createObject("game", "Component36"));
  13234. }
  13235. onConstruct() {
  13236. this.c1 = this.getController("c1");
  13237. this.n53 = (this.getChild("n53"));
  13238. this.n56 = (this.getChild("n56"));
  13239. }
  13240. }
  13241. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13242. class ui_Component37 extends fgui.GButton {
  13243. static createInstance() {
  13244. return (fgui.UIPackage.createObject("game", "Component37"));
  13245. }
  13246. onConstruct() {
  13247. this.c1 = this.getController("c1");
  13248. this.n52 = (this.getChild("n52"));
  13249. this.n54 = (this.getChild("n54"));
  13250. }
  13251. }
  13252. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13253. class ui_UISetting extends fgui.GComponent {
  13254. static createInstance() {
  13255. return (fgui.UIPackage.createObject("game", "UISetting"));
  13256. }
  13257. onConstruct() {
  13258. this.c1 = this.getController("c1");
  13259. this.n4 = (this.getChild("n4"));
  13260. this.soundBtn = (this.getChild("soundBtn"));
  13261. this.shakeBtn = (this.getChild("shakeBtn"));
  13262. this.clickNode = (this.getChild("clickNode"));
  13263. this.xyBtn = (this.getChild("xyBtn"));
  13264. }
  13265. }
  13266. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13267. class ui_Component39 extends fgui.GComponent {
  13268. static createInstance() {
  13269. return (fgui.UIPackage.createObject("game", "Component39"));
  13270. }
  13271. onConstruct() {
  13272. this.n5 = (this.getChild("n5"));
  13273. this.n6 = (this.getChild("n6"));
  13274. this.n7 = (this.getChild("n7"));
  13275. this.t0 = this.getTransition("t0");
  13276. }
  13277. }
  13278. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13279. class ui_Component40 extends fgui.GButton {
  13280. static createInstance() {
  13281. return (fgui.UIPackage.createObject("game", "Component40"));
  13282. }
  13283. onConstruct() {
  13284. this.n46 = (this.getChild("n46"));
  13285. this.n47 = (this.getChild("n47"));
  13286. }
  13287. }
  13288. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13289. class ui_Component41 extends fgui.GComponent {
  13290. static createInstance() {
  13291. return (fgui.UIPackage.createObject("game", "Component41"));
  13292. }
  13293. onConstruct() {
  13294. this.c1 = this.getController("c1");
  13295. this.n0 = (this.getChild("n0"));
  13296. this.titleTxt = (this.getChild("titleTxt"));
  13297. this.n2 = (this.getChild("n2"));
  13298. this.msgTips = (this.getChild("msgTips"));
  13299. this.numTxt = (this.getChild("numTxt"));
  13300. this.n18 = (this.getChild("n18"));
  13301. this.cancelBtn = (this.getChild("cancelBtn"));
  13302. this.videoBtn = (this.getChild("videoBtn"));
  13303. this.n10 = (this.getChild("n10"));
  13304. }
  13305. }
  13306. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13307. class ui_Component42 extends fgui.GComponent {
  13308. static createInstance() {
  13309. return (fgui.UIPackage.createObject("game", "Component42"));
  13310. }
  13311. onConstruct() {
  13312. this.c1 = this.getController("c1");
  13313. this.n1 = (this.getChild("n1"));
  13314. this.n2 = (this.getChild("n2"));
  13315. this.n3 = (this.getChild("n3"));
  13316. this.tipsTxt = (this.getChild("tipsTxt"));
  13317. this.cancelBtn = (this.getChild("cancelBtn"));
  13318. this.sureBtn = (this.getChild("sureBtn"));
  13319. this.n11 = (this.getChild("n11"));
  13320. this.n13 = (this.getChild("n13"));
  13321. this.n14 = (this.getChild("n14"));
  13322. this.womanTxt = (this.getChild("womanTxt"));
  13323. this.t0 = this.getTransition("t0");
  13324. }
  13325. }
  13326. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13327. class ui_dh_js_shengli extends fgui.GComponent {
  13328. static createInstance() {
  13329. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13330. }
  13331. onConstruct() {
  13332. this.n3 = (this.getChild("n3"));
  13333. this.n4 = (this.getChild("n4"));
  13334. this.n1 = (this.getChild("n1"));
  13335. this.n2 = (this.getChild("n2"));
  13336. this.n5 = (this.getChild("n5"));
  13337. this.n6 = (this.getChild("n6"));
  13338. this.n7 = (this.getChild("n7"));
  13339. this.n8 = (this.getChild("n8"));
  13340. this.attack = this.getTransition("attack");
  13341. this.idle = this.getTransition("idle");
  13342. }
  13343. }
  13344. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13345. class ui_dh_js_shengli_g extends fgui.GComponent {
  13346. static createInstance() {
  13347. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13348. }
  13349. onConstruct() {
  13350. this.n3 = (this.getChild("n3"));
  13351. this.n1 = (this.getChild("n1"));
  13352. this.t0 = this.getTransition("t0");
  13353. }
  13354. }
  13355. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13356. class ui_dh_js_shibai extends fgui.GComponent {
  13357. static createInstance() {
  13358. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13359. }
  13360. onConstruct() {
  13361. this.n0 = (this.getChild("n0"));
  13362. this.n1 = (this.getChild("n1"));
  13363. this.n2 = (this.getChild("n2"));
  13364. this.n3 = (this.getChild("n3"));
  13365. this.idle = this.getTransition("idle");
  13366. this.attack = this.getTransition("attack");
  13367. }
  13368. }
  13369. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13370. class ui_dh_zy_ganfa extends fgui.GButton {
  13371. static createInstance() {
  13372. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13373. }
  13374. onConstruct() {
  13375. this.n0 = (this.getChild("n0"));
  13376. }
  13377. }
  13378. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13379. class ui_dh_zy_sc_guang extends fgui.GButton {
  13380. static createInstance() {
  13381. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13382. }
  13383. onConstruct() {
  13384. this.n0 = (this.getChild("n0"));
  13385. this.n2 = (this.getChild("n2"));
  13386. }
  13387. }
  13388. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13389. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13390. static createInstance() {
  13391. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13392. }
  13393. onConstruct() {
  13394. this.n0 = (this.getChild("n0"));
  13395. this.n3 = (this.getChild("n3"));
  13396. this.t0 = this.getTransition("t0");
  13397. }
  13398. }
  13399. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13400. class ui_dh_zy_wanfa extends fgui.GButton {
  13401. static createInstance() {
  13402. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13403. }
  13404. onConstruct() {
  13405. this.n0 = (this.getChild("n0"));
  13406. }
  13407. }
  13408. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13409. class ui_Component53_1 extends fgui.GComponent {
  13410. static createInstance() {
  13411. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13412. }
  13413. onConstruct() {
  13414. this.n0 = (this.getChild("n0"));
  13415. this.n1 = (this.getChild("n1"));
  13416. this.n2 = (this.getChild("n2"));
  13417. this.n3 = (this.getChild("n3"));
  13418. this.n4 = (this.getChild("n4"));
  13419. this.n5 = (this.getChild("n5"));
  13420. this.n6 = (this.getChild("n6"));
  13421. this.n7 = (this.getChild("n7"));
  13422. this.n8 = (this.getChild("n8"));
  13423. this.n9 = (this.getChild("n9"));
  13424. this.n10 = (this.getChild("n10"));
  13425. this.n11 = (this.getChild("n11"));
  13426. this.n12 = (this.getChild("n12"));
  13427. this.n13 = (this.getChild("n13"));
  13428. this.n14 = (this.getChild("n14"));
  13429. this.n15 = (this.getChild("n15"));
  13430. this.n16 = (this.getChild("n16"));
  13431. this.n19 = (this.getChild("n19"));
  13432. this.n20 = (this.getChild("n20"));
  13433. this.n21 = (this.getChild("n21"));
  13434. this.n22 = (this.getChild("n22"));
  13435. this.n23 = (this.getChild("n23"));
  13436. this.n24 = (this.getChild("n24"));
  13437. this.n25 = (this.getChild("n25"));
  13438. this.n26 = (this.getChild("n26"));
  13439. this.n27 = (this.getChild("n27"));
  13440. this.n28 = (this.getChild("n28"));
  13441. this.n29 = (this.getChild("n29"));
  13442. this.n30 = (this.getChild("n30"));
  13443. this.n31 = (this.getChild("n31"));
  13444. this.n32 = (this.getChild("n32"));
  13445. this.n33 = (this.getChild("n33"));
  13446. this.n34 = (this.getChild("n34"));
  13447. this.n35 = (this.getChild("n35"));
  13448. this.t0 = this.getTransition("t0");
  13449. }
  13450. }
  13451. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13452. class ui_Component30 extends fgui.GComponent {
  13453. static createInstance() {
  13454. return (fgui.UIPackage.createObject("game", "Component30"));
  13455. }
  13456. onConstruct() {
  13457. this.c1 = this.getController("c1");
  13458. this.n46 = (this.getChild("n46"));
  13459. this.n47 = (this.getChild("n47"));
  13460. this.numTxt = (this.getChild("numTxt"));
  13461. this.n50 = (this.getChild("n50"));
  13462. this.n53 = (this.getChild("n53"));
  13463. this.n54 = (this.getChild("n54"));
  13464. this.n55 = (this.getChild("n55"));
  13465. this.n56 = (this.getChild("n56"));
  13466. }
  13467. }
  13468. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13469. class ui_Component30_1 extends fgui.GComponent {
  13470. static createInstance() {
  13471. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13472. }
  13473. onConstruct() {
  13474. this.c1 = this.getController("c1");
  13475. this.n46 = (this.getChild("n46"));
  13476. this.n47 = (this.getChild("n47"));
  13477. this.numTxt = (this.getChild("numTxt"));
  13478. this.n50 = (this.getChild("n50"));
  13479. this.n51 = (this.getChild("n51"));
  13480. this.n52 = (this.getChild("n52"));
  13481. this.n53 = (this.getChild("n53"));
  13482. this.n54 = (this.getChild("n54"));
  13483. }
  13484. }
  13485. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13486. class ui_Component31 extends fgui.GComponent {
  13487. static createInstance() {
  13488. return (fgui.UIPackage.createObject("game", "Component31"));
  13489. }
  13490. onConstruct() {
  13491. this.n55 = (this.getChild("n55"));
  13492. this.n54 = (this.getChild("n54"));
  13493. this.conditionTxt = (this.getChild("conditionTxt"));
  13494. this.n57 = (this.getChild("n57"));
  13495. this.t0 = this.getTransition("t0");
  13496. }
  13497. }
  13498. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13499. class ui_Component32 extends fgui.GComponent {
  13500. static createInstance() {
  13501. return (fgui.UIPackage.createObject("game", "Component32"));
  13502. }
  13503. onConstruct() {
  13504. this.n5 = (this.getChild("n5"));
  13505. this.n6 = (this.getChild("n6"));
  13506. this.n7 = (this.getChild("n7"));
  13507. this.t0 = this.getTransition("t0");
  13508. }
  13509. }
  13510. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13511. class ui_AwardItem extends fgui.GComponent {
  13512. static createInstance() {
  13513. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13514. }
  13515. onConstruct() {
  13516. this.n9 = (this.getChild("n9"));
  13517. this.myIcon = (this.getChild("myIcon"));
  13518. this.numTxt = (this.getChild("numTxt"));
  13519. this.nameTxt = (this.getChild("nameTxt"));
  13520. this.n16 = (this.getChild("n16"));
  13521. this.n17 = (this.getChild("n17"));
  13522. }
  13523. }
  13524. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13525. class ui_ranking_com1 extends fgui.GButton {
  13526. static createInstance() {
  13527. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13528. }
  13529. onConstruct() {
  13530. this.c1 = this.getController("c1");
  13531. this.n49 = (this.getChild("n49"));
  13532. this.n18 = (this.getChild("n18"));
  13533. this.n46 = (this.getChild("n46"));
  13534. this.n48 = (this.getChild("n48"));
  13535. this.n50 = (this.getChild("n50"));
  13536. }
  13537. }
  13538. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13539. class ui_ranking_com2 extends fgui.GButton {
  13540. static createInstance() {
  13541. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13542. }
  13543. onConstruct() {
  13544. this.c1 = this.getController("c1");
  13545. this.n49 = (this.getChild("n49"));
  13546. this.n18 = (this.getChild("n18"));
  13547. this.n46 = (this.getChild("n46"));
  13548. this.n48 = (this.getChild("n48"));
  13549. this.n50 = (this.getChild("n50"));
  13550. }
  13551. }
  13552. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13553. class ui_ranking_com3 extends fgui.GComponent {
  13554. static createInstance() {
  13555. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13556. }
  13557. onConstruct() {
  13558. this.n17 = (this.getChild("n17"));
  13559. this.myIcon = (this.getChild("myIcon"));
  13560. }
  13561. }
  13562. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13563. class ui_ranking_com4 extends fgui.GComponent {
  13564. static createInstance() {
  13565. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13566. }
  13567. onConstruct() {
  13568. this.n16 = (this.getChild("n16"));
  13569. this.head = (this.getChild("head"));
  13570. }
  13571. }
  13572. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13573. class ui_ranking_com5 extends fgui.GComponent {
  13574. static createInstance() {
  13575. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13576. }
  13577. onConstruct() {
  13578. this.c1 = this.getController("c1");
  13579. this.c2 = this.getController("c2");
  13580. this.n2 = (this.getChild("n2"));
  13581. this.n3 = (this.getChild("n3"));
  13582. this.levelBtn = (this.getChild("levelBtn"));
  13583. this.starBtn = (this.getChild("starBtn"));
  13584. this.n23 = (this.getChild("n23"));
  13585. this.n24 = (this.getChild("n24"));
  13586. this.n25 = (this.getChild("n25"));
  13587. this.myList = (this.getChild("myList"));
  13588. this.selfNode = (this.getChild("selfNode"));
  13589. this.n9 = (this.getChild("n9"));
  13590. this.n12 = (this.getChild("n12"));
  13591. this.n13 = (this.getChild("n13"));
  13592. this.n14 = (this.getChild("n14"));
  13593. this.n39 = (this.getChild("n39"));
  13594. this.n41 = (this.getChild("n41"));
  13595. this.n42 = (this.getChild("n42"));
  13596. this.n45 = (this.getChild("n45"));
  13597. this.changeBtn = (this.getChild("changeBtn"));
  13598. this.closeBtn = (this.getChild("closeBtn"));
  13599. this.t0 = this.getTransition("t0");
  13600. }
  13601. }
  13602. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13603. class ui_RankItem extends fgui.GComponent {
  13604. static createInstance() {
  13605. return (fgui.UIPackage.createObject("game", "RankItem"));
  13606. }
  13607. onConstruct() {
  13608. this.n10 = (this.getChild("n10"));
  13609. this.n11 = (this.getChild("n11"));
  13610. this.rankTxt = (this.getChild("rankTxt"));
  13611. this.headNode = (this.getChild("headNode"));
  13612. this.nameTxt = (this.getChild("nameTxt"));
  13613. this.n19 = (this.getChild("n19"));
  13614. this.valueTxt = (this.getChild("valueTxt"));
  13615. this.img1 = (this.getChild("img1"));
  13616. this.img2 = (this.getChild("img2"));
  13617. this.img3 = (this.getChild("img3"));
  13618. }
  13619. }
  13620. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13621. class ui_ranking_com9 extends fgui.GComponent {
  13622. static createInstance() {
  13623. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13624. }
  13625. onConstruct() {
  13626. this.c1 = this.getController("c1");
  13627. this.n27 = (this.getChild("n27"));
  13628. this.n28 = (this.getChild("n28"));
  13629. this.headNode = (this.getChild("headNode"));
  13630. this.rankTxt = (this.getChild("rankTxt"));
  13631. this.nameTxt = (this.getChild("nameTxt"));
  13632. this.n34 = (this.getChild("n34"));
  13633. this.valueTxt = (this.getChild("valueTxt"));
  13634. this.n36 = (this.getChild("n36"));
  13635. this.n37 = (this.getChild("n37"));
  13636. this.n38 = (this.getChild("n38"));
  13637. this.n39 = (this.getChild("n39"));
  13638. this.n40 = (this.getChild("n40"));
  13639. }
  13640. }
  13641. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13642. class ui_ranking_com10 extends fgui.GComponent {
  13643. static createInstance() {
  13644. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13645. }
  13646. onConstruct() {
  13647. this.n23 = (this.getChild("n23"));
  13648. this.n24 = (this.getChild("n24"));
  13649. }
  13650. }
  13651. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13652. class ui_ranking_com11 extends fgui.GComponent {
  13653. static createInstance() {
  13654. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13655. }
  13656. onConstruct() {
  13657. this.n24 = (this.getChild("n24"));
  13658. this.n25 = (this.getChild("n25"));
  13659. this.t0 = this.getTransition("t0");
  13660. }
  13661. }
  13662. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13663. class ui_ranking_com13 extends fgui.GButton {
  13664. static createInstance() {
  13665. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13666. }
  13667. onConstruct() {
  13668. this.c1 = this.getController("c1");
  13669. this.n44 = (this.getChild("n44"));
  13670. this.n45 = (this.getChild("n45"));
  13671. this.n46 = (this.getChild("n46"));
  13672. }
  13673. }
  13674. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13675. class ui_Component122 extends fgui.GComponent {
  13676. static createInstance() {
  13677. return (fgui.UIPackage.createObject("game", "Component122"));
  13678. }
  13679. onConstruct() {
  13680. this.gameNode3 = (this.getChild("gameNode3"));
  13681. }
  13682. }
  13683. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13684. class ui_skillItem extends fgui.GComponent {
  13685. static createInstance() {
  13686. return (fgui.UIPackage.createObject("game", "skillItem"));
  13687. }
  13688. onConstruct() {
  13689. this.c1 = this.getController("c1");
  13690. this.n31 = (this.getChild("n31"));
  13691. this.n6 = (this.getChild("n6"));
  13692. this.skillImg = (this.getChild("skillImg"));
  13693. this.nameTxt = (this.getChild("nameTxt"));
  13694. this.levelTxt = (this.getChild("levelTxt"));
  13695. this.n28 = (this.getChild("n28"));
  13696. this.describeTxt = (this.getChild("describeTxt"));
  13697. this.n32 = (this.getChild("n32"));
  13698. this.mutiBtn = (this.getChild("mutiBtn"));
  13699. this.tryNode = (this.getChild("tryNode"));
  13700. this.normalBtn = (this.getChild("normalBtn"));
  13701. this.startBtn = (this.getChild("startBtn"));
  13702. this.n42 = (this.getChild("n42"));
  13703. this.n43 = (this.getChild("n43"));
  13704. this.n44 = (this.getChild("n44"));
  13705. }
  13706. }
  13707. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13708. class ui_Component26 extends fgui.GButton {
  13709. static createInstance() {
  13710. return (fgui.UIPackage.createObject("game", "Component26"));
  13711. }
  13712. onConstruct() {
  13713. this.n11 = (this.getChild("n11"));
  13714. this.n30 = (this.getChild("n30"));
  13715. this.n34 = (this.getChild("n34"));
  13716. }
  13717. }
  13718. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13719. class ui_Component28 extends fgui.GButton {
  13720. static createInstance() {
  13721. return (fgui.UIPackage.createObject("game", "Component28"));
  13722. }
  13723. onConstruct() {
  13724. this.n12 = (this.getChild("n12"));
  13725. this.n31 = (this.getChild("n31"));
  13726. this.curTxt = (this.getChild("curTxt"));
  13727. this.n33 = (this.getChild("n33"));
  13728. }
  13729. }
  13730. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13731. class ui_Component1302 extends fgui.GComponent {
  13732. static createInstance() {
  13733. return (fgui.UIPackage.createObject("game", "Component1302"));
  13734. }
  13735. onConstruct() {
  13736. this.n2 = (this.getChild("n2"));
  13737. this.n3 = (this.getChild("n3"));
  13738. }
  13739. }
  13740. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13741. class ui_Component113 extends fgui.GComponent {
  13742. static createInstance() {
  13743. return (fgui.UIPackage.createObject("game", "Component113"));
  13744. }
  13745. onConstruct() {
  13746. this.n85 = (this.getChild("n85"));
  13747. this.n86 = (this.getChild("n86"));
  13748. this.n77 = (this.getChild("n77"));
  13749. this.n79 = (this.getChild("n79"));
  13750. this.n80 = (this.getChild("n80"));
  13751. this.n81 = (this.getChild("n81"));
  13752. this.n82 = (this.getChild("n82"));
  13753. this.n84 = (this.getChild("n84"));
  13754. this.n87 = (this.getChild("n87"));
  13755. this.t0 = this.getTransition("t0");
  13756. }
  13757. }
  13758. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13759. class ui_Component114 extends fgui.GComponent {
  13760. static createInstance() {
  13761. return (fgui.UIPackage.createObject("game", "Component114"));
  13762. }
  13763. onConstruct() {
  13764. this.n77 = (this.getChild("n77"));
  13765. this.t0 = this.getTransition("t0");
  13766. }
  13767. }
  13768. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13769. class ui_Component115 extends fgui.GComponent {
  13770. static createInstance() {
  13771. return (fgui.UIPackage.createObject("game", "Component115"));
  13772. }
  13773. onConstruct() {
  13774. this.n83 = (this.getChild("n83"));
  13775. this.fingerNode = (this.getChild("fingerNode"));
  13776. this.n84 = (this.getChild("n84"));
  13777. }
  13778. }
  13779. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13780. class ui_Component117 extends fgui.GComponent {
  13781. static createInstance() {
  13782. return (fgui.UIPackage.createObject("game", "Component117"));
  13783. }
  13784. onConstruct() {
  13785. this.n87 = (this.getChild("n87"));
  13786. this.n88 = (this.getChild("n88"));
  13787. this.n84 = (this.getChild("n84"));
  13788. this.n85 = (this.getChild("n85"));
  13789. this.n86 = (this.getChild("n86"));
  13790. this.t0 = this.getTransition("t0");
  13791. }
  13792. }
  13793. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13794. class ui_Component98_1 extends fgui.GButton {
  13795. static createInstance() {
  13796. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13797. }
  13798. onConstruct() {
  13799. this.c1 = this.getController("c1");
  13800. this.n8 = (this.getChild("n8"));
  13801. this.n41 = (this.getChild("n41"));
  13802. this.n40 = (this.getChild("n40"));
  13803. }
  13804. }
  13805. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13806. class ui_Component61 extends fgui.GComponent {
  13807. static createInstance() {
  13808. return (fgui.UIPackage.createObject("game", "Component61"));
  13809. }
  13810. onConstruct() {
  13811. this.n14 = (this.getChild("n14"));
  13812. this.n6 = (this.getChild("n6"));
  13813. this.t0 = this.getTransition("t0");
  13814. }
  13815. }
  13816. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13817. class ui_Component62 extends fgui.GComponent {
  13818. static createInstance() {
  13819. return (fgui.UIPackage.createObject("game", "Component62"));
  13820. }
  13821. onConstruct() {
  13822. this.n66 = (this.getChild("n66"));
  13823. this.n56 = (this.getChild("n56"));
  13824. this.n63 = (this.getChild("n63"));
  13825. this.n65 = (this.getChild("n65"));
  13826. this.t0 = this.getTransition("t0");
  13827. }
  13828. }
  13829. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13830. class ui_d3Root extends fgui.GComponent {
  13831. static createInstance() {
  13832. return (fgui.UIPackage.createObject("game", "d3Root"));
  13833. }
  13834. onConstruct() {
  13835. }
  13836. }
  13837. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13838. class ui_d2Root extends fgui.GComponent {
  13839. static createInstance() {
  13840. return (fgui.UIPackage.createObject("game", "d2Root"));
  13841. }
  13842. onConstruct() {
  13843. }
  13844. }
  13845. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13846. class ui_ballNode extends fgui.GComponent {
  13847. static createInstance() {
  13848. return (fgui.UIPackage.createObject("game", "ballNode"));
  13849. }
  13850. onConstruct() {
  13851. }
  13852. }
  13853. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13854. class ui_border extends fgui.GComponent {
  13855. static createInstance() {
  13856. return (fgui.UIPackage.createObject("game", "border"));
  13857. }
  13858. onConstruct() {
  13859. this.bar1 = (this.getChild("bar1"));
  13860. this.bar2 = (this.getChild("bar2"));
  13861. this.bar3 = (this.getChild("bar3"));
  13862. this.bar4 = (this.getChild("bar4"));
  13863. this.bar5 = (this.getChild("bar5"));
  13864. this.bar6 = (this.getChild("bar6"));
  13865. this.circle1 = (this.getChild("circle1"));
  13866. this.circle2 = (this.getChild("circle2"));
  13867. this.circle3 = (this.getChild("circle3"));
  13868. this.circle4 = (this.getChild("circle4"));
  13869. this.circle5 = (this.getChild("circle5"));
  13870. this.circle6 = (this.getChild("circle6"));
  13871. this.n28 = (this.getChild("n28"));
  13872. }
  13873. }
  13874. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13875. class ui_Component41_2 extends fgui.GComponent {
  13876. static createInstance() {
  13877. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13878. }
  13879. onConstruct() {
  13880. this.c1 = this.getController("c1");
  13881. this.n0 = (this.getChild("n0"));
  13882. this.n2 = (this.getChild("n2"));
  13883. this.n19 = (this.getChild("n19"));
  13884. this.cancelBtn = (this.getChild("cancelBtn"));
  13885. this.videoBtn = (this.getChild("videoBtn"));
  13886. this.n9 = (this.getChild("n9"));
  13887. this.n22 = (this.getChild("n22"));
  13888. this.tipsTxt = (this.getChild("tipsTxt"));
  13889. this.n23 = (this.getChild("n23"));
  13890. this.n24 = (this.getChild("n24"));
  13891. this.n26 = (this.getChild("n26"));
  13892. this.n27 = (this.getChild("n27"));
  13893. this.titleTxt = (this.getChild("titleTxt"));
  13894. }
  13895. }
  13896. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13897. class ui_Component41_1 extends fgui.GComponent {
  13898. static createInstance() {
  13899. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13900. }
  13901. onConstruct() {
  13902. this.c1 = this.getController("c1");
  13903. this.n0 = (this.getChild("n0"));
  13904. this.n2 = (this.getChild("n2"));
  13905. this.cancelBtn = (this.getChild("cancelBtn"));
  13906. this.videoBtn = (this.getChild("videoBtn"));
  13907. this.n27 = (this.getChild("n27"));
  13908. this.n30 = (this.getChild("n30"));
  13909. this.n31 = (this.getChild("n31"));
  13910. this.n32 = (this.getChild("n32"));
  13911. this.n33 = (this.getChild("n33"));
  13912. this.n34 = (this.getChild("n34"));
  13913. this.n35 = (this.getChild("n35"));
  13914. this.n36 = (this.getChild("n36"));
  13915. this.n1 = (this.getChild("n1"));
  13916. this.n37 = (this.getChild("n37"));
  13917. this.t0 = this.getTransition("t0");
  13918. this.t1 = this.getTransition("t1");
  13919. this.t2 = this.getTransition("t2");
  13920. this.t3 = this.getTransition("t3");
  13921. }
  13922. }
  13923. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13924. class ui_againBtn extends fgui.GButton {
  13925. static createInstance() {
  13926. return (fgui.UIPackage.createObject("game", "againBtn"));
  13927. }
  13928. onConstruct() {
  13929. this.n2 = (this.getChild("n2"));
  13930. this.n1 = (this.getChild("n1"));
  13931. this.n5 = (this.getChild("n5"));
  13932. }
  13933. }
  13934. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13935. class ui_Component118 extends fgui.GButton {
  13936. static createInstance() {
  13937. return (fgui.UIPackage.createObject("game", "Component118"));
  13938. }
  13939. onConstruct() {
  13940. this.c1 = this.getController("c1");
  13941. this.n14 = (this.getChild("n14"));
  13942. this.n9 = (this.getChild("n9"));
  13943. this.n10 = (this.getChild("n10"));
  13944. this.diamondTxt = (this.getChild("diamondTxt"));
  13945. this.n13 = (this.getChild("n13"));
  13946. this.n15 = (this.getChild("n15"));
  13947. }
  13948. }
  13949. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13950. class ui_Component119 extends fgui.GComponent {
  13951. static createInstance() {
  13952. return (fgui.UIPackage.createObject("game", "Component119"));
  13953. }
  13954. onConstruct() {
  13955. this.n1 = (this.getChild("n1"));
  13956. this.n2 = (this.getChild("n2"));
  13957. this.n13 = (this.getChild("n13"));
  13958. this.n6 = (this.getChild("n6"));
  13959. this.screenNode = (this.getChild("screenNode"));
  13960. this.n15 = (this.getChild("n15"));
  13961. this.closeBtn = (this.getChild("closeBtn"));
  13962. this.share2Btn = (this.getChild("share2Btn"));
  13963. this.shareBtn = (this.getChild("shareBtn"));
  13964. this.tipsNode = (this.getChild("tipsNode"));
  13965. this.awardNode = (this.getChild("awardNode"));
  13966. }
  13967. }
  13968. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13969. class ui_Component132_1 extends fgui.GComponent {
  13970. static createInstance() {
  13971. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13972. }
  13973. onConstruct() {
  13974. this.n25 = (this.getChild("n25"));
  13975. this.n26 = (this.getChild("n26"));
  13976. this.n27 = (this.getChild("n27"));
  13977. this.t0 = this.getTransition("t0");
  13978. }
  13979. }
  13980. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13981. class ui_SecretaryDisplay extends fgui.GComponent {
  13982. static createInstance() {
  13983. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13984. }
  13985. onConstruct() {
  13986. this.n2 = (this.getChild("n2"));
  13987. this.levelTxt = (this.getChild("levelTxt"));
  13988. this.n4 = (this.getChild("n4"));
  13989. this.secretary = (this.getChild("secretary"));
  13990. this.purchaseBtn = (this.getChild("purchaseBtn"));
  13991. this.n16 = (this.getChild("n16"));
  13992. this.n37 = (this.getChild("n37"));
  13993. this.n41 = (this.getChild("n41"));
  13994. this.n14 = (this.getChild("n14"));
  13995. this.n17 = (this.getChild("n17"));
  13996. this.heightTxt = (this.getChild("heightTxt"));
  13997. this.n46 = (this.getChild("n46"));
  13998. this.n36 = (this.getChild("n36"));
  13999. this.n38 = (this.getChild("n38"));
  14000. this.foodTxt = (this.getChild("foodTxt"));
  14001. this.n47 = (this.getChild("n47"));
  14002. this.n40 = (this.getChild("n40"));
  14003. this.n42 = (this.getChild("n42"));
  14004. this.historyTxt = (this.getChild("historyTxt"));
  14005. this.n48 = (this.getChild("n48"));
  14006. this.nameImg = (this.getChild("nameImg"));
  14007. this.n12 = (this.getChild("n12"));
  14008. this.n49 = (this.getChild("n49"));
  14009. this.t0 = this.getTransition("t0");
  14010. }
  14011. }
  14012. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14013. class ui_BallRodDisplay extends fgui.GComponent {
  14014. static createInstance() {
  14015. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14016. }
  14017. onConstruct() {
  14018. this.c1 = this.getController("c1");
  14019. this.n31 = (this.getChild("n31"));
  14020. this.n6 = (this.getChild("n6"));
  14021. this.nameTxt = (this.getChild("nameTxt"));
  14022. this.rodImg = (this.getChild("rodImg"));
  14023. this.levelNode = (this.getChild("levelNode"));
  14024. this.eftRod = (this.getChild("eftRod"));
  14025. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14026. }
  14027. }
  14028. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14029. class ui_Component111_11 extends fgui.GComponent {
  14030. static createInstance() {
  14031. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14032. }
  14033. onConstruct() {
  14034. this.n68 = (this.getChild("n68"));
  14035. this.n69 = (this.getChild("n69"));
  14036. }
  14037. }
  14038. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14039. class ui_Component112 extends fgui.GComponent {
  14040. static createInstance() {
  14041. return (fgui.UIPackage.createObject("game", "Component112"));
  14042. }
  14043. onConstruct() {
  14044. this.n68 = (this.getChild("n68"));
  14045. this.n70 = (this.getChild("n70"));
  14046. this.myMask = (this.getChild("myMask"));
  14047. }
  14048. }
  14049. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14050. class ui_Component111 extends fgui.GComponent {
  14051. static createInstance() {
  14052. return (fgui.UIPackage.createObject("game", "Component111"));
  14053. }
  14054. onConstruct() {
  14055. this.n68 = (this.getChild("n68"));
  14056. this.myMask = (this.getChild("myMask"));
  14057. }
  14058. }
  14059. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14060. class ui_Component144 extends fgui.GButton {
  14061. static createInstance() {
  14062. return (fgui.UIPackage.createObject("game", "Component144"));
  14063. }
  14064. onConstruct() {
  14065. this.n8 = (this.getChild("n8"));
  14066. }
  14067. }
  14068. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14069. class ui_Sign_com2 extends fgui.GComponent {
  14070. static createInstance() {
  14071. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14072. }
  14073. onConstruct() {
  14074. this.n0 = (this.getChild("n0"));
  14075. this.n1 = (this.getChild("n1"));
  14076. this.t0 = this.getTransition("t0");
  14077. }
  14078. }
  14079. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14080. class ui_Sign_guang extends fgui.GComponent {
  14081. static createInstance() {
  14082. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14083. }
  14084. onConstruct() {
  14085. this.n1 = (this.getChild("n1"));
  14086. this.n2 = (this.getChild("n2"));
  14087. this.n3 = (this.getChild("n3"));
  14088. this.n4 = (this.getChild("n4"));
  14089. this.n5 = (this.getChild("n5"));
  14090. this.n6 = (this.getChild("n6"));
  14091. this.n8 = (this.getChild("n8"));
  14092. }
  14093. }
  14094. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14095. class ui_SignMax extends fgui.GComponent {
  14096. static createInstance() {
  14097. return (fgui.UIPackage.createObject("game", "SignMax"));
  14098. }
  14099. onConstruct() {
  14100. this.c1 = this.getController("c1");
  14101. this.n7 = (this.getChild("n7"));
  14102. this.n15 = (this.getChild("n15"));
  14103. this.n8 = (this.getChild("n8"));
  14104. this.titleTxt = (this.getChild("titleTxt"));
  14105. this.myIcon1 = (this.getChild("myIcon1"));
  14106. this.numTxt1 = (this.getChild("numTxt1"));
  14107. this.myIcon2 = (this.getChild("myIcon2"));
  14108. this.n20 = (this.getChild("n20"));
  14109. this.n17 = (this.getChild("n17"));
  14110. this.numTxt2 = (this.getChild("numTxt2"));
  14111. this.n12 = (this.getChild("n12"));
  14112. this.n13 = (this.getChild("n13"));
  14113. this.n21 = (this.getChild("n21"));
  14114. this.n14 = (this.getChild("n14"));
  14115. }
  14116. }
  14117. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14118. class ui_Sign_com2_1 extends fgui.GComponent {
  14119. static createInstance() {
  14120. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14121. }
  14122. onConstruct() {
  14123. this.n0 = (this.getChild("n0"));
  14124. this.n1 = (this.getChild("n1"));
  14125. this.t0 = this.getTransition("t0");
  14126. }
  14127. }
  14128. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14129. class ui_Sign_com5 extends fgui.GComponent {
  14130. static createInstance() {
  14131. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14132. }
  14133. onConstruct() {
  14134. this.n3 = (this.getChild("n3"));
  14135. this.n29 = (this.getChild("n29"));
  14136. this.n4 = (this.getChild("n4"));
  14137. this.day1 = (this.getChild("day1"));
  14138. this.day2 = (this.getChild("day2"));
  14139. this.day3 = (this.getChild("day3"));
  14140. this.day4 = (this.getChild("day4"));
  14141. this.day5 = (this.getChild("day5"));
  14142. this.day6 = (this.getChild("day6"));
  14143. this.day7 = (this.getChild("day7"));
  14144. this.t0 = this.getTransition("t0");
  14145. }
  14146. }
  14147. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14148. class ui_Sign_com8 extends fgui.GComponent {
  14149. static createInstance() {
  14150. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14151. }
  14152. onConstruct() {
  14153. this.n48 = (this.getChild("n48"));
  14154. this.womanTxt = (this.getChild("womanTxt"));
  14155. this.t0 = this.getTransition("t0");
  14156. }
  14157. }
  14158. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14159. class ui_Sign_com6 extends fgui.GComponent {
  14160. static createInstance() {
  14161. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14162. }
  14163. onConstruct() {
  14164. this.n2 = (this.getChild("n2"));
  14165. this.n3 = (this.getChild("n3"));
  14166. this.t0 = this.getTransition("t0");
  14167. }
  14168. }
  14169. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14170. class ui_Sign_com7 extends fgui.GComponent {
  14171. static createInstance() {
  14172. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14173. }
  14174. onConstruct() {
  14175. this.n29 = (this.getChild("n29"));
  14176. this.n2 = (this.getChild("n2"));
  14177. }
  14178. }
  14179. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14180. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14181. static createInstance() {
  14182. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14183. }
  14184. onConstruct() {
  14185. this.n5 = (this.getChild("n5"));
  14186. this.n4 = (this.getChild("n4"));
  14187. this.t0 = this.getTransition("t0");
  14188. }
  14189. }
  14190. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14191. class ui_UITurntable_com2 extends fgui.GComponent {
  14192. static createInstance() {
  14193. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14194. }
  14195. onConstruct() {
  14196. this.c1 = this.getController("c1");
  14197. this.n4 = (this.getChild("n4"));
  14198. this.n6 = (this.getChild("n6"));
  14199. this.n10 = (this.getChild("n10"));
  14200. this.n11 = (this.getChild("n11"));
  14201. this.n12 = (this.getChild("n12"));
  14202. this.n13 = (this.getChild("n13"));
  14203. this.n14 = (this.getChild("n14"));
  14204. this.n15 = (this.getChild("n15"));
  14205. this.n16 = (this.getChild("n16"));
  14206. this.n17 = (this.getChild("n17"));
  14207. this.n18 = (this.getChild("n18"));
  14208. this.n19 = (this.getChild("n19"));
  14209. this.n20 = (this.getChild("n20"));
  14210. this.n21 = (this.getChild("n21"));
  14211. this.n22 = (this.getChild("n22"));
  14212. this.n23 = (this.getChild("n23"));
  14213. this.n24 = (this.getChild("n24"));
  14214. this.n25 = (this.getChild("n25"));
  14215. this.n26 = (this.getChild("n26"));
  14216. this.n27 = (this.getChild("n27"));
  14217. this.n28 = (this.getChild("n28"));
  14218. this.n29 = (this.getChild("n29"));
  14219. this.n30 = (this.getChild("n30"));
  14220. this.n31 = (this.getChild("n31"));
  14221. this.n32 = (this.getChild("n32"));
  14222. this.n33 = (this.getChild("n33"));
  14223. }
  14224. }
  14225. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14226. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14227. static createInstance() {
  14228. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14229. }
  14230. onConstruct() {
  14231. this.n5 = (this.getChild("n5"));
  14232. this.n4 = (this.getChild("n4"));
  14233. this.t0 = this.getTransition("t0");
  14234. }
  14235. }
  14236. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14237. class ui_UITurntable_com5 extends fgui.GComponent {
  14238. static createInstance() {
  14239. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14240. }
  14241. onConstruct() {
  14242. this.flashNode = (this.getChild("flashNode"));
  14243. this.rotNode = (this.getChild("rotNode"));
  14244. this.n3 = (this.getChild("n3"));
  14245. this.n21 = (this.getChild("n21"));
  14246. this.t0 = this.getTransition("t0");
  14247. }
  14248. }
  14249. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14250. class ui_UITurntable_com7 extends fgui.GComponent {
  14251. static createInstance() {
  14252. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14253. }
  14254. onConstruct() {
  14255. this.n2 = (this.getChild("n2"));
  14256. this.n35 = (this.getChild("n35"));
  14257. this.img1 = (this.getChild("img1"));
  14258. this.img2 = (this.getChild("img2"));
  14259. this.img3 = (this.getChild("img3"));
  14260. this.img4 = (this.getChild("img4"));
  14261. this.img6 = (this.getChild("img6"));
  14262. this.img5 = (this.getChild("img5"));
  14263. this.txt1 = (this.getChild("txt1"));
  14264. this.txt2 = (this.getChild("txt2"));
  14265. this.txt3 = (this.getChild("txt3"));
  14266. this.txt4 = (this.getChild("txt4"));
  14267. this.txt5 = (this.getChild("txt5"));
  14268. this.txt6 = (this.getChild("txt6"));
  14269. }
  14270. }
  14271. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14272. class ui_UITurntable_com9 extends fgui.GComponent {
  14273. static createInstance() {
  14274. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14275. }
  14276. onConstruct() {
  14277. this.n38 = (this.getChild("n38"));
  14278. this.n39 = (this.getChild("n39"));
  14279. }
  14280. }
  14281. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14282. class ui_UITurntable_com10 extends fgui.GComponent {
  14283. static createInstance() {
  14284. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14285. }
  14286. onConstruct() {
  14287. this.n39 = (this.getChild("n39"));
  14288. this.n40 = (this.getChild("n40"));
  14289. this.t0 = this.getTransition("t0");
  14290. }
  14291. }
  14292. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14293. class ui_UITurntable_com11 extends fgui.GComponent {
  14294. static createInstance() {
  14295. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14296. }
  14297. onConstruct() {
  14298. this.n38 = (this.getChild("n38"));
  14299. this.n39 = (this.getChild("n39"));
  14300. this.n40 = (this.getChild("n40"));
  14301. this.t0 = this.getTransition("t0");
  14302. }
  14303. }
  14304. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14305. class ui_UITurntable_com12 extends fgui.GComponent {
  14306. static createInstance() {
  14307. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14308. }
  14309. onConstruct() {
  14310. this.n43 = (this.getChild("n43"));
  14311. this.barNode = (this.getChild("barNode"));
  14312. this.tipsTxt = (this.getChild("tipsTxt"));
  14313. this.n45 = (this.getChild("n45"));
  14314. this.boxBtn = (this.getChild("boxBtn"));
  14315. }
  14316. }
  14317. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14318. class ui_UITurntable_com1 extends fgui.GButton {
  14319. static createInstance() {
  14320. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14321. }
  14322. onConstruct() {
  14323. this.n41 = (this.getChild("n41"));
  14324. this.n42 = (this.getChild("n42"));
  14325. this.t0 = this.getTransition("t0");
  14326. }
  14327. }
  14328. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14329. class ui_UITurntable_com3 extends fgui.GComponent {
  14330. static createInstance() {
  14331. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14332. }
  14333. onConstruct() {
  14334. this.n48 = (this.getChild("n48"));
  14335. this.womanTxt = (this.getChild("womanTxt"));
  14336. this.t0 = this.getTransition("t0");
  14337. }
  14338. }
  14339. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14340. class ui_cancelBtn2 extends fgui.GButton {
  14341. static createInstance() {
  14342. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14343. }
  14344. onConstruct() {
  14345. this.c1 = this.getController("c1");
  14346. this.n0 = (this.getChild("n0"));
  14347. this.n1 = (this.getChild("n1"));
  14348. this.n2 = (this.getChild("n2"));
  14349. this.n3 = (this.getChild("n3"));
  14350. this.n4 = (this.getChild("n4"));
  14351. this.n5 = (this.getChild("n5"));
  14352. this.n6 = (this.getChild("n6"));
  14353. this.n7 = (this.getChild("n7"));
  14354. this.n8 = (this.getChild("n8"));
  14355. this.powerEft = (this.getChild("powerEft"));
  14356. }
  14357. }
  14358. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14359. class ui_shareBtn2 extends fgui.GButton {
  14360. static createInstance() {
  14361. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14362. }
  14363. onConstruct() {
  14364. this.c1 = this.getController("c1");
  14365. this.n2 = (this.getChild("n2"));
  14366. this.n24 = (this.getChild("n24"));
  14367. this.n1 = (this.getChild("n1"));
  14368. this.n3 = (this.getChild("n3"));
  14369. this.n23 = (this.getChild("n23"));
  14370. this.n4 = (this.getChild("n4"));
  14371. this.n5 = (this.getChild("n5"));
  14372. this.n6 = (this.getChild("n6"));
  14373. this.n20 = (this.getChild("n20"));
  14374. this.n21 = (this.getChild("n21"));
  14375. this.n22 = (this.getChild("n22"));
  14376. this.powerEft = (this.getChild("powerEft"));
  14377. }
  14378. }
  14379. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14380. class ui_UIMoney extends fgui.GComponent {
  14381. static createInstance() {
  14382. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14383. }
  14384. onConstruct() {
  14385. this.c1 = this.getController("c1");
  14386. this.n4 = (this.getChild("n4"));
  14387. this.coinImg = (this.getChild("coinImg"));
  14388. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14389. this.coinTxt = (this.getChild("coinTxt"));
  14390. this.n7 = (this.getChild("n7"));
  14391. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14392. this.diamondTxt = (this.getChild("diamondTxt"));
  14393. this.diamondImg = (this.getChild("diamondImg"));
  14394. this.n12 = (this.getChild("n12"));
  14395. this.powerImg = (this.getChild("powerImg"));
  14396. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14397. this.powerTxt = (this.getChild("powerTxt"));
  14398. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14399. }
  14400. }
  14401. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14402. class ui_backBtn extends fgui.GButton {
  14403. static createInstance() {
  14404. return (fgui.UIPackage.createObject("game", "backBtn"));
  14405. }
  14406. onConstruct() {
  14407. this.n0 = (this.getChild("n0"));
  14408. this.t0 = this.getTransition("t0");
  14409. this.t1 = this.getTransition("t1");
  14410. }
  14411. }
  14412. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14413. class ui_MoneyBtn extends fgui.GButton {
  14414. static createInstance() {
  14415. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14416. }
  14417. onConstruct() {
  14418. this.button = this.getController("button");
  14419. this.n0 = (this.getChild("n0"));
  14420. }
  14421. }
  14422. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14423. class ui_UIMoneyBtn extends fgui.GComponent {
  14424. static createInstance() {
  14425. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14426. }
  14427. onConstruct() {
  14428. this.n1 = (this.getChild("n1"));
  14429. this.closeBtn = (this.getChild("closeBtn"));
  14430. }
  14431. }
  14432. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14433. class ui_Component64 extends fgui.GComponent {
  14434. static createInstance() {
  14435. return (fgui.UIPackage.createObject("game", "Component64"));
  14436. }
  14437. onConstruct() {
  14438. this.n57 = (this.getChild("n57"));
  14439. this.n54 = (this.getChild("n54"));
  14440. this.n55 = (this.getChild("n55"));
  14441. this.n56 = (this.getChild("n56"));
  14442. this.t1 = this.getTransition("t1");
  14443. }
  14444. }
  14445. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14446. class ui_Component41_3 extends fgui.GComponent {
  14447. static createInstance() {
  14448. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14449. }
  14450. onConstruct() {
  14451. this.c1 = this.getController("c1");
  14452. this.n0 = (this.getChild("n0"));
  14453. this.n2 = (this.getChild("n2"));
  14454. this.cancelBtn = (this.getChild("cancelBtn"));
  14455. this.videoBtn = (this.getChild("videoBtn"));
  14456. this.n9 = (this.getChild("n9"));
  14457. this.n24 = (this.getChild("n24"));
  14458. this.n27 = (this.getChild("n27"));
  14459. this.titleTxt = (this.getChild("titleTxt"));
  14460. this.n28 = (this.getChild("n28"));
  14461. this.t0 = this.getTransition("t0");
  14462. }
  14463. }
  14464. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14465. class ui_dh_zs_4 extends fgui.GComponent {
  14466. static createInstance() {
  14467. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14468. }
  14469. onConstruct() {
  14470. this.n1 = (this.getChild("n1"));
  14471. this.n2 = (this.getChild("n2"));
  14472. this.n3 = (this.getChild("n3"));
  14473. this.n4 = (this.getChild("n4"));
  14474. this.n5 = (this.getChild("n5"));
  14475. this.n6 = (this.getChild("n6"));
  14476. this.n8 = (this.getChild("n8"));
  14477. this.t0 = this.getTransition("t0");
  14478. }
  14479. }
  14480. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14481. class ui_Component71_1 extends fgui.GButton {
  14482. static createInstance() {
  14483. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14484. }
  14485. onConstruct() {
  14486. this.n17 = (this.getChild("n17"));
  14487. this.t0 = this.getTransition("t0");
  14488. }
  14489. }
  14490. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14491. class ui_Component83 extends fgui.GComponent {
  14492. static createInstance() {
  14493. return (fgui.UIPackage.createObject("game", "Component83"));
  14494. }
  14495. onConstruct() {
  14496. this.c1 = this.getController("c1");
  14497. this.n17 = (this.getChild("n17"));
  14498. this.n19 = (this.getChild("n19"));
  14499. this.n20 = (this.getChild("n20"));
  14500. }
  14501. }
  14502. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14503. class ui_Component84 extends fgui.GComponent {
  14504. static createInstance() {
  14505. return (fgui.UIPackage.createObject("game", "Component84"));
  14506. }
  14507. onConstruct() {
  14508. this.c1 = this.getController("c1");
  14509. this.n4 = (this.getChild("n4"));
  14510. this.n22 = (this.getChild("n22"));
  14511. this.n23 = (this.getChild("n23"));
  14512. this.numTxt = (this.getChild("numTxt"));
  14513. this.n25 = (this.getChild("n25"));
  14514. this.n26 = (this.getChild("n26"));
  14515. }
  14516. }
  14517. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14518. class ui_Component84_1 extends fgui.GComponent {
  14519. static createInstance() {
  14520. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14521. }
  14522. onConstruct() {
  14523. this.c1 = this.getController("c1");
  14524. this.n4 = (this.getChild("n4"));
  14525. this.n22 = (this.getChild("n22"));
  14526. this.n23 = (this.getChild("n23"));
  14527. this.numTxt = (this.getChild("numTxt"));
  14528. this.n25 = (this.getChild("n25"));
  14529. this.n26 = (this.getChild("n26"));
  14530. }
  14531. }
  14532. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14533. class ui_Component85 extends fgui.GComponent {
  14534. static createInstance() {
  14535. return (fgui.UIPackage.createObject("game", "Component85"));
  14536. }
  14537. onConstruct() {
  14538. this.n1 = (this.getChild("n1"));
  14539. this.n6 = (this.getChild("n6"));
  14540. this.n2 = (this.getChild("n2"));
  14541. this.n3 = (this.getChild("n3"));
  14542. this.levelTxt = (this.getChild("levelTxt"));
  14543. this.n10 = (this.getChild("n10"));
  14544. this.n11 = (this.getChild("n11"));
  14545. this.n12 = (this.getChild("n12"));
  14546. this.n13 = (this.getChild("n13"));
  14547. this.n14 = (this.getChild("n14"));
  14548. this.modeNode = (this.getChild("modeNode"));
  14549. this.n18 = (this.getChild("n18"));
  14550. this.conditionTxt = (this.getChild("conditionTxt"));
  14551. this.diamondNode = (this.getChild("diamondNode"));
  14552. this.coinNode = (this.getChild("coinNode"));
  14553. this.startBtn = (this.getChild("startBtn"));
  14554. this.n28 = (this.getChild("n28"));
  14555. this.displayRoot = (this.getChild("displayRoot"));
  14556. this.t0 = this.getTransition("t0");
  14557. }
  14558. }
  14559. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14560. class ui_Component86 extends fgui.GButton {
  14561. static createInstance() {
  14562. return (fgui.UIPackage.createObject("game", "Component86"));
  14563. }
  14564. onConstruct() {
  14565. this.n15 = (this.getChild("n15"));
  14566. this.t0 = this.getTransition("t0");
  14567. }
  14568. }
  14569. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14570. class ui_Component87 extends fgui.GComponent {
  14571. static createInstance() {
  14572. return (fgui.UIPackage.createObject("game", "Component87"));
  14573. }
  14574. onConstruct() {
  14575. this.n66 = (this.getChild("n66"));
  14576. this.myProgress = (this.getChild("myProgress"));
  14577. this.starAni = (this.getChild("starAni"));
  14578. this.hpTxt = (this.getChild("hpTxt"));
  14579. this.n74 = (this.getChild("n74"));
  14580. this.n73 = (this.getChild("n73"));
  14581. this.ballTxt = (this.getChild("ballTxt"));
  14582. this.n76 = (this.getChild("n76"));
  14583. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14584. this.levelTxt = (this.getChild("levelTxt"));
  14585. this.star1 = (this.getChild("star1"));
  14586. this.star2 = (this.getChild("star2"));
  14587. this.star3 = (this.getChild("star3"));
  14588. }
  14589. }
  14590. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14591. class ui_Component88 extends fgui.GProgressBar {
  14592. static createInstance() {
  14593. return (fgui.UIPackage.createObject("game", "Component88"));
  14594. }
  14595. onConstruct() {
  14596. this.n68 = (this.getChild("n68"));
  14597. this.bar = (this.getChild("bar"));
  14598. }
  14599. }
  14600. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14601. class ui_Component89 extends fgui.GComponent {
  14602. static createInstance() {
  14603. return (fgui.UIPackage.createObject("game", "Component89"));
  14604. }
  14605. onConstruct() {
  14606. this.c1 = this.getController("c1");
  14607. this.n71 = (this.getChild("n71"));
  14608. this.n72 = (this.getChild("n72"));
  14609. }
  14610. }
  14611. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14612. class ui_Component90 extends fgui.GComponent {
  14613. static createInstance() {
  14614. return (fgui.UIPackage.createObject("game", "Component90"));
  14615. }
  14616. onConstruct() {
  14617. this.c1 = this.getController("c1");
  14618. this.n64 = (this.getChild("n64"));
  14619. this.n65 = (this.getChild("n65"));
  14620. this.n66 = (this.getChild("n66"));
  14621. this.t0 = this.getTransition("t0");
  14622. }
  14623. }
  14624. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14625. class ui_Component127 extends fgui.GButton {
  14626. static createInstance() {
  14627. return (fgui.UIPackage.createObject("game", "Component127"));
  14628. }
  14629. onConstruct() {
  14630. this.n5 = (this.getChild("n5"));
  14631. }
  14632. }
  14633. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14634. class gameBinder {
  14635. static bindAll() {
  14636. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14637. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14638. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14639. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14640. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14641. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14642. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14643. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14644. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14645. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14646. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14647. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14648. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14649. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14650. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14651. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14652. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14653. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14654. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14655. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14656. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14657. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14658. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14659. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14660. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14661. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14662. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14663. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14664. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14665. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14666. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14667. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14668. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14669. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14670. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14671. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14672. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14673. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14674. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14675. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14676. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14677. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14678. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14679. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14680. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14681. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14682. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14683. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14684. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14685. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14686. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14687. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14688. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14689. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14690. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14691. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14692. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14693. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14694. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14695. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14696. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14697. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14698. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14699. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14700. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14701. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14702. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14703. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14704. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14705. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14706. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14707. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14708. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14709. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14710. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14711. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14712. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14713. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14714. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14715. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14716. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14717. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14718. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14719. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14720. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14721. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14722. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14723. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14724. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14725. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14726. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14727. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14728. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14729. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14730. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14731. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14732. fgui.UIObjectFactory.setExtension(ui_Component9.URL, ui_Component9);
  14733. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14734. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14735. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14736. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14737. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14738. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14739. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14740. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14741. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14742. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14743. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14744. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14745. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14746. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14747. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14748. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14749. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14750. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14751. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14752. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14753. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14754. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14755. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14756. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14757. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14758. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14759. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14760. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14761. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14762. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14763. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14764. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14765. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14766. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14767. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14768. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14769. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14770. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14771. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14772. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14773. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14774. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14775. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14776. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14777. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14778. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14779. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14780. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14781. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14782. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14783. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14784. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14785. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14786. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14787. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14788. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14789. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14790. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14791. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14792. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14793. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14794. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14795. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14796. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14797. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14798. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14799. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14800. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14801. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14802. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14803. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14804. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14805. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14806. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14807. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14808. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14809. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14810. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14811. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14812. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14813. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14814. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14815. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14816. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14817. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14818. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14819. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14820. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14821. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14822. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14823. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14824. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14825. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14826. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14827. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14828. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14829. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14830. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14831. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14832. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14833. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14834. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14835. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14836. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14837. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14838. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14839. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14840. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14841. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14842. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14843. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14844. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14845. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14846. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14847. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14848. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14849. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14850. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14851. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14852. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14853. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14854. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14855. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14856. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14857. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14858. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14859. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14860. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14861. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14862. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14863. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14864. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14865. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14866. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14867. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14868. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14869. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14870. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14871. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14872. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14873. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14874. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14875. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14876. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14877. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14878. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14879. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14880. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14881. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14882. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14883. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14884. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14885. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14886. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14887. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14888. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14889. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14890. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14891. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14892. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14893. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14894. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14895. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14896. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14897. }
  14898. }
  14899. class ui_btn6 extends fgui.GButton {
  14900. static createInstance() {
  14901. return (fgui.UIPackage.createObject("loading", "btn6"));
  14902. }
  14903. onConstruct() {
  14904. this.n6 = (this.getChild("n6"));
  14905. this.n1 = (this.getChild("n1"));
  14906. }
  14907. }
  14908. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14909. class ui_xyItem extends fgui.GComponent {
  14910. static createInstance() {
  14911. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14912. }
  14913. onConstruct() {
  14914. this.xyItem = (this.getChild("xyItem"));
  14915. }
  14916. }
  14917. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14918. class ui_loadinfo extends fgui.GProgressBar {
  14919. static createInstance() {
  14920. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14921. }
  14922. onConstruct() {
  14923. this.bg = (this.getChild("bg"));
  14924. this.bar = (this.getChild("bar"));
  14925. this.title = (this.getChild("title"));
  14926. this.ani = (this.getChild("ani"));
  14927. }
  14928. }
  14929. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14930. class ui_xyNode extends fgui.GComponent {
  14931. static createInstance() {
  14932. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14933. }
  14934. onConstruct() {
  14935. this.n0 = (this.getChild("n0"));
  14936. this.btnYes = (this.getChild("btnYes"));
  14937. this.btnNo = (this.getChild("btnNo"));
  14938. this.btnKnown = (this.getChild("btnKnown"));
  14939. this.btnSure = (this.getChild("btnSure"));
  14940. this.txtWelcom = (this.getChild("txtWelcom"));
  14941. this.txtXy = (this.getChild("txtXy"));
  14942. this.n75 = (this.getChild("n75"));
  14943. this.btnXy1 = (this.getChild("btnXy1"));
  14944. this.btnXy3 = (this.getChild("btnXy3"));
  14945. this.btnXy2 = (this.getChild("btnXy2"));
  14946. this.n74 = (this.getChild("n74"));
  14947. this.xy1 = (this.getChild("xy1"));
  14948. this.txtTitle = (this.getChild("txtTitle"));
  14949. this.btnBack = (this.getChild("btnBack"));
  14950. this.xyList = (this.getChild("xyList"));
  14951. this.xy2 = (this.getChild("xy2"));
  14952. this.xyNode = (this.getChild("xyNode"));
  14953. }
  14954. }
  14955. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14956. class ui_ageNode extends fgui.GComponent {
  14957. static createInstance() {
  14958. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14959. }
  14960. onConstruct() {
  14961. this.n3 = (this.getChild("n3"));
  14962. this.n7 = (this.getChild("n7"));
  14963. this.n4 = (this.getChild("n4"));
  14964. this.btnAge = (this.getChild("btnAge"));
  14965. this.ageNode = (this.getChild("ageNode"));
  14966. }
  14967. }
  14968. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14969. class ui_rnNode extends fgui.GComponent {
  14970. static createInstance() {
  14971. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14972. }
  14973. onConstruct() {
  14974. this.n28 = (this.getChild("n28"));
  14975. this.n30 = (this.getChild("n30"));
  14976. this.n33 = (this.getChild("n33"));
  14977. this.rn1 = (this.getChild("rn1"));
  14978. this.n40 = (this.getChild("n40"));
  14979. this.n41 = (this.getChild("n41"));
  14980. this.rn3 = (this.getChild("rn3"));
  14981. this.n37 = (this.getChild("n37"));
  14982. this.n39 = (this.getChild("n39"));
  14983. this.rn2 = (this.getChild("rn2"));
  14984. this.n47 = (this.getChild("n47"));
  14985. this.n49 = (this.getChild("n49"));
  14986. this.n44 = (this.getChild("n44"));
  14987. this.inputCode = (this.getChild("inputCode"));
  14988. this.inputName = (this.getChild("inputName"));
  14989. this.n48 = (this.getChild("n48"));
  14990. this.n50 = (this.getChild("n50"));
  14991. this.rn4 = (this.getChild("rn4"));
  14992. this.btnCheck = (this.getChild("btnCheck"));
  14993. this.btnExit = (this.getChild("btnExit"));
  14994. this.btnDone = (this.getChild("btnDone"));
  14995. this.rnNode = (this.getChild("rnNode"));
  14996. }
  14997. }
  14998. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  14999. class ui_tipNode extends fgui.GComponent {
  15000. static createInstance() {
  15001. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15002. }
  15003. onConstruct() {
  15004. this.bg = (this.getChild("bg"));
  15005. this.n55 = (this.getChild("n55"));
  15006. this.n56 = (this.getChild("n56"));
  15007. this.tipNode = (this.getChild("tipNode"));
  15008. }
  15009. }
  15010. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15011. class ui_fcmNode extends fgui.GComponent {
  15012. static createInstance() {
  15013. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15014. }
  15015. onConstruct() {
  15016. this.n63 = (this.getChild("n63"));
  15017. this.n62 = (this.getChild("n62"));
  15018. this.btnRn = (this.getChild("btnRn"));
  15019. this.n61 = (this.getChild("n61"));
  15020. this.n58 = (this.getChild("n58"));
  15021. this.fcmNode = (this.getChild("fcmNode"));
  15022. }
  15023. }
  15024. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15025. class ui_msgNode extends fgui.GComponent {
  15026. static createInstance() {
  15027. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15028. }
  15029. onConstruct() {
  15030. this.n69 = (this.getChild("n69"));
  15031. this.txtMsg = (this.getChild("txtMsg"));
  15032. this.msgNode = (this.getChild("msgNode"));
  15033. }
  15034. }
  15035. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15036. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15037. static createInstance() {
  15038. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15039. }
  15040. onConstruct() {
  15041. this.n1 = (this.getChild("n1"));
  15042. this.n13 = (this.getChild("n13"));
  15043. this.n14 = (this.getChild("n14"));
  15044. this.n15 = (this.getChild("n15"));
  15045. this.n3 = (this.getChild("n3"));
  15046. this.n4 = (this.getChild("n4"));
  15047. this.n5 = (this.getChild("n5"));
  15048. this.n6 = (this.getChild("n6"));
  15049. this.n7 = (this.getChild("n7"));
  15050. this.n8 = (this.getChild("n8"));
  15051. this.n9 = (this.getChild("n9"));
  15052. this.n10 = (this.getChild("n10"));
  15053. this.n12 = (this.getChild("n12"));
  15054. this.n11 = (this.getChild("n11"));
  15055. this.n16 = (this.getChild("n16"));
  15056. this.n17 = (this.getChild("n17"));
  15057. this.n18 = (this.getChild("n18"));
  15058. this.n20 = (this.getChild("n20"));
  15059. this.n21 = (this.getChild("n21"));
  15060. this.t0 = this.getTransition("t0");
  15061. }
  15062. }
  15063. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15064. class ui_btn5 extends fgui.GButton {
  15065. static createInstance() {
  15066. return (fgui.UIPackage.createObject("loading", "btn5"));
  15067. }
  15068. onConstruct() {
  15069. this.n9 = (this.getChild("n9"));
  15070. this.n1 = (this.getChild("n1"));
  15071. }
  15072. }
  15073. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15074. class ui_UILoading extends fgui.GComponent {
  15075. static createInstance() {
  15076. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15077. }
  15078. onConstruct() {
  15079. this.n12 = (this.getChild("n12"));
  15080. this.loadinfo = (this.getChild("loadinfo"));
  15081. this.n13 = (this.getChild("n13"));
  15082. this.txtLoad = (this.getChild("txtLoad"));
  15083. this.n18 = (this.getChild("n18"));
  15084. }
  15085. }
  15086. ui_UILoading.URL = "ui://37nctnhwphc33";
  15087. class ui_AgeItem extends fgui.GComponent {
  15088. static createInstance() {
  15089. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15090. }
  15091. onConstruct() {
  15092. this.txtAge = (this.getChild("txtAge"));
  15093. }
  15094. }
  15095. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15096. class ui_btn1 extends fgui.GButton {
  15097. static createInstance() {
  15098. return (fgui.UIPackage.createObject("loading", "btn1"));
  15099. }
  15100. onConstruct() {
  15101. this.n6 = (this.getChild("n6"));
  15102. this.n1 = (this.getChild("n1"));
  15103. }
  15104. }
  15105. ui_btn1.URL = "ui://37nctnhwxe622p";
  15106. class ui_btn3 extends fgui.GButton {
  15107. static createInstance() {
  15108. return (fgui.UIPackage.createObject("loading", "btn3"));
  15109. }
  15110. onConstruct() {
  15111. this.n9 = (this.getChild("n9"));
  15112. this.n1 = (this.getChild("n1"));
  15113. }
  15114. }
  15115. ui_btn3.URL = "ui://37nctnhwxe622s";
  15116. class ui_btn2 extends fgui.GButton {
  15117. static createInstance() {
  15118. return (fgui.UIPackage.createObject("loading", "btn2"));
  15119. }
  15120. onConstruct() {
  15121. this.n6 = (this.getChild("n6"));
  15122. this.n1 = (this.getChild("n1"));
  15123. }
  15124. }
  15125. ui_btn2.URL = "ui://37nctnhwxe622t";
  15126. class ui_btnBack extends fgui.GButton {
  15127. static createInstance() {
  15128. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15129. }
  15130. onConstruct() {
  15131. this.n6 = (this.getChild("n6"));
  15132. this.n7 = (this.getChild("n7"));
  15133. }
  15134. }
  15135. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15136. class ui_btnXy1 extends fgui.GButton {
  15137. static createInstance() {
  15138. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15139. }
  15140. onConstruct() {
  15141. this.n1 = (this.getChild("n1"));
  15142. }
  15143. }
  15144. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15145. class ui_btnXy2 extends fgui.GButton {
  15146. static createInstance() {
  15147. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15148. }
  15149. onConstruct() {
  15150. this.n1 = (this.getChild("n1"));
  15151. }
  15152. }
  15153. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15154. class ui_btnXy3 extends fgui.GButton {
  15155. static createInstance() {
  15156. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15157. }
  15158. onConstruct() {
  15159. this.n1 = (this.getChild("n1"));
  15160. }
  15161. }
  15162. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15163. class ui_btn4 extends fgui.GButton {
  15164. static createInstance() {
  15165. return (fgui.UIPackage.createObject("loading", "btn4"));
  15166. }
  15167. onConstruct() {
  15168. this.n9 = (this.getChild("n9"));
  15169. this.n1 = (this.getChild("n1"));
  15170. }
  15171. }
  15172. ui_btn4.URL = "ui://37nctnhwxe622z";
  15173. class loadingBinder {
  15174. static bindAll() {
  15175. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15176. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15177. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15178. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15179. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15180. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15181. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15182. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15183. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15184. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15185. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15186. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15187. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15188. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15189. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15190. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15191. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15192. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15193. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15194. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15195. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15196. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15197. }
  15198. }
  15199. class UIMgr {
  15200. constructor() {
  15201. this._stage = null;
  15202. this._uiList = [];
  15203. this._showList = [];
  15204. this._bindPkgList = [];
  15205. this.uiIndex = 0;
  15206. }
  15207. static get inst() {
  15208. if (UIMgr._inst == null) {
  15209. UIMgr._inst = new UIMgr();
  15210. }
  15211. return UIMgr._inst;
  15212. }
  15213. setStage(s) {
  15214. if (this._stage) {
  15215. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15216. return;
  15217. }
  15218. this._stage = s;
  15219. }
  15220. clearTempData() {
  15221. console.log('zh:clearTempData start');
  15222. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15223. console.log('zh:clearTempData end');
  15224. }
  15225. init() {
  15226. this.setStage(Laya.stage);
  15227. fairygui.UIConfig.defaultFont = "微软雅黑";
  15228. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15229. fairygui.UIConfig.packageFileExtension = "obj";
  15230. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15231. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15232. fairygui.GRoot.inst.width = Laya.stage.width;
  15233. fairygui.GRoot.inst.height = Laya.stage.height;
  15234. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15235. }
  15236. addAllUpdate() {
  15237. this.uiIndex = 0;
  15238. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15239. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15240. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15241. }
  15242. }
  15243. }
  15244. bindFUI(pkgname) {
  15245. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15246. return;
  15247. }
  15248. switch (pkgname) {
  15249. case fguiRes.loading:
  15250. fairygui.UIPackage.addPackage(pkgname);
  15251. loadingBinder.bindAll();
  15252. this._bindPkgList.push(pkgname);
  15253. break;
  15254. case fguiRes.game:
  15255. fairygui.UIPackage.addPackage(pkgname);
  15256. gameBinder.bindAll();
  15257. this._bindPkgList.push(pkgname);
  15258. break;
  15259. default:
  15260. break;
  15261. }
  15262. }
  15263. Show(cls, ...param) {
  15264. let nameStr = cls.uiName;
  15265. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15266. let temp = this._uiList[i];
  15267. let str = temp.className;
  15268. if (str == nameStr) {
  15269. if (temp.isMuti) {
  15270. if (temp.isHide) {
  15271. temp.show(...param);
  15272. this._uiList.splice(i, 1);
  15273. this._uiList.push(temp);
  15274. return temp;
  15275. }
  15276. }
  15277. else {
  15278. temp.show(...param);
  15279. this._uiList.splice(i, 1);
  15280. this._uiList.push(temp);
  15281. return temp;
  15282. }
  15283. }
  15284. }
  15285. let ui = new cls();
  15286. ui.className = nameStr;
  15287. this._showUI(ui, param);
  15288. return ui;
  15289. }
  15290. destroyUI(ui) {
  15291. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15292. let temp = this._uiList[i].className;
  15293. if (temp == ui.className) {
  15294. this._uiList.splice(i, 1);
  15295. break;
  15296. }
  15297. }
  15298. this.checkUIState();
  15299. }
  15300. _showUI(ui, param) {
  15301. this._uiList.push(ui);
  15302. ui.show(...param);
  15303. }
  15304. Hide(uiClass) {
  15305. let ui = this.getUI(uiClass);
  15306. if (ui && !ui.isHide) {
  15307. ui.hide();
  15308. }
  15309. }
  15310. getUI(ui) {
  15311. let nameStr = ui.uiName;
  15312. for (let index = 0; index < this._uiList.length; index++) {
  15313. let temp = this._uiList[index];
  15314. if (temp.className == nameStr) {
  15315. return temp;
  15316. }
  15317. }
  15318. return null;
  15319. }
  15320. isShow(cls) {
  15321. for (var i of this._uiList) {
  15322. if (i instanceof cls) {
  15323. return i.isShowing;
  15324. }
  15325. }
  15326. return false;
  15327. }
  15328. showUINum() {
  15329. let num = 0;
  15330. for (var i of this._uiList) {
  15331. if (i.isShowing) {
  15332. num++;
  15333. }
  15334. }
  15335. return num;
  15336. }
  15337. checkUIState() {
  15338. Laya.timer.clear(this, this._uiCheck);
  15339. Laya.timer.once(400, this, this._uiCheck);
  15340. }
  15341. _uiCheck() {
  15342. let showList = [];
  15343. for (var i of this._uiList) {
  15344. if (!i.isHide) {
  15345. showList.push(i);
  15346. }
  15347. }
  15348. for (let index = 0; index < showList.length; index++) {
  15349. if (index == showList.length - 1) {
  15350. showList[index].checkActive(true);
  15351. }
  15352. else {
  15353. showList[index].checkActive(false);
  15354. }
  15355. }
  15356. }
  15357. showTip(msg, time = 600, size = 30) {
  15358. }
  15359. }
  15360. class UIShowList {
  15361. }
  15362. class SoundMgr {
  15363. constructor() {
  15364. this.soundMax = 4;
  15365. this.isLoad = false;
  15366. this.soundMap = {};
  15367. this.isSound = true;
  15368. this.openShake = true;
  15369. SoundMgr._instance = this;
  15370. }
  15371. static getInstance() {
  15372. if (!this._instance) {
  15373. this._instance = new SoundMgr();
  15374. }
  15375. return this._instance;
  15376. }
  15377. init() {
  15378. console.log('zh:sm init 1');
  15379. Laya.SoundManager.autoReleaseSound = true;
  15380. Laya.SoundManager.autoStopMusic = true;
  15381. Laya.SoundManager.musicVolume = 0.3;
  15382. Laya.SoundManager.soundVolume = 0.5;
  15383. this.musicPlayed = false;
  15384. this.audioUrl = "asset/sound/ogg/";
  15385. console.log('zh:sm init 2');
  15386. console.log('zh:dev type ');
  15387. if (Laya.Browser.onAndroid) {
  15388. console.log('zh:dev type android');
  15389. this.audioUrl = "asset/sound/ogg/";
  15390. this.isLoad = true;
  15391. }
  15392. else {
  15393. console.log('zh:dev type not android');
  15394. this.audioUrl = "asset/sound/mp3/";
  15395. this.isLoad = true;
  15396. }
  15397. }
  15398. onSetting(isS) {
  15399. this.isSound = isS;
  15400. this.mute(!this.isSound);
  15401. }
  15402. clearCount() {
  15403. for (var key in this.soundMap) {
  15404. delete this.soundMap[key];
  15405. }
  15406. }
  15407. playMusic(path, loop = 0) {
  15408. console.log('zh:playMusic 1 PATH=' + path);
  15409. this.musicPath = path;
  15410. if (!this.isLoad)
  15411. console.log('zh:playMusic 2');
  15412. return;
  15413. if (!path || path == "")
  15414. console.log('zh:playMusic 3');
  15415. return;
  15416. if (!this.isSound)
  15417. console.log('zh:playMusic 4');
  15418. return;
  15419. this.musicPlayed = true;
  15420. console.log('zh:playMusic 5');
  15421. let url = this.getUrl(path);
  15422. console.log('zh:playMusic 6' + url);
  15423. if (Laya.Browser.onPC) {
  15424. console.log('zh:playMusic 7');
  15425. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15426. console.log('zh:playMusic 8');
  15427. this.play(url, loop);
  15428. }));
  15429. }
  15430. else
  15431. this.play(url, loop);
  15432. }
  15433. play(url, loop) {
  15434. Laya.SoundManager.playMusic(url, loop);
  15435. }
  15436. getUrl(path) {
  15437. let url = this.audioUrl + path;
  15438. if (Laya.Browser.onAndroid) {
  15439. url += ".ogg";
  15440. }
  15441. else {
  15442. url += ".mp3";
  15443. }
  15444. return url;
  15445. }
  15446. pauseMusic(pause) {
  15447. if (pause) {
  15448. this.mute(true);
  15449. }
  15450. else if (this.isSound)
  15451. this.mute(false);
  15452. }
  15453. stopMusic() {
  15454. Laya.SoundManager.stopMusic();
  15455. if (Moyu.isNeedPlatAudio) {
  15456. Moyu.stopMusic();
  15457. }
  15458. }
  15459. mute(mute) {
  15460. if (Moyu.isNeedPlatAudio) {
  15461. Moyu.pauseMusic(mute);
  15462. }
  15463. else {
  15464. Laya.SoundManager.musicMuted = mute;
  15465. if (!mute && !this.musicPlayed && this.musicPath) {
  15466. this.playMusic(this.musicPath);
  15467. }
  15468. }
  15469. }
  15470. stopSound(path) {
  15471. let url = this.getUrl(path);
  15472. Laya.SoundManager.stopSound(url);
  15473. }
  15474. playSound(path, loop = 1, soundMax = this.soundMax) {
  15475. if (!this.isLoad)
  15476. return;
  15477. if (!this.isSound)
  15478. return;
  15479. if (!path || path == "")
  15480. return;
  15481. let url = this.getUrl(path);
  15482. if (Moyu.isNeedPlatAudio) {
  15483. Moyu.playSound(path, loop == 0);
  15484. }
  15485. else {
  15486. let count = 1;
  15487. if (this.soundMap[path])
  15488. count = this.soundMap[path] + 1;
  15489. if (count > soundMax)
  15490. return;
  15491. this.soundMap[path] = count;
  15492. Laya.SoundManager.playSound(url, loop);
  15493. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15494. }
  15495. }
  15496. removePath(path) {
  15497. if (this.soundMap[path]) {
  15498. let count = this.soundMap[path];
  15499. count--;
  15500. if (count < 1)
  15501. delete this.soundMap[path];
  15502. else
  15503. this.soundMap[path] = count;
  15504. }
  15505. }
  15506. playBtnSound() {
  15507. this.playSound("btn");
  15508. }
  15509. playGetSound() {
  15510. }
  15511. playCloseUISound() {
  15512. }
  15513. }
  15514. SoundMgr._instance = null;
  15515. var Handler$1 = Laya.Handler;
  15516. var EResType;
  15517. (function (EResType) {
  15518. EResType[EResType["none"] = 0] = "none";
  15519. EResType[EResType["nromal"] = 1] = "nromal";
  15520. EResType[EResType["td"] = 2] = "td";
  15521. EResType[EResType["sk"] = 3] = "sk";
  15522. })(EResType || (EResType = {}));
  15523. class CResLoader {
  15524. constructor(doneCall, proCall) {
  15525. this.completrCall = doneCall;
  15526. this.progressCall = proCall;
  15527. this.progressHander = new Handler$1(this, this.onProgress);
  15528. this.tdResMap = {};
  15529. }
  15530. load(resList) {
  15531. this.resCount = 0;
  15532. this.loadCount = 0;
  15533. for (let i = 0; i < resList.length; i++) {
  15534. let path = resList[i];
  15535. if (!path)
  15536. continue;
  15537. this.resCount++;
  15538. let type = this.getResType(path);
  15539. if (type == EResType.nromal)
  15540. this.loadNromal(path);
  15541. else if (type == EResType.td)
  15542. this.loadTd(path);
  15543. }
  15544. }
  15545. getRes(path) {
  15546. let type = this.getResType(path);
  15547. if (type == EResType.nromal)
  15548. return Laya.loader.getRes(path);
  15549. else if (type == EResType.td) {
  15550. let res = this.tdResMap[path];
  15551. if (res)
  15552. return res.clone();
  15553. return null;
  15554. }
  15555. }
  15556. destroy() {
  15557. this.progressHander.clear();
  15558. this.progressHander = null;
  15559. }
  15560. clearRes(path) {
  15561. let type = this.getResType(path);
  15562. if (type == EResType.nromal)
  15563. Laya.loader.clearRes(path);
  15564. else if (type == EResType.td) {
  15565. let obj = this.tdResMap[path];
  15566. if (obj)
  15567. obj.destroy();
  15568. delete this.tdResMap[path];
  15569. }
  15570. }
  15571. getResType(path) {
  15572. let exs = this.getExtension(path);
  15573. if (exs == "sk")
  15574. return EResType.sk;
  15575. if (exs == "ls" || exs == "lh" || exs == "lm")
  15576. return EResType.td;
  15577. else
  15578. return EResType.nromal;
  15579. }
  15580. getExtension(res) {
  15581. var index = res.lastIndexOf(".");
  15582. return res.substr(index + 1);
  15583. }
  15584. loadNromal(path) {
  15585. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15586. if (res) {
  15587. this.onLoad();
  15588. }
  15589. else
  15590. console.log("load res fail:" + path);
  15591. }), this.progressHander);
  15592. }
  15593. loadSk() {
  15594. }
  15595. loadTd(path) {
  15596. if (this.tdResMap[path]) {
  15597. this.onLoad();
  15598. return;
  15599. }
  15600. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15601. if (res) {
  15602. this.tdResMap[path] = res;
  15603. this.onLoad();
  15604. }
  15605. else
  15606. console.log("load res fail:" + path);
  15607. }));
  15608. }
  15609. onLoad() {
  15610. this.loadCount++;
  15611. this.onProgress(1);
  15612. if (this.loadCount >= this.resCount) {
  15613. this.completrCall.run();
  15614. }
  15615. }
  15616. onProgress(pro) {
  15617. let progress = (this.loadCount + pro) / this.resCount;
  15618. this.progressCall.runWith(progress);
  15619. }
  15620. }
  15621. var Handler$2 = Laya.Handler;
  15622. class ResInfo {
  15623. constructor() {
  15624. this.index = 0;
  15625. }
  15626. }
  15627. class ResMgr {
  15628. constructor() {
  15629. this.resList = [];
  15630. this.doneList = [];
  15631. this.resMap = {};
  15632. this.currentLoad = null;
  15633. this.completeHandler = new Handler$2(this, this.onComplete);
  15634. this.progressHandler = new Handler$2(this, this.onProgress);
  15635. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15636. }
  15637. static getInstance() {
  15638. if (ResMgr._instance == null) {
  15639. ResMgr._instance = new ResMgr();
  15640. }
  15641. return ResMgr._instance;
  15642. }
  15643. loadList(list, completeHandler, progressHandler) {
  15644. if (list.length < 1) {
  15645. completeHandler.run();
  15646. return;
  15647. }
  15648. let info = this.getResInfo();
  15649. info.resList = list;
  15650. info.completeHandler = completeHandler;
  15651. info.progressHandler = progressHandler;
  15652. this.resList.push(info);
  15653. this.startLoad();
  15654. }
  15655. loadFguiRes(list, completeHandler, progressHandler) {
  15656. Laya.loader.load(list, completeHandler, progressHandler);
  15657. }
  15658. loadAny(list, completeHandler, progressHandler) {
  15659. Laya.loader.load(list, completeHandler, progressHandler);
  15660. }
  15661. load(path, completeHandler, progressHandler) {
  15662. let count = this.resMap[path];
  15663. if (count && count > 0) {
  15664. if (completeHandler)
  15665. completeHandler.run();
  15666. }
  15667. else
  15668. this.loadList([path], completeHandler, progressHandler);
  15669. }
  15670. getRes(path) {
  15671. let res = this.resMap[path];
  15672. if (!res)
  15673. this.showLog("资源不存在:" + path);
  15674. else
  15675. return this.loader.getRes(path);
  15676. }
  15677. clearList(list, force = false) {
  15678. if (!list || list.length < 1)
  15679. return;
  15680. let cr = () => {
  15681. for (const k in list) {
  15682. let v = list[k];
  15683. if (!v)
  15684. continue;
  15685. if (force) {
  15686. this.loader.clearRes(v);
  15687. delete this.resMap[v];
  15688. }
  15689. else {
  15690. let count = this.resMap[v];
  15691. if (count && count > 1) {
  15692. count--;
  15693. this.resMap[v] = count;
  15694. }
  15695. else {
  15696. this.loader.clearRes(v);
  15697. delete this.resMap[v];
  15698. }
  15699. }
  15700. }
  15701. if (!window.hasOwnProperty("ks"))
  15702. Laya.Resource.destroyUnusedResources();
  15703. };
  15704. Laya.timer.clearAll(this);
  15705. Laya.timer.once(2000, this, cr);
  15706. }
  15707. clear3D() {
  15708. for (const k in this.loader.tdResMap) {
  15709. this.loader.clearRes(k);
  15710. if (this.resMap[k])
  15711. delete this.resMap[k];
  15712. }
  15713. if (!window.hasOwnProperty("ks"))
  15714. Laya.Resource.destroyUnusedResources();
  15715. }
  15716. clear(path, force = false) {
  15717. this.clearList([path], force);
  15718. }
  15719. getResInfo() {
  15720. if (this.doneList.length > 0)
  15721. return this.doneList.pop();
  15722. else
  15723. return new ResInfo();
  15724. }
  15725. startLoad() {
  15726. if (this.currentLoad)
  15727. return;
  15728. this.currentLoad = this.resList.pop();
  15729. if (this.currentLoad) {
  15730. this.loader.load(this.currentLoad.resList);
  15731. }
  15732. }
  15733. onComplete() {
  15734. if (!this.currentLoad)
  15735. return;
  15736. for (const k in this.currentLoad.resList) {
  15737. let v = this.currentLoad.resList[k];
  15738. let count = this.resMap[v];
  15739. if (count)
  15740. count++;
  15741. else
  15742. count = 1;
  15743. this.resMap[v] = count;
  15744. }
  15745. if (this.currentLoad.completeHandler)
  15746. this.currentLoad.completeHandler.run();
  15747. this.doneList.push(this.currentLoad);
  15748. this.currentLoad = null;
  15749. this.startLoad();
  15750. }
  15751. onProgress(pro) {
  15752. if (!this.currentLoad)
  15753. return;
  15754. if (this.currentLoad.progressHandler)
  15755. this.currentLoad.progressHandler.runWith(pro);
  15756. }
  15757. showLog(str, ...args) {
  15758. console.log("[ResLoader] " + str);
  15759. }
  15760. }
  15761. ResMgr._instance = null;
  15762. class EventMgr extends Laya.EventDispatcher {
  15763. }
  15764. let eventMgr = new EventMgr();
  15765. class ConfigMgr {
  15766. static getInstance() {
  15767. if (!this._instance) {
  15768. this._instance = new ConfigMgr();
  15769. }
  15770. return this._instance;
  15771. }
  15772. init() {
  15773. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15774. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15775. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15776. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15777. }
  15778. getUserInfoByIndex(index) {
  15779. return this.npcJson[index];
  15780. }
  15781. getRandomUserInfo() {
  15782. let index = xGame.tools.random(0, this.npcJson.length);
  15783. return this.npcJson[index];
  15784. }
  15785. getMaxBigMoveLength() {
  15786. return Object.keys(this.levelCfg).length;
  15787. }
  15788. getBigMoveLevelByIndex(index) {
  15789. let cfg = this.levelCfg;
  15790. cfg = cfg[index];
  15791. return cfg;
  15792. }
  15793. getRandomClassicLevel() {
  15794. let cfg = this.classicCfg;
  15795. let num = Object.keys(cfg).length;
  15796. let rand = xGame.common.randomNum(1, num);
  15797. return cfg[rand];
  15798. }
  15799. getPlaceBallByLevel(level) {
  15800. return this.placeBallCfg[level];
  15801. }
  15802. getMaxPlaceBall() {
  15803. return Object.keys(this.placeBallCfg).length;
  15804. }
  15805. }
  15806. class PoolD3Mgr {
  15807. constructor() {
  15808. this.pool = {};
  15809. }
  15810. static get ins() {
  15811. return this._ins || (this._ins = new PoolD3Mgr);
  15812. }
  15813. createList(key, prefab, parent) {
  15814. if (!this.pool[key]) {
  15815. this.pool[key] = {};
  15816. this.pool[key].prefab = prefab;
  15817. this.pool[key].list = [];
  15818. this.pool[key].parent = parent;
  15819. }
  15820. }
  15821. getItem(key) {
  15822. if (!this.pool[key]) {
  15823. return;
  15824. }
  15825. let temp;
  15826. if (this.pool[key].list.length > 0) {
  15827. temp = this.pool[key].list.pop();
  15828. }
  15829. else {
  15830. temp = this.pool[key].prefab.clone();
  15831. if (this.pool[key].parent) {
  15832. this.pool[key].parent.addChild(temp);
  15833. }
  15834. }
  15835. temp.active = true;
  15836. return temp;
  15837. }
  15838. putItem(key, obj) {
  15839. if (!this.pool[key]) {
  15840. return;
  15841. }
  15842. obj.active = false;
  15843. this.pool[key].list.push(obj);
  15844. }
  15845. }
  15846. let context$1 = context;
  15847. let uiMgr = UIMgr.inst;
  15848. let soundMgr = SoundMgr.getInstance();
  15849. let resMgr = ResMgr.getInstance();
  15850. let httpMgr = HttpMgr.getInstance();
  15851. let common = Common.getInstance();
  15852. let cfgMgr = ConfigMgr.getInstance();
  15853. let poolD3Mgr = PoolD3Mgr.ins;
  15854. let d3TexUrl = "res/d3Res/";
  15855. let d3ModeUrl = "res/unityRes/";
  15856. function setStageSize(view) {
  15857. if (view.width) {
  15858. view.width = Laya.stage.width;
  15859. view.height = Laya.stage.height;
  15860. }
  15861. }
  15862. function filledBg(view) {
  15863. let wh = Laya.stage.height / Laya.stage.width;
  15864. if (wh > 16 / 9) {
  15865. view.height = Laya.stage.height;
  15866. view.width = Laya.stage.height / 1334 * 750;
  15867. }
  15868. else {
  15869. view.width = Laya.stage.width;
  15870. view.height = Laya.stage.width / 750 * 1334;
  15871. }
  15872. }
  15873. function setNotch(view) {
  15874. if (view.height) {
  15875. view.y += context$1.notchHeight;
  15876. }
  15877. }
  15878. function showTip(str) {
  15879. uiMgr.Show(UIMsg, str);
  15880. }
  15881. function log(...args) {
  15882. console.log(args);
  15883. }
  15884. let xGame = {
  15885. context: context$1,
  15886. eventMgr,
  15887. resMgr,
  15888. uiMgr,
  15889. soundMgr,
  15890. define,
  15891. tools,
  15892. httpMgr,
  15893. d3TexUrl,
  15894. d3ModeUrl,
  15895. common,
  15896. cfgMgr,
  15897. poolD3Mgr,
  15898. setStageSize,
  15899. filledBg,
  15900. setNotch,
  15901. showTip,
  15902. log,
  15903. };
  15904. window["xGame"] = xGame;
  15905. let dataName = 'tBall_';
  15906. class UserData {
  15907. constructor() {
  15908. this.userId = "";
  15909. this.isAgree = false;
  15910. this.coinNum = 0;
  15911. this.gemNum = 0;
  15912. this.sound = true;
  15913. this.vibration = true;
  15914. this.currentDate = 0;
  15915. this.createTime = 0;
  15916. this.awardTime = 0;
  15917. this.roleId = 1;
  15918. this.roleList = [];
  15919. this.roleAds = [];
  15920. this.dressId = 101;
  15921. this.itemId = 201;
  15922. this.bigSkills = [1, 1, 1, 1, 1];
  15923. this.coin = 4000;
  15924. this.diamond = 0;
  15925. this.skillSuccessTimes = 0;
  15926. this.skillGuide = 0;
  15927. this.skillAccTimes = 0;
  15928. this.placeBallData = [];
  15929. this.shareDiamondTimes = 0;
  15930. this.dailyVideoShareTimes = 0;
  15931. this.secretary = [1, 0];
  15932. this.curSecretary = 0;
  15933. this.ballRod = [1, 0, 0, 0, 0, 1];
  15934. this.curBallRod = 5;
  15935. this.signData = 0;
  15936. this.signTime = 0;
  15937. this.drawTimes = 0;
  15938. this.drawAwardTimes = 0;
  15939. this.dailyfreeDrawTimes = 1;
  15940. this.power = 5;
  15941. this.powerTime = 0;
  15942. this.challengeTimes = 0;
  15943. this.extraSign = 0;
  15944. this.classicTimes = 0;
  15945. this.guideHelpLine = 0;
  15946. this.newUser = true;
  15947. this.rootBallFoul = 0;
  15948. this.timeoutFoul = 0;
  15949. this.roleList = [1];
  15950. }
  15951. saveData() {
  15952. let data = {};
  15953. for (let k in this) {
  15954. data[k.toString()] = this[k];
  15955. }
  15956. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15957. }
  15958. getData() {
  15959. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15960. if (ld) {
  15961. let localData = JSON.parse(ld);
  15962. if (localData) {
  15963. for (let k in this) {
  15964. let key = k.toString();
  15965. let data = localData[key];
  15966. if (data != undefined) {
  15967. this[k] = data;
  15968. }
  15969. }
  15970. }
  15971. }
  15972. }
  15973. }
  15974. class ItemData {
  15975. constructor() {
  15976. this.itemList = {};
  15977. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15978. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15979. }
  15980. saveData() {
  15981. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15982. }
  15983. getData() {
  15984. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15985. if (ld) {
  15986. let localData = JSON.parse(ld);
  15987. if (localData) {
  15988. this.itemList = localData;
  15989. }
  15990. }
  15991. }
  15992. }
  15993. class GameData {
  15994. constructor() {
  15995. this.curLevel = 0;
  15996. this.gameType = 1;
  15997. this.signIdx = 0;
  15998. this.signMax = 0;
  15999. this.rotaryTime = 0;
  16000. this.rotaryCount = 0;
  16001. this.rotaryList = [];
  16002. this.diyCount = 3;
  16003. this.awardIdx = 0;
  16004. this.shareNum = 2;
  16005. this.rankWeek = 0;
  16006. this.rankScore = 0;
  16007. this.gameCount = 0;
  16008. this.trySkill = -1;
  16009. this.tryTime = 0;
  16010. }
  16011. saveData() {
  16012. let data = {};
  16013. for (let k in this) {
  16014. data[k.toString()] = this[k];
  16015. }
  16016. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16017. }
  16018. getData() {
  16019. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16020. if (ld) {
  16021. let localData = JSON.parse(ld);
  16022. if (localData) {
  16023. for (let k in this) {
  16024. let key = k.toString();
  16025. let data = localData[key];
  16026. if (data != undefined) {
  16027. this[k] = data;
  16028. }
  16029. }
  16030. }
  16031. }
  16032. }
  16033. }
  16034. class DataMgr {
  16035. static Init() {
  16036. this.userData = new UserData();
  16037. this.gameData = new GameData();
  16038. this.itemData = new ItemData();
  16039. this.userData.getData();
  16040. this.gameData.getData();
  16041. this.itemData.getData();
  16042. this.roleId = this.userData.roleId;
  16043. this.resetUse();
  16044. }
  16045. static isNewDay() {
  16046. Moyu.isNewDay(this, (isnew) => {
  16047. xGame.common.isNewDay = isnew;
  16048. if (!isnew)
  16049. return;
  16050. DataMgr.setShareDiamondTimes(0, false);
  16051. DataMgr.setDailyVideoShareTimes(0, false);
  16052. DataMgr.setDailyfreeDrawTimes(1);
  16053. DataMgr.setExtraSign(0);
  16054. });
  16055. }
  16056. static deletData() {
  16057. Laya.LocalStorage.clear();
  16058. }
  16059. static upRankData() {
  16060. let num = xGame.common.getAllStarNum();
  16061. if (num > 0)
  16062. Moyu.upRankData(xGame.common.curRankID, num);
  16063. }
  16064. static addItem(id, count = 1) {
  16065. let v = this.itemData.itemList[id];
  16066. if (!v)
  16067. v = { id: id, count: count, adnum: 0, active: true };
  16068. else {
  16069. if (v.active) {
  16070. v.count += count;
  16071. }
  16072. else {
  16073. v.count = count;
  16074. v.active = true;
  16075. }
  16076. }
  16077. this.itemData.itemList[id] = v;
  16078. xGame.soundMgr.playGetSound();
  16079. this.saveItemData();
  16080. }
  16081. static hasItem(id) {
  16082. let v = this.itemData.itemList[id];
  16083. if (v && v.active)
  16084. return true;
  16085. return false;
  16086. }
  16087. static getItem(id) {
  16088. let v = this.itemData.itemList[id];
  16089. return v;
  16090. }
  16091. static getItemCount(id) {
  16092. let v = this.itemData.itemList[id];
  16093. if (v && v.active)
  16094. return v.count;
  16095. return 0;
  16096. }
  16097. static getItemAd(id) {
  16098. let v = this.itemData.itemList[id];
  16099. if (v) {
  16100. return v.adnum;
  16101. }
  16102. return 0;
  16103. }
  16104. static onItemAd(id, num = 1) {
  16105. let v = this.itemData.itemList[id];
  16106. if (!v)
  16107. v = { id: id, count: 1, adnum: num, active: false };
  16108. else
  16109. v.adnum += num;
  16110. this.itemData.itemList[id] = v;
  16111. this.saveItemData();
  16112. }
  16113. static costItem(id, count) {
  16114. let v = this.itemData.itemList[id];
  16115. if (v && v.active) {
  16116. if (v.count < count)
  16117. return false;
  16118. else {
  16119. v.count -= count;
  16120. this.itemData.itemList[id] = v;
  16121. return true;
  16122. }
  16123. }
  16124. return false;
  16125. }
  16126. static resetUse() {
  16127. this.dressId = this.userData.dressId;
  16128. this.itemId = this.userData.itemId;
  16129. }
  16130. static passLevel() {
  16131. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16132. this.gameData.curLevel++;
  16133. this.curLevel = this.gameData.curLevel;
  16134. this.saveGameData();
  16135. }
  16136. static useRole(id) {
  16137. this.roleId = id;
  16138. if (this.hasRole(id)) {
  16139. this.userData.roleId = id;
  16140. this.saveUserData();
  16141. }
  16142. }
  16143. static addRole(id) {
  16144. if (this.hasRole(id))
  16145. return;
  16146. this.userData.roleList.push(id);
  16147. this.saveUserData();
  16148. }
  16149. static hasRole(id) {
  16150. return this.userData.roleList.indexOf(id) >= 0;
  16151. }
  16152. static gemEnough(num) {
  16153. return this.userData.gemNum >= num;
  16154. }
  16155. static roleHasAd(id) {
  16156. let count = this.userData.roleAds[id];
  16157. if (count != undefined && count >= 0)
  16158. return true;
  16159. else
  16160. return false;
  16161. }
  16162. static saveUserData(time = 1000, event, arg) {
  16163. if (this.userSaving)
  16164. return;
  16165. this.userSaving = true;
  16166. Laya.timer.once(time, this, () => {
  16167. this.userSaving = false;
  16168. this.userData.saveData();
  16169. if (event)
  16170. xGame.eventMgr.event(event, arg);
  16171. });
  16172. }
  16173. static saveGameData() {
  16174. if (this.gameSaving)
  16175. return;
  16176. this.gameSaving = true;
  16177. Laya.timer.once(1000, this, () => {
  16178. this.gameSaving = false;
  16179. this.gameData.saveData();
  16180. });
  16181. }
  16182. static saveItemData() {
  16183. let fun = () => {
  16184. this.itemData.saveData();
  16185. };
  16186. Laya.timer.clear(this, fun);
  16187. Laya.timer.once(500, this, fun);
  16188. }
  16189. static saveData() {
  16190. this.saveUserData();
  16191. this.saveGameData();
  16192. }
  16193. static getBigSkillList() {
  16194. return this.userData.bigSkills;
  16195. }
  16196. static getBigSkillByIndex(index) {
  16197. return this.userData.bigSkills[index];
  16198. }
  16199. static setBigSkill(index, val, addUp = true) {
  16200. if (addUp) {
  16201. this.userData.bigSkills[index] += val;
  16202. }
  16203. else {
  16204. this.userData.bigSkills[index] = val;
  16205. }
  16206. this.saveUserData();
  16207. }
  16208. static coinEnough(need) {
  16209. if (typeof need != "number") {
  16210. console.error("金币格式错误");
  16211. return;
  16212. }
  16213. return this.userData.coin >= need;
  16214. }
  16215. static setCoin(val) {
  16216. if (typeof val != "number") {
  16217. return;
  16218. }
  16219. this.userData.coin += val;
  16220. this.saveUserData();
  16221. xGame.eventMgr.event(COIN_CHANGE);
  16222. }
  16223. static getCoin() {
  16224. return this.userData.coin;
  16225. }
  16226. static diamondEnough(need) {
  16227. if (typeof need != "number") {
  16228. console.error("金币格式错误");
  16229. return;
  16230. }
  16231. return this.userData.diamond >= need;
  16232. }
  16233. static setDiamond(val) {
  16234. if (typeof val != "number") {
  16235. return;
  16236. }
  16237. this.userData.diamond += val;
  16238. this.saveUserData();
  16239. xGame.eventMgr.event(DIAMOND_CHANGE);
  16240. }
  16241. static getDiamond() {
  16242. return this.userData.diamond;
  16243. }
  16244. static getSkillSuccessTimes() {
  16245. return this.userData.skillSuccessTimes;
  16246. }
  16247. static setSkillSuccessTimes(val, addUp = true) {
  16248. if (addUp)
  16249. this.userData.skillSuccessTimes += val;
  16250. else
  16251. this.userData.skillSuccessTimes = val;
  16252. this.saveUserData();
  16253. }
  16254. static getSkillAccTimes() {
  16255. return this.userData.skillAccTimes;
  16256. }
  16257. static setSkillAccTimes(val) {
  16258. this.userData.skillAccTimes += val;
  16259. this.saveUserData();
  16260. }
  16261. static getSkillGuide() {
  16262. if (!xGame.common.openGuide) {
  16263. return 1;
  16264. }
  16265. return this.userData.skillGuide;
  16266. }
  16267. static setSkillGuide(val) {
  16268. this.userData.skillGuide = val;
  16269. this.saveUserData();
  16270. }
  16271. static getPlaceBallLevelList() {
  16272. return this.userData.placeBallData;
  16273. }
  16274. static getPlaceBallLevel(level) {
  16275. let arr = this.userData.placeBallData;
  16276. let index = level - 1;
  16277. let out;
  16278. if (arr[index]) {
  16279. out = arr[index];
  16280. }
  16281. else {
  16282. let max = arr.length;
  16283. if (max == index) {
  16284. out = {
  16285. star: 0,
  16286. play: true,
  16287. isCur: true,
  16288. getAward: false
  16289. };
  16290. }
  16291. else {
  16292. out = {
  16293. star: 0,
  16294. play: false,
  16295. getAward: false
  16296. };
  16297. }
  16298. }
  16299. return out;
  16300. }
  16301. static setPlaceBallLevel(level, star) {
  16302. let arr = this.userData.placeBallData;
  16303. let index = level - 1;
  16304. if (arr[index]) {
  16305. arr[index].star = Math.max(arr[index].star, star);
  16306. }
  16307. else {
  16308. let max = arr.length;
  16309. if (max == index) {
  16310. arr.push({
  16311. star: star,
  16312. play: true,
  16313. getAward: false
  16314. });
  16315. }
  16316. else {
  16317. console.error("关卡存储出错");
  16318. }
  16319. }
  16320. this.saveUserData();
  16321. }
  16322. static setPlaceBallAward(level) {
  16323. let arr = this.userData.placeBallData;
  16324. let index = level - 1;
  16325. if (arr[index]) {
  16326. arr[index].getAward = true;
  16327. }
  16328. this.saveUserData();
  16329. }
  16330. static getShareDiamondTimes() {
  16331. return this.userData.shareDiamondTimes;
  16332. }
  16333. static setShareDiamondTimes(val, addUp = true) {
  16334. if (addUp) {
  16335. this.userData.shareDiamondTimes += val;
  16336. }
  16337. else {
  16338. this.userData.shareDiamondTimes = val;
  16339. }
  16340. this.saveUserData();
  16341. }
  16342. static getDailyVideoShareTimes() {
  16343. return this.userData.dailyVideoShareTimes;
  16344. }
  16345. static setDailyVideoShareTimes(val, addUp = true) {
  16346. if (addUp) {
  16347. this.userData.dailyVideoShareTimes += val;
  16348. }
  16349. else {
  16350. this.userData.dailyVideoShareTimes = val;
  16351. }
  16352. this.saveUserData();
  16353. }
  16354. static getSecretary(index) {
  16355. return this.userData.secretary[index];
  16356. }
  16357. static setSecretary(index, val) {
  16358. this.userData.secretary[index] = val;
  16359. this.saveUserData();
  16360. }
  16361. static getCurSecretary() {
  16362. return this.userData.curSecretary;
  16363. }
  16364. static setCurSecretary(index) {
  16365. this.userData.curSecretary = index;
  16366. this.saveUserData();
  16367. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16368. }
  16369. static getBallRod(index) {
  16370. return this.userData.ballRod[index];
  16371. }
  16372. static setBallRod(index, val) {
  16373. this.userData.ballRod[index] = val;
  16374. this.saveUserData();
  16375. }
  16376. static getCurBallRod() {
  16377. return this.userData.curBallRod;
  16378. }
  16379. static setCurBallRod(index) {
  16380. this.userData.curBallRod = index;
  16381. this.saveUserData();
  16382. }
  16383. static setSignData(val) {
  16384. this.userData.signData = val;
  16385. this.saveUserData();
  16386. }
  16387. static getSignData() {
  16388. return this.userData.signData;
  16389. }
  16390. static setSignTime(val) {
  16391. this.userData.signTime = val;
  16392. this.saveUserData();
  16393. }
  16394. static getSignTime() {
  16395. return this.userData.signTime;
  16396. }
  16397. static getDrawTimes() {
  16398. return this.userData.drawTimes;
  16399. }
  16400. static setDrawTimes(val, addUp = true) {
  16401. if (addUp) {
  16402. this.userData.drawTimes += val;
  16403. }
  16404. else {
  16405. this.userData.drawTimes = val;
  16406. }
  16407. this.saveUserData();
  16408. }
  16409. static getDrawAwardTimes() {
  16410. return this.userData.drawAwardTimes;
  16411. }
  16412. static setDrawAwardTimes(val) {
  16413. this.userData.drawAwardTimes = val;
  16414. this.saveUserData();
  16415. }
  16416. static getDailyfreeDrawTimes() {
  16417. return this.userData.dailyfreeDrawTimes;
  16418. }
  16419. static setDailyfreeDrawTimes(val) {
  16420. this.userData.dailyfreeDrawTimes = val;
  16421. this.saveUserData();
  16422. }
  16423. static setPower(val, addUp = true) {
  16424. if (addUp)
  16425. this.userData.power += val;
  16426. else
  16427. this.userData.power = val;
  16428. if (this.userData.power >= xGame.common.maxPower) {
  16429. this.userData.power = xGame.common.maxPower;
  16430. }
  16431. xGame.eventMgr.event(POWER_CHANGE, val);
  16432. this.saveUserData();
  16433. }
  16434. static getPower() {
  16435. return this.userData.power;
  16436. }
  16437. static setPowerTime(val) {
  16438. this.userData.powerTime = val;
  16439. this.saveUserData();
  16440. }
  16441. static getPowerTime() {
  16442. return this.userData.powerTime;
  16443. }
  16444. static powerEnough() {
  16445. return this.getPower() > 0;
  16446. }
  16447. static getChallengeTimes() {
  16448. return this.userData.challengeTimes;
  16449. }
  16450. static setChallengeTimes(val) {
  16451. this.userData.challengeTimes += val;
  16452. this.saveUserData();
  16453. }
  16454. static getExtraSign() {
  16455. return this.userData.extraSign;
  16456. }
  16457. static setExtraSign(val) {
  16458. this.userData.extraSign = val;
  16459. this.saveUserData();
  16460. }
  16461. static getClassicTimes() {
  16462. return this.userData.classicTimes;
  16463. }
  16464. static setClassicTimes() {
  16465. this.userData.classicTimes += 1;
  16466. this.saveUserData();
  16467. }
  16468. static getGuideHelpLine() {
  16469. return this.userData.guideHelpLine;
  16470. }
  16471. static setGuideHelpLine() {
  16472. this.userData.guideHelpLine = 1;
  16473. this.saveUserData();
  16474. }
  16475. static getNewUser() {
  16476. return this.userData.newUser;
  16477. }
  16478. static setNewUser() {
  16479. this.userData.newUser = false;
  16480. this.saveUserData();
  16481. }
  16482. static getRootBallFoul() {
  16483. return this.userData.rootBallFoul;
  16484. }
  16485. static setRootBallFoul() {
  16486. this.userData.rootBallFoul = 1;
  16487. this.saveUserData();
  16488. }
  16489. static getTimeoutFoul() {
  16490. return this.userData.timeoutFoul;
  16491. }
  16492. static setTimeoutFoul() {
  16493. this.userData.timeoutFoul = 1;
  16494. this.saveUserData();
  16495. }
  16496. }
  16497. DataMgr.isNewUser = false;
  16498. DataMgr.fristEnter = true;
  16499. DataMgr.levelType = 0;
  16500. DataMgr.awardId = 0;
  16501. DataMgr.awardCoin = 0;
  16502. DataMgr.sceneId = -1;
  16503. DataMgr.tryId = 0;
  16504. DataMgr.curLevel = 1;
  16505. DataMgr.vipLevel = 0;
  16506. DataMgr.maxLevel = 0;
  16507. DataMgr.awardRatio = 1;
  16508. DataMgr.gameList = [];
  16509. DataMgr.rankList = [];
  16510. DataMgr.recoverTime = 480000;
  16511. DataMgr.minScore = 0;
  16512. DataMgr.rankDis = 0;
  16513. DataMgr.userSaving = false;
  16514. DataMgr.gameSaving = false;
  16515. class D3Tween extends Laya.Script3D {
  16516. constructor() {
  16517. super();
  16518. this.isInited = false;
  16519. }
  16520. ;
  16521. init() {
  16522. if (this.isInited)
  16523. return;
  16524. this.isInited = true;
  16525. this.gameObj = this.owner;
  16526. this.transform = this.gameObj.transform;
  16527. }
  16528. get rotX() {
  16529. return this.transform.localRotationEulerX;
  16530. }
  16531. set rotX(v) {
  16532. this.transform.localRotationEulerX = v;
  16533. }
  16534. get rotY() {
  16535. return this.transform.localRotationEulerY;
  16536. }
  16537. set rotY(v) {
  16538. this.transform.localRotationEulerY = v;
  16539. }
  16540. get rotZ() {
  16541. return this.transform.localRotationEulerZ;
  16542. }
  16543. set rotZ(v) {
  16544. this.transform.localRotationEulerZ = v;
  16545. }
  16546. get posX() {
  16547. return this.transform.localPositionX;
  16548. }
  16549. set posX(v) {
  16550. this.transform.localPositionX = v;
  16551. }
  16552. get posY() {
  16553. return this.transform.localPositionY;
  16554. }
  16555. set posY(v) {
  16556. this.transform.localPositionY = v;
  16557. }
  16558. get posZ() {
  16559. return this.transform.localPositionZ;
  16560. }
  16561. set posZ(v) {
  16562. this.transform.localPositionZ = v;
  16563. }
  16564. get rotation() {
  16565. return this.transform.localRotation;
  16566. }
  16567. set rotation(v) {
  16568. this.transform.localRotation = v;
  16569. }
  16570. }
  16571. class D2Hole extends Laya.Script {
  16572. constructor() { super(); }
  16573. onTriggerEnter(collider) {
  16574. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16575. return;
  16576. }
  16577. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16578. if (collider.owner["mySrc"].isRunSkillAni) {
  16579. return;
  16580. }
  16581. if (collider.owner["mySrc"].number != 0) {
  16582. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16583. }
  16584. xGame.common.ballColliHole(collider);
  16585. xGame.common.recoverCameraView();
  16586. }
  16587. }
  16588. }
  16589. class Table extends Laya.Script3D {
  16590. constructor() {
  16591. super();
  16592. this.isSetBorder = false;
  16593. this.inited = false;
  16594. }
  16595. ;
  16596. onAwake() {
  16597. this.init();
  16598. }
  16599. init() {
  16600. if (this.inited)
  16601. return;
  16602. this.inited = true;
  16603. this.gameObj = this.owner;
  16604. this.border = this.gameObj.getChildByName("border");
  16605. }
  16606. setBorderPos() {
  16607. if (this.isSetBorder)
  16608. return;
  16609. this.isSetBorder = true;
  16610. let ui = xGame.common.gameUI.ui;
  16611. let bar1 = this.border.getChildByName("bar1");
  16612. let bar2 = this.border.getChildByName("bar2");
  16613. let bar3 = this.border.getChildByName("bar3");
  16614. let bar4 = this.border.getChildByName("bar4");
  16615. let bar5 = this.border.getChildByName("bar5");
  16616. let bar6 = this.border.getChildByName("bar6");
  16617. this.setInfo(bar1, ui.border.bar1, "box");
  16618. this.setInfo(bar2, ui.border.bar2, "box");
  16619. this.setInfo(bar3, ui.border.bar3, "box");
  16620. this.setInfo(bar4, ui.border.bar4, "box");
  16621. this.setInfo(bar5, ui.border.bar5, "box");
  16622. this.setInfo(bar6, ui.border.bar6, "box");
  16623. let circle1 = this.border.getChildByName("circle1");
  16624. let circle2 = this.border.getChildByName("circle2");
  16625. let circle3 = this.border.getChildByName("circle3");
  16626. let circle4 = this.border.getChildByName("circle4");
  16627. let circle5 = this.border.getChildByName("circle5");
  16628. let circle6 = this.border.getChildByName("circle6");
  16629. this.setInfo(circle1, ui.border.circle1, "circle");
  16630. this.setInfo(circle2, ui.border.circle2, "circle");
  16631. this.setInfo(circle3, ui.border.circle3, "circle");
  16632. this.setInfo(circle4, ui.border.circle4, "circle");
  16633. this.setInfo(circle5, ui.border.circle5, "circle");
  16634. this.setInfo(circle6, ui.border.circle6, "circle");
  16635. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16636. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16637. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16638. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16639. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16640. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16641. let arr = xGame.common.gameMgr.holePosList;
  16642. xGame.common.gameMgr.posObj = {
  16643. "1": arr[0],
  16644. "3": arr[2],
  16645. "4": arr[3],
  16646. "6": arr[5]
  16647. };
  16648. }
  16649. initHolePos(x, y) {
  16650. if (x < 300)
  16651. x += 25;
  16652. else if (x > 1000)
  16653. x -= 25;
  16654. else if (y > 200)
  16655. y -= 10;
  16656. else
  16657. y += 10;
  16658. if (y < 200)
  16659. y += 30;
  16660. else if (y > 500)
  16661. y -= 30;
  16662. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16663. }
  16664. setInfo(d3Obj, d2Obj, type) {
  16665. let ui = xGame.common.gameUI.ui;
  16666. let sprite = new Laya.Sprite();
  16667. ui.border.displayObject.addChild(sprite);
  16668. let colli = xGame.common.getCollider(type);
  16669. sprite.addComponentIntance(colli);
  16670. let rigy = xGame.common.getRigbody();
  16671. rigy.type = "static";
  16672. sprite.addComponentIntance(rigy);
  16673. let d3Pos = d3Obj.transform.position;
  16674. xGame.common.pos3to2Convert(d3Pos);
  16675. let scaleX = d3Obj.transform.localScaleX;
  16676. let scaleZ = d3Obj.transform.localScaleZ;
  16677. let width = xGame.common.scale3to2Convert(scaleZ);
  16678. let height = xGame.common.scale3to2Convert(scaleX);
  16679. sprite.pivotX = width / 2;
  16680. sprite.pivotY = height / 2;
  16681. sprite.x = d3Pos.x;
  16682. sprite.y = d3Pos.y;
  16683. sprite.width = width;
  16684. sprite.height = height;
  16685. d2Obj.x = d3Pos.x;
  16686. d2Obj.y = d3Pos.y;
  16687. d2Obj.width = width;
  16688. d2Obj.height = height;
  16689. if (type == "box") {
  16690. colli.width = width;
  16691. colli.height = height;
  16692. colli.isSensor = false;
  16693. colli.label = "border";
  16694. }
  16695. else {
  16696. colli.radius = width / 2;
  16697. colli.isSensor = true;
  16698. colli.label = "hole";
  16699. sprite.addComponent(D2Hole);
  16700. }
  16701. }
  16702. }
  16703. class D3World extends Laya.Script3D {
  16704. constructor() {
  16705. super();
  16706. this.loadNum = 0;
  16707. this.setLoadNum = 7;
  16708. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16709. }
  16710. onAwake() {
  16711. }
  16712. loadScene() {
  16713. this.scene = this.owner;
  16714. let url = `res/unityRes/root.lh`;
  16715. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16716. this.scene.addChild(prefab);
  16717. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16718. this.putCameraInfo();
  16719. this.camera.enableHDR = false;
  16720. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16721. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16722. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16723. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16724. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16725. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16726. this.knife.active = false;
  16727. this.loadD3Obj();
  16728. }));
  16729. }
  16730. putCameraInfo() {
  16731. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16732. this.cameraObj = new cameraType();
  16733. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16734. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16735. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16736. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16737. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16738. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16739. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16740. this.visitAngleChild.init();
  16741. this.visitRootObj.posX = this.visitAngleChild.posX;
  16742. this.visitRootObj.posY = this.visitAngleChild.posY;
  16743. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16744. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16745. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16746. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16747. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16748. xGame.common.showOneCamera("mainCamera");
  16749. }
  16750. loadD3Obj() {
  16751. this.loadTable();
  16752. this.loadRoom();
  16753. this.loadInHoleParticial();
  16754. this.loadIceParticial();
  16755. this.loadHitParticial();
  16756. this.loadFireworksParticial();
  16757. this.loadBall();
  16758. }
  16759. loadInHoleParticial() {
  16760. this.loadD3Res("inHoleEft", "", (prefab) => {
  16761. prefab.addComponent(Partical);
  16762. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16763. });
  16764. }
  16765. loadIceParticial() {
  16766. this.loadD3Res("iceEft", "", (prefab) => {
  16767. prefab.addComponent(Partical);
  16768. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16769. });
  16770. }
  16771. loadHitParticial() {
  16772. this.loadD3Res("hitEft", "", (prefab) => {
  16773. prefab.addComponent(Partical);
  16774. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16775. });
  16776. }
  16777. loadFireworksParticial() {
  16778. this.loadD3Res("fireworksEft", "", (prefab) => {
  16779. prefab.addComponent(Partical);
  16780. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16781. });
  16782. }
  16783. loadBall(index = 1) {
  16784. this.loadD3Res("ball", index, (prefab) => {
  16785. this.ballPrefab = prefab;
  16786. this.ballPrefab.addComponent(Ball);
  16787. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16788. });
  16789. }
  16790. loadTable(index = 1) {
  16791. this.loadD3Res("table", index, (prefab) => {
  16792. this.tableSrc = prefab.addComponent(Table);
  16793. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16794. this.d3Hand.init();
  16795. this.tableRoot.addChild(prefab);
  16796. });
  16797. }
  16798. loadRoom(index = 1) {
  16799. this.loadD3Res("room", index, (prefab) => {
  16800. this.roomRoot.addChild(prefab);
  16801. });
  16802. }
  16803. loadD3Res(type, index, callback) {
  16804. let url = `res/unityRes/${type}${index}.lh`;
  16805. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16806. callback && callback(prefab);
  16807. this.checkResLoad();
  16808. }));
  16809. }
  16810. checkResLoad() {
  16811. this.loadNum++;
  16812. if (this.loadNum >= this.setLoadNum) {
  16813. xGame.eventMgr.event(D3RES_LOADED);
  16814. }
  16815. }
  16816. prePlayEft() {
  16817. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16818. eft.transform.localPositionX = 0;
  16819. eft.transform.localPositionY = -5;
  16820. eft.transform.localPositionZ = 0;
  16821. eft.active = true;
  16822. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16823. ice.transform.localPositionX = 0;
  16824. ice.transform.localPositionY = -5;
  16825. ice.transform.localPositionZ = 0;
  16826. ice.active = true;
  16827. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16828. hit.transform.localPositionX = 0;
  16829. hit.transform.localPositionY = -5;
  16830. hit.transform.localPositionZ = 0;
  16831. hit.active = true;
  16832. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16833. fireworks.transform.localPositionX = 0;
  16834. fireworks.transform.localPositionY = -5;
  16835. fireworks.transform.localPositionZ = 0;
  16836. fireworks.active = true;
  16837. }
  16838. }
  16839. class cameraType {
  16840. }
  16841. class MoyuMgr$1 {
  16842. static initMoyu() {
  16843. this.moyuView = new MoyuView$1();
  16844. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16845. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16846. this.moyuView.ui.displayObject.zOrder = 1000;
  16847. this.moyuView.init();
  16848. this.moyuView.showTip(true);
  16849. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16850. window['XApk'] = this;
  16851. }
  16852. static showAge(show) {
  16853. if (this.moyuView)
  16854. this.moyuView.showAge(show);
  16855. }
  16856. static onPlatMsg(idx) {
  16857. if (!MoyuMgr$1.moyuView)
  16858. return;
  16859. if (idx == '0') {
  16860. MoyuMgr$1.moyuView.showTip(false);
  16861. }
  16862. }
  16863. static showAgree(call) {
  16864. if (this.moyuView)
  16865. this.moyuView.showAgree(call);
  16866. else
  16867. call && call();
  16868. }
  16869. static showXy(type = 1) {
  16870. if (this.moyuView)
  16871. this.moyuView.showXy(type);
  16872. }
  16873. }
  16874. MoyuMgr$1.isAdvise = false;
  16875. class MoyuView$1 {
  16876. constructor() {
  16877. this.ysxyNum = 1;
  16878. this.ysJson = null;
  16879. this.ui = ui_UIMoyu.createInstance();
  16880. }
  16881. init() {
  16882. this.ui.mainBg.visible = false;
  16883. this.ui.xyNode.visible = false;
  16884. this.ui.ageNode.visible = false;
  16885. this.ui.tipNode.visible = false;
  16886. this.ui.rnNode.visible = false;
  16887. this.ui.fcmNode.visible = false;
  16888. this.ui.ageTip.visible = false;
  16889. this.ui.msgNode.visible = false;
  16890. this.ui.visible = false;
  16891. this.ui.xyNode.xyList.setVirtual();
  16892. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16893. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16894. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16895. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16896. this.ui.xyNode.btnKnown.visible = false;
  16897. this.ui.xyNode.xy1.visible = false;
  16898. this.ui.xyNode.xy2.visible = false;
  16899. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16900. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16901. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16902. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16903. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16904. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16905. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16906. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16907. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16908. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16909. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16910. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16911. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16912. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16913. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16914. this.ysxyNum = 2;
  16915. }
  16916. }
  16917. onClick(obj) {
  16918. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16919. switch (obj) {
  16920. case this.ui.ageTip:
  16921. if (Moyu.isTTApk) {
  16922. this.ui.ageNode.visible = true;
  16923. this.ui.mainBg.visible = true;
  16924. }
  16925. break;
  16926. case this.ui.tipNode:
  16927. this.showTip(false);
  16928. break;
  16929. case this.ui.ageNode.btnAge:
  16930. this.ui.ageNode.visible = false;
  16931. this.ui.mainBg.visible = false;
  16932. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16933. this.ui.visible = false;
  16934. break;
  16935. case this.ui.xyNode.btnXy3:
  16936. case this.ui.xyNode.btnXy1:
  16937. this.loadXy(1);
  16938. break;
  16939. case this.ui.xyNode.btnXy2:
  16940. this.loadXy(2);
  16941. break;
  16942. case this.ui.xyNode.btnBack:
  16943. this.ui.xyNode.xy1.visible = true;
  16944. this.ui.xyNode.xy2.visible = false;
  16945. break;
  16946. case this.ui.xyNode.btnKnown:
  16947. this.ui.xyNode.visible = false;
  16948. this.ui.mainBg.visible = false;
  16949. this.ui.visible = false;
  16950. break;
  16951. case this.ui.rnNode.btnCheck:
  16952. this.check();
  16953. break;
  16954. case this.ui.rnNode.btnExit:
  16955. case this.ui.xyNode.btnNo:
  16956. this.ysxyNum--;
  16957. if (this.ysxyNum > 0)
  16958. this.showMsg("Refuse to quit the game once again");
  16959. else {
  16960. Moyu.userAgree(false);
  16961. Moyu.exit();
  16962. }
  16963. break;
  16964. case this.ui.xyNode.btnSure:
  16965. case this.ui.xyNode.btnYes:
  16966. DataMgr.userData.isAgree = true;
  16967. DataMgr.saveUserData();
  16968. this.onAgree();
  16969. break;
  16970. case this.ui.rnNode.btnDone:
  16971. this.ui.rnNode.visible = false;
  16972. this.ui.visible = false;
  16973. break;
  16974. case this.ui.fcmNode.btnRn:
  16975. this.showRn();
  16976. break;
  16977. }
  16978. }
  16979. showTip(show) {
  16980. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16981. return;
  16982. if (show) {
  16983. MoyuMgr$1.isAdvise = true;
  16984. this.ui.visible = true;
  16985. this.ui.tipNode.visible = true;
  16986. this.ui.tipNode.alpha = 1;
  16987. Laya.timer.once(1000, this, this.showTip, [false]);
  16988. }
  16989. else {
  16990. this.ui.tipNode.alpha = 1;
  16991. this.ui.tipNode.visible = true;
  16992. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  16993. this.ui.tipNode.visible = false;
  16994. MoyuMgr$1.isAdvise = false;
  16995. }), 1000);
  16996. }
  16997. }
  16998. showAge(show, px = 0, py = 0) {
  16999. if (Moyu.platType > 10 && !Moyu.isIos) {
  17000. this.ui.ageTip.x = px;
  17001. this.ui.ageTip.y = py;
  17002. this.ui.ageTip.visible = show;
  17003. if (show)
  17004. this.ui.visible = true;
  17005. }
  17006. }
  17007. showAgree(call) {
  17008. this.agreeCall = call;
  17009. this.onAgree();
  17010. return;
  17011. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17012. this.showXy(0);
  17013. }
  17014. else
  17015. this.onAgree();
  17016. }
  17017. onAgree() {
  17018. if (!this.ui.ageNode.visible)
  17019. this.ui.visible = false;
  17020. this.ui.xyNode.visible = false;
  17021. Moyu.userAgree(true);
  17022. this.showAge(false);
  17023. this.agreeCall && this.agreeCall();
  17024. this.showRn();
  17025. }
  17026. showMsg(txt) {
  17027. this.ui.msgNode.txtMsg.text = txt;
  17028. this.ui.msgNode.visible = true;
  17029. this.ui.msgNode.alpha = 1;
  17030. this.ui.visible = true;
  17031. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17032. this.ui.msgNode.visible = false;
  17033. }), 2500, true);
  17034. }
  17035. showRn() {
  17036. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17037. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17038. this.ui.rnNode.rn1.visible = true;
  17039. this.ui.rnNode.rn2.visible = false;
  17040. this.ui.rnNode.rn3.visible = false;
  17041. this.ui.rnNode.rn4.visible = false;
  17042. this.ui.rnNode.visible = true;
  17043. this.ui.mainBg.visible = true;
  17044. this.ui.rnNode.btnDone.visible = false;
  17045. this.ui.rnNode.btnExit.visible = true;
  17046. this.ui.rnNode.btnCheck.visible = true;
  17047. this.ui.fcmNode.visible = false;
  17048. this.ui.visible = true;
  17049. return;
  17050. }
  17051. }
  17052. this.showFcm();
  17053. }
  17054. showFcm() {
  17055. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17056. Moyu.initFCM(true);
  17057. if (Moyu.gameTime < 1)
  17058. this.fcmLoop();
  17059. else if (Moyu.gameTime < 999)
  17060. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17061. }
  17062. }
  17063. fcmLoop() {
  17064. if (Moyu.gameTime < 1) {
  17065. this.ui.rnNode.visible = false;
  17066. this.ui.fcmNode.visible = true;
  17067. this.ui.mainBg.visible = true;
  17068. this.ui.visible = true;
  17069. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17070. Laya.timer.clear(this.ui, this.fcmLoop);
  17071. }
  17072. }
  17073. check() {
  17074. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17075. this.ui.rnNode.rn1.visible = false;
  17076. this.ui.rnNode.rn2.visible = false;
  17077. this.ui.rnNode.rn4.visible = true;
  17078. }
  17079. else if (this.ui.rnNode.rn4.visible) {
  17080. let name = this.ui.rnNode.inputName.text;
  17081. let code = this.ui.rnNode.inputCode.text;
  17082. if (code && code.length == 18) {
  17083. this.ui.rnNode.rn1.visible = false;
  17084. this.ui.rnNode.rn4.visible = false;
  17085. Moyu.authenticate(name, code, (res) => {
  17086. this.ui.rnNode.rn2.visible = !res;
  17087. this.ui.rnNode.rn3.visible = res;
  17088. this.ui.rnNode.btnDone.visible = res;
  17089. this.ui.rnNode.btnExit.visible = !res;
  17090. this.ui.rnNode.btnCheck.visible = !res;
  17091. if (res)
  17092. this.showFcm();
  17093. });
  17094. }
  17095. else
  17096. this.showMsg("信息填写不完整");
  17097. }
  17098. }
  17099. loadXy(type = 0) {
  17100. this.ui.xyNode.xy1.visible = false;
  17101. this.ui.xyNode.xy2.visible = true;
  17102. this.ui.xyNode.xyList.scrollToView(0);
  17103. if (type == 1) {
  17104. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17105. }
  17106. else if (type == 2) {
  17107. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17108. }
  17109. }
  17110. showXy(type = 0) {
  17111. this.xyBtn();
  17112. if (type == 0) {
  17113. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17114. this.ui.xyNode.btnSure.visible = true;
  17115. }
  17116. else {
  17117. this.ui.xyNode.btnYes.visible = true;
  17118. this.ui.xyNode.btnNo.visible = true;
  17119. }
  17120. }
  17121. else {
  17122. this.ui.xyNode.btnKnown.visible = true;
  17123. this.ui.mainBg.visible = true;
  17124. }
  17125. this.ui.xyNode.xy1.visible = true;
  17126. this.ui.xyNode.xy2.visible = false;
  17127. this.ui.xyNode.visible = true;
  17128. this.ui.visible = true;
  17129. }
  17130. xyBtn() {
  17131. this.ui.xyNode.btnSure.visible = false;
  17132. this.ui.xyNode.btnYes.visible = false;
  17133. this.ui.xyNode.btnNo.visible = false;
  17134. this.ui.xyNode.btnKnown.visible = false;
  17135. {
  17136. this.ui.xyNode.btnXy3.visible = false;
  17137. this.ui.xyNode.btnXy2.visible = true;
  17138. this.ui.xyNode.btnXy1.visible = true;
  17139. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17140. }
  17141. }
  17142. createXY(json) {
  17143. this.ysJson = json.content;
  17144. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17145. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17146. this.ui.xyNode.xy2.visible = true;
  17147. }
  17148. renderListItem(idx, cell) {
  17149. let xy = this.ysJson[idx];
  17150. cell.height = xy.line * 30;
  17151. cell.xyItem.text = xy.text;
  17152. }
  17153. onDestroy() {
  17154. this.agreeCall = null;
  17155. }
  17156. }
  17157. class UILoading extends UIBase {
  17158. constructor() {
  17159. super();
  17160. this.accTime = 0;
  17161. this.curNum = 0;
  17162. this.rate = 1;
  17163. this.loadSubOk = false;
  17164. this.loadResOK = false;
  17165. this.openLoading = true;
  17166. this.beginLoadRes = false;
  17167. this.finishD2 = false;
  17168. this.finishD3 = false;
  17169. }
  17170. onConstructor() {
  17171. this.ui = ui_UILoading.createInstance();
  17172. this.contentPane = this.ui;
  17173. this.isEject = false;
  17174. this._initUI();
  17175. this._addEvent();
  17176. }
  17177. _initUI() {
  17178. MoyuMgr$1.initMoyu();
  17179. }
  17180. _addEvent() {
  17181. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17182. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17183. }
  17184. show() {
  17185. super.show();
  17186. console.log('zh:加载分包资源');
  17187. loadSubRes(this.subResProgress.bind(this));
  17188. this.ui.txtLoad.text = "Loading...";
  17189. }
  17190. subResProgress(pro, finish) {
  17191. this.curNum = pro;
  17192. if (finish) {
  17193. this.curNum = 1;
  17194. this.loadSubOk = true;
  17195. }
  17196. }
  17197. laodD3Res() {
  17198. let scene3D = new Laya.Scene3D();
  17199. xGame.common.d3Scene = scene3D;
  17200. xGame.common.d3World = scene3D.addComponent(D3World);
  17201. xGame.common.d3World.loadScene();
  17202. }
  17203. loadD2Res() {
  17204. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17205. this.finishD2 = true;
  17206. this.checkLoadAll();
  17207. this.curNum = 1;
  17208. }), Laya.Handler.create(this, (pro) => {
  17209. this.curNum = pro;
  17210. }, null, false));
  17211. }
  17212. d3ResFinish() {
  17213. this.finishD3 = true;
  17214. this.checkLoadAll();
  17215. }
  17216. checkLoadAll() {
  17217. if (this.finishD2 && this.finishD3) {
  17218. this.loadResOK = true;
  17219. }
  17220. }
  17221. loadRes() {
  17222. this.laodD3Res();
  17223. this.loadD2Res();
  17224. }
  17225. myUpdate(dt) {
  17226. if (!this.openLoading)
  17227. return;
  17228. this.accTime += dt * this.rate;
  17229. if (this.accTime >= this.curNum)
  17230. this.accTime = this.curNum;
  17231. this.ui.loadinfo.value = this.accTime * 100;
  17232. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17233. if (!this.beginLoadRes) {
  17234. this.beginLoadRes = true;
  17235. this.ui.txtLoad.text = "Loading...";
  17236. this.curNum = 0;
  17237. this.accTime = 0;
  17238. this.loadRes();
  17239. }
  17240. if (this.loadResOK) {
  17241. this.openLoading = false;
  17242. Laya.timer.once(300, this, () => {
  17243. xGame.common.d3Scene.active = false;
  17244. MoyuMgr$1.showAgree(enterGame);
  17245. });
  17246. }
  17247. }
  17248. }
  17249. release() {
  17250. }
  17251. hide() {
  17252. super.hide();
  17253. this.release();
  17254. }
  17255. onClose() {
  17256. this.hide();
  17257. }
  17258. }
  17259. UILoading.uiName = "UILoading";
  17260. class UIRepentProp$1 extends UIBase {
  17261. constructor() {
  17262. super();
  17263. this.viewType = 0;
  17264. this.regretType = 0;
  17265. }
  17266. onConstructor() {
  17267. this.ui = ui_UIRepentProp.createInstance();
  17268. this.contentPane = this.ui;
  17269. this.isEject = false;
  17270. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17271. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17272. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17273. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17274. }
  17275. show(viewType, regretType, callback) {
  17276. PlatMgr.showInsert(true);
  17277. this.viewType = viewType;
  17278. this.regretType = regretType;
  17279. this.callback = callback;
  17280. super.show();
  17281. this.ui.t0.play();
  17282. this.ui.c1.selectedIndex = this.viewType;
  17283. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17284. if (this.viewType == 0) {
  17285. let guide = DataMgr.getGuideHelpLine();
  17286. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17287. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17288. }
  17289. xGame.common.gameMgr.gamePause = true;
  17290. }
  17291. hideSelf() {
  17292. xGame.common.gameMgr.gamePause = false;
  17293. this.callback && this.callback(false);
  17294. this.hide();
  17295. }
  17296. videoRegret() {
  17297. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17298. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17299. }
  17300. else {
  17301. console.log('zh:AD 失败,直接发放奖励');
  17302. this.qjff_AD_for_UIrepentProp_videoRegret();
  17303. }
  17304. }
  17305. qjff_AD_for_UIrepentProp_videoRegret() {
  17306. this.callback && this.callback(true);
  17307. this.hideSelf();
  17308. }
  17309. videoAddHelpLine() {
  17310. let guide = DataMgr.getGuideHelpLine();
  17311. if (guide == 0) {
  17312. this.callback && this.callback(true);
  17313. this.hideSelf();
  17314. DataMgr.setGuideHelpLine();
  17315. xGame.common.gameUI.ui.guideNode.visible = false;
  17316. }
  17317. else {
  17318. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17319. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17320. }
  17321. else {
  17322. console.log('zh:AD 失败,直接发放奖励');
  17323. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17324. }
  17325. }
  17326. }
  17327. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17328. this.callback && this.callback(true);
  17329. this.hideSelf();
  17330. }
  17331. }
  17332. UIRepentProp$1.uiName = "UIRepentProp";
  17333. class UIRodMethod$1 extends UIBase {
  17334. constructor() {
  17335. super();
  17336. this.isPressd = false;
  17337. }
  17338. onConstructor() {
  17339. this.ui = ui_UIRodMethod.createInstance();
  17340. this.contentPane = this.ui;
  17341. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17342. this.moveDir = new Laya.Vector2();
  17343. this.moveDest = new Laya.Vector2();
  17344. this.centerPos = new Laya.Vector2();
  17345. xGame.common.uiRodMethod = this;
  17346. }
  17347. show() {
  17348. super.show();
  17349. xGame.common.gameMgr.gamePause = true;
  17350. this.openPressDotEvent();
  17351. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17352. this.centerPos.x = this.ui.white.x;
  17353. this.centerPos.y = this.ui.white.y;
  17354. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17355. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17356. this.setDot();
  17357. }
  17358. setDot() {
  17359. this.ui.dot.x = this.moveDest.x;
  17360. this.ui.dot.y = this.moveDest.y;
  17361. }
  17362. closeSelf() {
  17363. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17364. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17365. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17366. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17367. xGame.common.gameMgr.gamePause = false;
  17368. this.hide();
  17369. }
  17370. openPressDotEvent() {
  17371. this.closePressDotEvent();
  17372. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17373. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17374. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17375. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17376. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17377. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17378. }
  17379. closePressDotEvent() {
  17380. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17381. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17382. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17383. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17384. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17385. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17386. }
  17387. onDown(e) {
  17388. if (e.type == Laya.Event.MOUSE_DOWN)
  17389. this.isPressd = true;
  17390. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17391. this.isPressd = false;
  17392. if (!this.isPressd)
  17393. return;
  17394. this.moveDest.x = e.stageX;
  17395. this.moveDest.y = e.stageY;
  17396. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17397. if (dis > 6724) {
  17398. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17399. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17400. }
  17401. this.setDot();
  17402. }
  17403. resetRod() {
  17404. this.ui.dot.x = this.ui.white.x;
  17405. this.ui.dot.y = this.ui.white.y;
  17406. this.gameRod.dot.x = this.gameRod.bg.x;
  17407. this.gameRod.dot.y = this.gameRod.bg.y;
  17408. xGame.common.rodOffest.x = 0;
  17409. xGame.common.rodOffest.y = 0;
  17410. }
  17411. }
  17412. UIRodMethod$1.uiName = "UIRodMethod";
  17413. class UIMsg$1 extends UIBase {
  17414. constructor() {
  17415. super();
  17416. }
  17417. onConstructor() {
  17418. this.ui = ui_UIMsg.createInstance();
  17419. this.contentPane = this.ui;
  17420. this.isEject = false;
  17421. this.isMuti = true;
  17422. }
  17423. show(msg, callback) {
  17424. super.show();
  17425. this.ui.tipsNode.msgTxt.text = msg;
  17426. this.ui.alpha = 1;
  17427. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17428. this.hide();
  17429. callback && callback();
  17430. }), 1000);
  17431. }
  17432. }
  17433. UIMsg$1.uiName = "UIMsg";
  17434. class UITips$1 extends UIBase {
  17435. constructor() {
  17436. super();
  17437. this.type = 0;
  17438. }
  17439. onConstructor() {
  17440. this.ui = ui_UITips.createInstance();
  17441. this.contentPane = this.ui;
  17442. this.isEject = false;
  17443. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17444. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17445. }
  17446. show(tipsTxt, womanTxt, type) {
  17447. super.show();
  17448. this.ui.t0.play();
  17449. this.ui.myNode.tipsTxt.text = tipsTxt;
  17450. this.ui.myNode.womanTxt.text = womanTxt;
  17451. PlatMgr.showInsert(true);
  17452. this.ui.myNode.c1.selectedIndex = type;
  17453. this.type = type;
  17454. switch (this.type) {
  17455. case TipsType.exitGame:
  17456. xGame.common.gameMgr.gamePause = true;
  17457. break;
  17458. case TipsType.foul:
  17459. Laya.timer.once(200, this, () => {
  17460. xGame.common.gameMgr.gamePause = true;
  17461. });
  17462. break;
  17463. default:
  17464. break;
  17465. }
  17466. }
  17467. clickLeftBtn() {
  17468. this.hide();
  17469. xGame.common.gameMgr.gamePause = false;
  17470. switch (this.type) {
  17471. case TipsType.exitGame:
  17472. break;
  17473. case TipsType.foul:
  17474. break;
  17475. default:
  17476. break;
  17477. }
  17478. }
  17479. clickRightBtn() {
  17480. this.hide();
  17481. switch (this.type) {
  17482. case TipsType.exitGame:
  17483. xGame.eventMgr.event(RESET_GAME);
  17484. xGame.uiMgr.Show(UIMain$1);
  17485. Moyu.recordEnd(this, null);
  17486. xGame.common.longHelpLine = false;
  17487. break;
  17488. case TipsType.foul:
  17489. xGame.common.gameMgr.gamePause = false;
  17490. Laya.timer.clearAll(this);
  17491. break;
  17492. default:
  17493. break;
  17494. }
  17495. }
  17496. }
  17497. UITips$1.uiName = "UITips";
  17498. class UIGame$1 extends UIBase {
  17499. constructor() {
  17500. super();
  17501. this.powerNum = 0;
  17502. this.isD3Inited = false;
  17503. this.isPrePlay = false;
  17504. this.isMoveRod = false;
  17505. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17506. this.rulerDis = 20;
  17507. this.rulerOffset = 0;
  17508. }
  17509. onConstructor() {
  17510. this.ui = ui_UIGame.createInstance();
  17511. this.contentPane = this.ui;
  17512. this.ui.x += xGame.common.sysOffestNum;
  17513. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17514. this.isEject = false;
  17515. xGame.common.gameUI = this;
  17516. this.initSelf();
  17517. }
  17518. isTurnSelf() {
  17519. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17520. return true;
  17521. }
  17522. }
  17523. initSelf() {
  17524. let topUI = this.ui.topNode;
  17525. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17526. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17527. this.barInfo = {};
  17528. this.barInfo.curY = 0;
  17529. this.barInfo.height = this.ui.powerNode.height;
  17530. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17531. this.barInfo.powerStartY = this.ui.powerNode.y;
  17532. xGame.common.aiPlayer = new AIPlayer();
  17533. xGame.common.gameMgr = new GameMgr();
  17534. xGame.common.skillMgr = new SkillMgr();
  17535. xGame.common.wordsMgr = new WordsMgr();
  17536. xGame.common.talkMgr = new TalkMgr();
  17537. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17538. console.log("加载经典模式表情文件chenggon !");
  17539. });
  17540. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17541. console.log("挑战模式奖励模式spine加载成功!");
  17542. });
  17543. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17544. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17545. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17546. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17547. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17548. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17549. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17550. }
  17551. returnHome() {
  17552. let tips = "Are you sure to exit the game?";
  17553. let woman = "Boss, why don't you play for a while longer?";
  17554. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17555. }
  17556. addRodMethodClick() {
  17557. if (this.isTurnSelf()) {
  17558. xGame.uiMgr.Show(UIRodMethod$1);
  17559. }
  17560. }
  17561. clickHelpLineBtn(force = false) {
  17562. if (!this.isTurnSelf())
  17563. return;
  17564. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17565. if (success) {
  17566. xGame.common.longHelpLine = true;
  17567. xGame.common.d2World.getHelpLine();
  17568. Moyu.sendDataEvent("guideNum");
  17569. }
  17570. else {
  17571. }
  17572. });
  17573. }
  17574. renderSelfDisplayBalls(index, target) {
  17575. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17576. target.myImg.url = xGame.common.getGameIconUrl(str);
  17577. }
  17578. renderAIDisplayBalls(index, target) {
  17579. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17580. target.myImg.url = xGame.common.getGameIconUrl(str);
  17581. ;
  17582. }
  17583. updateMode() {
  17584. if (xGame.common.gameMode == GameMode.classic) {
  17585. this.ui.topNode.scoreNode.visible = false;
  17586. }
  17587. else if (xGame.common.gameMode == GameMode.bigMove) {
  17588. this.ui.topNode.scoreNode.visible = true;
  17589. }
  17590. }
  17591. show() {
  17592. super.show();
  17593. console.log("zh:uigame show");
  17594. this.ui.alpha = 0;
  17595. this.updateSelf();
  17596. console.log("zh:uigame bf gamemusic01 start");
  17597. xGame.soundMgr.playMusic("gamemusic01");
  17598. console.log("zh:uigame bf gamemusic01 end");
  17599. xGame.common.gameMgr.gamePause = false;
  17600. xGame.common.gameUI.ui.blackAni.visible = false;
  17601. xGame.common.gameUI.ui.whiteAni.visible = false;
  17602. this.ui.powerEft.visible = false;
  17603. this.ui.colorNode.visible = false;
  17604. this.updateHead();
  17605. }
  17606. updateSelf() {
  17607. if (xGame.common.gameMode == GameMode.classic) {
  17608. this.ui.c1.selectedIndex = 0;
  17609. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17610. this.ui.topNode.middleNode.visible = true;
  17611. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17612. }
  17613. else if (xGame.common.gameMode == GameMode.bigMove) {
  17614. this.ui.c1.selectedIndex = 0;
  17615. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17616. this.ui.topNode.middleNode.visible = false;
  17617. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17618. let rand = xGame.common.randomNum(1, max);
  17619. let guide = DataMgr.getSkillGuide();
  17620. if (guide == 0)
  17621. rand = 1;
  17622. xGame.common.bigMoveLevelIndex = rand;
  17623. }
  17624. else if (xGame.common.gameMode == GameMode.placeBall) {
  17625. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17626. this.ui.c1.selectedIndex = 1 + data.type;
  17627. this.ui.alpha = 1;
  17628. this.startGame();
  17629. }
  17630. this.updateMode();
  17631. this.initD3world();
  17632. this.initD2world();
  17633. }
  17634. startGame() {
  17635. this.ui.snowNode.visible = Math.random() <= 0.1;
  17636. this.ui.d2Node.visible = false;
  17637. xGame.common.d3World.d3Hand.gameObj.active = false;
  17638. xGame.common.d3World.tableSrc.init();
  17639. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17640. this.cameraViewChange(() => {
  17641. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17642. switch (xGame.common.gameMode) {
  17643. case GameMode.classic:
  17644. xGame.common.d3World.d3Hand.gameObj.active = true;
  17645. this.playPutBallD3Ani();
  17646. break;
  17647. case GameMode.bigMove:
  17648. this.enterGame();
  17649. Laya.timer.once(500, this, () => {
  17650. this.ui.topNode.middleNode.visible = true;
  17651. this.ui.topNode.middleNode.t0.play();
  17652. });
  17653. break;
  17654. case GameMode.placeBall:
  17655. this.enterGame();
  17656. break;
  17657. default:
  17658. break;
  17659. }
  17660. });
  17661. PlatMgr.showBanner(false);
  17662. }
  17663. enterGame() {
  17664. this.ui.d2Node.visible = true;
  17665. xGame.common.d3World.d3Hand.gameObj.active = false;
  17666. xGame.common.showOneCamera("mainCamera");
  17667. Moyu.recordGame(30, true);
  17668. if (!this.isPrePlay) {
  17669. this.isPrePlay = true;
  17670. xGame.common.d3World.prePlayEft();
  17671. }
  17672. xGame.common.gameMgr.gameReady();
  17673. this.openAllEvent();
  17674. this.ui.snowNode.visible = false;
  17675. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17676. this.ui.helpBtn.visible = condition;
  17677. }
  17678. showHelpLineGuide() {
  17679. let longGuide = DataMgr.getGuideHelpLine();
  17680. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17681. this.ui.helpBtn.visible = true;
  17682. this.ui.guideNode.visible = true;
  17683. }
  17684. }
  17685. setTurnAlpha(alpha) {
  17686. this.ui.keduNode.alpha = alpha;
  17687. this.ui.ganNode.alpha = alpha;
  17688. this.ui.rodMethodNode.alpha = alpha;
  17689. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17690. }
  17691. cameraViewChange(callback) {
  17692. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17693. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17694. xGame.common.showOneCamera("visitAngle");
  17695. cameraSrc.localRotationEulerY = 180;
  17696. cameraSrc.localRotationEulerZ = 0;
  17697. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17698. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17699. callback && callback();
  17700. }));
  17701. }));
  17702. }
  17703. playPutBallD3Ani() {
  17704. xGame.common.showOneCamera("mainCamera");
  17705. let handSrc = xGame.common.d3World.d3Hand;
  17706. handSrc.gameObj.active = true;
  17707. handSrc.transform.localPositionZ = 3;
  17708. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17709. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17710. handSrc.gameObj.active = false;
  17711. this.enterGame();
  17712. }), 400);
  17713. }));
  17714. }
  17715. updateHead() {
  17716. let user = Moyu.getUserInfo();
  17717. this.ui.topNode.selfNameTxt.text = user.nickName;
  17718. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17719. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17720. if (DataMgr.getSkillGuide() < 1) {
  17721. this.ui.topNode.aiNameTxt.text = 'billiards';
  17722. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17723. }
  17724. else {
  17725. this.ui.topNode.aiNameTxt.text = aiData.name;
  17726. let randNo = Math.floor(Math.random() * 10) + 1;
  17727. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17728. }
  17729. }
  17730. initD2world() {
  17731. let node = this.ui.d2Root.displayObject;
  17732. let src = node.getComponent(D2World);
  17733. if (!src) {
  17734. xGame.common.d2World = node.addComponent(D2World);
  17735. }
  17736. xGame.common.d2World.initSelf();
  17737. }
  17738. initD3world() {
  17739. if (this.isD3Inited)
  17740. return;
  17741. this.isD3Inited = true;
  17742. let scene3D = xGame.common.d3Scene;
  17743. this.ui.d3Root.displayObject.addChild(scene3D);
  17744. scene3D.active = true;
  17745. xGame.common.d3World.tableSrc.setBorderPos();
  17746. }
  17747. onRootMove(e) {
  17748. let rootBall = xGame.common.d2World.rootBall;
  17749. this.ui.moveNode.x = e.x;
  17750. this.ui.moveNode.y = e.y;
  17751. rootBall.gameObj.x = e.x;
  17752. rootBall.gameObj.y = e.y;
  17753. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17754. }
  17755. aiRootMove(move) {
  17756. if (move)
  17757. this.hideBallUI();
  17758. else {
  17759. this.showBallUI();
  17760. xGame.common.d2World.getHelpLine();
  17761. }
  17762. }
  17763. aiForce(type, force = 0) {
  17764. this.pressTarget = PressType.powerNode;
  17765. if (type == 1)
  17766. this.onEventUp({ force: true });
  17767. else if (type == 2)
  17768. this.onEventMove({ stageY: force, force: true });
  17769. }
  17770. onEventPress(e) {
  17771. if (e.stopPropagation)
  17772. e.stopPropagation();
  17773. if (!this.isTurnSelf())
  17774. return;
  17775. let target = e.target;
  17776. switch (target) {
  17777. case this.ui.myPowerNode.displayObject:
  17778. this.pressTarget = PressType.powerNode;
  17779. this.barInfo.curY = e.stageY;
  17780. this.updateBarInfo();
  17781. break;
  17782. case this.ui.moveNode.displayObject:
  17783. this.pressTarget = PressType.moveNode;
  17784. this.hideBallUI();
  17785. this.eventObj.curX = this.ui.moveNode.x;
  17786. this.eventObj.curY = this.ui.moveNode.y;
  17787. this.ui.moveNode.finger.visible = false;
  17788. this.eventObj.lastX = e.stageX;
  17789. this.eventObj.lastY = e.stageY;
  17790. break;
  17791. case this.ui.rulerClickNode.displayObject:
  17792. this.pressTarget = PressType.rulerNode;
  17793. this.eventObj.lastY = e.stageY;
  17794. break;
  17795. case this.ui.d2Root.displayObject:
  17796. this.pressTarget = PressType.d2Root;
  17797. this.eventObj.lastX = e.stageX;
  17798. this.eventObj.lastY = e.stageY;
  17799. this.eventObj.starX = e.stageX;
  17800. this.eventObj.starY = e.stageY;
  17801. this.eventObj.curX = 0;
  17802. this.eventObj.curY = 0;
  17803. xGame.common.d2World.d2Gan.setGanLastInfo();
  17804. this.rulerOffset = 0;
  17805. break;
  17806. default:
  17807. break;
  17808. }
  17809. }
  17810. onEventMove(e) {
  17811. if (e.stopPropagation)
  17812. e.stopPropagation();
  17813. if (e && e.force) {
  17814. }
  17815. else {
  17816. if (!this.isTurnSelf())
  17817. return;
  17818. }
  17819. switch (this.pressTarget) {
  17820. case PressType.powerNode:
  17821. this.barInfo.curY = e.stageY;
  17822. this.updateBarInfo();
  17823. this.isMoveRod = true;
  17824. break;
  17825. case PressType.moveNode:
  17826. let rootBall = xGame.common.d2World.rootBall;
  17827. let radius = rootBall.gameObj.width / 2;
  17828. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17829. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17830. let border = xGame.common.d2World.borderRect;
  17831. if (curX <= border.x + radius)
  17832. curX = border.x + radius;
  17833. else if (curX >= border.x + border.width - radius)
  17834. curX = border.x + border.width - radius;
  17835. if (curY <= border.y + radius)
  17836. curY = border.y + radius;
  17837. else if (curY >= border.y + border.height - radius)
  17838. curY = border.y + border.height - radius;
  17839. if (xGame.common.gameMgr.isOpenBall) {
  17840. if (curX >= border.x + border.openBallW - radius)
  17841. curX = border.x + border.openBallW - radius;
  17842. }
  17843. this.ui.moveNode.x = curX;
  17844. this.ui.moveNode.y = curY;
  17845. rootBall.gameObj.x = curX;
  17846. rootBall.gameObj.y = curY;
  17847. rootBall.d3BallSrc.setTransPos(curX, curY);
  17848. this.isMoveRod = true;
  17849. break;
  17850. case PressType.rulerNode:
  17851. let yy = e.stageY - this.eventObj.lastY;
  17852. this.eventObj.lastY = e.stageY;
  17853. let ruler1 = this.ui.rulerNode.img1;
  17854. let ruler2 = this.ui.rulerNode.img2;
  17855. ruler1.y += yy;
  17856. ruler2.y += yy;
  17857. this.rulerOffset += yy;
  17858. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17859. this.rulerOffset = 0;
  17860. xGame.soundMgr.playSound("inch", 1, 10);
  17861. }
  17862. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17863. let h = ruler1.height;
  17864. this.checkGuide();
  17865. this.isMoveRod = true;
  17866. if (ruler1.y >= h) {
  17867. ruler1.y = -h;
  17868. ruler2.y = 0;
  17869. return;
  17870. }
  17871. else if (ruler1.y <= -h) {
  17872. ruler1.y = h;
  17873. ruler2.y = 0;
  17874. return;
  17875. }
  17876. if (ruler2.y >= h) {
  17877. ruler2.y = -h;
  17878. ruler1.y = 0;
  17879. return;
  17880. }
  17881. else if (ruler2.y <= -h) {
  17882. ruler2.y = h;
  17883. ruler1.y = 0;
  17884. return;
  17885. }
  17886. break;
  17887. case PressType.d2Root:
  17888. this.eventObj.curX = e.stageX;
  17889. this.eventObj.curY = e.stageY;
  17890. let offset = this.checkRodMoveDir();
  17891. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17892. this.eventObj.lastX = e.stageX;
  17893. this.eventObj.lastY = e.stageY;
  17894. break;
  17895. default:
  17896. break;
  17897. }
  17898. }
  17899. onEventUp(e) {
  17900. if (e.stopPropagation)
  17901. e.stopPropagation();
  17902. if (e && e.force) {
  17903. }
  17904. else {
  17905. if (!this.isTurnSelf())
  17906. return;
  17907. }
  17908. switch (this.pressTarget) {
  17909. case PressType.powerNode:
  17910. this.ui.powerNode.value = 0;
  17911. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17912. this.ui.powerTxt.text = "";
  17913. if (this.powerNum > 0) {
  17914. xGame.eventMgr.event(BALL_SHOOT);
  17915. xGame.common.d2World.shoot(this.powerNum);
  17916. xGame.common.d2World.d2Gan.shoot();
  17917. xGame.common.d2World.d2HelpLine.shoot();
  17918. this.finishGuide();
  17919. this.ui.powerEft.visible = false;
  17920. this.ui.colorNode.visible = false;
  17921. let ganStr = "";
  17922. if (this.powerNum <= 30) {
  17923. ganStr = "gan_30";
  17924. }
  17925. else if (this.powerNum <= 60) {
  17926. ganStr = "gan_50";
  17927. }
  17928. else {
  17929. ganStr = "gan_80";
  17930. }
  17931. xGame.soundMgr.playSound(ganStr);
  17932. }
  17933. break;
  17934. case PressType.moveNode:
  17935. let rootBall = xGame.common.d2World.rootBall;
  17936. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17937. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17938. let isIntersect = this.judgeBallIntersect();
  17939. if (isIntersect) {
  17940. this.ui.moveNode.x = lastX;
  17941. this.ui.moveNode.y = lastY;
  17942. rootBall.gameObj.x = lastX;
  17943. rootBall.gameObj.y = lastY;
  17944. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17945. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17946. }
  17947. else {
  17948. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17949. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17950. }
  17951. this.showBallUI();
  17952. this.ui.moveNode.finger.visible = true;
  17953. xGame.common.d2World.getHelpLine();
  17954. break;
  17955. case PressType.rulerNode:
  17956. break;
  17957. case PressType.d2Root:
  17958. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17959. if (dis <= 25) {
  17960. this.moveToClickDot(e);
  17961. }
  17962. break;
  17963. default:
  17964. break;
  17965. }
  17966. this.pressTarget = -1;
  17967. }
  17968. checkGuide() {
  17969. let guide = DataMgr.getSkillGuide();
  17970. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17971. xGame.common.guideStep++;
  17972. xGame.common.gameUI.ui.guide2.visible = false;
  17973. xGame.common.gameUI.ui.guide3.visible = true;
  17974. }
  17975. }
  17976. finishGuide() {
  17977. let guide = DataMgr.getSkillGuide();
  17978. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17979. xGame.common.guideStep = 10;
  17980. this.closeAllGuide();
  17981. }
  17982. }
  17983. closeAllGuide() {
  17984. xGame.common.gameUI.ui.guide1.visible = false;
  17985. xGame.common.gameUI.ui.guide2.visible = false;
  17986. xGame.common.gameUI.ui.guide3.visible = false;
  17987. }
  17988. updateBarInfo() {
  17989. let star = this.ui.powerNode.y;
  17990. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  17991. if (rate >= 1)
  17992. rate = 1;
  17993. if (rate <= 0)
  17994. rate = 0;
  17995. this.powerNum = Math.ceil(rate * 100);
  17996. this.ui.powerNode.value = this.powerNum;
  17997. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  17998. this.ui.colorNode.value = this.powerNum;
  17999. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18000. this.ui.powerEft.visible = this.powerNum != 0;
  18001. this.ui.colorNode.visible = this.powerNum != 0;
  18002. this.ui.powerTxt.text = this.powerNum + "";
  18003. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18004. }
  18005. forceCancel() {
  18006. this.ui.powerNode.value = 0;
  18007. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18008. this.ui.powerTxt.text = "";
  18009. }
  18010. checkRodMoveDir() {
  18011. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18012. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18013. if (tempX >= 0 && tempY <= 0) {
  18014. return this.checkDir();
  18015. }
  18016. else if (tempX < 0 && tempY < 0) {
  18017. return this.checkDir(1, -1);
  18018. }
  18019. else if (tempX < 0 && tempY > 0) {
  18020. return this.checkDir(-1, -1);
  18021. }
  18022. else {
  18023. return this.checkDir(-1, 1);
  18024. }
  18025. }
  18026. checkDir(flagX = 1, flagY = 1) {
  18027. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18028. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18029. if (offsetY == 0) {
  18030. return offsetX * flagX;
  18031. }
  18032. if (offsetX == 0) {
  18033. return offsetY * flagY;
  18034. }
  18035. let angle = offsetY / offsetX;
  18036. if (Math.abs(angle) >= 1) {
  18037. return offsetY * flagY;
  18038. }
  18039. else {
  18040. return offsetX * flagX;
  18041. }
  18042. }
  18043. judgeBallIntersect() {
  18044. let rootBall = xGame.common.d2World.rootBall;
  18045. let ballArr = xGame.common.d2World.ballArr;
  18046. let radius = rootBall.gameObj.width / 2;
  18047. let temp;
  18048. let isIntersect = false;
  18049. for (let index = 0; index < ballArr.length; index++) {
  18050. temp = ballArr[index];
  18051. if (temp.number == rootBall.number)
  18052. continue;
  18053. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18054. if (isIntersect) {
  18055. break;
  18056. }
  18057. }
  18058. return isIntersect;
  18059. }
  18060. hideBallUI() {
  18061. let d2Gan = xGame.common.d2World.d2Gan;
  18062. if (!d2Gan.ui.isDisposed)
  18063. d2Gan.ui.visible = false;
  18064. let d2Help = xGame.common.d2World.d2HelpLine;
  18065. if (!d2Help.ui.isDisposed)
  18066. d2Help.ui.visible = false;
  18067. let rootBall = xGame.common.d2World.rootBall;
  18068. if (!rootBall.destroyed) {
  18069. rootBall.gameObj.active = false;
  18070. }
  18071. }
  18072. showBallUI() {
  18073. let d2Gan = xGame.common.d2World.d2Gan;
  18074. if (!d2Gan.ui.isDisposed)
  18075. d2Gan.ui.visible = true;
  18076. let d2Help = xGame.common.d2World.d2HelpLine;
  18077. if (!d2Help.ui.isDisposed)
  18078. d2Help.ui.visible = true;
  18079. let rootBall = xGame.common.d2World.rootBall;
  18080. if (!rootBall.destroyed) {
  18081. rootBall.gameObj.active = true;
  18082. }
  18083. }
  18084. moveToClickDot(e) {
  18085. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18086. let root = xGame.common.d2World.rootBall.gameObj;
  18087. let xx = e.stageX - xGame.common.sysOffestNum;
  18088. let yy = e.stageY;
  18089. let x = xx - root.x;
  18090. let y = yy - root.y;
  18091. let angle = xGame.common.getfguiRotation(x, y);
  18092. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18093. xGame.common.d2World.getHelpLine();
  18094. }
  18095. this.isMoveRod = false;
  18096. xGame.common.clickedBall = false;
  18097. }
  18098. openAllEvent() {
  18099. this.closeAllEvent();
  18100. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18101. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18102. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18103. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18104. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18105. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18106. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18107. }
  18108. closeAllEvent() {
  18109. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18110. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18111. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18112. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18113. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18114. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18115. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18116. }
  18117. resetGame() {
  18118. this.closeAllEvent();
  18119. this.hideBallUI();
  18120. xGame.common.gameMgr.gamePause = true;
  18121. }
  18122. }
  18123. UIGame$1.uiName = "UIGame";
  18124. class UIAddCoin$1 extends UIBase {
  18125. constructor() {
  18126. super();
  18127. this.coinNum = 2000;
  18128. }
  18129. onConstructor() {
  18130. this.ui = ui_UIAddCoin.createInstance();
  18131. this.contentPane = this.ui;
  18132. this.isEject = false;
  18133. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18134. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18135. }
  18136. show() {
  18137. super.show();
  18138. this.ui.t0.play();
  18139. }
  18140. videoAddCoin() {
  18141. console.log('zh:qjff_AD_for_UIAddCoin');
  18142. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18143. }
  18144. else {
  18145. console.log('zh:AD 失败,直接发放奖励');
  18146. this.qjff_AD_for_UIAddCoin();
  18147. }
  18148. }
  18149. qjff_AD_for_UIAddCoin() {
  18150. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18151. this.hide();
  18152. }
  18153. }
  18154. UIAddCoin$1.uiName = "UIAddCoin";
  18155. class UIInvitation$1 extends UIBase {
  18156. constructor() {
  18157. super();
  18158. }
  18159. onConstructor() {
  18160. this.ui = ui_UIInvitation.createInstance();
  18161. this.contentPane = this.ui;
  18162. this.isEject = false;
  18163. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18164. }
  18165. show() {
  18166. super.show();
  18167. }
  18168. enterGame() {
  18169. xGame.common.gameMode = GameMode.classic;
  18170. DataMgr.setChallengeTimes(1);
  18171. xGame.common.passAwardCoin = 2000;
  18172. let need = xGame.common.classicNiceNeddCoin;
  18173. if (DataMgr.coinEnough(need)) {
  18174. DataMgr.setCoin(-need);
  18175. xGame.eventMgr.event(RESTART_GAME, true);
  18176. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18177. }
  18178. else {
  18179. xGame.eventMgr.event(RESTART_GAME, true);
  18180. }
  18181. this.hide();
  18182. }
  18183. hide() {
  18184. super.hide();
  18185. }
  18186. }
  18187. UIInvitation$1.uiName = "UIInvitation";
  18188. class UIPower$1 extends UIBase {
  18189. constructor() {
  18190. super();
  18191. }
  18192. onConstructor() {
  18193. this.ui = ui_UIPower.createInstance();
  18194. this.contentPane = this.ui;
  18195. this.isEject = false;
  18196. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18197. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18198. }
  18199. show() {
  18200. super.show();
  18201. this.ui.t0.play();
  18202. }
  18203. videoGetPower() {
  18204. console.log('zh:qjff_AD_for_uipower');
  18205. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18206. }
  18207. else {
  18208. console.log('zh:AD 失败,直接发放奖励');
  18209. this.qjff_AD_for_uipower();
  18210. }
  18211. }
  18212. qjff_AD_for_uipower() {
  18213. DataMgr.setPower(xGame.common.videoPower, true);
  18214. xGame.eventMgr.event(POWER_TIME);
  18215. this.hide();
  18216. }
  18217. }
  18218. UIPower$1.uiName = "UIPower";
  18219. class UIGameEnd$1 extends UIBase {
  18220. constructor() {
  18221. super();
  18222. this.success = false;
  18223. this.awardCoinNum = 1000;
  18224. this.awardDiamondNum = 10;
  18225. }
  18226. onConstructor() {
  18227. this.ui = ui_UIGameEnd.createInstance();
  18228. this.contentPane = this.ui;
  18229. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18230. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18231. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18232. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18233. this.ui.talkNode.visible = false;
  18234. if (Moyu.isKs)
  18235. this.ui.closeNode.closeBtn.x += 100;
  18236. }
  18237. updateType() {
  18238. switch (xGame.common.gameMode) {
  18239. case GameMode.classic:
  18240. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18241. this.ui.coinNode.visible = this.success;
  18242. if (!this.success) {
  18243. Laya.timer.once(500, this, () => {
  18244. xGame.uiMgr.Show(UIAddCoin$1);
  18245. });
  18246. }
  18247. this.ui.isGetAward.visible = false;
  18248. this.ui.leftBtn.c1.selectedIndex = 3;
  18249. this.ui.rightBtn.c1.selectedIndex = 0;
  18250. this.moneyNode.ui.c1.selectedIndex = 1;
  18251. break;
  18252. case GameMode.bigMove:
  18253. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18254. this.ui.coinNode.visible = this.success;
  18255. if (xGame.common.gameMode == GameMode.bigMove) {
  18256. if (this.success) {
  18257. DataMgr.setSkillSuccessTimes(1, true);
  18258. DataMgr.setSkillAccTimes(1);
  18259. }
  18260. else {
  18261. DataMgr.setSkillSuccessTimes(0, false);
  18262. }
  18263. }
  18264. if (!this.success) {
  18265. Laya.timer.once(500, this, () => {
  18266. xGame.uiMgr.Show(UIAddCoin$1);
  18267. });
  18268. }
  18269. this.ui.isGetAward.visible = false;
  18270. this.ui.leftBtn.c1.selectedIndex = 3;
  18271. this.ui.rightBtn.c1.selectedIndex = 0;
  18272. this.moneyNode.ui.c1.selectedIndex = 1;
  18273. break;
  18274. case GameMode.placeBall:
  18275. this.ui.coinNode.visible = false;
  18276. if (this.success) {
  18277. if (xGame.common.placeBallStarNum == 3) {
  18278. this.ui.c1.selectedIndex = 2;
  18279. }
  18280. else {
  18281. this.ui.c1.selectedIndex = 3;
  18282. }
  18283. }
  18284. else {
  18285. this.ui.c1.selectedIndex = 4;
  18286. }
  18287. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18288. if (cfg.type == PlaceBallType.challenge) {
  18289. this.ui.c1.selectedIndex = 2;
  18290. }
  18291. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18292. this.updatePlaceBallBtn();
  18293. this.updatePlaceBallStarNum();
  18294. this.updatePlaceBallAwardState();
  18295. this.moneyNode.ui.c1.selectedIndex = 2;
  18296. this.moneyNode.checkPowerTime();
  18297. this.moneyNode.powerChange();
  18298. DataMgr.upRankData();
  18299. break;
  18300. default:
  18301. break;
  18302. }
  18303. }
  18304. updatePlaceBallBtn() {
  18305. this.ui.leftBtn.c1.selectedIndex = 5;
  18306. if (this.success) {
  18307. this.ui.rightBtn.c1.selectedIndex = 14;
  18308. }
  18309. else {
  18310. if (xGame.common.placeBallStarNum == 3) {
  18311. this.ui.rightBtn.c1.selectedIndex = 14;
  18312. }
  18313. else {
  18314. this.ui.rightBtn.c1.selectedIndex = 1;
  18315. }
  18316. }
  18317. }
  18318. updatePlaceBallStarNum() {
  18319. let starNum = xGame.common.placeBallStarNum;
  18320. if (starNum == 0)
  18321. this.ui.starNumNode.c1.selectedIndex = 3;
  18322. else {
  18323. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18324. }
  18325. }
  18326. updatePlaceBallAwardState() {
  18327. let level = xGame.common.placeBallCurLevel;
  18328. let starNum = xGame.common.placeBallStarNum;
  18329. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18330. let data = cfgTable.placeballData[level].award;
  18331. let cfg = cfgTable.placeballData[level];
  18332. this.awardDiamondNum = data[1];
  18333. this.awardCoinNum = data[0];
  18334. if (cfg.type == PlaceBallType.challenge) {
  18335. this.awardDiamondNum = 0;
  18336. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18337. }
  18338. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18339. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18340. if (cfg.type == PlaceBallType.challenge) {
  18341. this.ui.awardNode.coinNode.visible = true;
  18342. }
  18343. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18344. this.ui.awardNode.diamondNode.x = 265;
  18345. this.ui.awardNode.coinNode.x = 354;
  18346. }
  18347. else {
  18348. this.ui.awardNode.diamondNode.x = 291;
  18349. this.ui.awardNode.coinNode.x = 291;
  18350. }
  18351. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18352. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18353. if (this.awardCoinNum == 0) {
  18354. this.ui.awardNode.coinNode.numTxt.text = "";
  18355. }
  18356. if (getAward) {
  18357. this.ui.isGetAward.visible = true;
  18358. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18359. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18360. }
  18361. else {
  18362. this.ui.isGetAward.visible = false;
  18363. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18364. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18365. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18366. }
  18367. else {
  18368. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18369. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18370. }
  18371. }
  18372. }
  18373. show(success) {
  18374. super.show();
  18375. xGame.eventMgr.event(RESET_GAME);
  18376. this.success = success;
  18377. Laya.timer.clearAll(this);
  18378. this.playSecretaryAni();
  18379. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18380. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18381. offsetTime = Math.floor(offsetTime / 1000);
  18382. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18383. this.updateType();
  18384. Laya.timer.once(200, this, () => {
  18385. this.addAward(() => {
  18386. this.updateType();
  18387. Laya.timer.once(500, this, () => {
  18388. this.showChallengeLevel();
  18389. });
  18390. });
  18391. });
  18392. if (this.success) {
  18393. xGame.soundMgr.playSound('slots_roll01');
  18394. xGame.soundMgr.playSound("s_win");
  18395. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18396. }
  18397. else {
  18398. xGame.soundMgr.playSound('matchwin01');
  18399. xGame.soundMgr.playSound("s_lose");
  18400. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18401. }
  18402. if (!Moyu.isLegal)
  18403. PlatMgr.showBanner(true);
  18404. let challengeNum = DataMgr.getChallengeTimes();
  18405. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18406. DataMgr.setChallengeTimes(1);
  18407. }
  18408. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18409. DataMgr.setClassicTimes();
  18410. }
  18411. }
  18412. showChallengeLevel() {
  18413. if (DataMgr.getChallengeTimes() != 0)
  18414. return;
  18415. let skill = DataMgr.getSkillAccTimes();
  18416. let put = DataMgr.getPlaceBallLevelList().length;
  18417. if (skill >= 3 || put >= 5) {
  18418. xGame.uiMgr.Show(UIInvitation$1);
  18419. this.hide();
  18420. }
  18421. }
  18422. addAward(callback) {
  18423. if (!this.success) {
  18424. callback && callback();
  18425. return;
  18426. }
  18427. switch (xGame.common.gameMode) {
  18428. case GameMode.classic:
  18429. this.awardCoinNum = xGame.common.passAwardCoin;
  18430. this.awardDiamondNum = 0;
  18431. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18432. break;
  18433. case GameMode.bigMove:
  18434. this.awardCoinNum = xGame.common.passAwardCoin;
  18435. this.awardDiamondNum = 0;
  18436. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18437. callback && callback();
  18438. break;
  18439. case GameMode.placeBall:
  18440. let level = xGame.common.placeBallCurLevel;
  18441. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18442. if (xGame.common.placeBallStarNum != 3) {
  18443. callback && callback();
  18444. return;
  18445. }
  18446. else {
  18447. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18448. if (getAward) {
  18449. callback && callback();
  18450. return;
  18451. }
  18452. }
  18453. let cfg = cfgTable.placeballData[level];
  18454. let data = cfgTable.placeballData[level].award;
  18455. this.awardCoinNum = data[0];
  18456. this.awardDiamondNum = data[1];
  18457. if (cfg.type == PlaceBallType.challenge) {
  18458. this.awardDiamondNum = 0;
  18459. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18460. }
  18461. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18462. let diamondAward;
  18463. if (this.awardDiamondNum > 0) {
  18464. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18465. xGame.common.getAward([diamondAward, coinAward], callback);
  18466. }
  18467. else {
  18468. xGame.common.getAward([coinAward], callback);
  18469. }
  18470. if (cfg.type == PlaceBallType.normal) {
  18471. DataMgr.setPlaceBallAward(level);
  18472. }
  18473. break;
  18474. default:
  18475. break;
  18476. }
  18477. }
  18478. playSecretaryAni_old() {
  18479. let parent = this.ui.secretary.displayObject;
  18480. parent.destroyChildren();
  18481. let xx = this.ui.secretary.width / 2;
  18482. let yy = this.ui.secretary.height;
  18483. let scale = xGame.common.getSecretaryScale();
  18484. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18485. if (this.success) {
  18486. let rand = Math.random() <= 0.5 ? 2 : 3;
  18487. xGame.common.secretary.play(data, rand, false, parent, () => {
  18488. xGame.common.secretary.play(data, 1, true, parent);
  18489. });
  18490. }
  18491. else {
  18492. xGame.common.secretary.play(data, 0, true, parent);
  18493. }
  18494. }
  18495. playSecretaryAni() {
  18496. let parent = this.ui.secretary.displayObject;
  18497. parent.destroyChildren();
  18498. let xx = this.ui.secretary.width / 2;
  18499. let yy = this.ui.secretary.height;
  18500. let scale = xGame.common.getSecretaryScale();
  18501. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18502. if (this.success) {
  18503. let rand = 0;
  18504. xGame.common.secretary.play(data, 0, true, parent);
  18505. }
  18506. else {
  18507. xGame.common.secretary.play(data, 0, true, parent);
  18508. }
  18509. }
  18510. restartGame() {
  18511. switch (xGame.common.gameMode) {
  18512. case GameMode.classic:
  18513. xGame.eventMgr.event(RESTART_GAME);
  18514. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18515. break;
  18516. case GameMode.bigMove:
  18517. this.hide();
  18518. xGame.eventMgr.event(RESTART_GAME);
  18519. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18520. break;
  18521. default:
  18522. break;
  18523. }
  18524. }
  18525. hide() {
  18526. super.hide();
  18527. xGame.common.stopGirlPop(this.ui.talkNode);
  18528. PlatMgr.showBanner(false);
  18529. }
  18530. returnHome() {
  18531. this.hide();
  18532. let showFailWords = !this.success;
  18533. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18534. }
  18535. clickLeftBtn() {
  18536. switch (xGame.common.gameMode) {
  18537. case GameMode.classic:
  18538. case GameMode.bigMove:
  18539. this.returnHome();
  18540. break;
  18541. case GameMode.placeBall:
  18542. let level = xGame.common.placeBallCurLevel;
  18543. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18544. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18545. break;
  18546. default:
  18547. break;
  18548. }
  18549. }
  18550. powerStartPlaceBallLevel(level, btn) {
  18551. if (DataMgr.powerEnough()) {
  18552. btn.touchable = false;
  18553. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18554. btn.touchable = true;
  18555. DataMgr.setPower(-1);
  18556. xGame.eventMgr.event(POWER_TIME);
  18557. this.startPlaceBallLevel(level);
  18558. }));
  18559. }
  18560. else {
  18561. xGame.uiMgr.Show(UIPower$1, 0);
  18562. }
  18563. }
  18564. clickRightBtn() {
  18565. switch (xGame.common.gameMode) {
  18566. case GameMode.classic:
  18567. console.log('zh:clickRightBtn 111');
  18568. case GameMode.bigMove:
  18569. console.log('zh:clickRightBtn 222');
  18570. this.restartGame();
  18571. break;
  18572. case GameMode.placeBall:
  18573. console.log('zh:clickRightBtn 333');
  18574. let level = xGame.common.placeBallCurLevel;
  18575. let data = DataMgr.getPlaceBallLevel(level);
  18576. let curPss = data.play && !data.isCur;
  18577. if (curPss) {
  18578. console.log('zh:clickRightBtn 333-111');
  18579. console.log('zh:当前LV=' + level);
  18580. if (level == 60) {
  18581. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18582. Laya.timer.once(3000, this, () => {
  18583. this.returnHome();
  18584. });
  18585. }
  18586. else {
  18587. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18588. }
  18589. }
  18590. else {
  18591. console.log('zh:clickRightBtn 333-000');
  18592. Moyu.sendDataEvent("placeBallNextLevel");
  18593. console.log('zh:qjff_AD_for_uiGameEnd');
  18594. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18595. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18596. }
  18597. else {
  18598. console.log('zh:AD 失败,直接发放奖励');
  18599. this.qjff_AD_for_uiGameEnd(level);
  18600. }
  18601. }
  18602. break;
  18603. default:
  18604. console.log('zh:clickRightBtn 444');
  18605. break;
  18606. }
  18607. }
  18608. qjff_AD_for_uiGameEnd(level) {
  18609. DataMgr.setPlaceBallLevel(level, 1);
  18610. this.startPlaceBallLevel(level + 1);
  18611. }
  18612. startPlaceBallLevel(level) {
  18613. xGame.common.gameMode = GameMode.placeBall;
  18614. xGame.common.placeBallCurLevel = level;
  18615. xGame.uiMgr.Show(UIGame$1);
  18616. this.hide();
  18617. }
  18618. }
  18619. UIGameEnd$1.uiName = "UIGameEnd";
  18620. class ShowItem$1 {
  18621. constructor() {
  18622. this.ui = ui_ShowItem.createInstance();
  18623. }
  18624. destroySelf() {
  18625. if (!this.ui.isDisposed) {
  18626. this.ui.removeFromParent();
  18627. this.ui.dispose();
  18628. }
  18629. }
  18630. setParent(parent) {
  18631. parent.addChild(this.ui);
  18632. }
  18633. setPos(x, y) {
  18634. this.ui.x = x;
  18635. this.ui.y = y;
  18636. }
  18637. setUrl(index) {
  18638. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18639. }
  18640. }
  18641. class UILevelProp$1 extends UIBase {
  18642. constructor() {
  18643. super();
  18644. this.firstPos = 385;
  18645. this.secondPos = 467;
  18646. this.showItemArr = [];
  18647. }
  18648. onConstructor() {
  18649. this.ui = ui_UILevelProp.createInstance();
  18650. this.contentPane = this.ui;
  18651. this.isEject = false;
  18652. this.addUIClick(this.ui.closeBtn, this.hide);
  18653. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18654. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18655. }
  18656. show(level) {
  18657. super.show();
  18658. this.ui.t1.play();
  18659. this.level = level;
  18660. this.data = cfgTable.placeballData[this.level];
  18661. this.updateSelf();
  18662. this.showPreView();
  18663. this.moneyNode.ui.c1.selectedIndex = 2;
  18664. this.moneyNode.checkPowerTime();
  18665. this.moneyNode.powerChange();
  18666. }
  18667. showPreView() {
  18668. let item;
  18669. let data;
  18670. for (let index = 0; index < this.showItemArr.length; index++) {
  18671. item = this.showItemArr[index];
  18672. item.destroySelf();
  18673. }
  18674. this.showItemArr = [];
  18675. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18676. for (const key in cfgData) {
  18677. data = cfgData[key];
  18678. item = new ShowItem$1();
  18679. item.setParent(this.ui.myNode.displayRoot);
  18680. item.setPos(data.x, data.y);
  18681. item.setUrl(data.value);
  18682. this.showItemArr.push(item);
  18683. }
  18684. }
  18685. updateSelf() {
  18686. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18687. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18688. if (this.data.ball == -1) {
  18689. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18690. }
  18691. else {
  18692. this.ui.myNode.conditionTxt.text = "Reward";
  18693. }
  18694. let localData = DataMgr.getPlaceBallLevel(this.level);
  18695. let getAward = localData.getAward;
  18696. let cfg = cfgTable.placeballData[this.level];
  18697. let coin = this.data.award[0];
  18698. let diamond = this.data.award[1];
  18699. if (cfg.type == PlaceBallType.challenge) {
  18700. diamond = 0;
  18701. coin = 100;
  18702. }
  18703. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18704. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18705. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18706. if (cfg.type == PlaceBallType.challenge) {
  18707. this.ui.myNode.coinNode.numTxt.text = "";
  18708. }
  18709. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18710. if (coin > 0 && diamond > 0) {
  18711. this.ui.myNode.diamondNode.x = 385;
  18712. this.ui.myNode.coinNode.x = 467;
  18713. }
  18714. else {
  18715. this.ui.myNode.diamondNode.x = 385;
  18716. this.ui.myNode.coinNode.x = 385;
  18717. }
  18718. if (!getAward) {
  18719. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18720. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18721. }
  18722. else {
  18723. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18724. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18725. }
  18726. }
  18727. startGame() {
  18728. if (DataMgr.powerEnough()) {
  18729. this.ui.myNode.startBtn.touchable = false;
  18730. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18731. console.log('zh:startGame ');
  18732. this.ui.myNode.startBtn.touchable = true;
  18733. DataMgr.setPower(-1);
  18734. xGame.eventMgr.event(POWER_TIME);
  18735. xGame.common.gameMode = GameMode.placeBall;
  18736. xGame.common.placeBallCurLevel = this.level;
  18737. xGame.uiMgr.Show(UIGame$1);
  18738. xGame.uiMgr.Hide(UILevelDisplay$1);
  18739. xGame.uiMgr.Hide(UIMain$1);
  18740. this.hide();
  18741. }));
  18742. }
  18743. else {
  18744. console.log('zh:startGame no power');
  18745. xGame.uiMgr.Show(UIPower$1);
  18746. }
  18747. }
  18748. hide() {
  18749. super.hide();
  18750. }
  18751. }
  18752. UILevelProp$1.uiName = "UILevelProp";
  18753. class PutBallLevelDisplay$1 {
  18754. constructor(ui, index) {
  18755. this.index = 0;
  18756. this.ui = ui;
  18757. this.index = index;
  18758. this.ui.onClick(this, this.clickSelf);
  18759. this.updateSelf();
  18760. this.ui.levelTxt.text = (this.index + 1) + "";
  18761. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18762. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18763. }
  18764. updateSelf() {
  18765. let level = this.index + 1;
  18766. this.data = DataMgr.getPlaceBallLevel(level);
  18767. this.ui.starNode.c1.selectedIndex = this.data.star;
  18768. let isChallenge = cfgTable.placeballData[level].type;
  18769. if (this.data.isCur) {
  18770. if (isChallenge) {
  18771. this.ui.c1.selectedIndex = 5;
  18772. }
  18773. else {
  18774. this.ui.c1.selectedIndex = 2;
  18775. }
  18776. }
  18777. else {
  18778. if (this.data.play) {
  18779. if (this.data.star == 3) {
  18780. this.ui.c1.selectedIndex = 0;
  18781. }
  18782. else {
  18783. this.ui.c1.selectedIndex = 1;
  18784. }
  18785. }
  18786. else {
  18787. if (isChallenge) {
  18788. this.ui.c1.selectedIndex = 4;
  18789. }
  18790. else {
  18791. this.ui.c1.selectedIndex = 3;
  18792. }
  18793. }
  18794. }
  18795. }
  18796. clickSelf() {
  18797. if (!this.data.play)
  18798. return;
  18799. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18800. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18801. }
  18802. }
  18803. class UILevelDisplay$1 extends UIBase {
  18804. constructor() {
  18805. super();
  18806. }
  18807. onConstructor() {
  18808. this.ui = ui_UILevelDisplay.createInstance();
  18809. this.contentPane = this.ui;
  18810. this.isEject = false;
  18811. this.myList = this.ui.myNode.myList;
  18812. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18813. this.levelItemArr = [];
  18814. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18815. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18816. this.myList.numItems = levelNum;
  18817. if (Moyu.isKs)
  18818. this.ui.closeNode.closeBtn.x += 100;
  18819. }
  18820. levelItemRender(index, target) {
  18821. let item = new PutBallLevelDisplay$1(target, index);
  18822. this.levelItemArr.push(item);
  18823. }
  18824. show() {
  18825. super.show();
  18826. this.updateLevel();
  18827. this.scrollToPlace();
  18828. }
  18829. updateLevel() {
  18830. let temp;
  18831. for (let index = 0; index < this.levelItemArr.length; index++) {
  18832. temp = this.levelItemArr[index];
  18833. temp.updateSelf();
  18834. }
  18835. }
  18836. scrollToPlace() {
  18837. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18838. let passArr = DataMgr.getPlaceBallLevelList();
  18839. let offest = passArr.length;
  18840. if (offest >= maxNum - 1)
  18841. offest = maxNum - 1;
  18842. this.myList.scrollToView(offest, true, true);
  18843. }
  18844. hide() {
  18845. super.hide();
  18846. }
  18847. }
  18848. UILevelDisplay$1.uiName = "UILevelDisplay";
  18849. class UIMatching$1 extends UIBase {
  18850. constructor() {
  18851. super();
  18852. }
  18853. onConstructor() {
  18854. this.ui = ui_UIMatching.createInstance();
  18855. this.contentPane = this.ui;
  18856. this.isEject = false;
  18857. }
  18858. show(callback) {
  18859. super.show();
  18860. PlatMgr.showBanner(true);
  18861. this.callback = callback;
  18862. let user = Moyu.getUserInfo();
  18863. if (!this.selfPot) {
  18864. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18865. }
  18866. if (!this.aiPot) {
  18867. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18868. }
  18869. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18870. this.ui.selfHead.nameTxt.text = user.nickName;
  18871. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18872. this.ui.aiHead.nameTxt.text = "???";
  18873. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18874. this.ui.selfHead.c1.selectedIndex = 0;
  18875. this.ui.aiHead.c1.selectedIndex = 0;
  18876. this.ui.selfHead.x = this.selfPot.x;
  18877. this.ui.selfHead.y = this.selfPot.y;
  18878. this.ui.aiHead.x = this.aiPot.x;
  18879. this.ui.aiHead.y = this.aiPot.y;
  18880. switch (xGame.common.gameMode) {
  18881. case GameMode.classic:
  18882. break;
  18883. case GameMode.bigMove:
  18884. this.initSkillData();
  18885. break;
  18886. default:
  18887. break;
  18888. }
  18889. this.ui.t1.play(Laya.Handler.create(this, () => {
  18890. this.ui.t2.play(Laya.Handler.create(this, () => {
  18891. switch (xGame.common.gameMode) {
  18892. case GameMode.classic:
  18893. this.waitingPeople();
  18894. break;
  18895. case GameMode.bigMove:
  18896. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18897. break;
  18898. default:
  18899. break;
  18900. }
  18901. }));
  18902. }));
  18903. }
  18904. initSkillData() {
  18905. this.skillSelectData = [];
  18906. let skillUrl = xGame.common.skillIconList;
  18907. let skillName = xGame.common.skillNameList;
  18908. let skillLevel = DataMgr.getBigSkillList();
  18909. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18910. for (let index = 0; index < 5; index++) {
  18911. let obj = {};
  18912. obj.skillImg = skillUrl[index];
  18913. obj.skillName = skillName[index];
  18914. obj.skillType = skillType[index];
  18915. obj.skillLevel = skillLevel[index];
  18916. this.skillSelectData.push(obj);
  18917. }
  18918. }
  18919. getAISkillLevel(myLevel) {
  18920. let video = xGame.common.upSkillLevel;
  18921. let aiLevel;
  18922. let temp;
  18923. if (video) {
  18924. temp = xGame.common.randomNum(-2, -1);
  18925. }
  18926. else {
  18927. if (myLevel <= 5) {
  18928. temp = xGame.common.randomNum(1, 3);
  18929. }
  18930. else if (myLevel <= 9) {
  18931. temp = xGame.common.randomNum(-2, 1);
  18932. }
  18933. else {
  18934. temp = xGame.common.randomNum(-4, 0);
  18935. }
  18936. }
  18937. aiLevel = temp + myLevel;
  18938. if (aiLevel <= 1)
  18939. aiLevel = 1;
  18940. if (aiLevel >= 10)
  18941. aiLevel = 10;
  18942. return aiLevel;
  18943. }
  18944. getAISkillType() {
  18945. return xGame.common.randomNum(1, 4);
  18946. let successTimes = DataMgr.getSkillSuccessTimes();
  18947. let info = cfgTable.aiskillData[successTimes];
  18948. if (!info) {
  18949. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18950. info = cfgTable.aiskillData[max];
  18951. }
  18952. let dataArr = info.skillselect;
  18953. let myCfg = {};
  18954. for (let index = 0; index < dataArr.length; index++) {
  18955. let temp = dataArr[index].split('-');
  18956. myCfg[temp[0]] = {};
  18957. myCfg[temp[0]].id = parseInt(temp[0]);
  18958. myCfg[temp[0]].weight = parseInt(temp[1]);
  18959. }
  18960. let aiCfg = xGame.common.initWeight(myCfg);
  18961. let curData = xGame.common.getRandomWeightData(aiCfg);
  18962. return parseInt(curData.id);
  18963. }
  18964. getAISkillData(index) {
  18965. let myLevel = this.skillSelectData[index].skillLevel;
  18966. let aiLevel = this.getAISkillLevel(myLevel);
  18967. let aiType = this.getAISkillType() - 1;
  18968. return { aiLevel, aiType } = { aiLevel, aiType };
  18969. }
  18970. skillSelectFinish(index) {
  18971. let aiInfo = this.getAISkillData(index);
  18972. xGame.common.gameMgr.selfCurSkill = index;
  18973. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  18974. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  18975. this.ui.selfHead.c1.selectedIndex = 1;
  18976. this.ui.aiHead.c1.selectedIndex = 1;
  18977. let myData = this.skillSelectData[index];
  18978. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  18979. let guide = DataMgr.getSkillGuide();
  18980. if (guide == 0) {
  18981. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  18982. }
  18983. else {
  18984. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  18985. }
  18986. let aiData = this.skillSelectData[aiInfo.aiType];
  18987. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  18988. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  18989. this.waitingPeople();
  18990. }
  18991. waitingPeople() {
  18992. let time = xGame.common.randomNum(1000, 3000);
  18993. time += 1000;
  18994. Laya.timer.once(time, this, () => {
  18995. this.matchingSuccess();
  18996. });
  18997. }
  18998. matchingSuccess() {
  18999. let gameUI = xGame.common.gameUI;
  19000. let name = gameUI.ui.topNode.aiNameTxt.text;
  19001. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19002. this.ui.aiHead.nameTxt.text = name;
  19003. this.ui.aiHead.headImg.url = url;
  19004. name = gameUI.ui.topNode.selfNameTxt.text;
  19005. url = gameUI.ui.topNode.selfHeadLoader.url;
  19006. this.ui.selfHead.nameTxt.text = name;
  19007. this.ui.selfHead.headImg.url = url;
  19008. this.ui.t3.play(Laya.Handler.create(this, () => {
  19009. this.callback && this.callback();
  19010. this.ui.t4.play(Laya.Handler.create(this, () => {
  19011. this.destroySelf();
  19012. }));
  19013. }));
  19014. }
  19015. destroySelf() {
  19016. this.callback = null;
  19017. this.skillSelectData = null;
  19018. this.selfPot = null;
  19019. this.aiPot = null;
  19020. if (!this.ui.isDisposed) {
  19021. this.ui.removeFromParent();
  19022. this.ui.dispose();
  19023. }
  19024. xGame.uiMgr.destroyUI(this);
  19025. }
  19026. }
  19027. UIMatching$1.uiName = "UIMatching";
  19028. class SkillDisplay$1 {
  19029. constructor(ui, data, uiIndex) {
  19030. this.starX = 0;
  19031. this.starY = 0;
  19032. this.index = 0;
  19033. this.ui = ui;
  19034. this.data = data;
  19035. this.index = uiIndex;
  19036. this.initSelf();
  19037. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19038. }
  19039. initSelf() {
  19040. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19041. this.ui.nameTxt.text = this.data.name;
  19042. this.ui.describeTxt.text = this.data.describe;
  19043. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19044. this.ui.startBtn.onClick(this, this.startGame);
  19045. this.updateSelf();
  19046. }
  19047. updateSelf() {
  19048. this.checkTry();
  19049. let level = DataMgr.getBigSkillByIndex(this.index);
  19050. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19051. }
  19052. checkTry() {
  19053. let index = this.index;
  19054. let level = DataMgr.getBigSkillByIndex(index);
  19055. if (level == null) {
  19056. DataMgr.setBigSkill(index, 1, false);
  19057. level = 1;
  19058. }
  19059. this.ui.levelTxt.text = "LV." + level;
  19060. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19061. this.ui.tryNode.visible = true;
  19062. else
  19063. this.ui.tryNode.visible = false;
  19064. }
  19065. clickAddLevel() {
  19066. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19067. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19068. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19069. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19070. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19071. }
  19072. else {
  19073. console.log('zh:AD 失败,直接发放奖励');
  19074. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19075. }
  19076. }
  19077. qjff_AD_for_skilldisplay_clickAddLevel() {
  19078. DataMgr.setBigSkill(this.data.index, 1);
  19079. this.updateSelf();
  19080. xGame.common.upSkillLevel = true;
  19081. }
  19082. startGame() {
  19083. if (this.data.index == 3) {
  19084. alert('Coming soon!');
  19085. return;
  19086. }
  19087. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19088. let needCoin = xGame.common.bigMoveNeedCoin;
  19089. xGame.common.passAwardCoin = 2000;
  19090. let guide = DataMgr.getSkillGuide();
  19091. console.log('zh:startGame guide=' + guide);
  19092. xGame.common.temSelfLevel = 0;
  19093. if (guide == 0) {
  19094. needCoin = 0;
  19095. xGame.common.temSelfLevel = 100;
  19096. }
  19097. if (DataMgr.coinEnough(needCoin)) {
  19098. DataMgr.setCoin(-needCoin);
  19099. xGame.common.curPlayerSkillType = this.index;
  19100. if (guide == 0)
  19101. xGame.common.curPlayerSkillType = 0;
  19102. xGame.uiMgr.Show(UIGame$1);
  19103. xGame.uiMgr.Hide(UIMain$1);
  19104. xGame.uiMgr.Show(UIMatching$1, () => {
  19105. xGame.common.gameUI.ui.alpha = 1;
  19106. xGame.common.gameUI.startGame();
  19107. xGame.uiMgr.Hide(UISkill$1);
  19108. });
  19109. }
  19110. else {
  19111. xGame.uiMgr.Show(UIAddProp$1, 0);
  19112. Moyu.sendDataEvent("AddCoinVideo");
  19113. }
  19114. }
  19115. }
  19116. class UISkill$1 extends UIBase {
  19117. constructor() {
  19118. super();
  19119. this.skillData = [];
  19120. }
  19121. onConstructor() {
  19122. this.ui = ui_UISkill.createInstance();
  19123. this.contentPane = this.ui;
  19124. this.isEject = false;
  19125. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19126. this.initSkillData();
  19127. console.log('zh:aaaaaa1111111111');
  19128. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19129. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19130. console.log('zh:aaaaaa22222222');
  19131. this.displayList = [];
  19132. this.ui.skillNode.skillList.numItems = 3;
  19133. this.addUIClick(this.ui, this.interuptSecretary);
  19134. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19135. this.ui.talkNode.visible = false;
  19136. if (Moyu.isKs)
  19137. this.ui.closeNode.closeBtn.x += 100;
  19138. }
  19139. show() {
  19140. super.show();
  19141. this.playSecretaryIdle();
  19142. this.moneyNode.ui.c1.selectedIndex = 1;
  19143. Laya.timer.clearAll(this);
  19144. xGame.soundMgr.playSound("s_start");
  19145. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19146. let guide = DataMgr.getSkillGuide();
  19147. this.ui.guideNode.visible = guide == 0;
  19148. let item = this.getSkillItemByUIIndex(0);
  19149. if (guide == 0) {
  19150. item.ui.c1.selectedIndex = 1;
  19151. }
  19152. else {
  19153. item.ui.c1.selectedIndex = 0;
  19154. }
  19155. this.ui.guideNode.guideBtn.visible = guide == 0;
  19156. for (let index = 0; index < this.displayList.length; index++) {
  19157. this.displayList[index].checkTry();
  19158. }
  19159. }
  19160. getSkillItemByUIIndex(cur) {
  19161. for (let index = 0; index < this.displayList.length; index++) {
  19162. if (this.displayList[index].index == cur) {
  19163. return this.displayList[index];
  19164. }
  19165. }
  19166. }
  19167. enterGuideLevel() {
  19168. let item = this.getSkillItemByUIIndex(0);
  19169. item.startGame();
  19170. if (DataMgr.getNewUser())
  19171. Moyu.sendDataEvent("gameStart1");
  19172. }
  19173. initSkillData() {
  19174. this.skillData = [];
  19175. let nameList = xGame.common.skillNameList;
  19176. let iconList = xGame.common.skillIconList;
  19177. let describeList = [
  19178. "Jump shot executed — ball bounced and pocketed an extra one!",
  19179. "Bonus Sweep: A random follow-up strike hits 1 extra ball after your shot!",
  19180. "Freeze Effect: Your shot freezes 1 random ball — enemy can’t hit it, and others bounce off!"
  19181. ];
  19182. console.log('zh:initSkillData 111111111');
  19183. let data;
  19184. for (let index = 0; index < nameList.length; index++) {
  19185. data = {};
  19186. data.name = nameList[index];
  19187. data.icon = iconList[index];
  19188. data.describe = describeList[index];
  19189. data.index = index;
  19190. this.skillData.push(data);
  19191. }
  19192. }
  19193. updateSkillItem(index, target) {
  19194. if (this.displayList[index] == null) {
  19195. let uiIndex;
  19196. switch (index) {
  19197. case 0:
  19198. uiIndex = 1;
  19199. break;
  19200. case 1:
  19201. uiIndex = 0;
  19202. break;
  19203. case 2:
  19204. uiIndex = 2;
  19205. break;
  19206. case 3:
  19207. uiIndex = 3;
  19208. break;
  19209. default:
  19210. break;
  19211. }
  19212. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19213. this.displayList.push(temp);
  19214. }
  19215. }
  19216. playSecretaryIdle() {
  19217. let parent = this.ui.secretary.displayObject;
  19218. parent.destroyChildren();
  19219. let xx = this.ui.secretary.width / 2;
  19220. let yy = this.ui.secretary.height;
  19221. let scale = xGame.common.getSecretaryScale();
  19222. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19223. xGame.common.secretary.play(data, 0, true, parent);
  19224. }
  19225. returnUIMain() {
  19226. this.hide();
  19227. xGame.common.stopGirlPop(this.ui.talkNode);
  19228. xGame.uiMgr.Show(UIMain$1);
  19229. }
  19230. interuptSecretary() {
  19231. Laya.timer.clearAll(this);
  19232. this.playSecretaryRandomSound();
  19233. }
  19234. playSecretaryRandomSound() {
  19235. if (this.isHide)
  19236. return;
  19237. let time = xGame.common.randomNum(45000, 60000);
  19238. Laya.timer.once(time, this, () => {
  19239. if (this.isHide)
  19240. return;
  19241. let index = xGame.common.randomNum(4, 7);
  19242. xGame.soundMgr.playSound("s_main0" + index);
  19243. let words = 1;
  19244. switch (index) {
  19245. case 4:
  19246. words = 5;
  19247. break;
  19248. case 5:
  19249. words = 3;
  19250. break;
  19251. case 6:
  19252. words = 6;
  19253. break;
  19254. case 7:
  19255. words = 7;
  19256. break;
  19257. default:
  19258. break;
  19259. }
  19260. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19261. this.playSecretaryRandomSound();
  19262. });
  19263. }
  19264. }
  19265. UISkill$1.uiName = "UISkill";
  19266. class UIAddProp$1 extends UIBase {
  19267. constructor() {
  19268. super();
  19269. this.curType = "";
  19270. }
  19271. onConstructor() {
  19272. this.ui = ui_UIAddProp.createInstance();
  19273. this.contentPane = this.ui;
  19274. this.isEject = false;
  19275. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19276. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19277. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19278. this.updateUI();
  19279. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19280. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19281. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19282. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19283. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19284. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19285. }
  19286. show(type) {
  19287. super.show();
  19288. this.curType = type == 0 ? "coin" : "diamond";
  19289. this.switchBtn("");
  19290. this.ui.t0.play();
  19291. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19292. PlatMgr.showInsert(true);
  19293. }
  19294. closeSelf() {
  19295. this.hide();
  19296. }
  19297. updateUI() {
  19298. let data = cfgTable.moneyData;
  19299. let temp;
  19300. let obj;
  19301. for (const key in data) {
  19302. temp = data[key];
  19303. obj = this.ui.myNode["node" + key];
  19304. if (parseInt(key) <= 2) {
  19305. obj.diamondTxt.text = "+" + temp.num;
  19306. }
  19307. else {
  19308. obj.coinTxt.text = temp.num;
  19309. obj.diamondTxt.text = temp.get.split('_')[1];
  19310. }
  19311. }
  19312. this.updateDiamondShare();
  19313. }
  19314. updateDiamondShare() {
  19315. let data = DataMgr.getShareDiamondTimes();
  19316. if (data >= xGame.common.maxShareDiamondTimes) {
  19317. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19318. this.ui.myNode.node1.touchable = false;
  19319. }
  19320. else {
  19321. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19322. this.ui.myNode.node1.touchable = true;
  19323. }
  19324. }
  19325. switchBtn(type) {
  19326. if (type == "")
  19327. type = this.curType;
  19328. else {
  19329. if (this.curType == type) {
  19330. return;
  19331. }
  19332. else {
  19333. this.curType = type;
  19334. }
  19335. }
  19336. if (type == "coin") {
  19337. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19338. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19339. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19340. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19341. this.ui.myNode.c1.selectedIndex = 0;
  19342. }
  19343. else {
  19344. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19345. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19346. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19347. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19348. this.ui.myNode.c1.selectedIndex = 1;
  19349. }
  19350. }
  19351. convertCoin(index) {
  19352. let data = cfgTable.moneyData[index];
  19353. let coinNum = data.num;
  19354. let str = data.get.split('_')[1];
  19355. let needDiamond = parseInt(str);
  19356. if (DataMgr.diamondEnough(needDiamond)) {
  19357. DataMgr.setDiamond(-needDiamond);
  19358. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19359. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19360. }
  19361. else {
  19362. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19363. this.switchBtn("diamond");
  19364. }
  19365. }
  19366. videoGetDiamond() {
  19367. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19368. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19369. }
  19370. else {
  19371. console.log('zh:AD 失败,直接发放奖励');
  19372. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19373. }
  19374. }
  19375. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19376. let num = cfgTable.moneyData[2].num;
  19377. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19378. this.closeSelf();
  19379. }
  19380. videoGetCoin() {
  19381. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19382. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19383. }
  19384. else {
  19385. console.log('zh:AD 失败,直接发放奖励');
  19386. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19387. }
  19388. }
  19389. qjff_AD_for_uiAddProp_videoGetCoin() {
  19390. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19391. this.closeSelf();
  19392. }
  19393. shareGetDiamond() {
  19394. let times = DataMgr.getShareDiamondTimes();
  19395. if (times >= xGame.common.maxShareDiamondTimes) {
  19396. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19397. }
  19398. else {
  19399. if (Moyu.isTT) {
  19400. let num = cfgTable.moneyData[1].num;
  19401. Moyu.shareVideo = '';
  19402. Moyu.shareGame((success) => {
  19403. if (success) {
  19404. xGame.uiMgr.Show(UIMsg$1, "分享成功!");
  19405. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19406. DataMgr.setShareDiamondTimes(1);
  19407. this.updateDiamondShare();
  19408. }
  19409. else {
  19410. xGame.uiMgr.Show(UIMsg$1, "分享失败!");
  19411. }
  19412. });
  19413. }
  19414. else {
  19415. Moyu.showVideoAd(() => {
  19416. let diamond = xGame.common.randomNum(50, 100);
  19417. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19418. DataMgr.setShareDiamondTimes(1);
  19419. this.updateDiamondShare();
  19420. }, EAdType.randomDiamond);
  19421. }
  19422. }
  19423. }
  19424. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19425. }
  19426. openPutBallView() {
  19427. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19428. let skill = xGame.uiMgr.getUI(UISkill$1);
  19429. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19430. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19431. if (end && !end.isHide) {
  19432. xGame.uiMgr.Hide(UIGameEnd$1);
  19433. xGame.uiMgr.Show(UIMain$1);
  19434. }
  19435. if (skill && !skill.isHide)
  19436. xGame.uiMgr.Hide(UISkill$1);
  19437. if (uigame && !uigame.isHide)
  19438. xGame.uiMgr.Hide(UIGame$1);
  19439. if (level && !level.isHide) {
  19440. }
  19441. else {
  19442. xGame.uiMgr.Show(UILevelDisplay$1);
  19443. }
  19444. this.closeSelf();
  19445. }
  19446. }
  19447. UIAddProp$1.uiName = "UIAddProp";
  19448. class MoneyNode$1 {
  19449. constructor(ui) {
  19450. this.leftTime = 0;
  19451. this.ui = ui;
  19452. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19453. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19454. this.ui.addPowerBtn.onClick(this, this.addPower);
  19455. this.ui.c1.selectedIndex = 1;
  19456. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19457. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19458. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19459. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19460. this.coinChange();
  19461. this.diamondChange();
  19462. this.powerChange();
  19463. }
  19464. addPower() {
  19465. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19466. xGame.uiMgr.Show(UIPower$1);
  19467. }
  19468. powerChange() {
  19469. let powerNum = DataMgr.getPower();
  19470. this.ui.powerTxt.text = powerNum + "";
  19471. }
  19472. checkPowerTime() {
  19473. let cur = new Date().getTime();
  19474. let last = DataMgr.getPowerTime();
  19475. if (last == 0) {
  19476. last = cur;
  19477. DataMgr.setPowerTime(cur);
  19478. }
  19479. let power = DataMgr.getPower();
  19480. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19481. Laya.timer.clearAll(this);
  19482. if (power >= xGame.common.natureMaxPower) {
  19483. this.ui.powerTimeTxt.text = "";
  19484. DataMgr.setPowerTime(cur);
  19485. return;
  19486. }
  19487. if (power + offset >= xGame.common.natureMaxPower) {
  19488. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19489. this.ui.powerTimeTxt.text = "";
  19490. DataMgr.setPowerTime(cur);
  19491. }
  19492. else {
  19493. if (offset > 0) {
  19494. DataMgr.setPower(offset);
  19495. DataMgr.setPowerTime(cur);
  19496. }
  19497. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19498. this.leftTime = xGame.common.powerRecoverNum - time;
  19499. if (this.leftTime <= 0)
  19500. this.leftTime = 0;
  19501. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19502. Laya.timer.loop(1000, this, this.updatePowerTime);
  19503. }
  19504. }
  19505. updatePowerTime() {
  19506. this.leftTime -= 1;
  19507. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19508. if (this.leftTime <= 0) {
  19509. this.checkPowerTime();
  19510. }
  19511. }
  19512. coinChange() {
  19513. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19514. }
  19515. diamondChange() {
  19516. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19517. }
  19518. addCoin() {
  19519. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19520. Moyu.sendDataEvent("AddCoinBtn");
  19521. xGame.uiMgr.Show(UIAddProp$1, 0);
  19522. }
  19523. addDiamond() {
  19524. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19525. Moyu.sendDataEvent("AddDiamondBtn");
  19526. xGame.uiMgr.Show(UIAddProp$1, 1);
  19527. }
  19528. }
  19529. class SettingNode$1 {
  19530. constructor(ui) {
  19531. this.showSetting = false;
  19532. this.openSound = true;
  19533. this.openShake = true;
  19534. this.ui = ui;
  19535. this.ui.soundBtn.onClick(this, this.switchSound);
  19536. this.ui.shakeBtn.onClick(this, this.switchShake);
  19537. this.ui.xyBtn.onClick(this, this.onXy);
  19538. this.ui.clickNode.onClick(this, this.changeSetting);
  19539. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19540. this.ui.xyBtn.visible = false;
  19541. this.ui.shakeBtn.visible = false;
  19542. }
  19543. changeSetting() {
  19544. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19545. this.showSetting = !this.showSetting;
  19546. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19547. }
  19548. switchSound() {
  19549. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19550. this.openSound = !this.openSound;
  19551. Moyu.onSetting(this.openSound, this.openShake);
  19552. xGame.soundMgr.onSetting(this.openSound);
  19553. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19554. }
  19555. switchShake() {
  19556. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19557. this.openShake = !this.openShake;
  19558. Moyu.onSetting(this.openSound, this.openShake);
  19559. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19560. }
  19561. onXy() {
  19562. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19563. MoyuMgr$1.showXy(1);
  19564. }
  19565. }
  19566. class UIDraw$1 extends UIBase {
  19567. constructor() {
  19568. super();
  19569. this.curKey = 0;
  19570. }
  19571. onConstructor() {
  19572. this.ui = ui_UIDraw.createInstance();
  19573. this.contentPane = this.ui;
  19574. this.isEject = false;
  19575. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19576. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19577. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19578. this.initDraw();
  19579. this.initUI();
  19580. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19581. if (Moyu.isKs)
  19582. this.ui.closeNode.closeBtn.x += 100;
  19583. }
  19584. show() {
  19585. super.show();
  19586. this.ui.t0.play();
  19587. this.playSecretaryIdle();
  19588. this.updateDraw();
  19589. this.checkFree();
  19590. if (PlatMgr.bannerDelay > 0) {
  19591. this.ui.closeNode.closeBtn.visible = false;
  19592. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19593. this.ui.closeNode.closeBtn.visible = true;
  19594. });
  19595. }
  19596. PlatMgr.showRateBanner();
  19597. }
  19598. hide() {
  19599. Laya.timer.clearAll(this);
  19600. super.hide();
  19601. }
  19602. checkFree() {
  19603. let isFree = DataMgr.getDailyfreeDrawTimes();
  19604. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19605. }
  19606. initDraw() {
  19607. this.drawObj = [];
  19608. let data = cfgTable.drawData;
  19609. let temp;
  19610. let weight = 0;
  19611. for (const key in data) {
  19612. temp = data[key];
  19613. weight += temp.weight;
  19614. this.drawObj.push(weight);
  19615. }
  19616. this.allWeight = weight;
  19617. }
  19618. initUI() {
  19619. let data = cfgTable.drawData;
  19620. let temp;
  19621. let img;
  19622. let txt;
  19623. for (const key in data) {
  19624. temp = data[key];
  19625. img = this.ui.myNode.rotNode["img" + key];
  19626. txt = this.ui.myNode.rotNode["txt" + key];
  19627. img.url = xGame.common.getGameIconUrl(temp.icon);
  19628. txt.visible = true;
  19629. if (temp.award > 2) {
  19630. img.rotation = 0;
  19631. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19632. }
  19633. else {
  19634. img.rotation = temp.rotation;
  19635. txt.text = temp.num;
  19636. }
  19637. }
  19638. }
  19639. getCurkey() {
  19640. let rand = Math.random() * this.allWeight;
  19641. let temp;
  19642. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19643. temp = this.drawObj[index];
  19644. if (index == 0) {
  19645. if (rand < temp) {
  19646. return index + 1;
  19647. }
  19648. }
  19649. else {
  19650. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19651. return index + 1;
  19652. }
  19653. }
  19654. }
  19655. return 2;
  19656. }
  19657. startDraw() {
  19658. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19659. if (freeTimes > 0) {
  19660. this.beginDraw();
  19661. DataMgr.setDailyfreeDrawTimes(0);
  19662. this.checkFree();
  19663. }
  19664. else {
  19665. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19666. }
  19667. else {
  19668. console.log('zh:AD 失败,直接发放奖励');
  19669. this.qjff_chouJiang();
  19670. }
  19671. }
  19672. }
  19673. qjff_chouJiang() {
  19674. this.beginDraw();
  19675. }
  19676. beginDraw() {
  19677. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19678. this.ui.drawBtn.touchable = false;
  19679. this.curKey = this.getCurkey();
  19680. console.log("当前key", this.curKey);
  19681. let cell = 60;
  19682. let lap = 3;
  19683. let angle = cell * (this.curKey - 1) + lap * 360;
  19684. let target = this.ui.myNode.rotNode;
  19685. target.rotation = 0;
  19686. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19687. console.log("旋转完成");
  19688. this.ui.drawBtn.touchable = true;
  19689. this.getAward();
  19690. }));
  19691. }
  19692. getAward() {
  19693. let data = cfgTable.drawData[this.curKey];
  19694. let temp = new AwardType();
  19695. temp.type = data.award;
  19696. temp.num = data.num;
  19697. xGame.common.getAward([temp], () => {
  19698. DataMgr.setDrawTimes(1);
  19699. this.updateDraw();
  19700. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19701. });
  19702. }
  19703. updateDraw() {
  19704. let drawTimes = DataMgr.getDrawTimes();
  19705. let awardTimes = DataMgr.getDrawAwardTimes();
  19706. if (Math.floor(drawTimes / 3) > awardTimes) {
  19707. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19708. this.ui.extraNode.boxBtn.touchable = true;
  19709. this.ui.extraNode.tipsTxt.text = "3/3";
  19710. this.ui.extraNode.barNode.width = 265;
  19711. this.getExtraAward();
  19712. }
  19713. else {
  19714. this.ui.extraNode.boxBtn.t0.stop();
  19715. this.ui.extraNode.boxBtn.touchable = false;
  19716. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19717. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19718. }
  19719. let data = cfgTable.drawData[1];
  19720. if (awardTimes == 0) {
  19721. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19722. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19723. this.ui.myNode.rotNode.img1.rotation = 0;
  19724. }
  19725. else {
  19726. let award = data.nextid;
  19727. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19728. this.ui.myNode.rotNode.txt1.text = award[1];
  19729. this.ui.myNode.rotNode.img1.rotation = 0;
  19730. }
  19731. }
  19732. getExtraAward() {
  19733. let drawTimes = DataMgr.getDrawTimes();
  19734. let awardTimes = DataMgr.getDrawAwardTimes();
  19735. let data = cfgTable.drawData[1];
  19736. let award = new AwardType();
  19737. if (awardTimes == 0) {
  19738. award.num = data.num;
  19739. award.type = data.award;
  19740. xGame.common.getAward([award], () => {
  19741. let all = Math.floor(drawTimes / 3);
  19742. DataMgr.setDrawAwardTimes(all);
  19743. this.updateDraw();
  19744. });
  19745. }
  19746. else {
  19747. award.num = parseInt(data.nextid[1]);
  19748. award.type = parseInt(data.nextid[0]);
  19749. xGame.common.getAward([award], () => {
  19750. let all = Math.floor(drawTimes / 3);
  19751. DataMgr.setDrawAwardTimes(all);
  19752. this.updateDraw();
  19753. });
  19754. }
  19755. }
  19756. closeSelf() {
  19757. this.hide();
  19758. }
  19759. playSecretaryIdle() {
  19760. let parent = this.ui.secretary.displayObject;
  19761. parent.destroyChildren();
  19762. let xx = this.ui.secretary.width / 2;
  19763. let yy = this.ui.secretary.height;
  19764. let scale = xGame.common.getSecretaryScale();
  19765. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19766. xGame.common.secretary.play(data, 0, true, parent);
  19767. }
  19768. }
  19769. UIDraw$1.uiName = "UIDraw";
  19770. class UIRanking$1 extends UIBase {
  19771. constructor() {
  19772. super();
  19773. this.showSelf = true;
  19774. this.rankType = 1;
  19775. this.rankList = [];
  19776. this.myIndex = 0;
  19777. this.myStar = 0;
  19778. }
  19779. onConstructor() {
  19780. this.ui = ui_UIRanking.createInstance();
  19781. this.contentPane = this.ui;
  19782. this.isEject = false;
  19783. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19784. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19785. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19786. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19787. this.ui.myNode.myList.setVirtual();
  19788. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19789. }
  19790. show() {
  19791. super.show();
  19792. this.myIndex = 51;
  19793. Moyu.getRankList({
  19794. rankId: xGame.common.curRankID,
  19795. type: MoyuRankType.total,
  19796. page: 1,
  19797. pageSize: 50,
  19798. }, this, this.updateItemData);
  19799. this.updateSelf();
  19800. let self = Moyu.getUserInfo();
  19801. if (!self.isAuth) {
  19802. Moyu.initUser(this, () => {
  19803. DataMgr.upRankData();
  19804. });
  19805. }
  19806. }
  19807. updateSelfItem() {
  19808. let self = Moyu.getUserInfo();
  19809. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19810. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19811. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19812. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19813. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19814. }
  19815. updateItemData(data) {
  19816. this.myStar = xGame.common.getAllStarNum();
  19817. if (this.rankList.length < 2) {
  19818. this.rankList = data;
  19819. let self = Moyu.getUserInfo();
  19820. for (let i = 0; i < data.length; i++) {
  19821. let data = this.rankList[i];
  19822. if (data.userId == self.userId) {
  19823. this.rankList.splice(i, 1);
  19824. break;
  19825. }
  19826. }
  19827. for (let i = 0; i < data.length; i++) {
  19828. let data = this.rankList[i];
  19829. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19830. this.myIndex = i + 1;
  19831. let user = { headIcon: self.headIcon, nickName: "myself" };
  19832. let ud = { user: user, data: {} };
  19833. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19834. if (Moyu.platType < 11) {
  19835. user.headIcon = self.headIcon;
  19836. user.nickName = self.nickName;
  19837. }
  19838. this.rankList.splice(i, 0, md);
  19839. break;
  19840. }
  19841. }
  19842. }
  19843. this.updateSelfItem();
  19844. this.ui.myNode.myList.numItems = this.rankList.length;
  19845. }
  19846. updateItemUI(index, obj) {
  19847. let data = this.rankList[index];
  19848. let userData = JSON.parse(data.userData).user;
  19849. obj.nameTxt.text = userData.nickName.toString();
  19850. obj.valueTxt.text = data.rankScore;
  19851. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19852. obj.rankTxt.text = index + 1;
  19853. switch (index) {
  19854. case 0:
  19855. this.setImg(obj, 1, 0, 0);
  19856. obj.rankTxt.color = "#FFC047";
  19857. break;
  19858. case 1:
  19859. this.setImg(obj, 0, 1, 0);
  19860. obj.rankTxt.color = "#ACACAC";
  19861. break;
  19862. case 2:
  19863. this.setImg(obj, 0, 0, 1);
  19864. obj.rankTxt.color = "#D09672";
  19865. break;
  19866. default:
  19867. this.setImg(obj, 0, 0, 0);
  19868. obj.rankTxt.color = "#496FAB";
  19869. break;
  19870. }
  19871. }
  19872. setImg(obj, a, b, c) {
  19873. obj.img1.visible = a ? true : false;
  19874. obj.img2.visible = b ? true : false;
  19875. obj.img3.visible = c ? true : false;
  19876. }
  19877. changeList(type) {
  19878. this.rankType = type;
  19879. this.updateSelf();
  19880. }
  19881. changeSelfNode() {
  19882. this.showSelf = !this.showSelf;
  19883. this.updateSelf();
  19884. }
  19885. updateSelf() {
  19886. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19887. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19888. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19889. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19890. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19891. }
  19892. }
  19893. UIRanking$1.uiName = "UIRanking";
  19894. class UISecretary$1 extends UIBase {
  19895. constructor() {
  19896. super();
  19897. this.curIndex = 1;
  19898. }
  19899. onConstructor() {
  19900. this.ui = ui_UISecretary.createInstance();
  19901. this.contentPane = this.ui;
  19902. this.isEject = false;
  19903. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19904. this.nodeObj = { left: null, right: null, cur: null };
  19905. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19906. }
  19907. show() {
  19908. super.show();
  19909. this.ui.t0.play();
  19910. this.updateData();
  19911. }
  19912. addSecretarySpine(node, spineName) {
  19913. if (spineName == "mishu") {
  19914. if (this.secretarySpine1) {
  19915. node.displayObject.destroyChildren();
  19916. this.playWoman(this.secretarySpine1, node.displayObject);
  19917. }
  19918. else {
  19919. let spine1 = new SpineMgr("mishu", () => {
  19920. this.secretarySpine1 = spine1;
  19921. this.playWoman(this.secretarySpine1, node.displayObject);
  19922. });
  19923. }
  19924. }
  19925. else {
  19926. if (this.secretarySpine2) {
  19927. node.displayObject.destroyChildren();
  19928. this.playWoman(this.secretarySpine2, node.displayObject);
  19929. }
  19930. else {
  19931. let spine2 = new SpineMgr("xiaomishu2", () => {
  19932. this.secretarySpine2 = spine2;
  19933. this.playWoman(this.secretarySpine2, node.displayObject);
  19934. });
  19935. }
  19936. }
  19937. }
  19938. playWoman(node, parent) {
  19939. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19940. let yy = this.ui.myNode.gameNode3.secretary.height;
  19941. let scale = 1.5;
  19942. if (node == this.secretarySpine2) {
  19943. scale = 1.2;
  19944. }
  19945. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19946. node.play(data, 0, true, parent);
  19947. }
  19948. turnLeft() {
  19949. this.curIndex--;
  19950. if (this.curIndex < 1) {
  19951. this.curIndex = 2;
  19952. }
  19953. let left = this.nodeObj.left;
  19954. let right = this.nodeObj.right;
  19955. let cur = this.nodeObj.cur;
  19956. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19957. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19958. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19959. this.updateData();
  19960. }));
  19961. this.ui.myNode.setChildIndex(right, 2);
  19962. this.nodeObj.left = cur;
  19963. this.nodeObj.right = left;
  19964. this.nodeObj.cur = right;
  19965. }
  19966. turnRight() {
  19967. this.curIndex++;
  19968. if (this.curIndex > 2) {
  19969. this.curIndex = 1;
  19970. }
  19971. let left = this.nodeObj.left;
  19972. let right = this.nodeObj.right;
  19973. let cur = this.nodeObj.cur;
  19974. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19975. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19976. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19977. this.updateData();
  19978. }));
  19979. this.ui.myNode.setChildIndex(left, 2);
  19980. this.nodeObj.left = right;
  19981. this.nodeObj.right = cur;
  19982. this.nodeObj.cur = left;
  19983. }
  19984. updateData() {
  19985. let data = cfgTable.secretaryshopData;
  19986. let children = this.ui.myNode._children;
  19987. let temp;
  19988. let curData;
  19989. for (let index = 0; index < children.length; index++) {
  19990. temp = children[index];
  19991. curData = data[1];
  19992. temp.heightTxt.text = curData.height;
  19993. temp.foodTxt.text = curData.food;
  19994. temp.historyTxt.text = curData.history;
  19995. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  19996. this.addSecretarySpine(temp.secretary, curData.spine);
  19997. let womanIndex = curData.id - 1;
  19998. let getWoman = DataMgr.getSecretary(womanIndex);
  19999. let curUse = DataMgr.getCurSecretary();
  20000. if (getWoman) {
  20001. if (curUse == womanIndex) {
  20002. temp.purchaseBtn.c1.selectedIndex = 1;
  20003. }
  20004. else {
  20005. temp.purchaseBtn.c1.selectedIndex = 2;
  20006. }
  20007. }
  20008. else {
  20009. temp.purchaseBtn.c1.selectedIndex = 0;
  20010. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20011. }
  20012. temp.purchaseBtn.offClick(this, this.clickSecretary);
  20013. temp.purchaseBtn.onClick(this, this.clickSecretary, [getWoman, curUse, womanIndex, curData.price]);
  20014. }
  20015. }
  20016. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20017. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20018. if (getWoman) {
  20019. if (curUse != womanIndex) {
  20020. console.log();
  20021. DataMgr.setCurSecretary(womanIndex);
  20022. this.updateData();
  20023. }
  20024. }
  20025. else {
  20026. let need = needDiamond;
  20027. if (DataMgr.diamondEnough(need)) {
  20028. DataMgr.setDiamond(-need);
  20029. DataMgr.setSecretary(womanIndex, 1);
  20030. DataMgr.setCurSecretary(womanIndex);
  20031. this.updateData();
  20032. }
  20033. else {
  20034. xGame.uiMgr.Show(UIAddProp$1, 1);
  20035. }
  20036. }
  20037. }
  20038. closeSelf() {
  20039. this.hide();
  20040. }
  20041. }
  20042. UISecretary$1.uiName = "UISecretary";
  20043. class BallRodDisplay$1 {
  20044. constructor(ui, index) {
  20045. this.index = 0;
  20046. this.uiIndex = 0;
  20047. this.ui = ui;
  20048. this.index = index;
  20049. this.initData();
  20050. }
  20051. initData() {
  20052. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20053. let data = cfgTable.ballrodData[this.index + 1];
  20054. this.ui.nameTxt.text = data.name;
  20055. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20056. this.ui.levelNode.c1.selectedIndex = data.quality;
  20057. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20058. if (data.spine) {
  20059. this.mySpine = new SpineMgr(data.spine, () => {
  20060. let xx = 150;
  20061. let yy = 70;
  20062. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20063. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20064. });
  20065. }
  20066. }
  20067. updateSelf() {
  20068. let get = DataMgr.getBallRod(this.index);
  20069. if (get == null)
  20070. get = 1;
  20071. let curUse = DataMgr.getCurBallRod();
  20072. if (get) {
  20073. if (curUse == this.index) {
  20074. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20075. }
  20076. else {
  20077. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20078. }
  20079. }
  20080. else {
  20081. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20082. }
  20083. }
  20084. buyBallRod() {
  20085. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20086. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20087. switch (selectedIndex) {
  20088. case 0:
  20089. break;
  20090. case 1:
  20091. DataMgr.setCurBallRod(this.index);
  20092. let ui = xGame.uiMgr.getUI(UIShop$1);
  20093. ui.updateBallRod();
  20094. break;
  20095. case 2:
  20096. let data = cfgTable.ballrodData[this.index + 1];
  20097. let need = data.price;
  20098. if (DataMgr.diamondEnough(need)) {
  20099. DataMgr.setDiamond(-need);
  20100. DataMgr.setBallRod(this.index, 1);
  20101. DataMgr.setCurBallRod(this.index);
  20102. let ui = xGame.uiMgr.getUI(UIShop$1);
  20103. ui.updateBallRod();
  20104. }
  20105. else {
  20106. xGame.uiMgr.Show(UIAddProp$1, 1);
  20107. }
  20108. break;
  20109. default:
  20110. break;
  20111. }
  20112. }
  20113. }
  20114. class UIShop$1 extends UIBase {
  20115. constructor() {
  20116. super();
  20117. this.itemNums = 0;
  20118. }
  20119. onConstructor() {
  20120. this.ui = ui_UIShop.createInstance();
  20121. this.contentPane = this.ui;
  20122. this.isEject = false;
  20123. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20124. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20125. this.addUIClick(this.ui, this.interuptSecretary);
  20126. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20127. this.ballRodArr = [];
  20128. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20129. this.ui.myNode.myList.numItems = this.itemNums;
  20130. if (Moyu.isKs)
  20131. this.ui.closeNode.closeBtn.x += 100;
  20132. }
  20133. show() {
  20134. super.show();
  20135. this.playSecretaryIdle();
  20136. this.updateBallRod();
  20137. }
  20138. updateBallRod() {
  20139. for (let index = 0; index < this.ballRodArr.length; index++) {
  20140. this.ballRodArr[index].updateSelf();
  20141. }
  20142. }
  20143. renderBallRod(sort, obj) {
  20144. let index = this.getIndexBySort(sort + 1) - 1;
  20145. let ballRod = new BallRodDisplay$1(obj, index);
  20146. this.ballRodArr.push(ballRod);
  20147. }
  20148. getIndexBySort(sort) {
  20149. let object = cfgTable.ballrodData;
  20150. for (const key in object) {
  20151. if (object[key].sort == sort) {
  20152. return parseInt(key);
  20153. }
  20154. }
  20155. }
  20156. playSecretaryIdle() {
  20157. let parent = this.ui.secretary.displayObject;
  20158. parent.destroyChildren();
  20159. let xx = this.ui.secretary.width / 2;
  20160. let yy = this.ui.secretary.height;
  20161. let scale = xGame.common.getSecretaryScale();
  20162. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20163. xGame.common.secretary.play(data, 0, true, parent);
  20164. }
  20165. interuptSecretary() {
  20166. Laya.timer.clearAll(this);
  20167. this.playSecretaryRandomSound();
  20168. }
  20169. playSecretaryRandomSound() {
  20170. if (this.isHide)
  20171. return;
  20172. let time = xGame.common.randomNum(45000, 60000);
  20173. Laya.timer.once(time, this, () => {
  20174. if (this.isHide)
  20175. return;
  20176. let index = xGame.common.randomNum(4, 7);
  20177. xGame.soundMgr.playSound("s_main0" + index);
  20178. let words = 1;
  20179. switch (index) {
  20180. case 4:
  20181. words = 5;
  20182. break;
  20183. case 5:
  20184. words = 3;
  20185. break;
  20186. case 6:
  20187. words = 6;
  20188. break;
  20189. case 7:
  20190. words = 7;
  20191. break;
  20192. default:
  20193. break;
  20194. }
  20195. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20196. this.playSecretaryRandomSound();
  20197. });
  20198. }
  20199. closeSelf() {
  20200. this.hide();
  20201. }
  20202. }
  20203. UIShop$1.uiName = "UIShop";
  20204. class SignMax$1 {
  20205. constructor(ui) {
  20206. this.ui = ui;
  20207. }
  20208. updateSelf(index, sameDay, curDayIndex) {
  20209. let data = cfgTable.signData[index + 1];
  20210. this.ui.titleTxt.text = data.title;
  20211. let arr1 = data.award[0].split('-');
  20212. let arr2 = data.award[1].split('-');
  20213. let num1 = parseInt(arr1[1]);
  20214. let num2 = parseInt(arr2[1]);
  20215. this.ui.numTxt1.text = num1 + "";
  20216. this.ui.numTxt2.text = num2 + "";
  20217. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20218. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20219. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20220. this.ui.numTxt1.visible = false;
  20221. }
  20222. else {
  20223. this.ui.numTxt1.visible = true;
  20224. }
  20225. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20226. this.ui.numTxt2.visible = false;
  20227. }
  20228. else {
  20229. this.ui.numTxt2.visible = true;
  20230. }
  20231. if (index < curDayIndex) {
  20232. this.ui.c1.selectedIndex = 1;
  20233. }
  20234. else if (index == curDayIndex) {
  20235. if (sameDay) {
  20236. this.ui.c1.selectedIndex = 2;
  20237. }
  20238. else {
  20239. this.ui.c1.selectedIndex = 2;
  20240. }
  20241. }
  20242. else {
  20243. this.ui.c1.selectedIndex = 0;
  20244. }
  20245. }
  20246. }
  20247. class SignNormal$1 {
  20248. constructor(ui) {
  20249. this.ui = ui;
  20250. }
  20251. updateSelf(index, sameDay, curDayIndex) {
  20252. let data = cfgTable.signData[index + 1];
  20253. this.ui.titleTxt.text = data.title;
  20254. let arr = data.award[0].split('-');
  20255. let type = parseInt(arr[0]);
  20256. let num = parseInt(arr[1]);
  20257. this.ui.numTxt.text = num + "";
  20258. if (type > 2) {
  20259. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20260. this.ui.myIcon.rotation = 0;
  20261. }
  20262. else {
  20263. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20264. this.ui.myIcon.rotation = 0;
  20265. }
  20266. if (xGame.common.signAwardContainsRod(data.award)) {
  20267. this.ui.numTxt.visible = false;
  20268. }
  20269. else {
  20270. this.ui.numTxt.visible = true;
  20271. }
  20272. if (index < curDayIndex) {
  20273. this.ui.c1.selectedIndex = 1;
  20274. }
  20275. else if (index == curDayIndex) {
  20276. if (sameDay) {
  20277. this.ui.c1.selectedIndex = 2;
  20278. }
  20279. else {
  20280. this.ui.c1.selectedIndex = 2;
  20281. }
  20282. }
  20283. else {
  20284. this.ui.c1.selectedIndex = 0;
  20285. }
  20286. }
  20287. }
  20288. class UISign$1 extends UIBase {
  20289. constructor() {
  20290. super();
  20291. this.curDayIndex = 0;
  20292. this.starX = 0;
  20293. }
  20294. onConstructor() {
  20295. this.ui = ui_UISign.createInstance();
  20296. this.contentPane = this.ui;
  20297. this.isEject = false;
  20298. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20299. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20300. this.initSignItem();
  20301. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20302. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20303. }
  20304. show() {
  20305. super.show();
  20306. this.ui.t0.play();
  20307. this.playSecretaryIdle();
  20308. this.updateSign();
  20309. }
  20310. initSignItem() {
  20311. this.signArr = [];
  20312. for (let index = 0; index < 6; index++) {
  20313. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20314. this.signArr.push(temp);
  20315. }
  20316. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20317. if (Moyu.isKs)
  20318. this.ui.closeNode.closeBtn.x += 100;
  20319. }
  20320. updateSign() {
  20321. let sameDay = xGame.common.judgeSameDay();
  20322. let max = 7;
  20323. this.curDayIndex = DataMgr.getSignData();
  20324. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20325. this.curDayIndex = 0;
  20326. if (!sameDay) {
  20327. this.ui.normalBtn.visible = true;
  20328. this.ui.tipsNode.visible = false;
  20329. this.ui.againBtn.visible = false;
  20330. }
  20331. else {
  20332. this.ui.normalBtn.visible = false;
  20333. let again = DataMgr.getExtraSign();
  20334. let isCurrency = false;
  20335. let index = this.curDayIndex;
  20336. if (index == 0)
  20337. index = 7;
  20338. let award = cfgTable.signData[index].award;
  20339. let num = award[0].split("-")[0];
  20340. if (num == "1" || num == "2")
  20341. isCurrency = true;
  20342. let showAgain = again == 0 && isCurrency;
  20343. this.ui.againBtn.visible = showAgain;
  20344. this.ui.tipsNode.visible = !showAgain;
  20345. }
  20346. for (let index = 0; index < this.signArr.length; index++) {
  20347. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20348. }
  20349. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20350. }
  20351. playSecretaryIdle() {
  20352. let parent = this.ui.secretary.displayObject;
  20353. parent.destroyChildren();
  20354. let xx = this.ui.secretary.width / 2;
  20355. let yy = this.ui.secretary.height;
  20356. let scale = xGame.common.getSecretaryScale();
  20357. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20358. xGame.common.secretary.play(data, 0, true, parent);
  20359. }
  20360. closeSelf() {
  20361. this.hide();
  20362. }
  20363. normalGetAward() {
  20364. let sameDay = xGame.common.judgeSameDay();
  20365. if (!sameDay) {
  20366. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20367. let temp;
  20368. let type;
  20369. let num;
  20370. let arr = [];
  20371. for (let index = 0; index < award.length; index++) {
  20372. temp = award[index].split("-");
  20373. type = parseInt(temp[0]);
  20374. num = parseInt(temp[1]);
  20375. let awardType = new AwardType();
  20376. awardType.num = num;
  20377. awardType.type = type;
  20378. arr.push(awardType);
  20379. }
  20380. xGame.common.getAward(arr, (watchVideo) => {
  20381. this.curDayIndex++;
  20382. if (this.curDayIndex > 7)
  20383. this.curDayIndex = 0;
  20384. DataMgr.setSignData(this.curDayIndex);
  20385. DataMgr.setSignTime(new Date().getTime());
  20386. if (watchVideo) {
  20387. DataMgr.setExtraSign(1);
  20388. Moyu.sendDataEvent("signIn1");
  20389. }
  20390. this.updateSign();
  20391. });
  20392. }
  20393. }
  20394. againGetAward() {
  20395. Moyu.sendDataEvent("signIn2");
  20396. console.log('zh:qjff_AD_for_uisign');
  20397. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20398. }
  20399. else {
  20400. console.log('zh:AD 失败,直接发放奖励');
  20401. this.qjff_AD_for_uisign();
  20402. }
  20403. }
  20404. qjff_AD_for_uisign() {
  20405. let index = this.curDayIndex;
  20406. if (index == 0)
  20407. index = 7;
  20408. let award = cfgTable.signData[index].award;
  20409. let temp;
  20410. let type;
  20411. let num;
  20412. for (let index = 0; index < award.length; index++) {
  20413. temp = award[index].split("-");
  20414. type = parseInt(temp[0]);
  20415. num = parseInt(temp[1]) * 3;
  20416. xGame.common.playObjFlyAnim(num, type);
  20417. }
  20418. DataMgr.setExtraSign(1);
  20419. this.updateSign();
  20420. }
  20421. }
  20422. UISign$1.uiName = "UISign";
  20423. class UIModeSelection$1 extends UIBase {
  20424. constructor() {
  20425. super();
  20426. }
  20427. onConstructor() {
  20428. this.ui = ui_UIModeSelection.createInstance();
  20429. this.contentPane = this.ui;
  20430. this.isEject = false;
  20431. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20432. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20433. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20434. this.addUIClick(this.ui.closeBtn, this.hide);
  20435. this.peopleArr = [650, 6900, 3800];
  20436. this.peopleOffest = [50, 500, 200];
  20437. this.updateSelf();
  20438. }
  20439. show(callback) {
  20440. super.show();
  20441. this.ui.t0.play();
  20442. this.callback = callback;
  20443. }
  20444. updateSelf() {
  20445. let cfg = cfgTable.modeselectData;
  20446. for (let index = 1; index <= 3; index++) {
  20447. let node = this.ui.myNode["type" + index];
  20448. node.need.text = cfg[index].need;
  20449. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20450. node.peopleTxt.text = this.getRandPeople(index - 1);
  20451. }
  20452. }
  20453. enterGame(type) {
  20454. xGame.common.classicRoomType = type;
  20455. let cfg = cfgTable.modeselectData[type];
  20456. let need = cfg.need;
  20457. xGame.common.passAwardCoin = cfg.award;
  20458. if (DataMgr.coinEnough(need)) {
  20459. DataMgr.setCoin(-need);
  20460. this.ui.myNode["type" + type].t0.play();
  20461. Laya.timer.once(200, this, () => {
  20462. this.callback && this.callback();
  20463. });
  20464. }
  20465. else {
  20466. Moyu.sendDataEvent("AddCoinVideo");
  20467. xGame.uiMgr.Show(UIAddProp$1, 0);
  20468. }
  20469. }
  20470. getRandPeople(index) {
  20471. let rand = this.peopleOffest[index];
  20472. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20473. }
  20474. }
  20475. UIModeSelection$1.uiName = "UIModeSelection";
  20476. class UITry$1 extends UIBase {
  20477. constructor() {
  20478. super();
  20479. this.closeTime = 0;
  20480. this.closeNum = 0;
  20481. this.skillUrl = xGame.common.skillIconList;
  20482. }
  20483. onConstructor() {
  20484. this.ui = ui_UITry.createInstance();
  20485. this.contentPane = this.ui;
  20486. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20487. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20488. }
  20489. show() {
  20490. super.show();
  20491. this.closeNum = 0;
  20492. this.closeTime = 15;
  20493. this.ui.t0.play();
  20494. PlatMgr.showRateBanner();
  20495. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20496. Laya.timer.loop(1000, this, this.updateTime);
  20497. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20498. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20499. xGame.common.gameMgr.gamePause = true;
  20500. }
  20501. updateTime() {
  20502. if (this.closeTime > 1) {
  20503. this.closeTime--;
  20504. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20505. }
  20506. else
  20507. this.hide();
  20508. }
  20509. hide() {
  20510. Laya.timer.clearAll(this);
  20511. Moyu.showBannerAd(false);
  20512. super.hide();
  20513. xGame.common.gameMgr.gamePause = false;
  20514. }
  20515. onTry() {
  20516. console.log('zh:qjff_AD_for_uitry');
  20517. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20518. }
  20519. else {
  20520. console.log('zh:AD 失败,直接发放奖励');
  20521. this.qjff_AD_for_uitry();
  20522. }
  20523. }
  20524. qjff_AD_for_uitry() {
  20525. let select = xGame.common.curPlayerSkillType;
  20526. DataMgr.gameData.trySkill = select;
  20527. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20528. DataMgr.saveGameData();
  20529. DataMgr.setBigSkill(select, 1);
  20530. xGame.showTip("Trial Successful");
  20531. this.hide();
  20532. }
  20533. onCancel() {
  20534. if (this.closeNum > 0) {
  20535. this.closeNum--;
  20536. if (this.closeNum < 2)
  20537. this.hide();
  20538. return;
  20539. }
  20540. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20541. this.onTry();
  20542. }
  20543. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20544. this.closeNum = 3;
  20545. }
  20546. else
  20547. this.hide();
  20548. }
  20549. }
  20550. UITry$1.uiName = "UITry";
  20551. class UIGetAward$1 extends UIBase {
  20552. constructor() {
  20553. super();
  20554. this.showTriple = true;
  20555. }
  20556. onConstructor() {
  20557. this.ui = ui_UIGetAward.createInstance();
  20558. this.contentPane = this.ui;
  20559. this.isEject = false;
  20560. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20561. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20562. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20563. }
  20564. show(arr, showTriple, callback) {
  20565. super.show();
  20566. this.ui.t0.play();
  20567. this.ui.eftNode.visible = true;
  20568. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20569. this.ui.eftNode.visible = false;
  20570. }), 1, 0, 0, 0.9);
  20571. this.awardArr = arr;
  20572. this.showTriple = showTriple;
  20573. this.callback = callback;
  20574. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20575. this.ui.myList.numItems = arr.length;
  20576. xGame.soundMgr.playSound("getaward");
  20577. }
  20578. updateSelf(index, obj) {
  20579. let temp = this.awardArr[index];
  20580. let icon = this.getIcon(temp.type);
  20581. let str = icon;
  20582. if (temp.type > 2) {
  20583. str = "s" + icon;
  20584. }
  20585. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20586. obj.myIcon.rotation = 0;
  20587. obj.numTxt.text = temp.num + "";
  20588. obj.numTxt.visible = temp.type > 2 ? false : true;
  20589. obj.nameTxt.text = this.getNameStr(temp.type);
  20590. }
  20591. renderItem(index, obj) {
  20592. this.updateSelf(index, obj);
  20593. }
  20594. tripleGetAward() {
  20595. console.log('zh:qjff_AD_for_uigetAward');
  20596. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20597. }
  20598. else {
  20599. console.log('zh:AD 失败,直接发放奖励');
  20600. this.qjff_AD_for_uigetAward();
  20601. }
  20602. }
  20603. qjff_AD_for_uigetAward() {
  20604. this.getAward(3);
  20605. }
  20606. normalGetAward() {
  20607. if (PlatMgr.isMisVideo())
  20608. this.tripleGetAward();
  20609. else
  20610. this.getAward();
  20611. }
  20612. getAward(times = 1) {
  20613. this.hide();
  20614. for (let index = 0; index < this.awardArr.length; index++) {
  20615. this.awardArr[index].num *= times;
  20616. }
  20617. this.callback && this.callback(times != 1);
  20618. }
  20619. getIcon(type) {
  20620. switch (type) {
  20621. case Prop.diamond:
  20622. return "ty_zs";
  20623. case Prop.coin:
  20624. return "ty_jb";
  20625. case Prop.gan1:
  20626. return "qg1";
  20627. case Prop.gan2:
  20628. return "qg2";
  20629. case Prop.gan3:
  20630. return "qg3";
  20631. case Prop.gan4:
  20632. return "qg4";
  20633. default:
  20634. break;
  20635. }
  20636. }
  20637. getNameStr(type) {
  20638. switch (type) {
  20639. case Prop.diamond:
  20640. return "Diamond";
  20641. case Prop.coin:
  20642. return "Coins";
  20643. case Prop.gan1:
  20644. case Prop.gan2:
  20645. case Prop.gan3:
  20646. case Prop.gan4:
  20647. return cfgTable.ballrodData[type - 1].name;
  20648. default:
  20649. break;
  20650. }
  20651. }
  20652. }
  20653. UIGetAward$1.uiName = "UIGetAward";
  20654. class UIBox$1 extends UIBase {
  20655. constructor() {
  20656. super();
  20657. this.boxNum = 0;
  20658. this.boxMax = 10;
  20659. this.inAd = false;
  20660. this.isClose = false;
  20661. }
  20662. onConstructor() {
  20663. this.ui = ui_UIBox.createInstance();
  20664. this.contentPane = this.ui;
  20665. this.isEject = false;
  20666. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20667. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20668. Laya.timer.loop(1000, this, this.update);
  20669. }
  20670. update() {
  20671. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20672. this.boxNum -= 1;
  20673. this.upBar();
  20674. }
  20675. }
  20676. upBar() {
  20677. if (this.boxNum > this.boxMax)
  20678. this.boxNum = this.boxMax;
  20679. this.ui.bar.value = this.boxNum * 10;
  20680. }
  20681. show() {
  20682. super.show();
  20683. this.isClose = false;
  20684. this.boxNum = 0;
  20685. this.inAd = false;
  20686. this.upBar();
  20687. this.ui.t0.play();
  20688. this.ui.closeBtn.visible = false;
  20689. Laya.timer.once(3000, this, () => {
  20690. this.ui.closeBtn.visible = true;
  20691. this.ui.bar.alpha = 1;
  20692. });
  20693. Laya.timer.once(500, this, () => {
  20694. this.ui.t1.play();
  20695. });
  20696. }
  20697. hide() {
  20698. Laya.timer.clearAll(this);
  20699. Moyu.showBannerAd(false);
  20700. super.hide();
  20701. }
  20702. onOpenBox() {
  20703. this.boxNum++;
  20704. if (this.boxNum < this.boxMax) {
  20705. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  20706. Moyu.showInsertAd(0, PlatMgr.insertGap);
  20707. }
  20708. else if (this.boxNum == this.boxMax) {
  20709. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20710. this.ui.openBtn.c1.selectedIndex = 13;
  20711. this.inAd = true;
  20712. }
  20713. else
  20714. this.getAward();
  20715. }
  20716. else if (this.inAd) {
  20717. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20718. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20719. }
  20720. else {
  20721. console.log('zh:AD 失败,直接发放奖励');
  20722. this.qjff_AD_for_UIBOX_onOpenBox();
  20723. }
  20724. }
  20725. this.upBar();
  20726. }
  20727. qjff_AD_for_UIBOX_onOpenBox() {
  20728. this.getAward();
  20729. }
  20730. onCloseBox() {
  20731. if (this.isClose)
  20732. this.hide();
  20733. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20734. this.isClose = true;
  20735. PlatMgr.showBanner(true, 0, 3000);
  20736. }
  20737. else
  20738. this.hide();
  20739. }
  20740. getAward() {
  20741. let str = "";
  20742. if (Math.random() < 0.5) {
  20743. let max = Moyu.isLegal ? 500 : 2500;
  20744. let num = xGame.tools.random(max, 500 + max);
  20745. DataMgr.setCoin(num);
  20746. str = "金币x" + num;
  20747. }
  20748. else {
  20749. let max = Moyu.isLegal ? 10 : 30;
  20750. let num = xGame.tools.random(max, 30 + max);
  20751. DataMgr.setDiamond(num);
  20752. str = "钻石x" + num;
  20753. }
  20754. xGame.showTip("恭喜获得-" + str);
  20755. this.hide();
  20756. }
  20757. }
  20758. UIBox$1.uiName = "UIBox";
  20759. class UIMain$1 extends UIBase {
  20760. constructor() {
  20761. super();
  20762. this.firstEnter = true;
  20763. }
  20764. nativeCallJs(msg) {
  20765. let t = msg;
  20766. console.log("zh: nativeCallJs 奖励开始发放:", t);
  20767. switch (t) {
  20768. case 'qjff_chouJiang':
  20769. let dui = xGame.uiMgr.getUI(UIDraw$1);
  20770. dui.qjff_chouJiang();
  20771. break;
  20772. case 'qjff_AD_for_uisign':
  20773. let dui2 = xGame.uiMgr.getUI(UISign$1);
  20774. dui2.qjff_AD_for_uisign();
  20775. break;
  20776. case 'qjff_AD_for_uitry':
  20777. let dui3 = xGame.uiMgr.getUI(UITry$1);
  20778. dui3.qjff_AD_for_uitry();
  20779. break;
  20780. case 'qjff_AD_for_uipower':
  20781. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  20782. dui4.qjff_AD_for_uipower();
  20783. break;
  20784. case 'qjff_AD_for_uigetAward':
  20785. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  20786. dui5.qjff_AD_for_uigetAward();
  20787. break;
  20788. case 'qjff_AD_for_uiGameEnd':
  20789. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  20790. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  20791. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  20792. break;
  20793. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  20794. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  20795. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  20796. break;
  20797. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  20798. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  20799. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  20800. break;
  20801. case 'qjff_AD_for_UIrepentProp_videoRegret':
  20802. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  20803. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  20804. break;
  20805. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  20806. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  20807. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20808. break;
  20809. case 'qjff_AD_for_UIBOX_onOpenBox':
  20810. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  20811. dui11.qjff_AD_for_UIBOX_onOpenBox();
  20812. break;
  20813. case 'qjff_AD_for_UIAddCoin':
  20814. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  20815. dui12.qjff_AD_for_UIAddCoin();
  20816. break;
  20817. case '111a':
  20818. let dui14 = xGame.uiMgr.getUI(UISign$1);
  20819. dui14.qjff_AD_for_uisign();
  20820. break;
  20821. case '222a':
  20822. let dui15 = xGame.uiMgr.getUI(UISign$1);
  20823. dui15.qjff_AD_for_uisign();
  20824. break;
  20825. case '333a':
  20826. let dui16 = xGame.uiMgr.getUI(UISign$1);
  20827. dui16.qjff_AD_for_uisign();
  20828. break;
  20829. default:
  20830. console.log('zh:未知的方法名字' + t);
  20831. break;
  20832. }
  20833. }
  20834. onConstructor() {
  20835. console.log('zh: UIMain onConstructor');
  20836. this.ui = ui_UIMain.createInstance();
  20837. this.contentPane = this.ui;
  20838. this.isEject = false;
  20839. this.addEvent();
  20840. this.addClickSpine();
  20841. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20842. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20843. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20844. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20845. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20846. let curUse = DataMgr.getCurSecretary();
  20847. this.changeSecretary(curUse);
  20848. this.ui.talkNode.visible = false;
  20849. let guide = DataMgr.getSkillGuide();
  20850. if (xGame.common.isNewDay && guide == 1) {
  20851. xGame.common.isNewDay = false;
  20852. xGame.soundMgr.playSound("s_main01");
  20853. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20854. console.log("播放小秘书每天语音");
  20855. }
  20856. this.onGetUserInfo();
  20857. this.ui.n83.visible = false;
  20858. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20859. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20860. }
  20861. changeSecretary(curUse) {
  20862. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20863. xGame.common.secretary && xGame.common.secretary.dispose();
  20864. this.addSecretarySpine(name);
  20865. }
  20866. addSecretarySpine(name) {
  20867. let spine = new SpineMgr(name, () => {
  20868. this.playSecretaryIdle();
  20869. });
  20870. xGame.common.secretary = spine;
  20871. }
  20872. addClickSpine() {
  20873. let clickSpine = new SpineMgr("dianji", () => {
  20874. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20875. let parent = Laya.stage;
  20876. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20877. clickSpine.play(data, 0, false, parent, (spine) => {
  20878. spine.destroy(true);
  20879. });
  20880. });
  20881. });
  20882. }
  20883. addEvent() {
  20884. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20885. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20886. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20887. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20888. this.addUIClick(this.ui.weeklyBtn, this.startWeekly);
  20889. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20890. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20891. this.addUIClick(this.ui, this.interuptSecretary);
  20892. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20893. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20894. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20895. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20896. this.addUIClick(this.ui.signBtn, this.openSignView);
  20897. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20898. }
  20899. show(showFailWords) {
  20900. super.show();
  20901. this.moneyNode.ui.c1.selectedIndex = 1;
  20902. this.playSecretaryIdle();
  20903. xGame.soundMgr.playMusic("caromhall01");
  20904. Laya.timer.clearAll(this);
  20905. this.playSecretaryRandomSound();
  20906. if (showFailWords) {
  20907. setTimeout(() => {
  20908. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20909. let words = -1;
  20910. if (str == "s_main02") {
  20911. words = 2;
  20912. }
  20913. else {
  20914. words = 3;
  20915. }
  20916. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20917. xGame.soundMgr.playSound(str);
  20918. }, 300);
  20919. }
  20920. this.showGuide();
  20921. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20922. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20923. let guide = DataMgr.getSkillGuide();
  20924. if (guide == 1) {
  20925. let randTime = xGame.common.randomNum(300, 800);
  20926. if (this.firstEnter) {
  20927. this.firstEnter = false;
  20928. randTime += 900;
  20929. }
  20930. Laya.timer.once(randTime, this, () => {
  20931. xGame.common.autoPopUIView();
  20932. });
  20933. }
  20934. }
  20935. checkActive(show) {
  20936. }
  20937. showGuide() {
  20938. let guide = DataMgr.getSkillGuide();
  20939. this.ui.guideBtn.visible = guide == 0;
  20940. this.ui.enterGuide.visible = false;
  20941. this.ui.secretaryGuide.visible = guide == 0;
  20942. if (guide == 0) {
  20943. xGame.soundMgr.playSound("s_guide");
  20944. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20945. }
  20946. }
  20947. ensureSecretary() {
  20948. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20949. this.ui.secretaryGuide.visible = false;
  20950. this.ui.enterGuide.visible = true;
  20951. this.ui.wordsNode.t0.play();
  20952. if (DataMgr.getNewUser())
  20953. Moyu.sendDataEvent("gameReady");
  20954. }
  20955. playSecretaryIdle() {
  20956. let parent = this.ui.secretary.displayObject;
  20957. parent.destroyChildren();
  20958. let xx = this.ui.secretary.width / 2;
  20959. let yy = this.ui.secretary.height;
  20960. let scale = xGame.common.getSecretaryScale();
  20961. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20962. console.log("zh:playSecretaryIdle", data);
  20963. xGame.common.secretary.play(data, 0, true, parent);
  20964. }
  20965. startGame(type) {
  20966. xGame.common.gameMode = type;
  20967. Moyu.sendDataEvent("PlayGame", { type: type });
  20968. switch (xGame.common.gameMode) {
  20969. case GameMode.classic:
  20970. let challengeTimes = DataMgr.getChallengeTimes();
  20971. if (challengeTimes == 0) {
  20972. xGame.uiMgr.Show(UIInvitation$1);
  20973. }
  20974. else {
  20975. this.beginGame();
  20976. }
  20977. break;
  20978. case GameMode.bigMove:
  20979. this.beginGame();
  20980. if (DataMgr.getNewUser())
  20981. Moyu.sendDataEvent("gameStart0");
  20982. break;
  20983. default:
  20984. break;
  20985. }
  20986. }
  20987. beginGame(isNice = false) {
  20988. if (xGame.common.gameMode == GameMode.classic) {
  20989. if (isNice) {
  20990. this.enterClassic();
  20991. }
  20992. else {
  20993. xGame.uiMgr.Show(UIModeSelection$1, () => {
  20994. this.enterClassic();
  20995. });
  20996. }
  20997. }
  20998. else if (xGame.common.gameMode == GameMode.bigMove) {
  20999. this.ui.enterGuide.visible = false;
  21000. xGame.uiMgr.Show(UISkill$1);
  21001. }
  21002. }
  21003. enterClassic() {
  21004. xGame.uiMgr.Show(UIGame$1);
  21005. xGame.uiMgr.Show(UIMatching$1, () => {
  21006. if (!this.isHide)
  21007. this.hide();
  21008. xGame.common.gameUI.ui.alpha = 1;
  21009. xGame.common.gameUI.startGame();
  21010. xGame.uiMgr.Hide(UIGameEnd$1);
  21011. });
  21012. }
  21013. startGlobal() {
  21014. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21015. }
  21016. startWeekly() {
  21017. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21018. }
  21019. zhouSaiMonth() {
  21020. console.log('zh: zhouSaiMonth 被调用');
  21021. }
  21022. startPlaceBall() {
  21023. xGame.uiMgr.Show(UILevelDisplay$1);
  21024. }
  21025. hide() {
  21026. super.hide();
  21027. xGame.common.stopGirlPop(this.ui.talkNode);
  21028. }
  21029. onGetUserInfo(force = false) {
  21030. if (Moyu.isWx) {
  21031. let info = Moyu.getSystemInfo();
  21032. if (info)
  21033. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21034. }
  21035. else {
  21036. Moyu.initUser(this, this.freshUser, force);
  21037. }
  21038. if (!Moyu.hasUserInfo) {
  21039. let user = Moyu.getUserInfo();
  21040. user.headIcon = 'res/ty_touxiang.png';
  21041. }
  21042. this.freshUser();
  21043. }
  21044. freshUser() {
  21045. let user = Moyu.getUserInfo();
  21046. if (!user.isAuth) {
  21047. user.headIcon = 'res/ty_touxiang.png';
  21048. }
  21049. else
  21050. DataMgr.upRankData();
  21051. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21052. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21053. }
  21054. interuptSecretary() {
  21055. Laya.timer.clearAll(this);
  21056. this.playSecretaryRandomSound();
  21057. }
  21058. playSecretaryRandomSound() {
  21059. if (this.isHide)
  21060. return;
  21061. let time = xGame.common.randomNum(45000, 60000);
  21062. Laya.timer.once(time, this, () => {
  21063. if (this.isHide)
  21064. return;
  21065. let index = xGame.common.randomNum(4, 7);
  21066. xGame.soundMgr.playSound("s_main0" + index);
  21067. let words = 1;
  21068. switch (index) {
  21069. case 4:
  21070. words = 5;
  21071. break;
  21072. case 5:
  21073. words = 3;
  21074. break;
  21075. case 6:
  21076. words = 6;
  21077. break;
  21078. case 7:
  21079. words = 7;
  21080. break;
  21081. default:
  21082. break;
  21083. }
  21084. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21085. this.playSecretaryRandomSound();
  21086. });
  21087. }
  21088. openSecretaryView() {
  21089. xGame.uiMgr.Show(UISecretary$1);
  21090. Moyu.sendDataEvent("secretary");
  21091. }
  21092. openShopView() {
  21093. xGame.uiMgr.Show(UIShop$1);
  21094. }
  21095. openSignView() {
  21096. xGame.uiMgr.Show(UISign$1);
  21097. }
  21098. openDrawView() {
  21099. xGame.uiMgr.Show(UIDraw$1);
  21100. }
  21101. openRanking() {
  21102. xGame.uiMgr.Show(UIRanking$1);
  21103. Moyu.sendDataEvent("rankingList");
  21104. }
  21105. }
  21106. UIMain$1.uiName = "UIMain";
  21107. function InitShader() {
  21108. }
  21109. function appInit() {
  21110. xGame.context.init(getLoadingResList(), initCallback);
  21111. }
  21112. function getLoadingResList() {
  21113. return [
  21114. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21115. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21116. ];
  21117. }
  21118. function getGameResList() {
  21119. return [
  21120. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21121. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21122. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21123. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21124. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21125. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21126. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21127. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21128. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21129. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21130. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21131. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21132. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21133. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21134. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21135. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21136. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21137. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21138. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21139. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21140. ];
  21141. }
  21142. function initCallback() {
  21143. window["DataMgr"] = DataMgr;
  21144. DataMgr.Init();
  21145. Moyu.init(getPlat(), this, () => {
  21146. DataMgr.isNewDay();
  21147. PlatMgr.initConfig();
  21148. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21149. }, true);
  21150. console.log('zh:开始sm init1 start');
  21151. xGame.soundMgr.init();
  21152. console.log('zh:开始sm init1 end');
  21153. xGame.uiMgr.init();
  21154. xGame.uiMgr.clearTempData();
  21155. xGame.uiMgr.bindFUI(fguiRes.loading);
  21156. xGame.uiMgr.Show(UILoading);
  21157. }
  21158. function loadSubRes(callback) {
  21159. var tab = ["asset", "res", "spine"];
  21160. let subDone = 0;
  21161. for (var i = 0; i < tab.length; i++) {
  21162. let sub = tab[i];
  21163. Moyu.loadSubRes(sub, (pro) => {
  21164. callback && callback(pro, false);
  21165. }).then(() => {
  21166. subDone++;
  21167. if (subDone >= tab.length)
  21168. callback && callback(1, true);
  21169. });
  21170. }
  21171. }
  21172. function enterGame() {
  21173. xGame.cfgMgr.init();
  21174. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21175. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21176. xGame.uiMgr.Hide(UILoading);
  21177. fgui.UIPackage.removePackage(fguiRes.loading);
  21178. xGame.uiMgr.bindFUI(fguiRes.game);
  21179. xGame.uiMgr.Show(UIMain$1);
  21180. if (DataMgr.getNewUser())
  21181. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21182. }
  21183. function getPlat() {
  21184. let cfg = new MoyuCfg();
  21185. cfg.plat = MoyuPlat.web;
  21186. cfg.myId = 120;
  21187. cfg.myKey = '8848a885774230a4';
  21188. cfg.version = 0;
  21189. if (window.hasOwnProperty("gamebox")) {
  21190. cfg.plat = MoyuPlat.f399;
  21191. cfg.version = 0;
  21192. }
  21193. else if (window.hasOwnProperty("ks")) {
  21194. cfg.plat = MoyuPlat.ks;
  21195. cfg.version = 0;
  21196. cfg.ads.ksVideoId = '2300002254_01';
  21197. cfg.ads.ksInsertId = '2300002254_02';
  21198. }
  21199. else if (Laya.Browser.onTTMiniGame) {
  21200. cfg.plat = MoyuPlat.tt;
  21201. cfg.version = 0;
  21202. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21203. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21204. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21205. }
  21206. else if (Laya.Browser.onMiniGame) {
  21207. cfg.plat = MoyuPlat.wx;
  21208. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21209. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21210. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21211. }
  21212. else if (Laya.Browser.onQQMiniGame) {
  21213. cfg.plat = MoyuPlat.qq;
  21214. }
  21215. else if (Laya.Browser.onQGMiniGame) {
  21216. cfg.plat = MoyuPlat.op;
  21217. cfg.ads.opVideoId = '455502';
  21218. cfg.ads.opBannerId = '455507';
  21219. }
  21220. else if (Laya.Browser.onVVMiniGame) {
  21221. cfg.plat = MoyuPlat.vv;
  21222. cfg.version = 0;
  21223. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21224. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21225. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21226. }
  21227. else if (Laya.Browser.onHWMiniGame) {
  21228. cfg.plat = MoyuPlat.hw;
  21229. }
  21230. else if (window["mz"]) {
  21231. cfg.plat = MoyuPlat.mz;
  21232. }
  21233. else {
  21234. let cfg = window['conchConfig'];
  21235. if (cfg) {
  21236. var os = cfg.getOS();
  21237. if (os == "Conch-ios") {
  21238. cfg.plat = MoyuPlat.ios;
  21239. }
  21240. else if (os == "Conch-android") {
  21241. }
  21242. }
  21243. }
  21244. return cfg;
  21245. }
  21246. class Main {
  21247. constructor() {
  21248. if (window["Laya3D"])
  21249. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21250. else {
  21251. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21252. this.initMain();
  21253. }
  21254. }
  21255. initMain() {
  21256. Laya["Physics"] && Laya["Physics"].enable();
  21257. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21258. Laya.stage.scaleMode = GameConfig.scaleMode;
  21259. Laya.stage.screenMode = GameConfig.screenMode;
  21260. Laya.stage.alignV = GameConfig.alignV;
  21261. Laya.stage.alignH = GameConfig.alignH;
  21262. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21263. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21264. Laya.enableDebugPanel();
  21265. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21266. Laya["PhysicsDebugDraw"].enable();
  21267. if (GameConfig.stat)
  21268. Laya.Stat.show();
  21269. Laya.alertGlobalError(true);
  21270. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21271. }
  21272. onVersionLoaded() {
  21273. appInit();
  21274. }
  21275. }
  21276. new Main();
  21277. }());
  21278. //# sourceMappingURL=bundle.js.map