bundle.js 885 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069
  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. alert("Please check your network connection.");
  856. }
  857. function completeHandler(data) {
  858. if (data && data.length > 0) {
  859. let jsonData = JSON.parse(data);
  860. if (call)
  861. call(jsonData);
  862. }
  863. }
  864. }
  865. sendPost2025(lastUrl, data, call) {
  866. let urlStr = "http://192.168.1.13:8080/api/game/";
  867. let url = urlStr + lastUrl;
  868. let httpObj = new Laya.HttpRequest();
  869. httpObj.http.timeout = 5000;
  870. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  871. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  872. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  873. function errorHandler(error) {
  874. if (call) {
  875. call("{'msg':'网络错误','code':500}");
  876. }
  877. else {
  878. alert("Tip:Please check your network connection.");
  879. }
  880. }
  881. function completeHandler(data) {
  882. if (data && data.length > 0) {
  883. let jsonData = JSON.parse(data);
  884. if (call)
  885. call(jsonData);
  886. }
  887. }
  888. }
  889. sendGet(url, call) {
  890. let httpObj = new Laya.HttpRequest();
  891. httpObj.http.timeout = 5000;
  892. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  893. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  894. httpObj.send(url, '', 'get');
  895. function errorHandler(error) {
  896. console.log("errorHandler:" + error);
  897. }
  898. function completeHandler(data) {
  899. if (data && data.length > 0) {
  900. if (call)
  901. call(data);
  902. }
  903. }
  904. }
  905. }
  906. HttpMgr._instance = null;
  907. class LightShader extends Laya.Sprite {
  908. constructor() {
  909. super();
  910. this._time = 0;
  911. this._sin = 0;
  912. this.initShader();
  913. }
  914. initShader() {
  915. var vs = `
  916. #define FSHIGHPRECISION
  917. attribute vec4 posuv;
  918. uniform vec2 size;
  919. varying vec4 v_texcoord;
  920. void main() {
  921. vec4 pos = vec4(posuv.xy,0.,1.);
  922. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  923. gl_Position=pos1;
  924. v_texcoord.xy = posuv.xy;
  925. }
  926. `;
  927. var ps = `
  928. #define FSHIGHPRECISION
  929. precision highp float;
  930. varying vec4 v_texcoord;
  931. uniform vec2 size;
  932. uniform sampler2D texture;
  933. uniform float u_Time;
  934. void main() {
  935. vec4 color= texture2D(texture, v_texcoord.xy);
  936. float width = 0.2;
  937. float start = u_Time;
  938. float offset = 1.0;
  939. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  940. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  941. {
  942. color.r=1.1;
  943. color.g=1.1;
  944. color.b=1.1;
  945. gl_FragColor = color;
  946. } else {
  947. gl_FragColor = color;
  948. }
  949. }
  950. `;
  951. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  952. this.customRenderEnable = true;
  953. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  954. }
  955. customRender(context, x, y) {
  956. this.onUpdate();
  957. if (!this.texture)
  958. return;
  959. let xx = x - this.pivotX;
  960. let yy = y - this.pivotY;
  961. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  962. }
  963. onUpdate() {
  964. this._time += 2 * Laya.timer.delta * 0.001;
  965. this._sin = Math.sin(this._time);
  966. if (this._sin > 0.99) {
  967. this._sin = 0;
  968. this._time = 0;
  969. }
  970. this.shaderValue['u_Time'] = this._sin;
  971. }
  972. }
  973. LightShader.DissolveSurfaceSaveName = 9997;
  974. class UIBase extends fairygui.Window {
  975. constructor() {
  976. super();
  977. this.isEject = true;
  978. this.isHide = true;
  979. this.showbanner = true;
  980. this.className = "";
  981. this.isMuti = false;
  982. this.showbanner = false;
  983. this.onConstructor();
  984. }
  985. checkActive(show) {
  986. }
  987. getUIName() {
  988. return UIBase.uiName;
  989. }
  990. onConstructor() {
  991. }
  992. onInit() {
  993. if (!!this.contentPane) {
  994. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  995. }
  996. this.setPivot(0.5, 0.5, false);
  997. }
  998. doShowAnimation() {
  999. if (!this.isEject)
  1000. return;
  1001. super.doShowAnimation();
  1002. Laya.Tween.clearTween(this);
  1003. this.scaleX = this.scaleY = 0.8;
  1004. let tweenFunc1 = (func) => {
  1005. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1006. };
  1007. let tweenFunc2 = (func) => {
  1008. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1009. };
  1010. tweenFunc1(tweenFunc2);
  1011. }
  1012. show(...args) {
  1013. super.show();
  1014. this._openParam = args;
  1015. this.isHide = false;
  1016. xGame.uiMgr.checkUIState();
  1017. }
  1018. moveBannerButton() {
  1019. }
  1020. showBannerButton() {
  1021. this.bannerButton.visible = true;
  1022. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1023. this.bannerButton.touchable = true;
  1024. }));
  1025. }
  1026. hide() {
  1027. super.hide();
  1028. this.isHide = true;
  1029. xGame.uiMgr.checkUIState();
  1030. }
  1031. Dispose() {
  1032. super.dispose();
  1033. }
  1034. myUpdate(delay) {
  1035. }
  1036. refresh() { }
  1037. addUIClick(obj, func, arr = null) {
  1038. obj.onClick(this, func, arr);
  1039. obj.onClick(this, this.playBtnSound);
  1040. }
  1041. offUIClick(obj, func) {
  1042. obj.offClick(this, func);
  1043. }
  1044. playBtnSound() {
  1045. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1046. }
  1047. }
  1048. UIBase.lastShowBanner = 0;
  1049. UIBase.showBannerNum = 0;
  1050. UIBase.uiName = "";
  1051. class ui_UIDraw extends fgui.GComponent {
  1052. static createInstance() {
  1053. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1054. }
  1055. onConstruct() {
  1056. this.n1 = (this.getChild("n1"));
  1057. this.extraNode = (this.getChild("extraNode"));
  1058. this.myNode = (this.getChild("myNode"));
  1059. this.closeNode = (this.getChild("closeNode"));
  1060. this.moneyNode = (this.getChild("moneyNode"));
  1061. this.n38 = (this.getChild("n38"));
  1062. this.secretary = (this.getChild("secretary"));
  1063. this.drawBtn = (this.getChild("drawBtn"));
  1064. this.talkNode = (this.getChild("talkNode"));
  1065. this.t0 = this.getTransition("t0");
  1066. }
  1067. }
  1068. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1069. class ui_UIBox extends fgui.GComponent {
  1070. static createInstance() {
  1071. return (fgui.UIPackage.createObject("game", "UIBox"));
  1072. }
  1073. onConstruct() {
  1074. this.n0 = (this.getChild("n0"));
  1075. this.n12 = (this.getChild("n12"));
  1076. this.n1 = (this.getChild("n1"));
  1077. this.n2 = (this.getChild("n2"));
  1078. this.bar = (this.getChild("bar"));
  1079. this.closeBtn = (this.getChild("closeBtn"));
  1080. this.openBtn = (this.getChild("openBtn"));
  1081. this.t0 = this.getTransition("t0");
  1082. this.t1 = this.getTransition("t1");
  1083. }
  1084. }
  1085. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1086. class GlobalManager {
  1087. constructor() {
  1088. }
  1089. registerMethod(name, method) {
  1090. console.log('zh: 注册全局方法', name);
  1091. this[name] = method;
  1092. }
  1093. callMethod(name, ...args) {
  1094. console.log('zh: 调用全局方法', name);
  1095. if (this[name]) {
  1096. return this[name](...args);
  1097. }
  1098. else {
  1099. console.error(`zh: 全局方法 Method ${name} not found`);
  1100. }
  1101. }
  1102. }
  1103. GlobalManager.instance = new GlobalManager();
  1104. class JSBridgeUtils {
  1105. constructor() { }
  1106. static get instance() {
  1107. if (!this._instance) {
  1108. this._instance = new JSBridgeUtils();
  1109. }
  1110. return this._instance;
  1111. }
  1112. initBridge() {
  1113. if (!Laya.Browser.onAndroid) {
  1114. console.log('zh:非android dev');
  1115. return;
  1116. }
  1117. let cfg = window['conchConfig'];
  1118. if (cfg) {
  1119. var os = cfg.getOS();
  1120. if (os == "Conch-android") {
  1121. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1122. if (this.bridge) {
  1123. return true;
  1124. }
  1125. else {
  1126. return false;
  1127. }
  1128. }
  1129. else {
  1130. return false;
  1131. }
  1132. }
  1133. else {
  1134. return false;
  1135. }
  1136. }
  1137. testAd1() {
  1138. if (!Laya.Browser.onAndroid) {
  1139. console.log('zh:非android dev');
  1140. return;
  1141. }
  1142. if (!this.initBridge()) {
  1143. return;
  1144. }
  1145. let rs = this.bridge.call("testString", "hello");
  1146. console.log('zh:testString rs=' + rs);
  1147. }
  1148. testAdCallBack() {
  1149. if (!this.initBridge()) {
  1150. return;
  1151. }
  1152. console.log("zh:testAdCallBack start");
  1153. const defaultObj = { code: 200, msg: "req update Ui" };
  1154. const reqObj = { code: 300, msg: "hello java ui" };
  1155. this.bridge.callWithBack((rsStr) => {
  1156. const rsObj = JSON.parse(rsStr);
  1157. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1158. }, "testAsyncCallback", JSON.stringify(reqObj));
  1159. }
  1160. showInternAd(mark) {
  1161. console.log('zh:showInternAd start');
  1162. if (!Laya.Browser.onAndroid) {
  1163. console.log('zh:showInternAd 非android dev');
  1164. return false;
  1165. }
  1166. if (!this.initBridge()) {
  1167. return false;
  1168. }
  1169. let rs = this.bridge.call("showInternAd", mark);
  1170. try {
  1171. const result = JSON.parse(rs);
  1172. if (result.code === 200) {
  1173. console.log("zh:showInternAd OK");
  1174. return true;
  1175. }
  1176. else {
  1177. console.warn("zh:showInternAd FAILL:", result.msg);
  1178. return false;
  1179. }
  1180. }
  1181. catch (e) {
  1182. console.error("zh:解析桥接返回值失败:", e);
  1183. return false;
  1184. }
  1185. }
  1186. exitAndCloseGame() {
  1187. if (!Laya.Browser.onAndroid) {
  1188. console.log('zh:非android dev');
  1189. return;
  1190. }
  1191. if (!this.initBridge()) {
  1192. return;
  1193. }
  1194. console.log('zh:开始关闭游戏-');
  1195. this.bridge.call("exitAndCloseGame");
  1196. }
  1197. showRewardAd(mark) {
  1198. if (!Laya.Browser.onAndroid) {
  1199. console.log('zh:非android dev');
  1200. return false;
  1201. }
  1202. if (!this.initBridge()) {
  1203. return false;
  1204. }
  1205. let rs = this.bridge.call("showRewardAd", mark);
  1206. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1207. try {
  1208. const result = JSON.parse(rs);
  1209. if (result.code === 200) {
  1210. console.log("zh:广告显示成功");
  1211. return true;
  1212. }
  1213. else {
  1214. console.warn("zh:广告显示失败:", result.msg);
  1215. return false;
  1216. }
  1217. }
  1218. catch (e) {
  1219. console.error("zh:解析桥接返回值失败:", e);
  1220. return false;
  1221. }
  1222. }
  1223. logEventForAdNoParams(eventName) {
  1224. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1225. if (!Laya.Browser.onAndroid) {
  1226. console.log('zh:非android dev');
  1227. return;
  1228. }
  1229. if (!this.initBridge()) {
  1230. return;
  1231. }
  1232. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1233. this.bridge.call("logEventForAdNoParams", eventName);
  1234. }
  1235. logEventForAdHaveParams(eventName, jsonStr) {
  1236. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1237. if (!Laya.Browser.onAndroid) {
  1238. console.log('zh:非android dev');
  1239. return;
  1240. }
  1241. if (!this.initBridge()) {
  1242. return;
  1243. }
  1244. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1245. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1246. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1247. }
  1248. logEventForFirebase(eventName, jsonStr) {
  1249. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1250. if (!Laya.Browser.onAndroid) {
  1251. console.log('zh:非android dev');
  1252. return;
  1253. }
  1254. if (!this.initBridge()) {
  1255. return;
  1256. }
  1257. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1258. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1259. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1260. }
  1261. nativeCallJs(msg) {
  1262. console.log("zh:nativeCallJs received data: 1111", msg);
  1263. if (msg === 'Ad1') {
  1264. GlobalManager.instance.callMethod('Ad1');
  1265. console.log("zh: Ad1 奖励发送成功");
  1266. }
  1267. else if (msg === 'Ad2') {
  1268. GlobalManager.instance.callMethod('Ad2');
  1269. console.log("zh: Ad2 奖励发送成功");
  1270. }
  1271. else if (msg === 'Ad3') {
  1272. GlobalManager.instance.callMethod('Ad3');
  1273. console.log("zh: Ad3 奖励发送成功");
  1274. }
  1275. else if (msg === 'Ad4') {
  1276. GlobalManager.instance.callMethod('Ad4');
  1277. console.log("zh: Ad4 奖励发送成功");
  1278. }
  1279. else if (msg === 'Ad5') {
  1280. console.log("zh: Ad5 奖励发送成功");
  1281. GlobalManager.instance.callMethod('Ad5');
  1282. }
  1283. }
  1284. }
  1285. class UIBox extends UIBase {
  1286. constructor() {
  1287. super();
  1288. this.boxNum = 0;
  1289. this.boxMax = 10;
  1290. this.inAd = false;
  1291. this.isClose = false;
  1292. }
  1293. onConstructor() {
  1294. this.ui = ui_UIBox.createInstance();
  1295. this.contentPane = this.ui;
  1296. this.isEject = false;
  1297. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1298. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1299. Laya.timer.loop(1000, this, this.update);
  1300. }
  1301. update() {
  1302. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1303. this.boxNum -= 1;
  1304. this.upBar();
  1305. }
  1306. }
  1307. upBar() {
  1308. if (this.boxNum > this.boxMax)
  1309. this.boxNum = this.boxMax;
  1310. this.ui.bar.value = this.boxNum * 10;
  1311. }
  1312. show() {
  1313. super.show();
  1314. this.isClose = false;
  1315. this.boxNum = 0;
  1316. this.inAd = false;
  1317. this.upBar();
  1318. this.ui.t0.play();
  1319. this.ui.closeBtn.visible = false;
  1320. Laya.timer.once(3000, this, () => {
  1321. this.ui.closeBtn.visible = true;
  1322. this.ui.bar.alpha = 1;
  1323. });
  1324. Laya.timer.once(500, this, () => {
  1325. this.ui.t1.play();
  1326. });
  1327. }
  1328. hide() {
  1329. Laya.timer.clearAll(this);
  1330. Moyu.showBannerAd(false);
  1331. super.hide();
  1332. }
  1333. onOpenBox() {
  1334. this.boxNum++;
  1335. if (this.boxNum < this.boxMax) {
  1336. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1337. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1338. }
  1339. }
  1340. else if (this.boxNum == this.boxMax) {
  1341. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1342. this.ui.openBtn.c1.selectedIndex = 13;
  1343. this.inAd = true;
  1344. }
  1345. else
  1346. this.getAward();
  1347. }
  1348. else if (this.inAd) {
  1349. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1350. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1351. }
  1352. else {
  1353. console.log('zh:AD 失败,直接发放奖励');
  1354. this.qjff_AD_for_UIBOX_onOpenBox();
  1355. }
  1356. }
  1357. this.upBar();
  1358. }
  1359. qjff_AD_for_UIBOX_onOpenBox() {
  1360. this.getAward();
  1361. }
  1362. onCloseBox() {
  1363. if (this.isClose)
  1364. this.hide();
  1365. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1366. this.isClose = true;
  1367. PlatMgr.showBanner(true, 0, 3000);
  1368. }
  1369. else
  1370. this.hide();
  1371. }
  1372. getAward() {
  1373. let str = "";
  1374. if (Math.random() < 0.5) {
  1375. let max = Moyu.isLegal ? 500 : 2500;
  1376. let num = xGame.tools.random(max, 500 + max);
  1377. DataMgr.setCoin(num);
  1378. str = "金币x" + num;
  1379. }
  1380. else {
  1381. let max = Moyu.isLegal ? 10 : 30;
  1382. let num = xGame.tools.random(max, 30 + max);
  1383. DataMgr.setDiamond(num);
  1384. str = "钻石x" + num;
  1385. }
  1386. xGame.showTip("恭喜获得-" + str);
  1387. this.hide();
  1388. }
  1389. }
  1390. UIBox.uiName = "UIBox";
  1391. class ui_UITry extends fgui.GComponent {
  1392. static createInstance() {
  1393. return (fgui.UIPackage.createObject("game", "UITry"));
  1394. }
  1395. onConstruct() {
  1396. this.n11 = (this.getChild("n11"));
  1397. this.myNode = (this.getChild("myNode"));
  1398. this.t0 = this.getTransition("t0");
  1399. }
  1400. }
  1401. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1402. class UITry extends UIBase {
  1403. constructor() {
  1404. super();
  1405. this.closeTime = 0;
  1406. this.closeNum = 0;
  1407. this.skillUrl = xGame.common.skillIconList;
  1408. }
  1409. onConstructor() {
  1410. this.ui = ui_UITry.createInstance();
  1411. this.contentPane = this.ui;
  1412. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1413. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1414. }
  1415. show() {
  1416. super.show();
  1417. this.closeNum = 0;
  1418. this.closeTime = 15;
  1419. this.ui.t0.play();
  1420. PlatMgr.showRateBanner();
  1421. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1422. Laya.timer.loop(1000, this, this.updateTime);
  1423. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1424. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1425. xGame.common.gameMgr.gamePause = true;
  1426. }
  1427. updateTime() {
  1428. if (this.closeTime > 1) {
  1429. this.closeTime--;
  1430. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1431. }
  1432. else
  1433. this.hide();
  1434. }
  1435. hide() {
  1436. Laya.timer.clearAll(this);
  1437. Moyu.showBannerAd(false);
  1438. super.hide();
  1439. xGame.common.gameMgr.gamePause = false;
  1440. }
  1441. onTry() {
  1442. console.log('zh:qjff_AD_for_uitry');
  1443. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1444. }
  1445. else {
  1446. console.log('zh:AD 失败,直接发放奖励');
  1447. this.qjff_AD_for_uitry();
  1448. }
  1449. }
  1450. qjff_AD_for_uitry() {
  1451. let select = xGame.common.curPlayerSkillType;
  1452. DataMgr.gameData.trySkill = select;
  1453. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1454. DataMgr.saveGameData();
  1455. DataMgr.setBigSkill(select, 1);
  1456. xGame.showTip("Trial Successful");
  1457. this.hide();
  1458. }
  1459. onCancel() {
  1460. if (this.closeNum > 0) {
  1461. this.closeNum--;
  1462. if (this.closeNum < 2)
  1463. this.hide();
  1464. return;
  1465. }
  1466. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1467. this.onTry();
  1468. }
  1469. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1470. this.closeNum = 3;
  1471. }
  1472. else
  1473. this.hide();
  1474. }
  1475. }
  1476. UITry.uiName = "UITry";
  1477. class PlatMgr {
  1478. static initConfig() {
  1479. this.lastVt = 0;
  1480. if (!Moyu.platConfig)
  1481. return;
  1482. for (let k in Moyu.platConfig) {
  1483. let pd = this[k];
  1484. let pc = Moyu.platConfig[k];
  1485. if (pd != undefined && pc != undefined)
  1486. this[k] = pc;
  1487. }
  1488. Moyu.setBannerPos(0.5, 1);
  1489. }
  1490. static rand100(num) {
  1491. return xGame.tools.random(0, 100) < num;
  1492. }
  1493. static isMisVideo() {
  1494. let dt = Laya.timer.currTimer - this.lastVt;
  1495. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1496. this.lastVt = Laya.timer.currTimer;
  1497. return true;
  1498. }
  1499. else {
  1500. if (this.rand100(this.fullVideoRate)) {
  1501. console.log('zh:插屏 ad start');
  1502. JSBridgeUtils.instance.showInternAd('platMgr');
  1503. }
  1504. return false;
  1505. }
  1506. }
  1507. static showVideo(call, type) {
  1508. Moyu.showVideoAd(() => {
  1509. this.lastVt = Laya.timer.currTimer;
  1510. call && call();
  1511. }, type);
  1512. }
  1513. static showInsert(delay = false) {
  1514. if (this.getRand() < this.insertRate) {
  1515. let dt = delay ? this.insertDelay : 0;
  1516. console.log('zh:插屏 ad start');
  1517. JSBridgeUtils.instance.showInternAd('gameInsert');
  1518. }
  1519. }
  1520. static gameInsert() {
  1521. let t = this.getRand();
  1522. let r = this.gameInsertRate;
  1523. if (t < r) {
  1524. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1525. }
  1526. }
  1527. static showRateBanner() {
  1528. if (this.getRand() < this.bannerRate)
  1529. this.showBanner(true, this.bannerDelay, 3000);
  1530. }
  1531. static showBanner(show, delay = 0, hide = 0) {
  1532. if (2 > 1) {
  1533. console.log('zh:显示showBanner广告 直接返回');
  1534. return;
  1535. }
  1536. if (!show)
  1537. Moyu.showBannerAd(false);
  1538. else {
  1539. Laya.timer.clear(this, this.bannerShow);
  1540. if (delay > 0)
  1541. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1542. else
  1543. this.bannerShow(true);
  1544. if (hide > 0)
  1545. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1546. }
  1547. }
  1548. static bannerShow(show) {
  1549. if (2 > 1) {
  1550. console.log('zh:显示showBanner广告 直接返回');
  1551. return;
  1552. }
  1553. Moyu.showBannerAd(show);
  1554. console.log("showBanner" + show);
  1555. }
  1556. static getRand() {
  1557. return xGame.tools.random(0, 100);
  1558. }
  1559. static openBox() {
  1560. if (this.getRand() < this.boxRate)
  1561. xGame.uiMgr.Show(UIBox);
  1562. }
  1563. static openTry() {
  1564. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1565. return;
  1566. if (this.getRand() < this.tryRate)
  1567. xGame.uiMgr.Show(UITry);
  1568. else if (DataMgr.gameData.gameCount == 1)
  1569. xGame.uiMgr.Show(UITry);
  1570. }
  1571. }
  1572. PlatMgr.forceShare = 0;
  1573. PlatMgr.signAdRate = 0;
  1574. PlatMgr.forceVideoRate = 0;
  1575. PlatMgr.forceVideoGap = 0;
  1576. PlatMgr.fullVideoRate = 0;
  1577. PlatMgr.gameInsertRate = 0;
  1578. PlatMgr.insertGap = 0;
  1579. PlatMgr.insertDelay = 0;
  1580. PlatMgr.insertRate = 0;
  1581. PlatMgr.boxRate = 0;
  1582. PlatMgr.boxVideoRate = 0;
  1583. PlatMgr.boxInsertRate = 0;
  1584. PlatMgr.boxBannerRate = 0;
  1585. PlatMgr.tryRate = 0;
  1586. PlatMgr.tryClose3Rate = 0;
  1587. PlatMgr.tryVideoRate = 0;
  1588. PlatMgr.bannerRate = 0;
  1589. PlatMgr.lastVt = 0;
  1590. class ui_UIAddProp extends fgui.GComponent {
  1591. static createInstance() {
  1592. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1593. }
  1594. onConstruct() {
  1595. this.n11 = (this.getChild("n11"));
  1596. this.myNode = (this.getChild("myNode"));
  1597. this.closeBtn = (this.getChild("closeBtn"));
  1598. this.t0 = this.getTransition("t0");
  1599. }
  1600. }
  1601. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1602. class SpineMgr {
  1603. constructor(name, loadCb = null) {
  1604. this.loaded = false;
  1605. this.spineName = '';
  1606. this.loadedCallback = loadCb;
  1607. this.templet = new Laya.Templet();
  1608. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1609. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1610. if (name === 'mishu') {
  1611. this.templet.loadAni('spine/nvmishu.sk');
  1612. }
  1613. else {
  1614. this.templet.loadAni(`spine/${name}.sk`);
  1615. }
  1616. this.templet.lock = true;
  1617. this.spineName = name;
  1618. }
  1619. onError() {
  1620. console.log("zh:spine加载出错");
  1621. }
  1622. parseComplete() {
  1623. this.loaded = true;
  1624. this.loadedCallback && this.loadedCallback();
  1625. }
  1626. dispose() {
  1627. if (this.templet && !this.templet.destroyed) {
  1628. this.templet.destroy();
  1629. }
  1630. this.templet = null;
  1631. }
  1632. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1633. if (!this.loaded) {
  1634. return;
  1635. }
  1636. let spine;
  1637. if (mySpine) {
  1638. spine = mySpine;
  1639. }
  1640. else {
  1641. spine = this.createSpine(data, parent);
  1642. }
  1643. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1644. if (!isLoop) {
  1645. spine.on(Laya.Event.STOPPED, this, () => {
  1646. spine.offAll(Laya.Event.STOPPED);
  1647. callback && callback(spine);
  1648. });
  1649. }
  1650. return spine;
  1651. }
  1652. createSpine(data, parent, type = 1) {
  1653. let spine;
  1654. spine = this.templet.buildArmature(type);
  1655. spine.showSkinByIndex(0);
  1656. parent.addChild(spine);
  1657. spine.pos(data.x, data.y);
  1658. spine.scale(data.scaleX, data.scaleY, true);
  1659. return spine;
  1660. }
  1661. }
  1662. var AIState;
  1663. (function (AIState) {
  1664. AIState[AIState["none"] = 0] = "none";
  1665. AIState[AIState["idle"] = 1] = "idle";
  1666. AIState[AIState["reset"] = 2] = "reset";
  1667. AIState[AIState["move"] = 3] = "move";
  1668. AIState[AIState["wait"] = 4] = "wait";
  1669. AIState[AIState["select"] = 5] = "select";
  1670. AIState[AIState["turn"] = 6] = "turn";
  1671. AIState[AIState["shoot"] = 7] = "shoot";
  1672. AIState[AIState["leave"] = 8] = "leave";
  1673. })(AIState || (AIState = {}));
  1674. class AIPlayer {
  1675. constructor() {
  1676. this.dtime = 30;
  1677. this.awayTime = 0;
  1678. this.awayNum = 0;
  1679. this.hideTime = 0;
  1680. this.rootMoveTime = 0;
  1681. this.isGuide = false;
  1682. this.state = AIState.none;
  1683. this.waitTime = 0;
  1684. this.forceNum = 0;
  1685. this.forceMax = 0;
  1686. this.ballSize = 33;
  1687. this.selectNum = 0;
  1688. this.destRot = 0;
  1689. this.aiLv = 10;
  1690. this.kickBall = [];
  1691. this.lineBall = [];
  1692. this.scoreBall = [];
  1693. this.holeBall = [];
  1694. this.turnNum = 0;
  1695. this.setNum = 0;
  1696. this.setMax = 0;
  1697. this.setRate = 0;
  1698. this.rectL = 0;
  1699. this.rectR = 0;
  1700. this.rectT = 0;
  1701. this.rectB = 0;
  1702. this.rootPos = { x: 0, y: 0 };
  1703. this.bestForce = 0;
  1704. this.bestAngle = 180;
  1705. this.bestPos = { x: 0, y: 0 };
  1706. this.bestKick = { x: 0, y: 0 };
  1707. this.posList = [];
  1708. this.posIdx = 0;
  1709. this.chatTime = 3000;
  1710. this.tempDir1 = new Laya.Vector2();
  1711. this.tempDir2 = new Laya.Vector2();
  1712. this.tempDir3 = new Laya.Vector2();
  1713. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1714. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1715. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1716. this.gameSrc = xGame.common.gameUI;
  1717. this.hideTime = Laya.timer.currTimer;
  1718. Moyu.setOnTipCall((id) => {
  1719. if (id == 20012)
  1720. this.hideTime = Laya.timer.currTimer;
  1721. else
  1722. (id == 20011);
  1723. {
  1724. let dt = Laya.timer.currTimer - this.hideTime;
  1725. console.log("onshow" + dt);
  1726. if (dt > 30000 && this.state > AIState.none)
  1727. xGame.common.gameMgr.aiGameEnd(false);
  1728. }
  1729. }, this);
  1730. }
  1731. init() {
  1732. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1733. this.awayTime = xGame.tools.random(5000, 10000);
  1734. this.awayNum = 0;
  1735. this.hideTime = Laya.timer.currTimer;
  1736. let rect = xGame.common.d2World.borderRect;
  1737. this.rectL = Math.ceil(rect.x) + 17;
  1738. this.rectT = Math.ceil(rect.y) + 17;
  1739. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1740. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1741. this.wBall = xGame.common.d2World.rootBall;
  1742. this.ballSize = this.wBall.gameObj.width - 1;
  1743. if (this.posList.length < 1) {
  1744. let dp = 40;
  1745. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1746. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1747. let dx = i < this.rectR ? i : this.rectR;
  1748. let dy = j < this.rectB ? j : this.rectB;
  1749. let order = xGame.tools.random(0, 1000);
  1750. this.posList.push({ x: dx, y: dy, order: order });
  1751. }
  1752. }
  1753. this.posList.sort(function (a, b) {
  1754. return a.order - b.order;
  1755. });
  1756. this.setMax = this.posList.length;
  1757. }
  1758. this.state = AIState.idle;
  1759. }
  1760. setAiLevel(num) {
  1761. this.aiLv = num;
  1762. }
  1763. initBall() {
  1764. this.rootPos.x = this.wBall.gameObj.x;
  1765. this.rootPos.y = this.wBall.gameObj.y;
  1766. this.initHoleBall();
  1767. }
  1768. initHoleBall() {
  1769. this.kickBall = [];
  1770. this.lineBall = [];
  1771. this.scoreBall = [];
  1772. this.holeBall = [];
  1773. this.selectNum = 0;
  1774. this.forceNum = 0;
  1775. this.forceMax = 0;
  1776. this.turnNum = 0;
  1777. let list = xGame.common.d2World.ballArr;
  1778. if (list.length < 20 && !this.isGuide) {
  1779. let holes = xGame.common.gameMgr.holePosList;
  1780. for (let i = 0; i < list.length; i++) {
  1781. let obj = list[i];
  1782. if (!obj)
  1783. continue;
  1784. obj.kickPos.x = 0;
  1785. obj.kickPos.y = 0;
  1786. obj.poleAngle = 0;
  1787. obj.hard = 0;
  1788. obj.borderDis = 0;
  1789. obj.kickAngle = 180;
  1790. if (obj.number == 0)
  1791. continue;
  1792. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1793. continue;
  1794. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1795. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1796. continue;
  1797. }
  1798. let b = obj.gameObj;
  1799. let wbp = this.rootPos;
  1800. let bx = wbp.x - b.x;
  1801. let by = wbp.y - b.y;
  1802. obj.borderDis = xGame.tools.random(0, 100);
  1803. this.kickBall.push(obj);
  1804. if (!this.isLine(wbp, obj))
  1805. continue;
  1806. obj.kickAngle = xGame.tools.random(90, 180);
  1807. obj.kickPos.x = b.x;
  1808. obj.kickPos.y = b.y;
  1809. this.lineBall.push(obj);
  1810. let minDis = 999999;
  1811. let hole = false;
  1812. for (let j = 0; j < holes.length; j++) {
  1813. let hp = holes[j];
  1814. if (bx >= 0 && hp.x > b.x + 100)
  1815. continue;
  1816. if (bx <= 0 && hp.x < b.x - 100)
  1817. continue;
  1818. if (by < -10 && hp.y < wbp.y)
  1819. continue;
  1820. if (by > 10 && hp.y > wbp.y)
  1821. continue;
  1822. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1823. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1824. if (dis < minDis) {
  1825. let dx = b.x - this.tempDir1.x * this.ballSize;
  1826. let dy = b.y - this.tempDir1.y * this.ballSize;
  1827. this.tempDir3.x = this.tempDir1.x;
  1828. this.tempDir3.y = this.tempDir1.y;
  1829. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1830. obj.kickPos.x = dx;
  1831. obj.kickPos.y = dy;
  1832. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1833. if (num > 1)
  1834. num = 1;
  1835. obj.kickAngle = Math.acos(num) * 57.3;
  1836. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1837. dis = dis * 2;
  1838. if (Math.abs(hp.x - 600) < 100)
  1839. dis += 50;
  1840. obj.hard = dis + obj.kickAngle * 3;
  1841. hole = true;
  1842. }
  1843. }
  1844. }
  1845. }
  1846. if (hole) {
  1847. this.scoreBall.push(obj);
  1848. this.holeBall.push(obj);
  1849. }
  1850. }
  1851. this.scoreBall.sort(function (a, b) {
  1852. return a.hard - b.hard;
  1853. });
  1854. this.holeBall.sort(function (a, b) {
  1855. return a.kickAngle - b.kickAngle;
  1856. });
  1857. this.kickBall.sort(function (a, b) {
  1858. return a.borderDis - b.borderDis;
  1859. });
  1860. }
  1861. else {
  1862. let max = list.length - 1;
  1863. let i = xGame.tools.random(0, max);
  1864. for (i; i <= max; i++) {
  1865. let idx = i >= max ? i -= max : i;
  1866. let obj = list[idx];
  1867. if (obj && obj.number != 0) {
  1868. obj.kickAngle = xGame.tools.random(90, 180);
  1869. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1870. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1871. this.lineBall.push(obj);
  1872. break;
  1873. }
  1874. }
  1875. }
  1876. }
  1877. selectBall() {
  1878. let ball = null;
  1879. this.destRot = 0;
  1880. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1881. let ai = 110 - this.aiLv * 10;
  1882. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1883. let score = false;
  1884. if (this.scoreBall.length < 1) {
  1885. if (this.lineBall.length < 1) {
  1886. for (let i = 0; i < this.kickBall.length; i++) {
  1887. let list = [];
  1888. let bo = this.kickBall[i];
  1889. let bobj = bo.gameObj;
  1890. let rect = xGame.common.d2World.borderRect;
  1891. let mobj = this.wBall.gameObj;
  1892. let minb = bobj.y - rect.y - 20;
  1893. let minw = mobj.y - rect.y - 50;
  1894. if (minb > 0 && minw > 0) {
  1895. let dlenx = 0;
  1896. let dleny = mobj.y - rect.y;
  1897. let spx = mobj.x;
  1898. let spy = rect.y - dleny;
  1899. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1900. }
  1901. minb = rect.y + rect.height - bobj.y - 20;
  1902. minw = rect.y + rect.height - mobj.y - 50;
  1903. if (minb > 0 && minw > 0) {
  1904. let dlenx = 0;
  1905. let dleny = rect.y + rect.height - mobj.y;
  1906. let spx = mobj.x;
  1907. let spy = rect.y + rect.height + dleny;
  1908. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1909. }
  1910. minb = bobj.x - rect.x - 20;
  1911. minw = mobj.x - rect.x - 50;
  1912. if (minb > 0 && minw > 0) {
  1913. let dlenx = mobj.x - rect.x;
  1914. let dleny = 0;
  1915. let spx = rect.x - dlenx;
  1916. let spy = mobj.y;
  1917. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1918. }
  1919. minb = rect.x + rect.width - bobj.x - 20;
  1920. minw = rect.x + rect.width - mobj.x - 50;
  1921. if (minb > 0 && minw > 0) {
  1922. let dlenx = rect.x + rect.width - mobj.x;
  1923. let dleny = 0;
  1924. let spx = rect.x + rect.width + dlenx;
  1925. let spy = mobj.y;
  1926. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1927. }
  1928. list.sort(function (a, b) {
  1929. return a.order - b.order;
  1930. });
  1931. for (let i = 0; i < list.length; i++) {
  1932. let data = list[i];
  1933. let mx = mobj.x - bobj.x;
  1934. let my = mobj.y - bobj.y;
  1935. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1936. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1937. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1938. if (num > 1)
  1939. num = 1;
  1940. let cos = Math.acos(num);
  1941. if (cos > 1.57)
  1942. cos = 1.57;
  1943. else if (cos < 0.01)
  1944. cos = 0.01;
  1945. let tan = Math.tan(cos);
  1946. let dx = tan * data.dleny;
  1947. let dy = tan * data.dlenx;
  1948. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1949. if (Math.abs(bx - 667) < 40)
  1950. continue;
  1951. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1952. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1953. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1954. this.forceMax = dis * 0.08;
  1955. this.destRot += mis * 0.1;
  1956. this.setKick(bx, by);
  1957. return true;
  1958. }
  1959. }
  1960. }
  1961. }
  1962. else {
  1963. ball = xGame.common.getRandArrEle(this.lineBall);
  1964. }
  1965. }
  1966. else {
  1967. for (let i = 0; i < this.scoreBall.length; i++) {
  1968. if (i < this.scoreBall.length - 1) {
  1969. let rand = 70 + this.aiLv * 10 + i * 10;
  1970. if (xGame.tools.random(0, 100) < rand) {
  1971. ball = this.scoreBall[i];
  1972. break;
  1973. }
  1974. }
  1975. else {
  1976. ball = this.scoreBall[i];
  1977. break;
  1978. }
  1979. }
  1980. score = true;
  1981. this.selectNum++;
  1982. }
  1983. if (!ball)
  1984. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1985. if (this.selectNum >= max) {
  1986. let dx = ball.gameObj.x;
  1987. let dy = ball.gameObj.y;
  1988. let kickAngle = 0;
  1989. if (score) {
  1990. dx = ball.kickPos.x;
  1991. dy = ball.kickPos.y;
  1992. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1993. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1994. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1995. if (adot > 1)
  1996. adot = 1;
  1997. kickAngle = Math.acos(adot) * 57.3;
  1998. if (kickAngle > 45) {
  1999. let kdx = ball.kickPos.x - ball.gameObj.x;
  2000. let kdy = ball.kickPos.y - ball.gameObj.y;
  2001. dx = ball.kickPos.x - kdx * mis * 0.3;
  2002. dy = ball.kickPos.y - kdy * mis * 0.3;
  2003. }
  2004. else
  2005. this.destRot += mis;
  2006. }
  2007. else if (ball.poleAngle != 0) {
  2008. this.destRot += ball.poleAngle;
  2009. }
  2010. if (xGame.common.gameMode == 0) {
  2011. let af = kickAngle * 0.08;
  2012. this.forceMax = ball.hard * 0.1 + af * af;
  2013. }
  2014. this.setKick(dx, dy);
  2015. }
  2016. else {
  2017. let rand = this.aiLv * 5 + 40;
  2018. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2019. ball = xGame.common.getRandArrEle(this.scoreBall);
  2020. else
  2021. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2022. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2023. if (xGame.tools.random(0, 100) > rand) {
  2024. this.selectNum = max;
  2025. }
  2026. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2027. this.selectNum++;
  2028. }
  2029. ball.onClick(0, true);
  2030. }
  2031. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2032. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2033. let balls = xGame.common.d2World.ballArr;
  2034. let max = xGame.tools.getDis(hx, hy, bx, by);
  2035. for (let index = 0; index < balls.length; index++) {
  2036. let obj = balls[index];
  2037. if (obj.number == 0)
  2038. continue;
  2039. if (obj.number == bn || obj.number == dn)
  2040. continue;
  2041. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2042. if (dis * dis > max)
  2043. continue;
  2044. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2045. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2046. if (num > 1)
  2047. num = 1;
  2048. if (num < 0)
  2049. continue;
  2050. let gap = Math.sin(Math.acos(num)) * dis;
  2051. if (gap < this.ballSize)
  2052. return true;
  2053. }
  2054. return false;
  2055. }
  2056. isLine(xy, ball) {
  2057. let bx = xy.x;
  2058. let by = xy.y;
  2059. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2060. let dis = ball.getDestDis(xy);
  2061. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2062. let sin = Math.sin(angle);
  2063. let cos = Math.cos(angle);
  2064. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2065. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2066. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2067. let dx = bx + this.tempDir2.x * dis;
  2068. let dy = by + this.tempDir2.y * dis;
  2069. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2070. sin = Math.sin(-angle);
  2071. cos = Math.cos(-angle);
  2072. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2073. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2074. dx = bx + this.tempDir2.x * dis;
  2075. dy = by + this.tempDir2.y * dis;
  2076. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2077. if (isr && isl)
  2078. return false;
  2079. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2080. }
  2081. return true;
  2082. }
  2083. turnPole() {
  2084. this.turnNum++;
  2085. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2086. let dr = rot - this.destRot;
  2087. let abs = Math.abs(dr) % 360;
  2088. if (abs > 180) {
  2089. if (rot > 180)
  2090. rot -= 360;
  2091. if (this.destRot > 180)
  2092. this.destRot -= 360;
  2093. }
  2094. let max = this.turnNum * 5 + this.aiLv * 5;
  2095. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2096. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2097. let at = xGame.tools.random(1000, 2000);
  2098. if (!this.onAway(3))
  2099. at += xGame.tools.random(10000, 15000);
  2100. this.setState(AIState.shoot, at);
  2101. }
  2102. else {
  2103. let mr = 0;
  2104. if (abs > 3)
  2105. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2106. else if (Math.random() > 0.6)
  2107. mr = xGame.tools.random(1, 10) * 0.1;
  2108. mr = dr > 0 ? -mr : mr;
  2109. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2110. }
  2111. }
  2112. setKick(dx, dy) {
  2113. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2114. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2115. this.tempDir1.x = 0;
  2116. this.tempDir1.y = 1;
  2117. this.tempDir2.y = -this.tempDir2.y;
  2118. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2119. if (num > 1)
  2120. num = 1;
  2121. let rot = Math.acos(num) * 57.3;
  2122. if (this.tempDir2.x < 0)
  2123. rot = 360 - rot;
  2124. this.destRot += rot;
  2125. if (!xGame.common.gameMgr.finishOneShoot) {
  2126. this.forceMax += xGame.tools.random(10, 50);
  2127. this.forceMax -= this.aiLv * 2;
  2128. if (this.forceMax < 20)
  2129. this.forceMax = 20;
  2130. }
  2131. if (this.forceMax > 100)
  2132. this.forceMax = 101;
  2133. else if (this.forceMax < 10)
  2134. this.forceMax += xGame.tools.random(0, 10);
  2135. if (xGame.common.gameMode == 1)
  2136. this.forceMax = xGame.tools.random(80, 100);
  2137. else
  2138. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2139. let max = 2000 - this.aiLv * 100;
  2140. if (Math.random() > 0.8)
  2141. max += xGame.tools.random(100, 2000);
  2142. this.setState(AIState.turn, xGame.tools.random(500, max));
  2143. }
  2144. shoot() {
  2145. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2146. if (Math.random() > 0.8) {
  2147. this.gameSrc.aiForce(1);
  2148. this.setState(AIState.wait);
  2149. }
  2150. }
  2151. else {
  2152. let df = xGame.tools.random(3, 8);
  2153. if (this.forceNum < this.forceMax)
  2154. this.forceNum += df;
  2155. else
  2156. this.forceNum -= df;
  2157. let startY = this.gameSrc.ui.powerNode.y;
  2158. let height = this.gameSrc.ui.powerNode.height;
  2159. let force = startY + height * this.forceNum * 0.01;
  2160. this.gameSrc.aiForce(2, force);
  2161. }
  2162. }
  2163. reset() {
  2164. for (let i = 0; i < 4; i++) {
  2165. this.setRate--;
  2166. this.setNum++;
  2167. let pos = this.posList[this.posIdx];
  2168. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2169. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2170. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2171. this.rootPos.x = 387;
  2172. if (this.rootPos.x < this.rectL)
  2173. this.rootPos.x = this.rectL;
  2174. else if (this.rootPos.x > this.rectR)
  2175. this.rootPos.x = this.rectR;
  2176. if (this.rootPos.y < this.rectT)
  2177. this.rootPos.y = this.rectT;
  2178. else if (this.rootPos.y > this.rectB)
  2179. this.rootPos.y = this.rectB;
  2180. this.posIdx++;
  2181. let max = this.posList.length;
  2182. if (this.posIdx >= max)
  2183. this.posIdx -= max;
  2184. this.initHoleBall();
  2185. let ball = null;
  2186. if (this.scoreBall.length > 0)
  2187. ball = this.scoreBall[0];
  2188. else if (this.lineBall.length > 0)
  2189. ball = xGame.common.getRandArrEle(this.lineBall);
  2190. if (ball && ball.kickAngle < this.bestAngle) {
  2191. this.bestAngle = ball.kickAngle;
  2192. this.bestKick.x = ball.kickPos.x;
  2193. this.bestKick.y = ball.kickPos.y;
  2194. this.bestPos.x = this.rootPos.x;
  2195. this.bestPos.y = this.rootPos.y;
  2196. this.bestForce = ball.hard * 0.08;
  2197. }
  2198. }
  2199. if (this.setNum >= this.setMax)
  2200. this.setMax = 0;
  2201. if (this.setRate < 1) {
  2202. this.setState(AIState.move, 0);
  2203. this.rootMoveTime = Laya.timer.currTimer;
  2204. this.gameSrc.aiRootMove(true);
  2205. }
  2206. }
  2207. delayLine() {
  2208. this.gameSrc.aiRootMove(false);
  2209. }
  2210. move() {
  2211. if (this.bestPos.x < 1)
  2212. this.bestPos = this.rootPos;
  2213. let wObj = this.wBall.gameObj;
  2214. let destx = wObj.x;
  2215. let desty = wObj.y;
  2216. let dx = Math.abs(destx - this.bestPos.x);
  2217. let dy = Math.abs(desty - this.bestPos.y);
  2218. let mx = 3 + dx * 0.03;
  2219. let my = 3 + dy * 0.03;
  2220. if (dx < 4 && dy < 4) {
  2221. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2222. dt = dt < 1000 ? 1000 - dt : 0;
  2223. if (this.setMax > 0) {
  2224. let min = this.setMax * 0.3 + this.aiLv * 5;
  2225. this.setRate = xGame.tools.random(min, this.setMax);
  2226. this.setState(AIState.reset, 0);
  2227. }
  2228. else {
  2229. this.destRot = 0;
  2230. this.forceMax = this.bestForce;
  2231. this.setKick(this.bestKick.x, this.bestKick.y);
  2232. }
  2233. if (dt > 100) {
  2234. Laya.timer.clear(this, this.delayLine);
  2235. Laya.timer.once(dt, this, this.delayLine);
  2236. }
  2237. else
  2238. this.gameSrc.aiRootMove(false);
  2239. }
  2240. else {
  2241. if (dx > 4)
  2242. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2243. if (dy > 4)
  2244. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2245. this.gameSrc.onRootMove({ x: destx, y: desty });
  2246. }
  2247. }
  2248. resetRoot() {
  2249. this.bestAngle = 180;
  2250. this.bestForce = 0;
  2251. this.setMax = this.posList.length;
  2252. this.posIdx = xGame.tools.random(0, this.setMax);
  2253. let min = this.setMax * 0.3 + this.aiLv * 5;
  2254. this.setRate = xGame.tools.random(min, this.setMax);
  2255. let max = 2000 - this.aiLv * 100;
  2256. if (Math.random() > 0.8)
  2257. max += xGame.tools.random(100, 1000);
  2258. if (this.isGuide)
  2259. this.setState(AIState.select, 500);
  2260. else if (this.onAway(2))
  2261. this.setState(AIState.reset, xGame.tools.random(400, max));
  2262. else
  2263. this.setState(AIState.none);
  2264. if (xGame.common.gameMgr.finishOneShoot)
  2265. this.chat();
  2266. }
  2267. runAI() {
  2268. if (this.state > AIState.idle)
  2269. return;
  2270. this.initBall();
  2271. this.onGame(2500);
  2272. if (Math.random() > 0.6)
  2273. this.chat();
  2274. }
  2275. stopRun() {
  2276. this.setState(AIState.idle);
  2277. }
  2278. onGame(base) {
  2279. let max = base - this.aiLv * 100;
  2280. if (Math.random() > 0.8)
  2281. max += xGame.tools.random(100, 1000);
  2282. if (this.onAway(2))
  2283. this.setState(AIState.select, xGame.tools.random(500, max));
  2284. else
  2285. this.setState(AIState.none);
  2286. }
  2287. setState(sta, wt = 0) {
  2288. if (this.state == AIState.none)
  2289. return;
  2290. this.state = sta;
  2291. this.waitTime = wt;
  2292. }
  2293. onUpdate() {
  2294. if (this.state == AIState.none)
  2295. return;
  2296. this.awayTime -= this.dtime;
  2297. if (this.awayTime < 1) {
  2298. this.awayTime = xGame.tools.random(6000, 10000);
  2299. this.awayNum += (11 - this.aiLv);
  2300. this.onAway(1);
  2301. }
  2302. if (this.waitTime >= 0) {
  2303. this.waitTime -= this.dtime;
  2304. return;
  2305. }
  2306. switch (this.state) {
  2307. case AIState.idle:
  2308. this.chat();
  2309. break;
  2310. case AIState.reset:
  2311. this.reset();
  2312. break;
  2313. case AIState.move:
  2314. this.move();
  2315. break;
  2316. case AIState.leave:
  2317. this.state = AIState.none;
  2318. xGame.common.gameMgr.aiGameEnd(true);
  2319. break;
  2320. case AIState.select:
  2321. this.selectBall();
  2322. break;
  2323. case AIState.turn:
  2324. this.turnPole();
  2325. break;
  2326. case AIState.shoot:
  2327. this.shoot();
  2328. break;
  2329. }
  2330. }
  2331. onAway(type) {
  2332. if (type == 1) {
  2333. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2334. let num = this.awayNum + db * 20;
  2335. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2336. xGame.common.gameMgr.aiLeave();
  2337. this.setState(AIState.leave, 6666);
  2338. }
  2339. }
  2340. else if (type == 2) {
  2341. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2342. let num = this.awayNum + db * 30;
  2343. if (xGame.tools.random(0, 10000) < num)
  2344. return false;
  2345. }
  2346. else if (type == 3) {
  2347. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2348. let num = this.awayNum + db * 10;
  2349. if (xGame.tools.random(0, 4000) < num)
  2350. return false;
  2351. }
  2352. return true;
  2353. }
  2354. chat() {
  2355. if (this.chatTime > 0) {
  2356. this.chatTime -= this.dtime;
  2357. return;
  2358. }
  2359. this.chatTime = xGame.tools.random(2000, 10000);
  2360. let rand = xGame.tools.random(0, 100);
  2361. if (rand < 15)
  2362. this.talk();
  2363. else if (rand < 35)
  2364. this.emotion();
  2365. }
  2366. talk() {
  2367. xGame.common.talkMgr.showAITalk(0);
  2368. }
  2369. emotion() {
  2370. xGame.common.talkMgr.showAIEmotion(0);
  2371. }
  2372. resetAI() {
  2373. this.stopRun();
  2374. this.state = AIState.none;
  2375. }
  2376. }
  2377. class Partical extends Laya.Script3D {
  2378. constructor() {
  2379. super();
  2380. this.duration = 2000;
  2381. }
  2382. ;
  2383. onAwake() {
  2384. this.gameObj = this.owner;
  2385. }
  2386. onEnable() {
  2387. this.openTimer();
  2388. }
  2389. openTimer() {
  2390. Laya.timer.once(this.duration, this, this.disappear);
  2391. }
  2392. setCallback(obj, callback) {
  2393. this.obj = obj;
  2394. this.callback = callback;
  2395. Laya.timer.clearAll(this);
  2396. Laya.timer.once(this.duration, this, this.disappear);
  2397. }
  2398. disappear() {
  2399. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2400. this.callback && this.callback(this.obj);
  2401. }
  2402. }
  2403. class Ball extends Laya.Script3D {
  2404. constructor() {
  2405. super();
  2406. this.posV3 = new Laya.Vector3();
  2407. this.rotRate = 2.1;
  2408. this.rotSpeed = new Laya.Vector3();
  2409. this.myIndex = 0;
  2410. }
  2411. onAwake() {
  2412. this.gameObj = this.owner;
  2413. this.transform = this.gameObj.transform;
  2414. this.ballNode = this.gameObj.getChildByName("Ball");
  2415. this.shadowNode = this.gameObj.getChildByName("shadow");
  2416. }
  2417. initSelf(index, x, y, owner) {
  2418. this.d2BallSrc = owner;
  2419. this.myIndex = index;
  2420. this.setAlbedoTexture();
  2421. this.setTransPos(x, y);
  2422. this.setScale();
  2423. this.ballNode.transform.localRotationEulerX = 90;
  2424. if (index == 0) {
  2425. }
  2426. }
  2427. setAlbedoTexture(isIce = false) {
  2428. let url;
  2429. if (isIce) {
  2430. url = `res/d3Res/ballTexture/ice.jpg`;
  2431. }
  2432. else {
  2433. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2434. }
  2435. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2436. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2437. }));
  2438. }
  2439. runFireworks(obj, delay, callback) {
  2440. Laya.timer.clearAll(this);
  2441. Laya.timer.once(delay + 1, this, () => {
  2442. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2443. fire.transform.localPositionX = this.transform.localPositionX;
  2444. fire.transform.localPositionY = this.transform.localPositionY;
  2445. fire.transform.localPositionZ = this.transform.localPositionZ;
  2446. let src = fire.getComponent(Partical);
  2447. src.duration = 1000;
  2448. src.setCallback(obj, callback);
  2449. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2450. eft.transform.localPositionX = this.transform.localPositionX;
  2451. eft.transform.localPositionY = this.transform.localPositionY;
  2452. eft.transform.localPositionZ = this.transform.localPositionZ;
  2453. });
  2454. }
  2455. setTransPos(x, y) {
  2456. this.setRotation();
  2457. xGame.common.pos2to3Convert(x, y, this.posV3);
  2458. this.transform.localPositionX = this.posV3.x;
  2459. this.transform.localPositionY = 0;
  2460. this.transform.localPositionZ = this.posV3.z;
  2461. this.transform.localRotationEulerX = 0;
  2462. this.transform.localRotationEulerY = 0;
  2463. this.transform.localRotationEulerZ = 0;
  2464. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2465. this.shadowNode.transform.localPositionY = 0.1;
  2466. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2467. }
  2468. setRotation() {
  2469. if (this.d2BallSrc.canRot) {
  2470. let speed = this.d2BallSrc.rigy.linearVelocity;
  2471. this.rotSpeed.x = speed.x * this.rotRate;
  2472. this.rotSpeed.z = speed.y * this.rotRate;
  2473. this.rotSpeed.y = this.d2BallSrc.rotY;
  2474. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2475. }
  2476. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2477. this.rotSpeed.x = this.rotSpeed.y = 0;
  2478. this.rotSpeed.y = this.d2BallSrc.rotY;
  2479. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2480. }
  2481. }
  2482. setScale() {
  2483. let radius = xGame.common.d2World.rootBall.ui.width;
  2484. let scale = xGame.common.scale2to3Convert(radius);
  2485. this.transform.localScaleX = scale;
  2486. this.transform.localScaleY = scale;
  2487. this.transform.localScaleZ = scale;
  2488. }
  2489. playInHoleEft() {
  2490. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2491. eft.transform.position = this.transform.position;
  2492. }
  2493. playIceEft() {
  2494. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2495. eft.transform.position = this.transform.position;
  2496. }
  2497. get scaleXYZ() {
  2498. return this.transform.localScaleX;
  2499. }
  2500. set scaleXYZ(val) {
  2501. this.transform.localScaleX = val;
  2502. this.transform.localScaleY = val;
  2503. this.transform.localScaleZ = val;
  2504. }
  2505. get posX() {
  2506. return this.transform.localPositionX;
  2507. }
  2508. set posX(val) {
  2509. this.transform.localPositionX = val;
  2510. }
  2511. get posY() {
  2512. return this.transform.localPositionY;
  2513. }
  2514. set posY(val) {
  2515. this.transform.localPositionY = val;
  2516. }
  2517. get posZ() {
  2518. return this.transform.localPositionZ;
  2519. }
  2520. set posZ(val) {
  2521. this.transform.localPositionZ = val;
  2522. }
  2523. destroySelf() {
  2524. this.posV3 = null;
  2525. this.rotSpeed = null;
  2526. this.d2BallSrc = null;
  2527. this.ballNode = null;
  2528. this.gameObj.destroy(true);
  2529. this.transform = null;
  2530. this.destroy();
  2531. }
  2532. }
  2533. class ui_D2Ball extends fgui.GComponent {
  2534. static createInstance() {
  2535. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2536. }
  2537. onConstruct() {
  2538. this.myIcon = (this.getChild("myIcon"));
  2539. this.inner = (this.getChild("inner"));
  2540. this.n8 = (this.getChild("n8"));
  2541. this.n4 = (this.getChild("n4"));
  2542. this.wrongTips = (this.getChild("wrongTips"));
  2543. this.rightTips = (this.getChild("rightTips"));
  2544. this.breathAni = this.getTransition("breathAni");
  2545. }
  2546. }
  2547. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2548. class D2BallSrc extends Laya.Script {
  2549. constructor() {
  2550. super();
  2551. this.number = 0;
  2552. this.startX = 0;
  2553. this.startY = 0;
  2554. this.angleV2 = new Laya.Vector2();
  2555. this.isRootBall = false;
  2556. this.isBlackBall = false;
  2557. this.ballType = "";
  2558. this.canRot = true;
  2559. this.rotY = 0;
  2560. this.poleAngle = 0;
  2561. this.kickPos = { x: 0, y: 0 };
  2562. this.hard = 0;
  2563. this.kickAngle = 0;
  2564. this.borderDis = 0;
  2565. this.speedP10 = 5.6;
  2566. this.lastSpeed = { x: 0, y: 0 };
  2567. this.stillSpeed = 0.12;
  2568. this.ballFunc = "normal";
  2569. this.isRunSkillAni = false;
  2570. this.isInHole = false;
  2571. this.iceOwner = "";
  2572. this.forceRun = false;
  2573. this.myUNID = "";
  2574. this.rectL = 0;
  2575. this.rectR = 0;
  2576. this.rectT = 0;
  2577. this.rectB = 0;
  2578. this.forceVec = new Laya.Vector2();
  2579. this.lastDis = 0;
  2580. this.helpOut = { type: "", x: 0, y: 0 };
  2581. }
  2582. initSelf(number, x, y, d3Ball) {
  2583. if (!this.gameObj)
  2584. this.gameObj = this.owner;
  2585. this.number = number;
  2586. this.startX = x;
  2587. this.startY = y;
  2588. this.d3Ball = d3Ball;
  2589. this.isRootBall = false;
  2590. this.isBlackBall = false;
  2591. this.ballType = "";
  2592. if (number == 0) {
  2593. this.isRootBall = true;
  2594. }
  2595. else if (number == 8) {
  2596. this.isBlackBall = true;
  2597. }
  2598. else {
  2599. if (number <= 7) {
  2600. this.ballType = ballCamp.full;
  2601. }
  2602. else {
  2603. this.ballType = ballCamp.flower;
  2604. }
  2605. }
  2606. this.setInfo();
  2607. this.setD3Ball();
  2608. this.owner["mySrc"] = this;
  2609. this.rigy.linearDamping = 1;
  2610. D2BallSrc._unid++;
  2611. this.myUNID = "d2ball" + D2BallSrc._unid;
  2612. let rect = xGame.common.d2World.borderRect;
  2613. this.rectL = Math.ceil(rect.x) + 20;
  2614. this.rectT = Math.ceil(rect.y) + 20;
  2615. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2616. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2617. }
  2618. setInfo() {
  2619. this.gameObj.x = this.startX;
  2620. this.gameObj.y = this.startY;
  2621. let radius = this.ui.width / 2;
  2622. this.gameObj.width = radius * 2;
  2623. this.gameObj.height = radius * 2;
  2624. if (xGame.common.showDebug) {
  2625. this.ui.myIcon.alpha = 1;
  2626. this.ui.inner.alpha = 1;
  2627. }
  2628. else {
  2629. this.ui.myIcon.alpha = 0;
  2630. this.ui.inner.alpha = 0;
  2631. }
  2632. }
  2633. setD3Ball() {
  2634. this.d3Ball = this.d3Ball;
  2635. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2636. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2637. }
  2638. onUpdate() {
  2639. if (xGame.common.gameMgr.gamePause)
  2640. return;
  2641. if (this.isInHole)
  2642. return;
  2643. if (!xGame.common.d2World.openCheckStill)
  2644. return;
  2645. this.runBall();
  2646. }
  2647. runBall() {
  2648. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2649. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2650. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2651. this.judgeBorder();
  2652. }
  2653. getDestDis(dest) {
  2654. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2655. }
  2656. setmyXY(x, y) {
  2657. this.d3BallSrc.setTransPos(x, y);
  2658. }
  2659. getSpeed() {
  2660. let speed = this.rigy.linearVelocity;
  2661. return speed.x * speed.x + speed.y * speed.y;
  2662. }
  2663. onTriggerEnter(collider) {
  2664. if (!collider || !collider.owner)
  2665. return;
  2666. let coll = "collide";
  2667. let speed = this.getSpeed();
  2668. let sv2 = this.speedP10 * this.speedP10;
  2669. if (collider.label == "ball") {
  2670. if (speed < 9 && this.number != 0)
  2671. coll = "";
  2672. else if (speed < sv2)
  2673. coll = "collide_4";
  2674. else if (speed < sv2 * 6.2)
  2675. coll = "collide_3";
  2676. else if (speed < sv2 * 25)
  2677. coll = "collide_2";
  2678. else if (speed < sv2 * 56)
  2679. coll = "collide_1";
  2680. xGame.soundMgr.playSound(coll);
  2681. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2682. if (collider.owner) {
  2683. let rig = collider.owner.getComponent(D2BallSrc);
  2684. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2685. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2686. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2687. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2688. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2689. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2690. let rx = 0;
  2691. let ry = 0;
  2692. if (this.gameObj.x < this.rectL)
  2693. rx = vx;
  2694. else if (this.gameObj.x > this.rectR)
  2695. rx = -vx;
  2696. else if (this.gameObj.y < this.rectT)
  2697. ry = vy;
  2698. else if (this.gameObj.y > this.rectB)
  2699. ry = -vy;
  2700. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2701. }
  2702. }
  2703. if (this.number != 0) {
  2704. return;
  2705. }
  2706. else {
  2707. if (this.forceRun) {
  2708. console.log("randon force");
  2709. this.applyForce(collider);
  2710. }
  2711. }
  2712. if (xGame.common.d2World.isOnSameLine) {
  2713. xGame.common.d2World.isOnSameLine = false;
  2714. this.rigy.linearVelocity = { x: 0, y: 0 };
  2715. }
  2716. if (xGame.common.gameMgr.firstColliObj == null) {
  2717. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2718. xGame.common.gameMgr.isTouchedBall = true;
  2719. }
  2720. }
  2721. else {
  2722. xGame.common.recoverCameraView();
  2723. let wallStr = "";
  2724. if (speed < 9) { }
  2725. else if (speed < sv2) { }
  2726. else if (speed < sv2 * 6.2)
  2727. wallStr = "wall_30";
  2728. else if (speed < sv2 * 25)
  2729. wallStr = "wall_50";
  2730. else if (speed < sv2 * 56)
  2731. wallStr = "wall_80";
  2732. xGame.soundMgr.playSound(wallStr);
  2733. }
  2734. }
  2735. applyForce(collider) {
  2736. let src = collider.owner.mySrc;
  2737. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2738. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2739. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2740. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2741. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2742. }
  2743. checkWrongBall(playEft = true) {
  2744. if (this.isInHole)
  2745. return;
  2746. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2747. if (this.number != 0 && playEft)
  2748. this.d3BallSrc.playInHoleEft();
  2749. let coll = "inpocket_1";
  2750. let speed = this.getSpeed();
  2751. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2752. if (speed < 9 && this.number != 0)
  2753. coll = "";
  2754. else if (speed < sv2 * 6.2)
  2755. coll = "inpocket_4";
  2756. else if (speed < sv2 * 25)
  2757. coll = "collide_3";
  2758. else if (speed < sv2 * 56)
  2759. coll = "collide_2";
  2760. xGame.soundMgr.playSound(coll);
  2761. this.isInHole = true;
  2762. if (this.number == 0) {
  2763. console.log("白球进了。。");
  2764. this.reset();
  2765. this.rigy.linearVelocity = { x: 0, y: 0 };
  2766. this.hideSelf();
  2767. xGame.common.gameUI.ui.whiteAni.visible = true;
  2768. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2769. xGame.common.gameUI.ui.whiteAni.visible = false;
  2770. }));
  2771. }
  2772. else {
  2773. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2774. xGame.common.d2World.removeOneBall(this);
  2775. this.destroySelf();
  2776. xGame.common.playHappySound(this.number);
  2777. this.runFlyEft();
  2778. }
  2779. }
  2780. runFlyEft() {
  2781. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2782. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2783. }
  2784. }
  2785. hideSelf() {
  2786. if (this.d3Ball)
  2787. this.d3Ball.active = false;
  2788. }
  2789. showSelf() {
  2790. this.isInHole = false;
  2791. if (this.d3Ball && !this.d3Ball.active)
  2792. this.d3Ball.active = true;
  2793. }
  2794. isStill() {
  2795. let speed = this.rigy.linearVelocity;
  2796. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2797. this.rigy.linearVelocity = { x: 0, y: 0 };
  2798. return true;
  2799. }
  2800. return false;
  2801. }
  2802. reset() {
  2803. }
  2804. destroySelf() {
  2805. this.d3BallSrc.destroySelf();
  2806. if (!this.ui.isDisposed) {
  2807. this.ui.removeFromParent();
  2808. this.ui.dispose();
  2809. this.ui = null;
  2810. }
  2811. this.outColli = null;
  2812. this.innerColli = null;
  2813. this.rigy = null;
  2814. this.d3Ball = null;
  2815. this.d3BallSrc = null;
  2816. this.angleV2 = null;
  2817. this.gameObj.destroy(true);
  2818. this.destroy();
  2819. }
  2820. judgeBorder() {
  2821. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2822. return;
  2823. }
  2824. if (this.destroyed)
  2825. return;
  2826. if (xGame.common.gameMode == GameMode.classic)
  2827. return;
  2828. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2829. if (isOver) {
  2830. this.checkWrongBall();
  2831. }
  2832. }
  2833. onClick(e, force = false) {
  2834. if (this.number == 0)
  2835. return;
  2836. if (force) {
  2837. }
  2838. else {
  2839. if (xGame.common.d2World.openCheckStill)
  2840. return;
  2841. if (!xGame.common.gameMgr.selfTurn) {
  2842. return;
  2843. }
  2844. }
  2845. if (!xGame.common.gameMgr.finishOneShoot)
  2846. return;
  2847. let root = xGame.common.d2World.rootBall.gameObj;
  2848. let x = this.gameObj.x - root.x;
  2849. let y = this.gameObj.y - root.y;
  2850. let angle = xGame.common.getfguiRotation(x, y);
  2851. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2852. xGame.common.d2World.getHelpLine();
  2853. xGame.common.clickedBall = true;
  2854. this.checkGuide();
  2855. }
  2856. checkGuide() {
  2857. let guide = DataMgr.getSkillGuide();
  2858. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2859. xGame.common.guideStep++;
  2860. xGame.common.gameUI.ui.guide1.visible = false;
  2861. xGame.common.gameUI.ui.guide2.visible = true;
  2862. }
  2863. }
  2864. checkDistance(disX, disY, angle) {
  2865. let diameter = this.gameObj.width - 1;
  2866. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2867. if (!this.lastDis)
  2868. this.lastDis = dis;
  2869. else {
  2870. if (dis > this.lastDis) {
  2871. this.helpOut.type = "remove";
  2872. return this.helpOut;
  2873. }
  2874. }
  2875. if (dis <= Math.pow(diameter, 2)) {
  2876. let del = 0.01;
  2877. let offest = 0;
  2878. let realX = disX - this.gameObj.x;
  2879. let realY = disY - this.gameObj.y;
  2880. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2881. offest += del;
  2882. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2883. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2884. }
  2885. this.helpOut.type = "ok";
  2886. this.helpOut.x = realX + this.gameObj.x;
  2887. this.helpOut.y = realY + this.gameObj.y;
  2888. return this.helpOut;
  2889. }
  2890. else {
  2891. this.helpOut.type = "no";
  2892. return this.helpOut;
  2893. }
  2894. }
  2895. clearBallEft() {
  2896. this.clearBallRightEft();
  2897. this.clearBallWrongEft();
  2898. }
  2899. clearBallRightEft() {
  2900. this.ui.breathAni.stop();
  2901. this.ui.rightTips.visible = false;
  2902. }
  2903. clearBallWrongEft() {
  2904. this.ui.wrongTips.visible = false;
  2905. }
  2906. showWrongEft() {
  2907. if (!xGame.common.gameMgr.selfTurn)
  2908. return;
  2909. this.ui.wrongTips.visible = true;
  2910. }
  2911. showRightEft() {
  2912. if (!xGame.common.gameMgr.selfTurn)
  2913. return;
  2914. this.ui.rightTips.visible = true;
  2915. this.ui.rightTips.scaleX = 1;
  2916. this.ui.rightTips.scaleY = 1;
  2917. this.ui.breathAni.play();
  2918. }
  2919. setBallFunc(type, owner) {
  2920. if (type == "ice") {
  2921. this.ballFunc = type;
  2922. this.d3BallSrc.setAlbedoTexture(true);
  2923. this.rigy.type = "static";
  2924. this.iceOwner = owner;
  2925. }
  2926. else {
  2927. if (owner == this.iceOwner) {
  2928. this.ballFunc = type;
  2929. this.d3BallSrc.setAlbedoTexture(false);
  2930. this.rigy.type = "dynamic";
  2931. }
  2932. }
  2933. }
  2934. }
  2935. D2BallSrc._unid = 0;
  2936. class D2RootBallSrc extends D2BallSrc {
  2937. constructor() {
  2938. super();
  2939. this.maxSpeed = 0;
  2940. this.classicMaxSpeed = 2.2;
  2941. this.bigSkillMaxSpeed = 4;
  2942. this.angle = 0;
  2943. this.allPercent = 0;
  2944. this.linearPercent = 0;
  2945. this.anglePercent = 0;
  2946. this.maxAngleRate = 0.6;
  2947. this.baseRot = 7;
  2948. this.angleMax = 0;
  2949. this.speed = new Laya.Vector2();
  2950. this.rotSpeed = new Laya.Vector2();
  2951. }
  2952. isStill() {
  2953. let speed = this.rigy.linearVelocity;
  2954. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2955. if (this.anglePercent <= 0.1) {
  2956. this.rigy.linearVelocity = { x: 0, y: 0 };
  2957. return true;
  2958. }
  2959. }
  2960. return false;
  2961. }
  2962. reset() {
  2963. this.linearPercent = 0;
  2964. this.anglePercent = 0;
  2965. }
  2966. setSpeed(percent, angle) {
  2967. this.allPercent = percent;
  2968. this.angle = angle;
  2969. this.setAngleSpeed();
  2970. this.setLinearSpeed();
  2971. let hit = "hit";
  2972. if (percent < 25)
  2973. hit = "hit03";
  2974. else if (percent < 50)
  2975. hit = "hit02";
  2976. else if (percent < 75)
  2977. hit = "hit01";
  2978. xGame.soundMgr.playSound(hit);
  2979. }
  2980. setAngleSpeed() {
  2981. let offest = xGame.common.rodOffest;
  2982. let radius = 82;
  2983. let rate = Math.abs(offest.y / radius) * 0.5;
  2984. if (offest.y > 0)
  2985. this.angleMax = -this.baseRot * 2;
  2986. else
  2987. this.angleMax = this.baseRot;
  2988. this.rotY = -offest.x / radius * 100;
  2989. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2990. this.linearPercent = this.allPercent - this.anglePercent;
  2991. }
  2992. setLinearSpeed() {
  2993. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2994. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2995. if (!xGame.common.longHelpLine) {
  2996. let offset = -150 + xGame.common.randomNum(0, 300);
  2997. offset /= 100;
  2998. this.angle += offset;
  2999. }
  3000. }
  3001. }
  3002. let sin = Math.sin(this.angle * Math.PI / 180);
  3003. let cos = Math.cos(this.angle * Math.PI / 180);
  3004. switch (xGame.common.gameMode) {
  3005. case GameMode.classic:
  3006. this.maxSpeed = this.classicMaxSpeed;
  3007. break;
  3008. case GameMode.bigMove:
  3009. this.maxSpeed = this.bigSkillMaxSpeed;
  3010. break;
  3011. case GameMode.placeBall:
  3012. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3013. if (data.type == 1) {
  3014. this.maxSpeed = this.bigSkillMaxSpeed;
  3015. }
  3016. else {
  3017. this.maxSpeed = this.classicMaxSpeed;
  3018. }
  3019. break;
  3020. default:
  3021. break;
  3022. }
  3023. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3024. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3025. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3026. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3027. this.rigy.applyLinearImpulseToCenter(this.speed);
  3028. }
  3029. onUpdate() {
  3030. if (this.anglePercent > 0.1) {
  3031. this.anglePercent *= 0.97;
  3032. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3033. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3034. this.rigy.applyForceToCenter(this.rotSpeed);
  3035. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3036. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3037. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3038. if (num > 0.9)
  3039. this.canRot = true;
  3040. }
  3041. else
  3042. this.canRot = true;
  3043. if (Math.abs(this.rotY) > 0.1)
  3044. this.rotY *= 0.98;
  3045. super.onUpdate();
  3046. }
  3047. destroySelf() {
  3048. super.destroySelf();
  3049. this.speed = null;
  3050. }
  3051. }
  3052. class D2Ball extends Laya.Sprite {
  3053. constructor(isRootBall = false) {
  3054. super();
  3055. this.ui = ui_D2Ball.createInstance();
  3056. this.pivotX = this.ui.width / 2;
  3057. this.pivotY = this.ui.width / 2;
  3058. this.x = 0;
  3059. this.y = 0;
  3060. this.addChild(this.ui.displayObject);
  3061. this.ui.displayObject.x += this.ui.width / 2;
  3062. this.ui.displayObject.y += this.ui.width / 2;
  3063. if (isRootBall) {
  3064. this.d2Src = this.addComponent(D2RootBallSrc);
  3065. }
  3066. else {
  3067. this.d2Src = this.addComponent(D2BallSrc);
  3068. }
  3069. this.d2Src.ui = this.ui;
  3070. this.addCircleCollider();
  3071. this.addInnerCircleCollider();
  3072. this.addRigyBody();
  3073. }
  3074. addCircleCollider() {
  3075. let colli = xGame.common.getCollider("circle");
  3076. colli.radius = this.ui.width / 2;
  3077. this.addComponentIntance(colli);
  3078. this.d2Src.outColli = colli;
  3079. colli.label = "ball";
  3080. }
  3081. addInnerCircleCollider() {
  3082. let colli = xGame.common.getCollider("circle");
  3083. colli.radius = this.ui.inner.width / 2;
  3084. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3085. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3086. this.addComponentIntance(colli);
  3087. this.d2Src.innerColli = colli;
  3088. colli.label = "inner";
  3089. }
  3090. addRigyBody() {
  3091. let rigy = xGame.common.getRigbody();
  3092. rigy.type = "dynamic";
  3093. this.addComponentIntance(rigy);
  3094. this.d2Src.rigy = rigy;
  3095. }
  3096. disposeSelf() {
  3097. if (!this.ui.isDisposed) {
  3098. this.ui.dispose();
  3099. this.ui.removeFromParent();
  3100. this.ui = null;
  3101. }
  3102. }
  3103. }
  3104. class ui_D2Gan extends fgui.GComponent {
  3105. static createInstance() {
  3106. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3107. }
  3108. onConstruct() {
  3109. this.myIcon = (this.getChild("myIcon"));
  3110. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3111. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3112. this.self = (this.getChild("self"));
  3113. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3114. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3115. this.ai = (this.getChild("ai"));
  3116. }
  3117. }
  3118. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3119. class D2Gan {
  3120. constructor() {
  3121. this.offset = 0.15;
  3122. this.cell = 1.5;
  3123. this.onBallCell = 0.4;
  3124. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3125. this.moveNum = 70;
  3126. this.rulerRate = 0.1;
  3127. this.ui = ui_D2Gan.createInstance();
  3128. this.changeSelfRod();
  3129. this.changeAIRod();
  3130. }
  3131. changeSelfRod() {
  3132. let index = DataMgr.getCurBallRod();
  3133. let data = cfgTable.ballrodData[index + 1];
  3134. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3135. this.selfMySpine && this.selfMySpine.dispose();
  3136. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3137. if (data.spine) {
  3138. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3139. this.selfMySpine = new SpineMgr(data.spine, () => {
  3140. let xx = this.ui.selfEftRoot.width / 2;
  3141. let yy = this.ui.selfEftRoot.height / 2;
  3142. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3143. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3144. outSpine.rotation = -90;
  3145. });
  3146. }
  3147. }
  3148. changeAIRod() {
  3149. let length = Object.keys(cfgTable.ballrodData).length;
  3150. let rand = Math.floor(length * Math.random()) + 1;
  3151. let data = cfgTable.ballrodData[rand];
  3152. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3153. this.aiMySpine && this.aiMySpine.dispose();
  3154. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3155. if (data.spine) {
  3156. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3157. this.aiMySpine = new SpineMgr(data.spine, () => {
  3158. let xx = this.ui.aiEftRoot.width / 2;
  3159. let yy = this.ui.aiEftRoot.height / 2;
  3160. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3161. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3162. outSpine.rotation = -90;
  3163. });
  3164. }
  3165. }
  3166. setGanLastInfo() {
  3167. this.lastInfo.rotation = this.ui.rotation;
  3168. this.lastInfo.x = this.ui.x;
  3169. this.lastInfo.y = this.ui.y;
  3170. }
  3171. rotateSelf(flag, isRuler = false) {
  3172. let angle;
  3173. flag = flag * this.offset;
  3174. if (xGame.common.d2World.isHelpLineOnBall) {
  3175. angle = flag * this.onBallCell;
  3176. }
  3177. else {
  3178. angle = flag * this.cell;
  3179. }
  3180. if (isRuler) {
  3181. angle *= this.rulerRate;
  3182. }
  3183. this.ui.rotation += angle;
  3184. xGame.common.d2World.getHelpLine();
  3185. }
  3186. checkDistance() {
  3187. let target = xGame.common.d2World.targetBall;
  3188. let root = xGame.common.d2World.rootBall;
  3189. if (target == null) {
  3190. return 1;
  3191. }
  3192. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3193. if (dis <= 2500) {
  3194. return 5;
  3195. }
  3196. return 1;
  3197. }
  3198. rotDest(rot) {
  3199. this.ui.rotation = rot;
  3200. xGame.common.d2World.getHelpLine();
  3201. }
  3202. storagePower(powerNum) {
  3203. let pos = (powerNum / 100) * this.moveNum;
  3204. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3205. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3206. this.ui.x = this.lastInfo.x + xx;
  3207. this.ui.y = this.lastInfo.y + yy;
  3208. }
  3209. shoot() {
  3210. this.storagePower(0);
  3211. this.ui.visible = false;
  3212. }
  3213. destroySelf() {
  3214. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3215. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3216. this.selfMySpine && this.selfMySpine.dispose();
  3217. this.aiMySpine && this.aiMySpine.dispose();
  3218. this.lastInfo = null;
  3219. if (!this.ui.isDisposed) {
  3220. this.ui.removeFromParent();
  3221. this.ui.dispose();
  3222. }
  3223. }
  3224. }
  3225. class ui_HelpLine extends fgui.GComponent {
  3226. static createInstance() {
  3227. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3228. }
  3229. onConstruct() {
  3230. this.n10 = (this.getChild("n10"));
  3231. this.rect = (this.getChild("rect"));
  3232. this.dir11 = (this.getChild("dir11"));
  3233. this.dir = (this.getChild("dir"));
  3234. this.rootDir = (this.getChild("rootDir"));
  3235. this.dirDot = (this.getChild("dirDot"));
  3236. }
  3237. }
  3238. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3239. class D2HelpLine {
  3240. constructor() {
  3241. this.starX = 0;
  3242. this.starY = 0;
  3243. this.ui = ui_HelpLine.createInstance();
  3244. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3245. this.starX = this.ui.rect.x;
  3246. this.starY = this.ui.rect.y;
  3247. }
  3248. shoot() {
  3249. this.ui.visible = false;
  3250. }
  3251. destroySelf() {
  3252. if (this.ui.isDisposed) {
  3253. this.ui.removeFromParent();
  3254. this.ui.dispose();
  3255. }
  3256. }
  3257. }
  3258. class D2World extends Laya.Script {
  3259. constructor() {
  3260. super();
  3261. this.ballArr = [];
  3262. this.openCheckStill = false;
  3263. this.checkArr = [];
  3264. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3265. this.isHelpLineOnBall = false;
  3266. this.isOnSameLine = false;
  3267. this.reflectAngle = 0;
  3268. this.powerPercent = 0;
  3269. this.inHolesSpeed = [];
  3270. this.outDir = new Laya.Vector2();
  3271. this.rootDir = new Laya.Vector2();
  3272. this.aiLv = 0;
  3273. this.rootPos = new Laya.Vector2();
  3274. this.tempDir1 = new Laya.Vector2();
  3275. this.tempDir2 = new Laya.Vector2();
  3276. this.tempDir3 = new Laya.Vector2();
  3277. this.ballSize = 33;
  3278. this.destRot = 0;
  3279. }
  3280. initSelf() {
  3281. this.createBalls();
  3282. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3283. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3284. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3285. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3286. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3287. }
  3288. setBorderRect() {
  3289. let ui = xGame.common.gameUI.ui;
  3290. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3291. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3292. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3293. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3294. this.borderRect.x = starX;
  3295. this.borderRect.y = starY;
  3296. this.borderRect.width = width;
  3297. this.borderRect.height = height;
  3298. }
  3299. resetGame() {
  3300. this.openCheckStill = false;
  3301. let temp;
  3302. for (let index = 0; index < this.ballArr.length; index++) {
  3303. temp = this.ballArr[index];
  3304. temp.destroySelf();
  3305. }
  3306. xGame.common.d3World.ballRoot.destroyChildren();
  3307. xGame.common.gameUI.ui.ballNode.removeChildren();
  3308. console.log("进入摧毁逻辑");
  3309. this.d2Gan.destroySelf();
  3310. this.d2HelpLine.destroySelf();
  3311. this.ballArr = [];
  3312. }
  3313. setD2Gan() {
  3314. let ballNode = this.rootBall.ui;
  3315. let d2Gan = new D2Gan();
  3316. this.d2Gan = d2Gan;
  3317. let ganNode = d2Gan.ui;
  3318. ballNode.addChild(ganNode);
  3319. ganNode.pivotX = ganNode.pivotX;
  3320. ganNode.pivotY = ganNode.pivotY;
  3321. ganNode.x = ganNode.myIcon.width / 2;
  3322. ganNode.y = this.rootBall.gameObj.width;
  3323. d2Gan.setGanLastInfo();
  3324. }
  3325. setHelpLine() {
  3326. let d2Help = new D2HelpLine();
  3327. this.d2HelpLine = d2Help;
  3328. }
  3329. createBalls() {
  3330. let cfg;
  3331. switch (xGame.common.gameMode) {
  3332. case GameMode.classic:
  3333. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3334. break;
  3335. case GameMode.bigMove:
  3336. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3337. break;
  3338. case GameMode.placeBall:
  3339. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3340. break;
  3341. default:
  3342. break;
  3343. }
  3344. cfg = JSON.parse(JSON.stringify(cfg));
  3345. for (const key in cfg) {
  3346. if (cfg[key].value == 0) {
  3347. this.createRootBall(cfg[key]);
  3348. delete cfg[key];
  3349. break;
  3350. }
  3351. }
  3352. this.createOtherBalls(cfg);
  3353. }
  3354. createRootBall(data) {
  3355. let root = new D2Ball(true);
  3356. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3357. this.rootBall = root.d2Src;
  3358. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3359. let d3BallSrc = d3Ball.getComponent(Ball);
  3360. xGame.common.d3World.rootBall = d3Ball;
  3361. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3362. let xx = data.x;
  3363. let yy = data.y;
  3364. let numer = data.value;
  3365. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3366. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3367. this.ballArr.push(this.rootBall);
  3368. this.setD2Gan();
  3369. this.setHelpLine();
  3370. }
  3371. createOtherBalls(cfg) {
  3372. let temp;
  3373. let src;
  3374. let data;
  3375. for (const key in cfg) {
  3376. data = cfg[key];
  3377. temp = new D2Ball();
  3378. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3379. src = temp.d2Src;
  3380. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3381. src.initSelf(data.value, data.x, data.y, d3Ball);
  3382. this.ballArr.push(src);
  3383. }
  3384. }
  3385. shoot(percent) {
  3386. this.powerPercent = percent;
  3387. this.openCheckStill = true;
  3388. let d2Angle = this.d2Gan.ui.rotation;
  3389. this.rootBall.setSpeed(percent, d2Angle);
  3390. this.clearBallAllEft();
  3391. this.changePlayerView();
  3392. }
  3393. onUpdate() {
  3394. if (!this.openCheckStill)
  3395. return;
  3396. this.checkStill();
  3397. }
  3398. checkStill() {
  3399. for (let index = 0; index < this.ballArr.length; index++) {
  3400. if (!this.ballArr[index].isStill()) {
  3401. return;
  3402. }
  3403. }
  3404. xGame.eventMgr.event(ALL_BALL_STOP);
  3405. }
  3406. allBallStop() {
  3407. this.openCheckStill = false;
  3408. xGame.common.recoverCameraView();
  3409. }
  3410. waitShoot() {
  3411. if (!this.d2Gan.ui.isDisposed) {
  3412. this.d2Gan.ui.visible = true;
  3413. }
  3414. if (!this.d2HelpLine.ui.isDisposed) {
  3415. this.d2HelpLine.ui.visible = true;
  3416. }
  3417. this.clearBallAllEft();
  3418. this.showBallRightEft();
  3419. this.getHelpLine();
  3420. this.inHolesSpeed = [];
  3421. this.selectOneBall();
  3422. }
  3423. _getAllBallArr() {
  3424. let arr = this.ballArr;
  3425. let outArr = [];
  3426. for (let index = 0; index < arr.length; index++) {
  3427. if (arr[index] instanceof D2RootBallSrc)
  3428. continue;
  3429. if (arr[index].ballFunc == "ice")
  3430. continue;
  3431. if (arr[index].destroyed)
  3432. continue;
  3433. outArr.push(arr[index]);
  3434. }
  3435. return outArr;
  3436. }
  3437. _getBlackObj() {
  3438. let arr = this.ballArr;
  3439. for (let index = 0; index < arr.length; index++) {
  3440. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3441. return arr[index];
  3442. }
  3443. }
  3444. }
  3445. selectOneBall() {
  3446. let all = this._getAllBallArr();
  3447. let target;
  3448. switch (xGame.common.gameMode) {
  3449. case GameMode.classic:
  3450. if (xGame.common.gameMgr.selfTurn) {
  3451. let self = xGame.common.gameMgr.selfBallArr;
  3452. let black = this._getBlackObj();
  3453. if (xGame.common.gameMgr.ensureBallType) {
  3454. if (self.length > 0) {
  3455. let out = [];
  3456. for (let j = 0; j < all.length; j++) {
  3457. if (self.indexOf(all[j].number) > -1) {
  3458. out.push(all[j]);
  3459. }
  3460. }
  3461. target = this.selectBestEnterOne(out);
  3462. }
  3463. else {
  3464. target = this.selectBestEnterOne([black]);
  3465. }
  3466. }
  3467. else {
  3468. target = this.selectBestEnterOne(all);
  3469. }
  3470. }
  3471. else {
  3472. target = this.selectBestEnterOne(all);
  3473. }
  3474. break;
  3475. case GameMode.bigMove:
  3476. target = this.selectBestEnterOne(all);
  3477. break;
  3478. case GameMode.placeBall:
  3479. if (all.length > 0) {
  3480. target = this.selectBestEnterOne(all);
  3481. }
  3482. break;
  3483. default:
  3484. break;
  3485. }
  3486. if (target && !target.destroyed && target.onClick) {
  3487. target.onClick(0, true);
  3488. let num = -200 + xGame.common.randomNum(0, 400);
  3489. num /= 150;
  3490. if (xGame.common.longHelpLine) {
  3491. num = 0;
  3492. }
  3493. this.destRot += num;
  3494. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3495. }
  3496. }
  3497. removeOneBall(ball) {
  3498. for (let index = 0; index < this.ballArr.length; index++) {
  3499. if (this.ballArr[index].id == ball.id) {
  3500. this.ballArr.splice(index, 1);
  3501. break;
  3502. }
  3503. }
  3504. }
  3505. getHelpLine() {
  3506. this.d2HelpLine.ui.dirDot.visible = false;
  3507. this.isOnSameLine = false;
  3508. let startX = this.rootBall.gameObj.x;
  3509. let startY = this.rootBall.gameObj.y;
  3510. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3511. if (dis == null) {
  3512. this.d2HelpLine.ui.visible = false;
  3513. console.error("辅助线异常");
  3514. return;
  3515. }
  3516. this.d2HelpLine.ui.visible = true;
  3517. let angle = this.d2Gan.ui.rotation;
  3518. let radius = 16.5;
  3519. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3520. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3521. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3522. if (colliObj == null) {
  3523. this.getColliPos(disX, disY, radius, angle);
  3524. xGame.common.d2World.isHelpLineOnBall = false;
  3525. this.targetBall = null;
  3526. this.reflectAngle = 0;
  3527. this.showBallWrongEft();
  3528. }
  3529. else {
  3530. let target = colliObj.src;
  3531. let radius = 16.5;
  3532. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3533. dis1 = Math.sqrt(dis1);
  3534. let realDis = colliObj.disHon - dis1;
  3535. let dir = colliObj.dir;
  3536. let xx = startX + dir.x * realDis;
  3537. let yy = startY + dir.y * realDis;
  3538. this.getColliPos(xx, yy, radius, angle);
  3539. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3540. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3541. let offset = xGame.common.rodOffest;
  3542. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3543. this.isOnSameLine = true;
  3544. }
  3545. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3546. xGame.common.d2World.isHelpLineOnBall = true;
  3547. this.targetBall = target;
  3548. this.reflectAngle = reflectAngle;
  3549. this.showBallWrongEft();
  3550. if (xGame.common.longHelpLine) {
  3551. this.delayReflectLine(target, reflectAngle);
  3552. }
  3553. }
  3554. }
  3555. getBorderDot(startX, startY, angle) {
  3556. let radius = 17;
  3557. let distance;
  3558. let isDone;
  3559. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3560. isDone = this.judgeUpDown(distance, angle, startX);
  3561. if (isDone != null) {
  3562. return isDone;
  3563. }
  3564. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3565. isDone = this.judgeUpDown(distance, angle, startX);
  3566. if (isDone != null) {
  3567. return isDone;
  3568. }
  3569. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3570. isDone = this.judgeLeftRight(distance, angle, startY);
  3571. if (isDone != null) {
  3572. return isDone;
  3573. }
  3574. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3575. isDone = this.judgeLeftRight(distance, angle, startY);
  3576. if (isDone != null) {
  3577. return isDone;
  3578. }
  3579. }
  3580. judgeUpDown(distance, angle, startX) {
  3581. let flag = Math.sin(angle * Math.PI / 180);
  3582. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3583. if (distance >= 0) {
  3584. if (flag > 0) {
  3585. if (temp < this.borderRect.x + this.borderRect.width) {
  3586. return distance;
  3587. }
  3588. }
  3589. else {
  3590. if (temp > this.borderRect.x) {
  3591. return distance;
  3592. }
  3593. }
  3594. }
  3595. }
  3596. judgeLeftRight(distance, angle, starY) {
  3597. let flag = -Math.cos(angle * Math.PI / 180);
  3598. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3599. if (distance >= 0) {
  3600. if (flag > 0) {
  3601. if (temp < this.borderRect.y + this.borderRect.height) {
  3602. return distance;
  3603. }
  3604. }
  3605. else {
  3606. if (temp > this.borderRect.y) {
  3607. return distance;
  3608. }
  3609. }
  3610. }
  3611. }
  3612. clearBallAllEft() {
  3613. let temp;
  3614. for (let index = 0; index < this.ballArr.length; index++) {
  3615. temp = this.ballArr[index];
  3616. temp.clearBallEft();
  3617. }
  3618. }
  3619. showBallRightEft() {
  3620. let gameMgr = xGame.common.gameMgr;
  3621. let temp;
  3622. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3623. if (targetArr.length <= 0)
  3624. return;
  3625. for (let index = 0; index < this.ballArr.length; index++) {
  3626. temp = this.ballArr[index];
  3627. if (targetArr.indexOf(temp.number) > -1) {
  3628. temp.showRightEft();
  3629. }
  3630. }
  3631. }
  3632. showBallWrongEft() {
  3633. let gameMgr = xGame.common.gameMgr;
  3634. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3635. if (targetArr.length <= 0)
  3636. return;
  3637. let temp;
  3638. for (let index = 0; index < this.ballArr.length; index++) {
  3639. temp = this.ballArr[index];
  3640. if (this.targetBall && this.targetBall.number == temp.number) {
  3641. if (targetArr.indexOf(temp.number) <= -1) {
  3642. temp.showWrongEft();
  3643. }
  3644. else {
  3645. temp.clearBallWrongEft();
  3646. }
  3647. }
  3648. else {
  3649. temp.clearBallWrongEft();
  3650. }
  3651. }
  3652. }
  3653. getColliPos(x, y, radius, angle) {
  3654. this.d2HelpLine.ui.x = x;
  3655. this.d2HelpLine.ui.y = y;
  3656. let dirX = x - this.rootBall.gameObj.x;
  3657. let dirY = y - this.rootBall.gameObj.y;
  3658. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3659. if (rectH <= 0)
  3660. rectH = 0;
  3661. this.d2HelpLine.ui.rect.height = 0;
  3662. this.d2HelpLine.ui.rect.height = rectH;
  3663. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3664. if (rectH < this.rootBall.gameObj.width) {
  3665. this.d2HelpLine.ui.rect.visible = false;
  3666. }
  3667. else {
  3668. this.d2HelpLine.ui.rect.visible = true;
  3669. }
  3670. this.d2HelpLine.ui.dir.visible = false;
  3671. this.d2HelpLine.ui.rootDir.visible = false;
  3672. }
  3673. getReflectLine(x, y, radius, target) {
  3674. this.d2HelpLine.ui.dir.visible = true;
  3675. let dirX = target.x - x;
  3676. let dirY = target.y - y;
  3677. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3678. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3679. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3680. this.d2HelpLine.ui.dir.height = 48;
  3681. this.d2HelpLine.ui.dir.rotation = angle;
  3682. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3683. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3684. return angle;
  3685. }
  3686. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3687. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3688. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3689. let targetX = target.gameObj.x;
  3690. let targetY = target.gameObj.y;
  3691. this.outDir.setValue(targetX - xx, targetY - yy);
  3692. this.rootDir.setValue(rtX - xx, rtY - yy);
  3693. let ver = Math.PI / 2;
  3694. let sin = Math.sin(ver);
  3695. let cos = Math.cos(ver);
  3696. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3697. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3698. this.outDir.setValue(outX, outY);
  3699. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3700. Laya.Vector2.normalize(this.outDir, this.outDir);
  3701. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3702. if (Math.abs(result) <= 0.08) {
  3703. this.d2HelpLine.ui.rootDir.visible = false;
  3704. return;
  3705. }
  3706. if (result > 0) {
  3707. angle += 90;
  3708. }
  3709. else if (result < 0) {
  3710. angle -= 90;
  3711. }
  3712. this.d2HelpLine.ui.rootDir.visible = true;
  3713. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3714. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3715. this.d2HelpLine.ui.rootDir.rotation = angle;
  3716. }
  3717. delayReflectLine(obj, angle) {
  3718. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3719. return;
  3720. }
  3721. this.isOnSameLine = false;
  3722. let startX = obj.gameObj.x;
  3723. let startY = obj.gameObj.y;
  3724. let dis = this.getBorderDot(startX, startY, angle);
  3725. if (dis == null) {
  3726. this.d2HelpLine.ui.dirDot.visible = false;
  3727. return;
  3728. }
  3729. this.d2HelpLine.ui.visible = true;
  3730. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3731. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3732. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3733. if (colliObj == null) {
  3734. this.setDelayLine(disX, disY, obj, angle);
  3735. }
  3736. else {
  3737. let radius = 16;
  3738. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3739. dis1 = Math.sqrt(dis1);
  3740. let realDis = colliObj.disHon - dis1;
  3741. let dir = colliObj.dir;
  3742. let xx = startX + dir.x * realDis;
  3743. let yy = startY + dir.y * realDis;
  3744. this.setDelayLine(xx, yy, obj, angle);
  3745. }
  3746. }
  3747. setDelayLine(x, y, obj, angle) {
  3748. let dirX = x - obj.gameObj.x;
  3749. let dirY = y - obj.gameObj.y;
  3750. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3751. if (rectH <= 0)
  3752. rectH = 0;
  3753. this.d2HelpLine.ui.dir.height = rectH;
  3754. this.d2HelpLine.ui.dirDot.visible = true;
  3755. this.d2HelpLine.ui.dirDot.x = 17;
  3756. this.d2HelpLine.ui.dirDot.y = 17;
  3757. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3758. ;
  3759. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3760. }
  3761. changePlayerView() {
  3762. if (Math.random() >= 0.7)
  3763. return;
  3764. if (!this.targetBall) {
  3765. return;
  3766. }
  3767. if (!xGame.common.gameMgr.selfTurn)
  3768. return;
  3769. switch (xGame.common.gameMode) {
  3770. case GameMode.classic:
  3771. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3772. if (this.targetBall.number != 8) {
  3773. return;
  3774. }
  3775. }
  3776. break;
  3777. case GameMode.bigMove:
  3778. return;
  3779. case GameMode.placeBall:
  3780. break;
  3781. default:
  3782. break;
  3783. }
  3784. let startX = this.targetBall.gameObj.x;
  3785. let startY = this.targetBall.gameObj.y;
  3786. let angle = this.reflectAngle;
  3787. let dis = this.getBorderDot(startX, startY, angle);
  3788. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3789. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3790. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3791. if (colliObj) {
  3792. return;
  3793. }
  3794. let offset = 40;
  3795. let posObj = xGame.common.gameMgr.posObj;
  3796. let temp;
  3797. let radius;
  3798. let tarX, tarY;
  3799. for (const key in posObj) {
  3800. temp = posObj[key];
  3801. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3802. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3803. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3804. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3805. xGame.common.showOneCamera("angle" + key);
  3806. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3807. Laya.physicsTimer.scale = 0.7;
  3808. break;
  3809. }
  3810. }
  3811. }
  3812. selectBestEnterOne(arr) {
  3813. this.aiLv = xGame.tools.random(1, 11);
  3814. this.aiLv = 10;
  3815. this.wBall = xGame.common.d2World.rootBall;
  3816. this.rootPos.x = this.wBall.gameObj.x;
  3817. this.rootPos.y = this.wBall.gameObj.y;
  3818. this.initHoleBall(arr);
  3819. return this.selectBall();
  3820. }
  3821. selectBall() {
  3822. let ball = null;
  3823. this.destRot = 0;
  3824. let ai = 110 - this.aiLv * 10;
  3825. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3826. let score = false;
  3827. if (this.scoreBall.length < 1) {
  3828. if (this.lineBall.length < 1) {
  3829. for (let i = 0; i < this.kickBall.length; i++) {
  3830. let list = [];
  3831. let bo = this.kickBall[i];
  3832. let bobj = bo.gameObj;
  3833. let rect = xGame.common.d2World.borderRect;
  3834. let mobj = this.wBall.gameObj;
  3835. let minb = bobj.y - rect.y - 20;
  3836. let minw = mobj.y - rect.y - 50;
  3837. if (minb > 0 && minw > 0) {
  3838. let dlenx = 0;
  3839. let dleny = mobj.y - rect.y;
  3840. let spx = mobj.x;
  3841. let spy = rect.y - dleny;
  3842. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3843. }
  3844. minb = rect.y + rect.height - bobj.y - 20;
  3845. minw = rect.y + rect.height - mobj.y - 50;
  3846. if (minb > 0 && minw > 0) {
  3847. let dlenx = 0;
  3848. let dleny = rect.y + rect.height - mobj.y;
  3849. let spx = mobj.x;
  3850. let spy = rect.y + rect.height + dleny;
  3851. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3852. }
  3853. minb = bobj.x - rect.x - 20;
  3854. minw = mobj.x - rect.x - 50;
  3855. if (minb > 0 && minw > 0) {
  3856. let dlenx = mobj.x - rect.x;
  3857. let dleny = 0;
  3858. let spx = rect.x - dlenx;
  3859. let spy = mobj.y;
  3860. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3861. }
  3862. minb = rect.x + rect.width - bobj.x - 20;
  3863. minw = rect.x + rect.width - mobj.x - 50;
  3864. if (minb > 0 && minw > 0) {
  3865. let dlenx = rect.x + rect.width - mobj.x;
  3866. let dleny = 0;
  3867. let spx = rect.x + rect.width + dlenx;
  3868. let spy = mobj.y;
  3869. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3870. }
  3871. list.sort(function (a, b) {
  3872. return a.order - b.order;
  3873. });
  3874. for (let i = 0; i < list.length; i++) {
  3875. let data = list[i];
  3876. let mx = mobj.x - bobj.x;
  3877. let my = mobj.y - bobj.y;
  3878. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3879. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3880. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3881. if (num > 1)
  3882. num = 1;
  3883. let cos = Math.acos(num);
  3884. if (cos > 1.57)
  3885. cos = 1.57;
  3886. else if (cos < 0.01)
  3887. cos = 0.01;
  3888. let tan = Math.tan(cos);
  3889. let dx = tan * data.dleny;
  3890. let dy = tan * data.dlenx;
  3891. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3892. if (Math.abs(bx - 667) < 40)
  3893. continue;
  3894. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3895. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3896. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3897. this.forceMax = dis * 0.08;
  3898. this.destRot += mis * 0.1;
  3899. this.setKick(bx, by);
  3900. return true;
  3901. }
  3902. }
  3903. }
  3904. }
  3905. else {
  3906. ball = xGame.common.getRandArrEle(this.lineBall);
  3907. }
  3908. }
  3909. else {
  3910. for (let i = 0; i < this.scoreBall.length; i++) {
  3911. if (i < this.scoreBall.length - 1) {
  3912. let rand = 70 + this.aiLv * 10 + i * 10;
  3913. if (xGame.tools.random(0, 100) < rand) {
  3914. ball = this.scoreBall[i];
  3915. break;
  3916. }
  3917. }
  3918. else {
  3919. ball = this.scoreBall[i];
  3920. break;
  3921. }
  3922. }
  3923. score = true;
  3924. this.selectNum++;
  3925. }
  3926. if (!ball)
  3927. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3928. let dx = ball.gameObj.x;
  3929. let dy = ball.gameObj.y;
  3930. let kickAngle = 0;
  3931. if (score) {
  3932. dx = ball.kickPos.x;
  3933. dy = ball.kickPos.y;
  3934. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3935. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3936. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3937. if (adot > 1)
  3938. adot = 1;
  3939. kickAngle = Math.acos(adot) * 57.3;
  3940. if (kickAngle > 45) {
  3941. let kdx = ball.kickPos.x - ball.gameObj.x;
  3942. let kdy = ball.kickPos.y - ball.gameObj.y;
  3943. dx = ball.kickPos.x - kdx * mis * 0.3;
  3944. dy = ball.kickPos.y - kdy * mis * 0.3;
  3945. }
  3946. else
  3947. this.destRot += mis;
  3948. }
  3949. else if (ball.poleAngle != 0) {
  3950. this.destRot += ball.poleAngle;
  3951. }
  3952. if (xGame.common.gameMode == 0) {
  3953. let af = kickAngle * 0.08;
  3954. this.forceMax = ball.hard * 0.1 + af * af;
  3955. }
  3956. this.setKick(dx, dy);
  3957. return ball;
  3958. }
  3959. initHoleBall(arr) {
  3960. this.kickBall = [];
  3961. this.lineBall = [];
  3962. this.scoreBall = [];
  3963. this.holeBall = [];
  3964. this.selectNum = 0;
  3965. this.forceNum = 0;
  3966. this.forceMax = 0;
  3967. this.turnNum = 0;
  3968. let list = arr;
  3969. let holes = xGame.common.gameMgr.holePosList;
  3970. let self = xGame.common.aiPlayer;
  3971. for (let i = 0; i < list.length; i++) {
  3972. let obj = list[i];
  3973. if (!obj)
  3974. continue;
  3975. obj.kickPos.x = 0;
  3976. obj.kickPos.y = 0;
  3977. obj.poleAngle = 0;
  3978. obj.hard = 0;
  3979. obj.borderDis = 0;
  3980. obj.kickAngle = 180;
  3981. let b = obj.gameObj;
  3982. let wbp = this.rootPos;
  3983. let bx = wbp.x - b.x;
  3984. let by = wbp.y - b.y;
  3985. obj.borderDis = xGame.tools.random(0, 100);
  3986. this.kickBall.push(obj);
  3987. if (!this.isLine(wbp, obj))
  3988. continue;
  3989. obj.kickAngle = xGame.tools.random(90, 180);
  3990. obj.kickPos.x = b.x;
  3991. obj.kickPos.y = b.y;
  3992. this.lineBall.push(obj);
  3993. let minDis = 999999;
  3994. let hole = false;
  3995. for (let j = 0; j < holes.length; j++) {
  3996. let hp = holes[j];
  3997. if (bx >= 0 && hp.x > b.x + 100)
  3998. continue;
  3999. if (bx <= 0 && hp.x < b.x - 100)
  4000. continue;
  4001. if (by < -10 && hp.y < wbp.y)
  4002. continue;
  4003. if (by > 10 && hp.y > wbp.y)
  4004. continue;
  4005. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4006. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4007. if (dis < minDis) {
  4008. let dx = b.x - this.tempDir1.x * this.ballSize;
  4009. let dy = b.y - this.tempDir1.y * this.ballSize;
  4010. this.tempDir3.x = this.tempDir1.x;
  4011. this.tempDir3.y = this.tempDir1.y;
  4012. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4013. obj.kickPos.x = dx;
  4014. obj.kickPos.y = dy;
  4015. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4016. if (num > 1)
  4017. num = 1;
  4018. obj.kickAngle = Math.acos(num) * 57.3;
  4019. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4020. dis = dis * 2;
  4021. if (Math.abs(hp.x - 600) < 100)
  4022. dis += 50;
  4023. obj.hard = dis + obj.kickAngle * 3;
  4024. hole = true;
  4025. }
  4026. }
  4027. }
  4028. }
  4029. if (hole) {
  4030. this.scoreBall.push(obj);
  4031. this.holeBall.push(obj);
  4032. }
  4033. }
  4034. this.scoreBall.sort(function (a, b) {
  4035. return a.hard - b.hard;
  4036. });
  4037. this.holeBall.sort(function (a, b) {
  4038. return a.kickAngle - b.kickAngle;
  4039. });
  4040. this.kickBall.sort(function (a, b) {
  4041. return a.borderDis - b.borderDis;
  4042. });
  4043. }
  4044. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4045. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4046. let balls = xGame.common.d2World.ballArr;
  4047. let max = xGame.tools.getDis(hx, hy, bx, by);
  4048. for (let index = 0; index < balls.length; index++) {
  4049. let obj = balls[index];
  4050. if (obj.number == 0)
  4051. continue;
  4052. if (obj.number == bn || obj.number == dn)
  4053. continue;
  4054. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4055. if (dis * dis > max)
  4056. continue;
  4057. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4058. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4059. if (num > 1)
  4060. num = 1;
  4061. if (num < 0)
  4062. continue;
  4063. let gap = Math.sin(Math.acos(num)) * dis;
  4064. if (gap < this.ballSize)
  4065. return true;
  4066. }
  4067. return false;
  4068. }
  4069. isLine(xy, ball) {
  4070. let bx = xy.x;
  4071. let by = xy.y;
  4072. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4073. let dis = ball.getDestDis(xy);
  4074. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4075. let sin = Math.sin(angle);
  4076. let cos = Math.cos(angle);
  4077. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4078. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4079. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4080. let dx = bx + this.tempDir2.x * dis;
  4081. let dy = by + this.tempDir2.y * dis;
  4082. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4083. sin = Math.sin(-angle);
  4084. cos = Math.cos(-angle);
  4085. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4086. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4087. dx = bx + this.tempDir2.x * dis;
  4088. dy = by + this.tempDir2.y * dis;
  4089. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4090. if (isr && isl)
  4091. return false;
  4092. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4093. }
  4094. return true;
  4095. }
  4096. setKick(dx, dy) {
  4097. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4098. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4099. this.tempDir1.x = 0;
  4100. this.tempDir1.y = 1;
  4101. this.tempDir2.y = -this.tempDir2.y;
  4102. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4103. if (num > 1)
  4104. num = 1;
  4105. let rot = Math.acos(num) * 57.3;
  4106. if (this.tempDir2.x < 0)
  4107. rot = 360 - rot;
  4108. this.destRot += rot;
  4109. }
  4110. }
  4111. class ui_UIGame extends fgui.GComponent {
  4112. static createInstance() {
  4113. return (fgui.UIPackage.createObject("game", "UIGame"));
  4114. }
  4115. onConstruct() {
  4116. this.c1 = this.getController("c1");
  4117. this.d3Root = (this.getChild("d3Root"));
  4118. this.clickNode = (this.getChild("clickNode"));
  4119. this.d2Root = (this.getChild("d2Root"));
  4120. this.topNode = (this.getChild("topNode"));
  4121. this.n72 = (this.getChild("n72"));
  4122. this.n40 = (this.getChild("n40"));
  4123. this.rulerNode = (this.getChild("rulerNode"));
  4124. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4125. this.n50 = (this.getChild("n50"));
  4126. this.keduNode = (this.getChild("keduNode"));
  4127. this.powerTxt = (this.getChild("powerTxt"));
  4128. this.powerNode = (this.getChild("powerNode"));
  4129. this.colorNode = (this.getChild("colorNode"));
  4130. this.powerEft = (this.getChild("powerEft"));
  4131. this.myPowerNode = (this.getChild("myPowerNode"));
  4132. this.ganNode = (this.getChild("ganNode"));
  4133. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4134. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4135. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4136. this.skillRod = (this.getChild("skillRod"));
  4137. this.border = (this.getChild("border"));
  4138. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4139. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4140. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4141. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4142. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4143. this.guanyuNode = (this.getChild("guanyuNode"));
  4144. this.helpBtn = (this.getChild("helpBtn"));
  4145. this.wordsBtn = (this.getChild("wordsBtn"));
  4146. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4147. this.returnBtn = (this.getChild("returnBtn"));
  4148. this.ballNode = (this.getChild("ballNode"));
  4149. this.whiteAni = (this.getChild("whiteAni"));
  4150. this.blackAni = (this.getChild("blackAni"));
  4151. this.selfTurn = (this.getChild("selfTurn"));
  4152. this.aiTurn = (this.getChild("aiTurn"));
  4153. this.deskNode = (this.getChild("deskNode"));
  4154. this.moveNode = (this.getChild("moveNode"));
  4155. this.selfTalk = (this.getChild("selfTalk"));
  4156. this.aiTalk = (this.getChild("aiTalk"));
  4157. this.d2Node = (this.getChild("d2Node"));
  4158. this.snowNode = (this.getChild("snowNode"));
  4159. this.guide2 = (this.getChild("guide2"));
  4160. this.guide1 = (this.getChild("guide1"));
  4161. this.guide3 = (this.getChild("guide3"));
  4162. this.guideNode = (this.getChild("guideNode"));
  4163. }
  4164. }
  4165. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4166. class ui_UIGameEnd extends fgui.GComponent {
  4167. static createInstance() {
  4168. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4169. }
  4170. onConstruct() {
  4171. this.c1 = this.getController("c1");
  4172. this.n22 = (this.getChild("n22"));
  4173. this.n2 = (this.getChild("n2"));
  4174. this.n52 = (this.getChild("n52"));
  4175. this.n53 = (this.getChild("n53"));
  4176. this.coinNode = (this.getChild("coinNode"));
  4177. this.closeNode = (this.getChild("closeNode"));
  4178. this.moneyNode = (this.getChild("moneyNode"));
  4179. this.secretary = (this.getChild("secretary"));
  4180. this.n27 = (this.getChild("n27"));
  4181. this.n29 = (this.getChild("n29"));
  4182. this.talkNode = (this.getChild("talkNode"));
  4183. this.n38 = (this.getChild("n38"));
  4184. this.n39 = (this.getChild("n39"));
  4185. this.n40 = (this.getChild("n40"));
  4186. this.awardNode = (this.getChild("awardNode"));
  4187. this.starNumNode = (this.getChild("starNumNode"));
  4188. this.n47 = (this.getChild("n47"));
  4189. this.conditionNode = (this.getChild("conditionNode"));
  4190. this.isGetAward = (this.getChild("isGetAward"));
  4191. this.leftBtn = (this.getChild("leftBtn"));
  4192. this.rightBtn = (this.getChild("rightBtn"));
  4193. this.btnNode = (this.getChild("btnNode"));
  4194. }
  4195. }
  4196. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4197. class ui_UIAddCoin extends fgui.GComponent {
  4198. static createInstance() {
  4199. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4200. }
  4201. onConstruct() {
  4202. this.n11 = (this.getChild("n11"));
  4203. this.myNode = (this.getChild("myNode"));
  4204. this.t0 = this.getTransition("t0");
  4205. }
  4206. }
  4207. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4208. class UIAddCoin extends UIBase {
  4209. constructor() {
  4210. super();
  4211. this.coinNum = 2000;
  4212. }
  4213. onConstructor() {
  4214. this.ui = ui_UIAddCoin.createInstance();
  4215. this.contentPane = this.ui;
  4216. this.isEject = false;
  4217. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4218. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4219. }
  4220. show() {
  4221. super.show();
  4222. this.ui.t0.play();
  4223. }
  4224. videoAddCoin() {
  4225. console.log('zh:qjff_AD_for_UIAddCoin');
  4226. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4227. }
  4228. else {
  4229. console.log('zh:AD 失败,直接发放奖励');
  4230. this.qjff_AD_for_UIAddCoin();
  4231. }
  4232. }
  4233. qjff_AD_for_UIAddCoin() {
  4234. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4235. this.hide();
  4236. }
  4237. }
  4238. UIAddCoin.uiName = "UIAddCoin";
  4239. class ui_UIInvitation extends fgui.GComponent {
  4240. static createInstance() {
  4241. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4242. }
  4243. onConstruct() {
  4244. this.n14 = (this.getChild("n14"));
  4245. this.myNode = (this.getChild("myNode"));
  4246. this.t0 = this.getTransition("t0");
  4247. }
  4248. }
  4249. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4250. class UIInvitation extends UIBase {
  4251. constructor() {
  4252. super();
  4253. }
  4254. onConstructor() {
  4255. this.ui = ui_UIInvitation.createInstance();
  4256. this.contentPane = this.ui;
  4257. this.isEject = false;
  4258. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4259. }
  4260. show() {
  4261. super.show();
  4262. }
  4263. enterGame() {
  4264. xGame.common.gameMode = GameMode.classic;
  4265. DataMgr.setChallengeTimes(1);
  4266. xGame.common.passAwardCoin = 2000;
  4267. let need = xGame.common.classicNiceNeddCoin;
  4268. if (DataMgr.coinEnough(need)) {
  4269. DataMgr.setCoin(-need);
  4270. xGame.eventMgr.event(RESTART_GAME, true);
  4271. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4272. }
  4273. else {
  4274. xGame.eventMgr.event(RESTART_GAME, true);
  4275. }
  4276. this.hide();
  4277. }
  4278. hide() {
  4279. super.hide();
  4280. }
  4281. }
  4282. UIInvitation.uiName = "UIInvitation";
  4283. class ui_UIMain extends fgui.GComponent {
  4284. static createInstance() {
  4285. return (fgui.UIPackage.createObject("game", "UIMain"));
  4286. }
  4287. onConstruct() {
  4288. this.n47 = (this.getChild("n47"));
  4289. this.n10 = (this.getChild("n10"));
  4290. this.secretary = (this.getChild("secretary"));
  4291. this.shopBtn = (this.getChild("shopBtn"));
  4292. this.moneyNode = (this.getChild("moneyNode"));
  4293. this.headNode = (this.getChild("headNode"));
  4294. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4295. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4296. this.classicBtn = (this.getChild("classicBtn"));
  4297. this.globalBtn = (this.getChild("globalBtn"));
  4298. this.n44 = (this.getChild("n44"));
  4299. this.signBtn = (this.getChild("signBtn"));
  4300. this.drawBtn = (this.getChild("drawBtn"));
  4301. this.settingNode = (this.getChild("settingNode"));
  4302. this.n45 = (this.getChild("n45"));
  4303. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4304. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4305. this.rankBtn = (this.getChild("rankBtn"));
  4306. this.n46 = (this.getChild("n46"));
  4307. this.liucheng1 = (this.getChild("liucheng1"));
  4308. this.rightBtn = (this.getChild("rightBtn"));
  4309. this.n75 = (this.getChild("n75"));
  4310. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4311. this.liucheng2 = (this.getChild("liucheng2"));
  4312. this.guideBtn = (this.getChild("guideBtn"));
  4313. this.n73 = (this.getChild("n73"));
  4314. this.wordsNode = (this.getChild("wordsNode"));
  4315. this.enterGuide = (this.getChild("enterGuide"));
  4316. this.talkNode = (this.getChild("talkNode"));
  4317. this.n83 = (this.getChild("n83"));
  4318. this.n84 = (this.getChild("n84"));
  4319. }
  4320. }
  4321. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4322. class ui_UIMoyu extends fgui.GComponent {
  4323. static createInstance() {
  4324. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4325. }
  4326. onConstruct() {
  4327. this.ageTip = (this.getChild("ageTip"));
  4328. this.mainBg = (this.getChild("mainBg"));
  4329. this.xyNode = (this.getChild("xyNode"));
  4330. this.rnNode = (this.getChild("rnNode"));
  4331. this.fcmNode = (this.getChild("fcmNode"));
  4332. this.ageNode = (this.getChild("ageNode"));
  4333. this.tipNode = (this.getChild("tipNode"));
  4334. this.msgNode = (this.getChild("msgNode"));
  4335. }
  4336. }
  4337. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4338. class MoyuMgr {
  4339. static initMoyu() {
  4340. this.moyuView = new MoyuView();
  4341. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4342. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4343. this.moyuView.ui.displayObject.zOrder = 1000;
  4344. this.moyuView.init();
  4345. this.moyuView.showTip(true);
  4346. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4347. window['XApk'] = this;
  4348. }
  4349. static showAge(show) {
  4350. if (this.moyuView)
  4351. this.moyuView.showAge(show);
  4352. }
  4353. static onPlatMsg(idx) {
  4354. if (!MoyuMgr.moyuView)
  4355. return;
  4356. if (idx == '0') {
  4357. MoyuMgr.moyuView.showTip(false);
  4358. }
  4359. }
  4360. static showAgree(call) {
  4361. if (this.moyuView)
  4362. this.moyuView.showAgree(call);
  4363. else
  4364. call && call();
  4365. }
  4366. static showXy(type = 1) {
  4367. if (this.moyuView)
  4368. this.moyuView.showXy(type);
  4369. }
  4370. }
  4371. MoyuMgr.isAdvise = false;
  4372. class MoyuView {
  4373. constructor() {
  4374. this.ysxyNum = 1;
  4375. this.ysJson = null;
  4376. this.ui = ui_UIMoyu.createInstance();
  4377. }
  4378. init() {
  4379. this.ui.mainBg.visible = false;
  4380. this.ui.xyNode.visible = false;
  4381. this.ui.ageNode.visible = false;
  4382. this.ui.tipNode.visible = false;
  4383. this.ui.rnNode.visible = false;
  4384. this.ui.fcmNode.visible = false;
  4385. this.ui.ageTip.visible = false;
  4386. this.ui.msgNode.visible = false;
  4387. this.ui.visible = false;
  4388. this.ui.xyNode.xyList.setVirtual();
  4389. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4390. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4391. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4392. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4393. this.ui.xyNode.btnKnown.visible = false;
  4394. this.ui.xyNode.xy1.visible = false;
  4395. this.ui.xyNode.xy2.visible = false;
  4396. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4397. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4398. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4399. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4400. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4401. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4402. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4403. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4404. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4405. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4406. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4407. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4408. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4409. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4410. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4411. this.ysxyNum = 2;
  4412. }
  4413. }
  4414. onClick(obj) {
  4415. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4416. switch (obj) {
  4417. case this.ui.ageTip:
  4418. if (Moyu.isTTApk) {
  4419. this.ui.ageNode.visible = true;
  4420. this.ui.mainBg.visible = true;
  4421. }
  4422. break;
  4423. case this.ui.tipNode:
  4424. this.showTip(false);
  4425. break;
  4426. case this.ui.ageNode.btnAge:
  4427. this.ui.ageNode.visible = false;
  4428. this.ui.mainBg.visible = false;
  4429. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4430. this.ui.visible = false;
  4431. break;
  4432. case this.ui.xyNode.btnXy3:
  4433. case this.ui.xyNode.btnXy1:
  4434. this.loadXy(1);
  4435. break;
  4436. case this.ui.xyNode.btnXy2:
  4437. this.loadXy(2);
  4438. break;
  4439. case this.ui.xyNode.btnBack:
  4440. this.ui.xyNode.xy1.visible = true;
  4441. this.ui.xyNode.xy2.visible = false;
  4442. break;
  4443. case this.ui.xyNode.btnKnown:
  4444. this.ui.xyNode.visible = false;
  4445. this.ui.mainBg.visible = false;
  4446. this.ui.visible = false;
  4447. break;
  4448. case this.ui.rnNode.btnCheck:
  4449. this.check();
  4450. break;
  4451. case this.ui.rnNode.btnExit:
  4452. case this.ui.xyNode.btnNo:
  4453. this.ysxyNum--;
  4454. if (this.ysxyNum > 0)
  4455. this.showMsg("Refuse to quit the game once again");
  4456. else {
  4457. Moyu.userAgree(false);
  4458. Moyu.exit();
  4459. }
  4460. break;
  4461. case this.ui.xyNode.btnSure:
  4462. case this.ui.xyNode.btnYes:
  4463. DataMgr.userData.isAgree = true;
  4464. DataMgr.saveUserData();
  4465. this.onAgree();
  4466. break;
  4467. case this.ui.rnNode.btnDone:
  4468. this.ui.rnNode.visible = false;
  4469. this.ui.visible = false;
  4470. break;
  4471. case this.ui.fcmNode.btnRn:
  4472. this.showRn();
  4473. break;
  4474. }
  4475. }
  4476. showTip(show) {
  4477. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4478. return;
  4479. if (show) {
  4480. MoyuMgr.isAdvise = true;
  4481. this.ui.visible = true;
  4482. this.ui.tipNode.visible = true;
  4483. this.ui.tipNode.alpha = 1;
  4484. Laya.timer.once(1000, this, this.showTip, [false]);
  4485. }
  4486. else {
  4487. this.ui.tipNode.alpha = 1;
  4488. this.ui.tipNode.visible = true;
  4489. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4490. this.ui.tipNode.visible = false;
  4491. MoyuMgr.isAdvise = false;
  4492. }), 1000);
  4493. }
  4494. }
  4495. showAge(show, px = 0, py = 0) {
  4496. if (Moyu.platType > 10 && !Moyu.isIos) {
  4497. this.ui.ageTip.x = px;
  4498. this.ui.ageTip.y = py;
  4499. this.ui.ageTip.visible = show;
  4500. if (show)
  4501. this.ui.visible = true;
  4502. }
  4503. }
  4504. showAgree(call) {
  4505. this.agreeCall = call;
  4506. this.onAgree();
  4507. return;
  4508. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4509. this.showXy(0);
  4510. }
  4511. else
  4512. this.onAgree();
  4513. }
  4514. onAgree() {
  4515. if (!this.ui.ageNode.visible)
  4516. this.ui.visible = false;
  4517. this.ui.xyNode.visible = false;
  4518. Moyu.userAgree(true);
  4519. this.showAge(false);
  4520. this.agreeCall && this.agreeCall();
  4521. this.showRn();
  4522. }
  4523. showMsg(txt) {
  4524. this.ui.msgNode.txtMsg.text = txt;
  4525. this.ui.msgNode.visible = true;
  4526. this.ui.msgNode.alpha = 1;
  4527. this.ui.visible = true;
  4528. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4529. this.ui.msgNode.visible = false;
  4530. }), 2500, true);
  4531. }
  4532. showRn() {
  4533. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4534. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4535. this.ui.rnNode.rn1.visible = true;
  4536. this.ui.rnNode.rn2.visible = false;
  4537. this.ui.rnNode.rn3.visible = false;
  4538. this.ui.rnNode.rn4.visible = false;
  4539. this.ui.rnNode.visible = true;
  4540. this.ui.mainBg.visible = true;
  4541. this.ui.rnNode.btnDone.visible = false;
  4542. this.ui.rnNode.btnExit.visible = true;
  4543. this.ui.rnNode.btnCheck.visible = true;
  4544. this.ui.fcmNode.visible = false;
  4545. this.ui.visible = true;
  4546. return;
  4547. }
  4548. }
  4549. this.showFcm();
  4550. }
  4551. showFcm() {
  4552. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4553. Moyu.initFCM(true);
  4554. if (Moyu.gameTime < 1)
  4555. this.fcmLoop();
  4556. else if (Moyu.gameTime < 999)
  4557. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4558. }
  4559. }
  4560. fcmLoop() {
  4561. if (Moyu.gameTime < 1) {
  4562. this.ui.rnNode.visible = false;
  4563. this.ui.fcmNode.visible = true;
  4564. this.ui.mainBg.visible = true;
  4565. this.ui.visible = true;
  4566. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4567. Laya.timer.clear(this.ui, this.fcmLoop);
  4568. }
  4569. }
  4570. check() {
  4571. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4572. this.ui.rnNode.rn1.visible = false;
  4573. this.ui.rnNode.rn2.visible = false;
  4574. this.ui.rnNode.rn4.visible = true;
  4575. }
  4576. else if (this.ui.rnNode.rn4.visible) {
  4577. let name = this.ui.rnNode.inputName.text;
  4578. let code = this.ui.rnNode.inputCode.text;
  4579. if (code && code.length == 18) {
  4580. this.ui.rnNode.rn1.visible = false;
  4581. this.ui.rnNode.rn4.visible = false;
  4582. Moyu.authenticate(name, code, (res) => {
  4583. this.ui.rnNode.rn2.visible = !res;
  4584. this.ui.rnNode.rn3.visible = res;
  4585. this.ui.rnNode.btnDone.visible = res;
  4586. this.ui.rnNode.btnExit.visible = !res;
  4587. this.ui.rnNode.btnCheck.visible = !res;
  4588. if (res)
  4589. this.showFcm();
  4590. });
  4591. }
  4592. else
  4593. this.showMsg("信息填写不完整");
  4594. }
  4595. }
  4596. loadXy(type = 0) {
  4597. this.ui.xyNode.xy1.visible = false;
  4598. this.ui.xyNode.xy2.visible = true;
  4599. this.ui.xyNode.xyList.scrollToView(0);
  4600. if (type == 1) {
  4601. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4602. }
  4603. else if (type == 2) {
  4604. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4605. }
  4606. }
  4607. showXy(type = 0) {
  4608. this.xyBtn();
  4609. if (type == 0) {
  4610. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4611. this.ui.xyNode.btnSure.visible = true;
  4612. }
  4613. else {
  4614. this.ui.xyNode.btnYes.visible = true;
  4615. this.ui.xyNode.btnNo.visible = true;
  4616. }
  4617. }
  4618. else {
  4619. this.ui.xyNode.btnKnown.visible = true;
  4620. this.ui.mainBg.visible = true;
  4621. }
  4622. this.ui.xyNode.xy1.visible = true;
  4623. this.ui.xyNode.xy2.visible = false;
  4624. this.ui.xyNode.visible = true;
  4625. this.ui.visible = true;
  4626. }
  4627. xyBtn() {
  4628. this.ui.xyNode.btnSure.visible = false;
  4629. this.ui.xyNode.btnYes.visible = false;
  4630. this.ui.xyNode.btnNo.visible = false;
  4631. this.ui.xyNode.btnKnown.visible = false;
  4632. {
  4633. this.ui.xyNode.btnXy3.visible = false;
  4634. this.ui.xyNode.btnXy2.visible = true;
  4635. this.ui.xyNode.btnXy1.visible = true;
  4636. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4637. }
  4638. }
  4639. createXY(json) {
  4640. this.ysJson = json.content;
  4641. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4642. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4643. this.ui.xyNode.xy2.visible = true;
  4644. }
  4645. renderListItem(idx, cell) {
  4646. let xy = this.ysJson[idx];
  4647. cell.height = xy.line * 30;
  4648. cell.xyItem.text = xy.text;
  4649. }
  4650. onDestroy() {
  4651. this.agreeCall = null;
  4652. }
  4653. }
  4654. class SettingNode {
  4655. constructor(ui) {
  4656. this.showSetting = false;
  4657. this.openSound = true;
  4658. this.openShake = true;
  4659. this.ui = ui;
  4660. this.ui.soundBtn.onClick(this, this.switchSound);
  4661. this.ui.shakeBtn.onClick(this, this.switchShake);
  4662. this.ui.xyBtn.onClick(this, this.onXy);
  4663. this.ui.clickNode.onClick(this, this.changeSetting);
  4664. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4665. this.ui.xyBtn.visible = false;
  4666. this.ui.shakeBtn.visible = false;
  4667. }
  4668. changeSetting() {
  4669. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4670. this.showSetting = !this.showSetting;
  4671. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4672. }
  4673. switchSound() {
  4674. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4675. this.openSound = !this.openSound;
  4676. Moyu.onSetting(this.openSound, this.openShake);
  4677. xGame.soundMgr.onSetting(this.openSound);
  4678. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4679. }
  4680. switchShake() {
  4681. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4682. this.openShake = !this.openShake;
  4683. Moyu.onSetting(this.openSound, this.openShake);
  4684. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4685. }
  4686. onXy() {
  4687. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4688. MoyuMgr.showXy(1);
  4689. }
  4690. }
  4691. class ui_UILevelDisplay extends fgui.GComponent {
  4692. static createInstance() {
  4693. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4694. }
  4695. onConstruct() {
  4696. this.n9 = (this.getChild("n9"));
  4697. this.myNode = (this.getChild("myNode"));
  4698. this.closeNode = (this.getChild("closeNode"));
  4699. }
  4700. }
  4701. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4702. class ui_UILevelProp extends fgui.GComponent {
  4703. static createInstance() {
  4704. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4705. }
  4706. onConstruct() {
  4707. this.n16 = (this.getChild("n16"));
  4708. this.myNode = (this.getChild("myNode"));
  4709. this.closeBtn = (this.getChild("closeBtn"));
  4710. this.moneyNode = (this.getChild("moneyNode"));
  4711. this.t1 = this.getTransition("t1");
  4712. }
  4713. }
  4714. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4715. class ui_ShowItem extends fgui.GComponent {
  4716. static createInstance() {
  4717. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4718. }
  4719. onConstruct() {
  4720. this.myImg = (this.getChild("myImg"));
  4721. }
  4722. }
  4723. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4724. class ShowItem {
  4725. constructor() {
  4726. this.ui = ui_ShowItem.createInstance();
  4727. }
  4728. destroySelf() {
  4729. if (!this.ui.isDisposed) {
  4730. this.ui.removeFromParent();
  4731. this.ui.dispose();
  4732. }
  4733. }
  4734. setParent(parent) {
  4735. parent.addChild(this.ui);
  4736. }
  4737. setPos(x, y) {
  4738. this.ui.x = x;
  4739. this.ui.y = y;
  4740. }
  4741. setUrl(index) {
  4742. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4743. }
  4744. }
  4745. class ui_UIPower extends fgui.GComponent {
  4746. static createInstance() {
  4747. return (fgui.UIPackage.createObject("game", "UIPower"));
  4748. }
  4749. onConstruct() {
  4750. this.n11 = (this.getChild("n11"));
  4751. this.myNode = (this.getChild("myNode"));
  4752. this.t0 = this.getTransition("t0");
  4753. }
  4754. }
  4755. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4756. class UIPower extends UIBase {
  4757. constructor() {
  4758. super();
  4759. }
  4760. onConstructor() {
  4761. this.ui = ui_UIPower.createInstance();
  4762. this.contentPane = this.ui;
  4763. this.isEject = false;
  4764. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4765. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4766. }
  4767. show() {
  4768. super.show();
  4769. this.ui.t0.play();
  4770. }
  4771. videoGetPower() {
  4772. console.log('zh:qjff_AD_for_uipower');
  4773. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4774. }
  4775. else {
  4776. console.log('zh:AD 失败,直接发放奖励');
  4777. this.qjff_AD_for_uipower();
  4778. }
  4779. }
  4780. qjff_AD_for_uipower() {
  4781. DataMgr.setPower(xGame.common.videoPower, true);
  4782. xGame.eventMgr.event(POWER_TIME);
  4783. this.hide();
  4784. }
  4785. }
  4786. UIPower.uiName = "UIPower";
  4787. class LocalStorageManager {
  4788. test1() {
  4789. LocalStorageManager.setItem("playerName", "Tom");
  4790. LocalStorageManager.setItem("playerLevel", 5);
  4791. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4792. const name = LocalStorageManager.getItem("playerName");
  4793. const level = LocalStorageManager.getItem("playerLevel");
  4794. const data = LocalStorageManager.getItem("playerData");
  4795. console.log(name);
  4796. console.log(level);
  4797. console.log(data);
  4798. LocalStorageManager.removeItem("playerLevel");
  4799. }
  4800. static setItem(key, value) {
  4801. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4802. }
  4803. static getItem(key) {
  4804. const data = Laya.LocalStorage.getItem(key);
  4805. if (data === null)
  4806. return null;
  4807. try {
  4808. return JSON.parse(data);
  4809. }
  4810. catch (e) {
  4811. return data;
  4812. }
  4813. }
  4814. static removeItem(key) {
  4815. Laya.LocalStorage.removeItem(key);
  4816. }
  4817. static clear() {
  4818. Laya.LocalStorage.clear();
  4819. }
  4820. static hasJosnKey(key) {
  4821. var value = Laya.LocalStorage.getJSON(key);
  4822. if (value != null) {
  4823. return true;
  4824. }
  4825. else {
  4826. return false;
  4827. }
  4828. }
  4829. static hasKey(key) {
  4830. return Laya.LocalStorage.getItem(key) !== null;
  4831. }
  4832. }
  4833. class UILevelProp extends UIBase {
  4834. constructor() {
  4835. super();
  4836. this.firstPos = 385;
  4837. this.secondPos = 467;
  4838. this.showItemArr = [];
  4839. }
  4840. onFontLoaded() {
  4841. try {
  4842. this.ui.myNode.conditionTxt.font = "arial";
  4843. console.log("zh: onFontLoaded 设置arial字体成功");
  4844. }
  4845. catch (error) {
  4846. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4847. }
  4848. }
  4849. onConstructor() {
  4850. this.ui = ui_UILevelProp.createInstance();
  4851. this.contentPane = this.ui;
  4852. this.isEject = false;
  4853. this.addUIClick(this.ui.closeBtn, this.hide);
  4854. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4855. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4856. }
  4857. show(level) {
  4858. super.show();
  4859. this.ui.t1.play();
  4860. this.level = level;
  4861. this.data = cfgTable.placeballData[this.level];
  4862. this.updateSelf();
  4863. this.showPreView();
  4864. this.moneyNode.ui.c1.selectedIndex = 2;
  4865. this.moneyNode.checkPowerTime();
  4866. this.moneyNode.powerChange();
  4867. }
  4868. showPreView() {
  4869. let item;
  4870. let data;
  4871. for (let index = 0; index < this.showItemArr.length; index++) {
  4872. item = this.showItemArr[index];
  4873. item.destroySelf();
  4874. }
  4875. this.showItemArr = [];
  4876. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4877. for (const key in cfgData) {
  4878. data = cfgData[key];
  4879. item = new ShowItem();
  4880. item.setParent(this.ui.myNode.displayRoot);
  4881. item.setPos(data.x, data.y);
  4882. item.setUrl(data.value);
  4883. this.showItemArr.push(item);
  4884. }
  4885. }
  4886. updateSelf() {
  4887. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4888. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4889. if (this.data.ball == -1) {
  4890. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4891. }
  4892. else {
  4893. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4894. }
  4895. let localData = DataMgr.getPlaceBallLevel(this.level);
  4896. let getAward = localData.getAward;
  4897. let cfg = cfgTable.placeballData[this.level];
  4898. let coin = this.data.award[0];
  4899. let diamond = this.data.award[1];
  4900. if (cfg.type == PlaceBallType.challenge) {
  4901. diamond = 0;
  4902. coin = 100;
  4903. }
  4904. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4905. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4906. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4907. if (cfg.type == PlaceBallType.challenge) {
  4908. this.ui.myNode.coinNode.numTxt.text = "";
  4909. }
  4910. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4911. if (coin > 0 && diamond > 0) {
  4912. this.ui.myNode.diamondNode.x = 385;
  4913. this.ui.myNode.coinNode.x = 467;
  4914. }
  4915. else {
  4916. this.ui.myNode.diamondNode.x = 385;
  4917. this.ui.myNode.coinNode.x = 385;
  4918. }
  4919. if (!getAward) {
  4920. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4921. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4922. }
  4923. else {
  4924. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4925. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4926. }
  4927. }
  4928. startGame() {
  4929. if (DataMgr.powerEnough()) {
  4930. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  4931. this.ui.myNode.startBtn.touchable = false;
  4932. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4933. console.log('zh:startGame ');
  4934. this.ui.myNode.startBtn.touchable = true;
  4935. DataMgr.setPower(-1);
  4936. xGame.eventMgr.event(POWER_TIME);
  4937. xGame.common.gameMode = GameMode.placeBall;
  4938. xGame.common.placeBallCurLevel = this.level;
  4939. xGame.uiMgr.Show(UIGame);
  4940. this.logEventForChallenge_level_start(this.level);
  4941. xGame.uiMgr.Hide(UILevelDisplay);
  4942. xGame.uiMgr.Hide(UIMain);
  4943. this.hide();
  4944. }));
  4945. }
  4946. else {
  4947. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  4948. xGame.uiMgr.Show(UIPower);
  4949. }
  4950. }
  4951. logEventForChallenge_level_start(level) {
  4952. let keyStr = 'sjmd_challenge_level_start';
  4953. let jsonStr = {
  4954. "count": 1,
  4955. "gold_balance ": DataMgr.getCoin(),
  4956. "level": level,
  4957. "diamond_balance ": DataMgr.getDiamond()
  4958. };
  4959. if (LocalStorageManager.hasJosnKey(keyStr)) {
  4960. const d = LocalStorageManager.getItem(keyStr);
  4961. if (level > d.level) {
  4962. jsonStr.count = d.count + 1;
  4963. LocalStorageManager.setItem(keyStr, jsonStr);
  4964. }
  4965. else {
  4966. }
  4967. }
  4968. else {
  4969. LocalStorageManager.setItem(keyStr, jsonStr);
  4970. }
  4971. const reqStr = JSON.stringify(jsonStr);
  4972. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  4973. }
  4974. hide() {
  4975. super.hide();
  4976. }
  4977. }
  4978. UILevelProp.uiName = "UILevelProp";
  4979. class PutBallLevelDisplay {
  4980. constructor(ui, index) {
  4981. this.index = 0;
  4982. this.ui = ui;
  4983. this.index = index;
  4984. this.ui.onClick(this, this.clickSelf);
  4985. this.updateSelf();
  4986. this.ui.levelTxt.text = (this.index + 1) + "";
  4987. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4988. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4989. }
  4990. updateSelf() {
  4991. let level = this.index + 1;
  4992. this.data = DataMgr.getPlaceBallLevel(level);
  4993. this.ui.starNode.c1.selectedIndex = this.data.star;
  4994. let isChallenge = cfgTable.placeballData[level].type;
  4995. if (this.data.isCur) {
  4996. if (isChallenge) {
  4997. this.ui.c1.selectedIndex = 5;
  4998. }
  4999. else {
  5000. this.ui.c1.selectedIndex = 2;
  5001. }
  5002. }
  5003. else {
  5004. if (this.data.play) {
  5005. if (this.data.star == 3) {
  5006. this.ui.c1.selectedIndex = 0;
  5007. }
  5008. else {
  5009. this.ui.c1.selectedIndex = 1;
  5010. }
  5011. }
  5012. else {
  5013. if (isChallenge) {
  5014. this.ui.c1.selectedIndex = 4;
  5015. }
  5016. else {
  5017. this.ui.c1.selectedIndex = 3;
  5018. }
  5019. }
  5020. }
  5021. }
  5022. clickSelf() {
  5023. if (!this.data.play)
  5024. return;
  5025. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5026. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5027. }
  5028. }
  5029. class UILevelDisplay extends UIBase {
  5030. constructor() {
  5031. super();
  5032. }
  5033. onConstructor() {
  5034. this.ui = ui_UILevelDisplay.createInstance();
  5035. this.contentPane = this.ui;
  5036. this.isEject = false;
  5037. this.myList = this.ui.myNode.myList;
  5038. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5039. this.levelItemArr = [];
  5040. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5041. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5042. this.myList.numItems = levelNum;
  5043. if (Moyu.isKs)
  5044. this.ui.closeNode.closeBtn.x += 100;
  5045. }
  5046. levelItemRender(index, target) {
  5047. let item = new PutBallLevelDisplay(target, index);
  5048. this.levelItemArr.push(item);
  5049. }
  5050. show() {
  5051. super.show();
  5052. this.updateLevel();
  5053. this.scrollToPlace();
  5054. }
  5055. updateLevel() {
  5056. let temp;
  5057. for (let index = 0; index < this.levelItemArr.length; index++) {
  5058. temp = this.levelItemArr[index];
  5059. temp.updateSelf();
  5060. }
  5061. }
  5062. scrollToPlace() {
  5063. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5064. let passArr = DataMgr.getPlaceBallLevelList();
  5065. let offest = passArr.length;
  5066. if (offest >= maxNum - 1)
  5067. offest = maxNum - 1;
  5068. this.myList.scrollToView(offest, true, true);
  5069. }
  5070. hide() {
  5071. super.hide();
  5072. }
  5073. }
  5074. UILevelDisplay.uiName = "UILevelDisplay";
  5075. class ui_UIMatching extends fgui.GComponent {
  5076. static createInstance() {
  5077. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5078. }
  5079. onConstruct() {
  5080. this.n5 = (this.getChild("n5"));
  5081. this.n49 = (this.getChild("n49"));
  5082. this.n51 = (this.getChild("n51"));
  5083. this.n64 = (this.getChild("n64"));
  5084. this.n2 = (this.getChild("n2"));
  5085. this.n53 = (this.getChild("n53"));
  5086. this.n54 = (this.getChild("n54"));
  5087. this.n56 = (this.getChild("n56"));
  5088. this.n58 = (this.getChild("n58"));
  5089. this.n59 = (this.getChild("n59"));
  5090. this.n57 = (this.getChild("n57"));
  5091. this.n60 = (this.getChild("n60"));
  5092. this.n62 = (this.getChild("n62"));
  5093. this.awardTxt = (this.getChild("awardTxt"));
  5094. this.n61 = (this.getChild("n61"));
  5095. this.selfHead = (this.getChild("selfHead"));
  5096. this.aiHead = (this.getChild("aiHead"));
  5097. this.n82 = (this.getChild("n82"));
  5098. this.n84 = (this.getChild("n84"));
  5099. this.n83 = (this.getChild("n83"));
  5100. this.t1 = this.getTransition("t1");
  5101. this.t2 = this.getTransition("t2");
  5102. this.t3 = this.getTransition("t3");
  5103. this.t4 = this.getTransition("t4");
  5104. }
  5105. }
  5106. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5107. class UIMatching extends UIBase {
  5108. constructor() {
  5109. super();
  5110. }
  5111. onConstructor() {
  5112. this.ui = ui_UIMatching.createInstance();
  5113. this.contentPane = this.ui;
  5114. this.isEject = false;
  5115. }
  5116. show(callback) {
  5117. super.show();
  5118. PlatMgr.showBanner(true);
  5119. this.callback = callback;
  5120. let user = Moyu.getUserInfo();
  5121. if (!this.selfPot) {
  5122. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5123. }
  5124. if (!this.aiPot) {
  5125. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5126. }
  5127. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5128. this.ui.selfHead.nameTxt.text = user.nickName;
  5129. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5130. this.ui.aiHead.nameTxt.text = "???";
  5131. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5132. this.ui.selfHead.c1.selectedIndex = 0;
  5133. this.ui.aiHead.c1.selectedIndex = 0;
  5134. this.ui.selfHead.x = this.selfPot.x;
  5135. this.ui.selfHead.y = this.selfPot.y;
  5136. this.ui.aiHead.x = this.aiPot.x;
  5137. this.ui.aiHead.y = this.aiPot.y;
  5138. switch (xGame.common.gameMode) {
  5139. case GameMode.classic:
  5140. break;
  5141. case GameMode.bigMove:
  5142. this.initSkillData();
  5143. break;
  5144. default:
  5145. break;
  5146. }
  5147. this.ui.t1.play(Laya.Handler.create(this, () => {
  5148. this.ui.t2.play(Laya.Handler.create(this, () => {
  5149. switch (xGame.common.gameMode) {
  5150. case GameMode.classic:
  5151. this.waitingPeople();
  5152. break;
  5153. case GameMode.bigMove:
  5154. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5155. break;
  5156. default:
  5157. break;
  5158. }
  5159. }));
  5160. }));
  5161. }
  5162. initSkillData() {
  5163. this.skillSelectData = [];
  5164. let skillUrl = xGame.common.skillIconList;
  5165. let skillName = xGame.common.skillNameList;
  5166. let skillLevel = DataMgr.getBigSkillList();
  5167. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5168. for (let index = 0; index < 5; index++) {
  5169. let obj = {};
  5170. obj.skillImg = skillUrl[index];
  5171. obj.skillName = skillName[index];
  5172. obj.skillType = skillType[index];
  5173. obj.skillLevel = skillLevel[index];
  5174. this.skillSelectData.push(obj);
  5175. }
  5176. }
  5177. getAISkillLevel(myLevel) {
  5178. let video = xGame.common.upSkillLevel;
  5179. let aiLevel;
  5180. let temp;
  5181. if (video) {
  5182. temp = xGame.common.randomNum(-2, -1);
  5183. }
  5184. else {
  5185. if (myLevel <= 5) {
  5186. temp = xGame.common.randomNum(1, 3);
  5187. }
  5188. else if (myLevel <= 9) {
  5189. temp = xGame.common.randomNum(-2, 1);
  5190. }
  5191. else {
  5192. temp = xGame.common.randomNum(-4, 0);
  5193. }
  5194. }
  5195. aiLevel = temp + myLevel;
  5196. if (aiLevel <= 1)
  5197. aiLevel = 1;
  5198. if (aiLevel >= 10)
  5199. aiLevel = 10;
  5200. return aiLevel;
  5201. }
  5202. getAISkillType() {
  5203. return xGame.common.randomNum(1, 4);
  5204. let successTimes = DataMgr.getSkillSuccessTimes();
  5205. let info = cfgTable.aiskillData[successTimes];
  5206. if (!info) {
  5207. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5208. info = cfgTable.aiskillData[max];
  5209. }
  5210. let dataArr = info.skillselect;
  5211. let myCfg = {};
  5212. for (let index = 0; index < dataArr.length; index++) {
  5213. let temp = dataArr[index].split('-');
  5214. myCfg[temp[0]] = {};
  5215. myCfg[temp[0]].id = parseInt(temp[0]);
  5216. myCfg[temp[0]].weight = parseInt(temp[1]);
  5217. }
  5218. let aiCfg = xGame.common.initWeight(myCfg);
  5219. let curData = xGame.common.getRandomWeightData(aiCfg);
  5220. return parseInt(curData.id);
  5221. }
  5222. getAISkillData(index) {
  5223. let myLevel = this.skillSelectData[index].skillLevel;
  5224. let aiLevel = this.getAISkillLevel(myLevel);
  5225. let aiType = this.getAISkillType() - 1;
  5226. return { aiLevel, aiType } = { aiLevel, aiType };
  5227. }
  5228. skillSelectFinish(index) {
  5229. let aiInfo = this.getAISkillData(index);
  5230. xGame.common.gameMgr.selfCurSkill = index;
  5231. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5232. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5233. this.ui.selfHead.c1.selectedIndex = 1;
  5234. this.ui.aiHead.c1.selectedIndex = 1;
  5235. let myData = this.skillSelectData[index];
  5236. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5237. let guide = DataMgr.getSkillGuide();
  5238. if (guide == 0) {
  5239. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5240. }
  5241. else {
  5242. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5243. }
  5244. let aiData = this.skillSelectData[aiInfo.aiType];
  5245. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5246. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5247. this.waitingPeople();
  5248. }
  5249. waitingPeople() {
  5250. let time = xGame.common.randomNum(1000, 3000);
  5251. time += 1000;
  5252. Laya.timer.once(time, this, () => {
  5253. this.matchingSuccess();
  5254. });
  5255. }
  5256. matchingSuccess() {
  5257. let gameUI = xGame.common.gameUI;
  5258. let name = gameUI.ui.topNode.aiNameTxt.text;
  5259. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5260. this.ui.aiHead.nameTxt.text = name;
  5261. this.ui.aiHead.headImg.url = url;
  5262. name = gameUI.ui.topNode.selfNameTxt.text;
  5263. url = gameUI.ui.topNode.selfHeadLoader.url;
  5264. this.ui.selfHead.nameTxt.text = name;
  5265. this.ui.selfHead.headImg.url = url;
  5266. this.ui.t3.play(Laya.Handler.create(this, () => {
  5267. this.callback && this.callback();
  5268. this.ui.t4.play(Laya.Handler.create(this, () => {
  5269. this.destroySelf();
  5270. }));
  5271. }));
  5272. }
  5273. destroySelf() {
  5274. this.callback = null;
  5275. this.skillSelectData = null;
  5276. this.selfPot = null;
  5277. this.aiPot = null;
  5278. if (!this.ui.isDisposed) {
  5279. this.ui.removeFromParent();
  5280. this.ui.dispose();
  5281. }
  5282. xGame.uiMgr.destroyUI(this);
  5283. }
  5284. }
  5285. UIMatching.uiName = "UIMatching";
  5286. class ui_UIRanking extends fgui.GComponent {
  5287. static createInstance() {
  5288. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5289. }
  5290. onConstruct() {
  5291. this.n26 = (this.getChild("n26"));
  5292. this.myNode = (this.getChild("myNode"));
  5293. }
  5294. }
  5295. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5296. class UIRanking extends UIBase {
  5297. constructor() {
  5298. super();
  5299. this.showSelf = true;
  5300. this.rankType = 1;
  5301. this.rankList = [];
  5302. this.topX = 10;
  5303. this.myIndex = this.topX + 1;
  5304. this.myStar = 0;
  5305. }
  5306. onConstructor() {
  5307. this.ui = ui_UIRanking.createInstance();
  5308. this.contentPane = this.ui;
  5309. this.isEject = false;
  5310. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5311. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5312. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5313. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5314. this.ui.myNode.myList.setVirtual();
  5315. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5316. }
  5317. show() {
  5318. super.show();
  5319. this.getPaiHangBangDataFormJosnFile();
  5320. this.updateSelf();
  5321. let self = Moyu.getUserInfo();
  5322. if (!self.isAuth) {
  5323. Moyu.initUser(this, () => {
  5324. DataMgr.upRankData();
  5325. });
  5326. }
  5327. }
  5328. getPaiHangBangDataFormJosnFile() {
  5329. const rankingList = cfgTable.paiHangBangData.list;
  5330. this.updateItemData(rankingList);
  5331. }
  5332. updateSelfItem() {
  5333. console.log('zh:Moyu.platType =' + Moyu.platType);
  5334. let self = Moyu.getUserInfo();
  5335. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5336. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5337. if (this.myIndex > this.topX) {
  5338. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5339. }
  5340. else {
  5341. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5342. }
  5343. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5344. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5345. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5346. }
  5347. updateItemData(data) {
  5348. this.myStar = xGame.common.getAllStarNum();
  5349. if (this.rankList.length < 2) {
  5350. this.rankList = data;
  5351. let self = Moyu.getUserInfo();
  5352. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5353. self.headIcon = self.headIcon;
  5354. for (let i = 0; i < data.length; i++) {
  5355. let data = this.rankList[i];
  5356. if (data.userId == self.userId) {
  5357. this.rankList.splice(i, 1);
  5358. break;
  5359. }
  5360. }
  5361. for (let i = 0; i < data.length; i++) {
  5362. let data = this.rankList[i];
  5363. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5364. this.myIndex = i + 1;
  5365. let user = { headIcon: self.headIcon, nickName: "myself" };
  5366. let ud = { user: user, data: {} };
  5367. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5368. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5369. if (Moyu.platType < 11) {
  5370. user.headIcon = self.headIcon;
  5371. user.nickName = self.nickName;
  5372. }
  5373. this.rankList.splice(i, 0, md);
  5374. break;
  5375. }
  5376. }
  5377. }
  5378. this.updateSelfItem();
  5379. this.ui.myNode.myList.numItems = this.rankList.length;
  5380. }
  5381. updateItemUI(index, obj) {
  5382. let data = this.rankList[index];
  5383. let userData = JSON.parse(data.userData).user;
  5384. obj.nameTxt.text = userData.nickName.toString();
  5385. obj.valueTxt.text = data.rankScore;
  5386. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5387. obj.rankTxt.text = index + 1;
  5388. switch (index) {
  5389. case 0:
  5390. this.setImg(obj, 1, 0, 0);
  5391. obj.rankTxt.color = "#FFC047";
  5392. break;
  5393. case 1:
  5394. this.setImg(obj, 0, 1, 0);
  5395. obj.rankTxt.color = "#ACACAC";
  5396. break;
  5397. case 2:
  5398. this.setImg(obj, 0, 0, 1);
  5399. obj.rankTxt.color = "#D09672";
  5400. break;
  5401. default:
  5402. this.setImg(obj, 0, 0, 0);
  5403. obj.rankTxt.color = "#496FAB";
  5404. break;
  5405. }
  5406. }
  5407. setImg(obj, a, b, c) {
  5408. obj.img1.visible = a ? true : false;
  5409. obj.img2.visible = b ? true : false;
  5410. obj.img3.visible = c ? true : false;
  5411. }
  5412. changeList(type) {
  5413. this.rankType = type;
  5414. this.updateSelf();
  5415. }
  5416. changeSelfNode() {
  5417. this.showSelf = !this.showSelf;
  5418. this.updateSelf();
  5419. }
  5420. updateSelf() {
  5421. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5422. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5423. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5424. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5425. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5426. }
  5427. }
  5428. UIRanking.uiName = "UIRanking";
  5429. class ui_UISecretary extends fgui.GComponent {
  5430. static createInstance() {
  5431. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5432. }
  5433. onConstruct() {
  5434. this.n0 = (this.getChild("n0"));
  5435. this.myNode = (this.getChild("myNode"));
  5436. this.closeBtn = (this.getChild("closeBtn"));
  5437. this.t0 = this.getTransition("t0");
  5438. }
  5439. }
  5440. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5441. class UISecretary extends UIBase {
  5442. constructor() {
  5443. super();
  5444. this.curIndex = 1;
  5445. }
  5446. onConstructor() {
  5447. this.ui = ui_UISecretary.createInstance();
  5448. this.contentPane = this.ui;
  5449. this.isEject = false;
  5450. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5451. this.nodeObj = { left: null, right: null, cur: null };
  5452. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5453. }
  5454. show() {
  5455. super.show();
  5456. this.ui.t0.play();
  5457. this.updateData();
  5458. }
  5459. addSecretarySpine(node, spineName) {
  5460. if (spineName == "mishu") {
  5461. if (this.secretarySpine1) {
  5462. node.displayObject.destroyChildren();
  5463. this.playWoman(this.secretarySpine1, node.displayObject);
  5464. }
  5465. else {
  5466. let spine1 = new SpineMgr("mishu", () => {
  5467. this.secretarySpine1 = spine1;
  5468. this.playWoman(this.secretarySpine1, node.displayObject);
  5469. });
  5470. }
  5471. }
  5472. else {
  5473. if (this.secretarySpine2) {
  5474. node.displayObject.destroyChildren();
  5475. this.playWoman(this.secretarySpine2, node.displayObject);
  5476. }
  5477. else {
  5478. let spine2 = new SpineMgr("xiaomishu2", () => {
  5479. this.secretarySpine2 = spine2;
  5480. this.playWoman(this.secretarySpine2, node.displayObject);
  5481. });
  5482. }
  5483. }
  5484. }
  5485. playWoman(node, parent) {
  5486. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5487. let yy = this.ui.myNode.gameNode3.secretary.height;
  5488. let scale = 1.5;
  5489. if (node == this.secretarySpine2) {
  5490. scale = 1.2;
  5491. }
  5492. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5493. node.play(data, 0, true, parent);
  5494. }
  5495. turnLeft() {
  5496. this.curIndex--;
  5497. if (this.curIndex < 1) {
  5498. this.curIndex = 2;
  5499. }
  5500. let left = this.nodeObj.left;
  5501. let right = this.nodeObj.right;
  5502. let cur = this.nodeObj.cur;
  5503. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5504. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5505. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5506. this.updateData();
  5507. }));
  5508. this.ui.myNode.setChildIndex(right, 2);
  5509. this.nodeObj.left = cur;
  5510. this.nodeObj.right = left;
  5511. this.nodeObj.cur = right;
  5512. }
  5513. turnRight() {
  5514. this.curIndex++;
  5515. if (this.curIndex > 2) {
  5516. this.curIndex = 1;
  5517. }
  5518. let left = this.nodeObj.left;
  5519. let right = this.nodeObj.right;
  5520. let cur = this.nodeObj.cur;
  5521. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5522. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5523. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5524. this.updateData();
  5525. }));
  5526. this.ui.myNode.setChildIndex(left, 2);
  5527. this.nodeObj.left = right;
  5528. this.nodeObj.right = cur;
  5529. this.nodeObj.cur = left;
  5530. }
  5531. updateData() {
  5532. console.log('zh: updateData FFFFFFFFFF');
  5533. let data = cfgTable.secretaryshopData;
  5534. let children = this.ui.myNode._children;
  5535. let temp;
  5536. let curData;
  5537. for (let index = 0; index < children.length; index++) {
  5538. temp = children[index];
  5539. curData = data[1];
  5540. temp.heightTxt.text = curData.height;
  5541. temp.foodTxt.text = curData.food;
  5542. temp.historyTxt.text = curData.history;
  5543. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5544. this.addSecretarySpine(temp.secretary, curData.spine);
  5545. let womanIndex = curData.id - 1;
  5546. let getWoman = DataMgr.getSecretary(womanIndex);
  5547. let curUse = DataMgr.getCurSecretary();
  5548. if (getWoman) {
  5549. if (curUse == womanIndex) {
  5550. temp.purchaseBtn.c1.selectedIndex = 1;
  5551. }
  5552. else {
  5553. temp.purchaseBtn.c1.selectedIndex = 2;
  5554. }
  5555. }
  5556. else {
  5557. temp.purchaseBtn.c1.selectedIndex = 0;
  5558. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5559. }
  5560. temp.purchaseBtn.visible = false;
  5561. }
  5562. }
  5563. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5564. console.log('zh: 点击了clickSecretary ');
  5565. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5566. if (getWoman) {
  5567. if (curUse != womanIndex) {
  5568. console.log();
  5569. DataMgr.setCurSecretary(womanIndex);
  5570. this.updateData();
  5571. }
  5572. }
  5573. else {
  5574. console.log('zh:点击购买了');
  5575. let need = needDiamond;
  5576. if (DataMgr.diamondEnough(need)) {
  5577. DataMgr.setDiamond(-need);
  5578. DataMgr.setSecretary(womanIndex, 1);
  5579. DataMgr.setCurSecretary(womanIndex);
  5580. this.updateData();
  5581. }
  5582. else {
  5583. xGame.uiMgr.Show(UIAddProp, 1);
  5584. }
  5585. }
  5586. }
  5587. closeSelf() {
  5588. this.hide();
  5589. }
  5590. }
  5591. UISecretary.uiName = "UISecretary";
  5592. class ui_UIShop extends fgui.GComponent {
  5593. static createInstance() {
  5594. return (fgui.UIPackage.createObject("game", "UIShop"));
  5595. }
  5596. onConstruct() {
  5597. this.n48 = (this.getChild("n48"));
  5598. this.n0 = (this.getChild("n0"));
  5599. this.secretary = (this.getChild("secretary"));
  5600. this.talkNode = (this.getChild("talkNode"));
  5601. this.closeNode = (this.getChild("closeNode"));
  5602. this.moneyNode = (this.getChild("moneyNode"));
  5603. this.myNode = (this.getChild("myNode"));
  5604. }
  5605. }
  5606. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5607. class BallRodDisplay {
  5608. constructor(ui, index) {
  5609. this.index = 0;
  5610. this.uiIndex = 0;
  5611. this.ui = ui;
  5612. this.index = index;
  5613. this.initData();
  5614. }
  5615. initData() {
  5616. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5617. let data = cfgTable.ballrodData[this.index + 1];
  5618. this.ui.nameTxt.text = data.name;
  5619. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5620. this.ui.levelNode.c1.selectedIndex = data.quality;
  5621. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5622. if (data.spine) {
  5623. this.mySpine = new SpineMgr(data.spine, () => {
  5624. let xx = 150;
  5625. let yy = 70;
  5626. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5627. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5628. });
  5629. }
  5630. }
  5631. updateSelf() {
  5632. console.log('zh:updateSelf -------------- ');
  5633. let get = DataMgr.getBallRod(this.index);
  5634. if (get == null)
  5635. get = 1;
  5636. let curUse = DataMgr.getCurBallRod();
  5637. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5638. if (get) {
  5639. if (curUse == this.index) {
  5640. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5641. }
  5642. else {
  5643. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5644. }
  5645. }
  5646. else {
  5647. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5648. }
  5649. }
  5650. buyBallRod() {
  5651. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5652. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5653. switch (selectedIndex) {
  5654. case 0:
  5655. break;
  5656. case 1:
  5657. console.log('zh:点击了 USE THIS');
  5658. DataMgr.setCurBallRod(this.index);
  5659. let curUse = DataMgr.getCurBallRod();
  5660. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5661. let ui = xGame.uiMgr.getUI(UIShop);
  5662. ui.updateBallRod();
  5663. break;
  5664. case 2:
  5665. let data = cfgTable.ballrodData[this.index + 1];
  5666. let need = data.price;
  5667. if (DataMgr.diamondEnough(need)) {
  5668. DataMgr.setDiamond(-need);
  5669. DataMgr.setBallRod(this.index, 1);
  5670. DataMgr.setCurBallRod(this.index);
  5671. let ui = xGame.uiMgr.getUI(UIShop);
  5672. ui.updateBallRod();
  5673. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5674. }
  5675. else {
  5676. xGame.uiMgr.Show(UIAddProp, 1);
  5677. }
  5678. break;
  5679. default:
  5680. break;
  5681. }
  5682. }
  5683. logEventForGouMaiGan(qiuGanName) {
  5684. const ev = {
  5685. value: qiuGanName
  5686. };
  5687. const jsonStr = JSON.stringify(ev);
  5688. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5689. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5690. }
  5691. }
  5692. class UIShop extends UIBase {
  5693. constructor() {
  5694. super();
  5695. this.itemNums = 0;
  5696. }
  5697. onConstructor() {
  5698. this.ui = ui_UIShop.createInstance();
  5699. this.contentPane = this.ui;
  5700. this.isEject = false;
  5701. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5702. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5703. this.addUIClick(this.ui, this.interuptSecretary);
  5704. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5705. this.ballRodArr = [];
  5706. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5707. this.ui.myNode.myList.numItems = this.itemNums;
  5708. if (Moyu.isKs)
  5709. this.ui.closeNode.closeBtn.x += 100;
  5710. }
  5711. show() {
  5712. super.show();
  5713. this.playSecretaryIdle();
  5714. this.updateBallRod();
  5715. }
  5716. updateBallRod() {
  5717. for (let index = 0; index < this.ballRodArr.length; index++) {
  5718. this.ballRodArr[index].updateSelf();
  5719. }
  5720. }
  5721. renderBallRod(sort, obj) {
  5722. let index = this.getIndexBySort(sort + 1) - 1;
  5723. let ballRod = new BallRodDisplay(obj, index);
  5724. this.ballRodArr.push(ballRod);
  5725. }
  5726. getIndexBySort(sort) {
  5727. let object = cfgTable.ballrodData;
  5728. for (const key in object) {
  5729. if (object[key].sort == sort) {
  5730. return parseInt(key);
  5731. }
  5732. }
  5733. }
  5734. playSecretaryIdle() {
  5735. let parent = this.ui.secretary.displayObject;
  5736. parent.destroyChildren();
  5737. let xx = this.ui.secretary.width / 2;
  5738. let yy = this.ui.secretary.height;
  5739. let scale = xGame.common.getSecretaryScale();
  5740. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5741. xGame.common.secretary.play(data, 0, true, parent);
  5742. }
  5743. interuptSecretary() {
  5744. Laya.timer.clearAll(this);
  5745. this.playSecretaryRandomSound();
  5746. }
  5747. playSecretaryRandomSound() {
  5748. if (this.isHide)
  5749. return;
  5750. let time = xGame.common.randomNum(45000, 60000);
  5751. Laya.timer.once(time, this, () => {
  5752. if (this.isHide)
  5753. return;
  5754. let index = xGame.common.randomNum(4, 7);
  5755. xGame.soundMgr.playSound("s_main0" + index);
  5756. let words = 1;
  5757. switch (index) {
  5758. case 4:
  5759. words = 5;
  5760. break;
  5761. case 5:
  5762. words = 3;
  5763. break;
  5764. case 6:
  5765. words = 6;
  5766. break;
  5767. case 7:
  5768. words = 7;
  5769. break;
  5770. default:
  5771. break;
  5772. }
  5773. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5774. this.playSecretaryRandomSound();
  5775. });
  5776. }
  5777. closeSelf() {
  5778. this.hide();
  5779. }
  5780. }
  5781. UIShop.uiName = "UIShop";
  5782. class ui_UISign extends fgui.GComponent {
  5783. static createInstance() {
  5784. return (fgui.UIPackage.createObject("game", "UISign"));
  5785. }
  5786. onConstruct() {
  5787. this.n6 = (this.getChild("n6"));
  5788. this.closeNode = (this.getChild("closeNode"));
  5789. this.myNode = (this.getChild("myNode"));
  5790. this.moneyNode = (this.getChild("moneyNode"));
  5791. this.secretary = (this.getChild("secretary"));
  5792. this.talkNode = (this.getChild("talkNode"));
  5793. this.tripleBtn = (this.getChild("tripleBtn"));
  5794. this.normalBtn = (this.getChild("normalBtn"));
  5795. this.tipsNode = (this.getChild("tipsNode"));
  5796. this.againBtn = (this.getChild("againBtn"));
  5797. this.t0 = this.getTransition("t0");
  5798. }
  5799. }
  5800. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5801. class SignMax {
  5802. constructor(ui) {
  5803. this.ui = ui;
  5804. }
  5805. updateSelf(index, sameDay, curDayIndex) {
  5806. let data = cfgTable.signData[index + 1];
  5807. this.ui.titleTxt.text = data.title;
  5808. let arr1 = data.award[0].split('-');
  5809. let arr2 = data.award[1].split('-');
  5810. let num1 = parseInt(arr1[1]);
  5811. let num2 = parseInt(arr2[1]);
  5812. this.ui.numTxt1.text = num1 + "";
  5813. this.ui.numTxt2.text = num2 + "";
  5814. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5815. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5816. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5817. this.ui.numTxt1.visible = false;
  5818. }
  5819. else {
  5820. this.ui.numTxt1.visible = true;
  5821. }
  5822. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5823. this.ui.numTxt2.visible = false;
  5824. }
  5825. else {
  5826. this.ui.numTxt2.visible = true;
  5827. }
  5828. if (index < curDayIndex) {
  5829. this.ui.c1.selectedIndex = 1;
  5830. }
  5831. else if (index == curDayIndex) {
  5832. if (sameDay) {
  5833. this.ui.c1.selectedIndex = 2;
  5834. }
  5835. else {
  5836. this.ui.c1.selectedIndex = 2;
  5837. }
  5838. }
  5839. else {
  5840. this.ui.c1.selectedIndex = 0;
  5841. }
  5842. }
  5843. }
  5844. class SignNormal {
  5845. constructor(ui) {
  5846. this.ui = ui;
  5847. }
  5848. updateSelf(index, sameDay, curDayIndex) {
  5849. let data = cfgTable.signData[index + 1];
  5850. this.ui.titleTxt.text = data.title;
  5851. let arr = data.award[0].split('-');
  5852. let type = parseInt(arr[0]);
  5853. let num = parseInt(arr[1]);
  5854. this.ui.numTxt.text = num + "";
  5855. if (type > 2) {
  5856. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5857. this.ui.myIcon.rotation = 0;
  5858. }
  5859. else {
  5860. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5861. this.ui.myIcon.rotation = 0;
  5862. }
  5863. if (xGame.common.signAwardContainsRod(data.award)) {
  5864. this.ui.numTxt.visible = false;
  5865. }
  5866. else {
  5867. this.ui.numTxt.visible = true;
  5868. }
  5869. if (index < curDayIndex) {
  5870. this.ui.c1.selectedIndex = 1;
  5871. }
  5872. else if (index == curDayIndex) {
  5873. if (sameDay) {
  5874. this.ui.c1.selectedIndex = 2;
  5875. }
  5876. else {
  5877. this.ui.c1.selectedIndex = 2;
  5878. }
  5879. }
  5880. else {
  5881. this.ui.c1.selectedIndex = 0;
  5882. }
  5883. }
  5884. }
  5885. class UISign extends UIBase {
  5886. constructor() {
  5887. super();
  5888. this.curDayIndex = 0;
  5889. this.starX = 0;
  5890. }
  5891. onConstructor() {
  5892. this.ui = ui_UISign.createInstance();
  5893. this.contentPane = this.ui;
  5894. this.isEject = false;
  5895. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5896. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5897. this.initSignItem();
  5898. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5899. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5900. }
  5901. show() {
  5902. super.show();
  5903. this.ui.t0.play();
  5904. this.playSecretaryIdle();
  5905. this.updateSign();
  5906. }
  5907. initSignItem() {
  5908. this.signArr = [];
  5909. for (let index = 0; index < 6; index++) {
  5910. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5911. this.signArr.push(temp);
  5912. }
  5913. this.signMax = new SignMax(this.ui.myNode.day7);
  5914. if (Moyu.isKs)
  5915. this.ui.closeNode.closeBtn.x += 100;
  5916. }
  5917. updateSign() {
  5918. let sameDay = xGame.common.judgeSameDay();
  5919. let max = 7;
  5920. this.curDayIndex = DataMgr.getSignData();
  5921. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5922. this.curDayIndex = 0;
  5923. if (!sameDay) {
  5924. this.ui.normalBtn.visible = true;
  5925. this.ui.tipsNode.visible = false;
  5926. this.ui.againBtn.visible = false;
  5927. }
  5928. else {
  5929. this.ui.normalBtn.visible = false;
  5930. let again = DataMgr.getExtraSign();
  5931. let isCurrency = false;
  5932. let index = this.curDayIndex;
  5933. if (index == 0)
  5934. index = 7;
  5935. let award = cfgTable.signData[index].award;
  5936. let num = award[0].split("-")[0];
  5937. if (num == "1" || num == "2")
  5938. isCurrency = true;
  5939. let showAgain = again == 0 && isCurrency;
  5940. this.ui.againBtn.visible = showAgain;
  5941. this.ui.tipsNode.visible = !showAgain;
  5942. }
  5943. for (let index = 0; index < this.signArr.length; index++) {
  5944. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5945. }
  5946. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5947. }
  5948. playSecretaryIdle() {
  5949. let parent = this.ui.secretary.displayObject;
  5950. parent.destroyChildren();
  5951. let xx = this.ui.secretary.width / 2;
  5952. let yy = this.ui.secretary.height;
  5953. let scale = xGame.common.getSecretaryScale();
  5954. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5955. xGame.common.secretary.play(data, 0, true, parent);
  5956. }
  5957. closeSelf() {
  5958. this.hide();
  5959. }
  5960. normalGetAward() {
  5961. let sameDay = xGame.common.judgeSameDay();
  5962. if (!sameDay) {
  5963. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5964. let temp;
  5965. let type;
  5966. let num;
  5967. let arr = [];
  5968. for (let index = 0; index < award.length; index++) {
  5969. temp = award[index].split("-");
  5970. type = parseInt(temp[0]);
  5971. num = parseInt(temp[1]);
  5972. let awardType = new AwardType();
  5973. awardType.num = num;
  5974. awardType.type = type;
  5975. arr.push(awardType);
  5976. }
  5977. xGame.common.getAward(arr, (watchVideo) => {
  5978. this.curDayIndex++;
  5979. if (this.curDayIndex > 7)
  5980. this.curDayIndex = 0;
  5981. DataMgr.setSignData(this.curDayIndex);
  5982. DataMgr.setSignTime(new Date().getTime());
  5983. if (watchVideo) {
  5984. DataMgr.setExtraSign(1);
  5985. Moyu.sendDataEvent("signIn1");
  5986. }
  5987. this.updateSign();
  5988. });
  5989. }
  5990. }
  5991. againGetAward() {
  5992. Moyu.sendDataEvent("signIn2");
  5993. console.log('zh:qjff_AD_for_uisign');
  5994. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5995. }
  5996. else {
  5997. console.log('zh:AD 失败,直接发放奖励');
  5998. this.qjff_AD_for_uisign();
  5999. }
  6000. }
  6001. qjff_AD_for_uisign() {
  6002. let index = this.curDayIndex;
  6003. if (index == 0)
  6004. index = 7;
  6005. let award = cfgTable.signData[index].award;
  6006. let temp;
  6007. let type;
  6008. let num;
  6009. for (let index = 0; index < award.length; index++) {
  6010. temp = award[index].split("-");
  6011. type = parseInt(temp[0]);
  6012. num = parseInt(temp[1]) * 3;
  6013. xGame.common.playObjFlyAnim(num, type);
  6014. }
  6015. DataMgr.setExtraSign(1);
  6016. this.updateSign();
  6017. }
  6018. }
  6019. UISign.uiName = "UISign";
  6020. class ui_UISkill extends fgui.GComponent {
  6021. static createInstance() {
  6022. return (fgui.UIPackage.createObject("game", "UISkill"));
  6023. }
  6024. onConstruct() {
  6025. this.n48 = (this.getChild("n48"));
  6026. this.n0 = (this.getChild("n0"));
  6027. this.secretary = (this.getChild("secretary"));
  6028. this.talkNode = (this.getChild("talkNode"));
  6029. this.closeNode = (this.getChild("closeNode"));
  6030. this.moneyNode = (this.getChild("moneyNode"));
  6031. this.skillNode = (this.getChild("skillNode"));
  6032. this.guideNode = (this.getChild("guideNode"));
  6033. }
  6034. }
  6035. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6036. class SkillDisplay {
  6037. constructor(ui, data, uiIndex) {
  6038. this.starX = 0;
  6039. this.starY = 0;
  6040. this.index = 0;
  6041. this.ui = ui;
  6042. this.data = data;
  6043. this.index = uiIndex;
  6044. this.initSelf();
  6045. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6046. }
  6047. initSelf() {
  6048. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6049. this.ui.nameTxt.text = this.data.name;
  6050. this.ui.describeTxt.text = this.data.describe;
  6051. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6052. this.ui.startBtn.onClick(this, this.startGame);
  6053. this.updateSelf();
  6054. }
  6055. updateSelf() {
  6056. this.checkTry();
  6057. let level = DataMgr.getBigSkillByIndex(this.index);
  6058. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6059. }
  6060. checkTry() {
  6061. let index = this.index;
  6062. let level = DataMgr.getBigSkillByIndex(index);
  6063. if (level == null) {
  6064. DataMgr.setBigSkill(index, 1, false);
  6065. level = 1;
  6066. }
  6067. this.ui.levelTxt.text = "LV." + level;
  6068. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6069. this.ui.tryNode.visible = true;
  6070. else
  6071. this.ui.tryNode.visible = false;
  6072. }
  6073. clickAddLevel() {
  6074. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6075. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6076. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6077. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6078. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6079. }
  6080. else {
  6081. console.log('zh:AD 失败,直接发放奖励');
  6082. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6083. }
  6084. }
  6085. qjff_AD_for_skilldisplay_clickAddLevel() {
  6086. DataMgr.setBigSkill(this.data.index, 1);
  6087. this.updateSelf();
  6088. xGame.common.upSkillLevel = true;
  6089. }
  6090. startGame() {
  6091. console.log('zh:rod skill startgame');
  6092. if (this.data.index == 3) {
  6093. alert('Coming soon!');
  6094. return;
  6095. }
  6096. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6097. let needCoin = xGame.common.bigMoveNeedCoin;
  6098. xGame.common.passAwardCoin = 2000;
  6099. let guide = DataMgr.getSkillGuide();
  6100. console.log('zh:startGame guide=' + guide);
  6101. xGame.common.temSelfLevel = 0;
  6102. if (guide == 0) {
  6103. needCoin = 0;
  6104. xGame.common.temSelfLevel = 100;
  6105. }
  6106. if (DataMgr.coinEnough(needCoin)) {
  6107. DataMgr.setCoin(-needCoin);
  6108. xGame.common.curPlayerSkillType = this.index;
  6109. if (guide == 0)
  6110. xGame.common.curPlayerSkillType = 0;
  6111. console.log('zh: skilldisplay 1');
  6112. xGame.uiMgr.Show(UIGame);
  6113. xGame.uiMgr.Hide(UIMain);
  6114. xGame.uiMgr.Show(UIMatching, () => {
  6115. xGame.common.gameUI.ui.alpha = 1;
  6116. xGame.common.gameUI.startGame();
  6117. xGame.uiMgr.Hide(UISkill);
  6118. });
  6119. this.logEventForRod_start();
  6120. }
  6121. else {
  6122. console.log('zh: skilldisplay 2');
  6123. xGame.uiMgr.Show(UIAddProp, 0);
  6124. Moyu.sendDataEvent("AddCoinVideo");
  6125. }
  6126. }
  6127. logEventForRod_start() {
  6128. let gfmsIdx = xGame.common.curPlayerSkillType;
  6129. console.log('zh:选择的技能=' + gfmsIdx);
  6130. let gfmc = 'Skyfall Shot';
  6131. if (gfmsIdx == 0) {
  6132. gfmc = 'Skyfall Shot';
  6133. }
  6134. if (gfmsIdx == 1) {
  6135. gfmc = 'Surging break';
  6136. }
  6137. if (gfmsIdx == 2) {
  6138. gfmc = 'Frost Lock';
  6139. }
  6140. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6141. let jsonStr = {
  6142. "count": 0,
  6143. "name": gfmc
  6144. };
  6145. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6146. const d = LocalStorageManager.getItem(keyStr);
  6147. jsonStr.count = d.count + 1;
  6148. LocalStorageManager.setItem(keyStr, jsonStr);
  6149. }
  6150. else {
  6151. LocalStorageManager.setItem(keyStr, jsonStr);
  6152. }
  6153. const reqStr = JSON.stringify(jsonStr);
  6154. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6155. }
  6156. }
  6157. class UISkill extends UIBase {
  6158. constructor() {
  6159. super();
  6160. this.skillData = [];
  6161. }
  6162. onConstructor() {
  6163. this.ui = ui_UISkill.createInstance();
  6164. this.contentPane = this.ui;
  6165. this.isEject = false;
  6166. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6167. this.initSkillData();
  6168. console.log('zh:aaaaaa1111111111');
  6169. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6170. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6171. console.log('zh:aaaaaa22222222');
  6172. this.displayList = [];
  6173. this.ui.skillNode.skillList.numItems = 3;
  6174. this.addUIClick(this.ui, this.interuptSecretary);
  6175. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6176. this.ui.talkNode.visible = false;
  6177. if (Moyu.isKs)
  6178. this.ui.closeNode.closeBtn.x += 100;
  6179. }
  6180. show() {
  6181. super.show();
  6182. this.playSecretaryIdle();
  6183. this.moneyNode.ui.c1.selectedIndex = 1;
  6184. Laya.timer.clearAll(this);
  6185. xGame.soundMgr.playSound("s_start");
  6186. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6187. let guide = DataMgr.getSkillGuide();
  6188. this.ui.guideNode.visible = guide == 0;
  6189. let item = this.getSkillItemByUIIndex(0);
  6190. if (guide == 0) {
  6191. item.ui.c1.selectedIndex = 1;
  6192. }
  6193. else {
  6194. item.ui.c1.selectedIndex = 0;
  6195. }
  6196. this.ui.guideNode.guideBtn.visible = guide == 0;
  6197. for (let index = 0; index < this.displayList.length; index++) {
  6198. this.displayList[index].checkTry();
  6199. }
  6200. }
  6201. getSkillItemByUIIndex(cur) {
  6202. for (let index = 0; index < this.displayList.length; index++) {
  6203. if (this.displayList[index].index == cur) {
  6204. return this.displayList[index];
  6205. }
  6206. }
  6207. }
  6208. enterGuideLevel() {
  6209. let item = this.getSkillItemByUIIndex(0);
  6210. item.startGame();
  6211. if (DataMgr.getNewUser())
  6212. Moyu.sendDataEvent("gameStart1");
  6213. }
  6214. initSkillData() {
  6215. this.skillData = [];
  6216. let nameList = xGame.common.skillNameList;
  6217. let iconList = xGame.common.skillIconList;
  6218. let describeList = [
  6219. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6220. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6221. "The power of frost descends—freezing the flow and taking full control of the game!"
  6222. ];
  6223. console.log('zh:initSkillData 111111111');
  6224. let data;
  6225. for (let index = 0; index < nameList.length; index++) {
  6226. data = {};
  6227. data.name = nameList[index];
  6228. data.icon = iconList[index];
  6229. data.describe = describeList[index];
  6230. data.index = index;
  6231. this.skillData.push(data);
  6232. }
  6233. }
  6234. updateSkillItem(index, target) {
  6235. if (this.displayList[index] == null) {
  6236. let uiIndex;
  6237. switch (index) {
  6238. case 0:
  6239. uiIndex = 1;
  6240. break;
  6241. case 1:
  6242. uiIndex = 0;
  6243. break;
  6244. case 2:
  6245. uiIndex = 2;
  6246. break;
  6247. case 3:
  6248. uiIndex = 3;
  6249. break;
  6250. default:
  6251. break;
  6252. }
  6253. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6254. this.displayList.push(temp);
  6255. }
  6256. }
  6257. playSecretaryIdle() {
  6258. let parent = this.ui.secretary.displayObject;
  6259. parent.destroyChildren();
  6260. let xx = this.ui.secretary.width / 2;
  6261. let yy = this.ui.secretary.height;
  6262. let scale = xGame.common.getSecretaryScale();
  6263. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6264. xGame.common.secretary.play(data, 0, true, parent);
  6265. }
  6266. returnUIMain() {
  6267. this.hide();
  6268. xGame.common.stopGirlPop(this.ui.talkNode);
  6269. xGame.uiMgr.Show(UIMain);
  6270. }
  6271. interuptSecretary() {
  6272. Laya.timer.clearAll(this);
  6273. this.playSecretaryRandomSound();
  6274. }
  6275. playSecretaryRandomSound() {
  6276. if (this.isHide)
  6277. return;
  6278. let time = xGame.common.randomNum(45000, 60000);
  6279. Laya.timer.once(time, this, () => {
  6280. if (this.isHide)
  6281. return;
  6282. let index = xGame.common.randomNum(4, 7);
  6283. xGame.soundMgr.playSound("s_main0" + index);
  6284. let words = 1;
  6285. switch (index) {
  6286. case 4:
  6287. words = 5;
  6288. break;
  6289. case 5:
  6290. words = 3;
  6291. break;
  6292. case 6:
  6293. words = 6;
  6294. break;
  6295. case 7:
  6296. words = 7;
  6297. break;
  6298. default:
  6299. break;
  6300. }
  6301. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6302. this.playSecretaryRandomSound();
  6303. });
  6304. }
  6305. }
  6306. UISkill.uiName = "UISkill";
  6307. class ui_UIMsg extends fgui.GComponent {
  6308. static createInstance() {
  6309. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6310. }
  6311. onConstruct() {
  6312. this.tipsNode = (this.getChild("tipsNode"));
  6313. }
  6314. }
  6315. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6316. class UIMsg extends UIBase {
  6317. constructor() {
  6318. super();
  6319. }
  6320. onConstructor() {
  6321. this.ui = ui_UIMsg.createInstance();
  6322. this.contentPane = this.ui;
  6323. this.isEject = false;
  6324. this.isMuti = true;
  6325. }
  6326. show(msg, callback) {
  6327. super.show();
  6328. this.ui.tipsNode.msgTxt.text = msg;
  6329. this.ui.alpha = 1;
  6330. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6331. this.hide();
  6332. callback && callback();
  6333. }), 1000);
  6334. }
  6335. }
  6336. UIMsg.uiName = "UIMsg";
  6337. class ui_UIModeSelection extends fgui.GComponent {
  6338. static createInstance() {
  6339. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6340. }
  6341. onConstruct() {
  6342. this.n19 = (this.getChild("n19"));
  6343. this.closeBtn = (this.getChild("closeBtn"));
  6344. this.myNode = (this.getChild("myNode"));
  6345. this.t0 = this.getTransition("t0");
  6346. }
  6347. }
  6348. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6349. class UIModeSelection extends UIBase {
  6350. constructor() {
  6351. super();
  6352. }
  6353. onConstructor() {
  6354. this.ui = ui_UIModeSelection.createInstance();
  6355. this.contentPane = this.ui;
  6356. this.isEject = false;
  6357. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6358. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6359. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6360. this.addUIClick(this.ui.closeBtn, this.hide);
  6361. this.peopleArr = [65, 990, 580];
  6362. this.peopleOffest = [5, 10, 10];
  6363. }
  6364. show(callback) {
  6365. this.updateSelf();
  6366. super.show();
  6367. this.ui.t0.play();
  6368. this.callback = callback;
  6369. }
  6370. updateSelf() {
  6371. let cfg = cfgTable.modeselectData;
  6372. for (let index = 1; index <= 3; index++) {
  6373. let node = this.ui.myNode["type" + index];
  6374. node.need.text = cfg[index].need;
  6375. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6376. node.peopleTxt.text = this.getRandPeople(index - 1);
  6377. }
  6378. }
  6379. enterGame(type) {
  6380. console.log('zh: 进入经典模式 type: ' + type);
  6381. xGame.common.classicRoomType = type;
  6382. let cfg = cfgTable.modeselectData[type];
  6383. let need = cfg.need;
  6384. xGame.common.passAwardCoin = cfg.award;
  6385. if (DataMgr.coinEnough(need)) {
  6386. DataMgr.setCoin(-need);
  6387. this.ui.myNode["type" + type].t0.play();
  6388. Laya.timer.once(200, this, () => {
  6389. this.callback && this.callback();
  6390. });
  6391. this.logEventForClassic_start();
  6392. }
  6393. else {
  6394. Moyu.sendDataEvent("AddCoinVideo");
  6395. xGame.uiMgr.Show(UIAddProp, 0);
  6396. }
  6397. }
  6398. getRandPeople(index) {
  6399. let rand = this.peopleOffest[index];
  6400. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6401. }
  6402. logEventForClassic_start() {
  6403. let rtype = xGame.common.classicRoomType;
  6404. let msmc = '';
  6405. if (rtype == 1) {
  6406. msmc = 'beginner';
  6407. }
  6408. if (rtype == 2) {
  6409. msmc = 'expert';
  6410. }
  6411. if (rtype == 3) {
  6412. msmc = 'master';
  6413. }
  6414. let keyStr = 'sjmd_classic_start_' + rtype;
  6415. let jsonStr = {
  6416. "difficulty": msmc,
  6417. "classic_count": 1,
  6418. "difficulty_count": 1
  6419. };
  6420. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6421. const d = LocalStorageManager.getItem(keyStr);
  6422. jsonStr.classic_count = d.classic_count + 1;
  6423. jsonStr.difficulty_count = d.difficulty_count + 1;
  6424. LocalStorageManager.setItem(keyStr, jsonStr);
  6425. }
  6426. else {
  6427. LocalStorageManager.setItem(keyStr, jsonStr);
  6428. }
  6429. const reqStr = JSON.stringify(jsonStr);
  6430. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6431. }
  6432. }
  6433. UIModeSelection.uiName = "UIModeSelection";
  6434. class ui_UIGetAward extends fgui.GComponent {
  6435. static createInstance() {
  6436. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6437. }
  6438. onConstruct() {
  6439. this.n4 = (this.getChild("n4"));
  6440. this.n0 = (this.getChild("n0"));
  6441. this.myList = (this.getChild("myList"));
  6442. this.n1 = (this.getChild("n1"));
  6443. this.eftNode = (this.getChild("eftNode"));
  6444. this.btnNode = (this.getChild("btnNode"));
  6445. this.t0 = this.getTransition("t0");
  6446. }
  6447. }
  6448. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6449. class UIGetAward extends UIBase {
  6450. constructor() {
  6451. super();
  6452. this.showTriple = true;
  6453. }
  6454. onConstructor() {
  6455. this.ui = ui_UIGetAward.createInstance();
  6456. this.contentPane = this.ui;
  6457. this.isEject = false;
  6458. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6459. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6460. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6461. }
  6462. show(arr, showTriple, callback) {
  6463. super.show();
  6464. this.ui.t0.play();
  6465. this.ui.eftNode.visible = true;
  6466. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6467. this.ui.eftNode.visible = false;
  6468. }), 1, 0, 0, 0.9);
  6469. this.awardArr = arr;
  6470. this.showTriple = showTriple;
  6471. this.callback = callback;
  6472. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6473. this.ui.myList.numItems = arr.length;
  6474. xGame.soundMgr.playSound("getaward");
  6475. }
  6476. updateSelf(index, obj) {
  6477. let temp = this.awardArr[index];
  6478. let icon = this.getIcon(temp.type);
  6479. let str = icon;
  6480. if (temp.type > 2) {
  6481. str = "s" + icon;
  6482. }
  6483. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6484. obj.myIcon.rotation = 0;
  6485. obj.numTxt.text = temp.num + "";
  6486. obj.numTxt.visible = temp.type > 2 ? false : true;
  6487. obj.nameTxt.text = this.getNameStr(temp.type);
  6488. }
  6489. renderItem(index, obj) {
  6490. this.updateSelf(index, obj);
  6491. }
  6492. tripleGetAward() {
  6493. console.log('zh:qjff_AD_for_uigetAward');
  6494. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6495. }
  6496. else {
  6497. console.log('zh:AD 失败,直接发放奖励');
  6498. this.qjff_AD_for_uigetAward();
  6499. }
  6500. }
  6501. qjff_AD_for_uigetAward() {
  6502. this.getAward(3);
  6503. }
  6504. normalGetAward() {
  6505. if (PlatMgr.isMisVideo())
  6506. this.tripleGetAward();
  6507. else
  6508. this.getAward();
  6509. }
  6510. getAward(times = 1) {
  6511. this.hide();
  6512. for (let index = 0; index < this.awardArr.length; index++) {
  6513. this.awardArr[index].num *= times;
  6514. }
  6515. this.callback && this.callback(times != 1);
  6516. }
  6517. getIcon(type) {
  6518. switch (type) {
  6519. case Prop.diamond:
  6520. return "ty_zs";
  6521. case Prop.coin:
  6522. return "ty_jb";
  6523. case Prop.gan1:
  6524. return "qg1";
  6525. case Prop.gan2:
  6526. return "qg2";
  6527. case Prop.gan3:
  6528. return "qg3";
  6529. case Prop.gan4:
  6530. return "qg4";
  6531. default:
  6532. break;
  6533. }
  6534. }
  6535. getNameStr(type) {
  6536. switch (type) {
  6537. case Prop.diamond:
  6538. return "Diamond";
  6539. case Prop.coin:
  6540. return "Coins";
  6541. case Prop.gan1:
  6542. case Prop.gan2:
  6543. case Prop.gan3:
  6544. case Prop.gan4:
  6545. return cfgTable.ballrodData[type - 1].name;
  6546. default:
  6547. break;
  6548. }
  6549. }
  6550. }
  6551. UIGetAward.uiName = "UIGetAward";
  6552. class ui_UIRepentProp extends fgui.GComponent {
  6553. static createInstance() {
  6554. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6555. }
  6556. onConstruct() {
  6557. this.c1 = this.getController("c1");
  6558. this.n11 = (this.getChild("n11"));
  6559. this.regretNode = (this.getChild("regretNode"));
  6560. this.helpLineNode = (this.getChild("helpLineNode"));
  6561. this.t0 = this.getTransition("t0");
  6562. }
  6563. }
  6564. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6565. class UIRepentProp extends UIBase {
  6566. constructor() {
  6567. super();
  6568. this.viewType = 0;
  6569. this.regretType = 0;
  6570. }
  6571. onConstructor() {
  6572. this.ui = ui_UIRepentProp.createInstance();
  6573. this.contentPane = this.ui;
  6574. this.isEject = false;
  6575. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6576. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6577. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6578. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6579. }
  6580. show(viewType, regretType, callback) {
  6581. PlatMgr.showInsert(true);
  6582. this.viewType = viewType;
  6583. this.regretType = regretType;
  6584. this.callback = callback;
  6585. super.show();
  6586. this.ui.t0.play();
  6587. this.ui.c1.selectedIndex = this.viewType;
  6588. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6589. if (this.viewType == 0) {
  6590. let guide = DataMgr.getGuideHelpLine();
  6591. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6592. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6593. }
  6594. xGame.common.gameMgr.gamePause = true;
  6595. }
  6596. hideSelf() {
  6597. xGame.common.gameMgr.gamePause = false;
  6598. this.callback && this.callback(false);
  6599. this.hide();
  6600. }
  6601. videoRegret() {
  6602. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6603. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6604. }
  6605. else {
  6606. console.log('zh:AD 失败,直接发放奖励');
  6607. this.qjff_AD_for_UIrepentProp_videoRegret();
  6608. }
  6609. }
  6610. qjff_AD_for_UIrepentProp_videoRegret() {
  6611. this.callback && this.callback(true);
  6612. this.hideSelf();
  6613. }
  6614. videoAddHelpLine() {
  6615. let guide = DataMgr.getGuideHelpLine();
  6616. if (guide == 0) {
  6617. this.callback && this.callback(true);
  6618. this.hideSelf();
  6619. DataMgr.setGuideHelpLine();
  6620. xGame.common.gameUI.ui.guideNode.visible = false;
  6621. }
  6622. else {
  6623. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6624. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6625. }
  6626. else {
  6627. console.log('zh:AD 失败,直接发放奖励');
  6628. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6629. }
  6630. }
  6631. }
  6632. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6633. this.callback && this.callback(true);
  6634. this.hideSelf();
  6635. }
  6636. }
  6637. UIRepentProp.uiName = "UIRepentProp";
  6638. class UIMain extends UIBase {
  6639. constructor() {
  6640. super();
  6641. this.firstEnter = true;
  6642. }
  6643. nativeCallJs(msg) {
  6644. let t = msg;
  6645. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6646. switch (t) {
  6647. case 'qjff_chouJiang':
  6648. let dui = xGame.uiMgr.getUI(UIDraw);
  6649. dui.qjff_chouJiang();
  6650. break;
  6651. case 'qjff_AD_for_uisign':
  6652. let dui2 = xGame.uiMgr.getUI(UISign);
  6653. dui2.qjff_AD_for_uisign();
  6654. break;
  6655. case 'qjff_AD_for_uitry':
  6656. let dui3 = xGame.uiMgr.getUI(UITry);
  6657. dui3.qjff_AD_for_uitry();
  6658. break;
  6659. case 'qjff_AD_for_uipower':
  6660. let dui4 = xGame.uiMgr.getUI(UIPower);
  6661. dui4.qjff_AD_for_uipower();
  6662. break;
  6663. case 'qjff_AD_for_uigetAward':
  6664. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6665. dui5.qjff_AD_for_uigetAward();
  6666. break;
  6667. case 'qjff_AD_for_uiGameEnd':
  6668. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6669. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6670. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6671. break;
  6672. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6673. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6674. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6675. break;
  6676. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6677. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6678. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6679. break;
  6680. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6681. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6682. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6683. break;
  6684. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6685. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6686. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6687. break;
  6688. case 'qjff_AD_for_UIBOX_onOpenBox':
  6689. let dui11 = xGame.uiMgr.getUI(UIBox);
  6690. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6691. break;
  6692. case 'qjff_AD_for_UIAddCoin':
  6693. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6694. dui12.qjff_AD_for_UIAddCoin();
  6695. break;
  6696. case '111a':
  6697. let dui14 = xGame.uiMgr.getUI(UISign);
  6698. dui14.qjff_AD_for_uisign();
  6699. break;
  6700. case '222a':
  6701. let dui15 = xGame.uiMgr.getUI(UISign);
  6702. dui15.qjff_AD_for_uisign();
  6703. break;
  6704. case '333a':
  6705. let dui16 = xGame.uiMgr.getUI(UISign);
  6706. dui16.qjff_AD_for_uisign();
  6707. break;
  6708. default:
  6709. console.log('zh:未知的方法名字' + t);
  6710. break;
  6711. }
  6712. }
  6713. onConstructor() {
  6714. console.log('zh: UIMain onConstructor');
  6715. this.ui = ui_UIMain.createInstance();
  6716. this.contentPane = this.ui;
  6717. this.isEject = false;
  6718. this.addEvent();
  6719. this.addClickSpine();
  6720. this.settingNode = new SettingNode(this.ui.settingNode);
  6721. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6722. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6723. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6724. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6725. let curUse = DataMgr.getCurSecretary();
  6726. this.changeSecretary(curUse);
  6727. this.ui.talkNode.visible = false;
  6728. let guide = DataMgr.getSkillGuide();
  6729. if (xGame.common.isNewDay && guide == 1) {
  6730. xGame.common.isNewDay = false;
  6731. xGame.soundMgr.playSound("s_main01");
  6732. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6733. console.log("zh:播放小秘书每天语音");
  6734. }
  6735. this.ui.n83.visible = false;
  6736. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6737. }
  6738. changeSecretary(curUse) {
  6739. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6740. xGame.common.secretary && xGame.common.secretary.dispose();
  6741. this.addSecretarySpine(name);
  6742. }
  6743. addSecretarySpine(name) {
  6744. let spine = new SpineMgr(name, () => {
  6745. this.playSecretaryIdle();
  6746. });
  6747. xGame.common.secretary = spine;
  6748. }
  6749. addClickSpine() {
  6750. let clickSpine = new SpineMgr("dianji", () => {
  6751. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6752. let parent = Laya.stage;
  6753. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6754. clickSpine.play(data, 0, false, parent, (spine) => {
  6755. spine.destroy(true);
  6756. });
  6757. });
  6758. });
  6759. }
  6760. addEvent() {
  6761. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6762. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6763. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6764. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6765. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6766. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6767. this.addUIClick(this.ui, this.interuptSecretary);
  6768. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6769. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6770. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6771. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6772. this.addUIClick(this.ui.signBtn, this.openSignView);
  6773. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6774. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6775. }
  6776. show(showFailWords) {
  6777. super.show();
  6778. this.moneyNode.ui.c1.selectedIndex = 1;
  6779. this.playSecretaryIdle();
  6780. xGame.soundMgr.playMusic("caromhall01", 0);
  6781. Laya.timer.clearAll(this);
  6782. this.playSecretaryRandomSound();
  6783. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  6784. if (showFailWords) {
  6785. console.log('zh:uimain.ts ');
  6786. setTimeout(() => {
  6787. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6788. let words = -1;
  6789. if (str == "s_main02") {
  6790. words = 2;
  6791. }
  6792. else {
  6793. words = 3;
  6794. }
  6795. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6796. xGame.soundMgr.playSound(str);
  6797. }, 300);
  6798. }
  6799. this.showGuide();
  6800. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6801. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6802. let guide = DataMgr.getSkillGuide();
  6803. if (guide == 1) {
  6804. let randTime = xGame.common.randomNum(300, 800);
  6805. if (this.firstEnter) {
  6806. console.log("zh: firstEnter");
  6807. this.firstEnter = false;
  6808. randTime += 900;
  6809. }
  6810. else {
  6811. console.log("zh: no firstEnter");
  6812. }
  6813. Laya.timer.once(randTime, this, () => {
  6814. xGame.common.autoPopUIView();
  6815. });
  6816. }
  6817. }
  6818. checkActive(show) {
  6819. }
  6820. showGuide() {
  6821. let guide = DataMgr.getSkillGuide();
  6822. this.ui.guideBtn.visible = guide == 0;
  6823. this.ui.enterGuide.visible = false;
  6824. this.ui.secretaryGuide.visible = guide == 0;
  6825. if (guide == 0) {
  6826. console.log("zh:显示引导");
  6827. xGame.soundMgr.playSound("s_guide");
  6828. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6829. }
  6830. else {
  6831. console.log("zh:不需要显示引导");
  6832. }
  6833. }
  6834. ensureSecretary() {
  6835. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6836. this.ui.secretaryGuide.visible = false;
  6837. this.ui.enterGuide.visible = true;
  6838. this.ui.wordsNode.t0.play();
  6839. if (DataMgr.getNewUser())
  6840. Moyu.sendDataEvent("gameReady");
  6841. }
  6842. playSecretaryIdle() {
  6843. let parent = this.ui.secretary.displayObject;
  6844. parent.destroyChildren();
  6845. let xx = this.ui.secretary.width / 2;
  6846. let yy = this.ui.secretary.height;
  6847. let scale = xGame.common.getSecretaryScale();
  6848. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6849. console.log("zh:playSecretaryIdle", data);
  6850. xGame.common.secretary.play(data, 0, true, parent);
  6851. }
  6852. startGame(type) {
  6853. xGame.common.gameMode = type;
  6854. Moyu.sendDataEvent("PlayGame", { type: type });
  6855. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  6856. switch (xGame.common.gameMode) {
  6857. case GameMode.classic:
  6858. console.log('zh:进入经典模式111111111');
  6859. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  6860. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6861. console.log('zh:classic db_over_lev=', db_over_lev);
  6862. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  6863. console.log('zh:判断是否可以玩该模式classic =NO');
  6864. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  6865. xGame.uiMgr.Show(UIMsg, tipStr);
  6866. return;
  6867. }
  6868. else {
  6869. console.log('zh:可以玩该模式classic 66666666666666');
  6870. this.beginGame();
  6871. }
  6872. }
  6873. else {
  6874. console.log('zh:不需要判断是否可以玩该classic');
  6875. let challengeTimes = DataMgr.getChallengeTimes();
  6876. if (challengeTimes == 0) {
  6877. xGame.uiMgr.Show(UIInvitation);
  6878. }
  6879. else {
  6880. this.beginGame();
  6881. }
  6882. break;
  6883. }
  6884. case GameMode.bigMove:
  6885. console.error('zh:bigMove check');
  6886. let guide = DataMgr.getSkillGuide();
  6887. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  6888. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6889. console.log('zh:bigMove db_over_lev=', db_over_lev);
  6890. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  6891. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  6892. xGame.uiMgr.Show(UIMsg, tipStr);
  6893. return;
  6894. }
  6895. else {
  6896. console.log('zh:可以玩该模式 bigMove');
  6897. this.beginGame();
  6898. if (DataMgr.getNewUser())
  6899. Moyu.sendDataEvent("gameStart0");
  6900. }
  6901. }
  6902. else {
  6903. this.beginGame();
  6904. if (DataMgr.getNewUser())
  6905. Moyu.sendDataEvent("gameStart0");
  6906. }
  6907. break;
  6908. default:
  6909. console.error('zh:未知错误!!!!');
  6910. break;
  6911. }
  6912. }
  6913. beginGame(isNice = false) {
  6914. console.log('zh:beginGame ');
  6915. let guide = DataMgr.getSkillGuide();
  6916. if (guide == 1) {
  6917. console.log('zh:非新手引导,showInternAd ');
  6918. JSBridgeUtils.instance.showInternAd('beginGame');
  6919. }
  6920. else {
  6921. console.log('zh:新手引导,不显示AD ');
  6922. }
  6923. console.log('zh:beginGame 2 go');
  6924. if (xGame.common.gameMode == GameMode.classic) {
  6925. if (isNice) {
  6926. this.enterClassic();
  6927. }
  6928. else {
  6929. xGame.uiMgr.Show(UIModeSelection, () => {
  6930. console.log('zh:BBBBBBBBBBBBBBB');
  6931. this.enterClassic();
  6932. });
  6933. }
  6934. }
  6935. else if (xGame.common.gameMode == GameMode.bigMove) {
  6936. this.ui.enterGuide.visible = false;
  6937. xGame.uiMgr.Show(UISkill);
  6938. }
  6939. }
  6940. enterClassic() {
  6941. xGame.uiMgr.Show(UIGame);
  6942. xGame.uiMgr.Show(UIMatching, () => {
  6943. if (!this.isHide)
  6944. this.hide();
  6945. xGame.common.gameUI.ui.alpha = 1;
  6946. xGame.common.gameUI.startGame();
  6947. xGame.uiMgr.Hide(UIGameEnd);
  6948. });
  6949. }
  6950. startGlobal() {
  6951. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6952. }
  6953. startWeekly() {
  6954. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6955. }
  6956. zhouSaiMonth() {
  6957. console.log('zh: zhouSaiMonth 被调用');
  6958. }
  6959. startPlaceBall() {
  6960. xGame.uiMgr.Show(UILevelDisplay);
  6961. }
  6962. hide() {
  6963. console.log('zh:uimain hide ...');
  6964. super.hide();
  6965. xGame.common.stopGirlPop(this.ui.talkNode);
  6966. }
  6967. onGetUserInfo(force = false) {
  6968. if (Moyu.isWx) {
  6969. let info = Moyu.getSystemInfo();
  6970. if (info)
  6971. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6972. }
  6973. else {
  6974. Moyu.initUser(this, this.freshUser, force);
  6975. }
  6976. if (!Moyu.hasUserInfo) {
  6977. let user = Moyu.getUserInfo();
  6978. user.headIcon = 'res/ty_touxiang.png';
  6979. }
  6980. this.freshUser();
  6981. }
  6982. freshUser() {
  6983. let user = Moyu.getUserInfo();
  6984. if (!user.isAuth) {
  6985. user.headIcon = 'res/ty_touxiang.png';
  6986. }
  6987. else
  6988. DataMgr.upRankData();
  6989. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6990. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6991. }
  6992. interuptSecretary() {
  6993. Laya.timer.clearAll(this);
  6994. this.playSecretaryRandomSound();
  6995. }
  6996. playSecretaryRandomSound() {
  6997. if (this.isHide)
  6998. return;
  6999. let time = xGame.common.randomNum(45000, 60000);
  7000. Laya.timer.once(time, this, () => {
  7001. if (this.isHide)
  7002. return;
  7003. let index = xGame.common.randomNum(4, 7);
  7004. xGame.soundMgr.playSound("s_main0" + index);
  7005. let words = 1;
  7006. switch (index) {
  7007. case 4:
  7008. words = 5;
  7009. break;
  7010. case 5:
  7011. words = 3;
  7012. break;
  7013. case 6:
  7014. words = 6;
  7015. break;
  7016. case 7:
  7017. words = 7;
  7018. break;
  7019. default:
  7020. break;
  7021. }
  7022. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7023. this.playSecretaryRandomSound();
  7024. });
  7025. }
  7026. openSecretaryView() {
  7027. xGame.uiMgr.Show(UISecretary);
  7028. Moyu.sendDataEvent("secretary");
  7029. }
  7030. openShopView() {
  7031. xGame.uiMgr.Show(UIShop);
  7032. }
  7033. openSignView() {
  7034. xGame.uiMgr.Show(UISign);
  7035. }
  7036. openDrawView() {
  7037. xGame.uiMgr.Show(UIDraw);
  7038. }
  7039. openRanking() {
  7040. console.log('zh:phb openRanking');
  7041. xGame.uiMgr.Show(UIRanking);
  7042. Moyu.sendDataEvent("rankingList");
  7043. }
  7044. }
  7045. UIMain.uiName = "UIMain";
  7046. class UIGameEnd extends UIBase {
  7047. constructor() {
  7048. super();
  7049. this.success = false;
  7050. this.awardCoinNum = 1000;
  7051. this.awardDiamondNum = 10;
  7052. }
  7053. onConstructor() {
  7054. this.ui = ui_UIGameEnd.createInstance();
  7055. this.contentPane = this.ui;
  7056. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7057. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7058. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7059. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7060. this.ui.talkNode.visible = false;
  7061. if (Moyu.isKs)
  7062. this.ui.closeNode.closeBtn.x += 100;
  7063. }
  7064. updateType() {
  7065. switch (xGame.common.gameMode) {
  7066. case GameMode.classic:
  7067. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7068. this.ui.coinNode.visible = this.success;
  7069. if (!this.success) {
  7070. Laya.timer.once(500, this, () => {
  7071. xGame.uiMgr.Show(UIAddCoin);
  7072. });
  7073. }
  7074. else {
  7075. this.logEventForClassic_win();
  7076. }
  7077. this.logEventForClassic_complete();
  7078. this.ui.isGetAward.visible = false;
  7079. this.ui.leftBtn.c1.selectedIndex = 3;
  7080. this.ui.rightBtn.c1.selectedIndex = 0;
  7081. this.moneyNode.ui.c1.selectedIndex = 1;
  7082. break;
  7083. case GameMode.bigMove:
  7084. console.log('zh:招法模式 aaaaaa bigMove');
  7085. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7086. this.ui.coinNode.visible = this.success;
  7087. if (xGame.common.gameMode == GameMode.bigMove) {
  7088. if (this.success) {
  7089. DataMgr.setSkillSuccessTimes(1, true);
  7090. DataMgr.setSkillAccTimes(1);
  7091. }
  7092. else {
  7093. DataMgr.setSkillSuccessTimes(0, false);
  7094. }
  7095. }
  7096. this.logEventForRod_complete_N();
  7097. if (!this.success) {
  7098. Laya.timer.once(500, this, () => {
  7099. xGame.uiMgr.Show(UIAddCoin);
  7100. });
  7101. }
  7102. else {
  7103. this.logEventForRod_win();
  7104. }
  7105. this.ui.isGetAward.visible = false;
  7106. this.ui.leftBtn.c1.selectedIndex = 3;
  7107. this.ui.rightBtn.c1.selectedIndex = 0;
  7108. this.moneyNode.ui.c1.selectedIndex = 1;
  7109. break;
  7110. case GameMode.placeBall:
  7111. this.ui.coinNode.visible = false;
  7112. if (this.success) {
  7113. if (xGame.common.placeBallStarNum == 3) {
  7114. this.ui.c1.selectedIndex = 2;
  7115. }
  7116. else {
  7117. this.ui.c1.selectedIndex = 3;
  7118. }
  7119. let level = xGame.common.placeBallCurLevel;
  7120. if (level > 59) {
  7121. this.logEventForChallenge_level_complete(level);
  7122. }
  7123. else {
  7124. this.logEventForChallenge_level_N(level);
  7125. }
  7126. }
  7127. else {
  7128. this.ui.c1.selectedIndex = 4;
  7129. }
  7130. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7131. if (cfg.type == PlaceBallType.challenge) {
  7132. this.ui.c1.selectedIndex = 2;
  7133. }
  7134. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7135. this.updatePlaceBallBtn();
  7136. this.updatePlaceBallStarNum();
  7137. this.updatePlaceBallAwardState();
  7138. this.moneyNode.ui.c1.selectedIndex = 2;
  7139. this.moneyNode.checkPowerTime();
  7140. this.moneyNode.powerChange();
  7141. DataMgr.upRankData();
  7142. break;
  7143. default:
  7144. break;
  7145. }
  7146. }
  7147. logEventForRod_complete_N() {
  7148. let gfmsIdx = xGame.common.curPlayerSkillType;
  7149. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7150. let gfmc = 'Skyfall Shot';
  7151. if (gfmsIdx == 0) {
  7152. gfmc = 'Skyfall Shot';
  7153. }
  7154. if (gfmsIdx == 1) {
  7155. gfmc = 'Surging break';
  7156. }
  7157. if (gfmsIdx == 2) {
  7158. gfmc = 'Frost Lock';
  7159. }
  7160. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7161. console.log('zh:logEventForRod_complete_N level = ' + level);
  7162. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7163. let jsonStr = {
  7164. "count": 0,
  7165. "name": gfmc
  7166. };
  7167. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7168. const d = LocalStorageManager.getItem(keyStr);
  7169. jsonStr.count = d.count + 1;
  7170. LocalStorageManager.setItem(keyStr, jsonStr);
  7171. }
  7172. else {
  7173. LocalStorageManager.setItem(keyStr, jsonStr);
  7174. }
  7175. const d2 = LocalStorageManager.getItem(keyStr);
  7176. let count = d2.count;
  7177. console.log('zh:logEventForRod_complete_N count = ' + count);
  7178. if (count % 5 == 0) {
  7179. const reqStr = JSON.stringify(jsonStr);
  7180. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7181. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7182. }
  7183. }
  7184. logEventForRod_win() {
  7185. console.log('zh:logEventForRod_win,胜利');
  7186. let gfmsIdx = xGame.common.curPlayerSkillType;
  7187. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7188. let gfmc = 'Skyfall Shot';
  7189. if (gfmsIdx == 0) {
  7190. gfmc = 'Skyfall Shot';
  7191. }
  7192. if (gfmsIdx == 1) {
  7193. gfmc = 'Surging break';
  7194. }
  7195. if (gfmsIdx == 2) {
  7196. gfmc = 'Frost Lock';
  7197. }
  7198. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7199. console.log('zh:logEventForRod_win level = ' + level);
  7200. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7201. let jsonStr = {
  7202. "count": 1,
  7203. "name": gfmc + ' Lev' + level
  7204. };
  7205. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7206. const d = LocalStorageManager.getItem(keyStr);
  7207. jsonStr.count = d.count + 1;
  7208. LocalStorageManager.setItem(keyStr, jsonStr);
  7209. }
  7210. else {
  7211. LocalStorageManager.setItem(keyStr, jsonStr);
  7212. }
  7213. const reqStr = JSON.stringify(jsonStr);
  7214. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7215. }
  7216. logEventForClassic_win() {
  7217. console.log('zh:logEventForClassic_win,胜利');
  7218. let rtype = xGame.common.classicRoomType;
  7219. let msmc = '';
  7220. if (rtype == 1) {
  7221. msmc = 'beginner';
  7222. }
  7223. if (rtype == 2) {
  7224. msmc = 'expert';
  7225. }
  7226. if (rtype == 3) {
  7227. msmc = 'master';
  7228. }
  7229. let keyStr = 'sjmd_classic_win_' + rtype;
  7230. let jsonStr = {
  7231. "difficulty": msmc,
  7232. "classic_count": 1,
  7233. "difficulty_count": 1
  7234. };
  7235. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7236. const d = LocalStorageManager.getItem(keyStr);
  7237. jsonStr.classic_count = d.classic_count + 1;
  7238. jsonStr.difficulty_count = d.difficulty_count + 1;
  7239. LocalStorageManager.setItem(keyStr, jsonStr);
  7240. }
  7241. else {
  7242. LocalStorageManager.setItem(keyStr, jsonStr);
  7243. }
  7244. const reqStr = JSON.stringify(jsonStr);
  7245. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7246. }
  7247. logEventForClassic_complete() {
  7248. console.log('zh:logEventForClassic_complete,胜利');
  7249. let rtype = xGame.common.classicRoomType;
  7250. let msmc = '';
  7251. if (rtype == 1) {
  7252. msmc = 'beginner';
  7253. }
  7254. if (rtype == 2) {
  7255. msmc = 'expert';
  7256. }
  7257. if (rtype == 3) {
  7258. msmc = 'master';
  7259. }
  7260. let keyStr = 'sjmd_classic_complete_' + rtype;
  7261. let jsonStr = {
  7262. "msmc": msmc,
  7263. "count": 0
  7264. };
  7265. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7266. const d = LocalStorageManager.getItem(keyStr);
  7267. jsonStr.count = d.count + 1;
  7268. LocalStorageManager.setItem(keyStr, jsonStr);
  7269. }
  7270. else {
  7271. LocalStorageManager.setItem(keyStr, jsonStr);
  7272. }
  7273. if (jsonStr.count % 5 == 0) {
  7274. const reqStr = JSON.stringify(jsonStr);
  7275. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7276. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7277. }
  7278. }
  7279. updatePlaceBallBtn() {
  7280. this.ui.leftBtn.c1.selectedIndex = 5;
  7281. if (this.success) {
  7282. this.ui.rightBtn.c1.selectedIndex = 14;
  7283. }
  7284. else {
  7285. if (xGame.common.placeBallStarNum == 3) {
  7286. this.ui.rightBtn.c1.selectedIndex = 14;
  7287. }
  7288. else {
  7289. this.ui.rightBtn.c1.selectedIndex = 1;
  7290. }
  7291. }
  7292. }
  7293. updatePlaceBallStarNum() {
  7294. let starNum = xGame.common.placeBallStarNum;
  7295. if (starNum == 0)
  7296. this.ui.starNumNode.c1.selectedIndex = 3;
  7297. else {
  7298. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7299. }
  7300. }
  7301. updatePlaceBallAwardState() {
  7302. let level = xGame.common.placeBallCurLevel;
  7303. let starNum = xGame.common.placeBallStarNum;
  7304. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7305. let data = cfgTable.placeballData[level].award;
  7306. let cfg = cfgTable.placeballData[level];
  7307. this.awardDiamondNum = data[1];
  7308. this.awardCoinNum = data[0];
  7309. if (cfg.type == PlaceBallType.challenge) {
  7310. this.awardDiamondNum = 0;
  7311. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7312. }
  7313. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7314. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7315. if (cfg.type == PlaceBallType.challenge) {
  7316. this.ui.awardNode.coinNode.visible = true;
  7317. }
  7318. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7319. this.ui.awardNode.diamondNode.x = 265;
  7320. this.ui.awardNode.coinNode.x = 354;
  7321. }
  7322. else {
  7323. this.ui.awardNode.diamondNode.x = 291;
  7324. this.ui.awardNode.coinNode.x = 291;
  7325. }
  7326. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7327. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7328. if (this.awardCoinNum == 0) {
  7329. this.ui.awardNode.coinNode.numTxt.text = "";
  7330. }
  7331. if (getAward) {
  7332. this.ui.isGetAward.visible = true;
  7333. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7334. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7335. }
  7336. else {
  7337. this.ui.isGetAward.visible = false;
  7338. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7339. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7340. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7341. }
  7342. else {
  7343. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7344. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7345. }
  7346. }
  7347. }
  7348. show(success) {
  7349. super.show();
  7350. xGame.eventMgr.event(RESET_GAME);
  7351. this.success = success;
  7352. Laya.timer.clearAll(this);
  7353. this.playSecretaryAni();
  7354. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7355. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7356. offsetTime = Math.floor(offsetTime / 1000);
  7357. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7358. this.updateType();
  7359. Laya.timer.once(200, this, () => {
  7360. this.addAward(() => {
  7361. this.updateType();
  7362. Laya.timer.once(500, this, () => {
  7363. this.showChallengeLevel();
  7364. });
  7365. });
  7366. });
  7367. if (this.success) {
  7368. JSBridgeUtils.instance.showInternAd('gameend_success');
  7369. console.log('zh:game end 成功');
  7370. xGame.soundMgr.playSound('slots_roll01');
  7371. xGame.soundMgr.playSound("s_win");
  7372. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7373. this.diyGameDataUtilForGameWin();
  7374. }
  7375. else {
  7376. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7377. console.log('zh:game end失败');
  7378. xGame.soundMgr.playSound('matchwin01');
  7379. xGame.soundMgr.playSound("s_lose");
  7380. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7381. }
  7382. let challengeNum = DataMgr.getChallengeTimes();
  7383. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7384. DataMgr.setChallengeTimes(1);
  7385. }
  7386. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7387. DataMgr.setClassicTimes();
  7388. }
  7389. }
  7390. diyGameDataUtilForGameWin() {
  7391. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7392. switch (xGame.common.gameMode) {
  7393. case GameMode.classic:
  7394. console.log('zh:DiyGameDataUtilForGameWin 111');
  7395. case GameMode.bigMove:
  7396. console.log('zh:DiyGameDataUtilForGameWin 222');
  7397. this.restartGame();
  7398. break;
  7399. case GameMode.placeBall:
  7400. console.log('zh:DiyGameDataUtilForGameWin 333');
  7401. var level = xGame.common.placeBallCurLevel;
  7402. console.log('zh:练习模式 联系了多少LEV=' + level);
  7403. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7404. if (level > db_over_lev) {
  7405. DataMgr.setChallengeMode_overLev(level);
  7406. }
  7407. break;
  7408. default:
  7409. console.log('zh:DiyGameDataUtilForGameWin 444');
  7410. break;
  7411. }
  7412. }
  7413. showChallengeLevel() {
  7414. if (DataMgr.getChallengeTimes() != 0)
  7415. return;
  7416. let skill = DataMgr.getSkillAccTimes();
  7417. let put = DataMgr.getPlaceBallLevelList().length;
  7418. if (skill >= 3 || put >= 5) {
  7419. xGame.uiMgr.Show(UIInvitation);
  7420. this.hide();
  7421. }
  7422. }
  7423. addAward(callback) {
  7424. if (!this.success) {
  7425. callback && callback();
  7426. return;
  7427. }
  7428. switch (xGame.common.gameMode) {
  7429. case GameMode.classic:
  7430. this.awardCoinNum = xGame.common.passAwardCoin;
  7431. this.awardDiamondNum = 0;
  7432. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7433. break;
  7434. case GameMode.bigMove:
  7435. this.awardCoinNum = xGame.common.passAwardCoin;
  7436. this.awardDiamondNum = 0;
  7437. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7438. callback && callback();
  7439. break;
  7440. case GameMode.placeBall:
  7441. let level = xGame.common.placeBallCurLevel;
  7442. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7443. if (xGame.common.placeBallStarNum != 3) {
  7444. callback && callback();
  7445. return;
  7446. }
  7447. else {
  7448. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7449. if (getAward) {
  7450. callback && callback();
  7451. return;
  7452. }
  7453. }
  7454. let cfg = cfgTable.placeballData[level];
  7455. let data = cfgTable.placeballData[level].award;
  7456. this.awardCoinNum = data[0];
  7457. this.awardDiamondNum = data[1];
  7458. if (cfg.type == PlaceBallType.challenge) {
  7459. this.awardDiamondNum = 0;
  7460. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7461. }
  7462. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7463. let diamondAward;
  7464. if (this.awardDiamondNum > 0) {
  7465. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7466. xGame.common.getAward([diamondAward, coinAward], callback);
  7467. }
  7468. else {
  7469. xGame.common.getAward([coinAward], callback);
  7470. }
  7471. if (cfg.type == PlaceBallType.normal) {
  7472. DataMgr.setPlaceBallAward(level);
  7473. }
  7474. break;
  7475. default:
  7476. break;
  7477. }
  7478. }
  7479. playSecretaryAni_old() {
  7480. let parent = this.ui.secretary.displayObject;
  7481. parent.destroyChildren();
  7482. let xx = this.ui.secretary.width / 2;
  7483. let yy = this.ui.secretary.height;
  7484. let scale = xGame.common.getSecretaryScale();
  7485. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7486. if (this.success) {
  7487. let rand = Math.random() <= 0.5 ? 2 : 3;
  7488. xGame.common.secretary.play(data, rand, false, parent, () => {
  7489. xGame.common.secretary.play(data, 1, true, parent);
  7490. });
  7491. }
  7492. else {
  7493. xGame.common.secretary.play(data, 0, true, parent);
  7494. }
  7495. }
  7496. playSecretaryAni() {
  7497. let parent = this.ui.secretary.displayObject;
  7498. parent.destroyChildren();
  7499. let xx = this.ui.secretary.width / 2;
  7500. let yy = this.ui.secretary.height;
  7501. let scale = xGame.common.getSecretaryScale();
  7502. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7503. if (this.success) {
  7504. let rand = 0;
  7505. xGame.common.secretary.play(data, 0, true, parent);
  7506. }
  7507. else {
  7508. xGame.common.secretary.play(data, 0, true, parent);
  7509. }
  7510. }
  7511. restartGame() {
  7512. switch (xGame.common.gameMode) {
  7513. case GameMode.classic:
  7514. xGame.eventMgr.event(RESTART_GAME);
  7515. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7516. break;
  7517. case GameMode.bigMove:
  7518. this.hide();
  7519. xGame.eventMgr.event(RESTART_GAME);
  7520. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7521. break;
  7522. default:
  7523. break;
  7524. }
  7525. }
  7526. hide() {
  7527. super.hide();
  7528. xGame.common.stopGirlPop(this.ui.talkNode);
  7529. PlatMgr.showBanner(false);
  7530. }
  7531. returnHome() {
  7532. this.hide();
  7533. let showFailWords = !this.success;
  7534. xGame.uiMgr.Show(UIMain, showFailWords);
  7535. }
  7536. clickLeftBtn() {
  7537. switch (xGame.common.gameMode) {
  7538. case GameMode.classic:
  7539. case GameMode.bigMove:
  7540. this.returnHome();
  7541. break;
  7542. case GameMode.placeBall:
  7543. let level = xGame.common.placeBallCurLevel;
  7544. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7545. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7546. break;
  7547. default:
  7548. break;
  7549. }
  7550. }
  7551. powerStartPlaceBallLevel(level, btn) {
  7552. if (DataMgr.powerEnough()) {
  7553. btn.touchable = false;
  7554. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7555. btn.touchable = true;
  7556. DataMgr.setPower(-1);
  7557. xGame.eventMgr.event(POWER_TIME);
  7558. this.startPlaceBallLevel(level);
  7559. this.logEventForChallenge_level_start(level);
  7560. }));
  7561. }
  7562. else {
  7563. xGame.uiMgr.Show(UIPower, 0);
  7564. }
  7565. }
  7566. clickRightBtn() {
  7567. switch (xGame.common.gameMode) {
  7568. case GameMode.classic:
  7569. console.log('zh:clickRightBtn 111');
  7570. case GameMode.bigMove:
  7571. console.log('zh:clickRightBtn 222');
  7572. this.restartGame();
  7573. break;
  7574. case GameMode.placeBall:
  7575. console.log('zh:clickRightBtn 333');
  7576. let level = xGame.common.placeBallCurLevel;
  7577. let data = DataMgr.getPlaceBallLevel(level);
  7578. let curPss = data.play && !data.isCur;
  7579. if (curPss) {
  7580. console.log('zh:clickRightBtn 333-111');
  7581. console.log('zh:当前LV=' + level);
  7582. if (level == 60) {
  7583. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7584. Laya.timer.once(3000, this, () => {
  7585. this.returnHome();
  7586. });
  7587. }
  7588. else {
  7589. let lev = level + 1;
  7590. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  7591. }
  7592. }
  7593. else {
  7594. console.log('zh:clickRightBtn 333-000');
  7595. Moyu.sendDataEvent("placeBallNextLevel");
  7596. console.log('zh:qjff_AD_for_uiGameEnd');
  7597. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7598. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7599. }
  7600. else {
  7601. console.log('zh:AD 失败,直接发放奖励');
  7602. this.qjff_AD_for_uiGameEnd(level);
  7603. }
  7604. }
  7605. break;
  7606. default:
  7607. console.log('zh:clickRightBtn 444');
  7608. break;
  7609. }
  7610. }
  7611. logEventForChallenge_level_start(level) {
  7612. let keyStr = 'sjmd_challenge_level_start';
  7613. let jsonStr = {
  7614. "count": 0,
  7615. "gold_balance ": DataMgr.getCoin(),
  7616. "level": level,
  7617. "diamond_balance ": DataMgr.getDiamond()
  7618. };
  7619. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7620. const d = LocalStorageManager.getItem(keyStr);
  7621. if (level > d.level) {
  7622. jsonStr.count = d.count + 1;
  7623. LocalStorageManager.setItem(keyStr, jsonStr);
  7624. }
  7625. else {
  7626. }
  7627. }
  7628. else {
  7629. LocalStorageManager.setItem(keyStr, jsonStr);
  7630. }
  7631. const reqStr = JSON.stringify(jsonStr);
  7632. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  7633. }
  7634. qjff_AD_for_uiGameEnd(level) {
  7635. DataMgr.setPlaceBallLevel(level, 1);
  7636. this.startPlaceBallLevel(level + 1);
  7637. }
  7638. startPlaceBallLevel(level) {
  7639. xGame.common.gameMode = GameMode.placeBall;
  7640. xGame.common.placeBallCurLevel = level;
  7641. xGame.uiMgr.Show(UIGame);
  7642. this.hide();
  7643. }
  7644. logEventForChallenge_level_complete(level) {
  7645. let keyStr = 'sjmd_challenge_level_complete';
  7646. let jsonStr = {
  7647. "count": 1,
  7648. "gold_balance ": DataMgr.getCoin(),
  7649. "level": level,
  7650. "diamond_balance ": DataMgr.getDiamond()
  7651. };
  7652. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7653. const d = LocalStorageManager.getItem(keyStr);
  7654. jsonStr.count = d.count + 1;
  7655. LocalStorageManager.setItem(keyStr, jsonStr);
  7656. }
  7657. else {
  7658. LocalStorageManager.setItem(keyStr, jsonStr);
  7659. }
  7660. const reqStr = JSON.stringify(jsonStr);
  7661. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  7662. }
  7663. logEventForChallenge_level_N(level) {
  7664. console.log('zh:logEventForChallenge_level_N ' + level);
  7665. let keyStr = 'sjmd_challenge_level_N';
  7666. if (LocalStorageManager.hasKey(keyStr)) {
  7667. let lev = LocalStorageManager.getItem(keyStr);
  7668. if (level > lev) {
  7669. LocalStorageManager.setItem(keyStr, level);
  7670. }
  7671. if ((level) % 5 == 0) {
  7672. console.log('zh:每5关上报1次');
  7673. let sjmc = 'challenge_level_' + level;
  7674. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  7675. let sjmcForFirebase = 'challenge_level_' + level;
  7676. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  7677. }
  7678. else {
  7679. console.log('zh:5 no 上报');
  7680. }
  7681. }
  7682. else {
  7683. LocalStorageManager.setItem(keyStr, level);
  7684. }
  7685. }
  7686. }
  7687. UIGameEnd.uiName = "UIGameEnd";
  7688. class ui_UIVideoShare extends fgui.GComponent {
  7689. static createInstance() {
  7690. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7691. }
  7692. onConstruct() {
  7693. this.n10 = (this.getChild("n10"));
  7694. this.myNode = (this.getChild("myNode"));
  7695. this.t0 = this.getTransition("t0");
  7696. }
  7697. }
  7698. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7699. class UIVideoShare extends UIBase {
  7700. constructor() {
  7701. super();
  7702. this.success = false;
  7703. this.awardNum = 0;
  7704. this.isShared = true;
  7705. }
  7706. onConstructor() {
  7707. this.ui = ui_UIVideoShare.createInstance();
  7708. this.contentPane = this.ui;
  7709. this.isEject = false;
  7710. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7711. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7712. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7713. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7714. }
  7715. show(success) {
  7716. super.show();
  7717. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7718. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7719. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7720. this.success = success;
  7721. let time = xGame.common.randomNum(600, 1500);
  7722. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7723. if (success)
  7724. xGame.soundMgr.playSound("applause");
  7725. this.ui.t0.play();
  7726. this.checkShareState();
  7727. let times = DataMgr.getDailyVideoShareTimes();
  7728. this.awardNum = times == 0 ? 2000 : 200;
  7729. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7730. }
  7731. checkShareState() {
  7732. if (PlatMgr.forceShare == 0) {
  7733. this.ui.myNode.closeBtn.visible = true;
  7734. this.ui.myNode.tipsNode.visible = false;
  7735. this.ui.myNode.closeBtn.x = 90;
  7736. this.ui.myNode.shareBtn.x = 342;
  7737. }
  7738. else if (PlatMgr.forceShare == 1) {
  7739. this.ui.myNode.closeBtn.visible = false;
  7740. this.ui.myNode.tipsNode.visible = true;
  7741. this.ui.myNode.shareBtn.x = 218;
  7742. this.isShared = true;
  7743. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7744. }
  7745. }
  7746. checkForceShare() {
  7747. this.isShared = !this.isShared;
  7748. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7749. }
  7750. videoShare() {
  7751. if (PlatMgr.forceShare == 1) {
  7752. if (this.isShared) {
  7753. this.shareGame();
  7754. }
  7755. else {
  7756. this.hideSelf();
  7757. }
  7758. }
  7759. else {
  7760. this.shareGame();
  7761. }
  7762. }
  7763. shareGame() {
  7764. Moyu.sendDataEvent("VideoShare");
  7765. if (Moyu.canShare() > 100) {
  7766. Moyu.shareGame((success) => {
  7767. if (success) {
  7768. DataMgr.setDailyVideoShareTimes(1);
  7769. DataMgr.setCoin(this.awardNum);
  7770. }
  7771. this.hideSelf();
  7772. }, this);
  7773. }
  7774. else {
  7775. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7776. this.hideSelf();
  7777. }
  7778. }
  7779. hideSelf() {
  7780. this.hide();
  7781. xGame.uiMgr.Show(UIGameEnd, this.success);
  7782. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7783. xGame.common.screenImg.destroy();
  7784. xGame.common.screenImg = null;
  7785. }
  7786. }
  7787. }
  7788. UIVideoShare.uiName = "UIVideoShare";
  7789. class ui_UITips extends fgui.GComponent {
  7790. static createInstance() {
  7791. return (fgui.UIPackage.createObject("game", "UITips"));
  7792. }
  7793. onConstruct() {
  7794. this.n0 = (this.getChild("n0"));
  7795. this.myNode = (this.getChild("myNode"));
  7796. this.t0 = this.getTransition("t0");
  7797. }
  7798. }
  7799. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7800. class UITips extends UIBase {
  7801. constructor() {
  7802. super();
  7803. this.type = 0;
  7804. }
  7805. onConstructor() {
  7806. this.ui = ui_UITips.createInstance();
  7807. this.contentPane = this.ui;
  7808. this.isEject = false;
  7809. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7810. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7811. }
  7812. show(tipsTxt, womanTxt, type) {
  7813. super.show();
  7814. this.ui.t0.play();
  7815. this.ui.myNode.tipsTxt.text = tipsTxt;
  7816. this.ui.myNode.womanTxt.text = womanTxt;
  7817. PlatMgr.showInsert(true);
  7818. this.ui.myNode.c1.selectedIndex = type;
  7819. this.type = type;
  7820. switch (this.type) {
  7821. case TipsType.exitGame:
  7822. xGame.common.gameMgr.gamePause = true;
  7823. break;
  7824. case TipsType.foul:
  7825. Laya.timer.once(200, this, () => {
  7826. xGame.common.gameMgr.gamePause = true;
  7827. });
  7828. break;
  7829. default:
  7830. break;
  7831. }
  7832. }
  7833. clickLeftBtn() {
  7834. this.hide();
  7835. xGame.common.gameMgr.gamePause = false;
  7836. switch (this.type) {
  7837. case TipsType.exitGame:
  7838. break;
  7839. case TipsType.foul:
  7840. break;
  7841. default:
  7842. break;
  7843. }
  7844. }
  7845. clickRightBtn() {
  7846. this.hide();
  7847. switch (this.type) {
  7848. case TipsType.exitGame:
  7849. xGame.eventMgr.event(RESET_GAME);
  7850. xGame.uiMgr.Show(UIMain);
  7851. Moyu.recordEnd(this, null);
  7852. xGame.common.longHelpLine = false;
  7853. break;
  7854. case TipsType.foul:
  7855. xGame.common.gameMgr.gamePause = false;
  7856. Laya.timer.clearAll(this);
  7857. break;
  7858. default:
  7859. break;
  7860. }
  7861. }
  7862. }
  7863. UITips.uiName = "UITips";
  7864. class GameMgr {
  7865. constructor() {
  7866. this.selfCamp = "";
  7867. this.selfFoulNum = 0;
  7868. this.selfBallArr = [];
  7869. this.selfTimer = 0;
  7870. this.selfScore = 0;
  7871. this.aiCamp = "";
  7872. this.aiFoulNum = 0;
  7873. this.aiBallArr = [];
  7874. this.aiTimer = 0;
  7875. this.aiScore = 0;
  7876. this.aiSkillLevelNum = 1;
  7877. this.targertScore = 0;
  7878. this.setTime = 30;
  7879. this.selfTurnRate = 0.5;
  7880. this.accTime = 0;
  7881. this.curFoul = "";
  7882. this.maxFoulTimes = 3;
  7883. this.isFirstInGame = true;
  7884. this.firstColliObj = null;
  7885. this.inHoleBalls = [];
  7886. this.blackNum = 8;
  7887. this.success = false;
  7888. this.holePosList = [];
  7889. this.posObj = {};
  7890. this._selfTurn = false;
  7891. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7892. this.ensureBallType = false;
  7893. this.isOpenBall = true;
  7894. this.finishOneShoot = true;
  7895. this.isEnd = false;
  7896. this.isChangeTurn = false;
  7897. this.isInterrupt = false;
  7898. this.aiPlayedBreakArmy = false;
  7899. this.isTouchedBall = false;
  7900. this.finishBalls = 0;
  7901. this.needBalls = 0;
  7902. this.allBallNum = 0;
  7903. this.placeBallPosData = {};
  7904. this.curHP = 0;
  7905. this.showLongView = false;
  7906. this.firstShoot = true;
  7907. this._gamePause = false;
  7908. this.trunCount = 0;
  7909. this.isBlackInHole = false;
  7910. this.isEnter = true;
  7911. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7912. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7913. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7914. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7915. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7916. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7917. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7918. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7919. }
  7920. get gamePause() {
  7921. return this._gamePause;
  7922. }
  7923. set gamePause(v) {
  7924. if (v) {
  7925. Laya.physicsTimer.pause();
  7926. }
  7927. else {
  7928. Laya.physicsTimer.resume();
  7929. }
  7930. this._gamePause = v;
  7931. }
  7932. get selfTurn() {
  7933. return this._selfTurn;
  7934. }
  7935. set selfTurn(val) {
  7936. this.trunCount++;
  7937. this._selfTurn = val;
  7938. if (val) {
  7939. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7940. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7941. }
  7942. else {
  7943. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7944. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7945. if (this.trunCount > 1)
  7946. PlatMgr.openBox();
  7947. }
  7948. }
  7949. resetGame() {
  7950. this.inHoleBalls = [];
  7951. this.isFirstInGame = true;
  7952. this.firstColliObj = null;
  7953. this.aiCamp = "";
  7954. this.selfCamp = "";
  7955. this.aiFoulNum = 0;
  7956. this.selfFoulNum = 0;
  7957. this.selfBallArr = [];
  7958. this.aiBallArr = [];
  7959. this.gamePause = false;
  7960. this.ensureBallType = false;
  7961. this.isInterrupt = false;
  7962. this.updateLeftBall();
  7963. this.clearTime();
  7964. this.aiPlayedBreakArmy = false;
  7965. this.isBlackInHole = false;
  7966. this.placeBallPosData = {};
  7967. if (xGame.common.d3World.knifeRoot) {
  7968. xGame.common.d3World.knifeRoot.destroyChildren();
  7969. }
  7970. }
  7971. gameReady() {
  7972. this.trunCount = 0;
  7973. this.firstColliObj = null;
  7974. this.isFirstInGame = true;
  7975. this.selfTurn = Math.random() <= this.selfTurnRate;
  7976. let challengeNum = DataMgr.getChallengeTimes();
  7977. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7978. this.selfTurn = true;
  7979. }
  7980. if (xGame.common.gameMode == GameMode.placeBall)
  7981. this.selfTurn = true;
  7982. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7983. this.selfTurn = true;
  7984. }
  7985. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7986. this.checkGuide();
  7987. if (xGame.common.uiRodMethod)
  7988. xGame.common.uiRodMethod.resetRod();
  7989. xGame.common.d2World.getHelpLine();
  7990. this.isOpenBall = true;
  7991. this.isTouchedBall = false;
  7992. xGame.common.aiPlayer.stopRun();
  7993. this.setTime = 30;
  7994. let ui = xGame.common.gameUI.ui;
  7995. switch (xGame.common.gameMode) {
  7996. case GameMode.classic:
  7997. xGame.common.aiPlayer.init();
  7998. this.blackNum = 8;
  7999. this.placeRootBall();
  8000. this.peoplePlay(9, 10);
  8001. ui.wordsBtn.visible = true;
  8002. ui.aiWordsBtn.visible = true;
  8003. xGame.common.talkMgr.changeAIState(true);
  8004. DataMgr.gameData.gameCount++;
  8005. DataMgr.saveGameData();
  8006. break;
  8007. case GameMode.bigMove:
  8008. this.blackNum = -1;
  8009. this.selfScore = 0;
  8010. this.aiScore = 0;
  8011. xGame.common.aiPlayer.init();
  8012. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8013. this.updateSelfScore();
  8014. this.updateAIScore();
  8015. this.updateTargetSroce();
  8016. this.placeRootBall();
  8017. this.peoplePlay(9, 10);
  8018. ui.wordsBtn.visible = true;
  8019. ui.aiWordsBtn.visible = true;
  8020. xGame.common.talkMgr.changeAIState(true);
  8021. if (DataMgr.getSkillGuide() < 1)
  8022. DataMgr.gameData.gameCount = 0;
  8023. else {
  8024. DataMgr.gameData.gameCount++;
  8025. DataMgr.saveGameData();
  8026. PlatMgr.openTry();
  8027. }
  8028. if (xGame.common.d3World.knifeRoot) {
  8029. xGame.common.d3World.knifeRoot.destroyChildren();
  8030. }
  8031. break;
  8032. case GameMode.placeBall:
  8033. this.blackNum = -1;
  8034. this.selfTurn = true;
  8035. this.setTime = 10000;
  8036. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8037. this.curHP = this.placeBallData.hp;
  8038. if (this.placeBallData.ball == -1)
  8039. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8040. else
  8041. this.needBalls = this.placeBallData.ball;
  8042. console.log("需要的进球数目", this.needBalls);
  8043. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8044. this.finishBalls = 0;
  8045. this.placeBallPosData = {};
  8046. this.updatePlaceBallPos();
  8047. this.updatePlaceBallState();
  8048. this.finishOneShoot = true;
  8049. xGame.common.gameUI.ui.moveNode.visible = false;
  8050. this.isOpenBall = false;
  8051. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8052. ui.wordsBtn.visible = false;
  8053. ui.aiWordsBtn.visible = false;
  8054. xGame.common.talkMgr.changeAIState(false);
  8055. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8056. PlatMgr.openBox();
  8057. });
  8058. break;
  8059. default:
  8060. break;
  8061. }
  8062. this.showLongView = false;
  8063. xGame.common.wordsMgr.comboTimes = 1;
  8064. let guide = DataMgr.getSkillGuide();
  8065. if (guide)
  8066. xGame.eventMgr.event(WAIT_SHOOT);
  8067. xGame.common.upSkillLevel = false;
  8068. xGame.common.gameStartTime = new Date().getTime();
  8069. this.firstShoot = true;
  8070. }
  8071. checkGuide() {
  8072. let guide = DataMgr.getSkillGuide();
  8073. let gameUI = xGame.common.gameUI.ui;
  8074. gameUI.guide1.visible = false;
  8075. gameUI.guide2.visible = false;
  8076. gameUI.guide3.visible = false;
  8077. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8078. this.selfTurn = true;
  8079. }
  8080. else {
  8081. return;
  8082. }
  8083. let oneBall = this.getOneBall();
  8084. gameUI.guide1.visible = true;
  8085. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8086. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8087. }
  8088. getOneBall() {
  8089. let arr = xGame.common.d2World.ballArr;
  8090. for (let index = 0; index < arr.length; index++) {
  8091. if (arr[index].number == 0)
  8092. continue;
  8093. return arr[index];
  8094. }
  8095. }
  8096. updateSelfScore() {
  8097. let ui = xGame.common.gameUI.ui.topNode;
  8098. ui.selfScoreTxt.text = this.selfScore + "";
  8099. }
  8100. updateAIScore() {
  8101. let ui = xGame.common.gameUI.ui.topNode;
  8102. ui.aiScoreTxt.text = this.aiScore + "";
  8103. }
  8104. updateTargetSroce() {
  8105. let ui = xGame.common.gameUI.ui.topNode;
  8106. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8107. }
  8108. updateLeftBall() {
  8109. let topUI = xGame.common.gameUI.ui.topNode;
  8110. topUI.selfBallList.numItems = this.selfBallArr.length;
  8111. topUI.aiBallList.numItems = this.aiBallArr.length;
  8112. }
  8113. ballShoot() {
  8114. this.clearTime();
  8115. this.finishOneShoot = false;
  8116. xGame.common.gameUI.ui.moveNode.visible = false;
  8117. if (xGame.common.gameUI.ui.guideNode.visible) {
  8118. xGame.common.gameUI.ui.guideNode.visible = false;
  8119. }
  8120. if (this.firstShoot) {
  8121. this.firstShoot = false;
  8122. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8123. }
  8124. }
  8125. ensureCamp(number) {
  8126. this.ensureBallType = true;
  8127. this.isOpenBall = false;
  8128. if (xGame.common.gameMode != GameMode.classic)
  8129. return;
  8130. let full = [1, 2, 3, 4, 5, 6, 7];
  8131. let flower = [9, 10, 11, 12, 13, 14, 15];
  8132. let sayWords = "";
  8133. if (this.selfTurn) {
  8134. if (number <= 7) {
  8135. this.selfCamp = ballCamp.full;
  8136. this.selfBallArr = full;
  8137. this.aiCamp = ballCamp.flower;
  8138. this.aiBallArr = flower;
  8139. sayWords = cfgTable.wordsData[3].msg;
  8140. }
  8141. else {
  8142. this.selfCamp = ballCamp.flower;
  8143. this.selfBallArr = flower;
  8144. this.aiCamp = ballCamp.full;
  8145. this.aiBallArr = full;
  8146. sayWords = cfgTable.wordsData[4].msg;
  8147. }
  8148. }
  8149. else {
  8150. if (number <= 7) {
  8151. this.selfCamp = ballCamp.flower;
  8152. this.selfBallArr = flower;
  8153. this.aiCamp = ballCamp.full;
  8154. this.aiBallArr = full;
  8155. sayWords = cfgTable.wordsData[2].msg;
  8156. }
  8157. else {
  8158. this.selfCamp = ballCamp.full;
  8159. this.selfBallArr = full;
  8160. this.aiCamp = ballCamp.flower;
  8161. this.aiBallArr = flower;
  8162. sayWords = cfgTable.wordsData[1].msg;
  8163. }
  8164. }
  8165. this.updateLeftBall();
  8166. xGame.uiMgr.Show(UIMsg, sayWords);
  8167. }
  8168. updatePlaceBallState() {
  8169. let ui = xGame.common.gameUI.ui;
  8170. switch (this.placeBallData.type) {
  8171. case PlaceBallType.normal:
  8172. let normal = ui.placeNormalNode;
  8173. normal.hpTxt.text = this.curHP + "";
  8174. this.updatePlaceBallStar(normal);
  8175. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8176. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8177. break;
  8178. case PlaceBallType.challenge:
  8179. let challenge = ui.placeChallengeNode;
  8180. challenge.hpTxt.text = "Shots:" + this.curHP;
  8181. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8182. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8183. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8184. break;
  8185. default:
  8186. break;
  8187. }
  8188. }
  8189. playSubHpAni() {
  8190. let ui = xGame.common.gameUI.ui;
  8191. switch (this.placeBallData.type) {
  8192. case PlaceBallType.normal:
  8193. let normal = ui.placeNormalNode;
  8194. normal.hpTxt.visible = false;
  8195. normal.starAni.c1.selectedIndex = 1;
  8196. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8197. normal.hpTxt.visible = true;
  8198. normal.starAni.c1.selectedIndex = 0;
  8199. }));
  8200. break;
  8201. default:
  8202. break;
  8203. }
  8204. }
  8205. getEndStarNum() {
  8206. let num;
  8207. let level = xGame.common.placeBallCurLevel;
  8208. if (this.curHP == this.placeBallData.hp) {
  8209. num = 3;
  8210. }
  8211. else if (this.curHP <= 1) {
  8212. num = 1;
  8213. }
  8214. else {
  8215. num = 2;
  8216. }
  8217. if (!this.success) {
  8218. num = 0;
  8219. }
  8220. else {
  8221. DataMgr.setPlaceBallLevel(level, num);
  8222. }
  8223. let myType = cfgTable.placeballData[level].type;
  8224. if (this.success && myType == 1) {
  8225. num = 3;
  8226. }
  8227. xGame.common.placeBallStarNum = num;
  8228. }
  8229. updatePlaceBallStar(node) {
  8230. let star = 0;
  8231. if (this.curHP == this.placeBallData.hp) {
  8232. star = 3;
  8233. }
  8234. else if (this.curHP >= 2) {
  8235. star = 2;
  8236. }
  8237. else if (this.curHP == 1) {
  8238. star = 1;
  8239. }
  8240. else {
  8241. star = 0;
  8242. }
  8243. let temp;
  8244. for (let index = 1; index <= 3; index++) {
  8245. temp = node["star" + index];
  8246. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8247. }
  8248. node.myProgress.value = (star / 3) * 100;
  8249. }
  8250. openRegretView(isFoul, GoalNum, challenge = false) {
  8251. let regretType = -1;
  8252. if (isFoul) {
  8253. regretType = 1;
  8254. }
  8255. else {
  8256. if (GoalNum <= 0) {
  8257. regretType = 0;
  8258. }
  8259. }
  8260. if (challenge) {
  8261. regretType = 1;
  8262. }
  8263. if (regretType != -1) {
  8264. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8265. if (success) {
  8266. this.curHP++;
  8267. this.updatePlaceBallState();
  8268. this.setPlaceBallAllPos();
  8269. xGame.common.gameUI.ui.moveNode.visible = false;
  8270. }
  8271. else {
  8272. if (this.curHP <= 0) {
  8273. this.success = false;
  8274. this.gameEnd();
  8275. }
  8276. this.playSubHpAni();
  8277. }
  8278. this.updatePlaceBallState();
  8279. this.updatePlaceBallPos();
  8280. });
  8281. }
  8282. }
  8283. setPlaceBallAllPos() {
  8284. let allBall = xGame.common.d2World.ballArr;
  8285. let cfgArr = this.placeBallPosData;
  8286. let temp;
  8287. let obj;
  8288. for (let index = 0; index < allBall.length; index++) {
  8289. temp = allBall[index];
  8290. if (temp.destroyed)
  8291. continue;
  8292. obj = cfgArr[temp.myUNID];
  8293. if (obj && obj.src && !obj.src.destroyed) {
  8294. temp.gameObj.x = obj.posX;
  8295. temp.gameObj.y = obj.posY;
  8296. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8297. }
  8298. }
  8299. xGame.common.d2World.getHelpLine();
  8300. }
  8301. updatePlaceBallPos() {
  8302. let arr = xGame.common.d2World.ballArr;
  8303. let temp;
  8304. for (let index = 0; index < arr.length; index++) {
  8305. temp = arr[index];
  8306. if (!this.placeBallPosData[temp.myUNID]) {
  8307. this.placeBallPosData[temp.myUNID] = {
  8308. src: temp,
  8309. posX: temp.gameObj.x,
  8310. posY: temp.gameObj.y
  8311. };
  8312. }
  8313. else {
  8314. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8315. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8316. }
  8317. }
  8318. let check;
  8319. for (const key in this.placeBallPosData) {
  8320. check = this.placeBallPosData[key];
  8321. if (check.src.destroyed) {
  8322. delete this.placeBallPosData[key];
  8323. }
  8324. }
  8325. }
  8326. gameRun(type) {
  8327. if (this.gamePause)
  8328. return;
  8329. this.curFoul = this.getFoulType();
  8330. if (type) {
  8331. xGame.common.d2World.d2Gan.shoot();
  8332. xGame.common.gameUI.forceCancel();
  8333. this.curFoul = type;
  8334. }
  8335. this.isEnd = false;
  8336. this.isChangeTurn = true;
  8337. if (xGame.common.gameMode == GameMode.classic) {
  8338. this.judgeClassic(this.curFoul);
  8339. this.checkClassicWords(() => {
  8340. xGame.common.destroyClassicEmotion();
  8341. if (this.isEnd) {
  8342. if (this.isBlackInHole) {
  8343. xGame.common.gameUI.ui.blackAni.visible = true;
  8344. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8345. xGame.common.gameUI.ui.blackAni.visible = false;
  8346. this.gameEnd();
  8347. }));
  8348. }
  8349. else {
  8350. this.gameEnd();
  8351. }
  8352. }
  8353. else {
  8354. this.waitShoot();
  8355. xGame.eventMgr.event(WAIT_SHOOT);
  8356. }
  8357. });
  8358. }
  8359. else if (xGame.common.gameMode == GameMode.bigMove) {
  8360. xGame.common.aiPlayer.stopRun();
  8361. let scoreArr = this.getScore(this.curFoul);
  8362. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8363. this.isEnd = true;
  8364. }
  8365. this.checkBigSkillWords(() => {
  8366. if (this.isEnd) {
  8367. this.gameEnd();
  8368. }
  8369. else {
  8370. this.waitShoot();
  8371. xGame.eventMgr.event(WAIT_SHOOT);
  8372. }
  8373. });
  8374. }
  8375. else if (xGame.common.gameMode == GameMode.placeBall) {
  8376. xGame.common.destroyAwardSpine();
  8377. let isFoul = this.curFoul == FoulType.rootHole;
  8378. let GoalNum = this.inHoleBalls.length;
  8379. if (this.inHoleBalls.indexOf(0) > -1)
  8380. GoalNum -= 1;
  8381. if (isFoul) {
  8382. this.placeRootBall();
  8383. }
  8384. console.log("neeballs", this.needBalls);
  8385. console.log("当前完成的goalNum", GoalNum);
  8386. this.finishBalls += GoalNum;
  8387. console.log("当前完成的finishballs", this.finishBalls);
  8388. let need = this.needBalls;
  8389. if (this.placeBallData.type == PlaceBallType.challenge) {
  8390. need += 100;
  8391. }
  8392. if (this.finishBalls >= need) {
  8393. this.success = true;
  8394. this.gameEnd();
  8395. }
  8396. else {
  8397. switch (this.placeBallData.type) {
  8398. case PlaceBallType.normal:
  8399. if (!isFoul && GoalNum > 0) {
  8400. this.updatePlaceBallPos();
  8401. this.updatePlaceBallState();
  8402. }
  8403. else {
  8404. this.curHP--;
  8405. this.openRegretView(isFoul, GoalNum);
  8406. }
  8407. this.waitShoot();
  8408. xGame.eventMgr.event(WAIT_SHOOT);
  8409. break;
  8410. case PlaceBallType.challenge:
  8411. this.curHP--;
  8412. this.updatePlaceBallState();
  8413. if (isFoul) {
  8414. this.openRegretView(isFoul, GoalNum, true);
  8415. }
  8416. else {
  8417. this.updatePlaceBallPos();
  8418. if (this.curHP <= 0) {
  8419. this.success = true;
  8420. this.gameEnd();
  8421. }
  8422. }
  8423. this.waitShoot();
  8424. xGame.eventMgr.event(WAIT_SHOOT);
  8425. break;
  8426. default:
  8427. break;
  8428. }
  8429. }
  8430. }
  8431. }
  8432. checkClassicWords(callback) {
  8433. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8434. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8435. let type = this.getClassicWordsType();
  8436. if (condition && type != -1) {
  8437. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8438. xGame.soundMgr.playSound(str);
  8439. xGame.common.wordsMgr.playClassicWords(type, callback);
  8440. }
  8441. else {
  8442. Laya.timer.once(300, this, () => {
  8443. callback && callback();
  8444. });
  8445. }
  8446. }
  8447. getClassicWordsType() {
  8448. let d2world = xGame.common.d2World;
  8449. let type = -1;
  8450. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8451. type = ClassicWordsType.perfectShow;
  8452. return type;
  8453. }
  8454. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8455. type = ClassicWordsType.directShoot;
  8456. return type;
  8457. }
  8458. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8459. type = ClassicWordsType.anotherShoot;
  8460. return type;
  8461. }
  8462. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8463. type = ClassicWordsType.bigPower;
  8464. return type;
  8465. }
  8466. let minSpeed = 1;
  8467. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8468. type = ClassicWordsType.hardShoot;
  8469. return type;
  8470. }
  8471. if (this.inHoleBalls.length > 0) {
  8472. type = ClassicWordsType.directShoot;
  8473. return type;
  8474. }
  8475. return type;
  8476. }
  8477. checkBigSkillWords(callback) {
  8478. if (this.curFoul == FoulType.timeOut) {
  8479. callback && callback();
  8480. }
  8481. else {
  8482. let playSkill = false;
  8483. if (this.selfTurn) {
  8484. playSkill = true;
  8485. }
  8486. else {
  8487. if (!this.aiPlayedBreakArmy) {
  8488. this.aiPlayedBreakArmy = true;
  8489. playSkill = true;
  8490. }
  8491. if (this.aiCurSkill != SkillType.breakArmy) {
  8492. playSkill = true;
  8493. }
  8494. }
  8495. if (xGame.common.skillMgr.playedLastSkill) {
  8496. xGame.common.skillMgr.playedLastSkill = false;
  8497. playSkill = false;
  8498. }
  8499. if (playSkill) {
  8500. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8501. let selfExtra = 0;
  8502. let aiExtra = 0;
  8503. if (this.selfTurn)
  8504. selfExtra += extraScore;
  8505. else
  8506. aiExtra += extraScore;
  8507. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8508. this.isEnd = true;
  8509. }
  8510. this.playBigSkillTimes(callback);
  8511. });
  8512. }
  8513. else {
  8514. this.playBigSkillTimes(callback);
  8515. }
  8516. }
  8517. }
  8518. playBigSkillTimes(callback) {
  8519. let length = this.inHoleBalls.length;
  8520. if (this.inHoleBalls.indexOf(0) > -1) {
  8521. length = this.inHoleBalls.length - 1;
  8522. }
  8523. if (length <= 0) {
  8524. callback && callback();
  8525. return;
  8526. }
  8527. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8528. callback && callback();
  8529. });
  8530. }
  8531. playSkillTips() {
  8532. let levelNum = 0;
  8533. let curType;
  8534. if (this.selfTurn) {
  8535. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8536. curType = this.selfCurSkill;
  8537. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8538. levelNum += 5;
  8539. }
  8540. }
  8541. else {
  8542. levelNum = this.aiSkillLevelNum;
  8543. curType = this.aiCurSkill;
  8544. }
  8545. let str = ``;
  8546. switch (curType) {
  8547. case SkillType.highSpace:
  8548. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8549. break;
  8550. case SkillType.breakArmy:
  8551. str = `You pocketed ${levelNum} extra balls`;
  8552. break;
  8553. case SkillType.ice:
  8554. str = `${levelNum * 2} extra balls were frozen`;
  8555. break;
  8556. case SkillType.fireworks:
  8557. str = `${levelNum} extra balls exploded `;
  8558. break;
  8559. case SkillType.GuanYu:
  8560. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8561. break;
  8562. default:
  8563. break;
  8564. }
  8565. xGame.uiMgr.Show(UIMsg, str);
  8566. }
  8567. getFoulType() {
  8568. let foulType = "";
  8569. if (this.firstColliObj == null) {
  8570. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8571. return FoulType.rootHole;
  8572. }
  8573. return FoulType.notTouch;
  8574. }
  8575. else {
  8576. if (this.selfTurn) {
  8577. if (this.selfBallArr.length > 0) {
  8578. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8579. foulType = FoulType.wrongTouch;
  8580. }
  8581. }
  8582. else {
  8583. if (this.ensureBallType) {
  8584. }
  8585. else {
  8586. if (this.firstColliObj == this.blackNum) {
  8587. foulType = FoulType.wrongTouch;
  8588. }
  8589. }
  8590. }
  8591. }
  8592. else {
  8593. if (this.aiBallArr.length > 0) {
  8594. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8595. foulType = FoulType.wrongTouch;
  8596. }
  8597. }
  8598. else {
  8599. if (this.ensureBallType) {
  8600. }
  8601. else {
  8602. if (this.firstColliObj == this.blackNum) {
  8603. foulType = FoulType.wrongTouch;
  8604. }
  8605. }
  8606. }
  8607. }
  8608. if (this.inHoleBalls.length <= 0) {
  8609. return foulType;
  8610. }
  8611. let temp;
  8612. if (this.inHoleBalls.indexOf(0) > -1) {
  8613. foulType = FoulType.rootHole;
  8614. }
  8615. else {
  8616. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8617. temp = this.inHoleBalls[index];
  8618. if (this.selfTurn) {
  8619. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8620. foulType = FoulType.wrongHole;
  8621. break;
  8622. }
  8623. }
  8624. else {
  8625. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8626. foulType = FoulType.wrongHole;
  8627. break;
  8628. }
  8629. }
  8630. }
  8631. }
  8632. let foo;
  8633. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8634. temp = this.inHoleBalls[index];
  8635. foo = this.selfBallArr.indexOf(temp);
  8636. if (foo > -1) {
  8637. this.selfBallArr.splice(foo, 1);
  8638. }
  8639. foo = this.aiBallArr.indexOf(temp);
  8640. if (foo > -1) {
  8641. this.aiBallArr.splice(foo, 1);
  8642. }
  8643. }
  8644. this.updateLeftBall();
  8645. }
  8646. return foulType;
  8647. }
  8648. judgeGameEndByBlack(arr) {
  8649. if (this.selfTurn) {
  8650. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8651. this.selfFoulNum = this.maxFoulTimes;
  8652. return true;
  8653. }
  8654. }
  8655. else {
  8656. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8657. this.aiFoulNum = this.maxFoulTimes;
  8658. return true;
  8659. }
  8660. }
  8661. }
  8662. judgeClassic(type) {
  8663. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8664. xGame.common.aiPlayer.stopRun();
  8665. if (this.judgeNormalSuccess()) {
  8666. this.isEnd = true;
  8667. return;
  8668. }
  8669. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8670. if (this.selfTurn) {
  8671. if (isFoul) {
  8672. this.selfFoulNum++;
  8673. }
  8674. if (this.selfFoulNum >= this.maxFoulTimes) {
  8675. this.success = false;
  8676. this.isEnd = true;
  8677. return;
  8678. }
  8679. }
  8680. else {
  8681. if (isFoul)
  8682. this.aiFoulNum++;
  8683. if (this.aiFoulNum >= this.maxFoulTimes) {
  8684. this.success = true;
  8685. this.isEnd = true;
  8686. return;
  8687. }
  8688. }
  8689. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8690. this.isChangeTurn = false;
  8691. }
  8692. else {
  8693. this.isInterrupt = true;
  8694. }
  8695. }
  8696. waitShoot() {
  8697. if (xGame.common.gameMode == GameMode.classic) {
  8698. switch (this.curFoul) {
  8699. case FoulType.timeOut:
  8700. case FoulType.rootHole:
  8701. this.selfTurn = !this.selfTurn;
  8702. this.peoplePlay(5, 6, true);
  8703. break;
  8704. case FoulType.notTouch:
  8705. this.selfTurn = !this.selfTurn;
  8706. this.peoplePlay(7, 7);
  8707. break;
  8708. case FoulType.wrongHole:
  8709. this.selfTurn = !this.selfTurn;
  8710. this.peoplePlay(11, 11);
  8711. break;
  8712. default:
  8713. if (this.inHoleBalls.length > 0) {
  8714. this.peoplePlay(0, 0, false, false);
  8715. }
  8716. else {
  8717. this.selfTurn = !this.selfTurn;
  8718. this.peoplePlay(7, 7);
  8719. }
  8720. break;
  8721. }
  8722. }
  8723. else if (xGame.common.gameMode == GameMode.bigMove) {
  8724. if (this.curFoul == FoulType.timeOut) {
  8725. this.selfTurn = !this.selfTurn;
  8726. this.peoplePlay(14, 15);
  8727. this.placeRootBall();
  8728. }
  8729. else {
  8730. this.selfTurn = !this.selfTurn;
  8731. if (this.curFoul == FoulType.rootHole) {
  8732. this.peoplePlay(12, 13);
  8733. this.placeRootBall();
  8734. }
  8735. else {
  8736. this.peoplePlay(0, 0, false, false);
  8737. }
  8738. }
  8739. }
  8740. else if (xGame.common.gameMode == GameMode.placeBall) {
  8741. this.finishOneShoot = true;
  8742. }
  8743. this.gameResult();
  8744. }
  8745. gameResult() {
  8746. this.firstColliObj = null;
  8747. this.inHoleBalls = [];
  8748. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8749. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8750. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8751. if (xGame.common.uiRodMethod)
  8752. xGame.common.uiRodMethod.resetRod();
  8753. xGame.common.d2World.rootBall.showSelf();
  8754. this.clearIceSkill();
  8755. if (this.selfTurn) {
  8756. PlatMgr.gameInsert();
  8757. }
  8758. xGame.common.d3World.knifeRoot.destroyChildren();
  8759. if (this.selfTurn) {
  8760. xGame.common.gameUI.showHelpLineGuide();
  8761. xGame.common.gameUI.setTurnAlpha(true);
  8762. }
  8763. else {
  8764. xGame.common.gameUI.setTurnAlpha(false);
  8765. }
  8766. }
  8767. getScore(type) {
  8768. let selfAdd = 0;
  8769. let aiAdd = 0;
  8770. if (type == FoulType.timeOut) {
  8771. if (this.selfTurn)
  8772. aiAdd += 3;
  8773. else
  8774. selfAdd += 3;
  8775. }
  8776. else {
  8777. if (this.inHoleBalls.length > 0) {
  8778. if (this.selfTurn) {
  8779. if (type == FoulType.rootHole) {
  8780. aiAdd += 3;
  8781. if (this.inHoleBalls.length - 1 > 0) {
  8782. selfAdd += this.inHoleBalls.length - 1;
  8783. }
  8784. }
  8785. else {
  8786. selfAdd += this.inHoleBalls.length;
  8787. }
  8788. }
  8789. else {
  8790. if (type == FoulType.rootHole) {
  8791. selfAdd += 3;
  8792. if (this.inHoleBalls.length - 1 > 0) {
  8793. aiAdd += this.inHoleBalls.length - 1;
  8794. }
  8795. }
  8796. else {
  8797. aiAdd += this.inHoleBalls.length;
  8798. }
  8799. }
  8800. }
  8801. }
  8802. return [selfAdd, aiAdd];
  8803. }
  8804. judgeScoreEnd(selfAdd, aiAdd) {
  8805. this.selfScore += selfAdd;
  8806. this.aiScore += aiAdd;
  8807. this.updateAIScore();
  8808. this.updateSelfScore();
  8809. if (this.selfScore >= this.targertScore) {
  8810. this.success = true;
  8811. return true;
  8812. }
  8813. if (this.aiScore >= this.targertScore) {
  8814. this.success = false;
  8815. return true;
  8816. }
  8817. let ballArr = xGame.common.d2World.ballArr;
  8818. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8819. if (this.selfScore > this.aiScore) {
  8820. this.success = true;
  8821. return true;
  8822. }
  8823. else if (this.selfScore < this.aiScore) {
  8824. this.success = false;
  8825. return true;
  8826. }
  8827. else {
  8828. if (this.selfTurn) {
  8829. this.success = false;
  8830. }
  8831. else {
  8832. this.success = true;
  8833. }
  8834. return true;
  8835. }
  8836. }
  8837. }
  8838. clearIceSkill() {
  8839. let arr = xGame.common.d2World.ballArr;
  8840. let temp;
  8841. if (this.selfTurn) {
  8842. if (this.selfCurSkill == SkillType.ice) {
  8843. for (let index = 0; index < arr.length; index++) {
  8844. temp = arr[index];
  8845. if (temp.ballFunc == "ice") {
  8846. temp.setBallFunc("normal", "self");
  8847. }
  8848. }
  8849. }
  8850. }
  8851. else {
  8852. if (this.aiCurSkill == SkillType.ice) {
  8853. for (let index = 0; index < arr.length; index++) {
  8854. temp = arr[index];
  8855. if (temp.ballFunc == "ice") {
  8856. temp.setBallFunc("normal", "ai");
  8857. }
  8858. }
  8859. }
  8860. }
  8861. }
  8862. judgeNormalSuccess() {
  8863. if (this.selfTurn) {
  8864. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8865. this.success = true;
  8866. return true;
  8867. }
  8868. }
  8869. else {
  8870. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8871. this.success = false;
  8872. return true;
  8873. }
  8874. }
  8875. }
  8876. gameEnd() {
  8877. if (Moyu.isTT) {
  8878. xGame.common.screenImg = getScreenImg();
  8879. }
  8880. console.log("游戏结束", this.success);
  8881. xGame.common.aiPlayer.stopRun();
  8882. if (xGame.common.gameMode == GameMode.placeBall) {
  8883. this.getEndStarNum();
  8884. this.updatePlaceBallState();
  8885. }
  8886. this.isEnter = false;
  8887. Moyu.recordEnd(this, () => {
  8888. if (this.isEnter)
  8889. return;
  8890. this.isEnter = true;
  8891. console.log("进入录结束回调");
  8892. this.enterNext();
  8893. });
  8894. Laya.timer.once(1000, this, () => {
  8895. if (this.isEnter)
  8896. return;
  8897. this.isEnter = true;
  8898. this.enterNext();
  8899. });
  8900. xGame.common.longHelpLine = false;
  8901. }
  8902. enterNext() {
  8903. Laya.timer.clearAll(this);
  8904. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8905. xGame.uiMgr.Show(UIVideoShare, this.success);
  8906. }
  8907. else {
  8908. xGame.uiMgr.Show(UIGameEnd, this.success);
  8909. }
  8910. }
  8911. aiLeave() {
  8912. let ui = xGame.common.gameUI.ui;
  8913. ui.topNode.aiNameTxt.text = "offline";
  8914. }
  8915. aiGameEnd(suc) {
  8916. this.success = suc;
  8917. xGame.common.aiPlayer.stopRun();
  8918. if (this.success) {
  8919. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8920. Laya.timer.once(1000, this, () => {
  8921. this.clearTime();
  8922. this.gameEnd();
  8923. });
  8924. }
  8925. }
  8926. openTimer() {
  8927. let src = xGame.common.gameUI;
  8928. if (this.selfTurn) {
  8929. src.ui.topNode.selfProgress.visible = true;
  8930. src.ui.topNode.aiProgress.visible = false;
  8931. this.curTimer = src.ui.topNode.selfProgress;
  8932. }
  8933. else {
  8934. src.ui.topNode.selfProgress.visible = false;
  8935. src.ui.topNode.aiProgress.visible = true;
  8936. this.curTimer = src.ui.topNode.aiProgress;
  8937. }
  8938. this.accTime = 0;
  8939. Laya.timer.clearAll(this);
  8940. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8941. this.curTimer.value = 100;
  8942. }
  8943. updateTime(dt) {
  8944. if (this.gamePause)
  8945. return;
  8946. this.accTime += dt;
  8947. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8948. if (this.accTime >= this.setTime) {
  8949. this.clearTime();
  8950. console.log("时钟进入了gameRun");
  8951. this.gameRun(FoulType.timeOut);
  8952. }
  8953. }
  8954. clearTime() {
  8955. let src = xGame.common.gameUI;
  8956. src.ui.topNode.selfProgress.visible = false;
  8957. src.ui.topNode.aiProgress.visible = false;
  8958. Laya.timer.clearAll(this);
  8959. }
  8960. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8961. let ui = xGame.common.gameUI.ui;
  8962. let selfMsg, aiMsg;
  8963. if (sayWords) {
  8964. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8965. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8966. if (Foul) {
  8967. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8968. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8969. this.placeRootBall();
  8970. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8971. if (this.curFoul == FoulType.rootHole) {
  8972. if (!DataMgr.getRootBallFoul()) {
  8973. DataMgr.setRootBallFoul();
  8974. aiMsg = "";
  8975. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8976. let woman = "Boss, pay attention next time~";
  8977. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8978. }
  8979. }
  8980. else if (this.curFoul == FoulType.timeOut) {
  8981. if (!DataMgr.getTimeoutFoul()) {
  8982. DataMgr.setTimeoutFoul();
  8983. aiMsg = "";
  8984. let tips = "Game timeout, 3 fouls, this game failed.";
  8985. let woman = "Boss, pay attention to the timeline~";
  8986. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8987. }
  8988. }
  8989. }
  8990. }
  8991. }
  8992. if (this.selfTurn) {
  8993. if (sayWords) {
  8994. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8995. ui.selfTurn.visible = true;
  8996. ui.aiTurn.visible = false;
  8997. ui.selfTurn.t0.play();
  8998. Moyu.vibration();
  8999. });
  9000. }
  9001. }
  9002. else {
  9003. let aiNum = xGame.tools.random(1, 11);
  9004. let challengeNum = DataMgr.getChallengeTimes();
  9005. let delay = false;
  9006. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9007. aiNum = 9;
  9008. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9009. aiNum = 3;
  9010. if (challengeNum == 3) {
  9011. if (!this.showLongView) {
  9012. this.showLongView = true;
  9013. delay = true;
  9014. }
  9015. }
  9016. }
  9017. }
  9018. if (delay) {
  9019. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9020. if (success) {
  9021. xGame.common.longHelpLine = true;
  9022. xGame.common.d2World.getHelpLine();
  9023. }
  9024. else {
  9025. aiNum = 10;
  9026. }
  9027. xGame.common.aiPlayer.setAiLevel(aiNum);
  9028. if (sayWords) {
  9029. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9030. xGame.common.aiPlayer.runAI();
  9031. ui.selfTurn.visible = false;
  9032. ui.aiTurn.visible = true;
  9033. ui.aiTurn.t0.play();
  9034. });
  9035. }
  9036. else {
  9037. xGame.common.aiPlayer.runAI();
  9038. }
  9039. this.openTimer();
  9040. this.finishOneShoot = true;
  9041. if (this.selfTurn) {
  9042. ui.topNode.selfKuang.visible = true;
  9043. ui.topNode.aiKuang.visible = false;
  9044. ui.topNode.selfTips.visible = true;
  9045. ui.topNode.aiTips.visible = false;
  9046. }
  9047. else {
  9048. ui.topNode.selfKuang.visible = false;
  9049. ui.topNode.aiKuang.visible = true;
  9050. ui.topNode.selfTips.visible = false;
  9051. ui.topNode.aiTips.visible = true;
  9052. }
  9053. });
  9054. return;
  9055. }
  9056. if (xGame.common.gameMode == GameMode.classic) {
  9057. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9058. if (cfg) {
  9059. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9060. aiNum = aiLevel;
  9061. }
  9062. }
  9063. xGame.common.aiPlayer.setAiLevel(aiNum);
  9064. if (sayWords) {
  9065. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9066. xGame.common.aiPlayer.runAI();
  9067. ui.selfTurn.visible = false;
  9068. ui.aiTurn.visible = true;
  9069. ui.aiTurn.t0.play();
  9070. });
  9071. }
  9072. else {
  9073. xGame.common.aiPlayer.runAI();
  9074. }
  9075. }
  9076. this.openTimer();
  9077. this.finishOneShoot = true;
  9078. if (this.selfTurn) {
  9079. ui.topNode.selfKuang.visible = true;
  9080. ui.topNode.aiKuang.visible = false;
  9081. ui.topNode.selfTips.visible = true;
  9082. ui.topNode.aiTips.visible = false;
  9083. }
  9084. else {
  9085. ui.topNode.selfKuang.visible = false;
  9086. ui.topNode.aiKuang.visible = true;
  9087. ui.topNode.selfTips.visible = false;
  9088. ui.topNode.aiTips.visible = true;
  9089. }
  9090. }
  9091. placeRootBall() {
  9092. let rootBall = xGame.common.d2World.rootBall;
  9093. if (!rootBall)
  9094. return;
  9095. rootBall.gameObj.x = this.lastRootBallPos.x;
  9096. rootBall.gameObj.y = this.lastRootBallPos.y;
  9097. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9098. let moveNode = xGame.common.gameUI.ui.moveNode;
  9099. moveNode.visible = true;
  9100. moveNode.x = this.lastRootBallPos.x;
  9101. moveNode.y = this.lastRootBallPos.y;
  9102. if (!this.selfTurn) {
  9103. xGame.common.aiPlayer.resetRoot();
  9104. }
  9105. }
  9106. }
  9107. class ui_guanyuAni extends fgui.GComponent {
  9108. static createInstance() {
  9109. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9110. }
  9111. onConstruct() {
  9112. this.n0 = (this.getChild("n0"));
  9113. }
  9114. }
  9115. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9116. class UIFireworks extends UIBase {
  9117. constructor() {
  9118. super();
  9119. }
  9120. onConstructor() {
  9121. this.isEject = false;
  9122. }
  9123. show(callback) {
  9124. super.show();
  9125. }
  9126. }
  9127. UIFireworks.uiName = "UIFireworks";
  9128. class ui_UIGuanYu extends fgui.GComponent {
  9129. static createInstance() {
  9130. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9131. }
  9132. onConstruct() {
  9133. this.n2 = (this.getChild("n2"));
  9134. this.n1 = (this.getChild("n1"));
  9135. this.n3 = (this.getChild("n3"));
  9136. this.n4 = (this.getChild("n4"));
  9137. this.n5 = (this.getChild("n5"));
  9138. this.n6 = (this.getChild("n6"));
  9139. this.n8 = (this.getChild("n8"));
  9140. this.n7 = (this.getChild("n7"));
  9141. this.t0 = this.getTransition("t0");
  9142. }
  9143. }
  9144. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9145. class UIGuanYu extends UIBase {
  9146. constructor() {
  9147. super();
  9148. }
  9149. onConstructor() {
  9150. this.ui = ui_UIGuanYu.createInstance();
  9151. this.contentPane = this.ui;
  9152. this.isEject = false;
  9153. }
  9154. show(callback) {
  9155. super.show();
  9156. this.ui.t0.play(Laya.Handler.create(this, () => {
  9157. callback && callback();
  9158. this.hide();
  9159. }));
  9160. }
  9161. }
  9162. UIGuanYu.uiName = "UIGuanYu";
  9163. class SkillMgr {
  9164. constructor() {
  9165. this.leveNum = 0;
  9166. this.extraScore = 0;
  9167. this.selfTurn = false;
  9168. this.playedLastSkill = false;
  9169. this.tweenArr = [];
  9170. this._finishNum = 0;
  9171. this._curFinish = 0;
  9172. this._rootX = 0;
  9173. this._rootY = 0;
  9174. this.knifeTimes = 0;
  9175. this.knifeV2 = new Laya.Vector2();
  9176. this.knifeV3 = new Laya.Vector3();
  9177. this.rtStarX = 0;
  9178. this.rtStarY = 0;
  9179. this.addBigSkillSpine();
  9180. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9181. }
  9182. addBigSkillSpine() {
  9183. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9184. console.log("extra2 success");
  9185. });
  9186. }
  9187. runBigSkill(callback) {
  9188. this.tweenArr = [];
  9189. this.callback = callback;
  9190. this.judgeSkill();
  9191. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9192. let guide = DataMgr.getSkillGuide();
  9193. if (!xGame.common.gameMgr.selfTurn) {
  9194. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9195. }
  9196. else {
  9197. if (xGame.common.temSelfLevel != 0) {
  9198. this.leveNum = xGame.common.temSelfLevel;
  9199. }
  9200. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9201. this.leveNum += 5;
  9202. }
  9203. }
  9204. if (guide == 0) {
  9205. DataMgr.setSkillGuide(1);
  9206. if (DataMgr.getNewUser()) {
  9207. Moyu.sendDataEvent("gameFirstPlay");
  9208. DataMgr.setNewUser();
  9209. }
  9210. }
  9211. this.playSpineAni(() => {
  9212. switch (this.curSkill) {
  9213. case SkillType.highSpace:
  9214. this.runHighSpace();
  9215. break;
  9216. case SkillType.breakArmy:
  9217. this.runBreakArmy();
  9218. break;
  9219. case SkillType.ice:
  9220. this.runIce();
  9221. break;
  9222. case SkillType.fireworks:
  9223. this.runFireworks();
  9224. break;
  9225. case SkillType.GuanYu:
  9226. this.runGuanYu();
  9227. break;
  9228. default:
  9229. break;
  9230. }
  9231. });
  9232. }
  9233. judgeSkill() {
  9234. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9235. let gameMgr = xGame.common.gameMgr;
  9236. let type;
  9237. for (let index = 0; index < typeArr.length; index++) {
  9238. type = typeArr[index];
  9239. if (gameMgr.selfTurn) {
  9240. if (gameMgr.selfCurSkill == type) {
  9241. this.selfTurn = true;
  9242. this.curSkill = type;
  9243. return;
  9244. }
  9245. }
  9246. else {
  9247. if (gameMgr.aiCurSkill == type) {
  9248. this.selfTurn = false;
  9249. this.curSkill = type;
  9250. return;
  9251. }
  9252. }
  9253. }
  9254. }
  9255. playSpineAni(callback) {
  9256. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9257. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9258. parent.destroyChildren();
  9259. let aniIndex = 0;
  9260. let skillSpine;
  9261. switch (this.curSkill) {
  9262. case SkillType.highSpace:
  9263. aniIndex = 1;
  9264. xGame.soundMgr.playSound("skill01");
  9265. skillSpine = this.skillSpine2;
  9266. data.scaleX = 0.5;
  9267. data.scaleY = 0.5;
  9268. skillSpine.play(data, 1, false, parent, () => {
  9269. callback && callback();
  9270. });
  9271. break;
  9272. case SkillType.breakArmy:
  9273. aniIndex = 2;
  9274. xGame.soundMgr.playSound("skill02");
  9275. skillSpine = this.skillSpine2;
  9276. data.scaleX = 0.5;
  9277. data.scaleY = 0.5;
  9278. skillSpine.play(data, 2, false, parent, () => {
  9279. callback && callback();
  9280. });
  9281. break;
  9282. case SkillType.ice:
  9283. aniIndex = 0;
  9284. xGame.soundMgr.playSound("skill03");
  9285. skillSpine = this.skillSpine2;
  9286. data.scaleX = 0.5;
  9287. data.scaleY = 0.5;
  9288. skillSpine.play(data, 0, false, parent, () => {
  9289. callback && callback();
  9290. });
  9291. break;
  9292. case SkillType.fireworks:
  9293. xGame.soundMgr.playSound("skill_04_01");
  9294. xGame.soundMgr.playSound("skill04");
  9295. xGame.uiMgr.Show(UIFireworks, callback);
  9296. break;
  9297. case SkillType.GuanYu:
  9298. xGame.soundMgr.playSound("skill05_1");
  9299. xGame.soundMgr.playSound("skill05");
  9300. xGame.uiMgr.Show(UIGuanYu, callback);
  9301. break;
  9302. default:
  9303. break;
  9304. }
  9305. }
  9306. getAllBallArr() {
  9307. let arr = xGame.common.d2World.ballArr;
  9308. let outArr = [];
  9309. for (let index = 0; index < arr.length; index++) {
  9310. if (arr[index] instanceof D2RootBallSrc)
  9311. continue;
  9312. if (arr[index].ballFunc == "ice")
  9313. continue;
  9314. if (arr[index].destroyed)
  9315. continue;
  9316. outArr.push(arr[index]);
  9317. }
  9318. return outArr;
  9319. }
  9320. getOneArr(deletObj) {
  9321. let allArr = this.getAllBallArr();
  9322. let temp;
  9323. for (let index = 0; index < allArr.length; index++) {
  9324. temp = allArr[index];
  9325. if (temp.id == deletObj.id) {
  9326. allArr.splice(index, 1);
  9327. break;
  9328. }
  9329. }
  9330. return allArr;
  9331. }
  9332. getNearBallBag(ball) {
  9333. let ui = xGame.common.gameUI.ui;
  9334. let circleArr = [];
  9335. for (let index = 1; index <= 6; index++) {
  9336. circleArr.push(ui.border["circle" + index]);
  9337. }
  9338. let outIndex = 0;
  9339. let temp;
  9340. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9341. ;
  9342. let dis = 0;
  9343. for (let index = 1; index < circleArr.length; index++) {
  9344. temp = circleArr[index];
  9345. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9346. if (dis < min) {
  9347. min = dis;
  9348. outIndex = index;
  9349. }
  9350. }
  9351. return [circleArr[outIndex], outIndex];
  9352. }
  9353. ballFlyToBag(ballArr, time = 300) {
  9354. let temp;
  9355. let hole;
  9356. this._finishNum = ballArr.length;
  9357. this._curFinish = 0;
  9358. let holeObj = {};
  9359. let holeCfg = {
  9360. "1": 0,
  9361. "2": 0,
  9362. "3": 0,
  9363. "4": 0,
  9364. "5": 0,
  9365. "6": 0
  9366. };
  9367. for (let index = 0; index < ballArr.length; index++) {
  9368. temp = ballArr[index];
  9369. temp.outColli.isSensor = true;
  9370. temp.innerColli.isSensor = true;
  9371. temp.isRunSkillAni = true;
  9372. let holeArr = this.getNearBallBag(temp);
  9373. hole = holeArr[0];
  9374. holeObj[index] = holeArr[1];
  9375. temp.d3BallSrc.scaleXYZ = 0.5;
  9376. this.tweenArr.push(temp.d3BallSrc, temp);
  9377. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9378. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9379. }));
  9380. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9381. let mIndex = holeObj[this._curFinish];
  9382. let isDone = holeCfg[mIndex];
  9383. if (isDone) {
  9384. ballArr[this._curFinish].checkWrongBall(false);
  9385. }
  9386. else {
  9387. holeCfg[mIndex] = 1;
  9388. ballArr[this._curFinish].checkWrongBall();
  9389. }
  9390. this._curFinish++;
  9391. if (this._curFinish >= this._finishNum) {
  9392. if (this.curSkill == SkillType.highSpace) {
  9393. }
  9394. else if (this.curSkill == SkillType.breakArmy) {
  9395. let rootBall = xGame.common.d2World.rootBall;
  9396. rootBall.gameObj.x = this._rootX;
  9397. rootBall.gameObj.y = this._rootY;
  9398. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9399. xGame.common.d2World.d2Gan.ui.visible = true;
  9400. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9401. xGame.common.d2World.getHelpLine();
  9402. this.callback && this.callback(this.extraScore);
  9403. }
  9404. }
  9405. }));
  9406. }
  9407. }
  9408. runHighSpace() {
  9409. let rootBall = xGame.common.d2World.rootBall;
  9410. rootBall.showSelf();
  9411. let d3Src = rootBall.d3BallSrc;
  9412. let allArr = this.getAllBallArr();
  9413. if (allArr.length <= 0) {
  9414. this.callback && this.callback(0);
  9415. return;
  9416. }
  9417. let selectBall = xGame.common.d2World.targetBall;
  9418. let wrong = selectBall && selectBall.destroyed;
  9419. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9420. selectBall = xGame.common.getRandArrEle(allArr);
  9421. }
  9422. let targetD3Src = selectBall.d3BallSrc;
  9423. xGame.common.d2World.d2Gan.ui.visible = false;
  9424. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9425. d3Src.scaleXYZ = 0.5;
  9426. this.tweenArr.push(d3Src);
  9427. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9428. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9429. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9430. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9431. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9432. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9433. let outArr = [selectBall];
  9434. let other = this.leveNum - 1;
  9435. if (other > 0) {
  9436. let nearArr = this.getOneArr(selectBall);
  9437. if (nearArr.length > 0) {
  9438. xGame.common.botherArr(nearArr);
  9439. if (other >= nearArr.length)
  9440. other = nearArr.length;
  9441. for (let index = 0; index < other; index++) {
  9442. outArr.push(nearArr[index]);
  9443. }
  9444. }
  9445. }
  9446. xGame.common.extraMoveNum = other + 1;
  9447. this.extraScore = other + 1;
  9448. this._rootX = selectBall.gameObj.x;
  9449. this._rootY = selectBall.gameObj.y;
  9450. rootBall.gameObj.x = this._rootX;
  9451. rootBall.gameObj.y = this._rootY;
  9452. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9453. Laya.Tween.clearAll(d3Src);
  9454. this.addRandomForce(outArr);
  9455. }));
  9456. }));
  9457. }
  9458. addRandomForce(outArr) {
  9459. if (outArr.length > 0) {
  9460. xGame.common.d2World.openCheckStill = true;
  9461. this.playedLastSkill = true;
  9462. }
  9463. let temp;
  9464. for (let index = 0; index < outArr.length; index++) {
  9465. let angle = xGame.common.randomNum(0, 360);
  9466. let linearPercent = xGame.common.randomNum(65, 100);
  9467. temp = outArr[index];
  9468. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9469. }
  9470. }
  9471. setLinearSpeed(angle, rigy, linearPercent) {
  9472. let sin = Math.sin(angle * Math.PI / 180);
  9473. let cos = Math.cos(angle * Math.PI / 180);
  9474. let maxSpeed = 4;
  9475. let speed = new Laya.Vector2();
  9476. speed.x = maxSpeed * linearPercent * sin;
  9477. speed.y = -maxSpeed * linearPercent * cos;
  9478. rigy.applyLinearImpulseToCenter(speed);
  9479. }
  9480. runBreakArmy() {
  9481. xGame.common.d2World.d2Gan.ui.visible = false;
  9482. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9483. let gameUI = xGame.common.gameUI.ui;
  9484. gameUI.skillRod.visible = true;
  9485. gameUI.skillRod.rotation = 110;
  9486. let outArr = this.getAllBallArr();
  9487. if (outArr.length <= 0) {
  9488. gameUI.skillRod.visible = false;
  9489. this.callback && this.callback(0);
  9490. return;
  9491. }
  9492. xGame.common.botherArr(outArr);
  9493. if (this.leveNum >= outArr.length)
  9494. this.leveNum = outArr.length;
  9495. let deleteNum = outArr.length - this.leveNum;
  9496. outArr.splice(0, deleteNum);
  9497. this.extraScore = this.leveNum;
  9498. let potX = gameUI.skillRod.x;
  9499. let potY = gameUI.skillRod.y;
  9500. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9501. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9502. let disArr = [];
  9503. for (let index = 0; index < outArr.length; index++) {
  9504. let obj = outArr[index];
  9505. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9506. dis = Math.pow(dis, 0.5);
  9507. disArr.push(dis);
  9508. }
  9509. this.tweenArr.push(gameUI.skillRod);
  9510. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9511. })).update = Laya.Handler.create(this, (e, t, c) => {
  9512. let angle = gameUI.skillRod.rotation;
  9513. let xx;
  9514. let yy;
  9515. let temp;
  9516. for (let index = 0; index < outArr.length; index++) {
  9517. temp = outArr[index];
  9518. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9519. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9520. yy -= 20;
  9521. temp.gameObj.x = xx;
  9522. temp.gameObj.y = yy;
  9523. temp.d3BallSrc.setTransPos(xx, yy);
  9524. }
  9525. if (angle <= 60) {
  9526. Laya.Tween.clearAll(gameUI.skillRod);
  9527. this.ballFlyToBag(outArr, 150);
  9528. gameUI.skillRod.visible = false;
  9529. }
  9530. }, null, false);
  9531. }
  9532. runIce() {
  9533. let ballArr = xGame.common.d2World.ballArr;
  9534. this.leveNum *= 2;
  9535. if (this.leveNum >= ballArr.length - 1)
  9536. this.leveNum = ballArr.length - 1;
  9537. let tempArr = [];
  9538. let outArr = [];
  9539. for (let index = 0; index < ballArr.length; index++) {
  9540. if (ballArr[index] instanceof D2RootBallSrc)
  9541. continue;
  9542. tempArr.push(ballArr[index]);
  9543. }
  9544. if (tempArr.length <= 0) {
  9545. this.callback && this.callback(0);
  9546. return;
  9547. }
  9548. xGame.common.botherArr(tempArr);
  9549. for (let index = 0; index < this.leveNum; index++) {
  9550. outArr.push(tempArr[index]);
  9551. }
  9552. this.extraScore = this.leveNum;
  9553. let temp;
  9554. for (let index = 0; index < outArr.length; index++) {
  9555. temp = outArr[index];
  9556. temp.d3BallSrc.playIceEft();
  9557. }
  9558. Laya.timer.once(2000, this, () => {
  9559. for (let index = 0; index < outArr.length; index++) {
  9560. temp = outArr[index];
  9561. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9562. temp.setBallFunc("ice", str);
  9563. }
  9564. this.callback && this.callback(0);
  9565. });
  9566. }
  9567. runFireworks() {
  9568. let allArr = this.getAllBallArr();
  9569. if (allArr.length <= 0) {
  9570. this.callback && this.callback(0);
  9571. return;
  9572. }
  9573. xGame.common.d2World.d2Gan.ui.visible = false;
  9574. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9575. let outArr = [];
  9576. let other = this.leveNum;
  9577. if (other > 0) {
  9578. if (allArr.length > 0) {
  9579. xGame.common.botherArr(allArr);
  9580. if (other >= allArr.length)
  9581. other = allArr.length;
  9582. for (let index = 0; index < other; index++) {
  9583. outArr.push(allArr[index]);
  9584. }
  9585. }
  9586. }
  9587. xGame.common.extraMoveNum = other;
  9588. this.extraScore = other;
  9589. this.addRandmomFireworks(outArr);
  9590. }
  9591. addRandmomFireworks(outArr) {
  9592. Laya.timer.once(1100, this, () => {
  9593. if (outArr.length > 0) {
  9594. xGame.common.d2World.openCheckStill = true;
  9595. this.playedLastSkill = true;
  9596. }
  9597. });
  9598. xGame.soundMgr.playSound("skill_04_02");
  9599. let temp;
  9600. let delay = -200;
  9601. for (let index = 0; index < outArr.length; index++) {
  9602. temp = outArr[index];
  9603. delay += 200;
  9604. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9605. let angle = xGame.common.randomNum(0, 360);
  9606. angle = this.getFireworksAngle(obj);
  9607. let linearPercent = xGame.common.randomNum(45, 80);
  9608. if (!obj.destroyed)
  9609. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9610. });
  9611. }
  9612. }
  9613. getFireworksAngle(obj) {
  9614. let rootBall = xGame.common.d2World.rootBall;
  9615. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9616. }
  9617. resetGame() {
  9618. Laya.timer.clearAll(this);
  9619. if (this.tweenArr) {
  9620. for (let index = 0; index < this.tweenArr.length; index++) {
  9621. Laya.Tween.clearAll(this.tweenArr[index]);
  9622. }
  9623. }
  9624. this.tweenArr = null;
  9625. }
  9626. runGuanYu() {
  9627. xGame.common.d2World.d2Gan.ui.visible = false;
  9628. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9629. let rootBall = xGame.common.d2World.rootBall;
  9630. if (rootBall.isInHole) {
  9631. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9632. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9633. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9634. rootBall.showSelf();
  9635. }
  9636. this.rtStarX = rootBall.gameObj.x;
  9637. this.rtStarY = rootBall.gameObj.y;
  9638. this.knifeTimes = 0;
  9639. this.playedLastSkill = true;
  9640. rootBall.forceRun = true;
  9641. rootBall.rigy.type = "static";
  9642. xGame.common.d2World.openCheckStill = true;
  9643. this.guanyuRandomKnife();
  9644. }
  9645. guanyuRandomKnife() {
  9646. let rootBall = xGame.common.d2World.rootBall;
  9647. let dir = this.getRandDir();
  9648. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9649. console.log("当前angle", angle);
  9650. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9651. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9652. let dis = 324;
  9653. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9654. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9655. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9656. this.rtStarX = rootBall.gameObj.x;
  9657. this.rtStarY = rootBall.gameObj.y;
  9658. this.knifeTimes++;
  9659. let skillLevel;
  9660. if (xGame.common.gameMgr.selfTurn) {
  9661. skillLevel = DataMgr.getBigSkillByIndex(4);
  9662. }
  9663. else {
  9664. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9665. }
  9666. if (!skillLevel)
  9667. skillLevel = 1;
  9668. skillLevel += 2;
  9669. if (this.knifeTimes < skillLevel) {
  9670. Laya.timer.once(400, this, () => {
  9671. this.guanyuRandomKnife();
  9672. });
  9673. }
  9674. else {
  9675. rootBall.forceRun = false;
  9676. rootBall.rigy.type = "dynamic";
  9677. xGame.common.extraMoveNum = skillLevel;
  9678. }
  9679. }));
  9680. }
  9681. getRandDir() {
  9682. let rootBall = xGame.common.d2World.rootBall;
  9683. let allBall = this.getAllBallArr();
  9684. let target = xGame.common.getRandArrEle(allBall);
  9685. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9686. return this.knifeV2;
  9687. }
  9688. cloneKnife(x, y, rotation) {
  9689. let parent = xGame.common.d3World.knifeRoot;
  9690. let prefab = xGame.common.d3World.knife;
  9691. let clone = prefab.clone();
  9692. parent.addChild(clone);
  9693. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9694. clone.transform.localPositionX = this.knifeV3.x;
  9695. clone.transform.localPositionY = 0;
  9696. clone.transform.localPositionZ = this.knifeV3.z;
  9697. clone.transform.localRotationEulerX = 0;
  9698. clone.transform.localRotationEulerY = rotation;
  9699. clone.transform.localRotationEulerZ = 0;
  9700. clone.active = true;
  9701. return clone;
  9702. }
  9703. cloneGuanYuEft(x, y, angle) {
  9704. return;
  9705. let parent = xGame.common.gameUI.ui.guanyuNode;
  9706. let eft = new ui_guanyuAni();
  9707. eft.parent = parent;
  9708. eft.x = x;
  9709. eft.y = y;
  9710. eft.rotation = angle;
  9711. }
  9712. }
  9713. class ui_UIWordsList extends fgui.GComponent {
  9714. static createInstance() {
  9715. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9716. }
  9717. onConstruct() {
  9718. this.c1 = this.getController("c1");
  9719. this.n74 = (this.getChild("n74"));
  9720. this.clickNode = (this.getChild("clickNode"));
  9721. this.myNode = (this.getChild("myNode"));
  9722. this.n68 = (this.getChild("n68"));
  9723. this.n66 = (this.getChild("n66"));
  9724. this.n55 = (this.getChild("n55"));
  9725. this.wordsBtn = (this.getChild("wordsBtn"));
  9726. this.emotionBtn = (this.getChild("emotionBtn"));
  9727. this.mybggg = (this.getChild("mybggg"));
  9728. this.wordsList = (this.getChild("wordsList"));
  9729. this.emotionList = (this.getChild("emotionList"));
  9730. this.myRoot = (this.getChild("myRoot"));
  9731. }
  9732. }
  9733. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9734. class EmotionDisplay {
  9735. constructor(index, ui) {
  9736. this.ui = ui;
  9737. this.index = index;
  9738. this.ui.onClick(this, this.clickSelf);
  9739. this.updateSelf();
  9740. }
  9741. updateSelf() {
  9742. let data = cfgTable.emotionData[this.index + 1];
  9743. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9744. }
  9745. clickSelf() {
  9746. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9747. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9748. xGame.common.talkMgr.closeTalkView();
  9749. }
  9750. }
  9751. class WordsDisplay {
  9752. constructor(index, ui) {
  9753. this.ui = ui;
  9754. this.index = index;
  9755. this.ui.onClick(this, this.clickSelf);
  9756. this.updateSelf();
  9757. }
  9758. updateSelf() {
  9759. let data = cfgTable.talkwordsData[this.index + 1];
  9760. this.ui.txt.text = data.msg;
  9761. }
  9762. clickSelf() {
  9763. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9764. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9765. xGame.common.talkMgr.closeTalkView();
  9766. }
  9767. }
  9768. class UIWordsList extends UIBase {
  9769. constructor() {
  9770. super();
  9771. }
  9772. onConstructor() {
  9773. this.ui = ui_UIWordsList.createInstance();
  9774. this.contentPane = this.ui;
  9775. this.isEject = false;
  9776. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9777. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9778. this.addUIClick(this.ui.clickNode, this.hide);
  9779. this.initTalkList();
  9780. this.initEmotionList();
  9781. }
  9782. show() {
  9783. super.show();
  9784. }
  9785. initTalkList() {
  9786. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9787. let data = cfgTable.talkwordsData;
  9788. let length = Object.keys(data).length;
  9789. this.ui.wordsList.numItems = length;
  9790. }
  9791. initEmotionList() {
  9792. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9793. let data = cfgTable.emotionData;
  9794. let length = Object.keys(data).length;
  9795. this.ui.emotionList.numItems = length;
  9796. }
  9797. renderTalkItem(index, obj) {
  9798. let temp = new WordsDisplay(index, obj);
  9799. }
  9800. renderEmotionItem(index, obj) {
  9801. let temp = new EmotionDisplay(index, obj);
  9802. }
  9803. openTalkList() {
  9804. this.ui.c1.selectedIndex = 0;
  9805. }
  9806. openEmotionList() {
  9807. this.ui.c1.selectedIndex = 1;
  9808. }
  9809. }
  9810. UIWordsList.uiName = "UIWordsList";
  9811. class TalkMgr {
  9812. constructor() {
  9813. this.aiSpeak = true;
  9814. this.emotionList = [];
  9815. this.talkList = [];
  9816. this.addEvent();
  9817. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9818. this.emotionList = [];
  9819. this.talkList = [];
  9820. for (let k in cfgTable.emotionData) {
  9821. this.emotionList.push(cfgTable.emotionData[k].id);
  9822. }
  9823. for (let k in cfgTable.talkwordsData) {
  9824. this.talkList.push(cfgTable.talkwordsData[k].id);
  9825. }
  9826. }
  9827. addEvent() {
  9828. let ui = xGame.common.gameUI.ui;
  9829. ui.wordsBtn.visible = true;
  9830. ui.wordsBtn.onClick(this, this.openTalkView);
  9831. ui.aiWordsBtn.visible = true;
  9832. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9833. }
  9834. openTalkView() {
  9835. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9836. xGame.uiMgr.Show(UIWordsList);
  9837. }
  9838. closeTalkView() {
  9839. xGame.uiMgr.Hide(UIWordsList);
  9840. }
  9841. clickAIState() {
  9842. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9843. this.aiSpeak = !this.aiSpeak;
  9844. this.changeAIState(this.aiSpeak);
  9845. }
  9846. changeAIState(speak) {
  9847. this.aiSpeak = speak;
  9848. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9849. if (speak) {
  9850. btn.c1.selectedIndex = 0;
  9851. }
  9852. else {
  9853. btn.c1.selectedIndex = 1;
  9854. }
  9855. }
  9856. showSelfTalk(wordsId) {
  9857. let ui = xGame.common.gameUI.ui;
  9858. ui.selfTalk.visible = true;
  9859. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9860. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9861. ui.selfTalk.t0.play();
  9862. }
  9863. showSelfEmotion(emotionId) {
  9864. let ui = xGame.common.gameUI.ui;
  9865. ui.selfTalk.visible = true;
  9866. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9867. this.selfSpine && this.selfSpine.dispose();
  9868. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9869. let spineData = cfgTable.emotionData[emotionId].spine;
  9870. this.selfSpine = new SpineMgr(spineData, () => {
  9871. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9872. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9873. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9874. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9875. });
  9876. ui.selfTalk.t0.play();
  9877. }
  9878. showAITalk(wordsId) {
  9879. if (!this.aiSpeak)
  9880. return;
  9881. if (DataMgr.gameData.gameCount < 2)
  9882. return;
  9883. if (wordsId < 1)
  9884. wordsId = this.getRandTalk();
  9885. let ui = xGame.common.gameUI.ui;
  9886. ui.aiTalk.visible = true;
  9887. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9888. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9889. ui.aiTalk.t0.play();
  9890. }
  9891. getRandTalk() {
  9892. let rand = xGame.tools.random(0, this.talkList.length);
  9893. return this.emotionList[rand];
  9894. }
  9895. getRandEmotion() {
  9896. let rand = xGame.tools.random(0, this.emotionList.length);
  9897. return this.emotionList[rand];
  9898. }
  9899. showAIEmotion(emotionId) {
  9900. if (!this.aiSpeak)
  9901. return;
  9902. if (DataMgr.gameData.gameCount < 2)
  9903. return;
  9904. if (emotionId < 1)
  9905. emotionId = this.getRandEmotion();
  9906. let ui = xGame.common.gameUI.ui;
  9907. ui.aiTalk.visible = true;
  9908. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9909. this.aiSpine && this.aiSpine.dispose();
  9910. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9911. let spineData = cfgTable.emotionData[emotionId].spine;
  9912. this.aiSpine = new SpineMgr(spineData, () => {
  9913. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9914. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9915. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9916. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9917. });
  9918. ui.aiTalk.t0.play();
  9919. }
  9920. resetGame() {
  9921. let ui = xGame.common.gameUI.ui;
  9922. ui.aiTalk.visible = false;
  9923. ui.selfTalk.visible = false;
  9924. this.aiSpine && this.aiSpine.dispose();
  9925. this.selfSpine && this.selfSpine.dispose();
  9926. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9927. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9928. this.closeTalkView();
  9929. }
  9930. }
  9931. class WordsMgr {
  9932. constructor() {
  9933. this.comboTimes = 1;
  9934. this.skillTimes = 0;
  9935. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9936. this.comboSpine = new SpineMgr("yxz_liangan");
  9937. this.skillSpine = new SpineMgr("yiganxqiu");
  9938. this.scoreSpine = new SpineMgr("defen");
  9939. }
  9940. setClassicCombo(isInterrupt) {
  9941. if (isInterrupt) {
  9942. this.comboTimes = 0;
  9943. }
  9944. }
  9945. playClassicWords(type, callback) {
  9946. this.callback = callback;
  9947. let aniIndex = type;
  9948. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9949. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9950. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9951. mySpine.destroy(true);
  9952. this.playClassicTimes();
  9953. });
  9954. }
  9955. playClassicTimes() {
  9956. this.comboTimes++;
  9957. if (this.comboTimes <= 1) {
  9958. this.callback && this.callback();
  9959. }
  9960. else {
  9961. let aniIndex = this.comboTimes - 1;
  9962. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9963. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9964. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9965. mySpine.destroy(true);
  9966. this.callback && this.callback();
  9967. });
  9968. }
  9969. }
  9970. playBigSkillTimes(times, callback) {
  9971. if (times <= 0) {
  9972. callback && callback();
  9973. return;
  9974. }
  9975. this.callback = callback;
  9976. let pre = "sz_0";
  9977. let aniIndex = 0;
  9978. this.getWordsImg(times, pre, () => {
  9979. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9980. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9981. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9982. let r1 = ``;
  9983. let r2 = ``;
  9984. if (times <= 9) {
  9985. r1 = `res/d2Res/${pre}${times}.png`;
  9986. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9987. aniIndex = 0;
  9988. }
  9989. else {
  9990. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9991. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9992. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9993. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9994. aniIndex = 1;
  9995. }
  9996. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9997. mySpine.destroy(true);
  9998. xGame.common.gameMgr.playSkillTips();
  9999. this.playScore(times);
  10000. xGame.common.playRandomMutiBallBigSkillSound();
  10001. }, mySpine);
  10002. });
  10003. }
  10004. playScore(score) {
  10005. let pre = "sz_";
  10006. let aniIndex = 0;
  10007. this.getWordsImg(score, pre, () => {
  10008. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10009. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10010. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10011. let r1 = ``;
  10012. let r2 = ``;
  10013. if (score <= 9) {
  10014. r1 = `res/d2Res/${pre}${score}.png`;
  10015. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10016. aniIndex = 0;
  10017. }
  10018. else {
  10019. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10020. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10021. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10022. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10023. aniIndex = 1;
  10024. }
  10025. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10026. mySpine.destroy(true);
  10027. this.callback && this.callback();
  10028. }, mySpine);
  10029. });
  10030. }
  10031. getWordsImg(number, pre = "", callback) {
  10032. let arr = [];
  10033. if (number <= 9) {
  10034. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10035. }
  10036. else {
  10037. 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 });
  10038. }
  10039. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10040. callback && callback();
  10041. }));
  10042. }
  10043. }
  10044. class ui_UIRodMethod extends fgui.GComponent {
  10045. static createInstance() {
  10046. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10047. }
  10048. onConstruct() {
  10049. this.n24 = (this.getChild("n24"));
  10050. this.white = (this.getChild("white"));
  10051. this.dot = (this.getChild("dot"));
  10052. this.sureBtn = (this.getChild("sureBtn"));
  10053. this.n20 = (this.getChild("n20"));
  10054. this.n21 = (this.getChild("n21"));
  10055. this.n22 = (this.getChild("n22"));
  10056. this.n23 = (this.getChild("n23"));
  10057. this.n5 = (this.getChild("n5"));
  10058. this.n14 = (this.getChild("n14"));
  10059. this.t0 = this.getTransition("t0");
  10060. }
  10061. }
  10062. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10063. class UIRodMethod extends UIBase {
  10064. constructor() {
  10065. super();
  10066. this.isPressd = false;
  10067. }
  10068. onConstructor() {
  10069. this.ui = ui_UIRodMethod.createInstance();
  10070. this.contentPane = this.ui;
  10071. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10072. this.moveDir = new Laya.Vector2();
  10073. this.moveDest = new Laya.Vector2();
  10074. this.centerPos = new Laya.Vector2();
  10075. xGame.common.uiRodMethod = this;
  10076. }
  10077. show() {
  10078. super.show();
  10079. xGame.common.gameMgr.gamePause = true;
  10080. this.openPressDotEvent();
  10081. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10082. this.centerPos.x = this.ui.white.x;
  10083. this.centerPos.y = this.ui.white.y;
  10084. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10085. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10086. this.setDot();
  10087. }
  10088. setDot() {
  10089. this.ui.dot.x = this.moveDest.x;
  10090. this.ui.dot.y = this.moveDest.y;
  10091. }
  10092. closeSelf() {
  10093. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10094. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10095. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10096. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10097. xGame.common.gameMgr.gamePause = false;
  10098. this.hide();
  10099. }
  10100. openPressDotEvent() {
  10101. this.closePressDotEvent();
  10102. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10103. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10104. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10105. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10106. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10107. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10108. }
  10109. closePressDotEvent() {
  10110. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10111. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10112. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10113. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10114. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10115. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10116. }
  10117. onDown(e) {
  10118. if (e.type == Laya.Event.MOUSE_DOWN)
  10119. this.isPressd = true;
  10120. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10121. this.isPressd = false;
  10122. if (!this.isPressd)
  10123. return;
  10124. this.moveDest.x = e.stageX;
  10125. this.moveDest.y = e.stageY;
  10126. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10127. if (dis > 6724) {
  10128. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10129. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10130. }
  10131. this.setDot();
  10132. }
  10133. resetRod() {
  10134. this.ui.dot.x = this.ui.white.x;
  10135. this.ui.dot.y = this.ui.white.y;
  10136. this.gameRod.dot.x = this.gameRod.bg.x;
  10137. this.gameRod.dot.y = this.gameRod.bg.y;
  10138. xGame.common.rodOffest.x = 0;
  10139. xGame.common.rodOffest.y = 0;
  10140. }
  10141. }
  10142. UIRodMethod.uiName = "UIRodMethod";
  10143. class UIGame extends UIBase {
  10144. constructor() {
  10145. super();
  10146. this.powerNum = 0;
  10147. this.isD3Inited = false;
  10148. this.isPrePlay = false;
  10149. this.isMoveRod = false;
  10150. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10151. this.rulerDis = 20;
  10152. this.rulerOffset = 0;
  10153. }
  10154. onConstructor() {
  10155. this.ui = ui_UIGame.createInstance();
  10156. this.contentPane = this.ui;
  10157. this.ui.x += xGame.common.sysOffestNum;
  10158. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10159. this.isEject = false;
  10160. xGame.common.gameUI = this;
  10161. this.initSelf();
  10162. }
  10163. isTurnSelf() {
  10164. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10165. return true;
  10166. }
  10167. }
  10168. initSelf() {
  10169. let topUI = this.ui.topNode;
  10170. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10171. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10172. this.barInfo = {};
  10173. this.barInfo.curY = 0;
  10174. this.barInfo.height = this.ui.powerNode.height;
  10175. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10176. this.barInfo.powerStartY = this.ui.powerNode.y;
  10177. xGame.common.aiPlayer = new AIPlayer();
  10178. xGame.common.gameMgr = new GameMgr();
  10179. xGame.common.skillMgr = new SkillMgr();
  10180. xGame.common.wordsMgr = new WordsMgr();
  10181. xGame.common.talkMgr = new TalkMgr();
  10182. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10183. console.log("加载经典模式表情文件chenggon !");
  10184. });
  10185. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10186. console.log("挑战模式奖励模式spine加载成功!");
  10187. });
  10188. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10189. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10190. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10191. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10192. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10193. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10194. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10195. }
  10196. getGanZiImg() {
  10197. let index = DataMgr.getCurBallRod();
  10198. let data = cfgTable.ballrodData[index + 1];
  10199. let gan_url = xGame.common.getGameIconUrl(data.img);
  10200. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10201. this.ui.powerNode.showImg.url = gan_url;
  10202. console.log('zh:修改杆子图标O K');
  10203. }
  10204. returnHome() {
  10205. let tips = "Are you sure to exit the game?";
  10206. let woman = "Boss, why don't you play for a while longer?";
  10207. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10208. }
  10209. addRodMethodClick() {
  10210. if (this.isTurnSelf()) {
  10211. xGame.uiMgr.Show(UIRodMethod);
  10212. }
  10213. }
  10214. clickHelpLineBtn(force = false) {
  10215. if (!this.isTurnSelf())
  10216. return;
  10217. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10218. if (success) {
  10219. xGame.common.longHelpLine = true;
  10220. xGame.common.d2World.getHelpLine();
  10221. Moyu.sendDataEvent("guideNum");
  10222. }
  10223. else {
  10224. }
  10225. });
  10226. }
  10227. renderSelfDisplayBalls(index, target) {
  10228. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10229. target.myImg.url = xGame.common.getGameIconUrl(str);
  10230. }
  10231. renderAIDisplayBalls(index, target) {
  10232. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10233. target.myImg.url = xGame.common.getGameIconUrl(str);
  10234. ;
  10235. }
  10236. updateMode() {
  10237. if (xGame.common.gameMode == GameMode.classic) {
  10238. this.ui.topNode.scoreNode.visible = false;
  10239. }
  10240. else if (xGame.common.gameMode == GameMode.bigMove) {
  10241. this.ui.topNode.scoreNode.visible = true;
  10242. }
  10243. }
  10244. show() {
  10245. super.show();
  10246. console.log("zh:uigame show AADD");
  10247. this.ui.alpha = 0;
  10248. this.updateSelf();
  10249. xGame.common.gameMgr.gamePause = false;
  10250. xGame.common.gameUI.ui.blackAni.visible = false;
  10251. xGame.common.gameUI.ui.whiteAni.visible = false;
  10252. this.ui.powerEft.visible = false;
  10253. this.ui.colorNode.visible = false;
  10254. this.updateHead();
  10255. let curUse = DataMgr.getCurBallRod();
  10256. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10257. this.getGanZiImg();
  10258. }
  10259. updateSelf() {
  10260. if (xGame.common.gameMode == GameMode.classic) {
  10261. this.ui.c1.selectedIndex = 0;
  10262. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10263. this.ui.topNode.middleNode.visible = true;
  10264. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10265. }
  10266. else if (xGame.common.gameMode == GameMode.bigMove) {
  10267. this.ui.c1.selectedIndex = 0;
  10268. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10269. this.ui.topNode.middleNode.visible = false;
  10270. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10271. let rand = xGame.common.randomNum(1, max);
  10272. let guide = DataMgr.getSkillGuide();
  10273. if (guide == 0)
  10274. rand = 1;
  10275. xGame.common.bigMoveLevelIndex = rand;
  10276. }
  10277. else if (xGame.common.gameMode == GameMode.placeBall) {
  10278. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10279. this.ui.c1.selectedIndex = 1 + data.type;
  10280. this.ui.alpha = 1;
  10281. this.startGame();
  10282. }
  10283. this.updateMode();
  10284. this.initD3world();
  10285. this.initD2world();
  10286. }
  10287. startGame() {
  10288. this.ui.snowNode.visible = Math.random() <= 0.1;
  10289. this.ui.d2Node.visible = false;
  10290. xGame.common.d3World.d3Hand.gameObj.active = false;
  10291. xGame.common.d3World.tableSrc.init();
  10292. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10293. this.cameraViewChange(() => {
  10294. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10295. switch (xGame.common.gameMode) {
  10296. case GameMode.classic:
  10297. xGame.common.d3World.d3Hand.gameObj.active = true;
  10298. this.playPutBallD3Ani();
  10299. break;
  10300. case GameMode.bigMove:
  10301. this.enterGame();
  10302. Laya.timer.once(500, this, () => {
  10303. this.ui.topNode.middleNode.visible = true;
  10304. this.ui.topNode.middleNode.t0.play();
  10305. });
  10306. break;
  10307. case GameMode.placeBall:
  10308. this.enterGame();
  10309. break;
  10310. default:
  10311. break;
  10312. }
  10313. });
  10314. PlatMgr.showBanner(false);
  10315. }
  10316. enterGame() {
  10317. this.ui.d2Node.visible = true;
  10318. xGame.common.d3World.d3Hand.gameObj.active = false;
  10319. xGame.common.showOneCamera("mainCamera");
  10320. Moyu.recordGame(30, true);
  10321. if (!this.isPrePlay) {
  10322. this.isPrePlay = true;
  10323. xGame.common.d3World.prePlayEft();
  10324. }
  10325. xGame.common.gameMgr.gameReady();
  10326. this.openAllEvent();
  10327. this.ui.snowNode.visible = false;
  10328. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10329. this.ui.helpBtn.visible = condition;
  10330. }
  10331. showHelpLineGuide() {
  10332. let longGuide = DataMgr.getGuideHelpLine();
  10333. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10334. this.ui.helpBtn.visible = true;
  10335. this.ui.guideNode.visible = true;
  10336. }
  10337. }
  10338. setTurnAlpha(alpha) {
  10339. this.ui.keduNode.alpha = alpha;
  10340. this.ui.ganNode.alpha = alpha;
  10341. this.ui.rodMethodNode.alpha = alpha;
  10342. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10343. }
  10344. cameraViewChange(callback) {
  10345. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10346. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10347. xGame.common.showOneCamera("visitAngle");
  10348. cameraSrc.localRotationEulerY = 180;
  10349. cameraSrc.localRotationEulerZ = 0;
  10350. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10351. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10352. callback && callback();
  10353. }));
  10354. }));
  10355. }
  10356. playPutBallD3Ani() {
  10357. xGame.common.showOneCamera("mainCamera");
  10358. let handSrc = xGame.common.d3World.d3Hand;
  10359. handSrc.gameObj.active = true;
  10360. handSrc.transform.localPositionZ = 3;
  10361. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10362. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10363. handSrc.gameObj.active = false;
  10364. this.enterGame();
  10365. }), 400);
  10366. }));
  10367. }
  10368. updateHead() {
  10369. let user = Moyu.getUserInfo();
  10370. this.ui.topNode.selfNameTxt.text = user.nickName;
  10371. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10372. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10373. if (DataMgr.getSkillGuide() < 1) {
  10374. this.ui.topNode.aiNameTxt.text = 'billiards';
  10375. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10376. }
  10377. else {
  10378. this.ui.topNode.aiNameTxt.text = aiData.name;
  10379. let randNo = Math.floor(Math.random() * 10) + 1;
  10380. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10381. }
  10382. }
  10383. initD2world() {
  10384. let node = this.ui.d2Root.displayObject;
  10385. let src = node.getComponent(D2World);
  10386. if (!src) {
  10387. xGame.common.d2World = node.addComponent(D2World);
  10388. }
  10389. xGame.common.d2World.initSelf();
  10390. }
  10391. initD3world() {
  10392. if (this.isD3Inited)
  10393. return;
  10394. this.isD3Inited = true;
  10395. let scene3D = xGame.common.d3Scene;
  10396. this.ui.d3Root.displayObject.addChild(scene3D);
  10397. scene3D.active = true;
  10398. xGame.common.d3World.tableSrc.setBorderPos();
  10399. }
  10400. onRootMove(e) {
  10401. let rootBall = xGame.common.d2World.rootBall;
  10402. this.ui.moveNode.x = e.x;
  10403. this.ui.moveNode.y = e.y;
  10404. rootBall.gameObj.x = e.x;
  10405. rootBall.gameObj.y = e.y;
  10406. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10407. }
  10408. aiRootMove(move) {
  10409. if (move)
  10410. this.hideBallUI();
  10411. else {
  10412. this.showBallUI();
  10413. xGame.common.d2World.getHelpLine();
  10414. }
  10415. }
  10416. aiForce(type, force = 0) {
  10417. this.pressTarget = PressType.powerNode;
  10418. if (type == 1)
  10419. this.onEventUp({ force: true });
  10420. else if (type == 2)
  10421. this.onEventMove({ stageY: force, force: true });
  10422. }
  10423. onEventPress(e) {
  10424. if (e.stopPropagation)
  10425. e.stopPropagation();
  10426. if (!this.isTurnSelf())
  10427. return;
  10428. let target = e.target;
  10429. switch (target) {
  10430. case this.ui.myPowerNode.displayObject:
  10431. this.pressTarget = PressType.powerNode;
  10432. this.barInfo.curY = e.stageY;
  10433. this.updateBarInfo();
  10434. break;
  10435. case this.ui.moveNode.displayObject:
  10436. this.pressTarget = PressType.moveNode;
  10437. this.hideBallUI();
  10438. this.eventObj.curX = this.ui.moveNode.x;
  10439. this.eventObj.curY = this.ui.moveNode.y;
  10440. this.ui.moveNode.finger.visible = false;
  10441. this.eventObj.lastX = e.stageX;
  10442. this.eventObj.lastY = e.stageY;
  10443. break;
  10444. case this.ui.rulerClickNode.displayObject:
  10445. this.pressTarget = PressType.rulerNode;
  10446. this.eventObj.lastY = e.stageY;
  10447. break;
  10448. case this.ui.d2Root.displayObject:
  10449. this.pressTarget = PressType.d2Root;
  10450. this.eventObj.lastX = e.stageX;
  10451. this.eventObj.lastY = e.stageY;
  10452. this.eventObj.starX = e.stageX;
  10453. this.eventObj.starY = e.stageY;
  10454. this.eventObj.curX = 0;
  10455. this.eventObj.curY = 0;
  10456. xGame.common.d2World.d2Gan.setGanLastInfo();
  10457. this.rulerOffset = 0;
  10458. break;
  10459. default:
  10460. break;
  10461. }
  10462. }
  10463. onEventMove(e) {
  10464. if (e.stopPropagation)
  10465. e.stopPropagation();
  10466. if (e && e.force) {
  10467. }
  10468. else {
  10469. if (!this.isTurnSelf())
  10470. return;
  10471. }
  10472. switch (this.pressTarget) {
  10473. case PressType.powerNode:
  10474. this.barInfo.curY = e.stageY;
  10475. this.updateBarInfo();
  10476. this.isMoveRod = true;
  10477. break;
  10478. case PressType.moveNode:
  10479. let rootBall = xGame.common.d2World.rootBall;
  10480. let radius = rootBall.gameObj.width / 2;
  10481. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10482. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10483. let border = xGame.common.d2World.borderRect;
  10484. if (curX <= border.x + radius)
  10485. curX = border.x + radius;
  10486. else if (curX >= border.x + border.width - radius)
  10487. curX = border.x + border.width - radius;
  10488. if (curY <= border.y + radius)
  10489. curY = border.y + radius;
  10490. else if (curY >= border.y + border.height - radius)
  10491. curY = border.y + border.height - radius;
  10492. if (xGame.common.gameMgr.isOpenBall) {
  10493. if (curX >= border.x + border.openBallW - radius)
  10494. curX = border.x + border.openBallW - radius;
  10495. }
  10496. this.ui.moveNode.x = curX;
  10497. this.ui.moveNode.y = curY;
  10498. rootBall.gameObj.x = curX;
  10499. rootBall.gameObj.y = curY;
  10500. rootBall.d3BallSrc.setTransPos(curX, curY);
  10501. this.isMoveRod = true;
  10502. break;
  10503. case PressType.rulerNode:
  10504. let yy = e.stageY - this.eventObj.lastY;
  10505. this.eventObj.lastY = e.stageY;
  10506. let ruler1 = this.ui.rulerNode.img1;
  10507. let ruler2 = this.ui.rulerNode.img2;
  10508. ruler1.y += yy;
  10509. ruler2.y += yy;
  10510. this.rulerOffset += yy;
  10511. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10512. this.rulerOffset = 0;
  10513. xGame.soundMgr.playSound("inch", 1, 10);
  10514. }
  10515. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10516. let h = ruler1.height;
  10517. this.checkGuide();
  10518. this.isMoveRod = true;
  10519. if (ruler1.y >= h) {
  10520. ruler1.y = -h;
  10521. ruler2.y = 0;
  10522. return;
  10523. }
  10524. else if (ruler1.y <= -h) {
  10525. ruler1.y = h;
  10526. ruler2.y = 0;
  10527. return;
  10528. }
  10529. if (ruler2.y >= h) {
  10530. ruler2.y = -h;
  10531. ruler1.y = 0;
  10532. return;
  10533. }
  10534. else if (ruler2.y <= -h) {
  10535. ruler2.y = h;
  10536. ruler1.y = 0;
  10537. return;
  10538. }
  10539. break;
  10540. case PressType.d2Root:
  10541. this.eventObj.curX = e.stageX;
  10542. this.eventObj.curY = e.stageY;
  10543. let offset = this.checkRodMoveDir();
  10544. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10545. this.eventObj.lastX = e.stageX;
  10546. this.eventObj.lastY = e.stageY;
  10547. break;
  10548. default:
  10549. break;
  10550. }
  10551. }
  10552. onEventUp(e) {
  10553. if (e.stopPropagation)
  10554. e.stopPropagation();
  10555. if (e && e.force) {
  10556. }
  10557. else {
  10558. if (!this.isTurnSelf())
  10559. return;
  10560. }
  10561. switch (this.pressTarget) {
  10562. case PressType.powerNode:
  10563. this.ui.powerNode.value = 0;
  10564. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10565. this.ui.powerTxt.text = "";
  10566. if (this.powerNum > 0) {
  10567. xGame.eventMgr.event(BALL_SHOOT);
  10568. xGame.common.d2World.shoot(this.powerNum);
  10569. xGame.common.d2World.d2Gan.shoot();
  10570. xGame.common.d2World.d2HelpLine.shoot();
  10571. this.finishGuide();
  10572. this.ui.powerEft.visible = false;
  10573. this.ui.colorNode.visible = false;
  10574. let ganStr = "";
  10575. if (this.powerNum <= 30) {
  10576. ganStr = "gan_30";
  10577. }
  10578. else if (this.powerNum <= 60) {
  10579. ganStr = "gan_50";
  10580. }
  10581. else {
  10582. ganStr = "gan_80";
  10583. }
  10584. xGame.soundMgr.playSound(ganStr);
  10585. }
  10586. break;
  10587. case PressType.moveNode:
  10588. let rootBall = xGame.common.d2World.rootBall;
  10589. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10590. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10591. let isIntersect = this.judgeBallIntersect();
  10592. if (isIntersect) {
  10593. this.ui.moveNode.x = lastX;
  10594. this.ui.moveNode.y = lastY;
  10595. rootBall.gameObj.x = lastX;
  10596. rootBall.gameObj.y = lastY;
  10597. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10598. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10599. }
  10600. else {
  10601. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10602. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10603. }
  10604. this.showBallUI();
  10605. this.ui.moveNode.finger.visible = true;
  10606. xGame.common.d2World.getHelpLine();
  10607. break;
  10608. case PressType.rulerNode:
  10609. break;
  10610. case PressType.d2Root:
  10611. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10612. if (dis <= 25) {
  10613. this.moveToClickDot(e);
  10614. }
  10615. break;
  10616. default:
  10617. break;
  10618. }
  10619. this.pressTarget = -1;
  10620. }
  10621. checkGuide() {
  10622. let guide = DataMgr.getSkillGuide();
  10623. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10624. xGame.common.guideStep++;
  10625. xGame.common.gameUI.ui.guide2.visible = false;
  10626. xGame.common.gameUI.ui.guide3.visible = true;
  10627. }
  10628. }
  10629. finishGuide() {
  10630. let guide = DataMgr.getSkillGuide();
  10631. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10632. xGame.common.guideStep = 10;
  10633. this.closeAllGuide();
  10634. console.log('zh: 新手引导完毕');
  10635. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  10636. }
  10637. }
  10638. closeAllGuide() {
  10639. xGame.common.gameUI.ui.guide1.visible = false;
  10640. xGame.common.gameUI.ui.guide2.visible = false;
  10641. xGame.common.gameUI.ui.guide3.visible = false;
  10642. }
  10643. updateBarInfo() {
  10644. let star = this.ui.powerNode.y;
  10645. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10646. if (rate >= 1)
  10647. rate = 1;
  10648. if (rate <= 0)
  10649. rate = 0;
  10650. this.powerNum = Math.ceil(rate * 100);
  10651. this.ui.powerNode.value = this.powerNum;
  10652. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10653. this.ui.colorNode.value = this.powerNum;
  10654. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10655. this.ui.powerEft.visible = this.powerNum != 0;
  10656. this.ui.colorNode.visible = this.powerNum != 0;
  10657. this.ui.powerTxt.text = this.powerNum + "";
  10658. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10659. }
  10660. forceCancel() {
  10661. this.ui.powerNode.value = 0;
  10662. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10663. this.ui.powerTxt.text = "";
  10664. }
  10665. checkRodMoveDir() {
  10666. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10667. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10668. if (tempX >= 0 && tempY <= 0) {
  10669. return this.checkDir();
  10670. }
  10671. else if (tempX < 0 && tempY < 0) {
  10672. return this.checkDir(1, -1);
  10673. }
  10674. else if (tempX < 0 && tempY > 0) {
  10675. return this.checkDir(-1, -1);
  10676. }
  10677. else {
  10678. return this.checkDir(-1, 1);
  10679. }
  10680. }
  10681. checkDir(flagX = 1, flagY = 1) {
  10682. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10683. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10684. if (offsetY == 0) {
  10685. return offsetX * flagX;
  10686. }
  10687. if (offsetX == 0) {
  10688. return offsetY * flagY;
  10689. }
  10690. let angle = offsetY / offsetX;
  10691. if (Math.abs(angle) >= 1) {
  10692. return offsetY * flagY;
  10693. }
  10694. else {
  10695. return offsetX * flagX;
  10696. }
  10697. }
  10698. judgeBallIntersect() {
  10699. let rootBall = xGame.common.d2World.rootBall;
  10700. let ballArr = xGame.common.d2World.ballArr;
  10701. let radius = rootBall.gameObj.width / 2;
  10702. let temp;
  10703. let isIntersect = false;
  10704. for (let index = 0; index < ballArr.length; index++) {
  10705. temp = ballArr[index];
  10706. if (temp.number == rootBall.number)
  10707. continue;
  10708. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10709. if (isIntersect) {
  10710. break;
  10711. }
  10712. }
  10713. return isIntersect;
  10714. }
  10715. hideBallUI() {
  10716. let d2Gan = xGame.common.d2World.d2Gan;
  10717. if (!d2Gan.ui.isDisposed)
  10718. d2Gan.ui.visible = false;
  10719. let d2Help = xGame.common.d2World.d2HelpLine;
  10720. if (!d2Help.ui.isDisposed)
  10721. d2Help.ui.visible = false;
  10722. let rootBall = xGame.common.d2World.rootBall;
  10723. if (!rootBall.destroyed) {
  10724. rootBall.gameObj.active = false;
  10725. }
  10726. }
  10727. showBallUI() {
  10728. let d2Gan = xGame.common.d2World.d2Gan;
  10729. if (!d2Gan.ui.isDisposed)
  10730. d2Gan.ui.visible = true;
  10731. let d2Help = xGame.common.d2World.d2HelpLine;
  10732. if (!d2Help.ui.isDisposed)
  10733. d2Help.ui.visible = true;
  10734. let rootBall = xGame.common.d2World.rootBall;
  10735. if (!rootBall.destroyed) {
  10736. rootBall.gameObj.active = true;
  10737. }
  10738. }
  10739. moveToClickDot(e) {
  10740. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10741. let root = xGame.common.d2World.rootBall.gameObj;
  10742. let xx = e.stageX - xGame.common.sysOffestNum;
  10743. let yy = e.stageY;
  10744. let x = xx - root.x;
  10745. let y = yy - root.y;
  10746. let angle = xGame.common.getfguiRotation(x, y);
  10747. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10748. xGame.common.d2World.getHelpLine();
  10749. }
  10750. this.isMoveRod = false;
  10751. xGame.common.clickedBall = false;
  10752. }
  10753. openAllEvent() {
  10754. this.closeAllEvent();
  10755. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10756. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10757. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10758. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10759. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10760. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10761. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10762. }
  10763. closeAllEvent() {
  10764. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10765. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10766. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10767. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10768. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10769. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10770. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10771. }
  10772. resetGame() {
  10773. this.closeAllEvent();
  10774. this.hideBallUI();
  10775. xGame.common.gameMgr.gamePause = true;
  10776. }
  10777. }
  10778. UIGame.uiName = "UIGame";
  10779. class UIAddProp extends UIBase {
  10780. constructor() {
  10781. super();
  10782. this.curType = "";
  10783. }
  10784. onConstructor() {
  10785. this.ui = ui_UIAddProp.createInstance();
  10786. this.contentPane = this.ui;
  10787. this.isEject = false;
  10788. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10789. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10790. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10791. this.updateUI();
  10792. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10793. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10794. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10795. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10796. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10797. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10798. }
  10799. show(type) {
  10800. super.show();
  10801. this.curType = type == 0 ? "coin" : "diamond";
  10802. this.switchBtn("");
  10803. this.ui.t0.play();
  10804. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10805. PlatMgr.showInsert(true);
  10806. }
  10807. closeSelf() {
  10808. this.hide();
  10809. }
  10810. updateUI() {
  10811. let data = cfgTable.moneyData;
  10812. let temp;
  10813. let obj;
  10814. for (const key in data) {
  10815. temp = data[key];
  10816. obj = this.ui.myNode["node" + key];
  10817. if (parseInt(key) <= 2) {
  10818. obj.diamondTxt.text = "+" + temp.num;
  10819. }
  10820. else {
  10821. obj.coinTxt.text = temp.num;
  10822. obj.diamondTxt.text = temp.get.split('_')[1];
  10823. }
  10824. }
  10825. this.updateDiamondShare();
  10826. }
  10827. updateDiamondShare() {
  10828. let data = DataMgr.getShareDiamondTimes();
  10829. if (data >= xGame.common.maxShareDiamondTimes) {
  10830. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10831. this.ui.myNode.node1.touchable = false;
  10832. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10833. }
  10834. else {
  10835. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10836. this.ui.myNode.node1.touchable = true;
  10837. }
  10838. }
  10839. switchBtn(type) {
  10840. if (type == "")
  10841. type = this.curType;
  10842. else {
  10843. if (this.curType == type) {
  10844. return;
  10845. }
  10846. else {
  10847. this.curType = type;
  10848. }
  10849. }
  10850. if (type == "coin") {
  10851. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10852. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10853. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10854. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10855. this.ui.myNode.c1.selectedIndex = 0;
  10856. }
  10857. else {
  10858. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10859. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10860. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10861. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10862. this.ui.myNode.c1.selectedIndex = 1;
  10863. }
  10864. }
  10865. convertCoin(index) {
  10866. let data = cfgTable.moneyData[index];
  10867. let coinNum = data.num;
  10868. let str = data.get.split('_')[1];
  10869. let needDiamond = parseInt(str);
  10870. if (DataMgr.diamondEnough(needDiamond)) {
  10871. DataMgr.setDiamond(-needDiamond);
  10872. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10873. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10874. }
  10875. else {
  10876. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10877. this.switchBtn("diamond");
  10878. }
  10879. }
  10880. videoGetDiamond() {
  10881. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10882. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10883. }
  10884. else {
  10885. console.log('zh:AD 失败,直接发放奖励');
  10886. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10887. }
  10888. }
  10889. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10890. let num = cfgTable.moneyData[2].num;
  10891. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10892. this.closeSelf();
  10893. }
  10894. videoGetCoin() {
  10895. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10896. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10897. }
  10898. else {
  10899. console.log('zh:AD 失败,直接发放奖励');
  10900. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10901. }
  10902. }
  10903. qjff_AD_for_uiAddProp_videoGetCoin() {
  10904. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10905. this.closeSelf();
  10906. }
  10907. shareGetDiamond() {
  10908. let times = DataMgr.getShareDiamondTimes();
  10909. if (times >= xGame.common.maxShareDiamondTimes) {
  10910. console.log('zh: 233333333333 maxShareDiamondTimes');
  10911. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10912. }
  10913. else {
  10914. console.log('zh:33333333333333ad');
  10915. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10916. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10917. }
  10918. else {
  10919. console.log('zh:AD 失败,直接发放奖励');
  10920. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10921. }
  10922. }
  10923. }
  10924. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10925. let diamond = xGame.common.randomNum(50, 100);
  10926. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10927. DataMgr.setShareDiamondTimes(1);
  10928. this.updateDiamondShare();
  10929. }
  10930. openPutBallView() {
  10931. let end = xGame.uiMgr.getUI(UIGameEnd);
  10932. let skill = xGame.uiMgr.getUI(UISkill);
  10933. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10934. let uigame = xGame.uiMgr.getUI(UIGame);
  10935. if (end && !end.isHide) {
  10936. xGame.uiMgr.Hide(UIGameEnd);
  10937. xGame.uiMgr.Show(UIMain);
  10938. }
  10939. if (skill && !skill.isHide)
  10940. xGame.uiMgr.Hide(UISkill);
  10941. if (uigame && !uigame.isHide)
  10942. xGame.uiMgr.Hide(UIGame);
  10943. if (level && !level.isHide) {
  10944. }
  10945. else {
  10946. xGame.uiMgr.Show(UILevelDisplay);
  10947. }
  10948. this.closeSelf();
  10949. }
  10950. }
  10951. UIAddProp.uiName = "UIAddProp";
  10952. class MoneyNode {
  10953. constructor(ui) {
  10954. this.leftTime = 0;
  10955. this.ui = ui;
  10956. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10957. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10958. this.ui.addPowerBtn.onClick(this, this.addPower);
  10959. this.ui.c1.selectedIndex = 1;
  10960. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10961. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10962. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10963. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10964. this.coinChange();
  10965. this.diamondChange();
  10966. this.powerChange();
  10967. }
  10968. addPower() {
  10969. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10970. xGame.uiMgr.Show(UIPower);
  10971. }
  10972. powerChange() {
  10973. let powerNum = DataMgr.getPower();
  10974. this.ui.powerTxt.text = powerNum + "";
  10975. }
  10976. checkPowerTime() {
  10977. let cur = new Date().getTime();
  10978. let last = DataMgr.getPowerTime();
  10979. if (last == 0) {
  10980. last = cur;
  10981. DataMgr.setPowerTime(cur);
  10982. }
  10983. let power = DataMgr.getPower();
  10984. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10985. Laya.timer.clearAll(this);
  10986. if (power >= xGame.common.natureMaxPower) {
  10987. this.ui.powerTimeTxt.text = "";
  10988. DataMgr.setPowerTime(cur);
  10989. return;
  10990. }
  10991. if (power + offset >= xGame.common.natureMaxPower) {
  10992. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10993. this.ui.powerTimeTxt.text = "";
  10994. DataMgr.setPowerTime(cur);
  10995. }
  10996. else {
  10997. if (offset > 0) {
  10998. DataMgr.setPower(offset);
  10999. DataMgr.setPowerTime(cur);
  11000. }
  11001. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11002. this.leftTime = xGame.common.powerRecoverNum - time;
  11003. if (this.leftTime <= 0)
  11004. this.leftTime = 0;
  11005. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11006. Laya.timer.loop(1000, this, this.updatePowerTime);
  11007. }
  11008. }
  11009. updatePowerTime() {
  11010. this.leftTime -= 1;
  11011. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11012. if (this.leftTime <= 0) {
  11013. this.checkPowerTime();
  11014. }
  11015. }
  11016. coinChange() {
  11017. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11018. }
  11019. diamondChange() {
  11020. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11021. }
  11022. addCoin() {
  11023. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11024. Moyu.sendDataEvent("AddCoinBtn");
  11025. xGame.uiMgr.Show(UIAddProp, 0);
  11026. }
  11027. addDiamond() {
  11028. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11029. Moyu.sendDataEvent("AddDiamondBtn");
  11030. xGame.uiMgr.Show(UIAddProp, 1);
  11031. }
  11032. }
  11033. class UIDraw extends UIBase {
  11034. constructor() {
  11035. super();
  11036. this.curKey = 0;
  11037. }
  11038. onConstructor() {
  11039. this.ui = ui_UIDraw.createInstance();
  11040. this.contentPane = this.ui;
  11041. this.isEject = false;
  11042. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11043. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11044. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11045. this.initDraw();
  11046. this.initUI();
  11047. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11048. if (Moyu.isKs)
  11049. this.ui.closeNode.closeBtn.x += 100;
  11050. }
  11051. show() {
  11052. super.show();
  11053. this.ui.t0.play();
  11054. this.playSecretaryIdle();
  11055. this.updateDraw();
  11056. this.checkFree();
  11057. if (PlatMgr.bannerDelay > 0) {
  11058. this.ui.closeNode.closeBtn.visible = false;
  11059. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11060. this.ui.closeNode.closeBtn.visible = true;
  11061. });
  11062. }
  11063. PlatMgr.showRateBanner();
  11064. }
  11065. hide() {
  11066. Laya.timer.clearAll(this);
  11067. super.hide();
  11068. }
  11069. checkFree() {
  11070. let isFree = DataMgr.getDailyfreeDrawTimes();
  11071. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11072. }
  11073. initDraw() {
  11074. this.drawObj = [];
  11075. let data = cfgTable.drawData;
  11076. let temp;
  11077. let weight = 0;
  11078. for (const key in data) {
  11079. temp = data[key];
  11080. weight += temp.weight;
  11081. this.drawObj.push(weight);
  11082. }
  11083. this.allWeight = weight;
  11084. }
  11085. initUI() {
  11086. let data = cfgTable.drawData;
  11087. let temp;
  11088. let img;
  11089. let txt;
  11090. for (const key in data) {
  11091. temp = data[key];
  11092. img = this.ui.myNode.rotNode["img" + key];
  11093. txt = this.ui.myNode.rotNode["txt" + key];
  11094. img.url = xGame.common.getGameIconUrl(temp.icon);
  11095. txt.visible = true;
  11096. if (temp.award > 2) {
  11097. img.rotation = 0;
  11098. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11099. }
  11100. else {
  11101. img.rotation = temp.rotation;
  11102. txt.text = temp.num;
  11103. }
  11104. }
  11105. }
  11106. getCurkey() {
  11107. let rand = Math.random() * this.allWeight;
  11108. let temp;
  11109. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11110. temp = this.drawObj[index];
  11111. if (index == 0) {
  11112. if (rand < temp) {
  11113. return index + 1;
  11114. }
  11115. }
  11116. else {
  11117. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11118. return index + 1;
  11119. }
  11120. }
  11121. }
  11122. return 2;
  11123. }
  11124. startDraw() {
  11125. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11126. if (freeTimes > 0) {
  11127. this.beginDraw();
  11128. DataMgr.setDailyfreeDrawTimes(0);
  11129. this.checkFree();
  11130. }
  11131. else {
  11132. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11133. }
  11134. else {
  11135. console.log('zh:AD 失败,直接发放奖励');
  11136. this.qjff_chouJiang();
  11137. }
  11138. }
  11139. }
  11140. qjff_chouJiang() {
  11141. this.beginDraw();
  11142. }
  11143. beginDraw() {
  11144. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11145. this.ui.drawBtn.touchable = false;
  11146. this.curKey = this.getCurkey();
  11147. console.log("当前key", this.curKey);
  11148. let cell = 60;
  11149. let lap = 3;
  11150. let angle = cell * (this.curKey - 1) + lap * 360;
  11151. let target = this.ui.myNode.rotNode;
  11152. target.rotation = 0;
  11153. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11154. console.log("旋转完成");
  11155. this.ui.drawBtn.touchable = true;
  11156. this.getAward();
  11157. }));
  11158. }
  11159. getAward() {
  11160. let data = cfgTable.drawData[this.curKey];
  11161. let temp = new AwardType();
  11162. temp.type = data.award;
  11163. temp.num = data.num;
  11164. xGame.common.getAward([temp], () => {
  11165. DataMgr.setDrawTimes(1);
  11166. this.updateDraw();
  11167. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11168. });
  11169. }
  11170. updateDraw() {
  11171. let drawTimes = DataMgr.getDrawTimes();
  11172. let awardTimes = DataMgr.getDrawAwardTimes();
  11173. if (Math.floor(drawTimes / 3) > awardTimes) {
  11174. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11175. this.ui.extraNode.boxBtn.touchable = true;
  11176. this.ui.extraNode.tipsTxt.text = "3/3";
  11177. this.ui.extraNode.barNode.width = 265;
  11178. this.getExtraAward();
  11179. }
  11180. else {
  11181. this.ui.extraNode.boxBtn.t0.stop();
  11182. this.ui.extraNode.boxBtn.touchable = false;
  11183. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11184. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11185. }
  11186. let data = cfgTable.drawData[1];
  11187. if (awardTimes == 0) {
  11188. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11189. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11190. this.ui.myNode.rotNode.img1.rotation = 0;
  11191. }
  11192. else {
  11193. let award = data.nextid;
  11194. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11195. this.ui.myNode.rotNode.txt1.text = award[1];
  11196. this.ui.myNode.rotNode.img1.rotation = 0;
  11197. }
  11198. }
  11199. getExtraAward() {
  11200. let drawTimes = DataMgr.getDrawTimes();
  11201. let awardTimes = DataMgr.getDrawAwardTimes();
  11202. let data = cfgTable.drawData[1];
  11203. let award = new AwardType();
  11204. if (awardTimes == 0) {
  11205. award.num = data.num;
  11206. award.type = data.award;
  11207. xGame.common.getAward([award], () => {
  11208. let all = Math.floor(drawTimes / 3);
  11209. DataMgr.setDrawAwardTimes(all);
  11210. this.updateDraw();
  11211. });
  11212. }
  11213. else {
  11214. award.num = parseInt(data.nextid[1]);
  11215. award.type = parseInt(data.nextid[0]);
  11216. xGame.common.getAward([award], () => {
  11217. let all = Math.floor(drawTimes / 3);
  11218. DataMgr.setDrawAwardTimes(all);
  11219. this.updateDraw();
  11220. });
  11221. }
  11222. }
  11223. closeSelf() {
  11224. this.hide();
  11225. }
  11226. playSecretaryIdle() {
  11227. let parent = this.ui.secretary.displayObject;
  11228. parent.destroyChildren();
  11229. let xx = this.ui.secretary.width / 2;
  11230. let yy = this.ui.secretary.height;
  11231. let scale = xGame.common.getSecretaryScale();
  11232. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11233. xGame.common.secretary.play(data, 0, true, parent);
  11234. }
  11235. }
  11236. UIDraw.uiName = "UIDraw";
  11237. class ui_UIFlyEft extends fgui.GComponent {
  11238. static createInstance() {
  11239. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11240. }
  11241. onConstruct() {
  11242. this.n0 = (this.getChild("n0"));
  11243. this.n1 = (this.getChild("n1"));
  11244. this.n2 = (this.getChild("n2"));
  11245. this.n3 = (this.getChild("n3"));
  11246. this.n4 = (this.getChild("n4"));
  11247. this.n5 = (this.getChild("n5"));
  11248. this.n6 = (this.getChild("n6"));
  11249. this.n7 = (this.getChild("n7"));
  11250. this.iconNode = (this.getChild("iconNode"));
  11251. this.txt = (this.getChild("txt"));
  11252. this.txtNode = (this.getChild("txtNode"));
  11253. }
  11254. }
  11255. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11256. class UIFlyEft extends UIBase {
  11257. constructor() {
  11258. super();
  11259. this.max = 8;
  11260. this.delay = 0;
  11261. }
  11262. onConstructor() {
  11263. this.ui = ui_UIFlyEft.createInstance();
  11264. this.contentPane = this.ui;
  11265. this.isEject = false;
  11266. this.isMuti = true;
  11267. this.ui.x += xGame.common.sysOffestNum;
  11268. }
  11269. getArrPos() {
  11270. if (this.iconPos && this.iconPos.length > 0)
  11271. return;
  11272. this.iconPos = [];
  11273. let temp;
  11274. for (let index = 0; index < this.max; index++) {
  11275. temp = this.ui["n" + index];
  11276. this.iconPos.push([temp.x, temp.y]);
  11277. }
  11278. }
  11279. show(stPos, edPos, num, type, callback) {
  11280. super.show();
  11281. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11282. this.getArrPos();
  11283. this.updateUI(type);
  11284. this.updatePos();
  11285. this.runFly(edPos, callback);
  11286. this.runWorlds(stPos, num);
  11287. }
  11288. updateUI(type) {
  11289. let temp;
  11290. let str;
  11291. for (let index = 0; index < this.max; index++) {
  11292. temp = this.ui["n" + index];
  11293. str = this.getIconStr(type);
  11294. temp.url = xGame.common.getGameIconUrl(str);
  11295. }
  11296. }
  11297. getIconStr(type) {
  11298. switch (type) {
  11299. case Prop.diamond:
  11300. return "ty_zs";
  11301. case Prop.coin:
  11302. return "ty_jb";
  11303. default:
  11304. break;
  11305. }
  11306. }
  11307. updatePos() {
  11308. let temp;
  11309. for (let index = 0; index < this.max; index++) {
  11310. temp = this.ui["n" + index];
  11311. temp.x = this.iconPos[index][0];
  11312. temp.y = this.iconPos[index][1];
  11313. }
  11314. }
  11315. runFly(endPos, callback) {
  11316. let all = 0;
  11317. let temp;
  11318. for (let index = 0; index < this.max; index++) {
  11319. temp = this.ui["n" + index];
  11320. temp.visible = true;
  11321. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11322. temp.visible = false;
  11323. all++;
  11324. if (all >= this.max) {
  11325. callback && callback();
  11326. }
  11327. }), 20 * index);
  11328. }
  11329. }
  11330. runWorlds(stPos, num) {
  11331. let str = "+" + num;
  11332. this.ui.txt.text = str;
  11333. let starX = stPos.x;
  11334. let starY = stPos.y + 50;
  11335. this.ui.txt.x = starX;
  11336. this.ui.txt.y = starY;
  11337. this.ui.txt.visible = true;
  11338. this.ui.txt.alpha = 1;
  11339. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11340. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11341. this.ui.txt.visible = false;
  11342. this.hide();
  11343. }));
  11344. }));
  11345. }
  11346. }
  11347. UIFlyEft.uiName = "UIFlyEft";
  11348. class Common {
  11349. constructor() {
  11350. this.convertNum = 0.025;
  11351. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11352. this.scaleV3One = new Laya.Vector3();
  11353. this.scaleV3Two = new Laya.Vector3();
  11354. this.posV4 = new Laya.Vector4();
  11355. this.showDebug = false;
  11356. this.openGuide = true;
  11357. this.rodOffest = new Laya.Vector2(0, 0);
  11358. this.rodAngle = 0;
  11359. this.gameMode = GameMode.classic;
  11360. this.bigMoveLevelIndex = 1;
  11361. this.bigMoveNeedCoin = 1000;
  11362. this.classicNiceNeddCoin = 1000;
  11363. this.passAwardCoin = 2000;
  11364. this.classicRoomType = 1;
  11365. this.maxPower = 20;
  11366. this.natureMaxPower = 5;
  11367. this.videoPower = 2;
  11368. this.powerRecoverNum = 900;
  11369. this.curPlayerSkillType = 0;
  11370. this.isNewDay = false;
  11371. this.clickedBall = false;
  11372. this.placeBallCurLevel = 0;
  11373. this.placeBallStarNum = 0;
  11374. this.longHelpLine = false;
  11375. this.maxShareDiamondTimes = 3;
  11376. this.guideStep = 0;
  11377. this.temSelfLevel = 0;
  11378. this.extraMoveNum = 0;
  11379. this.curRankID = 0;
  11380. this.rankID = {
  11381. normalStar: 12000,
  11382. wxStar: 12001
  11383. };
  11384. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11385. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11386. this.btnClickStr = "buttonclick";
  11387. this.maxSkillLevel = 10;
  11388. this.upSkillLevel = false;
  11389. this.gameStartTime = 0;
  11390. this._sysOffestNum = 0;
  11391. this.angleV2 = new Laya.Vector2();
  11392. this.rootV = new Laya.Vector2(0, 1);
  11393. this.tempDir1 = new Laya.Vector2();
  11394. this.tempDir2 = new Laya.Vector2();
  11395. this.ballSize = 33;
  11396. this.stPos = new Laya.Point();
  11397. this.edPos = new Laya.Point();
  11398. Common._instance = this;
  11399. window["common"] = this;
  11400. }
  11401. static getInstance() {
  11402. if (!this._instance) {
  11403. this._instance = new Common();
  11404. }
  11405. return this._instance;
  11406. }
  11407. get sysOffestNum() {
  11408. if (this._sysOffestNum == 0) {
  11409. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11410. }
  11411. return this._sysOffestNum;
  11412. }
  11413. testShader() {
  11414. let test = new LightShader();
  11415. test.texture = "res/d3Res/ballTexture/ball1.png";
  11416. Laya.stage.addChild(test);
  11417. }
  11418. playScale(node) {
  11419. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11420. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11421. }));
  11422. }));
  11423. }
  11424. setGroup(colli, ...group) {
  11425. let out = 0;
  11426. for (let index = 0; index < group.length; index++) {
  11427. if (index == 0) {
  11428. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11429. }
  11430. else {
  11431. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11432. }
  11433. }
  11434. colli.collisionGroup = out;
  11435. }
  11436. setCanGroupWith(colli, ...group) {
  11437. let out = 0;
  11438. for (let index = 0; index < group.length; index++) {
  11439. if (index == 0) {
  11440. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11441. }
  11442. else {
  11443. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11444. }
  11445. }
  11446. colli.canCollideWith = out;
  11447. }
  11448. loadPrefab(name, callback) {
  11449. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11450. let prefab = new Laya.Prefab();
  11451. prefab.json = obj;
  11452. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11453. callback && callback(img);
  11454. }));
  11455. }
  11456. pos2to3Convert(x, y, d3Pos) {
  11457. x = x + this.sysOffestNum;
  11458. d3Pos.setValue(x, y, 0);
  11459. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11460. if (success) {
  11461. }
  11462. else {
  11463. console.error("转换出错了。。。。。。。。");
  11464. }
  11465. }
  11466. scale2to3Convert(num) {
  11467. this.scaleV3One.setValue(0, 0, 0);
  11468. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11469. this.scaleV3Two.setValue(0, num, 0);
  11470. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11471. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11472. return outNum;
  11473. }
  11474. pos3to2Convert(d3Pos) {
  11475. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11476. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11477. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11478. d3Pos.x -= this.sysOffestNum;
  11479. }
  11480. scale3to2Convert(num) {
  11481. let scale = this.scale2to3Convert(1);
  11482. let d2Out = num / scale;
  11483. return d2Out;
  11484. }
  11485. getCollider(type, restitution = 0.9, density = 10) {
  11486. let colli;
  11487. if (type == "box")
  11488. colli = new Laya.BoxCollider();
  11489. else
  11490. colli = new Laya.CircleCollider();
  11491. colli.friction = 0;
  11492. colli.restitution = restitution;
  11493. colli.density = density;
  11494. return colli;
  11495. }
  11496. getRigbody() {
  11497. let rigy = new Laya.RigidBody();
  11498. rigy.bullet = true;
  11499. rigy.allowRotation = false;
  11500. rigy.allowSleep = false;
  11501. rigy.gravityScale = 0;
  11502. return rigy;
  11503. }
  11504. getfguiRotation(x, y) {
  11505. this.angleV2.setValue(x, y);
  11506. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11507. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11508. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11509. angle = -angle;
  11510. }
  11511. return 180 + angle;
  11512. }
  11513. getAngle(x, y) {
  11514. this.angleV2.setValue(x, y);
  11515. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11516. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11517. return angle;
  11518. }
  11519. randomNum(a, b) {
  11520. return a + Math.floor((b - a + 1) * Math.random());
  11521. }
  11522. getRandArrEle(arr) {
  11523. return arr[Math.floor(arr.length * Math.random())];
  11524. }
  11525. getSign(val) {
  11526. return val >= 0 ? 1 : -1;
  11527. }
  11528. botherArr(arr) {
  11529. let times = arr.length + 2;
  11530. let length = arr.length;
  11531. let a;
  11532. let b;
  11533. let temp;
  11534. for (let index = 0; index < times; index++) {
  11535. a = Math.floor(Math.random() * length);
  11536. b = Math.floor(Math.random() * length);
  11537. temp = arr[a];
  11538. arr[a] = arr[b];
  11539. arr[b] = temp;
  11540. }
  11541. }
  11542. getGameIconUrl(id) {
  11543. return "ui://game/" + id;
  11544. }
  11545. getComponentUrl(id) {
  11546. return "ui://game/" + id;
  11547. }
  11548. getAnimation() {
  11549. }
  11550. judgeSkillType(type = SkillType.highSpace) {
  11551. if (this.gameMode == GameMode.classic)
  11552. return;
  11553. let gameMgr = this.gameMgr;
  11554. if (gameMgr.selfTurn) {
  11555. if (gameMgr.selfCurSkill == type) {
  11556. return true;
  11557. }
  11558. }
  11559. else {
  11560. if (gameMgr.aiCurSkill == type) {
  11561. return true;
  11562. }
  11563. }
  11564. }
  11565. ballColliHole(collider) {
  11566. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11567. xGame.common.gameMgr.isFirstInGame = false;
  11568. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11569. }
  11570. collider.owner.mySrc.checkWrongBall();
  11571. }
  11572. getArrMaxEle(arr) {
  11573. let max = -Infinity;
  11574. for (let index = 0; index < arr.length; index++) {
  11575. max = Math.max(arr[index], max);
  11576. }
  11577. return max;
  11578. }
  11579. getArrMinEle(arr) {
  11580. let min = Infinity;
  11581. for (let index = 0; index < arr.length; index++) {
  11582. min = Math.min(arr[index], min);
  11583. }
  11584. return min;
  11585. }
  11586. playRandomMutiBallBigSkillSound() {
  11587. if (Math.random() <= 0.5)
  11588. return;
  11589. let rand = this.randomNum(1, 6);
  11590. let str = "ganfa0" + rand;
  11591. xGame.soundMgr.playSound(str);
  11592. }
  11593. showOneCamera(type) {
  11594. let object = xGame.common.d3World.cameraObj;
  11595. for (const key in object) {
  11596. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11597. object[key].init();
  11598. object[key].owner.active = key == type;
  11599. }
  11600. }
  11601. }
  11602. checkBallOverBorder(x, y) {
  11603. let radius = 17;
  11604. let condition = this._checkBorder(x + radius, y) ||
  11605. this._checkBorder(x - radius, y) ||
  11606. this._checkBorder(x, y + radius) ||
  11607. this._checkBorder(x, y - radius);
  11608. if (condition) {
  11609. return true;
  11610. }
  11611. }
  11612. _checkBorder(x, y) {
  11613. let borderRect = this.d2World.borderRect;
  11614. let xOffest = 20;
  11615. let yOffest = 20;
  11616. if (y <= borderRect.y - yOffest) {
  11617. return true;
  11618. }
  11619. if (y >= borderRect.y + borderRect.height + yOffest) {
  11620. return true;
  11621. }
  11622. if (x <= borderRect.x - xOffest) {
  11623. return true;
  11624. }
  11625. if (x >= borderRect.x + borderRect.width + xOffest) {
  11626. return true;
  11627. }
  11628. }
  11629. initWeight(cfg) {
  11630. let allCfgData = { data: {}, allWeightNum: 0 };
  11631. let weightCfg = allCfgData.data;
  11632. let weight = 0;
  11633. for (const key in cfg) {
  11634. weightCfg[key] = {};
  11635. weightCfg[key].id = cfg[key].id;
  11636. weightCfg[key].minWeight = weight;
  11637. weight += cfg[key].weight;
  11638. weightCfg[key].maxWeight = weight;
  11639. }
  11640. allCfgData.allWeightNum = weight;
  11641. return allCfgData;
  11642. }
  11643. getRandomWeightData(cfg) {
  11644. let weightCfg = cfg.data;
  11645. let allWeightNum = cfg.allWeightNum;
  11646. let rand = Math.floor(Math.random() * allWeightNum);
  11647. for (const key in weightCfg) {
  11648. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11649. return weightCfg[key];
  11650. }
  11651. }
  11652. return weightCfg[1];
  11653. }
  11654. showGirlTalkPop(wordsIndex, node, msgNode) {
  11655. node.visible = true;
  11656. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11657. node.t0.play(Laya.Handler.create(this, () => {
  11658. node.visible = false;
  11659. }));
  11660. }
  11661. stopGirlPop(node) {
  11662. node.t0.stop();
  11663. node.visible = false;
  11664. }
  11665. createHead(loader, url, size = 107) {
  11666. if (Laya.Browser.name == "Browser") {
  11667. loader.url = url;
  11668. return;
  11669. }
  11670. else {
  11671. console.log('zh:url=', url);
  11672. loader.url = url;
  11673. }
  11674. }
  11675. addTestCoin(num) {
  11676. DataMgr.setCoin(num);
  11677. }
  11678. addTestDiamond(num) {
  11679. DataMgr.setDiamond(num);
  11680. }
  11681. addTestSkill() {
  11682. DataMgr.setBigSkill(0, 99);
  11683. DataMgr.setBigSkill(1, 99);
  11684. DataMgr.setBigSkill(2, 99);
  11685. }
  11686. playClassicEmotion(number, x, y) {
  11687. if (this.gameMode == GameMode.bigMove)
  11688. return;
  11689. let randIndex = this.randomNum(0, 2);
  11690. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11691. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11692. if (this.gameMgr.selfTurn) {
  11693. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11694. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11695. }
  11696. else {
  11697. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11698. }
  11699. else {
  11700. if (number == this.gameMgr.blackNum) {
  11701. if (this.gameMgr.selfBallArr.length == 0) {
  11702. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11703. }
  11704. else {
  11705. }
  11706. }
  11707. else {
  11708. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11709. }
  11710. }
  11711. }
  11712. }
  11713. else {
  11714. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11715. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11716. }
  11717. else {
  11718. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11719. }
  11720. else {
  11721. if (number == this.gameMgr.blackNum) {
  11722. if (this.gameMgr.aiBallArr.length == 0) {
  11723. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11724. }
  11725. else {
  11726. }
  11727. }
  11728. else {
  11729. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11730. }
  11731. }
  11732. }
  11733. }
  11734. }
  11735. playHappySound(number) {
  11736. if (this.gameMode != GameMode.classic)
  11737. return;
  11738. if (number == 8)
  11739. return;
  11740. let play = false;
  11741. if (this.gameMgr.selfTurn) {
  11742. if (this.gameMgr.ensureBallType) {
  11743. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11744. play = true;
  11745. }
  11746. }
  11747. else {
  11748. play = true;
  11749. }
  11750. }
  11751. else {
  11752. if (this.gameMgr.ensureBallType) {
  11753. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11754. play = true;
  11755. }
  11756. }
  11757. else {
  11758. play = true;
  11759. }
  11760. }
  11761. if (play)
  11762. xGame.soundMgr.playSound("applause");
  11763. }
  11764. destroyClassicEmotion() {
  11765. if (this.gameMode == GameMode.bigMove)
  11766. return;
  11767. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11768. parent.destroyChildren();
  11769. }
  11770. playAwardSpine(x, y) {
  11771. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11772. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11773. this.awardSpine.play(data, 0, false, parent);
  11774. }
  11775. destroyAwardSpine() {
  11776. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11777. parent.destroyChildren();
  11778. }
  11779. isBlock(bx, by, hx, hy, except = null) {
  11780. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11781. let balls = xGame.common.d2World.ballArr;
  11782. let outArr = [];
  11783. for (let index = 0; index < balls.length; index++) {
  11784. let obj = balls[index];
  11785. if (obj.number == 0)
  11786. continue;
  11787. if (obj == except)
  11788. continue;
  11789. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11790. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11791. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11792. if (num >= 1)
  11793. num = 1;
  11794. if (num < 0)
  11795. continue;
  11796. let gap = Math.sin(Math.acos(num)) * dis;
  11797. if (gap < this.ballSize) {
  11798. outArr.push({
  11799. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11800. disHon: Math.cos(Math.acos(num)) * dis,
  11801. disVer: Math.sin(Math.acos(num)) * dis,
  11802. src: balls[index],
  11803. dir: this.tempDir1
  11804. });
  11805. }
  11806. }
  11807. if (outArr.length > 0) {
  11808. outArr.sort((a, b) => { return a.dis - b.dis; });
  11809. return outArr[0];
  11810. }
  11811. }
  11812. AngleBetween(vector1, vector2) {
  11813. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11814. return rad * (180 / Math.PI);
  11815. }
  11816. getSecretaryScale() {
  11817. if (this.secretary.spineName == "mishu") {
  11818. return 1.28;
  11819. }
  11820. else {
  11821. return 1.024;
  11822. }
  11823. }
  11824. signAwardContainsRod(arr) {
  11825. let temp;
  11826. for (let index = 0; index < arr.length; index++) {
  11827. temp = arr[index].split('-')[0];
  11828. if (parseInt(temp) > 2) {
  11829. return true;
  11830. }
  11831. }
  11832. }
  11833. judgeSameDay() {
  11834. let lastTime = DataMgr.getSignTime();
  11835. let curTime = new Date().getTime();
  11836. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11837. return true;
  11838. }
  11839. return false;
  11840. }
  11841. getAward(arr, callback) {
  11842. let showTriple = arr[0].type <= 2;
  11843. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11844. let temp;
  11845. for (let index = 0; index < arr.length; index++) {
  11846. temp = arr[index];
  11847. switch (temp.type) {
  11848. case 1:
  11849. this.playObjFlyAnim(temp.num, temp.type);
  11850. break;
  11851. case 2:
  11852. this.playObjFlyAnim(temp.num, temp.type);
  11853. break;
  11854. case 3:
  11855. case 4:
  11856. case 5:
  11857. case 6:
  11858. DataMgr.setBallRod(temp.type - 2, 1);
  11859. DataMgr.setCurBallRod(temp.type - 2);
  11860. break;
  11861. default:
  11862. break;
  11863. }
  11864. }
  11865. callback && callback(watchVideo);
  11866. });
  11867. }
  11868. getMoneyNode() {
  11869. let moneyNode;
  11870. let sign = xGame.uiMgr.getUI(UISign);
  11871. let draw = xGame.uiMgr.getUI(UIDraw);
  11872. let end = xGame.uiMgr.getUI(UIGameEnd);
  11873. let skill = xGame.uiMgr.getUI(UISkill);
  11874. if (sign && !sign.isHide)
  11875. moneyNode = sign.ui.moneyNode;
  11876. if (draw && !draw.isHide)
  11877. moneyNode = draw.ui.moneyNode;
  11878. if (end && !end.isHide)
  11879. moneyNode = end.ui.moneyNode;
  11880. if (skill && !skill.isHide)
  11881. moneyNode = skill.ui.moneyNode;
  11882. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11883. let main = xGame.uiMgr.getUI(UIMain);
  11884. if (condition1 && main && !main.isHide) {
  11885. moneyNode = main.ui.moneyNode;
  11886. }
  11887. return moneyNode;
  11888. }
  11889. playObjFlyAnim(num, type, callback = null) {
  11890. this.stPos.x = Laya.stage.width / 2;
  11891. this.stPos.y = Laya.stage.height / 2;
  11892. let moneyNode = this.getMoneyNode();
  11893. switch (type) {
  11894. case Prop.diamond:
  11895. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11896. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11897. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11898. this.edPos.x /= 2;
  11899. this.edPos.y /= 2;
  11900. break;
  11901. case Prop.coin:
  11902. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11903. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11904. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11905. this.edPos.x /= 2;
  11906. this.edPos.y /= 2;
  11907. break;
  11908. default:
  11909. break;
  11910. }
  11911. xGame.soundMgr.playSound("coinbag");
  11912. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11913. switch (type) {
  11914. case Prop.diamond:
  11915. DataMgr.setDiamond(num);
  11916. break;
  11917. case Prop.coin:
  11918. DataMgr.setCoin(num);
  11919. break;
  11920. default:
  11921. break;
  11922. }
  11923. callback && callback();
  11924. });
  11925. }
  11926. autoPopUIView() {
  11927. let arr = [];
  11928. let sign = this.judgeSameDay() ? false : true;
  11929. if (sign)
  11930. arr.push("sign");
  11931. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11932. if (draw)
  11933. arr.push("draw");
  11934. if (arr.length <= 0)
  11935. return;
  11936. let str = this.getRandArrEle(arr);
  11937. switch (str) {
  11938. case "sign":
  11939. xGame.uiMgr.Show(UISign);
  11940. break;
  11941. case "draw":
  11942. xGame.uiMgr.Show(UIDraw);
  11943. break;
  11944. default:
  11945. break;
  11946. }
  11947. }
  11948. getMSTime(time) {
  11949. let min = Math.floor(time / 60);
  11950. let sec = Math.floor((time - min * 60));
  11951. if (sec < 10)
  11952. sec = "0" + sec;
  11953. if (min < 10)
  11954. min = "0" + min;
  11955. return `${min}:${sec}`;
  11956. }
  11957. testPower() {
  11958. DataMgr.setPower(0, false);
  11959. }
  11960. getAllStarNum() {
  11961. let data = DataMgr.getPlaceBallLevelList();
  11962. let out = 0;
  11963. for (let index = 0; index < data.length; index++) {
  11964. out += data[index].star;
  11965. }
  11966. return out;
  11967. }
  11968. recoverCameraView() {
  11969. Laya.timer.once(900, this, () => {
  11970. xGame.common.showOneCamera("mainCamera");
  11971. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11972. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11973. xGame.common.gameUI.ui.border.alpha = 0;
  11974. if (Laya.physicsTimer.scale < 1) {
  11975. Laya.physicsTimer.scale = 1;
  11976. }
  11977. }
  11978. });
  11979. }
  11980. getClassicLevel() {
  11981. let successTimes = DataMgr.getClassicTimes();
  11982. let needKey = "";
  11983. let lastKey = "";
  11984. let cfg = cfgTable.classictimesData;
  11985. let data;
  11986. for (const key in cfg) {
  11987. data = cfg[key];
  11988. if (successTimes <= data.times) {
  11989. needKey = key;
  11990. }
  11991. lastKey = key;
  11992. }
  11993. if (needKey == "")
  11994. needKey = lastKey;
  11995. return cfg[needKey];
  11996. }
  11997. }
  11998. Common._instance = null;
  11999. class ui_Component92 extends fgui.GComponent {
  12000. static createInstance() {
  12001. return (fgui.UIPackage.createObject("game", "Component92"));
  12002. }
  12003. onConstruct() {
  12004. this.n0 = (this.getChild("n0"));
  12005. }
  12006. }
  12007. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12008. class ui_Component129 extends fgui.GProgressBar {
  12009. static createInstance() {
  12010. return (fgui.UIPackage.createObject("game", "Component129"));
  12011. }
  12012. onConstruct() {
  12013. this.bar_v = (this.getChild("bar_v"));
  12014. this.n84 = (this.getChild("n84"));
  12015. }
  12016. }
  12017. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12018. class ui_Component130 extends fgui.GComponent {
  12019. static createInstance() {
  12020. return (fgui.UIPackage.createObject("game", "Component130"));
  12021. }
  12022. onConstruct() {
  12023. this.ani = (this.getChild("ani"));
  12024. this.t0 = this.getTransition("t0");
  12025. }
  12026. }
  12027. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12028. class ui_powerEft extends fgui.GComponent {
  12029. static createInstance() {
  12030. return (fgui.UIPackage.createObject("game", "powerEft"));
  12031. }
  12032. onConstruct() {
  12033. this.ani = (this.getChild("ani"));
  12034. this.n88 = (this.getChild("n88"));
  12035. this.n89 = (this.getChild("n89"));
  12036. }
  12037. }
  12038. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12039. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12040. static createInstance() {
  12041. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12042. }
  12043. onConstruct() {
  12044. this.c1 = this.getController("c1");
  12045. this.n2 = (this.getChild("n2"));
  12046. this.n22 = (this.getChild("n22"));
  12047. this.n23 = (this.getChild("n23"));
  12048. this.n15 = (this.getChild("n15"));
  12049. this.challenge = (this.getChild("challenge"));
  12050. this.n17 = (this.getChild("n17"));
  12051. this.n3 = (this.getChild("n3"));
  12052. this.starNode = (this.getChild("starNode"));
  12053. this.levelTxt = (this.getChild("levelTxt"));
  12054. this.n14 = (this.getChild("n14"));
  12055. this.n19 = (this.getChild("n19"));
  12056. this.n20 = (this.getChild("n20"));
  12057. this.n21 = (this.getChild("n21"));
  12058. this.special = (this.getChild("special"));
  12059. }
  12060. }
  12061. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12062. class ui_Component79 extends fgui.GComponent {
  12063. static createInstance() {
  12064. return (fgui.UIPackage.createObject("game", "Component79"));
  12065. }
  12066. onConstruct() {
  12067. this.c1 = this.getController("c1");
  12068. this.n7 = (this.getChild("n7"));
  12069. this.n8 = (this.getChild("n8"));
  12070. this.n9 = (this.getChild("n9"));
  12071. this.n10 = (this.getChild("n10"));
  12072. this.n11 = (this.getChild("n11"));
  12073. this.n12 = (this.getChild("n12"));
  12074. }
  12075. }
  12076. ui_Component79.URL = "ui://isxx5ak7avag477";
  12077. class ui_Component80 extends fgui.GComponent {
  12078. static createInstance() {
  12079. return (fgui.UIPackage.createObject("game", "Component80"));
  12080. }
  12081. onConstruct() {
  12082. this.n0 = (this.getChild("n0"));
  12083. this.n1 = (this.getChild("n1"));
  12084. this.myList = (this.getChild("myList"));
  12085. this.t0 = this.getTransition("t0");
  12086. }
  12087. }
  12088. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12089. class ui_SignNormal extends fgui.GComponent {
  12090. static createInstance() {
  12091. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12092. }
  12093. onConstruct() {
  12094. this.c1 = this.getController("c1");
  12095. this.n7 = (this.getChild("n7"));
  12096. this.n15 = (this.getChild("n15"));
  12097. this.titleTxt = (this.getChild("titleTxt"));
  12098. this.n8 = (this.getChild("n8"));
  12099. this.myIcon = (this.getChild("myIcon"));
  12100. this.numTxt = (this.getChild("numTxt"));
  12101. this.n12 = (this.getChild("n12"));
  12102. this.n13 = (this.getChild("n13"));
  12103. this.n17 = (this.getChild("n17"));
  12104. this.n14 = (this.getChild("n14"));
  12105. }
  12106. }
  12107. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12108. class ui_screenNode extends fgui.GComponent {
  12109. static createInstance() {
  12110. return (fgui.UIPackage.createObject("game", "screenNode"));
  12111. }
  12112. onConstruct() {
  12113. this.n9 = (this.getChild("n9"));
  12114. this.screenImg = (this.getChild("screenImg"));
  12115. }
  12116. }
  12117. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12118. class ui_GetAwrad_com1 extends fgui.GComponent {
  12119. static createInstance() {
  12120. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12121. }
  12122. onConstruct() {
  12123. this.n38 = (this.getChild("n38"));
  12124. this.n39 = (this.getChild("n39"));
  12125. this.n40 = (this.getChild("n40"));
  12126. this.t0 = this.getTransition("t0");
  12127. this.t1 = this.getTransition("t1");
  12128. }
  12129. }
  12130. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12131. class ui_GetAwrad_com2 extends fgui.GComponent {
  12132. static createInstance() {
  12133. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12134. }
  12135. onConstruct() {
  12136. this.n39 = (this.getChild("n39"));
  12137. this.n40 = (this.getChild("n40"));
  12138. this.t0 = this.getTransition("t0");
  12139. }
  12140. }
  12141. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12142. class ui_Component128 extends fgui.GComponent {
  12143. static createInstance() {
  12144. return (fgui.UIPackage.createObject("game", "Component128"));
  12145. }
  12146. onConstruct() {
  12147. this.n38 = (this.getChild("n38"));
  12148. this.n40 = (this.getChild("n40"));
  12149. }
  12150. }
  12151. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12152. class ui_Component100_1 extends fgui.GComponent {
  12153. static createInstance() {
  12154. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12155. }
  12156. onConstruct() {
  12157. this.myNode = (this.getChild("myNode"));
  12158. this.t0 = this.getTransition("t0");
  12159. }
  12160. }
  12161. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12162. class ui_Component142 extends fgui.GComponent {
  12163. static createInstance() {
  12164. return (fgui.UIPackage.createObject("game", "Component142"));
  12165. }
  12166. onConstruct() {
  12167. this.n41 = (this.getChild("n41"));
  12168. this.n42 = (this.getChild("n42"));
  12169. }
  12170. }
  12171. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12172. class ui_main_guang extends fgui.GComponent {
  12173. static createInstance() {
  12174. return (fgui.UIPackage.createObject("game", "main_guang"));
  12175. }
  12176. onConstruct() {
  12177. this.n1 = (this.getChild("n1"));
  12178. this.n2 = (this.getChild("n2"));
  12179. this.n3 = (this.getChild("n3"));
  12180. this.n4 = (this.getChild("n4"));
  12181. this.n5 = (this.getChild("n5"));
  12182. this.n6 = (this.getChild("n6"));
  12183. this.n8 = (this.getChild("n8"));
  12184. this.t0 = this.getTransition("t0");
  12185. }
  12186. }
  12187. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12188. class ui_try_com1 extends fgui.GComponent {
  12189. static createInstance() {
  12190. return (fgui.UIPackage.createObject("game", "try_com1"));
  12191. }
  12192. onConstruct() {
  12193. this.c1 = this.getController("c1");
  12194. this.n0 = (this.getChild("n0"));
  12195. this.n2 = (this.getChild("n2"));
  12196. this.cancelBtn = (this.getChild("cancelBtn"));
  12197. this.videoBtn = (this.getChild("videoBtn"));
  12198. this.n9 = (this.getChild("n9"));
  12199. this.n24 = (this.getChild("n24"));
  12200. this.titleTxt = (this.getChild("titleTxt"));
  12201. this.n32 = (this.getChild("n32"));
  12202. this.n29 = (this.getChild("n29"));
  12203. this.n36 = (this.getChild("n36"));
  12204. this.txtTime = (this.getChild("txtTime"));
  12205. this.t0 = this.getTransition("t0");
  12206. }
  12207. }
  12208. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12209. class ui_try_com2 extends fgui.GComponent {
  12210. static createInstance() {
  12211. return (fgui.UIPackage.createObject("game", "try_com2"));
  12212. }
  12213. onConstruct() {
  12214. this.skillicon = (this.getChild("skillicon"));
  12215. this.n35 = (this.getChild("n35"));
  12216. this.n31 = (this.getChild("n31"));
  12217. this.n32 = (this.getChild("n32"));
  12218. this.n33 = (this.getChild("n33"));
  12219. this.n34 = (this.getChild("n34"));
  12220. }
  12221. }
  12222. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12223. class ui_try_com3 extends fgui.GComponent {
  12224. static createInstance() {
  12225. return (fgui.UIPackage.createObject("game", "try_com3"));
  12226. }
  12227. onConstruct() {
  12228. this.n33 = (this.getChild("n33"));
  12229. this.n34 = (this.getChild("n34"));
  12230. this.n35 = (this.getChild("n35"));
  12231. this.t0 = this.getTransition("t0");
  12232. }
  12233. }
  12234. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12235. class ui_huihe1 extends fgui.GComponent {
  12236. static createInstance() {
  12237. return (fgui.UIPackage.createObject("game", "huihe1"));
  12238. }
  12239. onConstruct() {
  12240. this.n0 = (this.getChild("n0"));
  12241. this.n1 = (this.getChild("n1"));
  12242. this.t0 = this.getTransition("t0");
  12243. }
  12244. }
  12245. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12246. class ui_huihe2 extends fgui.GComponent {
  12247. static createInstance() {
  12248. return (fgui.UIPackage.createObject("game", "huihe2"));
  12249. }
  12250. onConstruct() {
  12251. this.n0 = (this.getChild("n0"));
  12252. this.n1 = (this.getChild("n1"));
  12253. this.t0 = this.getTransition("t0");
  12254. }
  12255. }
  12256. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12257. class ui_Component143 extends fgui.GComponent {
  12258. static createInstance() {
  12259. return (fgui.UIPackage.createObject("game", "Component143"));
  12260. }
  12261. onConstruct() {
  12262. this.n3 = (this.getChild("n3"));
  12263. this.n4 = (this.getChild("n4"));
  12264. this.n5 = (this.getChild("n5"));
  12265. this.n6 = (this.getChild("n6"));
  12266. this.n7 = (this.getChild("n7"));
  12267. this.n8 = (this.getChild("n8"));
  12268. this.n9 = (this.getChild("n9"));
  12269. this.n10 = (this.getChild("n10"));
  12270. this.t0 = this.getTransition("t0");
  12271. }
  12272. }
  12273. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12274. class ui_dh_jingbi2 extends fgui.GComponent {
  12275. static createInstance() {
  12276. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12277. }
  12278. onConstruct() {
  12279. this.n0 = (this.getChild("n0"));
  12280. this.n1 = (this.getChild("n1"));
  12281. this.n2 = (this.getChild("n2"));
  12282. this.n3 = (this.getChild("n3"));
  12283. this.n4 = (this.getChild("n4"));
  12284. this.n5 = (this.getChild("n5"));
  12285. this.n6 = (this.getChild("n6"));
  12286. this.n8 = (this.getChild("n8"));
  12287. this.n10 = (this.getChild("n10"));
  12288. this.t0 = this.getTransition("t0");
  12289. }
  12290. }
  12291. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12292. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12293. static createInstance() {
  12294. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12295. }
  12296. onConstruct() {
  12297. this.n1 = (this.getChild("n1"));
  12298. this.n4 = (this.getChild("n4"));
  12299. this.t0 = this.getTransition("t0");
  12300. }
  12301. }
  12302. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12303. class ui_dh_jingbi3 extends fgui.GComponent {
  12304. static createInstance() {
  12305. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12306. }
  12307. onConstruct() {
  12308. this.n0 = (this.getChild("n0"));
  12309. this.n1 = (this.getChild("n1"));
  12310. this.n2 = (this.getChild("n2"));
  12311. this.n3 = (this.getChild("n3"));
  12312. this.n4 = (this.getChild("n4"));
  12313. this.n5 = (this.getChild("n5"));
  12314. this.n6 = (this.getChild("n6"));
  12315. this.n8 = (this.getChild("n8"));
  12316. this.n10 = (this.getChild("n10"));
  12317. this.t0 = this.getTransition("t0");
  12318. }
  12319. }
  12320. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12321. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12322. static createInstance() {
  12323. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12324. }
  12325. onConstruct() {
  12326. this.n3 = (this.getChild("n3"));
  12327. this.n1 = (this.getChild("n1"));
  12328. this.t0 = this.getTransition("t0");
  12329. }
  12330. }
  12331. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12332. class ui_hb_jinbi1 extends fgui.GButton {
  12333. static createInstance() {
  12334. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12335. }
  12336. onConstruct() {
  12337. this.n20 = (this.getChild("n20"));
  12338. this.n25 = (this.getChild("n25"));
  12339. this.coinTxt = (this.getChild("coinTxt"));
  12340. this.n28 = (this.getChild("n28"));
  12341. this.n32 = (this.getChild("n32"));
  12342. this.n38 = (this.getChild("n38"));
  12343. this.n45 = (this.getChild("n45"));
  12344. this.getTips = (this.getChild("getTips"));
  12345. this.n39 = (this.getChild("n39"));
  12346. this.diamondTxt = (this.getChild("diamondTxt"));
  12347. this.n41 = (this.getChild("n41"));
  12348. this.n42 = (this.getChild("n42"));
  12349. this.n46 = (this.getChild("n46"));
  12350. this.n47 = (this.getChild("n47"));
  12351. this.n48 = (this.getChild("n48"));
  12352. this.t0 = this.getTransition("t0");
  12353. }
  12354. }
  12355. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12356. class ui_hb_jinbi2 extends fgui.GButton {
  12357. static createInstance() {
  12358. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12359. }
  12360. onConstruct() {
  12361. this.n20 = (this.getChild("n20"));
  12362. this.n25 = (this.getChild("n25"));
  12363. this.coinTxt = (this.getChild("coinTxt"));
  12364. this.n28 = (this.getChild("n28"));
  12365. this.n32 = (this.getChild("n32"));
  12366. this.n38 = (this.getChild("n38"));
  12367. this.n39 = (this.getChild("n39"));
  12368. this.diamondTxt = (this.getChild("diamondTxt"));
  12369. this.n41 = (this.getChild("n41"));
  12370. this.n42 = (this.getChild("n42"));
  12371. this.n43 = (this.getChild("n43"));
  12372. this.n44 = (this.getChild("n44"));
  12373. this.n45 = (this.getChild("n45"));
  12374. this.t0 = this.getTransition("t0");
  12375. }
  12376. }
  12377. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12378. class ui_hb_jinbi3 extends fgui.GButton {
  12379. static createInstance() {
  12380. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12381. }
  12382. onConstruct() {
  12383. this.n20 = (this.getChild("n20"));
  12384. this.n25 = (this.getChild("n25"));
  12385. this.coinTxt = (this.getChild("coinTxt"));
  12386. this.n28 = (this.getChild("n28"));
  12387. this.n32 = (this.getChild("n32"));
  12388. this.n38 = (this.getChild("n38"));
  12389. this.n39 = (this.getChild("n39"));
  12390. this.diamondTxt = (this.getChild("diamondTxt"));
  12391. this.n41 = (this.getChild("n41"));
  12392. this.n42 = (this.getChild("n42"));
  12393. this.n43 = (this.getChild("n43"));
  12394. this.n44 = (this.getChild("n44"));
  12395. this.n45 = (this.getChild("n45"));
  12396. this.t0 = this.getTransition("t0");
  12397. }
  12398. }
  12399. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12400. class ui_Component104 extends fgui.GComponent {
  12401. static createInstance() {
  12402. return (fgui.UIPackage.createObject("game", "Component104"));
  12403. }
  12404. onConstruct() {
  12405. this.c1 = this.getController("c1");
  12406. this.n12 = (this.getChild("n12"));
  12407. this.coinBtn = (this.getChild("coinBtn"));
  12408. this.diamondBtn = (this.getChild("diamondBtn"));
  12409. this.node3 = (this.getChild("node3"));
  12410. this.node4 = (this.getChild("node4"));
  12411. this.node5 = (this.getChild("node5"));
  12412. this.node1 = (this.getChild("node1"));
  12413. this.node2 = (this.getChild("node2"));
  12414. this.node6 = (this.getChild("node6"));
  12415. this.t0 = this.getTransition("t0");
  12416. }
  12417. }
  12418. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12419. class ui_Component105 extends fgui.GButton {
  12420. static createInstance() {
  12421. return (fgui.UIPackage.createObject("game", "Component105"));
  12422. }
  12423. onConstruct() {
  12424. this.c1 = this.getController("c1");
  12425. this.n49 = (this.getChild("n49"));
  12426. this.n18 = (this.getChild("n18"));
  12427. this.n46 = (this.getChild("n46"));
  12428. this.n48 = (this.getChild("n48"));
  12429. }
  12430. }
  12431. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12432. class ui_Component106 extends fgui.GButton {
  12433. static createInstance() {
  12434. return (fgui.UIPackage.createObject("game", "Component106"));
  12435. }
  12436. onConstruct() {
  12437. this.c1 = this.getController("c1");
  12438. this.n49 = (this.getChild("n49"));
  12439. this.n18 = (this.getChild("n18"));
  12440. this.n46 = (this.getChild("n46"));
  12441. this.n48 = (this.getChild("n48"));
  12442. }
  12443. }
  12444. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12445. class ui_hb_zs1 extends fgui.GButton {
  12446. static createInstance() {
  12447. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12448. }
  12449. onConstruct() {
  12450. this.c1 = this.getController("c1");
  12451. this.n20 = (this.getChild("n20"));
  12452. this.n21 = (this.getChild("n21"));
  12453. this.n26 = (this.getChild("n26"));
  12454. this.n27 = (this.getChild("n27"));
  12455. this.shareTxt = (this.getChild("shareTxt"));
  12456. this.n32 = (this.getChild("n32"));
  12457. this.n38 = (this.getChild("n38"));
  12458. this.n39 = (this.getChild("n39"));
  12459. this.n44 = (this.getChild("n44"));
  12460. this.diamondTxt = (this.getChild("diamondTxt"));
  12461. this.n41 = (this.getChild("n41"));
  12462. this.n45 = (this.getChild("n45"));
  12463. this.n47 = (this.getChild("n47"));
  12464. this.n48 = (this.getChild("n48"));
  12465. this.randTxt = (this.getChild("randTxt"));
  12466. this.n50 = (this.getChild("n50"));
  12467. this.t0 = this.getTransition("t0");
  12468. }
  12469. }
  12470. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12471. class ui_dh_zs1 extends fgui.GComponent {
  12472. static createInstance() {
  12473. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12474. }
  12475. onConstruct() {
  12476. this.n10 = (this.getChild("n10"));
  12477. this.n9 = (this.getChild("n9"));
  12478. this.n1 = (this.getChild("n1"));
  12479. this.n2 = (this.getChild("n2"));
  12480. this.n3 = (this.getChild("n3"));
  12481. this.n4 = (this.getChild("n4"));
  12482. this.n5 = (this.getChild("n5"));
  12483. this.n6 = (this.getChild("n6"));
  12484. this.n8 = (this.getChild("n8"));
  12485. this.n11 = (this.getChild("n11"));
  12486. this.t0 = this.getTransition("t0");
  12487. }
  12488. }
  12489. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12490. class ui_dh_zs1_1 extends fgui.GComponent {
  12491. static createInstance() {
  12492. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12493. }
  12494. onConstruct() {
  12495. this.n3 = (this.getChild("n3"));
  12496. this.n1 = (this.getChild("n1"));
  12497. this.t0 = this.getTransition("t0");
  12498. }
  12499. }
  12500. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12501. class ui_hb_zs2 extends fgui.GButton {
  12502. static createInstance() {
  12503. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12504. }
  12505. onConstruct() {
  12506. this.n20 = (this.getChild("n20"));
  12507. this.n21 = (this.getChild("n21"));
  12508. this.n26 = (this.getChild("n26"));
  12509. this.n27 = (this.getChild("n27"));
  12510. this.n32 = (this.getChild("n32"));
  12511. this.n38 = (this.getChild("n38"));
  12512. this.n39 = (this.getChild("n39"));
  12513. this.n44 = (this.getChild("n44"));
  12514. this.diamondTxt = (this.getChild("diamondTxt"));
  12515. this.n41 = (this.getChild("n41"));
  12516. this.n45 = (this.getChild("n45"));
  12517. this.t0 = this.getTransition("t0");
  12518. }
  12519. }
  12520. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12521. class ui_hb_zs3 extends fgui.GButton {
  12522. static createInstance() {
  12523. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12524. }
  12525. onConstruct() {
  12526. this.n20 = (this.getChild("n20"));
  12527. this.n21 = (this.getChild("n21"));
  12528. this.n26 = (this.getChild("n26"));
  12529. this.n27 = (this.getChild("n27"));
  12530. this.n32 = (this.getChild("n32"));
  12531. this.n38 = (this.getChild("n38"));
  12532. this.n47 = (this.getChild("n47"));
  12533. this.t0 = this.getTransition("t0");
  12534. }
  12535. }
  12536. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12537. class ui_dh_zs2 extends fgui.GComponent {
  12538. static createInstance() {
  12539. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12540. }
  12541. onConstruct() {
  12542. this.n10 = (this.getChild("n10"));
  12543. this.n9 = (this.getChild("n9"));
  12544. this.n1 = (this.getChild("n1"));
  12545. this.n2 = (this.getChild("n2"));
  12546. this.n3 = (this.getChild("n3"));
  12547. this.n4 = (this.getChild("n4"));
  12548. this.n5 = (this.getChild("n5"));
  12549. this.n6 = (this.getChild("n6"));
  12550. this.n8 = (this.getChild("n8"));
  12551. this.n11 = (this.getChild("n11"));
  12552. this.t0 = this.getTransition("t0");
  12553. }
  12554. }
  12555. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12556. class ui_dh_zs2_1 extends fgui.GComponent {
  12557. static createInstance() {
  12558. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12559. }
  12560. onConstruct() {
  12561. this.n3 = (this.getChild("n3"));
  12562. this.n1 = (this.getChild("n1"));
  12563. this.t0 = this.getTransition("t0");
  12564. }
  12565. }
  12566. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12567. class ui_dh_zs3 extends fgui.GComponent {
  12568. static createInstance() {
  12569. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12570. }
  12571. onConstruct() {
  12572. this.n10 = (this.getChild("n10"));
  12573. this.n9 = (this.getChild("n9"));
  12574. this.n1 = (this.getChild("n1"));
  12575. this.n2 = (this.getChild("n2"));
  12576. this.n3 = (this.getChild("n3"));
  12577. this.n4 = (this.getChild("n4"));
  12578. this.n5 = (this.getChild("n5"));
  12579. this.n6 = (this.getChild("n6"));
  12580. this.n8 = (this.getChild("n8"));
  12581. this.n11 = (this.getChild("n11"));
  12582. this.t0 = this.getTransition("t0");
  12583. }
  12584. }
  12585. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12586. class ui_dh_zs3_1 extends fgui.GComponent {
  12587. static createInstance() {
  12588. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12589. }
  12590. onConstruct() {
  12591. this.n3 = (this.getChild("n3"));
  12592. this.n1 = (this.getChild("n1"));
  12593. this.t0 = this.getTransition("t0");
  12594. }
  12595. }
  12596. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12597. class ui_Component107 extends fgui.GComponent {
  12598. static createInstance() {
  12599. return (fgui.UIPackage.createObject("game", "Component107"));
  12600. }
  12601. onConstruct() {
  12602. this.n18 = (this.getChild("n18"));
  12603. this.n19 = (this.getChild("n19"));
  12604. this.n20 = (this.getChild("n20"));
  12605. this.n21 = (this.getChild("n21"));
  12606. this.n22 = (this.getChild("n22"));
  12607. this.levelTxt = (this.getChild("levelTxt"));
  12608. this.t0 = this.getTransition("t0");
  12609. }
  12610. }
  12611. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12612. class ui_box_com1 extends fgui.GComponent {
  12613. static createInstance() {
  12614. return (fgui.UIPackage.createObject("game", "box_com1"));
  12615. }
  12616. onConstruct() {
  12617. this.n14 = (this.getChild("n14"));
  12618. this.n6 = (this.getChild("n6"));
  12619. this.t0 = this.getTransition("t0");
  12620. }
  12621. }
  12622. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12623. class ui_box_com2 extends fgui.GProgressBar {
  12624. static createInstance() {
  12625. return (fgui.UIPackage.createObject("game", "box_com2"));
  12626. }
  12627. onConstruct() {
  12628. this.bg0 = (this.getChild("bg0"));
  12629. this.bg = (this.getChild("bg"));
  12630. this.bar = (this.getChild("bar"));
  12631. this.n7 = (this.getChild("n7"));
  12632. this.n8 = (this.getChild("n8"));
  12633. this.n10 = (this.getChild("n10"));
  12634. this.n11 = (this.getChild("n11"));
  12635. this.n12 = (this.getChild("n12"));
  12636. }
  12637. }
  12638. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12639. class ui_box_com4 extends fgui.GComponent {
  12640. static createInstance() {
  12641. return (fgui.UIPackage.createObject("game", "box_com4"));
  12642. }
  12643. onConstruct() {
  12644. this.n8 = (this.getChild("n8"));
  12645. this.t0 = this.getTransition("t0");
  12646. }
  12647. }
  12648. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12649. class ui_box_com3 extends fgui.GComponent {
  12650. static createInstance() {
  12651. return (fgui.UIPackage.createObject("game", "box_com3"));
  12652. }
  12653. onConstruct() {
  12654. this.n2 = (this.getChild("n2"));
  12655. this.n3 = (this.getChild("n3"));
  12656. this.n4 = (this.getChild("n4"));
  12657. this.n5 = (this.getChild("n5"));
  12658. this.t0 = this.getTransition("t0");
  12659. this.t1 = this.getTransition("t1");
  12660. }
  12661. }
  12662. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12663. class ui_Component97 extends fgui.GComponent {
  12664. static createInstance() {
  12665. return (fgui.UIPackage.createObject("game", "Component97"));
  12666. }
  12667. onConstruct() {
  12668. this.c1 = this.getController("c1");
  12669. this.n46 = (this.getChild("n46"));
  12670. this.diamondNode = (this.getChild("diamondNode"));
  12671. this.coinNode = (this.getChild("coinNode"));
  12672. this.t0 = this.getTransition("t0");
  12673. }
  12674. }
  12675. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12676. class ui_Component98 extends fgui.GButton {
  12677. static createInstance() {
  12678. return (fgui.UIPackage.createObject("game", "Component98"));
  12679. }
  12680. onConstruct() {
  12681. this.n8 = (this.getChild("n8"));
  12682. this.n40 = (this.getChild("n40"));
  12683. }
  12684. }
  12685. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12686. class ui_Component28_11 extends fgui.GButton {
  12687. static createInstance() {
  12688. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12689. }
  12690. onConstruct() {
  12691. this.c1 = this.getController("c1");
  12692. this.n12 = (this.getChild("n12"));
  12693. this.n17 = (this.getChild("n17"));
  12694. this.n13 = (this.getChild("n13"));
  12695. this.diamondTxt = (this.getChild("diamondTxt"));
  12696. this.n15 = (this.getChild("n15"));
  12697. this.n16 = (this.getChild("n16"));
  12698. }
  12699. }
  12700. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12701. class ui_Component58_11 extends fgui.GComponent {
  12702. static createInstance() {
  12703. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12704. }
  12705. onConstruct() {
  12706. this.c1 = this.getController("c1");
  12707. this.n23 = (this.getChild("n23"));
  12708. this.n41 = (this.getChild("n41"));
  12709. this.myList = (this.getChild("myList"));
  12710. this.djList = (this.getChild("djList"));
  12711. this.n45 = (this.getChild("n45"));
  12712. this.n_item = (this.getChild("n_item"));
  12713. this.t0 = this.getTransition("t0");
  12714. }
  12715. }
  12716. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12717. class ui_Component100 extends fgui.GComponent {
  12718. static createInstance() {
  12719. return (fgui.UIPackage.createObject("game", "Component100"));
  12720. }
  12721. onConstruct() {
  12722. this.c1 = this.getController("c1");
  12723. this.n75 = (this.getChild("n75"));
  12724. this.n76 = (this.getChild("n76"));
  12725. this.n80 = (this.getChild("n80"));
  12726. this.txt = (this.getChild("txt"));
  12727. this.spineRoot = (this.getChild("spineRoot"));
  12728. }
  12729. }
  12730. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12731. class ui_Component101 extends fgui.GComponent {
  12732. static createInstance() {
  12733. return (fgui.UIPackage.createObject("game", "Component101"));
  12734. }
  12735. onConstruct() {
  12736. this.c1 = this.getController("c1");
  12737. this.n36 = (this.getChild("n36"));
  12738. this.n35 = (this.getChild("n35"));
  12739. this.n33 = (this.getChild("n33"));
  12740. this.n34 = (this.getChild("n34"));
  12741. }
  12742. }
  12743. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12744. class ui_Component53 extends fgui.GComponent {
  12745. static createInstance() {
  12746. return (fgui.UIPackage.createObject("game", "Component53"));
  12747. }
  12748. onConstruct() {
  12749. this.n0 = (this.getChild("n0"));
  12750. this.n1 = (this.getChild("n1"));
  12751. this.n2 = (this.getChild("n2"));
  12752. this.n3 = (this.getChild("n3"));
  12753. this.n4 = (this.getChild("n4"));
  12754. this.n5 = (this.getChild("n5"));
  12755. this.n6 = (this.getChild("n6"));
  12756. this.n7 = (this.getChild("n7"));
  12757. this.n8 = (this.getChild("n8"));
  12758. this.n9 = (this.getChild("n9"));
  12759. this.n10 = (this.getChild("n10"));
  12760. this.n11 = (this.getChild("n11"));
  12761. this.n12 = (this.getChild("n12"));
  12762. this.n13 = (this.getChild("n13"));
  12763. this.n14 = (this.getChild("n14"));
  12764. this.n15 = (this.getChild("n15"));
  12765. this.n16 = (this.getChild("n16"));
  12766. this.n19 = (this.getChild("n19"));
  12767. this.n20 = (this.getChild("n20"));
  12768. this.n21 = (this.getChild("n21"));
  12769. this.n22 = (this.getChild("n22"));
  12770. this.n23 = (this.getChild("n23"));
  12771. this.n24 = (this.getChild("n24"));
  12772. this.n25 = (this.getChild("n25"));
  12773. this.n26 = (this.getChild("n26"));
  12774. this.n27 = (this.getChild("n27"));
  12775. this.n28 = (this.getChild("n28"));
  12776. this.n29 = (this.getChild("n29"));
  12777. this.n30 = (this.getChild("n30"));
  12778. this.n31 = (this.getChild("n31"));
  12779. this.n32 = (this.getChild("n32"));
  12780. this.n33 = (this.getChild("n33"));
  12781. this.n34 = (this.getChild("n34"));
  12782. this.n35 = (this.getChild("n35"));
  12783. this.t0 = this.getTransition("t0");
  12784. }
  12785. }
  12786. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12787. class ui_Component58 extends fgui.GComponent {
  12788. static createInstance() {
  12789. return (fgui.UIPackage.createObject("game", "Component58"));
  12790. }
  12791. onConstruct() {
  12792. this.n23 = (this.getChild("n23"));
  12793. this.n41 = (this.getChild("n41"));
  12794. this.n8 = (this.getChild("n8"));
  12795. this.skillList = (this.getChild("skillList"));
  12796. this.t0 = this.getTransition("t0");
  12797. }
  12798. }
  12799. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12800. class ui_Component59 extends fgui.GComponent {
  12801. static createInstance() {
  12802. return (fgui.UIPackage.createObject("game", "Component59"));
  12803. }
  12804. onConstruct() {
  12805. this.n3 = (this.getChild("n3"));
  12806. this.msgTxt = (this.getChild("msgTxt"));
  12807. this.t0 = this.getTransition("t0");
  12808. }
  12809. }
  12810. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12811. class ui_RulerNode extends fgui.GComponent {
  12812. static createInstance() {
  12813. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12814. }
  12815. onConstruct() {
  12816. this.n6 = (this.getChild("n6"));
  12817. this.n4 = (this.getChild("n4"));
  12818. this.img1 = (this.getChild("img1"));
  12819. this.img2 = (this.getChild("img2"));
  12820. }
  12821. }
  12822. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12823. class ui_Component108 extends fgui.GComponent {
  12824. static createInstance() {
  12825. return (fgui.UIPackage.createObject("game", "Component108"));
  12826. }
  12827. onConstruct() {
  12828. this.n19 = (this.getChild("n19"));
  12829. this.t0 = this.getTransition("t0");
  12830. }
  12831. }
  12832. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12833. class ui_Component63 extends fgui.GComponent {
  12834. static createInstance() {
  12835. return (fgui.UIPackage.createObject("game", "Component63"));
  12836. }
  12837. onConstruct() {
  12838. this.n66 = (this.getChild("n66"));
  12839. this.n56 = (this.getChild("n56"));
  12840. this.n63 = (this.getChild("n63"));
  12841. this.n65 = (this.getChild("n65"));
  12842. this.t0 = this.getTransition("t0");
  12843. }
  12844. }
  12845. ui_Component63.URL = "ui://isxx5ak7h657452";
  12846. class ui_topNode extends fgui.GComponent {
  12847. static createInstance() {
  12848. return (fgui.UIPackage.createObject("game", "topNode"));
  12849. }
  12850. onConstruct() {
  12851. this.selfProgress = (this.getChild("selfProgress"));
  12852. this.aiProgress = (this.getChild("aiProgress"));
  12853. this.selfKuang = (this.getChild("selfKuang"));
  12854. this.aiKuang = (this.getChild("aiKuang"));
  12855. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12856. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12857. this.n33 = (this.getChild("n33"));
  12858. this.n34 = (this.getChild("n34"));
  12859. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12860. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12861. this.selfBallList = (this.getChild("selfBallList"));
  12862. this.aiBallList = (this.getChild("aiBallList"));
  12863. this.middleNode = (this.getChild("middleNode"));
  12864. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12865. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12866. this.scoreNode = (this.getChild("scoreNode"));
  12867. this.selfTips = (this.getChild("selfTips"));
  12868. this.aiTips = (this.getChild("aiTips"));
  12869. }
  12870. }
  12871. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12872. class ui_selfProgress extends fgui.GProgressBar {
  12873. static createInstance() {
  12874. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12875. }
  12876. onConstruct() {
  12877. this.n3 = (this.getChild("n3"));
  12878. this.bar = (this.getChild("bar"));
  12879. }
  12880. }
  12881. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12882. class ui_aiProgress extends fgui.GProgressBar {
  12883. static createInstance() {
  12884. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12885. }
  12886. onConstruct() {
  12887. this.n3 = (this.getChild("n3"));
  12888. this.bar = (this.getChild("bar"));
  12889. }
  12890. }
  12891. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12892. class ui_ballDisplay extends fgui.GComponent {
  12893. static createInstance() {
  12894. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12895. }
  12896. onConstruct() {
  12897. this.myImg = (this.getChild("myImg"));
  12898. }
  12899. }
  12900. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12901. class ui_moveNode extends fgui.GComponent {
  12902. static createInstance() {
  12903. return (fgui.UIPackage.createObject("game", "moveNode"));
  12904. }
  12905. onConstruct() {
  12906. this.n8 = (this.getChild("n8"));
  12907. this.finger = (this.getChild("finger"));
  12908. }
  12909. }
  12910. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12911. class ui_cancelBtn extends fgui.GButton {
  12912. static createInstance() {
  12913. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12914. }
  12915. onConstruct() {
  12916. this.c1 = this.getController("c1");
  12917. this.n0 = (this.getChild("n0"));
  12918. this.n1 = (this.getChild("n1"));
  12919. }
  12920. }
  12921. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12922. class ui_shareBtn extends fgui.GButton {
  12923. static createInstance() {
  12924. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12925. }
  12926. onConstruct() {
  12927. this.c1 = this.getController("c1");
  12928. this.n2 = (this.getChild("n2"));
  12929. this.n1 = (this.getChild("n1"));
  12930. this.n3 = (this.getChild("n3"));
  12931. this.n4 = (this.getChild("n4"));
  12932. this.n5 = (this.getChild("n5"));
  12933. this.n6 = (this.getChild("n6"));
  12934. }
  12935. }
  12936. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12937. class ui_share2Btn extends fgui.GButton {
  12938. static createInstance() {
  12939. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12940. }
  12941. onConstruct() {
  12942. this.n3 = (this.getChild("n3"));
  12943. }
  12944. }
  12945. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12946. class ui_rodMethodNode extends fgui.GComponent {
  12947. static createInstance() {
  12948. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12949. }
  12950. onConstruct() {
  12951. this.bg = (this.getChild("bg"));
  12952. this.dot = (this.getChild("dot"));
  12953. }
  12954. }
  12955. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12956. class ui_sureBtn extends fgui.GButton {
  12957. static createInstance() {
  12958. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12959. }
  12960. onConstruct() {
  12961. this.n2 = (this.getChild("n2"));
  12962. this.n1 = (this.getChild("n1"));
  12963. }
  12964. }
  12965. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12966. class ui_Component18 extends fgui.GComponent {
  12967. static createInstance() {
  12968. return (fgui.UIPackage.createObject("game", "Component18"));
  12969. }
  12970. onConstruct() {
  12971. this.c1 = this.getController("c1");
  12972. this.nameTxt = (this.getChild("nameTxt"));
  12973. this.headImg = (this.getChild("headImg"));
  12974. this.n24 = (this.getChild("n24"));
  12975. this.skillImg = (this.getChild("skillImg"));
  12976. this.skillTxt = (this.getChild("skillTxt"));
  12977. }
  12978. }
  12979. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12980. class ui_Component45 extends fgui.GComponent {
  12981. static createInstance() {
  12982. return (fgui.UIPackage.createObject("game", "Component45"));
  12983. }
  12984. onConstruct() {
  12985. this.c1 = this.getController("c1");
  12986. this.n40 = (this.getChild("n40"));
  12987. this.n41 = (this.getChild("n41"));
  12988. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12989. this.n42 = (this.getChild("n42"));
  12990. this.awardTxt = (this.getChild("awardTxt"));
  12991. this.n44 = (this.getChild("n44"));
  12992. this.t0 = this.getTransition("t0");
  12993. }
  12994. }
  12995. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12996. class ui_emotionDisplay extends fgui.GButton {
  12997. static createInstance() {
  12998. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12999. }
  13000. onConstruct() {
  13001. this.myIcon = (this.getChild("myIcon"));
  13002. }
  13003. }
  13004. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13005. class ui_Component49 extends fgui.GButton {
  13006. static createInstance() {
  13007. return (fgui.UIPackage.createObject("game", "Component49"));
  13008. }
  13009. onConstruct() {
  13010. this.n69 = (this.getChild("n69"));
  13011. this.n56 = (this.getChild("n56"));
  13012. }
  13013. }
  13014. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13015. class ui_Component50 extends fgui.GButton {
  13016. static createInstance() {
  13017. return (fgui.UIPackage.createObject("game", "Component50"));
  13018. }
  13019. onConstruct() {
  13020. this.n54 = (this.getChild("n54"));
  13021. this.n65 = (this.getChild("n65"));
  13022. }
  13023. }
  13024. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13025. class ui_Component51 extends fgui.GButton {
  13026. static createInstance() {
  13027. return (fgui.UIPackage.createObject("game", "Component51"));
  13028. }
  13029. onConstruct() {
  13030. this.c1 = this.getController("c1");
  13031. this.n51 = (this.getChild("n51"));
  13032. this.n54 = (this.getChild("n54"));
  13033. }
  13034. }
  13035. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13036. class ui_Button5 extends fgui.GButton {
  13037. static createInstance() {
  13038. return (fgui.UIPackage.createObject("game", "Button5"));
  13039. }
  13040. onConstruct() {
  13041. this.c1 = this.getController("c1");
  13042. this.n0 = (this.getChild("n0"));
  13043. this.n2 = (this.getChild("n2"));
  13044. }
  13045. }
  13046. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13047. class ui_Component124 extends fgui.GComponent {
  13048. static createInstance() {
  13049. return (fgui.UIPackage.createObject("game", "Component124"));
  13050. }
  13051. onConstruct() {
  13052. this.n22 = (this.getChild("n22"));
  13053. this.shareNode = (this.getChild("shareNode"));
  13054. }
  13055. }
  13056. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13057. class ui_Component125 extends fgui.GComponent {
  13058. static createInstance() {
  13059. return (fgui.UIPackage.createObject("game", "Component125"));
  13060. }
  13061. onConstruct() {
  13062. this.n29 = (this.getChild("n29"));
  13063. this.coinTxt = (this.getChild("coinTxt"));
  13064. }
  13065. }
  13066. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13067. class ui_Component52 extends fgui.GButton {
  13068. static createInstance() {
  13069. return (fgui.UIPackage.createObject("game", "Component52"));
  13070. }
  13071. onConstruct() {
  13072. this.n35 = (this.getChild("n35"));
  13073. this.n36 = (this.getChild("n36"));
  13074. }
  13075. }
  13076. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13077. class ui_drawBtn extends fgui.GButton {
  13078. static createInstance() {
  13079. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13080. }
  13081. onConstruct() {
  13082. this.c1 = this.getController("c1");
  13083. this.n2 = (this.getChild("n2"));
  13084. this.n1 = (this.getChild("n1"));
  13085. this.n5 = (this.getChild("n5"));
  13086. }
  13087. }
  13088. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13089. class ui_Component43 extends fgui.GButton {
  13090. static createInstance() {
  13091. return (fgui.UIPackage.createObject("game", "Component43"));
  13092. }
  13093. onConstruct() {
  13094. this.n49 = (this.getChild("n49"));
  13095. }
  13096. }
  13097. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13098. class ui_wordsDisplay extends fgui.GComponent {
  13099. static createInstance() {
  13100. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13101. }
  13102. onConstruct() {
  13103. this.txt = (this.getChild("txt"));
  13104. this.n63 = (this.getChild("n63"));
  13105. }
  13106. }
  13107. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13108. class ui_Component_phb extends fgui.GComponent {
  13109. static createInstance() {
  13110. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13111. }
  13112. onConstruct() {
  13113. this.n3 = (this.getChild("n3"));
  13114. this.n4 = (this.getChild("n4"));
  13115. }
  13116. }
  13117. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13118. class ui_Component3 extends fgui.GComponent {
  13119. static createInstance() {
  13120. return (fgui.UIPackage.createObject("game", "Component3"));
  13121. }
  13122. onConstruct() {
  13123. this.n26 = (this.getChild("n26"));
  13124. this.n24 = (this.getChild("n24"));
  13125. this.nameTxt = (this.getChild("nameTxt"));
  13126. this.headRoot = (this.getChild("headRoot"));
  13127. }
  13128. }
  13129. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13130. class ui_Component4 extends fgui.GComponent {
  13131. static createInstance() {
  13132. return (fgui.UIPackage.createObject("game", "Component4"));
  13133. }
  13134. onConstruct() {
  13135. this.headImg = (this.getChild("headImg"));
  13136. }
  13137. }
  13138. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13139. class ui_Component7 extends fgui.GButton {
  13140. static createInstance() {
  13141. return (fgui.UIPackage.createObject("game", "Component7"));
  13142. }
  13143. onConstruct() {
  13144. this.n17 = (this.getChild("n17"));
  13145. }
  13146. }
  13147. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13148. class ui_Component8 extends fgui.GButton {
  13149. static createInstance() {
  13150. return (fgui.UIPackage.createObject("game", "Component8"));
  13151. }
  13152. onConstruct() {
  13153. this.n19 = (this.getChild("n19"));
  13154. }
  13155. }
  13156. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13157. class ui_Component10 extends fgui.GButton {
  13158. static createInstance() {
  13159. return (fgui.UIPackage.createObject("game", "Component10"));
  13160. }
  13161. onConstruct() {
  13162. this.c1 = this.getController("c1");
  13163. this.n40 = (this.getChild("n40"));
  13164. }
  13165. }
  13166. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13167. class ui_Component11 extends fgui.GButton {
  13168. static createInstance() {
  13169. return (fgui.UIPackage.createObject("game", "Component11"));
  13170. }
  13171. onConstruct() {
  13172. this.n34 = (this.getChild("n34"));
  13173. }
  13174. }
  13175. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13176. class ui_Component12 extends fgui.GButton {
  13177. static createInstance() {
  13178. return (fgui.UIPackage.createObject("game", "Component12"));
  13179. }
  13180. onConstruct() {
  13181. this.n35 = (this.getChild("n35"));
  13182. }
  13183. }
  13184. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13185. class ui_Component13 extends fgui.GButton {
  13186. static createInstance() {
  13187. return (fgui.UIPackage.createObject("game", "Component13"));
  13188. }
  13189. onConstruct() {
  13190. this.n27 = (this.getChild("n27"));
  13191. this.n36 = (this.getChild("n36"));
  13192. }
  13193. }
  13194. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13195. class ui_dh_js_tuowei extends fgui.GComponent {
  13196. static createInstance() {
  13197. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13198. }
  13199. onConstruct() {
  13200. this.n19 = (this.getChild("n19"));
  13201. this.n18 = (this.getChild("n18"));
  13202. this.n0 = (this.getChild("n0"));
  13203. this.n3 = (this.getChild("n3"));
  13204. this.n4 = (this.getChild("n4"));
  13205. this.n5 = (this.getChild("n5"));
  13206. this.n6 = (this.getChild("n6"));
  13207. this.n8 = (this.getChild("n8"));
  13208. this.n9 = (this.getChild("n9"));
  13209. this.n10 = (this.getChild("n10"));
  13210. this.n11 = (this.getChild("n11"));
  13211. this.n12 = (this.getChild("n12"));
  13212. this.n13 = (this.getChild("n13"));
  13213. this.n14 = (this.getChild("n14"));
  13214. this.n15 = (this.getChild("n15"));
  13215. this.n20 = (this.getChild("n20"));
  13216. this.t0 = this.getTransition("t0");
  13217. this.t1 = this.getTransition("t1");
  13218. }
  13219. }
  13220. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13221. class ui_dh_js_tw_g extends fgui.GComponent {
  13222. static createInstance() {
  13223. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13224. }
  13225. onConstruct() {
  13226. this.n0 = (this.getChild("n0"));
  13227. this.n1 = (this.getChild("n1"));
  13228. this.t0 = this.getTransition("t0");
  13229. }
  13230. }
  13231. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13232. class ui_dh_js_xingxing extends fgui.GComponent {
  13233. static createInstance() {
  13234. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13235. }
  13236. onConstruct() {
  13237. this.n1 = (this.getChild("n1"));
  13238. this.n2 = (this.getChild("n2"));
  13239. this.n3 = (this.getChild("n3"));
  13240. this.n4 = (this.getChild("n4"));
  13241. this.n0 = (this.getChild("n0"));
  13242. this.t2 = this.getTransition("t2");
  13243. this.t1 = this.getTransition("t1");
  13244. }
  13245. }
  13246. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13247. class ui_dh_zy_jiazai extends fgui.GComponent {
  13248. static createInstance() {
  13249. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13250. }
  13251. onConstruct() {
  13252. this.c1 = this.getController("c1");
  13253. this.n0 = (this.getChild("n0"));
  13254. this.n1 = (this.getChild("n1"));
  13255. this.n2 = (this.getChild("n2"));
  13256. this.n4 = (this.getChild("n4"));
  13257. this.n5 = (this.getChild("n5"));
  13258. this.n6 = (this.getChild("n6"));
  13259. this.n8 = (this.getChild("n8"));
  13260. this.n7 = (this.getChild("n7"));
  13261. this.t0 = this.getTransition("t0");
  13262. }
  13263. }
  13264. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13265. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13266. static createInstance() {
  13267. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13268. }
  13269. onConstruct() {
  13270. this.c1 = this.getController("c1");
  13271. this.n3 = (this.getChild("n3"));
  13272. this.n5 = (this.getChild("n5"));
  13273. this.n4 = (this.getChild("n4"));
  13274. this.n0 = (this.getChild("n0"));
  13275. this.n1 = (this.getChild("n1"));
  13276. this.n2 = (this.getChild("n2"));
  13277. }
  13278. }
  13279. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13280. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13281. static createInstance() {
  13282. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13283. }
  13284. onConstruct() {
  13285. this.n19 = (this.getChild("n19"));
  13286. this.n21 = (this.getChild("n21"));
  13287. this.n0 = (this.getChild("n0"));
  13288. this.n3 = (this.getChild("n3"));
  13289. this.n4 = (this.getChild("n4"));
  13290. this.n5 = (this.getChild("n5"));
  13291. this.n6 = (this.getChild("n6"));
  13292. this.n8 = (this.getChild("n8"));
  13293. this.n9 = (this.getChild("n9"));
  13294. this.n10 = (this.getChild("n10"));
  13295. this.n11 = (this.getChild("n11"));
  13296. this.n12 = (this.getChild("n12"));
  13297. this.n13 = (this.getChild("n13"));
  13298. this.n14 = (this.getChild("n14"));
  13299. this.n15 = (this.getChild("n15"));
  13300. this.n23 = (this.getChild("n23"));
  13301. this.t0 = this.getTransition("t0");
  13302. this.t1 = this.getTransition("t1");
  13303. }
  13304. }
  13305. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13306. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13307. static createInstance() {
  13308. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13309. }
  13310. onConstruct() {
  13311. this.n1 = (this.getChild("n1"));
  13312. this.n2 = (this.getChild("n2"));
  13313. this.t0 = this.getTransition("t0");
  13314. }
  13315. }
  13316. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13317. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13318. static createInstance() {
  13319. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13320. }
  13321. onConstruct() {
  13322. this.n4 = (this.getChild("n4"));
  13323. this.n2 = (this.getChild("n2"));
  13324. this.n3 = (this.getChild("n3"));
  13325. this.idle = this.getTransition("idle");
  13326. this.attack = this.getTransition("attack");
  13327. }
  13328. }
  13329. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13330. class ui_special extends fgui.GComponent {
  13331. static createInstance() {
  13332. return (fgui.UIPackage.createObject("game", "special"));
  13333. }
  13334. onConstruct() {
  13335. this.n18 = (this.getChild("n18"));
  13336. this.n19 = (this.getChild("n19"));
  13337. this.n20 = (this.getChild("n20"));
  13338. this.n21 = (this.getChild("n21"));
  13339. this.n22 = (this.getChild("n22"));
  13340. this.levelTxt = (this.getChild("levelTxt"));
  13341. this.n24 = (this.getChild("n24"));
  13342. this.n25 = (this.getChild("n25"));
  13343. this.t0 = this.getTransition("t0");
  13344. }
  13345. }
  13346. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13347. class ui_Component145 extends fgui.GComponent {
  13348. static createInstance() {
  13349. return (fgui.UIPackage.createObject("game", "Component145"));
  13350. }
  13351. onConstruct() {
  13352. this.guanyuNode = (this.getChild("guanyuNode"));
  13353. }
  13354. }
  13355. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13356. class ui_longBtn extends fgui.GButton {
  13357. static createInstance() {
  13358. return (fgui.UIPackage.createObject("game", "longBtn"));
  13359. }
  13360. onConstruct() {
  13361. this.c1 = this.getController("c1");
  13362. this.n2 = (this.getChild("n2"));
  13363. this.n1 = (this.getChild("n1"));
  13364. this.n4 = (this.getChild("n4"));
  13365. }
  13366. }
  13367. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13368. class ui_Component146 extends fgui.GComponent {
  13369. static createInstance() {
  13370. return (fgui.UIPackage.createObject("game", "Component146"));
  13371. }
  13372. onConstruct() {
  13373. this.n89 = (this.getChild("n89"));
  13374. this.n90 = (this.getChild("n90"));
  13375. this.guideBtn = (this.getChild("guideBtn"));
  13376. }
  13377. }
  13378. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13379. class ui_Component146_11 extends fgui.GComponent {
  13380. static createInstance() {
  13381. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13382. }
  13383. onConstruct() {
  13384. this.n89 = (this.getChild("n89"));
  13385. this.n90 = (this.getChild("n90"));
  13386. this.guideBtn = (this.getChild("guideBtn"));
  13387. }
  13388. }
  13389. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13390. class ui_Component111_1 extends fgui.GComponent {
  13391. static createInstance() {
  13392. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13393. }
  13394. onConstruct() {
  13395. this.n68 = (this.getChild("n68"));
  13396. this.myMask = (this.getChild("myMask"));
  13397. }
  13398. }
  13399. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13400. class ui_Component64_1 extends fgui.GComponent {
  13401. static createInstance() {
  13402. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13403. }
  13404. onConstruct() {
  13405. this.n57 = (this.getChild("n57"));
  13406. this.n54 = (this.getChild("n54"));
  13407. this.n55 = (this.getChild("n55"));
  13408. this.n56 = (this.getChild("n56"));
  13409. this.t1 = this.getTransition("t1");
  13410. }
  13411. }
  13412. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13413. class ui_ModeSelection_com123 extends fgui.GComponent {
  13414. static createInstance() {
  13415. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13416. }
  13417. onConstruct() {
  13418. this.type1 = (this.getChild("type1"));
  13419. this.type2 = (this.getChild("type2"));
  13420. this.type3 = (this.getChild("type3"));
  13421. this.n38 = (this.getChild("n38"));
  13422. this.t0 = this.getTransition("t0");
  13423. }
  13424. }
  13425. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13426. class ui_Component132_2 extends fgui.GComponent {
  13427. static createInstance() {
  13428. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13429. }
  13430. onConstruct() {
  13431. this.n25 = (this.getChild("n25"));
  13432. this.n26 = (this.getChild("n26"));
  13433. this.n27 = (this.getChild("n27"));
  13434. this.t0 = this.getTransition("t0");
  13435. }
  13436. }
  13437. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13438. class ui_UIPower$1 extends fgui.GComponent {
  13439. static createInstance() {
  13440. return (fgui.UIPackage.createObject("game", "UIPower"));
  13441. }
  13442. onConstruct() {
  13443. this.n11 = (this.getChild("n11"));
  13444. this.myNode = (this.getChild("myNode"));
  13445. this.t0 = this.getTransition("t0");
  13446. }
  13447. }
  13448. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13449. class ui_Component133 extends fgui.GComponent {
  13450. static createInstance() {
  13451. return (fgui.UIPackage.createObject("game", "Component133"));
  13452. }
  13453. onConstruct() {
  13454. this.n29 = (this.getChild("n29"));
  13455. this.n30 = (this.getChild("n30"));
  13456. }
  13457. }
  13458. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13459. class ui_Component134 extends fgui.GComponent {
  13460. static createInstance() {
  13461. return (fgui.UIPackage.createObject("game", "Component134"));
  13462. }
  13463. onConstruct() {
  13464. this.n30 = (this.getChild("n30"));
  13465. this.n31 = (this.getChild("n31"));
  13466. this.t0 = this.getTransition("t0");
  13467. }
  13468. }
  13469. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13470. class ui_Component135 extends fgui.GComponent {
  13471. static createInstance() {
  13472. return (fgui.UIPackage.createObject("game", "Component135"));
  13473. }
  13474. onConstruct() {
  13475. this.n30 = (this.getChild("n30"));
  13476. this.t0 = this.getTransition("t0");
  13477. }
  13478. }
  13479. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13480. class ui_Component137 extends fgui.GComponent {
  13481. static createInstance() {
  13482. return (fgui.UIPackage.createObject("game", "Component137"));
  13483. }
  13484. onConstruct() {
  13485. this.n28 = (this.getChild("n28"));
  13486. this.n29 = (this.getChild("n29"));
  13487. this.n30 = (this.getChild("n30"));
  13488. this.n32 = (this.getChild("n32"));
  13489. }
  13490. }
  13491. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13492. class ui_dh_zuanshi extends fgui.GButton {
  13493. static createInstance() {
  13494. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13495. }
  13496. onConstruct() {
  13497. this.n1 = (this.getChild("n1"));
  13498. this.n2 = (this.getChild("n2"));
  13499. this.n0 = (this.getChild("n0"));
  13500. this.n3 = (this.getChild("n3"));
  13501. this.n4 = (this.getChild("n4"));
  13502. }
  13503. }
  13504. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13505. class ui_Component138 extends fgui.GComponent {
  13506. static createInstance() {
  13507. return (fgui.UIPackage.createObject("game", "Component138"));
  13508. }
  13509. onConstruct() {
  13510. this.n1 = (this.getChild("n1"));
  13511. this.n2 = (this.getChild("n2"));
  13512. this.t0 = this.getTransition("t0");
  13513. }
  13514. }
  13515. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13516. class ui_Component139 extends fgui.GComponent {
  13517. static createInstance() {
  13518. return (fgui.UIPackage.createObject("game", "Component139"));
  13519. }
  13520. onConstruct() {
  13521. this.n0 = (this.getChild("n0"));
  13522. this.t0 = this.getTransition("t0");
  13523. }
  13524. }
  13525. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13526. class ui_Component140 extends fgui.GComponent {
  13527. static createInstance() {
  13528. return (fgui.UIPackage.createObject("game", "Component140"));
  13529. }
  13530. onConstruct() {
  13531. this.n2 = (this.getChild("n2"));
  13532. this.n3 = (this.getChild("n3"));
  13533. this.t0 = this.getTransition("t0");
  13534. }
  13535. }
  13536. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13537. class ui_Component141 extends fgui.GComponent {
  13538. static createInstance() {
  13539. return (fgui.UIPackage.createObject("game", "Component141"));
  13540. }
  13541. onConstruct() {
  13542. this.n0 = (this.getChild("n0"));
  13543. this.t0 = this.getTransition("t0");
  13544. }
  13545. }
  13546. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13547. class ui_powerNode extends fgui.GProgressBar {
  13548. static createInstance() {
  13549. return (fgui.UIPackage.createObject("game", "powerNode"));
  13550. }
  13551. onConstruct() {
  13552. this.n2 = (this.getChild("n2"));
  13553. this.bar_v = (this.getChild("bar_v"));
  13554. this.showImg = (this.getChild("showImg"));
  13555. this.n12 = (this.getChild("n12"));
  13556. }
  13557. }
  13558. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13559. class ui_dh_jingbi1 extends fgui.GComponent {
  13560. static createInstance() {
  13561. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13562. }
  13563. onConstruct() {
  13564. this.n0 = (this.getChild("n0"));
  13565. this.n1 = (this.getChild("n1"));
  13566. this.n2 = (this.getChild("n2"));
  13567. this.n3 = (this.getChild("n3"));
  13568. this.n4 = (this.getChild("n4"));
  13569. this.n5 = (this.getChild("n5"));
  13570. this.n6 = (this.getChild("n6"));
  13571. this.n8 = (this.getChild("n8"));
  13572. this.t0 = this.getTransition("t0");
  13573. }
  13574. }
  13575. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13576. class ui_Component94 extends fgui.GButton {
  13577. static createInstance() {
  13578. return (fgui.UIPackage.createObject("game", "Component94"));
  13579. }
  13580. onConstruct() {
  13581. this.n77 = (this.getChild("n77"));
  13582. }
  13583. }
  13584. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13585. class ui_Component95 extends fgui.GButton {
  13586. static createInstance() {
  13587. return (fgui.UIPackage.createObject("game", "Component95"));
  13588. }
  13589. onConstruct() {
  13590. this.n77 = (this.getChild("n77"));
  13591. }
  13592. }
  13593. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13594. class ui_Component126 extends fgui.GComponent {
  13595. static createInstance() {
  13596. return (fgui.UIPackage.createObject("game", "Component126"));
  13597. }
  13598. onConstruct() {
  13599. this.c1 = this.getController("c1");
  13600. this.normalBtn = (this.getChild("normalBtn"));
  13601. this.tripleBtn = (this.getChild("tripleBtn"));
  13602. }
  13603. }
  13604. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13605. class ui_Component60 extends fgui.GComponent {
  13606. static createInstance() {
  13607. return (fgui.UIPackage.createObject("game", "Component60"));
  13608. }
  13609. onConstruct() {
  13610. this.c1 = this.getController("c1");
  13611. this.n48 = (this.getChild("n48"));
  13612. this.womanTxt = (this.getChild("womanTxt"));
  13613. this.t0 = this.getTransition("t0");
  13614. }
  13615. }
  13616. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13617. class ui_Component98_3 extends fgui.GButton {
  13618. static createInstance() {
  13619. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13620. }
  13621. onConstruct() {
  13622. this.c1 = this.getController("c1");
  13623. this.n8 = (this.getChild("n8"));
  13624. this.n41 = (this.getChild("n41"));
  13625. this.n40 = (this.getChild("n40"));
  13626. }
  13627. }
  13628. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13629. class ui_ModeSelection_com1 extends fgui.GButton {
  13630. static createInstance() {
  13631. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13632. }
  13633. onConstruct() {
  13634. this.n34 = (this.getChild("n34"));
  13635. this.n36 = (this.getChild("n36"));
  13636. this.n22 = (this.getChild("n22"));
  13637. this.n20 = (this.getChild("n20"));
  13638. this.n23 = (this.getChild("n23"));
  13639. this.n24 = (this.getChild("n24"));
  13640. this.n26 = (this.getChild("n26"));
  13641. this.n33 = (this.getChild("n33"));
  13642. this.coinImg = (this.getChild("coinImg"));
  13643. this.need = (this.getChild("need"));
  13644. this.n35 = (this.getChild("n35"));
  13645. this.n29 = (this.getChild("n29"));
  13646. this.tipsTxt = (this.getChild("tipsTxt"));
  13647. this.n30 = (this.getChild("n30"));
  13648. this.peopleTxt = (this.getChild("peopleTxt"));
  13649. this.t0 = this.getTransition("t0");
  13650. }
  13651. }
  13652. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13653. class ui_ModeSelection_com2 extends fgui.GButton {
  13654. static createInstance() {
  13655. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13656. }
  13657. onConstruct() {
  13658. this.n36 = (this.getChild("n36"));
  13659. this.n34 = (this.getChild("n34"));
  13660. this.n22 = (this.getChild("n22"));
  13661. this.n20 = (this.getChild("n20"));
  13662. this.n23 = (this.getChild("n23"));
  13663. this.n24 = (this.getChild("n24"));
  13664. this.n26 = (this.getChild("n26"));
  13665. this.n33 = (this.getChild("n33"));
  13666. this.coinImg = (this.getChild("coinImg"));
  13667. this.need = (this.getChild("need"));
  13668. this.n35 = (this.getChild("n35"));
  13669. this.n29 = (this.getChild("n29"));
  13670. this.tipsTxt = (this.getChild("tipsTxt"));
  13671. this.n30 = (this.getChild("n30"));
  13672. this.peopleTxt = (this.getChild("peopleTxt"));
  13673. this.t0 = this.getTransition("t0");
  13674. }
  13675. }
  13676. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13677. class ui_ModeSelection_com3 extends fgui.GButton {
  13678. static createInstance() {
  13679. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13680. }
  13681. onConstruct() {
  13682. this.n34 = (this.getChild("n34"));
  13683. this.n36 = (this.getChild("n36"));
  13684. this.n22 = (this.getChild("n22"));
  13685. this.n20 = (this.getChild("n20"));
  13686. this.n23 = (this.getChild("n23"));
  13687. this.n24 = (this.getChild("n24"));
  13688. this.n26 = (this.getChild("n26"));
  13689. this.n33 = (this.getChild("n33"));
  13690. this.coinImg = (this.getChild("coinImg"));
  13691. this.need = (this.getChild("need"));
  13692. this.n35 = (this.getChild("n35"));
  13693. this.n29 = (this.getChild("n29"));
  13694. this.tipsTxt = (this.getChild("tipsTxt"));
  13695. this.n30 = (this.getChild("n30"));
  13696. this.peopleTxt = (this.getChild("peopleTxt"));
  13697. this.t0 = this.getTransition("t0");
  13698. }
  13699. }
  13700. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13701. class ui_Invitation_com1 extends fgui.GComponent {
  13702. static createInstance() {
  13703. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13704. }
  13705. onConstruct() {
  13706. this.n14 = (this.getChild("n14"));
  13707. this.n13 = (this.getChild("n13"));
  13708. this.n3 = (this.getChild("n3"));
  13709. this.n1 = (this.getChild("n1"));
  13710. this.n6 = (this.getChild("n6"));
  13711. this.n7 = (this.getChild("n7"));
  13712. this.enterBtn = (this.getChild("enterBtn"));
  13713. this.n11 = (this.getChild("n11"));
  13714. this.n12 = (this.getChild("n12"));
  13715. this.n15 = (this.getChild("n15"));
  13716. this.t0 = this.getTransition("t0");
  13717. this.t1 = this.getTransition("t1");
  13718. }
  13719. }
  13720. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13721. class ui_Component87_1 extends fgui.GComponent {
  13722. static createInstance() {
  13723. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13724. }
  13725. onConstruct() {
  13726. this.n74 = (this.getChild("n74"));
  13727. this.n73 = (this.getChild("n73"));
  13728. this.ballTxt = (this.getChild("ballTxt"));
  13729. this.n76 = (this.getChild("n76"));
  13730. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13731. this.levelTxt = (this.getChild("levelTxt"));
  13732. this.n87 = (this.getChild("n87"));
  13733. this.n84 = (this.getChild("n84"));
  13734. this.hpTxt = (this.getChild("hpTxt"));
  13735. this.n89 = (this.getChild("n89"));
  13736. this.tipsTxt = (this.getChild("tipsTxt"));
  13737. }
  13738. }
  13739. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13740. class ui_sqg1 extends fgui.GComponent {
  13741. static createInstance() {
  13742. return (fgui.UIPackage.createObject("game", "sqg1"));
  13743. }
  13744. onConstruct() {
  13745. this.n1 = (this.getChild("n1"));
  13746. this.n0 = (this.getChild("n0"));
  13747. }
  13748. }
  13749. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13750. class ui_sqg2 extends fgui.GComponent {
  13751. static createInstance() {
  13752. return (fgui.UIPackage.createObject("game", "sqg2"));
  13753. }
  13754. onConstruct() {
  13755. this.n1 = (this.getChild("n1"));
  13756. this.n0 = (this.getChild("n0"));
  13757. }
  13758. }
  13759. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13760. class ui_sqg3 extends fgui.GComponent {
  13761. static createInstance() {
  13762. return (fgui.UIPackage.createObject("game", "sqg3"));
  13763. }
  13764. onConstruct() {
  13765. this.n1 = (this.getChild("n1"));
  13766. this.n0 = (this.getChild("n0"));
  13767. }
  13768. }
  13769. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13770. class ui_sqg4 extends fgui.GComponent {
  13771. static createInstance() {
  13772. return (fgui.UIPackage.createObject("game", "sqg4"));
  13773. }
  13774. onConstruct() {
  13775. this.n1 = (this.getChild("n1"));
  13776. this.n0 = (this.getChild("n0"));
  13777. }
  13778. }
  13779. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13780. class ui_Component36 extends fgui.GButton {
  13781. static createInstance() {
  13782. return (fgui.UIPackage.createObject("game", "Component36"));
  13783. }
  13784. onConstruct() {
  13785. this.c1 = this.getController("c1");
  13786. this.n53 = (this.getChild("n53"));
  13787. this.n56 = (this.getChild("n56"));
  13788. }
  13789. }
  13790. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13791. class ui_Component37 extends fgui.GButton {
  13792. static createInstance() {
  13793. return (fgui.UIPackage.createObject("game", "Component37"));
  13794. }
  13795. onConstruct() {
  13796. this.c1 = this.getController("c1");
  13797. this.n52 = (this.getChild("n52"));
  13798. this.n54 = (this.getChild("n54"));
  13799. }
  13800. }
  13801. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13802. class ui_UISetting extends fgui.GComponent {
  13803. static createInstance() {
  13804. return (fgui.UIPackage.createObject("game", "UISetting"));
  13805. }
  13806. onConstruct() {
  13807. this.c1 = this.getController("c1");
  13808. this.n4 = (this.getChild("n4"));
  13809. this.soundBtn = (this.getChild("soundBtn"));
  13810. this.shakeBtn = (this.getChild("shakeBtn"));
  13811. this.clickNode = (this.getChild("clickNode"));
  13812. this.xyBtn = (this.getChild("xyBtn"));
  13813. }
  13814. }
  13815. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13816. class ui_Component39 extends fgui.GComponent {
  13817. static createInstance() {
  13818. return (fgui.UIPackage.createObject("game", "Component39"));
  13819. }
  13820. onConstruct() {
  13821. this.n5 = (this.getChild("n5"));
  13822. this.n6 = (this.getChild("n6"));
  13823. this.n7 = (this.getChild("n7"));
  13824. this.t0 = this.getTransition("t0");
  13825. }
  13826. }
  13827. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13828. class ui_Component40 extends fgui.GButton {
  13829. static createInstance() {
  13830. return (fgui.UIPackage.createObject("game", "Component40"));
  13831. }
  13832. onConstruct() {
  13833. this.n46 = (this.getChild("n46"));
  13834. this.n47 = (this.getChild("n47"));
  13835. }
  13836. }
  13837. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13838. class ui_Component41 extends fgui.GComponent {
  13839. static createInstance() {
  13840. return (fgui.UIPackage.createObject("game", "Component41"));
  13841. }
  13842. onConstruct() {
  13843. this.c1 = this.getController("c1");
  13844. this.n0 = (this.getChild("n0"));
  13845. this.titleTxt = (this.getChild("titleTxt"));
  13846. this.n2 = (this.getChild("n2"));
  13847. this.msgTips = (this.getChild("msgTips"));
  13848. this.numTxt = (this.getChild("numTxt"));
  13849. this.n18 = (this.getChild("n18"));
  13850. this.cancelBtn = (this.getChild("cancelBtn"));
  13851. this.videoBtn = (this.getChild("videoBtn"));
  13852. this.n10 = (this.getChild("n10"));
  13853. }
  13854. }
  13855. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13856. class ui_Component42 extends fgui.GComponent {
  13857. static createInstance() {
  13858. return (fgui.UIPackage.createObject("game", "Component42"));
  13859. }
  13860. onConstruct() {
  13861. this.c1 = this.getController("c1");
  13862. this.n1 = (this.getChild("n1"));
  13863. this.n2 = (this.getChild("n2"));
  13864. this.n3 = (this.getChild("n3"));
  13865. this.tipsTxt = (this.getChild("tipsTxt"));
  13866. this.cancelBtn = (this.getChild("cancelBtn"));
  13867. this.sureBtn = (this.getChild("sureBtn"));
  13868. this.n11 = (this.getChild("n11"));
  13869. this.n13 = (this.getChild("n13"));
  13870. this.n14 = (this.getChild("n14"));
  13871. this.womanTxt = (this.getChild("womanTxt"));
  13872. this.t0 = this.getTransition("t0");
  13873. }
  13874. }
  13875. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13876. class ui_dh_js_shengli extends fgui.GComponent {
  13877. static createInstance() {
  13878. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13879. }
  13880. onConstruct() {
  13881. this.n3 = (this.getChild("n3"));
  13882. this.n4 = (this.getChild("n4"));
  13883. this.n1 = (this.getChild("n1"));
  13884. this.n2 = (this.getChild("n2"));
  13885. this.n5 = (this.getChild("n5"));
  13886. this.n6 = (this.getChild("n6"));
  13887. this.n7 = (this.getChild("n7"));
  13888. this.n8 = (this.getChild("n8"));
  13889. this.attack = this.getTransition("attack");
  13890. this.idle = this.getTransition("idle");
  13891. }
  13892. }
  13893. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13894. class ui_dh_js_shengli_g extends fgui.GComponent {
  13895. static createInstance() {
  13896. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13897. }
  13898. onConstruct() {
  13899. this.n3 = (this.getChild("n3"));
  13900. this.n1 = (this.getChild("n1"));
  13901. this.t0 = this.getTransition("t0");
  13902. }
  13903. }
  13904. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13905. class ui_dh_js_shibai extends fgui.GComponent {
  13906. static createInstance() {
  13907. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13908. }
  13909. onConstruct() {
  13910. this.n0 = (this.getChild("n0"));
  13911. this.n1 = (this.getChild("n1"));
  13912. this.n2 = (this.getChild("n2"));
  13913. this.n3 = (this.getChild("n3"));
  13914. this.idle = this.getTransition("idle");
  13915. this.attack = this.getTransition("attack");
  13916. }
  13917. }
  13918. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13919. class ui_dh_zy_ganfa extends fgui.GButton {
  13920. static createInstance() {
  13921. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13922. }
  13923. onConstruct() {
  13924. this.n0 = (this.getChild("n0"));
  13925. }
  13926. }
  13927. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13928. class ui_dh_zy_sc_guang extends fgui.GButton {
  13929. static createInstance() {
  13930. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13931. }
  13932. onConstruct() {
  13933. this.n0 = (this.getChild("n0"));
  13934. this.n2 = (this.getChild("n2"));
  13935. }
  13936. }
  13937. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13938. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13939. static createInstance() {
  13940. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13941. }
  13942. onConstruct() {
  13943. this.n0 = (this.getChild("n0"));
  13944. this.n3 = (this.getChild("n3"));
  13945. this.t0 = this.getTransition("t0");
  13946. }
  13947. }
  13948. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13949. class ui_dh_zy_wanfa extends fgui.GButton {
  13950. static createInstance() {
  13951. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13952. }
  13953. onConstruct() {
  13954. this.n0 = (this.getChild("n0"));
  13955. }
  13956. }
  13957. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13958. class ui_Component_daoju extends fgui.GComponent {
  13959. static createInstance() {
  13960. return (fgui.UIPackage.createObject("game", "Component_daoju"));
  13961. }
  13962. onConstruct() {
  13963. }
  13964. }
  13965. ui_Component_daoju.URL = "ui://isxx5ak7nmu9v57t";
  13966. class ui_Component53_1 extends fgui.GComponent {
  13967. static createInstance() {
  13968. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13969. }
  13970. onConstruct() {
  13971. this.n0 = (this.getChild("n0"));
  13972. this.n1 = (this.getChild("n1"));
  13973. this.n2 = (this.getChild("n2"));
  13974. this.n3 = (this.getChild("n3"));
  13975. this.n4 = (this.getChild("n4"));
  13976. this.n5 = (this.getChild("n5"));
  13977. this.n6 = (this.getChild("n6"));
  13978. this.n7 = (this.getChild("n7"));
  13979. this.n8 = (this.getChild("n8"));
  13980. this.n9 = (this.getChild("n9"));
  13981. this.n10 = (this.getChild("n10"));
  13982. this.n11 = (this.getChild("n11"));
  13983. this.n12 = (this.getChild("n12"));
  13984. this.n13 = (this.getChild("n13"));
  13985. this.n14 = (this.getChild("n14"));
  13986. this.n15 = (this.getChild("n15"));
  13987. this.n16 = (this.getChild("n16"));
  13988. this.n19 = (this.getChild("n19"));
  13989. this.n20 = (this.getChild("n20"));
  13990. this.n21 = (this.getChild("n21"));
  13991. this.n22 = (this.getChild("n22"));
  13992. this.n23 = (this.getChild("n23"));
  13993. this.n24 = (this.getChild("n24"));
  13994. this.n25 = (this.getChild("n25"));
  13995. this.n26 = (this.getChild("n26"));
  13996. this.n27 = (this.getChild("n27"));
  13997. this.n28 = (this.getChild("n28"));
  13998. this.n29 = (this.getChild("n29"));
  13999. this.n30 = (this.getChild("n30"));
  14000. this.n31 = (this.getChild("n31"));
  14001. this.n32 = (this.getChild("n32"));
  14002. this.n33 = (this.getChild("n33"));
  14003. this.n34 = (this.getChild("n34"));
  14004. this.n35 = (this.getChild("n35"));
  14005. this.t0 = this.getTransition("t0");
  14006. }
  14007. }
  14008. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14009. class ui_Component30 extends fgui.GComponent {
  14010. static createInstance() {
  14011. return (fgui.UIPackage.createObject("game", "Component30"));
  14012. }
  14013. onConstruct() {
  14014. this.c1 = this.getController("c1");
  14015. this.n46 = (this.getChild("n46"));
  14016. this.n47 = (this.getChild("n47"));
  14017. this.numTxt = (this.getChild("numTxt"));
  14018. this.n50 = (this.getChild("n50"));
  14019. this.n53 = (this.getChild("n53"));
  14020. this.n54 = (this.getChild("n54"));
  14021. this.n55 = (this.getChild("n55"));
  14022. this.n56 = (this.getChild("n56"));
  14023. }
  14024. }
  14025. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14026. class ui_Component30_1 extends fgui.GComponent {
  14027. static createInstance() {
  14028. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14029. }
  14030. onConstruct() {
  14031. this.c1 = this.getController("c1");
  14032. this.n46 = (this.getChild("n46"));
  14033. this.n47 = (this.getChild("n47"));
  14034. this.numTxt = (this.getChild("numTxt"));
  14035. this.n50 = (this.getChild("n50"));
  14036. this.n51 = (this.getChild("n51"));
  14037. this.n52 = (this.getChild("n52"));
  14038. this.n53 = (this.getChild("n53"));
  14039. this.n54 = (this.getChild("n54"));
  14040. }
  14041. }
  14042. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14043. class ui_Component31 extends fgui.GComponent {
  14044. static createInstance() {
  14045. return (fgui.UIPackage.createObject("game", "Component31"));
  14046. }
  14047. onConstruct() {
  14048. this.n55 = (this.getChild("n55"));
  14049. this.n54 = (this.getChild("n54"));
  14050. this.conditionTxt = (this.getChild("conditionTxt"));
  14051. this.n57 = (this.getChild("n57"));
  14052. this.t0 = this.getTransition("t0");
  14053. }
  14054. }
  14055. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14056. class ui_Component32 extends fgui.GComponent {
  14057. static createInstance() {
  14058. return (fgui.UIPackage.createObject("game", "Component32"));
  14059. }
  14060. onConstruct() {
  14061. this.n5 = (this.getChild("n5"));
  14062. this.n6 = (this.getChild("n6"));
  14063. this.n7 = (this.getChild("n7"));
  14064. this.t0 = this.getTransition("t0");
  14065. }
  14066. }
  14067. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14068. class ui_AwardItem extends fgui.GComponent {
  14069. static createInstance() {
  14070. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14071. }
  14072. onConstruct() {
  14073. this.n9 = (this.getChild("n9"));
  14074. this.myIcon = (this.getChild("myIcon"));
  14075. this.numTxt = (this.getChild("numTxt"));
  14076. this.nameTxt = (this.getChild("nameTxt"));
  14077. this.n16 = (this.getChild("n16"));
  14078. this.n17 = (this.getChild("n17"));
  14079. }
  14080. }
  14081. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14082. class ui_ranking_com1 extends fgui.GButton {
  14083. static createInstance() {
  14084. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14085. }
  14086. onConstruct() {
  14087. this.c1 = this.getController("c1");
  14088. this.n49 = (this.getChild("n49"));
  14089. this.n18 = (this.getChild("n18"));
  14090. this.n46 = (this.getChild("n46"));
  14091. this.n48 = (this.getChild("n48"));
  14092. this.n50 = (this.getChild("n50"));
  14093. }
  14094. }
  14095. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14096. class ui_ranking_com2 extends fgui.GButton {
  14097. static createInstance() {
  14098. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14099. }
  14100. onConstruct() {
  14101. this.c1 = this.getController("c1");
  14102. this.n49 = (this.getChild("n49"));
  14103. this.n18 = (this.getChild("n18"));
  14104. this.n46 = (this.getChild("n46"));
  14105. this.n48 = (this.getChild("n48"));
  14106. this.n50 = (this.getChild("n50"));
  14107. }
  14108. }
  14109. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14110. class ui_ranking_com3 extends fgui.GComponent {
  14111. static createInstance() {
  14112. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14113. }
  14114. onConstruct() {
  14115. this.n17 = (this.getChild("n17"));
  14116. this.myIcon = (this.getChild("myIcon"));
  14117. }
  14118. }
  14119. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14120. class ui_ranking_com4 extends fgui.GComponent {
  14121. static createInstance() {
  14122. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14123. }
  14124. onConstruct() {
  14125. this.n16 = (this.getChild("n16"));
  14126. this.head = (this.getChild("head"));
  14127. }
  14128. }
  14129. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14130. class ui_ranking_com5 extends fgui.GComponent {
  14131. static createInstance() {
  14132. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14133. }
  14134. onConstruct() {
  14135. this.c1 = this.getController("c1");
  14136. this.c2 = this.getController("c2");
  14137. this.n2 = (this.getChild("n2"));
  14138. this.n3 = (this.getChild("n3"));
  14139. this.levelBtn = (this.getChild("levelBtn"));
  14140. this.starBtn = (this.getChild("starBtn"));
  14141. this.n23 = (this.getChild("n23"));
  14142. this.n24 = (this.getChild("n24"));
  14143. this.n25 = (this.getChild("n25"));
  14144. this.myList = (this.getChild("myList"));
  14145. this.selfNode = (this.getChild("selfNode"));
  14146. this.n9 = (this.getChild("n9"));
  14147. this.n12 = (this.getChild("n12"));
  14148. this.n13 = (this.getChild("n13"));
  14149. this.n14 = (this.getChild("n14"));
  14150. this.n39 = (this.getChild("n39"));
  14151. this.n41 = (this.getChild("n41"));
  14152. this.n42 = (this.getChild("n42"));
  14153. this.n45 = (this.getChild("n45"));
  14154. this.changeBtn = (this.getChild("changeBtn"));
  14155. this.closeBtn = (this.getChild("closeBtn"));
  14156. this.t0 = this.getTransition("t0");
  14157. }
  14158. }
  14159. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14160. class ui_RankItem extends fgui.GComponent {
  14161. static createInstance() {
  14162. return (fgui.UIPackage.createObject("game", "RankItem"));
  14163. }
  14164. onConstruct() {
  14165. this.n10 = (this.getChild("n10"));
  14166. this.n11 = (this.getChild("n11"));
  14167. this.rankTxt = (this.getChild("rankTxt"));
  14168. this.headNode = (this.getChild("headNode"));
  14169. this.nameTxt = (this.getChild("nameTxt"));
  14170. this.n19 = (this.getChild("n19"));
  14171. this.valueTxt = (this.getChild("valueTxt"));
  14172. this.img1 = (this.getChild("img1"));
  14173. this.img2 = (this.getChild("img2"));
  14174. this.img3 = (this.getChild("img3"));
  14175. }
  14176. }
  14177. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14178. class ui_ranking_com9 extends fgui.GComponent {
  14179. static createInstance() {
  14180. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14181. }
  14182. onConstruct() {
  14183. this.c1 = this.getController("c1");
  14184. this.n27 = (this.getChild("n27"));
  14185. this.n28 = (this.getChild("n28"));
  14186. this.headNode = (this.getChild("headNode"));
  14187. this.rankTxt = (this.getChild("rankTxt"));
  14188. this.nameTxt = (this.getChild("nameTxt"));
  14189. this.n34 = (this.getChild("n34"));
  14190. this.valueTxt = (this.getChild("valueTxt"));
  14191. this.n36 = (this.getChild("n36"));
  14192. this.n37 = (this.getChild("n37"));
  14193. this.n38 = (this.getChild("n38"));
  14194. this.n39 = (this.getChild("n39"));
  14195. this.n40 = (this.getChild("n40"));
  14196. }
  14197. }
  14198. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14199. class ui_ranking_com10 extends fgui.GComponent {
  14200. static createInstance() {
  14201. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14202. }
  14203. onConstruct() {
  14204. this.n23 = (this.getChild("n23"));
  14205. this.n24 = (this.getChild("n24"));
  14206. }
  14207. }
  14208. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14209. class ui_ranking_com11 extends fgui.GComponent {
  14210. static createInstance() {
  14211. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14212. }
  14213. onConstruct() {
  14214. this.n24 = (this.getChild("n24"));
  14215. this.n25 = (this.getChild("n25"));
  14216. this.t0 = this.getTransition("t0");
  14217. }
  14218. }
  14219. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14220. class ui_ranking_com13 extends fgui.GButton {
  14221. static createInstance() {
  14222. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14223. }
  14224. onConstruct() {
  14225. this.c1 = this.getController("c1");
  14226. this.n44 = (this.getChild("n44"));
  14227. this.n45 = (this.getChild("n45"));
  14228. this.n46 = (this.getChild("n46"));
  14229. }
  14230. }
  14231. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14232. class ui_Component122 extends fgui.GComponent {
  14233. static createInstance() {
  14234. return (fgui.UIPackage.createObject("game", "Component122"));
  14235. }
  14236. onConstruct() {
  14237. this.gameNode3 = (this.getChild("gameNode3"));
  14238. }
  14239. }
  14240. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14241. class ui_skillItem extends fgui.GComponent {
  14242. static createInstance() {
  14243. return (fgui.UIPackage.createObject("game", "skillItem"));
  14244. }
  14245. onConstruct() {
  14246. this.c1 = this.getController("c1");
  14247. this.n31 = (this.getChild("n31"));
  14248. this.n6 = (this.getChild("n6"));
  14249. this.skillImg = (this.getChild("skillImg"));
  14250. this.nameTxt = (this.getChild("nameTxt"));
  14251. this.levelTxt = (this.getChild("levelTxt"));
  14252. this.n28 = (this.getChild("n28"));
  14253. this.describeTxt = (this.getChild("describeTxt"));
  14254. this.n32 = (this.getChild("n32"));
  14255. this.mutiBtn = (this.getChild("mutiBtn"));
  14256. this.tryNode = (this.getChild("tryNode"));
  14257. this.normalBtn = (this.getChild("normalBtn"));
  14258. this.startBtn = (this.getChild("startBtn"));
  14259. this.n42 = (this.getChild("n42"));
  14260. this.n43 = (this.getChild("n43"));
  14261. this.n44 = (this.getChild("n44"));
  14262. }
  14263. }
  14264. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14265. class ui_Component26 extends fgui.GButton {
  14266. static createInstance() {
  14267. return (fgui.UIPackage.createObject("game", "Component26"));
  14268. }
  14269. onConstruct() {
  14270. this.n11 = (this.getChild("n11"));
  14271. this.n30 = (this.getChild("n30"));
  14272. this.n34 = (this.getChild("n34"));
  14273. }
  14274. }
  14275. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14276. class ui_Component28 extends fgui.GButton {
  14277. static createInstance() {
  14278. return (fgui.UIPackage.createObject("game", "Component28"));
  14279. }
  14280. onConstruct() {
  14281. this.n12 = (this.getChild("n12"));
  14282. this.n31 = (this.getChild("n31"));
  14283. this.curTxt = (this.getChild("curTxt"));
  14284. this.n33 = (this.getChild("n33"));
  14285. }
  14286. }
  14287. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14288. class ui_Component1302 extends fgui.GComponent {
  14289. static createInstance() {
  14290. return (fgui.UIPackage.createObject("game", "Component1302"));
  14291. }
  14292. onConstruct() {
  14293. this.n2 = (this.getChild("n2"));
  14294. this.n3 = (this.getChild("n3"));
  14295. }
  14296. }
  14297. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14298. class ui_Component113 extends fgui.GComponent {
  14299. static createInstance() {
  14300. return (fgui.UIPackage.createObject("game", "Component113"));
  14301. }
  14302. onConstruct() {
  14303. this.n85 = (this.getChild("n85"));
  14304. this.n86 = (this.getChild("n86"));
  14305. this.n77 = (this.getChild("n77"));
  14306. this.n79 = (this.getChild("n79"));
  14307. this.n80 = (this.getChild("n80"));
  14308. this.n81 = (this.getChild("n81"));
  14309. this.n82 = (this.getChild("n82"));
  14310. this.n84 = (this.getChild("n84"));
  14311. this.n87 = (this.getChild("n87"));
  14312. this.t0 = this.getTransition("t0");
  14313. }
  14314. }
  14315. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14316. class ui_Component114 extends fgui.GComponent {
  14317. static createInstance() {
  14318. return (fgui.UIPackage.createObject("game", "Component114"));
  14319. }
  14320. onConstruct() {
  14321. this.n77 = (this.getChild("n77"));
  14322. this.t0 = this.getTransition("t0");
  14323. }
  14324. }
  14325. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14326. class ui_Component115 extends fgui.GComponent {
  14327. static createInstance() {
  14328. return (fgui.UIPackage.createObject("game", "Component115"));
  14329. }
  14330. onConstruct() {
  14331. this.n83 = (this.getChild("n83"));
  14332. this.fingerNode = (this.getChild("fingerNode"));
  14333. this.n84 = (this.getChild("n84"));
  14334. }
  14335. }
  14336. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14337. class ui_Component117 extends fgui.GComponent {
  14338. static createInstance() {
  14339. return (fgui.UIPackage.createObject("game", "Component117"));
  14340. }
  14341. onConstruct() {
  14342. this.n87 = (this.getChild("n87"));
  14343. this.n88 = (this.getChild("n88"));
  14344. this.n84 = (this.getChild("n84"));
  14345. this.n85 = (this.getChild("n85"));
  14346. this.n86 = (this.getChild("n86"));
  14347. this.t0 = this.getTransition("t0");
  14348. }
  14349. }
  14350. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14351. class ui_Component98_1 extends fgui.GButton {
  14352. static createInstance() {
  14353. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14354. }
  14355. onConstruct() {
  14356. this.c1 = this.getController("c1");
  14357. this.n8 = (this.getChild("n8"));
  14358. this.n41 = (this.getChild("n41"));
  14359. this.n40 = (this.getChild("n40"));
  14360. }
  14361. }
  14362. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14363. class ui_Component61 extends fgui.GComponent {
  14364. static createInstance() {
  14365. return (fgui.UIPackage.createObject("game", "Component61"));
  14366. }
  14367. onConstruct() {
  14368. this.n14 = (this.getChild("n14"));
  14369. this.n6 = (this.getChild("n6"));
  14370. this.t0 = this.getTransition("t0");
  14371. }
  14372. }
  14373. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14374. class ui_Component62 extends fgui.GComponent {
  14375. static createInstance() {
  14376. return (fgui.UIPackage.createObject("game", "Component62"));
  14377. }
  14378. onConstruct() {
  14379. this.n66 = (this.getChild("n66"));
  14380. this.n56 = (this.getChild("n56"));
  14381. this.n63 = (this.getChild("n63"));
  14382. this.n65 = (this.getChild("n65"));
  14383. this.t0 = this.getTransition("t0");
  14384. }
  14385. }
  14386. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14387. class ui_d3Root extends fgui.GComponent {
  14388. static createInstance() {
  14389. return (fgui.UIPackage.createObject("game", "d3Root"));
  14390. }
  14391. onConstruct() {
  14392. }
  14393. }
  14394. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14395. class ui_d2Root extends fgui.GComponent {
  14396. static createInstance() {
  14397. return (fgui.UIPackage.createObject("game", "d2Root"));
  14398. }
  14399. onConstruct() {
  14400. }
  14401. }
  14402. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14403. class ui_ballNode extends fgui.GComponent {
  14404. static createInstance() {
  14405. return (fgui.UIPackage.createObject("game", "ballNode"));
  14406. }
  14407. onConstruct() {
  14408. }
  14409. }
  14410. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14411. class ui_border extends fgui.GComponent {
  14412. static createInstance() {
  14413. return (fgui.UIPackage.createObject("game", "border"));
  14414. }
  14415. onConstruct() {
  14416. this.bar1 = (this.getChild("bar1"));
  14417. this.bar2 = (this.getChild("bar2"));
  14418. this.bar3 = (this.getChild("bar3"));
  14419. this.bar4 = (this.getChild("bar4"));
  14420. this.bar5 = (this.getChild("bar5"));
  14421. this.bar6 = (this.getChild("bar6"));
  14422. this.circle1 = (this.getChild("circle1"));
  14423. this.circle2 = (this.getChild("circle2"));
  14424. this.circle3 = (this.getChild("circle3"));
  14425. this.circle4 = (this.getChild("circle4"));
  14426. this.circle5 = (this.getChild("circle5"));
  14427. this.circle6 = (this.getChild("circle6"));
  14428. this.n28 = (this.getChild("n28"));
  14429. }
  14430. }
  14431. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14432. class ui_Component41_2 extends fgui.GComponent {
  14433. static createInstance() {
  14434. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14435. }
  14436. onConstruct() {
  14437. this.c1 = this.getController("c1");
  14438. this.n0 = (this.getChild("n0"));
  14439. this.n2 = (this.getChild("n2"));
  14440. this.n19 = (this.getChild("n19"));
  14441. this.cancelBtn = (this.getChild("cancelBtn"));
  14442. this.videoBtn = (this.getChild("videoBtn"));
  14443. this.n9 = (this.getChild("n9"));
  14444. this.n22 = (this.getChild("n22"));
  14445. this.tipsTxt = (this.getChild("tipsTxt"));
  14446. this.n23 = (this.getChild("n23"));
  14447. this.n24 = (this.getChild("n24"));
  14448. this.n26 = (this.getChild("n26"));
  14449. this.n27 = (this.getChild("n27"));
  14450. this.titleTxt = (this.getChild("titleTxt"));
  14451. }
  14452. }
  14453. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14454. class ui_Component41_1 extends fgui.GComponent {
  14455. static createInstance() {
  14456. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14457. }
  14458. onConstruct() {
  14459. this.c1 = this.getController("c1");
  14460. this.n0 = (this.getChild("n0"));
  14461. this.n2 = (this.getChild("n2"));
  14462. this.cancelBtn = (this.getChild("cancelBtn"));
  14463. this.videoBtn = (this.getChild("videoBtn"));
  14464. this.n27 = (this.getChild("n27"));
  14465. this.n30 = (this.getChild("n30"));
  14466. this.n31 = (this.getChild("n31"));
  14467. this.n32 = (this.getChild("n32"));
  14468. this.n33 = (this.getChild("n33"));
  14469. this.n34 = (this.getChild("n34"));
  14470. this.n35 = (this.getChild("n35"));
  14471. this.n36 = (this.getChild("n36"));
  14472. this.n1 = (this.getChild("n1"));
  14473. this.n37 = (this.getChild("n37"));
  14474. this.t0 = this.getTransition("t0");
  14475. this.t1 = this.getTransition("t1");
  14476. this.t2 = this.getTransition("t2");
  14477. this.t3 = this.getTransition("t3");
  14478. }
  14479. }
  14480. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14481. class ui_againBtn extends fgui.GButton {
  14482. static createInstance() {
  14483. return (fgui.UIPackage.createObject("game", "againBtn"));
  14484. }
  14485. onConstruct() {
  14486. this.n2 = (this.getChild("n2"));
  14487. this.n1 = (this.getChild("n1"));
  14488. this.n5 = (this.getChild("n5"));
  14489. }
  14490. }
  14491. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14492. class ui_Component118 extends fgui.GButton {
  14493. static createInstance() {
  14494. return (fgui.UIPackage.createObject("game", "Component118"));
  14495. }
  14496. onConstruct() {
  14497. this.c1 = this.getController("c1");
  14498. this.n14 = (this.getChild("n14"));
  14499. this.n9 = (this.getChild("n9"));
  14500. this.n10 = (this.getChild("n10"));
  14501. this.diamondTxt = (this.getChild("diamondTxt"));
  14502. this.n13 = (this.getChild("n13"));
  14503. this.n15 = (this.getChild("n15"));
  14504. }
  14505. }
  14506. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14507. class ui_Component119 extends fgui.GComponent {
  14508. static createInstance() {
  14509. return (fgui.UIPackage.createObject("game", "Component119"));
  14510. }
  14511. onConstruct() {
  14512. this.n1 = (this.getChild("n1"));
  14513. this.n2 = (this.getChild("n2"));
  14514. this.n13 = (this.getChild("n13"));
  14515. this.n6 = (this.getChild("n6"));
  14516. this.screenNode = (this.getChild("screenNode"));
  14517. this.n15 = (this.getChild("n15"));
  14518. this.closeBtn = (this.getChild("closeBtn"));
  14519. this.share2Btn = (this.getChild("share2Btn"));
  14520. this.shareBtn = (this.getChild("shareBtn"));
  14521. this.tipsNode = (this.getChild("tipsNode"));
  14522. this.awardNode = (this.getChild("awardNode"));
  14523. }
  14524. }
  14525. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14526. class ui_Component132_1 extends fgui.GComponent {
  14527. static createInstance() {
  14528. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14529. }
  14530. onConstruct() {
  14531. this.n25 = (this.getChild("n25"));
  14532. this.n26 = (this.getChild("n26"));
  14533. this.n27 = (this.getChild("n27"));
  14534. this.t0 = this.getTransition("t0");
  14535. }
  14536. }
  14537. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14538. class ui_SecretaryDisplay extends fgui.GComponent {
  14539. static createInstance() {
  14540. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14541. }
  14542. onConstruct() {
  14543. this.n2 = (this.getChild("n2"));
  14544. this.levelTxt = (this.getChild("levelTxt"));
  14545. this.n4 = (this.getChild("n4"));
  14546. this.secretary = (this.getChild("secretary"));
  14547. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14548. this.n16 = (this.getChild("n16"));
  14549. this.n37 = (this.getChild("n37"));
  14550. this.n41 = (this.getChild("n41"));
  14551. this.n14 = (this.getChild("n14"));
  14552. this.n17 = (this.getChild("n17"));
  14553. this.heightTxt = (this.getChild("heightTxt"));
  14554. this.n46 = (this.getChild("n46"));
  14555. this.n36 = (this.getChild("n36"));
  14556. this.n38 = (this.getChild("n38"));
  14557. this.foodTxt = (this.getChild("foodTxt"));
  14558. this.n47 = (this.getChild("n47"));
  14559. this.n40 = (this.getChild("n40"));
  14560. this.n42 = (this.getChild("n42"));
  14561. this.historyTxt = (this.getChild("historyTxt"));
  14562. this.n48 = (this.getChild("n48"));
  14563. this.nameImg = (this.getChild("nameImg"));
  14564. this.n12 = (this.getChild("n12"));
  14565. this.n49 = (this.getChild("n49"));
  14566. this.t0 = this.getTransition("t0");
  14567. }
  14568. }
  14569. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14570. class ui_BallRodDisplay extends fgui.GComponent {
  14571. static createInstance() {
  14572. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14573. }
  14574. onConstruct() {
  14575. this.c1 = this.getController("c1");
  14576. this.n31 = (this.getChild("n31"));
  14577. this.n6 = (this.getChild("n6"));
  14578. this.nameTxt = (this.getChild("nameTxt"));
  14579. this.rodImg = (this.getChild("rodImg"));
  14580. this.levelNode = (this.getChild("levelNode"));
  14581. this.eftRod = (this.getChild("eftRod"));
  14582. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14583. }
  14584. }
  14585. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14586. class ui_Component111_11 extends fgui.GComponent {
  14587. static createInstance() {
  14588. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14589. }
  14590. onConstruct() {
  14591. this.n68 = (this.getChild("n68"));
  14592. this.n69 = (this.getChild("n69"));
  14593. }
  14594. }
  14595. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14596. class ui_Component112 extends fgui.GComponent {
  14597. static createInstance() {
  14598. return (fgui.UIPackage.createObject("game", "Component112"));
  14599. }
  14600. onConstruct() {
  14601. this.n68 = (this.getChild("n68"));
  14602. this.n70 = (this.getChild("n70"));
  14603. this.myMask = (this.getChild("myMask"));
  14604. }
  14605. }
  14606. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14607. class ui_Component111 extends fgui.GComponent {
  14608. static createInstance() {
  14609. return (fgui.UIPackage.createObject("game", "Component111"));
  14610. }
  14611. onConstruct() {
  14612. this.n68 = (this.getChild("n68"));
  14613. this.myMask = (this.getChild("myMask"));
  14614. }
  14615. }
  14616. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14617. class ui_Component144 extends fgui.GButton {
  14618. static createInstance() {
  14619. return (fgui.UIPackage.createObject("game", "Component144"));
  14620. }
  14621. onConstruct() {
  14622. this.n8 = (this.getChild("n8"));
  14623. }
  14624. }
  14625. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14626. class ui_Sign_com2 extends fgui.GComponent {
  14627. static createInstance() {
  14628. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14629. }
  14630. onConstruct() {
  14631. this.n0 = (this.getChild("n0"));
  14632. this.n1 = (this.getChild("n1"));
  14633. this.t0 = this.getTransition("t0");
  14634. }
  14635. }
  14636. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14637. class ui_Sign_guang extends fgui.GComponent {
  14638. static createInstance() {
  14639. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14640. }
  14641. onConstruct() {
  14642. this.n1 = (this.getChild("n1"));
  14643. this.n2 = (this.getChild("n2"));
  14644. this.n3 = (this.getChild("n3"));
  14645. this.n4 = (this.getChild("n4"));
  14646. this.n5 = (this.getChild("n5"));
  14647. this.n6 = (this.getChild("n6"));
  14648. this.n8 = (this.getChild("n8"));
  14649. }
  14650. }
  14651. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14652. class ui_SignMax extends fgui.GComponent {
  14653. static createInstance() {
  14654. return (fgui.UIPackage.createObject("game", "SignMax"));
  14655. }
  14656. onConstruct() {
  14657. this.c1 = this.getController("c1");
  14658. this.n7 = (this.getChild("n7"));
  14659. this.n15 = (this.getChild("n15"));
  14660. this.n8 = (this.getChild("n8"));
  14661. this.titleTxt = (this.getChild("titleTxt"));
  14662. this.myIcon1 = (this.getChild("myIcon1"));
  14663. this.numTxt1 = (this.getChild("numTxt1"));
  14664. this.myIcon2 = (this.getChild("myIcon2"));
  14665. this.n20 = (this.getChild("n20"));
  14666. this.n17 = (this.getChild("n17"));
  14667. this.numTxt2 = (this.getChild("numTxt2"));
  14668. this.n12 = (this.getChild("n12"));
  14669. this.n13 = (this.getChild("n13"));
  14670. this.n21 = (this.getChild("n21"));
  14671. this.n14 = (this.getChild("n14"));
  14672. }
  14673. }
  14674. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14675. class ui_Sign_com2_1 extends fgui.GComponent {
  14676. static createInstance() {
  14677. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14678. }
  14679. onConstruct() {
  14680. this.n0 = (this.getChild("n0"));
  14681. this.n1 = (this.getChild("n1"));
  14682. this.t0 = this.getTransition("t0");
  14683. }
  14684. }
  14685. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14686. class ui_Sign_com5 extends fgui.GComponent {
  14687. static createInstance() {
  14688. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14689. }
  14690. onConstruct() {
  14691. this.n3 = (this.getChild("n3"));
  14692. this.n29 = (this.getChild("n29"));
  14693. this.n4 = (this.getChild("n4"));
  14694. this.day1 = (this.getChild("day1"));
  14695. this.day2 = (this.getChild("day2"));
  14696. this.day3 = (this.getChild("day3"));
  14697. this.day4 = (this.getChild("day4"));
  14698. this.day5 = (this.getChild("day5"));
  14699. this.day6 = (this.getChild("day6"));
  14700. this.day7 = (this.getChild("day7"));
  14701. this.t0 = this.getTransition("t0");
  14702. }
  14703. }
  14704. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14705. class ui_Sign_com8 extends fgui.GComponent {
  14706. static createInstance() {
  14707. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14708. }
  14709. onConstruct() {
  14710. this.n48 = (this.getChild("n48"));
  14711. this.womanTxt = (this.getChild("womanTxt"));
  14712. this.t0 = this.getTransition("t0");
  14713. }
  14714. }
  14715. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14716. class ui_Sign_com6 extends fgui.GComponent {
  14717. static createInstance() {
  14718. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14719. }
  14720. onConstruct() {
  14721. this.n2 = (this.getChild("n2"));
  14722. this.n3 = (this.getChild("n3"));
  14723. this.t0 = this.getTransition("t0");
  14724. }
  14725. }
  14726. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14727. class ui_Sign_com7 extends fgui.GComponent {
  14728. static createInstance() {
  14729. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14730. }
  14731. onConstruct() {
  14732. this.n29 = (this.getChild("n29"));
  14733. this.n2 = (this.getChild("n2"));
  14734. }
  14735. }
  14736. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14737. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14738. static createInstance() {
  14739. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14740. }
  14741. onConstruct() {
  14742. this.n5 = (this.getChild("n5"));
  14743. this.n4 = (this.getChild("n4"));
  14744. this.t0 = this.getTransition("t0");
  14745. }
  14746. }
  14747. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14748. class ui_UITurntable_com2 extends fgui.GComponent {
  14749. static createInstance() {
  14750. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14751. }
  14752. onConstruct() {
  14753. this.c1 = this.getController("c1");
  14754. this.n4 = (this.getChild("n4"));
  14755. this.n6 = (this.getChild("n6"));
  14756. this.n10 = (this.getChild("n10"));
  14757. this.n11 = (this.getChild("n11"));
  14758. this.n12 = (this.getChild("n12"));
  14759. this.n13 = (this.getChild("n13"));
  14760. this.n14 = (this.getChild("n14"));
  14761. this.n15 = (this.getChild("n15"));
  14762. this.n16 = (this.getChild("n16"));
  14763. this.n17 = (this.getChild("n17"));
  14764. this.n18 = (this.getChild("n18"));
  14765. this.n19 = (this.getChild("n19"));
  14766. this.n20 = (this.getChild("n20"));
  14767. this.n21 = (this.getChild("n21"));
  14768. this.n22 = (this.getChild("n22"));
  14769. this.n23 = (this.getChild("n23"));
  14770. this.n24 = (this.getChild("n24"));
  14771. this.n25 = (this.getChild("n25"));
  14772. this.n26 = (this.getChild("n26"));
  14773. this.n27 = (this.getChild("n27"));
  14774. this.n28 = (this.getChild("n28"));
  14775. this.n29 = (this.getChild("n29"));
  14776. this.n30 = (this.getChild("n30"));
  14777. this.n31 = (this.getChild("n31"));
  14778. this.n32 = (this.getChild("n32"));
  14779. this.n33 = (this.getChild("n33"));
  14780. }
  14781. }
  14782. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14783. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14784. static createInstance() {
  14785. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14786. }
  14787. onConstruct() {
  14788. this.n5 = (this.getChild("n5"));
  14789. this.n4 = (this.getChild("n4"));
  14790. this.t0 = this.getTransition("t0");
  14791. }
  14792. }
  14793. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14794. class ui_UITurntable_com5 extends fgui.GComponent {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14797. }
  14798. onConstruct() {
  14799. this.flashNode = (this.getChild("flashNode"));
  14800. this.rotNode = (this.getChild("rotNode"));
  14801. this.n3 = (this.getChild("n3"));
  14802. this.n21 = (this.getChild("n21"));
  14803. this.t0 = this.getTransition("t0");
  14804. }
  14805. }
  14806. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14807. class ui_UITurntable_com7 extends fgui.GComponent {
  14808. static createInstance() {
  14809. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14810. }
  14811. onConstruct() {
  14812. this.n2 = (this.getChild("n2"));
  14813. this.n35 = (this.getChild("n35"));
  14814. this.img1 = (this.getChild("img1"));
  14815. this.img2 = (this.getChild("img2"));
  14816. this.img3 = (this.getChild("img3"));
  14817. this.img4 = (this.getChild("img4"));
  14818. this.img6 = (this.getChild("img6"));
  14819. this.img5 = (this.getChild("img5"));
  14820. this.txt1 = (this.getChild("txt1"));
  14821. this.txt2 = (this.getChild("txt2"));
  14822. this.txt3 = (this.getChild("txt3"));
  14823. this.txt4 = (this.getChild("txt4"));
  14824. this.txt5 = (this.getChild("txt5"));
  14825. this.txt6 = (this.getChild("txt6"));
  14826. }
  14827. }
  14828. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14829. class ui_UITurntable_com9 extends fgui.GComponent {
  14830. static createInstance() {
  14831. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14832. }
  14833. onConstruct() {
  14834. this.n38 = (this.getChild("n38"));
  14835. this.n39 = (this.getChild("n39"));
  14836. }
  14837. }
  14838. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14839. class ui_UITurntable_com10 extends fgui.GComponent {
  14840. static createInstance() {
  14841. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14842. }
  14843. onConstruct() {
  14844. this.n39 = (this.getChild("n39"));
  14845. this.n40 = (this.getChild("n40"));
  14846. this.t0 = this.getTransition("t0");
  14847. }
  14848. }
  14849. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14850. class ui_UITurntable_com11 extends fgui.GComponent {
  14851. static createInstance() {
  14852. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14853. }
  14854. onConstruct() {
  14855. this.n38 = (this.getChild("n38"));
  14856. this.n39 = (this.getChild("n39"));
  14857. this.n40 = (this.getChild("n40"));
  14858. this.t0 = this.getTransition("t0");
  14859. }
  14860. }
  14861. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14862. class ui_UITurntable_com12 extends fgui.GComponent {
  14863. static createInstance() {
  14864. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14865. }
  14866. onConstruct() {
  14867. this.n43 = (this.getChild("n43"));
  14868. this.barNode = (this.getChild("barNode"));
  14869. this.tipsTxt = (this.getChild("tipsTxt"));
  14870. this.n45 = (this.getChild("n45"));
  14871. this.boxBtn = (this.getChild("boxBtn"));
  14872. }
  14873. }
  14874. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14875. class ui_UITurntable_com1 extends fgui.GButton {
  14876. static createInstance() {
  14877. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14878. }
  14879. onConstruct() {
  14880. this.n41 = (this.getChild("n41"));
  14881. this.n42 = (this.getChild("n42"));
  14882. this.t0 = this.getTransition("t0");
  14883. }
  14884. }
  14885. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14886. class ui_UITurntable_com3 extends fgui.GComponent {
  14887. static createInstance() {
  14888. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14889. }
  14890. onConstruct() {
  14891. this.n48 = (this.getChild("n48"));
  14892. this.womanTxt = (this.getChild("womanTxt"));
  14893. this.t0 = this.getTransition("t0");
  14894. }
  14895. }
  14896. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14897. class ui_cancelBtn2 extends fgui.GButton {
  14898. static createInstance() {
  14899. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14900. }
  14901. onConstruct() {
  14902. this.c1 = this.getController("c1");
  14903. this.n0 = (this.getChild("n0"));
  14904. this.n1 = (this.getChild("n1"));
  14905. this.n2 = (this.getChild("n2"));
  14906. this.n3 = (this.getChild("n3"));
  14907. this.n4 = (this.getChild("n4"));
  14908. this.n5 = (this.getChild("n5"));
  14909. this.n6 = (this.getChild("n6"));
  14910. this.n7 = (this.getChild("n7"));
  14911. this.n8 = (this.getChild("n8"));
  14912. this.powerEft = (this.getChild("powerEft"));
  14913. }
  14914. }
  14915. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14916. class ui_shareBtn2 extends fgui.GButton {
  14917. static createInstance() {
  14918. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14919. }
  14920. onConstruct() {
  14921. this.c1 = this.getController("c1");
  14922. this.n2 = (this.getChild("n2"));
  14923. this.n24 = (this.getChild("n24"));
  14924. this.n1 = (this.getChild("n1"));
  14925. this.n3 = (this.getChild("n3"));
  14926. this.n23 = (this.getChild("n23"));
  14927. this.n4 = (this.getChild("n4"));
  14928. this.n5 = (this.getChild("n5"));
  14929. this.n6 = (this.getChild("n6"));
  14930. this.n20 = (this.getChild("n20"));
  14931. this.n21 = (this.getChild("n21"));
  14932. this.n22 = (this.getChild("n22"));
  14933. this.powerEft = (this.getChild("powerEft"));
  14934. }
  14935. }
  14936. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14937. class ui_UIMoney extends fgui.GComponent {
  14938. static createInstance() {
  14939. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14940. }
  14941. onConstruct() {
  14942. this.c1 = this.getController("c1");
  14943. this.n4 = (this.getChild("n4"));
  14944. this.coinImg = (this.getChild("coinImg"));
  14945. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14946. this.coinTxt = (this.getChild("coinTxt"));
  14947. this.n7 = (this.getChild("n7"));
  14948. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14949. this.diamondTxt = (this.getChild("diamondTxt"));
  14950. this.diamondImg = (this.getChild("diamondImg"));
  14951. this.n12 = (this.getChild("n12"));
  14952. this.powerImg = (this.getChild("powerImg"));
  14953. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14954. this.powerTxt = (this.getChild("powerTxt"));
  14955. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14956. }
  14957. }
  14958. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14959. class ui_backBtn extends fgui.GButton {
  14960. static createInstance() {
  14961. return (fgui.UIPackage.createObject("game", "backBtn"));
  14962. }
  14963. onConstruct() {
  14964. this.n0 = (this.getChild("n0"));
  14965. this.t0 = this.getTransition("t0");
  14966. this.t1 = this.getTransition("t1");
  14967. }
  14968. }
  14969. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14970. class ui_MoneyBtn extends fgui.GButton {
  14971. static createInstance() {
  14972. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14973. }
  14974. onConstruct() {
  14975. this.button = this.getController("button");
  14976. this.n0 = (this.getChild("n0"));
  14977. }
  14978. }
  14979. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14980. class ui_UIMoneyBtn extends fgui.GComponent {
  14981. static createInstance() {
  14982. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14983. }
  14984. onConstruct() {
  14985. this.n1 = (this.getChild("n1"));
  14986. this.closeBtn = (this.getChild("closeBtn"));
  14987. }
  14988. }
  14989. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14990. class ui_Component64 extends fgui.GComponent {
  14991. static createInstance() {
  14992. return (fgui.UIPackage.createObject("game", "Component64"));
  14993. }
  14994. onConstruct() {
  14995. this.n57 = (this.getChild("n57"));
  14996. this.n54 = (this.getChild("n54"));
  14997. this.n55 = (this.getChild("n55"));
  14998. this.n56 = (this.getChild("n56"));
  14999. this.t1 = this.getTransition("t1");
  15000. }
  15001. }
  15002. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15003. class ui_Component41_3 extends fgui.GComponent {
  15004. static createInstance() {
  15005. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15006. }
  15007. onConstruct() {
  15008. this.c1 = this.getController("c1");
  15009. this.n0 = (this.getChild("n0"));
  15010. this.n2 = (this.getChild("n2"));
  15011. this.cancelBtn = (this.getChild("cancelBtn"));
  15012. this.videoBtn = (this.getChild("videoBtn"));
  15013. this.n9 = (this.getChild("n9"));
  15014. this.n24 = (this.getChild("n24"));
  15015. this.n27 = (this.getChild("n27"));
  15016. this.titleTxt = (this.getChild("titleTxt"));
  15017. this.n28 = (this.getChild("n28"));
  15018. this.t0 = this.getTransition("t0");
  15019. }
  15020. }
  15021. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15022. class ui_dh_zs_4 extends fgui.GComponent {
  15023. static createInstance() {
  15024. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15025. }
  15026. onConstruct() {
  15027. this.n1 = (this.getChild("n1"));
  15028. this.n2 = (this.getChild("n2"));
  15029. this.n3 = (this.getChild("n3"));
  15030. this.n4 = (this.getChild("n4"));
  15031. this.n5 = (this.getChild("n5"));
  15032. this.n6 = (this.getChild("n6"));
  15033. this.n8 = (this.getChild("n8"));
  15034. this.t0 = this.getTransition("t0");
  15035. }
  15036. }
  15037. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15038. class ui_Component71_1 extends fgui.GButton {
  15039. static createInstance() {
  15040. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15041. }
  15042. onConstruct() {
  15043. this.n17 = (this.getChild("n17"));
  15044. this.t0 = this.getTransition("t0");
  15045. }
  15046. }
  15047. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15048. class ui_Component83 extends fgui.GComponent {
  15049. static createInstance() {
  15050. return (fgui.UIPackage.createObject("game", "Component83"));
  15051. }
  15052. onConstruct() {
  15053. this.c1 = this.getController("c1");
  15054. this.n17 = (this.getChild("n17"));
  15055. this.n19 = (this.getChild("n19"));
  15056. this.n20 = (this.getChild("n20"));
  15057. }
  15058. }
  15059. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15060. class ui_Component84 extends fgui.GComponent {
  15061. static createInstance() {
  15062. return (fgui.UIPackage.createObject("game", "Component84"));
  15063. }
  15064. onConstruct() {
  15065. this.c1 = this.getController("c1");
  15066. this.n4 = (this.getChild("n4"));
  15067. this.n22 = (this.getChild("n22"));
  15068. this.n23 = (this.getChild("n23"));
  15069. this.numTxt = (this.getChild("numTxt"));
  15070. this.n25 = (this.getChild("n25"));
  15071. this.n26 = (this.getChild("n26"));
  15072. }
  15073. }
  15074. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15075. class ui_Component84_1 extends fgui.GComponent {
  15076. static createInstance() {
  15077. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15078. }
  15079. onConstruct() {
  15080. this.c1 = this.getController("c1");
  15081. this.n4 = (this.getChild("n4"));
  15082. this.n22 = (this.getChild("n22"));
  15083. this.n23 = (this.getChild("n23"));
  15084. this.numTxt = (this.getChild("numTxt"));
  15085. this.n25 = (this.getChild("n25"));
  15086. this.n26 = (this.getChild("n26"));
  15087. }
  15088. }
  15089. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15090. class ui_Component85 extends fgui.GComponent {
  15091. static createInstance() {
  15092. return (fgui.UIPackage.createObject("game", "Component85"));
  15093. }
  15094. onConstruct() {
  15095. this.n1 = (this.getChild("n1"));
  15096. this.n6 = (this.getChild("n6"));
  15097. this.n2 = (this.getChild("n2"));
  15098. this.n3 = (this.getChild("n3"));
  15099. this.levelTxt = (this.getChild("levelTxt"));
  15100. this.n10 = (this.getChild("n10"));
  15101. this.n11 = (this.getChild("n11"));
  15102. this.n12 = (this.getChild("n12"));
  15103. this.n13 = (this.getChild("n13"));
  15104. this.n14 = (this.getChild("n14"));
  15105. this.modeNode = (this.getChild("modeNode"));
  15106. this.n18 = (this.getChild("n18"));
  15107. this.conditionTxt = (this.getChild("conditionTxt"));
  15108. this.diamondNode = (this.getChild("diamondNode"));
  15109. this.coinNode = (this.getChild("coinNode"));
  15110. this.startBtn = (this.getChild("startBtn"));
  15111. this.n28 = (this.getChild("n28"));
  15112. this.displayRoot = (this.getChild("displayRoot"));
  15113. this.t0 = this.getTransition("t0");
  15114. }
  15115. }
  15116. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15117. class ui_Component86 extends fgui.GButton {
  15118. static createInstance() {
  15119. return (fgui.UIPackage.createObject("game", "Component86"));
  15120. }
  15121. onConstruct() {
  15122. this.n15 = (this.getChild("n15"));
  15123. this.t0 = this.getTransition("t0");
  15124. }
  15125. }
  15126. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15127. class ui_Component87 extends fgui.GComponent {
  15128. static createInstance() {
  15129. return (fgui.UIPackage.createObject("game", "Component87"));
  15130. }
  15131. onConstruct() {
  15132. this.n66 = (this.getChild("n66"));
  15133. this.myProgress = (this.getChild("myProgress"));
  15134. this.starAni = (this.getChild("starAni"));
  15135. this.hpTxt = (this.getChild("hpTxt"));
  15136. this.n74 = (this.getChild("n74"));
  15137. this.n73 = (this.getChild("n73"));
  15138. this.ballTxt = (this.getChild("ballTxt"));
  15139. this.n76 = (this.getChild("n76"));
  15140. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15141. this.levelTxt = (this.getChild("levelTxt"));
  15142. this.star1 = (this.getChild("star1"));
  15143. this.star2 = (this.getChild("star2"));
  15144. this.star3 = (this.getChild("star3"));
  15145. }
  15146. }
  15147. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15148. class ui_Component88 extends fgui.GProgressBar {
  15149. static createInstance() {
  15150. return (fgui.UIPackage.createObject("game", "Component88"));
  15151. }
  15152. onConstruct() {
  15153. this.n68 = (this.getChild("n68"));
  15154. this.bar = (this.getChild("bar"));
  15155. }
  15156. }
  15157. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15158. class ui_Component89 extends fgui.GComponent {
  15159. static createInstance() {
  15160. return (fgui.UIPackage.createObject("game", "Component89"));
  15161. }
  15162. onConstruct() {
  15163. this.c1 = this.getController("c1");
  15164. this.n71 = (this.getChild("n71"));
  15165. this.n72 = (this.getChild("n72"));
  15166. }
  15167. }
  15168. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15169. class ui_Component90 extends fgui.GComponent {
  15170. static createInstance() {
  15171. return (fgui.UIPackage.createObject("game", "Component90"));
  15172. }
  15173. onConstruct() {
  15174. this.c1 = this.getController("c1");
  15175. this.n64 = (this.getChild("n64"));
  15176. this.n65 = (this.getChild("n65"));
  15177. this.n66 = (this.getChild("n66"));
  15178. this.t0 = this.getTransition("t0");
  15179. }
  15180. }
  15181. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15182. class ui_Component127 extends fgui.GButton {
  15183. static createInstance() {
  15184. return (fgui.UIPackage.createObject("game", "Component127"));
  15185. }
  15186. onConstruct() {
  15187. this.n5 = (this.getChild("n5"));
  15188. }
  15189. }
  15190. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15191. class gameBinder {
  15192. static bindAll() {
  15193. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15194. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15195. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15196. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15197. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15198. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15199. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15200. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15201. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15202. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15203. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15204. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15205. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15206. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15207. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15208. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15209. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15210. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15211. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15212. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15213. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15214. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15215. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15216. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15217. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15218. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15219. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15220. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15221. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15222. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15223. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15224. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15225. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15226. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15227. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15228. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15229. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15230. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15231. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15232. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15233. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15234. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15235. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15236. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15237. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15238. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15239. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15240. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15241. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15242. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15243. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15244. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15245. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15246. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15247. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15248. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15249. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15250. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15251. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15252. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15253. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15254. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15255. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15256. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15257. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15258. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15259. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15260. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15261. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15262. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15263. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15264. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15265. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15266. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15267. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15268. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15269. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15270. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15271. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15272. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15273. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15274. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15275. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15276. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15277. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15278. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15279. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15280. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15281. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15282. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15283. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15284. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15285. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15286. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15287. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15288. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15289. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15290. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15291. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15292. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15293. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15294. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15295. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15296. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15297. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15298. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15299. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15300. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15301. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15302. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15303. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15304. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15305. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15306. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15307. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15308. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15309. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15310. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15311. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15312. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15313. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15314. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15315. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15316. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15317. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15318. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15319. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15320. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15321. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15322. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15323. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15324. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15325. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15326. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15327. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15328. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15329. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15330. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15331. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15332. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15333. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15334. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15335. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15336. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15337. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15338. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15339. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15340. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15341. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15342. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15343. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15344. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15345. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15346. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15347. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15348. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15349. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15350. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15351. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15352. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15353. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15354. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15355. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15356. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15357. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15358. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15359. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15360. fgui.UIObjectFactory.setExtension(ui_Component_daoju.URL, ui_Component_daoju);
  15361. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  15362. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  15363. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  15364. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  15365. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  15366. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  15367. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  15368. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  15369. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  15370. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  15371. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  15372. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  15373. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  15374. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  15375. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  15376. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  15377. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  15378. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  15379. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  15380. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  15381. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  15382. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  15383. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  15384. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  15385. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  15386. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  15387. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  15388. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  15389. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  15390. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  15391. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15392. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15393. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15394. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15395. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15396. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15397. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15398. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15399. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15400. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15401. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15402. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15403. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15404. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15405. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15406. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15407. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15408. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15409. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15410. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15411. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15412. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15413. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15414. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15415. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15416. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15417. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15418. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15419. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15420. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15421. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15422. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15423. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15424. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15425. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15426. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15427. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15428. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15429. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15430. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15431. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15432. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15433. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15434. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15435. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15436. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15437. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15438. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15439. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15440. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15441. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15442. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15443. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15444. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15445. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15446. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15447. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15448. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15449. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15450. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15451. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15452. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15453. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15454. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15455. }
  15456. }
  15457. class ui_btn6 extends fgui.GButton {
  15458. static createInstance() {
  15459. return (fgui.UIPackage.createObject("loading", "btn6"));
  15460. }
  15461. onConstruct() {
  15462. this.n6 = (this.getChild("n6"));
  15463. this.n1 = (this.getChild("n1"));
  15464. }
  15465. }
  15466. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15467. class ui_xyItem extends fgui.GComponent {
  15468. static createInstance() {
  15469. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15470. }
  15471. onConstruct() {
  15472. this.xyItem = (this.getChild("xyItem"));
  15473. }
  15474. }
  15475. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15476. class ui_loadinfo extends fgui.GProgressBar {
  15477. static createInstance() {
  15478. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15479. }
  15480. onConstruct() {
  15481. this.bg = (this.getChild("bg"));
  15482. this.bar = (this.getChild("bar"));
  15483. this.title = (this.getChild("title"));
  15484. this.ani = (this.getChild("ani"));
  15485. }
  15486. }
  15487. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15488. class ui_xyNode extends fgui.GComponent {
  15489. static createInstance() {
  15490. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15491. }
  15492. onConstruct() {
  15493. this.n0 = (this.getChild("n0"));
  15494. this.btnYes = (this.getChild("btnYes"));
  15495. this.btnNo = (this.getChild("btnNo"));
  15496. this.btnKnown = (this.getChild("btnKnown"));
  15497. this.btnSure = (this.getChild("btnSure"));
  15498. this.txtWelcom = (this.getChild("txtWelcom"));
  15499. this.txtXy = (this.getChild("txtXy"));
  15500. this.n75 = (this.getChild("n75"));
  15501. this.btnXy1 = (this.getChild("btnXy1"));
  15502. this.btnXy3 = (this.getChild("btnXy3"));
  15503. this.btnXy2 = (this.getChild("btnXy2"));
  15504. this.n74 = (this.getChild("n74"));
  15505. this.xy1 = (this.getChild("xy1"));
  15506. this.txtTitle = (this.getChild("txtTitle"));
  15507. this.btnBack = (this.getChild("btnBack"));
  15508. this.xyList = (this.getChild("xyList"));
  15509. this.xy2 = (this.getChild("xy2"));
  15510. this.xyNode = (this.getChild("xyNode"));
  15511. }
  15512. }
  15513. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15514. class ui_ageNode extends fgui.GComponent {
  15515. static createInstance() {
  15516. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15517. }
  15518. onConstruct() {
  15519. this.n3 = (this.getChild("n3"));
  15520. this.n7 = (this.getChild("n7"));
  15521. this.n4 = (this.getChild("n4"));
  15522. this.btnAge = (this.getChild("btnAge"));
  15523. this.ageNode = (this.getChild("ageNode"));
  15524. }
  15525. }
  15526. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15527. class ui_rnNode extends fgui.GComponent {
  15528. static createInstance() {
  15529. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15530. }
  15531. onConstruct() {
  15532. this.n28 = (this.getChild("n28"));
  15533. this.n30 = (this.getChild("n30"));
  15534. this.n33 = (this.getChild("n33"));
  15535. this.rn1 = (this.getChild("rn1"));
  15536. this.n40 = (this.getChild("n40"));
  15537. this.n41 = (this.getChild("n41"));
  15538. this.rn3 = (this.getChild("rn3"));
  15539. this.n37 = (this.getChild("n37"));
  15540. this.n39 = (this.getChild("n39"));
  15541. this.rn2 = (this.getChild("rn2"));
  15542. this.n47 = (this.getChild("n47"));
  15543. this.n49 = (this.getChild("n49"));
  15544. this.n44 = (this.getChild("n44"));
  15545. this.inputCode = (this.getChild("inputCode"));
  15546. this.inputName = (this.getChild("inputName"));
  15547. this.n48 = (this.getChild("n48"));
  15548. this.n50 = (this.getChild("n50"));
  15549. this.rn4 = (this.getChild("rn4"));
  15550. this.btnCheck = (this.getChild("btnCheck"));
  15551. this.btnExit = (this.getChild("btnExit"));
  15552. this.btnDone = (this.getChild("btnDone"));
  15553. this.rnNode = (this.getChild("rnNode"));
  15554. }
  15555. }
  15556. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15557. class ui_tipNode extends fgui.GComponent {
  15558. static createInstance() {
  15559. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15560. }
  15561. onConstruct() {
  15562. this.bg = (this.getChild("bg"));
  15563. this.n55 = (this.getChild("n55"));
  15564. this.n56 = (this.getChild("n56"));
  15565. this.tipNode = (this.getChild("tipNode"));
  15566. }
  15567. }
  15568. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15569. class ui_fcmNode extends fgui.GComponent {
  15570. static createInstance() {
  15571. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15572. }
  15573. onConstruct() {
  15574. this.n63 = (this.getChild("n63"));
  15575. this.n62 = (this.getChild("n62"));
  15576. this.btnRn = (this.getChild("btnRn"));
  15577. this.n61 = (this.getChild("n61"));
  15578. this.n58 = (this.getChild("n58"));
  15579. this.fcmNode = (this.getChild("fcmNode"));
  15580. }
  15581. }
  15582. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15583. class ui_msgNode extends fgui.GComponent {
  15584. static createInstance() {
  15585. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15586. }
  15587. onConstruct() {
  15588. this.n69 = (this.getChild("n69"));
  15589. this.txtMsg = (this.getChild("txtMsg"));
  15590. this.msgNode = (this.getChild("msgNode"));
  15591. }
  15592. }
  15593. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15594. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15595. static createInstance() {
  15596. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15597. }
  15598. onConstruct() {
  15599. this.n1 = (this.getChild("n1"));
  15600. this.n13 = (this.getChild("n13"));
  15601. this.n14 = (this.getChild("n14"));
  15602. this.n15 = (this.getChild("n15"));
  15603. this.n3 = (this.getChild("n3"));
  15604. this.n4 = (this.getChild("n4"));
  15605. this.n5 = (this.getChild("n5"));
  15606. this.n6 = (this.getChild("n6"));
  15607. this.n7 = (this.getChild("n7"));
  15608. this.n8 = (this.getChild("n8"));
  15609. this.n9 = (this.getChild("n9"));
  15610. this.n10 = (this.getChild("n10"));
  15611. this.n12 = (this.getChild("n12"));
  15612. this.n11 = (this.getChild("n11"));
  15613. this.n16 = (this.getChild("n16"));
  15614. this.n17 = (this.getChild("n17"));
  15615. this.n18 = (this.getChild("n18"));
  15616. this.n20 = (this.getChild("n20"));
  15617. this.n21 = (this.getChild("n21"));
  15618. this.t0 = this.getTransition("t0");
  15619. }
  15620. }
  15621. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15622. class ui_btn5 extends fgui.GButton {
  15623. static createInstance() {
  15624. return (fgui.UIPackage.createObject("loading", "btn5"));
  15625. }
  15626. onConstruct() {
  15627. this.n9 = (this.getChild("n9"));
  15628. this.n1 = (this.getChild("n1"));
  15629. }
  15630. }
  15631. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15632. class ui_UILoading extends fgui.GComponent {
  15633. static createInstance() {
  15634. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15635. }
  15636. onConstruct() {
  15637. this.n12 = (this.getChild("n12"));
  15638. this.loadinfo = (this.getChild("loadinfo"));
  15639. this.n13 = (this.getChild("n13"));
  15640. this.txtLoad = (this.getChild("txtLoad"));
  15641. this.n18 = (this.getChild("n18"));
  15642. }
  15643. }
  15644. ui_UILoading.URL = "ui://37nctnhwphc33";
  15645. class ui_AgeItem extends fgui.GComponent {
  15646. static createInstance() {
  15647. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15648. }
  15649. onConstruct() {
  15650. this.txtAge = (this.getChild("txtAge"));
  15651. }
  15652. }
  15653. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15654. class ui_btn1 extends fgui.GButton {
  15655. static createInstance() {
  15656. return (fgui.UIPackage.createObject("loading", "btn1"));
  15657. }
  15658. onConstruct() {
  15659. this.n6 = (this.getChild("n6"));
  15660. this.n1 = (this.getChild("n1"));
  15661. }
  15662. }
  15663. ui_btn1.URL = "ui://37nctnhwxe622p";
  15664. class ui_btn3 extends fgui.GButton {
  15665. static createInstance() {
  15666. return (fgui.UIPackage.createObject("loading", "btn3"));
  15667. }
  15668. onConstruct() {
  15669. this.n9 = (this.getChild("n9"));
  15670. this.n1 = (this.getChild("n1"));
  15671. }
  15672. }
  15673. ui_btn3.URL = "ui://37nctnhwxe622s";
  15674. class ui_btn2 extends fgui.GButton {
  15675. static createInstance() {
  15676. return (fgui.UIPackage.createObject("loading", "btn2"));
  15677. }
  15678. onConstruct() {
  15679. this.n6 = (this.getChild("n6"));
  15680. this.n1 = (this.getChild("n1"));
  15681. }
  15682. }
  15683. ui_btn2.URL = "ui://37nctnhwxe622t";
  15684. class ui_btnBack extends fgui.GButton {
  15685. static createInstance() {
  15686. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15687. }
  15688. onConstruct() {
  15689. this.n6 = (this.getChild("n6"));
  15690. this.n7 = (this.getChild("n7"));
  15691. }
  15692. }
  15693. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15694. class ui_btnXy1 extends fgui.GButton {
  15695. static createInstance() {
  15696. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15697. }
  15698. onConstruct() {
  15699. this.n1 = (this.getChild("n1"));
  15700. }
  15701. }
  15702. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15703. class ui_btnXy2 extends fgui.GButton {
  15704. static createInstance() {
  15705. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15706. }
  15707. onConstruct() {
  15708. this.n1 = (this.getChild("n1"));
  15709. }
  15710. }
  15711. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15712. class ui_btnXy3 extends fgui.GButton {
  15713. static createInstance() {
  15714. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15715. }
  15716. onConstruct() {
  15717. this.n1 = (this.getChild("n1"));
  15718. }
  15719. }
  15720. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15721. class ui_btn4 extends fgui.GButton {
  15722. static createInstance() {
  15723. return (fgui.UIPackage.createObject("loading", "btn4"));
  15724. }
  15725. onConstruct() {
  15726. this.n9 = (this.getChild("n9"));
  15727. this.n1 = (this.getChild("n1"));
  15728. }
  15729. }
  15730. ui_btn4.URL = "ui://37nctnhwxe622z";
  15731. class loadingBinder {
  15732. static bindAll() {
  15733. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15734. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15735. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15736. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15737. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15738. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15739. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15740. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15741. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15742. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15743. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15744. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15745. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15746. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15747. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15748. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15749. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15750. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15751. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15752. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15753. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15754. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15755. }
  15756. }
  15757. class UIMgr {
  15758. constructor() {
  15759. this._stage = null;
  15760. this._uiList = [];
  15761. this._showList = [];
  15762. this._bindPkgList = [];
  15763. this.uiIndex = 0;
  15764. }
  15765. static get inst() {
  15766. if (UIMgr._inst == null) {
  15767. UIMgr._inst = new UIMgr();
  15768. }
  15769. return UIMgr._inst;
  15770. }
  15771. setStage(s) {
  15772. if (this._stage) {
  15773. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15774. return;
  15775. }
  15776. this._stage = s;
  15777. }
  15778. clearTempData() {
  15779. console.log('zh:clearTempData start');
  15780. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15781. console.log('zh:clearTempData end');
  15782. }
  15783. init() {
  15784. this.setStage(Laya.stage);
  15785. fairygui.UIConfig.defaultFont = "微软雅黑";
  15786. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15787. fairygui.UIConfig.packageFileExtension = "obj";
  15788. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15789. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15790. fairygui.GRoot.inst.width = Laya.stage.width;
  15791. fairygui.GRoot.inst.height = Laya.stage.height;
  15792. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15793. }
  15794. addAllUpdate() {
  15795. this.uiIndex = 0;
  15796. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15797. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15798. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15799. }
  15800. }
  15801. }
  15802. bindFUI(pkgname) {
  15803. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15804. return;
  15805. }
  15806. switch (pkgname) {
  15807. case fguiRes.loading:
  15808. fairygui.UIPackage.addPackage(pkgname);
  15809. loadingBinder.bindAll();
  15810. this._bindPkgList.push(pkgname);
  15811. break;
  15812. case fguiRes.game:
  15813. fairygui.UIPackage.addPackage(pkgname);
  15814. gameBinder.bindAll();
  15815. this._bindPkgList.push(pkgname);
  15816. break;
  15817. default:
  15818. break;
  15819. }
  15820. }
  15821. Show(cls, ...param) {
  15822. let nameStr = cls.uiName;
  15823. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15824. let temp = this._uiList[i];
  15825. let str = temp.className;
  15826. if (str == nameStr) {
  15827. if (temp.isMuti) {
  15828. if (temp.isHide) {
  15829. temp.show(...param);
  15830. this._uiList.splice(i, 1);
  15831. this._uiList.push(temp);
  15832. return temp;
  15833. }
  15834. }
  15835. else {
  15836. temp.show(...param);
  15837. this._uiList.splice(i, 1);
  15838. this._uiList.push(temp);
  15839. return temp;
  15840. }
  15841. }
  15842. }
  15843. let ui = new cls();
  15844. ui.className = nameStr;
  15845. this._showUI(ui, param);
  15846. return ui;
  15847. }
  15848. destroyUI(ui) {
  15849. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15850. let temp = this._uiList[i].className;
  15851. if (temp == ui.className) {
  15852. this._uiList.splice(i, 1);
  15853. break;
  15854. }
  15855. }
  15856. this.checkUIState();
  15857. }
  15858. _showUI(ui, param) {
  15859. this._uiList.push(ui);
  15860. ui.show(...param);
  15861. }
  15862. Hide(uiClass) {
  15863. let ui = this.getUI(uiClass);
  15864. if (ui && !ui.isHide) {
  15865. ui.hide();
  15866. }
  15867. }
  15868. getUI(ui) {
  15869. let nameStr = ui.uiName;
  15870. for (let index = 0; index < this._uiList.length; index++) {
  15871. let temp = this._uiList[index];
  15872. if (temp.className == nameStr) {
  15873. return temp;
  15874. }
  15875. }
  15876. return null;
  15877. }
  15878. isShow(cls) {
  15879. for (var i of this._uiList) {
  15880. if (i instanceof cls) {
  15881. return i.isShowing;
  15882. }
  15883. }
  15884. return false;
  15885. }
  15886. showUINum() {
  15887. let num = 0;
  15888. for (var i of this._uiList) {
  15889. if (i.isShowing) {
  15890. num++;
  15891. }
  15892. }
  15893. return num;
  15894. }
  15895. checkUIState() {
  15896. Laya.timer.clear(this, this._uiCheck);
  15897. Laya.timer.once(400, this, this._uiCheck);
  15898. }
  15899. _uiCheck() {
  15900. let showList = [];
  15901. for (var i of this._uiList) {
  15902. if (!i.isHide) {
  15903. showList.push(i);
  15904. }
  15905. }
  15906. for (let index = 0; index < showList.length; index++) {
  15907. if (index == showList.length - 1) {
  15908. showList[index].checkActive(true);
  15909. }
  15910. else {
  15911. showList[index].checkActive(false);
  15912. }
  15913. }
  15914. }
  15915. showTip(msg, time = 600, size = 30) {
  15916. }
  15917. }
  15918. class UIShowList {
  15919. }
  15920. class SoundMgr {
  15921. constructor() {
  15922. this.soundMax = 4;
  15923. this.isLoad = false;
  15924. this.soundMap = {};
  15925. this.isSound = true;
  15926. this.openShake = true;
  15927. SoundMgr._instance = this;
  15928. }
  15929. static getInstance() {
  15930. if (!this._instance) {
  15931. this._instance = new SoundMgr();
  15932. }
  15933. return this._instance;
  15934. }
  15935. init() {
  15936. console.log('zh:sm init 1');
  15937. Laya.SoundManager.autoReleaseSound = true;
  15938. Laya.SoundManager.autoStopMusic = true;
  15939. Laya.SoundManager.musicVolume = 0.3;
  15940. Laya.SoundManager.soundVolume = 0.5;
  15941. this.musicPlayed = false;
  15942. this.audioUrl = "asset/sound/ogg/";
  15943. console.log('zh:sm init 2');
  15944. console.log('zh:dev type ');
  15945. if (Laya.Browser.onAndroid) {
  15946. console.log('zh:dev type android');
  15947. this.audioUrl = "asset/sound/ogg/";
  15948. this.isLoad = true;
  15949. }
  15950. else {
  15951. console.log('zh:dev type not android');
  15952. this.audioUrl = "asset/sound/mp3/";
  15953. this.isLoad = true;
  15954. }
  15955. }
  15956. onSetting(isS) {
  15957. this.isSound = isS;
  15958. this.mute(!this.isSound);
  15959. }
  15960. clearCount() {
  15961. for (var key in this.soundMap) {
  15962. delete this.soundMap[key];
  15963. }
  15964. }
  15965. playMusic(path, loop = 0) {
  15966. console.log('zh:playMusic 1 PATH=' + path);
  15967. this.musicPath = path;
  15968. if (!this.isLoad) {
  15969. return;
  15970. }
  15971. if (!path || path == "") {
  15972. return;
  15973. }
  15974. if (!this.isSound) {
  15975. return;
  15976. }
  15977. this.musicPlayed = true;
  15978. let url = this.getUrl(path);
  15979. if (!Laya.Browser.onAndroid) {
  15980. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15981. this.play(url, loop);
  15982. }));
  15983. }
  15984. else {
  15985. this.play(url, loop);
  15986. }
  15987. }
  15988. play(url, loop) {
  15989. Laya.SoundManager.playMusic(url, loop);
  15990. }
  15991. getUrl(path) {
  15992. let url = this.audioUrl + path;
  15993. if (Laya.Browser.onAndroid) {
  15994. url += ".ogg";
  15995. }
  15996. else {
  15997. url += ".mp3";
  15998. }
  15999. return url;
  16000. }
  16001. pauseMusic(pause) {
  16002. if (pause) {
  16003. this.mute(true);
  16004. }
  16005. else if (this.isSound)
  16006. this.mute(false);
  16007. }
  16008. stopMusic() {
  16009. Laya.SoundManager.stopMusic();
  16010. if (Moyu.isNeedPlatAudio) {
  16011. Moyu.stopMusic();
  16012. }
  16013. }
  16014. mute(mute) {
  16015. if (Moyu.isNeedPlatAudio) {
  16016. Moyu.pauseMusic(mute);
  16017. }
  16018. else {
  16019. Laya.SoundManager.musicMuted = mute;
  16020. if (!mute && !this.musicPlayed && this.musicPath) {
  16021. this.playMusic(this.musicPath);
  16022. }
  16023. }
  16024. }
  16025. stopSound(path) {
  16026. let url = this.getUrl(path);
  16027. Laya.SoundManager.stopSound(url);
  16028. }
  16029. playSound(path, loop = 1, soundMax = this.soundMax) {
  16030. if (!this.isLoad)
  16031. return;
  16032. if (!this.isSound)
  16033. return;
  16034. if (!path || path == "")
  16035. return;
  16036. let url = this.getUrl(path);
  16037. if (Moyu.isNeedPlatAudio) {
  16038. Moyu.playSound(path, loop == 0);
  16039. }
  16040. else {
  16041. let count = 1;
  16042. if (this.soundMap[path])
  16043. count = this.soundMap[path] + 1;
  16044. if (count > soundMax)
  16045. return;
  16046. this.soundMap[path] = count;
  16047. Laya.SoundManager.playSound(url, loop);
  16048. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16049. }
  16050. }
  16051. removePath(path) {
  16052. if (this.soundMap[path]) {
  16053. let count = this.soundMap[path];
  16054. count--;
  16055. if (count < 1)
  16056. delete this.soundMap[path];
  16057. else
  16058. this.soundMap[path] = count;
  16059. }
  16060. }
  16061. playBtnSound() {
  16062. this.playSound("btn");
  16063. }
  16064. playGetSound() {
  16065. }
  16066. playCloseUISound() {
  16067. }
  16068. }
  16069. SoundMgr._instance = null;
  16070. var Handler$1 = Laya.Handler;
  16071. var EResType;
  16072. (function (EResType) {
  16073. EResType[EResType["none"] = 0] = "none";
  16074. EResType[EResType["nromal"] = 1] = "nromal";
  16075. EResType[EResType["td"] = 2] = "td";
  16076. EResType[EResType["sk"] = 3] = "sk";
  16077. })(EResType || (EResType = {}));
  16078. class CResLoader {
  16079. constructor(doneCall, proCall) {
  16080. this.completrCall = doneCall;
  16081. this.progressCall = proCall;
  16082. this.progressHander = new Handler$1(this, this.onProgress);
  16083. this.tdResMap = {};
  16084. }
  16085. load(resList) {
  16086. this.resCount = 0;
  16087. this.loadCount = 0;
  16088. for (let i = 0; i < resList.length; i++) {
  16089. let path = resList[i];
  16090. if (!path)
  16091. continue;
  16092. this.resCount++;
  16093. let type = this.getResType(path);
  16094. if (type == EResType.nromal)
  16095. this.loadNromal(path);
  16096. else if (type == EResType.td)
  16097. this.loadTd(path);
  16098. }
  16099. }
  16100. getRes(path) {
  16101. let type = this.getResType(path);
  16102. if (type == EResType.nromal)
  16103. return Laya.loader.getRes(path);
  16104. else if (type == EResType.td) {
  16105. let res = this.tdResMap[path];
  16106. if (res)
  16107. return res.clone();
  16108. return null;
  16109. }
  16110. }
  16111. destroy() {
  16112. this.progressHander.clear();
  16113. this.progressHander = null;
  16114. }
  16115. clearRes(path) {
  16116. let type = this.getResType(path);
  16117. if (type == EResType.nromal)
  16118. Laya.loader.clearRes(path);
  16119. else if (type == EResType.td) {
  16120. let obj = this.tdResMap[path];
  16121. if (obj)
  16122. obj.destroy();
  16123. delete this.tdResMap[path];
  16124. }
  16125. }
  16126. getResType(path) {
  16127. let exs = this.getExtension(path);
  16128. if (exs == "sk")
  16129. return EResType.sk;
  16130. if (exs == "ls" || exs == "lh" || exs == "lm")
  16131. return EResType.td;
  16132. else
  16133. return EResType.nromal;
  16134. }
  16135. getExtension(res) {
  16136. var index = res.lastIndexOf(".");
  16137. return res.substr(index + 1);
  16138. }
  16139. loadNromal(path) {
  16140. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16141. if (res) {
  16142. this.onLoad();
  16143. }
  16144. else
  16145. console.log("load res fail:" + path);
  16146. }), this.progressHander);
  16147. }
  16148. loadSk() {
  16149. }
  16150. loadTd(path) {
  16151. if (this.tdResMap[path]) {
  16152. this.onLoad();
  16153. return;
  16154. }
  16155. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16156. if (res) {
  16157. this.tdResMap[path] = res;
  16158. this.onLoad();
  16159. }
  16160. else
  16161. console.log("load res fail:" + path);
  16162. }));
  16163. }
  16164. onLoad() {
  16165. this.loadCount++;
  16166. this.onProgress(1);
  16167. if (this.loadCount >= this.resCount) {
  16168. this.completrCall.run();
  16169. }
  16170. }
  16171. onProgress(pro) {
  16172. let progress = (this.loadCount + pro) / this.resCount;
  16173. this.progressCall.runWith(progress);
  16174. }
  16175. }
  16176. var Handler$2 = Laya.Handler;
  16177. class ResInfo {
  16178. constructor() {
  16179. this.index = 0;
  16180. }
  16181. }
  16182. class ResMgr {
  16183. constructor() {
  16184. this.resList = [];
  16185. this.doneList = [];
  16186. this.resMap = {};
  16187. this.currentLoad = null;
  16188. this.completeHandler = new Handler$2(this, this.onComplete);
  16189. this.progressHandler = new Handler$2(this, this.onProgress);
  16190. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16191. }
  16192. static getInstance() {
  16193. if (ResMgr._instance == null) {
  16194. ResMgr._instance = new ResMgr();
  16195. }
  16196. return ResMgr._instance;
  16197. }
  16198. loadList(list, completeHandler, progressHandler) {
  16199. if (list.length < 1) {
  16200. completeHandler.run();
  16201. return;
  16202. }
  16203. let info = this.getResInfo();
  16204. info.resList = list;
  16205. info.completeHandler = completeHandler;
  16206. info.progressHandler = progressHandler;
  16207. this.resList.push(info);
  16208. this.startLoad();
  16209. }
  16210. loadFguiRes(list, completeHandler, progressHandler) {
  16211. Laya.loader.load(list, completeHandler, progressHandler);
  16212. }
  16213. loadAny(list, completeHandler, progressHandler) {
  16214. Laya.loader.load(list, completeHandler, progressHandler);
  16215. }
  16216. load(path, completeHandler, progressHandler) {
  16217. let count = this.resMap[path];
  16218. if (count && count > 0) {
  16219. if (completeHandler)
  16220. completeHandler.run();
  16221. }
  16222. else
  16223. this.loadList([path], completeHandler, progressHandler);
  16224. }
  16225. getRes(path) {
  16226. let res = this.resMap[path];
  16227. if (!res)
  16228. this.showLog("资源不存在:" + path);
  16229. else
  16230. return this.loader.getRes(path);
  16231. }
  16232. clearList(list, force = false) {
  16233. if (!list || list.length < 1)
  16234. return;
  16235. let cr = () => {
  16236. for (const k in list) {
  16237. let v = list[k];
  16238. if (!v)
  16239. continue;
  16240. if (force) {
  16241. this.loader.clearRes(v);
  16242. delete this.resMap[v];
  16243. }
  16244. else {
  16245. let count = this.resMap[v];
  16246. if (count && count > 1) {
  16247. count--;
  16248. this.resMap[v] = count;
  16249. }
  16250. else {
  16251. this.loader.clearRes(v);
  16252. delete this.resMap[v];
  16253. }
  16254. }
  16255. }
  16256. if (!window.hasOwnProperty("ks"))
  16257. Laya.Resource.destroyUnusedResources();
  16258. };
  16259. Laya.timer.clearAll(this);
  16260. Laya.timer.once(2000, this, cr);
  16261. }
  16262. clear3D() {
  16263. for (const k in this.loader.tdResMap) {
  16264. this.loader.clearRes(k);
  16265. if (this.resMap[k])
  16266. delete this.resMap[k];
  16267. }
  16268. if (!window.hasOwnProperty("ks"))
  16269. Laya.Resource.destroyUnusedResources();
  16270. }
  16271. clear(path, force = false) {
  16272. this.clearList([path], force);
  16273. }
  16274. getResInfo() {
  16275. if (this.doneList.length > 0)
  16276. return this.doneList.pop();
  16277. else
  16278. return new ResInfo();
  16279. }
  16280. startLoad() {
  16281. if (this.currentLoad)
  16282. return;
  16283. this.currentLoad = this.resList.pop();
  16284. if (this.currentLoad) {
  16285. this.loader.load(this.currentLoad.resList);
  16286. }
  16287. }
  16288. onComplete() {
  16289. if (!this.currentLoad)
  16290. return;
  16291. for (const k in this.currentLoad.resList) {
  16292. let v = this.currentLoad.resList[k];
  16293. let count = this.resMap[v];
  16294. if (count)
  16295. count++;
  16296. else
  16297. count = 1;
  16298. this.resMap[v] = count;
  16299. }
  16300. if (this.currentLoad.completeHandler)
  16301. this.currentLoad.completeHandler.run();
  16302. this.doneList.push(this.currentLoad);
  16303. this.currentLoad = null;
  16304. this.startLoad();
  16305. }
  16306. onProgress(pro) {
  16307. if (!this.currentLoad)
  16308. return;
  16309. if (this.currentLoad.progressHandler)
  16310. this.currentLoad.progressHandler.runWith(pro);
  16311. }
  16312. showLog(str, ...args) {
  16313. console.log("[ResLoader] " + str);
  16314. }
  16315. }
  16316. ResMgr._instance = null;
  16317. class EventMgr extends Laya.EventDispatcher {
  16318. }
  16319. let eventMgr = new EventMgr();
  16320. /*! *****************************************************************************
  16321. Copyright (c) Microsoft Corporation. All rights reserved.
  16322. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  16323. this file except in compliance with the License. You may obtain a copy of the
  16324. License at http://www.apache.org/licenses/LICENSE-2.0
  16325. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16326. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  16327. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  16328. MERCHANTABLITY OR NON-INFRINGEMENT.
  16329. See the Apache Version 2.0 License for specific language governing permissions
  16330. and limitations under the License.
  16331. ***************************************************************************** */
  16332. /* global Reflect, Promise */
  16333. var extendStatics = function(d, b) {
  16334. extendStatics = Object.setPrototypeOf ||
  16335. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16336. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16337. return extendStatics(d, b);
  16338. };
  16339. function __extends(d, b) {
  16340. extendStatics(d, b);
  16341. function __() { this.constructor = d; }
  16342. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16343. }
  16344. var __assign = function() {
  16345. __assign = Object.assign || function __assign(t) {
  16346. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16347. s = arguments[i];
  16348. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16349. }
  16350. return t;
  16351. };
  16352. return __assign.apply(this, arguments);
  16353. };
  16354. function __rest(s, e) {
  16355. var t = {};
  16356. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  16357. t[p] = s[p];
  16358. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  16359. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  16360. t[p[i]] = s[p[i]];
  16361. return t;
  16362. }
  16363. function __decorate(decorators, target, key, desc) {
  16364. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16365. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16366. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  16367. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16368. }
  16369. function __param(paramIndex, decorator) {
  16370. return function (target, key) { decorator(target, key, paramIndex); }
  16371. }
  16372. function __metadata(metadataKey, metadataValue) {
  16373. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  16374. }
  16375. function __awaiter(thisArg, _arguments, P, generator) {
  16376. return new (P || (P = Promise))(function (resolve, reject) {
  16377. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  16378. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  16379. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  16380. step((generator = generator.apply(thisArg, _arguments || [])).next());
  16381. });
  16382. }
  16383. function __generator(thisArg, body) {
  16384. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  16385. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  16386. function verb(n) { return function (v) { return step([n, v]); }; }
  16387. function step(op) {
  16388. if (f) throw new TypeError("Generator is already executing.");
  16389. while (_) try {
  16390. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  16391. if (y = 0, t) op = [op[0] & 2, t.value];
  16392. switch (op[0]) {
  16393. case 0: case 1: t = op; break;
  16394. case 4: _.label++; return { value: op[1], done: false };
  16395. case 5: _.label++; y = op[1]; op = [0]; continue;
  16396. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  16397. default:
  16398. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  16399. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  16400. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  16401. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  16402. if (t[2]) _.ops.pop();
  16403. _.trys.pop(); continue;
  16404. }
  16405. op = body.call(thisArg, _);
  16406. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  16407. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  16408. }
  16409. }
  16410. function __exportStar(m, exports) {
  16411. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  16412. }
  16413. function __values(o) {
  16414. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  16415. if (m) return m.call(o);
  16416. return {
  16417. next: function () {
  16418. if (o && i >= o.length) o = void 0;
  16419. return { value: o && o[i++], done: !o };
  16420. }
  16421. };
  16422. }
  16423. function __read(o, n) {
  16424. var m = typeof Symbol === "function" && o[Symbol.iterator];
  16425. if (!m) return o;
  16426. var i = m.call(o), r, ar = [], e;
  16427. try {
  16428. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  16429. }
  16430. catch (error) { e = { error: error }; }
  16431. finally {
  16432. try {
  16433. if (r && !r.done && (m = i["return"])) m.call(i);
  16434. }
  16435. finally { if (e) throw e.error; }
  16436. }
  16437. return ar;
  16438. }
  16439. function __spread() {
  16440. for (var ar = [], i = 0; i < arguments.length; i++)
  16441. ar = ar.concat(__read(arguments[i]));
  16442. return ar;
  16443. }
  16444. function __await(v) {
  16445. return this instanceof __await ? (this.v = v, this) : new __await(v);
  16446. }
  16447. function __asyncGenerator(thisArg, _arguments, generator) {
  16448. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16449. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  16450. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  16451. function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  16452. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  16453. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  16454. function fulfill(value) { resume("next", value); }
  16455. function reject(value) { resume("throw", value); }
  16456. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  16457. }
  16458. function __asyncDelegator(o) {
  16459. var i, p;
  16460. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  16461. function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
  16462. }
  16463. function __asyncValues(o) {
  16464. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16465. var m = o[Symbol.asyncIterator], i;
  16466. return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  16467. function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  16468. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  16469. }
  16470. function __makeTemplateObject(cooked, raw) {
  16471. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  16472. return cooked;
  16473. };
  16474. function __importStar(mod) {
  16475. if (mod && mod.__esModule) return mod;
  16476. var result = {};
  16477. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  16478. result.default = mod;
  16479. return result;
  16480. }
  16481. function __importDefault(mod) {
  16482. return (mod && mod.__esModule) ? mod : { default: mod };
  16483. }
  16484. class CustomAlert {
  16485. static show(title, content, buttons) {
  16486. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  16487. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  16488. return;
  16489. }
  16490. const bg = new Laya.Box();
  16491. bg.alpha = 0;
  16492. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  16493. Laya.stage.addChild(bg);
  16494. Laya.Tween.to(bg, { alpha: 1 }, 200);
  16495. const panel = new Laya.Box();
  16496. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  16497. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  16498. bg.addChild(panel);
  16499. const titleText = new Laya.Text();
  16500. titleText.text = title;
  16501. titleText.fontSize = 32;
  16502. titleText.color = "#333333";
  16503. titleText.bold = true;
  16504. titleText.pos(20, 20);
  16505. titleText.width = 360;
  16506. titleText.align = "center";
  16507. panel.addChild(titleText);
  16508. const contentText = new Laya.Text();
  16509. contentText.text = content;
  16510. contentText.fontSize = 21;
  16511. contentText.color = "#555555";
  16512. contentText.pos(20, 70);
  16513. contentText.width = 360;
  16514. contentText.wordWrap = true;
  16515. contentText.align = "center";
  16516. panel.addChild(contentText);
  16517. const buttonContainer = new Laya.Box();
  16518. buttonContainer.pos(20, 160);
  16519. panel.addChild(buttonContainer);
  16520. const btnWidth = 120;
  16521. const spacing = 30;
  16522. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  16523. buttons.forEach((btn, index) => {
  16524. const button = new Laya.Button();
  16525. button.label = btn.label;
  16526. button.size(btnWidth, 40);
  16527. button.labelSize = 22;
  16528. button.pos(index * (btnWidth + spacing), 0);
  16529. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  16530. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  16531. button.on(Laya.Event.MOUSE_OVER, this, () => {
  16532. button.alpha = 0.9;
  16533. });
  16534. button.on(Laya.Event.MOUSE_OUT, this, () => {
  16535. button.alpha = 1;
  16536. });
  16537. button.on(Laya.Event.CLICK, this, () => {
  16538. btn.handler();
  16539. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  16540. bg.removeSelf();
  16541. }));
  16542. });
  16543. buttonContainer.addChild(button);
  16544. });
  16545. buttonContainer.x = (panel.width - totalWidth) / 2;
  16546. }
  16547. }
  16548. class ConfigMgr {
  16549. constructor() {
  16550. this.httpReqCount = 3;
  16551. this.httpReqOkCount = 0;
  16552. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  16553. try {
  16554. this.httpReqOkCount = 0;
  16555. let reqData = JSON.stringify({
  16556. gameName: "TQ",
  16557. gameUserName: "zhangSan"
  16558. });
  16559. console.log('zh:第1个请求');
  16560. const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
  16561. this.classicCfg = classicCfg;
  16562. this.httpReqOkCount++;
  16563. console.log('zh:第2个请求');
  16564. const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
  16565. this.levelCfg = levelCfg;
  16566. this.httpReqOkCount++;
  16567. console.log('zh:第3个请求');
  16568. const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
  16569. this.placeBallCfg = placeBallCfg;
  16570. this.httpReqOkCount++;
  16571. console.log('zh:所有配置加载完成');
  16572. }
  16573. catch (error) {
  16574. console.error('请求失败:', error);
  16575. }
  16576. finally {
  16577. if (this.httpReqCount > this.httpReqOkCount) {
  16578. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  16579. {
  16580. label: "Okay", handler: () => {
  16581. console.log("zh:好的知道了");
  16582. JSBridgeUtils.instance.exitAndCloseGame();
  16583. }
  16584. }
  16585. ]);
  16586. }
  16587. }
  16588. });
  16589. this.sendPostAsync = (action, reqData) => {
  16590. return new Promise((resolve, reject) => {
  16591. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  16592. try {
  16593. let code = res.code;
  16594. if (code == 200) {
  16595. const parsedData = JSON.parse(res.msg);
  16596. resolve(parsedData);
  16597. }
  16598. else {
  16599. console.log(`zh:res = ${JSON.stringify(res)}`);
  16600. reject(new Error(`Request failed with code: ${code}`));
  16601. }
  16602. }
  16603. catch (error) {
  16604. console.error(`error=${error}`);
  16605. alert("Please check your network connection.");
  16606. reject(error);
  16607. }
  16608. finally {
  16609. console.log(`zh:${action}`);
  16610. }
  16611. });
  16612. });
  16613. };
  16614. }
  16615. static getInstance() {
  16616. if (!this._instance) {
  16617. this._instance = new ConfigMgr();
  16618. }
  16619. return this._instance;
  16620. }
  16621. init() {
  16622. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  16623. this.getConfigFromServer();
  16624. }
  16625. test() {
  16626. let reqData = JSON.stringify({
  16627. gameName: "TQ",
  16628. gameUserName: "zhangSan"
  16629. });
  16630. xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => {
  16631. console.log('zh:1s');
  16632. try {
  16633. let code = res.code;
  16634. let data = res.data;
  16635. if (code == 200) {
  16636. const parsedData = JSON.parse(data);
  16637. this.classicCfg = parsedData;
  16638. }
  16639. else {
  16640. console.log('zh:res = ' + JSON.stringify(res));
  16641. }
  16642. }
  16643. catch (error) {
  16644. console.log('error=' + error);
  16645. alert("Please check your network connection.");
  16646. }
  16647. finally {
  16648. console.log('zh:1');
  16649. }
  16650. });
  16651. }
  16652. getUserInfoByIndex(index) {
  16653. return this.npcJson[index];
  16654. }
  16655. getRandomUserInfo() {
  16656. let index = xGame.tools.random(0, this.npcJson.length);
  16657. return this.npcJson[index];
  16658. }
  16659. getMaxBigMoveLength() {
  16660. return Object.keys(this.levelCfg).length;
  16661. }
  16662. getBigMoveLevelByIndex(index) {
  16663. let cfg = this.levelCfg;
  16664. cfg = cfg[index];
  16665. return cfg;
  16666. }
  16667. getRandomClassicLevel() {
  16668. let cfg = this.classicCfg;
  16669. let num = Object.keys(cfg).length;
  16670. let rand = xGame.common.randomNum(1, num);
  16671. return cfg[rand];
  16672. }
  16673. getPlaceBallByLevel(level) {
  16674. return this.placeBallCfg[level];
  16675. }
  16676. getMaxPlaceBall() {
  16677. return Object.keys(this.placeBallCfg).length;
  16678. }
  16679. }
  16680. class PoolD3Mgr {
  16681. constructor() {
  16682. this.pool = {};
  16683. }
  16684. static get ins() {
  16685. return this._ins || (this._ins = new PoolD3Mgr);
  16686. }
  16687. createList(key, prefab, parent) {
  16688. if (!this.pool[key]) {
  16689. this.pool[key] = {};
  16690. this.pool[key].prefab = prefab;
  16691. this.pool[key].list = [];
  16692. this.pool[key].parent = parent;
  16693. }
  16694. }
  16695. getItem(key) {
  16696. if (!this.pool[key]) {
  16697. return;
  16698. }
  16699. let temp;
  16700. if (this.pool[key].list.length > 0) {
  16701. temp = this.pool[key].list.pop();
  16702. }
  16703. else {
  16704. temp = this.pool[key].prefab.clone();
  16705. if (this.pool[key].parent) {
  16706. this.pool[key].parent.addChild(temp);
  16707. }
  16708. }
  16709. temp.active = true;
  16710. return temp;
  16711. }
  16712. putItem(key, obj) {
  16713. if (!this.pool[key]) {
  16714. return;
  16715. }
  16716. obj.active = false;
  16717. this.pool[key].list.push(obj);
  16718. }
  16719. }
  16720. let context$1 = context;
  16721. let uiMgr = UIMgr.inst;
  16722. let soundMgr = SoundMgr.getInstance();
  16723. let resMgr = ResMgr.getInstance();
  16724. let httpMgr = HttpMgr.getInstance();
  16725. let common = Common.getInstance();
  16726. let cfgMgr = ConfigMgr.getInstance();
  16727. let poolD3Mgr = PoolD3Mgr.ins;
  16728. let d3TexUrl = "res/d3Res/";
  16729. let d3ModeUrl = "res/unityRes/";
  16730. function setStageSize(view) {
  16731. if (view.width) {
  16732. view.width = Laya.stage.width;
  16733. view.height = Laya.stage.height;
  16734. }
  16735. }
  16736. function filledBg(view) {
  16737. let wh = Laya.stage.height / Laya.stage.width;
  16738. if (wh > 16 / 9) {
  16739. view.height = Laya.stage.height;
  16740. view.width = Laya.stage.height / 1334 * 750;
  16741. }
  16742. else {
  16743. view.width = Laya.stage.width;
  16744. view.height = Laya.stage.width / 750 * 1334;
  16745. }
  16746. }
  16747. function setNotch(view) {
  16748. if (view.height) {
  16749. view.y += context$1.notchHeight;
  16750. }
  16751. }
  16752. function showTip(str) {
  16753. uiMgr.Show(UIMsg, str);
  16754. }
  16755. function log(...args) {
  16756. console.log(args);
  16757. }
  16758. let xGame = {
  16759. context: context$1,
  16760. eventMgr,
  16761. resMgr,
  16762. uiMgr,
  16763. soundMgr,
  16764. define,
  16765. tools,
  16766. httpMgr,
  16767. d3TexUrl,
  16768. d3ModeUrl,
  16769. common,
  16770. cfgMgr,
  16771. poolD3Mgr,
  16772. setStageSize,
  16773. filledBg,
  16774. setNotch,
  16775. showTip,
  16776. log,
  16777. };
  16778. window["xGame"] = xGame;
  16779. let dataName = 'tBall_';
  16780. class UserData {
  16781. constructor() {
  16782. this.userId = "";
  16783. this.isAgree = false;
  16784. this.coinNum = 0;
  16785. this.gemNum = 0;
  16786. this.sound = true;
  16787. this.vibration = true;
  16788. this.currentDate = 0;
  16789. this.createTime = 0;
  16790. this.awardTime = 0;
  16791. this.roleId = 1;
  16792. this.roleList = [];
  16793. this.roleAds = [];
  16794. this.dressId = 101;
  16795. this.itemId = 201;
  16796. this.bigSkills = [1, 1, 1, 1, 1];
  16797. this.coin = 4000;
  16798. this.diamond = 0;
  16799. this.skillSuccessTimes = 0;
  16800. this.skillGuide = 0;
  16801. this.skillAccTimes = 0;
  16802. this.placeBallData = [];
  16803. this.shareDiamondTimes = 0;
  16804. this.dailyVideoShareTimes = 0;
  16805. this.secretary = [1, 0];
  16806. this.curSecretary = 0;
  16807. this.ballRod = [1, 0, 0, 0, 0, 1];
  16808. this.curBallRod = 5;
  16809. this.signData = 0;
  16810. this.signTime = 0;
  16811. this.drawTimes = 0;
  16812. this.drawAwardTimes = 0;
  16813. this.dailyfreeDrawTimes = 1;
  16814. this.power = 5;
  16815. this.powerTime = 0;
  16816. this.challengeTimes = 0;
  16817. this.extraSign = 0;
  16818. this.classicTimes = 0;
  16819. this.guideHelpLine = 0;
  16820. this.newUser = true;
  16821. this.rootBallFoul = 0;
  16822. this.timeoutFoul = 0;
  16823. this.roleList = [1];
  16824. }
  16825. saveData() {
  16826. let data = {};
  16827. for (let k in this) {
  16828. data[k.toString()] = this[k];
  16829. }
  16830. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  16831. }
  16832. getData() {
  16833. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  16834. if (ld) {
  16835. let localData = JSON.parse(ld);
  16836. if (localData) {
  16837. for (let k in this) {
  16838. let key = k.toString();
  16839. let data = localData[key];
  16840. if (data != undefined) {
  16841. this[k] = data;
  16842. }
  16843. }
  16844. }
  16845. }
  16846. }
  16847. }
  16848. class ItemData {
  16849. constructor() {
  16850. this.itemList = {};
  16851. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  16852. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  16853. }
  16854. saveData() {
  16855. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  16856. }
  16857. getData() {
  16858. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  16859. if (ld) {
  16860. let localData = JSON.parse(ld);
  16861. if (localData) {
  16862. this.itemList = localData;
  16863. }
  16864. }
  16865. }
  16866. }
  16867. class GameData {
  16868. constructor() {
  16869. this.curLevel = 0;
  16870. this.gameType = 1;
  16871. this.signIdx = 0;
  16872. this.signMax = 0;
  16873. this.rotaryTime = 0;
  16874. this.rotaryCount = 0;
  16875. this.rotaryList = [];
  16876. this.diyCount = 3;
  16877. this.awardIdx = 0;
  16878. this.shareNum = 2;
  16879. this.rankWeek = 0;
  16880. this.rankScore = 0;
  16881. this.gameCount = 0;
  16882. this.trySkill = -1;
  16883. this.tryTime = 0;
  16884. }
  16885. saveData() {
  16886. let data = {};
  16887. for (let k in this) {
  16888. data[k.toString()] = this[k];
  16889. }
  16890. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16891. }
  16892. getData() {
  16893. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16894. if (ld) {
  16895. let localData = JSON.parse(ld);
  16896. if (localData) {
  16897. for (let k in this) {
  16898. let key = k.toString();
  16899. let data = localData[key];
  16900. if (data != undefined) {
  16901. this[k] = data;
  16902. }
  16903. }
  16904. }
  16905. }
  16906. }
  16907. }
  16908. class Diy2025GameData {
  16909. constructor() {
  16910. this.challengeMode_overLev = 0;
  16911. this.xszyForClassic = false;
  16912. this.xszyForChallenge = false;
  16913. }
  16914. saveData() {
  16915. let data = {};
  16916. for (let k in this) {
  16917. data[k.toString()] = this[k];
  16918. }
  16919. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  16920. }
  16921. getData() {
  16922. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  16923. if (ld) {
  16924. let localData = JSON.parse(ld);
  16925. if (localData) {
  16926. for (let k in this) {
  16927. let key = k.toString();
  16928. let data = localData[key];
  16929. if (data != undefined) {
  16930. this[k] = data;
  16931. }
  16932. }
  16933. }
  16934. }
  16935. }
  16936. }
  16937. class DataMgr {
  16938. static Init() {
  16939. this.userData = new UserData();
  16940. this.gameData = new GameData();
  16941. this.itemData = new ItemData();
  16942. this.diyGameData = new Diy2025GameData();
  16943. this.userData.getData();
  16944. this.gameData.getData();
  16945. this.itemData.getData();
  16946. this.diyGameData.getData();
  16947. this.roleId = this.userData.roleId;
  16948. this.resetUse();
  16949. }
  16950. static isNewDay() {
  16951. Moyu.isNewDay(this, (isnew) => {
  16952. xGame.common.isNewDay = isnew;
  16953. if (!isnew)
  16954. return;
  16955. DataMgr.setShareDiamondTimes(0, false);
  16956. DataMgr.setDailyVideoShareTimes(0, false);
  16957. DataMgr.setDailyfreeDrawTimes(1);
  16958. DataMgr.setExtraSign(0);
  16959. });
  16960. }
  16961. static deletData() {
  16962. Laya.LocalStorage.clear();
  16963. }
  16964. static upRankData() {
  16965. let num = xGame.common.getAllStarNum();
  16966. if (num > 0)
  16967. Moyu.upRankData(xGame.common.curRankID, num);
  16968. }
  16969. static addItem(id, count = 1) {
  16970. let v = this.itemData.itemList[id];
  16971. if (!v)
  16972. v = { id: id, count: count, adnum: 0, active: true };
  16973. else {
  16974. if (v.active) {
  16975. v.count += count;
  16976. }
  16977. else {
  16978. v.count = count;
  16979. v.active = true;
  16980. }
  16981. }
  16982. this.itemData.itemList[id] = v;
  16983. xGame.soundMgr.playGetSound();
  16984. this.saveItemData();
  16985. }
  16986. static hasItem(id) {
  16987. let v = this.itemData.itemList[id];
  16988. if (v && v.active)
  16989. return true;
  16990. return false;
  16991. }
  16992. static getItem(id) {
  16993. let v = this.itemData.itemList[id];
  16994. return v;
  16995. }
  16996. static getItemCount(id) {
  16997. let v = this.itemData.itemList[id];
  16998. if (v && v.active)
  16999. return v.count;
  17000. return 0;
  17001. }
  17002. static getItemAd(id) {
  17003. let v = this.itemData.itemList[id];
  17004. if (v) {
  17005. return v.adnum;
  17006. }
  17007. return 0;
  17008. }
  17009. static onItemAd(id, num = 1) {
  17010. let v = this.itemData.itemList[id];
  17011. if (!v)
  17012. v = { id: id, count: 1, adnum: num, active: false };
  17013. else
  17014. v.adnum += num;
  17015. this.itemData.itemList[id] = v;
  17016. this.saveItemData();
  17017. }
  17018. static costItem(id, count) {
  17019. let v = this.itemData.itemList[id];
  17020. if (v && v.active) {
  17021. if (v.count < count)
  17022. return false;
  17023. else {
  17024. v.count -= count;
  17025. this.itemData.itemList[id] = v;
  17026. return true;
  17027. }
  17028. }
  17029. return false;
  17030. }
  17031. static resetUse() {
  17032. this.dressId = this.userData.dressId;
  17033. this.itemId = this.userData.itemId;
  17034. }
  17035. static passLevel() {
  17036. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17037. this.gameData.curLevel++;
  17038. this.curLevel = this.gameData.curLevel;
  17039. this.saveGameData();
  17040. }
  17041. static useRole(id) {
  17042. this.roleId = id;
  17043. if (this.hasRole(id)) {
  17044. this.userData.roleId = id;
  17045. this.saveUserData();
  17046. }
  17047. }
  17048. static addRole(id) {
  17049. if (this.hasRole(id))
  17050. return;
  17051. this.userData.roleList.push(id);
  17052. this.saveUserData();
  17053. }
  17054. static hasRole(id) {
  17055. return this.userData.roleList.indexOf(id) >= 0;
  17056. }
  17057. static gemEnough(num) {
  17058. return this.userData.gemNum >= num;
  17059. }
  17060. static roleHasAd(id) {
  17061. let count = this.userData.roleAds[id];
  17062. if (count != undefined && count >= 0)
  17063. return true;
  17064. else
  17065. return false;
  17066. }
  17067. static saveUserData(time = 500, event, arg) {
  17068. if (this.userSaving)
  17069. return;
  17070. this.userSaving = true;
  17071. Laya.timer.once(time, this, () => {
  17072. this.userSaving = false;
  17073. this.userData.saveData();
  17074. if (event)
  17075. xGame.eventMgr.event(event, arg);
  17076. });
  17077. }
  17078. static saveGameData() {
  17079. if (this.gameSaving)
  17080. return;
  17081. this.gameSaving = true;
  17082. Laya.timer.once(1000, this, () => {
  17083. this.gameSaving = false;
  17084. this.gameData.saveData();
  17085. });
  17086. }
  17087. static saveItemData() {
  17088. let fun = () => {
  17089. this.itemData.saveData();
  17090. };
  17091. Laya.timer.clear(this, fun);
  17092. Laya.timer.once(500, this, fun);
  17093. }
  17094. static saveData() {
  17095. this.saveUserData();
  17096. this.saveGameData();
  17097. }
  17098. static getBigSkillList() {
  17099. return this.userData.bigSkills;
  17100. }
  17101. static getBigSkillByIndex(index) {
  17102. return this.userData.bigSkills[index];
  17103. }
  17104. static setBigSkill(index, val, addUp = true) {
  17105. if (addUp) {
  17106. this.userData.bigSkills[index] += val;
  17107. }
  17108. else {
  17109. this.userData.bigSkills[index] = val;
  17110. }
  17111. this.saveUserData();
  17112. }
  17113. static coinEnough(need) {
  17114. if (typeof need != "number") {
  17115. console.error("金币格式错误");
  17116. return;
  17117. }
  17118. return this.userData.coin >= need;
  17119. }
  17120. static setCoin(val) {
  17121. if (typeof val != "number") {
  17122. return;
  17123. }
  17124. this.userData.coin += val;
  17125. this.saveUserData();
  17126. xGame.eventMgr.event(COIN_CHANGE);
  17127. }
  17128. static getCoin() {
  17129. return this.userData.coin;
  17130. }
  17131. static diamondEnough(need) {
  17132. if (typeof need != "number") {
  17133. console.error("金币格式错误");
  17134. return;
  17135. }
  17136. return this.userData.diamond >= need;
  17137. }
  17138. static setDiamond(val) {
  17139. if (typeof val != "number") {
  17140. return;
  17141. }
  17142. this.userData.diamond += val;
  17143. this.saveUserData();
  17144. xGame.eventMgr.event(DIAMOND_CHANGE);
  17145. }
  17146. static getDiamond() {
  17147. return this.userData.diamond;
  17148. }
  17149. static getSkillSuccessTimes() {
  17150. return this.userData.skillSuccessTimes;
  17151. }
  17152. static setSkillSuccessTimes(val, addUp = true) {
  17153. if (addUp)
  17154. this.userData.skillSuccessTimes += val;
  17155. else
  17156. this.userData.skillSuccessTimes = val;
  17157. this.saveUserData();
  17158. }
  17159. static getSkillAccTimes() {
  17160. return this.userData.skillAccTimes;
  17161. }
  17162. static setSkillAccTimes(val) {
  17163. this.userData.skillAccTimes += val;
  17164. this.saveUserData();
  17165. }
  17166. static getSkillGuide() {
  17167. if (!xGame.common.openGuide) {
  17168. return 1;
  17169. }
  17170. return this.userData.skillGuide;
  17171. }
  17172. static setSkillGuide(val) {
  17173. this.userData.skillGuide = val;
  17174. this.saveUserData();
  17175. }
  17176. static getPlaceBallLevelList() {
  17177. return this.userData.placeBallData;
  17178. }
  17179. static getPlaceBallLevel(level) {
  17180. let arr = this.userData.placeBallData;
  17181. let index = level - 1;
  17182. let out;
  17183. if (arr[index]) {
  17184. out = arr[index];
  17185. }
  17186. else {
  17187. let max = arr.length;
  17188. if (max == index) {
  17189. out = {
  17190. star: 0,
  17191. play: true,
  17192. isCur: true,
  17193. getAward: false
  17194. };
  17195. }
  17196. else {
  17197. out = {
  17198. star: 0,
  17199. play: false,
  17200. getAward: false
  17201. };
  17202. }
  17203. }
  17204. return out;
  17205. }
  17206. static setPlaceBallLevel(level, star) {
  17207. let arr = this.userData.placeBallData;
  17208. let index = level - 1;
  17209. if (arr[index]) {
  17210. arr[index].star = Math.max(arr[index].star, star);
  17211. }
  17212. else {
  17213. let max = arr.length;
  17214. if (max == index) {
  17215. arr.push({
  17216. star: star,
  17217. play: true,
  17218. getAward: false
  17219. });
  17220. }
  17221. else {
  17222. console.error("关卡存储出错");
  17223. }
  17224. }
  17225. this.saveUserData();
  17226. }
  17227. static setPlaceBallAward(level) {
  17228. let arr = this.userData.placeBallData;
  17229. let index = level - 1;
  17230. if (arr[index]) {
  17231. arr[index].getAward = true;
  17232. }
  17233. this.saveUserData();
  17234. }
  17235. static getShareDiamondTimes() {
  17236. return this.userData.shareDiamondTimes;
  17237. }
  17238. static setShareDiamondTimes(val, addUp = true) {
  17239. if (addUp) {
  17240. this.userData.shareDiamondTimes += val;
  17241. }
  17242. else {
  17243. this.userData.shareDiamondTimes = val;
  17244. }
  17245. this.saveUserData();
  17246. }
  17247. static getDailyVideoShareTimes() {
  17248. return this.userData.dailyVideoShareTimes;
  17249. }
  17250. static setDailyVideoShareTimes(val, addUp = true) {
  17251. if (addUp) {
  17252. this.userData.dailyVideoShareTimes += val;
  17253. }
  17254. else {
  17255. this.userData.dailyVideoShareTimes = val;
  17256. }
  17257. this.saveUserData();
  17258. }
  17259. static getSecretary(index) {
  17260. return this.userData.secretary[index];
  17261. }
  17262. static setSecretary(index, val) {
  17263. this.userData.secretary[index] = val;
  17264. this.saveUserData();
  17265. }
  17266. static getCurSecretary() {
  17267. return this.userData.curSecretary;
  17268. }
  17269. static setCurSecretary(index) {
  17270. this.userData.curSecretary = index;
  17271. this.saveUserData();
  17272. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  17273. }
  17274. static getBallRod(index) {
  17275. return this.userData.ballRod[index];
  17276. }
  17277. static setBallRod(index, val) {
  17278. this.userData.ballRod[index] = val;
  17279. this.saveUserData();
  17280. }
  17281. static getCurBallRod() {
  17282. return this.userData.curBallRod;
  17283. }
  17284. static setCurBallRod(index) {
  17285. this.userData.curBallRod = index;
  17286. this.saveUserData();
  17287. }
  17288. static setSignData(val) {
  17289. this.userData.signData = val;
  17290. this.saveUserData();
  17291. }
  17292. static getSignData() {
  17293. return this.userData.signData;
  17294. }
  17295. static setSignTime(val) {
  17296. this.userData.signTime = val;
  17297. this.saveUserData();
  17298. }
  17299. static getSignTime() {
  17300. return this.userData.signTime;
  17301. }
  17302. static getDrawTimes() {
  17303. return this.userData.drawTimes;
  17304. }
  17305. static setDrawTimes(val, addUp = true) {
  17306. if (addUp) {
  17307. this.userData.drawTimes += val;
  17308. }
  17309. else {
  17310. this.userData.drawTimes = val;
  17311. }
  17312. this.saveUserData();
  17313. }
  17314. static getDrawAwardTimes() {
  17315. return this.userData.drawAwardTimes;
  17316. }
  17317. static setDrawAwardTimes(val) {
  17318. this.userData.drawAwardTimes = val;
  17319. this.saveUserData();
  17320. }
  17321. static getDailyfreeDrawTimes() {
  17322. return this.userData.dailyfreeDrawTimes;
  17323. }
  17324. static setDailyfreeDrawTimes(val) {
  17325. this.userData.dailyfreeDrawTimes = val;
  17326. this.saveUserData();
  17327. }
  17328. static setPower(val, addUp = true) {
  17329. if (addUp)
  17330. this.userData.power += val;
  17331. else
  17332. this.userData.power = val;
  17333. if (this.userData.power >= xGame.common.maxPower) {
  17334. this.userData.power = xGame.common.maxPower;
  17335. }
  17336. xGame.eventMgr.event(POWER_CHANGE, val);
  17337. this.saveUserData();
  17338. }
  17339. static getPower() {
  17340. return this.userData.power;
  17341. }
  17342. static setPowerTime(val) {
  17343. this.userData.powerTime = val;
  17344. this.saveUserData();
  17345. }
  17346. static getPowerTime() {
  17347. return this.userData.powerTime;
  17348. }
  17349. static powerEnough() {
  17350. return this.getPower() > 0;
  17351. }
  17352. static getChallengeTimes() {
  17353. return this.userData.challengeTimes;
  17354. }
  17355. static setChallengeTimes(val) {
  17356. this.userData.challengeTimes += val;
  17357. this.saveUserData();
  17358. }
  17359. static getExtraSign() {
  17360. return this.userData.extraSign;
  17361. }
  17362. static setExtraSign(val) {
  17363. this.userData.extraSign = val;
  17364. this.saveUserData();
  17365. }
  17366. static getClassicTimes() {
  17367. return this.userData.classicTimes;
  17368. }
  17369. static setClassicTimes() {
  17370. this.userData.classicTimes += 1;
  17371. this.saveUserData();
  17372. }
  17373. static getGuideHelpLine() {
  17374. return this.userData.guideHelpLine;
  17375. }
  17376. static setGuideHelpLine() {
  17377. this.userData.guideHelpLine = 1;
  17378. this.saveUserData();
  17379. }
  17380. static getNewUser() {
  17381. return this.userData.newUser;
  17382. }
  17383. static setNewUser() {
  17384. this.userData.newUser = false;
  17385. this.saveUserData();
  17386. }
  17387. static getRootBallFoul() {
  17388. return this.userData.rootBallFoul;
  17389. }
  17390. static setRootBallFoul() {
  17391. this.userData.rootBallFoul = 1;
  17392. this.saveUserData();
  17393. }
  17394. static getTimeoutFoul() {
  17395. return this.userData.timeoutFoul;
  17396. }
  17397. static setTimeoutFoul() {
  17398. this.userData.timeoutFoul = 1;
  17399. this.saveUserData();
  17400. }
  17401. static saveDiyGameData() {
  17402. if (this.diyGameSaving)
  17403. return;
  17404. this.diyGameSaving = true;
  17405. Laya.timer.once(500, this, () => {
  17406. this.diyGameSaving = false;
  17407. this.diyGameData.saveData();
  17408. });
  17409. }
  17410. static getChallengeMode_overLev() {
  17411. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  17412. return this.challengeMode_overLev;
  17413. }
  17414. static setChallengeMode_overLev(levNum) {
  17415. this.diyGameData.challengeMode_overLev = levNum;
  17416. this.saveDiyGameData();
  17417. }
  17418. }
  17419. DataMgr.isNewUser = false;
  17420. DataMgr.fristEnter = true;
  17421. DataMgr.levelType = 0;
  17422. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  17423. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  17424. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  17425. DataMgr.challengeMode_overLev = 0;
  17426. DataMgr.xszyForClassic = false;
  17427. DataMgr.xszyForChallenge = false;
  17428. DataMgr.awardId = 0;
  17429. DataMgr.awardCoin = 0;
  17430. DataMgr.sceneId = -1;
  17431. DataMgr.tryId = 0;
  17432. DataMgr.curLevel = 1;
  17433. DataMgr.vipLevel = 0;
  17434. DataMgr.maxLevel = 0;
  17435. DataMgr.awardRatio = 1;
  17436. DataMgr.gameList = [];
  17437. DataMgr.rankList = [];
  17438. DataMgr.recoverTime = 480000;
  17439. DataMgr.minScore = 0;
  17440. DataMgr.rankDis = 0;
  17441. DataMgr.userSaving = false;
  17442. DataMgr.gameSaving = false;
  17443. DataMgr.diyGameSaving = false;
  17444. class D3Tween extends Laya.Script3D {
  17445. constructor() {
  17446. super();
  17447. this.isInited = false;
  17448. }
  17449. ;
  17450. init() {
  17451. if (this.isInited)
  17452. return;
  17453. this.isInited = true;
  17454. this.gameObj = this.owner;
  17455. this.transform = this.gameObj.transform;
  17456. }
  17457. get rotX() {
  17458. return this.transform.localRotationEulerX;
  17459. }
  17460. set rotX(v) {
  17461. this.transform.localRotationEulerX = v;
  17462. }
  17463. get rotY() {
  17464. return this.transform.localRotationEulerY;
  17465. }
  17466. set rotY(v) {
  17467. this.transform.localRotationEulerY = v;
  17468. }
  17469. get rotZ() {
  17470. return this.transform.localRotationEulerZ;
  17471. }
  17472. set rotZ(v) {
  17473. this.transform.localRotationEulerZ = v;
  17474. }
  17475. get posX() {
  17476. return this.transform.localPositionX;
  17477. }
  17478. set posX(v) {
  17479. this.transform.localPositionX = v;
  17480. }
  17481. get posY() {
  17482. return this.transform.localPositionY;
  17483. }
  17484. set posY(v) {
  17485. this.transform.localPositionY = v;
  17486. }
  17487. get posZ() {
  17488. return this.transform.localPositionZ;
  17489. }
  17490. set posZ(v) {
  17491. this.transform.localPositionZ = v;
  17492. }
  17493. get rotation() {
  17494. return this.transform.localRotation;
  17495. }
  17496. set rotation(v) {
  17497. this.transform.localRotation = v;
  17498. }
  17499. }
  17500. class D2Hole extends Laya.Script {
  17501. constructor() { super(); }
  17502. onTriggerEnter(collider) {
  17503. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  17504. return;
  17505. }
  17506. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  17507. if (collider.owner["mySrc"].isRunSkillAni) {
  17508. return;
  17509. }
  17510. if (collider.owner["mySrc"].number != 0) {
  17511. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  17512. }
  17513. xGame.common.ballColliHole(collider);
  17514. xGame.common.recoverCameraView();
  17515. }
  17516. }
  17517. }
  17518. class Table extends Laya.Script3D {
  17519. constructor() {
  17520. super();
  17521. this.isSetBorder = false;
  17522. this.inited = false;
  17523. }
  17524. ;
  17525. onAwake() {
  17526. this.init();
  17527. }
  17528. init() {
  17529. if (this.inited)
  17530. return;
  17531. this.inited = true;
  17532. this.gameObj = this.owner;
  17533. this.border = this.gameObj.getChildByName("border");
  17534. }
  17535. setBorderPos() {
  17536. if (this.isSetBorder)
  17537. return;
  17538. this.isSetBorder = true;
  17539. let ui = xGame.common.gameUI.ui;
  17540. let bar1 = this.border.getChildByName("bar1");
  17541. let bar2 = this.border.getChildByName("bar2");
  17542. let bar3 = this.border.getChildByName("bar3");
  17543. let bar4 = this.border.getChildByName("bar4");
  17544. let bar5 = this.border.getChildByName("bar5");
  17545. let bar6 = this.border.getChildByName("bar6");
  17546. this.setInfo(bar1, ui.border.bar1, "box");
  17547. this.setInfo(bar2, ui.border.bar2, "box");
  17548. this.setInfo(bar3, ui.border.bar3, "box");
  17549. this.setInfo(bar4, ui.border.bar4, "box");
  17550. this.setInfo(bar5, ui.border.bar5, "box");
  17551. this.setInfo(bar6, ui.border.bar6, "box");
  17552. let circle1 = this.border.getChildByName("circle1");
  17553. let circle2 = this.border.getChildByName("circle2");
  17554. let circle3 = this.border.getChildByName("circle3");
  17555. let circle4 = this.border.getChildByName("circle4");
  17556. let circle5 = this.border.getChildByName("circle5");
  17557. let circle6 = this.border.getChildByName("circle6");
  17558. this.setInfo(circle1, ui.border.circle1, "circle");
  17559. this.setInfo(circle2, ui.border.circle2, "circle");
  17560. this.setInfo(circle3, ui.border.circle3, "circle");
  17561. this.setInfo(circle4, ui.border.circle4, "circle");
  17562. this.setInfo(circle5, ui.border.circle5, "circle");
  17563. this.setInfo(circle6, ui.border.circle6, "circle");
  17564. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  17565. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  17566. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  17567. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  17568. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  17569. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  17570. let arr = xGame.common.gameMgr.holePosList;
  17571. xGame.common.gameMgr.posObj = {
  17572. "1": arr[0],
  17573. "3": arr[2],
  17574. "4": arr[3],
  17575. "6": arr[5]
  17576. };
  17577. }
  17578. initHolePos(x, y) {
  17579. if (x < 300)
  17580. x += 25;
  17581. else if (x > 1000)
  17582. x -= 25;
  17583. else if (y > 200)
  17584. y -= 10;
  17585. else
  17586. y += 10;
  17587. if (y < 200)
  17588. y += 30;
  17589. else if (y > 500)
  17590. y -= 30;
  17591. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  17592. }
  17593. setInfo(d3Obj, d2Obj, type) {
  17594. let ui = xGame.common.gameUI.ui;
  17595. let sprite = new Laya.Sprite();
  17596. ui.border.displayObject.addChild(sprite);
  17597. let colli = xGame.common.getCollider(type);
  17598. sprite.addComponentIntance(colli);
  17599. let rigy = xGame.common.getRigbody();
  17600. rigy.type = "static";
  17601. sprite.addComponentIntance(rigy);
  17602. let d3Pos = d3Obj.transform.position;
  17603. xGame.common.pos3to2Convert(d3Pos);
  17604. let scaleX = d3Obj.transform.localScaleX;
  17605. let scaleZ = d3Obj.transform.localScaleZ;
  17606. let width = xGame.common.scale3to2Convert(scaleZ);
  17607. let height = xGame.common.scale3to2Convert(scaleX);
  17608. sprite.pivotX = width / 2;
  17609. sprite.pivotY = height / 2;
  17610. sprite.x = d3Pos.x;
  17611. sprite.y = d3Pos.y;
  17612. sprite.width = width;
  17613. sprite.height = height;
  17614. d2Obj.x = d3Pos.x;
  17615. d2Obj.y = d3Pos.y;
  17616. d2Obj.width = width;
  17617. d2Obj.height = height;
  17618. if (type == "box") {
  17619. colli.width = width;
  17620. colli.height = height;
  17621. colli.isSensor = false;
  17622. colli.label = "border";
  17623. }
  17624. else {
  17625. colli.radius = width / 2;
  17626. colli.isSensor = true;
  17627. colli.label = "hole";
  17628. sprite.addComponent(D2Hole);
  17629. }
  17630. }
  17631. }
  17632. class D3World extends Laya.Script3D {
  17633. constructor() {
  17634. super();
  17635. this.loadNum = 0;
  17636. this.setLoadNum = 7;
  17637. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  17638. }
  17639. onAwake() {
  17640. }
  17641. loadScene() {
  17642. this.scene = this.owner;
  17643. let url = `res/unityRes/root.lh`;
  17644. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  17645. this.scene.addChild(prefab);
  17646. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  17647. this.putCameraInfo();
  17648. this.camera.enableHDR = false;
  17649. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  17650. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  17651. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  17652. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  17653. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  17654. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  17655. this.knife.active = false;
  17656. this.loadD3Obj();
  17657. }));
  17658. }
  17659. putCameraInfo() {
  17660. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  17661. this.cameraObj = new cameraType();
  17662. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  17663. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  17664. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  17665. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  17666. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  17667. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  17668. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  17669. this.visitAngleChild.init();
  17670. this.visitRootObj.posX = this.visitAngleChild.posX;
  17671. this.visitRootObj.posY = this.visitAngleChild.posY;
  17672. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  17673. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  17674. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  17675. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  17676. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  17677. xGame.common.showOneCamera("mainCamera");
  17678. }
  17679. loadD3Obj() {
  17680. this.loadTable();
  17681. this.loadRoom();
  17682. this.loadInHoleParticial();
  17683. this.loadIceParticial();
  17684. this.loadHitParticial();
  17685. this.loadFireworksParticial();
  17686. this.loadBall();
  17687. }
  17688. loadInHoleParticial() {
  17689. this.loadD3Res("inHoleEft", "", (prefab) => {
  17690. prefab.addComponent(Partical);
  17691. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  17692. });
  17693. }
  17694. loadIceParticial() {
  17695. this.loadD3Res("iceEft", "", (prefab) => {
  17696. prefab.addComponent(Partical);
  17697. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  17698. });
  17699. }
  17700. loadHitParticial() {
  17701. this.loadD3Res("hitEft", "", (prefab) => {
  17702. prefab.addComponent(Partical);
  17703. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  17704. });
  17705. }
  17706. loadFireworksParticial() {
  17707. this.loadD3Res("fireworksEft", "", (prefab) => {
  17708. prefab.addComponent(Partical);
  17709. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  17710. });
  17711. }
  17712. loadBall(index = 1) {
  17713. this.loadD3Res("ball", index, (prefab) => {
  17714. this.ballPrefab = prefab;
  17715. this.ballPrefab.addComponent(Ball);
  17716. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  17717. });
  17718. }
  17719. loadTable(index = 1) {
  17720. this.loadD3Res("table", index, (prefab) => {
  17721. this.tableSrc = prefab.addComponent(Table);
  17722. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  17723. this.d3Hand.init();
  17724. this.tableRoot.addChild(prefab);
  17725. });
  17726. }
  17727. loadRoom(index = 1) {
  17728. this.loadD3Res("room", index, (prefab) => {
  17729. this.roomRoot.addChild(prefab);
  17730. });
  17731. }
  17732. loadD3Res(type, index, callback) {
  17733. let url = `res/unityRes/${type}${index}.lh`;
  17734. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  17735. callback && callback(prefab);
  17736. this.checkResLoad();
  17737. }));
  17738. }
  17739. checkResLoad() {
  17740. this.loadNum++;
  17741. if (this.loadNum >= this.setLoadNum) {
  17742. xGame.eventMgr.event(D3RES_LOADED);
  17743. }
  17744. }
  17745. prePlayEft() {
  17746. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  17747. eft.transform.localPositionX = 0;
  17748. eft.transform.localPositionY = -5;
  17749. eft.transform.localPositionZ = 0;
  17750. eft.active = true;
  17751. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  17752. ice.transform.localPositionX = 0;
  17753. ice.transform.localPositionY = -5;
  17754. ice.transform.localPositionZ = 0;
  17755. ice.active = true;
  17756. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  17757. hit.transform.localPositionX = 0;
  17758. hit.transform.localPositionY = -5;
  17759. hit.transform.localPositionZ = 0;
  17760. hit.active = true;
  17761. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  17762. fireworks.transform.localPositionX = 0;
  17763. fireworks.transform.localPositionY = -5;
  17764. fireworks.transform.localPositionZ = 0;
  17765. fireworks.active = true;
  17766. }
  17767. }
  17768. class cameraType {
  17769. }
  17770. class MoyuMgr$1 {
  17771. static initMoyu() {
  17772. this.moyuView = new MoyuView$1();
  17773. Laya.stage.addChild(this.moyuView.ui.displayObject);
  17774. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  17775. this.moyuView.ui.displayObject.zOrder = 1000;
  17776. this.moyuView.init();
  17777. this.moyuView.showTip(true);
  17778. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  17779. window['XApk'] = this;
  17780. }
  17781. static showAge(show) {
  17782. if (this.moyuView)
  17783. this.moyuView.showAge(show);
  17784. }
  17785. static onPlatMsg(idx) {
  17786. if (!MoyuMgr$1.moyuView)
  17787. return;
  17788. if (idx == '0') {
  17789. MoyuMgr$1.moyuView.showTip(false);
  17790. }
  17791. }
  17792. static showAgree(call) {
  17793. if (this.moyuView)
  17794. this.moyuView.showAgree(call);
  17795. else
  17796. call && call();
  17797. }
  17798. static showXy(type = 1) {
  17799. if (this.moyuView)
  17800. this.moyuView.showXy(type);
  17801. }
  17802. }
  17803. MoyuMgr$1.isAdvise = false;
  17804. class MoyuView$1 {
  17805. constructor() {
  17806. this.ysxyNum = 1;
  17807. this.ysJson = null;
  17808. this.ui = ui_UIMoyu.createInstance();
  17809. }
  17810. init() {
  17811. this.ui.mainBg.visible = false;
  17812. this.ui.xyNode.visible = false;
  17813. this.ui.ageNode.visible = false;
  17814. this.ui.tipNode.visible = false;
  17815. this.ui.rnNode.visible = false;
  17816. this.ui.fcmNode.visible = false;
  17817. this.ui.ageTip.visible = false;
  17818. this.ui.msgNode.visible = false;
  17819. this.ui.visible = false;
  17820. this.ui.xyNode.xyList.setVirtual();
  17821. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  17822. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  17823. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  17824. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  17825. this.ui.xyNode.btnKnown.visible = false;
  17826. this.ui.xyNode.xy1.visible = false;
  17827. this.ui.xyNode.xy2.visible = false;
  17828. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  17829. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  17830. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  17831. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  17832. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  17833. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  17834. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  17835. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  17836. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  17837. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  17838. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  17839. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  17840. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  17841. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  17842. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  17843. this.ysxyNum = 2;
  17844. }
  17845. }
  17846. onClick(obj) {
  17847. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  17848. switch (obj) {
  17849. case this.ui.ageTip:
  17850. if (Moyu.isTTApk) {
  17851. this.ui.ageNode.visible = true;
  17852. this.ui.mainBg.visible = true;
  17853. }
  17854. break;
  17855. case this.ui.tipNode:
  17856. this.showTip(false);
  17857. break;
  17858. case this.ui.ageNode.btnAge:
  17859. this.ui.ageNode.visible = false;
  17860. this.ui.mainBg.visible = false;
  17861. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  17862. this.ui.visible = false;
  17863. break;
  17864. case this.ui.xyNode.btnXy3:
  17865. case this.ui.xyNode.btnXy1:
  17866. this.loadXy(1);
  17867. break;
  17868. case this.ui.xyNode.btnXy2:
  17869. this.loadXy(2);
  17870. break;
  17871. case this.ui.xyNode.btnBack:
  17872. this.ui.xyNode.xy1.visible = true;
  17873. this.ui.xyNode.xy2.visible = false;
  17874. break;
  17875. case this.ui.xyNode.btnKnown:
  17876. this.ui.xyNode.visible = false;
  17877. this.ui.mainBg.visible = false;
  17878. this.ui.visible = false;
  17879. break;
  17880. case this.ui.rnNode.btnCheck:
  17881. this.check();
  17882. break;
  17883. case this.ui.rnNode.btnExit:
  17884. case this.ui.xyNode.btnNo:
  17885. this.ysxyNum--;
  17886. if (this.ysxyNum > 0)
  17887. this.showMsg("Refuse to quit the game once again");
  17888. else {
  17889. Moyu.userAgree(false);
  17890. Moyu.exit();
  17891. }
  17892. break;
  17893. case this.ui.xyNode.btnSure:
  17894. case this.ui.xyNode.btnYes:
  17895. DataMgr.userData.isAgree = true;
  17896. DataMgr.saveUserData();
  17897. this.onAgree();
  17898. break;
  17899. case this.ui.rnNode.btnDone:
  17900. this.ui.rnNode.visible = false;
  17901. this.ui.visible = false;
  17902. break;
  17903. case this.ui.fcmNode.btnRn:
  17904. this.showRn();
  17905. break;
  17906. }
  17907. }
  17908. showTip(show) {
  17909. if (!Moyu.isVVApk && !Moyu.isOPApk)
  17910. return;
  17911. if (show) {
  17912. MoyuMgr$1.isAdvise = true;
  17913. this.ui.visible = true;
  17914. this.ui.tipNode.visible = true;
  17915. this.ui.tipNode.alpha = 1;
  17916. Laya.timer.once(1000, this, this.showTip, [false]);
  17917. }
  17918. else {
  17919. this.ui.tipNode.alpha = 1;
  17920. this.ui.tipNode.visible = true;
  17921. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  17922. this.ui.tipNode.visible = false;
  17923. MoyuMgr$1.isAdvise = false;
  17924. }), 1000);
  17925. }
  17926. }
  17927. showAge(show, px = 0, py = 0) {
  17928. if (Moyu.platType > 10 && !Moyu.isIos) {
  17929. this.ui.ageTip.x = px;
  17930. this.ui.ageTip.y = py;
  17931. this.ui.ageTip.visible = show;
  17932. if (show)
  17933. this.ui.visible = true;
  17934. }
  17935. }
  17936. showAgree(call) {
  17937. this.agreeCall = call;
  17938. this.onAgree();
  17939. return;
  17940. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17941. this.showXy(0);
  17942. }
  17943. else
  17944. this.onAgree();
  17945. }
  17946. onAgree() {
  17947. if (!this.ui.ageNode.visible)
  17948. this.ui.visible = false;
  17949. this.ui.xyNode.visible = false;
  17950. Moyu.userAgree(true);
  17951. this.showAge(false);
  17952. this.agreeCall && this.agreeCall();
  17953. this.showRn();
  17954. }
  17955. showMsg(txt) {
  17956. this.ui.msgNode.txtMsg.text = txt;
  17957. this.ui.msgNode.visible = true;
  17958. this.ui.msgNode.alpha = 1;
  17959. this.ui.visible = true;
  17960. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17961. this.ui.msgNode.visible = false;
  17962. }), 2500, true);
  17963. }
  17964. showRn() {
  17965. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17966. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17967. this.ui.rnNode.rn1.visible = true;
  17968. this.ui.rnNode.rn2.visible = false;
  17969. this.ui.rnNode.rn3.visible = false;
  17970. this.ui.rnNode.rn4.visible = false;
  17971. this.ui.rnNode.visible = true;
  17972. this.ui.mainBg.visible = true;
  17973. this.ui.rnNode.btnDone.visible = false;
  17974. this.ui.rnNode.btnExit.visible = true;
  17975. this.ui.rnNode.btnCheck.visible = true;
  17976. this.ui.fcmNode.visible = false;
  17977. this.ui.visible = true;
  17978. return;
  17979. }
  17980. }
  17981. this.showFcm();
  17982. }
  17983. showFcm() {
  17984. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17985. Moyu.initFCM(true);
  17986. if (Moyu.gameTime < 1)
  17987. this.fcmLoop();
  17988. else if (Moyu.gameTime < 999)
  17989. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17990. }
  17991. }
  17992. fcmLoop() {
  17993. if (Moyu.gameTime < 1) {
  17994. this.ui.rnNode.visible = false;
  17995. this.ui.fcmNode.visible = true;
  17996. this.ui.mainBg.visible = true;
  17997. this.ui.visible = true;
  17998. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17999. Laya.timer.clear(this.ui, this.fcmLoop);
  18000. }
  18001. }
  18002. check() {
  18003. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18004. this.ui.rnNode.rn1.visible = false;
  18005. this.ui.rnNode.rn2.visible = false;
  18006. this.ui.rnNode.rn4.visible = true;
  18007. }
  18008. else if (this.ui.rnNode.rn4.visible) {
  18009. let name = this.ui.rnNode.inputName.text;
  18010. let code = this.ui.rnNode.inputCode.text;
  18011. if (code && code.length == 18) {
  18012. this.ui.rnNode.rn1.visible = false;
  18013. this.ui.rnNode.rn4.visible = false;
  18014. Moyu.authenticate(name, code, (res) => {
  18015. this.ui.rnNode.rn2.visible = !res;
  18016. this.ui.rnNode.rn3.visible = res;
  18017. this.ui.rnNode.btnDone.visible = res;
  18018. this.ui.rnNode.btnExit.visible = !res;
  18019. this.ui.rnNode.btnCheck.visible = !res;
  18020. if (res)
  18021. this.showFcm();
  18022. });
  18023. }
  18024. else
  18025. this.showMsg("信息填写不完整");
  18026. }
  18027. }
  18028. loadXy(type = 0) {
  18029. this.ui.xyNode.xy1.visible = false;
  18030. this.ui.xyNode.xy2.visible = true;
  18031. this.ui.xyNode.xyList.scrollToView(0);
  18032. if (type == 1) {
  18033. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18034. }
  18035. else if (type == 2) {
  18036. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18037. }
  18038. }
  18039. showXy(type = 0) {
  18040. this.xyBtn();
  18041. if (type == 0) {
  18042. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18043. this.ui.xyNode.btnSure.visible = true;
  18044. }
  18045. else {
  18046. this.ui.xyNode.btnYes.visible = true;
  18047. this.ui.xyNode.btnNo.visible = true;
  18048. }
  18049. }
  18050. else {
  18051. this.ui.xyNode.btnKnown.visible = true;
  18052. this.ui.mainBg.visible = true;
  18053. }
  18054. this.ui.xyNode.xy1.visible = true;
  18055. this.ui.xyNode.xy2.visible = false;
  18056. this.ui.xyNode.visible = true;
  18057. this.ui.visible = true;
  18058. }
  18059. xyBtn() {
  18060. this.ui.xyNode.btnSure.visible = false;
  18061. this.ui.xyNode.btnYes.visible = false;
  18062. this.ui.xyNode.btnNo.visible = false;
  18063. this.ui.xyNode.btnKnown.visible = false;
  18064. {
  18065. this.ui.xyNode.btnXy3.visible = false;
  18066. this.ui.xyNode.btnXy2.visible = true;
  18067. this.ui.xyNode.btnXy1.visible = true;
  18068. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18069. }
  18070. }
  18071. createXY(json) {
  18072. this.ysJson = json.content;
  18073. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18074. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18075. this.ui.xyNode.xy2.visible = true;
  18076. }
  18077. renderListItem(idx, cell) {
  18078. let xy = this.ysJson[idx];
  18079. cell.height = xy.line * 30;
  18080. cell.xyItem.text = xy.text;
  18081. }
  18082. onDestroy() {
  18083. this.agreeCall = null;
  18084. }
  18085. }
  18086. class UILoading extends UIBase {
  18087. constructor() {
  18088. super();
  18089. this.accTime = 0;
  18090. this.curNum = 0;
  18091. this.rate = 1;
  18092. this.loadSubOk = false;
  18093. this.loadResOK = false;
  18094. this.openLoading = true;
  18095. this.beginLoadRes = false;
  18096. this.finishD2 = false;
  18097. this.finishD3 = false;
  18098. }
  18099. onConstructor() {
  18100. this.ui = ui_UILoading.createInstance();
  18101. this.contentPane = this.ui;
  18102. this.isEject = false;
  18103. this._initUI();
  18104. this._addEvent();
  18105. }
  18106. _initUI() {
  18107. MoyuMgr$1.initMoyu();
  18108. }
  18109. _addEvent() {
  18110. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18111. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18112. }
  18113. show() {
  18114. super.show();
  18115. console.log('zh:加载分包资源');
  18116. loadSubRes(this.subResProgress.bind(this));
  18117. this.ui.txtLoad.text = "Loading...";
  18118. }
  18119. subResProgress(pro, finish) {
  18120. this.curNum = pro;
  18121. if (finish) {
  18122. this.curNum = 1;
  18123. this.loadSubOk = true;
  18124. }
  18125. }
  18126. laodD3Res() {
  18127. let scene3D = new Laya.Scene3D();
  18128. xGame.common.d3Scene = scene3D;
  18129. xGame.common.d3World = scene3D.addComponent(D3World);
  18130. xGame.common.d3World.loadScene();
  18131. }
  18132. loadD2Res() {
  18133. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18134. this.finishD2 = true;
  18135. this.checkLoadAll();
  18136. this.curNum = 1;
  18137. }), Laya.Handler.create(this, (pro) => {
  18138. this.curNum = pro;
  18139. }, null, false));
  18140. }
  18141. d3ResFinish() {
  18142. this.finishD3 = true;
  18143. this.checkLoadAll();
  18144. }
  18145. checkLoadAll() {
  18146. if (this.finishD2 && this.finishD3) {
  18147. this.loadResOK = true;
  18148. }
  18149. }
  18150. loadRes() {
  18151. this.laodD3Res();
  18152. this.loadD2Res();
  18153. }
  18154. myUpdate(dt) {
  18155. if (!this.openLoading)
  18156. return;
  18157. this.accTime += dt * this.rate;
  18158. if (this.accTime >= this.curNum)
  18159. this.accTime = this.curNum;
  18160. this.ui.loadinfo.value = this.accTime * 100;
  18161. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  18162. if (!this.beginLoadRes) {
  18163. this.beginLoadRes = true;
  18164. this.ui.txtLoad.text = "Loading...";
  18165. this.curNum = 0;
  18166. this.accTime = 0;
  18167. this.loadRes();
  18168. }
  18169. if (this.loadResOK) {
  18170. this.openLoading = false;
  18171. Laya.timer.once(300, this, () => {
  18172. xGame.common.d3Scene.active = false;
  18173. MoyuMgr$1.showAgree(enterGame);
  18174. });
  18175. }
  18176. }
  18177. }
  18178. release() {
  18179. }
  18180. hide() {
  18181. super.hide();
  18182. this.release();
  18183. }
  18184. onClose() {
  18185. this.hide();
  18186. }
  18187. }
  18188. UILoading.uiName = "UILoading";
  18189. class UIRepentProp$1 extends UIBase {
  18190. constructor() {
  18191. super();
  18192. this.viewType = 0;
  18193. this.regretType = 0;
  18194. }
  18195. onConstructor() {
  18196. this.ui = ui_UIRepentProp.createInstance();
  18197. this.contentPane = this.ui;
  18198. this.isEject = false;
  18199. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  18200. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  18201. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  18202. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  18203. }
  18204. show(viewType, regretType, callback) {
  18205. PlatMgr.showInsert(true);
  18206. this.viewType = viewType;
  18207. this.regretType = regretType;
  18208. this.callback = callback;
  18209. super.show();
  18210. this.ui.t0.play();
  18211. this.ui.c1.selectedIndex = this.viewType;
  18212. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  18213. if (this.viewType == 0) {
  18214. let guide = DataMgr.getGuideHelpLine();
  18215. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  18216. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  18217. }
  18218. xGame.common.gameMgr.gamePause = true;
  18219. }
  18220. hideSelf() {
  18221. xGame.common.gameMgr.gamePause = false;
  18222. this.callback && this.callback(false);
  18223. this.hide();
  18224. }
  18225. videoRegret() {
  18226. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  18227. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  18228. }
  18229. else {
  18230. console.log('zh:AD 失败,直接发放奖励');
  18231. this.qjff_AD_for_UIrepentProp_videoRegret();
  18232. }
  18233. }
  18234. qjff_AD_for_UIrepentProp_videoRegret() {
  18235. this.callback && this.callback(true);
  18236. this.hideSelf();
  18237. }
  18238. videoAddHelpLine() {
  18239. let guide = DataMgr.getGuideHelpLine();
  18240. if (guide == 0) {
  18241. this.callback && this.callback(true);
  18242. this.hideSelf();
  18243. DataMgr.setGuideHelpLine();
  18244. xGame.common.gameUI.ui.guideNode.visible = false;
  18245. }
  18246. else {
  18247. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  18248. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  18249. }
  18250. else {
  18251. console.log('zh:AD 失败,直接发放奖励');
  18252. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  18253. }
  18254. }
  18255. }
  18256. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  18257. this.callback && this.callback(true);
  18258. this.hideSelf();
  18259. }
  18260. }
  18261. UIRepentProp$1.uiName = "UIRepentProp";
  18262. class UIRodMethod$1 extends UIBase {
  18263. constructor() {
  18264. super();
  18265. this.isPressd = false;
  18266. }
  18267. onConstructor() {
  18268. this.ui = ui_UIRodMethod.createInstance();
  18269. this.contentPane = this.ui;
  18270. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  18271. this.moveDir = new Laya.Vector2();
  18272. this.moveDest = new Laya.Vector2();
  18273. this.centerPos = new Laya.Vector2();
  18274. xGame.common.uiRodMethod = this;
  18275. }
  18276. show() {
  18277. super.show();
  18278. xGame.common.gameMgr.gamePause = true;
  18279. this.openPressDotEvent();
  18280. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  18281. this.centerPos.x = this.ui.white.x;
  18282. this.centerPos.y = this.ui.white.y;
  18283. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  18284. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  18285. this.setDot();
  18286. }
  18287. setDot() {
  18288. this.ui.dot.x = this.moveDest.x;
  18289. this.ui.dot.y = this.moveDest.y;
  18290. }
  18291. closeSelf() {
  18292. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  18293. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  18294. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  18295. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  18296. xGame.common.gameMgr.gamePause = false;
  18297. this.hide();
  18298. }
  18299. openPressDotEvent() {
  18300. this.closePressDotEvent();
  18301. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18302. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18303. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18304. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18305. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18306. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18307. }
  18308. closePressDotEvent() {
  18309. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18310. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18311. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18312. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18313. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18314. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18315. }
  18316. onDown(e) {
  18317. if (e.type == Laya.Event.MOUSE_DOWN)
  18318. this.isPressd = true;
  18319. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  18320. this.isPressd = false;
  18321. if (!this.isPressd)
  18322. return;
  18323. this.moveDest.x = e.stageX;
  18324. this.moveDest.y = e.stageY;
  18325. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  18326. if (dis > 6724) {
  18327. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  18328. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  18329. }
  18330. this.setDot();
  18331. }
  18332. resetRod() {
  18333. this.ui.dot.x = this.ui.white.x;
  18334. this.ui.dot.y = this.ui.white.y;
  18335. this.gameRod.dot.x = this.gameRod.bg.x;
  18336. this.gameRod.dot.y = this.gameRod.bg.y;
  18337. xGame.common.rodOffest.x = 0;
  18338. xGame.common.rodOffest.y = 0;
  18339. }
  18340. }
  18341. UIRodMethod$1.uiName = "UIRodMethod";
  18342. class UIMsg$1 extends UIBase {
  18343. constructor() {
  18344. super();
  18345. }
  18346. onConstructor() {
  18347. this.ui = ui_UIMsg.createInstance();
  18348. this.contentPane = this.ui;
  18349. this.isEject = false;
  18350. this.isMuti = true;
  18351. }
  18352. show(msg, callback) {
  18353. super.show();
  18354. this.ui.tipsNode.msgTxt.text = msg;
  18355. this.ui.alpha = 1;
  18356. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  18357. this.hide();
  18358. callback && callback();
  18359. }), 1000);
  18360. }
  18361. }
  18362. UIMsg$1.uiName = "UIMsg";
  18363. class UITips$1 extends UIBase {
  18364. constructor() {
  18365. super();
  18366. this.type = 0;
  18367. }
  18368. onConstructor() {
  18369. this.ui = ui_UITips.createInstance();
  18370. this.contentPane = this.ui;
  18371. this.isEject = false;
  18372. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  18373. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  18374. }
  18375. show(tipsTxt, womanTxt, type) {
  18376. super.show();
  18377. this.ui.t0.play();
  18378. this.ui.myNode.tipsTxt.text = tipsTxt;
  18379. this.ui.myNode.womanTxt.text = womanTxt;
  18380. PlatMgr.showInsert(true);
  18381. this.ui.myNode.c1.selectedIndex = type;
  18382. this.type = type;
  18383. switch (this.type) {
  18384. case TipsType.exitGame:
  18385. xGame.common.gameMgr.gamePause = true;
  18386. break;
  18387. case TipsType.foul:
  18388. Laya.timer.once(200, this, () => {
  18389. xGame.common.gameMgr.gamePause = true;
  18390. });
  18391. break;
  18392. default:
  18393. break;
  18394. }
  18395. }
  18396. clickLeftBtn() {
  18397. this.hide();
  18398. xGame.common.gameMgr.gamePause = false;
  18399. switch (this.type) {
  18400. case TipsType.exitGame:
  18401. break;
  18402. case TipsType.foul:
  18403. break;
  18404. default:
  18405. break;
  18406. }
  18407. }
  18408. clickRightBtn() {
  18409. this.hide();
  18410. switch (this.type) {
  18411. case TipsType.exitGame:
  18412. xGame.eventMgr.event(RESET_GAME);
  18413. xGame.uiMgr.Show(UIMain$1);
  18414. Moyu.recordEnd(this, null);
  18415. xGame.common.longHelpLine = false;
  18416. break;
  18417. case TipsType.foul:
  18418. xGame.common.gameMgr.gamePause = false;
  18419. Laya.timer.clearAll(this);
  18420. break;
  18421. default:
  18422. break;
  18423. }
  18424. }
  18425. }
  18426. UITips$1.uiName = "UITips";
  18427. class UIGame$1 extends UIBase {
  18428. constructor() {
  18429. super();
  18430. this.powerNum = 0;
  18431. this.isD3Inited = false;
  18432. this.isPrePlay = false;
  18433. this.isMoveRod = false;
  18434. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  18435. this.rulerDis = 20;
  18436. this.rulerOffset = 0;
  18437. }
  18438. onConstructor() {
  18439. this.ui = ui_UIGame.createInstance();
  18440. this.contentPane = this.ui;
  18441. this.ui.x += xGame.common.sysOffestNum;
  18442. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  18443. this.isEject = false;
  18444. xGame.common.gameUI = this;
  18445. this.initSelf();
  18446. }
  18447. isTurnSelf() {
  18448. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  18449. return true;
  18450. }
  18451. }
  18452. initSelf() {
  18453. let topUI = this.ui.topNode;
  18454. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  18455. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  18456. this.barInfo = {};
  18457. this.barInfo.curY = 0;
  18458. this.barInfo.height = this.ui.powerNode.height;
  18459. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  18460. this.barInfo.powerStartY = this.ui.powerNode.y;
  18461. xGame.common.aiPlayer = new AIPlayer();
  18462. xGame.common.gameMgr = new GameMgr();
  18463. xGame.common.skillMgr = new SkillMgr();
  18464. xGame.common.wordsMgr = new WordsMgr();
  18465. xGame.common.talkMgr = new TalkMgr();
  18466. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  18467. console.log("加载经典模式表情文件chenggon !");
  18468. });
  18469. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  18470. console.log("挑战模式奖励模式spine加载成功!");
  18471. });
  18472. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  18473. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  18474. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  18475. this.addUIClick(this.ui.returnBtn, this.returnHome);
  18476. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  18477. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  18478. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  18479. }
  18480. getGanZiImg() {
  18481. let index = DataMgr.getCurBallRod();
  18482. let data = cfgTable.ballrodData[index + 1];
  18483. let gan_url = xGame.common.getGameIconUrl(data.img);
  18484. console.log('zh:getGanZiImg gan_url==' + gan_url);
  18485. this.ui.powerNode.showImg.url = gan_url;
  18486. console.log('zh:修改杆子图标O K');
  18487. }
  18488. returnHome() {
  18489. let tips = "Are you sure to exit the game?";
  18490. let woman = "Boss, why don't you play for a while longer?";
  18491. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  18492. }
  18493. addRodMethodClick() {
  18494. if (this.isTurnSelf()) {
  18495. xGame.uiMgr.Show(UIRodMethod$1);
  18496. }
  18497. }
  18498. clickHelpLineBtn(force = false) {
  18499. if (!this.isTurnSelf())
  18500. return;
  18501. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  18502. if (success) {
  18503. xGame.common.longHelpLine = true;
  18504. xGame.common.d2World.getHelpLine();
  18505. Moyu.sendDataEvent("guideNum");
  18506. }
  18507. else {
  18508. }
  18509. });
  18510. }
  18511. renderSelfDisplayBalls(index, target) {
  18512. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  18513. target.myImg.url = xGame.common.getGameIconUrl(str);
  18514. }
  18515. renderAIDisplayBalls(index, target) {
  18516. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  18517. target.myImg.url = xGame.common.getGameIconUrl(str);
  18518. ;
  18519. }
  18520. updateMode() {
  18521. if (xGame.common.gameMode == GameMode.classic) {
  18522. this.ui.topNode.scoreNode.visible = false;
  18523. }
  18524. else if (xGame.common.gameMode == GameMode.bigMove) {
  18525. this.ui.topNode.scoreNode.visible = true;
  18526. }
  18527. }
  18528. show() {
  18529. super.show();
  18530. console.log("zh:uigame show AADD");
  18531. this.ui.alpha = 0;
  18532. this.updateSelf();
  18533. xGame.common.gameMgr.gamePause = false;
  18534. xGame.common.gameUI.ui.blackAni.visible = false;
  18535. xGame.common.gameUI.ui.whiteAni.visible = false;
  18536. this.ui.powerEft.visible = false;
  18537. this.ui.colorNode.visible = false;
  18538. this.updateHead();
  18539. let curUse = DataMgr.getCurBallRod();
  18540. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  18541. this.getGanZiImg();
  18542. }
  18543. updateSelf() {
  18544. if (xGame.common.gameMode == GameMode.classic) {
  18545. this.ui.c1.selectedIndex = 0;
  18546. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  18547. this.ui.topNode.middleNode.visible = true;
  18548. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  18549. }
  18550. else if (xGame.common.gameMode == GameMode.bigMove) {
  18551. this.ui.c1.selectedIndex = 0;
  18552. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  18553. this.ui.topNode.middleNode.visible = false;
  18554. let max = xGame.cfgMgr.getMaxBigMoveLength();
  18555. let rand = xGame.common.randomNum(1, max);
  18556. let guide = DataMgr.getSkillGuide();
  18557. if (guide == 0)
  18558. rand = 1;
  18559. xGame.common.bigMoveLevelIndex = rand;
  18560. }
  18561. else if (xGame.common.gameMode == GameMode.placeBall) {
  18562. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18563. this.ui.c1.selectedIndex = 1 + data.type;
  18564. this.ui.alpha = 1;
  18565. this.startGame();
  18566. }
  18567. this.updateMode();
  18568. this.initD3world();
  18569. this.initD2world();
  18570. }
  18571. startGame() {
  18572. this.ui.snowNode.visible = Math.random() <= 0.1;
  18573. this.ui.d2Node.visible = false;
  18574. xGame.common.d3World.d3Hand.gameObj.active = false;
  18575. xGame.common.d3World.tableSrc.init();
  18576. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18577. this.cameraViewChange(() => {
  18578. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  18579. switch (xGame.common.gameMode) {
  18580. case GameMode.classic:
  18581. xGame.common.d3World.d3Hand.gameObj.active = true;
  18582. this.playPutBallD3Ani();
  18583. break;
  18584. case GameMode.bigMove:
  18585. this.enterGame();
  18586. Laya.timer.once(500, this, () => {
  18587. this.ui.topNode.middleNode.visible = true;
  18588. this.ui.topNode.middleNode.t0.play();
  18589. });
  18590. break;
  18591. case GameMode.placeBall:
  18592. this.enterGame();
  18593. break;
  18594. default:
  18595. break;
  18596. }
  18597. });
  18598. PlatMgr.showBanner(false);
  18599. }
  18600. enterGame() {
  18601. this.ui.d2Node.visible = true;
  18602. xGame.common.d3World.d3Hand.gameObj.active = false;
  18603. xGame.common.showOneCamera("mainCamera");
  18604. Moyu.recordGame(30, true);
  18605. if (!this.isPrePlay) {
  18606. this.isPrePlay = true;
  18607. xGame.common.d3World.prePlayEft();
  18608. }
  18609. xGame.common.gameMgr.gameReady();
  18610. this.openAllEvent();
  18611. this.ui.snowNode.visible = false;
  18612. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  18613. this.ui.helpBtn.visible = condition;
  18614. }
  18615. showHelpLineGuide() {
  18616. let longGuide = DataMgr.getGuideHelpLine();
  18617. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  18618. this.ui.helpBtn.visible = true;
  18619. this.ui.guideNode.visible = true;
  18620. }
  18621. }
  18622. setTurnAlpha(alpha) {
  18623. this.ui.keduNode.alpha = alpha;
  18624. this.ui.ganNode.alpha = alpha;
  18625. this.ui.rodMethodNode.alpha = alpha;
  18626. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  18627. }
  18628. cameraViewChange(callback) {
  18629. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18630. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  18631. xGame.common.showOneCamera("visitAngle");
  18632. cameraSrc.localRotationEulerY = 180;
  18633. cameraSrc.localRotationEulerZ = 0;
  18634. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  18635. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  18636. callback && callback();
  18637. }));
  18638. }));
  18639. }
  18640. playPutBallD3Ani() {
  18641. xGame.common.showOneCamera("mainCamera");
  18642. let handSrc = xGame.common.d3World.d3Hand;
  18643. handSrc.gameObj.active = true;
  18644. handSrc.transform.localPositionZ = 3;
  18645. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  18646. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  18647. handSrc.gameObj.active = false;
  18648. this.enterGame();
  18649. }), 400);
  18650. }));
  18651. }
  18652. updateHead() {
  18653. let user = Moyu.getUserInfo();
  18654. this.ui.topNode.selfNameTxt.text = user.nickName;
  18655. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  18656. let aiData = xGame.cfgMgr.getRandomUserInfo();
  18657. if (DataMgr.getSkillGuide() < 1) {
  18658. this.ui.topNode.aiNameTxt.text = 'billiards';
  18659. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  18660. }
  18661. else {
  18662. this.ui.topNode.aiNameTxt.text = aiData.name;
  18663. let randNo = Math.floor(Math.random() * 10) + 1;
  18664. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  18665. }
  18666. }
  18667. initD2world() {
  18668. let node = this.ui.d2Root.displayObject;
  18669. let src = node.getComponent(D2World);
  18670. if (!src) {
  18671. xGame.common.d2World = node.addComponent(D2World);
  18672. }
  18673. xGame.common.d2World.initSelf();
  18674. }
  18675. initD3world() {
  18676. if (this.isD3Inited)
  18677. return;
  18678. this.isD3Inited = true;
  18679. let scene3D = xGame.common.d3Scene;
  18680. this.ui.d3Root.displayObject.addChild(scene3D);
  18681. scene3D.active = true;
  18682. xGame.common.d3World.tableSrc.setBorderPos();
  18683. }
  18684. onRootMove(e) {
  18685. let rootBall = xGame.common.d2World.rootBall;
  18686. this.ui.moveNode.x = e.x;
  18687. this.ui.moveNode.y = e.y;
  18688. rootBall.gameObj.x = e.x;
  18689. rootBall.gameObj.y = e.y;
  18690. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  18691. }
  18692. aiRootMove(move) {
  18693. if (move)
  18694. this.hideBallUI();
  18695. else {
  18696. this.showBallUI();
  18697. xGame.common.d2World.getHelpLine();
  18698. }
  18699. }
  18700. aiForce(type, force = 0) {
  18701. this.pressTarget = PressType.powerNode;
  18702. if (type == 1)
  18703. this.onEventUp({ force: true });
  18704. else if (type == 2)
  18705. this.onEventMove({ stageY: force, force: true });
  18706. }
  18707. onEventPress(e) {
  18708. if (e.stopPropagation)
  18709. e.stopPropagation();
  18710. if (!this.isTurnSelf())
  18711. return;
  18712. let target = e.target;
  18713. switch (target) {
  18714. case this.ui.myPowerNode.displayObject:
  18715. this.pressTarget = PressType.powerNode;
  18716. this.barInfo.curY = e.stageY;
  18717. this.updateBarInfo();
  18718. break;
  18719. case this.ui.moveNode.displayObject:
  18720. this.pressTarget = PressType.moveNode;
  18721. this.hideBallUI();
  18722. this.eventObj.curX = this.ui.moveNode.x;
  18723. this.eventObj.curY = this.ui.moveNode.y;
  18724. this.ui.moveNode.finger.visible = false;
  18725. this.eventObj.lastX = e.stageX;
  18726. this.eventObj.lastY = e.stageY;
  18727. break;
  18728. case this.ui.rulerClickNode.displayObject:
  18729. this.pressTarget = PressType.rulerNode;
  18730. this.eventObj.lastY = e.stageY;
  18731. break;
  18732. case this.ui.d2Root.displayObject:
  18733. this.pressTarget = PressType.d2Root;
  18734. this.eventObj.lastX = e.stageX;
  18735. this.eventObj.lastY = e.stageY;
  18736. this.eventObj.starX = e.stageX;
  18737. this.eventObj.starY = e.stageY;
  18738. this.eventObj.curX = 0;
  18739. this.eventObj.curY = 0;
  18740. xGame.common.d2World.d2Gan.setGanLastInfo();
  18741. this.rulerOffset = 0;
  18742. break;
  18743. default:
  18744. break;
  18745. }
  18746. }
  18747. onEventMove(e) {
  18748. if (e.stopPropagation)
  18749. e.stopPropagation();
  18750. if (e && e.force) {
  18751. }
  18752. else {
  18753. if (!this.isTurnSelf())
  18754. return;
  18755. }
  18756. switch (this.pressTarget) {
  18757. case PressType.powerNode:
  18758. this.barInfo.curY = e.stageY;
  18759. this.updateBarInfo();
  18760. this.isMoveRod = true;
  18761. break;
  18762. case PressType.moveNode:
  18763. let rootBall = xGame.common.d2World.rootBall;
  18764. let radius = rootBall.gameObj.width / 2;
  18765. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  18766. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  18767. let border = xGame.common.d2World.borderRect;
  18768. if (curX <= border.x + radius)
  18769. curX = border.x + radius;
  18770. else if (curX >= border.x + border.width - radius)
  18771. curX = border.x + border.width - radius;
  18772. if (curY <= border.y + radius)
  18773. curY = border.y + radius;
  18774. else if (curY >= border.y + border.height - radius)
  18775. curY = border.y + border.height - radius;
  18776. if (xGame.common.gameMgr.isOpenBall) {
  18777. if (curX >= border.x + border.openBallW - radius)
  18778. curX = border.x + border.openBallW - radius;
  18779. }
  18780. this.ui.moveNode.x = curX;
  18781. this.ui.moveNode.y = curY;
  18782. rootBall.gameObj.x = curX;
  18783. rootBall.gameObj.y = curY;
  18784. rootBall.d3BallSrc.setTransPos(curX, curY);
  18785. this.isMoveRod = true;
  18786. break;
  18787. case PressType.rulerNode:
  18788. let yy = e.stageY - this.eventObj.lastY;
  18789. this.eventObj.lastY = e.stageY;
  18790. let ruler1 = this.ui.rulerNode.img1;
  18791. let ruler2 = this.ui.rulerNode.img2;
  18792. ruler1.y += yy;
  18793. ruler2.y += yy;
  18794. this.rulerOffset += yy;
  18795. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  18796. this.rulerOffset = 0;
  18797. xGame.soundMgr.playSound("inch", 1, 10);
  18798. }
  18799. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  18800. let h = ruler1.height;
  18801. this.checkGuide();
  18802. this.isMoveRod = true;
  18803. if (ruler1.y >= h) {
  18804. ruler1.y = -h;
  18805. ruler2.y = 0;
  18806. return;
  18807. }
  18808. else if (ruler1.y <= -h) {
  18809. ruler1.y = h;
  18810. ruler2.y = 0;
  18811. return;
  18812. }
  18813. if (ruler2.y >= h) {
  18814. ruler2.y = -h;
  18815. ruler1.y = 0;
  18816. return;
  18817. }
  18818. else if (ruler2.y <= -h) {
  18819. ruler2.y = h;
  18820. ruler1.y = 0;
  18821. return;
  18822. }
  18823. break;
  18824. case PressType.d2Root:
  18825. this.eventObj.curX = e.stageX;
  18826. this.eventObj.curY = e.stageY;
  18827. let offset = this.checkRodMoveDir();
  18828. xGame.common.d2World.d2Gan.rotateSelf(offset);
  18829. this.eventObj.lastX = e.stageX;
  18830. this.eventObj.lastY = e.stageY;
  18831. break;
  18832. default:
  18833. break;
  18834. }
  18835. }
  18836. onEventUp(e) {
  18837. if (e.stopPropagation)
  18838. e.stopPropagation();
  18839. if (e && e.force) {
  18840. }
  18841. else {
  18842. if (!this.isTurnSelf())
  18843. return;
  18844. }
  18845. switch (this.pressTarget) {
  18846. case PressType.powerNode:
  18847. this.ui.powerNode.value = 0;
  18848. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18849. this.ui.powerTxt.text = "";
  18850. if (this.powerNum > 0) {
  18851. xGame.eventMgr.event(BALL_SHOOT);
  18852. xGame.common.d2World.shoot(this.powerNum);
  18853. xGame.common.d2World.d2Gan.shoot();
  18854. xGame.common.d2World.d2HelpLine.shoot();
  18855. this.finishGuide();
  18856. this.ui.powerEft.visible = false;
  18857. this.ui.colorNode.visible = false;
  18858. let ganStr = "";
  18859. if (this.powerNum <= 30) {
  18860. ganStr = "gan_30";
  18861. }
  18862. else if (this.powerNum <= 60) {
  18863. ganStr = "gan_50";
  18864. }
  18865. else {
  18866. ganStr = "gan_80";
  18867. }
  18868. xGame.soundMgr.playSound(ganStr);
  18869. }
  18870. break;
  18871. case PressType.moveNode:
  18872. let rootBall = xGame.common.d2World.rootBall;
  18873. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  18874. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  18875. let isIntersect = this.judgeBallIntersect();
  18876. if (isIntersect) {
  18877. this.ui.moveNode.x = lastX;
  18878. this.ui.moveNode.y = lastY;
  18879. rootBall.gameObj.x = lastX;
  18880. rootBall.gameObj.y = lastY;
  18881. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  18882. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  18883. }
  18884. else {
  18885. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  18886. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  18887. }
  18888. this.showBallUI();
  18889. this.ui.moveNode.finger.visible = true;
  18890. xGame.common.d2World.getHelpLine();
  18891. break;
  18892. case PressType.rulerNode:
  18893. break;
  18894. case PressType.d2Root:
  18895. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  18896. if (dis <= 25) {
  18897. this.moveToClickDot(e);
  18898. }
  18899. break;
  18900. default:
  18901. break;
  18902. }
  18903. this.pressTarget = -1;
  18904. }
  18905. checkGuide() {
  18906. let guide = DataMgr.getSkillGuide();
  18907. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  18908. xGame.common.guideStep++;
  18909. xGame.common.gameUI.ui.guide2.visible = false;
  18910. xGame.common.gameUI.ui.guide3.visible = true;
  18911. }
  18912. }
  18913. finishGuide() {
  18914. let guide = DataMgr.getSkillGuide();
  18915. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  18916. xGame.common.guideStep = 10;
  18917. this.closeAllGuide();
  18918. console.log('zh: 新手引导完毕');
  18919. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  18920. }
  18921. }
  18922. closeAllGuide() {
  18923. xGame.common.gameUI.ui.guide1.visible = false;
  18924. xGame.common.gameUI.ui.guide2.visible = false;
  18925. xGame.common.gameUI.ui.guide3.visible = false;
  18926. }
  18927. updateBarInfo() {
  18928. let star = this.ui.powerNode.y;
  18929. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18930. if (rate >= 1)
  18931. rate = 1;
  18932. if (rate <= 0)
  18933. rate = 0;
  18934. this.powerNum = Math.ceil(rate * 100);
  18935. this.ui.powerNode.value = this.powerNum;
  18936. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18937. this.ui.colorNode.value = this.powerNum;
  18938. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18939. this.ui.powerEft.visible = this.powerNum != 0;
  18940. this.ui.colorNode.visible = this.powerNum != 0;
  18941. this.ui.powerTxt.text = this.powerNum + "";
  18942. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18943. }
  18944. forceCancel() {
  18945. this.ui.powerNode.value = 0;
  18946. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18947. this.ui.powerTxt.text = "";
  18948. }
  18949. checkRodMoveDir() {
  18950. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18951. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18952. if (tempX >= 0 && tempY <= 0) {
  18953. return this.checkDir();
  18954. }
  18955. else if (tempX < 0 && tempY < 0) {
  18956. return this.checkDir(1, -1);
  18957. }
  18958. else if (tempX < 0 && tempY > 0) {
  18959. return this.checkDir(-1, -1);
  18960. }
  18961. else {
  18962. return this.checkDir(-1, 1);
  18963. }
  18964. }
  18965. checkDir(flagX = 1, flagY = 1) {
  18966. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18967. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18968. if (offsetY == 0) {
  18969. return offsetX * flagX;
  18970. }
  18971. if (offsetX == 0) {
  18972. return offsetY * flagY;
  18973. }
  18974. let angle = offsetY / offsetX;
  18975. if (Math.abs(angle) >= 1) {
  18976. return offsetY * flagY;
  18977. }
  18978. else {
  18979. return offsetX * flagX;
  18980. }
  18981. }
  18982. judgeBallIntersect() {
  18983. let rootBall = xGame.common.d2World.rootBall;
  18984. let ballArr = xGame.common.d2World.ballArr;
  18985. let radius = rootBall.gameObj.width / 2;
  18986. let temp;
  18987. let isIntersect = false;
  18988. for (let index = 0; index < ballArr.length; index++) {
  18989. temp = ballArr[index];
  18990. if (temp.number == rootBall.number)
  18991. continue;
  18992. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18993. if (isIntersect) {
  18994. break;
  18995. }
  18996. }
  18997. return isIntersect;
  18998. }
  18999. hideBallUI() {
  19000. let d2Gan = xGame.common.d2World.d2Gan;
  19001. if (!d2Gan.ui.isDisposed)
  19002. d2Gan.ui.visible = false;
  19003. let d2Help = xGame.common.d2World.d2HelpLine;
  19004. if (!d2Help.ui.isDisposed)
  19005. d2Help.ui.visible = false;
  19006. let rootBall = xGame.common.d2World.rootBall;
  19007. if (!rootBall.destroyed) {
  19008. rootBall.gameObj.active = false;
  19009. }
  19010. }
  19011. showBallUI() {
  19012. let d2Gan = xGame.common.d2World.d2Gan;
  19013. if (!d2Gan.ui.isDisposed)
  19014. d2Gan.ui.visible = true;
  19015. let d2Help = xGame.common.d2World.d2HelpLine;
  19016. if (!d2Help.ui.isDisposed)
  19017. d2Help.ui.visible = true;
  19018. let rootBall = xGame.common.d2World.rootBall;
  19019. if (!rootBall.destroyed) {
  19020. rootBall.gameObj.active = true;
  19021. }
  19022. }
  19023. moveToClickDot(e) {
  19024. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19025. let root = xGame.common.d2World.rootBall.gameObj;
  19026. let xx = e.stageX - xGame.common.sysOffestNum;
  19027. let yy = e.stageY;
  19028. let x = xx - root.x;
  19029. let y = yy - root.y;
  19030. let angle = xGame.common.getfguiRotation(x, y);
  19031. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19032. xGame.common.d2World.getHelpLine();
  19033. }
  19034. this.isMoveRod = false;
  19035. xGame.common.clickedBall = false;
  19036. }
  19037. openAllEvent() {
  19038. this.closeAllEvent();
  19039. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19040. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19041. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19042. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19043. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19044. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19045. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19046. }
  19047. closeAllEvent() {
  19048. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19049. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19050. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19051. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19052. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19053. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19054. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19055. }
  19056. resetGame() {
  19057. this.closeAllEvent();
  19058. this.hideBallUI();
  19059. xGame.common.gameMgr.gamePause = true;
  19060. }
  19061. }
  19062. UIGame$1.uiName = "UIGame";
  19063. class UIAddCoin$1 extends UIBase {
  19064. constructor() {
  19065. super();
  19066. this.coinNum = 2000;
  19067. }
  19068. onConstructor() {
  19069. this.ui = ui_UIAddCoin.createInstance();
  19070. this.contentPane = this.ui;
  19071. this.isEject = false;
  19072. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19073. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19074. }
  19075. show() {
  19076. super.show();
  19077. this.ui.t0.play();
  19078. }
  19079. videoAddCoin() {
  19080. console.log('zh:qjff_AD_for_UIAddCoin');
  19081. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19082. }
  19083. else {
  19084. console.log('zh:AD 失败,直接发放奖励');
  19085. this.qjff_AD_for_UIAddCoin();
  19086. }
  19087. }
  19088. qjff_AD_for_UIAddCoin() {
  19089. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19090. this.hide();
  19091. }
  19092. }
  19093. UIAddCoin$1.uiName = "UIAddCoin";
  19094. class UIInvitation$1 extends UIBase {
  19095. constructor() {
  19096. super();
  19097. }
  19098. onConstructor() {
  19099. this.ui = ui_UIInvitation.createInstance();
  19100. this.contentPane = this.ui;
  19101. this.isEject = false;
  19102. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19103. }
  19104. show() {
  19105. super.show();
  19106. }
  19107. enterGame() {
  19108. xGame.common.gameMode = GameMode.classic;
  19109. DataMgr.setChallengeTimes(1);
  19110. xGame.common.passAwardCoin = 2000;
  19111. let need = xGame.common.classicNiceNeddCoin;
  19112. if (DataMgr.coinEnough(need)) {
  19113. DataMgr.setCoin(-need);
  19114. xGame.eventMgr.event(RESTART_GAME, true);
  19115. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19116. }
  19117. else {
  19118. xGame.eventMgr.event(RESTART_GAME, true);
  19119. }
  19120. this.hide();
  19121. }
  19122. hide() {
  19123. super.hide();
  19124. }
  19125. }
  19126. UIInvitation$1.uiName = "UIInvitation";
  19127. class UIPower$1 extends UIBase {
  19128. constructor() {
  19129. super();
  19130. }
  19131. onConstructor() {
  19132. this.ui = ui_UIPower.createInstance();
  19133. this.contentPane = this.ui;
  19134. this.isEject = false;
  19135. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19136. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  19137. }
  19138. show() {
  19139. super.show();
  19140. this.ui.t0.play();
  19141. }
  19142. videoGetPower() {
  19143. console.log('zh:qjff_AD_for_uipower');
  19144. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  19145. }
  19146. else {
  19147. console.log('zh:AD 失败,直接发放奖励');
  19148. this.qjff_AD_for_uipower();
  19149. }
  19150. }
  19151. qjff_AD_for_uipower() {
  19152. DataMgr.setPower(xGame.common.videoPower, true);
  19153. xGame.eventMgr.event(POWER_TIME);
  19154. this.hide();
  19155. }
  19156. }
  19157. UIPower$1.uiName = "UIPower";
  19158. class UIGameEnd$1 extends UIBase {
  19159. constructor() {
  19160. super();
  19161. this.success = false;
  19162. this.awardCoinNum = 1000;
  19163. this.awardDiamondNum = 10;
  19164. }
  19165. onConstructor() {
  19166. this.ui = ui_UIGameEnd.createInstance();
  19167. this.contentPane = this.ui;
  19168. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  19169. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  19170. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  19171. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19172. this.ui.talkNode.visible = false;
  19173. if (Moyu.isKs)
  19174. this.ui.closeNode.closeBtn.x += 100;
  19175. }
  19176. updateType() {
  19177. switch (xGame.common.gameMode) {
  19178. case GameMode.classic:
  19179. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19180. this.ui.coinNode.visible = this.success;
  19181. if (!this.success) {
  19182. Laya.timer.once(500, this, () => {
  19183. xGame.uiMgr.Show(UIAddCoin$1);
  19184. });
  19185. }
  19186. else {
  19187. this.logEventForClassic_win();
  19188. }
  19189. this.logEventForClassic_complete();
  19190. this.ui.isGetAward.visible = false;
  19191. this.ui.leftBtn.c1.selectedIndex = 3;
  19192. this.ui.rightBtn.c1.selectedIndex = 0;
  19193. this.moneyNode.ui.c1.selectedIndex = 1;
  19194. break;
  19195. case GameMode.bigMove:
  19196. console.log('zh:招法模式 aaaaaa bigMove');
  19197. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19198. this.ui.coinNode.visible = this.success;
  19199. if (xGame.common.gameMode == GameMode.bigMove) {
  19200. if (this.success) {
  19201. DataMgr.setSkillSuccessTimes(1, true);
  19202. DataMgr.setSkillAccTimes(1);
  19203. }
  19204. else {
  19205. DataMgr.setSkillSuccessTimes(0, false);
  19206. }
  19207. }
  19208. this.logEventForRod_complete_N();
  19209. if (!this.success) {
  19210. Laya.timer.once(500, this, () => {
  19211. xGame.uiMgr.Show(UIAddCoin$1);
  19212. });
  19213. }
  19214. else {
  19215. this.logEventForRod_win();
  19216. }
  19217. this.ui.isGetAward.visible = false;
  19218. this.ui.leftBtn.c1.selectedIndex = 3;
  19219. this.ui.rightBtn.c1.selectedIndex = 0;
  19220. this.moneyNode.ui.c1.selectedIndex = 1;
  19221. break;
  19222. case GameMode.placeBall:
  19223. this.ui.coinNode.visible = false;
  19224. if (this.success) {
  19225. if (xGame.common.placeBallStarNum == 3) {
  19226. this.ui.c1.selectedIndex = 2;
  19227. }
  19228. else {
  19229. this.ui.c1.selectedIndex = 3;
  19230. }
  19231. let level = xGame.common.placeBallCurLevel;
  19232. if (level > 59) {
  19233. this.logEventForChallenge_level_complete(level);
  19234. }
  19235. else {
  19236. this.logEventForChallenge_level_N(level);
  19237. }
  19238. }
  19239. else {
  19240. this.ui.c1.selectedIndex = 4;
  19241. }
  19242. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19243. if (cfg.type == PlaceBallType.challenge) {
  19244. this.ui.c1.selectedIndex = 2;
  19245. }
  19246. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  19247. this.updatePlaceBallBtn();
  19248. this.updatePlaceBallStarNum();
  19249. this.updatePlaceBallAwardState();
  19250. this.moneyNode.ui.c1.selectedIndex = 2;
  19251. this.moneyNode.checkPowerTime();
  19252. this.moneyNode.powerChange();
  19253. DataMgr.upRankData();
  19254. break;
  19255. default:
  19256. break;
  19257. }
  19258. }
  19259. logEventForRod_complete_N() {
  19260. let gfmsIdx = xGame.common.curPlayerSkillType;
  19261. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  19262. let gfmc = 'Skyfall Shot';
  19263. if (gfmsIdx == 0) {
  19264. gfmc = 'Skyfall Shot';
  19265. }
  19266. if (gfmsIdx == 1) {
  19267. gfmc = 'Surging break';
  19268. }
  19269. if (gfmsIdx == 2) {
  19270. gfmc = 'Frost Lock';
  19271. }
  19272. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19273. console.log('zh:logEventForRod_complete_N level = ' + level);
  19274. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19275. let jsonStr = {
  19276. "count": 0,
  19277. "name": gfmc
  19278. };
  19279. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19280. const d = LocalStorageManager.getItem(keyStr);
  19281. jsonStr.count = d.count + 1;
  19282. LocalStorageManager.setItem(keyStr, jsonStr);
  19283. }
  19284. else {
  19285. LocalStorageManager.setItem(keyStr, jsonStr);
  19286. }
  19287. const d2 = LocalStorageManager.getItem(keyStr);
  19288. let count = d2.count;
  19289. console.log('zh:logEventForRod_complete_N count = ' + count);
  19290. if (count % 5 == 0) {
  19291. const reqStr = JSON.stringify(jsonStr);
  19292. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  19293. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  19294. }
  19295. }
  19296. logEventForRod_win() {
  19297. console.log('zh:logEventForRod_win,胜利');
  19298. let gfmsIdx = xGame.common.curPlayerSkillType;
  19299. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  19300. let gfmc = 'Skyfall Shot';
  19301. if (gfmsIdx == 0) {
  19302. gfmc = 'Skyfall Shot';
  19303. }
  19304. if (gfmsIdx == 1) {
  19305. gfmc = 'Surging break';
  19306. }
  19307. if (gfmsIdx == 2) {
  19308. gfmc = 'Frost Lock';
  19309. }
  19310. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19311. console.log('zh:logEventForRod_win level = ' + level);
  19312. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  19313. let jsonStr = {
  19314. "count": 1,
  19315. "name": gfmc + ' Lev' + level
  19316. };
  19317. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19318. const d = LocalStorageManager.getItem(keyStr);
  19319. jsonStr.count = d.count + 1;
  19320. LocalStorageManager.setItem(keyStr, jsonStr);
  19321. }
  19322. else {
  19323. LocalStorageManager.setItem(keyStr, jsonStr);
  19324. }
  19325. const reqStr = JSON.stringify(jsonStr);
  19326. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  19327. }
  19328. logEventForClassic_win() {
  19329. console.log('zh:logEventForClassic_win,胜利');
  19330. let rtype = xGame.common.classicRoomType;
  19331. let msmc = '';
  19332. if (rtype == 1) {
  19333. msmc = 'beginner';
  19334. }
  19335. if (rtype == 2) {
  19336. msmc = 'expert';
  19337. }
  19338. if (rtype == 3) {
  19339. msmc = 'master';
  19340. }
  19341. let keyStr = 'sjmd_classic_win_' + rtype;
  19342. let jsonStr = {
  19343. "difficulty": msmc,
  19344. "classic_count": 1,
  19345. "difficulty_count": 1
  19346. };
  19347. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19348. const d = LocalStorageManager.getItem(keyStr);
  19349. jsonStr.classic_count = d.classic_count + 1;
  19350. jsonStr.difficulty_count = d.difficulty_count + 1;
  19351. LocalStorageManager.setItem(keyStr, jsonStr);
  19352. }
  19353. else {
  19354. LocalStorageManager.setItem(keyStr, jsonStr);
  19355. }
  19356. const reqStr = JSON.stringify(jsonStr);
  19357. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  19358. }
  19359. logEventForClassic_complete() {
  19360. console.log('zh:logEventForClassic_complete,胜利');
  19361. let rtype = xGame.common.classicRoomType;
  19362. let msmc = '';
  19363. if (rtype == 1) {
  19364. msmc = 'beginner';
  19365. }
  19366. if (rtype == 2) {
  19367. msmc = 'expert';
  19368. }
  19369. if (rtype == 3) {
  19370. msmc = 'master';
  19371. }
  19372. let keyStr = 'sjmd_classic_complete_' + rtype;
  19373. let jsonStr = {
  19374. "msmc": msmc,
  19375. "count": 0
  19376. };
  19377. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19378. const d = LocalStorageManager.getItem(keyStr);
  19379. jsonStr.count = d.count + 1;
  19380. LocalStorageManager.setItem(keyStr, jsonStr);
  19381. }
  19382. else {
  19383. LocalStorageManager.setItem(keyStr, jsonStr);
  19384. }
  19385. if (jsonStr.count % 5 == 0) {
  19386. const reqStr = JSON.stringify(jsonStr);
  19387. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  19388. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  19389. }
  19390. }
  19391. updatePlaceBallBtn() {
  19392. this.ui.leftBtn.c1.selectedIndex = 5;
  19393. if (this.success) {
  19394. this.ui.rightBtn.c1.selectedIndex = 14;
  19395. }
  19396. else {
  19397. if (xGame.common.placeBallStarNum == 3) {
  19398. this.ui.rightBtn.c1.selectedIndex = 14;
  19399. }
  19400. else {
  19401. this.ui.rightBtn.c1.selectedIndex = 1;
  19402. }
  19403. }
  19404. }
  19405. updatePlaceBallStarNum() {
  19406. let starNum = xGame.common.placeBallStarNum;
  19407. if (starNum == 0)
  19408. this.ui.starNumNode.c1.selectedIndex = 3;
  19409. else {
  19410. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  19411. }
  19412. }
  19413. updatePlaceBallAwardState() {
  19414. let level = xGame.common.placeBallCurLevel;
  19415. let starNum = xGame.common.placeBallStarNum;
  19416. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19417. let data = cfgTable.placeballData[level].award;
  19418. let cfg = cfgTable.placeballData[level];
  19419. this.awardDiamondNum = data[1];
  19420. this.awardCoinNum = data[0];
  19421. if (cfg.type == PlaceBallType.challenge) {
  19422. this.awardDiamondNum = 0;
  19423. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19424. }
  19425. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  19426. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  19427. if (cfg.type == PlaceBallType.challenge) {
  19428. this.ui.awardNode.coinNode.visible = true;
  19429. }
  19430. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  19431. this.ui.awardNode.diamondNode.x = 265;
  19432. this.ui.awardNode.coinNode.x = 354;
  19433. }
  19434. else {
  19435. this.ui.awardNode.diamondNode.x = 291;
  19436. this.ui.awardNode.coinNode.x = 291;
  19437. }
  19438. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  19439. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  19440. if (this.awardCoinNum == 0) {
  19441. this.ui.awardNode.coinNode.numTxt.text = "";
  19442. }
  19443. if (getAward) {
  19444. this.ui.isGetAward.visible = true;
  19445. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  19446. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  19447. }
  19448. else {
  19449. this.ui.isGetAward.visible = false;
  19450. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  19451. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  19452. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  19453. }
  19454. else {
  19455. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  19456. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  19457. }
  19458. }
  19459. }
  19460. show(success) {
  19461. super.show();
  19462. xGame.eventMgr.event(RESET_GAME);
  19463. this.success = success;
  19464. Laya.timer.clearAll(this);
  19465. this.playSecretaryAni();
  19466. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  19467. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  19468. offsetTime = Math.floor(offsetTime / 1000);
  19469. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  19470. this.updateType();
  19471. Laya.timer.once(200, this, () => {
  19472. this.addAward(() => {
  19473. this.updateType();
  19474. Laya.timer.once(500, this, () => {
  19475. this.showChallengeLevel();
  19476. });
  19477. });
  19478. });
  19479. if (this.success) {
  19480. JSBridgeUtils.instance.showInternAd('gameend_success');
  19481. console.log('zh:game end 成功');
  19482. xGame.soundMgr.playSound('slots_roll01');
  19483. xGame.soundMgr.playSound("s_win");
  19484. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19485. this.diyGameDataUtilForGameWin();
  19486. }
  19487. else {
  19488. JSBridgeUtils.instance.showInternAd('gameend_faill');
  19489. console.log('zh:game end失败');
  19490. xGame.soundMgr.playSound('matchwin01');
  19491. xGame.soundMgr.playSound("s_lose");
  19492. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19493. }
  19494. let challengeNum = DataMgr.getChallengeTimes();
  19495. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  19496. DataMgr.setChallengeTimes(1);
  19497. }
  19498. if (this.success && xGame.common.gameMode == GameMode.classic) {
  19499. DataMgr.setClassicTimes();
  19500. }
  19501. }
  19502. diyGameDataUtilForGameWin() {
  19503. console.log('zh: DiyGameDataUtilForGameWin diy ');
  19504. switch (xGame.common.gameMode) {
  19505. case GameMode.classic:
  19506. console.log('zh:DiyGameDataUtilForGameWin 111');
  19507. case GameMode.bigMove:
  19508. console.log('zh:DiyGameDataUtilForGameWin 222');
  19509. this.restartGame();
  19510. break;
  19511. case GameMode.placeBall:
  19512. console.log('zh:DiyGameDataUtilForGameWin 333');
  19513. var level = xGame.common.placeBallCurLevel;
  19514. console.log('zh:练习模式 联系了多少LEV=' + level);
  19515. let db_over_lev = DataMgr.getChallengeMode_overLev();
  19516. if (level > db_over_lev) {
  19517. DataMgr.setChallengeMode_overLev(level);
  19518. }
  19519. break;
  19520. default:
  19521. console.log('zh:DiyGameDataUtilForGameWin 444');
  19522. break;
  19523. }
  19524. }
  19525. showChallengeLevel() {
  19526. if (DataMgr.getChallengeTimes() != 0)
  19527. return;
  19528. let skill = DataMgr.getSkillAccTimes();
  19529. let put = DataMgr.getPlaceBallLevelList().length;
  19530. if (skill >= 3 || put >= 5) {
  19531. xGame.uiMgr.Show(UIInvitation$1);
  19532. this.hide();
  19533. }
  19534. }
  19535. addAward(callback) {
  19536. if (!this.success) {
  19537. callback && callback();
  19538. return;
  19539. }
  19540. switch (xGame.common.gameMode) {
  19541. case GameMode.classic:
  19542. this.awardCoinNum = xGame.common.passAwardCoin;
  19543. this.awardDiamondNum = 0;
  19544. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19545. break;
  19546. case GameMode.bigMove:
  19547. this.awardCoinNum = xGame.common.passAwardCoin;
  19548. this.awardDiamondNum = 0;
  19549. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19550. callback && callback();
  19551. break;
  19552. case GameMode.placeBall:
  19553. let level = xGame.common.placeBallCurLevel;
  19554. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  19555. if (xGame.common.placeBallStarNum != 3) {
  19556. callback && callback();
  19557. return;
  19558. }
  19559. else {
  19560. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19561. if (getAward) {
  19562. callback && callback();
  19563. return;
  19564. }
  19565. }
  19566. let cfg = cfgTable.placeballData[level];
  19567. let data = cfgTable.placeballData[level].award;
  19568. this.awardCoinNum = data[0];
  19569. this.awardDiamondNum = data[1];
  19570. if (cfg.type == PlaceBallType.challenge) {
  19571. this.awardDiamondNum = 0;
  19572. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19573. }
  19574. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  19575. let diamondAward;
  19576. if (this.awardDiamondNum > 0) {
  19577. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  19578. xGame.common.getAward([diamondAward, coinAward], callback);
  19579. }
  19580. else {
  19581. xGame.common.getAward([coinAward], callback);
  19582. }
  19583. if (cfg.type == PlaceBallType.normal) {
  19584. DataMgr.setPlaceBallAward(level);
  19585. }
  19586. break;
  19587. default:
  19588. break;
  19589. }
  19590. }
  19591. playSecretaryAni_old() {
  19592. let parent = this.ui.secretary.displayObject;
  19593. parent.destroyChildren();
  19594. let xx = this.ui.secretary.width / 2;
  19595. let yy = this.ui.secretary.height;
  19596. let scale = xGame.common.getSecretaryScale();
  19597. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19598. if (this.success) {
  19599. let rand = Math.random() <= 0.5 ? 2 : 3;
  19600. xGame.common.secretary.play(data, rand, false, parent, () => {
  19601. xGame.common.secretary.play(data, 1, true, parent);
  19602. });
  19603. }
  19604. else {
  19605. xGame.common.secretary.play(data, 0, true, parent);
  19606. }
  19607. }
  19608. playSecretaryAni() {
  19609. let parent = this.ui.secretary.displayObject;
  19610. parent.destroyChildren();
  19611. let xx = this.ui.secretary.width / 2;
  19612. let yy = this.ui.secretary.height;
  19613. let scale = xGame.common.getSecretaryScale();
  19614. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19615. if (this.success) {
  19616. let rand = 0;
  19617. xGame.common.secretary.play(data, 0, true, parent);
  19618. }
  19619. else {
  19620. xGame.common.secretary.play(data, 0, true, parent);
  19621. }
  19622. }
  19623. restartGame() {
  19624. switch (xGame.common.gameMode) {
  19625. case GameMode.classic:
  19626. xGame.eventMgr.event(RESTART_GAME);
  19627. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19628. break;
  19629. case GameMode.bigMove:
  19630. this.hide();
  19631. xGame.eventMgr.event(RESTART_GAME);
  19632. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19633. break;
  19634. default:
  19635. break;
  19636. }
  19637. }
  19638. hide() {
  19639. super.hide();
  19640. xGame.common.stopGirlPop(this.ui.talkNode);
  19641. PlatMgr.showBanner(false);
  19642. }
  19643. returnHome() {
  19644. this.hide();
  19645. let showFailWords = !this.success;
  19646. xGame.uiMgr.Show(UIMain$1, showFailWords);
  19647. }
  19648. clickLeftBtn() {
  19649. switch (xGame.common.gameMode) {
  19650. case GameMode.classic:
  19651. case GameMode.bigMove:
  19652. this.returnHome();
  19653. break;
  19654. case GameMode.placeBall:
  19655. let level = xGame.common.placeBallCurLevel;
  19656. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  19657. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19658. break;
  19659. default:
  19660. break;
  19661. }
  19662. }
  19663. powerStartPlaceBallLevel(level, btn) {
  19664. if (DataMgr.powerEnough()) {
  19665. btn.touchable = false;
  19666. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19667. btn.touchable = true;
  19668. DataMgr.setPower(-1);
  19669. xGame.eventMgr.event(POWER_TIME);
  19670. this.startPlaceBallLevel(level);
  19671. this.logEventForChallenge_level_start(level);
  19672. }));
  19673. }
  19674. else {
  19675. xGame.uiMgr.Show(UIPower$1, 0);
  19676. }
  19677. }
  19678. clickRightBtn() {
  19679. switch (xGame.common.gameMode) {
  19680. case GameMode.classic:
  19681. console.log('zh:clickRightBtn 111');
  19682. case GameMode.bigMove:
  19683. console.log('zh:clickRightBtn 222');
  19684. this.restartGame();
  19685. break;
  19686. case GameMode.placeBall:
  19687. console.log('zh:clickRightBtn 333');
  19688. let level = xGame.common.placeBallCurLevel;
  19689. let data = DataMgr.getPlaceBallLevel(level);
  19690. let curPss = data.play && !data.isCur;
  19691. if (curPss) {
  19692. console.log('zh:clickRightBtn 333-111');
  19693. console.log('zh:当前LV=' + level);
  19694. if (level == 60) {
  19695. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  19696. Laya.timer.once(3000, this, () => {
  19697. this.returnHome();
  19698. });
  19699. }
  19700. else {
  19701. let lev = level + 1;
  19702. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  19703. }
  19704. }
  19705. else {
  19706. console.log('zh:clickRightBtn 333-000');
  19707. Moyu.sendDataEvent("placeBallNextLevel");
  19708. console.log('zh:qjff_AD_for_uiGameEnd');
  19709. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  19710. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  19711. }
  19712. else {
  19713. console.log('zh:AD 失败,直接发放奖励');
  19714. this.qjff_AD_for_uiGameEnd(level);
  19715. }
  19716. }
  19717. break;
  19718. default:
  19719. console.log('zh:clickRightBtn 444');
  19720. break;
  19721. }
  19722. }
  19723. logEventForChallenge_level_start(level) {
  19724. let keyStr = 'sjmd_challenge_level_start';
  19725. let jsonStr = {
  19726. "count": 0,
  19727. "gold_balance ": DataMgr.getCoin(),
  19728. "level": level,
  19729. "diamond_balance ": DataMgr.getDiamond()
  19730. };
  19731. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19732. const d = LocalStorageManager.getItem(keyStr);
  19733. if (level > d.level) {
  19734. jsonStr.count = d.count + 1;
  19735. LocalStorageManager.setItem(keyStr, jsonStr);
  19736. }
  19737. else {
  19738. }
  19739. }
  19740. else {
  19741. LocalStorageManager.setItem(keyStr, jsonStr);
  19742. }
  19743. const reqStr = JSON.stringify(jsonStr);
  19744. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  19745. }
  19746. qjff_AD_for_uiGameEnd(level) {
  19747. DataMgr.setPlaceBallLevel(level, 1);
  19748. this.startPlaceBallLevel(level + 1);
  19749. }
  19750. startPlaceBallLevel(level) {
  19751. xGame.common.gameMode = GameMode.placeBall;
  19752. xGame.common.placeBallCurLevel = level;
  19753. xGame.uiMgr.Show(UIGame$1);
  19754. this.hide();
  19755. }
  19756. logEventForChallenge_level_complete(level) {
  19757. let keyStr = 'sjmd_challenge_level_complete';
  19758. let jsonStr = {
  19759. "count": 1,
  19760. "gold_balance ": DataMgr.getCoin(),
  19761. "level": level,
  19762. "diamond_balance ": DataMgr.getDiamond()
  19763. };
  19764. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19765. const d = LocalStorageManager.getItem(keyStr);
  19766. jsonStr.count = d.count + 1;
  19767. LocalStorageManager.setItem(keyStr, jsonStr);
  19768. }
  19769. else {
  19770. LocalStorageManager.setItem(keyStr, jsonStr);
  19771. }
  19772. const reqStr = JSON.stringify(jsonStr);
  19773. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  19774. }
  19775. logEventForChallenge_level_N(level) {
  19776. console.log('zh:logEventForChallenge_level_N ' + level);
  19777. let keyStr = 'sjmd_challenge_level_N';
  19778. if (LocalStorageManager.hasKey(keyStr)) {
  19779. let lev = LocalStorageManager.getItem(keyStr);
  19780. if (level > lev) {
  19781. LocalStorageManager.setItem(keyStr, level);
  19782. }
  19783. if ((level) % 5 == 0) {
  19784. console.log('zh:每5关上报1次');
  19785. let sjmc = 'challenge_level_' + level;
  19786. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  19787. let sjmcForFirebase = 'challenge_level_' + level;
  19788. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  19789. }
  19790. else {
  19791. console.log('zh:5 no 上报');
  19792. }
  19793. }
  19794. else {
  19795. LocalStorageManager.setItem(keyStr, level);
  19796. }
  19797. }
  19798. }
  19799. UIGameEnd$1.uiName = "UIGameEnd";
  19800. class ShowItem$1 {
  19801. constructor() {
  19802. this.ui = ui_ShowItem.createInstance();
  19803. }
  19804. destroySelf() {
  19805. if (!this.ui.isDisposed) {
  19806. this.ui.removeFromParent();
  19807. this.ui.dispose();
  19808. }
  19809. }
  19810. setParent(parent) {
  19811. parent.addChild(this.ui);
  19812. }
  19813. setPos(x, y) {
  19814. this.ui.x = x;
  19815. this.ui.y = y;
  19816. }
  19817. setUrl(index) {
  19818. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  19819. }
  19820. }
  19821. class UILevelProp$1 extends UIBase {
  19822. constructor() {
  19823. super();
  19824. this.firstPos = 385;
  19825. this.secondPos = 467;
  19826. this.showItemArr = [];
  19827. }
  19828. onFontLoaded() {
  19829. try {
  19830. this.ui.myNode.conditionTxt.font = "arial";
  19831. console.log("zh: onFontLoaded 设置arial字体成功");
  19832. }
  19833. catch (error) {
  19834. console.log("zh: constructor onFontLoaded加载arial字体失败");
  19835. }
  19836. }
  19837. onConstructor() {
  19838. this.ui = ui_UILevelProp.createInstance();
  19839. this.contentPane = this.ui;
  19840. this.isEject = false;
  19841. this.addUIClick(this.ui.closeBtn, this.hide);
  19842. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19843. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  19844. }
  19845. show(level) {
  19846. super.show();
  19847. this.ui.t1.play();
  19848. this.level = level;
  19849. this.data = cfgTable.placeballData[this.level];
  19850. this.updateSelf();
  19851. this.showPreView();
  19852. this.moneyNode.ui.c1.selectedIndex = 2;
  19853. this.moneyNode.checkPowerTime();
  19854. this.moneyNode.powerChange();
  19855. }
  19856. showPreView() {
  19857. let item;
  19858. let data;
  19859. for (let index = 0; index < this.showItemArr.length; index++) {
  19860. item = this.showItemArr[index];
  19861. item.destroySelf();
  19862. }
  19863. this.showItemArr = [];
  19864. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  19865. for (const key in cfgData) {
  19866. data = cfgData[key];
  19867. item = new ShowItem$1();
  19868. item.setParent(this.ui.myNode.displayRoot);
  19869. item.setPos(data.x, data.y);
  19870. item.setUrl(data.value);
  19871. this.showItemArr.push(item);
  19872. }
  19873. }
  19874. updateSelf() {
  19875. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  19876. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  19877. if (this.data.ball == -1) {
  19878. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  19879. }
  19880. else {
  19881. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  19882. }
  19883. let localData = DataMgr.getPlaceBallLevel(this.level);
  19884. let getAward = localData.getAward;
  19885. let cfg = cfgTable.placeballData[this.level];
  19886. let coin = this.data.award[0];
  19887. let diamond = this.data.award[1];
  19888. if (cfg.type == PlaceBallType.challenge) {
  19889. diamond = 0;
  19890. coin = 100;
  19891. }
  19892. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  19893. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  19894. this.ui.myNode.coinNode.numTxt.text = coin + "";
  19895. if (cfg.type == PlaceBallType.challenge) {
  19896. this.ui.myNode.coinNode.numTxt.text = "";
  19897. }
  19898. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  19899. if (coin > 0 && diamond > 0) {
  19900. this.ui.myNode.diamondNode.x = 385;
  19901. this.ui.myNode.coinNode.x = 467;
  19902. }
  19903. else {
  19904. this.ui.myNode.diamondNode.x = 385;
  19905. this.ui.myNode.coinNode.x = 385;
  19906. }
  19907. if (!getAward) {
  19908. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  19909. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  19910. }
  19911. else {
  19912. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  19913. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  19914. }
  19915. }
  19916. startGame() {
  19917. if (DataMgr.powerEnough()) {
  19918. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  19919. this.ui.myNode.startBtn.touchable = false;
  19920. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19921. console.log('zh:startGame ');
  19922. this.ui.myNode.startBtn.touchable = true;
  19923. DataMgr.setPower(-1);
  19924. xGame.eventMgr.event(POWER_TIME);
  19925. xGame.common.gameMode = GameMode.placeBall;
  19926. xGame.common.placeBallCurLevel = this.level;
  19927. xGame.uiMgr.Show(UIGame$1);
  19928. this.logEventForChallenge_level_start(this.level);
  19929. xGame.uiMgr.Hide(UILevelDisplay$1);
  19930. xGame.uiMgr.Hide(UIMain$1);
  19931. this.hide();
  19932. }));
  19933. }
  19934. else {
  19935. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  19936. xGame.uiMgr.Show(UIPower$1);
  19937. }
  19938. }
  19939. logEventForChallenge_level_start(level) {
  19940. let keyStr = 'sjmd_challenge_level_start';
  19941. let jsonStr = {
  19942. "count": 1,
  19943. "gold_balance ": DataMgr.getCoin(),
  19944. "level": level,
  19945. "diamond_balance ": DataMgr.getDiamond()
  19946. };
  19947. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19948. const d = LocalStorageManager.getItem(keyStr);
  19949. if (level > d.level) {
  19950. jsonStr.count = d.count + 1;
  19951. LocalStorageManager.setItem(keyStr, jsonStr);
  19952. }
  19953. else {
  19954. }
  19955. }
  19956. else {
  19957. LocalStorageManager.setItem(keyStr, jsonStr);
  19958. }
  19959. const reqStr = JSON.stringify(jsonStr);
  19960. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  19961. }
  19962. hide() {
  19963. super.hide();
  19964. }
  19965. }
  19966. UILevelProp$1.uiName = "UILevelProp";
  19967. class PutBallLevelDisplay$1 {
  19968. constructor(ui, index) {
  19969. this.index = 0;
  19970. this.ui = ui;
  19971. this.index = index;
  19972. this.ui.onClick(this, this.clickSelf);
  19973. this.updateSelf();
  19974. this.ui.levelTxt.text = (this.index + 1) + "";
  19975. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  19976. this.ui.special.levelTxt.text = (this.index + 1) + "";
  19977. }
  19978. updateSelf() {
  19979. let level = this.index + 1;
  19980. this.data = DataMgr.getPlaceBallLevel(level);
  19981. this.ui.starNode.c1.selectedIndex = this.data.star;
  19982. let isChallenge = cfgTable.placeballData[level].type;
  19983. if (this.data.isCur) {
  19984. if (isChallenge) {
  19985. this.ui.c1.selectedIndex = 5;
  19986. }
  19987. else {
  19988. this.ui.c1.selectedIndex = 2;
  19989. }
  19990. }
  19991. else {
  19992. if (this.data.play) {
  19993. if (this.data.star == 3) {
  19994. this.ui.c1.selectedIndex = 0;
  19995. }
  19996. else {
  19997. this.ui.c1.selectedIndex = 1;
  19998. }
  19999. }
  20000. else {
  20001. if (isChallenge) {
  20002. this.ui.c1.selectedIndex = 4;
  20003. }
  20004. else {
  20005. this.ui.c1.selectedIndex = 3;
  20006. }
  20007. }
  20008. }
  20009. }
  20010. clickSelf() {
  20011. if (!this.data.play)
  20012. return;
  20013. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20014. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20015. }
  20016. }
  20017. class UILevelDisplay$1 extends UIBase {
  20018. constructor() {
  20019. super();
  20020. }
  20021. onConstructor() {
  20022. this.ui = ui_UILevelDisplay.createInstance();
  20023. this.contentPane = this.ui;
  20024. this.isEject = false;
  20025. this.myList = this.ui.myNode.myList;
  20026. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20027. this.levelItemArr = [];
  20028. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20029. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20030. this.myList.numItems = levelNum;
  20031. if (Moyu.isKs)
  20032. this.ui.closeNode.closeBtn.x += 100;
  20033. }
  20034. levelItemRender(index, target) {
  20035. let item = new PutBallLevelDisplay$1(target, index);
  20036. this.levelItemArr.push(item);
  20037. }
  20038. show() {
  20039. super.show();
  20040. this.updateLevel();
  20041. this.scrollToPlace();
  20042. }
  20043. updateLevel() {
  20044. let temp;
  20045. for (let index = 0; index < this.levelItemArr.length; index++) {
  20046. temp = this.levelItemArr[index];
  20047. temp.updateSelf();
  20048. }
  20049. }
  20050. scrollToPlace() {
  20051. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20052. let passArr = DataMgr.getPlaceBallLevelList();
  20053. let offest = passArr.length;
  20054. if (offest >= maxNum - 1)
  20055. offest = maxNum - 1;
  20056. this.myList.scrollToView(offest, true, true);
  20057. }
  20058. hide() {
  20059. super.hide();
  20060. }
  20061. }
  20062. UILevelDisplay$1.uiName = "UILevelDisplay";
  20063. class UIMatching$1 extends UIBase {
  20064. constructor() {
  20065. super();
  20066. }
  20067. onConstructor() {
  20068. this.ui = ui_UIMatching.createInstance();
  20069. this.contentPane = this.ui;
  20070. this.isEject = false;
  20071. }
  20072. show(callback) {
  20073. super.show();
  20074. PlatMgr.showBanner(true);
  20075. this.callback = callback;
  20076. let user = Moyu.getUserInfo();
  20077. if (!this.selfPot) {
  20078. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20079. }
  20080. if (!this.aiPot) {
  20081. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20082. }
  20083. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20084. this.ui.selfHead.nameTxt.text = user.nickName;
  20085. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20086. this.ui.aiHead.nameTxt.text = "???";
  20087. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20088. this.ui.selfHead.c1.selectedIndex = 0;
  20089. this.ui.aiHead.c1.selectedIndex = 0;
  20090. this.ui.selfHead.x = this.selfPot.x;
  20091. this.ui.selfHead.y = this.selfPot.y;
  20092. this.ui.aiHead.x = this.aiPot.x;
  20093. this.ui.aiHead.y = this.aiPot.y;
  20094. switch (xGame.common.gameMode) {
  20095. case GameMode.classic:
  20096. break;
  20097. case GameMode.bigMove:
  20098. this.initSkillData();
  20099. break;
  20100. default:
  20101. break;
  20102. }
  20103. this.ui.t1.play(Laya.Handler.create(this, () => {
  20104. this.ui.t2.play(Laya.Handler.create(this, () => {
  20105. switch (xGame.common.gameMode) {
  20106. case GameMode.classic:
  20107. this.waitingPeople();
  20108. break;
  20109. case GameMode.bigMove:
  20110. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  20111. break;
  20112. default:
  20113. break;
  20114. }
  20115. }));
  20116. }));
  20117. }
  20118. initSkillData() {
  20119. this.skillSelectData = [];
  20120. let skillUrl = xGame.common.skillIconList;
  20121. let skillName = xGame.common.skillNameList;
  20122. let skillLevel = DataMgr.getBigSkillList();
  20123. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  20124. for (let index = 0; index < 5; index++) {
  20125. let obj = {};
  20126. obj.skillImg = skillUrl[index];
  20127. obj.skillName = skillName[index];
  20128. obj.skillType = skillType[index];
  20129. obj.skillLevel = skillLevel[index];
  20130. this.skillSelectData.push(obj);
  20131. }
  20132. }
  20133. getAISkillLevel(myLevel) {
  20134. let video = xGame.common.upSkillLevel;
  20135. let aiLevel;
  20136. let temp;
  20137. if (video) {
  20138. temp = xGame.common.randomNum(-2, -1);
  20139. }
  20140. else {
  20141. if (myLevel <= 5) {
  20142. temp = xGame.common.randomNum(1, 3);
  20143. }
  20144. else if (myLevel <= 9) {
  20145. temp = xGame.common.randomNum(-2, 1);
  20146. }
  20147. else {
  20148. temp = xGame.common.randomNum(-4, 0);
  20149. }
  20150. }
  20151. aiLevel = temp + myLevel;
  20152. if (aiLevel <= 1)
  20153. aiLevel = 1;
  20154. if (aiLevel >= 10)
  20155. aiLevel = 10;
  20156. return aiLevel;
  20157. }
  20158. getAISkillType() {
  20159. return xGame.common.randomNum(1, 4);
  20160. let successTimes = DataMgr.getSkillSuccessTimes();
  20161. let info = cfgTable.aiskillData[successTimes];
  20162. if (!info) {
  20163. let max = Object.keys(cfgTable.aiskillData).length - 1;
  20164. info = cfgTable.aiskillData[max];
  20165. }
  20166. let dataArr = info.skillselect;
  20167. let myCfg = {};
  20168. for (let index = 0; index < dataArr.length; index++) {
  20169. let temp = dataArr[index].split('-');
  20170. myCfg[temp[0]] = {};
  20171. myCfg[temp[0]].id = parseInt(temp[0]);
  20172. myCfg[temp[0]].weight = parseInt(temp[1]);
  20173. }
  20174. let aiCfg = xGame.common.initWeight(myCfg);
  20175. let curData = xGame.common.getRandomWeightData(aiCfg);
  20176. return parseInt(curData.id);
  20177. }
  20178. getAISkillData(index) {
  20179. let myLevel = this.skillSelectData[index].skillLevel;
  20180. let aiLevel = this.getAISkillLevel(myLevel);
  20181. let aiType = this.getAISkillType() - 1;
  20182. return { aiLevel, aiType } = { aiLevel, aiType };
  20183. }
  20184. skillSelectFinish(index) {
  20185. let aiInfo = this.getAISkillData(index);
  20186. xGame.common.gameMgr.selfCurSkill = index;
  20187. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  20188. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  20189. this.ui.selfHead.c1.selectedIndex = 1;
  20190. this.ui.aiHead.c1.selectedIndex = 1;
  20191. let myData = this.skillSelectData[index];
  20192. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  20193. let guide = DataMgr.getSkillGuide();
  20194. if (guide == 0) {
  20195. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  20196. }
  20197. else {
  20198. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  20199. }
  20200. let aiData = this.skillSelectData[aiInfo.aiType];
  20201. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  20202. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  20203. this.waitingPeople();
  20204. }
  20205. waitingPeople() {
  20206. let time = xGame.common.randomNum(1000, 3000);
  20207. time += 1000;
  20208. Laya.timer.once(time, this, () => {
  20209. this.matchingSuccess();
  20210. });
  20211. }
  20212. matchingSuccess() {
  20213. let gameUI = xGame.common.gameUI;
  20214. let name = gameUI.ui.topNode.aiNameTxt.text;
  20215. let url = gameUI.ui.topNode.aiHeadLoader.url;
  20216. this.ui.aiHead.nameTxt.text = name;
  20217. this.ui.aiHead.headImg.url = url;
  20218. name = gameUI.ui.topNode.selfNameTxt.text;
  20219. url = gameUI.ui.topNode.selfHeadLoader.url;
  20220. this.ui.selfHead.nameTxt.text = name;
  20221. this.ui.selfHead.headImg.url = url;
  20222. this.ui.t3.play(Laya.Handler.create(this, () => {
  20223. this.callback && this.callback();
  20224. this.ui.t4.play(Laya.Handler.create(this, () => {
  20225. this.destroySelf();
  20226. }));
  20227. }));
  20228. }
  20229. destroySelf() {
  20230. this.callback = null;
  20231. this.skillSelectData = null;
  20232. this.selfPot = null;
  20233. this.aiPot = null;
  20234. if (!this.ui.isDisposed) {
  20235. this.ui.removeFromParent();
  20236. this.ui.dispose();
  20237. }
  20238. xGame.uiMgr.destroyUI(this);
  20239. }
  20240. }
  20241. UIMatching$1.uiName = "UIMatching";
  20242. class SkillDisplay$1 {
  20243. constructor(ui, data, uiIndex) {
  20244. this.starX = 0;
  20245. this.starY = 0;
  20246. this.index = 0;
  20247. this.ui = ui;
  20248. this.data = data;
  20249. this.index = uiIndex;
  20250. this.initSelf();
  20251. console.log('zh:SkillDisplay constructor this.skillData=', data);
  20252. }
  20253. initSelf() {
  20254. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  20255. this.ui.nameTxt.text = this.data.name;
  20256. this.ui.describeTxt.text = this.data.describe;
  20257. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  20258. this.ui.startBtn.onClick(this, this.startGame);
  20259. this.updateSelf();
  20260. }
  20261. updateSelf() {
  20262. this.checkTry();
  20263. let level = DataMgr.getBigSkillByIndex(this.index);
  20264. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  20265. }
  20266. checkTry() {
  20267. let index = this.index;
  20268. let level = DataMgr.getBigSkillByIndex(index);
  20269. if (level == null) {
  20270. DataMgr.setBigSkill(index, 1, false);
  20271. level = 1;
  20272. }
  20273. this.ui.levelTxt.text = "LV." + level;
  20274. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  20275. this.ui.tryNode.visible = true;
  20276. else
  20277. this.ui.tryNode.visible = false;
  20278. }
  20279. clickAddLevel() {
  20280. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20281. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  20282. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  20283. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  20284. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20285. }
  20286. else {
  20287. console.log('zh:AD 失败,直接发放奖励');
  20288. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20289. }
  20290. }
  20291. qjff_AD_for_skilldisplay_clickAddLevel() {
  20292. DataMgr.setBigSkill(this.data.index, 1);
  20293. this.updateSelf();
  20294. xGame.common.upSkillLevel = true;
  20295. }
  20296. startGame() {
  20297. console.log('zh:rod skill startgame');
  20298. if (this.data.index == 3) {
  20299. alert('Coming soon!');
  20300. return;
  20301. }
  20302. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20303. let needCoin = xGame.common.bigMoveNeedCoin;
  20304. xGame.common.passAwardCoin = 2000;
  20305. let guide = DataMgr.getSkillGuide();
  20306. console.log('zh:startGame guide=' + guide);
  20307. xGame.common.temSelfLevel = 0;
  20308. if (guide == 0) {
  20309. needCoin = 0;
  20310. xGame.common.temSelfLevel = 100;
  20311. }
  20312. if (DataMgr.coinEnough(needCoin)) {
  20313. DataMgr.setCoin(-needCoin);
  20314. xGame.common.curPlayerSkillType = this.index;
  20315. if (guide == 0)
  20316. xGame.common.curPlayerSkillType = 0;
  20317. console.log('zh: skilldisplay 1');
  20318. xGame.uiMgr.Show(UIGame$1);
  20319. xGame.uiMgr.Hide(UIMain$1);
  20320. xGame.uiMgr.Show(UIMatching$1, () => {
  20321. xGame.common.gameUI.ui.alpha = 1;
  20322. xGame.common.gameUI.startGame();
  20323. xGame.uiMgr.Hide(UISkill$1);
  20324. });
  20325. this.logEventForRod_start();
  20326. }
  20327. else {
  20328. console.log('zh: skilldisplay 2');
  20329. xGame.uiMgr.Show(UIAddProp$1, 0);
  20330. Moyu.sendDataEvent("AddCoinVideo");
  20331. }
  20332. }
  20333. logEventForRod_start() {
  20334. let gfmsIdx = xGame.common.curPlayerSkillType;
  20335. console.log('zh:选择的技能=' + gfmsIdx);
  20336. let gfmc = 'Skyfall Shot';
  20337. if (gfmsIdx == 0) {
  20338. gfmc = 'Skyfall Shot';
  20339. }
  20340. if (gfmsIdx == 1) {
  20341. gfmc = 'Surging break';
  20342. }
  20343. if (gfmsIdx == 2) {
  20344. gfmc = 'Frost Lock';
  20345. }
  20346. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20347. let jsonStr = {
  20348. "count": 0,
  20349. "name": gfmc
  20350. };
  20351. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20352. const d = LocalStorageManager.getItem(keyStr);
  20353. jsonStr.count = d.count + 1;
  20354. LocalStorageManager.setItem(keyStr, jsonStr);
  20355. }
  20356. else {
  20357. LocalStorageManager.setItem(keyStr, jsonStr);
  20358. }
  20359. const reqStr = JSON.stringify(jsonStr);
  20360. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  20361. }
  20362. }
  20363. class UISkill$1 extends UIBase {
  20364. constructor() {
  20365. super();
  20366. this.skillData = [];
  20367. }
  20368. onConstructor() {
  20369. this.ui = ui_UISkill.createInstance();
  20370. this.contentPane = this.ui;
  20371. this.isEject = false;
  20372. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20373. this.initSkillData();
  20374. console.log('zh:aaaaaa1111111111');
  20375. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  20376. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  20377. console.log('zh:aaaaaa22222222');
  20378. this.displayList = [];
  20379. this.ui.skillNode.skillList.numItems = 3;
  20380. this.addUIClick(this.ui, this.interuptSecretary);
  20381. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  20382. this.ui.talkNode.visible = false;
  20383. if (Moyu.isKs)
  20384. this.ui.closeNode.closeBtn.x += 100;
  20385. }
  20386. show() {
  20387. super.show();
  20388. this.playSecretaryIdle();
  20389. this.moneyNode.ui.c1.selectedIndex = 1;
  20390. Laya.timer.clearAll(this);
  20391. xGame.soundMgr.playSound("s_start");
  20392. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20393. let guide = DataMgr.getSkillGuide();
  20394. this.ui.guideNode.visible = guide == 0;
  20395. let item = this.getSkillItemByUIIndex(0);
  20396. if (guide == 0) {
  20397. item.ui.c1.selectedIndex = 1;
  20398. }
  20399. else {
  20400. item.ui.c1.selectedIndex = 0;
  20401. }
  20402. this.ui.guideNode.guideBtn.visible = guide == 0;
  20403. for (let index = 0; index < this.displayList.length; index++) {
  20404. this.displayList[index].checkTry();
  20405. }
  20406. }
  20407. getSkillItemByUIIndex(cur) {
  20408. for (let index = 0; index < this.displayList.length; index++) {
  20409. if (this.displayList[index].index == cur) {
  20410. return this.displayList[index];
  20411. }
  20412. }
  20413. }
  20414. enterGuideLevel() {
  20415. let item = this.getSkillItemByUIIndex(0);
  20416. item.startGame();
  20417. if (DataMgr.getNewUser())
  20418. Moyu.sendDataEvent("gameStart1");
  20419. }
  20420. initSkillData() {
  20421. this.skillData = [];
  20422. let nameList = xGame.common.skillNameList;
  20423. let iconList = xGame.common.skillIconList;
  20424. let describeList = [
  20425. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  20426. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  20427. "The power of frost descends—freezing the flow and taking full control of the game!"
  20428. ];
  20429. console.log('zh:initSkillData 111111111');
  20430. let data;
  20431. for (let index = 0; index < nameList.length; index++) {
  20432. data = {};
  20433. data.name = nameList[index];
  20434. data.icon = iconList[index];
  20435. data.describe = describeList[index];
  20436. data.index = index;
  20437. this.skillData.push(data);
  20438. }
  20439. }
  20440. updateSkillItem(index, target) {
  20441. if (this.displayList[index] == null) {
  20442. let uiIndex;
  20443. switch (index) {
  20444. case 0:
  20445. uiIndex = 1;
  20446. break;
  20447. case 1:
  20448. uiIndex = 0;
  20449. break;
  20450. case 2:
  20451. uiIndex = 2;
  20452. break;
  20453. case 3:
  20454. uiIndex = 3;
  20455. break;
  20456. default:
  20457. break;
  20458. }
  20459. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  20460. this.displayList.push(temp);
  20461. }
  20462. }
  20463. playSecretaryIdle() {
  20464. let parent = this.ui.secretary.displayObject;
  20465. parent.destroyChildren();
  20466. let xx = this.ui.secretary.width / 2;
  20467. let yy = this.ui.secretary.height;
  20468. let scale = xGame.common.getSecretaryScale();
  20469. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20470. xGame.common.secretary.play(data, 0, true, parent);
  20471. }
  20472. returnUIMain() {
  20473. this.hide();
  20474. xGame.common.stopGirlPop(this.ui.talkNode);
  20475. xGame.uiMgr.Show(UIMain$1);
  20476. }
  20477. interuptSecretary() {
  20478. Laya.timer.clearAll(this);
  20479. this.playSecretaryRandomSound();
  20480. }
  20481. playSecretaryRandomSound() {
  20482. if (this.isHide)
  20483. return;
  20484. let time = xGame.common.randomNum(45000, 60000);
  20485. Laya.timer.once(time, this, () => {
  20486. if (this.isHide)
  20487. return;
  20488. let index = xGame.common.randomNum(4, 7);
  20489. xGame.soundMgr.playSound("s_main0" + index);
  20490. let words = 1;
  20491. switch (index) {
  20492. case 4:
  20493. words = 5;
  20494. break;
  20495. case 5:
  20496. words = 3;
  20497. break;
  20498. case 6:
  20499. words = 6;
  20500. break;
  20501. case 7:
  20502. words = 7;
  20503. break;
  20504. default:
  20505. break;
  20506. }
  20507. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20508. this.playSecretaryRandomSound();
  20509. });
  20510. }
  20511. }
  20512. UISkill$1.uiName = "UISkill";
  20513. class UIAddProp$1 extends UIBase {
  20514. constructor() {
  20515. super();
  20516. this.curType = "";
  20517. }
  20518. onConstructor() {
  20519. this.ui = ui_UIAddProp.createInstance();
  20520. this.contentPane = this.ui;
  20521. this.isEject = false;
  20522. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20523. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  20524. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  20525. this.updateUI();
  20526. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  20527. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  20528. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  20529. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  20530. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  20531. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  20532. }
  20533. show(type) {
  20534. super.show();
  20535. this.curType = type == 0 ? "coin" : "diamond";
  20536. this.switchBtn("");
  20537. this.ui.t0.play();
  20538. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  20539. PlatMgr.showInsert(true);
  20540. }
  20541. closeSelf() {
  20542. this.hide();
  20543. }
  20544. updateUI() {
  20545. let data = cfgTable.moneyData;
  20546. let temp;
  20547. let obj;
  20548. for (const key in data) {
  20549. temp = data[key];
  20550. obj = this.ui.myNode["node" + key];
  20551. if (parseInt(key) <= 2) {
  20552. obj.diamondTxt.text = "+" + temp.num;
  20553. }
  20554. else {
  20555. obj.coinTxt.text = temp.num;
  20556. obj.diamondTxt.text = temp.get.split('_')[1];
  20557. }
  20558. }
  20559. this.updateDiamondShare();
  20560. }
  20561. updateDiamondShare() {
  20562. let data = DataMgr.getShareDiamondTimes();
  20563. if (data >= xGame.common.maxShareDiamondTimes) {
  20564. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  20565. this.ui.myNode.node1.touchable = false;
  20566. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20567. }
  20568. else {
  20569. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  20570. this.ui.myNode.node1.touchable = true;
  20571. }
  20572. }
  20573. switchBtn(type) {
  20574. if (type == "")
  20575. type = this.curType;
  20576. else {
  20577. if (this.curType == type) {
  20578. return;
  20579. }
  20580. else {
  20581. this.curType = type;
  20582. }
  20583. }
  20584. if (type == "coin") {
  20585. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  20586. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  20587. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  20588. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  20589. this.ui.myNode.c1.selectedIndex = 0;
  20590. }
  20591. else {
  20592. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  20593. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  20594. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  20595. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  20596. this.ui.myNode.c1.selectedIndex = 1;
  20597. }
  20598. }
  20599. convertCoin(index) {
  20600. let data = cfgTable.moneyData[index];
  20601. let coinNum = data.num;
  20602. let str = data.get.split('_')[1];
  20603. let needDiamond = parseInt(str);
  20604. if (DataMgr.diamondEnough(needDiamond)) {
  20605. DataMgr.setDiamond(-needDiamond);
  20606. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  20607. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  20608. }
  20609. else {
  20610. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  20611. this.switchBtn("diamond");
  20612. }
  20613. }
  20614. videoGetDiamond() {
  20615. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  20616. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  20617. }
  20618. else {
  20619. console.log('zh:AD 失败,直接发放奖励');
  20620. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  20621. }
  20622. }
  20623. qjff_AD_for_uiAddProp_videoGetDiamond() {
  20624. let num = cfgTable.moneyData[2].num;
  20625. xGame.common.playObjFlyAnim(num, Prop.diamond);
  20626. this.closeSelf();
  20627. }
  20628. videoGetCoin() {
  20629. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  20630. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  20631. }
  20632. else {
  20633. console.log('zh:AD 失败,直接发放奖励');
  20634. this.qjff_AD_for_uiAddProp_videoGetCoin();
  20635. }
  20636. }
  20637. qjff_AD_for_uiAddProp_videoGetCoin() {
  20638. xGame.common.playObjFlyAnim(2000, Prop.coin);
  20639. this.closeSelf();
  20640. }
  20641. shareGetDiamond() {
  20642. let times = DataMgr.getShareDiamondTimes();
  20643. if (times >= xGame.common.maxShareDiamondTimes) {
  20644. console.log('zh: 233333333333 maxShareDiamondTimes');
  20645. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20646. }
  20647. else {
  20648. console.log('zh:33333333333333ad');
  20649. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  20650. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  20651. }
  20652. else {
  20653. console.log('zh:AD 失败,直接发放奖励');
  20654. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  20655. }
  20656. }
  20657. }
  20658. qjff_AD_for_uiAddProp_shareGetDiamond() {
  20659. let diamond = xGame.common.randomNum(50, 100);
  20660. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  20661. DataMgr.setShareDiamondTimes(1);
  20662. this.updateDiamondShare();
  20663. }
  20664. openPutBallView() {
  20665. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  20666. let skill = xGame.uiMgr.getUI(UISkill$1);
  20667. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  20668. let uigame = xGame.uiMgr.getUI(UIGame$1);
  20669. if (end && !end.isHide) {
  20670. xGame.uiMgr.Hide(UIGameEnd$1);
  20671. xGame.uiMgr.Show(UIMain$1);
  20672. }
  20673. if (skill && !skill.isHide)
  20674. xGame.uiMgr.Hide(UISkill$1);
  20675. if (uigame && !uigame.isHide)
  20676. xGame.uiMgr.Hide(UIGame$1);
  20677. if (level && !level.isHide) {
  20678. }
  20679. else {
  20680. xGame.uiMgr.Show(UILevelDisplay$1);
  20681. }
  20682. this.closeSelf();
  20683. }
  20684. }
  20685. UIAddProp$1.uiName = "UIAddProp";
  20686. class MoneyNode$1 {
  20687. constructor(ui) {
  20688. this.leftTime = 0;
  20689. this.ui = ui;
  20690. this.ui.addCoinBtn.onClick(this, this.addCoin);
  20691. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  20692. this.ui.addPowerBtn.onClick(this, this.addPower);
  20693. this.ui.c1.selectedIndex = 1;
  20694. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  20695. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  20696. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  20697. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  20698. this.coinChange();
  20699. this.diamondChange();
  20700. this.powerChange();
  20701. }
  20702. addPower() {
  20703. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20704. xGame.uiMgr.Show(UIPower$1);
  20705. }
  20706. powerChange() {
  20707. let powerNum = DataMgr.getPower();
  20708. this.ui.powerTxt.text = powerNum + "";
  20709. }
  20710. checkPowerTime() {
  20711. let cur = new Date().getTime();
  20712. let last = DataMgr.getPowerTime();
  20713. if (last == 0) {
  20714. last = cur;
  20715. DataMgr.setPowerTime(cur);
  20716. }
  20717. let power = DataMgr.getPower();
  20718. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  20719. Laya.timer.clearAll(this);
  20720. if (power >= xGame.common.natureMaxPower) {
  20721. this.ui.powerTimeTxt.text = "";
  20722. DataMgr.setPowerTime(cur);
  20723. return;
  20724. }
  20725. if (power + offset >= xGame.common.natureMaxPower) {
  20726. DataMgr.setPower(xGame.common.natureMaxPower, false);
  20727. this.ui.powerTimeTxt.text = "";
  20728. DataMgr.setPowerTime(cur);
  20729. }
  20730. else {
  20731. if (offset > 0) {
  20732. DataMgr.setPower(offset);
  20733. DataMgr.setPowerTime(cur);
  20734. }
  20735. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  20736. this.leftTime = xGame.common.powerRecoverNum - time;
  20737. if (this.leftTime <= 0)
  20738. this.leftTime = 0;
  20739. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  20740. Laya.timer.loop(1000, this, this.updatePowerTime);
  20741. }
  20742. }
  20743. updatePowerTime() {
  20744. this.leftTime -= 1;
  20745. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  20746. if (this.leftTime <= 0) {
  20747. this.checkPowerTime();
  20748. }
  20749. }
  20750. coinChange() {
  20751. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  20752. }
  20753. diamondChange() {
  20754. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  20755. }
  20756. addCoin() {
  20757. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20758. Moyu.sendDataEvent("AddCoinBtn");
  20759. xGame.uiMgr.Show(UIAddProp$1, 0);
  20760. }
  20761. addDiamond() {
  20762. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20763. Moyu.sendDataEvent("AddDiamondBtn");
  20764. xGame.uiMgr.Show(UIAddProp$1, 1);
  20765. }
  20766. }
  20767. class SettingNode$1 {
  20768. constructor(ui) {
  20769. this.showSetting = false;
  20770. this.openSound = true;
  20771. this.openShake = true;
  20772. this.ui = ui;
  20773. this.ui.soundBtn.onClick(this, this.switchSound);
  20774. this.ui.shakeBtn.onClick(this, this.switchShake);
  20775. this.ui.xyBtn.onClick(this, this.onXy);
  20776. this.ui.clickNode.onClick(this, this.changeSetting);
  20777. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  20778. this.ui.xyBtn.visible = false;
  20779. this.ui.shakeBtn.visible = false;
  20780. }
  20781. changeSetting() {
  20782. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20783. this.showSetting = !this.showSetting;
  20784. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  20785. }
  20786. switchSound() {
  20787. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20788. this.openSound = !this.openSound;
  20789. Moyu.onSetting(this.openSound, this.openShake);
  20790. xGame.soundMgr.onSetting(this.openSound);
  20791. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  20792. }
  20793. switchShake() {
  20794. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20795. this.openShake = !this.openShake;
  20796. Moyu.onSetting(this.openSound, this.openShake);
  20797. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  20798. }
  20799. onXy() {
  20800. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20801. MoyuMgr$1.showXy(1);
  20802. }
  20803. }
  20804. class UIDraw$1 extends UIBase {
  20805. constructor() {
  20806. super();
  20807. this.curKey = 0;
  20808. }
  20809. onConstructor() {
  20810. this.ui = ui_UIDraw.createInstance();
  20811. this.contentPane = this.ui;
  20812. this.isEject = false;
  20813. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20814. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20815. this.addUIClick(this.ui.drawBtn, this.startDraw);
  20816. this.initDraw();
  20817. this.initUI();
  20818. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  20819. if (Moyu.isKs)
  20820. this.ui.closeNode.closeBtn.x += 100;
  20821. }
  20822. show() {
  20823. super.show();
  20824. this.ui.t0.play();
  20825. this.playSecretaryIdle();
  20826. this.updateDraw();
  20827. this.checkFree();
  20828. if (PlatMgr.bannerDelay > 0) {
  20829. this.ui.closeNode.closeBtn.visible = false;
  20830. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  20831. this.ui.closeNode.closeBtn.visible = true;
  20832. });
  20833. }
  20834. PlatMgr.showRateBanner();
  20835. }
  20836. hide() {
  20837. Laya.timer.clearAll(this);
  20838. super.hide();
  20839. }
  20840. checkFree() {
  20841. let isFree = DataMgr.getDailyfreeDrawTimes();
  20842. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  20843. }
  20844. initDraw() {
  20845. this.drawObj = [];
  20846. let data = cfgTable.drawData;
  20847. let temp;
  20848. let weight = 0;
  20849. for (const key in data) {
  20850. temp = data[key];
  20851. weight += temp.weight;
  20852. this.drawObj.push(weight);
  20853. }
  20854. this.allWeight = weight;
  20855. }
  20856. initUI() {
  20857. let data = cfgTable.drawData;
  20858. let temp;
  20859. let img;
  20860. let txt;
  20861. for (const key in data) {
  20862. temp = data[key];
  20863. img = this.ui.myNode.rotNode["img" + key];
  20864. txt = this.ui.myNode.rotNode["txt" + key];
  20865. img.url = xGame.common.getGameIconUrl(temp.icon);
  20866. txt.visible = true;
  20867. if (temp.award > 2) {
  20868. img.rotation = 0;
  20869. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  20870. }
  20871. else {
  20872. img.rotation = temp.rotation;
  20873. txt.text = temp.num;
  20874. }
  20875. }
  20876. }
  20877. getCurkey() {
  20878. let rand = Math.random() * this.allWeight;
  20879. let temp;
  20880. for (let index = 0; index < this.drawObj.length - 1; index++) {
  20881. temp = this.drawObj[index];
  20882. if (index == 0) {
  20883. if (rand < temp) {
  20884. return index + 1;
  20885. }
  20886. }
  20887. else {
  20888. if (rand >= temp && rand < this.drawObj[index + 1]) {
  20889. return index + 1;
  20890. }
  20891. }
  20892. }
  20893. return 2;
  20894. }
  20895. startDraw() {
  20896. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  20897. if (freeTimes > 0) {
  20898. this.beginDraw();
  20899. DataMgr.setDailyfreeDrawTimes(0);
  20900. this.checkFree();
  20901. }
  20902. else {
  20903. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  20904. }
  20905. else {
  20906. console.log('zh:AD 失败,直接发放奖励');
  20907. this.qjff_chouJiang();
  20908. }
  20909. }
  20910. }
  20911. qjff_chouJiang() {
  20912. this.beginDraw();
  20913. }
  20914. beginDraw() {
  20915. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  20916. this.ui.drawBtn.touchable = false;
  20917. this.curKey = this.getCurkey();
  20918. console.log("当前key", this.curKey);
  20919. let cell = 60;
  20920. let lap = 3;
  20921. let angle = cell * (this.curKey - 1) + lap * 360;
  20922. let target = this.ui.myNode.rotNode;
  20923. target.rotation = 0;
  20924. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  20925. console.log("旋转完成");
  20926. this.ui.drawBtn.touchable = true;
  20927. this.getAward();
  20928. }));
  20929. }
  20930. getAward() {
  20931. let data = cfgTable.drawData[this.curKey];
  20932. let temp = new AwardType();
  20933. temp.type = data.award;
  20934. temp.num = data.num;
  20935. xGame.common.getAward([temp], () => {
  20936. DataMgr.setDrawTimes(1);
  20937. this.updateDraw();
  20938. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  20939. });
  20940. }
  20941. updateDraw() {
  20942. let drawTimes = DataMgr.getDrawTimes();
  20943. let awardTimes = DataMgr.getDrawAwardTimes();
  20944. if (Math.floor(drawTimes / 3) > awardTimes) {
  20945. this.ui.extraNode.boxBtn.t0.play(null, -1);
  20946. this.ui.extraNode.boxBtn.touchable = true;
  20947. this.ui.extraNode.tipsTxt.text = "3/3";
  20948. this.ui.extraNode.barNode.width = 265;
  20949. this.getExtraAward();
  20950. }
  20951. else {
  20952. this.ui.extraNode.boxBtn.t0.stop();
  20953. this.ui.extraNode.boxBtn.touchable = false;
  20954. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  20955. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  20956. }
  20957. let data = cfgTable.drawData[1];
  20958. if (awardTimes == 0) {
  20959. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  20960. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  20961. this.ui.myNode.rotNode.img1.rotation = 0;
  20962. }
  20963. else {
  20964. let award = data.nextid;
  20965. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  20966. this.ui.myNode.rotNode.txt1.text = award[1];
  20967. this.ui.myNode.rotNode.img1.rotation = 0;
  20968. }
  20969. }
  20970. getExtraAward() {
  20971. let drawTimes = DataMgr.getDrawTimes();
  20972. let awardTimes = DataMgr.getDrawAwardTimes();
  20973. let data = cfgTable.drawData[1];
  20974. let award = new AwardType();
  20975. if (awardTimes == 0) {
  20976. award.num = data.num;
  20977. award.type = data.award;
  20978. xGame.common.getAward([award], () => {
  20979. let all = Math.floor(drawTimes / 3);
  20980. DataMgr.setDrawAwardTimes(all);
  20981. this.updateDraw();
  20982. });
  20983. }
  20984. else {
  20985. award.num = parseInt(data.nextid[1]);
  20986. award.type = parseInt(data.nextid[0]);
  20987. xGame.common.getAward([award], () => {
  20988. let all = Math.floor(drawTimes / 3);
  20989. DataMgr.setDrawAwardTimes(all);
  20990. this.updateDraw();
  20991. });
  20992. }
  20993. }
  20994. closeSelf() {
  20995. this.hide();
  20996. }
  20997. playSecretaryIdle() {
  20998. let parent = this.ui.secretary.displayObject;
  20999. parent.destroyChildren();
  21000. let xx = this.ui.secretary.width / 2;
  21001. let yy = this.ui.secretary.height;
  21002. let scale = xGame.common.getSecretaryScale();
  21003. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21004. xGame.common.secretary.play(data, 0, true, parent);
  21005. }
  21006. }
  21007. UIDraw$1.uiName = "UIDraw";
  21008. class UIRanking$1 extends UIBase {
  21009. constructor() {
  21010. super();
  21011. this.showSelf = true;
  21012. this.rankType = 1;
  21013. this.rankList = [];
  21014. this.topX = 10;
  21015. this.myIndex = this.topX + 1;
  21016. this.myStar = 0;
  21017. }
  21018. onConstructor() {
  21019. this.ui = ui_UIRanking.createInstance();
  21020. this.contentPane = this.ui;
  21021. this.isEject = false;
  21022. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21023. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21024. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21025. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21026. this.ui.myNode.myList.setVirtual();
  21027. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21028. }
  21029. show() {
  21030. super.show();
  21031. this.getPaiHangBangDataFormJosnFile();
  21032. this.updateSelf();
  21033. let self = Moyu.getUserInfo();
  21034. if (!self.isAuth) {
  21035. Moyu.initUser(this, () => {
  21036. DataMgr.upRankData();
  21037. });
  21038. }
  21039. }
  21040. getPaiHangBangDataFormJosnFile() {
  21041. const rankingList = cfgTable.paiHangBangData.list;
  21042. this.updateItemData(rankingList);
  21043. }
  21044. updateSelfItem() {
  21045. console.log('zh:Moyu.platType =' + Moyu.platType);
  21046. let self = Moyu.getUserInfo();
  21047. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21048. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21049. if (this.myIndex > this.topX) {
  21050. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21051. }
  21052. else {
  21053. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21054. }
  21055. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21056. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21057. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21058. }
  21059. updateItemData(data) {
  21060. this.myStar = xGame.common.getAllStarNum();
  21061. if (this.rankList.length < 2) {
  21062. this.rankList = data;
  21063. let self = Moyu.getUserInfo();
  21064. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21065. self.headIcon = self.headIcon;
  21066. for (let i = 0; i < data.length; i++) {
  21067. let data = this.rankList[i];
  21068. if (data.userId == self.userId) {
  21069. this.rankList.splice(i, 1);
  21070. break;
  21071. }
  21072. }
  21073. for (let i = 0; i < data.length; i++) {
  21074. let data = this.rankList[i];
  21075. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21076. this.myIndex = i + 1;
  21077. let user = { headIcon: self.headIcon, nickName: "myself" };
  21078. let ud = { user: user, data: {} };
  21079. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21080. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21081. if (Moyu.platType < 11) {
  21082. user.headIcon = self.headIcon;
  21083. user.nickName = self.nickName;
  21084. }
  21085. this.rankList.splice(i, 0, md);
  21086. break;
  21087. }
  21088. }
  21089. }
  21090. this.updateSelfItem();
  21091. this.ui.myNode.myList.numItems = this.rankList.length;
  21092. }
  21093. updateItemUI(index, obj) {
  21094. let data = this.rankList[index];
  21095. let userData = JSON.parse(data.userData).user;
  21096. obj.nameTxt.text = userData.nickName.toString();
  21097. obj.valueTxt.text = data.rankScore;
  21098. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  21099. obj.rankTxt.text = index + 1;
  21100. switch (index) {
  21101. case 0:
  21102. this.setImg(obj, 1, 0, 0);
  21103. obj.rankTxt.color = "#FFC047";
  21104. break;
  21105. case 1:
  21106. this.setImg(obj, 0, 1, 0);
  21107. obj.rankTxt.color = "#ACACAC";
  21108. break;
  21109. case 2:
  21110. this.setImg(obj, 0, 0, 1);
  21111. obj.rankTxt.color = "#D09672";
  21112. break;
  21113. default:
  21114. this.setImg(obj, 0, 0, 0);
  21115. obj.rankTxt.color = "#496FAB";
  21116. break;
  21117. }
  21118. }
  21119. setImg(obj, a, b, c) {
  21120. obj.img1.visible = a ? true : false;
  21121. obj.img2.visible = b ? true : false;
  21122. obj.img3.visible = c ? true : false;
  21123. }
  21124. changeList(type) {
  21125. this.rankType = type;
  21126. this.updateSelf();
  21127. }
  21128. changeSelfNode() {
  21129. this.showSelf = !this.showSelf;
  21130. this.updateSelf();
  21131. }
  21132. updateSelf() {
  21133. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  21134. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  21135. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21136. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  21137. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21138. }
  21139. }
  21140. UIRanking$1.uiName = "UIRanking";
  21141. class UISecretary$1 extends UIBase {
  21142. constructor() {
  21143. super();
  21144. this.curIndex = 1;
  21145. }
  21146. onConstructor() {
  21147. this.ui = ui_UISecretary.createInstance();
  21148. this.contentPane = this.ui;
  21149. this.isEject = false;
  21150. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21151. this.nodeObj = { left: null, right: null, cur: null };
  21152. this.nodeObj.cur = this.ui.myNode.gameNode3;
  21153. }
  21154. show() {
  21155. super.show();
  21156. this.ui.t0.play();
  21157. this.updateData();
  21158. }
  21159. addSecretarySpine(node, spineName) {
  21160. if (spineName == "mishu") {
  21161. if (this.secretarySpine1) {
  21162. node.displayObject.destroyChildren();
  21163. this.playWoman(this.secretarySpine1, node.displayObject);
  21164. }
  21165. else {
  21166. let spine1 = new SpineMgr("mishu", () => {
  21167. this.secretarySpine1 = spine1;
  21168. this.playWoman(this.secretarySpine1, node.displayObject);
  21169. });
  21170. }
  21171. }
  21172. else {
  21173. if (this.secretarySpine2) {
  21174. node.displayObject.destroyChildren();
  21175. this.playWoman(this.secretarySpine2, node.displayObject);
  21176. }
  21177. else {
  21178. let spine2 = new SpineMgr("xiaomishu2", () => {
  21179. this.secretarySpine2 = spine2;
  21180. this.playWoman(this.secretarySpine2, node.displayObject);
  21181. });
  21182. }
  21183. }
  21184. }
  21185. playWoman(node, parent) {
  21186. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  21187. let yy = this.ui.myNode.gameNode3.secretary.height;
  21188. let scale = 1.5;
  21189. if (node == this.secretarySpine2) {
  21190. scale = 1.2;
  21191. }
  21192. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21193. node.play(data, 0, true, parent);
  21194. }
  21195. turnLeft() {
  21196. this.curIndex--;
  21197. if (this.curIndex < 1) {
  21198. this.curIndex = 2;
  21199. }
  21200. let left = this.nodeObj.left;
  21201. let right = this.nodeObj.right;
  21202. let cur = this.nodeObj.cur;
  21203. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21204. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21205. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21206. this.updateData();
  21207. }));
  21208. this.ui.myNode.setChildIndex(right, 2);
  21209. this.nodeObj.left = cur;
  21210. this.nodeObj.right = left;
  21211. this.nodeObj.cur = right;
  21212. }
  21213. turnRight() {
  21214. this.curIndex++;
  21215. if (this.curIndex > 2) {
  21216. this.curIndex = 1;
  21217. }
  21218. let left = this.nodeObj.left;
  21219. let right = this.nodeObj.right;
  21220. let cur = this.nodeObj.cur;
  21221. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21222. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21223. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21224. this.updateData();
  21225. }));
  21226. this.ui.myNode.setChildIndex(left, 2);
  21227. this.nodeObj.left = right;
  21228. this.nodeObj.right = cur;
  21229. this.nodeObj.cur = left;
  21230. }
  21231. updateData() {
  21232. console.log('zh: updateData FFFFFFFFFF');
  21233. let data = cfgTable.secretaryshopData;
  21234. let children = this.ui.myNode._children;
  21235. let temp;
  21236. let curData;
  21237. for (let index = 0; index < children.length; index++) {
  21238. temp = children[index];
  21239. curData = data[1];
  21240. temp.heightTxt.text = curData.height;
  21241. temp.foodTxt.text = curData.food;
  21242. temp.historyTxt.text = curData.history;
  21243. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  21244. this.addSecretarySpine(temp.secretary, curData.spine);
  21245. let womanIndex = curData.id - 1;
  21246. let getWoman = DataMgr.getSecretary(womanIndex);
  21247. let curUse = DataMgr.getCurSecretary();
  21248. if (getWoman) {
  21249. if (curUse == womanIndex) {
  21250. temp.purchaseBtn.c1.selectedIndex = 1;
  21251. }
  21252. else {
  21253. temp.purchaseBtn.c1.selectedIndex = 2;
  21254. }
  21255. }
  21256. else {
  21257. temp.purchaseBtn.c1.selectedIndex = 0;
  21258. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  21259. }
  21260. temp.purchaseBtn.visible = false;
  21261. }
  21262. }
  21263. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  21264. console.log('zh: 点击了clickSecretary ');
  21265. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21266. if (getWoman) {
  21267. if (curUse != womanIndex) {
  21268. console.log();
  21269. DataMgr.setCurSecretary(womanIndex);
  21270. this.updateData();
  21271. }
  21272. }
  21273. else {
  21274. console.log('zh:点击购买了');
  21275. let need = needDiamond;
  21276. if (DataMgr.diamondEnough(need)) {
  21277. DataMgr.setDiamond(-need);
  21278. DataMgr.setSecretary(womanIndex, 1);
  21279. DataMgr.setCurSecretary(womanIndex);
  21280. this.updateData();
  21281. }
  21282. else {
  21283. xGame.uiMgr.Show(UIAddProp$1, 1);
  21284. }
  21285. }
  21286. }
  21287. closeSelf() {
  21288. this.hide();
  21289. }
  21290. }
  21291. UISecretary$1.uiName = "UISecretary";
  21292. class BallRodDisplay$1 {
  21293. constructor(ui, index) {
  21294. this.index = 0;
  21295. this.uiIndex = 0;
  21296. this.ui = ui;
  21297. this.index = index;
  21298. this.initData();
  21299. }
  21300. initData() {
  21301. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  21302. let data = cfgTable.ballrodData[this.index + 1];
  21303. this.ui.nameTxt.text = data.name;
  21304. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  21305. this.ui.levelNode.c1.selectedIndex = data.quality;
  21306. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  21307. if (data.spine) {
  21308. this.mySpine = new SpineMgr(data.spine, () => {
  21309. let xx = 150;
  21310. let yy = 70;
  21311. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  21312. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  21313. });
  21314. }
  21315. }
  21316. updateSelf() {
  21317. console.log('zh:updateSelf -------------- ');
  21318. let get = DataMgr.getBallRod(this.index);
  21319. if (get == null)
  21320. get = 1;
  21321. let curUse = DataMgr.getCurBallRod();
  21322. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21323. if (get) {
  21324. if (curUse == this.index) {
  21325. this.ui.purchaseBtn.c1.selectedIndex = 0;
  21326. }
  21327. else {
  21328. this.ui.purchaseBtn.c1.selectedIndex = 1;
  21329. }
  21330. }
  21331. else {
  21332. this.ui.purchaseBtn.c1.selectedIndex = 2;
  21333. }
  21334. }
  21335. buyBallRod() {
  21336. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21337. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  21338. switch (selectedIndex) {
  21339. case 0:
  21340. break;
  21341. case 1:
  21342. console.log('zh:点击了 USE THIS');
  21343. DataMgr.setCurBallRod(this.index);
  21344. let curUse = DataMgr.getCurBallRod();
  21345. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21346. let ui = xGame.uiMgr.getUI(UIShop$1);
  21347. ui.updateBallRod();
  21348. break;
  21349. case 2:
  21350. let data = cfgTable.ballrodData[this.index + 1];
  21351. let need = data.price;
  21352. if (DataMgr.diamondEnough(need)) {
  21353. DataMgr.setDiamond(-need);
  21354. DataMgr.setBallRod(this.index, 1);
  21355. DataMgr.setCurBallRod(this.index);
  21356. let ui = xGame.uiMgr.getUI(UIShop$1);
  21357. ui.updateBallRod();
  21358. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  21359. }
  21360. else {
  21361. xGame.uiMgr.Show(UIAddProp$1, 1);
  21362. }
  21363. break;
  21364. default:
  21365. break;
  21366. }
  21367. }
  21368. logEventForGouMaiGan(qiuGanName) {
  21369. const ev = {
  21370. value: qiuGanName
  21371. };
  21372. const jsonStr = JSON.stringify(ev);
  21373. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  21374. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  21375. }
  21376. }
  21377. class UIShop$1 extends UIBase {
  21378. constructor() {
  21379. super();
  21380. this.itemNums = 0;
  21381. }
  21382. onConstructor() {
  21383. this.ui = ui_UIShop.createInstance();
  21384. this.contentPane = this.ui;
  21385. this.isEject = false;
  21386. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21387. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21388. this.addUIClick(this.ui, this.interuptSecretary);
  21389. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  21390. this.ballRodArr = [];
  21391. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  21392. this.ui.myNode.myList.numItems = this.itemNums;
  21393. if (Moyu.isKs)
  21394. this.ui.closeNode.closeBtn.x += 100;
  21395. }
  21396. show() {
  21397. super.show();
  21398. this.playSecretaryIdle();
  21399. this.updateBallRod();
  21400. }
  21401. updateBallRod() {
  21402. for (let index = 0; index < this.ballRodArr.length; index++) {
  21403. this.ballRodArr[index].updateSelf();
  21404. }
  21405. }
  21406. renderBallRod(sort, obj) {
  21407. let index = this.getIndexBySort(sort + 1) - 1;
  21408. let ballRod = new BallRodDisplay$1(obj, index);
  21409. this.ballRodArr.push(ballRod);
  21410. }
  21411. getIndexBySort(sort) {
  21412. let object = cfgTable.ballrodData;
  21413. for (const key in object) {
  21414. if (object[key].sort == sort) {
  21415. return parseInt(key);
  21416. }
  21417. }
  21418. }
  21419. playSecretaryIdle() {
  21420. let parent = this.ui.secretary.displayObject;
  21421. parent.destroyChildren();
  21422. let xx = this.ui.secretary.width / 2;
  21423. let yy = this.ui.secretary.height;
  21424. let scale = xGame.common.getSecretaryScale();
  21425. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21426. xGame.common.secretary.play(data, 0, true, parent);
  21427. }
  21428. interuptSecretary() {
  21429. Laya.timer.clearAll(this);
  21430. this.playSecretaryRandomSound();
  21431. }
  21432. playSecretaryRandomSound() {
  21433. if (this.isHide)
  21434. return;
  21435. let time = xGame.common.randomNum(45000, 60000);
  21436. Laya.timer.once(time, this, () => {
  21437. if (this.isHide)
  21438. return;
  21439. let index = xGame.common.randomNum(4, 7);
  21440. xGame.soundMgr.playSound("s_main0" + index);
  21441. let words = 1;
  21442. switch (index) {
  21443. case 4:
  21444. words = 5;
  21445. break;
  21446. case 5:
  21447. words = 3;
  21448. break;
  21449. case 6:
  21450. words = 6;
  21451. break;
  21452. case 7:
  21453. words = 7;
  21454. break;
  21455. default:
  21456. break;
  21457. }
  21458. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21459. this.playSecretaryRandomSound();
  21460. });
  21461. }
  21462. closeSelf() {
  21463. this.hide();
  21464. }
  21465. }
  21466. UIShop$1.uiName = "UIShop";
  21467. class SignMax$1 {
  21468. constructor(ui) {
  21469. this.ui = ui;
  21470. }
  21471. updateSelf(index, sameDay, curDayIndex) {
  21472. let data = cfgTable.signData[index + 1];
  21473. this.ui.titleTxt.text = data.title;
  21474. let arr1 = data.award[0].split('-');
  21475. let arr2 = data.award[1].split('-');
  21476. let num1 = parseInt(arr1[1]);
  21477. let num2 = parseInt(arr2[1]);
  21478. this.ui.numTxt1.text = num1 + "";
  21479. this.ui.numTxt2.text = num2 + "";
  21480. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  21481. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  21482. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  21483. this.ui.numTxt1.visible = false;
  21484. }
  21485. else {
  21486. this.ui.numTxt1.visible = true;
  21487. }
  21488. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  21489. this.ui.numTxt2.visible = false;
  21490. }
  21491. else {
  21492. this.ui.numTxt2.visible = true;
  21493. }
  21494. if (index < curDayIndex) {
  21495. this.ui.c1.selectedIndex = 1;
  21496. }
  21497. else if (index == curDayIndex) {
  21498. if (sameDay) {
  21499. this.ui.c1.selectedIndex = 2;
  21500. }
  21501. else {
  21502. this.ui.c1.selectedIndex = 2;
  21503. }
  21504. }
  21505. else {
  21506. this.ui.c1.selectedIndex = 0;
  21507. }
  21508. }
  21509. }
  21510. class SignNormal$1 {
  21511. constructor(ui) {
  21512. this.ui = ui;
  21513. }
  21514. updateSelf(index, sameDay, curDayIndex) {
  21515. let data = cfgTable.signData[index + 1];
  21516. this.ui.titleTxt.text = data.title;
  21517. let arr = data.award[0].split('-');
  21518. let type = parseInt(arr[0]);
  21519. let num = parseInt(arr[1]);
  21520. this.ui.numTxt.text = num + "";
  21521. if (type > 2) {
  21522. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  21523. this.ui.myIcon.rotation = 0;
  21524. }
  21525. else {
  21526. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  21527. this.ui.myIcon.rotation = 0;
  21528. }
  21529. if (xGame.common.signAwardContainsRod(data.award)) {
  21530. this.ui.numTxt.visible = false;
  21531. }
  21532. else {
  21533. this.ui.numTxt.visible = true;
  21534. }
  21535. if (index < curDayIndex) {
  21536. this.ui.c1.selectedIndex = 1;
  21537. }
  21538. else if (index == curDayIndex) {
  21539. if (sameDay) {
  21540. this.ui.c1.selectedIndex = 2;
  21541. }
  21542. else {
  21543. this.ui.c1.selectedIndex = 2;
  21544. }
  21545. }
  21546. else {
  21547. this.ui.c1.selectedIndex = 0;
  21548. }
  21549. }
  21550. }
  21551. class UISign$1 extends UIBase {
  21552. constructor() {
  21553. super();
  21554. this.curDayIndex = 0;
  21555. this.starX = 0;
  21556. }
  21557. onConstructor() {
  21558. this.ui = ui_UISign.createInstance();
  21559. this.contentPane = this.ui;
  21560. this.isEject = false;
  21561. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21562. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21563. this.initSignItem();
  21564. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  21565. this.addUIClick(this.ui.againBtn, this.againGetAward);
  21566. }
  21567. show() {
  21568. super.show();
  21569. this.ui.t0.play();
  21570. this.playSecretaryIdle();
  21571. this.updateSign();
  21572. }
  21573. initSignItem() {
  21574. this.signArr = [];
  21575. for (let index = 0; index < 6; index++) {
  21576. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  21577. this.signArr.push(temp);
  21578. }
  21579. this.signMax = new SignMax$1(this.ui.myNode.day7);
  21580. if (Moyu.isKs)
  21581. this.ui.closeNode.closeBtn.x += 100;
  21582. }
  21583. updateSign() {
  21584. let sameDay = xGame.common.judgeSameDay();
  21585. let max = 7;
  21586. this.curDayIndex = DataMgr.getSignData();
  21587. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  21588. this.curDayIndex = 0;
  21589. if (!sameDay) {
  21590. this.ui.normalBtn.visible = true;
  21591. this.ui.tipsNode.visible = false;
  21592. this.ui.againBtn.visible = false;
  21593. }
  21594. else {
  21595. this.ui.normalBtn.visible = false;
  21596. let again = DataMgr.getExtraSign();
  21597. let isCurrency = false;
  21598. let index = this.curDayIndex;
  21599. if (index == 0)
  21600. index = 7;
  21601. let award = cfgTable.signData[index].award;
  21602. let num = award[0].split("-")[0];
  21603. if (num == "1" || num == "2")
  21604. isCurrency = true;
  21605. let showAgain = again == 0 && isCurrency;
  21606. this.ui.againBtn.visible = showAgain;
  21607. this.ui.tipsNode.visible = !showAgain;
  21608. }
  21609. for (let index = 0; index < this.signArr.length; index++) {
  21610. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  21611. }
  21612. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  21613. }
  21614. playSecretaryIdle() {
  21615. let parent = this.ui.secretary.displayObject;
  21616. parent.destroyChildren();
  21617. let xx = this.ui.secretary.width / 2;
  21618. let yy = this.ui.secretary.height;
  21619. let scale = xGame.common.getSecretaryScale();
  21620. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21621. xGame.common.secretary.play(data, 0, true, parent);
  21622. }
  21623. closeSelf() {
  21624. this.hide();
  21625. }
  21626. normalGetAward() {
  21627. let sameDay = xGame.common.judgeSameDay();
  21628. if (!sameDay) {
  21629. let award = cfgTable.signData[this.curDayIndex + 1].award;
  21630. let temp;
  21631. let type;
  21632. let num;
  21633. let arr = [];
  21634. for (let index = 0; index < award.length; index++) {
  21635. temp = award[index].split("-");
  21636. type = parseInt(temp[0]);
  21637. num = parseInt(temp[1]);
  21638. let awardType = new AwardType();
  21639. awardType.num = num;
  21640. awardType.type = type;
  21641. arr.push(awardType);
  21642. }
  21643. xGame.common.getAward(arr, (watchVideo) => {
  21644. this.curDayIndex++;
  21645. if (this.curDayIndex > 7)
  21646. this.curDayIndex = 0;
  21647. DataMgr.setSignData(this.curDayIndex);
  21648. DataMgr.setSignTime(new Date().getTime());
  21649. if (watchVideo) {
  21650. DataMgr.setExtraSign(1);
  21651. Moyu.sendDataEvent("signIn1");
  21652. }
  21653. this.updateSign();
  21654. });
  21655. }
  21656. }
  21657. againGetAward() {
  21658. Moyu.sendDataEvent("signIn2");
  21659. console.log('zh:qjff_AD_for_uisign');
  21660. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  21661. }
  21662. else {
  21663. console.log('zh:AD 失败,直接发放奖励');
  21664. this.qjff_AD_for_uisign();
  21665. }
  21666. }
  21667. qjff_AD_for_uisign() {
  21668. let index = this.curDayIndex;
  21669. if (index == 0)
  21670. index = 7;
  21671. let award = cfgTable.signData[index].award;
  21672. let temp;
  21673. let type;
  21674. let num;
  21675. for (let index = 0; index < award.length; index++) {
  21676. temp = award[index].split("-");
  21677. type = parseInt(temp[0]);
  21678. num = parseInt(temp[1]) * 3;
  21679. xGame.common.playObjFlyAnim(num, type);
  21680. }
  21681. DataMgr.setExtraSign(1);
  21682. this.updateSign();
  21683. }
  21684. }
  21685. UISign$1.uiName = "UISign";
  21686. class UIModeSelection$1 extends UIBase {
  21687. constructor() {
  21688. super();
  21689. }
  21690. onConstructor() {
  21691. this.ui = ui_UIModeSelection.createInstance();
  21692. this.contentPane = this.ui;
  21693. this.isEject = false;
  21694. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  21695. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  21696. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  21697. this.addUIClick(this.ui.closeBtn, this.hide);
  21698. this.peopleArr = [65, 990, 580];
  21699. this.peopleOffest = [5, 10, 10];
  21700. }
  21701. show(callback) {
  21702. this.updateSelf();
  21703. super.show();
  21704. this.ui.t0.play();
  21705. this.callback = callback;
  21706. }
  21707. updateSelf() {
  21708. let cfg = cfgTable.modeselectData;
  21709. for (let index = 1; index <= 3; index++) {
  21710. let node = this.ui.myNode["type" + index];
  21711. node.need.text = cfg[index].need;
  21712. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  21713. node.peopleTxt.text = this.getRandPeople(index - 1);
  21714. }
  21715. }
  21716. enterGame(type) {
  21717. console.log('zh: 进入经典模式 type: ' + type);
  21718. xGame.common.classicRoomType = type;
  21719. let cfg = cfgTable.modeselectData[type];
  21720. let need = cfg.need;
  21721. xGame.common.passAwardCoin = cfg.award;
  21722. if (DataMgr.coinEnough(need)) {
  21723. DataMgr.setCoin(-need);
  21724. this.ui.myNode["type" + type].t0.play();
  21725. Laya.timer.once(200, this, () => {
  21726. this.callback && this.callback();
  21727. });
  21728. this.logEventForClassic_start();
  21729. }
  21730. else {
  21731. Moyu.sendDataEvent("AddCoinVideo");
  21732. xGame.uiMgr.Show(UIAddProp$1, 0);
  21733. }
  21734. }
  21735. getRandPeople(index) {
  21736. let rand = this.peopleOffest[index];
  21737. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  21738. }
  21739. logEventForClassic_start() {
  21740. let rtype = xGame.common.classicRoomType;
  21741. let msmc = '';
  21742. if (rtype == 1) {
  21743. msmc = 'beginner';
  21744. }
  21745. if (rtype == 2) {
  21746. msmc = 'expert';
  21747. }
  21748. if (rtype == 3) {
  21749. msmc = 'master';
  21750. }
  21751. let keyStr = 'sjmd_classic_start_' + rtype;
  21752. let jsonStr = {
  21753. "difficulty": msmc,
  21754. "classic_count": 1,
  21755. "difficulty_count": 1
  21756. };
  21757. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21758. const d = LocalStorageManager.getItem(keyStr);
  21759. jsonStr.classic_count = d.classic_count + 1;
  21760. jsonStr.difficulty_count = d.difficulty_count + 1;
  21761. LocalStorageManager.setItem(keyStr, jsonStr);
  21762. }
  21763. else {
  21764. LocalStorageManager.setItem(keyStr, jsonStr);
  21765. }
  21766. const reqStr = JSON.stringify(jsonStr);
  21767. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  21768. }
  21769. }
  21770. UIModeSelection$1.uiName = "UIModeSelection";
  21771. class UITry$1 extends UIBase {
  21772. constructor() {
  21773. super();
  21774. this.closeTime = 0;
  21775. this.closeNum = 0;
  21776. this.skillUrl = xGame.common.skillIconList;
  21777. }
  21778. onConstructor() {
  21779. this.ui = ui_UITry.createInstance();
  21780. this.contentPane = this.ui;
  21781. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  21782. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  21783. }
  21784. show() {
  21785. super.show();
  21786. this.closeNum = 0;
  21787. this.closeTime = 15;
  21788. this.ui.t0.play();
  21789. PlatMgr.showRateBanner();
  21790. this.ui.myNode.txtTime.text = this.closeTime.toString();
  21791. Laya.timer.loop(1000, this, this.updateTime);
  21792. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  21793. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  21794. xGame.common.gameMgr.gamePause = true;
  21795. }
  21796. updateTime() {
  21797. if (this.closeTime > 1) {
  21798. this.closeTime--;
  21799. this.ui.myNode.txtTime.text = this.closeTime.toString();
  21800. }
  21801. else
  21802. this.hide();
  21803. }
  21804. hide() {
  21805. Laya.timer.clearAll(this);
  21806. Moyu.showBannerAd(false);
  21807. super.hide();
  21808. xGame.common.gameMgr.gamePause = false;
  21809. }
  21810. onTry() {
  21811. console.log('zh:qjff_AD_for_uitry');
  21812. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  21813. }
  21814. else {
  21815. console.log('zh:AD 失败,直接发放奖励');
  21816. this.qjff_AD_for_uitry();
  21817. }
  21818. }
  21819. qjff_AD_for_uitry() {
  21820. let select = xGame.common.curPlayerSkillType;
  21821. DataMgr.gameData.trySkill = select;
  21822. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  21823. DataMgr.saveGameData();
  21824. DataMgr.setBigSkill(select, 1);
  21825. xGame.showTip("Trial Successful");
  21826. this.hide();
  21827. }
  21828. onCancel() {
  21829. if (this.closeNum > 0) {
  21830. this.closeNum--;
  21831. if (this.closeNum < 2)
  21832. this.hide();
  21833. return;
  21834. }
  21835. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  21836. this.onTry();
  21837. }
  21838. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  21839. this.closeNum = 3;
  21840. }
  21841. else
  21842. this.hide();
  21843. }
  21844. }
  21845. UITry$1.uiName = "UITry";
  21846. class UIGetAward$1 extends UIBase {
  21847. constructor() {
  21848. super();
  21849. this.showTriple = true;
  21850. }
  21851. onConstructor() {
  21852. this.ui = ui_UIGetAward.createInstance();
  21853. this.contentPane = this.ui;
  21854. this.isEject = false;
  21855. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  21856. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  21857. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  21858. }
  21859. show(arr, showTriple, callback) {
  21860. super.show();
  21861. this.ui.t0.play();
  21862. this.ui.eftNode.visible = true;
  21863. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  21864. this.ui.eftNode.visible = false;
  21865. }), 1, 0, 0, 0.9);
  21866. this.awardArr = arr;
  21867. this.showTriple = showTriple;
  21868. this.callback = callback;
  21869. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  21870. this.ui.myList.numItems = arr.length;
  21871. xGame.soundMgr.playSound("getaward");
  21872. }
  21873. updateSelf(index, obj) {
  21874. let temp = this.awardArr[index];
  21875. let icon = this.getIcon(temp.type);
  21876. let str = icon;
  21877. if (temp.type > 2) {
  21878. str = "s" + icon;
  21879. }
  21880. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  21881. obj.myIcon.rotation = 0;
  21882. obj.numTxt.text = temp.num + "";
  21883. obj.numTxt.visible = temp.type > 2 ? false : true;
  21884. obj.nameTxt.text = this.getNameStr(temp.type);
  21885. }
  21886. renderItem(index, obj) {
  21887. this.updateSelf(index, obj);
  21888. }
  21889. tripleGetAward() {
  21890. console.log('zh:qjff_AD_for_uigetAward');
  21891. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  21892. }
  21893. else {
  21894. console.log('zh:AD 失败,直接发放奖励');
  21895. this.qjff_AD_for_uigetAward();
  21896. }
  21897. }
  21898. qjff_AD_for_uigetAward() {
  21899. this.getAward(3);
  21900. }
  21901. normalGetAward() {
  21902. if (PlatMgr.isMisVideo())
  21903. this.tripleGetAward();
  21904. else
  21905. this.getAward();
  21906. }
  21907. getAward(times = 1) {
  21908. this.hide();
  21909. for (let index = 0; index < this.awardArr.length; index++) {
  21910. this.awardArr[index].num *= times;
  21911. }
  21912. this.callback && this.callback(times != 1);
  21913. }
  21914. getIcon(type) {
  21915. switch (type) {
  21916. case Prop.diamond:
  21917. return "ty_zs";
  21918. case Prop.coin:
  21919. return "ty_jb";
  21920. case Prop.gan1:
  21921. return "qg1";
  21922. case Prop.gan2:
  21923. return "qg2";
  21924. case Prop.gan3:
  21925. return "qg3";
  21926. case Prop.gan4:
  21927. return "qg4";
  21928. default:
  21929. break;
  21930. }
  21931. }
  21932. getNameStr(type) {
  21933. switch (type) {
  21934. case Prop.diamond:
  21935. return "Diamond";
  21936. case Prop.coin:
  21937. return "Coins";
  21938. case Prop.gan1:
  21939. case Prop.gan2:
  21940. case Prop.gan3:
  21941. case Prop.gan4:
  21942. return cfgTable.ballrodData[type - 1].name;
  21943. default:
  21944. break;
  21945. }
  21946. }
  21947. }
  21948. UIGetAward$1.uiName = "UIGetAward";
  21949. class UIBox$1 extends UIBase {
  21950. constructor() {
  21951. super();
  21952. this.boxNum = 0;
  21953. this.boxMax = 10;
  21954. this.inAd = false;
  21955. this.isClose = false;
  21956. }
  21957. onConstructor() {
  21958. this.ui = ui_UIBox.createInstance();
  21959. this.contentPane = this.ui;
  21960. this.isEject = false;
  21961. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  21962. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  21963. Laya.timer.loop(1000, this, this.update);
  21964. }
  21965. update() {
  21966. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  21967. this.boxNum -= 1;
  21968. this.upBar();
  21969. }
  21970. }
  21971. upBar() {
  21972. if (this.boxNum > this.boxMax)
  21973. this.boxNum = this.boxMax;
  21974. this.ui.bar.value = this.boxNum * 10;
  21975. }
  21976. show() {
  21977. super.show();
  21978. this.isClose = false;
  21979. this.boxNum = 0;
  21980. this.inAd = false;
  21981. this.upBar();
  21982. this.ui.t0.play();
  21983. this.ui.closeBtn.visible = false;
  21984. Laya.timer.once(3000, this, () => {
  21985. this.ui.closeBtn.visible = true;
  21986. this.ui.bar.alpha = 1;
  21987. });
  21988. Laya.timer.once(500, this, () => {
  21989. this.ui.t1.play();
  21990. });
  21991. }
  21992. hide() {
  21993. Laya.timer.clearAll(this);
  21994. Moyu.showBannerAd(false);
  21995. super.hide();
  21996. }
  21997. onOpenBox() {
  21998. this.boxNum++;
  21999. if (this.boxNum < this.boxMax) {
  22000. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  22001. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  22002. }
  22003. }
  22004. else if (this.boxNum == this.boxMax) {
  22005. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  22006. this.ui.openBtn.c1.selectedIndex = 13;
  22007. this.inAd = true;
  22008. }
  22009. else
  22010. this.getAward();
  22011. }
  22012. else if (this.inAd) {
  22013. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  22014. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  22015. }
  22016. else {
  22017. console.log('zh:AD 失败,直接发放奖励');
  22018. this.qjff_AD_for_UIBOX_onOpenBox();
  22019. }
  22020. }
  22021. this.upBar();
  22022. }
  22023. qjff_AD_for_UIBOX_onOpenBox() {
  22024. this.getAward();
  22025. }
  22026. onCloseBox() {
  22027. if (this.isClose)
  22028. this.hide();
  22029. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  22030. this.isClose = true;
  22031. PlatMgr.showBanner(true, 0, 3000);
  22032. }
  22033. else
  22034. this.hide();
  22035. }
  22036. getAward() {
  22037. let str = "";
  22038. if (Math.random() < 0.5) {
  22039. let max = Moyu.isLegal ? 500 : 2500;
  22040. let num = xGame.tools.random(max, 500 + max);
  22041. DataMgr.setCoin(num);
  22042. str = "金币x" + num;
  22043. }
  22044. else {
  22045. let max = Moyu.isLegal ? 10 : 30;
  22046. let num = xGame.tools.random(max, 30 + max);
  22047. DataMgr.setDiamond(num);
  22048. str = "钻石x" + num;
  22049. }
  22050. xGame.showTip("恭喜获得-" + str);
  22051. this.hide();
  22052. }
  22053. }
  22054. UIBox$1.uiName = "UIBox";
  22055. class UIMain$1 extends UIBase {
  22056. constructor() {
  22057. super();
  22058. this.firstEnter = true;
  22059. }
  22060. nativeCallJs(msg) {
  22061. let t = msg;
  22062. console.log("zh: nativeCallJs 奖励开始发放:", t);
  22063. switch (t) {
  22064. case 'qjff_chouJiang':
  22065. let dui = xGame.uiMgr.getUI(UIDraw$1);
  22066. dui.qjff_chouJiang();
  22067. break;
  22068. case 'qjff_AD_for_uisign':
  22069. let dui2 = xGame.uiMgr.getUI(UISign$1);
  22070. dui2.qjff_AD_for_uisign();
  22071. break;
  22072. case 'qjff_AD_for_uitry':
  22073. let dui3 = xGame.uiMgr.getUI(UITry$1);
  22074. dui3.qjff_AD_for_uitry();
  22075. break;
  22076. case 'qjff_AD_for_uipower':
  22077. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  22078. dui4.qjff_AD_for_uipower();
  22079. break;
  22080. case 'qjff_AD_for_uigetAward':
  22081. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  22082. dui5.qjff_AD_for_uigetAward();
  22083. break;
  22084. case 'qjff_AD_for_uiGameEnd':
  22085. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  22086. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  22087. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  22088. break;
  22089. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  22090. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  22091. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  22092. break;
  22093. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  22094. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  22095. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  22096. break;
  22097. case 'qjff_AD_for_UIrepentProp_videoRegret':
  22098. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  22099. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  22100. break;
  22101. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  22102. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  22103. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  22104. break;
  22105. case 'qjff_AD_for_UIBOX_onOpenBox':
  22106. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  22107. dui11.qjff_AD_for_UIBOX_onOpenBox();
  22108. break;
  22109. case 'qjff_AD_for_UIAddCoin':
  22110. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  22111. dui12.qjff_AD_for_UIAddCoin();
  22112. break;
  22113. case '111a':
  22114. let dui14 = xGame.uiMgr.getUI(UISign$1);
  22115. dui14.qjff_AD_for_uisign();
  22116. break;
  22117. case '222a':
  22118. let dui15 = xGame.uiMgr.getUI(UISign$1);
  22119. dui15.qjff_AD_for_uisign();
  22120. break;
  22121. case '333a':
  22122. let dui16 = xGame.uiMgr.getUI(UISign$1);
  22123. dui16.qjff_AD_for_uisign();
  22124. break;
  22125. default:
  22126. console.log('zh:未知的方法名字' + t);
  22127. break;
  22128. }
  22129. }
  22130. onConstructor() {
  22131. console.log('zh: UIMain onConstructor');
  22132. this.ui = ui_UIMain.createInstance();
  22133. this.contentPane = this.ui;
  22134. this.isEject = false;
  22135. this.addEvent();
  22136. this.addClickSpine();
  22137. this.settingNode = new SettingNode$1(this.ui.settingNode);
  22138. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22139. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  22140. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  22141. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  22142. let curUse = DataMgr.getCurSecretary();
  22143. this.changeSecretary(curUse);
  22144. this.ui.talkNode.visible = false;
  22145. let guide = DataMgr.getSkillGuide();
  22146. if (xGame.common.isNewDay && guide == 1) {
  22147. xGame.common.isNewDay = false;
  22148. xGame.soundMgr.playSound("s_main01");
  22149. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22150. console.log("zh:播放小秘书每天语音");
  22151. }
  22152. this.ui.n83.visible = false;
  22153. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  22154. }
  22155. changeSecretary(curUse) {
  22156. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  22157. xGame.common.secretary && xGame.common.secretary.dispose();
  22158. this.addSecretarySpine(name);
  22159. }
  22160. addSecretarySpine(name) {
  22161. let spine = new SpineMgr(name, () => {
  22162. this.playSecretaryIdle();
  22163. });
  22164. xGame.common.secretary = spine;
  22165. }
  22166. addClickSpine() {
  22167. let clickSpine = new SpineMgr("dianji", () => {
  22168. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  22169. let parent = Laya.stage;
  22170. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  22171. clickSpine.play(data, 0, false, parent, (spine) => {
  22172. spine.destroy(true);
  22173. });
  22174. });
  22175. });
  22176. }
  22177. addEvent() {
  22178. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  22179. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  22180. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  22181. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  22182. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  22183. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  22184. this.addUIClick(this.ui, this.interuptSecretary);
  22185. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  22186. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  22187. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  22188. this.addUIClick(this.ui.shopBtn, this.openShopView);
  22189. this.addUIClick(this.ui.signBtn, this.openSignView);
  22190. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  22191. this.addUIClick(this.ui.rankBtn, this.openRanking);
  22192. }
  22193. show(showFailWords) {
  22194. super.show();
  22195. this.moneyNode.ui.c1.selectedIndex = 1;
  22196. this.playSecretaryIdle();
  22197. xGame.soundMgr.playMusic("caromhall01", 0);
  22198. Laya.timer.clearAll(this);
  22199. this.playSecretaryRandomSound();
  22200. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  22201. if (showFailWords) {
  22202. console.log('zh:uimain.ts ');
  22203. setTimeout(() => {
  22204. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  22205. let words = -1;
  22206. if (str == "s_main02") {
  22207. words = 2;
  22208. }
  22209. else {
  22210. words = 3;
  22211. }
  22212. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22213. xGame.soundMgr.playSound(str);
  22214. }, 300);
  22215. }
  22216. this.showGuide();
  22217. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  22218. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  22219. let guide = DataMgr.getSkillGuide();
  22220. if (guide == 1) {
  22221. let randTime = xGame.common.randomNum(300, 800);
  22222. if (this.firstEnter) {
  22223. console.log("zh: firstEnter");
  22224. this.firstEnter = false;
  22225. randTime += 900;
  22226. }
  22227. else {
  22228. console.log("zh: no firstEnter");
  22229. }
  22230. Laya.timer.once(randTime, this, () => {
  22231. xGame.common.autoPopUIView();
  22232. });
  22233. }
  22234. }
  22235. checkActive(show) {
  22236. }
  22237. showGuide() {
  22238. let guide = DataMgr.getSkillGuide();
  22239. this.ui.guideBtn.visible = guide == 0;
  22240. this.ui.enterGuide.visible = false;
  22241. this.ui.secretaryGuide.visible = guide == 0;
  22242. if (guide == 0) {
  22243. console.log("zh:显示引导");
  22244. xGame.soundMgr.playSound("s_guide");
  22245. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22246. }
  22247. else {
  22248. console.log("zh:不需要显示引导");
  22249. }
  22250. }
  22251. ensureSecretary() {
  22252. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  22253. this.ui.secretaryGuide.visible = false;
  22254. this.ui.enterGuide.visible = true;
  22255. this.ui.wordsNode.t0.play();
  22256. if (DataMgr.getNewUser())
  22257. Moyu.sendDataEvent("gameReady");
  22258. }
  22259. playSecretaryIdle() {
  22260. let parent = this.ui.secretary.displayObject;
  22261. parent.destroyChildren();
  22262. let xx = this.ui.secretary.width / 2;
  22263. let yy = this.ui.secretary.height;
  22264. let scale = xGame.common.getSecretaryScale();
  22265. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22266. console.log("zh:playSecretaryIdle", data);
  22267. xGame.common.secretary.play(data, 0, true, parent);
  22268. }
  22269. startGame(type) {
  22270. xGame.common.gameMode = type;
  22271. Moyu.sendDataEvent("PlayGame", { type: type });
  22272. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  22273. switch (xGame.common.gameMode) {
  22274. case GameMode.classic:
  22275. console.log('zh:进入经典模式111111111');
  22276. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  22277. let db_over_lev = DataMgr.getChallengeMode_overLev();
  22278. console.log('zh:classic db_over_lev=', db_over_lev);
  22279. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  22280. console.log('zh:判断是否可以玩该模式classic =NO');
  22281. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  22282. xGame.uiMgr.Show(UIMsg$1, tipStr);
  22283. return;
  22284. }
  22285. else {
  22286. console.log('zh:可以玩该模式classic 66666666666666');
  22287. this.beginGame();
  22288. }
  22289. }
  22290. else {
  22291. console.log('zh:不需要判断是否可以玩该classic');
  22292. let challengeTimes = DataMgr.getChallengeTimes();
  22293. if (challengeTimes == 0) {
  22294. xGame.uiMgr.Show(UIInvitation$1);
  22295. }
  22296. else {
  22297. this.beginGame();
  22298. }
  22299. break;
  22300. }
  22301. case GameMode.bigMove:
  22302. console.error('zh:bigMove check');
  22303. let guide = DataMgr.getSkillGuide();
  22304. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  22305. let db_over_lev = DataMgr.getChallengeMode_overLev();
  22306. console.log('zh:bigMove db_over_lev=', db_over_lev);
  22307. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  22308. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  22309. xGame.uiMgr.Show(UIMsg$1, tipStr);
  22310. return;
  22311. }
  22312. else {
  22313. console.log('zh:可以玩该模式 bigMove');
  22314. this.beginGame();
  22315. if (DataMgr.getNewUser())
  22316. Moyu.sendDataEvent("gameStart0");
  22317. }
  22318. }
  22319. else {
  22320. this.beginGame();
  22321. if (DataMgr.getNewUser())
  22322. Moyu.sendDataEvent("gameStart0");
  22323. }
  22324. break;
  22325. default:
  22326. console.error('zh:未知错误!!!!');
  22327. break;
  22328. }
  22329. }
  22330. beginGame(isNice = false) {
  22331. console.log('zh:beginGame ');
  22332. let guide = DataMgr.getSkillGuide();
  22333. if (guide == 1) {
  22334. console.log('zh:非新手引导,showInternAd ');
  22335. JSBridgeUtils.instance.showInternAd('beginGame');
  22336. }
  22337. else {
  22338. console.log('zh:新手引导,不显示AD ');
  22339. }
  22340. console.log('zh:beginGame 2 go');
  22341. if (xGame.common.gameMode == GameMode.classic) {
  22342. if (isNice) {
  22343. this.enterClassic();
  22344. }
  22345. else {
  22346. xGame.uiMgr.Show(UIModeSelection$1, () => {
  22347. console.log('zh:BBBBBBBBBBBBBBB');
  22348. this.enterClassic();
  22349. });
  22350. }
  22351. }
  22352. else if (xGame.common.gameMode == GameMode.bigMove) {
  22353. this.ui.enterGuide.visible = false;
  22354. xGame.uiMgr.Show(UISkill$1);
  22355. }
  22356. }
  22357. enterClassic() {
  22358. xGame.uiMgr.Show(UIGame$1);
  22359. xGame.uiMgr.Show(UIMatching$1, () => {
  22360. if (!this.isHide)
  22361. this.hide();
  22362. xGame.common.gameUI.ui.alpha = 1;
  22363. xGame.common.gameUI.startGame();
  22364. xGame.uiMgr.Hide(UIGameEnd$1);
  22365. });
  22366. }
  22367. startGlobal() {
  22368. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22369. }
  22370. startWeekly() {
  22371. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22372. }
  22373. zhouSaiMonth() {
  22374. console.log('zh: zhouSaiMonth 被调用');
  22375. }
  22376. startPlaceBall() {
  22377. xGame.uiMgr.Show(UILevelDisplay$1);
  22378. }
  22379. hide() {
  22380. console.log('zh:uimain hide ...');
  22381. super.hide();
  22382. xGame.common.stopGirlPop(this.ui.talkNode);
  22383. }
  22384. onGetUserInfo(force = false) {
  22385. if (Moyu.isWx) {
  22386. let info = Moyu.getSystemInfo();
  22387. if (info)
  22388. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  22389. }
  22390. else {
  22391. Moyu.initUser(this, this.freshUser, force);
  22392. }
  22393. if (!Moyu.hasUserInfo) {
  22394. let user = Moyu.getUserInfo();
  22395. user.headIcon = 'res/ty_touxiang.png';
  22396. }
  22397. this.freshUser();
  22398. }
  22399. freshUser() {
  22400. let user = Moyu.getUserInfo();
  22401. if (!user.isAuth) {
  22402. user.headIcon = 'res/ty_touxiang.png';
  22403. }
  22404. else
  22405. DataMgr.upRankData();
  22406. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  22407. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  22408. }
  22409. interuptSecretary() {
  22410. Laya.timer.clearAll(this);
  22411. this.playSecretaryRandomSound();
  22412. }
  22413. playSecretaryRandomSound() {
  22414. if (this.isHide)
  22415. return;
  22416. let time = xGame.common.randomNum(45000, 60000);
  22417. Laya.timer.once(time, this, () => {
  22418. if (this.isHide)
  22419. return;
  22420. let index = xGame.common.randomNum(4, 7);
  22421. xGame.soundMgr.playSound("s_main0" + index);
  22422. let words = 1;
  22423. switch (index) {
  22424. case 4:
  22425. words = 5;
  22426. break;
  22427. case 5:
  22428. words = 3;
  22429. break;
  22430. case 6:
  22431. words = 6;
  22432. break;
  22433. case 7:
  22434. words = 7;
  22435. break;
  22436. default:
  22437. break;
  22438. }
  22439. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22440. this.playSecretaryRandomSound();
  22441. });
  22442. }
  22443. openSecretaryView() {
  22444. xGame.uiMgr.Show(UISecretary$1);
  22445. Moyu.sendDataEvent("secretary");
  22446. }
  22447. openShopView() {
  22448. xGame.uiMgr.Show(UIShop$1);
  22449. }
  22450. openSignView() {
  22451. xGame.uiMgr.Show(UISign$1);
  22452. }
  22453. openDrawView() {
  22454. xGame.uiMgr.Show(UIDraw$1);
  22455. }
  22456. openRanking() {
  22457. console.log('zh:phb openRanking');
  22458. xGame.uiMgr.Show(UIRanking$1);
  22459. Moyu.sendDataEvent("rankingList");
  22460. }
  22461. }
  22462. UIMain$1.uiName = "UIMain";
  22463. function InitShader() {
  22464. }
  22465. function appInit() {
  22466. xGame.context.init(getLoadingResList(), initCallback);
  22467. }
  22468. function getLoadingResList() {
  22469. return [
  22470. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  22471. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  22472. ];
  22473. }
  22474. function getGameResList() {
  22475. return [
  22476. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  22477. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  22478. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  22479. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  22480. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  22481. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  22482. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  22483. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  22484. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  22485. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  22486. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  22487. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  22488. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  22489. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  22490. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  22491. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  22492. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  22493. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  22494. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  22495. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  22496. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  22497. ];
  22498. }
  22499. function initCallback() {
  22500. window["DataMgr"] = DataMgr;
  22501. DataMgr.Init();
  22502. Moyu.init(getPlat(), this, () => {
  22503. DataMgr.isNewDay();
  22504. PlatMgr.initConfig();
  22505. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  22506. }, true);
  22507. console.log('zh:开始sm init1 start');
  22508. xGame.soundMgr.init();
  22509. console.log('zh:开始sm init1 end');
  22510. xGame.uiMgr.init();
  22511. xGame.uiMgr.clearTempData();
  22512. xGame.uiMgr.bindFUI(fguiRes.loading);
  22513. xGame.uiMgr.Show(UILoading);
  22514. }
  22515. function loadSubRes(callback) {
  22516. var tab = ["asset", "res", "spine"];
  22517. let subDone = 0;
  22518. for (var i = 0; i < tab.length; i++) {
  22519. let sub = tab[i];
  22520. Moyu.loadSubRes(sub, (pro) => {
  22521. callback && callback(pro, false);
  22522. }).then(() => {
  22523. subDone++;
  22524. if (subDone >= tab.length)
  22525. callback && callback(1, true);
  22526. });
  22527. }
  22528. }
  22529. function enterGame() {
  22530. xGame.cfgMgr.init();
  22531. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  22532. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  22533. xGame.uiMgr.Hide(UILoading);
  22534. fgui.UIPackage.removePackage(fguiRes.loading);
  22535. xGame.uiMgr.bindFUI(fguiRes.game);
  22536. xGame.uiMgr.Show(UIMain$1);
  22537. if (DataMgr.getNewUser())
  22538. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  22539. }
  22540. function getPlat() {
  22541. let cfg = new MoyuCfg();
  22542. cfg.plat = MoyuPlat.web;
  22543. cfg.myId = 180;
  22544. cfg.myKey = '8848a885774230a4';
  22545. cfg.version = 0;
  22546. if (window.hasOwnProperty("gamebox")) {
  22547. cfg.plat = MoyuPlat.f399;
  22548. cfg.version = 0;
  22549. }
  22550. else if (window.hasOwnProperty("ks")) {
  22551. cfg.plat = MoyuPlat.ks;
  22552. cfg.version = 0;
  22553. cfg.ads.ksVideoId = '2300002254_01';
  22554. cfg.ads.ksInsertId = '2300002254_02';
  22555. }
  22556. else if (Laya.Browser.onTTMiniGame) {
  22557. cfg.plat = MoyuPlat.tt;
  22558. cfg.version = 0;
  22559. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  22560. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  22561. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  22562. }
  22563. else if (Laya.Browser.onMiniGame) {
  22564. cfg.plat = MoyuPlat.wx;
  22565. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  22566. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  22567. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  22568. }
  22569. else if (Laya.Browser.onQQMiniGame) {
  22570. cfg.plat = MoyuPlat.qq;
  22571. }
  22572. else if (Laya.Browser.onQGMiniGame) {
  22573. cfg.plat = MoyuPlat.op;
  22574. cfg.ads.opVideoId = '455502';
  22575. cfg.ads.opBannerId = '455507';
  22576. }
  22577. else if (Laya.Browser.onVVMiniGame) {
  22578. cfg.plat = MoyuPlat.vv;
  22579. cfg.version = 0;
  22580. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  22581. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  22582. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  22583. }
  22584. else if (Laya.Browser.onHWMiniGame) {
  22585. cfg.plat = MoyuPlat.hw;
  22586. }
  22587. else if (window["mz"]) {
  22588. cfg.plat = MoyuPlat.mz;
  22589. }
  22590. else {
  22591. let cfg = window['conchConfig'];
  22592. if (cfg) {
  22593. var os = cfg.getOS();
  22594. if (os == "Conch-ios") {
  22595. cfg.plat = MoyuPlat.ios;
  22596. }
  22597. else if (os == "Conch-android") {
  22598. }
  22599. }
  22600. }
  22601. return cfg;
  22602. }
  22603. class Main {
  22604. constructor() {
  22605. if (window["Laya3D"])
  22606. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  22607. else {
  22608. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  22609. this.initMain();
  22610. }
  22611. }
  22612. initMain() {
  22613. Laya["Physics"] && Laya["Physics"].enable();
  22614. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  22615. Laya.stage.scaleMode = GameConfig.scaleMode;
  22616. Laya.stage.screenMode = GameConfig.screenMode;
  22617. Laya.stage.alignV = GameConfig.alignV;
  22618. Laya.stage.alignH = GameConfig.alignH;
  22619. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  22620. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  22621. Laya.enableDebugPanel();
  22622. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  22623. Laya["PhysicsDebugDraw"].enable();
  22624. if (GameConfig.stat)
  22625. Laya.Stat.show();
  22626. Laya.alertGlobalError(true);
  22627. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  22628. }
  22629. onVersionLoaded() {
  22630. appInit();
  22631. }
  22632. }
  22633. new Main();
  22634. }());
  22635. //# sourceMappingURL=bundle.js.map